import{M as m,j as l}from"./index-ba11e6ab.js";import{D as v,P as R,a as e,b as M,V as i,T as s,c as Y}from"./index-5eb6e0e5.js";const I=x=>{const y=Math.ceil(x.length/2);return[x.slice(0,y),x.slice(y)]};function g({stockTransferOutData:x,companyData:y,locationData:t,authorizationData:b}){var n,c,o;const p=[{label:"Doc No:",value:x==null?void 0:x.code},{label:"Date:",value:m(x==null?void 0:x.date).format("DD-MM-YYYY")},{label:"From Location:",value:(n=x==null?void 0:x.from_location)==null?void 0:n.name},{label:"To Location:",value:(c=x==null?void 0:x.to_location)==null?void 0:c.name},{label:"Remarks:",value:x==null?void 0:x.description}],[H,w]=I(p);return l.jsx(v,{children:l.jsxs(R,{size:"A4",style:e.body,children:[l.jsx(M,{companyData:y,locationData:t}),l.jsx(i,{style:[e.bid,{marginTop:30}],children:l.jsx(s,{style:e.content,children:"Stock Transfer Out"})}),l.jsx(i,{style:e.tablefeilds,children:l.jsxs(i,{style:e.tableRow,children:[l.jsx(i,{style:e.column,children:H.map((d,h)=>l.jsxs(i,{style:e.itemRow,children:[l.jsx(s,{style:e.labelCell,children:d.label}),l.jsx(s,{style:e.valueCell,children:d.value})]},`left-${h}`))}),l.jsx(i,{style:e.column,children:w.map((d,h)=>l.jsxs(i,{style:e.itemRow,children:[l.jsx(s,{style:e.labelCell,children:d.label}),l.jsx(s,{style:e.valueCell,children:d.value})]},`right-${h}`))})]})}),l.jsxs(i,{style:e.table,children:[l.jsxs(i,{style:e.tableRow,children:[l.jsx(s,{style:[e.tableCellHeader,{flex:.5}],children:"SI No"}),l.jsx(s,{style:[e.tableCellHeader,{flex:2}],children:"Item"}),l.jsx(s,{style:[e.tableCellHeader,{flex:2}],children:"Quantity"}),l.jsx(s,{style:[e.tableCellHeader,{flex:1}],children:"Unit"}),l.jsx(s,{style:[e.tableCellHeader,{flex:2}],children:"Warehouse"})]}),(o=x==null?void 0:x.soitems)==null?void 0:o.map((d,h)=>{var j,C,r;return l.jsxs(i,{style:e.tableRow,wrap:!1,children:[l.jsx(s,{style:[e.tableCell,{flex:.5}],children:h+1},h),l.jsx(s,{style:[e.tableCell,{flex:2}],children:(j=d.item)==null?void 0:j.name},h),l.jsx(s,{style:[e.tableCell,{flex:2}],children:parseInt(d.qty)},h),l.jsx(s,{style:[e.tableCell,{flex:1}],children:(C=d.unit)==null?void 0:C.name},h),l.jsxs(s,{style:[e.tableCell,{flex:2}],children:["  ",(r=d==null?void 0:d.warehouse)==null?void 0:r.name]},h)]})})]}),l.jsxs(i,{style:e.table,children:[l.jsxs(i,{style:e.tableRow,children:[l.jsx(s,{style:[e.tableCellHeader,{flex:.5}],children:"SI No"}),l.jsx(s,{style:[e.tableCellHeader,{flex:.5}],children:"Level"}),l.jsx(s,{style:[e.tableCellHeader,{flex:2}],children:"Authorization By"}),l.jsx(s,{style:[e.tableCellHeader,{flex:2}],children:"Status"}),l.jsx(s,{style:[e.tableCellHeader,{flex:2}],children:"Authorized On"})]}),b==null?void 0:b.map((d,h)=>{var j;return l.jsxs(i,{style:e.tableRow,wrap:!1,children:[l.jsx(s,{style:[e.tableCell,{flex:.5}],children:h+1},h),l.jsx(s,{style:[e.tableCell,{flex:.5}],children:d.authorized_level},h),l.jsx(s,{style:[e.tableCell,{flex:2}],children:(j=d.authorized_by)==null?void 0:j.username},h),l.jsx(s,{style:[e.tableCell,{flex:2}],children:d.authorized_status_name},h),l.jsxs(s,{style:[e.tableCell,{flex:2}],children:[" ",m(d.authorized_on).format("DD-MM-YYYY - HH:mm:ss")]},h)]})})]}),l.jsx(Y,{companyData:y,selectedData:x})]})})}export{g as S};
