function tConvert(e){var e=new Date(e),e=(time_s=e.getHours()+":"+e.getMinutes()).split(":"),t=e[0],e=e[1],n=12<=t?"PM":"AM";return(t=(t%=12)||12)+":"+(e<10?"0"+e:e)+" "+n}var str_dt=function(e){var e=new Date(e),t=""+["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],n=""+e.getDate(),e=e.getFullYear();return t.length<2&&(t="0"+t),[(n=n.length<2?"0"+n:n)+" "+t,e].join(", ")};if(null!==localStorage.getItem("invoices-list")&&null!==localStorage.getItem("option")&&null!==localStorage.getItem("invoice_no")){var invoices_list=localStorage.getItem("invoices-list"),options=localStorage.getItem("option"),invoice_no=localStorage.getItem("invoice_no"),invoices=JSON.parse(invoices_list);let t=invoices.find(e=>e.invoice_no===invoice_no);if(""!=t&&"view-invoice"==options){let e;switch(t.status){case"Paid":e="success";break;case"Refund":e="primary";break;case"Unpaid":e="warning";break;case"Cancel":e="danger"}document.getElementById("legal-register-no").innerHTML=t.company_details.legal_registration_no,document.getElementById("email").innerHTML=t.company_details.email,document.getElementById("website").href=t.company_details.website,document.getElementById("website").innerHTML=t.company_details.website,document.getElementById("contact-no").innerHTML=t.company_details.contact_no,document.getElementById("address-details").innerHTML=t.company_details.address,document.getElementById("zip-code").innerHTML=t.company_details.zip_code,document.getElementById("invoice-no").innerHTML=t.invoice_no,document.getElementById("invoice-date").innerHTML=str_dt(t.date),document.getElementById("invoice-time").innerHTML=tConvert(t.date),document.getElementById("payment-status").innerHTML=t.status,document.getElementById("payment-status").classList.replace("bg-success-subtle text-success","badge-soft-"+e),document.getElementById("total-amount").innerHTML=t.invoice_amount,document.getElementById("billing-name").innerHTML=t.billing_address.full_name,document.getElementById("billing-address-line-1").innerHTML=t.billing_address.address,document.getElementById("billing-phone-no").innerHTML=t.billing_address.phone,document.getElementById("billing-tax-no").innerHTML=t.billing_address.tax,document.getElementById("shipping-name").innerHTML=t.shipping_address.full_name,document.getElementById("shipping-address-line-1").innerHTML=t.shipping_address.address,document.getElementById("shipping-phone-no").innerHTML=t.shipping_address.phone,document.getElementById("products-list").innerHTML="";var paroducts_list=t.prducts,counter=1,order_summary=(Array.from(paroducts_list).forEach(function(e){product_data=` `+counter+` `+e.product_name+`

`+e.product_details+`

`+e.rates+` `+e.quantity+` $`+e.amount+` `,document.getElementById("products-list").innerHTML+=product_data,counter++}),`
Sub Total $`+t.order_summary.sub_total+`
Estimated Tax (12.5%) $`+t.order_summary.estimated_tex+`
Discount (VELZON15) - $`+t.order_summary.discount+`
Shipping Charge $`+t.order_summary.shipping_charge+`
Total Amount $`+t.order_summary.total_amount+`
`);document.getElementById("products-list").innerHTML+=order_summary,document.getElementById("payment-method").innerHTML=t.payment_details.payment_method,document.getElementById("card-holder-name").innerHTML=t.payment_details.card_holder_name,document.getElementById("card-number").innerHTML=t.payment_details.card_number,document.getElementById("card-total-amount").innerHTML=t.payment_details.total_amount,document.getElementById("note").innerHTML=t.notes}}