import{a as x,u as f,b as I,z as v,r as o,E as h,d as K}from"./app-DGDivIsO.js";const g=()=>{const{dayjs:u}=x();f();const{t:e}=I(),n=v(),s=o(n.meta.orderType),r=o([]),d=["user_id","warehouse_id"];h(()=>{n.meta&&n.meta.orderType?s.value=n.meta.orderType:s.value="online-orders"});const i={order_date:u().utc().format("YYYY-MM-DDTHH:mm:ssZ"),user_id:void 0,notes:"",order_status:void 0,tax_id:void 0,warehouse_id:void 0,discount:0,shipping:0,subtotal:0},l={date:void 0,payment_mode_id:void 0,amount:"",notes:""},p=[{title:"#",dataIndex:"sn"},{title:e("product.name"),dataIndex:"name"},{title:e("product.quantity"),dataIndex:"unit_quantity"},{title:e("product.unit_price"),dataIndex:"single_unit_price"},{title:e("product.discount"),dataIndex:"total_discount"},{title:e("product.tax"),dataIndex:"total_tax"},{title:e("product.subtotal"),dataIndex:"subtotal"},{title:e("common.action"),dataIndex:"action"}],m=[{title:e("product.product"),dataIndex:"product_id"},{title:e("product.quantity"),dataIndex:"quantity"},{title:e("product.unit_price"),dataIndex:"single_unit_price"},{title:e("product.discount"),dataIndex:"total_discount"},{title:e("product.tax"),dataIndex:"total_tax"},{title:e("product.subtotal"),dataIndex:"subtotal"}],c=[{key:"invoice_number",value:e("stock.invoice_number")}],a=K(()=>{var t={};return s.value=="purchases"?t={type:"purchases",langKey:"purchase",menuKey:"purchases",userType:"suppliers",permission:"purchases"}:s.value=="sales"?t={type:"sales",langKey:"sales",menuKey:"sales",userType:"customers",permission:"sales"}:s.value=="purchase-returns"?t={type:"purchase-returns",langKey:"purchase_returns",menuKey:"purchase_returns",userType:"suppliers",permission:"purchase_returns"}:s.value=="sales-returns"?t={type:"sales-returns",langKey:"sales_returns",menuKey:"sales_returns",userType:"customers",permission:"sales_returns"}:s.value=="online-orders"?t={type:"online-orders",langKey:"online_orders",menuKey:"online_orders",userType:"customers",permission:"online_orders"}:s.value=="quotations"?t={type:"quotations",langKey:"quotation",menuKey:"sales",userType:"customers",permission:"quotations"}:s.value=="stock-transfers"&&(t={type:"stock-transfers",langKey:"stock_transfer",menuKey:"stock_transfer",userType:"customers",permission:"stock_transfers"}),t}),y=()=>{var t=[{title:e("stock.invoice_number"),dataIndex:"invoice_number",sorter:!0}];a.value.type=="stock-transfers"&&t.push({title:e("stock_transfer.warehouse"),dataIndex:"warehouse",sorter:!0,sorter_field:"orders.warehouse_id"}),t.push({title:e(`${a.value.langKey}.${a.value.langKey}_date`),dataIndex:"order_date",sorter:!0}),a.value.type!="stock-transfers"&&t.push({title:e(`${a.value.langKey}.user`),dataIndex:"user_id",sorter:!0,sorter_field:"orders.user_id"}),r.value=[...t,{title:e(`${a.value.langKey}.${a.value.langKey}_status`),dataIndex:"order_status",sorter:!0},{title:e("payments.total_amount"),dataIndex:"total_amount",sorter:!0,sorter_field:"orders.total"},{title:e("payments.paid_amount"),dataIndex:"paid_amount",sorter:!0},{title:e("payments.due_amount"),dataIndex:"due_amount",sorter:!0},{title:e("payments.payment_status"),dataIndex:"payment_status",sorter:!0},{title:e("common.action"),dataIndex:"action"}]},_=[{title:e("payments.transaction_number"),dataIndex:"payment_number"},{title:e("payments.date"),dataIndex:"date"},{title:e("payments.amount"),dataIndex:"amount"},{title:e("payments.payment_mode"),dataIndex:"payment_mode_id"}];return{initData:i,initPaymentData:l,columns:r,hashableColumns:d,setupTableColumns:y,filterableColumns:c,pageObject:a,orderType:s,orderItemColumns:p,orderPaymentsColumns:_,orderItemDetailsColumns:m}};export{g as f};
