1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2008],{2008:(e,t,a)=>{a.r(t),a.d(t,{PrintableInvoice:()=>s,default:()=>r});var l=a(3741);function s(e){var t,a,s,r,i,d;let{invoice:x,company:n,uomMap:c,sellerProvinceLabel:m,buyerProvinceLabel:u,invoiceTypeLabel:h,hideScenario:o=!1}=e,N=null!=(t=null!=(a=x.invoiceNumber)?a:x.invoice_number)?t:null,g=x.items.some(e=>{var t;return Number(null!=(t=e.valueSalesExcludingST)?t:0)>0}),y=x.items.some(e=>{var t;return Number(null!=(t=e.fixedNotifiedValueOrRetailPrice)?t:0)>0}),p=x.items.some(e=>{var t;return Number(null!=(t=e.discount)?t:0)>0}),v=e=>{var t,a,l,s;return Number(null!=(t=e.salesTaxApplicable)?t:0)+Number(null!=(a=e.extraTax)?a:0)+Number(null!=(l=e.furtherTax)?l:0)+Number(null!=(s=e.fedPayable)?s:0)},b=x.items.reduce((e,t)=>e+v(t),0);return(0,l.jsxs)("div",{className:"rounded-lg bg-white p-6 shadow-sm dark:bg-gray-800 print:w-full print:rounded-none print:border-none print:p-8 print:shadow-none",children:[(0,l.jsxs)("div",{className:"mb-6 flex items-start justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-xl font-bold text-gray-900 dark:text-white",children:(null==n?void 0:n.name)||x.sellerBusinessName}),(0,l.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:["NTN/CNIC: ",(null==n?void 0:n.ntn)||x.sellerNTNCNIC]}),(0,l.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:["Province: ",m||""]}),(0,l.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:(null==n?void 0:n.address)||x.sellerAddress})]}),(0,l.jsxs)("div",{className:"text-right",children:[(0,l.jsx)("div",{className:"text-lg font-semibold",children:"Invoice"}),N&&(0,l.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Invoice Number: ",N]}),(0,l.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Type: ",h||""]}),(0,l.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Date: ",x.invoiceDate]}),(0,l.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Ref: ",x.invoiceRefNo]}),!o&&(0,l.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Scenario: ",x.scenarioId]})]})]}),(0,l.jsx)("div",{className:"mb-6 grid gap-4 md:grid-cols-2",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-1 text-sm font-medium text-gray-800 dark:text-gray-200",children:"Bill To"}),(0,l.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:x.buyerBusinessName}),(0,l.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:["Registration Type: ",x.buyerRegistrationType]}),(0,l.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:["NTN/CNIC: ",x.buyerNTNCNIC]}),(0,l.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:["Province: ",u||""]}),(0,l.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:x.buyerAddress})]})}),(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"responsive-table min-w-full divide-y divide-gray-200 text-sm dark:divide-gray-700",children:[(0,l.jsx)("thead",{className:"bg-gray-50 dark:bg-gray-700/30",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"HS Code"}),(0,l.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Description"}),(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Qty"}),(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"UoM"}),(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Rate"}),g&&(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Value Excl. ST"}),y&&(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Fixed / Notified / Retail Price"}),(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Tax (All)"}),(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Withheld Tax"}),p&&(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Discount"}),(0,l.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Total Values"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:x.items.map((e,t)=>{var a,s,r,i;return(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{className:"px-3 py-2","data-label":"HS Code",children:e.hsCode}),(0,l.jsx)("td",{className:"px-3 py-2","data-label":"Description",children:e.productDescription}),(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Qty",children:Number(null!=(a=e.quantity)?a:0).toLocaleStr
1ing()}),(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"UoM",children:(e=>{var t,a;let l=null==e?"":String(e).trim();if(!l)return"";let s=l.toUpperCase();return null!=(t=null!=(a=null==c?void 0:c.get(s))?a:null==c?void 0:c.get(l))?t:""})(e.uoM)}),(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Rate",children:e.rate}),g&&(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Value Excl. ST",children:Number(null!=(s=e.valueSalesExcludingST)?s:0)>0?Number(e.valueSalesExcludingST).toFixed(2):"â"}),y&&(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Fixed / Notified / Retail Price",children:Number(null!=(r=e.fixedNotifiedValueOrRetailPrice)?r:0)>0?Number(e.fixedNotifiedValueOrRetailPrice).toFixed(2):"â"}),(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Tax (All)",children:v(e).toFixed(2)}),(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Withheld Tax",children:Number(e.salesTaxWithheldAtSource).toFixed(2)}),p&&(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Discount",children:Number(null!=(i=e.discount)?i:0)>0?Number(e.discount).toFixed(2):"â"}),(0,l.jsx)("td",{className:"px-3 py-2 text-right","data-label":"Total Values",children:Number(e.totalValues).toFixed(2)})]},t)})})]})}),(0,l.jsx)("div",{className:"mt-6 flex flex-col gap-4 md:flex-row md:justify-end",children:(0,l.jsxs)("div",{className:"rounded-md bg-gray-50 p-4 text-sm dark:bg-gray-700/50 md:w-1/4 lg:w-1/5 md:ml-auto",children:[(0,l.jsx)("div",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Tax Info"}),(0,l.jsxs)("div",{className:"mt-2 text-gray-600 dark:text-gray-300",children:["Tax (All): ",b.toFixed(2)]}),(0,l.jsxs)("div",{className:"text-gray-600 dark:text-gray-300",children:["FED Payable: ",Number(null!=(s=x.thirdScheduleTaxAmount)?s:0).toFixed(2)]}),(0,l.jsxs)("div",{className:"text-gray-600 dark:text-gray-300",children:["Sales Tax: ",Number(null!=(r=x.totalTaxCharged)?r:0).toFixed(2)]}),(0,l.jsxs)("div",{className:"text-gray-600 dark:text-gray-300",children:["Further Tax: ",Number(null!=(i=x.furtherTaxAmount)?i:0).toFixed(2)]}),(0,l.jsxs)("div",{className:"text-gray-600 dark:text-gray-300",children:["Extra Tax: ",Number(null!=(d=x.extraTaxAmount)?d:0).toFixed(2)]})]})})]})}a(7609);let r=s}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.