import{M as m,j as l}from"./index-e79f7aad.js";import{D as v,P as R,a as e,V as i,T as s}from"./quill.snow-e3ef0c54.js";import{P as M,a as Y}from"./index-ee5818f8.js";const I=x=>{const y=Math.ceil(x.length/2);return[x.slice(0,y),x.slice(y)]};function F({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,r,C;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:(r=d.unit)==null?void 0:r.name},h),l.jsxs(s,{style:[e.tableCell,{flex:2}],children:["  ",(C=d==null?void 0:d.warehouse)==null?void 0:C.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{F as S};
