/*! For license information please see 12.d1b2cfaf.chunk.js.LICENSE.txt */
(this.webpackJsonpvegas=this.webpackJsonpvegas||[]).push([[12],{236:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));c(3);var s=c(308),n=c(309),i=c(5);const o=Object(s.a)((e=>({root:{width:"100%","& > * + *":{marginTop:e.spacing(2)}}})));function a(e){const t=o();return Object(i.jsx)("div",{className:t.root,children:Object(i.jsx)(n.a,{color:null!==e&&void 0!==e&&e.color?null===e||void 0===e?void 0:e.color:"secondary"})})}},250:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var s=c(249),n=c(76),i=c.n(n);function o(e){let{data:t}=e;return i()(t).isValid()?Object(s.a)(t,"dd-mm-yyyy"):t}},265:function(e,t,c){},362:function(e,t,c){"use strict";t.a=c.p+"static/media/logo2.0cf45c1c.png"},628:function(e,t,c){"use strict";c.r(t);var s=c(3),n=c(9),i=c(13),o=c(27),a=c(19),d=c(14),r=c(26),l=c(151),j=c(465);const b=j.a.div`
  border: 1px solid black;
`,x=j.a.p`
  margin: 0;
  color: #004f8c;
  font-size: 12px;
  max-width: 100%;
`,h=j.a.p`
  margin: 0;
  color: #004f8c;
  font-size: 12px;
  max-width: 50%;
`,O=j.a.h6`
  color: #004f8c;
  font-weight: 600;
  margin: 0;
`,m=j.a.h5`
  color: #004f8c;
  font-weight: 600;
  margin: 0;
`,p=j.a.div`
  flex: 0.6;
  border: 1px solid black;
`,u=j.a.div`
  flex: 0.4;
  border: 1px solid black;
`,v=j.a.h6`
  color: white;
  background-color: #004f8c;
  font-weight: 500;
  text-align: center;
  margin: 0;
  border: 1px solid black;
`,_=j.a.span`
  display: flex;
  padding: 0px;
`,f=j.a.p`
  margin: 0;
  flex: 0.25;
  font-size: 12px;
  font-weight: 600;
`,g=j.a.p`
  margin: 0;
  flex: 0.5;
  font-size: 12px;
  font-weight: 600;
`,N=j.a.p`
  margin: 0;
  flex: 0.75;
  font-size: 12px;
`,y=j.a.p`
  margin: 0;
  flex: 0.5;
  font-size: 12px;
`,I=j.a.table`
  border: 1px solid black;
  font-size: 12px;
  text-align: center;
  padding: 0;
  margin: 0;
`,S=j.a.thead`
  border: 1px solid black;
`,w=j.a.tbody`
  border: 1px solid black;
`,C=j.a.tr`
border: 1px solid black
padding:0
`,T=j.a.th`
  border: 1px solid black;
`,A=j.a.td`
  border: 1px solid black;
`,k=j.a.div`
  flex: 0.5;
  border: 1px solid black;
  padding: 0;
  margin: 0;
`,q=j.a.div`
  flex: 0.5;
  border: 1px solid black;
`,D=j.a.p`
  color: black;
  background-color: lightgray;
  font-weight: 600;
  text-align: center;
  margin: 0;
  border-bottom: 1px solid black;
  font-size: 14px;
  padding: 4px;
`;var F=c(362),E=(c(265),c(281)),G=c.n(E),R=c(250),P=c(5),$=c(386);var U=Object(d.b)((e=>({login:e.login,invoice:e.invoice,cols:e.cols.cols,customer:e.customer.customer,rows:e.rows.rows,company:e.company.company})))((function(e){var t;let{data:c,customer:i,...o}=e;const[a,d]=Object(s.useState)(!1),[r,l]=Object(s.useState)([]),[j,E]=Object(s.useState)([]),U=()=>{d(!a)};return Object(s.useEffect)((()=>{var e;null===i||void 0===i||i.map((e=>{c.customer_id==e.id&&l(e)})),null===(e=o.company)||void 0===e||e.map((e=>{c.company_id==e.id&&E(e)}))}),[]),Object(P.jsxs)("div",{className:"invoice",children:[Object(P.jsx)(n.a,{className:"btn-info p-1 mr-2",onClick:()=>{U()},children:Object(P.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})}),Object(P.jsxs)(n.t,{className:"modal-info modal-lg",isOpen:a,toggle:U,backdrop:"static",children:[Object(P.jsx)(n.w,{toggle:U,children:"View Invoice"}),Object(P.jsx)(n.u,{children:Object(P.jsxs)(b,{id:"InvoicePrint",className:"test",children:[Object(P.jsxs)("div",{className:"d-flex justify-content-between p-1",children:[Object(P.jsxs)("div",{children:[Object(P.jsxs)("div",{className:"d-flex flex-column",children:[Object(P.jsx)(O,{children:null===j||void 0===j?void 0:j.name}),"VEGA CALIBRATION AND VALIDATION SERVICES LLP"==j.name&&Object(P.jsx)(x,{className:"ml-5 pl-5",children:"(An ISO 9001:2015 Certified Company)"})]}),Object(P.jsxs)("div",{children:[Object(P.jsx)(h,{className:"space-line",children:null===j||void 0===j?void 0:j.address}),Object(P.jsxs)(x,{children:["Phone No : ",j.phone]}),Object(P.jsx)(x,{children:"Email ID : support@vegacalibrations.com"}),Object(P.jsx)(x,{children:"Website : www.vegacalibrations.com"})]})]}),Object(P.jsxs)("div",{className:"d-flex flex-column justify-content-center",children:[Object(P.jsx)(m,{className:"text-center text-uppercase",children:c.invoice_type}),Object(P.jsx)("div",{children:Object(P.jsx)("img",{src:F.a,alt:"logo",height:"100px",width:"220px"})})]})]}),Object(P.jsxs)("div",{className:"d-flex w-100",children:[i.map((e=>{var t,s,n;if(c.customer_id==e.id)return Object(P.jsxs)(p,{children:[Object(P.jsx)(v,{className:"client-h6",children:"CLIENT DETAILS"}),Object(P.jsxs)("div",{className:"p-1",children:[Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Kind Attn."}),Object(P.jsx)(N,{children:e.name})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Company Name"}),Object(P.jsx)(N,{children:null===e||void 0===e||null===(t=e.company)||void 0===t?void 0:t.name})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Company Address"}),Object(P.jsx)(N,{children:null===e||void 0===e||null===(s=e.company)||void 0===s?void 0:s.address})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Contact"}),Object(P.jsx)(N,{children:null===e||void 0===e||null===(n=e.company)||void 0===n?void 0:n.phone})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Email ID"}),Object(P.jsx)(N,{children:e.email})]})]})]},e.id)})),Object(P.jsxs)(u,{children:[Object(P.jsx)(v,{className:"client-h6",children:"INVOICE DETAILS"}),Object(P.jsxs)("div",{className:"p-1",children:[Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Invoice No."}),Object(P.jsx)(y,{children:c.invoice_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Invoice Date"}),Object(P.jsxs)(y,{children:[" ",Object(P.jsx)(R.a,{data:c.date})]})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Quotation Reference No"}),Object(P.jsx)(y,{children:c.quotation_ref})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Purchase Order No."}),Object(P.jsx)(y,{children:c.purchase_order_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Purchase Order Date"}),Object(P.jsx)(y,{children:Object(P.jsx)(R.a,{data:c.purchase_order_date})})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"GSTIN"}),Object(P.jsx)(y,{children:c.invoice_gstin})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Challan No"}),Object(P.jsx)(y,{children:c.invoice_challan})]})]})]})]}),Object(P.jsxs)(I,{className:"table table-sm",children:[Object(P.jsx)(S,{className:"client-h6",children:Object(P.jsxs)(C,{children:[Object(P.jsx)(T,{children:"Sr. No"}),Object(P.jsx)(T,{children:"Description Of Items"}),Object(P.jsx)(T,{children:"Model/Specifications"}),Object(P.jsx)(T,{children:"SAC/HSC Code"}),Object(P.jsx)(T,{children:"Qty"}),Object(P.jsx)(T,{children:"Units"}),Object(P.jsx)(T,{children:"Unit Price (INR)"}),Object(P.jsx)(T,{children:"Total Amount ( INR)"})]})}),Object(P.jsx)(w,{children:null===(t=c.invoice_details)||void 0===t?void 0:t.map(((e,t)=>Object(P.jsxs)(C,{children:[Object(P.jsx)(A,{children:t+1}),Object(P.jsx)(A,{children:e.desc}),Object(P.jsx)(A,{children:e.specs}),Object(P.jsx)(A,{children:e.hsc_code}),Object(P.jsx)(A,{children:e.qty}),Object(P.jsx)(A,{children:e.units}),Object(P.jsx)(A,{children:e.unit_price}),Object(P.jsx)(A,{width:"100",className:"text-right",children:parseFloat(e.total_amount).toFixed(2)})]},t)))})]}),Object(P.jsxs)("div",{className:"d-flex",children:[Object(P.jsxs)(k,{children:[Object(P.jsx)(D,{className:"vega-p",children:"VEGA DETAILS"}),Object(P.jsxs)("div",{className:"p-1",children:[Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"PAN No."}),Object(P.jsx)(y,{children:j.pan_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"GSTIN"}),Object(P.jsx)(y,{children:j.gstin})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"BANK"}),Object(P.jsx)(y,{children:j.bank})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"BRANCH"}),Object(P.jsx)(y,{children:j.branch})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"BENEFICIARY NAME"}),Object(P.jsx)(y,{children:j.beneficiary})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"CURRENT ACC. NO"}),Object(P.jsx)(y,{children:j.current_ac})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"RTGS/NEFT IFSC Code"}),Object(P.jsx)(y,{children:j.ifsc_code})]})]})]}),Object(P.jsx)(q,{children:Object(P.jsx)("div",{className:"",children:Object(P.jsxs)(I,{className:"table table-sm",children:[Object(P.jsx)(S,{className:"vega-p",children:Object(P.jsxs)(C,{children:[Object(P.jsx)(T,{className:"",children:"TOTAL NET AMOUNT (INR)"}),Object(P.jsxs)(T,{className:"text-right p-1",width:"100",children:[" ",Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",null===c||void 0===c?void 0:c.net_amount]})]})}),Object(P.jsxs)(w,{children:[Object(P.jsxs)("tr",{className:"text-right",children:[Object(P.jsxs)("td",{className:"test-r font-weight-bold",children:[Object(P.jsx)("span",{children:"Add : CGST @"}),Object(P.jsx)("span",{className:"ml-3 mr-3",children:"9.00%"})]}),Object(P.jsxs)("td",{className:"font-weight-bold",children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",null===c||void 0===c?void 0:c.cgst]})]}),Object(P.jsxs)("tr",{className:"text-right border-0",children:[Object(P.jsxs)("td",{className:"test-r font-weight-bold",children:[Object(P.jsxs)("span",{children:["Add : ",null===c||void 0===c?void 0:c.gst_type," @"]}),Object(P.jsx)("span",{className:"ml-3 mr-3",children:"9.00%"})]}),Object(P.jsxs)("td",{className:"font-weight-bold",children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",null===c||void 0===c?void 0:c.gst]})]}),Object(P.jsxs)(C,{className:"light-blue",children:[Object(P.jsx)(T,{style:{border:"1px solid black"},children:"TOTAL TAX AMOUNT (INR)"}),Object(P.jsxs)(T,{className:"text-right",style:{border:"1px solid black"},children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",null===c||void 0===c?void 0:c.total_tax_amount]})]}),Object(P.jsxs)(C,{children:[Object(P.jsx)(T,{className:"p-4",children:"TOTAL ORDER AMOUNT (INR)"}),Object(P.jsxs)(T,{className:"text-right pt-4 pb-4 pl-2 ",children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",null===c||void 0===c?void 0:c.total_order_amount]})]})]})]})})})]}),Object(P.jsxs)("div",{className:"test f-12 font-weight-bold p-1 pl-2",children:[Object(P.jsx)("span",{children:"Amount Chargeable (In Words) :"}),Object(P.jsxs)("span",{className:"ml-3",children:[" ",$.toWords(c.total_order_amount)," Only"]})]}),Object(P.jsxs)("div",{className:"test p-1 ",children:[Object(P.jsx)("div",{style:{color:"#4A469B",fontSize:"13px",fontWeight:"600"},children:j.name}),Object(P.jsx)("div",{children:" Signature"}),Object(P.jsx)("span",{className:"font-weight-bold f-12",children:"Authorised Signatory"})]}),Object(P.jsx)("div",{className:"f-12 font-weight-bold text-center test vega-gray",children:"THANK-YOU FOR YOUR BUSINESS WITH US."}),Object(P.jsx)("div",{className:"f-12 font-weight-bold test text-center",children:"SUBJECT TO MUMBAI JURISDICTION"}),Object(P.jsx)("div",{className:"f-12 font-weight-bold test text-center",children:"This is a Computer Generated Invoice"})]})}),Object(P.jsxs)(n.v,{children:[Object(P.jsx)(n.a,{className:"btn-warning",onClick:U,children:"Cancel"}),Object(P.jsx)(n.a,{className:"btn-danger",onClick:()=>{console.log("print"),G()({printable:"InvoicePrint",type:"html",css:"../CaseMaster/CoolRoom/FinalReport/FinalReport.css",scanStyles:!0,targetStyles:"[*]",font_size:"10pt",maxWidth:1080,honorMarginPadding:!1,style:"@page {  options: footers;  }"})},children:"Print"})]})]})]})})),z=(c.p,c(386));var L=Object(d.b)((e=>({login:e.login,invoice:e.invoice,cols:e.cols.cols,customer:e.customer.customer,rows:e.rows.rows,company:e.company.company})))((function(e){var t,c,i,o,a,d;let{toggle:r,data:l,customer:j,...E}=e;const[$,U]=Object(s.useState)([]),[L,M]=Object(s.useState)([]);return Object(s.useEffect)((()=>{var e;j.map((e=>{l.customer_id==e.id&&U(e)})),null===(e=E.company)||void 0===e||e.map((e=>{l.company_id==e.id&&M(e)}))}),[]),console.log("company",L),Object(P.jsxs)("div",{className:"invoice",children:[Object(P.jsxs)(b,{id:"InvoicePrint",className:"test",children:[Object(P.jsxs)("div",{className:"d-flex justify-content-between p-1",children:[Object(P.jsxs)("div",{children:[Object(P.jsxs)("div",{className:"",children:[Object(P.jsx)(O,{children:null===L||void 0===L?void 0:L.name}),"VEGA CALIBRATION AND VALIDATION SERVICES LLP"===L.name&&Object(P.jsx)(x,{className:"ml-5 pl-5",children:"(An ISO 9001:2015 Certified Company)"})]}),Object(P.jsxs)("div",{children:[Object(P.jsx)(h,{className:"space-line",children:null===L||void 0===L?void 0:L.address}),Object(P.jsxs)(x,{children:["Phone No : ",null===L||void 0===L?void 0:L.phone]}),Object(P.jsx)(x,{children:"Email ID : support@vegacalibrations.com"}),Object(P.jsx)(x,{children:"Website : www.vegacalibrations.com"})]})]}),Object(P.jsxs)("div",{className:"d-flex flex-column justify-content-center",children:[Object(P.jsx)(m,{className:"text-center text-uppercase",children:l.type_of_invoice}),Object(P.jsx)("div",{children:Object(P.jsx)("img",{src:F.a,alt:"logo",height:"100px",width:"220px"})})]})]}),Object(P.jsxs)("div",{className:"d-flex w-100",children:[j.map((e=>{var t,c,s;if(l.customer_id==e.id)return Object(P.jsxs)(p,{children:[Object(P.jsx)(v,{className:"client-h6",children:"CLIENT DETAILS"}),Object(P.jsxs)("div",{className:"p-1",children:[Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Kind Attn."}),Object(P.jsx)(N,{children:e.name})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Company Name"}),Object(P.jsx)(N,{children:null===e||void 0===e||null===(t=e.company)||void 0===t?void 0:t.name})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Company Address"}),Object(P.jsx)(N,{children:null===e||void 0===e||null===(c=e.company)||void 0===c?void 0:c.address})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Contact"}),Object(P.jsx)(N,{children:null===e||void 0===e||null===(s=e.company)||void 0===s?void 0:s.phone})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(f,{children:"Email ID"}),Object(P.jsx)(N,{children:e.email})]})]})]},e.id)})),Object(P.jsxs)(u,{children:[Object(P.jsx)(v,{className:"client-h6",children:"INVOICE DETAILS"}),Object(P.jsxs)("div",{className:"p-1",children:[Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Invoice No."}),Object(P.jsx)(y,{children:l.invoice_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Invoice Date"}),Object(P.jsx)(y,{children:Object(P.jsx)(R.a,{data:l.invoice_date})})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Quotation Reference No"}),Object(P.jsx)(y,{children:l.quotation_ref_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Purchase Order No."}),Object(P.jsx)(y,{children:l.purchase_order_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Purchase Order Date"}),Object(P.jsx)(y,{children:Object(P.jsx)(R.a,{data:l.purchase_order_date})})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"GSTIN"}),Object(P.jsx)(y,{children:l.inv_gstin})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"Challan No"}),Object(P.jsx)(y,{children:l.challan_no})]})]})]})]}),Object(P.jsxs)(I,{className:"table table-sm",children:[Object(P.jsx)(S,{className:"client-h6",children:Object(P.jsxs)(C,{children:[Object(P.jsx)(T,{children:"Sr. No"}),Object(P.jsx)(T,{children:"Description Of Items"}),Object(P.jsx)(T,{children:"Model/Specifications"}),Object(P.jsx)(T,{children:"SAC/HSC Code"}),Object(P.jsx)(T,{children:"Qty"}),Object(P.jsx)(T,{children:"Units"}),Object(P.jsx)(T,{children:"Unit Price (INR)"}),Object(P.jsx)(T,{children:"Total Amount ( INR)"})]})}),Object(P.jsx)(w,{children:null===(t=l.details)||void 0===t?void 0:t.map(((e,t)=>Object(P.jsxs)(C,{children:[Object(P.jsx)(A,{children:t+1}),Object(P.jsx)(A,{children:e.desc}),Object(P.jsx)(A,{children:e.specs}),Object(P.jsx)(A,{children:e.hsc_code}),Object(P.jsx)(A,{children:e.qty}),Object(P.jsx)(A,{children:e.units}),Object(P.jsx)(A,{children:e.unit_price}),Object(P.jsx)(A,{width:"100",className:"text-right",children:parseFloat(e.total_amount).toFixed(2)})]},t)))})]}),Object(P.jsxs)("div",{className:"d-flex",children:[Object(P.jsxs)(k,{children:[Object(P.jsx)(D,{className:"vega-p",children:"VEGA DETAILS"}),Object(P.jsxs)("div",{className:"p-1",children:[Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"PAN No."}),Object(P.jsx)(y,{children:L.pan_no})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"GSTIN"}),Object(P.jsx)(y,{children:L.gstin})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"BANK"}),Object(P.jsx)(y,{children:L.bank})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"BRANCH"}),Object(P.jsx)(y,{children:L.branch})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"BENEFICIARY NAME"}),Object(P.jsx)(y,{children:L.beneficiary})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"CURRENT ACC. NO"}),Object(P.jsx)(y,{children:L.current_ac})]}),Object(P.jsxs)(_,{children:[Object(P.jsx)(g,{children:"RTGS/NEFT IFSC Code"}),Object(P.jsx)(y,{children:L.ifsc_code})]})]})]}),Object(P.jsx)(q,{children:Object(P.jsx)("div",{className:"",children:Object(P.jsxs)(I,{className:"table table-sm",children:[Object(P.jsx)(S,{className:"vega-p",children:Object(P.jsxs)(C,{children:[Object(P.jsx)(T,{className:"",children:"TOTAL NET AMOUNT (INR)"}),Object(P.jsxs)(T,{className:"text-right p-1",width:"100",children:[" ",Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",parseFloat(null===(c=l.details)||void 0===c?void 0:c.reduce((function(e,t){return e+t.total_amount}),0)).toFixed(2)]})]})}),Object(P.jsxs)(w,{children:[Object(P.jsxs)("tr",{className:"text-right",children:[Object(P.jsxs)("td",{className:"test-r font-weight-bold",children:[Object(P.jsx)("span",{children:"Add : CGST @"}),Object(P.jsx)("span",{className:"ml-3 mr-3",children:"9.00%"})]}),Object(P.jsxs)("td",{className:"font-weight-bold",children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",parseFloat(null===(i=l.details)||void 0===i?void 0:i.reduce((function(e,t){return e+t.cgst}),0)).toFixed(2)]})]}),Object(P.jsxs)("tr",{className:"text-right border-0",children:[Object(P.jsxs)("td",{className:"test-r font-weight-bold",children:[Object(P.jsxs)("span",{children:["Add : ",null===l||void 0===l?void 0:l.gst_type," @"]}),Object(P.jsx)("span",{className:"ml-3 mr-3",children:"9.00%"})]}),Object(P.jsxs)("td",{className:"font-weight-bold",children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",parseFloat(null===(o=l.details)||void 0===o?void 0:o.reduce((function(e,t){return e+t.sgst}),0)).toFixed(2)]})]}),Object(P.jsxs)(C,{className:"light-blue",children:[Object(P.jsx)(T,{style:{border:"1px solid black"},children:"TOTAL TAX AMOUNT (INR)"}),Object(P.jsxs)(T,{className:"text-right",style:{border:"1px solid black"},children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",parseFloat(null===(a=l.details)||void 0===a?void 0:a.reduce((function(e,t){return e+t.tax_amount}),0)).toFixed(2)]})]}),Object(P.jsxs)(C,{children:[Object(P.jsx)(T,{className:"p-4",children:"TOTAL ORDER AMOUNT (INR)"}),Object(P.jsxs)(T,{className:"text-right pt-4 pb-4 pl-2",children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",parseFloat(null===(d=l.details)||void 0===d?void 0:d.reduce((function(e,t){return e+t.order_amount}),0)).toFixed(2)]})]})]})]})})})]}),Object(P.jsxs)("div",{className:"test f-12 font-weight-bold p-1 pl-2",children:[Object(P.jsx)("span",{children:"Amount Chargeable (In Words) :"}),Object(P.jsxs)("span",{className:"ml-3",children:[" ",z.toWords(l.total_order_amount)," Only"]})]}),Object(P.jsxs)("div",{className:"test p-1",children:[Object(P.jsx)("div",{style:{color:"#4A469B",fontSize:"13px",fontWeight:"600"},children:L.name}),Object(P.jsx)("div",{children:" Signature"}),Object(P.jsx)("div",{className:"font-weight-bold f-12",children:"Authorised Signatory"})]}),Object(P.jsx)("div",{className:"f-12 font-weight-bold test text-center vega-gray",children:"THANK-YOU FOR YOUR BUSINESS WITH US."}),Object(P.jsx)("div",{className:"f-12 font-weight-bold test text-center",children:"SUBJECT TO MUMBAI JURISDICTION"}),Object(P.jsx)("div",{className:"f-12 font-weight-bold test text-center",children:"This is a Computer Generated Invoice"})]}),Object(P.jsxs)(n.v,{children:[Object(P.jsx)(n.a,{className:"btn-warning",onClick:r,children:"Cancel"}),Object(P.jsx)(n.a,{className:"btn-danger",onClick:()=>{console.log("print"),G()({printable:"InvoicePrint",type:"html",css:"../CaseMaster/CoolRoom/FinalReport/FinalReport.css",scanStyles:!0,targetStyles:"[*]",font_size:"10pt",maxWidth:1080,honorMarginPadding:!1})},children:"Print"})]})]})}));var M=Object(d.b)((e=>({login:e.login,invoice:e.invoice,cols:e.cols.cols,customer:e.customer.customer,rows:e.rows.rows,company:e.company.company})),(e=>({onCompanyGetData:t=>e(r.f(t)),onCustomerGetData:t=>e(r.g(t)),onRowsGetData:t=>e(r.jb(t)),onColsGetData:t=>e(r.e(t)),onInvoiceGetData:t=>e(r.F(t)),onDeleteInvoice:(t,c)=>e(r.r(t,c)),onPostInvoiceData:(t,c,s,n,i)=>e(r.V(t,c,s,n,i)),onUpdateInvoiceData:(t,c,s,n)=>e(r.zb(t,c,s,n)),invoiceEditGetData:t=>e(r.E(t))})))((function(e){var t,c,a,d,r,j;let b={token:`${null===(t=e.login)||void 0===t||null===(c=t.login)||void 0===c?void 0:c.token}`,id:e.data.id};const[x,h]=Object(s.useState)(!1),O=()=>{h(!x)};return console.log("props.data",e.data),Object(P.jsxs)("div",{children:[Object(P.jsx)(n.a,{className:"btn-warning p-1",onClick:()=>{O()},children:Object(P.jsx)("i",{className:"fa fa-edit","aria-hidden":"true"})}),Object(P.jsxs)(n.t,{className:"modal-info modal-lg",isOpen:x,toggle:O,backdrop:"static",children:[Object(P.jsx)(n.w,{toggle:O,children:"Edit Invoice"}),Object(P.jsx)(n.u,{children:Object(P.jsx)(i.e,{initialValues:{company_id:e.data.company_id,customer_id:e.data.customer_id,user_id:null===(a=e.login)||void 0===a||null===(d=a.login)||void 0===d||null===(r=d.user)||void 0===r?void 0:r.id,invoice_no:e.data.invoice_no,type_of_invoice:e.data.invoice_type,invoice_date:e.data.date,quotation_ref_no:e.data.quotation_ref,purchase_order_no:e.data.purchase_order_no,purchase_order_date:e.data.purchase_order_date,inv_gstin:e.data.invoice_gstin,challan_no:e.data.invoice_challan,net_amount:e.data.net_amount,cgst:e.data.cgst,gst:e.data.gst,total_tax_amount:e.data.total_tax_amount,total_order_amount:e.data.total_order_amount,is_paid:null===(j=e.data)||void 0===j?void 0:j.is_paid,details:e.data.invoice_details,gst_type:e.data.gst_type},onSubmit:(t,c)=>{let{setSubmitting:s}=c;console.log("values in EditInvoice:",t);let n={customer_id:t.customer_id,company_id:t.company_id,user_id:t.user_id,invoice_no:t.invoice_no,invoice_type:t.type_of_invoice,date:t.invoice_date,invoice_gstin:t.inv_gstin,quotation_ref:t.quotation_ref_no,purchase_order_no:t.purchase_order_no,purchase_order_date:t.purchase_order_date,invoice_challan:t.challan_no,net_amount:t.net_amount,cgst:t.cgst,gst:t.gst,total_tax_amount:t.total_tax_amount,total_order_amount:t.total_order_amount,products:t.details,gst_type:t.gst_type};console.log("Data of Invoice:",n),e.onUpdateInvoiceData(b,n,O,s),s(!0)},children:t=>{var c,s;return Object(P.jsxs)(i.d,{children:[Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"customer_id",children:"Select Customer"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"customer_id",id:"customer_id",placeholder:"Select Customer",className:"form-control"+(t.errors.customer_id&&t.touched.customer_id?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Customer"}),null===(c=e.customer)||void 0===c?void 0:c.map((e=>Object(P.jsx)("option",{value:e.id,children:e.name})))]}),Object(P.jsx)(i.a,{name:"customer_id",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"company_id",children:"Select Company"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"company_id",id:"company_id",placeholder:"Select Company",className:"form-control"+(t.errors.company_id&&t.touched.company_id?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Company"}),null===(s=e.company)||void 0===s?void 0:s.filter((e=>1==e.internal)).map((e=>Object(P.jsx)("option",{value:e.id,children:e.name})))]}),Object(P.jsx)(i.a,{name:"company_id",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"type_of_invoice",children:"Select Invoice Type"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"type_of_invoice",id:"type_of_invoice",placeholder:"Select Invoice Type",className:"form-control"+(t.errors.type_of_invoice&&t.touched.type_of_invoice?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Invoice Type"}),Object(P.jsx)("option",{value:"Profoma Invoice",children:"Profoma Invoice"}),Object(P.jsx)("option",{value:"Tax Invoice",children:"Tax Invoice"})]}),Object(P.jsx)(i.a,{name:"type_of_invoice",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"invoice_no",children:"Invoice No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"invoice_no",id:"invoice_no",placeholder:"Enter Invoice No",className:"form-control"+(t.errors.invoice_no&&t.touched.invoice_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"invoice_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"invoice_date",children:"Invoice Date"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"date",name:"invoice_date",id:"invoice_date",placeholder:"Enter Invoice No",className:"form-control"+(t.errors.invoice_date&&t.touched.invoice_date?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"invoice_date",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"quotation_ref_no",children:"Quotation Reference No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"quotation_ref_no",id:"quotation_ref_no",placeholder:"Enter Quotation Reference No",className:"form-control"+(t.errors.quotation_ref_no&&t.touched.quotation_ref_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"quotation_ref_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"purchase_order_no",children:"Purchase Order No."}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"purchase_order_no",id:"purchase_order_no",placeholder:"Enter Purchase Order No.",className:"form-control"+(t.errors.purchase_order_no&&t.touched.purchase_order_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"purchase_order_no",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"purchase_order_date",children:"Purchase Order Date"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"date",name:"purchase_order_date",id:"purchase_order_date",placeholder:"Enter Purchase Order Date",className:"form-control"+(t.errors.purchase_order_date&&t.touched.purchase_order_date?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"purchase_order_date",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"inv_gstin",children:"Invoice GSTIN"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"inv_gstin",id:"inv_gstin",placeholder:"Enter Invoice GSTIN",className:"form-control"+(t.errors.inv_gstin&&t.touched.inv_gstin?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"inv_gstin",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"challan_no",children:"Challan No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"challan_no",id:"challan_no",placeholder:"Enter Challan No",className:"form-control"+(t.errors.challan_no&&t.touched.challan_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"challan_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsx)(n.F,{className:"form-group",children:Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"gst_type",children:"Select Gst Type"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"gst_type",id:"gst_type",placeholder:"",className:"form-control"+(t.errors.gst_type&&t.touched.gst_type?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Gst Type"}),Object(P.jsx)("option",{value:"SGST",children:"SGST"}),Object(P.jsx)("option",{value:"IGST",children:"IGST"})]}),Object(P.jsx)(i.a,{name:"gst_type",component:"div",className:"invalid-feedback"})]})]})}),Object(P.jsx)(n.F,{children:Object(P.jsx)(n.h,{md:12,children:Object(P.jsx)(i.c,{name:"details",render:e=>{var c,s,a;return Object(P.jsxs)("div",{children:[Object(P.jsx)(n.F,{}),Object(P.jsx)("div",{style:{overflow:"scroll"},children:Object(P.jsxs)(n.I,{size:"sm",className:"text-center f-12",children:[Object(P.jsx)("thead",{children:Object(P.jsxs)("tr",{children:[Object(P.jsx)("th",{children:"Sr no"}),Object(P.jsx)("th",{children:"Description Of Items"}),Object(P.jsx)("th",{children:"Model/Specifications"}),Object(P.jsx)("th",{children:"SAC/HSC Code"}),Object(P.jsx)("th",{children:"Qty"}),Object(P.jsx)("th",{children:"Units"}),Object(P.jsx)("th",{children:"Unit Price (INR)"}),Object(P.jsx)("th",{children:"Total Amount(INR)"}),Object(P.jsx)("th",{children:"Delete"})]})}),Object(P.jsxs)("tbody",{className:"text-center",children:[console.log("values",null===t||void 0===t||null===(c=t.values)||void 0===c?void 0:c.details),null===t||void 0===t||null===(s=t.values)||void 0===s||null===(a=s.details)||void 0===a?void 0:a.map(((t,c)=>{var s=Number(t.unit_price)*Number(t.qty),a=9*s/100,d=9*s/100;t.total_amount=s,t.sgst=d,t.cgst=a;var r=d+a;return t.tax_amount=r,t.order_amount=r+s,Object(P.jsxs)("tr",{className:"text-center",children:[Object(P.jsx)("td",{children:c+1}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.desc`,id:"desc",style:{width:"130px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.specs`,id:`details.${c}.specs`})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.hsc_code`,id:`details.${c}.hsc_code`,style:{width:"80px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"number",name:`details.${c}.qty`,id:`details.${c}.qty`,min:"1",style:{width:"60px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.units`,id:`details.${c}.units`,style:{width:"60px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.unit_price`,id:`details.${c}.unit_price`,style:{width:"130px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.total_amount`,id:`details.${c}.total_amount`,style:{width:"80px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(n.a,{color:"danger p-1",size:"sm",onClick:()=>e.remove(c),children:Object(P.jsx)("i",{className:"fa fa-trash"})})})]},c)})),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{style:{width:"200px"},children:"Total Net Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.net_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.total_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{children:"Add : CGST @ 9.00%"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.cgst=parseFloat(t.values.details.reduce((function(e,t){return e+t.cgst}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsxs)("td",{children:["Add : ",t.values.gst_type," @ 9.00%"]}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.gst=parseFloat(t.values.details.reduce((function(e,t){return e+t.sgst}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{children:"Total Tax Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.total_tax_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.tax_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{style:{width:"200px"},children:"Total Order Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.total_order_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.order_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]})]})]})})]})}})})}),Object(P.jsxs)(n.F,{style:{justifyContent:"center"},children:[Object(P.jsx)(n.h,{md:4,children:Object(P.jsx)(n.a,{type:"reset",color:"danger",block:!0,children:Object(P.jsx)("b",{children:"Reset"})})}),Object(P.jsx)(n.h,{md:4,children:Object(P.jsx)(n.a,{type:"submit",disabled:t.isSubmitting,color:"primary",block:!0,children:"Submit"})})]})]})}})})]})]})})),V=c(236);var B=Object(d.b)((e=>({login:e.login,invoice:e.invoice,cols:e.cols.cols,customer:e.customer.customer,rows:e.rows.rows,company:e.company.company})),(e=>({onCustomerGetData:t=>e(r.g(t)),onRowsGetData:t=>e(r.jb(t)),onColsGetData:t=>e(r.e(t)),onInvoiceGetData:t=>e(r.F(t)),onDeleteInvoice:(t,c)=>e(r.r(t,c)),onPostInvoiceData:(t,c,s)=>e(r.V(t,c,s)),onUpdateInvoiceData:(t,c,s)=>e(r.zb(t,c,s)),invoiceEditGetData:t=>e(r.E(t))})))((function(e){var t,c,d,r,j;let b={token:`${null===(t=e.login)||void 0===t||null===(c=t.login)||void 0===c?void 0:c.token}`};const[x,h]=Object(s.useState)(!1),[O,m]=Object(s.useState)(!1),p=()=>{h(!1),m(!O)};return Object(P.jsxs)("div",{children:[Object(P.jsx)(n.a,{className:"btn-success p-1 mr-2",onClick:()=>{p()},children:Object(P.jsx)("i",{className:"fa fa-angle-double-right","aria-hidden":"true"})}),Object(P.jsxs)(n.t,{className:"modal-info modal-lg",isOpen:O,toggle:p,backdrop:"static",children:[Object(P.jsx)(n.w,{toggle:p,children:"Add New Invoice"}),Object(P.jsx)(n.u,{children:Object(P.jsx)(i.e,{initialValues:{company_id:e.data.company_id,customer_id:e.data.customer_id,user_id:null===(d=e.login)||void 0===d||null===(r=d.login)||void 0===r||null===(j=r.user)||void 0===j?void 0:j.id,invoice_no:e.data.invoice_no,type_of_invoice:"",invoice_date:e.data.date,quotation_ref_no:e.data.quotation_ref,purchase_order_no:e.data.purchase_order_no,purchase_order_date:e.data.purchase_order_date,inv_gstin:e.data.invoice_gstin,challan_no:e.data.invoice_challan,row:"",net_amount:"",cgst:"",gst:"",total_tax_amount:"",total_order_amount:"",is_paid:"",gst_type:"",details:[]},onSubmit:(t,c)=>{let{setSubmitting:s}=c;console.log("values in Invoice:",t);let n={customer_id:t.customer_id,company_id:t.company_id,user_id:t.user_id,invoice_no:t.invoice_no,invoice_type:t.type_of_invoice,date:t.invoice_date,invoice_gstin:t.inv_gstin,quotation_ref:t.quotation_ref_no,purchase_order_no:t.purchase_order_no,purchase_order_date:t.purchase_order_date,invoice_challan:t.challan_no,net_amount:t.net_amount,cgst:t.cgst,gst:t.gst,total_tax_amount:t.total_tax_amount,total_order_amount:t.total_order_amount,products:t.details,gst_type:t.gst_type};console.log("Data of Invoice:",n),e.onPostInvoiceData(b,n,p,h,s),s(!0)},validationSchema:a.a().shape({company_id:a.c().required("Company is required"),customer_id:a.c().required("Customer is required"),invoice_no:a.c().required("required"),invoice_date:a.c().required("required"),type_of_invoice:a.c().required("required"),quotation_ref_no:a.c().required("required"),purchase_order_no:a.c().required("required"),purchase_order_date:a.c().required("required"),inv_gstin:a.c().required("required"),challan_no:a.c().required("required"),gst_type:a.c().required("required")}),children:t=>{var c,s;return x?Object(P.jsx)(L,{toggle:p,data:t.values,customer:e.customer}):Object(P.jsxs)(i.d,{children:[Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"customer_id",children:"Select Customer"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"customer_id",id:"customer_id",placeholder:"Select Customer",className:"form-control"+(t.errors.customer_id&&t.touched.customer_id?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Customer"}),null===(c=e.customer)||void 0===c?void 0:c.map((e=>Object(P.jsx)("option",{value:e.id,children:e.name})))]}),Object(P.jsx)(i.a,{name:"customer_id",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"company_id",children:"Select Company"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"company_id",id:"company_id",placeholder:"Select Company",className:"form-control"+(t.errors.company_id&&t.touched.company_id?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Company"}),null===(s=e.company)||void 0===s?void 0:s.filter((e=>1==e.internal)).map((e=>Object(P.jsx)("option",{value:e.id,children:e.name})))]}),Object(P.jsx)(i.a,{name:"company_id",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"type_of_invoice",children:"Select Invoice Type"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"type_of_invoice",id:"type_of_invoice",placeholder:"Select Invoice Type",className:"form-control"+(t.errors.type_of_invoice&&t.touched.type_of_invoice?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Invoice Type"}),Object(P.jsx)("option",{value:"Profoma Invoice",children:"Profoma Invoice"}),Object(P.jsx)("option",{value:"Tax Invoice",children:"Tax Invoice"})]}),Object(P.jsx)(i.a,{name:"type_of_invoice",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"invoice_no",children:"Invoice No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"invoice_no",id:"invoice_no",placeholder:"Enter Invoice No",className:"form-control"+(t.errors.invoice_no&&t.touched.invoice_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"invoice_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"invoice_date",children:"Invoice Date"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"date",name:"invoice_date",id:"invoice_date",placeholder:"Enter Invoice No",className:"form-control"+(t.errors.invoice_date&&t.touched.invoice_date?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"invoice_date",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"quotation_ref_no",children:"Quotation Reference No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"quotation_ref_no",id:"quotation_ref_no",placeholder:"Enter Quotation Reference No",className:"form-control"+(t.errors.quotation_ref_no&&t.touched.quotation_ref_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"quotation_ref_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"purchase_order_no",children:"Purchase Order No."}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"purchase_order_no",id:"purchase_order_no",placeholder:"Enter Purchase Order No.",className:"form-control"+(t.errors.purchase_order_no&&t.touched.purchase_order_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"purchase_order_no",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"purchase_order_date",children:"Purchase Order Date"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"date",name:"purchase_order_date",id:"purchase_order_date",placeholder:"Enter Purchase Order Date",className:"form-control"+(t.errors.purchase_order_date&&t.touched.purchase_order_date?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"purchase_order_date",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"inv_gstin",children:"Invoice GSTIN"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"inv_gstin",id:"inv_gstin",placeholder:"Enter Invoice GSTIN",className:"form-control"+(t.errors.inv_gstin&&t.touched.inv_gstin?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"inv_gstin",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"challan_no",children:"Challan No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"challan_no",id:"challan_no",placeholder:"Enter Challan No",className:"form-control"+(t.errors.challan_no&&t.touched.challan_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"challan_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsx)(n.F,{className:"form-group",children:Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"gst_type",children:"Select Gst Type"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"gst_type",id:"gst_type",placeholder:"",className:"form-control"+(t.errors.gst_type&&t.touched.gst_type?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Gst Type"}),Object(P.jsx)("option",{value:"SGST",children:"SGST"}),Object(P.jsx)("option",{value:"IGST",children:"IGST"})]}),Object(P.jsx)(i.a,{name:"gst_type",component:"div",className:"invalid-feedback"})]})]})}),Object(P.jsx)(n.F,{className:"form-group",children:Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"row",children:"Add Table Rows"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"number",name:"row",id:"row",placeholder:"Enter Table rows",className:"form-control"+(t.errors.row&&t.touched.row?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"row",component:"div",className:"invalid-feedback"})]})]})}),Object(P.jsx)(n.F,{children:Object(P.jsx)(n.h,{md:12,children:Object(P.jsx)(i.c,{name:"details",render:e=>{var c,s,a;return Object(P.jsxs)("div",{children:[Object(P.jsx)(n.F,{children:Object(P.jsx)(n.h,{md:10,children:Object(P.jsx)(n.n,{children:Object(P.jsx)(n.p,{children:Object(P.jsx)(n.q,{addonType:"append",children:Object(P.jsx)(n.a,{block:!0,className:"btn-success",onClick:()=>{for(let c=1;c<=t.values.row;c++)e.push({desc:"",specs:"",hsc_code:"",qty:"",units:"",unit_price:"",total_amount:"",cgst:"",sgst:"",tax_amount:"",order_amount:""})},children:"Add Rows"})})})})})}),Object(P.jsx)("div",{style:{overflow:"scroll"},children:Object(P.jsxs)(n.I,{size:"sm",className:"text-center f-12",children:[Object(P.jsx)("thead",{children:Object(P.jsxs)("tr",{children:[Object(P.jsx)("th",{children:"Sr no"}),Object(P.jsx)("th",{children:"Description Of Items"}),Object(P.jsx)("th",{children:"Model/Specifications"}),Object(P.jsx)("th",{children:"SAC/HSC Code"}),Object(P.jsx)("th",{children:"Qty"}),Object(P.jsx)("th",{children:"Units"}),Object(P.jsx)("th",{children:"Unit Price (INR)"}),Object(P.jsx)("th",{children:"Total Amount(INR)"}),Object(P.jsx)("th",{children:"Delete"})]})}),Object(P.jsxs)("tbody",{className:"text-center",children:[console.log("values",null===t||void 0===t||null===(c=t.values)||void 0===c?void 0:c.details),null===t||void 0===t||null===(s=t.values)||void 0===s||null===(a=s.details)||void 0===a?void 0:a.map(((t,c)=>{var s=Number(t.unit_price)*Number(t.qty),a=9*s/100,d=9*s/100;t.total_amount=s,t.sgst=d,t.cgst=a;var r=d+a;return t.tax_amount=r,t.order_amount=r+s,Object(P.jsxs)("tr",{className:"text-center",children:[Object(P.jsx)("td",{children:c+1}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.desc`,id:"desc",style:{width:"130px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.specs`,id:`details.${c}.specs`})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.hsc_code`,id:`details.${c}.hsc_code`,style:{width:"80px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"number",name:`details.${c}.qty`,id:`details.${c}.qty`,min:"1",style:{width:"60px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.units`,id:`details.${c}.units`,style:{width:"60px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.unit_price`,id:`details.${c}.unit_price`,style:{width:"130px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.total_amount`,id:`details.${c}.total_amount`,style:{width:"80px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(n.a,{color:"danger p-1",size:"sm",onClick:()=>e.remove(c),children:Object(P.jsx)("i",{className:"fa fa-trash"})})})]},c)})),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{style:{width:"200px"},children:"Total Net Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.net_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.total_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{children:"Add : CGST @ 9.00%"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.cgst=parseFloat(t.values.details.reduce((function(e,t){return e+t.cgst}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsxs)("td",{children:["Add : ",t.values.gst_type," @ 9.00%"]}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.gst=parseFloat(t.values.details.reduce((function(e,t){return e+t.sgst}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{children:"Total Tax Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.total_tax_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.tax_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{style:{width:"200px"},children:"Total Order Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.total_order_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.order_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]})]})]})})]})}})})}),Object(P.jsxs)(n.F,{style:{justifyContent:"center"},children:[Object(P.jsx)(n.h,{md:4,children:Object(P.jsx)(n.a,{type:"reset",color:"danger",block:!0,children:Object(P.jsx)("b",{children:"Reset"})})}),Object(P.jsx)(n.h,{md:4,children:Object(P.jsx)(n.a,{type:"submit",disabled:t.isSubmitting,color:"primary",block:!0,children:"Submit"})})]})]})}})})]})]})}));var Q=Object(d.b)((e=>({login:e.login,invoice:e.invoice,cols:e.cols.cols,customer:e.customer.customer,company:e.company.company,rows:e.rows.rows})),(e=>({onCompanyGetData:t=>e(r.f(t)),onCustomerGetData:t=>e(r.g(t)),onRowsGetData:t=>e(r.jb(t)),onColsGetData:t=>e(r.e(t)),onInvoiceGetData:t=>e(r.F(t)),onDeleteInvoice:(t,c)=>e(r.r(t,c)),onPostInvoiceData:(t,c,s,n,i)=>e(r.V(t,c,s,n,i)),onUpdateInvoiceData:(t,c)=>e(r.zb(t,c)),invoiceEditGetData:t=>e(r.E(t))})))((function(e){var t,c;let{data:s,...i}=e,o={token:`${null===(t=i.login)||void 0===t||null===(c=t.login)||void 0===c?void 0:c.token}`,id:s.id};return console.log("data in Invoice:",s),Object(P.jsx)("div",{children:Object(P.jsx)(n.a,{className:"btn-warning p-1 mr-2",onClick:()=>{(()=>{let e={customer_id:s.customer_id,company_id:s.company_id,user_id:s.user_id,invoice_no:s.invoice_no,invoice_type:s.invoice_type,date:s.date,invoice_gstin:s.invoice_gstin,quotation_ref:s.quotation_ref,purchase_order_no:s.purchase_order_no,purchase_order_date:s.purchase_order_date,invoice_challan:s.invoice_challan,net_amount:s.net_amount,cgst:s.cgst,gst:s.gst,total_tax_amount:s.total_tax_amount,total_order_amount:s.total_order_amount,is_paid:1,products:s.invoice_details};console.log("Data of InvoicePaid:",e),i.onUpdateInvoiceData(o,e)})()},children:Object(P.jsx)("i",{className:"fa fa-dollar-sign","aria-hidden":"true"})})})}));t.default=Object(d.b)((e=>({login:e.login,invoice:e.invoice,cols:e.cols.cols,customer:e.customer.customer,company:e.company.company,rows:e.rows.rows})),(e=>({onCompanyGetData:t=>e(r.f(t)),onCustomerGetData:t=>e(r.g(t)),onRowsGetData:t=>e(r.jb(t)),onColsGetData:t=>e(r.e(t)),onInvoiceGetData:t=>e(r.F(t)),onDeleteInvoice:(t,c)=>e(r.r(t,c)),onPostInvoiceData:(t,c,s,n,i)=>e(r.V(t,c,s,n,i)),onUpdateInvoiceData:(t,c,s,n)=>e(r.zb(t,c,s,n)),invoiceEditGetData:t=>e(r.E(t))})))((function(e){var t,c,d,r,j,b,x,h,O,m,p,u;let v={token:`${null===(t=e.login)||void 0===t||null===(c=t.login)||void 0===c?void 0:c.token}`};const[_,f]=Object(s.useState)(!1);Object(s.useEffect)((()=>{e.onCompanyGetData(v),e.onInvoiceGetData(v),e.onRowsGetData(v),e.onCustomerGetData(v),e.onColsGetData(v)}),[]);const[g,N]=Object(s.useState)({pageSize:10,pageIndex:0,items:null!==(d=e.invoice)&&void 0!==d&&d.isLoading?[]:null===(r=e.invoice)||void 0===r?void 0:r.invoice}),[y,I]=Object(s.useState)(!1),S=()=>{f(!1),I(!y)};return Object(P.jsxs)(n.b,{children:[Object(P.jsxs)(n.e,{className:"bg-warning text-white",children:[Object(P.jsxs)("div",{className:"",children:[Object(P.jsx)("strong",{children:"Invoice"}),Object(P.jsx)(n.a,{className:"btn-success float-right",onClick:()=>{S()},children:"Create Invoice"})]}),Object(P.jsxs)(n.t,{className:"modal-info modal-lg",isOpen:y,toggle:S,backdrop:"static",children:[Object(P.jsx)(n.w,{toggle:S,children:"Add New Invoice"}),Object(P.jsx)(n.u,{children:Object(P.jsx)(i.e,{initialValues:{company_id:"",customer_id:"",user_id:null===(j=e.login)||void 0===j||null===(b=j.login)||void 0===b||null===(x=b.user)||void 0===x?void 0:x.id,invoice_no:"",type_of_invoice:"",invoice_date:"",quotation_ref_no:"",purchase_order_no:"",purchase_order_date:"",inv_gstin:"",challan_no:"",net_amount:"",cgst:"",gst:"",gst_type:"",total_tax_amount:"",total_order_amount:"",is_paid:"",row:"",details:[]},onSubmit:(t,c)=>{let{setSubmitting:s}=c;console.log("values in Invoice:",t);let n={customer_id:t.customer_id,company_id:t.company_id,user_id:t.user_id,invoice_no:t.invoice_no,invoice_type:t.type_of_invoice,date:t.invoice_date,invoice_gstin:t.inv_gstin,quotation_ref:t.quotation_ref_no,purchase_order_no:t.purchase_order_no,purchase_order_date:t.purchase_order_date,invoice_challan:t.challan_no,net_amount:t.net_amount,cgst:t.cgst,gst:t.gst,total_tax_amount:t.total_tax_amount,total_order_amount:t.total_order_amount,products:t.details,gst_type:t.gst_type};console.log("Data of Invoice:",n),e.onPostInvoiceData(v,n,S,f,s),s(!0)},validationSchema:a.a().shape({company_id:a.c().required("Company is required"),customer_id:a.c().required("Customer is required"),invoice_no:a.c().required("required"),invoice_date:a.c().required("required"),quotation_ref_no:a.c().required("required"),type_of_invoice:a.c().required("required"),purchase_order_no:a.c().required("required"),purchase_order_date:a.c().required("required"),inv_gstin:a.c().required("required"),challan_no:a.c().required("required"),gst_type:a.c().required("required")}),children:t=>{var c,s;return _?Object(P.jsx)(L,{toggle:S,data:t.values,customer:e.customer}):Object(P.jsxs)(i.d,{children:[Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"customer_id",children:"Select Customer"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"customer_id",id:"customer_id",placeholder:"Select Customer",className:"form-control"+(t.errors.customer_id&&t.touched.customer_id?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Customer"}),null===(c=e.customer)||void 0===c?void 0:c.map((e=>Object(P.jsx)("option",{value:e.id,children:e.name})))]}),Object(P.jsx)(i.a,{name:"customer_id",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"company_id",children:"Select Company"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"company_id",id:"company_id",placeholder:"Select Company",className:"form-control"+(t.errors.company_id&&t.touched.company_id?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Company"}),null===(s=e.company)||void 0===s?void 0:s.filter((e=>1==e.internal)).map((e=>Object(P.jsx)("option",{value:e.id,children:e.name})))]}),Object(P.jsx)(i.a,{name:"company_id",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"type_of_invoice",children:"Select Invoice Type"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"type_of_invoice",id:"type_of_invoice",placeholder:"Select Invoice Type",className:"form-control"+(t.errors.type_of_invoice&&t.touched.type_of_invoice?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Invoice Type"}),Object(P.jsx)("option",{value:"Profoma Invoice",children:"Profoma Invoice"}),Object(P.jsx)("option",{value:"Tax Invoice",children:"Tax Invoice"})]}),Object(P.jsx)(i.a,{name:"type_of_invoice",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"invoice_no",children:"Invoice No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"invoice_no",id:"invoice_no",placeholder:"Enter Invoice No",className:"form-control"+(t.errors.invoice_no&&t.touched.invoice_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"invoice_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"invoice_date",children:"Invoice Date"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"date",name:"invoice_date",id:"invoice_date",placeholder:"Enter Invoice No",className:"form-control"+(t.errors.invoice_date&&t.touched.invoice_date?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"invoice_date",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"quotation_ref_no",children:"Quotation Reference No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"quotation_ref_no",id:"quotation_ref_no",placeholder:"Enter Quotation Reference No",className:"form-control"+(t.errors.quotation_ref_no&&t.touched.quotation_ref_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"quotation_ref_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"purchase_order_no",children:"Purchase Order No."}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"purchase_order_no",id:"purchase_order_no",placeholder:"Enter Purchase Order No.",className:"form-control"+(t.errors.purchase_order_no&&t.touched.purchase_order_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"purchase_order_no",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"purchase_order_date",children:"Purchase Order Date"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"date",name:"purchase_order_date",id:"purchase_order_date",placeholder:"Enter Purchase Order Date",className:"form-control"+(t.errors.purchase_order_date&&t.touched.purchase_order_date?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"purchase_order_date",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsxs)(n.F,{className:"form-group",children:[Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"inv_gstin",children:"Invoice GSTIN"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"inv_gstin",id:"inv_gstin",placeholder:"Enter Invoice GSTIN",className:"form-control"+(t.errors.inv_gstin&&t.touched.inv_gstin?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"inv_gstin",component:"div",className:"invalid-feedback"})]})]}),Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"challan_no",children:"Challan No"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"text",name:"challan_no",id:"challan_no",placeholder:"Enter Challan No",className:"form-control"+(t.errors.challan_no&&t.touched.challan_no?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"challan_no",component:"div",className:"invalid-feedback"})]})]})]}),Object(P.jsx)(n.F,{className:"form-group",children:Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"gst_type",children:"Select Gst Type"}),Object(P.jsxs)(n.p,{children:[Object(P.jsxs)(i.b,{component:l.a,type:"select",name:"gst_type",id:"gst_type",placeholder:"",className:"form-control"+(t.errors.gst_type&&t.touched.gst_type?" is-invalid":""),children:[Object(P.jsx)("option",{value:"",children:"Select Gst Type"}),Object(P.jsx)("option",{value:"SGST",children:"SGST"}),Object(P.jsx)("option",{value:"IGST",children:"IGST"})]}),Object(P.jsx)(i.a,{name:"gst_type",component:"div",className:"invalid-feedback"})]})]})}),Object(P.jsx)(n.F,{className:"form-group",children:Object(P.jsxs)(n.h,{md:6,children:[Object(P.jsx)(n.s,{for:"row",children:"Add Table Rows"}),Object(P.jsxs)(n.p,{children:[Object(P.jsx)(i.b,{component:o.a,type:"number",name:"row",id:"row",placeholder:"Enter Table rows",className:"form-control"+(t.errors.row&&t.touched.row?" is-invalid":"")}),Object(P.jsx)(i.a,{name:"row",component:"div",className:"invalid-feedback"})]})]})}),Object(P.jsx)(n.F,{children:Object(P.jsx)(n.h,{md:12,children:Object(P.jsx)(i.c,{name:"details",render:e=>{var c,s,a;return Object(P.jsxs)("div",{children:[Object(P.jsx)(n.F,{children:Object(P.jsx)(n.h,{md:10,children:Object(P.jsx)(n.n,{children:Object(P.jsx)(n.p,{children:Object(P.jsx)(n.q,{addonType:"append",children:Object(P.jsx)(n.a,{block:!0,className:"btn-success",onClick:()=>{for(let c=1;c<=t.values.row;c++)e.push({desc:"",specs:"",hsc_code:"",qty:"",units:"",unit_price:"",total_amount:"",cgst:"",sgst:"",tax_amount:"",order_amount:""})},children:"Add Rows"})})})})})}),Object(P.jsx)("div",{style:{overflow:"scroll"},children:Object(P.jsxs)(n.I,{size:"sm",className:"text-center f-12",children:[Object(P.jsx)("thead",{children:Object(P.jsxs)("tr",{children:[Object(P.jsx)("th",{children:"Sr no"}),Object(P.jsx)("th",{children:"Description Of Items"}),Object(P.jsx)("th",{children:"Model/Specifications"}),Object(P.jsx)("th",{children:"SAC/HSC Code"}),Object(P.jsx)("th",{children:"Qty"}),Object(P.jsx)("th",{children:"Units"}),Object(P.jsx)("th",{children:"Unit Price (INR)"}),Object(P.jsx)("th",{children:"Total Amount(INR)"}),Object(P.jsx)("th",{children:"Delete"})]})}),Object(P.jsxs)("tbody",{className:"text-center",children:[console.log("values",null===t||void 0===t||null===(c=t.values)||void 0===c?void 0:c.details),null===t||void 0===t||null===(s=t.values)||void 0===s||null===(a=s.details)||void 0===a?void 0:a.map(((t,c)=>{var s=Number(t.unit_price)*Number(t.qty),a=9*s/100,d=9*s/100;t.total_amount=s,t.sgst=d,t.cgst=a;var r=d+a;return t.tax_amount=r,t.order_amount=r+s,Object(P.jsxs)("tr",{className:"text-center",children:[Object(P.jsx)("td",{children:c+1}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.desc`,id:"desc",style:{width:"130px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.specs`,id:`details.${c}.specs`})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.hsc_code`,id:`details.${c}.hsc_code`,style:{width:"80px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"number",name:`details.${c}.qty`,id:`details.${c}.qty`,min:"1",style:{width:"60px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.units`,id:`details.${c}.units`,style:{width:"60px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.unit_price`,id:`details.${c}.unit_price`,style:{width:"130px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(i.b,{component:o.a,type:"text",name:`details.${c}.total_amount`,id:`details.${c}.total_amount`,style:{width:"80px"}})}),Object(P.jsx)("td",{children:Object(P.jsx)(n.a,{color:"danger p-1",size:"sm",onClick:()=>e.remove(c),children:Object(P.jsx)("i",{className:"fa fa-trash"})})})]},c)})),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{style:{width:"200px"},children:"Total Net Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.net_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.total_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{children:"Add : CGST @ 9.00%"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.cgst=parseFloat(t.values.details.reduce((function(e,t){return e+t.cgst}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsxs)("td",{children:["Add : ",t.values.gst_type," @ 9.00%"]}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.gst=parseFloat(t.values.details.reduce((function(e,t){return e+t.sgst}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{children:"Total Tax Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.total_tax_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.tax_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]}),Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{}),Object(P.jsx)("td",{style:{width:"200px"},children:"Total Order Amount"}),Object(P.jsxs)("td",{children:[Object(P.jsx)("i",{className:"fa fa-rupee-sign"})," ",t.values.total_order_amount=parseFloat(t.values.details.reduce((function(e,t){return e+t.order_amount}),0)).toFixed(2)]}),Object(P.jsx)("td",{})]})]})]})})]})}})})}),Object(P.jsxs)(n.F,{style:{justifyContent:"center"},children:[Object(P.jsx)(n.h,{md:4,children:Object(P.jsx)(n.a,{type:"reset",color:"danger",block:!0,children:Object(P.jsx)("b",{children:"Reset"})})}),Object(P.jsx)(n.h,{md:4,children:Object(P.jsx)(n.a,{type:"submit",disabled:t.isSubmitting,color:"primary",block:!0,children:"Submit"})})]})]})}})})]})]}),Object(P.jsx)(n.c,{children:Object(P.jsxs)("table",{className:"table table-sm text-center",style:{fontSize:"12px"},children:[Object(P.jsx)("thead",{children:Object(P.jsxs)("tr",{children:[Object(P.jsx)("th",{scope:"col",children:"Invoice No"}),Object(P.jsx)("th",{scope:"col",children:"Kind Attn"}),Object(P.jsx)("th",{scope:"col",children:"Company Name"}),Object(P.jsx)("th",{scope:"col",children:"Invoice Type"}),Object(P.jsx)("th",{scope:"col",children:"Invoice Date"}),Object(P.jsx)("th",{scope:"col",children:"Quotation Reference No"}),Object(P.jsx)("th",{scope:"col",children:"Purchase Order No."}),Object(P.jsx)("th",{scope:"col",children:"Purchase Order Date"}),Object(P.jsx)("th",{scope:"col",children:"Paid"}),Object(P.jsx)("th",{scope:"col",children:"Action"})]})}),Object(P.jsx)("tbody",{style:{textTransform:"uppercase"},children:null!==(h=e.invoice)&&void 0!==h&&h.isLoading?Object(P.jsx)("tr",{children:Object(P.jsx)("td",{colSpan:18,children:Object(P.jsx)(V.a,{color:"primary"})})}):(null===(O=e.invoice)||void 0===O||null===(m=O.invoice)||void 0===m?void 0:m.length)>0?null===(p=e.invoice)||void 0===p||null===(u=p.invoice)||void 0===u?void 0:u.slice(g.pageIndex*g.pageSize,g.pageIndex*g.pageSize+g.pageSize).map(((t,c)=>{var s,i;return Object(P.jsxs)("tr",{children:[Object(P.jsx)("td",{children:t.invoice_no}),Object(P.jsx)("td",{children:null===(s=t.customer)||void 0===s?void 0:s.name}),Object(P.jsx)("td",{children:null===(i=t.company)||void 0===i?void 0:i.name}),Object(P.jsx)("td",{children:t.invoice_type}),Object(P.jsx)("td",{children:t.date}),Object(P.jsx)("td",{children:t.quotation_ref}),Object(P.jsx)("td",{children:t.purchase_order_no}),Object(P.jsx)("td",{children:t.purchase_order_date}),Object(P.jsx)("td",{children:0==t.is_paid?"No":"Yes"}),Object(P.jsxs)("td",{className:"d-flex justify-content-center",children:[Object(P.jsx)(Q,{data:t}),Object(P.jsx)(B,{data:t}),Object(P.jsx)(U,{data:t,customer:e.customer}),Object(P.jsx)(M,{data:t}),Object(P.jsx)(n.a,{className:"btn-danger ml-2 p-1",onClick:()=>{window.confirm("Are you sure you wish to delete this Invoice?")&&e.onDeleteInvoice(v,t.id)},children:Object(P.jsx)("i",{className:"fa fa-trash-alt ",value:t.id,"aria-hidden":"true"})})]})]},c)})):Object(P.jsx)("tr",{children:Object(P.jsx)("td",{colSpan:3,children:"No Invoice"})})}),Object(P.jsx)("nav",{children:Object(P.jsxs)(n.C,{children:[Object(P.jsx)(n.D,{children:Object(P.jsx)(n.E,{previous:!0,tag:"button",onClick:e=>{N((e=>({...g,pageIndex:e.pageIndex>0?e.pageIndex-1:0})))},children:"Back"})}),Object(P.jsx)(n.D,{children:Object(P.jsx)(n.E,{next:!0,tag:"button",onClick:e=>(console.log("pageIndex",g.pageIndex),console.log("pageSize",g.pageSize),void N((e=>({...g,pageIndex:e.pageIndex<Math.ceil(e.items.length/e.pageSize)?e.pageIndex+1:e.pageIndex})))),children:"Next"})})]})})]})})]})}))}}]);
//# sourceMappingURL=12.d1b2cfaf.chunk.js.map