import{b as r}from"./app-DTeOhhdM.js";const c={title:"Stock Adjustment Details",breadcrumb:"Home - Stock Adjustment View",backRoute:"stock-adjustment.index",getNumber:e=>e.reference_no,getDate:e=>e.adjustment_date,getTotalAmount:e=>0,getStatusBadge:e=>null,getApprovalStatusBadge:e=>null,summaryFields:[{label:"Reference No",value:e=>e.reference_no||"N/A"},{label:"Date",value:e=>e.adjustment_date?new Date(e.adjustment_date).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"N/A"},{label:"Warehouse/Shop",value:e=>{var a;return((a=e.warehouse)==null?void 0:a.name)||"N/A"}}],infoCards:[{title:"Stock Adjustment Info",fields:[{label:"Reference No",getValue:e=>e.reference_no||"N/A"},{label:"Date",getValue:e=>new Date(e.adjustment_date).toLocaleDateString("en-US")},{label:"Warehouse/Shop",getValue:e=>{var a;return((a=e.warehouse)==null?void 0:a.name)||"N/A"}}]}],itemsField:"details",itemsLabel:"Adjustment Items",getTableColumns:(e,a)=>{var d;const n=[{header:"Product",field:"product",sortable:!0,render:t=>{var s,u;return r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900",children:((s=t.product)==null?void 0:s.name)||t.product_name||"Unknown Product"}),((u=t.attribute)==null?void 0:u.sku)&&r.jsxs("div",{className:"text-xs text-gray-500 mt-0.5",children:["SKU: ",t.attribute.sku]})]})}},{header:"Adjust Type",field:"adjust_type",align:"center",sortable:!0,render:t=>{const s=t.adjust_type,u=s==="increase"?"bg-green-100 text-green-800":"bg-red-100 text-red-800";return r.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded ${u}`,children:s==="increase"?"Increase":"Decrease"})}},{header:"Quantity",field:"adjust_qty",align:"center",sortable:!0,render:t=>r.jsx("span",{className:"font-medium text-gray-900",children:parseFloat(t.adjust_qty||0).toFixed(2)})}];return((d=e.details)==null?void 0:d.some(t=>t.note))&&n.push({header:"Note",field:"note",render:t=>r.jsx("span",{className:"text-sm text-gray-600",children:t.note||"-"})}),n},getSortValue:(e,a)=>{var n;switch(a){case"product":return((n=e.product)==null?void 0:n.name)||e.product_name||"";case"adjust_type":return e.adjust_type||"";case"adjust_qty":return parseFloat(e.adjust_qty||0);case"note":return e.note||"";default:return""}},printConfig:null};export{c as stockAdjustmentSingleViewConfig};
