import{h as i,j as e,G as d,z as g,B as u,D as s,E as b,y as v,aF as D,aG as N}from"./index-Da-VPv7f.js";import{aT as f,R as I,r as C}from"./mui-icons-CVqIXJUc.js";import{u as A,T as n,f as B}from"./mui-x-charts-CP3e2jhe.js";import{g as S,l,P as p,D as h,p as r}from"./mui-x-datagrid-D42xrz8e.js";import"./mui-x-pickers-BflNfF54.js";const W=({data:t})=>{const a=A();return i(l,{sx:{p:3},children:[e(l,{sx:{mb:2},children:e(S,{variant:"contained",startIcon:e(f,{}),onClick:()=>{const o=window.open("","_blank");if(o){const m=`
        <html>
          <head>
            <title>E-Way Bill - ${t.eWayBillNo}</title>
            <style>
              body { 
                font-family: 'Segoe UI', Arial, sans-serif; 
                margin: 0; 
                padding: 24px; 
                background: #fff; 
                color: #222; 
                line-height: 1.4;
              }
              .header { 
                text-align: center; 
                margin-bottom: 32px; 
                border-bottom: 2px solid #1976d2; 
                padding-bottom: 16px; 
              }
              .header h1 { 
                margin: 0; 
                font-size: 2.2rem; 
                color: #1976d2; 
                font-weight: bold;
              }
              .header h2 { 
                margin: 0; 
                font-size: 1.2rem; 
                color: #555; 
                font-weight: 400; 
              }
              .section { 
                margin-bottom: 28px; 
                page-break-inside: avoid;
              }
              .section-title { 
                font-size: 1.1rem; 
                color: #1976d2; 
                font-weight: 600; 
                margin-bottom: 15px; 
                margin-top: 30px; 
                border-bottom: 1px solid #1976d2;
                padding-bottom: 5px;
              }
              .info-grid { 
                display: grid; 
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
                gap: 16px; 
                margin-bottom: 20px; 
              }
              .info-item { 
                background: #f5faff; 
                border: 1px solid #e3eafc; 
                padding: 12px 16px; 
                border-radius: 6px; 
              }
              .info-label { 
                font-weight: 600; 
                color: #1976d2; 
                font-size: 12px; 
                margin-bottom: 4px;
              }
              .info-value { 
                font-size: 14px; 
                color: #222; 
                font-weight: 500;
              }
              .address-section {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 24px;
                margin-bottom: 20px;
              }
              .address-box {
                background: #f5faff;
                border: 1px solid #e3eafc;
                padding: 16px;
                border-radius: 8px;
              }
              .address-title {
                font-weight: 600;
                color: #1976d2;
                font-size: 14px;
                margin-bottom: 8px;
              }
              .address-content {
                font-size: 13px;
                line-height: 1.5;
              }
              .address-label {
                font-weight: 600;
                color: #666;
                font-size: 11px;
                margin-bottom: 2px;
              }
              table { 
                width: 100%; 
                border-collapse: collapse; 
                margin-bottom: 16px; 
                page-break-inside: avoid;
              }
              th, td { 
                border: 1px solid #e3eafc; 
                padding: 8px 10px; 
                font-size: 12px; 
                text-align: left;
              }
              th { 
                background: #e3eafc; 
                color: #1976d2; 
                font-weight: 600; 
                font-size: 11px;
              }
              td { 
                background: #fff; 
                vertical-align: top;
              }
              .amount-table th,
              .amount-table td {
                text-align: right;
                font-size: 11px;
                padding: 6px 8px;
              }
              .total-row {
                background: #e3f2fd !important;
                font-weight: 600;
              }
              .total-row td {
                background: #e3f2fd !important;
                color: #1976d2;
              }
              .divider {
                border-top: 1px solid #e3eafc;
                margin: 20px 0;
              }
              .footer {
                margin-top: 30px;
                text-align: center;
                font-size: 11px;
                color: #666;
                border-top: 1px solid #e3eafc;
                padding-top: 10px;
              }
              @media print {
                body { 
                  margin: 0; 
                  padding: 16px; 
                  background: #fff; 
                }
                .header { 
                  margin-bottom: 20px; 
                  padding-bottom: 10px; 
                }
                .section { 
                  margin-bottom: 20px; 
                }
                .info-grid { 
                  gap: 12px; 
                  margin-bottom: 15px; 
                }
                .info-item { 
                  padding: 8px 12px; 
                  background: #fff !important; 
                  border-color: #e3eafc !important; 
                }
                .address-section {
                  gap: 16px;
                  margin-bottom: 15px;
                }
                .address-box {
                  padding: 12px;
                  background: #fff !important;
                  border-color: #e3eafc !important;
                }
                table { 
                  margin-bottom: 12px; 
                }
                th, td { 
                  padding: 6px 8px; 
                  font-size: 10px; 
                }
                .amount-table th,
                .amount-table td {
                  padding: 4px 6px;
                  font-size: 10px;
                }
                .divider {
                  margin: 15px 0;
                }
                .footer {
                  margin-top: 20px;
                  font-size: 10px;
                }
              }
            </style>
          </head>
          <body>
            <div class="header">
              <h1>E-WAY BILL</h1>
              <h2>Electronic Way Bill</h2>
            </div>

            <div class="section">
              <div class="section-title">E-WAY BILL Details</div>
              <div class="info-grid">
                <div class="info-item">
                  <div class="info-label">E-Way Bill No</div>
                  <div class="info-value">${t.eWayBillNo}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Generated Date</div>
                  <div class="info-value">${t.generatedDate}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Generated By</div>
                  <div class="info-value">${t.generatedBy}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Mode</div>
                  <div class="info-value">${t.mode}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Approx Distance</div>
                  <div class="info-value">${t.approxDistance}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Valid Upto</div>
                  <div class="info-value">${t.validUpto}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Type</div>
                  <div class="info-value">${t.type}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Transaction Type</div>
                  <div class="info-value">${t.transactionType}</div>
                </div>
              </div>
            </div>

            <div class="divider"></div>

            <div class="section">
              <div class="section-title">Address Details</div>
              <div class="address-section">
                <div class="address-box">
                  <div class="address-title">From (Consignor)</div>
                  <div class="address-content">
                    <div class="address-label">GSTIN</div>
                    <div>${t.from.gstin}</div>
                    <div style="font-weight: 600; margin: 8px 0 4px 0;">${t.from.companyName}</div>
                    <div>${t.from.state}</div>
                    <div class="address-label" style="margin-top: 8px;">::Dispatch From::</div>
                    <div>${t.from.address}</div>
                  </div>
                </div>
                <div class="address-box">
                  <div class="address-title">To (Consignee)</div>
                  <div class="address-content">
                    <div class="address-label">GSTIN</div>
                    <div>${t.to.gstin}</div>
                    <div style="font-weight: 600; margin: 8px 0 4px 0;">${t.to.companyName}</div>
                    <div>${t.to.state}</div>
                    <div class="address-label" style="margin-top: 8px;">::Ship To::</div>
                    <div>${t.to.address}</div>
                  </div>
                </div>
              </div>
            </div>

            <div class="divider"></div>

            <div class="section">
              <div class="section-title">Goods Details</div>
              <table>
                <thead>
                  <tr>
                    <th>HSN Code</th>
                    <th>Product Name & Desc</th>
                    <th>Quantity</th>
                    <th>Taxable Amount (₹)</th>
                    <th>Tax Rate</th>
                  </tr>
                </thead>
                <tbody>
                  ${t.goods.map((c,y)=>`
                    <tr>
                      <td>${c.hsnCode}</td>
                      <td>${c.productName}</td>
                      <td>${c.quantity}</td>
                      <td style="text-align: right;">${c.taxableAmount.toLocaleString()}</td>
                      <td>${c.taxRate}</td>
                    </tr>
                  `).join("")}
                </tbody>
              </table>

              <div class="section-title">Amount Summary</div>
              <table class="amount-table">
                <thead>
                  <tr>
                    <th>Tot. Tax'ble Amt</th>
                    <th>CGST Amt</th>
                    <th>SGST Amt</th>
                    <th>IGST Amt</th>
                    <th>Cess Amt</th>
                    <th>Cess Non.Advol Amt</th>
                    <th>Other Amt</th>
                    <th>Tot. Inv. Amt</th>
                  </tr>
                </thead>
                <tbody>
                  <tr class="total-row">
                    <td>${t.amountSummary.totalTaxableAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.cgstAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.sgstAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.igstAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.cessAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.cessNonAdvolAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.otherAmount.toLocaleString()}</td>
                    <td>${t.amountSummary.totalInvoiceAmount.toLocaleString()}</td>
                  </tr>
                </tbody>
              </table>
            </div>

            <div class="divider"></div>

            <div class="section">
              <div class="section-title">Transportation Details</div>
              <div class="info-grid">
                <div class="info-item">
                  <div class="info-label">Transport ID & Name</div>
                  <div class="info-value">${t.transportId}</div>
                </div>
                <div class="info-item">
                  <div class="info-label">Transport Doc. No. & Date</div>
                  <div class="info-value">${t.transportDocNo} ${t.transportDocDate}</div>
                </div>
              </div>
            </div>

            <div class="divider"></div>

            <div class="section">
              <div class="section-title">Vehicle Details</div>
              ${t.vehicleDetails.length>0?`
                <table>
                  <thead>
                    <tr>
                      <th>Mode</th>
                      <th>Vehicle / Transport Doc. No. & Date</th>
                      <th>From</th>
                      <th>Entered Date</th>
                      <th>Entered By</th>
                      <th>CEWB No. (If any)</th>
                      <th>Multi Veh. Info (if any)</th>
                    </tr>
                  </thead>
                  <tbody>
                    ${t.vehicleDetails.map((c,y)=>`
                      <tr>
                        <td>${c.mode}</td>
                        <td>${c.vehicleNo}</td>
                        <td>${c.from}</td>
                        <td>${c.enteredDate}</td>
                        <td>${c.enteredBy}</td>
                        <td>${c.cewbNo}</td>
                        <td>${c.multiVehInfo}</td>
                      </tr>
                    `).join("")}
                  </tbody>
                </table>
              `:`
                <div style="text-align: center; padding: 20px; color: #666; font-style: italic;">
                  No vehicle details available
                </div>
              `}
            </div>

            <div class="footer">
              This is a computer generated E-Way Bill. No signature required.
            </div>
          </body>
        </html>
      `;o.document.write(m),o.document.close(),o.focus(),o.print(),o.close()}},sx:{bgcolor:a.palette.primary.main,"&:hover":{bgcolor:a.palette.primary.dark}},children:"Print E-Way Bill"})}),i(p,{elevation:3,sx:{p:3,mb:3},children:[e(n,{variant:"h4",sx:{color:a.palette.primary.main,mb:3,fontWeight:"bold"},children:"E-WAY BILL"}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2},children:"E-WAY BILL Details"}),i(d,{container:!0,spacing:2,children:[i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"E-Way Bill No"}),e(n,{variant:"body1",fontWeight:"medium",children:t.eWayBillNo})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Generated Date"}),e(n,{variant:"body1",fontWeight:"medium",children:t.generatedDate})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Generated By"}),e(n,{variant:"body1",fontWeight:"medium",children:t.generatedBy})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Mode"}),e(n,{variant:"body1",fontWeight:"medium",children:t.mode})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Approx Distance"}),e(n,{variant:"body1",fontWeight:"medium",children:t.approxDistance})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Valid Upto"}),e(n,{variant:"body1",fontWeight:"medium",children:t.validUpto})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Type"}),e(n,{variant:"body1",fontWeight:"medium",children:t.type})]}),i(d,{item:!0,xs:12,sm:6,md:3,children:[e(n,{variant:"body2",color:"text.secondary",children:"Transaction Type"}),e(n,{variant:"body1",fontWeight:"medium",children:t.transactionType})]})]})]}),e(h,{sx:{my:3}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2},children:"Address Details"}),i(d,{container:!0,spacing:3,children:[i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"From (Consignor)"}),i(n,{variant:"body2",color:"text.secondary",children:["GSTIN: ",t.from.gstin]}),e(n,{variant:"body1",fontWeight:"medium",children:t.from.companyName}),e(n,{variant:"body1",children:t.from.state}),e(n,{variant:"body2",color:"text.secondary",children:"::Dispatch From::"}),e(n,{variant:"body1",children:t.from.address})]}),i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"To (Consignee)"}),i(n,{variant:"body2",color:"text.secondary",children:["GSTIN: ",t.to.gstin]}),e(n,{variant:"body1",fontWeight:"medium",children:t.to.companyName}),e(n,{variant:"body1",children:t.to.state}),e(n,{variant:"body2",color:"text.secondary",children:"::Ship To::"}),e(n,{variant:"body1",children:t.to.address})]})]})]}),e(h,{sx:{my:3}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2},children:"Goods Details"}),e(v,{component:p,variant:"outlined",children:i(g,{size:"small",children:[e(u,{children:i(s,{sx:{bgcolor:a.palette.grey[100]},children:[e(r,{children:"HSN Code"}),e(r,{children:"Product Name & Desc"}),e(r,{align:"right",children:"Quantity"}),e(r,{align:"right",children:"Taxable Amount (₹)"}),e(r,{children:"Tax Rate (C+S+I+Cess+Cess Non.Advol)"})]})}),e(b,{children:t.goods.map((o,m)=>i(s,{children:[e(r,{children:o.hsnCode}),e(r,{children:o.productName}),e(r,{align:"right",children:o.quantity}),e(r,{align:"right",children:o.taxableAmount.toLocaleString()}),e(r,{children:o.taxRate})]},m))})]})}),e(l,{sx:{mt:2},children:e(v,{component:p,variant:"outlined",children:i(g,{size:"small",children:[e(u,{children:i(s,{sx:{bgcolor:a.palette.grey[100]},children:[e(r,{children:"Tot. Tax'ble Amt"}),e(r,{align:"right",children:"CGST Amt"}),e(r,{align:"right",children:"SGST Amt"}),e(r,{align:"right",children:"IGST Amt"}),e(r,{align:"right",children:"Cess Amt"}),e(r,{align:"right",children:"Cess Non.Advol Amt"}),e(r,{align:"right",children:"Other Amt"}),e(r,{align:"right",children:"Tot. Inv. Amt"})]})}),e(b,{children:i(s,{children:[e(r,{children:t.amountSummary.totalTaxableAmount.toLocaleString()}),e(r,{align:"right",children:t.amountSummary.cgstAmount.toLocaleString()}),e(r,{align:"right",children:t.amountSummary.sgstAmount.toLocaleString()}),e(r,{align:"right",children:t.amountSummary.igstAmount.toLocaleString()}),e(r,{align:"right",children:t.amountSummary.cessAmount.toLocaleString()}),e(r,{align:"right",children:t.amountSummary.cessNonAdvolAmount.toLocaleString()}),e(r,{align:"right",children:t.amountSummary.otherAmount.toLocaleString()}),e(r,{align:"right",sx:{fontWeight:"bold"},children:t.amountSummary.totalInvoiceAmount.toLocaleString()})]})})]})})})]}),e(h,{sx:{my:3}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2},children:"Transportation Details"}),i(d,{container:!0,spacing:2,children:[i(d,{item:!0,xs:12,sm:6,children:[e(n,{variant:"body2",color:"text.secondary",children:"Transport ID & Name"}),e(n,{variant:"body1",fontWeight:"medium",children:t.transportId})]}),i(d,{item:!0,xs:12,sm:6,children:[e(n,{variant:"body2",color:"text.secondary",children:"Transport Doc. No. & Date"}),i(n,{variant:"body1",fontWeight:"medium",children:[t.transportDocNo," ",t.transportDocDate]})]})]})]}),e(h,{sx:{my:3}}),i(l,{children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2},children:"Vehicle Details"}),e(v,{component:p,variant:"outlined",children:i(g,{size:"small",children:[e(u,{children:i(s,{sx:{bgcolor:a.palette.grey[100]},children:[e(r,{children:"Mode"}),e(r,{children:"Vehicle / Transport Doc. No. & Date"}),e(r,{children:"From"}),e(r,{children:"Entered Date"}),e(r,{children:"Entered By"}),e(r,{children:"CEWB No. (If any)"}),e(r,{children:"Multi Veh. Info (if any)"})]})}),e(b,{children:t.vehicleDetails.length>0?t.vehicleDetails.map((o,m)=>i(s,{children:[e(r,{children:o.mode}),e(r,{children:o.vehicleNo}),e(r,{children:o.from}),e(r,{children:o.enteredDate}),e(r,{children:o.enteredBy}),e(r,{children:o.cewbNo}),e(r,{children:o.multiVehInfo})]},m)):e(s,{children:e(r,{colSpan:7,align:"center",sx:{color:"text.secondary"},children:"No vehicle details available"})})})]})})]})]})]})},P=({data:t})=>{const a=A();return i(l,{sx:{p:3},children:[e(l,{sx:{mb:2,"@media print":{display:"none"}},children:e(S,{variant:"contained",startIcon:e(f,{}),onClick:()=>{window.print()},sx:{bgcolor:a.palette.primary.main,"&:hover":{bgcolor:a.palette.primary.dark}},children:"Print B2C Bill"})}),i(p,{elevation:3,sx:{p:3,mb:3,"@media print":{boxShadow:"none",border:"1px solid #ccc",pageBreakAfter:"always"}},children:[e(n,{variant:"h4",sx:{color:a.palette.primary.main,mb:3,fontWeight:"bold","@media print":{color:"#000",fontSize:"24px"}},children:"TAX INVOICE"}),e(l,{sx:{mb:3},children:i(d,{container:!0,spacing:3,children:[i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:1,"@media print":{color:"#000",fontSize:"16px"}},children:t.seller.name}),i(n,{variant:"body2",color:"text.secondary",children:["GSTIN: ",t.seller.gstin]}),e(n,{variant:"body1",children:t.seller.address}),i(n,{variant:"body2",color:"text.secondary",children:["Mobile: ",t.seller.mobile]})]}),e(d,{item:!0,xs:12,md:6,children:i(l,{sx:{textAlign:"right"},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:1,"@media print":{color:"#000",fontSize:"16px"}},children:"ORIGINAL FOR RECIPIENT"}),i(n,{variant:"body2",color:"text.secondary",children:["Invoice #: ",t.invoiceNumber]}),i(n,{variant:"body2",color:"text.secondary",children:["Invoice Date: ",t.invoiceDate]})]})})]})}),e(h,{sx:{my:3,"@media print":{borderColor:"#000"}}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2,"@media print":{color:"#000",fontSize:"16px"}},children:"Customer Details"}),i(d,{container:!0,spacing:3,children:[i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"Customer Information"}),e(n,{variant:"body1",fontWeight:"medium",children:t.customer.name}),i(n,{variant:"body2",color:"text.secondary",children:["Place of Supply: ",t.customer.placeOfSupply]})]}),i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"Addresses"}),e(n,{variant:"body2",fontWeight:"medium",children:"Billing Address:"}),e(n,{variant:"body2",children:t.customer.billingAddress}),e(n,{variant:"body2",fontWeight:"medium",sx:{mt:1},children:"Shipping Address:"}),e(n,{variant:"body2",children:t.customer.shippingAddress})]})]})]}),e(h,{sx:{my:3,"@media print":{borderColor:"#000"}}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2,"@media print":{color:"#000",fontSize:"16px"}},children:"Itemized Purchase Details"}),e(v,{component:p,variant:"outlined",sx:{"@media print":{border:"1px solid #000",pageBreakInside:"avoid"}},children:i(g,{size:"small",children:[e(u,{children:i(s,{sx:{bgcolor:a.palette.grey[100],"@media print":{bgcolor:"#f0f0f0"}},children:[e(r,{children:"#"}),e(r,{children:"Item"}),e(r,{align:"right",children:"MRP (₹)"}),e(r,{align:"right",children:"Selling Price (₹)"}),e(r,{align:"right",children:"Qty"}),e(r,{align:"right",children:"Amount (₹)"})]})}),e(b,{children:t.items.map(o=>i(I.Fragment,{children:[i(s,{children:[e(r,{children:o.itemNumber}),i(r,{children:[e(n,{variant:"body2",fontWeight:"medium",children:o.itemName}),i(n,{variant:"caption",color:"text.secondary",children:["(HSN: ",o.hsnCode,")"]})]}),e(r,{align:"right",children:o.mrp.toFixed(2)}),e(r,{align:"right",children:o.sellingPrice.toFixed(2)}),e(r,{align:"right",children:o.quantity}),e(r,{align:"right",children:o.amount.toFixed(2)})]}),o.discount>0&&i(s,{children:[e(r,{}),e(r,{colSpan:5,children:i(n,{variant:"caption",color:"text.secondary",children:["(Discount: ",o.discount.toFixed(2)," (-",o.discountPercentage.toFixed(2),"%))"]})})]})]},o.itemNumber))})]})}),e(l,{sx:{mt:2,textAlign:"center"},children:i(n,{variant:"body2",color:"text.secondary",children:["Total Items / Qty: ",t.summary.totalItems," / ",t.summary.totalQuantity.toFixed(2)]})})]}),e(h,{sx:{my:3,"@media print":{borderColor:"#000"}}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2,"@media print":{color:"#000",fontSize:"16px"}},children:"Summary of Charges"}),e(v,{component:p,variant:"outlined",sx:{"@media print":{border:"1px solid #000",pageBreakInside:"avoid"}},children:i(g,{size:"small",children:[e(u,{children:i(s,{sx:{bgcolor:a.palette.grey[100],"@media print":{bgcolor:"#f0f0f0"}},children:[e(r,{children:"Description"}),e(r,{align:"right",children:"Amount (₹)"})]})}),i(b,{children:[i(s,{children:[e(r,{children:"Total MRP"}),e(r,{align:"right",children:t.summary.totalMRP.toFixed(2)})]}),i(s,{children:[e(r,{children:"Total Savings"}),e(r,{align:"right",children:t.summary.totalSavings.toFixed(2)})]}),i(s,{sx:{bgcolor:a.palette.grey[50]},children:[e(r,{sx:{fontWeight:"bold"},children:"Total"}),e(r,{align:"right",sx:{fontWeight:"bold"},children:t.summary.total.toFixed(2)})]}),i(s,{children:[e(r,{children:"Taxable Amount"}),e(r,{align:"right",children:t.summary.taxableAmount.toFixed(2)})]}),i(s,{children:[i(r,{children:["CGST ",t.summary.cgstRate,"%"]}),e(r,{align:"right",children:t.summary.cgstAmount.toFixed(2)})]}),i(s,{children:[i(r,{children:["SGST ",t.summary.sgstRate,"%"]}),e(r,{align:"right",children:t.summary.sgstAmount.toFixed(2)})]}),i(s,{sx:{bgcolor:B(a.palette.primary.main,.1),"@media print":{bgcolor:"#e3f2fd"}},children:[e(r,{sx:{fontWeight:"bold"},children:"Amount Payable"}),e(r,{align:"right",sx:{fontWeight:"bold",color:a.palette.primary.main,"@media print":{color:"#000"}},children:t.summary.amountPayable.toFixed(2)})]})]})]})}),e(l,{sx:{mt:2,textAlign:"center"},children:e(n,{variant:"body2",color:"text.secondary",children:t.summary.amountInWords})})]}),e(h,{sx:{my:3,"@media print":{borderColor:"#000"}}}),i(l,{sx:{mb:3},children:[e(n,{variant:"h6",sx:{color:a.palette.primary.main,mb:2,"@media print":{color:"#000",fontSize:"16px"}},children:"Payment Information"}),i(d,{container:!0,spacing:3,children:[i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"Bank Details"}),i(n,{variant:"body2",children:["Bank: ",t.payment.bankName]}),i(n,{variant:"body2",children:["Account #: ",t.payment.accountNumber]}),i(n,{variant:"body2",children:["IFSC: ",t.payment.ifsc]}),i(n,{variant:"body2",children:["Branch: ",t.payment.branch]})]}),i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"Pay using UPI"}),e(l,{sx:{width:120,height:120,bgcolor:"grey.200",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1,border:"2px dashed",borderColor:"grey.400","@media print":{border:"1px solid #000",bgcolor:"#fff"}},children:e(n,{variant:"caption",color:"text.secondary",textAlign:"center",children:"QR Code"})})]})]})]}),e(h,{sx:{my:3,"@media print":{borderColor:"#000"}}}),e(l,{children:i(d,{container:!0,spacing:3,children:[i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"Notes"}),e(n,{variant:"body2",children:t.notes})]}),i(d,{item:!0,xs:12,md:6,children:[e(n,{variant:"subtitle1",fontWeight:"medium",sx:{mb:1},children:"Terms and Conditions"}),e(l,{component:"ol",sx:{pl:2,m:0},children:t.termsAndConditions.map((o,m)=>e(n,{variant:"body2",component:"li",sx:{mb:.5},children:o},m))})]})]})}),e(l,{sx:{mt:4,textAlign:"right"},children:i(l,{sx:{width:80,height:80,borderRadius:"50%",bgcolor:a.palette.primary.main,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"12px",fontWeight:"bold",textAlign:"center",lineHeight:1.2,"@media print":{bgcolor:"#000",color:"#fff"}},children:["SIGNATURE",e("br",{}),"For ",t.seller.name]})})]})]})},E=()=>{const t=A(),[a,x]=C.useState("eway"),o={eWayBillNo:"6615 2278 3444",generatedDate:"08/02/2023 06:12PM",generatedBy:"21GI A2129 HE89Y HE",mode:"Road",approxDistance:"4km",validUpto:"09/02/2023",type:"Outward-Supply",documentDetails:"Tax-Invoice-65-08/09/2023",transactionType:"Regular",from:{gstin:"29GH1234##########",companyName:"Company Name here",state:"State",address:"Dispatch Address"},to:{gstin:"29GH1234##########",companyName:"Company Name Here",state:"State",address:"Ship To Address"},goods:[{hsnCode:"1234",productName:"Item 01",quantity:"12",taxableAmount:3e3,taxRate:"9% 9% 0% 0% 100"},{hsnCode:"1235",productName:"Item 02",quantity:"12",taxableAmount:2500,taxRate:"0% 0% 18% 2% 0"},{hsnCode:"1236",productName:"Item 03",quantity:"12",taxableAmount:2600,taxRate:"9% 9% 0% 0% 100"},{hsnCode:"1237",productName:"Item 04",quantity:"12",taxableAmount:2400,taxRate:"0% 0% 18% 3% 0"}],transportId:"Self",transportDocNo:"123",transportDocDate:"08/02/2023",vehicleDetails:[],amountSummary:{totalTaxableAmount:10500,cgstAmount:504,sgstAmount:504,igstAmount:882,cessAmount:122,cessNonAdvolAmount:200,otherAmount:50,totalInvoiceAmount:12762}},m={invoiceNumber:"INV-14",invoiceDate:"06 Apr 2022",seller:{name:"DMart",gstin:"27BDLEP3836R2UT",address:"35/4, Datta Nagar Road Katraj Bypass Road, Opposite Trimurti Garden, Ambegaon Budruk, Pune, 27-MAHARASHTRA, 411046",mobile:"9999999999"},customer:{name:"Taniya",placeOfSupply:"27-MAHARASHTRA",billingAddress:"Phase 3, Hinjewadi Rajiv Gandhi Infotech Park, Pune, 27-MAHARASHTRA, 411057",shippingAddress:"Phase 3, Hinjewadi Rajiv Gandhi Infotech Park, Pune, 27-MAHARASHTRA, 411057"},items:[{itemNumber:1,itemName:"Pearlpet Plastic Bottles",hsnCode:"392330",mrp:99,sellingPrice:95.66,quantity:"6 KGS",amount:573.96,discount:3.34,discountPercentage:3.37},{itemNumber:2,itemName:"Haldiram's Bhujia Sev",hsnCode:"",mrp:224,sellingPrice:169.01,quantity:"1",amount:169.01,discount:54.99,discountPercentage:24.55},{itemNumber:3,itemName:"Premium Medjool Dates",hsnCode:"",mrp:2100,sellingPrice:2000.04,quantity:"2 KGS",amount:4e3,discount:99.96,discountPercentage:4.76},{itemNumber:4,itemName:"Comfort After Wash Fabric Conditioner - Morning Fresh",hsnCode:"",mrp:415,sellingPrice:365.2,quantity:"1 LTR",amount:365.2,discount:49.8,discountPercentage:12}],summary:{totalItems:4,totalQuantity:10,totalMRP:5432.81,totalSavings:324.81,total:5108,taxableAmount:4560.87,cgstRate:6,cgstAmount:273.65,sgstRate:6,sgstAmount:273.65,amountPayable:5108,amountInWords:"INR Five Thousand, One Hundred And Eight Rupees Only."},payment:{bankName:"Yes Bank",accountNumber:"99999999999999",ifsc:"YES99999",branch:"Kodihalli"},notes:"Thank you for the Business",termsAndConditions:["Goods once sold cannot be taken back or exchanged.","We are not the manufacturers, company will stand for warranty as per their terms and conditions.","Interest @24% p.a. will be charged for uncleared bills beyond 15 days.","Subject to local Jurisdiction."]},c=(R,T)=>{T!==null&&x(T)},y=()=>{window.print()};return i(l,{sx:{p:3,minHeight:"100vh",bgcolor:"#f9f9f9","@media print":{bgcolor:"#fff",p:0}},children:[i(l,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,"@media print":{display:"none"}},children:[e(n,{variant:"h4",fontWeight:600,sx:{color:t.palette.primary.main,"@media print":{display:"none"}},children:"Bill Tables Demo"}),i(l,{sx:{display:"flex",gap:2,alignItems:"center"},children:[i(D,{value:a,exclusive:!0,onChange:c,size:"large",children:[e(N,{value:"eway",children:"E-Way Bill"}),e(N,{value:"b2c",children:"B2C Bill"})]}),e(S,{variant:"contained",startIcon:e(f,{}),onClick:y,sx:{bgcolor:t.palette.secondary.main,"&:hover":{bgcolor:t.palette.secondary.dark}},children:"Print Current Bill"})]})]}),e(l,{children:a==="eway"?e(W,{data:o}):e(P,{data:m})})]})};export{P as B2CBillTable,E as BillTablesDemo,W as EWayBillTable,E as default};
