1import{a as ga,b as Nt,c as lt,d as Dt}from"./chunk-QOE2KOVP.js";import{a as Te}from"./chunk-E4WIPNPO.js";import{a as z}from"./chunk-TEESABZV.js";import{a as Ki}from"./chunk-HNQW7QF3.js";import{a as Jt}from"./chunk-F3RX7ABR.js";import{b as va}from"./chunk-AQ2FKTCJ.js";import{a as fa}from"./chunk-IIIRTLKU.js";import{a as pi}from"./chunk-OJD2WZJ4.js";import{a as da,d as ca,f as pa,g as ma,h as ua}from"./chunk-YRSFCREV.js";import{a as ki,b as Fi,c as _a}from"./chunk-DK3VUX5E.js";import{Aa as Z,Ab as ai,Ca as Hi,Cb as oa,D as Ht,Db as sa,Ea as De,G as Re,H as Qn,I as Kt,J as kt,K as Ft,L as Kn,M as Zn,N as Jn,Oa as ae,P as Qi,Pa as ut,S as rt,b as L,cb as Gt,f as Lt,g as vt,hb as ra,ib as tt,j as Bn,jb as la,la as Yi,m as dt,na as Zt,ra as Je,t as Ze,ta as Xe,tb as vi,ua as et,va as ta,xb as Le,ya as ia}from"./chunk-LAN6LAL4.js";import{i as It,j as Hn,k as Mt,l as na,u as aa}from"./chunk-AGFO3ORX.js";import{f as Yn,m as Xn,p as Se,q as ea}from"./chunk-JTVOOMEQ.js";import{a as Qt}from"./chunk-VBJOJ4QA.js";import{g as Ae,l as Et,m as Wn}from"./chunk-2JIXHQVY.js";import{c as H}from"./chunk-APMNTTKR.js";import{N as Rn,Z as Ln,ga as qn,pa as bt,sa as Gn}from"./chunk-ETVAUZGB.js";import"./chunk-CARY4E7O.js";import{a as ge}from"./chunk-MHKUR5ZH.js";import"./chunk-JYPO2ME6.js";import{a as ni}from"./chunk-U2X3MT2O.js";import{$d as Ke,Ab as I,Ad as Vi,Dd as Ne,Fd as E,G as Sn,Gb as S,Gc as Pn,Ib as p,Id as Pe,J as Cn,Jd as Ie,Kc as nt,Lb as Pi,Lc as J,Ld as zi,Mb as ii,Mc as W,Md as qt,Nc as pt,Nd as _i,O as En,Oa as q,Oc as mt,Od as Yt,Pd as Pt,Qb as N,Qd as Oe,Rb as V,Rd as at,Sb as B,Sc as On,Sd as Oi,Ta as l,Tb as w,Ua as T,Ub as n,Uc as Rt,Ud as We,Vb as f,Vd as yt,W as In,Wb as m,Wc as st,Wd as St,Xb as D,Xd as Qe,Yb as wt,Yd as Ye,Zb as se,Zd as He,_c as kn,ac as ue,ad as Fn,ae as Un,bc as _e,be as gt,cc as ve,ce as Wi,d as Gi,da as ji,de as Ot,e as ti,ga as Dn,gb as u,gc as Ce,ge as jn,hb as Be,hc as ze,hd as Mn,he as Ct,ib as s,ic as wn,ie as ft,jb as $e,jc as rn,jd as An,je as $n,kb as re,ke as zn,m as ui,ma as R,mb as Ni,na as $i,pc as _,qc as v,rc as U,ub as i,uc as P,va as b,vb as t,vd as de,wa as y,wb as x,wd as Nn,x as Ui,xa as an,xb as F,xd as K,ya as Tn,yb as M,yc as Wt,yd as Ee,zd as Vn}from"./chunk-2YIY45QY.js";import{a as A,b as j,d as Bt,h as yn}from"./chunk-BQWXLU4Q.js";var vr=a=>({sidebarCompactMode:a}),gr=()=>({exact:!0}),ha=(()=>{class a{constructor(e,o){this.breakpointObserver=e,this.router=o,this.isSidebarCompact=!1}isCustomerInvoiceActive(){let e=this.router.url;return e.includes("/receivable-purchase-orders/send")?!0:e.includes("/receivable-invoices/create-from-po")?!1:e.includes("/receivable-invoices")?!0:e.includes("/receivable-purchase-orders")&&/[?&]invoice(Id|Type)=/i.test(e)}isSalesOrderActive(){let e=this.router.url;return e.includes("/receivable-invoices/create-from-po")||e.includes("/receivable-work-orders")?!0:e.includes("/receivable-purchase-orders/send")||!e.includes("/receivable-purchase-orders")?!1:!/[?&]invoice(Id|Type)=/i.test(e)}isVendorBillActive(){let e=this.router.url;return e.includes("/payable-invoices")?!0:e.includes("/payable-payments/po")&&/[?&]origin=vendor-bills/i.test(e)?!/[?&]pay=true/i.test(e):!1}isPaymentsActive(){let e=this.router.url;return!(!e.includes("/payable-payments")||e.includes("/payable-payments/po")&&/[?&]origin=vendor-bills/i.test(e)&&!/[?&]pay=true/i.test(e))}isPurchaseOrderActive(){let e=this.router.url;return e.includes("/payable-purchase-orders")||e.includes("/payable-work-orders")}ngOnInit(){this.breakpointObserver.observe(["(max-width: 1400px)"]).subscribe(e=>{this.isSidebarCompact=e.matches})}static{this.\u0275fac=function(o){return new(o||a)(T(Rn),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-finance-layout"]],decls:101,vars:30,consts:[[1,"commonModuleLayout-container",3,"ngClass"],[1,"commonModuleLayout-sidebar"],[1,"nav-menu"],["routerLink","./","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"routerLinkActiveOptions","ngbPopover"],[1,"ri-dashboard-line"],["appTranslate",""],["appTranslate","",1,"commonModuleLayout-sidebar-title"],["routerLink","./payable-purchase-orders","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-bill-line"],["routerLink","./payable-invoices","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],["routerLink","./payable-payments","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-hand-coin-line"],["routerLink","./payable-debit-notes","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-exchange-box-line"],["routerLink","./payable-credit-notes","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],["routerLink","./payable-reports","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-folder-chart-line"],["routerLink","./receivable-purchase-orders","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],["routerLink","./receivable-invoices","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-article-line"],["routerLink","./receivable-receipts","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-receipt-line"],["routerLink","./receivable-credit-notes","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],["routerLink","./receivable-debit-notes","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],["routerLink","./receivable-reports","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],["routerLink","./bank-accounts","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-bank-line"],["routerLink","./my-documents","routerLinkActive","active","placement","right","triggers","mouseenter:mouseleave","popoverClass","sidebarPopover","container","body",3,"ngbPopover"],[1,"ri-folder-upload-line"],["type","button",1,"btn","commonModuleLayout-sidebar-btn",3,"click"],[1,"ri-arrow-left-double-line"],["data-copilot","closed",1,"commonModuleLayout-content","fin-copilot-shell","app-shell"],["module","finance","name","Finance C
1opilot","greeting","Hi! I'm Vipani's Finance Copilot. Ask me about invoices, payments, credit notes and what is due.","placeholder","Ask about invoices, payments\u2026","shellSelector",".fin-copilot-shell.app-shell"]],template:function(o,r){o&1&&(i(0,"div",0)(1,"div",1)(2,"nav",2)(3,"ul")(4,"li")(5,"a",3),x(6,"i",4),i(7,"span",5),n(8,"Dashboard"),t()()(),i(9,"li"),x(10,"hr"),t(),i(11,"li")(12,"h4",6),n(13,"Payables "),t()(),i(14,"li")(15,"a",7),x(16,"i",8),i(17,"span",5),n(18,"Purchase Orders"),t()()(),i(19,"li")(20,"a",9),x(21,"i",8),i(22,"span",5),n(23,"Vendor Bills "),t()()(),i(24,"li")(25,"a",10),x(26,"i",11),i(27,"span",5),n(28,"Payments"),t()()(),i(29,"li")(30,"a",12),x(31,"i",13),i(32,"span",5),n(33,"Debit Notes Issued "),t()()(),i(34,"li")(35,"a",14),x(36,"i",13),i(37,"span",5),n(38,"Credit Notes Received"),t()()(),i(39,"li")(40,"a",15),x(41,"i",16),i(42,"span",5),n(43,"AP Reports"),t()()(),i(44,"li"),x(45,"hr"),t(),i(46,"li")(47,"h4",6),n(48," Receivables "),t()(),i(49,"li")(50,"a",17),x(51,"i",8),i(52,"span",5),n(53,"Sales Orders"),t()()(),i(54,"li")(55,"a",18),x(56,"i",19),i(57,"span",5),n(58,"Customer Invoices"),t()()(),i(59,"li")(60,"a",20),x(61,"i",21),i(62,"span",5),n(63,"Receipts"),t()()(),i(64,"li")(65,"a",22),x(66,"i",13),i(67,"span",5),n(68,"Credit Notes Issued"),t()()(),i(69,"li")(70,"a",23),x(71,"i",13),i(72,"span",5),n(73,"Debit Notes Received"),t()()(),i(74,"li")(75,"a",24),x(76,"i",16),i(77,"span",5),n(78,"AR Reports"),t()()(),i(79,"li"),x(80,"hr"),t(),i(81,"li")(82,"h4",6),n(83,"Banking "),t()(),i(84,"li")(85,"a",25),x(86,"i",26),i(87,"span",5),n(88,"Bank Accounts"),t()()(),i(89,"li"),x(90,"hr"),t(),i(91,"li")(92,"a",27),x(93,"i",28),i(94,"span",5),n(95,"My Documents"),t()()()()(),i(96,"button",29),S("click",function(){return r.isSidebarCompact=!r.isSidebarCompact}),x(97,"i",30),t()(),i(98,"div",31),x(99,"router-outlet")(100,"app-common-ai-chat",32),t()()),o&2&&(s("ngClass",ze(27,vr,r.isSidebarCompact)),l(5),s("routerLinkActiveOptions",Ce(29,gr))("ngbPopover",r.isSidebarCompact?"Dashboard":null),l(10),re("active",r.isPurchaseOrderActive()),s("ngbPopover",r.isSidebarCompact?"Purchase Orders":null),l(5),re("active",r.isVendorBillActive()),s("ngbPopover",r.isSidebarCompact?"Vendor Bills ":null),l(5),re("active",r.isPaymentsActive()),s("ngbPopover",r.isSidebarCompact?"Payments":null),l(5),s("ngbPopover",r.isSidebarCompact?" Debit Notes":null),l(5),s("ngbPopover",r.isSidebarCompact?" Credit Notes Received":null),l(5),s("ngbPopover",r.isSidebarCompact?"AP Reports":null),l(10),re("active",r.isSalesOrderActive()),s("ngbPopover",r.isSidebarCompact?"Sales Orders":null),l(5),re("active",r.isCustomerInvoiceActive()),s("ngbPopover",r.isSidebarCompact?" Customer Invoices":null),l(5),s("ngbPopover",r.isSidebarCompact?"Receipts":null),l(5),s("ngbPopover",r.isSidebarCompact?"Credit Notes Issued":null),l(5),s("ngbPopover",r.isSidebarCompact?"Debit Notes":null),l(5),s("ngbPopover",r.isSidebarCompact?"AR Reports":null),l(10),s("ngbPopover",r.isSidebarCompact?"Bank Accounts":null),l(7),s("ngbPopover",r.isSidebarCompact?"My Documents":null))},dependencies:[nt,Nn,Ee,Vn,oa,Se,L,ra],styles:[".commonModuleLayout-content.app-shell[data-copilot=open][_ngcontent-%COMP%]{padding-right:calc(var(--copilot-width) + var(--CRManagement-inside-gap, 20px));transition:padding-right var(--transition-base, .2s ease)}.commonModuleLayout-content.app-shell[data-copilot=closed][_ngcontent-%COMP%]{padding-right:calc(var(--copilot-rail-width) + var(--CRManagement-inside-gap, 20px));transition:padding-right var(--transition-base, .2s ease)}.commonModuleLayout-content.app-shell[data-copilot=fullscreen][_ngcontent-%COMP%]{padding-right:var(--CRManagement-inside-gap, 20px)}@media (max-width: 900px){.commonModuleLayout-content.app-shell[data-copilot=open][_ngcontent-%COMP%], .commonModuleLayout-content.app-shell[data-copilot=closed][_ngcontent-%COMP%]{padding-right:var(--CRManagement-inside-gap, 20px)}}"]})}}return a})();var fr=["poNumberTemplate"],hr=["sellerPoNumberTemplate"],xr=["sellerInvoiceIdTemplate"],br=["sellerActionsTemplate"],yr=["invoicePoNumberTemplate"],Sr=["invoiceIdTemplate"],Cr=["totalAmountTemplate"],Er=["statusTemplate"],Ir=["actionsTemplate"],Dr=["invoiceActionsTemplate"],Tr=["paymentActionsTemplate"],wr=["paymentStatusTemplate"],Pr=()=>["/finance-management/payable-purchase-orders"],Or=()=>["/finance-management/receivable-purchase-orders"],kr=()=>["/finance-management/payable-invoices"],Fr=()=>["/finance-management/payable-payments"];function Mr(a,d){if(a&1&&(i(0,"div",29)(1,"div",30)(2,"div",31),x(3,"img",32),t(),i(4,"div",33)(5,"h6",34),n(6),t(),i(7,"h5",35),n(8),_(9,"numFormat"),t(),i(10,"span",36),x(11,"i"),n(12),t()()()()),a&2){let e=d.$implicit,o=p();l(2),$e("background-color",e.color_code),l(),s("src",e.image,q),l(3),f(e.title),l(2),f(U(9,8,e.value,o.kpiCurrency(e))),l(3),Ni(e.status==="up"?"ri-arrow-up-s-line":"ri-arrow-down-s-line"),l(),m(" ",e.percentage,"")}}function Ar(a,d){if(a&1&&(i(0,"div",29)(1,"div",30)(2,"div",31),x(3,"img",32),t(),i(4,"div",33)(5,"h6",34),n(6),t(),i(7,"h5",35),n(8),_(9,"numFormat"),t(),i(10,"span",36),x(11,"i"),n(12),t()()()()),a&2){let e=d.$implicit,o=p();l(2),$e("background-color",e.color_code),l(),s("src",e.image,q),l(3),f(e.title),l(2),f(U(9,8,e.value,o.kpiCurrency(e))),l(3),Ni(e.status==="up"?"ri-arrow-up-s-line":"ri-arrow-down-s-line"),l(),m(" ",e.percentage,"")}}function Nr(a,d){if(a&1){let e=I();
1i(0,"button",37),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.id,r.source))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function Vr(a,d){if(a&1){let e=I();i(0,"button",37),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onSellerPoClick(r.status_code,r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function Br(a,d){if(a&1){let e=I();i(0,"button",37),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onSellerInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function Rr(a,d){if(a&1){let e=I();i(0,"button",37),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.po_id,r.source))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function Lr(a,d){if(a&1){let e=I();i(0,"button",37),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function qr(a,d){if(a&1&&(i(0,"div",40)(1,"ul",41)(2,"li")(3,"span",42),n(4,"Gross Total:"),t(),i(5,"span"),n(6),_(7,"numFormat"),t()(),i(8,"li")(9,"span",42),n(10,"Discount:"),t(),i(11,"span"),n(12),_(13,"numFormat"),t()(),i(14,"li")(15,"span",42),n(16,"Net Total:"),t(),i(17,"span"),n(18),_(19,"numFormat"),t()(),i(20,"li")(21,"span",42),n(22,"GST:"),t(),i(23,"span"),n(24),_(25,"numFormat"),t()(),i(26,"li")(27,"span",42),n(28,"Logistics:"),t(),i(29,"span"),n(30),_(31,"numFormat"),t()(),i(32,"li")(33,"span",42),n(34,"Insurance:"),t(),i(35,"span"),n(36),_(37,"numFormat"),t()(),i(38,"li")(39,"span",42),n(40,"Total Payable:"),t(),i(41,"span"),n(42),_(43,"numFormat"),t()()()()),a&2){let e=p().$implicit,o=p();l(6),f(U(7,7,e.gross_total,o.kpiCurrency(e))),l(6),m("- ",U(13,10,e.discount_amount,o.kpiCurrency(e)),""),l(6),f(U(19,13,e.net_amount,o.kpiCurrency(e))),l(6),m("+ ",U(25,16,e.gst_amount,o.kpiCurrency(e)),""),l(6),m("+ ",U(31,19,e.logistics_charges,o.kpiCurrency(e)),""),l(6),m("+ ",U(37,22,e.insurance_charges,o.kpiCurrency(e)),""),l(6),f(U(43,25,e.total_amount,o.kpiCurrency(e)))}}function Gr(a,d){if(a&1&&(i(0,"span",38),n(1),_(2,"numFormat"),u(3,qr,44,28,"ng-template",null,12,P),x(5,"i",39),t()),a&2){let e=d.$implicit,o=w(4),r=p();l(),m(" ",U(2,2,e.total_amount,r.kpiCurrency(e))," "),l(4),s("ngbPopover",o)}}function Ur(a,d){if(a&1&&(i(0,"span",43),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function jr(a,d){if(a&1&&(i(0,"span",43),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function $r(a,d){if(a&1){let e=I();i(0,"button",51),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deletePo(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",49),n(4,"Delete"),t()()}}function zr(a,d){if(a&1){let e=I();i(0,"button",44),x(1,"i",45),t(),i(2,"mat-menu",46,13)(4,"button",47),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.id,r.source))}),i(5,"mat-icon",48),n(6,"visibility"),t(),i(7,"span",49),n(8,"View PO"),t()(),u(9,$r,5,0,"button",50),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}function Wr(a,d){if(a&1){let e=I();i(0,"button",44),x(1,"i",45),t(),i(2,"mat-menu",46,14)(4,"button",47),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onSellerPoClick(r.status_code,r.id))}),i(5,"mat-icon",48),n(6,"visibility"),t(),i(7,"span",49),n(8,"View PO"),t()()()}if(a&2){let e=w(3);s("matMenuTriggerFor",e)}}function Qr(a,d){if(a&1){let e=I();i(0,"button",51),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteInvoice(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",49),n(4,"Delete"),t()()}}function Yr(a,d){if(a&1){let e=I();i(0,"button",44),x(1,"i",45),t(),i(2,"mat-menu",46,15)(4,"button",47),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),i(5,"mat-icon",48),n(6,"visibility"),t(),i(7,"span",49),n(8,"View Invoice"),t()(),u(9,Qr,5,0,"button",50),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}function Hr(a,d){if(a&1){let e=I();i(0,"button",51),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deletePayment(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",49),n(4,"Delete"),t()()}}function Kr(a,d){if(a&1){let e=I();i(0,"button",44),x(1,"i",45),t(),i(2,"mat-menu",46,16)(4,"button",47),S("click",function(){let r=b
1(e).$implicit,c=p();return y(c.onPaymentClick(r.id))}),i(5,"mat-icon",48),n(6,"visibility"),t(),i(7,"span",49),n(8,"View Payment"),t()(),u(9,Hr,5,0,"button",50),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var xa=(()=>{class a{constructor(e,o,r,c){this.oService=e,this.router=o,this.notificationService=r,this.cService=c,this.cellTemplates={},this.sellerPoTemplates={},this.invoiceTemplates={},this.paymentTemplates={},this.tableData=[],this.sellerPoData=[],this.invoiceData=[],this.paymentData=[],this.pageLengths={},this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.tableConfig=this.createTableConfig("finance-payable-purchase-orders","PO-LIST",this.getPoColumns()),this.sellerPoTableConfig=this.createTableConfig("finance-receivable-purchase-orders","PO-LIST",this.getSellerPoColumns()),this.invoiceTableConfig=this.createTableConfig("finance-payables-invoices","PAYABLES-INVOICES-LIST",this.getInvoiceColumns()),this.paymentTableConfig=this.createTableConfig("finance-payables-payments","PAYABLES-PAYMENTS-LIST",this.getPaymentColumns()),this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate},this.sellerPoTemplates={po_number:this.sellerPoNumberTemplate,invoice_id:this.sellerInvoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate},this.invoiceTemplates={po_number:this.invoicePoNumberTemplate,invoice_id:this.invoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate},this.paymentTemplates={status:this.paymentStatusTemplate},this.getFinanceDashboardData()}createTableConfig(e,o,r){return{tableId:e,columns:r,features:{columnVisibility:!1,columnFilters:!0,tableSearch:!1,filterPanel:!1,pagination:!1,export:!1,refresh:!1,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:5,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:o,useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}getPoColumns(){return[{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"cdate",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Seller",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}getSellerPoColumns(){return[{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"po_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Buyer",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Buyer"}},{key:"qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}getInvoiceColumns(){return[{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice ID"}},{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"cdate",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Seller",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"offered_qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}getPaymentColumns(){return[{key:"payment_id",label:"Payment ID",selected:!0,dataType:"text",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Source ID"}},{key:"payment_date",label:"Payment Date",selected:!0,dataType:"date",sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice ID"}},{key:"seller_company_name",label:"Seller",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"invoice_amount",label:"Invoice Amount",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"paid_amount",label:"Paid Amount",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"payment_mode",label:"Payment Mode",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}fetchData(e,o,r,c,g,h="data"){this.checkAccess(r)&&(this.isLoading=!0,g(c).subscribe({next:C=>{this[o]=C.response?.[h]||[],this.pageLengths[e]=C.response?.total_count||0,this.tableActions=C.response?.actions,this.isLoading=!1},error:C=>{this.notificationService.showError(C.error?.message||"Failed to load data"),this.isLoading=!1}}))}
1onDataRequest(e){this.lastRequestParams=e,this.fetchData("finance-payable-purchase-orders","tableData","po_view",A(A({userType:"BUYER",perPage:e.pageLength,pageNumber:e.currentPage,status:"0",search:e.search||""},e.ordering&&{ordering:e.ordering}),e.filters&&Object.keys(e.filters).length>0&&{filters:e.filters}),o=>this.oService.getPolist(o))}onSellerPoDataRequest(e){this.lastRequestParams=e,this.fetchData("finance-receivable-purchase-orders","sellerPoData","po_view",A(A({userType:"SELLER",perPage:e.pageLength,pageNumber:e.currentPage,status:"0",search:e.search||""},e.ordering&&{ordering:e.ordering}),e.filters&&Object.keys(e.filters).length>0&&{filters:e.filters}),o=>this.oService.getPolist(o))}onInvoiceDataRequest(e){this.lastRequestParams=e,this.fetchData("finance-payables-invoices","invoiceData","invoice_view",A(A({user_type:"BUYER",currentPage:e.currentPage,pageLength:e.pageLength,status:e.status,search:e.search||""},e.ordering&&{ordering:e.ordering}),e.filters&&Object.keys(e.filters).length>0&&{filters:e.filters}),o=>this.oService.GetInvoiceList(o))}
1onPaymentDataRequest(e){this.lastRequestParams=e,this.fetchData("finance-payables-payments","paymentData","payments_view",A(A({user_type:"BUYER",currentPage:e.currentPage,pageLength:e.pageLength,status:e.status,search:e.search||""},e.ordering&&{ordering:e.ordering}),e.filters&&Object.keys(e.filters).length>0&&{filters:e.filters}),o=>this.oService.GetPaymentList(o),"list")}getFinanceDashboardData(){let e={from_date:"",to_date:""};this.oService.getDashboardData(e).subscribe({next:o=>{this.dashboardData=o.response?.buyer_info||[],this.sellerDashBoardData=o.response?.seller_info||[]},error:o=>{this.notificationService.showError(o.error?.message||"Failed to load dashboard data")}})}kpiCurrency(e){return e?.currency?e.currency:String(e?.title??"").toLowerCase().includes("days")?"":"INR"}onPoClick(e,o,r){if(!e||!o)return;let c=e==="po_generated"&&r==="Manual"?"po_sent":e;this.router.navigate([Nt.buyer.po[c]],{queryParams:{id:o,poId:o}})}onSellerPoClick(e,o){if(!o)return;let r=Nt.seller.po[e]||"finance-management/receivable-purchase-orders/seller-view";this.router.navigate([r],{queryParams:{id:o,poId:o}})}onSellerInvoiceClick(e,o,r){if(!e||!o||!r)return;let g={parent_invoice:"parent",child_invoice:"child"}[r]??r;this.router.navigate([lt.seller[g][e]],{queryParams:{invoiceId:o,invoiceType:g}})}onPaymentClick(e){this.router.navigate(["/finance-management/payable-payments/details",e])}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let g={parent_invoice:"parent",child_invoice:"child"}[r]??r;this.router.navigate([lt.buyer[g][e]],{queryParams:{invoiceId:o,invoiceType:g}})}deletePo(e){let o={doc_type:"PO",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode===200&&(this.notificationService.showSuccess("Purchase Order deleted successfully"),this.lastRequestParam
1s&&this.onDataRequest(this.lastRequestParams))}})}deleteInvoice(e){let o={doc_type:"INVOICE",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode===200&&(this.notificationService.showSuccess("Invoice Deleted Succesfully"),console.log("Deleted"))}})}deletePayment(e){let o={doc_type:"TAX_INVOICE",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode==200&&console.log("Deleted")}})}checkAccess(e){return!0}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-dashboard"]],viewQuery:function(o,r){if(o&1&&(N(fr,7),N(hr,7),N(xr,7),N(br,7),N(yr,7),N(Sr,7),N(Cr,7),N(Er,7),N(Ir,7),N(Dr,7),N(Tr,7),N(wr,7)),o&2){let c;V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.sellerPoNumberTemplate=c.first),V(c=B())&&(r.sellerInvoiceIdTemplate=c.first),V(c=B())&&(r.sellerActionsTemplate=c.first),V(c=B())&&(r.invoicePoNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first),V(c=B())&&(r.invoiceActionsTemplate=c.first),V(c=B())&&(r.paymentActionsTemplate=c.first),V(c=B())&&(r.paymentStatusTemplate=c.first)}},decls:64,vars:34,consts:[["poNumberTemplate",""],["sellerPoNumberTemplate",""],["sellerInvoiceIdTemplate",""],["invoicePoNumberTemplate",""],["invoiceIdTemplate",""],["totalAmountTemplate",""],["statusTemplate",""],["paymentStatusTemplate",""],["actionsTemplate",""],["sellerActionsTemplate",""],["invoiceActionsTemplate",""],["paymentActionsTemplate",""],["GrossTotalPopContent",""],["actionsMenu","matMenu"],["sellerActionsMenu","matMenu"],["invoiceActionsMenu","matMenu"],["paymentActionsMenu","matMenu"],["id","content",1,"sellerOrdersDashboardPage","mod-list-page"],[1,"row","align-items-center","mb-20"],[1,"col"],["appTranslate","",1,"mod-page-title","mb-0"],[1,"row","gut-row","gut-3","buyerOrdersDashboardPage__KpisRow"],["class","col-md-6 col-lg-4 col-xl-3",4,"ngFor","ngForOf"],[1,"mod-card","mt-30"],[1,"mod-card-header","border-bottom-0"],["appTranslate","",1,"mod-card-title"],["type","button","appTranslate","",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"routerLink"],[1,"mod-card-body","pt-0"],[3,"dataRequest","refresh","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],[1,"col-md-6","col-lg-4","col-xl-3"],[1,"mod-kpi-card"],[1,"mod-kpi-icon"],["fallback","assets/img/placeholdericon.png","alt","",1,"img-fluid",3,"src"],[1,"mod-kpi-content"],[1,"mod-kpi-label"],[1,"mod-kpi-value"],[1,"mod-kpi-trend"],["type","button",1,"mod-btn-action",3,"click"],[1,"d-inline-flex","align-items-center","text-nowrap"],["container","body","placement","auto","triggers","mouseenter:mouseleave",1,"ri-information-2-line","cursor-pointer","ml-1",3,"ngbPopover"],[1,"grossTotalPopContent"],[1,"list-unstyled"],["appTranslate","",1,"ml-0","pl-0","font-weight-normal"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["appTranslate",""],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"div",17)(1,"div",18)(2,"div",19)(3,"h1",20),n(4,"Finance Management"),t()()(),i(5,"div",21),u(6,Mr,13,11,"div",22)(7,Ar,13,11,"div",22),t(),i(8,"div",23)(9,"div",24)(10,"h2",25),n(11,"Purchase Orders"),t(),i(12,"button",26),n(13,"View All"),t()(),i(14,"div",27)(15,"data-table",28),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("refresh",function(){return b(c),y(r.onDataRequest(r.lastRequestParam
1s))}),t()()(),i(16,"div",23)(17,"div",24)(18,"h2",25),n(19,"Sales Orders"),t(),i(20,"button",26),n(21,"View All"),t()(),i(22,"div",27)(23,"data-table",28),S("dataRequest",function(h){return b(c),y(r.onSellerPoDataRequest(h))})("refresh",function(){return b(c),y(r.onSellerPoDataRequest(r.lastRequestParams))}),t()()(),i(24,"div",23)(25,"div",24)(26,"h2",25),n(27,"Vendor Bills"),t(),i(28,"button",26),n(29,"View All"),t()(),i(30,"div",27)(31,"data-table",28),S("dataRequest",function(h){return b(c),y(r.onInvoiceDataRequest(h))})("refresh",function(){return b(c),y(r.onInvoiceDataRequest(r.lastRequestParams))}),t()()(),i(32,"div",23)(33,"div",24)(34,"h2",25),n(35,"Payments"),t(),i(36,"button",26),n(37,"View All"),t()(),i(38,"div",27)(39,"data-table",28),S("dataRequest",function(h){return b(c),y(r.onPaymentDataRequest(h))})("refresh",function(){return b(c),y(r.onPaymentDataRequest(r.lastRequestParams))}),t()()()(),u(40,Nr,2,1,"ng-template",null,0,P)(42,Vr,2,1,"ng-template",null,1,P)(44,Br,2,1,"ng-template",null,2,P)(46,Rr,2,1,"ng-template",null,3,P)(48,Lr,2,1,"ng-template",null,4,P)(50,Gr,6,5,"ng-template",null,5,P)(52,Ur,2,3,"ng-template",null,6,P)(54,jr,2,3,"ng-template",null,7,P)(56,zr,10,2,"ng-template",null,8,P)(58,Wr,9,1,"ng-template",null,9,P)(60,Yr,10,2,"ng-template",null,10,P)(62,Kr,10,2,"ng-template",null,11,P)}if(o&2){let c=w(57),g=w(59),h=w(61),C=w(63);l(6),s("ngForOf",r.dashboardData),l(),s("ngForOf",r.sellerDashBoardData),l(5),s("routerLink",Ce(30,Pr)),l(3),s("config",r.tableConfig)("data",r.tableData)("totalRecords",(r.pageLengths["finance-payable-purchase-orders"]||0)>10?r.pageLengths["finance-payable-purchase-orders"]:0)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c),l(5),s("routerLink",Ce(31,Or)),l(3),s("config",r.sellerPoTableConfig)("data",r.sellerPoData)("totalRecords",(r.pageLengths["finance-receivable-purchase-orders"]||0)>10?r.pageLengths["finance-receivable-purchase-orders"]:0)("isLoading",r.isLoading)("cellTemplates",r.sellerPoTemplates)("actionsTemplate",g),l(5),s("routerLink",Ce(32,kr)),l(3),s("config",r.invoiceTableConfig)("data",r.invoiceData)("totalRecords",(r.pageLengths["finance-payables-invoices"]||0)>10?r.pageLengths["finance-payables-invoices"]:0)("isLoading",r.isLoading)("cellTemplates",r.invoiceTemplates)("actionsTemplate",h),l(5),s("routerLink",Ce(33,Fr)),l(3),s("config",r.paymentTableConfig)("data",r.paymentData)("totalRecords",(r.pageLengths["finance-payables-payments"]||0)>10?r.pageLengths["finance-payables-payments"]:0)("isLoading",r.isLoading)("cellTemplates",r.paymentTemplates)("actionsTemplate",C)}},dependencies:[J,W,Ee,Xe,Je,et,Re,Se,Lt,L,Le,ai],styles:["@media screen and (min-width: 1200px){.buyerOrdersDashboardPage__KpisRow[_ngcontent-%COMP%] [class*=col-][_ngcontent-%COMP%]{flex:0 0 25%;max-width:25%}}"]})}}return a})();var Zr=["poNumberTemplate"],Jr=["invoiceIdTemplate"],Xr=["sourceIdTemplate"],el=["taxInvoiceIdTemplate"],tl=["proformaIdTemplate"],il=["totalAmountTemplate"],nl=["statusTemplate"],al=["actionsTemplate"],rl=()=>["/finance-management/payable-invoices/create"];function ll(a,d){if(a&1){let e=I();i(0,"div",20)(1,"button",21),S("click",function(){b(e);let r=p();return y(r.downloadTemplate())}),x(2,"i",22),i(3,"span",23),n(4,"Download Template"),t()(),i(5,"div",24)(6,"button",25),x(7,"i",26),i(8,"span",23),n(9,"Add Invoice"),t()(),i(10,"div",27)(11,"button",28),x(12,"i",29),i(13,"span",23),n(14,"Manual Entry"),t()(),i(15,"button",30),S("click",function(){b(e);let r=p();return y(r.bulkupload())}),x(16,"i",31),i(17,"span",23),n(18,"Import File"),t()()()()()}a&2&&(l(11),s("routerLink",Ce(1,rl)))}function ol(a,d){if(a&1){let e=I();i(0,"div",32)(1,"button",33),x(2,"i",34),n(3),t(),i(4,"div",35)(5,"button",36),S("click",function(){b(e);let r=p();return y(r.setInvoiceType("INVOICE"))}),x(6,"i",37),i(7,"span",23),n(8,"Proforma Invoices"),t()(),i(9,"button",36),S("click",function(){b(e);let r=p();return y(r.setInvoiceType("TAX_INVOICE"))}),x(10,"i",38),i(11,"span",23),n(12,"Tax Invoices"),t()()()()}if(a&2){let e=p();l(3),m(" ",e.invoiceType==="INVOICE"?"Proforma Invoices":"Tax Invoices"," "),l(2),re("active",e.invoiceType==="INVOICE"),l(4),re("active",e.invoiceType==="TAX_INVOICE")}}function sl(a,d){if(a&1){let e=I();i(0,"button",40),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.onSourceClick(r))}),n(1),t()}if(a&2){let e=p().$implicit;s("title",e.display_source_id),l(),m(" ",e.display_source_id||"-"," ")}}function dl(a,d){if(a&1&&n(0),a&2){let e=p().$implicit;f(e.display_source_id||"-")}}function cl(a,d){if(a&1&&u(0,sl,2,2,"button",39)(1,dl,1,1,"ng-template",null,9,P),a&2){let e=d.$implicit,o=w(2);
1s("ngIf",e.source_id&&((e.source||"").toLowerCase()==="rfq"||(e.source||"").toLowerCase()==="auction"))("ngIfElse",o)}}function pl(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent",r.source))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function ml(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"child"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function ul(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.proforma_invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.proforma_invoice_id||"-"," ")}}function _l(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.po_id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function vl(a,d){if(a&1&&(i(0,"div",44)(1,"ul",45)(2,"li")(3,"span",46),n(4,"Gross Total:"),t(),i(5,"span"),n(6),_(7,"numFormat"),t()(),i(8,"li")(9,"span",46),n(10,"Discount:"),t(),i(11,"span"),n(12),_(13,"numFormat"),t()(),i(14,"li")(15,"span",46),n(16,"Net Total:"),t(),i(17,"span"),n(18),_(19,"numFormat"),t()(),i(20,"li")(21,"span",46),n(22,"GST:"),t(),i(23,"span"),n(24),_(25,"numFormat"),t()(),i(26,"li")(27,"span",46),n(28,"Logistics:"),t(),i(29,"span"),n(30),_(31,"numFormat"),t()(),i(32,"li")(33,"span",46),n(34,"Insurance:"),t(),i(35,"span"),n(36),_(37,"numFormat"),t()(),i(38,"li")(39,"span",46),n(40,"Total Payable:"),t(),i(41,"span"),n(42),_(43,"numFormat"),t()()()()),a&2){let e=p().$implicit,o=p();l(6),f(U(7,7,e.gross_total,o.kpiCurrency(e))),l(6),m("- ",U(13,10,e.discount_amount,o.kpiCurrency(e)),""),l(6),f(U(19,13,e.net_amount,o.kpiCurrency(e))),l(6),m("+ ",U(25,16,e.gst_amount,o.kpiCurrency(e)),""),l(6),m("+ ",U(31,19,e.logistics_charges,o.kpiCurrency(e)),""),l(6),m("+ ",U(37,22,e.insurance_charges,o.kpiCurrency(e)),""),l(6),f(U(43,25,e.total_amount,o.kpiCurrency(e)))}}function gl(a,d){if(a&1&&(i(0,"span",42),n(1),_(2,"numFormat"),u(3,vl,44,28,"ng-template",null,10,P),x(5,"i",43),t()),a&2){let e=d.$implicit,o=w(4),r=p();l(),m(" ",U(2,2,e.total_amount,r.kpiCurrency(e))," "),l(4),s("ngbPopover",o)}}function fl(a,d){if(a&1&&(i(0,"span",47),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function hl(a,d){if(a&1){let e=I();i(0,"button",54),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteAsn(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",23),n(4,"Delete"),t()()}}function xl(a,d){if(a&1){let e=I();i(0,"button",48),x(1,"i",49),t(),i(2,"mat-menu",50,11)(4,"button",51),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,c.invoiceType==="TAX_INVOICE"?"child":"parent"))}),i(5,"mat-icon",52),n(6,"visibility"),t(),i(7,"span",23),n(8,"View Invoice"),t()(),u(9,hl,5,0,"button",53),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var ln=(()=>{class a{constructor(e,o,r,c,g,h,C){this.oService=e,this.router=o,this.activatedRoute=r,this.snackBar=c,this.dialog=g,this.notificationService=h,this.cService=C,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.accessActions={},this.toolTipContent=Ze,this.invoiceType="INVOICE"}downloadTemplate(){this.oService.getInvoiceUploadTemplate().subscribe({next:e=>this.saveTemplateResponse(e,"invoice_upload_template.xlsx"),error:()=>this.notificationService.showError("Failed to download template")})}saveTemplateResponse(e,o){let r=e?.body??e,c=o,g=e?.headers?.get?.("content-disposition")?.match(/filename="(.+)"/);g?.[1]&&(c=g[1]);let h=window.URL.createObjectURL(r),C=document.createElement("a");C.href=h,C.download=c,document.body.appendChild(C),C.click(),document.body.removeChild(C),window.URL.revokeObjectURL(h)}ngOnInit(){this.cService.getModuleAccessList.subscribe(o=>{o&&(this.accessList=o)}),this.cService.getModuleWiseUserAccess({modules:["order_management"],userType:"BUYER"}).subscribe(o=>{this.accessActions=o?.response?.order_management?.actions||{}}),this.activatedRoute.snapshot.queryParamMap.get("invoiceType")==="TAX_INVOICE"&&(this.invoiceType="TAX_INVOICE"),this.initializeTableConfig(),this.initializeCellTemplates(),this.applyInvoiceTypeColumns()}proformaColumns(){return[{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice ID"}},{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"custom",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"proforma_created_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Seller",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"offered_qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}taxInvoiceColumns(){return[{key:"invoice_id",label:"Tax Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Tax Invoice ID"}},{key:"proforma_invoice_id",label:"Proforma ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Proforma ID"}},{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"proforma_created_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"name",label:"Seller",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"offered_qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Tax Invoice Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}buildTableConfig(e){return{tableId:"finance-payables-invoices",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"PAYABLES-INVOICES-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeTableConfig(){this.tableConfig=this.buildTableConfig(this.proformaColumns())}initializeCellTemplates(){this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,display_source_id:this.sourceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}onSourceClick(e){let o=(e?.source||"").toLowerCase();e?.source_id&&(o==="rfq"?this.router.navigate(["/rfq/buyer/rfq-details/"+e.source_id]):o==="auction"&&this.router.navigate(["/buyer-auction/buyer-auction-details/"+(e.source_main_id||e.source_id)]))}applyInvoiceTypeColumns(){this.invoiceType==="TAX_INVOICE"?(this.tableConfig=this.buildTableConfig(this.taxInvoiceColumns()),this.cellTemplates={invoice_id:this.taxInvoiceIdTemplate,proforma_invoice_id:this.proformaIdTemplate,po_number:this.poNumberTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}):(this.tableConfig=this.buildTableConfig(this.proformaColumns()),this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,display_source_id:this.sourceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate})}checkAccess(e){return!0}onDataRequest(e){if(!this.checkAccess("invoice_view"))return;
1this.lastRequestParams=e,this.isLoading=!0;let o={user_type:"BUYER",currentPage:e.currentPage??1,pageLength:e.pageLength??10,status:e.status||"",search:e.search||"",type:this.invoiceType};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.GetInvoiceList(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.total_count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}setInvoiceType(e){this.invoiceType!==e&&(this.invoiceType=e,this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{invoiceType:e},queryParamsHandling:"merge",replaceUrl:!0}),this.applyInvoiceTypeColumns(),this.lastRequestParams&&this.onDataRequest(j(A({},this.lastRequestParams),{currentPage:1})))}kpiCurrency(e){return e?.currency?e.currency:String(e?.title??"").toLowerCase().includes("days")?"":"INR"}deleteAsn(e){let o={doc_type:"INVOICE",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode===200&&(this.notificationService.showSuccess("Invoice Deleted Succesfully"),this.lastRequestParam
1s&&this.onDataRequest(this.lastRequestParams))}})}onExportRequest(e){let o={user_type:"BUYER",type:this.invoiceType,search:"",file_type:e.fileType,columns:e.columns},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportPOList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_invoices_list.pdf":"payable_invoices_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onPoClick(e,o){!e||!o||this.router.navigate([Nt.buyer.po[e]],{queryParams:{id:o,poId:o}})}onInvoiceClick(e,o,r,c){if(!e||!o||!r)return;let g;if(r==="parent_invoice"?g="parent":r==="child_invoice"?g="child":g=r,c==="Manual"){this.router.navigate(["finance-management/payable-invoices/approve"],{queryParams:{invoiceId:o,invoiceType:g,source:"Manual"}});return}this.router.navigate([lt.buyer[g][e]],{queryParams:{invoiceId:o,invoiceType:g,origin:"vendor-bills"}})}bulkupload(){this.dialog.open(Kt,{data:{type:"Finance_Management_invoice",role:"BUYER"},width:"50%",panelClass:"custom-dialog-container"})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(de),T(tt),T(Ae),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payables-invoices"]],viewQuery:function(o,r){if(o&1&&(N(Zr,7),N(Jr,7),N(Xr,7),N(el,7),N(tl,7),N(il,7),N(nl,7),N(al,7)),o&2){let c;V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.sourceIdTemplate=c.first),V(c=B())&&(r.taxInvoiceIdTemplate=c.first),V(c=B())&&(r.proformaIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:27,vars:8,consts:[["invoiceTypeFilter",""],["sourceIdTemplate",""],["invoiceIdTemplate",""],["taxInvoiceIdTemplate",""],["proformaIdTemplate",""],["poNumberTemplate",""],["totalAmountTemplate",""],["statusTemplate",""],["actionsTemplate",""],["plainSourceId",""],["GrossTotalPopContent",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],["class","col-md-auto d-flex justify-content-end align-items-center",4,"ngIf"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","refresh","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate","toolbarTemplate"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],["type","button",1,"mod-btn","mod-btn-outline-primary","mr-3",3,"click"],[1,"ri-table-2","mr-2"],["appTranslate",""],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],["type","button","matTooltipPosition","above",1,"dropdown-item",3,"click"],[1,"ri-import-line","font-18","pr-2"],[1,"dropdown","d-inline-block"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-outline-primary","dropdown-toggle"],[1,"ri-filter-3-line"],[1,"dropdown-menu"],["type","button",1,"dropdown-item",3,"click"],[1,"ri-file-list-line","mr-1"],[1,"ri-receipt-line","mr-1"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["type","button",1,"mod-btn-action",3,"click","title"],["type","button",1,"mod-btn-action",3,"click"],[1,"d-inline-flex","align-items-center","text-nowrap"],["container","body","placement","auto","triggers","mouseenter:mouseleave",1,"ri-information-2-line","cursor-pointer","ml-1",3,"ngbPopover"],[1,"grossTotalPopContent"],[1,"list-unstyled"],["appTranslate","",1,"ml-0","pl-0","font-weight-normal"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",12)(1,"div",13)(2,"div",14)(3,"h2",15),n(4,"Invoices"),t()(),u(5,ll,19,2,"div",16),t(),i(6,"div",17)(7,"div",18)(8,"data-table",19),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}
1)("exportRequest",function(h){return b(c),y(r.onExportRequest(h))})("refresh",function(){return b(c),y(r.onDataRequest(r.lastRequestParams))}),t()()(),u(9,ol,13,5,"ng-template",null,0,P)(11,cl,3,2,"ng-template",null,1,P)(13,pl,2,1,"ng-template",null,2,P)(15,ml,2,1,"ng-template",null,3,P)(17,ul,2,1,"ng-template",null,4,P)(19,_l,2,1,"ng-template",null,5,P)(21,gl,6,5,"ng-template",null,6,P)(23,fl,2,3,"ng-template",null,7,P)(25,xl,10,2,"ng-template",null,8,P),t()}if(o&2){let c=w(10),g=w(26);l(5),s("ngIf",r.accessActions==null?null:r.accessActions.invoice_create),l(3),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",g)("toolbarTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,Se,L,Le,ai]})}}return a})();var bl=["paymentIdTemplate"],yl=["poNumberTemplate"],Sl=["invoiceIdTemplate"],Cl=["statusTemplate"],El=["actionsTemplate"],Il=()=>["/finance-management/payable-payments/create"];function Dl(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPaymentClick(r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.payment_id||"-"," ")}}function Tl(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function wl(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.po_id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function Pl(a,d){if(a&1&&(i(0,"span",22),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function Ol(a,d){if(a&1){let e=I();i(0,"button",29),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteAsn(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",14),n(4,"Delete"),t()()}}function kl(a,d){if(a&1){let e=I();i(0,"button",23),x(1,"i",24),t(),i(2,"mat-menu",25,5)(4,"button",26),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPaymentClick(r.id))}),i(5,"mat-icon",27),n(6,"visibility"),t(),i(7,"span",14),n(8,"View Payment"),t()(),u(9,Ol,5,0,"button",28),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var ba=(()=>{class a{constructor(e,o,r,c,g,h){this.oService=e,this.router=o,this.snackBar=r,this.dialog=c,this.notificationService=g,this.cService=h,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"payment_id",label:"Payment ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Source ID"}},{key:"payment_date",label:"Payment Date",selected:!0,dataType:"date",sortable:{enabled:!0}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice ID"}},{key:"po_source",label:"Source",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Source"}},{key:"seller_company_name",label:"Seller Name",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"invoice_amount",label:"Invoice Amount",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"amount",label:"Paid Amount",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"payment_mode",label:"Payment Mode",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payables-payments",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!1,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"PAYABLES-PAYMENTS-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={payment_id:this.paymentIdTemplate,po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){if(!this.checkAccess("payments_view"))return;this.isLoading=!0;let o={user_type:"BUYER",currentPage:e.currentPage,pageLength:e.pageLength,status:e.status,search:e.search||""};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.GetPaymentList(o).subscribe({next:r=>{this.tableData=r.response?.list||[],this.pageLength=r.response?.total_count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}deleteAsn(e){let o={doc_type:"TAX_INVOICE",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode==200&&console.log("Deleted")}})}onExportRequest(e){let o={user_type:"BUYER",type:"PAYMENTS",search:"",file_type:e.fileType,columns:e.columns},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportPOList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_payments_list.pdf":"payable_payments_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onPoClick(e,o){!e||!o||this.router.navigate([Nt.buyer.po[e]],{queryParams:{id:o,poId:o}})}onPaymentClick(e){this.router.navigate(["/finance-management/payable-payments/details",e])}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.buyer[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}bulkupload(){this.dialog.open(Kt,{data:{type:"Finance_Management_payments",role:"BUYER"},width:"50%",panelClass:"custom-dialog-container"})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(Ae),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payable-payments"]],viewQuery:function(o,r){if(o&1&&(N(bl,7),N(yl,7),N(Sl,7),N(Cl,7),N(El,7)),o&2){let c;V(c=B())&&(r.paymentIdTemplate=c.first),V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:29,vars:8,consts:[["paymentIdTemplate",""],["invoiceIdTemplate",""],["poNumberTemplate",""],["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],["appTranslate",""],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",6)(1,"div",7)(2,"div",8)(3,"h2",9),n(4,"Payments"),t()(),i(5,"div",10)(6,"div",11)(7,"button",12),x(8,"i",13),i(9,"span",14),n(10,"Add New Payment"),t()(),i(11,"div",15)(12,"button",16),x(13,"i",17),i(14,"span",14),n(15,"Manual Entry"),t()()()()()(),i(16,"div",18)(17,"div",19)(18,"data-table",20),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}
1)("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(19,Dl,2,1,"ng-template",null,0,P)(21,Tl,2,1,"ng-template",null,1,P)(23,wl,2,1,"ng-template",null,2,P)(25,Pl,2,3,"ng-template",null,3,P)(27,kl,10,2,"ng-template",null,4,P),t()}if(o&2){let c=w(28);l(12),s("routerLink",Ce(7,Il)),l(6),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,L,Le]})}}return a})();var Fl=["poNumberTemplate"],Ml=["invoiceIdTemplate"],Al=["sourceIdTemplate"],Nl=["taxInvoiceIdTemplate"],Vl=["proformaIdTemplate"],Bl=["totalAmountTemplate"],Rl=["statusTemplate"],Ll=["actionsTemplate"],ql=()=>["/finance-management/receivable-invoices/create"];function Gl(a,d){if(a&1){let e=I();i(0,"div",20)(1,"button",21),S("click",function(){b(e);let r=p();return y(r.downloadTemplate())}),x(2,"i",22),i(3,"span",23),n(4,"Download Template"),t()(),i(5,"div",24)(6,"button",25),x(7,"i",26),i(8,"span",23),n(9,"Add Invoice"),t()(),i(10,"div",27)(11,"button",28),x(12,"i",29),i(13,"span",23),n(14,"Manual Entry"),t()(),i(15,"button",30),S("click",function(){b(e);let r=p();return y(r.bulkupload())}),x(16,"i",31),i(17,"span",23),n(18,"Import File"),t()()()()()}a&2&&(l(11),s("routerLink",Ce(1,ql)))}function Ul(a,d){if(a&1){let e=I();i(0,"div",32)(1,"button",33),x(2,"i",34),n(3),t(),i(4,"div",35)(5,"button",36),S("click",function(){b(e);let r=p();return y(r.setInvoiceType("INVOICE"))}),x(6,"i",37),i(7,"span",23),n(8,"Proforma Invoices"),t()(),i(9,"button",36),S("click",function(){b(e);let r=p();return y(r.setInvoiceType("TAX_INVOICE"))}),x(10,"i",38),i(11,"span",23),n(12,"Tax Invoices"),t()()()()}if(a&2){let e=p();l(3),m(" ",e.invoiceType==="INVOICE"?"Proforma Invoices":"Tax Invoices"," "),l(2),re("active",e.invoiceType==="INVOICE"),l(4),re("active",e.invoiceType==="TAX_INVOICE")}}function jl(a,d){if(a&1){let e=I();i(0,"button",40),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.onSourceClick(r))}),n(1),t()}if(a&2){let e=p().$implicit;s("title",e.display_source_id),l(),m(" ",e.display_source_id||"-"," ")}}function $l(a,d){if(a&1&&n(0),a&2){let e=p().$implicit;f(e.display_source_id||"-")}}function zl(a,d){if(a&1&&u(0,jl,2,2,"button",39)(1,$l,1,1,"ng-template",null,9,P),a&2){let e=d.$implicit,o=w(2);s("ngIf",e.source_id&&((e.source||"").toLowerCase()==="rfq"||(e.source||"").toLowerCase()==="auction"))("ngIfElse",o)}}function Wl(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function Ql(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"child"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function Yl(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.proforma_invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.proforma_invoice_id||"-"," ")}}function Hl(a,d){if(a&1){let e=I();i(0,"button",41),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.po_id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function Kl(a,d){if(a&1&&(i(0,"div",44)(1,"ul",45)(2,"li")(3,"span",46),n(4,"Gross Total"),t(),n(5,": "),i(6,"span"),n(7),_(8,"currency"),t()(),i(9,"li")(10,"span",46),n(11,"Discount"),t(),n(12,": "),i(13,"span"),n(14),_(15,"currency"),t()(),i(16,"li")(17,"span",46),n(18,"Net Total"),t(),n(19,": "),i(20,"span"),n(21),_(22,"currency"),t()(),i(23,"li")(24,"span",46),n(25,"GST"),t(),n(26,": "),i(27,"span"),n(28),_(29,"currency"),t()(),i(30,"li")(31,"span",46),n(32,"Logistics"),t(),n(33,": "),i(34,"span"),n(35),_(36,"currency"),t()(),i(37,"li")(38,"span",46),n(39,"Insurance"),t(),n(40,": "),i(41,"span"),n(42),_(43,"currency"),t()(),i(44,"li")(45,"span",46),n(46,"Total Payable"),t(),n(47,": "),i(48,"span"),n(49),_(50,"currency"),t()()()()),a&2){let e=p().$implicit,o=p();l(7),f(U(8,7,e.gross_total,o.kpiCurrency(e))),l(7),m("- ",U(15,10,e.discount_amount,o.kpiCurrency(e)),""),l(7),f(U(22,13,e.net_amount,o.kpiCurrency(e))),l(7),m("+ ",U(29,16,e.gst_amount,o.kpiCurrency(e)),""),l(7),m("+ ",U(36,19,e.logistics_charges,o.kpiCurrency(e)),""),l(7),m("+ ",U(43,22,e.insurance_charges,o.kpiCurrency(e)),""),l(7),f(U(50,25,e.total_amount,o.kpiCurrency(e)))}}function Zl(a,d){if(a&1&&(i(0,"span",42),n(1),_(2,"numFormat"),u(3,Kl,51,28,"ng-template",null,10,P),x(5,"i",43),t()),a&2){let e=d.$implicit,o=w(4),r=p();l(),m(" ",U(2,2,e.total_amount,r.kpiCurrency(e))," "),l(4),s("ngbPopover",o)}}function Jl(a,d){if(a&1&&(i(0,"span",47),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function Xl(a,d){if(a&1){let e=I();i(0,"button",54),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteAsn(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",23),n(4,"Delete"),t()()}}function eo(a,d){if(a&1){let e=I();i(0,"button",48),x(1,"i",49),t(),i(2,"mat-menu",50,11)(4,"button",51),S("click",function(){let r=b
1(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,c.invoiceType==="TAX_INVOICE"?"child":"parent"))}),i(5,"mat-icon",52),n(6,"visibility"),t(),i(7,"span",23),n(8,"View Invoice"),t()(),u(9,Xl,5,0,"button",53),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var ya=(()=>{class a{constructor(e,o,r,c,g,h,C){this.oService=e,this.router=o,this.activatedRoute=r,this.snackBar=c,this.dialog=g,this.notificationService=h,this.cService=C,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.accessActions={},this.toolTipContent=Ze,this.invoiceType="INVOICE"}downloadTemplate(){this.oService.getInvoiceUploadTemplate().subscribe({next:e=>this.saveTemplateResponse(e,"invoice_upload_template.xlsx"),error:()=>this.notificationService.showError("Failed to download template")})}saveTemplateResponse(e,o){let r=e?.body??e,c=o,g=e?.headers?.get?.("content-disposition")?.match(/filename="(.+)"/);g?.[1]&&(c=g[1]);let h=window.URL.createObjectURL(r),C=document.createElement("a");C.href=h,C.download=c,document.body.appendChild(C),C.click(),document.body.removeChild(C),window.URL.revokeObjectURL(h)}ngOnInit(){this.cService.getModuleAccessList.subscribe(o=>{o&&(this.accessList=o)}),this.cService.getModuleWiseUserAccess({modules:["order_management"],userType:"SELLER"}).subscribe(o=>{this.accessActions=o?.response?.order_management?.actions||{}}),this.activatedRoute.snapshot.queryParamMap.get("invoiceType")==="TAX_INVOICE"&&(this.invoiceType="TAX_INVOICE"),this.initializeTableConfig(),this.initializeCellTemplates(),this.applyInvoiceTypeColumns()}proformaColumns(){return[{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice ID"}},{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"custom",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"proforma_created_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Buyer",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Buyer"}},{key:"location",label:"Shipping Location",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"offered_qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}taxInvoiceColumns(){return[{key:"invoice_id",label:"Tax Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Tax Invoice ID"}},{key:"proforma_invoice_id",label:"Proforma ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Proforma ID"}},{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"proforma_created_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"name",label:"Buyer",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Buyer"}},{key:"offered_qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Tax Invoice Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}]}buildTableConfig(e){return{tableId:"finance-receivable-invoices",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"PAYABLES-INVOICES-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeTableConfig(){this.tableConfig=this.buildTableConfig(this.proformaColumns())}initializeCellTemplates(){this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,display_source_id:this.sourceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}onSourceClick(e){let o=(e?.source||"").toLowerCase();e?.source_id&&(o==="rfq"?this.router.navigate(["/rfq/sellers/rfq-details/"+e.source_id]):o==="auction"&&this.router.navigate(["/auction/seller-auction-details/"+(e.source_main_id||e.source_id)]))}kpiCurrency(e){return e?.currency?e.currency:String(e?.title??"").toLowerCase().includes("days")?"":"INR"}applyInvoiceTypeColumns(){this.invoiceType==="TAX_INVOICE"?(this.tableConfig=this.buildTableConfig(this.taxInvoiceColumns()),this.cellTemplates={invoice_id:this.taxInvoiceIdTemplate,proforma_invoice_id:this.proformaIdTemplate,po_number:this.poNumberTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}):(this.tableConfig=this.buildTableConfig(this.proformaColumns()),this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,display_source_id:this.sourceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate})}setInvoiceType(e){this.invoiceType!==e&&(this.invoiceType=e,this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{invoiceType:e},queryParamsHandling:"merge",replaceUrl:!0}
1),this.applyInvoiceTypeColumns(),this.lastRequestParams&&this.onDataRequest(j(A({},this.lastRequestParams),{currentPage:1})))}checkAccess(e){return!0}onDataRequest(e){if(!this.checkAccess("invoice_view"))return;this.lastRequestParams=e,this.isLoading=!0;let o={user_type:"SELLER",currentPage:e.currentPage??1,pageLength:e.pageLength??10,status:e.status||"",search:e.search||"",type:this.invoiceType};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.GetInvoiceList(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.total_count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}deleteAsn(e){let o={doc_type:"INVOICE",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode===200&&(this.notificationService.showSuccess("Invoice Deleted Succesfully"),this.lastRequestParam
1s&&this.onDataRequest(this.lastRequestParams))}})}onExportRequest(e){let o={user_type:"SELLER",type:this.invoiceType,search:"",file_type:e.fileType,columns:e.columns},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportPOList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"receivable_invoices_list.pdf":"receivable_invoices_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onPoClick(e,o){!e||!o||this.router.navigate([Nt.seller.po[e]],{queryParams:{id:o,poId:o}})}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.seller[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}bulkupload(){this.dialog.open(Kt,{data:{type:"Finance_Management_invoice",role:"SELLER"},width:"50%",panelClass:"custom-dialog-container"})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(de),T(tt),T(Ae),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-invoices"]],viewQuery:function(o,r){if(o&1&&(N(Fl,7),N(Ml,7),N(Al,7),N(Nl,7),N(Vl,7),N(Bl,7),N(Rl,7),N(Ll,7)),o&2){let c;V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.sourceIdTemplate=c.first),V(c=B())&&(r.taxInvoiceIdTemplate=c.first),V(c=B())&&(r.proformaIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:27,vars:8,consts:[["invoiceTypeFilter",""],["sourceIdTemplate",""],["invoiceIdTemplate",""],["taxInvoiceIdTemplate",""],["proformaIdTemplate",""],["poNumberTemplate",""],["totalAmountTemplate",""],["statusTemplate",""],["actionsTemplate",""],["plainSourceId",""],["GrossTotalPopContent",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],["class","col-md-auto d-flex justify-content-end align-items-center",4,"ngIf"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","refresh","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate","toolbarTemplate"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],["type","button",1,"mod-btn","mod-btn-outline-primary","mr-3",3,"click"],[1,"ri-table-2","mr-2"],["appTranslate",""],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],["type","button","matTooltipPosition","above",1,"dropdown-item",3,"click"],[1,"ri-import-line","font-18","pr-2"],[1,"dropdown","d-inline-block"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-outline-primary","dropdown-toggle"],[1,"ri-filter-3-line"],[1,"dropdown-menu"],["type","button",1,"dropdown-item",3,"click"],[1,"ri-file-list-line","mr-1"],[1,"ri-receipt-line","mr-1"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["type","button",1,"mod-btn-action",3,"click","title"],["type","button",1,"mod-btn-action",3,"click"],[1,"d-inline-flex","align-items-center","text-nowrap"],["container","body","placement","auto","triggers","mouseenter:mouseleave",1,"ri-information-2-line","cursor-pointer","ml-1",3,"ngbPopover"],[1,"grossTotalPopContent"],[1,"list-unstyled"],["appTranslate","",1,"ml-0","pl-0","font-weight-normal"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",12)(1,"div",13)(2,"div",14)(3,"h2",15),n(4,"Customer Invoices"),t()(),u(5,Gl,19,2,"div",16),t(),i(6,"div",17)(7,"div",18)(8,"data-table",19),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}
1)("exportRequest",function(h){return b(c),y(r.onExportRequest(h))})("refresh",function(){return b(c),y(r.onDataRequest(r.lastRequestParams))}),t()()(),u(9,Ul,13,5,"ng-template",null,0,P)(11,zl,3,2,"ng-template",null,1,P)(13,Wl,2,1,"ng-template",null,2,P)(15,Ql,2,1,"ng-template",null,3,P)(17,Yl,2,1,"ng-template",null,4,P)(19,Hl,2,1,"ng-template",null,5,P)(21,Zl,6,5,"ng-template",null,6,P)(23,Jl,2,3,"ng-template",null,7,P)(25,eo,10,2,"ng-template",null,8,P),t()}if(o&2){let c=w(10),g=w(26);l(5),s("ngIf",r.accessActions==null?null:r.accessActions.invoice_create),l(3),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",g)("toolbarTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,Se,L,Le,kn,ai]})}}return a})();var to=["receiptIdTemplate"],io=["poNumberTemplate"],no=["invoiceIdTemplate"],ao=["statusTemplate"],ro=["actionsTemplate"],lo=()=>["/finance-management/receivable-receipts/create"];function oo(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onReceiptClick(r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.payment_id||"-"," ")}}function so(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function co(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.po_id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function po(a,d){if(a&1&&(i(0,"span",22),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function mo(a,d){if(a&1){let e=I();i(0,"button",29),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteAsn(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",14),n(4,"Delete"),t()()}}function uo(a,d){if(a&1){let e=I();i(0,"button",23),x(1,"i",24),t(),i(2,"mat-menu",25,5)(4,"button",26),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onReceiptClick(r.id))}),i(5,"mat-icon",27),n(6,"visibility"),t(),i(7,"span",14),n(8,"View Receipt"),t()(),u(9,mo,5,0,"button",28),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var Sa=(()=>{class a{constructor(e,o,r,c,g){this.oService=e,this.router=o,this.snackBar=r,this.notificationService=c,this.cService=g,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"payment_id",label:"Receipt ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Receipt ID"}},{key:"payment_date",label:"Receipt Date",selected:!0,dataType:"date",sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"payment_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice ID"}},{key:"po_source",label:"Source",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Source"}},{key:"buyer_company_name",label:"Buyer Name",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Buyer"}},{key:"invoice_amount",label:"Invoice Amount",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"amount",label:"Received Amount",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"payment_mode",label:"Payment Mode",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payables-payments",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!1,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"PAYABLES-PAYMENTS-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={payment_id:this.receiptIdTemplate,po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){if(!this.checkAccess("payments_view"))return;this.isLoading=!0;let o={user_type:"SELLER",currentPage:e.currentPage,pageLength:e.pageLength,status:e.status,search:e.search||""};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.GetPaymentList(o).subscribe({next:r=>{this.tableData=r.response?.list||[],this.pageLength=r.response?.total_count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}deleteAsn(e){let o={doc_type:"TAX_INVOICE",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r.responseCode==200&&console.log("Deleted")}})}onExportRequest(e){let o={user_type:"SELLER",type:"PAYMENTS",search:"",file_type:e.fileType,columns:e.columns},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportPOList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_payments_list.pdf":"payable_payments_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onPoClick(e,o){!e||!o||this.router.navigate([Nt.seller.po[e]],{queryParams:{id:o,poId:o}})}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.seller[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}onReceiptClick(e){this.router.navigate(["/finance-management/receivable-receipts/details",e])}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-receipts"]],viewQuery:function(o,r){if(o&1&&(N(to,7),N(io,7),N(no,7),N(ao,7),N(ro,7)),o&2){let c;V(c=B())&&(r.receiptIdTemplate=c.first),V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:29,vars:8,consts:[["receiptIdTemplate",""],["invoiceIdTemplate",""],["poNumberTemplate",""],["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],["appTranslate",""],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",6)(1,"div",7)(2,"div",8)(3,"h2",9),n(4,"Receipts"),t()(),i(5,"div",10)(6,"div",11)(7,"button",12),x(8,"i",13),i(9,"span",14),n(10,"Add Receipt"),t()(),i(11,"div",15)(12,"button",16),x(13,"i",17),i(14,"span",14),n(15,"Manual Entry"),t()()()()()(),i(16,"div",18)(17,"div",19)(18,"data-table",20),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}
1)("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(19,oo,2,1,"ng-template",null,0,P)(21,so,2,1,"ng-template",null,1,P)(23,co,2,1,"ng-template",null,2,P)(25,po,2,3,"ng-template",null,3,P)(27,uo,10,2,"ng-template",null,4,P),t()}if(o&2){let c=w(28);l(12),s("routerLink",Ce(7,lo)),l(6),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,L,Le]})}}return a})();var go=["financeDrawer"];function fo(a,d){if(a&1){let e=I();i(0,"mat-option",171),S("onSelectionChange",function(){let r=b(e).$implicit,c=p(),g=w(244);return y(c.selectPo(r,g))}),n(1),t()}if(a&2){let e=d.$implicit;s("value",e.po_number),l(),f(e.po_number)}}function ho(a,d){a&1&&(i(0,"sup",126),n(1,"*"),t())}function xo(a,d){a&1&&(i(0,"div",172),n(1,"Invoice NO is required"),t())}function bo(a,d){a&1&&(i(0,"div",172),n(1,"Invoice creation date cannot be after expiry date"),t())}function yo(a,d){a&1&&(i(0,"div",172),n(1,"Invoice expiry date cannot be before creation date"),t())}function So(a,d){a&1&&(i(0,"sup",126),n(1,"*"),t())}function Co(a,d){a&1&&(i(0,"mat-option",182),x(1,"div",183),n(2," Searching... "),t())}function Eo(a,d){if(a&1&&(i(0,"mat-option",184)(1,"div",185)(2,"div",186),n(3),t(),i(4,"div",187),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function Io(a,d){a&1&&(i(0,"mat-option",182),n(1,"No matches found"),t())}function Do(a,d){a&1&&(i(0,"div",172),n(1,"Seller Name is required"),t())}function To(a,d){if(a&1){let e=I();i(0,"div",25)(1,"div",173)(2,"div",27)(3,"label",42)(4,"span",18),n(5,"Seller Name"),t(),u(6,So,2,0,"sup",32),t(),i(7,"mat-form-field",174)(8,"mat-select",175,6),S("selectionChange",function(r){b(e);let c=w(9),g=p();return y(g.onSelectSellerOption(r.value,c))}),i(10,"mat-select-trigger"),n(11),t(),i(12,"div",176),S("click",function(r){return b(e),y(r.stopPropagation())}),i(13,"mat-form-field",177)(14,"input",178),S("input",function(r){b(e);let c=p();return y(c.onSearchSellers(r))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(15,Co,3,0,"mat-option",179)(16,Eo,6,5,"mat-option",136)(17,Io,2,0,"mat-option",179),i(18,"mat-option",180),x(19,"i",50),n(20," Add New Seller "),t()()(),x(21,"button",181),u(22,Do,2,0,"div",34),t()()()}if(a&2){let e,o,r,c=p();l(6),s("ngIf",!c.isManualEntryPo),l(2),s("value",(e=c.createInvoiceForm.get("vendorId"))==null?null:e.value),l(3),m(" ",((o=c.createInvoiceForm.get("sellerName"))==null?null:o.value)||"Type to search or add seller"," "),l(3),s("value",c.sellerSearchTerm),l(),s("ngIf",c.isSearchLoading),l(),s("ngForOf",c.sellerOptions),l(),s("ngIf",!c.isSearchLoading&&c.sellerSearchTerm&&c.sellerOptions.length===0),l(),s("value",c.ADD_SUPPLIER),l(4),s("ngIf",!c.isManualEntryPo&&((r=c.createInvoiceForm.get("sellerName"))==null?null:r.touched)&&((r=c.createInvoiceForm.get("sellerName"))==null?null:r.invalid))}}function wo(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createInvoiceForm.get("state"))==null?null:e.value,"")}}function Po(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createInvoiceForm.get("city"))==null?null:e.value,"")}}function Oo(a,d){if(a&1&&(i(0,"div",132)(1,"span",194),n(2,"Shipping From"),t(),i(3,"span",195),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createInvoiceForm.get("sellerAddress"))==null?null:e.value)}}function ko(a,d){if(a&1&&(i(0,"div",188)(1,"h4",189),n(2),t(),i(3,"p",190),n(4),u(5,wo,2,1,"ng-container",191)(6,Po,2,1,"ng-container",191),t(),x(7,"hr",192),i(8,"div",25),u(9,Oo,5,1,"div",193),t()()),a&2){let e,o,r,c,g,h=p();l(2),f((e=h.createInvoiceForm.get("sellerName"))==null?null:e.value),l(2),m(" ",(o=h.createInvoiceForm.get("gstNumber"))==null?null:o.value," "),l(),s("ngIf",(r=h.createInvoiceForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=h.createInvoiceForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=h.createInvoiceForm.get("sellerAddress"))==null?null:g.value)}}function Fo(a,d){if(a&1&&(i(0,"div",199)(1,"div",25)(2,"div",26)(3,"span",194),n(4,"Contact Name"),t(),i(5,"span",195),n(6),t()(),i(7,"div",26)(8,"span",194),n(9,"Phone No."),t(),i(10,"span",195),n(11),t()(),i(12,"div",26)(13,"span",194),n(14,"Email"),t(),i(15,"span",195),n(16),t()()()()),a&2){let e,o,r,c=p(2);l(6),f(((e=c.createInvoiceForm.get("contactName"))==null?null:e.value)||"--"),l(5),f(((o=c.createInvoiceForm.get("contactPersonNumber"))==null?null:o.value)||"--"),l(5),f(((r=c.createInvoiceForm.get("contactPersonEmail"))==null?null:r.value)||"--")}}function Mo(a,d){a&1&&x(0,"input",203)}function Ao(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),m(" - ",e.email,"")}}function No(a,d){if(a&1&&(i(0,"mat-option",184)(1,"div",185)(2,"div",186),n(3),t(),i(4,"div",187),n(5),u(6,Ao,2,1,"ng-container",191),t()()()),a&2){let e=d.$implicit;s("value",e.id),l(3),f(e.name),l(2),m(" ",e.phone,""),l(),s("ngIf",e.email)}}function Vo(a,d){a&1&&(i(0,"mat-option",182),n(1,"No users found"),t())}function Bo(a,d){if(a&1){let e=I();i(0,"mat-form-field",174)(1,"mat-select",204,8),S("selectionChange",function(r){b(e);let c=w(2),g=p(3);return y(g.onSelectContactOption(r.value,c))}),i(3,"mat-select-trigger"),n(4),t(),i(5,"div",176),S("click",function(r){return b(e),y(r.stopPropagation())}),i(6,"mat-form-field",177)(7,"input",205),S("input",function(r){b(e);let c=p(3);return y(c.onContactSearch(r.target.value))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(8,No,7,4,"mat-option",136)(9,Vo,2,0,"mat-option",179),i(10,"mat-option",180),x(11,"i",50),n(12," Add User "),t()()(),x(13,"button",206)}if(a&2){let e,o=p(3);l(),s("value",o.selectedContactUserId),l(3),m(" ",((e=o.createInvoiceForm.get("contactName"))==null?null:e.value)||"Type to search or select contact"," "),l(3),s("value",o.contactSearch),l(),s("ngForOf",o.filteredContactUsers),l(),s("ngIf",!o.filteredContactUsers.length),l(),s("value",o.ADD_CONTACT)}}function Ro(a,d){a&1&&(i(0,"div",172),n(1,"Contact number must be 10 digits"),t())}function Lo(a,d){if(a&1){let e=I();i(0,"div",52)(1,"div",26)(2,"div",27)(3,"label",42),n(4,"Contact Name"),t(),u(5,Mo,1,0,"input",200)(6,Bo,14,6,"ng-template",null,7,P),t()(),i(8,"div",26)(9,"div",27)(10,"label",42),n(11,"Phone No."),t(),i(12,"input",201),S("input",function(){b(e);let r=p(2);return y(r.onContactPhoneInput())}),t(),u(13,Ro,2,0,"div",34),t()(),i(14,"div",26)(15,"div",27)(16,"label",42),n(17,"Email"),t(),x(18,"input",202),t()()()}if(a&2){let e,o=w(7),r=p(2);l(5),s("ngIf",r.newSellerAdded)("ngIfElse",o),l(7),s("readOnly",r.disableFields||r.contactPhoneLocked),l(),s("ngIf",((e=r.createInvoiceForm.get("contactPersonNumber"))==null?null:e.touched)&&((e=r.createInvoiceForm.get("contactPersonNumber"))==null?null:e.invalid)),l(5),s("readOnly",r.disableFields||r.contactEmailLocked)}}function qo(a,d){if(a&1&&(i(0,"div",21)(1,"div",22)(2,"h3",196),n(3,"Contact Details "),i(4,"sup",126),n(5,"*"),t()()(),i(6,"div",24),u(7,Fo,17,3,"div",197)(8,Lo,19,5,"div",198),t()()),a&2){let e=p();l(7),s("ngIf",e.poIdState==="select"),l(),s("ngIf",e.poIdState!=="select")}}function Go(a,d){a&1&&(i(0,"sup",126),n(1,"*"),t())}function Uo(a,d){if(a&1){let e=I();
1i(0,"a",207),S("click",function(){let r=b(e).$implicit,c=p();return y(c.selectBankAccount(r))}),i(1,"span",208),n(2),t(),i(3,"small",209),n(4),t()()}if(a&2){let e=d.$implicit;l(2),f(e.bank_name),l(2),D("",e.account_name," - ",e.account_number,"")}}function jo(a,d){if(a&1&&(i(0,"div",210),n(1),t()),a&2){let e=p();l(),f(e.isSellerSelected?"No saved bank accounts":"Please select a seller first")}}function $o(a,d){if(a&1&&(i(0,"div",211)(1,"div",212)(2,"h4",213),n(3),t(),i(4,"span",214),n(5),t()(),i(6,"div",215)(7,"div",216)(8,"span",194),n(9,"Account Holder"),t(),i(10,"span",195),n(11),t()(),i(12,"div",216)(13,"span",194),n(14,"Account Number"),t(),i(15,"span",195),n(16),t()(),i(17,"div",216)(18,"span",194),n(19,"IFSC Code"),t(),i(20,"span",195),n(21),t()(),i(22,"div",216)(23,"span",194),n(24,"Branch"),t(),i(25,"span",195),n(26),t()()()()),a&2){let e,o,r,c,g,h,C=p();l(3),f((e=C.createInvoiceForm.get("bankName"))==null?null:e.value),l(2),f((o=C.createInvoiceForm.get("bankBranch"))==null?null:o.value),l(6),f((r=C.createInvoiceForm.get("accountName"))==null?null:r.value),l(5),f((c=C.createInvoiceForm.get("accountNumber"))==null?null:c.value),l(5),f((g=C.createInvoiceForm.get("ifscCode"))==null?null:g.value),l(5),f((h=C.createInvoiceForm.get("bankBranch"))==null?null:h.value)}}function zo(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p(2);l(),m(" ",(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname)+" - "+(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].city)," ")}}function Wo(a,d){if(a&1&&(i(0,"mat-option",184)(1,"div",185)(2,"div",186),n(3),t(),i(4,"div",187),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function Qo(a,d){a&1&&(i(0,"mat-option",182),n(1,"No addresses found"),t())}function Yo(a,d){if(a&1){let e=I();i(0,"mat-form-field",174)(1,"mat-select",217,9),S("selectionChange",function(r){b(e);let c=w(2),g=p();return y(g.onSelectShippingAddress(r.value,c))}),u(3,zo,2,1,"mat-select-trigger",191),i(4,"div",176),S("click",function(r){return b(e),y(r.stopPropagation())}),i(5,"mat-form-field",177)(6,"input",218),S("input",function(r){b(e);let c=p();return y(c.shippingToSearch=r.target.value)})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(7,Wo,6,4,"mat-option",136)(8,Qo,2,0,"mat-option",179),i(9,"mat-option",180),x(10,"i",50),n(11," Add New Address "),t()()()}if(a&2){let e,o=p();l(),s("value",(e=o.selectedShippingAddress==null||o.selectedShippingAddress[0]==null?null:o.selectedShippingAddress[0].entity_id)!==null&&e!==void 0?e:null),l(2),s("ngIf",o.selectedShippingAddress==null?null:o.selectedShippingAddress.length),l(3),s("value",o.shippingToSearch),l(),s("ngForOf",o.filterAddresses(o.shippingToSearch)),l(),s("ngIf",!o.filterAddresses(o.shippingToSearch).length),l(),s("value",o.ADD_SHIPPING_ADDRESS)}}function Ho(a,d){if(a&1&&(i(0,"div",219),x(1,"i",220),i(2,"div")(3,"span",221),n(4),t(),i(5,"span",222),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname),l(2),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].full_address)}}function Ko(a,d){if(a&1){let e=I();i(0,"div",223)(1,"input",224),S("change",function(r){b(e);let c=p();return y(c.onSameAsShippingChange(r))}),t(),i(2,"label",225),n(3,"Same as Shipping Address"),t()()}if(a&2){let e=p();l(),s("checked",e.sameAsShippingAddress)("disabled",!e.selectedShippingAddress||e.selectedShippingAddress.length==0)}}function Zo(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p(2);l(),m(" ",(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname)+" - "+(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].city)," ")}}function Jo(a,d){if(a&1&&(i(0,"mat-option",184)(1,"div",185)(2,"div",186),n(3),t(),i(4,"div",187),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function Xo(a,d){a&1&&(i(0,"mat-option",182),n(1,"No addresses found"),t())}function es(a,d){if(a&1){let e=I();i(0,"mat-form-field",174)(1,"mat-select",226,10),S("selectionChange",function(r){b(e);let c=w(2),g=p();return y(g.onSelectBillingAddress(r.value,c))}),u(3,Zo,2,1,"mat-select-trigger",191),i(4,"div",176),S("click",function(r){return b(e),y(r.stopPropagation())}),i(5,"mat-form-field",177)(6,"input",218),S("input",function(r){b(e);let c=p();return y(c.billingToSearch=r.target.value)})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(7,Jo,6,4,"mat-option",136)(8,Xo,2,0,"mat-option",179),i(9,"mat-option",180),x(10,"i",50),n(11," Add New Address "),t()()()}if(a&2){let e,o=p();l(),s("value",(e=o.selectedBillingAddress==null||o.selectedBillingAddress[0]==null?null:o.selectedBillingAddress[0].entity_id)!==null&&e!==void 0?e:null)("disabled",o.sameAsShippingAddress),l(2),s("ngIf",o.selectedBillingAddress==null?null:o.selectedBillingAddress.length),l(3),s("value",o.billingToSearch),l(),s("ngForOf",o.filterAddresses(o.billingToSearch)),l(),s("ngIf",!o.filterAddresses(o.billingToSearch).length),l(),s("value",o.ADD_BILLING_ADDRESS)}}function ts(a,d){if(a&1&&(i(0,"div",219),x(1,"i",220),i(2,"div")(3,"span",221),n(4),t(),i(5,"span",222),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname),l(2),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].full_address)}}function is(a,d){if(a&1){let e=I();i(0,"button",227),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(1,"i",50),i(2,"span",18),n(3,"Add Product"),t()()}}function ns(a,d){if(a&1){let e=I();i(0,"div",228)(1,"p",229),n(2,"Add products in invoice"),t(),i(3,"button",230),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(4,"i",50),i(5,"span",18),n(6,"Add Product"),t()()()}}function as(a,d){a&1&&x(0,"th")}function rs(a,d){if(a&1&&(i(0,"div",239),n(1),t()),a&2){let e=p(2).$implicit;l(),m(" ",e.quantityError," ")}}function ls(a,d){if(a&1){let e=I();F(0),i(1,"input",237),S("input",function(r){b(e);let c=p().index,g=p(2);return y(g.onQuantityChange(c,r))}),t(),u(2,rs,2,1,"div",238),M()}if(a&2){let e=p().$implicit;l(),re("is-invalid",e.quantityError),s("value",e.quantity),l(),s("ngIf",e.quantityError)}}function os(a,d){if(a&1&&n(0),a&2){let e=p().$implicit;f(e.quantity)}}function ss(a,d){if(a&1){let e=I();i(0,"td",240)(1,"a",241),S("click",function(){b(e);let r=p().index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(2,"i",242),t(),i(3,"a",243),S("click",function(){b(e);let r=p().index,c=p(2);return y(c.requestDeleteProduct(r))}),x(4,"i",244),t()()}}function ds(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",234),n(3),t()(),i(4,"td"),n(5),t(),i(6,"td"),u(7,ls,3,4,"ng-container",235)(8,os,1,1,"ng-template",null,11,P),t(),i(10,"td"),n(11),_(12,"currencyFormat"),t(),i(13,"td"),n(14),_(15,"currencyFormat"),t(),i(16,"td"),n(17),t(),i(18,"td"),n(19),t(),i(20,"td"),n(21),_(22,"currencyFormat"),t(),u(23,ss,5,0,"td",236),t()),a&2){let e=d.$implicit,o=w(9),r=p(2);l(2),s("title",e.productName),l(),f(e.productName),l(2),f(e.skuId||"-"),l(2),s("ngIf",r.poSelected)("ngIfElse",o),l(4),f(v(12,11,e.unitPrice)),l(3),f(v(15,13,e.grossTotal)),l(3),m("",e.discount,"%"),l(2),m("",e.tax,"%"),l(2),f(v(22,15,e.totalPayable)),l(2),s("ngIf",!r.poSelected)}}function cs(a,d){if(a&1&&(i(0,"div",231)(1,"table",232)(2,"thead")(3,"tr")(4,"th",18),n(5,"Product Name"),t(),i(6,"th",18),n(7,"SKU"),t(),i(8,"th",18),n(9,"Quantity"),t(),i(10,"th",18),n(11,"Quoted Price/Unit"),t(),i(12,"th",18),n(13,"Gross Total"),t(),i(14,"th",18),n(1
15,"Discount(%)"),t(),i(16,"th",18),n(17,"GST(%)"),t(),i(18,"th",18),n(19,"Total Payable"),t(),u(20,as,1,0,"th",191),t()(),i(21,"tbody"),u(22,ds,24,17,"tr",233),t()()()),a&2){let e=p();l(20),s("ngIf",!e.poSelected),l(2),s("ngForOf",e.productFormValues)("ngForTrackBy",e.trackByIndex)}}function ps(a,d){a&1&&(i(0,"div",245),n(1," At least one product is required. "),t())}function ms(a,d){if(a&1){let e=I();i(0,"div",246)(1,"button",247),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",248),t(),i(3,"span",249),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function us(a,d){if(a&1){let e=I();i(0,"button",247),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",248),t()}}function _s(a,d){if(a&1){let e=I();i(0,"button",259),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",260),t()}}function vs(a,d){if(a&1){let e=I();i(0,"div",250)(1,"div",251)(2,"label",77),n(3,"Description"),t(),x(4,"textarea",252),t(),i(5,"div",251)(6,"label",77),n(7,"Amount"),t(),i(8,"input",253),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",254)(10,"div",255)(11,"div",256),u(12,us,2,0,"button",257)(13,_s,2,0,"button",258),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function gs(a,d){a&1&&(i(0,"span",18),n(1,"Attachments"),t())}function fs(a,d){a&1&&(i(0,"span",18),n(1,"Uploading..."),t())}function hs(a,d){if(a&1&&x(0,"app-loader",261),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function xs(a,d){if(a&1){let e=I();i(0,"span",264)(1,"a",265),n(2),t(),i(3,"i",266),S("click",function(){let r=b(e).$implicit,c=p(2),g=w(124);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function bs(a,d){if(a&1&&(i(0,"div",262),u(1,xs,4,2,"span",263),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function ys(a,d){a&1&&(i(0,"span",276),n(1,"Default Address"),t())}function Ss(a,d){if(a&1){let e=I();i(0,"tr")(1,"td")(2,"div",272)(3,"input",273),S("change",function(){let r=b(e).$implicit,c=p(3);return y(c.changeSelectedAddress(r,"shipping"))}),t(),x(4,"label",274),t()(),i(5,"td"),n(6),x(7,"br"),u(8,ys,2,0,"span",275),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),t()()}if(a&2){let e=d.$implicit,o=d.index;l(3),ii("id","addressCheckA__01",o,""),Pi("value",e.entity_id),l(),ii("for","addressCheckA__01",o,""),l(2),m("",e.firstname," "),l(2),s("ngIf",e.shippingDefault=="default"),l(2),f(e.lastname),l(2),f(e.telephone),l(2),f(e.full_address)}}function Cs(a,d){if(a&1&&(i(0,"table",269)(1,"thead")(2,"tr",270)(3,"th",18),n(4,"Select"),t(),i(5,"th",18),n(6,"Saved As"),t(),i(7,"th",18),n(8,"Name"),t(),i(9,"th",18),n(10,"Phone Number"),t(),i(11,"th",18),n(12,"Address"),t()()(),i(13,"tbody"),u(14,Ss,15,10,"tr",271),_(15,"appFilter"),t()()),a&2){let e=p(2);l(14),s("ngForOf",U(15,1,e.shippingAddressResponse,e.shippingAddress))}}function Es(a,d){a&1&&(i(0,"p",18),n(1,"No Address Found, Please Add One to Continue"),t())}function Is(a,d){if(a&1&&(i(0,"div",267),u(1,Cs,16,4,"table",268)(2,Es,2,0,"p",82),t()),a&2){let e=p();l(),s("ngIf",e.shippingAddressResponse&&e.shippingAddressResponse.length),l(),s("ngIf",e.shippingAddressResponse&&!e.shippingAddressResponse.length)}}function Ds(a,d){a&1&&(i(0,"span",276),n(1,"Default Address"),t())}function Ts(a,d){if(a&1){let e=I();i(0,"tr")(1,"td")(2,"div",272)(3,"input",277),S("change",function(){let r=b(e).$implicit,c=p(3);return y(c.changeSelectedAddress(r,"billing"))}),t(),x(4,"label",274),t()(),i(5,"td"),n(6),x(7,"br"),u(8,Ds,2,0,"span",275),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),t()()}if(a&2){let e=d.$implicit,o=d.index;l(3),ii("id","addressCheckB__01",o,""),Pi("value",e.entity_id),l(),ii("for","addressCheckB__01",o,""),l(2),m("",e.firstname," "),l(2),s("ngIf",e.billingDefault=="default"),l(2),f(e.lastname),l(2),f(e.telephone),l(2),f(e.full_address)}}function ws(a,d){if(a&1&&(i(0,"table",269)(1,"thead")(2,"tr",270)(3,"th",18),n(4,"Select"),t(),i(5,"th",18),n(6,"Saved As"),t(),i(7,"th",18),n(8,"Name"),t(),i(9,"th",18),n(10,"Phone Number"),t(),i(11,"th",18),n(12,"Address"),t()()(),i(13,"tbody"),u(14,Ts,15,10,"tr",271),_(15,"appFilter"),t()()),a&2){let e=p(2);l(14),s("ngForOf",U(15,1,e.billingAddressResponse,e.billingAddress))}}function Ps(a,d){a&1&&(i(0,"p",18),n(1,"No Address Found, Please Add One to Continue"),t())}function Os(a,d){if(a&1&&(i(0,"div",267),u(1,ws,16,4,"table",268)(2,Ps,2,0,"p",82),t()),a&2){let e=p();l(),s("ngIf",e.billingAddressResponse&&e.billingAddressResponse.length),l(),s("ngIf",e.billingAddressResponse&&!e.billingAddressResponse.length)}}function ks(a,d){if(a&1){let e=I();i(0,"div",278)(1,"div",112)(2,"div",279)(3,"div",280)(4,"p",18),n(5," All invoices have been generated against. Do you want to update the PO? "),t(),i(6,"button",281),S("click",function(){b(e);let r=p();return y(r.onCloseModel())}),n(7,"Yes"),t(),i(8,"button",282),S("click",function(){b(e);let r=p();return y(r.onCloseDialogModel())}),n(9,"No"),t()()()()()}}function Fs(a,d){if(a&1){let e=I();i(0,"div",283)(1,"div",112)(2,"div",279)(3,"div",280)(4,"button",284),S("click",function(){b(e);let r=p();return y(r.dialogConfirm==null?null:r.dialogConfirm.close())}),n(5,"\xD7"),t(),i(6,"p",18),n(7," Do you want to auto create the PO?"),t(),i(8,"button",285),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoYes())}),n(9,"Yes"),t(),i(10,"button",282),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoNo())}),n(11,"No"),t()()()()()}}function Ms(a,d){if(a&1){let e=I();i(0,"div",283)(1,"div",112)(2,"div",279)(3,"div",280)(4,"button",284),S("click",function(){b(e);let r=p();return y(r.dialogConfirm==null?null:r.dialogConfirm.close())}),n(5,"\xD7"),t(),i(6,"p",18),n(7," No PO number was entered. Do you want to auto create the PO?"),t(),i(8,"button",285),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoYes())}),n(9,"Yes"),t(),i(10,"button",282),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoNo())}),n(11,"No"),t()()()()()}}function As(a,d){a&1&&(i(0,"div",286),n(1,"Organization name is required"),t())}function Ns(a,d){a&1&&(i(0,"div",286),n(1,"Address is required"),t())}function Vs(a,d){if(a&1&&(i(0,"option",184),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function Bs(a,d){a&1&&(i(0,"div",286),n(1,"State is required"),t())}function Rs(a,d){a&1&&(i(0,"div",286),n(1,"City is required"),t())}function Ls(a,d){a&1&&(i(0,"div",286),n(1,"Country is required"),t())}function qs(a,d){a&1&&(i(0,"div",286),n(1,"Postal code must be 6 digits"),t())}function Gs(a,d){a&1&&(i(0,"div",286),n(1,"Contact name is required"),t())}function Us(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function js(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function $s(a,d){if(a&1&&(i(0,"div",286),u(1,Us,2,0,"span",191)(2,js,2,0,"span",191),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.buyerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function zs(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function Ws(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function Qs(a,d){if(a&1&&(i(0,"div",286),u(1,zs,2,0,"span",191)(2,Ws,2,0,"span",191),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.buyerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function Ys(a,d){a&1&&(i(0,"span"),n(1,"Account number is required"),t())}function Hs(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid account number"),t())}function Ks(a,d){if(a&1&&(i(0,"div",286),u(1,Ys,2,0,"span",191)(2,Hs,2,0,"span",191),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("accountNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bank
1Form.get("accountNumber"))==null||o.errors==null?null:o.errors.pattern)}}function Zs(a,d){a&1&&(i(0,"span"),n(1,"IFSC code is required"),t())}function Js(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid IFSC code"),t())}function Xs(a,d){if(a&1&&(i(0,"div",286),u(1,Zs,2,0,"span",191)(2,Js,2,0,"span",191),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("ifsc"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("ifsc"))==null||o.errors==null?null:o.errors.pattern)}}function ed(a,d){a&1&&(i(0,"div",286),n(1,"Account holder name is required"),t())}function td(a,d){a&1&&(i(0,"div",286),n(1,"Bank name is required"),t())}function id(a,d){a&1&&(i(0,"div",286),n(1,"Branch is required"),t())}function nd(a,d){a&1&&(i(0,"div",286),n(1,"Name is required"),t())}function ad(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function rd(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid 10-digit phone number"),t())}function ld(a,d){if(a&1&&(i(0,"div",286),u(1,ad,2,0,"span",191)(2,rd,2,0,"span",191),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.userForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function od(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function sd(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function dd(a,d){if(a&1&&(i(0,"div",286),u(1,od,2,0,"span",191)(2,sd,2,0,"span",191),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.userForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function gi(a){document.getElementById(a)?.click()}var Ri=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O,Q,G){this.fb=e,this.inventoryService=o,this.fbs=r,this.commonService=c,this.dialog=g,this.financeService=h,this.onboardingService=C,this.FinanceOrderService=k,this.notificationService=O,this.ref=Q,this.router=G,this.submitted=!1,this.productRequiredError=!1,this.buyerSubmitting=!1,this.newSellerAdded=!1,this.userSubmitting=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.selectedContactUserId=null,this.bankSubmitting=!1,this.bankVerifying=!1,this.productFormValues=[],this.formControlListeners=[],this.displaySearchList=!1,this.searchList=[],this.isSearchLoading=!1,this.states=[],this.shippingAddressResponse=[],this.billingAddressResponse=[],this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.enableAddressSelection=!1,this.isLoading=!1,this.isAddressLoading=!1,this.sameAsShippingAddress=!1,this.shippingToSearch="",this.billingToSearch="",this.isWarehouseLoading=!1,this.shippingWarehouseResponse=[],this.selectedShippingWarehouse=[],this.shippingSearchText="",this.selectedOption="no",this.approverPayload=[],this.prIdFromRoute=null,this.disableGstField=!1,this.disableFields=!1,this.sellerOptions=[],this.sellerSearchTerm="",this.loadingStates={termsDocs:!1},this.uploadedTermsDocs=[],this.poList=[],this.isPoLoading=!1,this.accessList=[],this.showPoDropdown=!1,this.poIdState="empty",this.poSelected=!1,this.poRequired=0,this.bankDetails=[],this.suggestedInvoiceNumber="",this.isManualEntryPo=!1,this.editingProductIndex=null,this.confirmDeleteIndex=null,this.ADD_SUPPLIER="__add_supplier__",this.ADD_CONTACT="__add_contact__",this.ADD_ADDRESS="__add_address__",this.ADD_SHIPPING_ADDRESS="__add_shipping_address__",this.ADD_BILLING_ADDRESS="__add_billing_address__",this.initializeInvoiceForm(),this.generatePoForm()}ngOnInit(){this.onSearchSellers({target:{value:""}}),this.getStates(),this.initializeAddProductForm(),this.initializeBuyerForm(),this.initializeUserForm(),this.initializeBankForm(),this.getAddressData(),this.getPoList()}clearAllValidators(){this.createInvoiceForm.clearValidators(),Object.keys(this.createInvoiceForm.controls).forEach(e=>{let o=this.createInvoiceForm.get(e);o?.clearValidators(),o?.updateValueAndValidity({emitEvent:!1})}),this.createInvoiceForm.updateValueAndValidity({emitEvent:!1})}invoiceDateRangeValidator(e){let o=e.get("invoiceCreationDate")?.value,r=e.get("invoiceExpiryDate")?.value;return!o||!r?null:r<o?{invoiceDateRange:!0}:null}
1restoreAllValidators(){let e={invoiceNumber:[E.required],sellerName:[E.required],accountName:[E.required],bankName:[E.required],accountNumber:[E.required],bankBranch:[E.required],ifscCode:[E.required]};Object.keys(this.createInvoiceForm.controls).forEach(o=>{let r=this.createInvoiceForm.get(o);r?.setValidators(e[o]??null),r?.updateValueAndValidity({emitEvent:!1})}),this.createInvoiceForm.setValidators(this.invoiceDateRangeValidator),this.createInvoiceForm.updateValueAndValidity({emitEvent:!1})}get invoiceCreationDateValue(){return this.createInvoiceForm?.get("invoiceCreationDate")?.value||""}get invoiceExpiryDateValue(){return this.createInvoiceForm?.get("invoiceExpiryDate")?.value||""}get isInvoiceDateRangeInvalid(){return!!this.createInvoiceForm?.errors?.invoiceDateRange}requestDeleteProduct(e){this.confirmDeleteIndex=e,gi("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null,this.productRequiredError=this.productFormValues.length===0),gi("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,gi("closeDeleteConfirmModal")}initializeBuyerForm(){this.buyerForm=this.fb.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveBuyer(){if(this.buyerForm.invalid){this.buyerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required seller details correctly.");return}let e=this.buyerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"seller",password:"Test@1234",is_live_user:!1};this.buyerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.buyerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Seller added successfully"),this.applyBuyerToInvoice(e,r),this.buyerForm.reset(),gi("closeAddBuyerModal")):this.notificationService.showError(r?.response||"Failed to add seller")},error:()=>{this.buyerSubmitting=!1,this.notificationService.showError("Failed to add seller. Please try again.")}})}applyBuyerToInvoice(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,c=o?.response?.user?.id??null;this.createInvoiceForm.patchValue({sellerName:e.organization_name,gstNumber:e.gst,sellerAddress:e.address,city:e.city,state:e.state,country:e.country_id,contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,vendorId:r}),this.selectedContactUserId=c,this.disableGstField=!0,this.contactUsers=[],this.contactSearch="",this.newSellerAdded=!0,this.contactUserSelected=!0,this.contactPhoneLocked=!0,this.contactEmailLocked=!0;let g=this.createInvoiceForm.get("contactPersonNumber");g?.clearValidators(),g?.updateValueAndValidity({emitEvent:!1}),this.getContactUsers(),this.getBankDetails(r)}get filteredContactUsers(){return this.contactUsers||[]}getOrgId(){return this.createInvoiceForm.get("vendorId")?.value||null}get isSellerSelected(){return!!this.getOrgId()}getContactUsers(e="",o,r){let c=o??this.getOrgId();c&&this.financeService.userList({org_id:c,search:e}).subscribe({next:g=>{let h=g?.response?.list??[];this.contactUsers=(Array.isArray(h)?h:[]).map(C=>({id:C.id,name:C.full_name||[C.firstName,C.lastName].filter(Boolean).join(" ")||"",phone:C.phoneNumber||"",email:C.email||"",raw:C})),r?.()},error:()=>{this.contactUsers=[]}})}selectNewContactUser(e){this.getContactUsers("",void 0,()=>{let o=this.contactUsers.find(r=>e.email&&r.email&&r.email.toLowerCase()===e.email.toLowerCase()||e.phone&&r.phone&&String(r.phone)===String(e.phone));this.selectContactUser(o||{name:e.name,phone:e.phone,email:e.email})})}onContactSearch(e){this.contactSearch=e||"",this.getContactUsers(this.contactSearch)}selectContactUser(e){if(!e)return;this.selectedContactUserId=e.id??e.raw?.id??null,this.createInvoiceForm.patchValue({contactName:e.name||"",contactPersonNumber:e.phone||this.createInvoiceForm.get("contactPersonNumber")?.value||"",contactPersonEmail:e.email||this.createInvoiceForm.get("contactPersonEmail")?.value||""});let o=this.createInvoiceForm.get("contactPersonNumber");e.phone?o?.clearValidators():o?.setValidators([E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]),o?.updateValueAndValidity({emitEvent:!1}),this.contactPhoneLocked=!!e.phone,this.contactEmailLocked=!!e.email,this.contactUserSelected=!0}onContactPhoneInput(){let e=this.createInvoiceForm.get("contactPersonNumber");e?.setValidators([E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}resetContactSelection(){this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newSellerAdded=!1,this.selectedContactUserId=null;let e=this.createInvoiceForm.get("contactPersonNumber");e?.setValidators([E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}initializeUserForm(){this.userForm=this.fb.group({name:["",[E.required]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}openAddContactUser(){this.userForm?.reset()}
1saveContactUser(){if(this.userForm.invalid){this.userForm.markAllAsTouched(),this.notificationService.showError("Please fill all user details correctly.");return}let e=this.getOrgId();if(!e){this.notificationService.showError("Please select a seller first.");return}let o=this.userForm.value,r={email:o.email,phoneNumber:o.phone,firstName:o.name,org_id:e,is_live_user:!1};this.userSubmitting=!0,this.financeService.addUser(r).subscribe({next:c=>{this.userSubmitting=!1,c?.responseCode===200?(this.notificationService.showSuccess(c.response?.response||"User added successfully"),this.selectNewContactUser({name:o.name,phone:o.phone,email:o.email}),this.userForm.reset(),gi("closeAddContactUserModal")):this.notificationService.showError(c?.response||"Failed to add user")},error:()=>{this.userSubmitting=!1,this.notificationService.showError("Failed to add user. Please try again.")}})}initializeBankForm(){this.bankForm=this.fb.group({accountNumber:["",[E.required,E.pattern("^[0-9]+$")]],ifsc:["",[E.required,E.pattern("^[A-Z]{4}0[A-Z0-9]{6}$")]],accountHolder:["",[E.required]],bankName:["",[E.required]],branch:["",[E.required]]})}selectBankAccount(e){e&&this.createInvoiceForm.patchValue({accountNumber:e.account_number,bankName:e.bank_name,accountName:e.account_name,bankBranch:e.branch_name,ifscCode:e.ifsc})}saveBankAccount(){let e=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let o=this.bankForm.get("accountNumber");if(o?.setValue(String(o.value??"").replace(/\s/g,""),{emitEvent:!1}),this.bankForm.updateValueAndValidity(),this.bankForm.invalid){this.bankForm.markAllAsTouched(),this.notificationService.showError("Please fill all required bank details correctly.");return}let r=this.bankForm.value,c={org_id:this.getOrgId(),bank_details:[{bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch,ledger_number:"",micr_code:"",account_type:"",ledger_folio_number:"",cancelled_cheque:"",is_default:"0"}]};this.bankSubmitting=!0,this.onboardingService.AddBankDetails(c).subscribe({next:g=>{this.bankSubmitting=!1,g.responseCode==200?(this.notificationService.showSuccess(g.response?.response||"Bank account added successfully"),this.selectBankAccount({bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch}),this.getBankDetails(this.getOrgId()),this.bankForm.reset(),gi("closeAddBankModal")):this.notificationService.showError(g.response)},error:()=>{this.bankSubmitting=!1,this.notificationService.showError("Failed to add bank account. Please try again.")}})}verifyBankAccount(){let e=this.bankForm.get("accountNumber"),o=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,""),{emitEvent:!1}),o?.setValue(String(o.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let r=e?.value,c=o?.value;if(!r||!c){e?.markAsTouched(),o?.markAsTouched(),this.notificationService.showError("Enter account number and IFSC to verify.");return}let g={name:this.bankForm.get("accountHolder")?.value||"",phone:"",account_number:r,ifsc:c};this.bankVerifying=!0,this.financeService.verifyBankAccount(g).subscribe({next:h=>{this.bankVerifying=!1,this.handleBankVerificationResult(h?.response?.data)},error:h=>{this.bankVerifying=!1;let C=h?.error?.response?.data;C?this.handleBankVerificationResult(C):this.notificationService.showError("Bank account verification failed. Please try again.")}})}handleBankVerificationResult(e){if(e?.accountStatus==="VALID"){let o=e?.data||{};this.bankForm.patchValue({accountHolder:o.nameAtBank||this.bankForm.get("accountHolder")?.value||"",bankName:o.bankName||this.bankForm.get("bankName")?.value||"",branch:o.branch||this.bankForm.get("branch")?.value||""}),this.notificationService.showSuccess(e?.message||"Bank account verified successfully.")}else this.notificationService.showError(e?.message||"Unable to verify the bank account.")}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.productRequiredError=!1,this.calculateSummary()}initializeInvoiceForm(){this.createInvoiceForm=this.fb.group({poNumber:[""],invoiceNumber:["",E.required],invoiceCreationDate:[""],invoiceExpiryDate:[""],sellerName:["",E.required],vendorId:0,gstNumber:[""],sellerAddress:[""],city:[""],state:[""],country:[""],pincode:[""],contactName:[""],contactPersonNumber:["",[E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],contactPersonEmail
1:[""],accountName:["",E.required],bankName:["",E.required],accountNumber:["",E.required],bankBranch:["",E.required],ifscCode:["",E.required],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fb.array([]),totalPayableAmount:0,hasApprovers:["no"],termsandConditions:[""]},{validators:this.invoiceDateRangeValidator})}initializeAddProductForm(){this.formControlListeners.push(this.createInvoiceForm.valueChanges.subscribe(()=>this.calculateSummary()))}handlePoSearchDisplay(e){e===!1&&setTimeout(()=>{this.showPoDropdown=e},200)}get paymentMode(){return this.createInvoiceForm.get("paymentMode")?.value}calculateSummary(){let e=C=>Math.round((Number(C)||0)*100+Number.EPSILON)/100,o=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal,0));this.createInvoiceForm.patchValue({grossTotal:o},{emitEvent:!1});let r=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal*k.discount/100,0));this.createInvoiceForm.patchValue({discount:r},{emitEvent:!1});let c=e(o-r);this.createInvoiceForm.patchValue({netTotal:c},{emitEvent:!1});let g=e(this.productFormValues.reduce((C,k)=>C+(k.grossTotal-k.grossTotal*k.discount/100)*k.tax/100,0));this.createInvoiceForm.patchValue({taxes:g},{emitEvent:!1});let h=this.getAdditionalCharges;this.createInvoiceForm.patchValue({totalPayableAmount:e(c+g+h)},{emitEvent:!1})}trackByIndex(e){return e}get hasQuantityErrors(){return this.productFormValues.some(e=>!!e.quantityError)}onQuantityChange(e,o){let r=this.productFormValues[e],c=Number(o.target.value);if(!c||c<=0||isNaN(c)){this.productFormValues[e]=j(A({},r),{quantity:c,quantityError:"Quantity cannot be zero or negative."}),this.calculateSummary();return}let g=c*r.unitPrice,h=g*r.discount/100,C=g-h,k=C*r.tax/100;this.productFormValues[e]=j(A({},r),{quantity:c,grossTotal:g,totalPayable:C+k,quantityError:null}),this.calculateSummary()}get additionalChargesArray(){return this.createInvoiceForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.additionalChargesArray;return!e||e.length===0?0:e.controls.reduce((o,r)=>o+(Number(r.get("amount")?.value)||0),0)}addAdditionalCharge(){this.createInvoiceForm.get("additionalCharges").push(this.fb.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.createInvoiceForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}resetForm(e){e?this.createInvoiceForm.setValue({poNumber:this.createInvoiceForm.value.poNumber,invoiceNumber:this.suggestedInvoiceNumber||"",invoiceCreationDate:"",invoiceExpiryDate:"",sellerName:"",vendorId:0,gstNumber:"",sellerAddress:"",city:"",state:"",country:"",pincode:"",contactName:"",contactPersonNumber:"",contactPersonEmail:"",accountName:"",bankName:"",accountNumber:"",bankBranch:"",ifscCode:"",grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:[],totalPayableAmount:0,hasApprovers:"",termsandConditions:""}):(this.createInvoiceForm.reset(),this.createInvoiceForm.patchValue({invoiceNumber:this.suggestedInvoiceNumber||""})),this.createInvoiceForm.get("invoiceNumber")?.markAsPristine(),this.disableFields=!1,this.disableGstField=!1,this.poSelected=!1,this.poIdState="empty",this.poDetails=null,this.clearBankSelection(),this.GeneratePoForm.reset(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingToSearch="",this.billingToSearch="",this.selectedShippingWarehouse=[],this.shippingSearchText="",this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.selectedContactUserId=null,this.newSellerAdded=!1,this.productFormValues=[],this.uploadedTermsDocs=[],this.editingProductIndex=null,this.confirmDeleteIndex=null,this.calculateSummary(),this.ref.detectChanges(),this.submitted=!1,this.isManualEntryPo=!1,this.restoreAllValidators()}onSave(e,o){if(this.submitted=!0,this.poDetails?.source==="Manual"?this.clearAllValidators():this.restoreAllValidators(),this.createInvoiceForm.markAllAsTouched(),this.createInvoiceForm.invali
1d||!this.productFormValues||this.productFormValues.length===0||this.hasQuantityErrors)return;if(this.poIdState==="custom"&&e){this.dialogConfirm=this.dialog.open(e);return}if(this.poIdState==="empty"&&o){this.dialogConfirm=this.dialog.open(o);return}if(!this.selectedShippingAddress||this.selectedShippingAddress.length===0){this.notificationService.showError("Please select a shipping address.");return}if(this.sameAsShippingAddress&&(this.selectedBillingAddress=[...this.selectedShippingAddress]),!this.selectedBillingAddress||this.selectedBillingAddress.length===0){this.notificationService.showError("Please select a billing address.");return}let r=this.productFormValues.find(h=>!(Number(h.quantity)>0));if(r){this.notificationService.showError(`Enter a quantity greater than 0 for "${r.productName||"each product"}". There may be no remaining quantity left to invoice on this PO.`);return}let c={};try{c=JSON.parse(localStorage.getItem("details")||"{}")}catch{c={}}let g={po_id:this.poDetails?.po_id||0,po_number:this.createInvoiceForm.value.poNumber,account_name:this.createInvoiceForm.value.accountName,bank_name:this.createInvoiceForm.value.bankName,account_number:this.createInvoiceForm.value.accountNumber,branch:this.createInvoiceForm.value.bankBranch,ifsc:this.createInvoiceForm.value.ifscCode,seller_gst:this.createInvoiceForm.value.gstNumber,seller_address:this.createInvoiceForm.value.sellerAddress,city:this.createInvoiceForm.value.city,state:this.createInvoiceForm.value.state,country:this.createInvoiceForm.value.country,user_type:"BUYER",contact_name:this.createInvoiceForm.value.contactName,contact_person_number:this.createInvoiceForm.value.contactPersonNumber,contact_person_email:this.createInvoiceForm.value.contactPersonEmail,invoice_number:this.createInvoiceForm.value.invoiceNumber,invoice_creation_date:this.createInvoiceForm.value.invoiceCreationDate,invoice_expiry_date:this.createInvoiceForm.value.invoiceExpiryDate,net_amount:this.createInvoiceForm.value.netTotal,seller_name:this.createInvoiceForm.value.sellerName,vendor_id:this.createInvoiceForm.value.vendorId,shipping_address:this.selectedShippingAddress[0]?.entity_id||"",billing_address:this.selectedBillingAddress[0]?.entity_id||this.selectedShippingAddress[0]?.entity_id||"",seller_terms_and_conditions_path:[],items:[],additional_charges:[...this.createInvoiceForm.value.additionalCharges],total_payable_amount:this.createInvoiceForm.value.totalPayableAmount,po_required:String(this.poRequired),approvalUsers:[],documents:[],buyer_organization_id:c?.response?.vendor_id??null,buyer_user_id:c?.response?.user_id??null,seller_organization_id:this.createInvoiceForm.value.vendorId||null,seller_user_id:this.selectedContactUserId??null};g.seller_terms_and_conditions_path=this.uploadedTermsDocs.map(h=>({path:h.path,filename:h.name})),g.items=this.productFormValues.map(h=>A({product_name:h.productName,product_id:h.parentId??h.productId,qty:h.quantity,unit_price:h.unitPrice,discount_percentage:h.discount,gst_percentage:h.tax,selected_options:h.selectedConfigOptions||[]},h.isTemp&&{is_temp_product:!0,sku:h.skuId,category:h.category,sub_category:h.subCategory,product_group:h.productGroup,sub_product_group:h.subProductGroup})),g.approvalUsers=this.approverPayload.map(h=>({customer_id:h.customer_id,level:h.level})),this.financeService.invoicemanualCreate(g).subscribe({next:h=>{h.responseCode===200?(this.notificationService.showSuccess("Invoice created successfully"),this.router.navigate(["finance-management/payable-invoices"])):this.notificationService.showError(typeof h?.response=="string"?h.response:"Failed to create invoice.")},error:h=>{let C=h?.error?.response;this.notificationService.showError(typeof C=="string"&&C?C:"Failed to create invoice. Please try again.")}})}onOptionChange(e){this.selectedOption=e,this.createInvoiceForm.get("hasApprovers").setValue(e)}onApproversChange(e){this.approverPayload=e,this.prResponse.approve_users=e.map(o=>j(A({},o),{status:"A"}))}onSearchInput(e){let o=e.target.value||"";this.searchTex=o.toLowerCase(),this.getPoList(),this.showPoDropdown=!0,this.poIdState==="select"&&(this.poSelected=!1,this.resetForm(!0),this.calculateSummary()),this.poIdState=o.trim()?"custom"
1:"empty",this.poRequired=0}getPoList(){this.isPoLoading=!0,this.disableFields=!1,this.FinanceOrderService.getPolist({userType:"BUYER",perPage:10,pageNumber:1,status:"0",search:this.searchTex}).subscribe({next:e=>{this.poList=e.response.data,this.isPoLoading=!1},error:e=>{this.notificationService.showError(e.error.message),this.isPoLoading=!1}})}selectPo(e,o){this.productFormValues=[],this.uploadedTermsDocs=[],this.taxInvoiceDetails=[];let r={po_id:e.po_id};this.FinanceOrderService.GetPoDetails(r).subscribe({next:c=>{this.poDetails=c.response.data,this.isManualEntryPo=this.poDetails?.source==="Manual",this.isManualEntryPo?this.clearAllValidators():this.restoreAllValidators();let g=()=>{this.createInvoiceForm.patchValue({poNumber:this.poDetails.po_number,sellerName:this.poDetails.seller_company_name,vendorId:this.poDetails.seller_vendor_id??this.poDetails.seller_id,gstNumber:this.poDetails.seller_gst,sellerAddress:this.poDetails.seller_details?.address,city:this.poDetails.seller_details?.city,state:this.poDetails.seller_details?.region,country:this.poDetails.seller_details?.country_id,pincode:this.poDetails.seller_billing_address?.postcode,contactName:this.poDetails.seller_details?.seller_name,contactPersonNumber:this.poDetails.seller_details?.contact_number,contactPersonEmail:this.poDetails.seller_details?.email,termsandConditions:this.poDetails.terms}),this.poIdState="select",this.poSelected=!0,this.poRequired=1,this.contactSearch="",this.contactUsers=[],this.resetContactSelection();let h=this.poDetails.seller_vendor_id??this.poDetails.seller_id;this.getContactUsers("",h),this.selectedContactUserId=this.poDetails.seller_id??null,this.clearBankSelection(),this.getBankDetails(h),this.poDetails.terms_document.forEach(X=>{this.uploadedTermsDocs.push({name:X.filename,path:X.path,viewPath:X.viewPath})});let C=this.poDetails.address||[],k=C.find(X=>X.addressType==="shipping")||C[0],O=C.find(X=>X.addressType==="billing")||C[1]||k;this.GeneratePoForm.patchValue({shippingAddress:k?String(k.id):"",billingAddress:O?String(O.id):""}),this.selectedShippingAddress=k?[j(A({},k),{entity_id:k.id,addressType:k.addressType})]:[],this.selectedBillingAddress=O?[j(A({},O),{entity_id:O.id,addressType:O.addressType})]:[];let Q=this.poDetails.seller_details||{},G=this.poDetails.seller_billing_address||{};this.selectedShippingWarehouse=[{name:this.poDetails.seller_company_name||Q.company_name||"",code:"",breadcrumbs:G.street||Q.address||"",city:G.city||Q.city||"",region:G.region||Q.region||"",country_id:G.country_id||Q.country_id||"",post_code:G.postcode||""}]};if(this.poDetails.invoice_id){let h={invoice_id:this.poDetails.invoice_id};this.FinanceOrderService.GetInvoiceDetails(h).subscribe({next:C=>{this.invoiceDetails=C.response.data;let k=this.invoiceDetails.invoices;if(k.length===0){this.poDetails.items.forEach(G=>{let X=G.offered_qty,pe=X*G.unit_price,Y=pe*G.discount_percent/100,le=pe-Y,ee=le*G.tax_percent/100;this.productFormValues.push({productName:G.product_name,productId:G.product_id,skuId:G.display_item_id||G.item_id||"",quantity:X,unitPrice:G.unit_price,grossTotal:pe,discount:G.discount_percent,tax:G.tax_percent,totalPayable:le+ee,selectedConfigOptions:[],configurableOptionsFull:[],quantityError:null})}),this.calculateSummary(),g();return}let Q=k.map(G=>G.invoice_id).map(G=>{let X={invoice_id:G,invoice_type:"child"};return this.FinanceOrderService.GetTaxInvoiceDetails(X)});Ui(Q).subscribe({next:G=>{this.taxInvoiceDetails=G.map(Y=>Y.response.data);let X=Y=>{let ee=this.taxInvoiceDetails.flatMap(fe=>fe.items).find(fe=>fe.product_id===Y);return ee?ee.offered_qty:0},pe=!1;this.poDetails.items.forEach(Y=>{let le=Y.offered_qty-X(Y.product_id),ee=le*Y.unit_price,fe=ee*Y.discount_percent/100,oe=ee-fe,te=oe*Y.tax_percent/100;this.productFormValues.push({productName:Y.product_name,productId:Y.product_id,skuId:Y.display_item_id||Y.item_id||"",quantity:le,unitPrice:Y.unit_price,grossTotal:ee,discount:Y.discount_percent,tax:Y.tax_percent,totalPayable:oe+te,selectedConfigOptions:[],configurableOptionsFull:[],quantityError:null}),le<=0&&(pe=!0)}),pe&&(this.dialogRef=this.dialog.open(o)),this.calculateSummary(),g()}})}})}
1else this.poDetails.items.forEach(h=>{let C=h.offered_qty,k=C*h.unit_price,O=k*h.discount_percent/100,Q=k-O,G=Q*h.tax_percent/100;this.productFormValues.push({productName:h.product_name,productId:h.product_id,skuId:h.display_item_id||h.item_id||"",quantity:C,unitPrice:h.unit_price,grossTotal:k,discount:h.discount_percent,tax:h.tax_percent,totalPayable:Q+G,selectedConfigOptions:[],configurableOptionsFull:[],quantityError:null})}),this.calculateSummary(),g()}}),this.disableFields=!0,this.showPoDropdown=!1}getBankDetails(e){let o=e?{org_id:e}:void 0;this.onboardingService.bankdetailsList(o).subscribe({next:r=>{r.responseCode===200?this.bankDetails=r.response.list||[]:this.notificationService.showError("Something went wrong!")},error:r=>{this.notificationService.showError("Something went wrong!")}})}onBankAccountSelect(e){let o=e.target.value,r=this.bankDetails[o];this.createInvoiceForm.get("accountNumber").setValue(r.account_number),this.createInvoiceForm.get("bankName").setValue(r.bank_name),this.createInvoiceForm.get("accountName").setValue(r.account_name),this.createInvoiceForm.get("bankBranch").setValue(r.branch_name),this.createInvoiceForm.get("ifscCode").setValue(r.ifsc)}onCloseModel(){this.dialogRef.close()}onCloseDialogModel(){this.dialogRef.close(),this.resetForm(),this.calculateSummary()}poTypeChange(e){e===""?(this.poIdState="empty",this.poRequired=0,this.resetForm(),this.calculateSummary()):(this.poIdState="custom",this.poRequired=0)}onConfirmAutoCreatePoYes(){this.poRequired=1,this.dialogConfirm?.close(),this.onSave()}onConfirmAutoCreatePoNo(){this.poRequired=0,this.dialogConfirm?.close(),this.onSave()}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:e.target.value}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.sellerOptions=c,this.isSearchLoading=!1}}})}onSelectSellerOption(e,o){if(e===this.ADD_SUPPLIER){gi("openAddBuyerModal"),this.restoreSelectValue(o,this.createInvoiceForm.get("vendorId")?.value);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}onSelectContactOption(e,o){if(e===this.ADD_CONTACT){this.openAddContactUser(),gi("openAddContactUserModal"),this.restoreSelectValue(o,this.selectedContactUserId);return}let r=this.contactUsers.find(c=>c.id===e);r&&this.selectContactUser(r)}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}selectSeller(e){if(!e)return this.removeSeller();this.createInvoiceForm.patchValue({sellerName:e.vendorData.company_name,vendorId:e.vendorData.vendor_id,gstNumber:e.vendorData.gst,sellerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vend
1orData.region,country:e.vendorData.country_id}),this.disableGstField=!0,this.displaySearchList=!1,this.createInvoiceForm.patchValue({contactName:"",contactPersonNumber:"",contactPersonEmail:""}),this.contactSearch="",this.contactUsers=[],this.resetContactSelection(),this.getContactUsers(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.getAddressData(),this.getWarehouseList(),this.clearBankSelection(),this.getBankDetails(e.vendorData.vendor_id)}clearBankSelection(){this.bankDetails=[],this.createInvoiceForm.patchValue({accountNumber:"",bankName:"",accountName:"",bankBranch:"",ifscCode:""})}removeSeller(){this.contactUsers=[],this.contactSearch="",this.resetContactSelection(),this.clearBankSelection(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.selectedShippingWarehouse=[],this.sameAsShippingAddress=!1,this.shippingWarehouseResponse=[],this.shippingSearchText="",this.shippingToSearch="",this.getAddressData(),this.createInvoiceForm.patchValue({sellerName:"",vendorId:null,gstNumber:"",sellerAddress:"",city:"",state:"",country:""})}handleSearchDisplay(e){e===!1?setTimeout(()=>{this.displaySearchList=e},200):this.displaySearchList=e}getAddressData(e){this.isAddressLoading=!0;let o={perPage:10,pageNumber:1};e&&(o.org_id=e),this.commonService.getAddressList(o).subscribe(r=>{let c=r.total_count||0,g=this.createInvoiceForm.get("invoiceNumber");if(r.invoice_number&&(this.suggestedInvoiceNumber=r.invoice_number),r.invoice_number&&!g?.dirty&&!g?.value&&g?.setValue(r.invoice_number),this.shippingAddressResponse=r.response||[],this.billingAddressResponse=r.response||[],this.enableAddressSelection=!0,this.isAddressLoading=!1,c>10){let h={perPage:c,pageNumber:1};e&&(h.org_id=e),this.commonService.getAddressList(h).subscribe(C=>{let k=C.response||[];this.shippingAddressResponse=k,this.billingAddressResponse=k})}})}generatePoForm(){this.GeneratePoForm=this.fbs.group({selectedSeller:[""],shippingAddress:["",E.required],billingAddress:["",E.required]})}onSelectShippingAddress(e,o){if(e===this.ADD_SHIPPING_ADDRESS){this.setAddAddressMode("shipping",!0),this.restoreSelectValue(o,this.selectedShippingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&(this.changeSelectedAddress(r,"shipping"),this.sameAsShippingAddress&&this.changeSelectedAddress(r,"billing"))}onSelectBillingAddress(e,o){if(e===this.ADD_BILLING_ADDRESS){this.setAddAddressMode("billing",!0),this.restoreSelectValue(o,this.selectedBillingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"billing")}onSelectShippingTo(e,o){if(e===this.ADD_ADDRESS){this.setAddAddressMode("shipping",!0);let r=this.selectedShippingAddress?.[0]?.entity_id;this.restoreSelectValue(o,(this.shippingAddressResponse||[]).find(c=>c.entity_id===r));return}this.selectDeliveryAddress(e)}setAddAddressMode(e,o){this.addAddressMode=e,o&&this.dialog.open(Ht,{data:{}}).afterClosed().subscribe(c=>{c&&(this.poRfqData?.data&&(this.addAddressMode==="shipping"&&(this.poRfqData.data.delivery_address=A({},c)),this.addAddressMode==="billing"&&(this.poRfqData.data.billing_address=A({},c))),this.getAddressData())}),(!this.shippingAddressResponse.length||!this.billingAddressResponse.length)&&this.getAddressData()}changeSelectedAddress(e,o){let r=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})];o==="shipping"&&(this.selectedShippingAddress=r,this.GeneratePoForm.patchValue({shippingAddress:String(e.entity_id)})),o==="billing"&&(this.selectedBillingAddress=r,this.GeneratePoForm.patchValue({billingAddress:String(e.entity_id)}))}filterAddresses(e){let o=this.shippingAddressResponse||[];if(!e||!e.trim())return o;let r=e.toLowerCase();return o.filter(c=>(c.firstname||"").toLowerCase().includes(r)||(c.lastname||"").toLowerCase().includes(r)||(c.full_address||"").toLowerCase().includes(r)||(c.city||"").toLowerCase().includes(r))}selectDeliveryAddress(e){this.changeSelectedAddress(e,"shipping"),this.changeSelectedAddress(e,"billing")}selectBillingAddr(e){this.changeSelectedAddress(e,"billing")}getWarehouseList(e=""){this.isWarehouseLoading=!0,this.inventoryService.getWarehouseList({pageLength:50,currentPage:1,status:"active",search:e,allWarehouses:"yes"}).subscribe({next:o=>{this.shippingWarehouseResponse=o?.response?.warehouses2||[],this.isWarehouseLoading=!1},error:()=>{this.shippingWarehouseResponse=[],this.isWarehouseLoading=!1}})}onWarehouseInput(e){this.shippingSearchText=e||"",this.isSellerSelected&&this.getWarehouseList(this.shippingSearchText)}onWarehouseDropdownOpened(e){e&&this.isSellerSelected&&this.shippingWarehouseResponse.length===0&&this.getWarehouseList(this.shippingSearchText)}getFilteredWarehouses(e){if(!e||e.trim()==="")return this.shippingWarehouseResponse;let o=e.toLowerCase();return this.shippingWarehouseResponse.filter(r=>(r.name||"").toLowerCase().includes(o)||(r.code||"").toLowerCase().includes(o)||(r.city||"").toLowerCase().includes(o)||(r.region||"").toLowerCase().includes(o)||(r.breadcrumbs||"").toLowerCase().includes(o))}
1getWarehouseLocation(e){return[e?.breadcrumbs,e?.city,e?.region,e?.country_id,e?.post_code].filter(Boolean).join(", ")}selectShippingWarehouse(e){e&&(this.selectedShippingWarehouse=[e])}selectShippingAddress(){!this.selectedShippingAddress||this.selectedShippingAddress.length===0||this.GeneratePoForm.patchValue({shippingAddress:String(this.selectedShippingAddress[0].entity_id)})}selectBillingAddress(){!this.selectedBillingAddress||this.selectedBillingAddress.length===0||this.GeneratePoForm.patchValue({billingAddress:String(this.selectedBillingAddress[0].entity_id)})}onSameAsShippingChange(e){if(this.sameAsShippingAddress=e.target.checked,this.sameAsShippingAddress){let o=this.selectedShippingAddress?.[0];o&&this.changeSelectedAddress(o,"billing")}else this.selectedBillingAddress=[],this.GeneratePoForm.patchValue({billingAddress:""})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=new FormData;c.append("file",o[r]),c.append("source","po"),c.append("source_id",""),this.FinanceOrderService.FileUpload(c).subscribe(g=>{g.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:g.response.file_name,path:g.response.filepath,viewPath:g.response.fileViewPath}]:this.notificationService.showError(g.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}ngOnDestroy(){this.formControlListeners.forEach(e=>e.unsubscribe())}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Ki),T(ft),T(ge),T(Ae),T(Dt),T(Jt),T(z),T(H),T(Wt),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-invoice"]],viewQuery:function(o,r){if(o&1&&N(go,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:451,vars:91,consts:[["auto","matAutocomplete"],["docsinput",""],["dialog1",""],["dialog2",""],["dialog3",""],["financeDrawer",""],["sellerSelect",""],["contactNameDropdown",""],["contactSelect",""],["shippingAddrSelect",""],["billingAddrSelect",""],["qtyText",""],[1,"splittedCreateCardMain","mod-mat-fields"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group"],["for","","appTranslate","",1,"mod-form-label"],["type","text","formControlName","poNumber","placeholder","Enter PO/WO NO",1,"form-control","mod-input",3,"input","focus","blur","matAutocomplete"],[3,"value","onSelectionChange",4,"ngFor","ngForOf"],["for","",1,"mod-form-label"],["class","text-danger",4,"ngIf"],["type","text","formControlName","invoiceNumber","placeholder","Enter invoice no.",1,"form-control","mod-input"],["class","invalid-error","appTranslate","",4,"ngIf"],["type","date","formControlName","invoiceCreationDate","placeholder","Enter date",1,"form-control","mod-input"],["type","date","formControlName","invoiceExpiryDate","placeholder","Enter date",1,"form-control","mod-input"],["class","row",4,"ngIf"],["class","fin-info-block mt-2",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"row","align-items-end","gut-row","gut-3"],[1,"form-group","mb-0"],[1,"mod-form-label"],[1,"dropdown","w-100"],["data-toggle","dropdown","data-display","static",1,"form-control","fin-select-toggle","d-flex","justify-content-between","align-items-center","dropdown-toggle"],[1,"ri-arrow-down-s-line"],[1,"dropdown-menu","w-100","fin-buyer-dropdown"],["class","dropdown-item fin-buyer-item","href","javascript:void(0)",3,"click",4,"ngFor","ngForOf"],["class","dropdown-item text-muted",4,"ngIf"],["type","button","data-toggle","modal","data-target","#addBankModal",1,"mod-btn","mod-btn-outline-primary"],[1,"ri-add-line"],["class","fin-bank-card mt-3",4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"shpCard","h-100"],["appTranslate","",1,"h6","fw-600","mb-3"],["appearance","outline","class","w-100 compact-form-field",4,"ngIf"],["class","mod-address-chip mt-3",4,"ngIf"],[1,"d-flex","align-items-center","mb-3"],["appTranslate","",1,"h6","fw-600","mb-0"],["class","custom-control custom-checkbox fin-check ml-4",4,"ngIf"],[1,"mod-card"],[1,"mod-card-header","border-bottom-0"],["type","button","class","mod-btn mod-btn-outline-primary btn-sm",3,"click",4,"ngIf"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],[1,"col-12","px-0"],["class","fin-empty-products text-center py-4 m-15",4,"ngIf"],["class","table-responsive mod-table-wrapper mod-table-top-radius-flush mod-thin-scrollbar","id","product_table",4,"ngIf"],["class","invali
1d-error mt-2 px-15 pb-15",4,"ngIf"],[1,"col-12","p-15"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","h-100"],["appTranslate","",1,"mod-form-label"],["rows","6","formControlName","termsandConditions","placeholder","Please write T & C, if any concern in invoice",1,"form-control","mod-input"],["type","file","id","invoiceAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","invoiceAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"col-lg","col-12","splitedSummaryRightSide"],[1,"mod-card","h-100","fin-summary-card"],[1,"list-unstyled","fin-summary"],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/payable-invoices","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","selectShippingAddress",1,"modal","fade"],[1,"modal-dialog","modal
1-lg","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-bottom-0"],["appTranslate","",1,"modal-title","font-16","fw-600"],["type","button","data-dismiss","modal",1,"close"],[1,"modal-body"],[3,"formGroup"],[1,"row","justify-content-end","pb-2"],[1,"col-auto"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[3,"isLoading","useBlockPosition"],["class","table-responsive addressTable rounded-lg",4,"ngIf"],[1,"row","justify-content-end","mt-3"],["id","selectBillingAddress",1,"modal","fade"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-header"],[1,"modal-title","d-flex","align-items-cente"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],["appTranslateText","",1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["id","addBuyerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-title"],["type","button","id","closeAddBuyerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[1,"text-danger"],["type","text","formControlName","organization_name","placeholder","Enter seller name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],[1,"col-12"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],[3,"value",4,"ngFor","ngForOf"],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addBankModal","tabindex","-1",1,"modal","fade"],[1,"modal-header","align-items-start"],[1,"d-flex","align-items-center"],[1,"fin-modal-icon"],[1,"ri-bank-line"],[1,"modal-title","mb-0"],[1,"text-muted"],["type","button","id","closeAddBankModal","data-dismiss","modal",1,"d-none"],[1,"fin-verify-box"],["type","text","formControlName","accountNumber","placeholder","Enter account number",1,"form-control","mod-input"],["type","text","formControlName","ifsc","placeholder","Enter IFSC Code",1,"form-control","mod-input"],[1,"col-12","text-center"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],[1,"row","gut-row","gut-3","mt-2"],["type","text","formControlName","accountHolder","placeholder","Enter account holder name",1,"form-control","mod-input"],["type","text","formControlName","bankName","placeholder","Enter bank name",1,"form-control","mod-input"],["type","text","formControlName","branch","placeholder","Enter branch",1,"form-control","mod-input"],["id","addContactUserModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-dialog-scrollable"],["type","button","id","closeAddContactUserModal","data-dismiss","modal",1,"d-none"],["type","text","formControlName","name","placeholder","Enter name",1,"form-control","mod-input"],["type","text","inputmode","numeric","formControlName","phone","placeholder","Enter phone number","maxlength","10",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter email id",1,"form-control","mod-input"],["moduleType","FINANCE","productType","PRODUCT",3,"productAdded"],[3,"onSelectionChange","value"],["appTranslate","",1,"invalid-error"],[1,"col-md-8"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or add seller",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search seller...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[1,"text-primary","fw-500",3,"value"],["type","button","id","openAddBuyerModal","data-toggle","modal","data-target","#addBuyerModal",1,"d-none"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[4,"ngIf"],[1,"fin-info-block__divider"],["class","col-12",4,"ngIf"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"mod-card-title","mb-0"],["class","fin-info-block",4,"ngIf"],["class","row gut-row gut-3",4,"ngIf"],[1,"fin-info-block"],["type","text","class","form-control mod-input","formControlName","contactName","readonly","",4,"ngIf","ngIfElse"],["type","text","inputmode","numeric","maxlength","10","formControlName","contactPersonNumber","placeholder","Enter Number",1,"form-control","mod-input",3,"input","readOnly"],["type","text","formControlName","contactPersonEmail","placeholder","Enter Email id",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","contactName","readonly","",1,"form-control","mod-input"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or select contact",3,"selectionChange","value"],["matInput","","placeholder","Search user...",3,"input","keydown.space","click","value"],["type","button","id","openAddContactUserModal","data-toggle","modal","data-target","#addContactUserModal",1,"d-none"],["href","javascript:void(0)",1,"dropdown-item","fin-buyer-item",3,"click"],[1,"fin-buyer-item__name"],[1,"fin-buyer-item__meta"],[1,"dropdown-item","text-muted"],[1,"fin-bank-card","mt-3"],[1,"fin-bank-card__head"],[1,"fin-bank-card__name"],[1,"fin-bank-card__city"],[1,"row","fin-bank-card__body"],[1,"col-md-3"],["panelClass","address-select-panel no-checkmark","placeholder","Select Shipping Address",3,"selectionChange","value"],["matInput","","placeholder","Search address...",3,"input","keydown.space","click","value"],[1,"mod-address-chip","mt-3"],[1,"ri-map-pin-line"],[1,"mod-address-chip__title"],[1,"mod-address-chip__addr"],[1,"custom-control","custom-checkbox","fin-check","ml-4"],["type","checkbox","id","sameAsShipping",1,"custom-control-input",3,"change","checked","disabled"],["for","sameAsShipping","appTranslate","",1,"custom-control-label","mr-2"],["panelClass","address-select-panel no-checkmark","placeholder","Select Billing Address",3,"selectionChange","value","disabled"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"fin-empty-products","text-center","py-4","m-15"],[1,"text-muted","mb-3"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table","table-dashboard","fin-product-table"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"mod-clamp-2",3,"title"],[4,"ngIf","ngIfElse"],["class","text-center text-nowrap",4,"ngIf"],["type","number","min","1",1,"form-control","mod-input",2,"max-width","110px",3,"input","value"],["class","invali
1d-error mt-1",4,"ngIf"],[1,"invalid-error","mt-1"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],[1,"invalid-error","mt-2","px-15","pb-15"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class","p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"],[1,"table-responsive","addressTable","rounded-lg"],["class","table mod-table border rounded-lg",4,"ngIf"],[1,"table","mod-table","border","rounded-lg"],[1,"table-secondary"],[4,"ngFor","ngForOf"],[1,"custom-control","custom-radio","custom-control-inline"],["type","radio","formControlName","shippingAddress","name","shippingAddress",1,"custom-control-input",3,"change","id","value"],[1,"custom-control-label",3,"for"],["class","badge badge-secondary-s text-dark status-badge px-2 py-1","appTranslate","",4,"ngIf"],["appTranslate","",1,"badge","badge-secondary-s","text-dark","status-badge","px-2","py-1"],["type","radio","formControlName","billingAddress","name","billingAddress",1,"custom-control-input",3,"change","id","value"],["id","changePwd__modal","aria-modal","true",1,"modal","fade","show","d-block","pr-20"],[1,"modal-content","br-0"],[1,"modal-body","text-center"],["type","button","data-dismiss","modal","appTranslate","",1,"btn","btn-sm","btn-outline-themeDanger","px-5","mr-15",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"btn","btn-sm","btn-logo-dark","px-5",3,"click"],["aria-modal","true",1,"modal","fade","show","d-block","pr-20"],["type","button","data-dismiss","modal",1,"close","curserType",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"btn","btn-sm","btn-theme","px-5","mr-15",3,"click"],[1,"invalid-error"]],template:function(o,r){if(o&1){let c=I();i(0,"main",12)(1,"div",13)(2,"div",14)(3,"h2",15)(4,"a",16),x(5,"i",17),t(),i(6,"span",18),n(7,"Create Invoice"),t()()(),x(8,"div",19),t(),i(9,"form",20),S("ngSubmit",function(){b(c);let h=w(246),C=w(248);return y(r.onSave(h,C))}),i(10,"div",21)(11,"div",22)(12,"h3",23),n(13,"Basic Invoice Info"),t()(),i(14,"div",24)(15,"div",25)(16,"div",26)(17,"div",27)(18,"label",28),n(19,"PO/WO NO"),t(),i(20,"input",29),S("input",function(h){return b(c),y(r.onSearchInput(h))})("focus",function(){return b(c),y(r.handlePoSearchDisplay(!0))})("blur",function(){return b(c),y(r.handlePoSearchDisplay(!1))}),t(),i(21,"mat-autocomplete",null,0),u(23,fo,2,2,"mat-option",30),t()()(),i(24,"div",26)(25,"div",27)(26,"label",31)(27,"span",18),n(28,"Invoice Number"),t(),u(29,ho,2,0,"sup",32),t(),x(30,"input",33),u(31,xo,2,0,"div",34),t()(),i(32,"div",26)(33,"div",27)(34,"label",28),n(35,"Invoice Creation Date"),t(),x(36,"input",35),u(37,bo,2,0,"div",34),t()(),i(38,"div",26)(39,"div",27)(40,"label",28),n(41,"Invoice Expiry Date"),t(),x(42,"input",36),u(43,yo,2,0,"div",34),t()()()()(),i(44,"div",21)(45,"div",22)(46,"h3",23),n(47,"Seller Details"),t()(),i(48,"div",24),u(49,To,23,9,"div",37)(50,ko,10,5,"div",38),t()(),u(51,qo,9,2,"div",39),i(52,"div",21)(53,"div",22)(54,"h3",23),n(55,"Seller Bank Details"),t()(),i(56,"div",24)(57,"div",40)(58,"div",14)(59,"div",41)(60,"label",42)(61,"span",18),n(62,"Select Bank account"),t(),u(63,Go,2,0,"sup",32),t(),i(64,"div",43)(65,"div",44)(66,"span"),n(67),t(),x(68,"i",45),t(),i(69,"div",46),u(70,Uo,5,3,"a",47)(71,jo,2,1,"div",48),t()()()(),i(72,"div",19)(73,"button",49),x(74,"i",50),n(75," Add New "),t()()(),u(76,$o,27,6,"div",51),t()(),i(77,"div",21)(78,"div",22)(79,"h3",23),n(80,"Delivery Address"),t()(),i(81,"div",24)(82,"div",52)(83,"div",53)(84,"div",54)(85,"h4",55),n(86,"Shipping Address"),t(),u(87,Yo,12,6,"mat-form-field",56)(88,Ho,7,2,"div",57),t()(),i(89,"div",53)(90,"div",54)(91,"div",58)(92,"h4",59),n(93,"Billing Address"),t(),u(94,Ko,4,2,"div",60),t(),u(95,es,12,7,"mat-form-field",56)(96,ts,7,2,"div",57),t()()()()(),i(97,"div",61)(98,"div",62)(99,"h3",23),n(100,"Product Details"),t(),u(101,is,4,0,"button",63),t(),i(102,"div",64)(103,"div",65)(104,"div",66),u(105,ns,7,0,"div",67)(106,cs,23,3,"div",68)(107,ps,2,0,"div",69),t(),i(108,"div",70),u(109,ms,5,0,"div",71),i(110,"div",72),u(111,vs,14,3,"div",73),t()()()()(),i(112,"div",74)(113,"div",75)(114,"div",76)(115,"div",22)(116,"h3",23),n(117,"Terms & Conditions"),t()(),i(118,"div",24)(119,"div",27)(120,"label",77),n(121,"Terms"),t(),x(122,"textarea",78),t(),i(123,"input",79,1),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(125,"label",80),x(126,"i",81),u(127,gs,2,0,"span",82)(128,fs,2,0,"span",82),t(),u(129,hs,1,2,"app-loader",83)(130,bs,2,1,"div",84),t()()(),i(131,"div",85)(132,"div",86)(133,"div",22)(134,"h3",23),n(135,"Invoice Summary"),t()(),i(136,"div",24)(137,"ul",87)(138,"li")(139,"span",18),n(140,"Gross Total"),t(),i(141,"span"),n(142),_(143,"currencyFormat"),t()(),i(144,"li")(145,"span",18),n(146,"Discount"),t(),i(147,"span"),n(148),_(149,"currencyFormat"),t()(),i(150,"li")(151,"span",18),n(1
152,"Net Total"),t(),i(153,"span"),n(154),_(155,"currencyFormat"),t()(),i(156,"li")(157,"span",18),n(158,"GST"),t(),i(159,"span"),n(160),_(161,"currencyFormat"),t()(),i(162,"li")(163,"span",18),n(164,"Additional Charges"),t(),i(165,"span"),n(166),_(167,"currencyFormat"),t()()()(),i(168,"div",88),n(169," Total Payable Amount "),i(170,"span"),n(171),_(172,"currencyFormat"),t()()()()(),i(173,"div",89)(174,"div",90)(175,"div",91)(176,"button",92),n(177,"Cancel"),t(),i(178,"button",93),n(179,"Save"),t()()()()()(),i(180,"div",94)(181,"div",95)(182,"div",96)(183,"div",97)(184,"h4",98),n(185,"Select shipping address"),t(),i(186,"button",99),n(187,"\xD7"),t()(),i(188,"div",100)(189,"div",101)(190,"div",102)(191,"div",103)(192,"button",104),S("click",function(){return b(c),y(r.setAddAddressMode("shipping",!0))}),n(193,"Add New Address"),t()()(),x(194,"app-loader",105),u(195,Is,3,2,"div",106),i(196,"div",107)(197,"div",103)(198,"button",104),S("click",function(){return b(c),y(r.selectShippingAddress())}),n(199,"Select & Proceed"),t()()()()()()()(),i(200,"div",108)(201,"div",95)(202,"div",96)(203,"div",97)(204,"h4",98),n(205,"Select billing address"),t(),i(206,"button",99),n(207,"\xD7"),t()(),i(208,"div",100)(209,"div",101)(210,"div",102)(211,"div",103)(212,"button",104),S("click",function(){return b(c),y(r.setAddAddressMode("billing",!0))}),n(213,"Add New Address"),t()()(),x(214,"app-loader",105),u(215,Os,3,2,"div",106),i(216,"div",107)(217,"div",103)(218,"button",104),S("click",function(){return b(c),y(r.selectBillingAddress())}),n(219,"Select & Proceed"),t()()()()()()()(),x(220,"button",109)(221,"button",110),i(222,"div",111)(223,"div",112)(224,"div",96)(225,"div",113)(226,"h4",114),x(227,"i",115),i(228,"span",18),n(229,"Delete Product"),t()()(),i(230,"div",116)(231,"p",117),n(232,"Are you sure you want to delete "),i(233,"strong"),n(234),t(),n(235,"? "),t(),i(236,"p",118),n(237,"This action cannot be undone."),t()(),i(238,"div",119)(239,"button",120),S("click",function(){return b(c),y(r.cancelDelete())}),n(240,"No, Keep it"),t(),i(241,"button",104),S("click",function(){return b(c),y(r.confirmDelete())}),n(242,"Yes, Delete"),t()()()()(),u(243,ks,10,0,"ng-template",null,2,P)(245,Fs,12,0,"ng-template",null,3,P)(247,Ms,12,0,"ng-template",null,4,P),i(249,"div",121)(250,"div",122)(251,"div",96)(252,"div",113)(253,"h5",123),n(254,"Add New Seller"),t(),x(255,"button",124),i(256,"button",125),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(257,"\xD7"),t()(),i(258,"form",101)(259,"div",100)(260,"div",52)(261,"div",53)(262,"label",42),n(263,"Seller Name / Company Name "),i(264,"sup",126),n(265,"*"),t()(),x(266,"input",127),u(267,As,2,0,"div",128),t(),i(268,"div",53)(269,"label",42),n(270,"GST"),t(),x(271,"input",129),t(),i(272,"div",53)(273,"label",42),n(274,"PAN"),t(),x(275,"input",130),t()(),i(276,"h3",131),n(277,"Shipping From"),t(),i(278,"div",52)(279,"div",132)(280,"label",42),n(281,"Address "),i(282,"sup",126),n(283,"*"),t()(),x(284,"input",133),u(285,Ns,2,0,"div",128),t(),i(286,"div",53)(287,"label",42),n(288,"State "),i(289,"sup",126),n(290,"*"),t()(),i(291,"select",134)(292,"option",135),n(293,"Select State"),t(),u(294,Vs,2,2,"option",136),t(),u(295,Bs,2,0,"div",128),t(),i(296,"div",53)(297,"label",42),n(298,"City "),i(299,"sup",126),n(300,"*"),t()(),x(301,"input",137),u(302,Rs,2,0,"div",128),t(),i(303,"div",53)(304,"label",42),n(305,"Country "),i(306,"sup",126),n(307,"*"),t()(),i(308,"select",138)(309,"option",135),n(310,"Select Country"),t(),i(311,"option",139),n(312,"India"),t()(),u(313,Ls,2,0,"div",128),t(),i(314,"div",53)(315,"label",42),n(316,"Postal Code"),t(),x(317,"input",140),u(318,qs,2,0,"div",128),t()(),i(319,"h3",131),n(320,"Contact Details"),t(),i(321,"div",52)(322,"div",53)(323,"label",42),n(324,"Contact Name "),i(325,"sup",126),n(326,"*"),t()(),x(327,"input",141),u(328,Gs,2,0,"div",128),t(),i(329,"div",53)(330,"label",42),n(331,"Phone No. "),i(332,"sup",126),n(333,"*"),t()(),x(334,"input",142),u(335,$s,3,2,"div",128),t(),i(336,"div",53)(337,"label",42),n(338,"Email Id "),i(339,"sup",126),n(340,"*"),t()(),x(341,"input",143),u(342,Qs,3,2,"div",128),t()()(),i(343,"div",144)(344,"button",145),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(345,"Cancel"),t(),i(346,"button",146),S("click",function(){return b(c),y(r.saveBuyer())}),n(347),t()()()()()(),i(348,"div",147)(349,"div",122)(350,"div",96)(351,"div",148)(352,"div",149)(353,"span",150),x(354,"i",151),t(),i(355,"div")(356,"h5",152),n(357,"Add New bank details"),t(),i(358,"small",153),n(359,"Verify using Account No. & IFSC"),t()()(),x(360,"button",154),i(361,"button",125),S("click",function(){return b(c),y(r.bankForm.reset())}),n(362,"\xD7"),t()(),i(363,"form",101)(364,"div",100)(365,"div",155)(366,"div",52)(367,"div",53)(368,"label",42),n(369,"Account Number "),i(370,"sup",126),n(371,"*"),t()(),x(372,"input",156),u(373,Ks,3,2,"div",128),t(),i(374,"div",53)(375,"label",42),n(376,"IFSC Code "),i(377,"sup",126),n(378,"*"),t()(),x(379,"input",157),u(380,Xs,3,2,"div",128),t(),i(381,"div",158)(382,"button",159),S("click",function(){return b(c),y(r.verifyBankAccount())}),n(383),t()()()(),i(384,"div",160)(385,"div",53)(386,"label",42),n(387,"Account Holder Name "),i(388,"sup",126),n(389,"*"),t()(),x(390,"input",161),u(391,ed,2,0,"div",128),t(),i(392,"div",53)(393,"label",42),n(394,"Bank Name "),i(395,"sup",126),n(396,"*"),t()(),x(397,"input",162),u(398,td,2,0,"div",128),t(),i(399,"div",53)(400,"label",42),n(401,"Branch "),i(402,"sup",126),n(403,"*"),t()(),x(404,"input",163),u(405,id,2,0,"div",128),t()()(),i(406,"div",144)(407,"button",145),S("click",function(){return b(c),y(r.bankForm.reset())}
1),n(408,"Cancel"),t(),i(409,"button",146),S("click",function(){return b(c),y(r.saveBankAccount())}),n(410),t()()()()()(),i(411,"div",164)(412,"div",165)(413,"div",96)(414,"div",113)(415,"h5",123),n(416,"Add User"),t(),x(417,"button",166),i(418,"button",125),S("click",function(){return b(c),y(r.userForm.reset())}),n(419,"\xD7"),t()(),i(420,"form",101)(421,"div",100)(422,"div",52)(423,"div",132)(424,"label",42),n(425,"Name "),i(426,"sup",126),n(427,"*"),t()(),x(428,"input",167),u(429,nd,2,0,"div",128),t(),i(430,"div",132)(431,"label",42),n(432,"Phone Number "),i(433,"sup",126),n(434,"*"),t()(),x(435,"input",168),u(436,ld,3,2,"div",128),t(),i(437,"div",132)(438,"label",42),n(439,"Email "),i(440,"sup",126),n(441,"*"),t()(),x(442,"input",169),u(443,dd,3,2,"div",128),t()()(),i(444,"div",144)(445,"button",145),S("click",function(){return b(c),y(r.userForm.reset())}),n(446,"Cancel"),t(),i(447,"button",146),S("click",function(){return b(c),y(r.saveContactUser())}),n(448),t()()()()()(),i(449,"app-common-bom-product-drawer",170,5),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve,qe,Ge,Ue,je,si,di,ci,nn=w(22);l(4),s("backButtonFallback","/finance-management/payable-invoices"),l(5),s("formGroup",r.createInvoiceForm),l(11),s("matAutocomplete",nn),l(3),s("ngForOf",r.poList),l(6),s("ngIf",!r.isManualEntryPo),l(2),s("ngIf",!r.isManualEntryPo&&((c=r.createInvoiceForm.get("invoiceNumber"))==null?null:c.touched)&&((c=r.createInvoiceForm.get("invoiceNumber"))==null?null:c.invalid)),l(5),Be("max",r.invoiceExpiryDateValue||null),l(),s("ngIf",r.isInvoiceDateRangeInvalid&&((g=r.createInvoiceForm.get("invoiceCreationDate"))==null?null:g.touched)),l(5),Be("min",r.invoiceCreationDateValue||null),l(),s("ngIf",r.isInvoiceDateRangeInvalid&&((h=r.createInvoiceForm.get("invoiceExpiryDate"))==null?null:h.touched)),l(6),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",(C=r.createInvoiceForm.get("sellerName"))==null?null:C.value),l(),s("ngIf",(k=r.createInvoiceForm.get("sellerName"))==null?null:k.value),l(12),s("ngIf",!r.isManualEntryPo),l(4),f((O=r.createInvoiceForm.get("bankName"))!=null&&O.value?((O=r.createInvoiceForm.get("bankName"))==null?null:O.value)+" - "+((O=r.createInvoiceForm.get("accountNumber"))==null?null:O.value):"Select bank account"),l(3),s("ngForOf",r.bankDetails),l(),s("ngIf",!r.bankDetail
1s.length),l(5),s("ngIf",(Q=r.createInvoiceForm.get("accountNumber"))==null?null:Q.value),l(11),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(6),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(5),s("ngIf",r.productFormValues.length&&r.poIdState!=="select"&&r.poSelected==!1),l(4),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",r.productFormValues.length),l(),s("ngIf",(r.submitted||r.productRequiredError)&&(!r.productFormValues||r.productFormValues.length===0)),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(12),f(v(143,79,(G=r.createInvoiceForm.get("grossTotal"))==null?null:G.value)),l(6),f(v(149,81,(X=r.createInvoiceForm.get("discount"))==null?null:X.value)),l(6),f(v(155,83,(pe=r.createInvoiceForm.get("netTotal"))==null?null:pe.value)),l(6),f(v(161,85,(Y=r.createInvoiceForm.get("taxes"))==null?null:Y.value)),l(6),f(v(167,87,r.getAdditionalCharges)),l(5),f(v(172,89,(le=r.createInvoiceForm.get("totalPayableAmount"))==null?null:le.value)),l(7),s("disabled",r.createInvoiceForm.invali
1d||!r.productFormValues||r.productFormValues.length===0||r.hasQuantityErrors),l(11),s("formGroup",r.GeneratePoForm),l(5),s("isLoading",r.isAddressLoading)("useBlockPosition",!0),l(),s("ngIf",!r.isAddressLoading),l(14),s("formGroup",r.GeneratePoForm),l(5),s("isLoading",r.isAddressLoading)("useBlockPosition",!0),l(),s("ngIf",!r.isAddressLoading),l(19),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:""),l(24),s("formGroup",r.buyerForm),l(9),s("ngIf",((ee=r.buyerForm.get("organization_name"))==null?null:ee.touched)&&((ee=r.buyerForm.get("organization_name"))==null?null:ee.invalid)),l(18),s("ngIf",((fe=r.buyerForm.get("address"))==null?null:fe.touched)&&((fe=r.buyerForm.get("address"))==null?null:fe.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((oe=r.buyerForm.get("state"))==null?null:oe.touched)&&((oe=r.buyerForm.get("state"))==null?null:oe.invalid)),l(7),s("ngIf",((te=r.buyerForm.get("city"))==null?null:te.touched)&&((te=r.buyerForm.get("city"))==null?null:te.invalid)),l(11),s("ngIf",((me=r.buyerForm.get("country_id"))==null?null:me.touched)&&((me=r.buyerForm.get("country_id"))==null?null:me.invalid)),l(5),s("ngIf",((ce=r.buyerForm.get("postal_code"))==null?null:ce.touched)&&((ce=r.buyerForm.get("postal_code"))==null?null:ce.invalid)),l(10),s("ngIf",((be=r.buyerForm.get("contact_name"))==null?null:be.touched)&&((be=r.buyerForm.get("contact_name"))==null?null:be.invalid)),l(7),s("ngIf",((Fe=r.buyerForm.get("phone"))==null?null:Fe.touched)&&((Fe=r.buyerForm.get("phone"))==null?null:Fe.invalid)),l(7),s("ngIf",((Me=r.buyerForm.get("email"))==null?null:Me.touched)&&((Me=r.buyerForm.get("email"))==null?null:Me.invalid)),l(4),s("disabled",r.buyerSubmitting),l(),m(" ",r.buyerSubmitting?"Saving...":"Save Seller"," "),l(16),s("formGroup",r.bankForm),l(10),s("ngIf",((Ve=r.bankForm.get("accountNumber"))==null?null:Ve.touched)&&((Ve=r.bankForm.get("accountNumber"))==null?null:Ve.invalid)),l(7),s("ngIf",((qe=r.bankForm.get("ifsc"))==null?null:qe.touched)&&((qe=r.bankForm.get("ifsc"))==null?null:qe.invalid)),l(2),s("disabled",r.bankVerifying),l(),m(" ",r.bankVerifying?"Verifying...":"Verify Account"," "),l(8),s("ngIf",((Ge=r.bankForm.get("accountHolder"))==null?null:Ge.touched)&&((Ge=r.bankForm.get("accountHolder"))==null?null:Ge.invalid)),l(7),s("ngIf",((Ue=r.bankForm.get("bankName"))==null?null:Ue.touched)&&((Ue=r.bankForm.get("bankName"))==null?null:Ue.invalid)),l(7),s("ngIf",((je=r.bankForm.get("branch"))==null?null:je.touched)&&((je=r.bankForm.get("branch"))==null?null:je.invalid)),l(4),s("disabled",r.bankSubmitting),l(),m(" ",r.bankSubmitting?"Saving...":"Save bank account"," "),l(10),s("formGroup",r.userForm),l(9),s("ngIf",((si=r.userForm.get("name"))==null?null:si.touched)&&((si=r.userForm.get("name"))==null?null:si.invalid)),l(7),s("ngIf",((di=r.userForm.get("phone"))==null?null:di.touched)&&((di=r.userForm.get("phone"))==null?null:di.invalid)),l(7),s("ngIf",((ci=r.userForm.get("email"))==null?null:ci.touched)&&((ci=r.userForm.get("email"))==null?null:ci.invalid)),l(4),s("disabled",r.userSubmitting),l(),m(" ",r.userSubmitting?"Submitting...":"Submit"," ")}},dependencies:[rt,J,W,Ee,It,Mt,Et,Oe,He,Ke,Ne,at,Ye,Oi,Pe,Ie,Ot,gt,kt,Ft,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ki,Fi,Qi,ae],styles:[".parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}textarea.form-control-sm.mod-input[_ngcontent-%COMP%]{min-height:38px}.min-h-21[_ngcontent-%COMP%]{min-height:21px}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:focus, .shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:active{outline:none!important;box-shadow:none!important}.btn-theme-light[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;
1background:var(--theme-bg-light);color:var(--theme-primary, #5a2c1a);border:1px solid #f0e2db;border-radius:6px;font-size:14px;font-weight:500;line-height:1.2;white-space:nowrap;transition:background .15s ease,border-color .15s ease}.btn-theme-light[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px;line-height:1}.btn-theme-light[_ngcontent-%COMP%]:hover, .btn-theme-light[_ngcontent-%COMP%]:focus{background:#f4e3dc;border-color:#e8d3ca;color:var(--theme-primary, #5a2c1a);text-decoration:none}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__name[_ngcontent-%COMP%]{color:#000}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.fin-address-chip[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;background:var(--theme-bg-light);border-radius:8px;padding:12px 14px}.fin-address-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:18px;color:#555;margin-top:2px}.fin-address-chip__title[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-address-chip__addr[_ngcontent-%COMP%]{display:block;font-size:13px;color:#777}.fin-bank-card[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden;border:1px solid #f1e0d9}.fin-bank-card__head[_ngcontent-%COMP%]{background:var(--theme-bg-light);padding:14px 18px}.fin-bank-card__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;margin:0;color:#000}.fin-bank-card__city[_ngcontent-%COMP%]{font-size:13px;color:#777}.fin-bank-card__body[_ngcontent-%COMP%]{padding:16px 18px}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:22px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary-card[_ngcontent-%COMP%]{overflow:hidden}.fin-summary-card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding-bottom:0}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}.fin-modal-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:8px;background:var(--theme-bg-light);margin-right:12px}.fin-modal-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:var(--theme-primary, #6b2f1a)}.fin-verify-box[_ngcontent-%COMP%]{border:1px solid #ececec;border-radius:8px;padding:18px;margin-bottom:8px}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var on=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-invoice-details"]],decls:240,vars:1,consts:[[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],[1,"col-md-auto"],["href","#deleteConfirmationModal","data-toggle","modal",1,"mod-btn","mod-btn-outline-danger","ml-3"],[1,"ri-delete-bin-line"],["appTranslate",""],["href","#","download","",1,"mod-btn","mod-btn-outline-primary","ml-3"],[1,"ri-download-2-line"],["routerLink","/finance-management/payable-invoices/edit/1",1,"mod-btn","mod-btn-primary","ml-3"],[1,"ri-pencil-line"],[1,"row"],[1,"card","invoiceDetailsCard__one","mb-30"],[1,"card-body"],[1,"media-object","align-items-center"],[1,"media-object-shrink","mr-15"],["src","https://placehold.co/300x300/EEE/31343C","alt","",1,"img-fluid"],[1,"media-object-grow"],[1,"mb-2","fw-400","text-secondary"],[1,"mb-2","h5","fw-600","text-muted"],[1,"mb-0","small"],[1,"card","invoiceDetailsCard__two","mb-30"],["appTranslate","",1,"mt-4","fw-600"],[1,"list-group","list-group-flush"],[1,"list-group-item"],["appTranslate","",1,"label"],[1,"value"],[1,"commonBadge","badge","badge-blue-s"],["appTranslate","",1,"mt-5","fw-600"],[1,"table-dashboard","table-x-negativeMargin"],[1,"table-responsive"],[1,"table","mod-table"],["appTranslate","",1,"text-right"],[1,"text-right"],[1,"row","mt-30"],[1,"col-md","col-12"],[1,"col-md-auto","col-12"],[1,"card","taxCard"],[1,"card-body","bg-light"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"hilight-element"],[1,"card-footer","theme-bg","text-white","fw-600"],[1,"card","contactCard","mb-30"],[1,"knownContact"],["appTranslate","",1,"fw-600"],["type","button","routerLink","/crm/deals/1",1,"mod-btn","mod-btn-primary"],[1,"ri-question-answer-line"],[1,"list-unstyled","mt-3"],["href","tel:+919876543211"],["id","deleteConfirmationModal",1,"modal"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-body"],["type","button","data-dismiss","modal",1,"close"],[1,"text-center","mt-4"],[1,"ri-error-warning-line","text-warning","font-48"],["appTranslate","",1,"text-center","mb-4","mt-2","fw-500"],[1,"text-center","mb-4"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-outline-primary","mr-3"],["type","button","routerLink","/finance-management/payable-invoices/","appTranslate","",1,"mod-btn","mod-btn-danger"]],template:function(o,r){o&1&&(i(0,"main")(1,"div",0)(2,"div",1)(3,"h2",2)(4,"a",3),x(5,"i",4),t(),n(6,"INV75QW451A1"),t()(),i(7,"div",5)(8,"a",6),x(9,"i",7),i(10,"span",8),n(11,"Delete"),t()(),i(12,"a",9),x(13,"i",10),i(14,"span",8),n(15,"Download"),t()(),i(16,"a",11),x(17,"i",12),i(18,"span",8),n(19,"Edit"),t()()()(),i(20,"div",13)(21,"div",1)(22,"div",14)(23,"div",15)(24,"div",16)(25,"div",17),x(26,"img",18),t(),i(27,"div",19)(28,"div",13)(29,"div",1)(30,"h6",20)(31,"b",8),n(32,"GSTIN:"),t(),n(33," 07ABCDE1234F2Z5"),t(),i(34,"h3",21),n(35,"Company name for sample"),t(),i(36,"p",22),n(37,"Created 2 days ago"),t()()()()()()(),i(38,"div",23)(39,"div",15)(40,"h5",24),n(41,"Basic Invoice Info"),t(),i(42,"ul",25)(43,"li",26)(44,"p",27),n(45,"Invoice Number"),t(),i(46,"p",28),n(47,"INVRT12369QAE"),t()(),i(48,"li",26)(49,"p",27),n(50,"Invoice Date"),t(),i(51,"p",28),n(52,"12-05-2025"),t()(),i(53,"li",26)(54,"p",27),n(55,"Due Date"),t(),i(56,"p",28),n(57,"15-05-2025"),t()(),i(58,"li",26)(59,"p",27),n(60,"Status"),t(),i(61,"p",28)(62,"span",29),n(63,"Open"),t()()()(),i(64,"h5",30),n(65,"Product Information"),t(),i(66,"div",31)(67,"div",32)(68,"table",33)(69,"thead")(70,"tr")(71,"th",8),n(72,"S.No."),t(),i(73,"th",8),n(74,"Product Name"),t(),i(75,"th",8),n(76,"Quantity"),t(),i(77,"th",8),n(78,"Unit Price"),t(),i(79,"th",8),n(80,"Tax"),t(),i(81,"th",34),n(82,"Total"),t()()(),i(83,"tbody")(84,"tr")(85,"td"),n(86,"1"),t(),i(87,"td"),n(88,"Product Name"),t(),i(89,"td"),n(90,"1"),t(),i(91,"td"),n(92,"100.00"),t(),i(93,"td"),n(94,"18%"),t(),i(95,"td",35),n(96,"118.00"),t()(),i(97,"tr")(98,"td"),n(99,"2"),t(),i(100,"td"),n(101,"Product Name"),t(),i(102,"td"),n(103,"1"),t(),i(104,"td"),n(105,"100.00"),t(),i(106,"td"),n(107,"18%"),t(),i(108,"td",35),n(109,"118.00"),t()(),i(110,"tr")(111,"td"),n(112,"3"),t(),i(113,"td"),n(114,"Product Name"),t(),i(115,"td"),n(116,"1"),t(),i(117,"td"),n(118,"100.00"),t(),i(119,"td"),n(120,"18%"),t(),i(121,"td",35),n(122,"118.00"),t()()()()()(),i(123,"div",36),x(124,"div",37),i(125,"div",38)(126,"div",39)(127,"div",40)(128,"ul",41)(129,"li",42)(130,"b",8),n(131,"Gross Total:"),t(),i(132,"span",43),n(133," \u20B9 2,70,400.00"),t()(),i(134,"li",42)(135,"b",8),n(136,"Discount:"),t(),i(137,"span",44),n(138,"(-) \u20B9 0.00"),t()(),i(139,"li",42)(140,"b",8),n(141,"Net Total:"),t(),i(142,"span",43),n(143," \u20B9 2,70,400.00"),t()(),i(144,"li",42)(145,"b",8),n(146,"Tax Amount:"),t(),i(147,"span",43),n(148," \u20B9 40,560.00"),t()(),i(149,"li",45)(150,"span",8),n(151,"SGST:"),t(),i(152,"span",43),n(153," \u20B9 0.00"),t()(),i(154,"li",45)(155,"span",8),n(156,"CGST:"),t(),i(157,"span",43),n(158," \u20B9 0.00"),t()(),i(159,"li",45)(160,"span",8),n(161,"IGST:"),t(),i(162,"span",43),n(163," \u20B9 40,560.00"),t()(),i(164,"li",42)(165,"b",8),n(166,"Logistics:"),t(),i(167,"span",43),n(168," \u20B9 0.00"),t()(),i(169,"li",42)(170,"b",8),n(171,"Insurance:"),t(),i(172,"span",43),n(173," \u20B9 0.00"),t()(),i(174,"li",46)(175,"b",8),n(176,"Remaining Amount:"),t(),i(177,"span",43),n(178," \u20B9 3,10,960.00"),t()()()(),i(179,"div",47)(180,"span",8),n(181,"Total Payable Amount:"),t(),i(182,"span",43),n(183," \u20B9 3,10,960.00"),t()()()()()()()(),i(184,"div",5)(185,"div",48)(186,"div",15)(187,"div",49)(188,"h5",50),n(189,"Contact Card"),t(),i(190,"p",8),n(191,"Good news! This user is already on Vipani. Head over to the Deal Room to connect directly"),t(),i(192,"button",51),x(193,"i",52),i(194,"span",8),n(195,"Deal Room"),t()()(),i(196,"h5",50),n(197,"Contact Details"),t(),i(198,"ul",53)(199,"li")(200,"p",27),n(201,"Business Name "),t(),i(202,"p",28),n(203,"Ranjith Travels"),t()(),i(204,"li")(205,"p",27),n(206,"GSTIN "),t(),i(207,"p",28),n(208,"07ABCDE1234F2Z5 "),t()(),i(209,"li")(210,"p",27),n(211,"Address "),t(),i(212,"p",28),n(213,"501,Srinivas Colony, Jai Bharat Nagar, Nizampet, Hyderabad, Telangana, India- 500090 "),t()(),i(214,"li")(215,"p",27),n(216,"Contact Person"),t(),i(217,"p",28),n(218,"Ranjith Gunda"),t()(),i(219,"li")(220,"p",27),n(221,"Contact Number"),t(),i(222,"p",28)(223,"a",54),n(224,"+91 9876543211"),t()()()()()()()()(),i(225,"div",55)(226,"div",56)(227,"div",57)(228,"div",58)(229,"button",59),n(230,"\xD7"),t(),i(231,"div",60),x(232,"i",61),t(),i(233,"p",62),n(234,"Are you sure you want to delete this invoice?"),t(),i(235,"div",63)(236,"button",64),n(237,"Cancel"),t(),i(238,"button",65),n(239,"Delete"),t()()()()()()),o&2&&(l(4),s("backButtonFallback","/finance-management/payable-invoices"))},dependencies:[Ee,Z,L],styles:['.invoiceDetailsCard__one[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:120px;border-radius:.65rem}.invoiceDetailsCard__one[_ngcontent-%COMP%] .media-object-grow[_ngcontent-%COMP%] h4[_ng
1content-%COMP%]{color:#4b5563;font-size:1rem;margin-bottom:10px;font-weight:600}.invoiceDetailsCard__one[_ngcontent-%COMP%] .media-object-grow[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{color:#4b5563;font-weight:400;font-size:1.15rem;margin-bottom:10px}.invoiceDetailsCard__one[_ngcontent-%COMP%] .media-object-grow[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#000;font-weight:500;margin-bottom:0}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%]{margin-top:15px}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;border-color:#efefef}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] p.label[_ngcontent-%COMP%]{color:#6b6b6b;margin-bottom:0;font-weight:400;min-width:170px}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] p.value[_ngcontent-%COMP%]{font-weight:500;margin-bottom:0;color:#333}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object[_ngcontent-%COMP%]{align-items:center}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object-shrink[_ngcontent-%COMP%]{margin-right:10px}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object-shrink[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;object-fit:cover}.invoiceDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object-grow[_ngcontent-%COMP%]{font-weight:600}.invoiceDetailsCard__two[_ngcontent-%COMP%] .taxCard[_ngcontent-%COMP%]{min-width:300px}.contactCard[_ngcontent-%COMP%]{min-width:250px;max-width:250px}@media only screen and (min-width: 1600px){.contactCard[_ngcontent-%COMP%]{min-width:350px;max-width:350px}}.contactCard[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:#333}.contactCard[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{color:#6b6b6b;font-size:90%;margin-bottom:0}.contactCard[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{font-weight:500;margin-bottom:20px}.contactCard[_ngcontent-%COMP%] .activity-log[_ngcontent-%COMP%] .activity-log-step[_ngcontent-%COMP%]{flex-wrap:wrap}.contactCard[_ngcontent-%COMP%] .activity-log[_ngcontent-%COMP%] .activity-log-step[_ngcontent-%COMP%] .media-object-shrink[_ngcontent-%COMP%], .contactCard[_ngcontent-%COMP%] .activity-log[_ngcontent-%COMP%] .activity-log-step[_ngcontent-%COMP%] .media-object-grow[_ngcontent-%COMP%]{width:100%}.activity-log[_ngcontent-%COMP%]{position:relative;margin-top:20px;padding-left:4px}.activity-log-step[_ngcontent-%COMP%]{padding-bottom:10px;position:relative;padding-left:20px;display:flex;min-height:40px}.activity-log-step[_ngcontent-%COMP%]:before{content:"";position:absolute;top:5px;bottom:0;left:-4px;width:10px;height:10px;border-radius:50%;background-color:var(--theme-blue2);z-index:9}.activity-log-step[_ngcontent-%COMP%]:not(:last-child):after{content:"";position:absolute;top:16px;left:0;bottom:-8px;width:1px;background-color:#e9e9e9}.activity-log-step[_ngcontent-%COMP%] .media-object-shrink[_ngcontent-%COMP%]{font-weight:600;color:var(--dark);padding-right:15px}.activity-log-step[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{font-weight:600;color:var(--dark);padding:0 6px}.knownContact[_ngcontent-%COMP%]{margin-bottom:24px;background-color:#eef9ff;border-radius:5px;padding:15px}']})}}return a})();var cd=["invoiceSearchInput"];function pd(a,d){a&1&&(i(0,"div",126),x(1,"i",127),i(2,"span",9),n(3,"Loading..."),t()())}function md(a,d){if(a&1){let e=I();
1i(0,"li",131),S("mousedown",function(){let r=b(e).$implicit,c=p(3);return y(c.selectInvoice(r))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id," ")}}function ud(a,d){a&1&&(i(0,"li",132),n(1," No invoices found "),t())}function _d(a,d){if(a&1&&(i(0,"ul",128),u(1,md,2,1,"li",129)(2,ud,2,0,"li",130),t()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceList),l(),s("ngIf",(e.invoiceList==null?null:e.invoiceList.length)===0)}}function vd(a,d){if(a&1){let e=I();i(0,"div",121)(1,"div",122)(2,"input",123,1),S("input",function(r){b(e);let c=p();return y(c.onSearchInput(r))})("click",function(r){return b(e),y(r.stopPropagation())}),t()(),u(4,pd,4,0,"div",124)(5,_d,3,2,"ul",125),t()}if(a&2){let e=p();l(4),s("ngIf",e.isInvoiceLoading),l(),s("ngIf",!e.isInvoiceLoading)}}function gd(a,d){a&1&&(i(0,"div",133),n(1,"Invoice Number is required"),t())}function fd(a,d){a&1&&(i(0,"div",133),n(1,"Payment ID is required"),t())}function hd(a,d){a&1&&(i(0,"div",133),n(1,"Payment Date is required"),t())}function xd(a,d){a&1&&(i(0,"div",133),n(1,"Payment Method is required"),t())}function bd(a,d){a&1&&(i(0,"mat-option",144),x(1,"div",145),n(2," Searching... "),t())}function yd(a,d){if(a&1&&(i(0,"mat-option",146)(1,"div",147)(2,"div",148),n(3),t(),i(4,"div",149),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function Sd(a,d){a&1&&(i(0,"mat-option",144),n(1,"No matches found"),t())}function Cd(a,d){a&1&&(i(0,"div",133),n(1,"Seller Name is required"),t())}function Ed(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",134)(2,"div",25)(3,"label",19)(4,"span",9),n(5,"Seller Name"),t(),i(6,"sup",20),n(7,"*"),t()(),i(8,"mat-form-field",135)(9,"mat-select",136,2),S("selectionChange",function(r){b(e);let c=w(10),g=p();return y(g.onSelectSellerOption(r.value,c))}),i(11,"mat-select-trigger"),n(12),t(),i(13,"div",137),S("click",function(r){return b(e),y(r.stopPropagation())}),i(14,"mat-form-field",138)(15,"input",139),S("input",function(r){b(e);let c=p();return y(c.onSearchSellers(r))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(16,bd,3,0,"mat-option",140)(17,yd,6,5,"mat-option",93)(18,Sd,2,0,"mat-option",140),i(19,"mat-option",141),x(20,"i",142),n(21," Add New Seller "),t()()(),x(22,"button",143),u(23,Cd,2,0,"div",24),t()()()}if(a&2){let e,o,r=p();l(9),s("value",r.sellerBuyerId),l(3),m(" ",((e=r.createPayamentForm.get("sellerName"))==null?null:e.value)||"Type to search or add seller"," "),l(3),s("value",r.sellerSearchTerm),l(),s("ngIf",r.isSearchLoading),l(),s("ngForOf",r.sellerOptions),l(),s("ngIf",!r.isSearchLoading&&r.sellerSearchTerm&&r.sellerOptions.length===0),l(),s("value",r.ADD_SUPPLIER),l(4),s("ngIf",((o=r.createPayamentForm.get("sellerName"))==null?null:o.touched)&&((o=r.createPayamentForm.get("sellerName"))==null?null:o.invalid))}}function Id(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createPayamentForm.get("state"))==null?null:e.value,"")}}function Dd(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createPayamentForm.get("city"))==null?null:e.value,"")}}function Td(a,d){if(a&1&&(i(0,"div",58)(1,"span",156),n(2,"Billing Address"),t(),i(3,"span",157),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createPayamentForm.get("sellerAddress"))==null?null:e.value)}}function wd(a,d){if(a&1&&(i(0,"div",158)(1,"span",156),n(2,"Contact Name"),t(),i(3,"span",157),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createPayamentForm.get("contactName"))==null?null:e.value)}}function Pd(a,d){if(a&1&&(i(0,"div",158)(1,"span",156),n(2,"Contact Number"),t(),i(3,"span",157),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createPayamentForm.get("contactPersonNumber"))==null?null:e.value)}}function Od(a,d){if(a&1&&(i(0,"div",158)(1,"span",156),n(2,"Contact Email"),t(),i(3,"span",157),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createPayamentForm.get("contactPersonEmail"))==null?null:e.value)}}function kd(a,d){if(a&1&&(i(0,"div",150)(1,"h4",151),n(2),t(),i(3,"p",152),n(4),u(5,Id,2,1,"ng-container",65)(6,Dd,2,1,"ng-container",65),t(),x(7,"hr",153),i(8,"div",83),u(9,Td,5,1,"div",154)(10,wd,5,1,"div",155)(11,Pd,5,1,"div",155)(12,Od,5,1,"div",155),t()()),a&2){let e,o,r,c,g,h,C,k,O=p();l(2),f((e=O.createPayamentForm.get("sellerName"))==null?null:e.value),l(2),m(" ",(o=O.createPayamentForm.get("gstNumber"))==null?null:o.value," "),l(),s("ngIf",(r=O.createPayamentForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=O.createPayamentForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=O.createPayamentForm.get("sellerAddress"))==null?null:g.value),l(),s("ngIf",(h=O.createPayamentForm.get("contactName"))==null?null:h.value),l(),s("ngIf",(C=O.createPayamentForm.get("contactPersonNumber"))==null?null:C.value),l(),s("ngIf",(k=O.createPayamentForm.get("contactPersonEmail"))==null?null:k.value)}}function Fd(a,d){if(a&1){let e=I();
1i(0,"a",168),S("click",function(){let r=b(e).$implicit,c=p(2);return y(c.selectBankAccount(r))}),i(1,"span",169),n(2),t(),i(3,"small",170),n(4),t()()}if(a&2){let e=d.$implicit;l(2),f(e.bank_name),l(2),D("",e.account_name," - ",e.account_number,"")}}function Md(a,d){a&1&&(i(0,"span",9),n(1,"Please select a seller first"),t())}function Ad(a,d){a&1&&(i(0,"span",9),n(1,"No saved bank accounts"),t())}function Nd(a,d){if(a&1&&(i(0,"div",171),u(1,Md,2,0,"span",172)(2,Ad,2,0,"span",172),t()),a&2){let e,o,r=p(2);l(),s("ngIf",!((e=r.createPayamentForm.get("sellerName"))!=null&&e.value)),l(),s("ngIf",(o=r.createPayamentForm.get("sellerName"))==null?null:o.value)}}function Vd(a,d){if(a&1&&(i(0,"div",159)(1,"div",5)(2,"div",160)(3,"label",19)(4,"span",9),n(5,"Select Bank account"),t()(),i(6,"div",161)(7,"div",162)(8,"span"),n(9),t(),x(10,"i",163),t(),i(11,"div",164),u(12,Fd,5,3,"a",165)(13,Nd,3,2,"div",166),t()()()(),i(14,"div",10)(15,"button",167),x(16,"i",142),n(17," Add New "),t()()()),a&2){let e,o=p();l(9),f((e=o.createPayamentForm.get("sellerBankName"))!=null&&e.value?((e=o.createPayamentForm.get("sellerBankName"))==null?null:e.value)+" - "+((e=o.createPayamentForm.get("sellerAccountNumber"))==null?null:e.value):"Select bank account"),l(3),s("ngForOf",o.bankDetails),l(),s("ngIf",!o.bankDetails.length)}}function Bd(a,d){if(a&1&&(i(0,"div",173)(1,"div",174)(2,"h4",175),n(3),t(),i(4,"span",176),n(5),t()(),i(6,"div",177)(7,"div",178)(8,"span",156),n(9,"Account Holder"),t(),i(10,"span",157),n(11),t()(),i(12,"div",178)(13,"span",156),n(14,"Account Number"),t(),i(15,"span",157),n(16),t()(),i(17,"div",178)(18,"span",156),n(19,"IFSC Code"),t(),i(20,"span",157),n(21),t()(),i(22,"div",178)(23,"span",156),n(24,"Branch"),t(),i(25,"span",157),n(26),t()()()()),a&2){let e,o,r,c,g,h,C=p();l(3),f((e=C.createPayamentForm.get("sellerBankName"))==null?null:e.value),l(2),f((o=C.createPayamentForm.get("sellerBankBranch"))==null?null:o.value),l(6),f((r=C.createPayamentForm.get("sellerAccountName"))==null?null:r.value),l(5),f((c=C.createPayamentForm.get("sellerAccountNumber"))==null?null:c.value),l(5),f((g=C.createPayamentForm.get("sellerIfscCode"))==null?null:g.value),l(5),f((h=C.createPayamentForm.get("sellerBankBranch"))==null?null:h.value)}}function Rd(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Bank Name"),t(),x(5,"input",179),t()(),i(6,"div",17)(7,"div",25)(8,"label",26),n(9,"Account Number"),t(),x(10,"input",180),t()(),i(11,"div",17)(12,"div",25)(13,"label",26),n(14,"IFSC Code"),t(),x(15,"input",181),t()()())}function Ld(a,d){a&1&&(i(0,"span"),n(1,"Choose file"),t())}function qd(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function Gd(a,d){if(a&1&&x(0,"app-loader",185),a&2){let e=p(2);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function Ud(a,d){if(a&1){let e=I();i(0,"li",186)(1,"p",187)(2,"a",188),n(3),t(),i(4,"span",189)(5,"i",190),S("click",function(){let r=b(e).$implicit;p();let c=w(19),g=p();return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function jd(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Cheque/DD Number"),t(),x(5,"input",182),t()(),i(6,"div",17)(7,"div",25)(8,"label",26),n(9,"Cheque/DD Date"),t(),x(10,"input",183),t()(),i(11,"div",17)(12,"div",25)(13,"label",26),n(14,"Bank & Branch"),t(),x(15,"input",184),t()(),i(16,"div",61)(17,"div",62)(18,"input",63,0),S("change",function(r){b(e);let c=p();return y(c.fileChange(r))}),t(),i(20,"label",64),u(21,Ld,2,0,"span",65)(22,qd,2,0,"span",65),t(),u(23,Gd,1,2,"app-loader",66),t()(),i(24,"div",58)(25,"ul",67),u(26,Ud,6,2,"li",68),t()()()}if(a&2){let e=p();l(18),s("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function $d(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Received By"),t(),x(5,"input",191),t()()())}function zd(a,d){a&1&&(i(0,"span"),n(1,"Choose file"),t())}function Wd(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function Qd(a,d){if(a&1&&x(0,"app-loader",185),a&2){let e=p(2);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function Yd(a,d){if(a&1){let e=I();i(0,"li",199)(1,"p",187)(2,"a",188),n(3),t(),i(4,"span",189)(5,"i",190),S("click",function(){let r=b
1(e).$implicit;p();let c=w(20),g=p();return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function Hd(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Card Type"),t(),i(5,"select",192)(6,"option",34),n(7,"Select Card Type"),t(),i(8,"option",193),n(9,"Credit Card"),t(),i(10,"option",194),n(11,"Debit Card"),t()()()(),i(12,"div",17)(13,"div",25)(14,"label",26),n(15,"Transaction ID"),t(),x(16,"input",195),t()(),i(17,"div",196)(18,"div",62)(19,"input",63,0),S("change",function(r){b(e);let c=p();return y(c.fileChange(r))}),t(),i(21,"label",64),u(22,zd,2,0,"span",65)(23,Wd,2,0,"span",65),t(),u(24,Qd,1,2,"app-loader",66),t()(),i(25,"div",58)(26,"ul",197),u(27,Yd,6,2,"li",198),t()()()}if(a&2){let e=p();l(19),s("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function Kd(a,d){a&1&&(i(0,"span"),n(1,"Choose file"),t())}function Zd(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function Jd(a,d){if(a&1&&x(0,"app-loader",185),a&2){let e=p(2);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function Xd(a,d){if(a&1){let e=I();i(0,"li",199)(1,"p",187)(2,"a",188),n(3),t(),i(4,"span",189)(5,"i",190),S("click",function(){let r=b(e).$implicit;p();let c=w(14),g=p();return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function e0(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"UPI ID"),t(),x(5,"input",200),t()(),i(6,"div",17)(7,"div",25)(8,"label",26),n(9,"UPI Transaction ID"),t(),x(10,"input",201),t()(),i(11,"div",196)(12,"div",62)(13,"input",63,0),S("change",function(r){b(e);let c=p();return y(c.fileChange(r))}),t(),i(15,"label",64),u(16,Kd,2,0,"span",65)(17,Zd,2,0,"span",65),t(),u(18,Jd,1,2,"app-loader",66),t()(),i(19,"div",58)(20,"ul",197),u(21,Xd,6,2,"li",198),t()()()}if(a&2){let e=p();l(13),s("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function t0(a,d){a&1&&(i(0,"span"),n(1,"Choose file"),t())}function i0(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function n0(a,d){if(a&1&&x(0,"app-loader",185),a&2){let e=p(2);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function a0(a,d){if(a&1){let e=I();i(0,"li",199)(1,"p",187)(2,"a",188),n(3),t(),i(4,"span",189)(5,"i",190),S("click",function(){let r=b(e).$implicit;p();let c=w(28),g=p();return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function r0(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Gateway Name"),t(),i(5,"select",202)(6,"option",34),n(7,"Select Gateway"),t(),i(8,"option",203),n(9,"Razorpay"),t(),i(10,"option",204),n(11,"PayU"),t(),i(12,"option",205),n(13,"CCAvenue"),t(),i(14,"option",206),n(15,"Instamojo"),t(),i(16,"option",207),n(17,"Stripe"),t(),i(18,"option",208),n(19,"Other"),t()()()(),i(20,"div",17)(21,"div",25)(22,"label",26),n(23,"Gateway Transaction ID"),t(),x(24,"input",209),t()(),i(25,"div",196)(26,"div",62)(27,"input",63,0),S("change",function(r){b(e);let c=p();return y(c.fileChange(r))}),t(),i(29,"label",64),u(30,t0,2,0,"span",65)(31,i0,2,0,"span",65),t(),u(32,n0,1,2,"app-loader",66),t()(),i(33,"div",58)(34,"ul",197),u(35,a0,6,2,"li",198),t()()()}if(a&2){let e=p();l(27),s("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function l0(a,d){a&1&&(i(0,"span"),n(1,"Choose File"),t())}function o0(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function s0(a,d){if(a&1&&x(0,"app-loader",185),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function d0(a,d){if(a&1){let e=I();i(0,"li",186)(1,"p",187)(2,"a",188),n(3),t(),i(4,"span",189)(5,"i",190),S("click",function(){let r=b
1(e).$implicit,c=p(),g=w(185);return y(c.OnClickDeleteDoc(r.name,g))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function c0(a,d){a&1&&(i(0,"div",210),n(1,"Organization name is required"),t())}function p0(a,d){a&1&&(i(0,"div",210),n(1,"Address is required"),t())}function m0(a,d){if(a&1&&(i(0,"option",146),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function u0(a,d){a&1&&(i(0,"div",210),n(1,"State is required"),t())}function _0(a,d){a&1&&(i(0,"div",210),n(1,"City is required"),t())}function v0(a,d){a&1&&(i(0,"div",210),n(1,"Country is required"),t())}function g0(a,d){a&1&&(i(0,"div",210),n(1,"Postal code must be 6 digits"),t())}function f0(a,d){a&1&&(i(0,"div",210),n(1,"Contact name is required"),t())}function h0(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function x0(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function b0(a,d){if(a&1&&(i(0,"div",210),u(1,h0,2,0,"span",65)(2,x0,2,0,"span",65),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.buyerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function y0(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function S0(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function C0(a,d){if(a&1&&(i(0,"div",210),u(1,y0,2,0,"span",65)(2,S0,2,0,"span",65),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.buyerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function E0(a,d){a&1&&(i(0,"span"),n(1,"Account number is required"),t())}function I0(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid account number"),t())}function D0(a,d){if(a&1&&(i(0,"div",210),u(1,E0,2,0,"span",65)(2,I0,2,0,"span",65),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("accountNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("accountNumber"))==null||o.errors==null?null:o.errors.pattern)}}function T0(a,d){a&1&&(i(0,"span"),n(1,"IFSC code is required"),t())}function w0(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid IFSC code"),t())}function P0(a,d){if(a&1&&(i(0,"div",210),u(1,T0,2,0,"span",65)(2,w0,2,0,"span",65),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("ifsc"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("ifsc"))==null||o.errors==null?null:o.errors.pattern)}}function O0(a,d){a&1&&(i(0,"div",210),n(1,"Account holder name is required"),t())}function k0(a,d){a&1&&(i(0,"div",210),n(1,"Bank name is required"),t())}function F0(a,d){a&1&&(i(0,"div",210),n(1,"Branch is required"),t())}function sn(a){document.getElementById(a)?.click()}var Ea=(()=>{class a{constructor(e,o,r,c,g,h){this.fb=e,this.financeService=o,this.FinanceOrderService=r,this.onboardingService=c,this.notificationService=g,this.router=h,this.submitted=!1,this.searchText="",this.displaySearchList=!1,this.searchList=[],this.isSearchLoading=!1,this.states=[],this.uploadedTermsDocs=[],this.disabledFields=!1,this.loadingStates={termsDocs:!1},this.invoiceList=[],this.isInvoiceLoading=!1,this.showInvoiceDropdown=!1,this.searchTex="",this.invoiceMainId=0,this.lockedFields={},this.sellerOptions=[],this.sellerSearchTerm="",this.disableGstField=!1,this.ADD_SUPPLIER="__add_supplier__",this.bankDetails=[],this.buyerSubmitting=!1,this.bankSubmitting=!1,this.bankVerifying=!1,this.sellerBuyerId=0,this.initializePaymentsForm(),this.initializeBuyerForm(),this.initializeBankForm()}ngOnInit(){this.onSearchSellers({target:{value:""}}),this.getStates(),this.getInvoiceList(),this.paymentId()}initializePaymentsForm(){this.createPayamentForm=this.fb.group({paymentId:["",E.required],paymentDate:["",E.required],paymentType:[""],paymentStatus:[""],sellerName:["",E.required],gstNumber:[""],sellerAddress:[""],city:[""],state:[""],country:[""],pincode:[""],contactPersonName:[""],contactPersonNumber:["",E.pattern(/^\d{10}$/)],contactPersonEmail:[""],sellerBankName:[""],sellerAccountNumber:[""],sellerIfscCode:[""],sellerBankBranch:[""],sellerAccountName:[""],invoiceNumber:["",E.required],invoiceDate:[""],invoiceAmount:0,balanceAmount:0,dueDate:[""],paymentAmount:0,currency:[""],exchangeRate:0,discountsApplied:0,tax:[""],netPayableAmount:0,paymentMode:[""],bankName:[""],accountNumber:[""],ifscCode:[""],chequeNumber:[""],chequeDate:[""],bankBranch:[""],receivedBy:[""],cardType:[""],cardTransactionId:[""],upiId:[""],upiTransactionId:[""],gatewayName:[""],gatewayTransactionId:[""],contactName:[""],contactNumber:[""],contactEmail:[""],termsandConditions:[""]})}get paymentMode(){return this.createPayamentForm.get("paymentMode")?.value}toTenDigitNumber(e){return String(e||"").replace(/\D/g,"").slice(0,10)}limitContactNumber(e){let o=this.createPayamentForm.get(e);if(!o)return;let r=this.toTenDigitNumber(o.value);o.value!==r&&o.setValue(r,{emitEvent:!1})}toggleInvoiceDropdown(){this.showInvoiceDropdown=!this.showInvoiceDropdown,this.showInvoiceDropdown&&(this.searchTex="",this.getInvoiceList(),setTimeout(()=>{this.invoiceSearchInput?.nativeElement?.focus()},50))}buildPaymentModeDetails(e){switch(e.paymentMode){case"bankTransfer":return{bankName:e.bankName||"",accountNumber:e.accountNumber||"",ifscCode:e.ifscCode||""};case"Cheque/DD":return{chequeNumber:e.chequeNumber||"",chequeDate:e.chequeDate||"",bankBranch:e.bankBranch||"",attachments:this.uploadedTermsDocs.map(o=>o.path)};case"cash":return{receivedBy:e.receivedBy||""};case"card":return{cardType:e.cardType||"",cardTransactionId:e.cardTransactionId||"",attachments:this.uploadedTermsDocs.map(o=>o.path)};case"Wallet/UPI":return{upiId:e.upiId||"",upiTransactionId:e.upiTransactionId||"",attachments:this.uploadedTermsDocs.map(o=>o.path)};case"paymentGateway":return{gatewayName:e.gatewayName||"",gatewayTransactionId:e.gatewayTransactionId||"",attachments:this.uploadedTermsDocs.map(o=>o.path)};default:return{}}}mapPaymentMode(e){return{bankTransfer:"bankTransfer",chequeDd:"Cheque/DD",cash:"cash",card:"card",walletUpi:"Wallet/UPI",paymentGateway:"paymentGateway"}[e]||e}mapPaymentType(e){return{advance:"Advance",partial:"Partial",final:"Final",refund:"Refund",crediNoteSettlement:"Credit Note Settlement"}[e]||e}
1onSave(){if(this.submitted=!0,this.createPayamentForm.invalid)return;let e=this.createPayamentForm.value,o=Number(e.paymentAmount)||0,r=Number(e.balanceAmount)||0;if(r>0&&o>r){this.notificationService.showError("Payment amount cannot exceed the balance amount.");return}let c={paymentId:e.paymentId,paymentDate:e.paymentDate,paymentType:this.mapPaymentType(e.paymentType),recordType:"BUYER",source:"MANUAL",invoiceId:this.invoiceMainId,invoiceNo:e.invoiceNumber,invoiceDate:e.invoiceDate,invoiceAmount:Number(e.invoiceAmount)||0,balanceAmount:Number(e.balanceAmount)||0,dueDate:e.dueDate,seller_buyer_Id:this.sellerBuyerId,seller_buyer_Name:e.sellerName,gstin:e.gstNumber||"",contactName:e.contactName||"",contactNumber:e.contactPersonNumber||"",contactEmail:e.contactPersonEmail||"",paymentAmount:Number(e.paymentAmount)||0,currency:e.currency?e.currency.toUpperCase():"",exchangeRate:Number(e.exchangeRate)||0,netPayableAmount:Number(e.netPayableAmount)||0,paymentMode:this.mapPaymentMode(e.paymentMode),paymentModeDetails:this.buildPaymentModeDetails(e),terms:e.termsandConditions||"",attachments:this.uploadedTermsDocs.map(g=>g.path)};this.financeService.paymentmanualCreate(c).subscribe({next:g=>{g.responseCode===200?(this.notificationService.showSuccess("Payment created successfully"),this.router.navigate(["finance-management/payable-payments"])):this.notificationService.showError(typeof g?.response=="string"&&g.response||g?.message||"Something went wrong")},error:g=>{this.notificationService.showError(typeof g?.error?.response=="string"&&g.error.response||g?.error?.message||"Something went wrong")}})}paymentId(){let e={recordType:"BUYER"};this.financeService.getPaymentId(e).subscribe({next:o=>{this.createPayamentForm.patchValue({paymentId:o.response.payment_id})}})}onSearchInput(e){this.searchTex=e.target.value.toLowerCase(),this.getInvoiceList()}handleInvoiceDisplay(e){e||setTimeout(()=>{this.showInvoiceDropdown=!1},200)}getInvoiceList(){this.isInvoiceLoading=!0,this.FinanceOrderService.GetInvoiceList({user_type:"BUYER",type:"INVOICE",pageLength:10,currentPage:1,status:"",search:this.searchTex}).subscribe({next:e=>{this.invoiceList=e.response.data,this.isInvoiceLoading=!1},error:e=>{this.notificationService.showError(e.error.message),this.isInvoiceLoading=!1}})}selectInvoice(e){let o={invoice_id:e.id,user_type:"BUYER"};this.FinanceOrderService.GetInvoiceDetails(o).subscribe({next:r=>{this.invoiceDetails=r.response.data;let c=new Date(this.invoiceDetails.cdate),g=new Date(c.getTime()+this.invoiceDetails.invoice_due_days*24*60*60*1e3),h=G=>G.toISOString().split("T")[0],C=this.invoiceDetails.seller_details||{},k=this.invoiceDetails.seller_address||{},O=C.contact_name||[k.firstname,k.lastname].filter(Boolean).filter((G,X,pe)=>pe.indexOf(G)===X).join(" ").trim();this.sellerBuyerId=C.vendor_id||this.invoiceDetails.seller_vendor_id||0,this.invoiceMainId=this.invoiceDetails.invoice_main_id||0,this.createPayamentForm.patchValue({invoiceNumber:this.invoiceDetails.invoice_id,invoiceDate:h(c),invoiceAmount:this.invoiceDetails.total_amount,dueDate:h(g),balanceAmount:this.invoiceDetails.balance_amount,sellerName:this.invoiceDetails.seller_company_name||C.company_name,gstNumber:C.gst,sellerAddress:C.full_address||C.address,city:C.city,state:C.region,country:C.country_id,contactName:O,contactPersonNumber:this.toTenDigitNumber(C.contact_number),contactPersonEmail:C.email,termsandConditions:this.invoiceDetails.terms,sellerBankName:this.invoiceDetails.bank_name,sellerAccountNumber:this.invoiceDetails.bank_account_number,sellerIfscCode:this.invoiceDetails.bank_account_ifsc,sellerBankBranch:this.invoiceDetails.bank_branch,sellerAccountName:this.invoiceDetails.bank_account_name}),this.invoiceDetails.seller_terms_and_conditions_path?.forEach(G=>{this.uploadedTermsDocs.push({name:G.filename,path:G.path,viewPath:G.viewPath})});let Q=this.createPayamentForm;this.lockedFields={invoiceDate:!!Q.get("invoiceDate")?.value,invoiceAmount:!!Q.get("invoiceAmount")?.value,balanceAmount:!!Q.get("balanceAmount")?.value,dueDate:!!Q.get("dueDate")?.value}}}),this.disabledFields=!0,this.showInvoiceDropdown=!1}searchSellers(e){if(!e?.target?.value){this.searchList=[],this.isSearchLoading=!1;return}this.searchText=e.target.value,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:this.searchText}).subscribe({next:o=>{o.responseCode===200&&(this.searchList=o.response.vendorData,this.isSearchLoading=!1)}})}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}selectSeller(e){this.sellerBuyerId=e?.vendorData?.vendor_id||0,this.createPayamentForm.patchValue({sellerName:e.vend
1orData.company_name,gstNumber:e.vendorData.gst,sellerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vendorData.region,country:e.vendorData.country_id,sellerAccountName:"",sellerAccountNumber:"",sellerBankName:"",sellerBankBranch:"",sellerIfscCode:""}),this.disableGstField=!0,this.displaySearchList=!1,this.getBankDetails(this.sellerBuyerId)}handleSearchDisplay(e){e===!1?setTimeout(()=>{this.displaySearchList=e},200):this.displaySearchList=e}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:this.sellerSearchTerm}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.sellerOptions=c,this.isSearchLoading=!1}}})}onSelectSellerOption(e,o){if(e===this.ADD_SUPPLIER){sn("openAddBuyerModal"),this.restoreSelectValue(o,this.sellerBuyerId);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getBankDetails(e){let o=e?{org_id:e}:void 0;this.onboardingService.bankdetailsList(o).subscribe({next:r=>{r.responseCode===200?this.bankDetails=r.response.list||[]:this.notificationService.showError("Something went wrong!")},error:()=>{this.notificationService.showError("Something went wrong!")}})}selectBankAccount(e){e&&this.createPayamentForm.patchValue({sellerAccountNumber:e.account_number,sellerBankName:e.bank_name,sellerAccountName:e.account_name,sellerBankBranch:e.branch_name,sellerIfscCode:e.ifsc})}initializeBuyerForm(){this.buyerForm=this.fb.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveBuyer(){if(this.buyerForm.invalid){this.buyerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required seller details correctly.");return}let e=this.buyerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"seller",password:"Test@1234",is_live_user:!1};this.buyerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.buyerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Seller added successfully"),this.applyBuyerToPayment(e,r),this.buyerForm.reset(),sn("closeAddBuyerModal")):this.notificationService.showError(r?.response||"Failed to add seller")},error:()=>{this.buyerSubmitting=!1,this.notificationService.showError("Failed to add seller. Please try again.")}})}applyBuyerToPayment(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0;this.sellerBuyerId=r,this.createPayamentForm.patchValue({sellerName:e.organization_name,gstNumber:e.gst,sellerAddress:e.address,city:e.city,state:e.state,country:e.country_id,contactName:e.contact_name,contactPersonNumber:this.toTenDigitNumber(e.phone),contactPersonEmail:e.email}),this.disableGstField=!0,this.getBankDetails(this.sellerBuyerId)}initializeBankForm(){this.bankForm=this.fb.group({accountNumber:["",[E.required,E.pattern("^[0-9]+$")]],ifsc:["",[E.required,E.pattern("^[A-Z]{4}0[A-Z0-9]{6}$")]],accountHolder:["",[E.required]],bankName:["",[E.required]],branch:["",[E.required]]})}verifyBankAccount(){let e=this.bankForm.get("accountNumber"),o=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,""),{emitEvent:!1}),o?.setValue(String(o.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let r=e?.value,c=o?.value;if(!r||!c){e?.markAsTouched(),o?.markAsTouched(),this.notificationService.showError("Enter account number and IFSC to verify.");return}let g={name:this.bankForm.get("accountHolder")?.value||"",phone:"",account_number:r,ifsc:c};this.bankVerifying=!0,this.financeService.verifyBankAccount(g).subscribe({next:h=>{this.bankVerifying=!1,this.handleBankVerificationResult(h?.response?.data)},error:h=>{this.bankVerifying=!1;let C=h?.error?.response?.data;C?this.handleBankVerificationResult(C):this.notificationService.showError("Bank account verification failed. Please try again.")}})}handleBankVerificationResult(e){if(e?.accountStatus==="VALID"){let o=e?.data||{};this.bankForm.patchValue({accountHolder:o.nameAtBank||this.bankForm.get("accountHolder")?.value||"",bankName:o.bankName||this.bankForm.get("bankName")?.value||"",branch:o.branch||this.bankForm.get("branch")?.value||""}),this.notificationService.showSuccess(e?.message||"Bank account verified successfully.")}else this.notificationService.showError(e?.message||"Unable to verify the bank account.")}saveBankAccount(){let e=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let o=this.bankForm.get("accountNumber");if(o?.setValue(String(o.value??"").replace(/\s/g,""),{emitEvent:!1}),this.bankForm.updateValueAndValidity(),this.bankForm.invalid){this.bankForm.markAllAsTouched(),this.notificationService.showError("Please fill all required bank details correctly.");return}let r=this.bankForm.value,c={org_id:this.sellerBuyerId||null,bank_details:[{bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch,ledger_number:"",micr_code:"",account_type:"",ledger_folio_number:"",cancelled_cheque:"",is_default:"0"}]};this.bankSubmitting=!0,this.onboardingService.AddBankDetails(c).subscribe({next:g=>{this.bankSubmitting=!1,g.responseCode==200?(this.notificationService.showSuccess(g.response?.response||"Bank account added successfully"),this.selectBankAccount({bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch}),this.getBankDetails(),this.bankForm.reset(),sn("closeAddBankModal")):this.notificationService.showError(g.response)},error:()=>{this.bankSubmitting=!1,this.notificationService.showError("Failed to add bank account. Please try again.")}})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=o[r],g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",""),this.FinanceOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError(h.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Dt),T(z),T(Jt),T(H),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-payment"]],viewQuery:function(o,r){if(o&1&&N(cd,5),o&2){let c;V(c=B())&&(r.invoiceSearchInput=c.first)}},decls:362,vars:54,consts:[["docsinput",""],["invoiceSearchInput",""],["sellerSelect",""],[1,"splittedCreateCardMain","mod-mat-fields"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group","invoice-select-wrapper"],[1,"mod-form-label"],[1,"text-danger"],[1,"invoice-select-trigger","form-control","mod-input","d-flex","align-items-center","justify-content-between",3,"click"],[1,"uil",3,"ngClass"],["class","invoice-dropdown-panel",4,"ngIf"],["class","invali
1d-error","appTranslate","",4,"ngIf"],[1,"form-group"],["for","","appTranslate","",1,"mod-form-label"],["type","date","formControlName","invoiceDate","placeholder","Enter Invoice Date",1,"form-control","mod-input",3,"readOnly"],["type","number","formControlName","invoiceAmount","placeholder","Enter Invoice Amount",1,"form-control","mod-input",3,"readOnly"],["type","date","formControlName","dueDate","placeholder"," Enter Due Date",1,"form-control","mod-input",3,"readOnly"],["for","",1,"mod-form-label"],["type","text","formControlName","paymentId","placeholder","Enter Payment Id",1,"form-control","mod-input"],["type","date","formControlName","paymentDate","placeholder","Enter date",1,"form-control","mod-input"],["formControlName","paymentType",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],["value","advance","appTranslate",""],["value","partial","appTranslate",""],["value","final","appTranslate",""],["value","refund","appTranslate",""],["value","crediNoteSettlement","appTranslate",""],["class","row",4,"ngIf"],["class","fin-info-block mt-2",4,"ngIf"],["class","row align-items-end gut-row gut-3",4,"ngIf"],["class","fin-bank-card mt-3",4,"ngIf"],["type","number","formControlName","balanceAmount","placeholder","Enter Balance Amount",1,"form-control","mod-input",3,"readOnly"],["type","number","formControlName","paymentAmount","placeholder","Enter Amount ","appRemoveZeroOnFocus","",1,"form-control","mod-input"],["formControlName","currency",1,"form-control","mod-input"],["value","usd","appTranslate",""],["value","inr","appTranslate",""],["type","number","formControlName","exchangeRate","placeholder","Enter exchange rate","appRemoveZeroOnFocus","",1,"form-control","mod-input"],["type","number","formControlName","netPayableAmount","placeholder"," Enter Tax percentage","appRemoveZeroOnFocus","",1,"form-control","mod-input"],["formControlName","paymentMode",1,"form-control","mod-input"],["value","bankTransfer","appTranslate",""],["value","chequeDd","appTranslate",""],["value","cash","appTranslate",""],["value","card","appTranslate",""],["value","walletUpi","appTranslate",""],["value","paymentGateway","appTranslate",""],[1,"col-12"],["for","","appTranslate","",1,"fw-600","mod-form-label"],["rows","5","formControlName","termsandConditions","placeholder","Enter any payment-related terms or conditions",1,"form-control","mod-input"],[1,"col-12","col-md-4"],[1,"custom-file"],["type","file","id","customFile","multiple","","id","imgInp_01",1,"custom-file-input",3,"change","disabled"],["for","imgInp_01",1,"custom-file-label"],[4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],[1,"list-inline"],["class","list-inline-item","style","margin-top: 10px;",4,"ngFor","ngForOf"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/payable-payments","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","addBuyerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","id","closeAddBuyerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"modal-body"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],["type","text","formControlName","organization_name","placeholder","Enter seller name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],[3,"value",4,"ngFor","ngForOf"],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addBankModal","tabindex","-1",1,"modal","fade"],[1,"modal-header","align-items-start"],[1,"d-flex","align-items-center"],[1,"fin-modal-icon"],[1,"ri-bank-line"],[1,"modal-title","mb-0"],[1,"text-muted"],["type","button","id","closeAddBankModal","data-dismiss","modal",1,"d-none"],[1,"fin-verify-box"],["type","text","formControlName","accountNumber","placeholder","Enter account number",1,"form-control","mod-input"],["type","text","formControlName","ifsc","placeholder","Enter IFSC Code",1,"form-control","mod-input"],[1,"col-12","text-center"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],[1,"row","gut-row","gut-3","mt-2"],["type","text","formControlName","accountHolder","placeholder","Enter account holder name",1,"form-control","mod-input"],["type","text","formControlName","bankName","placeholder","Enter bank name",1,"form-control","mod-input"],["type","text","formControlName","branch","placeholder","Enter branch",1,"form-control","mod-input"],[1,"invoice-dropdown-panel"],[1,"invoice-dropdown-search","p-2"],["type","text","placeholder","Search invoice...",1,"form-control","form-control-sm","mod-input",3,"input","click"],["class","invoice-dropdown-empty text-muted",4,"ngIf"],["class","invoice-dropdown-list mb-0",4,"ngIf"],[1,"invoice-dropdown-empty","text-muted"],[1,"uil","uil-spinner-alt"],[1,"invoice-dropdown-list","mb-0"],["class","invoice-dropdown-item",3,"mousedown",4,"ngFor","ngForOf"],["class","invoice-dropdown-empty text-muted","appTranslate","",4,"ngIf"],[1,"invoice-dropdown-item",3,"mousedown"],["appTranslate","",1,"invoice-dropdown-empty","text-muted"],["appTranslate","",1,"invalid-error"],[1,"col-md-8"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or add seller",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search seller...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[1,"text-primary","fw-500",3,"value"],[1,"ri-add-line"],["type","button","id","openAddBuyerModal","data-toggle","modal","data-target","#addBuyerModal",1,"d-none"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12",4,"ngIf"],["class","col-md-4 mt-3",4,"ngIf"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"col-md-4","mt-3"],[1,"row","align-items-end","gut-row","gut-3"],[1,"form-group","mb-0"],[1,"dropdown","w-100"],["data-toggle","dropdown","data-display","static",1,"form-control","fin-select-toggle","d-flex","justify-content-between","align-items-center","dropdown-toggle"],[1,"ri-arrow-down-s-line"],[1,"dropdown-menu","w-100","fin-buyer-dropdown"],["class","dropdown-item fin-buyer-item","href","javascript:void(0)",3,"click",4,"ngFor","ngForOf"],["class","dropdown-item text-muted",4,"ngIf"],["type","button","data-toggle","modal","data-target","#addBankModal",1,"mod-btn","mod-btn-outline-primary"],["href","javascript:void(0)",1,"dropdown-item","fin-buyer-item",3,"click"],[1,"fin-buyer-item__name"],[1,"fin-buyer-item__meta"],[1,"dropdown-item","text-muted"],["appTranslate","",4,"ngIf"],[1,"fin-bank-card","mt-3"],[1,"fin-bank-card__head"],[1,"fin-bank-card__name"],[1,"fin-bank-card__city"],[1,"row","fin-bank-card__body"],[1,"col-md-3"],["type","text","formControlName","bankName","placeholder","Enter Bank Name",1,"form-control","mod-input"],["type","number","formControlName","accountNumber","placeholder","Enter Account Number",1,"form-control","mod-input"],["type","text","formControlName","ifscCode","placeholder","Enter IFSC Code",1,"form-control","mod-input"],["type","text","formControlName","chequeNumber","placeholder","Enter Cheque/DD Number",1,"form-control","mod-input"],["type","date","formControlName","chequeDate","placeholder","Enter Date",1,"form-control","mod-input"],["type","text","formControlName","bankBranch","placeholder","Enter Bank & Branch",1,"form-control","mod-input"],["size","small",3,"isLoading","useBlockPosition"],[1,"list-inline-item",2,"margin-top","10px"],[1,"d-flex","align-items-center","mb-4","p-2","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"],[1,"ml-auto","pl-15","text-danger","cursor-pointer"],[1,"uil","uil-times-circle","font-18",3,"click"],["type","text","formControlName","receivedBy","placeholder","Enter Name",1,"form-control","mod-input"],["formControlName","cardType",1,"form-control","mod-input"],["value","credit","appTranslate",""],["value","debit","appTranslate",""],["type","text","formControlName","cardTransactionId","placeholder","Enter Transaction ID",1,"form-control","mod-input"],[1,"col-12","col-md-4","margin-top-28px"],[1,"list-inline","m-670"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["type","text","formControlName","upiId","placeholder","Enter UPI ID",1,"form-control","mod-input"],["type","text","formControlName","upiTransactionId","placeholder","Enter Transaction ID",1,"form-control","mod-input"],["formControlName","gatewayName",1,"form-control","mod-input"],["value","razorpay","appTranslate",""],["value","payu","appTranslate",""],["value","ccavenue","appTranslate",""],["value","instamojo","appTranslate",""],["value","stripe","appTranslate",""],["value","other","a
1ppTranslate",""],["type","text","formControlName","gatewayTransactionId","placeholder","Enter Transaction ID",1,"form-control","mod-input"],[1,"invalid-error"]],template:function(o,r){if(o&1){let c=I();i(0,"main",3)(1,"div",4)(2,"div",5)(3,"h2",6)(4,"a",7),x(5,"i",8),t(),i(6,"span",9),n(7,"Create Payment"),t()()(),x(8,"div",10),t(),i(9,"form",11),S("ngSubmit",function(){return b(c),y(r.onSave())}),i(10,"div",12)(11,"div",13)(12,"h3",14),n(13,"Invoice Details"),t()(),i(14,"div",15)(15,"div",16)(16,"div",17)(17,"div",18)(18,"label",19)(19,"span",9),n(20,"Invoice Number"),t(),i(21,"sup",20),n(22,"*"),t()(),i(23,"div",21),S("click",function(){return b(c),y(r.toggleInvoiceDropdown())}),i(24,"span"),n(25),t(),x(26,"i",22),t(),u(27,vd,6,2,"div",23)(28,gd,2,0,"div",24),t()(),i(29,"div",17)(30,"div",25)(31,"label",26),n(32,"Invoice Date"),t(),x(33,"input",27),t()(),i(34,"div",17)(35,"div",25)(36,"label",26),n(37,"Invoice Amount"),t(),x(38,"input",28),t()(),i(39,"div",17)(40,"div",25)(41,"label",26),n(42,"Due Date"),t(),x(43,"input",29),t()()()()(),i(44,"div",12)(45,"div",13)(46,"h3",14),n(47,"Payment Details"),t()(),i(48,"div",15)(49,"div",16)(50,"div",17)(51,"div",25)(52,"label",30)(53,"span",9),n(54,"Payment ID"),t(),i(55,"sup",20),n(56,"*"),t()(),x(57,"input",31),u(58,fd,2,0,"div",24),t()(),i(59,"div",17)(60,"div",25)(61,"label",30)(62,"span",9),n(63,"Payment Date"),t(),i(64,"sup",20),n(65,"*"),t()(),x(66,"input",32),u(67,hd,2,0,"div",24),t()(),i(68,"div",17)(69,"div",25)(70,"label",30)(71,"span",9),n(72,"Payment Method"),t(),i(73,"sup",20),n(74,"*"),t()(),i(75,"select",33)(76,"option",34),n(77,"Select Payment Method"),t(),i(78,"option",35),n(79,"Advance "),t(),i(80,"option",36),n(81,"Partial"),t(),i(82,"option",37),n(83," Final"),t(),i(84,"option",38),n(85,"Refund"),t(),i(86,"option",39),n(87,"Credit Note Settlement"),t()(),u(88,xd,2,0,"div",24),t()()()()(),i(89,"div",12)(90,"div",13)(91,"h3",14),n(92,"Seller Details"),t()(),i(93,"div",15),u(94,Ed,24,8,"div",40)(95,kd,13,8,"div",41),t()(),i(96,"div",12)(97,"div",13)(98,"h3",14),n(99,"Seller Bank Details"),t()(),i(100,"div",15),u(101,Vd,18,3,"div",42)(102,Bd,27,6,"div",43),t()(),i(103,"div",12)(104,"div",13)(105,"h3",14),n(106,"Payment Breakdown"),t()(),i(107,"div",15)(108,"div",16)(109,"div",17)(110,"div",25)(111,"label",26),n(112,"Balance Amount"),t(),x(113,"input",44),t()(),i(114,"div",17)(115,"div",25)(116,"label",26),n(117," Payment Amount"),t(),x(118,"input",45),t()(),i(119,"div",17)(120,"div",25)(121,"label",26),n(122,"Currency"),t(),i(123,"select",46)(124,"option",34),n(125,"Select Currency"),t(),i(126,"option",47),n(127,"USD"),t(),i(128,"option",48),n(129,"INR"),t()()()(),i(130,"div",17)(131,"div",25)(132,"label",26),n(133,"Exchange Rate "),t(),x(134,"input",49),t()(),i(135,"div",17)(136,"div",25)(137,"label",26),n(138,"Net Payable Amount"),t(),x(139,"input",50),t()()()()(),i(140,"div",12)(141,"div",13)(142,"h3",14),n(143,"Payment Method/Mode"),t()(),i(144,"div",15)(145,"div",16)(146,"div",17)(147,"div",25)(148,"label",26),n(149," Payment Mode"),t(),i(150,"select",51)(151,"option",34),n(152,"Select Payment Mode"),t(),i(153,"option",52),n(154,"Bank Transfer"),t(),i(155,"option",53),n(156,"Cheque/DD"),t(),i(157,"option",54),n(158,"Cash"),t(),i(159,"option",55),n(160,"Card"),t(),i(161,"option",56),n(162,"Wallet/UPI"),t(),i(163,"option",57),n(164,"Payment Gateway"),t()()()()(),u(165,Rd,16,0,"div",40)(166,jd,27,5,"div",40)(167,$d,6,0,"div",40)(168,Hd,28,5,"div",40)(169,e0,22,5,"div",40)(170,r0,36,5,"div",40),t()(),i(171,"div",12)(172,"div",13)(173,"h3",14),n(174,"Additional Details"),t()(),i(175,"div",15)(176,"div",16)(177,"div",58)(178,"div",25)(179,"label",59),n(180,"Terms & Conditions:"),t(),x(181,"textarea",60),t()(),i(182,"div",61)(183,"div",62)(184,"input",63,0),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(186,"label",64),u(187,l0,2,0,"span",65)(188,o0,2,0,"span",65),t(),u(189,s0,1,2,"app-loader",66),t()(),i(190,"div",58)(191,"ul",67),u(192,d0,6,2,"li",68),t()()()()(),i(193,"div",69)(194,"div",70)(195,"div",71)(196,"button",72),n(197,"Cancel"),t(),i(198,"button",73),n(199,"Save"),t()()()()(),i(200,"div",74)(201,"div",75)(202,"div",76)(203,"div",77)(204,"h5",78),n(205,"Add New Seller"),t(),x(206,"button",79),i(207,"button",8
10),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(208,"\xD7"),t()(),i(209,"form",81)(210,"div",82)(211,"div",83)(212,"div",84)(213,"label",19),n(214,"Seller Name / Company Name "),i(215,"sup",20),n(216,"*"),t()(),x(217,"input",85),u(218,c0,2,0,"div",86),t(),i(219,"div",84)(220,"label",19),n(221,"GST"),t(),x(222,"input",87),t(),i(223,"div",84)(224,"label",19),n(225,"PAN"),t(),x(226,"input",88),t()(),i(227,"h3",89),n(228,"Shipping From"),t(),i(229,"div",83)(230,"div",58)(231,"label",19),n(232,"Address "),i(233,"sup",20),n(234,"*"),t()(),x(235,"input",90),u(236,p0,2,0,"div",86),t(),i(237,"div",84)(238,"label",19),n(239,"State "),i(240,"sup",20),n(241,"*"),t()(),i(242,"select",91)(243,"option",92),n(244,"Select State"),t(),u(245,m0,2,2,"option",93),t(),u(246,u0,2,0,"div",86),t(),i(247,"div",84)(248,"label",19),n(249,"City "),i(250,"sup",20),n(251,"*"),t()(),x(252,"input",94),u(253,_0,2,0,"div",86),t(),i(254,"div",84)(255,"label",19),n(256,"Country "),i(257,"sup",20),n(258,"*"),t()(),i(259,"select",95)(260,"option",92),n(261,"Select Country"),t(),i(262,"option",96),n(263,"India"),t()(),u(264,v0,2,0,"div",86),t(),i(265,"div",84)(266,"label",19),n(267,"Postal Code"),t(),x(268,"input",97),u(269,g0,2,0,"div",86),t()(),i(270,"h3",89),n(271,"Contact Details"),t(),i(272,"div",83)(273,"div",84)(274,"label",19),n(275,"Contact Name "),i(276,"sup",20),n(277,"*"),t()(),x(278,"input",98),u(279,f0,2,0,"div",86),t(),i(280,"div",84)(281,"label",19),n(282,"Phone No. "),i(283,"sup",20),n(284,"*"),t()(),x(285,"input",99),u(286,b0,3,2,"div",86),t(),i(287,"div",84)(288,"label",19),n(289,"Email Id "),i(290,"sup",20),n(291,"*"),t()(),x(292,"input",100),u(293,C0,3,2,"div",86),t()()(),i(294,"div",101)(295,"button",102),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(296,"Cancel"),t(),i(297,"button",103),S("click",function(){return b(c),y(r.saveBuyer())}),n(298),t()()()()()(),i(299,"div",104)(300,"div",75)(301,"div",76)(302,"div",105)(303,"div",106)(304,"span",107),x(305,"i",108),t(),i(306,"div")(307,"h5",109),n(308,"Add New bank details"),t(),i(309,"small",110),n(310,"Verify using Account No. & IFSC"),t()()(),x(311,"button",111),i(312,"button",80),S("click",function(){return b(c),y(r.bankForm.reset())}),n(313,"\xD7"),t()(),i(314,"form",81)(315,"div",82)(316,"div",112)(317,"div",83)(318,"div",84)(319,"label",19),n(320,"Account Number "),i(321,"sup",20),n(322,"*"),t()(),x(323,"input",113),u(324,D0,3,2,"div",86),t(),i(325,"div",84)(326,"label",19),n(327,"IFSC Code "),i(328,"sup",20),n(329,"*"),t()(),x(330,"input",114),u(331,P0,3,2,"div",86),t(),i(332,"div",115)(333,"button",116),S("click",function(){return b(c),y(r.verifyBankAccount())}),n(334),t()()()(),i(335,"div",117)(336,"div",84)(337,"label",19),n(338,"Account Holder Name "),i(339,"sup",20),n(340,"*"),t()(),x(341,"input",118),u(342,O0,2,0,"div",86),t(),i(343,"div",84)(344,"label",19),n(345,"Bank Name "),i(346,"sup",20),n(347,"*"),t()(),x(348,"input",119),u(349,k0,2,0,"div",86),t(),i(350,"div",84)(351,"label",19),n(352,"Branch "),i(353,"sup",20),n(354,"*"),t()(),x(355,"input",120),u(356,F0,2,0,"div",86),t()()(),i(357,"div",101)(358,"button",102),S("click",function(){return b(c),y(r.bankForm.reset())}),n(359,"Cancel"),t(),i(360,"button",103),S("click",function(){return b(c),y(r.saveBankAccount())}),n(361),t()()()()()()()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve;l(4),s("backButtonFallback","/finance-management/payable-payments"),l(5),s("formGroup",r.createPayamentForm),l(15),re
1("text-muted",!((c=r.createPayamentForm.get("invoiceNumber"))!=null&&c.value)),l(),m(" ",((g=r.createPayamentForm.get("invoiceNumber"))==null?null:g.value)||"Select Invoice Number"," "),l(),s("ngClass",r.showInvoiceDropdown?"uil-angle-up":"uil-angle-down"),l(),s("ngIf",r.showInvoiceDropdown),l(),s("ngIf",((h=r.createPayamentForm.get("invoiceNumber"))==null?null:h.touched)&&((h=r.createPayamentForm.get("invoiceNumber"))==null?null:h.invalid)),l(5),s("readOnly",r.lockedFields.invoiceDate),l(5),s("readOnly",r.lockedFields.invoiceAmount),l(5),s("readOnly",r.lockedFields.dueDate),l(15),s("ngIf",((C=r.createPayamentForm.get("paymentId"))==null?null:C.touched)&&((C=r.createPayamentForm.get("paymentId"))==null?null:C.invalid)),l(9),s("ngIf",((k=r.createPayamentForm.get("paymentDate"))==null?null:k.touched)&&((k=r.createPayamentForm.get("paymentDate"))==null?null:k.invalid)),l(21),s("ngIf",((O=r.createPayamentForm.get("paymentType"))==null?null:O.touched)&&((O=r.createPayamentForm.get("paymentType"))==null?null:O.invalid)),l(6),s("ngIf",!r.disabledFields),l(),s("ngIf",(Q=r.createPayamentForm.get("sellerName"))==null?null:Q.value),l(6),s("ngIf",!r.disabledFields),l(),s("ngIf",(G=r.createPayamentForm.get("sellerAccountNumber"))==null?null:G.value),l(11),s("readOnly",r.lockedFields.balanceAmount),l(52),s("ngIf",r.paymentMode==="bankTransfer"),l(),s("ngIf",r.paymentMode==="chequeDd"),l(),s("ngIf",r.paymentMode==="cash"),l(),s("ngIf",r.paymentMode==="card"),l(),s("ngIf",r.paymentMode==="walletUpi"),l(),s("ngIf",r.paymentMode==="paymentGateway"),l(14),s("disabled",r.loadingStates.termsDocs),l(3),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(3),s("ngForOf",r.uploadedTermsDocs),l(6),s("disabled",r.createPayamentForm.invalid),l(11),s("formGroup",r.buyerForm),l(9),s("ngIf",((X=r.buyerForm.get("organization_name"))==null?null:X.touched)&&((X=r.buyerForm.get("organization_name"))==null?null:X.invalid)),l(18),s("ngIf",((pe=r.buyerForm.get("address"))==null?null:pe.touched)&&((pe=r.buyerForm.get("address"))==null?null:pe.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((Y=r.buyerForm.get("state"))==null?null:Y.touched)&&((Y=r.buyerForm.get("state"))==null?null:Y.invalid)),l(7),s("ngIf",((le=r.buyerForm.get("city"))==null?null:le.touched)&&((le=r.buyerForm.get("city"))==null?null:le.invalid)),l(11),s("ngIf",((ee=r.buyerForm.get("country_id"))==null?null:ee.touched)&&((ee=r.buyerForm.get("country_id"))==null?null:ee.invalid)),l(5),s("ngIf",((fe=r.buyerForm.get("postal_code"))==null?null:fe.touched)&&((fe=r.buyerForm.get("postal_code"))==null?null:fe.invalid)),l(10),s("ngIf",((oe=r.buyerForm.get("contact_name"))==null?null:oe.touched)&&((oe=r.buyerForm.get("contact_name"))==null?null:oe.invalid)),l(7),s("ngIf",((te=r.buyerForm.get("phone"))==null?null:te.touched)&&((te=r.buyerForm.get("phone"))==null?null:te.invalid)),l(7),s("ngIf",((me=r.buyerForm.get("email"))==null?null:me.touched)&&((me=r.buyerForm.get("email"))==null?null:me.invalid)),l(4),s("disabled",r.buyerSubmitting),l(),m(" ",r.buyerSubmitting?"Saving...":"Save Seller"," "),l(16),s("formGroup",r.bankForm),l(10),s("ngIf",((ce=r.bankForm.get("accountNumber"))==null?null:ce.touched)&&((ce=r.bankForm.get("accountNumber"))==null?null:ce.invalid)),l(7),s("ngIf",((be=r.bankForm.get("ifsc"))==null?null:be.touched)&&((be=r.bankForm.get("ifsc"))==null?null:be.invalid)),l(2),s("disabled",r.bankVerifying),l(),m(" ",r.bankVerifying?"Verifying...":"Verify Account"," "),l(8),s("ngIf",((Fe=r.bankForm.get("accountHolder"))==null?null:Fe.touched)&&((Fe=r.bankForm.get("accountHolder"))==null?null:Fe.invalid)),l(7),s("ngIf",((Me=r.bankForm.get("bankName"))==null?null:Me.touched)&&((Me=r.bankForm.get("bankName"))==null?null:Me.invalid)),l(7),s("ngIf",((Ve=r.bankForm.get("branch"))==null?null:Ve.touched)&&((Ve=r.bankForm.get("branch"))==null?null:Ve.invalid)),l(4),s("disabled",r.bankSubmitting),l(),m(" ",r.bankSubmitting?"Saving...":"Save bank account"," ")}},dependencies:[rt,nt,J,W,Ee,It,Mt,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Ot,kt,Ft,bt,Z,De,L,ut,We,Qe],styles:[".searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.form-group[_ngcontent-%COMP%], .invoice-select-wrapper[_ngcontent-%COMP%]{position:relative}.invoice-select-trigger[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;background-color:#fff;min-height:calc(1.5em + .75rem + 2px);height:auto}.invoice-select-trigger[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.invoice-select-trigger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:18px;color:#6c757d;flex-shrink:0;margin-left:8px;transition:transform .2s ease}.invoice-select-trigger[_ngcontent-%COMP%]:hover{border-color:#80bdff}.invoice-select-trigger[_ngcontent-%COMP%]:focus{outline:none;border-color:#80bdff;box-shadow:0 0 0 .2rem #007bff40}.invoice-dropdown-panel[_ngcontent-%COMP%]{position:absolute;z-index:1050;width:100%;background:#fff;border:1px solid #ced4da;border-radius:4px;box-shadow:0 4px 12px #0000001f;margin-top:2px;top:100%;left:0}.invoice-dropdown-search[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef}.invoice-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;font-size:13px}.invoice-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{box-shadow:none;border-color:#80bdff}.invoice-dropdown-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;max-height:220px;overflow-y:auto}.invoice-dropdown-list[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px}.invoice-dropdown-list[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1}.invoice-dropdown-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ced4da;border-radius:4px}.invoice-dropdown-item[_ngcontent-%COMP%]{padding:8px 12px;cursor:pointer;font-size:14px;transition:background-color .15s ease}.invoice-dropdown-item[_ngcontent-%COMP%]:hover{background-color:#f0f4ff;color:var(--theme-color, #3c57a6)}.invoice-dropdown-item[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f5f5f5}.invoice-dropdown-empty[_ngcontent-%COMP%]{padding:10px 12px;font-size:13px;text-align:center;color:#6c757d}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;
1color:#777;font-size:13px}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.fin-bank-card[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden;border:1px solid #f1e0d9}.fin-bank-card__head[_ngcontent-%COMP%]{background:var(--theme-bg-light);padding:14px 18px}.fin-bank-card__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;margin:0;color:#000}.fin-bank-card__city[_ngcontent-%COMP%]{font-size:13px;color:#777}.fin-bank-card__body[_ngcontent-%COMP%]{padding:16px 18px}.fin-modal-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:8px;background:var(--theme-bg-light);margin-right:12px}.fin-modal-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:var(--theme-primary, #6b2f1a)}.fin-verify-box[_ngcontent-%COMP%]{border:1px solid #ececec;border-radius:8px;padding:18px;margin-bottom:8px}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}"]})}}return a})();function M0(a,d){a&1&&(i(0,"span"),x(1,"i",38),i(2,"span",6),n(3,"Print"),t()())}function A0(a,d){a&1&&(i(0,"span")(1,"div",39)(2,"span",40),n(3,"Loading..."),t()(),i(4,"span",6),n(5,"Printing..."),t()())}function N0(a,d){a&1&&(i(0,"li",41)(1,"p",42),n(2,"No Attachments"),t()())}function V0(a,d){if(a&1&&(i(0,"li",41)(1,"p",43)(2,"a",44),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.url,q),l(),f(e.name)}}var Ia=(()=>{class a{constructor(e,o,r){this.financeService=e,this.route=o,this.notificationService=r,this.paymentDetails={},this.paymentAttachments={},this.isPrintLoading=!1}ngOnInit(){this.paymentId=this.route.snapshot.paramMap.get("id"),this.getPaymentDetails()}getPaymentDetails(){let e={payment_id:this.paymentId,type:"BUYER"};this.financeService.paymentDetails(e).subscribe(o=>{this.paymentDetails=o.response||{},this.paymentAttachments=o.response.attachments})}printDocument(){this.isPrintLoading=!0,this.financeService.printPdf("PAYMENT",Number(this.paymentId),"BUYER").subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1,this.notificationService.showError("Failed to print the payment document.")}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payment-details"]],decls:175,vars:44,consts:[[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"create-debit-note-form"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],[1,"row","gut-row","gut-4"],[1,"col-md-6","col-xl-4"],["appTranslate","",1,"finance-note-label"],[1,"finance-note-value"],[1,"badge","badge-green-s","commonBadge","py-2","px-4"],[1,"mt-2","finance-note-value"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card"],[1,"list-inline"],["class","list-inline-item mt-2",4,"ngIf"],["class","list-inline-item mt-2",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"card-footer"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],[1,"sr-only"],[1,"list-inline-item","mt-2"],["appTranslate","",1,"text-muted"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3)(4,"a",4),x(5,"i",5),t(),i(6,"span",6),n(7,"Payment Details"),t()()(),i(8,"div",7)(9,"button",8),S("click",function(){return r.printDocument()}),u(10,M0,4,0,"span",9)(11,A0,6,0,"span",9),t()()(),i(12,"form",10)(13,"div",11)(14,"div",12)(15,"h3",13),n(16,"Invoice Details"),t()(),i(17,"div",14)(18,"div",15)(19,"div",16)(20,"div",17),n(21,"Invoice Number"),t(),i(22,"div",18),n(23),t()(),i(24,"div",16)(25,"div",17),n(26,"Invoice Date"),t(),i(27,"div",18),n(28),t()(),i(29,"div",16)(30,"div",17),n(31,"Due Date"),t(),i(32,"div",18),n(33),t()(),i(34,"div",16)(35,"div",17),n(36,"Invoice Amount"),t(),i(37,"div",18),n(38),_(39,"currencyFormat"),t()(),i(40,"div",16)(41,"div",17),n(42,"Balance Amount"),t(),i(43,"div",18),n(44),_(45,"currencyFormat"),t()(),i(46,"div",16)(47,"div",17),n(48,"Source"),t(),i(49,"div",18),n(50),_(51,"titlecase"),t()()()()(),i(52,"div",11)(53,"div",12)(54,"h3",13),n(55,"Payment Details"),t()(),i(56,"div",14)(57,"div",19)(58,"div",20)(59,"h6",21),n(60,"Payment Done By"),t(),i(61,"p",22),n(62),t()(),i(63,"div",20)(64,"h6",21),n(65,"Contact Number"),t(),i(66,"p",22),n(67),t()(),i(68,"div",20)(69,"h6",21),n(70,"Email ID"),t(),i(71,"p",22),n(72),t()(),i(73,"div",20)(74,"h6",21),n(75,"Payment ID"),t(),i(76,"p",22),n(77),t()(),i(78,"div",20)(79,"h6",21),n(80,"Payment Date"),t(),i(81,"p",22),n(82),t()(),i(83,"div",20)(84,"h6",21),n(85,"Payment Method"),t(),i(86,"p",22),n(87),t()(),i(88,"div",20)(89,"h6",21),n(90,"Net Payment Amount"),t(),i(91,"p",22),n(92),_(93,"currencyFormat"),t()(),i(94,"div",20)(95,"h6",21),n(96,"Payment Mode"),t(),i(97,"p",22),n(98),t()(),i(99,"div",20)(100,"h6",21),n(101,"Status"),t(),i(102,"p",22)(103,"span",23),n(104),t()()()()()(),i(105,"div",11)(106,"div",12)(107,"h3",13),n(108,"Seller Details"),t()(),i(109,"div",14)(110,"div",19)(111,"div",20)(112,"h6",21),n(113,"Seller Name"),t(),i(114,"p",24),n(115),t()(),i(116,"div",20)(117,"h6",21),n(118,"GSTIN"),t(),i(119,"p",24),n(120
1),t()(),i(121,"div",20)(122,"h6",21),n(123,"Contact Name"),t(),i(124,"p",24),n(125),t()(),i(126,"div",20)(127,"h6",21),n(128,"Contact Number"),t(),i(129,"p",24),n(130),t()(),i(131,"div",20)(132,"h6",21),n(133,"Email ID"),t(),i(134,"p",24),n(135),t()()()()(),i(136,"div",25)(137,"div",26)(138,"div",27)(139,"div",12)(140,"h3",13),n(141,"Additional Details"),t()(),i(142,"div",14)(143,"h5",21),n(144,"Terms & Conditions:"),t(),i(145,"p",22),n(146),t(),x(147,"br"),i(148,"h5",21),n(149,"Attachments:"),t(),i(150,"ul",28),u(151,N0,3,0,"li",29)(152,V0,4,2,"li",30),t()()()(),i(153,"div",31)(154,"div",32)(155,"div",33)(156,"ul",34)(157,"li",35)(158,"span",6),n(159,"Invoice Amount :"),t(),i(160,"span",36),n(161),_(162,"currencyFormat"),t()(),i(163,"li",35)(164,"span",6),n(165,"Paid Amount :"),t(),i(166,"span",36),n(167),_(168,"currencyFormat"),t()()()(),i(169,"div",37)(170,"span",6),n(171,"Total Remaining Amount : "),t(),i(172,"span",36),n(173),_(174,"currencyFormat"),t()()()()()()()),o&2&&(l(4),s("backButtonFallback","/finance-management/payable-payments"),l(5),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(12),f(r.paymentDetails.invoice_number||"--"),l(5),f(r.paymentDetails.invoice_date||"--"),l(5),f(r.paymentDetails.invoice_due_date||"--"),l(5),f(r.paymentDetails.invoice_amount?v(39,30,r.paymentDetails.invoice_amount):"--"),l(6),f(r.paymentDetails.invoice_balance?v(45,32,r.paymentDetails.invoice_balance):"--"),l(6),f(v(51,34,r.paymentDetails.source)||"--"),l(12),m(" ",r.paymentDetails.payment_done_by||"--"," "),l(5),m(" ",r.paymentDetails.payment_contact_number||"--",""),l(5),f(r.paymentDetails.payment_contact_email||"--"),l(5),f(r.paymentDetails.payment_id||"--"),l(5),f(r.paymentDetails.payment_date||"--"),l(5),f(r.paymentDetails.payment_type||"--"),l(5),m(" ",r.paymentDetails.net_payment_amount?v(93,36,r.paymentDetails.net_payment_amount):"--",""),l(6),f(r.paymentDetails.payment_mode||"--"),l(6),f(r.paymentDetails.status||"--"),l(11),f(r.paymentDetails.seller_name||"--"),l(5),f(r.paymentDetails.gst||"--"),l(5),f(r.paymentDetails.contact_name||"--"),l(5),f(r.paymentDetails.contact_number||"--"),l(5),f(r.paymentDetails.email_id||"--"),l(11),f(r.paymentDetails.terms_and_conditions||"--"),l(5),s("ngIf",!r.paymentAttachments||r.paymentAttachments.length===0),l(),s("ngForOf",r.paymentAttachments),l(9),f(r.paymentDetails.invoice_amount?v(162,38,r.paymentDetails.invoice_amount):"--"),l(6),m(" ",r.paymentDetails.paid_amount?v(168,40,r.paymentDetails.paid_amount):"--",""),l(6),f(r.paymentDetails.invoice_balance?v(174,42,r.paymentDetails.invoice_balance):"--"))},dependencies:[J,W,Oe,Ie,qt,Z,L,Rt,ae],styles:[".finance-note-bottom-border[_ngcontent-%COMP%]{border-bottom:1px solid #dedede;padding-bottom:3rem;margin-bottom:3rem}.finance-detail-titles[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:600;color:#343a40!important;font-size:1.2rem}"]})}}return a})();var B0=["debitNoteNumberTemplate"],R0=["invoiceIdTemplate"],L0=["totalAmountTemplate"],q0=["statusTemplate"],G0=["actionsTemplate"];function U0(a,d){if(a&1&&(i(0,"span",10),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function j0(a,d){if(a&1&&(i(0,"button",11),x(1,"i",12),t(),i(2,"mat-menu",13,2)(4,"button",14)(5,"mat-icon",15),n(6,"visibility"),t(),i(7,"span",16),n(8,"View"),t()(),i(9,"button",17)(10,"mat-icon"),n(11,"delete"),t(),i(12,"span",16),n(13,"Delete"),t()()()),a&2){let e=w(3);s("matMenuTriggerFor",e)}}var Da=(()=>{class a{constructor(e,o,r,c){this.oService=e,this.snackBar=o,this.notificationService=r,this.cService=c,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"name",label:"Supplier Name",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Supplier"}},{key:"tax_invoice_amount",label:"Total Invoice Amount",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"paid_received_amount",label:"Total Paid Amount ",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"balance_amount",label:"Outstanding Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"last_transaction_date",label:"Last Transaction Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"last_transaction_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-debit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"DEBIT-NOTE-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={total_amount:this.totalAmountTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search,userType:"BUYER"};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getApReportsList(o).subscribe({next:r=>{this.tableData=r?.data||[],this.pageLength=r?.totalRecords||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}onExportRequest(e){let o={userType:"BUYER",exportType:e.fileType},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportReportsList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_reports.pdf":"payable_reports.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payable-reports"]],viewQuery:function(o,r){if(o&1&&(N(B0,7),N(R0,7),N(L0,7),N(q0,7),N(G0,7)),o&2){let c;V(c=B())&&(r.debitNoteNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:12,vars:6,consts:[["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px"],[1,"menu-option-icon"],["appTranslate",""],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",3)(1,"div",4)(2,"div",5)(3,"h2",6),n(4,"AP Reports "),t()()(),i(5,"div",7)(6,"div",8)(7,"data-table",9),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(8,U0,2,3,"ng-template",null,0,P)(10,j0,14,1,"ng-template",null,1,P),t()}if(o&2){let c=w(11);l(7),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[Xe,Je,et,Re,L,Le]})}}return a})();var $0=["financeDrawer"];function z0(a,d){if(a&1){let e=I();i(0,"mat-option",165),S("onSelectionChange",function(){let r=b(e).$implicit,c=p(),g=w(462);return y(c.selectPo(r,g))}),n(1),t()}if(a&2){let e=d.$implicit;s("value",e.po_number),l(),f(e.po_number)}}function W0(a,d){a&1&&(i(0,"sup",35),n(1,"*"),t())}function Q0(a,d){a&1&&(i(0,"div",166),n(1," Invoice NO is required "),t())}function Y0(a,d){a&1&&(i(0,"div",166),n(1,"Invoice date cannot be after due date"),t())}function H0(a,d){a&1&&(i(0,"div",166),n(1,"Invoice due date cannot be before invoice date"),t())}function K0(a,d){a&1&&(i(0,"sup",35),n(1,"*"),t())}function Z0(a,d){a&1&&(i(0,"mat-option",176),x(1,"div",177),n(2," Searching... "),t())}function J0(a,d){if(a&1&&(i(0,"mat-option",178)(1,"div",179)(2,"div",180),n(3),t(),i(4,"div",181),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function X0(a,d){a&1&&(i(0,"mat-option",176),n(1,"No matches found"),t())}function ec(a,d){a&1&&(i(0,"div",166),n(1,"Seller Name is required"),t())}function tc(a,d){if(a&1){let e=I();i(0,"div",167)(1,"div",72)(2,"div",27)(3,"label",43)(4,"span",18),n(5,"Buyer Name"),t(),u(6,K0,2,0,"sup",32),t(),i(7,"mat-form-field",168)(8,"mat-select",169,6),S("selectionChange",function(r){b(e);let c=w(9),g=p();return y(g.onSelectSellerOption(r.value,c))}),i(10,"mat-select-trigger"),n(11),t(),i(12,"div",170),S("click",function(r){return b(e),y(r.stopPropagation())}),i(13,"mat-form-field",171)(14,"input",172),S("input",function(r){b(e);let c=p();return y(c.onSearchSellers(r))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(15,Z0,3,0,"mat-option",173)(16,J0,6,5,"mat-option",119)(17,X0,2,0,"mat-option",173),i(18,"mat-option",174),x(19,"i",51),n(20," Add New Buyer "),t()()(),x(21,"button",175),u(22,ec,2,0,"div",34),t()()()}if(a&2){let e,o,r,c=p();l(6),s("ngIf",!c.isManualEntryPo),l(2),s("value",(e=c.createInvoiceForm.get("vendorId"))==null?null:e.value),l(3),m(" ",((o=c.createInvoiceForm.get("sellerName"))==null?null:o.value)||"Search or enter buyer name"," "),l(3),s("value",c.sellerSearchTerm),l(),s("ngIf",c.isSearchLoading),l(
1),s("ngForOf",c.sellerOptions),l(),s("ngIf",!c.isSearchLoading&&c.sellerSearchTerm&&c.sellerOptions.length===0),l(),s("value",c.ADD_SUPPLIER),l(4),s("ngIf",((r=c.createInvoiceForm.get("sellerName"))==null?null:r.touched)&&((r=c.createInvoiceForm.get("sellerName"))==null?null:r.invalid))}}function ic(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createInvoiceForm.get("state"))==null?null:e.value,"")}}function nc(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createInvoiceForm.get("city"))==null?null:e.value,"")}}function ac(a,d){if(a&1&&(i(0,"div",187)(1,"span",188),n(2,"Billing Address"),t(),i(3,"span",189),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createInvoiceForm.get("sellerAddress"))==null?null:e.value)}}function rc(a,d){if(a&1&&(i(0,"div",182)(1,"h4",183),n(2),t(),i(3,"p",184),n(4),u(5,ic,2,1,"ng-container",40)(6,nc,2,1,"ng-container",40),t(),x(7,"hr",185),i(8,"div",167),u(9,ac,5,1,"div",186),t()()),a&2){let e,o,r,c,g,h=p();l(2),f((e=h.createInvoiceForm.get("sellerName"))==null?null:e.value),l(2),m(" ",(o=h.createInvoiceForm.get("gstNumber"))==null?null:o.value," "),l(),s("ngIf",(r=h.createInvoiceForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=h.createInvoiceForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=h.createInvoiceForm.get("sellerAddress"))==null?null:g.value)}}function lc(a,d){if(a&1&&(i(0,"div",193)(1,"div",167)(2,"div",26)(3,"span",188),n(4,"Contact Name"),t(),i(5,"span",189),n(6),t()(),i(7,"div",26)(8,"span",188),n(9,"Phone No."),t(),i(10,"span",189),n(11),t()(),i(12,"div",26)(13,"span",188),n(14,"Email"),t(),i(15,"span",189),n(16),t()()()()),a&2){let e,o,r,c=p(2);l(6),f(((e=c.createInvoiceForm.get("contactName"))==null?null:e.value)||"--"),l(5),f(((o=c.createInvoiceForm.get("contactPersonNumber"))==null?null:o.value)||"--"),l(5),f(((r=c.createInvoiceForm.get("contactPersonEmail"))==null?null:r.value)||"--")}}function oc(a,d){a&1&&x(0,"input",197)}function sc(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),m(" - ",e.email,"")}}function dc(a,d){if(a&1&&(i(0,"mat-option",178)(1,"div",179)(2,"div",180),n(3),t(),i(4,"div",181),n(5),u(6,sc,2,1,"ng-container",40),t()()()),a&2){let e=d.$implicit;s("value",e.id),l(3),f(e.name),l(2),m(" ",e.phone,""),l(),s("ngIf",e.email)}}function cc(a,d){a&1&&(i(0,"mat-option",176),n(1,"No users found"),t())}function pc(a,d){if(a&1){let e=I();i(0,"mat-form-field",168)(1,"mat-select",198,8),S("selectionChange",function(r){b(e);let c=w(2),g=p(3);return y(g.onSelectContactOption(r.value,c))}),i(3,"mat-select-trigger"),n(4),t(),i(5,"div",170),S("click",function(r){return b(e),y(r.stopPropagation())}),i(6,"mat-form-field",171)(7,"input",199),S("input",function(r){b(e);let c=p(3);return y(c.onContactSearch(r.target.value))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(8,dc,7,4,"mat-option",119)(9,cc,2,0,"mat-option",173),i(10,"mat-option",174),x(11,"i",51),n(12," Add User "),t()()(),x(13,"button",200)}if(a&2){let e,o=p(3);l(),s("value",o.selectedContactUserId),l(3),m(" ",((e=o.createInvoiceForm.get("contactName"))==null?null:e.value)||"Type to search or select contact"," "),l(3),s("value",o.contactSearch),l(),s("ngForOf",o.filteredContactUsers),l(),s("ngIf",!o.filteredContactUsers.length),l(),s("value",o.ADD_CONTACT)}}function mc(a,d){a&1&&(i(0,"div",166),n(1,"Contact number must be 10 digits"),t())}function uc(a,d){if(a&1){let e=I();i(0,"div",25)(1,"div",26)(2,"div",27)(3,"label",74),n(4,"Contact Name"),t(),u(5,oc,1,0,"input",194)(6,pc,14,6,"ng-template",null,7,P),t()(),i(8,"div",26)(9,"div",27)(10,"label",74),n(11,"Phone No."),t(),i(12,"input",195),S("input",function(){b(e);let r=p(2);return y(r.onContactPhoneInput())}),t(),u(13,mc,2,0,"div",34),t()(),i(14,"div",26)(15,"div",27)(16,"label",74),n(17,"Email"),t(),x(18,"input",196),t()()()}if(a&2){let e,o=w(7),r=p(2);l(5),s("ngIf",r.newBuyerAdded)("ngIfElse",o),l(7),s("readOnly",r.disableFields||r.contactPhoneLocked),l(),s("ngIf",((e=r.createInvoiceForm.get("contactPersonNumber"))==null?null:e.touched)&&((e=r.createInvoiceForm.get("contactPersonNumber"))==null?null:e.invalid)),l(5),s("readOnly",r.disableFields||r.contactEmailLocked)}}function _c(a,d){if(a&1&&(F(0),i(1,"div",21)(2,"div",22)(3,"h3",190),n(4,"Contact Details "),i(5,"sup",35),n(6,"*"),t()()(),i(7,"div",24),u(8,lc,17,3,"div",191)(9,uc,19,5,"div",192),t()(),M()),a&2){let e=p();l(8),s("ngIf",e.poIdState==="select"),l(),s("ngIf",e.poIdState!=="select")}}function vc(a,d){a&1&&(i(0,"sup",35),n(1,"*"),t())}function gc(a,d){if(a&1){let e=I();
1i(0,"a",201),S("click",function(){let r=b(e).$implicit,c=p();return y(c.selectBankAccount(r))}),i(1,"span",202),n(2),t(),i(3,"small",203),n(4),t()()}if(a&2){let e=d.$implicit;l(2),f(e.bank_name),l(2),D("",e.account_name," - ",e.account_number,"")}}function fc(a,d){a&1&&(i(0,"div",204),n(1,"No saved bank accounts"),t())}function hc(a,d){if(a&1&&(i(0,"div",205)(1,"div",206)(2,"h4",207),n(3),t(),i(4,"span",208),n(5),t()(),i(6,"div",209)(7,"div",210)(8,"span",188),n(9,"Account Holder"),t(),i(10,"span",189),n(11),t()(),i(12,"div",210)(13,"span",188),n(14,"Account Number"),t(),i(15,"span",189),n(16),t()(),i(17,"div",210)(18,"span",188),n(19,"IFSC Code"),t(),i(20,"span",189),n(21),t()(),i(22,"div",210)(23,"span",188),n(24,"Branch"),t(),i(25,"span",189),n(26),t()()()()),a&2){let e,o,r,c,g,h,C=p();l(3),f((e=C.createInvoiceForm.get("bankName"))==null?null:e.value),l(2),f((o=C.createInvoiceForm.get("bankBranch"))==null?null:o.value),l(6),f((r=C.createInvoiceForm.get("accountName"))==null?null:r.value),l(5),f((c=C.createInvoiceForm.get("accountNumber"))==null?null:c.value),l(5),f((g=C.createInvoiceForm.get("ifscCode"))==null?null:g.value),l(5),f((h=C.createInvoiceForm.get("bankBranch"))==null?null:h.value)}}function xc(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p(2);l(),m(" ",(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname)+" - "+(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].city)," ")}}function bc(a,d){if(a&1&&(i(0,"mat-option",178)(1,"div",179)(2,"div",180),n(3),t(),i(4,"div",181),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function yc(a,d){if(a&1&&(i(0,"mat-option",176),n(1),t()),a&2){let e=p(2);l(),f(e.isSellerSelected?"No addresses found":"Select a buyer first")}}function Sc(a,d){if(a&1){let e=I();i(0,"mat-form-field",168)(1,"mat-select",211,9),S("openedChange",function(r){b(e);let c=p();return y(c.onAddressDropdownOpened(r))})("selectionChange",function(r){b(e);let c=w(2),g=p();return y(g.onSelectShippingAddress(r.value,c))}),u(3,xc,2,1,"mat-select-trigger",40),i(4,"div",170),S("click",function(r){return b(e),y(r.stopPropagation())}),i(5,"mat-form-field",171)(6,"input",212),S("input",function(r){b(e);let c=p();return y(c.shippingToSearch=r.target.value)})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(7,bc,6,4,"mat-option",119)(8,yc,2,1,"mat-option",173),i(9,"mat-option",213),x(10,"i",51),n(11," Add New Address "),t()()()}if(a&2){let e,o=p();l(),s("value",(e=o.selectedShippingAddress==null||o.selectedShippingAddress[0]==null?null:o.selectedShippingAddress[0].entity_id)!==null&&e!==void 0?e:null),l(2),s("ngIf",o.selectedShippingAddress==null?null:o.selectedShippingAddress.length),l(3),s("value",o.shippingToSearch),l(),s("ngForOf",o.filterAddresses(o.shippingToSearch)),l(),s("ngIf",!o.filterAddresses(o.shippingToSearch).length),l(),s("value",o.ADD_SHIPPING_ADDRESS)("disabled",!o.isSellerSelected)}}function Cc(a,d){if(a&1&&(i(0,"div",214),x(1,"i",215),i(2,"div")(3,"span",216),n(4),t(),i(5,"span",217),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname),l(2),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].full_address)}}function Ec(a,d){if(a&1){let e=I();i(0,"div",218)(1,"input",219),S("change",function(r){b(e);let c=p();return y(c.onSameAsShippingChange(r))}),t(),i(2,"label",220),n(3,"Same as Shipping Address"),t()()}if(a&2){let e=p();l(),s("checked",e.sameAsShippingAddress)("disabled",!e.selectedShippingAddress||e.selectedShippingAddress.length==0)}}function Ic(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p(2);l(),m(" ",(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname)+" - "+(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].city)," ")}}function Dc(a,d){if(a&1&&(i(0,"mat-option",178)(1,"div",179)(2,"div",180),n(3),t(),i(4,"div",181),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function Tc(a,d){if(a&1&&(i(0,"mat-option",176),n(1),t()),a&2){let e=p(2);
1l(),f(e.isSellerSelected?"No addresses found":"Select a buyer first")}}function wc(a,d){if(a&1){let e=I();i(0,"mat-form-field",168)(1,"mat-select",221,10),S("openedChange",function(r){b(e);let c=p();return y(c.onAddressDropdownOpened(r))})("selectionChange",function(r){b(e);let c=w(2),g=p();return y(g.onSelectBillingAddress(r.value,c))}),u(3,Ic,2,1,"mat-select-trigger",40),i(4,"div",170),S("click",function(r){return b(e),y(r.stopPropagation())}),i(5,"mat-form-field",171)(6,"input",212),S("input",function(r){b(e);let c=p();return y(c.billingToSearch=r.target.value)})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(7,Dc,6,4,"mat-option",119)(8,Tc,2,1,"mat-option",173),i(9,"mat-option",213),x(10,"i",51),n(11," Add New Address "),t()()()}if(a&2){let e,o=p();l(),s("value",(e=o.selectedBillingAddress==null||o.selectedBillingAddress[0]==null?null:o.selectedBillingAddress[0].entity_id)!==null&&e!==void 0?e:null)("disabled",o.sameAsShippingAddress),l(2),s("ngIf",o.selectedBillingAddress==null?null:o.selectedBillingAddress.length),l(3),s("value",o.billingToSearch),l(),s("ngForOf",o.filterAddresses(o.billingToSearch)),l(),s("ngIf",!o.filterAddresses(o.billingToSearch).length),l(),s("value",o.ADD_BILLING_ADDRESS)("disabled",!o.isSellerSelected)}}function Pc(a,d){if(a&1&&(i(0,"div",214),x(1,"i",215),i(2,"div")(3,"span",216),n(4),t(),i(5,"span",217),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname),l(2),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].full_address)}}function Oc(a,d){if(a&1){let e=I();i(0,"button",222),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(1,"i",51),i(2,"span",18),n(3,"Add Product"),t()()}}function kc(a,d){if(a&1){let e=I();i(0,"div",223)(1,"p",224),n(2,"Add products in invoice"),t(),i(3,"button",225),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(4,"i",51),i(5,"span",18),n(6,"Add Product"),t()()()}}function Fc(a,d){a&1&&(i(0,"div",226),n(1," At least one product is required. "),t())}function Mc(a,d){a&1&&x(0,"th")}function Ac(a,d){if(a&1&&(i(0,"div",234),n(1),t()),a&2){let e=p(2).$implicit;l(),m(" ",e.quantityError," ")}}function Nc(a,d){if(a&1){let e=I();F(0),i(1,"input",232),S("input",function(r){b(e);let c=p().index,g=p(2);return y(g.onQuantityChange(c,r))}),t(),u(2,Ac,2,1,"div",233),M()}if(a&2){let e=p().$implicit;l(),re("is-invalid",e.quantityError),s("value",e.quantity),l(),s("ngIf",e.quantityError)}}function Vc(a,d){if(a&1&&n(0),a&2){let e=p().$implicit;f(e.quantity)}}function Bc(a,d){if(a&1){let e=I();i(0,"td",235)(1,"a",236),S("click",function(){b(e);let r=p().index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(2,"i",237),t(),i(3,"a",238),S("click",function(){b(e);let r=p().index,c=p(2);return y(c.requestDeleteProduct(r))}),x(4,"i",239),t()()}}function Rc(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),u(6,Nc,3,4,"ng-container",230)(7,Vc,1,1,"ng-template",null,11,P),t(),i(9,"td"),n(10),_(11,"currencyFormat"),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),u(19,Bc,5,0,"td",231),t()),a&2){let e=d.$implicit,o=w(8),r=p(2);l(2),f(e.productName),l(2),f(e.skuId||"-"),l(2),s("ngIf",r.poSelected)("ngIfElse",o),l(4),f(v(11,9,e.unitPrice)),l(3),m("",e.discount,"%"),l(2),m("",e.tax,"%"),l(2),f(v(18,11,e.totalPayable)),l(2),s("ngIf",!r.poSelected)}}function Lc(a,d){if(a&1&&(i(0,"div",227)(1,"table",228)(2,"thead")(3,"tr")(4,"th",18),n(5,"Product/service Name"),t(),i(6,"th",18),n(7,"SKU"),t(),i(8,"th",18),n(9,"Quantity"),t(),i(10,"th",18),n(11,"Unit price"),t(),i(12,"th",18),n(13,"Discount"),t(),i(14,"th",18),n(15,"GST Rate"),t(),i(16,"th",18),n(17,"Total Amount"),t(),u(18,Mc,1,0,"th",40),t()(),i(19,"tbody"),u(20,Rc,20,13,"tr",229),t()()()),a&2){let e=p();l(18),s("ngIf",!e.poSelected),l(2),s("ngForOf",e.productFormValues)("ngForTrackBy",e.trackByIndex)}}function qc(a,d){if(a&1){let e=I();i(0,"div",240)(1,"button",241),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",242),t(),i(3,"span",243),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function Gc(a,d){if(a&1){let e=I();i(0,"button",241),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",242),t()}}function Uc(a,d){if(a&1){let e=I();i(0,"button",253),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",254),t()}}function jc(a,d){if(a&1){let e=I();i(0,"div",244)(1,"div",245)(2,"label",74),n(3,"Description"),t(),x(4,"textarea",246),t(),i(5,"div",245)(6,"label",74),n(7,"Amount"),t(),i(8,"input",247),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",248)(10,"div",249)(11,"div",250),u(12,Gc,2,0,"button",251)(13,Uc,2,0,"button",252),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function $c(a,d){a&1&&(i(0,"span",18),n(1,"Attachments"),t())}function zc(a,d){a&1&&(i(0,"span",18),n(1,"Uploading..."),t())}function Wc(a,d){if(a&1&&x(0,"app-loader",255),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function Qc(a,d){if(a&1){let e=I();i(0,"span",258)(1,"a",259),n(2),t(),i(3,"i",260),S("click",function(){let r=b
1(e).$implicit,c=p(2),g=w(130);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function Yc(a,d){if(a&1&&(i(0,"div",256),u(1,Qc,4,2,"span",257),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function Hc(a,d){a&1&&(i(0,"span",270),n(1,"Default Address"),t())}function Kc(a,d){if(a&1){let e=I();i(0,"tr")(1,"td")(2,"div",266)(3,"input",267),S("change",function(){let r=b(e).$implicit,c=p(3);return y(c.changeSelectedAddress(r,"shipping"))}),t(),x(4,"label",268),t()(),i(5,"td"),n(6),x(7,"br"),u(8,Hc,2,0,"span",269),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),t()()}if(a&2){let e=d.$implicit,o=d.index;l(3),ii("id","addressCheckA__01",o,""),Pi("value",e.entity_id),l(),ii("for","addressCheckA__01",o,""),l(2),m("",e.firstname," "),l(2),s("ngIf",e.shippingDefault=="default"),l(2),f(e.lastname),l(2),f(e.telephone),l(2),f(e.full_address)}}function Zc(a,d){if(a&1&&(i(0,"table",263)(1,"thead")(2,"tr",264)(3,"th",18),n(4,"Select"),t(),i(5,"th",18),n(6,"Saved As"),t(),i(7,"th",18),n(8,"Name"),t(),i(9,"th",18),n(10,"Phone Number"),t(),i(11,"th",18),n(12,"Address"),t()()(),i(13,"tbody"),u(14,Kc,15,10,"tr",265),_(15,"appFilter"),t()()),a&2){let e=p(2);l(14),s("ngForOf",U(15,1,e.shippingAddressResponse,e.shippingAddress))}}function Jc(a,d){a&1&&(i(0,"p",18),n(1,"No Address Found, Please Add One to Continue"),t())}function Xc(a,d){if(a&1&&(i(0,"div",261),u(1,Zc,16,4,"table",262)(2,Jc,2,0,"p",79),t()),a&2){let e=p();l(),s("ngIf",e.shippingAddressResponse&&e.shippingAddressResponse.length),l(),s("ngIf",e.shippingAddressResponse&&!e.shippingAddressResponse.length)}}function ep(a,d){a&1&&(i(0,"span",270),n(1,"Default Address"),t())}function tp(a,d){if(a&1){let e=I();i(0,"tr")(1,"td")(2,"div",266)(3,"input",271),S("change",function(){let r=b(e).$implicit,c=p(3);return y(c.changeSelectedAddress(r,"billing"))}),t(),x(4,"label",268),t()(),i(5,"td"),n(6),x(7,"br"),u(8,ep,2,0,"span",269),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),t()()}if(a&2){let e=d.$implicit,o=d.index;l(3),ii("id","addressCheckB__01",o,""),Pi("value",e.entity_id),l(),ii("for","addressCheckB__01",o,""),l(2),m("",e.firstname," "),l(2),s("ngIf",e.billingDefault=="default"),l(2),f(e.lastname),l(2),f(e.telephone),l(2),f(e.full_address)}}function ip(a,d){if(a&1&&(i(0,"table",263)(1,"thead")(2,"tr",264)(3,"th",18),n(4,"Select"),t(),i(5,"th",18),n(6,"Saved As"),t(),i(7,"th",18),n(8,"Name"),t(),i(9,"th",18),n(10,"Phone Number"),t(),i(11,"th",18),n(12,"Address"),t()()(),i(13,"tbody"),u(14,tp,15,10,"tr",265),_(15,"appFilter"),t()()),a&2){let e=p(2);l(14),s("ngForOf",U(15,1,e.billingAddressResponse,e.billingAddress))}}function np(a,d){a&1&&(i(0,"p",18),n(1,"No Address Found, Please Add One to Continue"),t())}function ap(a,d){if(a&1&&(i(0,"div",261),u(1,ip,16,4,"table",262)(2,np,2,0,"p",79),t()),a&2){let e=p();l(),s("ngIf",e.billingAddressResponse&&e.billingAddressResponse.length),l(),s("ngIf",e.billingAddressResponse&&!e.billingAddressResponse.length)}}function rp(a,d){a&1&&(i(0,"div",166),n(1,"Organization name is required"),t())}function lp(a,d){a&1&&(i(0,"div",166),n(1,"Address is required"),t())}function op(a,d){if(a&1&&(i(0,"option",178),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function sp(a,d){a&1&&(i(0,"div",166),n(1,"State is required"),t())}function dp(a,d){a&1&&(i(0,"div",166),n(1,"City is required"),t())}function cp(a,d){a&1&&(i(0,"div",166),n(1,"Country is required"),t())}function pp(a,d){a&1&&(i(0,"div",166),n(1,"Postal code must be 6 digits"),t())}function mp(a,d){a&1&&(i(0,"div",166),n(1,"Contact name is required"),t())}function up(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function _p(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function vp(a,d){if(a&1&&(i(0,"div",166),u(1,up,2,0,"span",40)(2,_p,2,0,"span",40),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.buyerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function gp(a,d){a&1&&(i(0,"span",18),n(1,"Email is required"),t())}function fp(a,d){a&1&&(i(0,"span",18),n(1,"Enter a valid email"),t())}function hp(a,d){if(a&1&&(i(0,"div",166),u(1,gp,2,0,"span",79)(2,fp,2,0,"span",79),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.buyerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function xp(a,d){a&1&&(i(0,"span",18),n(1,"Account number is required"),t())}function bp(a,d){a&1&&(i(0,"span",18),n(1,"Enter a valid account number"),t())}function yp(a,d){if(a&1&&(i(0,"div",166),u(1,xp,2,0,"span",79)(2,bp,2,0,"span",79),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("accountNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bank
1Form.get("accountNumber"))==null||o.errors==null?null:o.errors.pattern)}}function Sp(a,d){a&1&&(i(0,"span",18),n(1,"IFSC code is required"),t())}function Cp(a,d){a&1&&(i(0,"span",18),n(1,"Enter a valid IFSC code"),t())}function Ep(a,d){if(a&1&&(i(0,"div",166),u(1,Sp,2,0,"span",79)(2,Cp,2,0,"span",79),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("ifsc"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("ifsc"))==null||o.errors==null?null:o.errors.pattern)}}function Ip(a,d){a&1&&(i(0,"div",166),n(1,"Account holder name is required"),t())}function Dp(a,d){a&1&&(i(0,"div",166),n(1,"Bank name is required"),t())}function Tp(a,d){a&1&&(i(0,"div",166),n(1,"Branch is required"),t())}function wp(a,d){a&1&&(i(0,"div",166),n(1,"Name is required"),t())}function Pp(a,d){a&1&&(i(0,"span",18),n(1,"Phone number is required"),t())}function Op(a,d){a&1&&(i(0,"span",18),n(1,"Enter a valid 10-digit phone number"),t())}function kp(a,d){if(a&1&&(i(0,"div",166),u(1,Pp,2,0,"span",79)(2,Op,2,0,"span",79),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.userForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function Fp(a,d){a&1&&(i(0,"span",18),n(1,"Email is required"),t())}function Mp(a,d){a&1&&(i(0,"span",18),n(1,"Enter a valid email"),t())}function Ap(a,d){if(a&1&&(i(0,"div",166),u(1,Fp,2,0,"span",79)(2,Mp,2,0,"span",79),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.userForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function Np(a,d){if(a&1){let e=I();i(0,"div",272)(1,"div",156)(2,"div",273)(3,"div",274)(4,"p",18),n(5," All invoices have been generated against. Do you want to update the PO? "),t(),i(6,"button",275),S("click",function(){b(e);let r=p();return y(r.onCloseModel())}),n(7,"Yes"),t(),i(8,"button",276),S("click",function(){b(e);let r=p();return y(r.onCloseDialogModel())}),n(9,"No"),t()()()()()}}function Vp(a,d){if(a&1){let e=I();i(0,"div",277)(1,"div",156)(2,"div",273)(3,"div",274)(4,"button",278),S("click",function(){b(e);let r=p();return y(r.dialogConfirm==null?null:r.dialogConfirm.close())}),n(5,"\xD7"),t(),i(6,"p",18),n(7,"This PO number is new. Do you want to auto create the PO?"),t(),i(8,"button",279),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoYes())}),n(9,"Yes"),t(),i(10,"button",276),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoNo())}),n(11,"No"),t()()()()()}}function Bp(a,d){if(a&1){let e=I();i(0,"div",277)(1,"div",156)(2,"div",273)(3,"div",274)(4,"button",278),S("click",function(){b(e);let r=p();return y(r.dialogConfirm==null?null:r.dialogConfirm.close())}),n(5,"\xD7"),t(),i(6,"p",18),n(7,"No PO number was entered. Do you want to auto create the PO?"),t(),i(8,"button",279),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoYes())}),n(9,"Yes"),t(),i(10,"button",276),S("click",function(){b(e);let r=p();return y(r.onConfirmAutoCreatePoNo())}),n(11,"No"),t()()()()()}}function yi(a){document.getElementById(a)?.click()}var dn=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O,Q,G){this.fb=e,this.inventoryService=o,this.fbs=r,this.commonService=c,this.dialog=g,this.financeService=h,this.onboardingService=C,this.FinanceOrderService=k,this.notificationService=O,this.ref=Q,this.router=G,this.buyerSubmitting=!1,this.bankSubmitting=!1,this.bankVerifying=!1,this.userSubmitting=!1,this.submitted=!1,this.productRequiredError=!1,this.productFormValues=[],this.formControlListeners=[],this.displaySearchList=!1,this.searchList=[],this.isSearchLoading=!1,this.states=[],this.shippingAddressResponse=[],this.billingAddressResponse=[],this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.isWarehouseLoading=!1,this.shippingWarehouseResponse=[],this.selectedShippingWarehouse=[],this.suggestedInvoiceNumber="",this.shippingSearchText="",this.shippingToSearch="",this.billingToSearch="",this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newBuyerAdded=!1,this.selectedContactUserId=null,this.enableAddressSelection=!1,this.isLoading=!1,this.isAddressLoading=!1,this.sameAsShippingAddress=!1,this.disableGstField=!1,this.disableFields=!1,this.sellerOptions=[],this.sellerSearchTerm="",this.selectedOption="no",this.approverPayload=[],this.prIdFromRoute=null,this.loadingStates={termsDocs:!1}
1,this.uploadedTermsDocs=[],this.poList=[],this.isPoLoading=!1,this.accessList=[],this.showPoDropdown=!1,this.poIdState="empty",this.poSelected=!1,this.poRequired=0,this.bankDetails=[],this.isManualEntryPo=!1,this.editingProductIndex=null,this.confirmDeleteIndex=null,this.ADD_SUPPLIER="__add_supplier__",this.ADD_CONTACT="__add_contact__",this.ADD_ADDRESS="__add_address__",this.ADD_SHIPPING_ADDRESS="__add_shipping_address__",this.ADD_BILLING_ADDRESS="__add_billing_address__",this.initializeInvoiceForm(),this.generatePoForm()}ngOnInit(){this.onSearchSellers({target:{value:""}}),this.getStates(),this.initializeAddProductForm(),this.getPoList(),this.getBankDetails(),this.getAddressData(),this.initializeBuyerForm(),this.initializeBankForm(),this.initializeUserForm()}initializeBuyerForm(){this.buyerForm=this.fb.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveBuyer(){if(this.buyerForm.invalid){this.buyerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required buyer details correctly.");return}let e=this.buyerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"buyer",password:"Test@1234",is_live_user:!1};this.buyerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.buyerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Buyer added successfully"),this.applyBuyerToInvoice(e,r),this.buyerForm.reset(),yi("closeAddBuyerModal")):this.notificationService.showError(r?.response||"Failed to add buyer")},error:()=>{this.buyerSubmitting=!1,this.notificationService.showError("Failed to add buyer. Please try again.")}})}applyBuyerToInvoice(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,c=o?.response?.user?.id??null;this.createInvoiceForm.patchValue({sellerName:e.organization_name,gstNumber:e.gst,sellerAddress:e.address,city:e.city,state:e.state,country:e.country_id,contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,vendorId:r}),this.selectedContactUserId=c,this.disableGstField=!0,this.contactUsers=[],this.contactSearch="",this.newBuyerAdded=!0,this.contactUserSelected=!0,this.contactPhoneLocked=!0,this.contactEmailLocked=!0;let g=this.createInvoiceForm.get("contactPersonNumber");g?.clearValidators(),g?.updateValueAndValidity({emitEvent:!1}),this.getContactUsers(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.getAddressData(this.getOrgId())}initializeBankForm(){this.bankForm=this.fb.group({accountNumber:["",[E.required,E.pattern("^[0-9]+$")]],ifsc:["",[E.required,E.pattern("^[A-Z]{4}0[A-Z0-9]{6}$")]],accountHolder:["",[E.required]],bankName:["",[E.required]],branch:["",[E.required]]})}saveBankAccount(){let e=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let o=this.bankForm.get("accountNumber");if(o?.setValue(String(o.value??"").replace(/\s/g,""),{emitEvent:!1}),this.bankForm.updateValueAndValidity(),this.bankForm.invalid){this.bankForm.markAllAsTouched(),this.notificationService.showError("Please fill all required bank details correctly.");return}let r=this.bankForm.value,c={};try{c=JSON.parse(localStorage.getItem("details")||"{}")}catch{c={}}let g={org_id:c?.response?.vendor_id??null,bank_details:[{bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch,ledger_number:"",micr_code:"",account_type:"",ledger_folio_number:"",cancelled_cheque:"",is_default:"0"}]};this.bankSubmitting=!0,this.onboardingService.AddBankDetails(g).subscribe({next:h=>{this.bankSubmitting=!1,h.responseCode==200?(this.notificationService.showSuccess(h.response?.response||"Bank account added successfully"),this.selectBankAccount({bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch}),this.getBankDetails(),this.bankForm.reset(),yi("closeAddBankModal")):this.notificationService.showError(h.response)},error:()=>{this.bankSubmitting=!1,this.notificationService.showError("Failed to add bank account. Please try again.")}})}verifyBankAccount(){let e=this.bankForm.get("accountNumber"),o=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,""),{emitEvent:!1}),o?.setValue(String(o.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let r=e?.value,c=o?.value;if(!r||!c){e?.markAsTouched(),o?.markAsTouched(),this.notificationService.showError("Enter account number and IFSC to verify.");return}let g={name:this.bankForm.get("accountHolder")?.value||"",phone:"",account_number:r,ifsc:c};this.bankVerifying=!0,this.financeService.verifyBankAccount(g).subscribe({next:h=>{this.bankVerifying=!1,this.handleBankVerificationResult(h?.response?.data)},error:h=>{this.bankVerifying=!1;let C=h?.error?.response?.data;C?this.handleBankVerificationResult(C):this.notificationService.showError("Bank account verification failed. Please try again.")}})}handleBankVerificationResult(e){if(e?.accountStatus==="VALID"){let o=e?.data||{};this.bankForm.patchValue({accountHolder:o.nameAtBank||this.bankForm.get("accountHolder")?.value||"",bankName:o.bankName||this.bankForm.get("bankName")?.value||"",branch:o.branch||this.bankForm.get("branch")?.value||""}),this.notificationService.showSuccess(e?.message||"Bank account verified successfully.")}else this.notificationService.showError(e?.message||"Unable to verify the bank account.")}clearAllValidators(){this.createInvoiceForm.clearValidators(),Object.keys(this.createInvoiceForm.controls).forEac
1h(e=>{let o=this.createInvoiceForm.get(e);o?.clearValidators(),o?.updateValueAndValidity({emitEvent:!1})}),this.createInvoiceForm.updateValueAndValidity({emitEvent:!1})}invoiceDateRangeValidator(e){let o=e.get("invoiceCreationDate")?.value,r=e.get("invoiceExpiryDate")?.value;return!o||!r?null:r<o?{invoiceDateRange:!0}:null}restoreAllValidators(){let e={invoiceNumber:[E.required],sellerName:[E.required],accountName:[E.required],bankName:[E.required],accountNumber:[E.required],bankBranch:[E.required],ifscCode:[E.required]};Object.keys(this.createInvoiceForm.controls).forEach(o=>{let r=this.createInvoiceForm.get(o);r?.setValidators(e[o]??null),r?.updateValueAndValidity({emitEvent:!1})}),this.createInvoiceForm.setValidators(this.invoiceDateRangeValidator),this.createInvoiceForm.updateValueAndValidity({emitEvent:!1})}get invoiceCreationDateValue(){return this.createInvoiceForm?.get("invoiceCreationDate")?.value||""}get invoiceExpiryDateValue(){return this.createInvoiceForm?.get("invoiceExpiryDate")?.value||""}get isInvoiceDateRangeInvalid(){return!!this.createInvoiceForm?.errors?.invoiceDateRange}requestDeleteProduct(e){this.confirmDeleteIndex=e,yi("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null,this.productRequiredError=this.productFormValues.length===0),yi("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,yi("closeDeleteConfirmModal")}initializeInvoiceForm(){this.createInvoiceForm=this.fb.group({poNumber:[""],invoiceNumber:["",E.required],invoiceCreationDate:[""],invoiceExpiryDate:[""],sellerName:["",E.required],vendorId:0,gstNumber:[""],sellerAddress:[""],city:[""],state:[""],country:[""],pincode:[""],contactName:[""],contactPersonNumber:["",[E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],contactPersonEmail:[""],accountName:["",E.required],bankName:["",E.required],accountNumber:["",E.required],bankBranch:["",E.required],ifscCode:["",E.required],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fb.array([]),totalPayableAmount:0,hasApprovers:["no"],termsandConditions:[""]},{validators:this.invoiceDateRangeValidator})}initializeAddProductForm(){this.formControlListeners.push(this.createInvoiceForm.valueChanges.subscribe(()=>this.calculateSummary()))}handlePoSearchDisplay(e){e===!1&&setTimeout(()=>{this.showPoDropdown=e},200)}get paymentMode(){return this.createInvoiceForm.get("paymentMode")?.value}calculateSummary(){let e=C=>Math.round((Number(C)||0)*100+Number.EPSILON)/100,o=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal,0));this.createInvoiceForm.patchValue({grossTotal:o},{emitEvent:!1});let r=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal*k.discount/100,0));this.createInvoiceForm.patchValue({discount:r},{emitEvent:!1});let c=e(o-r);this.createInvoiceForm.patchValue({netTotal:c},{emitEvent:!1});let g=e(this.productFormValues.reduce((C,k)=>C+(k.grossTotal-k.grossTotal*k.discount/100)*k.tax/100,0));this.createInvoiceForm.patchValue({taxes:g},{emitEvent:!1});let h=this.getAdditionalCharges;this.createInvoiceForm.patchValue({totalPayableAmount:e(c+g+h)},{emitEvent:!1})}trackByIndex(e){return e}get hasQuantityErrors(){return this.productFormValues.some(e=>!!e.quantityError)}onQuantityChange(e,o){let r=this.productFormValues[e],c=Number(o.target.value);if(!c||c<=0||isNaN(c)){this.productFormValues[e]=j(A({},r),{quantity:c,quantityError:"Quantity cannot be zero or negative."}),this.calculateSummary();return}let g=c*r.unitPrice,h=g*r.discount/100,C=g-h,k=C*r.tax/100;this.productFormValues[e]=j(A({},r),{quantity:c,grossTotal:g,totalPayable:C+k,quantityError:null}),this.calculateSummary()}get additionalChargesArray(){return this.createInvoiceForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.createInvoiceForm.get("additionalCharges");return!e||e.length===0?0:e.controls.reduce((o,r)=>{let c=Number(r.get("amount")?.value)||0;return o+c},0)}addAdditionalCharge(){this.createInvoiceForm.get("additionalCharges").push(this.fb.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.createInvoiceForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.productRequiredError=!1,this.calculateSummary()}resetForm(e){e?this.createInvoiceForm.setValue({poNumber:this.createInvoiceForm.value.poNumber,invoiceNumber:this.suggestedInvoiceNumber||"",invoiceCreationDate:"",invoiceExpiryDate:"",sellerName:"",vendorId:0,gstNumber:"",sellerAddress:"",city:"",state:"",country:"",pincode:"",contactName:"",contactPersonNumber:"",contactPersonEmail
1:"",accountName:"",bankName:"",accountNumber:"",bankBranch:"",ifscCode:"",grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:[],totalPayableAmount:0,hasApprovers:"",termsandConditions:""}):(this.createInvoiceForm.reset(),this.createInvoiceForm.patchValue({invoiceNumber:this.suggestedInvoiceNumber||""})),this.createInvoiceForm.get("invoiceNumber")?.markAsPristine(),this.disableFields=!1,this.disableGstField=!1,this.poSelected=!1,this.poIdState="empty",this.poDetails=null,this.GeneratePoForm.reset(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingToSearch="",this.billingToSearch="",this.selectedShippingWarehouse=[],this.shippingSearchText="",this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.selectedContactUserId=null,this.newBuyerAdded=!1,this.productFormValues=[],this.uploadedTermsDocs=[],this.editingProductIndex=null,this.confirmDeleteIndex=null,this.calculateSummary(),this.ref.detectChanges(),this.submitted=!1,this.isManualEntryPo=!1,this.restoreAllValidators()}onSave(e,o){if(this.submitted=!0,this.poDetails?.source==="Manual"?this.clearAllValidators():this.restoreAllValidators(),this.createInvoiceForm.markAllAsTouched(),this.createInvoiceForm.invali
1d||!this.productFormValues||this.productFormValues.length===0||this.hasQuantityErrors)return;if(this.poIdState==="custom"&&e){this.dialogConfirm=this.dialog.open(e);return}if(this.poIdState==="empty"&&o){this.dialogConfirm=this.dialog.open(o);return}if(!this.selectedShippingAddress||this.selectedShippingAddress.length===0){this.notificationService.showError("Please select a shipping address.");return}if(this.sameAsShippingAddress&&(this.selectedBillingAddress=[...this.selectedShippingAddress]),!this.selectedBillingAddress||this.selectedBillingAddress.length===0){this.notificationService.showError("Please select a billing address.");return}let r={};try{r=JSON.parse(localStorage.getItem("details")||"{}")}catch{r={}}let c={po_id:this.poDetails?.po_id||0,po_number:this.createInvoiceForm.value.poNumber,account_name:this.createInvoiceForm.value.accountName,bank_name:this.createInvoiceForm.value.bankName,account_number:this.createInvoiceForm.value.accountNumber,branch:this.createInvoiceForm.value.bankBranch,ifsc:this.createInvoiceForm.value.ifscCode,seller_gst:this.createInvoiceForm.value.gstNumber,seller_address:this.createInvoiceForm.value.sellerAddress,city:this.createInvoiceForm.value.city,state:this.createInvoiceForm.value.state,country:this.createInvoiceForm.value.country,user_type:"SELLER",contact_name:this.createInvoiceForm.value.contactName,contact_person_number:this.createInvoiceForm.value.contactPersonNumber,contact_person_email:this.createInvoiceForm.value.contactPersonEmail,invoice_number:this.createInvoiceForm.value.invoiceNumber,invoice_creation_date:this.createInvoiceForm.value.invoiceCreationDate,invoice_expiry_date:this.createInvoiceForm.value.invoiceExpiryDate,net_amount:this.createInvoiceForm.value.netTotal,seller_name:this.createInvoiceForm.value.sellerName,vendor_id:this.createInvoiceForm.value.vendorId,shipping_address:this.selectedShippingAddress[0]?.entity_id||"",billing_address:this.selectedBillingAddress[0]?.entity_id||this.selectedShippingAddress[0]?.entity_id||"",seller_terms_and_conditions_path:[],items:[],additional_charges:[...this.createInvoiceForm.value.additionalCharges],total_payable_amount:this.createInvoiceForm.value.totalPayableAmount,po_required:String(this.poRequired),approvalUsers:[],documents:[],seller_organization_id:r?.response?.vendor_id??null,seller_user_id:r?.response?.user_id??null,buyer_organization_id:this.createInvoiceForm.value.vendorId||null,buyer_user_id:this.selectedContactUserId??null};c.seller_terms_and_conditions_path=this.uploadedTermsDocs.map(g=>({path:g.path,filename:g.name})),c.items=this.productFormValues.map(g=>A({product_name:g.productName,product_id:g.parentId??g.productId,qty:g.quantity,unit_price:g.unitPrice,discount_percentage:g.discount,gst_percentage:g.tax,selected_options:g.selectedConfigOptions||[]},g.isTemp&&{is_temp_product:!0,sku:g.skuId,category:g.category,sub_category:g.subCategory,product_group:g.productGroup,sub_product_group:g.subProductGroup})),c.approvalUsers=this.approverPayload.map(g=>({customer_id:g.customer_id,level:g.level})),this.financeService.invoicemanualCreate(c).subscribe({next:g=>{g.responseCode===200?(this.notificationService.showSuccess("Invoice created successfully"),this.router.navigate(["finance-management/receivable-invoices"])):this.notificationService.showError(typeof g?.response=="string"?g.response:"Failed to create invoice.")},error:g=>{let h=g?.error?.response;this.notificationService.showError(typeof h=="string"&&h?h:"Failed to create invoice. Please try again.")}})}onOptionChange(e){this.selectedOption=e,this.createInvoiceForm.get("hasApprovers").setValue(e)}onApproversChange(e){this.approverPayload=e,this.prResponse.approve_users=e.map(o=>j(A({},o),{status:"A"}))}onSearchInput(e){let o=e.target.value||"";this.searchTex=o.toLowerCase(),this.getPoList(),this.showPoDropdown=!0,this.poIdState==="select"&&(this.poSelected=!1,this.resetForm(!0),this.calculateSummary()),this.poIdState=o.trim()?"custom":"empty",this.poRequired=0}getPoList(){this.isPoLoading=!0,this.disableFields=!1,this.FinanceOrderService.getPolist({userType:"SELLER",perPage:10,pageNumber:1,status:"0",search:this.searchTex}).subscribe({next:e=>{this.poList=e.response.data,this.isPoLoading=!1},error:e=>{this.notificationService.showError(e.error.message),this.isPoLoading=!1}})}selectPo(e,o){this.productFormValues=[],this.uploadedTermsDocs=[];let r={po_id:e.po_id};this.FinanceOrderService.GetPoDetails(r).subscribe({next:c=>{if(this.poDetails=c.response.data,this.isManualEntryPo=this.poDetails?.source==="Manual",this.isManualEntryPo?this.clearAllValidators():this.restoreAllValidators(),this.poDetails.invoice_id){let G={invoice_id:this.poDetails.invoice_id};this.FinanceOrderService.GetInvoiceDetails(G).subscribe({next:X=>{this.invoiceDetails=X.response.data;let pe=this.invoiceDetails.invoices;
1if(pe.length===0){this.poDetails.items.forEach(ee=>{let fe=ee.offered_qty,oe=fe*ee.unit_price,te=oe*ee.discount_percent/100,me=oe-te,ce=me*ee.tax_percent/100;this.productFormValues.push({productName:ee.product_name,productId:ee.product_id,skuId:ee.display_item_id||ee.item_id||"",quantity:fe,unitPrice:ee.unit_price,grossTotal:oe,discount:ee.discount_percent,tax:ee.tax_percent,totalPayable:me+ce,selectedConfigOptions:[],configurableOptionsFull:[],quantityError:null})}),this.calculateSummary();return}let le=pe.map(ee=>ee.invoice_id).map(ee=>{let fe={invoice_id:ee,invoice_type:"child"};return this.FinanceOrderService.GetTaxInvoiceDetails(fe)});Ui(le).subscribe({next:ee=>{this.taxInvoiceDetails=ee.map(te=>te.response.data);let fe=te=>{let ce=this.taxInvoiceDetails.flatMap(be=>be.items).find(be=>be.product_id===te);return ce?ce.offered_qty:0},oe=!1;this.poDetails.items.forEach(te=>{let me=te.offered_qty-fe(te.product_id),ce=me*te.unit_price,be=ce*te.discount_percent/100,Fe=ce-be,Me=Fe*te.tax_percent/100;this.productFormValues.push({productName:te.product_name,productId:te.product_id,skuId:te.display_item_id||te.item_id||"",quantity:me,unitPrice:te.unit_price,grossTotal:ce,discount:te.discount_percent,tax:te.tax_percent,totalPayable:Fe+Me,selectedConfigOptions:[],configurableOptionsFull:[],quantityError:null}),me<=0&&(oe=!0)}),oe&&(this.dialogRef=this.dialog.open(o)),this.calculateSummary()}})}})}else this.poDetails.items.forEach(G=>{let X=G.offered_qty,pe=X*G.unit_price,Y=pe*G.discount_percent/100,le=pe-Y,ee=le*G.tax_percent/100;this.productFormValues.push({productName:G.product_name,productId:G.product_id,skuId:G.display_item_id||G.item_id||"",quantity:X,unitPrice:G.unit_price,grossTotal:pe,discount:G.discount_percent,tax:G.tax_percent,totalPayable:le+ee,selectedConfigOptions:[],configurableOptionsFull:[],quantityError:null})}),this.calculateSummary();let g=this.poDetails.address||[],h=g.find(G=>G.addressType==="shipping")||g[0],C=g.find(G=>G.addressType==="billing")||g[1]||h,k=this.poDetails.buyer_vendor_id??this.poDetails.buyer_id;this.createInvoiceForm.patchValue({poNumber:this.poDetails.po_number,sellerName:this.poDetails.buyer_company_name,vendorId:k,gstNumber:this.poDetails.buyer_gst||(this.poDetails.buyer_gst_list?.[0]??""),sellerAddress:C?.street||"",city:C?.city||"",state:C?.region||"",country:C?.country_id||"",pincode:C?.postcode||"",contactName:"",contactPersonNumber:"",contactPersonEmail:"",termsandConditions:this.poDetails.terms}),this.poIdState="select",this.poSelected=!0,this.poRequired=1,this.contactSearch="",this.contactUsers=[],this.resetContactSelection(),this.getContactUsers("",k),this.selectedContactUserId=this.poDetails.buyer_id??null,(this.poDetails.terms_document||[]).forEach(G=>{this.uploadedTermsDocs.push({name:G.filename,path:G.path,viewPath:G.viewPath})}),this.GeneratePoForm.patchValue({shippingAddress:h?String(h.id):"",billingAddress:C?String(C.id):""}),this.selectedShippingAddress=h?[j(A({},h),{entity_id:h.id,addressType:h.addressType})]:[],this.selectedBillingAddress=C?[j(A({},C),{entity_id:C.id,addressType:C.addressType})]:[];let O=this.poDetails.seller_details||{},Q=this.poDetails.seller_billing_address||{};this.selectedShippingWarehouse=[{name:this.poDetails.seller_company_name||O.company_name||"",code:"",breadcrumbs:Q.street||O.address||"",city:Q.city||O.city||"",region:Q.region||O.region||"",country_id:Q.country_id||O.country_id||"",post_code:Q.postcode||""}]}}),this.disableFields=!0,this.showPoDropdown=!1}getBankDetails(){this.onboardingService.bankdetailsList().subscribe({next:e=>{e.responseCode===200?this.bankDetails=e.response.list:this.notificationService.showError("Something went wrong!")},error:e=>{this.notificationService.showError("Something went wrong!")}})}onBankAccountSelect(e){let o=e.target.value,r=this.bankDetails[o];this.selectBankAccount(r)}selectBankAccount(e){e&&this.createInvoiceForm.patchValue({accountNumber:e.account_number,bankName:e.bank_name,accountName:e.account_name,bankBranch:e.branch_name,ifscCode:e.ifsc})}onCloseModel(){this.dialogRef.close()}onCloseDialogModel(){this.dialogRef.close(),this.resetForm(),this.calculateSummary()}poTypeChange(e){e===""?(this.poIdState="empty",this.poRequired=0,this.resetForm(),this.calculateSummary()):(this.poIdState="custom",this.poRequired=0)}onConfirmAutoCreatePoYes(){this.poRequired=1,this.dialogConfirm?.close(),this.onSave()}onConfirmAutoCreatePoNo(){this.poRequired=0,this.dialogConfirm?.close(),this.onSave()}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:e.target.value}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.sellerOptions=c,this.isSearchLoading=!1}}})}onSelectSellerOption(e,o){if(e===this.ADD_SUPPLIER){yi("openAddBuyerModal"),this.restoreSelectValue(o,this.createInvoiceForm.get("vendorId")?.value);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}onSelectContactOption(e,o){if(e===this.ADD_CONTACT){this.openAddContactUser(),yi("openAddContactUserModal"),this.restoreSelectValue(o,this.selectedContactUserId);return}let r=this.contactUsers.find(c=>c.id===e);r&&this.selectContactUser(r)}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}selectSeller(e){if(!e)return this.removeSeller();
1this.createInvoiceForm.patchValue({sellerName:e.vendorData.company_name,vendorId:e.vendorData.vendor_id,gstNumber:e.vendorData.gst,sellerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vendorData.region,country:e.vendorData.country_id}),this.disableGstField=!0,this.displaySearchList=!1,this.createInvoiceForm.patchValue({contactName:"",contactPersonNumber:"",contactPersonEmail:""}),this.contactSearch="",this.contactUsers=[],this.resetContactSelection(),this.getContactUsers(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.getAddressData(e.vendorData.vendor_id)}resetContactSelection(){this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newBuyerAdded=!1,this.selectedContactUserId=null;let e=this.createInvoiceForm.get("contactPersonNumber");e?.setValidators([E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}removeSeller(){this.contactUsers=[],this.contactSearch="",this.resetContactSelection(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.shippingAddressResponse=[],this.billingAddressResponse=[],this.shippingToSearch="",this.createInvoiceForm.patchValue({sellerName:"",vendorId:null,gstNumber:"",sellerAddress:"",city:"",state:"",country:""})}handleSearchDisplay(e){e===!1?setTimeout(()=>{this.displaySearchList=e},200):this.displaySearchList=e}getAddressData(e){this.isAddressLoading=!0;let o={perPage:10,pageNumber:1};e&&(o.org_id=e),this.commonService.getAddressList(o).subscribe(r=>{let c=r.total_count||0,g=this.createInvoiceForm.get("invoiceNumber");if(r.invoice_number&&(this.suggestedInvoiceNumber=r.invoice_number),r.invoice_number&&!g?.dirty&&!g?.value&&g?.setValue(r.invoice_number),this.shippingAddressResponse=r.response||[],this.billingAddressResponse=r.response||[],this.enableAddressSelection=!0,this.isAddressLoading=!1,c>10){let h={perPage:c,pageNumber:1};e&&(h.org_id=e),this.commonService.getAddressList(h).subscribe(C=>{let k=C.response||[];this.shippingAddressResponse=k,this.billingAddressResponse=k})}})}generatePoForm(){this.GeneratePoForm=this.fbs.group({selectedSeller:[""],shippingAddress:["",E.required],billingAddress:["",E.required]})}closeOpenDropdowns(){document.querySelectorAll(".dropdown-menu.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll(".dropdown.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll('[data-toggle="dropdown"][aria-expanded="true"]').forEach(e=>e.setAttribute("aria-expanded","false"))}onSelectShippingAddress(e,o){if(e===this.ADD_SHIPPING_ADDRESS){this.setAddAddressMode("shipping",!0),this.restoreSelectValue(o,this.selectedShippingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&(this.changeSelectedAddress(r,"shipping"),this.sameAsShippingAddress&&this.changeSelectedAddress(r,"billing"))}onSelectBillingAddress(e,o){if(e===this.ADD_BILLING_ADDRESS){this.setAddAddressMode("billing",!0),this.restoreSelectValue(o,this.selectedBillingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"billing")}onSelectShippingTo(e,o){if(e===this.ADD_ADDRESS){this.setAddAddressMode("shipping",!0);let r=this.selectedShippingAddress?.[0]?.entity_id;this.restoreSelectValue(o,(this.shippingAddressResponse||[]).find(c=>c.entity_id===r));return}this.selectDeliveryAddress(e)}setAddAddressMode(e,o){if(o&&!this.isSellerSelected){this.notificationService.showError("Please select a buyer first.");return}this.addAddressMode=e,o&&(this.closeOpenDropdowns(),setTimeout(()=>{this.dialog.open(Ht,{data:{addressType:e,org_id:this.getOrgId()}}).afterClosed().subscribe(c=>{c&&(this.poRfqData?.data&&(this.addAddressMode=="shipping"&&(this.poRfqData.data.delivery_address=A({},c)),this.addAddressMode=="billing"&&(this.poRfqData.data.billing_address=A({},c))),this.getAddressData(this.getOrgId()))})},0)),(!this.shippingAddressResponse.length||!this.billingAddressResponse.length)&&this.getAddressData(this.getOrgId())}selectDeliveryAddress(e){this.changeSelectedAddress(e,"shipping"),this.changeSelectedAddress(e,"billing")}changeSelectedAddress(e,o){o=="shipping"&&(this.selectedShippingAddress=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})],this.GeneratePoForm.patchValue({shippingAddress:String(e.entity_id)}
1)),o=="billing"&&(this.selectedBillingAddress=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})],this.GeneratePoForm.patchValue({billingAddress:String(e.entity_id)}))}selectShippingAddress(){!this.selectedShippingAddress||this.selectedShippingAddress.length===0||this.GeneratePoForm.patchValue({shippingAddress:String(this.selectedShippingAddress[0].entity_id)})}selectBillingAddress(){!this.selectedBillingAddress||this.selectedBillingAddress.length===0||this.GeneratePoForm.patchValue({billingAddress:String(this.selectedBillingAddress[0].entity_id)})}onSameAsShippingChange(e){if(this.sameAsShippingAddress=e.target.checked,this.sameAsShippingAddress){let o=this.selectedShippingAddress?.[0];o&&this.changeSelectedAddress(o,"billing")}else this.selectedBillingAddress=[],this.GeneratePoForm.patchValue({billingAddress:""})}getWarehouseList(e=""){this.isWarehouseLoading=!0,this.inventoryService.getWarehouseList({pageLength:50,currentPage:1,status:"active",search:e,allWarehouses:"yes"}).subscribe({next:o=>{this.shippingWarehouseResponse=o?.response?.warehouses2||[],this.isWarehouseLoading=!1},error:()=>{this.shippingWarehouseResponse=[],this.isWarehouseLoading=!1}})}onWarehouseInput(e){this.shippingSearchText=e||"",this.getWarehouseList(this.shippingSearchText)}onAddressDropdownOpened(e){e&&this.isSellerSelected&&this.shippingAddressResponse.length===0&&this.getAddressData(this.getOrgId())}getFilteredWarehouses(e){if(!e||e.trim()==="")return this.shippingWarehouseResponse;let o=e.toLowerCase();return this.shippingWarehouseResponse.filter(r=>(r.name||"").toLowerCase().includes(o)||(r.code||"").toLowerCase().includes(o)||(r.city||"").toLowerCase().includes(o)||(r.region||"").toLowerCase().includes(o)||(r.breadcrumbs||"").toLowerCase().includes(o))}getWarehouseLocation(e){return[e?.breadcrumbs,e?.city,e?.region,e?.country_id,e?.post_code].filter(Boolean).join(", ")}selectShippingWarehouse(e){e&&(this.selectedShippingWarehouse=[e])}get filteredContactUsers(){return this.contactUsers||[]}getOrgId(){return this.createInvoiceForm.get("vendorId")?.value||null}get isSellerSelected(){return!!this.getOrgId()}getContactUsers(e="",o,r){let c=o??this.getOrgId();c&&this.financeService.userList({org_id:c,search:e}).subscribe({next:g=>{let h=g?.response?.list??[];this.contactUsers=(Array.isArray(h)?h:[]).map(k=>({id:k.id,name:k.full_name||[k.firstName,k.lastName].filter(Boolean).join(" ")||"",phone:k.phoneNumber||"",email:k.email||"",raw:k}));let C=this.contactUsers.find(k=>k.id===this.selectedContactUserId);C&&!this.createInvoiceForm.get("contactName")?.value&&this.selectContactUser(C),r?.()},error:()=>{this.contactUsers=[]}})}selectNewContactUser(e){this.getContactUsers("",void 0,()=>{let o=this.contactUsers.find(r=>e.email&&r.email&&r.email.toLowerCase()===e.email.toLowerCase()||e.phone&&r.phone&&String(r.phone)===String(e.phone));this.selectContactUser(o||{name:e.name,phone:e.phone,email:e.email})})}onContactSearch(e){this.contactSearch=e||"",this.getContactUsers(this.contactSearch)}selectContactUser(e){if(!e)return;this.selectedContactUserId=e.id??e.raw?.id??null,this.createInvoiceForm.patchValue({contactName:e.name||"",contactPersonNumber:e.phone||this.createInvoiceForm.get("contactPersonNumber")?.value||"",contactPersonEmail:e.email||this.createInvoiceForm.get("contactPersonEmail")?.value||""});let o=this.createInvoiceForm.get("contactPersonNumber");e.phone?o?.clearValidators():o?.setValidators([E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]),o?.updateValueAndValidity({emitEvent:!1}),this.contactPhoneLocked=!!e.phone,this.contactEmailLocked=!!e.email,this.contactUserSelected=!0}onContactPhoneInput(){let e=this.createInvoiceForm.get("contactPersonNumber");e?.setValidators([E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}initializeUserForm(){this.userForm=this.fb.group({name:["",[E.required]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}openAddContactUser(){this.userForm?.reset()}
1saveContactUser(){if(this.userForm.invalid){this.userForm.markAllAsTouched(),this.notificationService.showError("Please fill all user details correctly.");return}let e=this.getOrgId();if(!e){this.notificationService.showError("Please select a buyer first.");return}let o=this.userForm.value,r={email:o.email,phoneNumber:o.phone,firstName:o.name,org_id:e,is_live_user:!1};this.userSubmitting=!0,this.financeService.addUser(r).subscribe({next:c=>{this.userSubmitting=!1,c?.responseCode===200?(this.notificationService.showSuccess(c.response?.response||"User added successfully"),this.selectNewContactUser({name:o.name,phone:o.phone,email:o.email}),this.userForm.reset(),yi("closeAddContactUserModal")):this.notificationService.showError(c?.response||"Failed to add user")},error:()=>{this.userSubmitting=!1,this.notificationService.showError("Failed to add user. Please try again.")}})}filterAddresses(e){if(!this.isSellerSelected)return[];let o=this.shippingAddressResponse||[];if(!e||!e.trim())return o;let r=e.toLowerCase();return o.filter(c=>(c.firstname||"").toLowerCase().includes(r)||(c.lastname||"").toLowerCase().includes(r)||(c.full_address||"").toLowerCase().includes(r)||(c.city||"").toLowerCase().includes(r))}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=o[r],g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",""),this.FinanceOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError(h.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},h=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}ngOnDestroy(){this.formControlListeners.forEach(e=>e.unsubscribe())}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Ki),T(ft),T(ge),T(Ae),T(Dt),T(Jt),T(z),T(H),T(Wt),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-receivable-invoice"]],viewQuery:function(o,r){if(o&1&&N($0,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:469,vars:91,consts:[["auto","matAutocomplete"],["docsinput",""],["dialog1",""],["dialog2",""],["dialog3",""],["financeDrawer",""],["sellerSelect",""],["contactNameDropdown",""],["contactSelect",""],["shippingAddrSelect",""],["billingAddrSelect",""],["qtyText",""],[1,"splittedCreateCardMain","mod-mat-fields"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-3"],[1,"col-md-4"],[1,"form-group"],["for","","appTranslate","",1,"mod-form-label"],["type","text","formControlName","poNumber","placeholder","Enter PO/WO No.",1,"form-control","mod-input",3,"input","focus","blur","matAutocomplete"],[3,"value","onSelectionChange",4,"ngFor","ngForOf"],["for","",1,"mod-form-label"],["class","text-danger",4,"ngIf"],["type","text","formControlName","invoiceNumber","placeholder","Enter Invoice Number",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],[1,"text-danger"],["type","date","formControlName","invoiceCreationDate","placeholder","DD-MM-YYYY",1,"form-control","mod-input"],["type","date","formControlName","invoiceExpiryDate","placeholder","DD-MM-YYYY",1,"form-control","mod-input"],["class","row",4,"ngIf"],["class","fin-info-block mt-2",4,"ngIf"],[4,"ngIf"],[1,"row","align-items-end","gut-row","gut-3"],[1,"form-group","mb-0"],[1,"mod-form-label"],[1,"dropdown","w-100"],["data-toggle","dropdown","data-display","static",1,"form-control","fin-select-toggle","d-flex","justify-content-between","align-items-center","dropdown-toggle"],[1,"ri-arrow-down-s-line"],[1,"dropdown-menu","w-100","fin-buyer-dropdown"],["class","dropdown-item fin-buyer-item","href","javascript:void(0)",3,"click",4,"ngFor","ngForOf"],["class","dropdown-item text-muted",4,"ngIf"],["type","button","data-toggle","modal","data-target","#addBankModal",1,"mod-btn","mod-btn-outline-primary"],[1,"ri-add-line"],["class","fin-bank-card mt-3",4,"ngIf"],[1,"col-md-6"],[1,"shpCard","h-100"],["appTranslate","",1,"h6","fw-600","mb-3"],["appearance","outline","class","w-100 compact-form-field",4,"ngIf"],["class","mod-address-chip mt-3",4,"ngIf"],[1,"d-flex","align-items-center","mb-3"],["appTranslate","",1,"h6","fw-600","mb-0"],["class","custom-control custom-checkbox fin-check ml-4",4,"ngIf"],[1,"mod-card"],["type","button","class","mod-btn mod-btn-outline-primary btn-sm",3,"click",4,"ngIf"],[1,"table-dashboard"],["class","fin-empty-products text-center py-4",4,"ngIf"],["class","invali
1d-error mt-2 text-center",4,"ngIf"],["class","table-responsive mod-table-wrapper","id","product_table",4,"ngIf"],[1,"mt-4"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"col-md-8"],[1,"mod-card","h-100"],["appTranslate","",1,"mod-form-label"],["rows","6","formControlName","termsandConditions","placeholder","Please enter the terms and conditions for this invoice",1,"form-control","mod-input"],["type","file","id","invoiceAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","invoiceAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"list-unstyled","fin-summary"],["appTranslateText",""],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/receivable-invoices","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","selectShippingAddress",1,"modal","fade"],[1,"modal-dialog","modal
1-lg","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-bottom-0"],["appTranslate","",1,"modal-title","font-16","fw-600"],["type","button","data-dismiss","modal",1,"close"],[1,"modal-body"],[3,"formGroup"],[1,"row","justify-content-end","pb-2"],[1,"col-auto"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[3,"isLoading","useBlockPosition"],["class","table-responsive addressTable rounded-lg",4,"ngIf"],[1,"row","justify-content-end","mt-3"],["id","selectBillingAddress",1,"modal","fade"],["id","addBuyerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-header"],["appTranslate","",1,"modal-title"],["type","button","id","closeAddBuyerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],["type","text","formControlName","organization_name","placeholder","Enter buyer name / company name",1,"form-control","mod-input"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],["appTranslate","",1,"h6","fw-600","mt-4","mb-3"],[1,"col-12"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],[3,"value",4,"ngFor","ngForOf"],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN","appTranslate",""],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addBankModal","tabindex","-1",1,"modal","fade"],[1,"modal-header","align-items-start"],[1,"d-flex","align-items-center"],[1,"fin-modal-icon"],[1,"ri-bank-line"],["appTranslate","",1,"modal-title","mb-0"],[1,"text-muted"],["type","button","id","closeAddBankModal","data-dismiss","modal",1,"d-none"],[1,"fin-verify-box"],["type","text","formControlName","accountNumber","placeholder","Enter account number",1,"form-control","mod-input"],["type","text","formControlName","ifsc","placeholder","Enter IFSC Code",1,"form-control","mod-input"],[1,"col-12","text-center"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],[1,"row","gut-row","gut-3","mt-2"],["type","text","formControlName","accountHolder","placeholder","Enter account holder name",1,"form-control","mod-input"],["type","text","formControlName","bankName","placeholder","Enter bank name",1,"form-control","mod-input"],["type","text","formControlName","branch","placeholder","Enter branch",1,"form-control","mod-input"],["id","addContactUserModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-dialog-scrollable"],["type","button","id","closeAddContactUserModal","data-dismiss","modal",1,"d-none"],["type","text","formControlName","name","placeholder","Enter name",1,"form-control","mod-input"],["type","text","inputmode","numeric","formControlName","phone","placeholder","Enter phone number","maxlength","10",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter email id",1,"form-control","mod-input"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-title","d-flex","align-items-cente"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],["appTranslateText","",1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["moduleType","FINANCE","productType","PRODUCT",3,"productAdded"],[3,"onSelectionChange","value"],[1,"invalid-error"],[1,"row"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Search or enter buyer name",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search buyer...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[1,"text-primary","fw-500",3,"value"],["type","button","id","openAddBuyerModal","data-toggle","modal","data-target","#addBuyerModal",1,"d-none"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12 mb-3",4,"ngIf"],[1,"col-12","mb-3"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"mod-card-title","mb-0"],["class","fin-info-block",4,"ngIf"],["class","row gut-row gut-3",4,"ngIf"],[1,"fin-info-block"],["type","text","class","form-control mod-input","formControlName","contactName","readonly","",4,"ngIf","ngIfElse"],["type","text","inputmode","numeric","maxlength","10","formControlName","contactPersonNumber","placeholder","Enter Number",1,"form-control","mod-input",3,"input","readOnly"],["type","text","formControlName","contactPersonEmail","placeholder","Enter Email id",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","contactName","readonly","",1,"form-control","mod-input"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or select contact",3,"selectionChange","value"],["matInput","","placeholder","Search user...",3,"input","keydown.space","click","value"],["type","button","id","openAddContactUserModal","data-toggle","modal","data-target","#addContactUserModal",1,"d-none"],["href","javascript:void(0)",1,"dropdown-item","fin-buyer-item",3,"click"],[1,"fin-buyer-item__name"],[1,"fin-buyer-item__meta"],[1,"dropdown-item","text-muted"],[1,"fin-bank-card","mt-3"],[1,"fin-bank-card__head"],[1,"fin-bank-card__name"],[1,"fin-bank-card__city"],[1,"row","fin-bank-card__body"],[1,"col-md-3"],["panelClass","address-select-panel no-checkmark","placeholder","Select Shipping Address",3,"openedChange","selectionChange","value"],["matInput","","placeholder","Search address...",3,"input","keydown.space","click","value"],[1,"text-primary","fw-500",3,"value","disabled"],[1,"mod-address-chip","mt-3"],[1,"ri-map-pin-line"],[1,"mod-address-chip__title"],[1,"mod-address-chip__addr"],[1,"custom-control","custom-checkbox","fin-check","ml-4"],["type","checkbox","id","sameAsShipping",1,"custom-control-input",3,"change","checked","disabled"],["for","sameAsShipping","appTranslate","",1,"custom-control-label","mr-2"],["panelClass","address-select-panel no-checkmark","placeholder","Select Billing Address",3,"openedChange","selectionChange","value","disabled"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"fin-empty-products","text-center","py-4"],["appTranslate","",1,"text-muted","mb-3"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click"],[1,"invalid-error","mt-2","text-center"],["id","product_table",1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","table-dashboard","fin-product-table"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf","ngIfElse"],["class","text-center text-nowrap",4,"ngIf"],["type","number","min","1",1,"form-control","mod-input",2,"max-width","110px",3,"input","value"],["class","invali
1d-error mt-1",4,"ngIf"],[1,"invalid-error","mt-1"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class"," p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"],[1,"table-responsive","addressTable","rounded-lg"],["class","table mod-table border rounded-lg",4,"ngIf"],[1,"table","mod-table","border","rounded-lg"],[1,"table-secondary"],[4,"ngFor","ngForOf"],[1,"custom-control","custom-radio","custom-control-inline"],["type","radio","formControlName","shippingAddress","name","shippingAddress",1,"custom-control-input",3,"change","id","value"],[1,"custom-control-label",3,"for"],["class","badge badge-secondary-s text-dark status-badge px-2 py-1","appTranslate","",4,"ngIf"],["appTranslate","",1,"badge","badge-secondary-s","text-dark","status-badge","px-2","py-1"],["type","radio","formControlName","billingAddress","name","billingAddress",1,"custom-control-input",3,"change","id","value"],["id","changePwd__modal","aria-modal","true",1,"modal","fade","show","d-block","pr-20"],[1,"modal-content","br-0"],[1,"modal-body","text-center"],["type","button","data-dismiss","modal","appTranslate","",1,"btn","btn-sm","btn-outline-themeDanger","px-5","mr-15",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"btn","btn-sm","btn-logo-dark","px-5",3,"click"],["aria-modal","true",1,"modal","fade","show","d-block","pr-20"],["type","button","data-dismiss","modal",1,"close","curserType",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"btn","btn-sm","btn-theme","px-5","mr-15",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",12)(1,"div",13)(2,"div",14)(3,"h2",15)(4,"a",16),x(5,"i",17),t(),i(6,"span",18),n(7,"Customer Invoice"),t()()(),x(8,"div",19),t(),i(9,"form",20),S("ngSubmit",function(){b(c);let h=w(464),C=w(466);return y(r.onSave(h,C))}),i(10,"div",21)(11,"div",22)(12,"h3",23),n(13,"Invoice Details"),t()(),i(14,"div",24)(15,"div",25)(16,"div",26)(17,"div",27)(18,"label",28),n(19,"PO/WO NO"),t(),i(20,"input",29),S("input",function(h){return b(c),y(r.onSearchInput(h))})("focus",function(){return b(c),y(r.handlePoSearchDisplay(!0))})("blur",function(){return b(c),y(r.handlePoSearchDisplay(!1))}),t(),i(21,"mat-autocomplete",null,0),u(23,z0,2,2,"mat-option",30),t()()(),i(24,"div",26)(25,"div",27)(26,"label",31)(27,"span",18),n(28,"Invoice Number"),t(),u(29,W0,2,0,"sup",32),t(),x(30,"input",33),u(31,Q0,2,0,"div",34),t()(),i(32,"div",26)(33,"div",27)(34,"label",31)(35,"span",18),n(36,"Invoice Date"),t(),i(37,"sup",35),n(38,"*"),t()(),x(39,"input",36),u(40,Y0,2,0,"div",34),t()(),i(41,"div",26)(42,"div",27)(43,"label",31)(44,"span",18),n(45,"Due Date"),t(),i(46,"sup",35),n(47,"*"),t()(),x(48,"input",37),u(49,H0,2,0,"div",34),t()()()()(),i(50,"div",21)(51,"div",22)(52,"h3",23),n(53,"Buyer Details"),t()(),i(54,"div",24),u(55,tc,23,9,"div",38)(56,rc,10,5,"div",39),t()(),u(57,_c,10,2,"ng-container",40),i(58,"div",21)(59,"div",22)(60,"h3",23),n(61,"Payment Details"),t()(),i(62,"div",24)(63,"div",41)(64,"div",14)(65,"div",42)(66,"label",43)(67,"span",18),n(68,"Select Bank account"),t(),u(69,vc,2,0,"sup",32),t(),i(70,"div",44)(71,"div",45)(72,"span"),n(73),t(),x(74,"i",46),t(),i(75,"div",47),u(76,gc,5,3,"a",48)(77,fc,2,0,"div",49),t()()()(),i(78,"div",19)(79,"button",50),x(80,"i",51),i(81,"span",18),n(82,"Add New"),t()()()(),u(83,hc,27,6,"div",52),t()(),i(84,"div",21)(85,"div",22)(86,"h3",23),n(87,"Delivery Address"),t()(),i(88,"div",24)(89,"div",25)(90,"div",53)(91,"div",54)(92,"h4",55),n(93,"Shipping Address"),t(),u(94,Sc,12,7,"mat-form-field",56)(95,Cc,7,2,"div",57),t()(),i(96,"div",53)(97,"div",54)(98,"div",58)(99,"h4",59),n(100,"Billing Address"),t(),u(101,Ec,4,2,"div",60),t(),u(102,wc,12,8,"mat-form-field",56)(103,Pc,7,2,"div",57),t()()()()(),i(104,"div",61)(105,"div",22)(106,"h3",23),n(107,"Product Details"),t(),u(108,Oc,4,0,"button",62),t(),i(109,"div",24)(110,"div",63),u(111,kc,7,0,"div",64)(112,Fc,2,0,"div",65)(113,Lc,21,3,"div",66),i(114,"div",67),u(115,qc,5,0,"div",68),i(116,"div",69),u(117,jc,14,3,"div",70),t()()()()(),i(118,"div",71)(119,"div",72)(120,"div",73)(121,"div",22)(122,"h3",23),n(123,"Terms & Conditions"),t()(),i(124,"div",24)(125,"div",27)(126,"label",74),n(127,"Terms & Conditions"),t(),x(128,"textarea",75),t(),i(129,"input",76,1),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(131,"label",77),x(132,"i",78),u(133,$c,2,0,"span",79)(134,zc,2,0,"span",79),t(),u(135,Wc,1,2,"app-loader",80)(136,Yc,2,1,"div",81),t()()(),i(137,"div",26)(138,"div",73)(139,"div",22)(140,"h3",23),n(141,"Invoice Summary"),t()(),i(142,"div",24)(143,"ul",82)(144,"li",83),n(145," Gross Total "),i(146,"span"),n(147),_(148,"currencyFormat"),t()(),i(149,"li")(150,"span",18),n(1
vendor: 4,922 bytes, line 1
151,"Discount"),t(),i(152,"span",35),n(153),_(154,"currencyFormat"),t()(),i(155,"li",83),n(156," Net Total "),i(157,"span"),n(158),_(159,"currencyFormat"),t()(),i(160,"li",83),n(161," GST "),i(162,"span"),n(163),_(164,"currencyFormat"),t()(),i(165,"li",83),n(166," Additional Charges "),i(167,"span"),n(168),_(169,"currencyFormat"),t()()()(),i(170,"div",84),n(171," Total Payable Amount "),i(172,"span"),n(173),_(174,"currencyFormat"),t()()()()(),i(175,"div",85)(176,"div",86)(177,"div",87)(178,"button",88),n(179,"Cancel"),t(),i(180,"button",89),n(181,"Save"),t()()()()()(),i(182,"div",90)(183,"div",91)(184,"div",92)(185,"div",93)(186,"h4",94),n(187,"Select shipping address"),t(),i(188,"button",95),n(189,"\xD7"),t()(),i(190,"div",96)(191,"div",97)(192,"div",98)(193,"div",99)(194,"button",100),S("click",function(){return b(c),y(r.setAddAddressMode("shipping",!0))}),n(195,"Add New Address"),t()()(),x(196,"app-loader",101),u(197,Xc,3,2,"div",102),i(198,"div",103)(199,"div",99)(200,"button",100),S("click",function(){return b(c),y(r.selectShippingAddress())}),n(201,"Select & Proceed"),t()()()()()()()(),i(202,"div",104)(203,"div",91)(204,"div",92)(205,"div",93)(206,"h4",94),n(207,"Select billing address"),t(),i(208,"button",95),n(209,"\xD7"),t()(),i(210,"div",96)(211,"div",97)(212,"div",98)(213,"div",99)(214,"button",100),S("click",function(){return b(c),y(r.setAddAddressMode("billing",!0))}),n(215,"Add New Address"),t()()(),x(216,"app-loader",101),u(217,ap,3,2,"div",102),i(218,"div",103)(219,"div",99)(220,"button",100),S("click",function(){return b(c),y(r.selectBillingAddress())}),n(221,"Select & Proceed"),t()()()()()()()(),i(222,"div",105)(223,"div",106)(224,"div",92)(225,"div",107)(226,"h5",108),n(227,"Add New Buyer"),t(),x(228,"button",109),i(229,"button",110),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(230,"\xD7"),t()(),i(231,"form",97)(232,"div",96)(233,"div",25)(234,"div",53)(235,"label",43)(236,"span",18),n(237,"Buyer Name / Company Name"),t(),i(238,"sup",35),n(239,"*"),t()(),x(240,"input",111),u(241,rp,2,0,"div",34),t(),i(242,"div",53)(243,"label",74),n(244,"GST"),t(),x(245,"input",112),t(),i(246,"div",53)(247,"label",74),n(248,"PAN"),t(),x(249,"input",113),t()(),i(250,"h3",114),n(251,"Billing address"),t(),i(252,"div",25)(253,"div",115)(254,"label",43)(255,"span",18),n(256,"Address"),t(),i(257,"sup",35),n(258,"*"),t()(),x(259,"input",116),u(260,lp,2,0,"div",34),t(),i(261,"div",53)(262,"label",43)(263,"span",18),n(264,"State"),t(),i(265,"sup",35),n(266,"*"),t()(),i(267,"select",117)(268,"option",118),n(269,"Select State"),t(),u(270,op,2,2,"option",119),t(),u(271,sp,2,0,"div",34),t(),i(272,"div",53)(273,"label",43)(274,"span",18),n(275,"City"),t(),i(276,"sup",35),n(277,"*"),t()(),x(278,"input",120),u(279,dp,2,0,"div",34),t(),i(280,"div",53)(281,"label",43)(282,"span",18),n(283,"Country"),t(),i(284,"sup",35),n(285,"*"),t()(),i(286,"select",121)(287,"option",118),n(288,"Select Country"),t(),i(289,"option",122),n(290,"India"),t()(),u(291,cp,2,0,"div",34),t(),i(292,"div",53)(293,"label",74),n(294,"Postal Code"),t(),x(295,"input",123),u(296,pp,2,0,"div",34),t()(),i(297,"h3",114),n(298,"Contact Details"),t(),i(299,"div",25)(300,"div",53)(301,"label",43)(302,"span",18),n(303,"Contact Name"),t(),i(304,"sup",35),n(305,"*"),t()(),x(306,"input",124),u(307,mp,2,0,"div",34),t(),i(308,"div",53)(309,"label",43)(310,"span",18),n(311,"Phone No."),t(),i(312,"sup",35),n(313,"*"),t()(),x(314,"input",125),u(315,vp,3,2,"div",34),t(),i(316,"div",53)(317,"label",43)(318,"span",18),n(319,"Email Id"),t(),i(320,"sup",35),n(321,"*"),t()(),x(322,"input",126),u(323,hp,3,2,"div",34),t()()(),i(324,"div",127)(325,"button",128),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(326,"Cancel"),t(),i(327,"button",129),S("click",function(){return b(c),y(r.saveBuyer())}),n(328),t()()()()()(),i(329,"div",130)(330,"div",106)(331,"div",92)(332,"div",131)(333,"div",132)(334,"span",133),x(335,"i",134),t(),i(336,"div")(337,"h5",135),n(338,"Add New Bank Details"),t(),i(339,"small",136),n(340,"Verify using Account No. & IFSC"),t()()(),x(341,"button",137),i(342,"button",110),S("click",function(){return b(c),y(r.bankForm.reset())}),n(343,"\xD7"),t()(),i(344,"form",97)(345,"div",96)(346,"div",138)(347,"div",25)(348,"div",53)(349,"label",43)(350,"span",18),n(351,"Account Number"),t(),i(352,"sup",35),n(353,"*"),t()(),x(354,"input",139),u(355,yp,3,2,"div",34),t(),i(356,"div",53)(357,"label",43)(358,"span",18),n(359,"IFSC Code"),t(),i(360,"sup",35),n(361,"*"),t()(),x(362,"input",140),u(363,Ep,3,2,"div",34),t(),i(364,"div",141)(365,"button",142),S("click",function(){return b(c),y(r.verifyBankAccount())}),n(366),t()()()(),i(367,"div",143)(368,"div",53)(369,"label",43)(370,"span",18),n(371,"Account Holder Name"),t(),i(372,"sup",35),n(373,"*"),t()(),x(374,"input",144),u(375,Ip,2,0,"div",34),t(),i(376,"div",53)(377,"label",43)(378,"span",18),n(379,"Bank Name"),t(),i(38
10,"sup",35),n(381,"*"),t()(),x(382,"input",145),u(383,Dp,2,0,"div",34),t(),i(384,"div",53)(385,"label",43)(386,"span",18),n(387,"Branch Name"),t(),i(388,"sup",35),n(389,"*"),t()(),x(390,"input",146),u(391,Tp,2,0,"div",34),t()()(),i(392,"div",127)(393,"button",128),S("click",function(){return b(c),y(r.bankForm.reset())}),n(394,"Cancel"),t(),i(395,"button",129),S("click",function(){return b(c),y(r.saveBankAccount())}),n(396),t()()()()()(),i(397,"div",147)(398,"div",148)(399,"div",92)(400,"div",107)(401,"h5",108),n(402,"Add User"),t(),x(403,"button",149),i(404,"button",110),S("click",function(){return b(c),y(r.userForm.reset())}),n(405,"\xD7"),t()(),i(406,"form",97)(407,"div",96)(408,"div",25)(409,"div",115)(410,"label",43)(411,"span",18),n(412,"Name"),t(),i(413,"sup",35),n(414,"*"),t()(),x(415,"input",150),u(416,wp,2,0,"div",34),t(),i(417,"div",115)(418,"label",43)(419,"span",18),n(420,"Phone Number"),t(),i(421,"sup",35),n(422,"*"),t()(),x(423,"input",151),u(424,kp,3,2,"div",34),t(),i(425,"div",115)(426,"label",43)(427,"span",18),n(428,"Email"),t(),i(429,"sup",35),n(430,"*"),t()(),x(431,"input",152),u(432,Ap,3,2,"div",34),t()()(),i(433,"div",127)(434,"button",128),S("click",function(){return b(c),y(r.userForm.reset())}),n(435,"Cancel"),t(),i(436,"button",129),S("click",function(){return b(c),y(r.saveContactUser())}),n(437),t()()()()()(),x(438,"button",153)(439,"button",154),i(440,"div",155)(441,"div",156)(442,"div",92)(443,"div",107)(444,"h4",157),x(445,"i",158),i(446,"span",18),n(447,"Delete Product"),t()()(),i(448,"div",159)(449,"p",160),n(450,"Are you sure you want to delete "),i(451,"strong"),n(452),t(),n(453,"? "),t(),i(454,"p",161),n(455,"This action cannot be undone."),t()(),i(456,"div",162)(457,"button",163),S("click",function(){return b(c),y(r.cancelDelete())}),n(458,"No, Keep it"),t(),i(459,"button",100),S("click",function(){return b(c),y(r.confirmDelete())}),n(460,"Yes, Delete"),t()()()()(),u(461,Np,10,0,"ng-template",null,2,P)(463,Vp,12,0,"ng-template",null,3,P)(465,Bp,12,0,"ng-template",null,4,P),i(467,"app-common-bom-product-drawer",164,5),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve,qe,Ge,Ue,je,si,di,ci,nn=w(22);l(4),s("backButtonFallback","/finance-management/receivable-invoices"),l(5),s("formGroup",r.createInvoiceForm),l(11),s("matAutocomplete",nn),l(3),s("ngForOf",r.poList),l(6),s("ngIf",!r.isManualEntryPo),l(2),s("ngIf",((c=r.createInvoiceForm.get("invoiceNumber"))==null?null:c.touched)&&((c=r.createInvoiceForm.get("invoiceNumber"))==null?null:c.invalid)),l(8),Be("max",r.invoiceExpiryDateValue||null),l(),s("ngIf",r.isInvoiceDateRangeInvalid&&((g=r.createInvoiceForm.get("invoiceCreationDate"))==null?null:g.touched)),l(8),Be("min",r.invoiceCreationDateValue||null),l(),s("ngIf",r.isInvoiceDateRangeInvalid&&((h=r.createInvoiceForm.get("invoiceExpiryDate"))==null?null:h.touched)),l(6),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",(C=r.createInvoiceForm.get("sellerName"))==null?null:C.value),l(),s("ngIf",(k=r.createInvoiceForm.get("sellerName"))==null?null:k.value),l(12),s("ngIf",!r.isManualEntryPo),l(4),f((O=r.createInvoiceForm.get("bankName"))!=null&&O.value?((O=r.createInvoiceForm.get("bankName"))==null?null:O.value)+" - "+((O=r.createInvoiceForm.get("accountNumber"))==null?null:O.value):"Select bank account"),l(3),s("ngForOf",r.bankDetails),l(),s("ngIf",!r.bankDetail
1s.length),l(6),s("ngIf",(Q=r.createInvoiceForm.get("accountNumber"))==null?null:Q.value),l(11),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(6),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",r.poIdState!=="select"),l(),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(5),s("ngIf",r.productFormValues.length&&r.poIdState!=="select"&&r.poSelected==!1),l(3),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",(r.submitted||r.productRequiredError)&&(!r.productFormValues||r.productFormValues.length===0)),l(),s("ngIf",r.productFormValues.length),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(11),f(v(148,79,(G=r.createInvoiceForm.get("grossTotal"))==null?null:G.value)),l(6),m("- ",v(154,81,(X=r.createInvoiceForm.get("discount"))==null?null:X.value),""),l(5),f(v(159,83,(pe=r.createInvoiceForm.get("netTotal"))==null?null:pe.value)),l(5),f(v(164,85,(Y=r.createInvoiceForm.get("taxes"))==null?null:Y.value)),l(5),f(v(169,87,r.getAdditionalCharges)),l(5),f(v(174,89,(le=r.createInvoiceForm.get("totalPayableAmount"))==null?null:le.value)),l(7),s("disabled",r.createInvoiceForm.invali
1d||!r.productFormValues||r.productFormValues.length===0||r.hasQuantityErrors),l(11),s("formGroup",r.GeneratePoForm),l(5),s("isLoading",r.isAddressLoading)("useBlockPosition",!0),l(),s("ngIf",!r.isAddressLoading),l(14),s("formGroup",r.GeneratePoForm),l(5),s("isLoading",r.isAddressLoading)("useBlockPosition",!0),l(),s("ngIf",!r.isAddressLoading),l(14),s("formGroup",r.buyerForm),l(10),s("ngIf",((ee=r.buyerForm.get("organization_name"))==null?null:ee.touched)&&((ee=r.buyerForm.get("organization_name"))==null?null:ee.invalid)),l(19),s("ngIf",((fe=r.buyerForm.get("address"))==null?null:fe.touched)&&((fe=r.buyerForm.get("address"))==null?null:fe.invalid)),l(10),s("ngForOf",r.states),l(),s("ngIf",((oe=r.buyerForm.get("state"))==null?null:oe.touched)&&((oe=r.buyerForm.get("state"))==null?null:oe.invalid)),l(8),s("ngIf",((te=r.buyerForm.get("city"))==null?null:te.touched)&&((te=r.buyerForm.get("city"))==null?null:te.invalid)),l(12),s("ngIf",((me=r.buyerForm.get("country_id"))==null?null:me.touched)&&((me=r.buyerForm.get("country_id"))==null?null:me.invalid)),l(5),s("ngIf",((ce=r.buyerForm.get("postal_code"))==null?null:ce.touched)&&((ce=r.buyerForm.get("postal_code"))==null?null:ce.invalid)),l(11),s("ngIf",((be=r.buyerForm.get("contact_name"))==null?null:be.touched)&&((be=r.buyerForm.get("contact_name"))==null?null:be.invalid)),l(8),s("ngIf",((Fe=r.buyerForm.get("phone"))==null?null:Fe.touched)&&((Fe=r.buyerForm.get("phone"))==null?null:Fe.invalid)),l(8),s("ngIf",((Me=r.buyerForm.get("email"))==null?null:Me.touched)&&((Me=r.buyerForm.get("email"))==null?null:Me.invalid)),l(4),s("disabled",r.buyerSubmitting),l(),m(" ",r.buyerSubmitting?"Saving...":"Save Buyer"," "),l(16),s("formGroup",r.bankForm),l(11),s("ngIf",((Ve=r.bankForm.get("accountNumber"))==null?null:Ve.touched)&&((Ve=r.bankForm.get("accountNumber"))==null?null:Ve.invalid)),l(8),s("ngIf",((qe=r.bankForm.get("ifsc"))==null?null:qe.touched)&&((qe=r.bankForm.get("ifsc"))==null?null:qe.invalid)),l(2),s("disabled",r.bankVerifying),l(),m(" ",r.bankVerifying?"Verifying...":"Verify Account"," "),l(9),s("ngIf",((Ge=r.bankForm.get("accountHolder"))==null?null:Ge.touched)&&((Ge=r.bankForm.get("accountHolder"))==null?null:Ge.invalid)),l(8),s("ngIf",((Ue=r.bankForm.get("bankName"))==null?null:Ue.touched)&&((Ue=r.bankForm.get("bankName"))==null?null:Ue.invalid)),l(8),s("ngIf",((je=r.bankForm.get("branch"))==null?null:je.touched)&&((je=r.bankForm.get("branch"))==null?null:je.invalid)),l(4),s("disabled",r.bankSubmitting),l(),m(" ",r.bankSubmitting?"Saving...":"Save Bank Account"," "),l(10),s("formGroup",r.userForm),l(10),s("ngIf",((si=r.userForm.get("name"))==null?null:si.touched)&&((si=r.userForm.get("name"))==null?null:si.invalid)),l(8),s("ngIf",((di=r.userForm.get("phone"))==null?null:di.touched)&&((di=r.userForm.get("phone"))==null?null:di.invalid)),l(8),s("ngIf",((ci=r.userForm.get("email"))==null?null:ci.touched)&&((ci=r.userForm.get("email"))==null?null:ci.invalid)),l(4),s("disabled",r.userSubmitting),l(),m(" ",r.userSubmitting?"Submitting...":"Submit"," "),l(15),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:"")}},dependencies:[rt,J,W,Ee,It,Mt,Et,Oe,He,Ke,Ne,at,Ye,Oi,Pe,Ie,Ot,gt,kt,Ft,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ki,Fi,Qi,ae],styles:[".parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseInput[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:focus, .shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:active{outline:none!important;box-shadow:none!important}.btn-theme-light[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;
1background:var(--theme-bg-light);color:var(--theme-primary, #5a2c1a);border:1px solid #f0e2db;border-radius:6px;font-size:14px;font-weight:500;line-height:1.2;white-space:nowrap;transition:background .15s ease,border-color .15s ease}.btn-theme-light[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px;line-height:1}.btn-theme-light[_ngcontent-%COMP%]:hover, .btn-theme-light[_ngcontent-%COMP%]:focus{background:#f4e3dc;border-color:#e8d3ca;color:var(--theme-primary, #5a2c1a);text-decoration:none}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__name[_ngcontent-%COMP%]{color:#000}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.fin-address-chip[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;background:var(--theme-bg-light);border-radius:8px;padding:12px 14px}.fin-address-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:18px;color:#555;margin-top:2px}.fin-address-chip__title[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-address-chip__addr[_ngcontent-%COMP%]{display:block;font-size:13px;color:#777}.fin-bank-card[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden;border:1px solid #f1e0d9}.fin-bank-card__head[_ngcontent-%COMP%]{background:var(--theme-bg-light);padding:14px 18px}.fin-bank-card__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;margin:0;color:#000}.fin-bank-card__city[_ngcontent-%COMP%]{font-size:13px;color:#777}.fin-bank-card__body[_ngcontent-%COMP%]{padding:16px 18px}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;border:1px solid #ececec;border-radius:8px;overflow:hidden;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:22px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary-card[_ngcontent-%COMP%]{overflow:hidden}.fin-summary-card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding-bottom:0}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}.fin-modal-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:8px;background:var(--theme-bg-light);margin-right:12px}.fin-modal-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:var(--theme-primary, #6b2f1a)}.fin-verify-box[_ngcontent-%COMP%]{border:1px solid #ececec;border-radius:8px;padding:18px;margin-bottom:8px}"]})}}return a})();var Ta=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-invoice-details"]],decls:161,vars:1,consts:[[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],[1,"col-md-auto"],["href","#deleteConfirmationModal","data-toggle","modal",1,"mod-btn","mod-btn-outline-danger","ml-3"],[1,"ri-delete-bin-line"],["appTranslate",""],["href","#","download","",1,"mod-btn","mod-btn-outline-primary","ml-3"],[1,"ri-download-2-line"],["routerLink","/finance-management/receivable-invoices/1",1,"mod-btn","mod-btn-primary","ml-3"],[1,"ri-pencil-line"],[1,"card","paymentDetailsCard__two","mb-30"],[1,"card-body"],["appTranslate","",1,"mt-4","fw-600"],[1,"list-group","list-group-flush"],[1,"list-group-item"],["appTranslate","",1,"label"],[1,"value"],[1,"commonBadge","badge","badge-blue-s"],[1,"list-unstlyed","list-inline"],[1,"list-inline-item"],["href","#","download","",1,"btn","btn-link","pl-0"],["href","#","download","",1,"btn","btn-link"],["appTranslate","",1,"mt-5","mb-4","fw-600"],[1,"table-dashboard","table-x-negativeMargin"],[1,"table-responsive"],[1,"table","mod-table"],["appTranslate","",1,"text-right"],[1,"text-right"],["id","deleteConfirmationModal",1,"modal"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-body"],["type","button","data-dismiss","modal",1,"close"],[1,"text-center","mt-4"],[1,"ri-error-warning-line","text-warning","font-48"],["appTranslate","",1,"text-center","mb-4","mt-2","fw-500"],[1,"text-center","mb-4"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-outline-primary","mr-3"],["type","button","routerLink","/finance-management/payable-invoices/","appTranslate","",1,"mod-btn","mod-btn-danger"]],template:function(o,r){o&1&&(i(0,"main")(1,"div",0)(2,"div",1)(3,"h2",2)(4,"a",3),x(5,"i",4),t(),n(6,"INV5FR542121ER"),t()(),i(7,"div",5)(8,"a",6),x(9,"i",7),i(10,"span",8),n(11,"Delete"),t()(),i(12,"a",9),x(13,"i",10),i(14,"span",8),n(15,"Download"),t()(),i(16,"a",11),x(17,"i",12),i(18,"span",8),n(19,"Edit"),t()()()(),i(20,"div",13)(21,"div",14)(22,"h5",15),n(23,"General Information"),t(),i(24,"ul",16)(25,"li",17)(26,"p",18),n(27,"Customer GST"),t(),i(28,"p",19),n(29,"23AAACC1206D2ZN"),t()(),i(30,"li",17)(31,"p",18),n(32,"Customer Name"),t(),i(33,"p",19),n(34,"Surya Kumar Yadhav"),t()(),i(35,"li",17)(36,"p",18),n(37,"Invoice Number"),t(),i(38,"p",19),n(39,"156266565556"),t()(),i(40,"li",17)(41,"p",18),n(42,"Invoice Date"),t(),i(43,"p",19),n(44,"15-05-2025"),t()(),i(45,"li",17)(46,"p",18),n(47,"Invoice Due Date"),t(),i(48,"p",19),n(49,"15-05-2025"),t()(),i(50,"li",17)(51,"p",18),n(52,"Billing Address"),t(),i(53,"p",19),n(54,"501,Srinivas Colony, Jai Bharat Nagar, Nizampet, Hyderabad, Telangana, India- 500090"),t()(),i(55,"li",17)(56,"p",18),n(57,"Status"),t(),i(58,"p",19)(59,"span",20),n(60,"Open"),t()()(),i(61,"li",17)(62,"p",18),n(63,"Notes"),t(),i(64,"p",19),n(65,"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Hic alias dolores fugit laudantium sequi ab, rerum reprehenderit placeat. Blanditiis dignissimos corporis repellendus labore iure pariatur ratione est itaque magnam cum."),t()(),i(66,"li",17)(67,"p",18),n(68,"Attachments"),t(),i(69,"ul",21)(70,"li",22)(71,"a",23),n(72,"Invoice Document.pdf"),t()(),i(73,"li",22)(74,"a",24),n(75,"Payment Receipt.jpg"),t()(),i(76,"li",22)(77,"a",24),n(78,"Bank Statement.pdf"),t()()()()(),i(79,"h5",25),n(80,"Product/ Service Information"),t(),i(81,"div",26)(82,"div",27)(83,"table",28)(84,"thead")(85,"tr")(86,"th",8),n(87,"S.No."),t(),i(88,"th",8),n(89,"Product Name/ Service"),t(),i(90,"th",8),n(91,"Quantity"),t(),i(92,"th",8),n(93,"Unit Price"),t(),i(94,"th",8),n(95,"Discount %"),t(),i(96,"th",8),n(97,"Tax %"),t(),i(98,"th",29),n(99,"Total Amount"),t()()(),i(100,"tbody")(101,"tr")(102,"td"),n(103,"1"),t(),i(104,"td"),n(105,"Product Name"),t(),i(106,"td"),n(107,"1"),t(),i(108,"td"),n(109,"100.00"),t(),i(110,"td"),n(111,"10.00"),t(),i(112,"td"),n(113,"18%"),t(),i(114,"td",30),n(115,"118.00"),t()(),i(116,"tr")(117,"td"),n(118,"2"),t(),i(119,"td"),n(120,"Product Name"),t(),i(121,"td"),n(122,"1"),t(),i(123,"td"),n(124,"100.00"),t(),i(125,"td"),n(126,"10.00"),t(),i(127,"td"),n(128,"18%"),t(),i(129,"td",30),n(130,"118.00"),t()(),i(131,"tr")(132,"td"),n(133,"3"),t(),i(134,"td"),n(135,"Product Name"),t(),i(136,"td"),n(137,"1"),t(),i(138,"td"),n(139,"100.00"),t(),i(140,"td"),n(141,"10.00"),t(),i(142,"td"),n(143,"18%"),t(),i(144,"td",30),n(145,"118.00"),t()()()()()()()()(),i(146,"div",31)(147,"div",32)(148,"div",33)(149,"div",34)(150,"button",35),n(151,"\xD7"),t(),i(152,"div",36),x(153,"i",37),t(),i(154,"p",38),n(155,"Are you sure you want to delete this payment?"),t(),i(156,"div",39)(157,"button",40),n(158,"Cancel"),t(),i(159,"button",41),n(160,"Delete"),t()()()()()()),o&2&&(l(4),s("backButtonFallback","/finance-management/receivable-invoices"))},dependencies:[Ee,Z,L],styles:[".paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%]{margin-top:15px}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{display:flex;align-items:center;border-color:#efefef}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] p.label[_ngcontent-%COMP%]{color:#6b6b6b;margin-bottom:0;font-weight:400;min-width:170px}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] p.value[_ngcontent-%COMP%]{font-weight:500;margin-bottom:0;color:#333}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object[_ngcontent-%COMP%]{align-items:center}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object-shrink[_ngcontent-%COMP%]{margin-right:10px}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object-shrink[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;object-fit:cover}.paymentDetailsCard__two[_ngcontent-%COMP%] ul.list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%] .media-object-grow[_ngcontent-%COMP%]{font-weight:600}.paymentDetailsCard__two[_ngcontent-%COMP%] .taxCard[_ngcontent-%COMP%]{min-width:300px}"]})}}return a})();var Rp=["totalAmountTemplate"],Lp=["statusTemplate"],qp=["actionsTemplate"];function Gp(a,d){if(a&1&&(i(0,"span",10),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function Up(a,d){if(a&1&&(i(0,"button",11),x(1,"i",12),t(),i(2,"mat-menu",13,2)(4,"button",14)(5,"mat-icon",15),n(6,"visibility"),t(),i(7,"span",16),n(8,"View"),t()(),i(9,"button",17)(10,"mat-icon"),n(11,"delete"),t(),i(12,"span",16),n(13,"Delete"),t()()()),a&2){let e=w(3);s("matMenuTriggerFor",e)}}var wa=(()=>{class a{constructor(e,o,r,c){this.oService=e,this.snackBar=o,this.notificationService=r,this.cService=c,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"name",label:"Customer Name",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Customer"}},{key:"tax_invoice_amount",label:"Total Invoice Amount",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"paid_received_amount",label:"Total Paid Amount ",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"balance_amount",label:"Outstanding Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"last_transaction_date",label:"Last Transaction Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"last_transaction_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-debit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"DEBIT-NOTE-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={total_amount:this.totalAmountTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search,userType:"SELLER"};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getApReportsList(o).subscribe({next:r=>{this.tableData=r?.data||[],this.pageLength=r?.totalRecords||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}onExportRequest(e){let o={userType:"SELLER",exportType:e.fileType},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportReportsList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"receivable_reports.pdf":"receivable_reports.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-reports"]],viewQuery:function(o,r){if(o&1&&(N(Rp,7),N(Lp,7),N(qp,7)),o&2){let c;V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:12,vars:6,consts:[["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px"],[1,"menu-option-icon"],["appTranslate",""],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",3)(1,"div",4)(2,"div",5)(3,"h2",6),n(4,"AR Reports "),t()()(),i(5,"div",7)(6,"div",8)(7,"data-table",9),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(8,Gp,2,3,"ng-template",null,0,P)(10,Up,14,1,"ng-template",null,1,P),t()}if(o&2){let c=w(11);l(7),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[Xe,Je,et,Re,L,Le]})}}return a})();var jp=["actionsTemplate"],$p=()=>["/finance-management/bank-accounts/create"];function zp(a,d){if(a&1&&(i(0,"button",17),x(1,"i",18),t(),i(2,"mat-menu",19,1)(4,"button",20)(5,"mat-icon",21),n(6,"visibility"),t(),i(7,"span",10),n(8,"View"),t()(),i(9,"button",22)(10,"mat-icon"),n(11,"delete"),t(),i(12,"span",10),n(13,"Delete"),t()()()),a&2){let e=w(3);s("matMenuTriggerFor",e)}}var Pa=(()=>{class a{constructor(e,o,r){this.oService=e,this.notificationService=o,this.cService=r,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig()}initializeTableConfig(){let e=[{key:"bank_name",label:"Bank Name",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Bank Name"}},{key:"account_name",label:"Company Name",selected:!0,dataType:"text",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Company"}},{key:"account_number",label:"Account Number ",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Account No."}},{key:"ifsc",label:"IFSC Code",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search IFSC Code"}},{key:"ledger_number",label:"Ledger Number",selected:!0,dataType:"number",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Ledger No."}}
1,{key:"branch_name",label:"Branch Name",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Branch"}}];this.tableConfig={tableId:"finance-payable-debit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!1,export:!1,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"BANK-DETAILS-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getBankDetailsList(o).subscribe({next:r=>{this.tableData=r.response?.list||[],this.pageLength=r?.totalRecords||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-bank-accounts"]],viewQuery:function(o,r){if(o&1&&N(jp,7),o&2){let c;V(c=B())&&(r.actionsTemplate=c.first)}},decls:21,vars:7,consts:[["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],["appTranslate",""],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","config","data","totalRecords","isLoading","actionsTemplate"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px"],[1,"menu-option-icon"],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",2)(1,"div",3)(2,"div",4)(3,"h2",5),n(4," Bank Accounts "),t()(),i(5,"div",6)(6,"div",7)(7,"button",8),x(8,"i",9),i(9,"span",10),n(10,"Add New Bank Details"),t()(),i(11,"div",11)(12,"button",12),x(13,"i",13),i(14,"span",10),n(15,"Manual Entry"),t()()()()()(),i(16,"div",14)(17,"div",15)(18,"data-table",16),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}),t()()(),u(19,zp,14,1,"ng-template",null,0,P),t()}if(o&2){let c=w(20);l(12),s("routerLink",Ce(6,$p)),l(6),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("actionsTemplate",c)}},dependencies:[Ee,Xe,Je,et,Re,L,Le]})}}return a})();var Wp=["invoiceSearchInput"];function Qp(a,d){a&1&&(i(0,"div",115),x(1,"i",116),i(2,"span",9),n(3,"Loading..."),t()())}function Yp(a,d){if(a&1){let e=I();i(0,"li",120),S("mousedown",function(){let r=b(e).$implicit,c=p(3);return y(c.selectInvoice(r))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id," ")}}function Hp(a,d){a&1&&(i(0,"li",121),n(1," No invoices found "),t())}function Kp(a,d){if(a&1&&(i(0,"ul",117),u(1,Yp,2,1,"li",118)(2,Hp,2,0,"li",119),t()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceList),l(),s("ngIf",(e.invoiceList==null?null:e.invoiceList.length)===0)}}function Zp(a,d){if(a&1){let e=I();i(0,"div",110)(1,"div",111)(2,"input",112,1),S("input",function(r){b(e);let c=p();return y(c.onSearchInput(r))})("click",function(r){return b(e),y(r.stopPropagation())}),t()(),u(4,Qp,4,0,"div",113)(5,Kp,3,2,"ul",114),t()}if(a&2){let e=p();
1l(4),s("ngIf",e.isInvoiceLoading),l(),s("ngIf",!e.isInvoiceLoading)}}function Jp(a,d){a&1&&(i(0,"div",122),n(1,"Invoice Number is required"),t())}function Xp(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Bank Name"),t(),x(5,"input",123),t()(),i(6,"div",17)(7,"div",25)(8,"label",26),n(9,"Account Number"),t(),x(10,"input",124),t()(),i(11,"div",17)(12,"div",25)(13,"label",26),n(14,"IFSC Code"),t(),x(15,"input",125),t()()())}function em(a,d){a&1&&(i(0,"span"),n(1,"Choose file"),t())}function tm(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function im(a,d){if(a&1&&x(0,"app-loader",131),a&2){let e=p(2);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function nm(a,d){if(a&1){let e=I();i(0,"li",132)(1,"p",133)(2,"a",134),n(3),t(),i(4,"span",135)(5,"i",136),S("click",function(){let r=b(e).$implicit;p();let c=w(19),g=p();return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function am(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Cheque/DD Number"),t(),x(5,"input",126),t()(),i(6,"div",17)(7,"div",25)(8,"label",26),n(9,"Cheque/DD Date"),t(),x(10,"input",127),t()(),i(11,"div",17)(12,"div",25)(13,"label",26),n(14,"Bank & Branch"),t(),x(15,"input",128),t()(),i(16,"div",50)(17,"div",51)(18,"input",129,0),S("change",function(r){b(e);let c=p();return y(c.fileChange(r))}),t(),i(20,"label",130),u(21,em,2,0,"span",54)(22,tm,2,0,"span",54),t(),u(23,im,1,2,"app-loader",55),t()(),i(24,"div",47)(25,"ul",56),u(26,nm,6,2,"li",57),t()()()}if(a&2){let e=p();l(18),s("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function rm(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Received By"),t(),x(5,"input",137),t()()())}function lm(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Card Type"),t(),i(5,"select",138)(6,"option",34),n(7,"Select Card Type"),t(),i(8,"option",139),n(9,"Credit Card"),t(),i(10,"option",140),n(11,"Debit Card"),t()()()(),i(12,"div",17)(13,"div",25)(14,"label",26),n(15,"Transaction ID"),t(),x(16,"input",141),t()()())}function om(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"UPI ID"),t(),x(5,"input",142),t()(),i(6,"div",17)(7,"div",25)(8,"label",26),n(9,"UPI Transaction ID"),t(),x(10,"input",143),t()()())}function sm(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"div",25)(3,"label",26),n(4,"Gateway Name"),t(),i(5,"select",144)(6,"option",34),n(7,"Select Gateway"),t(),i(8,"option",145),n(9,"Razorpay"),t(),i(10,"option",146),n(11,"PayU"),t(),i(12,"option",147),n(13,"CCAvenue"),t(),i(14,"option",148),n(15,"Instamojo"),t(),i(16,"option",149),n(17,"Stripe"),t(),i(18,"option",150),n(19,"Other"),t()()()(),i(20,"div",17)(21,"div",25)(22,"label",26),n(23,"Gateway Transaction ID"),t(),x(24,"input",151),t()()())}function dm(a,d){a&1&&(i(0,"div",152),x(1,"i",116),i(2,"span",9),n(3,"Loading bank accounts..."),t()())}function cm(a,d){if(a&1){let e=I();i(0,"a",163),S("click",function(){let r=b(e).$implicit,c=p(2);return y(c.selectBankAccount(r))}),i(1,"span",164),n(2),t(),i(3,"small",165),n(4),t()()}if(a&2){let e=d.$implicit;l(2),f(e.bank_name),l(2),D("",e.account_name," - ",e.account_number,"")}}function pm(a,d){a&1&&(i(0,"div",166),n(1,"No saved bank accounts"),t())}function mm(a,d){if(a&1&&(i(0,"div",153)(1,"div",5)(2,"div",154)(3,"label",19)(4,"span",9),n(5,"Received in Account"),t(),i(6,"sup",20),n(7,"*"),t()(),i(8,"div",155)(9,"div",156)(10,"span"),n(11),t(),x(12,"i",157),t(),i(13,"div",158),u(14,cm,5,3,"a",159)(15,pm,2,0,"div",160),t()()()(),i(16,"div",10)(17,"button",161),x(18,"i",162),n(19," Add New "),t()()()),a&2){let e=p();l(11),f(e.selectedBankAccount?e.selectedBankAccount.bank_name+" - "+e.selectedBankAccount.account_number:"Select bank account"),l(3),s("ngForOf",e.bankDetail
1s),l(),s("ngIf",!e.bankDetails.length)}}function um(a,d){if(a&1&&(i(0,"div",167)(1,"div",168)(2,"h4",169),n(3),t(),i(4,"span",170),n(5),t()(),i(6,"div",171)(7,"div",172)(8,"span",173),n(9,"Account Holder"),t(),i(10,"span",174),n(11),t()(),i(12,"div",172)(13,"span",173),n(14,"Account Number"),t(),i(15,"span",174),n(16),t()(),i(17,"div",172)(18,"span",173),n(19,"IFSC Code"),t(),i(20,"span",174),n(21),t()(),i(22,"div",172)(23,"span",173),n(24,"Branch"),t(),i(25,"span",174),n(26),t()()()()),a&2){let e=p();l(3),f(e.selectedBankAccount.bank_name),l(2),f(e.selectedBankAccount.branch_name),l(6),f(e.selectedBankAccount.account_name),l(5),f(e.selectedBankAccount.account_number),l(5),f(e.selectedBankAccount.ifsc),l(5),f(e.selectedBankAccount.branch_name)}}function _m(a,d){a&1&&(i(0,"div",175),n(1," Please select a bank account "),t())}function vm(a,d){a&1&&(i(0,"mat-option",185),x(1,"div",186),n(2," Searching... "),t())}function gm(a,d){if(a&1&&(i(0,"mat-option",187)(1,"div",188)(2,"div",189),n(3),t(),i(4,"div",190),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function fm(a,d){a&1&&(i(0,"mat-option",185),n(1,"No matches found"),t())}function hm(a,d){a&1&&(i(0,"div",122),n(1,"Customer Name is required"),t())}function xm(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",176)(2,"div",25)(3,"label",19)(4,"span",9),n(5,"Customer Name"),t(),i(6,"sup",20),n(7,"*"),t()(),i(8,"mat-form-field",177)(9,"mat-select",178,2),S("selectionChange",function(r){b(e);let c=w(10),g=p();return y(g.onSelectSellerOption(r.value,c))}),i(11,"mat-select-trigger"),n(12),t(),i(13,"div",179),S("click",function(r){return b(e),y(r.stopPropagation())}),i(14,"mat-form-field",180)(15,"input",181),S("input",function(r){b(e);let c=p();return y(c.onSearchSellers(r))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(16,vm,3,0,"mat-option",182)(17,gm,6,5,"mat-option",82)(18,fm,2,0,"mat-option",182),i(19,"mat-option",183),x(20,"i",162),n(21," Add New Customer "),t()()(),x(22,"button",184),u(23,hm,2,0,"div",24),t()()()}if(a&2){let e,o,r=p();l(9),s("value",r.customerId),l(3),m(" ",((e=r.createReceiptForm.get("sellerName"))==null?null:e.value)||"Type to search or add customer"," "),l(3),s("value",r.sellerSearchTerm),l(),s("ngIf",r.isSearchLoading),l(),s("ngForOf",r.sellerOptions),l(),s("ngIf",!r.isSearchLoading&&r.sellerSearchTerm&&r.sellerOptions.length===0),l(),s("value",r.ADD_SUPPLIER),l(4),s("ngIf",((o=r.createReceiptForm.get("sellerName"))==null?null:o.touched)&&((o=r.createReceiptForm.get("sellerName"))==null?null:o.invalid))}}function bm(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createReceiptForm.get("state"))==null?null:e.value,"")}}function ym(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.createReceiptForm.get("city"))==null?null:e.value,"")}}function Sm(a,d){if(a&1&&(i(0,"div",47)(1,"span",173),n(2,"Billing Address"),t(),i(3,"span",174),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createReceiptForm.get("customerBillingAddress"))==null?null:e.value)}}function Cm(a,d){if(a&1&&(i(0,"div",197)(1,"span",173),n(2,"Contact Name"),t(),i(3,"span",174),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createReceiptForm.get("contactName"))==null?null:e.value)}}function Em(a,d){if(a&1&&(i(0,"div",197)(1,"span",173),n(2,"Contact Number"),t(),i(3,"span",174),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createReceiptForm.get("contactPersonNumber"))==null?null:e.value)}}function Im(a,d){if(a&1&&(i(0,"div",197)(1,"span",173),n(2,"Contact Email"),t(),i(3,"span",174),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.createReceiptForm.get("contactPersonEmail"))==null?null:e.value)}}function Dm(a,d){if(a&1&&(i(0,"div",191)(1,"h4",192),n(2),t(),i(3,"p",193),n(4),u(5,bm,2,1,"ng-container",54)(6,ym,2,1,"ng-container",54),t(),x(7,"hr",194),i(8,"div",72),u(9,Sm,5,1,"div",195)(10,Cm,5,1,"div",196)(11,Em,5,1,"div",196)(12,Im,5,1,"div",196),t()()),a&2){let e,o,r,c,g,h,C,k,O=p();l(2),f((e=O.createReceiptForm.get("sellerName"))==null?null:e.value),l(2),m(" ",(o=O.createReceiptForm.get("gstNumber"))==null?null:o.value," "),l(),s("ngIf",(r=O.createReceiptForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=O.createReceiptForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=O.createReceiptForm.get("customerBillingAddress"))==null?null:g.value),l(),s("ngIf",(h=O.createReceiptForm.get("contactName"))==null?null:h.value),l(),s("ngIf",(C=O.createReceiptForm.get("contactPersonNumber"))==null?null:C.value),l(),s("ngIf",(k=O.createReceiptForm.get("contactPersonEmail"))==null?null:k.value)}}function Tm(a,d){a&1&&(i(0,"span"),n(1,"Choose file"),t())}function wm(a,d){a&1&&(i(0,"span"),n(1,"Uploading..."),t())}function Pm(a,d){if(a&1&&x(0,"app-loader",131),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}
1function Om(a,d){if(a&1){let e=I();i(0,"li",132)(1,"p",133)(2,"a",134),n(3),t(),i(4,"span",135)(5,"i",136),S("click",function(){let r=b(e).$implicit,c=p(),g=w(120);return y(c.OnClickDeleteDoc(r.name,g))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function km(a,d){a&1&&(i(0,"div",198),n(1,"Organization name is required"),t())}function Fm(a,d){a&1&&(i(0,"div",198),n(1,"Address is required"),t())}function Mm(a,d){if(a&1&&(i(0,"option",187),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function Am(a,d){a&1&&(i(0,"div",198),n(1,"State is required"),t())}function Nm(a,d){a&1&&(i(0,"div",198),n(1,"City is required"),t())}function Vm(a,d){a&1&&(i(0,"div",198),n(1,"Country is required"),t())}function Bm(a,d){a&1&&(i(0,"div",198),n(1,"Postal code must be 6 digits"),t())}function Rm(a,d){a&1&&(i(0,"div",198),n(1,"Contact name is required"),t())}function Lm(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function qm(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function Gm(a,d){if(a&1&&(i(0,"div",198),u(1,Lm,2,0,"span",54)(2,qm,2,0,"span",54),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.buyerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function Um(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function jm(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function $m(a,d){if(a&1&&(i(0,"div",198),u(1,Um,2,0,"span",54)(2,jm,2,0,"span",54),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.buyerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function zm(a,d){a&1&&(i(0,"span"),n(1,"Account number is required"),t())}function Wm(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid account number"),t())}function Qm(a,d){if(a&1&&(i(0,"div",198),u(1,zm,2,0,"span",54)(2,Wm,2,0,"span",54),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("accountNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("accountNumber"))==null||o.errors==null?null:o.errors.pattern)}}function Ym(a,d){a&1&&(i(0,"span"),n(1,"IFSC code is required"),t())}function Hm(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid IFSC code"),t())}function Km(a,d){if(a&1&&(i(0,"div",198),u(1,Ym,2,0,"span",54)(2,Hm,2,0,"span",54),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("ifsc"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("ifsc"))==null||o.errors==null?null:o.errors.pattern)}}function Zm(a,d){a&1&&(i(0,"div",198),n(1,"Account holder name is required"),t())}function Jm(a,d){a&1&&(i(0,"div",198),n(1,"Bank name is required"),t())}function Xm(a,d){a&1&&(i(0,"div",198),n(1,"Branch is required"),t())}function cn(a){document.getElementById(a)?.click()}var pn=(()=>{class a{constructor(e,o,r,c,g,h){this.fb=e,this.financeService=o,this.FinanceOrderService=r,this.notificationService=c,this.onboardingService=g,this.router=h,this.submitted=!1,this.displaySearchList=!1,this.searchList=[],this.isSearchLoading=!1,this.states=[],this.uploadedTermsDocs=[],this.bankDetails=[],this.selectedBankAccount=null,this.disabledFields=!1,this.invoiceMainId=0,this.lockedFields={},this.sellerOptions=[],this.sellerSearchTerm="",this.disableGstField=!1,this.customerId=0,this.ADD_SUPPLIER="__add_supplier__",this.buyerSubmitting=!1,this.bankSubmitting=!1,this.bankVerifying=!1,this.loadingStates={bankDetails:!1,termsDocs:!1},this.invoiceList=[],this.isInvoiceLoading=!1,this.showInvoiceDropdown=!1,this.initalizeReceiptsForm(),this.initializeBuyerForm(),this.initializeBankForm()}ngOnInit(){this.onSearchSellers({target:{value:""}}),this.getStates(),this.getInvoiceList(),this.paymentId(),this.getBankDetails()}initalizeReceiptsForm(){this.createReceiptForm=this.fb.group({receiptId:[""],receiptDate:[""],receiptType:[""],sellerName:["",E.required],gstNumber:[""],sellerAddress:[""],city:[""],state:[""],country:[""],pincode:[""],contactPersonName:[""],contactPersonNumber:[""],contactPersonEmail
1:[""],invoiceNumber:[""],invoiceDate:[""],invoiceAmount:0,receivedAmount:0,balanceAmount:0,paymentAmount:0,currency:[""],exchangeRate:0,discountsApplied:0,tax:[""],netPayableAmount:0,paymentMode:[""],bankName:[""],accountNumber:[""],ifscCode:[""],transactionReference:[""],chequeNumber:[""],chequeDate:[""],bankBranch:[""],receivedBy:[""],cardType:[""],cardTransactionId:[""],upiId:[""],upiTransactionId:[""],gatewayName:[""],gatewayTransactionId:[""],contactName:[""],contactNumber:[""],contactEmail:[""],termsandConditions:[""],customerName:[""],customerBillingAddress:[""],receivedInAccount:[""]})}get paymentMode(){return this.createReceiptForm.get("paymentMode")?.value}getBankDetails(){this.loadingStates.bankDetails=!0,this.onboardingService.bankdetailsList().subscribe({next:e=>{e.responseCode===200?this.bankDetails=e.response.list:this.notificationService.showError("Something went wrong!"),this.loadingStates.bankDetails=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.bankDetails=!1}})}selectBankAccount(e){this.selectedBankAccount=e,this.createReceiptForm.patchValue({receivedInAccount:e.account_number})}onSave(){if(this.submitted=!0,this.createReceiptForm.invalid){this.createReceiptForm.markAllAsTouched();return}if(!this.selectedBankAccount){this.notificationService.showError("Please select a bank account to receive payment.");return}let e=this.createReceiptForm.value,o={};switch(e.paymentMode){case"bankTransfer":o={bankName:e.bankName,accountNumber:e.accountNumber,ifscCode:e.ifscCode};break;case"chequeDd":o={chequeNumber:e.chequeNumber,chequeDate:e.chequeDate,bankBranch:e.bankBranch,attachments:this.uploadedTermsDocs.map(c=>c.path)};break;case"cash":o={receivedBy:e.receivedBy}
1;break;case"card":o={cardType:e.cardType,cardTransactionId:e.cardTransactionId};break;case"walletUpi":o={upiId:e.upiId,upiTransactionId:e.upiTransactionId};break;case"paymentGateway":o={gatewayName:e.gatewayName,gatewayTransactionId:e.gatewayTransactionId};break}let r={paymentId:e.receiptId,paymentDate:e.receiptDate,recordType:"SELLER",source:"MANUAL",invoiceId:this.invoiceMainId,invoiceNo:e.invoiceNumber,invoiceDate:e.invoiceDate,invoiceAmount:e.invoiceAmount,balanceAmount:e.balanceAmount,paymentMode:e.paymentMode,paymentModeDetails:o,customerName:e.customerName,customerBillingAddress:e.customerBillingAddress,terms:e.termsandConditions,attachments:this.uploadedTermsDocs.map(c=>c.path),receivedInAccount:{accountNumber:this.selectedBankAccount.account_number,accountName:this.selectedBankAccount.account_name,bankName:this.selectedBankAccount.bank_name,ifsc:this.selectedBankAccount.ifsc,branchName:this.selectedBankAccount.branch_name}};this.financeService.paymentmanualCreate(r).subscribe({next:c=>{c.responseCode===200?(this.notificationService.showSuccess("Receipt created successfully"),this.router.navigate(["finance-management/receivable-receipts"])):this.notificationService.showError(typeof c?.response=="string"&&c.response||c?.message||"Failed to create receipt")},error:c=>{this.notificationService.showError(typeof c?.error?.response=="string"&&c.error.response||c?.error?.message||"Something went wrong!")}})}paymentId(){let e={recordType:"SELLER"};this.financeService.getPaymentId(e).subscribe({next:o=>{this.createReceiptForm.patchValue({receiptId:o.response.payment_id})}})}onSearchInput(e){this.searchTex=e.target.value.toLowerCase(),this.getInvoiceList(),this.showInvoiceDropdown=!0}handleInvoiceDisplay(e){e===!1&&setTimeout(()=>{this.showInvoiceDropdown=e},200)}toggleInvoiceDropdown(){this.showInvoiceDropdown=!this.showInvoiceDropdown,this.showInvoiceDropdown&&(this.searchTex="",this.getInvoiceList(),setTimeout(()=>{this.invoiceSearchInput?.nativeElement?.focus()},50))}getInvoiceList(){this.isInvoiceLoading=!0,this.FinanceOrderService.GetInvoiceList({user_type:"SELLER",type:"INVOICE",pageLength:10,currentPage:1,status:"",search:this.searchTex}).subscribe({next:e=>{this.invoiceList=e.response.data,this.isInvoiceLoading=!1},error:e=>{this.notificationService.showError(e.error.message),this.isInvoiceLoading=!1}})}selectInvoice(e){let o={invoice_id:e.id};this.FinanceOrderService.GetInvoiceDetails(o).subscribe({next:r=>{this.invoiceDetails=r.response.data;let c=new Date(this.invoiceDetails.cdate),g=Q=>Q.toISOString().split("T")[0],h=this.invoiceDetails.buyerCompanyDetails||{},C=h.company_name||this.invoiceDetails.buyer_company_name||"",k=h.full_address||h.address||"";this.customerId=h.vendor_id||this.invoiceDetails.buyer_vendor_id||0,this.invoiceMainId=this.invoiceDetails.invoice_main_id||0,this.createReceiptForm.patchValue({invoiceNumber:this.invoiceDetails.invoice_id,invoiceAmount:this.invoiceDetails.total_amount,invoiceDate:g(c),receivedAmount:this.invoiceDetails.paid_amount,balanceAmount:this.invoiceDetails.balance_amount,sellerName:C,gstNumber:h.gst,sellerAddress:k,city:h.city,state:h.region,country:h.country_id,contactName:h.name,contactPersonNumber:h.contact_number,contactPersonEmail:h.email,customerName:C,customerBillingAddress:k,termsandConditions:this.invoiceDetails.terms}),this.disabledFields=!0;let O=this.createReceiptForm;this.lockedFields={invoiceDate:!!O.get("invoiceDate")?.value,invoiceAmount:!!O.get("invoiceAmount")?.value,receivedAmount:!!O.get("receivedAmount")?.value,balanceAmount:!!O.get("balanceAmount")?.value},this.invoiceDetails.seller_terms_and_conditions_path.forEach(Q=>{this.uploadedTermsDocs.push({name:Q.filename,path:Q.path,viewPath:Q.viewPath})})}}),this.showInvoiceDropdown=!1}searchSellers(e){if(!e||!e.target||!e.target.value){this.searchList=[],this.isSearchLoading=!1;return}this.searchText=e.target.value,this.isSearchLoading=!0;let o={currentPage:1,pageLength:10,search:this.searchText};this.financeService.sellerList(o).subscribe({next:r=>{r.responseCode===200&&(this.searchList=r.response.vendorData,this.isSearchLoading=!1)}})}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}selectSeller(e){e&&(this.customerId=e.vendorData.vendor_id||0,this.createReceiptForm.patchValue({sellerName:e.vend
1orData.company_name,gstNumber:e.vendorData.gst,sellerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vendorData.region,country:e.vendorData.country_id,customerName:e.vendorData.company_name,customerBillingAddress:e.vendorData.address}),this.disableGstField=!0,this.displaySearchList=!1)}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:this.sellerSearchTerm}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.sellerOptions=c,this.isSearchLoading=!1}}})}onSelectSellerOption(e,o){if(e===this.ADD_SUPPLIER){cn("openAddBuyerModal"),this.restoreSelectValue(o,this.customerId);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}initializeBuyerForm(){this.buyerForm=this.fb.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveBuyer(){if(this.buyerForm.invalid){this.buyerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required customer details correctly.");return}let e=this.buyerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"buyer",password:"Test@1234",is_live_user:!1};this.buyerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.buyerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Customer added successfully"),this.applyBuyerToReceipt(e,r),this.buyerForm.reset(),cn("closeAddBuyerModal")):this.notificationService.showError(r?.response||"Failed to add customer")},error:()=>{this.buyerSubmitting=!1,this.notificationService.showError("Failed to add customer. Please try again.")}})}applyBuyerToReceipt(e,o){this.customerId=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,this.createReceiptForm.patchValue({sellerName:e.organization_name,gstNumber:e.gst,sellerAddress:e.address,city:e.city,state:e.state,country:e.country_id,contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,customerName:e.organization_name,customerBillingAddress:e.address}),this.disableGstField=!0}initializeBankForm(){this.bankForm=this.fb.group({accountNumber:["",[E.required,E.pattern("^[0-9]+$")]],ifsc:["",[E.required,E.pattern("^[A-Z]{4}0[A-Z0-9]{6}$")]],accountHolder:["",[E.required]],bankName:["",[E.required]],branch:["",[E.required]]})}verifyBankAccount(){let e=this.bankForm.get("accountNumber"),o=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,""),{emitEvent:!1}),o?.setValue(String(o.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let r=e?.value,c=o?.value;if(!r||!c){e?.markAsTouched(),o?.markAsTouched(),this.notificationService.showError("Enter account number and IFSC to verify.");return}let g={name:this.bankForm.get("accountHolder")?.value||"",phone:"",account_number:r,ifsc:c};this.bankVerifying=!0,this.financeService.verifyBankAccount(g).subscribe({next:h=>{this.bankVerifying=!1,this.handleBankVerificationResult(h?.response?.data)},error:h=>{this.bankVerifying=!1;let C=h?.error?.response?.data;C?this.handleBankVerificationResult(C):this.notificationService.showError("Bank account verification failed. Please try again.")}})}handleBankVerificationResult(e){if(e?.accountStatus==="VALID"){let o=e?.data||{};this.bankForm.patchValue({accountHolder:o.nameAtBank||this.bankForm.get("accountHolder")?.value||"",bankName:o.bankName||this.bankForm.get("bankName")?.value||"",branch:o.branch||this.bankForm.get("branch")?.value||""}),this.notificationService.showSuccess(e?.message||"Bank account verified successfully.")}else this.notificationService.showError(e?.message||"Unable to verify the bank account.")}saveBankAccount(){let e=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let o=this.bankForm.get("accountNumber");if(o?.setValue(String(o.value??"").replace(/\s/g,""),{emitEvent:!1}),this.bankForm.updateValueAndValidity(),this.bankForm.invalid){this.bankForm.markAllAsTouched(),this.notificationService.showError("Please fill all required bank details correctly.");return}let r=this.bankForm.value,c={};try{c=JSON.parse(localStorage.getItem("details")||"{}")}catch{c={}}let g={org_id:c?.response?.vendor_id??null,bank_details:[{bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch,ledger_number:"",micr_code:"",account_type:"",ledger_folio_number:"",cancelled_cheque:"",is_default:"0"}]};this.bankSubmitting=!0,this.onboardingService.AddBankDetails(g).subscribe({next:h=>{this.bankSubmitting=!1,h.responseCode==200?(this.notificationService.showSuccess(h.response?.response||"Bank account added successfully"),this.selectBankAccount({bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch}
1),this.getBankDetails(),this.bankForm.reset(),cn("closeAddBankModal")):this.notificationService.showError(h.response)},error:()=>{this.bankSubmitting=!1,this.notificationService.showError("Failed to add bank account. Please try again.")}})}handleSearchDisplay(e){e===!1?setTimeout(()=>{this.displaySearchList=e},200):this.displaySearchList=e}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=o[r],g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",""),this.FinanceOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError(h.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Dt),T(z),T(H),T(Jt),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-receipt"]],viewQuery:function(o,r){if(o&1&&N(Wp,5),o&2){let c;V(c=B())&&(r.invoiceSearchInput=c.first)}},decls:297,vars:52,consts:[["docsinput",""],["invoiceSearchInput",""],["customerSelect",""],[1,"splittedCreateCardMain","mod-mat-fields"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group","invoice-select-wrapper"],[1,"mod-form-label"],[1,"text-danger"],[1,"invoice-select-trigger","form-control","d-flex","align-items-center","justify-content-between",3,"click"],[1,"uil",3,"ngClass"],["class","invoice-dropdown-panel",4,"ngIf"],["class","invalid-error","appTranslate","",4,"ngIf"],[1,"form-group"],["for","","appTranslate","",1,"mod-form-label"],["type","date","formControlName","invoiceDate","placeholder","Enter Invoice Date",1,"form-control","mod-input",3,"readOnly"],["type","number","formControlName","invoiceAmount","placeholder","Enter Invoice Amount",1,"form-control","mod-input",3,"readOnly"],["type","number","formControlName","receivedAmount","placeholder","Enter Received Amount",1,"form-control","mod-input",3,"readOnly"],["type","number","formControlName","balanceAmount","placeholder","Enter Balance Amount",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","receiptId","placeholder","Enter Receipt Id",1,"form-control","mod-input"],["type","date","formControlName","receiptDate","placeholder","Enter date",1,"form-control","mod-input"],["formControlName","paymentMode",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],["value","bankTransfer","appTranslate",""],["value","chequeDd","appTranslate",""],["value","cash","appTranslate",""],["value","card","appTranslate",""],["value","walletUpi","appTranslate",""],["value","paymentGateway","appTranslate",""],["class","row",4,"ngIf"],["class","form-control text-muted d-flex align-items-center gap-2",4,"ngIf"],["class","row align-items-end gut-row gut-3",4,"ngIf"],["class","fin-bank-card mt-3",4,"ngIf"],["class","invalid-error mt-2","appTranslate","",4,"ngIf"],["class","fin-info-block mt-2",4,"ngIf"],[1,"col-12"],["for","","appTranslate","",1,"fw-600","mod-form-label"],["rows","5","formControlName","termsandConditions","placeholder","Please enter the terms and conditions for this receipt",1,"form-control","mod-input"],[1,"col-12","col-md-4"],[1,"custom-file"],["type","file","multiple","","id","imgInp_01",1,"custom-file-input",3,"change","disabled"],["for","imgInp_01",1,"custom-file-label"],[4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],[1,"list-inline"],["class","list-inline-item","style","margin-top: 10px;",4,"ngFor","ngForOf"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/receivable-receipts","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary"],["id","addBuyerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","id","closeAddBuyerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"modal-body"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],["type","text","formControlName","organization_name","placeholder","Enter customer name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],[3,"value",4,"ngFor","ngForOf"],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addBankModal","tabindex","-1",1,"modal","fade"],[1,"modal-header","align-items-start"],[1,"d-flex","align-items-center"],[1,"fin-modal-icon"],[1,"ri-bank-line"],[1,"modal-title","mb-0"],[1,"text-muted"],["type","button","id","closeAddBankModal","data-dismiss","modal",1,"d-none"],[1,"fin-verify-box"],["type","text","formControlName","accountNumber","placeholder","Enter account number",1,"form-control","mod-input"],["type","text","formControlName","ifsc","placeholder","Enter IFSC Code",1,"form-control","mod-input"],[1,"col-12","text-center"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],[1,"row","gut-row","gut-3","mt-2"],["type","text","formControlName","accountHolder","placeholder","Enter account holder name",1,"form-control","mod-input"],["type","text","formControlName","bankName","placeholder","Enter bank name",1,"form-control","mod-input"],["type","text","formControlName","branch","placeholder","Enter branch",1,"form-control","mod-input"],[1,"invoice-dropdown-panel"],[1,"invoice-dropdown-search","p-2"],["type","text","placeholder","Search invoice...",1,"form-control","form-control-sm","mod-input",3,"input","click"],["class","invoice-dropdown-empty text-muted",4,"ngIf"],["class","invoice-dropdown-list mb-0",4,"ngIf"],[1,"invoice-dropdown-empty","text-muted"],[1,"uil","uil-spinner-alt"],[1,"invoice-dropdown-list","mb-0"],["class","invoice-dropdown-item",3,"mousedown",4,"ngFor","ngForOf"],["class","invoice-dropdown-empty text-muted","appTranslate","",4,"ngIf"],[1,"invoice-dropdown-item",3,"mousedown"],["appTranslate","",1,"invoice-dropdown-empty","text-muted"],["appTranslate","",1,"invalid-error"],["type","text","formControlName","bankName","placeholder","Enter Bank Name",1,"form-control","mod-input"],["type","number","formControlName","accountNumber","placeholder","Enter Account Number",1,"form-control","mod-input"],["type","text","formControlName","ifscCode","placeholder","Enter IFSC Code",1,"form-control","mod-input"],["type","text","formControlName","chequeNumber","placeholder","Enter Cheque/DD Number",1,"form-control","mod-input"],["type","date","formControlName","chequeDate","placeholder","Enter Date",1,"form-control","mod-input"],["type","text","formControlName","bankBranch","placeholder","Enter Bank & Branch",1,"form-control","mod-input"],["type","file","multiple","","id","imgInp_cheque",1,"custom-file-input",3,"change","disabled"],["for","imgInp_cheque",1,"custom-file-label"],["size","small",3,"isLoading","useBlockPosition"],[1,"list-inline-item",2,"margin-top","10px"],[1,"d-flex","align-items-center","mb-4","p-2","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"],[1,"ml-auto","pl-15","text-danger","cursor-pointer"],[1,"uil","uil-times-circle","font-18",3,"click"],["type","text","formControlName","receivedBy","placeholder","Enter Name",1,"form-control","mod-input"],["formControlName","cardType",1,"form-control","mod-input"],["value","credit","appTranslate",""],["value","debit","appTranslate",""],["type","text","formControlName","cardTransactionId","placeholder","Enter Transaction ID",1,"form-control","mod-input"],["type","text","formControlName","upiId","placeholder","Enter UPI ID",1,"form-control","mod-input"],["type","text","formControlName","upiTransactionId","placeholder","Enter Transaction ID",1,"form-control","mod-input"],["formControlName","gatewayName",1,"form-control","mod-input"],["value","razorpay","appTranslate",""],["value","payu","appTranslate",""],["value","ccavenue","appTranslate",""],["value","instamojo","appTranslate",""],["value","stripe","appTranslate",""],["value","other","a
1ppTranslate",""],["type","number","formControlName","gatewayTransactionId","placeholder","Enter Transaction ID",1,"form-control","mod-input"],[1,"form-control","text-muted","d-flex","align-items-center","gap-2"],[1,"row","align-items-end","gut-row","gut-3"],[1,"form-group","mb-0"],[1,"dropdown","w-100"],["data-toggle","dropdown","data-display","static",1,"form-control","fin-select-toggle","d-flex","justify-content-between","align-items-center","dropdown-toggle"],[1,"ri-arrow-down-s-line"],[1,"dropdown-menu","w-100","fin-buyer-dropdown"],["class","dropdown-item fin-buyer-item","href","javascript:void(0)",3,"click",4,"ngFor","ngForOf"],["class","dropdown-item text-muted","appTranslate","",4,"ngIf"],["type","button","data-toggle","modal","data-target","#addBankModal",1,"mod-btn","mod-btn-outline-primary"],[1,"ri-add-line"],["href","javascript:void(0)",1,"dropdown-item","fin-buyer-item",3,"click"],[1,"fin-buyer-item__name"],[1,"fin-buyer-item__meta"],["appTranslate","",1,"dropdown-item","text-muted"],[1,"fin-bank-card","mt-3"],[1,"fin-bank-card__head"],[1,"fin-bank-card__name"],[1,"fin-bank-card__city"],[1,"row","fin-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],["appTranslate","",1,"invalid-error","mt-2"],[1,"col-md-8"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or add customer",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search customer...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[1,"text-primary","fw-500",3,"value"],["type","button","id","openAddBuyerModal","data-toggle","modal","data-target","#addBuyerModal",1,"d-none"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12",4,"ngIf"],["class","col-md-4 mt-3",4,"ngIf"],[1,"col-md-4","mt-3"],[1,"invalid-error"]],template:function(o,r){if(o&1){let c=I();i(0,"main",3)(1,"div",4)(2,"div",5)(3,"h2",6)(4,"a",7),x(5,"i",8),t(),i(6,"span",9),n(7,"Add Receipt"),t()()(),x(8,"div",10),t(),i(9,"form",11),S("ngSubmit",function(){return b(c),y(r.onSave())}),i(10,"div",12)(11,"div",13)(12,"h3",14),n(13,"Invoice Details"),t()(),i(14,"div",15)(15,"div",16)(16,"div",17)(17,"div",18)(18,"label",19)(19,"span",9),n(20,"Invoice Number"),t(),i(21,"sup",20),n(22,"*"),t()(),i(23,"div",21),S("click",function(){return b(c),y(r.toggleInvoiceDropdown())}),i(24,"span"),n(25),t(),x(26,"i",22),t(),u(27,Zp,6,2,"div",23)(28,Jp,2,0,"div",24),t()(),i(29,"div",17)(30,"div",25)(31,"label",26),n(32,"Invoice Date"),t(),x(33,"input",27),t()(),i(34,"div",17)(35,"div",25)(36,"label",26),n(37,"Invoice Amount"),t(),x(38,"input",28),t()(),i(39,"div",17)(40,"div",25)(41,"label",26),n(42,"Amount Received"),t(),x(43,"input",29),t()(),i(44,"div",17)(45,"div",25)(46,"label",26),n(47,"Outstanding Balance"),t(),x(48,"input",30),t()()()()(),i(49,"div",12)(50,"div",13)(51,"h3",14),n(52,"Payment Information"),t()(),i(53,"div",15)(54,"div",16)(55,"div",17)(56,"div",25)(57,"label",26),n(58,"Receipt ID"),t(),x(59,"input",31),t()(),i(60,"div",17)(61,"div",25)(62,"label",26),n(63,"Payment Date"),t(),x(64,"input",32),t()(),i(65,"div",17)(66,"div",25)(67,"label",26),n(68," Payment Mode"),t(),i(69,"select",33)(70,"option",34),n(71,"Select Payment Mode"),t(),i(72,"option",35),n(73,"Bank Transfer"),t(),i(74,"option",36),n(75,"Cheque/DD"),t(),i(76,"option",37),n(77,"Cash"),t(),i(78,"option",38),n(79,"Card"),t(),i(80,"option",39),n(81,"Wallet/UPI"),t(),i(82,"option",40),n(83,"Payment Gateway"),t()()()()(),u(84,Xp,16,0,"div",41)(85,am,27,5,"div",41)(86,rm,6,0,"div",41)(87,lm,17,0,"div",41)(88,om,11,0,"div",41)(89,sm,25,0,"div",41),t()(),i(90,"div",12)(91,"div",13)(92,"h3",14),n(93,"Payment Receipt Details"),t()(),i(94,"div",15),u(95,dm,4,0,"div",42)(96,mm,20,3,"div",43)(97,um,27,6,"div",44)(98,_m,2,0,"div",45),t()(),i(99,"div",12)(100,"div",13)(101,"h3",14),n(102,"Customer Details"),t()(),i(103,"div",15),u(104,xm,24,8,"div",41)(105,Dm,13,8,"div",46),t()(),i(106,"div",12)(107,"div",13)(108,"h3",14),n(109,"Attachments & Notes"),t()(),i(110,"div",15)(111,"div",16)(112,"div",47)(113,"div",25)(114,"label",48),n(115,"Terms & Conditions:"),t(),x(116,"textarea",49),t()(),i(117,"div",50)(118,"div",51)(119,"input",52,0),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(121,"label",53),u(122,Tm,2,0,"span",54)(123,wm,2,0,"span",54),t(),u(124,Pm,1,2,"app-loader",55),t()(),i(125,"div",47)(126,"ul",56),u(127,Om,6,2,"li",57),t()()()()(),i(128,"div",58)(129,"div",59)(130,"div",60)(131,"button",61),n(132,"Cancel"),t(),i(133,"button",62),n(134,"Save"),t()()()()(),i(135,"div",63)(136,"div",64)(137,"div",65)(138,"div",66)(139,"h5",67),n(140,"Add New Customer"),t(),x(141,"button",68),i(142,"button",69),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(143,"\xD7"),t()(),i(144,"form",70)(145,"div",71)(146,"div",72)(147,"div",73)(148,"label",19),n(149,"Customer Name / Company Name "),i(150,"sup",20),n(151,"*"),t()(),x(152,"input",74),u(153,km,2,0,"div",75),t(),i(154,"div",73)(155,"label",19),n(156,"GST"),t(),x(157,"input",76),t(),i(158,"div",73)(159,"label",19),n(160,"PAN"),t(),x(161,"input",77),t()(),i(162,"h3",78),n(163,"Billing address"),t(),i(164,"div",72)(165,"div",47)(166,"label",19),n(167,"Address "),i(168,"sup",20),n(169,"*"),t()(),x(170,"input",79),u(171,Fm,2,0,"div",75),t(),i(172,"div",73)(173,"label",19),n(174,"State "),i(175,"sup",20),n(176,"*"),t()(),i(177,"select",80)(178,"o
1ption",81),n(179,"Select State"),t(),u(180,Mm,2,2,"option",82),t(),u(181,Am,2,0,"div",75),t(),i(182,"div",73)(183,"label",19),n(184,"City "),i(185,"sup",20),n(186,"*"),t()(),x(187,"input",83),u(188,Nm,2,0,"div",75),t(),i(189,"div",73)(190,"label",19),n(191,"Country "),i(192,"sup",20),n(193,"*"),t()(),i(194,"select",84)(195,"option",81),n(196,"Select Country"),t(),i(197,"option",85),n(198,"India"),t()(),u(199,Vm,2,0,"div",75),t(),i(200,"div",73)(201,"label",19),n(202,"Postal Code"),t(),x(203,"input",86),u(204,Bm,2,0,"div",75),t()(),i(205,"h3",78),n(206,"Contact Details"),t(),i(207,"div",72)(208,"div",73)(209,"label",19),n(210,"Contact Name "),i(211,"sup",20),n(212,"*"),t()(),x(213,"input",87),u(214,Rm,2,0,"div",75),t(),i(215,"div",73)(216,"label",19),n(217,"Phone No. "),i(218,"sup",20),n(219,"*"),t()(),x(220,"input",88),u(221,Gm,3,2,"div",75),t(),i(222,"div",73)(223,"label",19),n(224,"Email Id "),i(225,"sup",20),n(226,"*"),t()(),x(227,"input",89),u(228,$m,3,2,"div",75),t()()(),i(229,"div",90)(230,"button",91),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(231,"Cancel"),t(),i(232,"button",92),S("click",function(){return b(c),y(r.saveBuyer())}),n(233),t()()()()()(),i(234,"div",93)(235,"div",64)(236,"div",65)(237,"div",94)(238,"div",95)(239,"span",96),x(240,"i",97),t(),i(241,"div")(242,"h5",98),n(243,"Add New bank details"),t(),i(244,"small",99),n(245,"Verify using Account No. & IFSC"),t()()(),x(246,"button",100),i(247,"button",69),S("click",function(){return b(c),y(r.bankForm.reset())}),n(248,"\xD7"),t()(),i(249,"form",70)(250,"div",71)(251,"div",101)(252,"div",72)(253,"div",73)(254,"label",19),n(255,"Account Number "),i(256,"sup",20),n(257,"*"),t()(),x(258,"input",102),u(259,Qm,3,2,"div",75),t(),i(260,"div",73)(261,"label",19),n(262,"IFSC Code "),i(263,"sup",20),n(264,"*"),t()(),x(265,"input",103),u(266,Km,3,2,"div",75),t(),i(267,"div",104)(268,"button",105),S("click",function(){return b(c),y(r.verifyBankAccount())}),n(269),t()()()(),i(270,"div",106)(271,"div",73)(272,"label",19),n(273,"Account Holder Name "),i(274,"sup",20),n(275,"*"),t()(),x(276,"input",107),u(277,Zm,2,0,"div",75),t(),i(278,"div",73)(279,"label",19),n(280,"Bank Name "),i(281,"sup",20),n(282,"*"),t()(),x(283,"input",108),u(284,Jm,2,0,"div",75),t(),i(285,"div",73)(286,"label",19),n(287,"Branch "),i(288,"sup",20),n(289,"*"),t()(),x(290,"input",109),u(291,Xm,2,0,"div",75),t()()(),i(292,"div",90)(293,"button",91),S("click",function(){return b(c),y(r.bankForm.reset())}),n(294,"Cancel"),t(),i(295,"button",92),S("click",function(){return b(c),y(r.saveBankAccount())}),n(296),t()()()()()()()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce;l(4),s("backButtonFallback","/finance-management/receivable-receipts"),l(5),s("formGroup",r.createReceiptForm),l(15),re
1("text-muted",!((c=r.createReceiptForm.get("invoiceNumber"))!=null&&c.value)),l(),m(" ",((g=r.createReceiptForm.get("invoiceNumber"))==null?null:g.value)||"Select Invoice Number"," "),l(),s("ngClass",r.showInvoiceDropdown?"uil-angle-up":"uil-angle-down"),l(),s("ngIf",r.showInvoiceDropdown),l(),s("ngIf",((h=r.createReceiptForm.get("invoiceNumber"))==null?null:h.touched)&&((h=r.createReceiptForm.get("invoiceNumber"))==null?null:h.invalid)),l(5),s("readOnly",r.lockedFields.invoiceDate),l(5),s("readOnly",r.lockedFields.invoiceAmount),l(5),s("readOnly",r.lockedFields.receivedAmount),l(5),s("readOnly",r.lockedFields.balanceAmount),l(36),s("ngIf",r.paymentMode==="bankTransfer"),l(),s("ngIf",r.paymentMode==="chequeDd"),l(),s("ngIf",r.paymentMode==="cash"),l(),s("ngIf",r.paymentMode==="card"),l(),s("ngIf",r.paymentMode==="walletUpi"),l(),s("ngIf",r.paymentMode==="paymentGateway"),l(6),s("ngIf",r.loadingStates.bankDetails),l(),s("ngIf",!r.loadingStates.bankDetails),l(),s("ngIf",r.selectedBankAccount),l(),s("ngIf",r.submitted&&!r.selectedBankAccount),l(6),s("ngIf",!r.disabledFields),l(),s("ngIf",(C=r.createReceiptForm.get("sellerName"))==null?null:C.value),l(14),s("disabled",r.loadingStates.termsDocs),l(3),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(3),s("ngForOf",r.uploadedTermsDocs),l(17),s("formGroup",r.buyerForm),l(9),s("ngIf",((k=r.buyerForm.get("organization_name"))==null?null:k.touched)&&((k=r.buyerForm.get("organization_name"))==null?null:k.invalid)),l(18),s("ngIf",((O=r.buyerForm.get("address"))==null?null:O.touched)&&((O=r.buyerForm.get("address"))==null?null:O.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((Q=r.buyerForm.get("state"))==null?null:Q.touched)&&((Q=r.buyerForm.get("state"))==null?null:Q.invalid)),l(7),s("ngIf",((G=r.buyerForm.get("city"))==null?null:G.touched)&&((G=r.buyerForm.get("city"))==null?null:G.invalid)),l(11),s("ngIf",((X=r.buyerForm.get("country_id"))==null?null:X.touched)&&((X=r.buyerForm.get("country_id"))==null?null:X.invalid)),l(5),s("ngIf",((pe=r.buyerForm.get("postal_code"))==null?null:pe.touched)&&((pe=r.buyerForm.get("postal_code"))==null?null:pe.invalid)),l(10),s("ngIf",((Y=r.buyerForm.get("contact_name"))==null?null:Y.touched)&&((Y=r.buyerForm.get("contact_name"))==null?null:Y.invalid)),l(7),s("ngIf",((le=r.buyerForm.get("phone"))==null?null:le.touched)&&((le=r.buyerForm.get("phone"))==null?null:le.invalid)),l(7),s("ngIf",((ee=r.buyerForm.get("email"))==null?null:ee.touched)&&((ee=r.buyerForm.get("email"))==null?null:ee.invalid)),l(4),s("disabled",r.buyerSubmitting),l(),m(" ",r.buyerSubmitting?"Saving...":"Save Customer"," "),l(16),s("formGroup",r.bankForm),l(10),s("ngIf",((fe=r.bankForm.get("accountNumber"))==null?null:fe.touched)&&((fe=r.bankForm.get("accountNumber"))==null?null:fe.invalid)),l(7),s("ngIf",((oe=r.bankForm.get("ifsc"))==null?null:oe.touched)&&((oe=r.bankForm.get("ifsc"))==null?null:oe.invalid)),l(2),s("disabled",r.bankVerifying),l(),m(" ",r.bankVerifying?"Verifying...":"Verify Account"," "),l(8),s("ngIf",((te=r.bankForm.get("accountHolder"))==null?null:te.touched)&&((te=r.bankForm.get("accountHolder"))==null?null:te.invalid)),l(7),s("ngIf",((me=r.bankForm.get("bankName"))==null?null:me.touched)&&((me=r.bankForm.get("bankName"))==null?null:me.invalid)),l(7),s("ngIf",((ce=r.bankForm.get("branch"))==null?null:ce.touched)&&((ce=r.bankForm.get("branch"))==null?null:ce.invalid)),l(4),s("disabled",r.bankSubmitting),l(),m(" ",r.bankSubmitting?"Saving...":"Save bank account"," ")}},dependencies:[rt,nt,J,W,Ee,It,Mt,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Ot,kt,Ft,bt,Z,De,L,We,Qe],styles:[".form-group[_ngcontent-%COMP%], .invoice-select-wrapper[_ngcontent-%COMP%]{position:relative}.invoice-select-trigger[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;background-color:#fff;min-height:calc(1.5em + .75rem + 2px);height:auto}.invoice-select-trigger[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.invoice-select-trigger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:18px;color:#6c757d;flex-shrink:0;margin-left:8px;transition:transform .2s ease}.invoice-select-trigger[_ngcontent-%COMP%]:hover{border-color:#80bdff}.invoice-select-trigger[_ngcontent-%COMP%]:focus{outline:none;border-color:#80bdff;box-shadow:0 0 0 .2rem #007bff40}.invoice-dropdown-panel[_ngcontent-%COMP%]{position:absolute;z-index:1050;width:100%;background:#fff;border:1px solid #ced4da;border-radius:4px;box-shadow:0 4px 12px #0000001f;margin-top:2px;top:100%;left:0}.invoice-dropdown-search[_ngcontent-%COMP%]{border-bottom:1px solid #e9ecef}.invoice-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;font-size:13px}.invoice-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{box-shadow:none;border-color:#80bdff}.invoice-dropdown-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;max-height:220px;overflow-y:auto}.invoice-dropdown-list[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px}.invoice-dropdown-list[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1}.invoice-dropdown-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ced4da;border-radius:4px}.invoice-dropdown-item[_ngcontent-%COMP%]{padding:8px 12px;cursor:pointer;font-size:14px;transition:background-color .15s ease}.invoice-dropdown-item[_ngcontent-%COMP%]:hover{background-color:#f0f4ff;color:var(--theme-color, #3c57a6)}.invoice-dropdown-item[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f5f5f5}.invoice-dropdown-empty[_ngcontent-%COMP%]{padding:10px 12px;font-size:13px;text-align:center;color:#6c757d}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;
1color:#777;font-size:13px}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.fin-bank-card[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden;border:1px solid #f1e0d9}.fin-bank-card__head[_ngcontent-%COMP%]{background:var(--theme-bg-light);padding:14px 18px}.fin-bank-card__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;margin:0;color:#000}.fin-bank-card__city[_ngcontent-%COMP%]{font-size:13px;color:#777}.fin-bank-card__body[_ngcontent-%COMP%]{padding:16px 18px}.fin-modal-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:8px;background:var(--theme-bg-light);margin-right:12px}.fin-modal-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:var(--theme-primary, #6b2f1a)}.fin-verify-box[_ngcontent-%COMP%]{border:1px solid #ececec;border-radius:8px;padding:18px;margin-bottom:8px}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}"]})}}return a})();function eu(a,d){a&1&&(i(0,"span"),x(1,"i",39),i(2,"span",7),n(3,"Print"),t()())}function tu(a,d){a&1&&(i(0,"span")(1,"div",40)(2,"span",41),n(3,"Loading..."),t()(),i(4,"span",7),n(5,"Printing..."),t()())}function iu(a,d){if(a&1&&(i(0,"div",17)(1,"h6",18),n(2,"Bank Account"),t(),i(3,"p",19),n(4),t()()),a&2){let e=p();l(4),f(e.receiptDetails.bank_account||(e.receiptDetails.bank_details==null?null:e.receiptDetails.bank_details.account_number)||"--")}}function nu(a,d){if(a&1&&(i(0,"div",17)(1,"h6",18),n(2,"Bank Name"),t(),i(3,"p",19),n(4),t()()),a&2){let e=p();l(4),f(e.receiptDetails.bank_name||(e.receiptDetails.bank_details==null?null:e.receiptDetails.bank_details.bank_name)||"--")}}function au(a,d){a&1&&(i(0,"li",42)(1,"p",43),n(2,"No Attachments"),t()())}function ru(a,d){if(a&1&&(i(0,"li",42)(1,"p",44)(2,"a",45),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.url,q),l(),f(e.name)}}function lu(a,d){a&1&&(i(0,"div",54)(1,"span",55),n(2,"Loading..."),t()())}function ou(a,d){if(a&1){let e=I();i(0,"div",46)(1,"div",47)(2,"div",48)(3,"button",49),S("click",function(){b(e);let r=p(),c=w(126);return y(r.rejectReceipt(c))}),x(4,"i",50),i(5,"span",7),n(6,"Reject"),t()(),i(7,"button",51),S("click",function(){b(e);let r=p();return y(r.approveReceipt())}),u(8,lu,3,0,"div",52),x(9,"i",53),i(10,"span",7),n(11,"Approve"),t()()()()()}if(a&2){let e=p();l(3),s("disabled",e.isLoading),l(4),s("disabled",e.isLoading),l(),s("ngIf",e.isLoading)}}function su(a,d){a&1&&(i(0,"div",54)(1,"span",55),n(2,"Loading..."),t()())}function du(a,d){if(a&1){let e=I();i(0,"div",56)(1,"div",57)(2,"div",58)(3,"h4",59),n(4,"Reject Receipt"),t(),i(5,"button",60),S("click",function(){b(e);let r=p();return y(r.onClickCloseDialog())}),n(6,"\xD7"),t()(),i(7,"div",61)(8,"div",62)(9,"label",63),n(10,"Reason"),t(),i(11,"textarea",64),ve("ngModelChange",function(r){b(e);let c=p();return _e(c.remarks,r)||(c.remarks=r),y(r)}),t()(),i(12,"div",65)(13,"button",66),S("click",function(){b(e);let r=p();return y(r.onClickCloseDialog())}),n(14,"Cancel"),t(),i(15,"button",67),S("click",function(){b(e);let r=p();return y(r.confirmRejectReceipt())}),u(16,su,3,0,"div",52),i(17,"span",7),n(18,"Reject Receipt"),t()()()()()()}if(a&2){let e=p();l(11),ue("ngModel",e.remarks),l(4),s("disabled",e.isLoading||e.remarks.trim().length==0),l(),s("ngIf",e.isLoading)}}var Oa=(()=>{class a{constructor(e,o,r,c){this.financeService=e,this.route=o,this.dialog=r,this.notificationService=c,this.receiptDetails={},this.receiptAttachments=[],this.isLoading=!1,this.isPrintLoading=!1,this.remarks="",this.actionCompleted=!1,this.detailsLoaded=!1}get canTakeAction(){if(!this.detailsLoaded||this.actionCompleted)return!1;let e=(this.receiptDetails.status_code||this.receiptDetails.status||"").toLowerCase().replace(/ /g,"_");return e==="payment_initiated"||e==="initiated"||e==="pending"}ngOnInit(){this.receiptId=this.route.snapshot.paramMap.get("id"),this.getReceiptDetails()}getReceiptDetails(){let e={payment_id:this.receiptId,type:"SELLER"};this.financeService.paymentDetails(e).subscribe(o=>{this.receiptDetails=o.response||{},this.detailsLoaded=!0,this.receiptAttachments=(o.response?.attachments||[]).map(r=>({name:(r.document_path||"").split("/").pop()||r.document_path,url:r.document_ViewPath}))})}printDocument(){this.isPrintLoading=!0,this.financeService.printPdf("PAYMENT",Number(this.receiptId),"SELLER").subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1,this.notificationService.showError("Failed to print the receipt document.")}})}approveReceipt(){this.updateReceiptStatus("approve")}rejectReceipt(e){this.remarks="",this.dialogRef=this.dialog.open(e,{panelClass:"reject-modal"})}confirmRejectReceipt(){this.updateReceiptStatus("reject",this.remarks)}updateReceiptStatus(e,o){this.isLoading=!0;let r={transaction_id:Number(this.receiptId),status_type:e};o&&(r.reason=o),this.financeService.updatePaymentStatus(r).subscribe({next:c=>{this.isLoading=!1,c.responseCode==200?(this.notificationService.showSuccess("Receipt "+(e=="approve"?"approved":"rejected")+" successfully"),this.dialogRef?.close(),this.actionCompleted=!0,this.getReceiptDetails()):this.notificationService.showError(c.response?.message||"Failed to update receipt status")},error:c=>{this.isLoading=!1,this.notificationService.showError(c?.error?.message||"Something went wrong!")}})}onClickCloseDialog(){this.dialogRef?.close()}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Ae),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receipt-details"]],decls:127,vars:36,consts:[["rejectDialog",""],[1,"splittedCreateCardMain","debit-note-details-main"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"create-debit-note-form"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-4"],[1,"col-md-6","col-xl-4"],["appTranslate","",1,"finance-note-label"],[1,"finance-note-value"],["class","col-md-6 col-xl-4",4,"ngIf"],[1,"badge","badge-green-s","commonBadge","py-2","px-4"],[1,"fw-600","mb-1"],[1,"text-secondary"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"finance-note-value","mb-0"],[1,"list-inline","mb-0"],["class","list-inline-item mt-2",4,"ngIf"],["class","list-inline-item mt-2",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"card-footer"],["class","splittedCreateCardMain--floatSaveBar",4,"ngIf"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],[1,"sr-only"],[1,"list-inline-item","mt-2"],["appTranslate","",1,"finance-note-value","text-muted"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button",1,"mod-btn","mod-btn-outline-danger","mr-2",3,"click","disabled"],[1,"uil","uil-times-circle"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["class","spinner-border mr-1 w-h-1rem","role","status",4,"ngIf"],[1,"uil","uil-check-circle"],["role","status",1,"spinner-border","mr-1","w-h-1rem"],["appTranslate","",1,"sr-only"],[1,"w-480px"],[1,"modal-content"],[1,"modal-header"],["appTranslate","",1,"modal-title","fw-600","font-14","text-danger"],["type","button","data-dismiss","modal",1,"close",3,"click"],[1,"modal-body"],[1,"form-group"],["appTranslate","",1,"font-14-i","fw-600"],["rows","5","placeholder"," Write Text Here",1,"form-control",3,"ngModelChange","ngModel"],[1,"text-right"],["type","button","data-dismiss","modal","a
1ppTranslate","",1,"mod-btn","mod-btn-soft-primary","btn-sm","mr-2",3,"click"],["type","button",1,"mod-btn","mod-btn-danger","btn-sm",3,"click","disabled"]],template:function(o,r){if(o&1){let c=I();i(0,"main",1)(1,"div",2)(2,"div",3)(3,"h2",4)(4,"a",5),x(5,"i",6),t(),i(6,"span",7),n(7,"Receipt Details"),t()()(),i(8,"div",8)(9,"button",9),S("click",function(){return b(c),y(r.printDocument())}),u(10,eu,4,0,"span",10)(11,tu,6,0,"span",10),t()()(),i(12,"form",11)(13,"div",12)(14,"div",13)(15,"h3",14),n(16,"Receipt Details"),t()(),i(17,"div",15)(18,"div",16)(19,"div",17)(20,"h6",18),n(21,"Invoice Number"),t(),i(22,"p",19),n(23),t()(),i(24,"div",17)(25,"h6",18),n(26,"PO Number"),t(),i(27,"p",19),n(28),t()(),i(29,"div",17)(30,"h6",18),n(31,"Invoice Amount"),t(),i(32,"p",19),n(33),_(34,"currencyFormat"),t()(),i(35,"div",17)(36,"h6",18),n(37,"Received Amount"),t(),i(38,"p",19),n(39),_(40,"currencyFormat"),t()(),i(41,"div",17)(42,"h6",18),n(43,"Receipt Date"),t(),i(44,"p",19),n(45),t()(),i(46,"div",17)(47,"h6",18),n(48,"Payment Mode"),t(),i(49,"p",19),n(50),t()(),i(51,"div",17)(52,"h6",18),n(53,"Transaction ID"),t(),i(54,"p",19),n(55),t()(),u(56,iu,5,1,"div",20)(57,nu,5,1,"div",20),i(58,"div",17)(59,"h6",18),n(60,"Source"),t(),i(61,"p",19),n(62),_(63,"titlecase"),t()(),i(64,"div",17)(65,"h6",18),n(66,"Status"),t(),i(67,"p",19)(68,"span",21),n(69),t()()()()()(),i(70,"div",12)(71,"div",13)(72,"h3",14),n(73,"Address Details"),t()(),i(74,"div",15)(75,"p",22)(76,"span",7),n(77,"Customer Name : "),t(),i(78,"span",23),n(79),t()(),i(80,"p",22)(81,"span",7),n(82,"Billing Address :"),t(),i(83,"span",23),n(84),t()()()(),i(85,"div",24)(86,"div",25)(87,"div",26)(88,"div",13)(89,"h3",14),n(90,"Additional Details"),t()(),i(91,"div",15)(92,"h5",18),n(93,"Terms and Conditions:"),t(),i(94,"p",27),n(95),t(),x(96,"br"),i(97,"h5",18),n(98,"Attachments:"),t(),i(99,"ul",28),u(100,au,3,0,"li",29)(101,ru,4,2,"li",30),t()()()(),i(102,"div",31)(103,"div",32)(104,"div",33)(105,"ul",34)(106,"li",35)(107,"span",7),n(108,"Invoice Amount :"),t(),i(109,"span",36),n(110),_(111,"currencyFormat"),t()(),i(112,"li",35)(113,"span",7),n(114,"Received Amount :"),t(),i(115,"span",36),n(116),_(117,"currencyFormat"),t()()()(),i(118,"div",37)(119,"span",7),n(120,"Total Remaining Amount : "),t(),i(121,"span",36),n(122),_(123,"currencyFormat"),t()()()()(),u(124,ou,12,3,"div",38),t(),u(125,du,19,3,"ng-template",null,0,P),t()}o&2&&(l(4),s("backButtonFallback","/finance-management/receivable-receipts"),l(5),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(12),f(r.receiptDetails.invoice_number||"--"),l(5),f(r.receiptDetails.po_number||"--"),l(5),f(r.receiptDetails.invoice_amount?v(34,24,r.receiptDetails.invoice_amount):"--"),l(6),f(r.receiptDetails.amount?v(40,26,r.receiptDetails.amount):"--"),l(6),f(r.receiptDetails.receipt_date||r.receiptDetails.payment_date||"--"),l(5),f(r.receiptDetails.payment_mode||"--"),l(5),f(r.receiptDetails.transaction_id||"--"),l(),s("ngIf",(r.receiptDetails.payment_mode||"").toLowerCase()!=="manual"),l(),s("ngIf",(r.receiptDetails.payment_mode||"").toLowerCase()!=="manual"),l(5),f(v(63,28,r.receiptDetails.po_source)||"--"),l(7),f(r.receiptDetails.status||"--"),l(10),f(r.receiptDetails.customer_name||r.receiptDetails.buyer_name||"--"),l(5),f((r.receiptDetails.billing_address==null?null:r.receiptDetails.billing_address.full_address)||(r.receiptDetails.billing_address!=null&&r.receiptDetails.billing_address.street?(r.receiptDetails.billing_address==null?null:r.receiptDetails.billing_address.street)+", "+((r.receiptDetails.billing_address==null?null:r.receiptDetails.billing_address.city)||"")+", "+((r.receiptDetails.billing_address==null?null:r.receiptDetails.billing_address.region)||"")+" - "+((r.receiptDetails.billing_address==null?null:r.receiptDetails.billing_address.postcode)||""):"--")),l(11),m("",r.receiptDetails.terms_and_conditions||r.receiptDetails.notes||"--"," "),l(5),s("ngIf",!r.receiptAttachments||r.receiptAttachments.length===0),l(),s("ngForOf",r.receiptAttachments),l(9),f(r.receiptDetails.invoice_amount?v(111,30,r.receiptDetails.invoice_amount):"--"),l(6),f(r.receiptDetails.amount?v(117,32,r.receiptDetails.amount):"--"),l(6),f(r.receiptDetails.invoice_balance!=null?v(123,34,r.receiptDetails.invoice_balance):"--"),l(2),s("ngIf",r.canTakeAction))},dependencies:[J,W,Oe,Ne,Pe,Ie,Pt,qt,Z,L,Rt,ae],styles:[".finance-note-bottom-border[_ngcontent-%COMP%]{border-bottom:1px solid #dedede;padding-bottom:3rem;margin-bottom:3rem}.finance-detail-titles[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:600;color:#343a40!important;font-size:1.2rem}"]})}}return a})();var cu=["poNumberTemplate"],pu=["invoiceIdTemplate"],mu=["sourceIdTemplate"],uu=["totalAmountTemplate"],_u=["statusTemplate"],vu=["actionsTemplate"],gu=()=>["/finance-management/payable-purchase-orders/create"],fu=()=>["/finance-management/payable-work-orders/create"];function hu(a,d){if(a&1){let e=I();i(0,"div",22)(1,"button",23),S("click",function(){b(e);let r=p();return y(r.downloadTemplate())}),x(2,"i",24),i(3,"span",25),n(4,"Download Template"),t()(),i(5,"div",26)(6,"button",27),x(7,"i",28),i(8,"span",25),n(9,"Create New"),t()(),i(10,"div",29)(11,"button",30),x(12,"i",31),i(13,"span",25),n(14,"Create PO"),t()(),i(15,"button",30),x(16,"i",31),i(17,"span",25),n(18,"Create WO"),t()(),i(19,"button",32),S("click",function(){b(e);let r=p();return y(r.bulkupload())}),x(20,"i",33),i(21,"span",25),n(22,"Import PO"),t()()()()()}a&2&&(l(11),s("routerLink",Ce(2,gu)),l(4),s("routerLink",Ce(3,fu)))}function xu(a,d){if(a&1){let e=I();
1i(0,"button",34),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.id,r.source))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function bu(a,d){if(a&1){let e=I();i(0,"button",36),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.onSourceClick(r))}),n(1),t()}if(a&2){let e=p().$implicit;s("title",e.display_source_id),l(),m(" ",e.display_source_id||"-"," ")}}function yu(a,d){if(a&1&&n(0),a&2){let e=p().$implicit;f(e.display_source_id||"-")}}function Su(a,d){if(a&1&&u(0,bu,2,2,"button",35)(1,yu,1,1,"ng-template",null,6,P),a&2){let e=d.$implicit,o=w(2);s("ngIf",e.source_id&&((e.source||"").toLowerCase()==="rfq"||(e.source||"").toLowerCase()==="auction"))("ngIfElse",o)}}function Cu(a,d){if(a&1){let e=I();i(0,"button",34),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=p().$implicit;l(),m(" ",e.invoice_id," ")}}function Eu(a,d){a&1&&n(0,"-")}function Iu(a,d){if(a&1&&u(0,Cu,2,1,"button",37)(1,Eu,1,0,"ng-template",null,7,P),a&2){let e=d.$implicit,o=w(2);s("ngIf",e.invoice_id)("ngIfElse",o)}}function Du(a,d){if(a&1&&(i(0,"div",40)(1,"ul",41)(2,"li")(3,"span",42),n(4,"Gross Total:"),t(),i(5,"span"),n(6),_(7,"numFormat"),t()(),i(8,"li")(9,"span",42),n(10,"Discount:"),t(),i(11,"span"),n(12),_(13,"numFormat"),t()(),i(14,"li")(15,"span",42),n(16,"Net Total:"),t(),i(17,"span"),n(18),_(19,"numFormat"),t()(),i(20,"li")(21,"span",42),n(22,"GST:"),t(),i(23,"span"),n(24),_(25,"numFormat"),t()(),i(26,"li")(27,"span",42),n(28,"Logistics:"),t(),i(29,"span"),n(30),_(31,"numFormat"),t()(),i(32,"li")(33,"span",42),n(34,"Insurance:"),t(),i(35,"span"),n(36),_(37,"numFormat"),t()(),i(38,"li")(39,"span",42),n(40,"Additional Charges:"),t(),i(41,"span"),n(42),_(43,"numFormat"),t()(),i(44,"li")(45,"span",42),n(46,"Total Payable:"),t(),i(47,"span"),n(48),_(49,"numFormat"),t()()()()),a&2){let e=p().$implicit,o=p();l(6),f(U(7,8,e.gross_total,o.kpiCurrency(e))),l(6),m("- ",U(13,11,e.discount_amount,o.kpiCurrency(e)),""),l(6),f(U(19,14,e.net_amount,o.kpiCurrency(e))),l(6),m("+ ",U(25,17,e.gst_amount,o.kpiCurrency(e)),""),l(6),m("+ ",U(31,20,e.logistics_charges,o.kpiCurrency(e)),""),l(6),m("+ ",U(37,23,e.insurance_charges,o.kpiCurrency(e)),""),l(6),m("+ ",U(43,26,e.additional_charges_amount,o.kpiCurrency(e)),""),l(6),f(U(49,29,e.total_amount,o.kpiCurrency(e)))}}function Tu(a,d){if(a&1&&(i(0,"span",38),n(1),_(2,"numFormat"),u(3,Du,50,32,"ng-template",null,8,P),x(5,"i",39),t()),a&2){let e=d.$implicit,o=w(4),r=p();l(),m(" ",U(2,2,e.total_amount,r.kpiCurrency(e))," "),l(4),s("ngbPopover",o)}}function wu(a,d){if(a&1&&(i(0,"span",43),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function Pu(a,d){if(a&1){let e=I();i(0,"button",50),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteAsn(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",25),n(4,"Delete"),t()()}}function Ou(a,d){if(a&1){let e=I();i(0,"button",44),x(1,"i",45),t(),i(2,"mat-menu",46,9)(4,"button",47),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.id,r.source))}),i(5,"mat-icon",48),n(6,"visibility"),t(),i(7,"span",25),n(8,"View PO"),t()(),u(9,Pu,5,0,"button",49),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var ka=(()=>{class a{constructor(e,o,r,c,g,h){this.oService=e,this.router=o,this.snackBar=r,this.dialog=c,this.notificationService=g,this.cService=h,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.orderType="PO",this.accessList=[],this.accessActions={},this.toolTipContent=Ze}downloadTemplate(){this.oService.getPoUploadTemplate().subscribe({next:e=>this.saveTemplateResponse(e,"po_upload_template.xlsx"),error:()=>this.notificationService.showError("Failed to download template")})}saveTemplateResponse(e,o){let r=e?.body??e,c=o,g=e?.headers?.get?.("content-disposition")?.match(/filename="(.+)"/);g?.[1]&&(c=g[1]);let h=window.URL.createObjectURL(r),C=document.createElement("a");C.href=h,C.download=c,document.body.appendChild(C),C.click(),document.body.removeChild(C),window.URL.revokeObjectURL(h)}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.cService.getModuleWiseUserAccess({modules:["order_management"],userType:"BUYER"}).subscribe(e=>{this.accessActions=e?.response?.order_management?.actions||{}}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"custom",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"po_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Seller",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Seller"}},{key:"qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-purchase-orders",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"PO-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,display_source_id:this.sourceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}onSourceClick(e){let o=(e?.source||"").toLowerCase();e?.source_id&&(o==="rfq"?this.router.navigate(["/rfq/buyer/rfq-details/"+e.source_id]):o==="auction"&&this.router.navigate(["/buyer-auction/buyer-auction-details/"+e.source_id]))}kpiCurrency(e){return e?.currency?e.currency:String(e?.title??"").toLowerCase().includes("days")?"":"INR"}checkAccess(e){return!0}getAdditionalCharges(e){let o=e?.additional_charges;if(Array.isArray(o))return o;if(typeof o=="string")try{let r=JSON.parse(o);return Array.isArray(r)?r:[]}catch{return[]}return[]}getAdditionalChargeLabel(e,o){return e?.description||e?.charge_name||e?.name||`Additional Charge ${o+1}`}getAdditionalChargeAmount(e){return e==null?0:typeof e=="number"||typeof e=="string"?Number(e)||0:Number(e.amount??e.charge_amount??e.value??0)||0}getAdditionalChargesTotal(e){return this.getAdditionalCharges(e).reduce((o,r)=>o+this.getAdditionalChargeAmount(r),0)}onDataRequest(e){if(!this.checkAccess("po_view"))return;
1this.lastRequestParams=e,this.isLoading=!0;let o={userType:"BUYER",perPage:e.pageLength,pageNumber:e.currentPage,status:"0",search:e.search||"",orderType:this.orderType};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getPolist(o).subscribe({next:r=>{this.tableData=[...r.response?.data||[]],console.log(this.tableData),this.pageLength=r.response?.total_count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}deleteAsn(e){let o={doc_type:"PO",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r?.responseCode===200&&(this.notificationService.showSuccess("Purchase Order deleted successfully"),this.lastRequestParams&&this.onDataRequest(this.lastRequestParams))},error:r=>{this.notificationService.showError(r.error?.message||"Failed to delete PO")}})}onExportRequest(e){let o={user_type:"BUYER",type:"PO",search:"",file_type:e.fileType,columns:e.columns},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportPOList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_po_list.pdf":"payable_po_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onOrderTypeChange(e){this.orderType=e;
1let o=this.lastRequestParams||{};this.onDataRequest(j(A({},o),{currentPage:1,pageLength:o.pageLength||this.tableConfig?.pagination?.pageSize||10,search:o.search||""}))}onPoClick(e,o,r){if(!o)return;let c=e==="po_generated"&&r==="Manual"?"po_sent":e,g=Nt.buyer.po[c]||"finance-management/payable-purchase-orders/view";this.router.navigate([g],{queryParams:{id:o,poId:o}})}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.buyer[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}bulkupload(){this.dialog.open(Kt,{data:{type:"Finance_Management_po",role:"BUYER"},width:"50%",panelClass:"custom-dialog-container"})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(Ae),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payable-purchase-orders"]],viewQuery:function(o,r){if(o&1&&(N(cu,7),N(pu,7),N(mu,7),N(uu,7),N(_u,7),N(vu,7)),o&2){let c;V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.sourceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:27,vars:8,consts:[["poNumberTemplate",""],["sourceIdTemplate",""],["invoiceIdTemplate",""],["totalAmountTemplate",""],["statusTemplate",""],["actionsTemplate",""],["plainSourceId",""],["noInvoice",""],["GrossTotalPopContent",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto"],[1,"form-control","mod-input",2,"min-width","190px",3,"ngModelChange","ngModel"],["value","PO","appTranslate",""],["value","WO","appTranslate",""],["class","col-md-auto d-flex justify-content-end align-items-center",4,"ngIf"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","refresh","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],["type","button",1,"mod-btn","mod-btn-outline-primary","mr-3",3,"click"],[1,"ri-table-2","mr-2"],["appTranslate",""],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],["type","button","matTooltipPosition","above",1,"dropdown-item",3,"click"],[1,"ri-import-line","font-18","pr-2"],["type","button",1,"mod-btn-action",3,"click"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["type","button",1,"mod-btn-action",3,"click","title"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],[1,"d-inline-flex","align-items-center","text-nowrap"],["container","body","placement","auto","triggers","mouseenter:mouseleave",1,"ri-information-2-line","cursor-pointer","ml-1",3,"ngbPopover"],[1,"grossTotalPopContent"],[1,"list-unstyled"],["appTranslate","",1,"ml-0","pl-0","font-weight-normal"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",10)(1,"div",11)(2,"div",12)(3,"h2",13),n(4,"Purchase Orders"),t()(),i(5,"div",14)(6,"select",15),ve("ngModelChange",function(h){return b(c),_e(r.orderType,h)||(r.orderType=h),y(h)}),S("ngModelChange",function(h){return b(c),y(r.onOrderTypeChange(h))}),i(7,"option",16),n(8,"Purchase Orders"),t(),i(9,"option",17),n(10,"Work Orders"),t()()(),u(11,hu,23,4,"div",18),t(),i(12,"div",19)(13,"div",20)(14,"data-table",21),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("exportRequest",function(h){return b(c),y(r.onExportRequest(h))})("refresh",function(){return b(c),y(r.onDataRequest(r.lastRequestParam
1s))}),t()()(),u(15,xu,2,1,"ng-template",null,0,P)(17,Su,3,2,"ng-template",null,1,P)(19,Iu,3,2,"ng-template",null,2,P)(21,Tu,6,5,"ng-template",null,3,P)(23,wu,2,3,"ng-template",null,4,P)(25,Ou,10,2,"ng-template",null,5,P),t()}if(o&2){let c=w(26);l(6),ue("ngModel",r.orderType),l(5),s("ngIf",r.accessActions==null?null:r.accessActions.create_po),l(3),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,He,Ke,Ye,Pe,Pt,Se,L,Le,ai]})}}return a})();var At=class{};var Vt=class{};var Si=class{};var Xi=class{},en=class{};var xt=class{};var ku=["financeDrawer"];function Fu(a,d){a&1&&(i(0,"div",140),n(1,"PO No. is required"),t())}function Mu(a,d){a&1&&(i(0,"div",140),n(1,"PO creation date cannot be after expiry date"),t())}function Au(a,d){a&1&&(i(0,"div",140),n(1,"PO expiry date cannot be before creation date"),t())}function Nu(a,d){a&1&&(i(0,"mat-option",141),x(1,"div",142),n(2," Searching... "),t())}function Vu(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function Bu(a,d){a&1&&(i(0,"mat-option",141),n(1,"No matches found"),t())}function Ru(a,d){a&1&&(i(0,"div",140),n(1,"Seller Name is required"),t())}function Lu(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("state"))==null?null:e.value,"")}}function qu(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("city"))==null?null:e.value,"")}}function Gu(a,d){if(a&1&&(i(0,"div",155)(1,"span",153),n(2,"Shipping From"),t(),i(3,"span",154),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.purchaseOrderForm.get("sellerAddress"))==null?null:e.value)}}function Uu(a,d){if(a&1&&(i(0,"div",147)(1,"h4",148),n(2),t(),i(3,"p",149),n(4),u(5,Lu,2,1,"ng-container",51)(6,qu,2,1,"ng-container",51),t(),x(7,"hr",150),i(8,"div",20),u(9,Gu,5,1,"div",151),i(10,"div",152)(11,"span",153),n(12,"City"),t(),i(13,"span",154),n(14),t()(),i(15,"div",152)(16,"span",153),n(17,"State"),t(),i(18,"span",154),n(19),t()(),i(20,"div",152)(21,"span",153),n(22,"Country"),t(),i(23,"span",154),n(24),t()()()()),a&2){let e,o,r,c,g,h,C,k,O=p();l(2),f((e=O.purchaseOrderForm.get("sellerName"))==null?null:e.value),l(2),m(" ",(o=O.purchaseOrderForm.get("gstNumber"))==null?null:o.value," "),l(),s("ngIf",(r=O.purchaseOrderForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=O.purchaseOrderForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=O.purchaseOrderForm.get("sellerAddress"))==null?null:g.value),l(5),f(((h=O.purchaseOrderForm.get("city"))==null?null:h.value)||"--"),l(5),f(((C=O.purchaseOrderForm.get("state"))==null?null:C.value)||"--"),l(5),f(((k=O.purchaseOrderForm.get("country"))==null?null:k.value)||"--")}}function ju(a,d){a&1&&x(0,"input",160)}function $u(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),m(" - ",e.email,"")}}function zu(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),u(6,$u,2,1,"ng-container",51),t()()()),a&2){let e=d.$implicit;s("value",e.id),l(3),f(e.name),l(2),m(" ",e.phone,""),l(),s("ngIf",e.email)}}function Wu(a,d){a&1&&(i(0,"mat-option",141),n(1,"No users found"),t())}function Qu(a,d){if(a&1){let e=I();i(0,"mat-form-field",40)(1,"mat-select",161,6),S("selectionChange",function(r){b(e);let c=w(2),g=p(2);return y(g.onSelectContactOption(r.value,c))}),i(3,"mat-select-trigger"),n(4),t(),i(5,"div",42),S("click",function(r){return b(e),y(r.stopPropagation())}),i(6,"mat-form-field",43)(7,"input",162),S("input",function(r){b(e);let c=p(2);return y(c.onContactSearch(r.target.value))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(8,zu,7,4,"mat-option",46)(9,Wu,2,0,"mat-option",45),i(10,"mat-option",47),x(11,"i",48),n(12," Add User "),t()()(),x(13,"button",163)}if(a&2){let e,o=p(2);l(),s("value",o.selectedContactUserId),l(3),m(" ",((e=o.purchaseOrderForm.get("contactName"))==null?null:e.value)||"Type to search or select contact"," "),l(3),s("value",o.contactSearch),l(),s("ngForOf",o.filteredContactUsers),l(),s("ngIf",!o.filteredContactUsers.length),l(),s("value",o.ADD_CONTACT)}}function Yu(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function Hu(a,d){a&1&&(i(0,"span"),n(1,"Contact number should contain up to 10 digits"),t())}function Ku(a,d){if(a&1&&(i(0,"div",164),u(1,Yu,2,0,"span",51)(2,Hu,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonNumber"))==null||o.errors==null)&&o.errors.required))}}function Zu(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function Ju(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email address"),t())}function Xu(a,d){if(a&1&&(i(0,"div",164),u(1,Zu,2,0,"span",51)(2,Ju,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonEmail"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonEmail"))==null||o.errors==null)&&o.errors.required))}}function e1(a,d){if(a&1){let e=I();F(0),i(1,"div",16)(2,"div",17)(3,"h3",156),n(4,"Contact Details "),i(5,"sup",24),n(6,"*"),t()()(),i(7,"div",19)(8,"div",20)(9,"div",21)(10,"div",22)(11,"label",39),n(12,"Contact Name "),i(13,"sup",24),n(14,"*"),t()(),u(15,ju,1,0,"input",157)(16,Qu,14,6,"ng-template",null,5,P),t()(),i(18,"div",21)(19,"div",22)(20,"label",39),n(21,"Phone No. "),i(22,"sup",24),n(23,"*"),t()(),i(24,"input",158),S("input",function(){b(e);let r=p();return y(r.onContactPhoneInput())}),t(),u(25,Ku,3,2,"div",115),t()(),i(26,"div",21)(27,"div",22)(28,"label",39),n(29,"Email "),i(30,"sup",24),n(31,"*"),t()(),x(32,"input",159),u(33,Xu,3,2,"div",115),t()()()()(),M()}
1if(a&2){let e,o,r=w(17),c=p();l(15),s("ngIf",c.newSellerAdded)("ngIfElse",r),l(9),s("readOnly",c.contactPhoneLocked),l(),s("ngIf",((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.touched)&&((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.invalid)),l(7),s("readOnly",c.contactEmailLocked),l(),s("ngIf",((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.touched)&&((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.invalid))}}function t1(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname)+" - "+(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].city)," ")}}function i1(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function n1(a,d){a&1&&(i(0,"mat-option",141),n(1,"No addresses found"),t())}function a1(a,d){if(a&1&&(i(0,"div",165),x(1,"i",166),i(2,"div")(3,"span",167),n(4),t(),i(5,"span",168),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname),l(2),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].full_address)}}function r1(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname)+" - "+(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].city)," ")}}function l1(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function o1(a,d){a&1&&(i(0,"mat-option",141),n(1,"No addresses found"),t())}function s1(a,d){if(a&1&&(i(0,"div",165),x(1,"i",166),i(2,"div")(3,"span",167),n(4),t(),i(5,"span",168),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname),l(2),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].full_address)}}function d1(a,d){if(a&1){let e=I();i(0,"button",169),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(1,"i",48),i(2,"span",13),n(3,"Add Product"),t()()}}function c1(a,d){if(a&1){let e=I();i(0,"div",170)(1,"p",171),n(2,"Add products to purchase order"),t(),i(3,"button",172),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(4,"i",48),n(5," Add Product "),t()()}}function p1(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),t(),i(7,"td"),n(8),_(9,"currencyFormat"),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td",176)(18,"a",177),S("click",function(){let r=b(e).index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(19,"i",178),t(),i(20,"a",179),S("click",function(){let r=b(e).index,c=p(2);return y(c.requestDeleteProduct(r))}),x(21,"i",180),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.productName),l(2),f(e.skuId||"-"),l(2),f(e.quantity),l(2),f(v(9,7,e.unitPrice)),l(3),m("",e.discount,"%"),l(2),m("",e.tax,"%"),l(2),f(v(16,9,e.totalPayable))}}function m1(a,d){if(a&1&&(i(0,"div",173)(1,"table",174)(2,"thead")(3,"tr")(4,"th",13),n(5,"Product/service Name"),t(),i(6,"th",13),n(7,"SKU"),t(),i(8,"th",13),n(9,"Quantity"),t(),i(10,"th",13),n(11,"Quoted Price/Unit"),t(),i(12,"th",13),n(13,"Discount"),t(),i(14,"th",13),n(15,"GST Rate"),t(),i(16,"th",13),n(17,"Total Amount"),t(),x(18,"th"),t()(),i(19,"tbody"),u(20,p1,22,11,"tr",175),t()()()),a&2){let e=p();l(20),s("ngForOf",e.productFormValues)}}function u1(a,d){a&1&&(i(0,"div",181),n(1," At least one product is required. "),t())}function _1(a,d){if(a&1){let e=I();i(0,"div",182)(1,"button",183),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",184),t(),i(3,"span",185),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function v1(a,d){if(a&1){let e=I();i(0,"button",183),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",184),t()}}function g1(a,d){if(a&1){let e=I();i(0,"button",195),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",196),t()}}function f1(a,d){if(a&1){let e=I();i(0,"div",186)(1,"div",187)(2,"label",77),n(3,"Description"),t(),x(4,"textarea",188),t(),i(5,"div",187)(6,"label",77),n(7,"Amount"),t(),i(8,"input",189),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",190)(10,"div",191)(11,"div",192),u(12,v1,2,0,"button",193)(13,g1,2,0,"button",194),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function h1(a,d){a&1&&(i(0,"span",13),n(1,"Attachments"),t())}function x1(a,d){a&1&&(i(0,"span",13),n(1,"Uploading..."),t())}function b1(a,d){if(a&1&&x(0,"app-loader",197),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function y1(a,d){if(a&1){let e=I();i(0,"span",200)(1,"a",201),n(2),t(),i(3,"i",202),S("click",function(){let r=b
1(e).$implicit,c=p(2),g=w(159);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function S1(a,d){if(a&1&&(i(0,"div",198),u(1,y1,4,2,"span",199),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function C1(a,d){a&1&&(i(0,"div",164),n(1,"Organization name is required"),t())}function E1(a,d){a&1&&(i(0,"div",164),n(1,"Address is required"),t())}function I1(a,d){if(a&1&&(i(0,"option",143),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function D1(a,d){a&1&&(i(0,"div",164),n(1,"State is required"),t())}function T1(a,d){a&1&&(i(0,"div",164),n(1,"City is required"),t())}function w1(a,d){a&1&&(i(0,"div",164),n(1,"Country is required"),t())}function P1(a,d){a&1&&(i(0,"div",164),n(1,"Postal code must be 6 digits"),t())}function O1(a,d){a&1&&(i(0,"div",164),n(1,"Contact name is required"),t())}function k1(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function F1(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function M1(a,d){if(a&1&&(i(0,"div",164),u(1,k1,2,0,"span",51)(2,F1,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.sellerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.sellerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function A1(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function N1(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function V1(a,d){if(a&1&&(i(0,"div",164),u(1,A1,2,0,"span",51)(2,N1,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.sellerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.sellerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function B1(a,d){a&1&&(i(0,"div",164),n(1,"Name is required"),t())}function R1(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function L1(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid 10-digit phone number"),t())}function q1(a,d){if(a&1&&(i(0,"div",164),u(1,R1,2,0,"span",51)(2,L1,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.userForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function G1(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function U1(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function j1(a,d){if(a&1&&(i(0,"div",164),u(1,G1,2,0,"span",51)(2,U1,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.userForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function Ii(a){document.getElementById(a)?.click()}var mn=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O,Q){this.fbs=e,this.financeService=o,this.fb=r,this.commonService=c,this.dialog=g,this.FinanceOrderService=h,this.notificationService=C,this.ref=k,this.activatedRoute=O,this.router=Q,this.states=[],this.submitted=!1,this.selectedFiles=[],this.showDropdown=!1,this.searchList=[],this.filteredSellers$=new Gi,this.sellerOptions=[],this.searchInput$=new ti,this.isSearchLoading=!1,this.disableGstField=!1,this.displaySearchList=!1,this.allowedFileTypes=[".pdf",".doc",".docx"],this.minValue=0,this.countryCode="IN",this.shippingAddressResponse=[],this.billingAddressResponse=[],this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.enableAddressSelection=!1,this.isLoading=!1,this.isAddressLoading=!1,this.sameAsShippingAddress=!1,this.formControlListeners=[],this.productFormValues=[],this.uploadedTermsDocs=[],this.selectedOption="no",this.approverPayload=[],this.prIdFromRoute=null,this.regenerateFromPoId=null,this.prefillPoData=null,this.addressDataReady=!1,this.sellerSubmitting=!1,this.sellerSearchTerm="",this.newSellerAdded=!1,this.userSubmitting=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.selectedContactUserId=null,this.shippingAddrSearch="",this.billingAddrSearch="",this.loadingStates={termsDocs:!1},this.editingProductIndex=null,this.confirmDeleteIndex=null,this.ADD_SELLER="__add_seller__",this.ADD_CONTACT="__add_contact__",this.ADD_SHIPPING_ADDRESS="__add_shipping_address__",this.ADD_BILLING_ADDRESS="__add_billing_address__",this.purchaseOrderForm=this.fbs.group({poNumber:["",E.required],poCreationDate:[""],poExpiryDate:[""],paymentMode:[""],sellerName:new _i("",[E.required]),vendorId:0,gstNumber:[""],sellerAddress:[""],city:[""],state:[""],pincode:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],country:[""],contactName:["",E.required],contactPersonNumber:["",[E.required,E.maxLength(10),E.pattern(/^\d+$/)]],contactPersonEmail
1:["",[E.required,E.email]],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fbs.array([]),totalPayableAmount:0,hasApprovers:["no"],termsandConditions:[""]},{validators:this.poDateRangeValidator}),this.generatePoForm()}sanitizeDigits(e,o){let r=String(e||"").replace(/\D/g,"");return o?r.slice(0,o):r}sanitizeAlphabetic(e){return String(e||"").replace(/[^A-Za-z ]/g,"")}poDateRangeValidator(e){let o=e.get("poCreationDate")?.value,r=e.get("poExpiryDate")?.value;return!o||!r?null:r<o?{poDateRange:!0}:null}get poCreationDateValue(){return this.purchaseOrderForm?.get("poCreationDate")?.value||""}get poExpiryDateValue(){return this.purchaseOrderForm?.get("poExpiryDate")?.value||""}get isPoDateRangeInvalid(){return!!this.purchaseOrderForm?.errors?.poDateRange}limitPositiveNumber(e,o){let r=this.purchaseOrderForm.get(e);if(!r)return;let c=this.sanitizeDigits(r.value,o);r.value!==c&&r.setValue(c,{emitEvent:!1})}limitAlphabetic(e){let o=this.purchaseOrderForm.get(e);if(!o)return;let r=this.sanitizeAlphabetic(o.value);o.value!==r&&o.setValue(r,{emitEvent:!1})}ngOnInit(){this.onSearchSellers({target:{value:""}}
1),this.getAddressData(),this.getStates(),this.initializeAddProductForm(),this.initializeSellerForm(),this.initializeUserForm(),this.activatedRoute.queryParams.subscribe(e=>{e.regenerateFromPoId&&(this.regenerateFromPoId=e.regenerateFromPoId,this.fetchAndPrefillPO(this.regenerateFromPoId))})}requestDeleteProduct(e){this.confirmDeleteIndex=e,Ii("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null),Ii("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,Ii("closeDeleteConfirmModal")}calculateSummary(){let e=C=>Math.round((Number(C)||0)*100+Number.EPSILON)/100,o=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal,0));this.purchaseOrderForm.patchValue({grossTotal:o},{emitEvent:!1});let r=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal*k.discount/100,0));this.purchaseOrderForm.patchValue({discount:r},{emitEvent:!1});let c=e(this.productFormValues.reduce((C,k)=>C+(k.grossTotal-k.grossTotal*k.discount/100)*k.tax/100,0));this.purchaseOrderForm.patchValue({taxes:c},{emitEvent:!1});let g=e(o-r);this.purchaseOrderForm.patchValue({netTotal:g},{emitEvent:!1});let h=e(g+c+this.getAdditionalCharges);this.purchaseOrderForm.patchValue({totalPayableAmount:h},{emitEvent:!1})}get additionalChargesArray(){return this.purchaseOrderForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.additionalChargesArray;return!e||e.length===0?0:e.controls.reduce((o,r)=>o+(Number(r.get("amount")?.value)||0),0)}addAdditionalCharge(){this.purchaseOrderForm.get("additionalCharges").push(this.fbs.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.purchaseOrderForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}initializeAddProductForm(){this.formControlListeners.push(this.purchaseOrderForm.valueChanges.subscribe(()=>this.calculateSummary()))}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.calculateSummary()}resetForm(){this.purchaseOrderForm.reset(),this.GeneratePoForm.reset(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingAddrSearch="",this.billingAddrSearch="",this.sellerSearchTerm="",this.filteredSellers$=ui([]),this.sellerOptions=[],this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newSellerAdded=!1,this.selectedContactUserId=null,this.disableGstField=!1,this.productFormValues=[],this.uploadedTermsDocs=[],this.editingProductIndex=null,this.confirmDeleteIndex=null,this.calculateSummary(),this.ref.detectChanges(),this.submitted=!1}onSave(){if(this.submitted=!0,this.purchaseOrderForm.markAllAsTouched(),this.purchaseOrderForm.invali
1d)return;let e={};try{e=JSON.parse(localStorage.getItem("userDetails")||"{}")}catch{e={}}let o={po_number:this.purchaseOrderForm.value.poNumber,po_creation_date:this.purchaseOrderForm.value.poCreationDate,po_expiry_date:this.purchaseOrderForm.value.poExpiryDate,payment_mode:this.purchaseOrderForm.value.paymentMode,seller_name:this.purchaseOrderForm.value.sellerName,vendor_id:this.purchaseOrderForm.value.vendorId,seller_gst:this.purchaseOrderForm.value.gstNumber,seller_address:this.purchaseOrderForm.value.sellerAddress,city:this.purchaseOrderForm.value.city,state:this.purchaseOrderForm.value.state,pincode:this.purchaseOrderForm.value.pincode,country:this.purchaseOrderForm.value.country,user_type:"BUYER",contact_name:this.purchaseOrderForm.value.contactName,contact_number:this.purchaseOrderForm.value.contactPersonNumber,contact_email:this.purchaseOrderForm.value.contactPersonEmail,terms:this.purchaseOrderForm.value.termsandConditions,terms_document_path:[],shipping_address:this.selectedShippingAddress[0]?.entity_id,billing_address:this.selectedBillingAddress[0]?.entity_id,items:[],additional_charges:[...this.purchaseOrderForm.value.additionalCharges],approvalUsers:[],total_payable_amount:this.purchaseOrderForm.value.totalPayableAmount,po_required:1,is_qa_required:"NO",buyer_organization_id:e?.vendorId??null,buyer_user_id:e?.userId??null,seller_organization_id:this.purchaseOrderForm.value.vendorId||null,seller_user_id:this.selectedContactUserId??null};o.terms_document_path=this.uploadedTermsDocs.map(r=>({path:r.path,filename:r.name})),o.items=this.productFormValues.map(r=>A({product_name:r.productName,product_id:r.parentId??r.productId,qty:r.quantity,unit_price:r.unitPrice,discount_percentage:r.discount,gst_percentage:r.tax,sku:r.skuId||"",selected_options:r.selectedConfigOptions||[]},r.isTemp&&{is_temp_product:!0,category:r.category,sub_category:r.subCategory,product_group:r.productGroup,sub_product_group:r.subProductGroup})),o.approvalUsers=this.approverPayload.map(r=>({customer_id:r.customer_id,level:r.level})),this.financeService.pomanualCreate(o).subscribe({next:r=>{r.responseCode===200?(this.notificationService.showSuccess("Purchase Order created successfully"),this.router.navigate(["finance-management/payable-purchase-orders"])):this.notificationService.showError(r.response||"Failed to create Purchase Order")},error:r=>{let c=r?.error?.response;this.notificationService.showError(typeof c=="string"&&c?c:"Failed to create Purchase Order. Please try again.")}})}onOptionChange(e){this.selectedOption=e,this.purchaseOrderForm.get("hasApprovers").setValue(e)}onApproversChange(e){this.approverPayload=e,this.prResponse.approve_users=e.map(o=>j(A({},o),{status:"A"}))}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:e.target.value}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.filteredSellers$=ui(c),this.sellerOptions=c,this.isSearchLoading=!1}}})}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}selectSeller(e){if(!e)return this.removeSeller();this.purchaseOrderForm.patchValue({sellerName:e.vendorData.company_name,vendorId:e.vendorData.vendor_id,gstNumber:e.vendorData.gst,sellerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vend
1orData.region,country:e.vendorData.country_id}),this.disableGstField=!0,this.displaySearchList=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newSellerAdded=!1,this.selectedContactUserId=null,this.getContactUsers()}removeSeller(){this.purchaseOrderForm.patchValue({sellerName:"",gstNumber:"",sellerAddress:"",city:"",state:"",country:""})}onSelectSellerOption(e,o){if(e===this.ADD_SELLER){Ii("openAddSellerModal"),this.restoreSelectValue(o,this.purchaseOrderForm.get("vendorId")?.value);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}onSelectContactOption(e,o){if(e===this.ADD_CONTACT){this.openAddContactUser(),Ii("openAddContactUserModal"),this.restoreSelectValue(o,this.selectedContactUserId);return}let r=this.contactUsers.find(c=>c.id===e);r&&this.selectContactUser(r)}onSelectShippingAddress(e,o){if(e===this.ADD_SHIPPING_ADDRESS){this.setAddAddressMode("shipping",!0),this.restoreSelectValue(o,this.selectedShippingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"shipping")}onSelectBillingAddress(e,o){if(e===this.ADD_BILLING_ADDRESS){this.setAddAddressMode("billing",!0),this.restoreSelectValue(o,this.selectedBillingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"billing")}initializeSellerForm(){this.sellerForm=this.fbs.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveSeller(){if(this.sellerForm.invalid){this.sellerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required seller details correctly.");return}let e=this.sellerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"seller",password:"Test@1234",is_live_user:!1};this.sellerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.sellerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Seller added successfully"),this.applySellerToPo(e,r),this.sellerForm.reset(),Ii("closeAddSellerModal")):this.notificationService.showError(r?.response||"Failed to add seller")},error:()=>{this.sellerSubmitting=!1,this.notificationService.showError("Failed to add seller. Please try again.")}})}applySellerToPo(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,c=o?.response?.user?.id??null;this.purchaseOrderForm.patchValue({sellerName:e.organization_name,gstNumber:e.gst,sellerAddress:e.address,city:e.city,state:e.state,country:e.country_id,pincode:this.sanitizeDigits(e.postal_code,6),contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,vendorId:r}),this.selectedContactUserId=c,this.disableGstField=!0,this.contactUsers=[],this.contactSearch="",this.newSellerAdded=!0,this.contactUserSelected=!0,this.contactPhoneLocked=!0,this.contactEmailLocked=!0;let g=this.purchaseOrderForm.get("contactPersonNumber");g?.setValidators([E.required]),g?.updateValueAndValidity({emitEvent:!1}),this.getContactUsers()}get filteredContactUsers(){return this.contactUsers||[]}getOrgId(){return this.purchaseOrderForm.get("vendorId")?.value||null}getContactUsers(e="",o){let r=this.getOrgId();r&&this.financeService.userList({org_id:r,search:e}).subscribe({next:c=>{let g=c?.response?.list??[];this.contactUsers=(Array.isArray(g)?g:[]).map(h=>({id:h.id,name:h.full_name||[h.firstName,h.lastName].filter(Boolean).join(" ")||"",phone:h.phoneNumber||"",email:h.email||"",raw:h})),o?.()},error:()=>{this.contactUsers=[]}})}selectNewContactUser(e){this.getContactUsers("",()=>{let o=this.contactUsers.find(r=>e.email&&r.email&&r.email.toLowerCase()===e.email.toLowerCase()||e.phone&&r.phone&&String(r.phone)===String(e.phone));this.selectContactUser(o||{name:e.name,phone:e.phone,email:e.email})})}onContactSearch(e){this.contactSearch=e||"",this.getContactUsers(this.contactSearch)}selectContactUser(e){if(!e)return;this.selectedContactUserId=e.id??e.raw?.id??null,this.purchaseOrderForm.patchValue({contactName:e.name||"",contactPersonNumber:e.phone||this.purchaseOrderForm.get("contactPersonNumber")?.value||"",contactPersonEmail:e.email||this.purchaseOrderForm.get("contactPersonEmail")?.value||""});let o=this.purchaseOrderForm.get("contactPersonNumber");e.phone?o?.setValidators([E.required]):o?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),o?.updateValueAndValidity({emitEvent:!1}),this.contactPhoneLocked=!!e.phone,this.contactEmailLocked=!!e.email,this.contactUserSelected=!0}onContactPhoneInput(){let e=this.purchaseOrderForm.get("contactPersonNumber");e?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}initializeUserForm(){this.userForm=this.fbs.group({name:["",[E.required]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}openAddContactUser(){this.userForm?.reset()}
1saveContactUser(){if(this.userForm.invalid){this.userForm.markAllAsTouched(),this.notificationService.showError("Please fill all user details correctly.");return}let e=this.getOrgId();if(!e){this.notificationService.showError("Please select a seller first.");return}let o=this.userForm.value,r={email:o.email,phoneNumber:o.phone,firstName:o.name,org_id:e,is_live_user:!1};this.userSubmitting=!0,this.financeService.addUser(r).subscribe({next:c=>{this.userSubmitting=!1,c?.responseCode===200?(this.notificationService.showSuccess(c.response?.response||"User added successfully"),this.selectNewContactUser({name:o.name,phone:o.phone,email:o.email}),this.userForm.reset(),Ii("closeAddContactUserModal")):this.notificationService.showError(c?.response||"Failed to add user")},error:()=>{this.userSubmitting=!1,this.notificationService.showError("Failed to add user. Please try again.")}})}getAddressData(){this.isAddressLoading=!0,this.commonService.getAddressList({perPage:10,pageNumber:1}).subscribe(e=>{let o=e.total_count||0;e.po_number&&this.purchaseOrderForm.patchValue({poNumber:e.po_number}),this.shippingAddressResponse=e.response||[],this.billingAddressResponse=e.response||[],this.enableAddressSelection=!0,this.isAddressLoading=!1,this.addressDataReady=!0,this.prefillPoData&&this.applyPrefill(),o>10&&this.commonService.getAddressList({perPage:o,pageNumber:1}).subscribe(r=>{let c=r.response||[];this.shippingAddressResponse=c,this.billingAddressResponse=c})})}generatePoForm(){this.GeneratePoForm=this.fb.group({selectedSeller:[""],shippingAddress:["",E.required],billingAddress:["",E.required]})}closeOpenDropdowns(){document.querySelectorAll(".dropdown-menu.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll(".dropdown.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll('[data-toggle="dropdown"][aria-expanded="true"]').forEach(e=>e.setAttribute("aria-expanded","false"))}setAddAddressMode(e,o){this.addAddressMode=e,o&&(this.closeOpenDropdowns(),setTimeout(()=>{this.dialog.open(Ht,{data:{}}).afterClosed().subscribe(c=>{c&&(this.poRfqData?.data&&(this.addAddressMode==="shipping"&&(this.poRfqData.data.delivery_address=A({},c)),this.addAddressMode==="billing"&&(this.poRfqData.data.billing_address=A({},c))),this.getAddressData())})},0)),(!this.shippingAddressResponse.length||!this.billingAddressResponse.length)&&this.getAddressData()}filterAddresses(e){let o=this.shippingAddressResponse||[];if(!e||!e.trim())return o;let r=e.toLowerCase();return o.filter(c=>(c.firstname||"").toLowerCase().includes(r)||(c.lastname||"").toLowerCase().includes(r)||(c.full_address||"").toLowerCase().includes(r)||(c.city||"").toLowerCase().includes(r))}onSameAsShippingChange(e){this.sameAsShippingAddress=e.target.checked,this.sameAsShippingAddress?this.selectedShippingAddress?.length&&this.changeSelectedAddress(this.selectedShippingAddress[0],"billing"):(this.selectedBillingAddress=[],this.GeneratePoForm.patchValue({billingAddress:""}))}changeSelectedAddress(e,o){let r=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})];o==="shipping"&&(this.selectedShippingAddress=r,this.GeneratePoForm.patchValue({shippingAddress:String(e.entity_id)})),o==="billing"&&(this.selectedBillingAddress=r,this.GeneratePoForm.patchValue({billingAddress:String(e.entity_id)}))}selectShippingAddress(){this.poRfqData.data.delivery_address=j(A({},this.selectedShippingAddress[0]),{address_id:this.selectedShippingAddress[0].entity_id}),this.GeneratePoForm.patchValue({shippingAddress:String(this.selectedShippingAddress[0].entity_id)})}selectBillingAddress(){this.poRfqData.data.billing_address=j(A({},this.selectedBillingAddress[0]),{address_id:this.selectedBillingAddress[0].entity_id}),this.GeneratePoForm.patchValue({billingAddress:String(this.selectedBillingAddress[0].entity_id)})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=new FormData;c.append("file",o[r]),c.append("source","po"),c.append("source_id",""),this.FinanceOrderService.FileUpload(c).subscribe(g=>{g.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:g.response.file_name,path:g.response.filepath,viewPath:g.response.fileViewPath}]:this.notificationService.showError(g.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}fetchAndPrefillPO(e){let o=new xt;o.po_id=e,this.FinanceOrderService.GetPoDetails(o).subscribe({next:r=>{this.prefillPoData=r.response.data,this.addressDataReady&&this.applyPrefill()},error:()=>this.notificationService.showError("Failed to load PO details for regeneration.")})}applyPrefill(){let e=this.prefillPoData;if(!e)return;this.purchaseOrderForm.patchValue({poNumber:e.po_number,poCreationDate:e.po_date?e.po_date.split(" ")[0]:"",poExpiryDate:e.expiry_date?e.expiry_date.split(" ")[0]:"",paymentMode:this.mapPaymentMode(e.payment_mode),sellerName:e.seller_details?.company_name??"",vendorId:e.seller_vendor_id,gstNumber:e.seller_gst||(e.seller_gst_list?.[0]??""),sellerAddress:e.seller_details?.address??"",city:e.seller_details?.city??"",state:e.seller_details?.region??"",pincode:this.sanitizeDigits(e.seller_billing_address?.postcode??"",6),country:e.seller_details?.country_id??"",termsandConditions:e.terms??""}),this.disableGstField=!0,this.productFormValues=(e.items??[]).map(g=>({productName:g.product_name,productId:g.product_id,skuId:g.display_item_id||g.item_id||"",quantity:g.offered_qty??g.required_qty??0,unitPrice:g.unit_price,grossTotal:g.gross_total,discount:g.discount_percent??0,tax:g.tax_percent??0,totalPayable:g.total_amount,selectedConfigOptions:[],configurableOptionsFull:[]}));let o=this.purchaseOrderForm.get("additionalCharges");o.clear(),[{description:"Logistics",amount:e.logistics_charges},{description:"Insurance",amount:e.insurance_charges},{description:"Shipping",amount:e.shipping_charges}
1].forEach(g=>{g.amount&&o.push(this.fbs.group({description:[g.description],amount:[g.amount]}))}),this.calculateSummary();let r=(e.address??[]).find(g=>g.addressType==="shipping"),c=(e.address??[]).find(g=>g.addressType==="billing");if(r){let g=this.shippingAddressResponse.find(h=>h.entity_id==r.id);g&&this.changeSelectedAddress(g,"shipping")}if(c){let g=this.billingAddressResponse.find(h=>h.entity_id==c.id);g&&this.changeSelectedAddress(g,"billing")}}mapPaymentMode(e){return{"Bank Transfer":"bankTransfer","Online Transfer":"bankTransfer","Cheque/DD":"chequeDd",Cash:"cash",Card:"card","Wallet/UPI":"walletUpi","Payment Gateway":"paymentGateway"}[e]??""}ngOnDestroy(){this.formControlListeners.forEach(e=>e.unsubscribe())}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Dt),T(ft),T(ge),T(Ae),T(z),T(H),T(Wt),T(de),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-purchase-orders"]],viewQuery:function(o,r){if(o&1&&N(ku,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:373,vars:83,consts:[["sellerSelect",""],["shippingAddrSelect",""],["billingAddrSelect",""],["docsinput",""],["financeDrawer",""],["contactNameDropdown",""],["contactSelect",""],[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group"],["for","",1,"mod-form-label"],[1,"text-danger"],["type","text","formControlName","poNumber","placeholder","Enter PO No.",1,"form-control","mod-input"],["class","invalid-error","appTranslate","",4,"ngIf"],["for","","appTranslate","",1,"mod-form-label"],["type","date","formControlName","poCreationDate","placeholder","Enter date",1,"form-control","mod-input"],["type","date","formControlName","poExpiryDate","placeholder","Enter date",1,"form-control","mod-input"],["formControlName","paymentMode",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],["value","bankTransfer","appTranslate",""],["value","chequeDd","appTranslate",""],["value","cash","appTranslate",""],["value","card","appTranslate",""],["value","walletUpi","appTranslate",""],["value","paymentGateway","appTranslate",""],[1,"col-md-8"],[1,"mod-form-label"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or enter new seller",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search seller...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[1,"text-primary","fw-500",3,"value"],[1,"ri-add-line"],["type","button","id","openAddSellerModal","data-toggle","modal","data-target","#addSellerModal",1,"d-none"],["class","fin-info-block mt-2",4,"ngIf"],[4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"shpCard","h-100"],["appTranslate","",1,"h6","fw-600","mb-3"],["panelClass","address-select-panel no-checkmark","placeholder","Select shipping address",3,"selectionChange"],["matInput","","placeholder","Search address...",3,"input","keydown.space","click","value"],["class","mod-address-chip mt-3",4,"ngIf"],[1,"d-flex","align-items-center","mb-3"],["appTranslate","",1,"h6","fw-600","mb-0"],[1,"custom-control","custom-checkbox","fin-check","ml-4"],["type","checkbox","id","sameAsShipping",1,"custom-control-input",3,"change","checked","disabled"],["for","sameAsShipping","appTranslate","",1,"custom-control-label","mr-2"],["panelClass","address-select-panel no-checkmark","placeholder","Select Billing Address",3,"selectionChange","value","disabled"],["type","button","class","mod-btn mod-btn-outline-primary btn-sm",3,"click",4,"ngIf"],[1,"table-dashboard"],[1,"col-12","px-0"],["class","fin-empty-products text-center py-4",4,"ngIf"],["class","table-responsive mod-table-wrapper",4,"ngIf"],["class","invali
1d-error mt-2","appTranslate","",4,"ngIf"],[1,"col-12","px-0","mt-4"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"mod-card","h-100"],["appTranslate","",1,"mod-form-label"],["rows","6","formControlName","termsandConditions","placeholder","Please write T & C, if any concern in PO",1,"form-control","mod-input"],["type","file","id","poAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","poAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"list-unstyled","fin-summary"],["appTranslateText",""],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/payable-purchase-orders","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title","d-flex","align-items-center"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],["appTranslateText","",1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],["id","addSellerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-title"],["type","button","id","closeAddSellerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"modal-body"],["type","text","formControlName","organization_name","placeholder","Enter seller name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],[1,"col-12"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addContactUserModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-dialog-scrollable"],["type","button","id","closeAddContactUserModal","data-dismiss","modal",1,"d-none"],["type","text","formControlName","name","placeholder","Enter name",1,"form-control","mod-input"],["type","text","inputmode","numeric","formControlName","phone","placeholder","Enter phone number","maxlength","10",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter email id",1,"form-control","mod-input"],["moduleType","FINANCE","productType","PRODUCT",3,"productAdded"],["appTranslate","",1,"invalid-error"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12 mb-3",4,"ngIf"],[1,"col-sm-4"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"col-12","mb-3"],[1,"mod-card-title","mb-0"],["type","text","class","form-control mod-input","formControlName","contactName","readonly","",4,"ngIf","ngIfElse"],["type","text","inputmode","numeric","maxlength","10","formControlName","contactPersonNumber","placeholder","Enter Number",1,"form-control","mod-input",3,"input","readOnly"],["type","text","formControlName","contactPersonEmail","placeholder","Enter Email id",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","contactName","readonly","",1,"form-control","mod-input"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or select contact",3,"selectionChange","value"],["matInput","","placeholder","Search user...",3,"input","keydown.space","click","value"],["type","button","id","openAddContactUserModal","data-toggle","modal","data-target","#addContactUserModal",1,"d-none"],[1,"invalid-error"],[1,"mod-address-chip","mt-3"],[1,"ri-map-pin-line"],[1,"mod-address-chip__title"],[1,"mod-address-chip__addr"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"fin-empty-products","text-center","py-4"],[1,"text-muted","mb-3"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click"],[1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","table-dashboard","fin-product-table"],[4,"ngFor","ngForOf"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],["appTranslate","",1,"invalid-error","mt-2"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class","p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",7)(1,"div",8)(2,"div",9)(3,"h2",10)(4,"a",11),x(5,"i",12),t(),i(6,"span",13),n(7,"Create Purchase Order"),t()()(),x(8,"div",14),t(),i(9,"form",15),S("ngSubmit",function(){return b(c),y(r.onSave())}),i(10,"div",16)(11,"div",17)(12,"h3",18),n(13,"Purchase Order Information"),t()(),i(14,"div",19)(15,"div",20)(16,"div",21)(17,"div",22)(18,"label",23)(19,"span",13),n(20,"PO No."),t(),i(21,"sup",24),n(22,"*"),t()(),x(23,"input",25),u(24,Fu,2,0,"div",26),t()(),i(25,"div",21)(26,"div",22)(27,"label",27),n(28,"PO Creation Date"),t(),x(29,"input",28),u(30,Mu,2,0,"div",26),t()(),i(31,"div",21)(32,"div",22)(33,"label",27),n(34,"PO Expiry Date"),t(),x(35,"input",29),u(36,Au,2,0,"div",26),t()(),i(37,"div",21)(38,"div",22)(39,"label",27),n(40," Payment Mode"),t(),i(41,"select",30)(42,"o
1ption",31),n(43,"Select Payment Mode"),t(),i(44,"option",32),n(45,"Bank Transfer"),t(),i(46,"option",33),n(47,"Cheque/DD"),t(),i(48,"option",34),n(49,"Cash"),t(),i(50,"option",35),n(51,"Card"),t(),i(52,"option",36),n(53,"Wallet/UPI"),t(),i(54,"option",37),n(55,"Payment Gateway"),t()()()()()()(),i(56,"div",16)(57,"div",17)(58,"h3",18),n(59,"Seller Details"),t()(),i(60,"div",19)(61,"div",20)(62,"div",38)(63,"div",22)(64,"label",39)(65,"span",13),n(66,"Seller Name"),t(),i(67,"sup",24),n(68,"*"),t()(),i(69,"mat-form-field",40)(70,"mat-select",41,0),S("selectionChange",function(h){b(c);let C=w(71);return y(r.onSelectSellerOption(h.value,C))}),i(72,"mat-select-trigger"),n(73),t(),i(74,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(75,"mat-form-field",43)(76,"input",44),S("input",function(h){return b(c),y(r.onSearchSellers(h))})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(77,Nu,3,0,"mat-option",45)(78,Vu,6,5,"mat-option",46)(79,Bu,2,0,"mat-option",45),i(80,"mat-option",47),x(81,"i",48),n(82," Add New Seller "),t()()(),x(83,"button",49),u(84,Ru,2,0,"div",26),t()()(),u(85,Uu,25,8,"div",50),t()(),u(86,e1,34,6,"ng-container",51),i(87,"div",16)(88,"div",17)(89,"h3",18),n(90,"Buyer Details"),t()(),i(91,"div",19)(92,"div",52)(93,"div",53)(94,"div",54)(95,"h4",55),n(96,"Shipping Address"),t(),i(97,"mat-form-field",40)(98,"mat-select",56,1),S("selectionChange",function(h){b(c);let C=w(99);return y(r.onSelectShippingAddress(h.value,C))}),u(100,t1,2,1,"mat-select-trigger",51),i(101,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(102,"mat-form-field",43)(103,"input",57),S("input",function(h){return b(c),y(r.shippingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(104,i1,6,4,"mat-option",46)(105,n1,2,0,"mat-option",45),i(106,"mat-option",47),x(107,"i",48),n(108," Add New Address "),t()()(),u(109,a1,7,2,"div",58),t()(),i(110,"div",53)(111,"div",54)(112,"div",59)(113,"h4",60),n(114,"Billing Address"),t(),i(115,"div",61)(116,"input",62),S("change",function(h){return b(c),y(r.onSameAsShippingChange(h))}),t(),i(117,"label",63),n(118,"Same as Shipping Address"),t()()(),i(119,"mat-form-field",40)(120,"mat-select",64,2),S("selectionChange",function(h){b(c);let C=w(121);return y(r.onSelectBillingAddress(h.value,C))}),u(122,r1,2,1,"mat-select-trigger",51),i(123,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(124,"mat-form-field",43)(125,"input",57),S("input",function(h){return b(c),y(r.billingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(126,l1,6,4,"mat-option",46)(127,o1,2,0,"mat-option",45),i(128,"mat-option",47),x(129,"i",48),n(130," Add New Address "),t()()(),u(131,s1,7,2,"div",58),t()()()()(),i(132,"div",16)(133,"div",17)(134,"h3",18),n(135,"Product Details"),t(),u(136,d1,4,0,"button",65),t(),i(137,"div",19)(138,"div",66)(139,"div",67),u(140,c1,6,0,"div",68)(141,m1,21,1,"div",69)(142,u1,2,0,"div",70),t(),i(143,"div",71),u(144,_1,5,0,"div",72),i(145,"div",73),u(146,f1,14,3,"div",74),t()()()()(),i(147,"div",75)(148,"div",38)(149,"div",76)(150,"div",17)(151,"h3",18),n(152,"Terms & Conditions"),t()(),i(153,"div",19)(154,"div",22)(155,"label",77),n(156,"Terms"),t(),x(157,"textarea",78),t(),i(158,"input",79,3),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(160,"label",80),x(161,"i",81),u(162,h1,2,0,"span",82)(163,x1,2,0,"span",82),t(),u(164,b1,1,2,"app-loader",83)(165,S1,2,1,"div",84),t()()(),i(166,"div",21)(167,"div",76)(168,"div",17)(169,"h3",18),n(170,"PO Summary"),t()(),i(171,"div",19)(172,"ul",85)(173,"li",86),n(174," Gross Total "),i(175,"span"),n(176),_(177,"currencyFormat"),t()(),i(178,"li")(179,"span",13),n(180,"Discount"),t(),i(181,"span",24),n(182),_(183,"currencyFormat"),t()(),i(184,"li",86),n(185," Net Total "),i(186,"span"),n(187),_(188,"currencyFormat"),t()(),i(189,"li",86),n(190," GST "),i(191,"span"),n(192),_(193,"currencyFormat"),t()(),i(194,"li",86),n(195," Additional Charges "),i(196,"span"),n(197),_(198,"currencyFormat"),t()()()(),i(199,"div",87),n(200," Total Payable Amou
1nt "),i(201,"span"),n(202),_(203,"currencyFormat"),t()()()()(),i(204,"div",88)(205,"div",89)(206,"div",90)(207,"button",91),n(208,"Cancel"),t(),i(209,"button",92),n(210,"Save"),t()()()()()(),x(211,"button",93)(212,"button",94),i(213,"div",95)(214,"div",96)(215,"div",97)(216,"div",98)(217,"h4",99),x(218,"i",100),i(219,"span",13),n(220,"Delete Product"),t()()(),i(221,"div",101)(222,"p",102),n(223,"Are you sure you want to delete "),i(224,"strong"),n(225),t(),n(226,"? "),t(),i(227,"p",103),n(228,"This action cannot be undone."),t()(),i(229,"div",104)(230,"button",105),S("click",function(){return b(c),y(r.cancelDelete())}),n(231,"No, Keep it"),t(),i(232,"button",106),S("click",function(){return b(c),y(r.confirmDelete())}),n(233,"Yes, Delete"),t()()()()(),i(234,"div",107)(235,"div",108)(236,"div",97)(237,"div",98)(238,"h5",109),n(239,"Add New Seller"),t(),x(240,"button",110),i(241,"button",111),S("click",function(){return b(c),y(r.sellerForm.reset())}),n(242,"\xD7"),t()(),i(243,"form",112)(244,"div",113)(245,"div",52)(246,"div",53)(247,"label",39),n(248,"Seller Name / Company Name "),i(249,"sup",24),n(250,"*"),t()(),x(251,"input",114),u(252,C1,2,0,"div",115),t(),i(253,"div",53)(254,"label",39),n(255,"GST"),t(),x(256,"input",116),t(),i(257,"div",53)(258,"label",39),n(259,"PAN"),t(),x(260,"input",117),t()(),i(261,"h3",118),n(262,"Shipping From"),t(),i(263,"div",52)(264,"div",119)(265,"label",39),n(266,"Address "),i(267,"sup",24),n(268,"*"),t()(),x(269,"input",120),u(270,E1,2,0,"div",115),t(),i(271,"div",53)(272,"label",39),n(273,"State "),i(274,"sup",24),n(275,"*"),t()(),i(276,"select",121)(277,"option",122),n(278,"Select State"),t(),u(279,I1,2,2,"option",46),t(),u(280,D1,2,0,"div",115),t(),i(281,"div",53)(282,"label",39),n(283,"City "),i(284,"sup",24),n(285,"*"),t()(),x(286,"input",123),u(287,T1,2,0,"div",115),t(),i(288,"div",53)(289,"label",39),n(290,"Country "),i(291,"sup",24),n(292,"*"),t()(),i(293,"select",124)(294,"option",122),n(295,"Select Country"),t(),i(296,"option",125),n(297,"India"),t()(),u(298,w1,2,0,"div",115),t(),i(299,"div",53)(300,"label",39),n(301,"Postal Code"),t(),x(302,"input",126),u(303,P1,2,0,"div",115),t()(),i(304,"h3",118),n(305,"Contact Details"),t(),i(306,"div",52)(307,"div",53)(308,"label",39),n(309,"Contact Name "),i(310,"sup",24),n(311,"*"),t()(),x(312,"input",127),u(313,O1,2,0,"div",115),t(),i(314,"div",53)(315,"label",39),n(316,"Phone No. "),i(317,"sup",24),n(318,"*"),t()(),x(319,"input",128),u(320,M1,3,2,"div",115),t(),i(321,"div",53)(322,"label",39),n(323,"Email Id "),i(324,"sup",24),n(325,"*"),t()(),x(326,"input",129),u(327,V1,3,2,"div",115),t()()(),i(328,"div",130)(329,"button",131),S("click",function(){return b(c),y(r.sellerForm.reset())}),n(330,"Cancel"),t(),i(331,"button",132),S("click",function(){return b(c),y(r.saveSeller())}),n(332),t()()()()()(),i(333,"div",133)(334,"div",134)(335,"div",97)(336,"div",98)(337,"h5",109),n(338,"Add User"),t(),x(339,"button",135),i(340,"button",111),S("click",function(){return b(c),y(r.userForm.reset())}),n(341,"\xD7"),t()(),i(342,"form",112)(343,"div",113)(344,"div",52)(345,"div",119)(346,"label",39),n(347,"Name "),i(348,"sup",24),n(349,"*"),t()(),x(350,"input",136),u(351,B1,2,0,"div",115),t(),i(352,"div",119)(353,"label",39),n(354,"Phone Number "),i(355,"sup",24),n(356,"*"),t()(),x(357,"input",137),u(358,q1,3,2,"div",115),t(),i(359,"div",119)(360,"label",39),n(361,"Email "),i(362,"sup",24),n(363,"*"),t()(),x(364,"input",138),u(365,j1,3,2,"div",115),t()()(),i(366,"div",130)(367,"button",131),S("click",function(){return b(c),y(r.userForm.reset())}),n(368,"Cancel"),t(),i(369,"button",132),S("click",function(){return b(c),y(r.saveContactUser())}),n(370),t()()()()()(),i(371,"app-common-bom-product-drawer",139,4),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve,qe,Ge,Ue,je;l(4),s("backButtonFallback","/finance-management/payable-purchase-orders"),l(5),s("formGroup",r.purchaseOrderForm),l(15),s("ngIf",((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.touched)&&((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.invalid)),l(5),Be("max",r.poExpiryDateValue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((g=r.purchaseOrderForm.get("poCreationDate"))==null?null:g.touched)),l(5),Be("min",r.poCreationDateV
1alue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((h=r.purchaseOrderForm.get("poExpiryDate"))==null?null:h.touched)),l(34),s("value",(C=r.purchaseOrderForm.get("vendorId"))==null?null:C.value),l(3),m(" ",((k=r.purchaseOrderForm.get("sellerName"))==null?null:k.value)||"Type to search or enter new seller"," "),l(3),s("value",r.sellerSearchTerm),l(),s("ngIf",r.isSearchLoading),l(),s("ngForOf",r.sellerOptions),l(),s("ngIf",!r.isSearchLoading&&r.sellerSearchTerm&&r.sellerOptions.length===0),l(),s("value",r.ADD_SELLER),l(4),s("ngIf",((O=r.purchaseOrderForm.get("sellerName"))==null?null:O.touched)&&((O=r.purchaseOrderForm.get("sellerName"))==null?null:O.invalid)),l(),s("ngIf",(Q=r.purchaseOrderForm.get("sellerName"))==null?null:Q.value),l(),s("ngIf",(G=r.purchaseOrderForm.get("sellerName"))==null?null:G.value),l(14),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(3),s("value",r.shippingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.shippingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.shippingAddrSearch).length),l(),s("value",r.ADD_SHIPPING_ADDRESS),l(3),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(7),s("checked",r.sameAsShippingAddress)("disabled",!r.selectedShippingAddress||r.selectedShippingAddress.length==0),l(4),s("value",(X=r.selectedBillingAddress==null||r.selectedBillingAddress[0]==null?null:r.selectedBillingAddress[0].entity_id)!==null&&X!==void 0?X:null)("disabled",r.sameAsShippingAddress),l(2),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(3),s("value",r.billingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.billingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.billingAddrSearch).length),l(),s("value",r.ADD_BILLING_ADDRESS),l(3),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(5),s("ngIf",r.productFormValues.length),l(4),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",r.productFormValues.length),l(),s("ngIf",r.submitted&&(!r.productFormValues||r.productFormValues.length===0)),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(11),f(v(177,71,(pe=r.purchaseOrderForm.get("grossTotal"))==null?null:pe.value)),l(6),m("- ",v(183,73,(Y=r.purchaseOrderForm.get("discount"))==null?null:Y.value),""),l(5),f(v(188,75,(le=r.purchaseOrderForm.get("netTotal"))==null?null:le.value)),l(5),f(v(193,77,(ee=r.purchaseOrderForm.get("taxes"))==null?null:ee.value)),l(5),f(v(198,79,r.getAdditionalCharges)),l(5),f(v(203,81,(fe=r.purchaseOrderForm.get("totalPayableAmount"))==null?null:fe.value)),l(7),s("disabled",r.purchaseOrderForm.invali
1d||!r.productFormValues||r.productFormValues.length===0),l(16),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:""),l(18),s("formGroup",r.sellerForm),l(9),s("ngIf",((oe=r.sellerForm.get("organization_name"))==null?null:oe.touched)&&((oe=r.sellerForm.get("organization_name"))==null?null:oe.invalid)),l(18),s("ngIf",((te=r.sellerForm.get("address"))==null?null:te.touched)&&((te=r.sellerForm.get("address"))==null?null:te.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((me=r.sellerForm.get("state"))==null?null:me.touched)&&((me=r.sellerForm.get("state"))==null?null:me.invalid)),l(7),s("ngIf",((ce=r.sellerForm.get("city"))==null?null:ce.touched)&&((ce=r.sellerForm.get("city"))==null?null:ce.invalid)),l(11),s("ngIf",((be=r.sellerForm.get("country_id"))==null?null:be.touched)&&((be=r.sellerForm.get("country_id"))==null?null:be.invalid)),l(5),s("ngIf",((Fe=r.sellerForm.get("postal_code"))==null?null:Fe.touched)&&((Fe=r.sellerForm.get("postal_code"))==null?null:Fe.invalid)),l(10),s("ngIf",((Me=r.sellerForm.get("contact_name"))==null?null:Me.touched)&&((Me=r.sellerForm.get("contact_name"))==null?null:Me.invalid)),l(7),s("ngIf",((Ve=r.sellerForm.get("phone"))==null?null:Ve.touched)&&((Ve=r.sellerForm.get("phone"))==null?null:Ve.invalid)),l(7),s("ngIf",((qe=r.sellerForm.get("email"))==null?null:qe.touched)&&((qe=r.sellerForm.get("email"))==null?null:qe.invalid)),l(4),s("disabled",r.sellerSubmitting),l(),m(" ",r.sellerSubmitting?"Saving...":"Save Seller"," "),l(10),s("formGroup",r.userForm),l(9),s("ngIf",((Ge=r.userForm.get("name"))==null?null:Ge.touched)&&((Ge=r.userForm.get("name"))==null?null:Ge.invalid)),l(7),s("ngIf",((Ue=r.userForm.get("phone"))==null?null:Ue.touched)&&((Ue=r.userForm.get("phone"))==null?null:Ue.invalid)),l(7),s("ngIf",((je=r.userForm.get("email"))==null?null:je.touched)&&((je=r.userForm.get("email"))==null?null:je.invalid)),l(4),s("disabled",r.userSubmitting),l(),m(" ",r.userSubmitting?"Submitting...":"Submit"," ")}},dependencies:[rt,J,W,Ee,It,Mt,Et,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Ot,gt,kt,Ft,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ae],styles:[".searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.max-w-80px[_ngcontent-%COMP%]{max-width:80px}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.min-w-154px[_ngcontent-%COMP%]{min-width:154px}.ml-20[_ngcontent-%COMP%]{margin-left:20px}.min-h-21[_ngcontent-%COMP%]{min-height:21px}.border-right-black[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.125)}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}
1.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal;cursor:pointer}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;border:1px solid #ececec;border-radius:8px;overflow:hidden;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-theme[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:18px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}"]})}}return a})();var un=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-purchase-orders-details"]],decls:2,vars:0,consts:[["appTranslate",""]],template:function(o,r){o&1&&(i(0,"p",0),n(1,"purchase-orders-details works!"),t())},dependencies:[L]})}}return a})();var $1=["poNumberTemplate"],z1=["invoiceIdTemplate"],W1=["sourceIdTemplate"],Q1=["totalAmountTemplate"],Y1=["statusTemplate"],H1=["actionsTemplate"],K1=()=>["/finance-management/receivable-purchase-orders/create"],Z1=()=>["/finance-management/receivable-work-orders/create"];function J1(a,d){if(a&1){let e=I();i(0,"div",21)(1,"button",22),S("click",function(){b(e);let r=p();return y(r.downloadTemplate())}),x(2,"i",23),i(3,"span",24),n(4,"Download Template"),t()(),i(5,"div",25)(6,"button",26),x(7,"i",27),i(8,"span",24),n(9,"Create New"),t()(),i(10,"div",28)(11,"button",29),x(12,"i",30),i(13,"span",24),n(14,"Create PO"),t()(),i(15,"button",29),x(16,"i",30),i(17,"span",24),n(18,"Create WO"),t()(),i(19,"button",31),S("click",function(){b(e);let r=p();return y(r.bulkupload())}),x(20,"i",32),i(21,"span",24),n(22,"Import PO"),t()()()()()}a&2&&(l(11),s("routerLink",Ce(2,K1)),l(4),s("routerLink",Ce(3,Z1)))}function X1(a,d){if(a&1){let e=I();i(0,"button",33),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.po_number||"-"," ")}}function e_(a,d){if(a&1){let e=I();i(0,"button",35),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.onSourceClick(r))}),n(1),t()}if(a&2){let e=p().$implicit;s("title",e.display_source_id),l(),m(" ",e.display_source_id||"-"," ")}}function t_(a,d){if(a&1&&n(0),a&2){let e=p().$implicit;f(e.display_source_id||"-")}}function i_(a,d){if(a&1&&u(0,e_,2,2,"button",34)(1,t_,1,1,"ng-template",null,6,P),a&2){let e=d.$implicit,o=w(2);s("ngIf",e.source_id&&((e.source||"").toLowerCase()==="rfq"||(e.source||"").toLowerCase()==="auction"))("ngIfElse",o)}}function n_(a,d){if(a&1){let e=I();i(0,"button",33),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onInvoiceClick(r.status_code,r.invoice_main_id,"parent"))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.invoice_id||"-"," ")}}function a_(a,d){if(a&1&&(i(0,"div",38)(1,"ul",39)(2,"li")(3,"span",40),n(4,"Gross Total:"),t(),i(5,"span"),n(6),_(7,"numFormat"),t()(),i(8,"li")(9,"span",40),n(10,"Discount:"),t(),i(11,"span"),n(12),_(13,"numFormat"),t()(),i(14,"li")(15,"span",40),n(16,"Net Total:"),t(),i(17,"span"),n(18),_(19,"numFormat"),t()(),i(20,"li")(21,"span",40),n(22,"GST:"),t(),i(23,"span"),n(24),_(25,"numFormat"),t()(),i(26,"li")(27,"span",40),n(28,"Logistics:"),t(),i(29,"span"),n(30),_(31,"numFormat"),t()(),i(32,"li")(33,"span",40),n(34,"Insurance:"),t(),i(35,"span"),n(36),_(37,"numFormat"),t()(),i(38,"li")(39,"span",40),n(40,"Total Payable:"),t(),i(41,"span"),n(42),_(43,"numFormat"),t()()()()),a&2){let e=p().$implicit,o=p();l(6),f(U(7,7,e.gross_total,o.kpiCurrency(e))),l(6),m("- ",U(13,10,e.discount_amount,o.kpiCurrency(e)),""),l(6),f(U(19,13,e.net_amount,o.kpiCurrency(e))),l(6),m("+ ",U(25,16,e.gst_amount,o.kpiCurrency(e)),""),l(6),m("+ ",U(31,19,e.logistics_charges,o.kpiCurrency(e)),""),l(6),m("+ ",U(37,22,e.insurance_charges,o.kpiCurrency(e)),""),l(6),f(U(43,25,e.total_amount,o.kpiCurrency(e)))}}function r_(a,d){if(a&1&&(i(0,"span",36),n(1),_(2,"numFormat"),u(3,a_,44,28,"ng-template",null,7,P),x(5,"i",37),t()),a&2){let e=d.$implicit,o=w(4),r=p();l(),m(" ",U(2,2,e.total_amount,r.kpiCurrency(e))," "),l(4),s("ngbPopover",o)}}function l_(a,d){if(a&1&&(i(0,"span",41),n(1),t()),a&2){let e=d.$implicit;$e("background",e.seller_color_code),l(),m(" ",e.status," ")}}function o_(a,d){if(a&1){let e=I();i(0,"button",48),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.deleteAsn(r.id))}),i(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",24),n(4,"Delete"),t()()}}function s_(a,d){if(a&1){let e=I();i(0,"button",42),x(1,"i",43),t(),i(2,"mat-menu",44,8)(4,"button",45),S("click",function(){let r=b
1(e).$implicit,c=p();return y(c.onPoClick(r.status_code,r.id))}),i(5,"mat-icon",46),n(6,"visibility"),t(),i(7,"span",24),n(8,"View PO"),t()(),u(9,o_,5,0,"button",47),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var Fa=(()=>{class a{constructor(e,o,r,c,g,h){this.oService=e,this.router=o,this.snackBar=r,this.dialog=c,this.notificationService=g,this.cService=h,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.orderType="PO",this.accessList=[],this.accessActions={},this.toolTipContent=Ze}downloadTemplate(){this.oService.getPoUploadTemplate().subscribe({next:e=>this.saveTemplateResponse(e,"po_upload_template.xlsx"),error:()=>this.notificationService.showError("Failed to download template")})}saveTemplateResponse(e,o){let r=e?.body??e,c=o,g=e?.headers?.get?.("content-disposition")?.match(/filename="(.+)"/);g?.[1]&&(c=g[1]);let h=window.URL.createObjectURL(r),C=document.createElement("a");C.href=h,C.download=c,document.body.appendChild(C),C.click(),document.body.removeChild(C),window.URL.revokeObjectURL(h)}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.cService.getModuleWiseUserAccess({modules:["order_management"],userType:"SELLER"}).subscribe(e=>{this.accessActions=e?.response?.order_management?.actions||{}}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"po_number",label:"PO ID",selected:!0,disabled:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search PO ID"}},{key:"invoice_id",label:"Invoice ID",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"source",label:"Source",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"display_source_id",label:"Source ID",selected:!0,dataType:"custom",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0}},{key:"po_date",label:"Creation Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"cdate__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"name",label:"Buyer",selected:!0,dataType:"text",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Buyer"}},{key:"location",label:"Shipping Location",selected:!0,dataType:"text",sortable:{enabled:!0}},{key:"qty",label:"Quantity",selected:!0,dataType:"number",sortable:{enabled:!0}},{key:"total_amount",label:"Total Payable",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-receivable-purchase-orders",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"PO-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={po_number:this.poNumberTemplate,invoice_id:this.invoiceIdTemplate,display_source_id:this.sourceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}onSourceClick(e){let o=(e?.source||"").toLowerCase();e?.source_id&&(o==="rfq"?this.router.navigate(["/rfq/sellers/rfq-details/"+e.source_id]):o==="auction"&&this.router.navigate(["/auction/seller-auction-details/"+e.source_id]))}checkAccess(e){return!0}onDataRequest(e){if(!this.checkAccess("po_view"))return;
1this.lastRequestParams=e,this.isLoading=!0;let o={userType:"SELLER",perPage:e.pageLength,pageNumber:e.currentPage,status:"0",search:e.search||"",orderType:this.orderType};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getPolist(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.total_count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}deleteAsn(e){let o={doc_type:"PO",doc_id:e};this.oService.onDeleteReq(o).subscribe({next:r=>{r?.responseCode===200&&(this.notificationService.showSuccess("Purchase Order deleted successfully"),this.lastRequestParams&&this.onDataRequest(this.lastRequestParams))},error:r=>{this.notificationService.showError(r.error?.message||"Failed to delete PO")}})}kpiCurrency(e){return e?.currency?e.currency:String(e?.title??"").toLowerCase().includes("days")?"":"INR"}onExportRequest(e){let o={user_type:"SELLER",type:"PO",search:"",file_type:e.fileType,columns:e.columns},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.exportPOList(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"receivable_po_list.pdf":"receivable_po_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onOrderTypeChange(e){this.orderType=e;
1let o=this.lastRequestParams||{};this.onDataRequest(j(A({},o),{currentPage:1,pageLength:o.pageLength||this.tableConfig?.pagination?.pageSize||10,search:o.search||""}))}onPoClick(e,o){if(!o)return;let r=Nt.seller.po[e]||"finance-management/receivable-purchase-orders/seller-view";this.router.navigate([r],{queryParams:{id:o,poId:o}})}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.seller[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}bulkupload(){this.dialog.open(Kt,{data:{type:"Finance_Management_po",role:"SELLER"},width:"50%",panelClass:"custom-dialog-container"})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(Ae),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-purchase-orders"]],viewQuery:function(o,r){if(o&1&&(N($1,7),N(z1,7),N(W1,7),N(Q1,7),N(Y1,7),N(H1,7)),o&2){let c;V(c=B())&&(r.poNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.sourceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:27,vars:8,consts:[["poNumberTemplate",""],["sourceIdTemplate",""],["invoiceIdTemplate",""],["totalAmountTemplate",""],["statusTemplate",""],["actionsTemplate",""],["plainSourceId",""],["GrossTotalPopContent",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto"],[1,"form-control","mod-input",2,"min-width","190px",3,"ngModelChange","ngModel"],["value","PO","appTranslate",""],["value","WO","appTranslate",""],["class","col-md-auto d-flex justify-content-end align-items-center",4,"ngIf"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","refresh","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],["type","button",1,"mod-btn","mod-btn-outline-primary","mr-3",3,"click"],[1,"ri-table-2","mr-2"],["appTranslate",""],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],["type","button","matTooltipPosition","above",1,"dropdown-item",3,"click"],[1,"ri-import-line","font-18","pr-2"],["type","button",1,"mod-btn-action",3,"click"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["type","button",1,"mod-btn-action",3,"click","title"],[1,"d-inline-flex","align-items-center","text-nowrap"],["container","body","placement","auto","triggers","mouseenter:mouseleave",1,"ri-information-2-line","cursor-pointer","ml-1",3,"ngbPopover"],[1,"grossTotalPopContent"],[1,"list-unstyled"],["appTranslate","",1,"ml-0","pl-0","font-weight-normal"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",9)(1,"div",10)(2,"div",11)(3,"h2",12),n(4,"Purchase Orders"),t()(),i(5,"div",13)(6,"select",14),ve("ngModelChange",function(h){return b(c),_e(r.orderType,h)||(r.orderType=h),y(h)}),S("ngModelChange",function(h){return b(c),y(r.onOrderTypeChange(h))}),i(7,"option",15),n(8,"Purchase Orders"),t(),i(9,"option",16),n(10,"Work Orders"),t()()(),u(11,J1,23,4,"div",17),t(),i(12,"div",18)(13,"div",19)(14,"data-table",20),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("exportRequest",function(h){return b(c),y(r.onExportRequest(h))})("refresh",function(){return b(c),y(r.onDataRequest(r.lastRequestParam
1s))}),t()()(),u(15,X1,2,1,"ng-template",null,0,P)(17,i_,3,2,"ng-template",null,1,P)(19,n_,2,1,"ng-template",null,2,P)(21,r_,6,5,"ng-template",null,3,P)(23,l_,2,3,"ng-template",null,4,P)(25,s_,10,2,"ng-template",null,5,P),t()}if(o&2){let c=w(26);l(6),ue("ngModel",r.orderType),l(5),s("ngIf",r.accessActions==null?null:r.accessActions.create_po),l(3),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,He,Ke,Ye,Pe,Pt,Se,L,Le,ai]})}}return a})();var d_=["financeDrawer"];function c_(a,d){a&1&&(i(0,"div",141),n(1,"PO No. is required"),t())}function p_(a,d){a&1&&(i(0,"div",141),n(1,"PO creation date cannot be after expiry date"),t())}function m_(a,d){a&1&&(i(0,"div",141),n(1,"PO expiry date cannot be before creation date"),t())}function u_(a,d){a&1&&(i(0,"mat-option",142),x(1,"div",143),n(2," Searching... "),t())}function __(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function v_(a,d){a&1&&(i(0,"mat-option",142),n(1,"No matches found"),t())}function g_(a,d){a&1&&(i(0,"div",141),n(1,"Buyer Name is required"),t())}function f_(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("state"))==null?null:e.value,"")}}function h_(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("city"))==null?null:e.value,"")}}function x_(a,d){if(a&1&&(i(0,"div",156)(1,"span",154),n(2,"Billing Address"),t(),i(3,"span",155),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.purchaseOrderForm.get("buyerAddress"))==null?null:e.value)}}function b_(a,d){if(a&1&&(i(0,"div",148)(1,"h4",149),n(2),t(),i(3,"p",150),n(4),u(5,f_,2,1,"ng-container",51)(6,h_,2,1,"ng-container",51),t(),x(7,"hr",151),i(8,"div",20),u(9,x_,5,1,"div",152),i(10,"div",153)(11,"span",154),n(12,"City"),t(),i(13,"span",155),n(14),t()(),i(15,"div",153)(16,"span",154),n(17,"State"),t(),i(18,"span",155),n(19),t()(),i(20,"div",153)(21,"span",154),n(22,"Country"),t(),i(23,"span",155),n(24),t()()()()),a&2){let e,o,r,c,g,h,C,k,O=p();l(2),f((e=O.purchaseOrderForm.get("buyerName"))==null?null:e.value),l(2),m(" ",(o=O.purchaseOrderForm.get("buyerGst"))==null?null:o.value," "),l(),s("ngIf",(r=O.purchaseOrderForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=O.purchaseOrderForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=O.purchaseOrderForm.get("buyerAddress"))==null?null:g.value),l(5),f(((h=O.purchaseOrderForm.get("city"))==null?null:h.value)||"--"),l(5),f(((C=O.purchaseOrderForm.get("state"))==null?null:C.value)||"--"),l(5),f(((k=O.purchaseOrderForm.get("country"))==null?null:k.value)||"--")}}function y_(a,d){a&1&&x(0,"input",161)}function S_(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),m(" - ",e.email,"")}}function C_(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),u(6,S_,2,1,"ng-container",51),t()()()),a&2){let e=d.$implicit;s("value",e.id),l(3),f(e.name),l(2),m(" ",e.phone,""),l(),s("ngIf",e.email)}}function E_(a,d){a&1&&(i(0,"mat-option",142),n(1,"No users found"),t())}function I_(a,d){if(a&1){let e=I();i(0,"mat-form-field",40)(1,"mat-select",162,6),S("selectionChange",function(r){b(e);let c=w(2),g=p(2);return y(g.onSelectContactOption(r.value,c))}),i(3,"mat-select-trigger"),n(4),t(),i(5,"div",42),S("click",function(r){return b(e),y(r.stopPropagation())}),i(6,"mat-form-field",43)(7,"input",163),S("input",function(r){b(e);let c=p(2);return y(c.onContactSearch(r.target.value))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(8,C_,7,4,"mat-option",46)(9,E_,2,0,"mat-option",45),i(10,"mat-option",47),x(11,"i",48),n(12," Add User "),t()()(),x(13,"button",164)}if(a&2){let e,o=p(2);l(),s("value",o.selectedContactUserId),l(3),m(" ",((e=o.purchaseOrderForm.get("contactName"))==null?null:e.value)||"Type to search or select contact"," "),l(3),s("value",o.contactSearch),l(),s("ngForOf",o.filteredContactUsers),l(),s("ngIf",!o.filteredContactUsers.length),l(),s("value",o.ADD_CONTACT)}}function D_(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function T_(a,d){a&1&&(i(0,"span"),n(1,"Contact number should contain up to 10 digits"),t())}function w_(a,d){if(a&1&&(i(0,"div",165),u(1,D_,2,0,"span",51)(2,T_,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonNumber"))==null||o.errors==null)&&o.errors.required))}}function P_(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function O_(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email address"),t())}function k_(a,d){if(a&1&&(i(0,"div",165),u(1,P_,2,0,"span",51)(2,O_,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonEmail"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonEmail"))==null||o.errors==null)&&o.errors.required))}}function F_(a,d){if(a&1){let e=I();F(0),i(1,"div",16)(2,"div",17)(3,"h3",157),n(4,"Contact Details "),i(5,"sup",24),n(6,"*"),t()()(),i(7,"div",19)(8,"div",20)(9,"div",21)(10,"div",22)(11,"label",39),n(12,"Contact Name "),i(13,"sup",24),n(14,"*"),t()(),u(15,y_,1,0,"input",158)(16,I_,14,6,"ng-template",null,5,P),t()(),i(18,"div",21)(19,"div",22)(20,"label",39),n(21,"Phone No. "),i(22,"sup",24),n(23,"*"),t()(),i(24,"input",159),S("input",function(){b(e);let r=p();return y(r.onContactPhoneInput())}),t(),u(25,w_,3,2,"div",116),t()(),i(26,"div",21)(27,"div",22)(28,"label",39),n(29,"Email "),i(30,"sup",24),n(31,"*"),t()(),x(32,"input",160),u(33,k_,3,2,"div",116),t()()()()(),M()}
1if(a&2){let e,o,r=w(17),c=p();l(15),s("ngIf",c.newBuyerAdded)("ngIfElse",r),l(9),s("readOnly",c.contactPhoneLocked),l(),s("ngIf",((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.touched)&&((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.invalid)),l(7),s("readOnly",c.contactEmailLocked),l(),s("ngIf",((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.touched)&&((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.invalid))}}function M_(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname)+" - "+(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].city)," ")}}function A_(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function N_(a,d){if(a&1&&(i(0,"mat-option",142),n(1),t()),a&2){let e=p();l(),f(e.isBuyerSelected?"No addresses found":"Select a buyer first")}}function V_(a,d){if(a&1&&(i(0,"div",166),x(1,"i",167),i(2,"div")(3,"span",168),n(4),t(),i(5,"span",169),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname),l(2),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].full_address)}}function B_(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname)+" - "+(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].city)," ")}}function R_(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function L_(a,d){if(a&1&&(i(0,"mat-option",142),n(1),t()),a&2){let e=p();l(),f(e.isBuyerSelected?"No addresses found":"Select a buyer first")}}function q_(a,d){if(a&1&&(i(0,"div",166),x(1,"i",167),i(2,"div")(3,"span",168),n(4),t(),i(5,"span",169),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname),l(2),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].full_address)}}function G_(a,d){if(a&1){let e=I();i(0,"button",170),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(1,"i",48),i(2,"span",13),n(3,"Add Product"),t()()}}function U_(a,d){if(a&1){let e=I();i(0,"div",171)(1,"p",172),n(2,"Add products in purchase order"),t(),i(3,"button",173),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(4,"i",48),i(5,"span",13),n(6,"Add Product"),t()()()}}function j_(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),t(),i(7,"td"),n(8),_(9,"currencyFormat"),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td",177)(18,"a",178),S("click",function(){let r=b(e).index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(19,"i",179),t(),i(20,"a",180),S("click",function(){let r=b(e).index,c=p(2);return y(c.requestDeleteProduct(r))}),x(21,"i",181),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.productName),l(2),f(e.skuId||"-"),l(2),f(e.quantity),l(2),f(v(9,7,e.unitPrice)),l(3),m("",e.discount,"%"),l(2),m("",e.tax,"%"),l(2),f(v(16,9,e.totalPayable))}}function $_(a,d){if(a&1&&(i(0,"div",174)(1,"table",175)(2,"thead")(3,"tr")(4,"th",13),n(5,"Product/service Name"),t(),i(6,"th",13),n(7,"SKU"),t(),i(8,"th",13),n(9,"Quantity"),t(),i(10,"th",13),n(11,"Quoted Price/Unit"),t(),i(12,"th",13),n(13,"Discount"),t(),i(14,"th",13),n(15,"GST Rate"),t(),i(16,"th",13),n(17,"Total Amount"),t(),x(18,"th"),t()(),i(19,"tbody"),u(20,j_,22,11,"tr",176),t()()()),a&2){let e=p();l(20),s("ngForOf",e.productFormValues)}}function z_(a,d){a&1&&(i(0,"div",182),n(1,"At least one product is required."),t())}function W_(a,d){if(a&1){let e=I();i(0,"div",183)(1,"button",184),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",185),t(),i(3,"span",186),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function Q_(a,d){if(a&1){let e=I();i(0,"button",184),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",185),t()}}function Y_(a,d){if(a&1){let e=I();i(0,"button",196),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",197),t()}}function H_(a,d){if(a&1){let e=I();i(0,"div",187)(1,"div",188)(2,"label",78),n(3,"Description"),t(),x(4,"textarea",189),t(),i(5,"div",188)(6,"label",78),n(7,"Amount"),t(),i(8,"input",190),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",191)(10,"div",192)(11,"div",193),u(12,Q_,2,0,"button",194)(13,Y_,2,0,"button",195),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function K_(a,d){a&1&&(i(0,"span",13),n(1,"Attachments"),t())}function Z_(a,d){a&1&&(i(0,"span",13),n(1,"Uploading..."),t())}function J_(a,d){if(a&1&&x(0,"app-loader",198),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function X_(a,d){if(a&1){let e=I();i(0,"span",201)(1,"a",202),n(2),t(),i(3,"i",203),S("click",function(){let r=b
1(e).$implicit,c=p(2),g=w(159);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function ev(a,d){if(a&1&&(i(0,"div",199),u(1,X_,4,2,"span",200),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function tv(a,d){a&1&&(i(0,"div",165),n(1,"Organization name is required"),t())}function iv(a,d){a&1&&(i(0,"div",165),n(1,"Address is required"),t())}function nv(a,d){if(a&1&&(i(0,"option",144),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function av(a,d){a&1&&(i(0,"div",165),n(1,"State is required"),t())}function rv(a,d){a&1&&(i(0,"div",165),n(1,"City is required"),t())}function lv(a,d){a&1&&(i(0,"div",165),n(1,"Country is required"),t())}function ov(a,d){a&1&&(i(0,"div",165),n(1,"Postal code must be 6 digits"),t())}function sv(a,d){a&1&&(i(0,"div",165),n(1,"Contact name is required"),t())}function dv(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function cv(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function pv(a,d){if(a&1&&(i(0,"div",165),u(1,dv,2,0,"span",51)(2,cv,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.buyerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function mv(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function uv(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function _v(a,d){if(a&1&&(i(0,"div",165),u(1,mv,2,0,"span",51)(2,uv,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.buyerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function vv(a,d){a&1&&(i(0,"div",165),n(1,"Name is required"),t())}function gv(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function fv(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid 10-digit phone number"),t())}function hv(a,d){if(a&1&&(i(0,"div",165),u(1,gv,2,0,"span",51)(2,fv,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.userForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function xv(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function bv(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function yv(a,d){if(a&1&&(i(0,"div",165),u(1,xv,2,0,"span",51)(2,bv,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.userForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function Di(a){document.getElementById(a)?.click()}var _n=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O){this.fbs=e,this.financeService=o,this.fb=r,this.commonService=c,this.dialog=g,this.FinanceOrderService=h,this.notificationService=C,this.ref=k,this.router=O,this.states=[],this.submitted=!1,this.selectedFiles=[],this.showDropdown=!1,this.searchList=[],this.sellerOptions=[],this.searchInput$=new ti,this.isSearchLoading=!1,this.disableGstField=!1,this.displaySearchList=!1,this.allowedFileTypes=[".pdf",".doc",".docx"],this.minValue=0,this.countryCode="IN",this.shippingAddressResponse=[],this.billingAddressResponse=[],this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.enableAddressSelection=!1,this.isLoading=!1,this.isAddressLoading=!1,this.sameAsShippingAddress=!1,this.formControlListeners=[],this.productFormValues=[],this.uploadedTermsDocs=[],this.selectedOption="no",this.approverPayload=[],this.prIdFromRoute=null,this.buyerSubmitting=!1,this.sellerSearchTerm="",this.newBuyerAdded=!1,this.userSubmitting=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.selectedContactUserId=null,this.shippingAddrSearch="",this.billingAddrSearch="",this.loadingStates={termsDocs:!1},this.editingProductIndex=null,this.confirmDeleteIndex=null,this.ADD_SUPPLIER="__add_supplier__",this.ADD_CONTACT="__add_contact__",this.ADD_SHIPPING_ADDRESS="__add_shipping_address__",this.ADD_BILLING_ADDRESS="__add_billing_address__",this.purchaseOrderForm=this.fbs.group({poNumber:["",E.required],poCreationDate:[""],poExpiryDate:[""],paymentMode:[""],buyerName:new _i("",[E.required]),vendorId:0,buyerGst:[""],buyerAddress:[""],city:[""],state:[""],pincode:[""],country:[""],contactName:["",E.required],contactPersonNumber:["",[E.required,E.maxLength(10),E.pattern(/^\d+$/)]],contactPersonEmail
1:["",[E.required,E.email]],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fbs.array([]),totalPayableAmount:0,approvalStatus:[""],approverName:[""],approvalDate:[""],termsandConditions:[""]},{validators:this.poDateRangeValidator}),this.generatePoForm()}poDateRangeValidator(e){let o=e.get("poCreationDate")?.value,r=e.get("poExpiryDate")?.value;return!o||!r?null:r<o?{poDateRange:!0}:null}get poCreationDateValue(){return this.purchaseOrderForm?.get("poCreationDate")?.value||""}get poExpiryDateValue(){return this.purchaseOrderForm?.get("poExpiryDate")?.value||""}get isPoDateRangeInvalid(){return!!this.purchaseOrderForm?.errors?.poDateRange}ngOnInit(){this.onSearchSellers({target:{value:""}}),this.getAddressData(),this.getStates(),this.initializeAddProductForm(),this.initializeBuyerForm(),this.initializeUserForm()}sanitizeDigits(e,o){let r=String(e||"").replace(/\D/g,"");return o?r.slice(0,o):r}requestDeleteProduct(e){this.confirmDeleteIndex=e,Di("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null),Di("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,Di("closeDeleteConfirmModal")}calculateSummary(){let e=h=>Math.round((Number(h)||0)*100+Number.EPSILON)/100,o=e(this.productFormValues.reduce((h,
1C)=>h+C.grossTotal,0));this.purchaseOrderForm.patchValue({grossTotal:o},{emitEvent:!1});let r=e(this.productFormValues.reduce((h,C)=>h+C.grossTotal*C.discount/100,0));this.purchaseOrderForm.patchValue({discount:r},{emitEvent:!1});let c=e(this.productFormValues.reduce((h,C)=>h+(C.grossTotal-C.grossTotal*C.discount/100)*C.tax/100,0));this.purchaseOrderForm.patchValue({taxes:c},{emitEvent:!1});let g=e(o-r);this.purchaseOrderForm.patchValue({netTotal:g},{emitEvent:!1}),this.purchaseOrderForm.patchValue({totalPayableAmount:e(g+c+this.getAdditionalCharges)},{emitEvent:!1})}get additionalChargesArray(){return this.purchaseOrderForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.purchaseOrderForm.get("additionalCharges");return!e||e.length===0?0:e.controls.reduce((o,r)=>o+(Number(r.get("amount")?.value)||0),0)}addAdditionalCharge(){this.purchaseOrderForm.get("additionalCharges").push(this.fbs.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.purchaseOrderForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}initializeAddProductForm(){this.formControlListeners.push(this.purchaseOrderForm.valueChanges.subscribe(()=>this.calculateSummary()))}handleSearchDisplay(e){e===!1?setTimeout(()=>{this.displaySearchList=e},200):this.displaySearchList=e}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.calculateSummary()}resetForm(){this.purchaseOrderForm.reset(),this.GeneratePoForm.reset(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingAddrSearch="",this.billingAddrSearch="",this.sellerSearchTerm="",this.sellerOptions=[],this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newBuyerAdded=!1,this.selectedContactUserId=null,this.disableGstField=!1,this.productFormValues=[],this.uploadedTermsDocs=[],this.editingProductIndex=null,this.confirmDeleteIndex=null,this.calculateSummary(),this.ref.detectChanges(),this.submitted=!1}onSave(){if(this.submitted=!0,this.purchaseOrderForm.markAllAsTouched(),this.purchaseOrderForm.invali
1d)return;let e={};try{e=JSON.parse(localStorage.getItem("userDetails")||"{}")}catch{e={}}let o={po_number:this.purchaseOrderForm.value.poNumber,po_creation_date:this.purchaseOrderForm.value.poCreationDate,po_expiry_date:this.purchaseOrderForm.value.poExpiryDate,payment_mode:this.purchaseOrderForm.value.paymentMode,seller_name:this.purchaseOrderForm.value.sellerName||" ",buyer_name:this.purchaseOrderForm.value.buyerName,buyer_gst:this.purchaseOrderForm.value.buyerGst,buyer_address:this.purchaseOrderForm.value.buyerAddress,city:this.purchaseOrderForm.value.city,state:this.purchaseOrderForm.value.state,pincode:this.purchaseOrderForm.value.pincode,country:this.purchaseOrderForm.value.country,user_type:"SELLER",contact_name:this.purchaseOrderForm.value.contactName,contact_number:this.purchaseOrderForm.value.contactPersonNumber,contact_email:this.purchaseOrderForm.value.contactPersonEmail,vendor_id:this.purchaseOrderForm.value.vendorId,seller_gst:" ",seller_address:"",terms:this.purchaseOrderForm.value.termsandConditions,terms_document_path:[],shipping_address:this.selectedShippingAddress[0]?.entity_id,billing_address:this.selectedBillingAddress[0]?.entity_id,items:[],additional_charges:[...this.purchaseOrderForm.value.additionalCharges],approvalUsers:[],total_payable_amount:this.purchaseOrderForm.value.totalPayableAmount,po_required:1,is_qa_required:"NO",seller_organization_id:e?.vendorId??null,seller_user_id:e?.userId??null,buyer_organization_id:this.purchaseOrderForm.value.vendorId||null,buyer_user_id:this.selectedContactUserId??null};o.terms_document_path=this.uploadedTermsDocs.map(r=>({path:r.path,filename:r.name})),o.items=this.productFormValues.map(r=>A({product_name:r.productName,product_id:r.parentId??r.productId,qty:r.quantity,unit_price:r.unitPrice,discount_percentage:r.discount,gst_percentage:r.tax,sku:r.skuId||"",selected_options:r.selectedConfigOptions||[]},r.isTemp&&{is_temp_product:!0,category:r.category,sub_category:r.subCategory,product_group:r.productGroup,sub_product_group:r.subProductGroup})),o.approvalUsers=this.approverPayload.map(r=>({customer_id:r.customer_id,level:r.level})),this.financeService.pomanualCreate(o).subscribe({next:r=>{r.responseCode===200?(this.notificationService.showSuccess("Purchase Order created successfully"),this.router.navigate(["finance-management/receivable-purchase-orders"])):this.notificationService.showError(typeof r?.response=="string"?r.response:"Failed to create Purchase Order.")},error:r=>{let c=r?.error?.response;this.notificationService.showError(typeof c=="string"&&c?c:"Failed to create Purchase Order. Please try again.")}})}onOptionChange(e){this.selectedOption=e,this.purchaseOrderForm.get("hasApprovers").setValue(e)}onApproversChange(e){this.approverPayload=e,this.prResponse.approve_users=e.map(o=>j(A({},o),{status:"A"}))}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:e.target.value}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.sellerOptions=c,this.isSearchLoading=!1}}})}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}onSelectSellerOption(e,o){if(e===this.ADD_SUPPLIER){Di("openAddBuyerModal"),this.restoreSelectValue(o,this.purchaseOrderForm.get("vendorId")?.value);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}onSelectContactOption(e,o){if(e===this.ADD_CONTACT){this.openAddContactUser(),Di("openAddContactUserModal"),this.restoreSelectValue(o,this.selectedContactUserId);return}let r=this.contactUsers.find(c=>c.id===e);r&&this.selectContactUser(r)}selectSeller(e){if(!e)return this.removeSeller();
1this.purchaseOrderForm.patchValue({buyerName:e.vendorData.company_name,vendorId:e.vendorData.vendor_id,buyerGst:e.vendorData.gst,buyerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vendorData.region,country:e.vendorData.country_id}),this.disableGstField=!0,this.displaySearchList=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newBuyerAdded=!1,this.selectedContactUserId=null,this.getContactUsers(),this.loadBuyerAddresses(e.vendorData.vendor_id)}removeSeller(){this.purchaseOrderForm.patchValue({buyerName:"",buyerGst:"",buyerAddress:"",city:"",state:"",country:""})}initializeBuyerForm(){this.buyerForm=this.fbs.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveBuyer(){if(this.buyerForm.invalid){this.buyerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required buyer details correctly.");return}let e=this.buyerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"buyer",password:"Test@1234",is_live_user:!1};this.buyerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.buyerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Buyer added successfully"),this.applyBuyerToPo(e,r),this.buyerForm.reset(),Di("closeAddBuyerModal")):this.notificationService.showError(r?.response||"Failed to add buyer")},error:()=>{this.buyerSubmitting=!1,this.notificationService.showError("Failed to add buyer. Please try again.")}})}applyBuyerToPo(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,c=o?.response?.user?.id??null;this.purchaseOrderForm.patchValue({buyerName:e.organization_name,buyerGst:e.gst,buyerAddress:e.address,city:e.city,state:e.state,country:e.country_id,pincode:this.sanitizeDigits(e.postal_code,6),contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,vendorId:r}),this.selectedContactUserId=c,this.disableGstField=!0,this.contactUsers=[],this.contactSearch="",this.newBuyerAdded=!0,this.contactUserSelected=!0,this.contactPhoneLocked=!0,this.contactEmailLocked=!0;let g=this.purchaseOrderForm.get("contactPersonNumber");g?.setValidators([E.required]),g?.updateValueAndValidity({emitEvent:!1}),this.getContactUsers(),this.loadBuyerAddresses(r)}get filteredContactUsers(){return this.contactUsers||[]}getOrgId(){return this.purchaseOrderForm.get("vendorId")?.value||null}getContactUsers(e="",o){let r=this.getOrgId();r&&this.financeService.userList({org_id:r,search:e}).subscribe({next:c=>{let g=c?.response?.list??[];this.contactUsers=(Array.isArray(g)?g:[]).map(h=>({id:h.id,name:h.full_name||[h.firstName,h.lastName].filter(Boolean).join(" ")||"",phone:h.phoneNumber||"",email:h.email||"",raw:h})),o?.()},error:()=>{this.contactUsers=[]}})}selectNewContactUser(e){this.getContactUsers("",()=>{let o=this.contactUsers.find(r=>e.email&&r.email&&r.email.toLowerCase()===e.email.toLowerCase()||e.phone&&r.phone&&String(r.phone)===String(e.phone));this.selectContactUser(o||{name:e.name,phone:e.phone,email:e.email})})}onContactSearch(e){this.contactSearch=e||"",this.getContactUsers(this.contactSearch)}selectContactUser(e){if(!e)return;this.selectedContactUserId=e.id??e.raw?.id??null,this.purchaseOrderForm.patchValue({contactName:e.name||"",contactPersonNumber:e.phone||this.purchaseOrderForm.get("contactPersonNumber")?.value||"",contactPersonEmail:e.email||this.purchaseOrderForm.get("contactPersonEmail")?.value||""});let o=this.purchaseOrderForm.get("contactPersonNumber");e.phone?o?.setValidators([E.required]):o?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),o?.updateValueAndValidity({emitEvent:!1}),this.contactPhoneLocked=!!e.phone,this.contactEmailLocked=!!e.email,this.contactUserSelected=!0}onContactPhoneInput(){let e=this.purchaseOrderForm.get("contactPersonNumber");e?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}initializeUserForm(){this.userForm=this.fbs.group({name:["",[E.required]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}openAddContactUser(){this.userForm?.reset()}
1saveContactUser(){if(this.userForm.invalid){this.userForm.markAllAsTouched(),this.notificationService.showError("Please fill all user details correctly.");return}let e=this.getOrgId();if(!e){this.notificationService.showError("Please select a buyer first.");return}let o=this.userForm.value,r={email:o.email,phoneNumber:o.phone,firstName:o.name,org_id:e,is_live_user:!1};this.userSubmitting=!0,this.financeService.addUser(r).subscribe({next:c=>{this.userSubmitting=!1,c?.responseCode===200?(this.notificationService.showSuccess(c.response?.response||"User added successfully"),this.selectNewContactUser({name:o.name,phone:o.phone,email:o.email}),this.userForm.reset(),Di("closeAddContactUserModal")):this.notificationService.showError(c?.response||"Failed to add user")},error:()=>{this.userSubmitting=!1,this.notificationService.showError("Failed to add user. Please try again.")}})}getAddressData(e){this.isAddressLoading=!0;let o={perPage:10,pageNumber:1};e&&(o.org_id=e),this.commonService.getAddressList(o).subscribe(r=>{let c=r.total_count||0,g=this.purchaseOrderForm.get("poNumber");if(r.po_number&&!g?.dirty&&!g?.value&&g?.setValue(r.po_number),this.shippingAddressResponse=r.response||[],this.billingAddressResponse=r.response||[],this.enableAddressSelection=!0,this.isAddressLoading=!1,c>10){let h={perPage:c,pageNumber:1};e&&(h.org_id=e),this.commonService.getAddressList(h).subscribe(C=>{let k=C.response||[];this.shippingAddressResponse=k,this.billingAddressResponse=k})}})}get isBuyerSelected(){return!!this.getOrgId()}onAddressDropdownOpened(e){e&&this.isBuyerSelected&&this.shippingAddressResponse.length===0&&this.getAddressData(this.getOrgId())}loadBuyerAddresses(e){this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingAddrSearch="",this.billingAddrSearch="",this.GeneratePoForm.patchValue({shippingAddress:"",billingAddress:""}),this.shippingAddressResponse=[],this.billingAddressResponse=[],e&&this.getAddressData(e)}generatePoForm(){this.GeneratePoForm=this.fb.group({selectedSeller:[""],shippingAddress:["",E.required],billingAddress:["",E.required]})}closeOpenDropdowns(){document.querySelectorAll(".dropdown-menu.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll(".dropdown.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll('[data-toggle="dropdown"][aria-expanded="true"]').forEach(e=>e.setAttribute("aria-expanded","false"))}setAddAddressMode(e,o){if(o&&!this.isBuyerSelected){this.notificationService.showError("Please select a buyer first.");return}this.addAddressMode=e,o&&(this.closeOpenDropdowns(),setTimeout(()=>{this.dialog.open(Ht,{data:{addressType:e,org_id:this.getOrgId()}}).afterClosed().subscribe(c=>{c&&(this.poRfqData?.data&&(this.addAddressMode==="shipping"&&(this.poRfqData.data.delivery_address=A({},c)),this.addAddressMode==="billing"&&(this.poRfqData.data.billing_address=A({},c))),this.getAddressData(this.getOrgId()))})},0)),(!this.shippingAddressResponse.length||!this.billingAddressResponse.length)&&this.getAddressData(this.getOrgId())}filterAddresses(e){if(!this.isBuyerSelected)return[];let o=this.shippingAddressResponse||[];if(!e||!e.trim())return o;let r=e.toLowerCase();return o.filter(c=>(c.firstname||"").toLowerCase().includes(r)||(c.lastname||"").toLowerCase().includes(r)||(c.full_address||"").toLowerCase().includes(r)||(c.city||"").toLowerCase().includes(r))}onSameAsShippingChange(e){this.sameAsShippingAddress=e.target.checked,this.sameAsShippingAddress?this.selectedShippingAddress?.length&&this.changeSelectedAddress(this.selectedShippingAddress[0],"billing"):(this.selectedBillingAddress=[],this.GeneratePoForm.patchValue({billingAddress:""}))}onSelectShippingAddress(e,o){if(e===this.ADD_SHIPPING_ADDRESS){this.setAddAddressMode("shipping",!0),this.restoreSelectValue(o,this.selectedShippingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"shipping")}onSelectBillingAddress(e,o){if(e===this.ADD_BILLING_ADDRESS){this.setAddAddressMode("billing",!0),this.restoreSelectValue(o,this.selectedBillingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"billing")}changeSelectedAddress(e,o){let r=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})];o==="shipping"&&(this.selectedShippingAddress=r,this.GeneratePoForm.patchValue({shippingAddress:String(e.entity_id)}
1)),o==="billing"&&(this.selectedBillingAddress=r,this.GeneratePoForm.patchValue({billingAddress:String(e.entity_id)}))}selectShippingAddress(){this.poRfqData.data.delivery_address=j(A({},this.selectedShippingAddress[0]),{address_id:this.selectedShippingAddress[0].entity_id}),this.GeneratePoForm.patchValue({shippingAddress:String(this.selectedShippingAddress[0].entity_id)})}selectBillingAddress(){this.poRfqData.data.billing_address=j(A({},this.selectedBillingAddress[0]),{address_id:this.selectedBillingAddress[0].entity_id}),this.GeneratePoForm.patchValue({billingAddress:String(this.selectedBillingAddress[0].entity_id)})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=new FormData;c.append("file",o[r]),c.append("source","po"),c.append("source_id",""),this.FinanceOrderService.FileUpload(c).subscribe(g=>{g.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:g.response.file_name,path:g.response.filepath,viewPath:g.response.fileViewPath}]:this.notificationService.showError(g.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}ngOnDestroy(){this.formControlListeners.forEach(e=>e.unsubscribe())}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Dt),T(ft),T(ge),T(Ae),T(z),T(H),T(Wt),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-receivable-purchase-orders"]],viewQuery:function(o,r){if(o&1&&N(d_,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:373,vars:85,consts:[["sellerSelect",""],["shippingAddrSelect",""],["billingAddrSelect",""],["docsinput",""],["financeDrawer",""],["contactNameDropdown",""],["contactSelect",""],[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group"],["for","",1,"mod-form-label"],[1,"text-danger"],["type","text","formControlName","poNumber","placeholder","Enter PO No.",1,"form-control","mod-input"],["class","invalid-error","appTranslate","",4,"ngIf"],["for","","appTranslate","",1,"mod-form-label"],["type","date","formControlName","poCreationDate","placeholder","Enter date",1,"form-control","mod-input"],["type","date","formControlName","poExpiryDate","placeholder","Enter date",1,"form-control","mod-input"],["formControlName","paymentMode",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],["value","bankTransfer","appTranslate",""],["value","chequeDd","appTranslate",""],["value","cash","appTranslate",""],["value","card","appTranslate",""],["value","walletUpi","appTranslate",""],["value","paymentGateway","appTranslate",""],[1,"col-md-8"],[1,"mod-form-label"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or enter new buyer",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search buyer...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[1,"text-primary","fw-500",3,"value"],[1,"ri-add-line"],["type","button","id","openAddBuyerModal","data-toggle","modal","data-target","#addBuyerModal",1,"d-none"],["class","fin-info-block mt-2",4,"ngIf"],[4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"shpCard","h-100"],["appTranslate","",1,"h6","fw-600","mb-3"],["panelClass","address-select-panel no-checkmark","placeholder","Select Shipping Address",3,"openedChange","selectionChange"],["matInput","","placeholder","Search address...",3,"input","keydown.space","click","value"],[1,"text-primary","fw-500",3,"value","disabled"],["class","mod-address-chip mt-3",4,"ngIf"],[1,"d-flex","align-items-center","mb-3"],["appTranslate","",1,"h6","fw-600","mb-0"],[1,"custom-control","custom-checkbox","fin-check","ml-4"],["type","checkbox","id","sameAsShipping",1,"custom-control-input",3,"change","checked","disabled"],["for","sameAsShipping","appTranslate","",1,"custom-control-label","mr-2"],["panelClass","address-select-panel no-checkmark","placeholder","Select Billing Address",3,"openedChange","selectionChange","value","disabled"],["type","button","class","mod-btn mod-btn-outline-primary btn-sm",3,"click",4,"ngIf"],[1,"table-dashboard"],[1,"col-12","px-0"],["class","fin-empty-products text-center py-4",4,"ngIf"],["class","table-responsive mod-table-wrapper",4,"ngIf"],["class","invali
1d-error mt-2","appTranslate","",4,"ngIf"],[1,"col-12","px-0","mt-4"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"mod-card","h-100"],["appTranslate","",1,"mod-form-label"],["rows","6","formControlName","termsandConditions","placeholder","Please enter any applicable terms and conditions for this purchase order.",1,"form-control","mod-input"],["type","file","id","poAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","poAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"list-unstyled","fin-summary"],["appTranslateText",""],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/receivable-purchase-orders/create","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title","d-flex","align-items-center"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],["appTranslateText","",1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],["id","addBuyerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-title"],["type","button","id","closeAddBuyerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"modal-body"],["type","text","formControlName","organization_name","placeholder","Enter buyer name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],[1,"col-12"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addContactUserModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-dialog-scrollable"],["type","button","id","closeAddContactUserModal","data-dismiss","modal",1,"d-none"],["type","text","formControlName","name","placeholder","Enter name",1,"form-control","mod-input"],["type","text","inputmode","numeric","formControlName","phone","placeholder","Enter phone number","maxlength","10",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter email id",1,"form-control","mod-input"],["moduleType","FINANCE","productType","PRODUCT",3,"productAdded"],["appTranslate","",1,"invalid-error"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12 mb-3",4,"ngIf"],[1,"col-sm-4"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"col-12","mb-3"],[1,"mod-card-title","mb-0"],["type","text","class","form-control mod-input","formControlName","contactName","readonly","",4,"ngIf","ngIfElse"],["type","text","inputmode","numeric","maxlength","10","formControlName","contactPersonNumber","placeholder","Enter Number",1,"form-control","mod-input",3,"input","readOnly"],["type","text","formControlName","contactPersonEmail","placeholder","Enter Email id",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","contactName","readonly","",1,"form-control","mod-input"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or select contact",3,"selectionChange","value"],["matInput","","placeholder","Search user...",3,"input","keydown.space","click","value"],["type","button","id","openAddContactUserModal","data-toggle","modal","data-target","#addContactUserModal",1,"d-none"],[1,"invalid-error"],[1,"mod-address-chip","mt-3"],[1,"ri-map-pin-line"],[1,"mod-address-chip__title"],[1,"mod-address-chip__addr"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"fin-empty-products","text-center","py-4"],[1,"text-muted","mb-3"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click"],[1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","table-dashboard","fin-product-table"],[4,"ngFor","ngForOf"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],["appTranslate","",1,"invalid-error","mt-2"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class","p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",7)(1,"div",8)(2,"div",9)(3,"h2",10)(4,"a",11),x(5,"i",12),t(),i(6,"span",13),n(7,"Create Purchase Order"),t()()(),x(8,"div",14),t(),i(9,"form",15),S("ngSubmit",function(){return b(c),y(r.onSave())}),i(10,"div",16)(11,"div",17)(12,"h3",18),n(13,"Purchase Order Information"),t()(),i(14,"div",19)(15,"div",20)(16,"div",21)(17,"div",22)(18,"label",23)(19,"span",13),n(20,"PO No."),t(),i(21,"sup",24),n(22,"*"),t()(),x(23,"input",25),u(24,c_,2,0,"div",26),t()(),i(25,"div",21)(26,"div",22)(27,"label",27),n(28,"PO Creation Date"),t(),x(29,"input",28),u(30,p_,2,0,"div",26),t()(),i(31,"div",21)(32,"div",22)(33,"label",27),n(34,"PO Expiry Date"),t(),x(35,"input",29),u(36,m_,2,0,"div",26),t()(),i(37,"div",21)(38,"div",22)(39,"label",27),n(40," Payment Mode"),t(),i(41,"select",30)(42,"o
1ption",31),n(43,"Select Payment Mode"),t(),i(44,"option",32),n(45,"Bank Transfer"),t(),i(46,"option",33),n(47,"Cheque/DD"),t(),i(48,"option",34),n(49,"Cash"),t(),i(50,"option",35),n(51,"Card"),t(),i(52,"option",36),n(53,"Wallet/UPI"),t(),i(54,"option",37),n(55,"Payment Gateway"),t()()()()()()(),i(56,"div",16)(57,"div",17)(58,"h3",18),n(59,"Buyer Details"),t()(),i(60,"div",19)(61,"div",20)(62,"div",38)(63,"div",22)(64,"label",39)(65,"span",13),n(66,"Buyer Name"),t(),i(67,"sup",24),n(68,"*"),t()(),i(69,"mat-form-field",40)(70,"mat-select",41,0),S("selectionChange",function(h){b(c);let C=w(71);return y(r.onSelectSellerOption(h.value,C))}),i(72,"mat-select-trigger"),n(73),t(),i(74,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(75,"mat-form-field",43)(76,"input",44),S("input",function(h){return b(c),y(r.onSearchSellers(h))})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(77,u_,3,0,"mat-option",45)(78,__,6,5,"mat-option",46)(79,v_,2,0,"mat-option",45),i(80,"mat-option",47),x(81,"i",48),n(82," Add New Buyer "),t()()(),x(83,"button",49),u(84,g_,2,0,"div",26),t()()(),u(85,b_,25,8,"div",50),t()(),u(86,F_,34,6,"ng-container",51),i(87,"div",16)(88,"div",17)(89,"h3",18),n(90,"Buyer Address Details"),t()(),i(91,"div",19)(92,"div",52)(93,"div",53)(94,"div",54)(95,"h4",55),n(96,"Shipping Address"),t(),i(97,"mat-form-field",40)(98,"mat-select",56,1),S("openedChange",function(h){return b(c),y(r.onAddressDropdownOpened(h))})("selectionChange",function(h){b(c);let C=w(99);return y(r.onSelectShippingAddress(h.value,C))}),u(100,M_,2,1,"mat-select-trigger",51),i(101,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(102,"mat-form-field",43)(103,"input",57),S("input",function(h){return b(c),y(r.shippingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(104,A_,6,4,"mat-option",46)(105,N_,2,1,"mat-option",45),i(106,"mat-option",58),x(107,"i",48),n(108," Add New Address "),t()()(),u(109,V_,7,2,"div",59),t()(),i(110,"div",53)(111,"div",54)(112,"div",60)(113,"h4",61),n(114,"Billing Address"),t(),i(115,"div",62)(116,"input",63),S("change",function(h){return b(c),y(r.onSameAsShippingChange(h))}),t(),i(117,"label",64),n(118,"Same as Shipping Address"),t()()(),i(119,"mat-form-field",40)(120,"mat-select",65,2),S("openedChange",function(h){return b(c),y(r.onAddressDropdownOpened(h))})("selectionChange",function(h){b(c);let C=w(121);return y(r.onSelectBillingAddress(h.value,C))}),u(122,B_,2,1,"mat-select-trigger",51),i(123,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(124,"mat-form-field",43)(125,"input",57),S("input",function(h){return b(c),y(r.billingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(126,R_,6,4,"mat-option",46)(127,L_,2,1,"mat-option",45),i(128,"mat-option",58),x(129,"i",48),n(130," Add New Address "),t()()(),u(131,q_,7,2,"div",59),t()()()()(),i(132,"div",16)(133,"div",17)(134,"h3",18),n(135,"Product Details"),t(),u(136,G_,4,0,"button",66),t(),i(137,"div",19)(138,"div",67)(139,"div",68),u(140,U_,7,0,"div",69)(141,$_,21,1,"div",70)(142,z_,2,0,"div",71),t(),i(143,"div",72),u(144,W_,5,0,"div",73),i(145,"div",74),u(146,H_,14,3,"div",75),t()()()()(),i(147,"div",76)(148,"div",38)(149,"div",77)(150,"div",17)(151,"h3",18),n(152,"Terms & Conditions"),t()(),i(153,"div",19)(154,"div",22)(155,"label",78),n(156,"Terms & Conditions"),t(),x(157,"textarea",79),t(),i(158,"input",80,3),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(160,"label",81),x(161,"i",82),u(162,K_,2,0,"span",83)(163,Z_,2,0,"span",83),t(),u(164,J_,1,2,"app-loader",84)(165,ev,2,1,"div",85),t()()(),i(166,"div",21)(167,"div",77)(168,"div",17)(169,"h3",18),n(170,"PO Summary"),t()(),i(171,"div",19)(172,"ul",86)(173,"li",87),n(174," Gross Total: "),i(175,"span"),n(176),_(177,"currencyFormat"),t()(),i(178,"li")(179,"span",13),n(180,"Discount: "),t(),i(181,"span",24),n(182),_(183,"currencyFormat"),t()(),i(184,"li",87),n(185," Net Total: "),i(186,"span"),n(187),_(188,"currencyFormat"),t()(),i(189,"li",87),n(190," GST: "),i(191,"span"),n(192),_(193,"currencyFormat"),t()(),i(194,"li",87),n(195," Additional Charges: "),i(196,"span"),n(197),_(198,"currencyFormat"),t()()()(),i(199,"div",88),n(200," Total Payable Amou
1nt: "),i(201,"span"),n(202),_(203,"currencyFormat"),t()()()()(),i(204,"div",89)(205,"div",90)(206,"div",91)(207,"button",92),n(208,"Cancel"),t(),i(209,"button",93),n(210,"Save"),t()()()()()(),x(211,"button",94)(212,"button",95),i(213,"div",96)(214,"div",97)(215,"div",98)(216,"div",99)(217,"h4",100),x(218,"i",101),i(219,"span",13),n(220,"Delete Product"),t()()(),i(221,"div",102)(222,"p",103),n(223,"Are you sure you want to delete "),i(224,"strong"),n(225),t(),n(226,"? "),t(),i(227,"p",104),n(228,"This action cannot be undone."),t()(),i(229,"div",105)(230,"button",106),S("click",function(){return b(c),y(r.cancelDelete())}),n(231,"No, Keep it"),t(),i(232,"button",107),S("click",function(){return b(c),y(r.confirmDelete())}),n(233,"Yes, Delete"),t()()()()(),i(234,"div",108)(235,"div",109)(236,"div",98)(237,"div",99)(238,"h5",110),n(239,"Add New Buyer"),t(),x(240,"button",111),i(241,"button",112),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(242,"\xD7"),t()(),i(243,"form",113)(244,"div",114)(245,"div",52)(246,"div",53)(247,"label",39),n(248,"Buyer Name / Company Name "),i(249,"sup",24),n(250,"*"),t()(),x(251,"input",115),u(252,tv,2,0,"div",116),t(),i(253,"div",53)(254,"label",39),n(255,"GST"),t(),x(256,"input",117),t(),i(257,"div",53)(258,"label",39),n(259,"PAN"),t(),x(260,"input",118),t()(),i(261,"h3",119),n(262,"Billing address"),t(),i(263,"div",52)(264,"div",120)(265,"label",39),n(266,"Address "),i(267,"sup",24),n(268,"*"),t()(),x(269,"input",121),u(270,iv,2,0,"div",116),t(),i(271,"div",53)(272,"label",39),n(273,"State "),i(274,"sup",24),n(275,"*"),t()(),i(276,"select",122)(277,"option",123),n(278,"Select State"),t(),u(279,nv,2,2,"option",46),t(),u(280,av,2,0,"div",116),t(),i(281,"div",53)(282,"label",39),n(283,"City "),i(284,"sup",24),n(285,"*"),t()(),x(286,"input",124),u(287,rv,2,0,"div",116),t(),i(288,"div",53)(289,"label",39),n(290,"Country "),i(291,"sup",24),n(292,"*"),t()(),i(293,"select",125)(294,"option",123),n(295,"Select Country"),t(),i(296,"option",126),n(297,"India"),t()(),u(298,lv,2,0,"div",116),t(),i(299,"div",53)(300,"label",39),n(301,"Postal Code"),t(),x(302,"input",127),u(303,ov,2,0,"div",116),t()(),i(304,"h3",119),n(305,"Contact Details"),t(),i(306,"div",52)(307,"div",53)(308,"label",39),n(309,"Contact Name "),i(310,"sup",24),n(311,"*"),t()(),x(312,"input",128),u(313,sv,2,0,"div",116),t(),i(314,"div",53)(315,"label",39),n(316,"Phone No. "),i(317,"sup",24),n(318,"*"),t()(),x(319,"input",129),u(320,pv,3,2,"div",116),t(),i(321,"div",53)(322,"label",39),n(323,"Email Id "),i(324,"sup",24),n(325,"*"),t()(),x(326,"input",130),u(327,_v,3,2,"div",116),t()()(),i(328,"div",131)(329,"button",132),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(330,"Cancel"),t(),i(331,"button",133),S("click",function(){return b(c),y(r.saveBuyer())}),n(332),t()()()()()(),i(333,"div",134)(334,"div",135)(335,"div",98)(336,"div",99)(337,"h5",110),n(338,"Add User"),t(),x(339,"button",136),i(340,"button",112),S("click",function(){return b(c),y(r.userForm.reset())}),n(341,"\xD7"),t()(),i(342,"form",113)(343,"div",114)(344,"div",52)(345,"div",120)(346,"label",39),n(347,"Name "),i(348,"sup",24),n(349,"*"),t()(),x(350,"input",137),u(351,vv,2,0,"div",116),t(),i(352,"div",120)(353,"label",39),n(354,"Phone Number "),i(355,"sup",24),n(356,"*"),t()(),x(357,"input",138),u(358,hv,3,2,"div",116),t(),i(359,"div",120)(360,"label",39),n(361,"Email "),i(362,"sup",24),n(363,"*"),t()(),x(364,"input",139),u(365,yv,3,2,"div",116),t()()(),i(366,"div",131)(367,"button",132),S("click",function(){return b(c),y(r.userForm.reset())}),n(368,"Cancel"),t(),i(369,"button",133),S("click",function(){return b(c),y(r.saveContactUser())}),n(370),t()()()()()(),i(371,"app-common-bom-product-drawer",140,4),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve,qe,Ge,Ue,je;l(4),s("backButtonFallback","/finance-management/receivable-purchase-orders"),l(5),s("formGroup",r.purchaseOrderForm),l(15),s("ngIf",((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.touched)&&((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.invalid)),l(5),Be("max",r.poExpiryDateValue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((g=r.purchaseOrderForm.get("poCreationDate"))==null?null:g.touched)),l(5),Be("min",r.poCreationDateV
1alue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((h=r.purchaseOrderForm.get("poExpiryDate"))==null?null:h.touched)),l(34),s("value",(C=r.purchaseOrderForm.get("vendorId"))==null?null:C.value),l(3),m(" ",((k=r.purchaseOrderForm.get("buyerName"))==null?null:k.value)||"Search or enter buyer name"," "),l(3),s("value",r.sellerSearchTerm),l(),s("ngIf",r.isSearchLoading),l(),s("ngForOf",r.sellerOptions),l(),s("ngIf",!r.isSearchLoading&&r.sellerSearchTerm&&r.sellerOptions.length===0),l(),s("value",r.ADD_SUPPLIER),l(4),s("ngIf",((O=r.purchaseOrderForm.get("buyerName"))==null?null:O.touched)&&((O=r.purchaseOrderForm.get("buyerName"))==null?null:O.invalid)),l(),s("ngIf",(Q=r.purchaseOrderForm.get("buyerName"))==null?null:Q.value),l(),s("ngIf",(G=r.purchaseOrderForm.get("buyerName"))==null?null:G.value),l(14),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(3),s("value",r.shippingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.shippingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.shippingAddrSearch).length),l(),s("value",r.ADD_SHIPPING_ADDRESS)("disabled",!r.isBuyerSelected),l(3),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(7),s("checked",r.sameAsShippingAddress)("disabled",!r.selectedShippingAddress||r.selectedShippingAddress.length==0),l(4),s("value",(X=r.selectedBillingAddress==null||r.selectedBillingAddress[0]==null?null:r.selectedBillingAddress[0].entity_id)!==null&&X!==void 0?X:null)("disabled",r.sameAsShippingAddress),l(2),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(3),s("value",r.billingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.billingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.billingAddrSearch).length),l(),s("value",r.ADD_BILLING_ADDRESS)("disabled",!r.isBuyerSelected),l(3),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(5),s("ngIf",r.productFormValues.length),l(4),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",r.productFormValues.length),l(),s("ngIf",r.submitted&&(!r.productFormValues||r.productFormValues.length===0)),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(11),f(v(177,73,(pe=r.purchaseOrderForm.get("grossTotal"))==null?null:pe.value)),l(6),m("- ",v(183,75,(Y=r.purchaseOrderForm.get("discount"))==null?null:Y.value),""),l(5),f(v(188,77,(le=r.purchaseOrderForm.get("netTotal"))==null?null:le.value)),l(5),f(v(193,79,(ee=r.purchaseOrderForm.get("taxes"))==null?null:ee.value)),l(5),f(v(198,81,r.getAdditionalCharges)),l(5),f(v(203,83,(fe=r.purchaseOrderForm.get("totalPayableAmount"))==null?null:fe.value)),l(7),s("disabled",r.purchaseOrderForm.invali
1d||!r.productFormValues||r.productFormValues.length===0),l(16),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:""),l(18),s("formGroup",r.buyerForm),l(9),s("ngIf",((oe=r.buyerForm.get("organization_name"))==null?null:oe.touched)&&((oe=r.buyerForm.get("organization_name"))==null?null:oe.invalid)),l(18),s("ngIf",((te=r.buyerForm.get("address"))==null?null:te.touched)&&((te=r.buyerForm.get("address"))==null?null:te.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((me=r.buyerForm.get("state"))==null?null:me.touched)&&((me=r.buyerForm.get("state"))==null?null:me.invalid)),l(7),s("ngIf",((ce=r.buyerForm.get("city"))==null?null:ce.touched)&&((ce=r.buyerForm.get("city"))==null?null:ce.invalid)),l(11),s("ngIf",((be=r.buyerForm.get("country_id"))==null?null:be.touched)&&((be=r.buyerForm.get("country_id"))==null?null:be.invalid)),l(5),s("ngIf",((Fe=r.buyerForm.get("postal_code"))==null?null:Fe.touched)&&((Fe=r.buyerForm.get("postal_code"))==null?null:Fe.invalid)),l(10),s("ngIf",((Me=r.buyerForm.get("contact_name"))==null?null:Me.touched)&&((Me=r.buyerForm.get("contact_name"))==null?null:Me.invalid)),l(7),s("ngIf",((Ve=r.buyerForm.get("phone"))==null?null:Ve.touched)&&((Ve=r.buyerForm.get("phone"))==null?null:Ve.invalid)),l(7),s("ngIf",((qe=r.buyerForm.get("email"))==null?null:qe.touched)&&((qe=r.buyerForm.get("email"))==null?null:qe.invalid)),l(4),s("disabled",r.buyerSubmitting),l(),m(" ",r.buyerSubmitting?"Saving...":"Save Buyer"," "),l(10),s("formGroup",r.userForm),l(9),s("ngIf",((Ge=r.userForm.get("name"))==null?null:Ge.touched)&&((Ge=r.userForm.get("name"))==null?null:Ge.invalid)),l(7),s("ngIf",((Ue=r.userForm.get("phone"))==null?null:Ue.touched)&&((Ue=r.userForm.get("phone"))==null?null:Ue.invalid)),l(7),s("ngIf",((je=r.userForm.get("email"))==null?null:je.touched)&&((je=r.userForm.get("email"))==null?null:je.invalid)),l(4),s("disabled",r.userSubmitting),l(),m(" ",r.userSubmitting?"Submitting...":"Submit"," ")}},dependencies:[rt,J,W,Ee,It,Mt,Et,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Ot,gt,kt,Ft,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ae],styles:[".searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.max-w-80px[_ngcontent-%COMP%]{max-width:80px}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.min-w-154px[_ngcontent-%COMP%]{min-width:154px}.ml-20[_ngcontent-%COMP%]{margin-left:20px}.border-right-black[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.125)}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}
1.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal;cursor:pointer}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;border:1px solid #ececec;border-radius:8px;overflow:hidden;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:22px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}"]})}}return a})();var Ma=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-transactions"]],decls:1,vars:1,consts:[[3,"title"]],template:function(o,r){o&1&&x(0,"app-coming-soon",0),o&2&&s("title","Reconciliation")},dependencies:[vi]})}}return a})();var Aa=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-reconcilation"]],decls:1,vars:1,consts:[[3,"title"]],template:function(o,r){o&1&&x(0,"app-coming-soon",0),o&2&&s("title","Reconciliation")},dependencies:[vi]})}}return a})();var Na=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-fund-transfers"]],decls:1,vars:1,consts:[[3,"title"]],template:function(o,r){o&1&&x(0,"app-coming-soon",0),o&2&&s("title","Fund Transfers")},dependencies:[vi]})}}return a})();var Sv=["debitNoteNumberTemplate"],Cv=["invoiceIdTemplate"],Ev=["totalAmountTemplate"],Iv=["statusTemplate"],Dv=["actionsTemplate"],Tv=()=>["/finance-management/payable-debit-notes/create"];function wv(a,d){if(a&1){let e=I();i(0,"button",21),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onDebitNoteClick(r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.debit_note_number||"-"," ")}}function Pv(a,d){if(a&1&&(i(0,"span",22),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function Ov(a,d){a&1&&(i(0,"button",29)(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",12),n(4,"Delete"),t()())}function kv(a,d){if(a&1){let e=I();i(0,"button",23),x(1,"i",24),t(),i(2,"mat-menu",25,3)(4,"button",26),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onDebitNoteClick(r.id))}),i(5,"mat-icon",27),n(6,"visibility"),t(),i(7,"span",12),n(8,"View"),t()(),u(9,Ov,5,0,"button",28),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var Va=(()=>{class a{constructor(e,o,r,c,g){this.oService=e,this.router=o,this.snackBar=r,this.notificationService=c,this.cService=g,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"debit_note_number",label:"Debit Note Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Debit Note No."}},{key:"supplier_name",label:"Supplier Name",selected:!0,dataType:"text",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Supplier"}},{key:"grn",label:"GRN No",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search GRN No."}},{key:"invoice",label:"Invoice Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice Number"}},{key:"debit_note_date",label:"Debit Note Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"debit_note_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"total_amount",label:"Total Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"debit_note_amount",label:"Debit Note Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-debit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"DEBIT-NOTE-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No debit notes found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={debit_note_number:this.debitNoteNumberTemplate,invoice_id:this.invoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search,note_type:"ISSUED"};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getDebitNoteList(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}
1onExportRequest(e){let o={type:"DEBIT",format:e.fileType},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.creditDebitNoteExport(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_debit_note_list.pdf":"payable_debit_note_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onDebitNoteClick(e){e&&this.router.navigate(["/finance-management/payable-debit-notes/details",e])}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.buyer[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}onGrnClick(e){this.router.navigate(["shipments/details",e])}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payable-debit-notes"]],viewQuery:function(o,r){if(o&1&&(N(Sv,7),N(Cv,7),N(Ev,7),N(Iv,7),N(Dv,7)),o&2){let c;V(c=B())&&(r.debitNoteNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:29,vars:8,consts:[["debitNoteNumberTemplate",""],["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],[1,"dropdown"],["type","button","data-toggle","dropdown",1,"mod-btn","mod-btn-primary","dropdown-toggle"],[1,"ri-add-line"],["appTranslate",""],[1,"dropdown-menu","dropdown-menu-right"],["type","button",1,"dropdown-item",3,"routerLink"],[1,"ri-input-field","font-18","pr-2"],["type","button","matTooltipPosition","above",1,"dropdown-item"],[1,"ri-import-line","font-18","pr-2"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["mat-menu-item","",4,"ngIf"],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",4)(1,"div",5)(2,"div",6)(3,"h2",7),n(4,"Debit Notes "),t()(),i(5,"div",8)(6,"div",9)(7,"button",10),x(8,"i",11),i(9,"span",12),n(10,"Add Debit Note"),t()(),i(11,"div",13)(12,"button",14),x(13,"i",15),i(14,"span",12),n(15,"Manual Entry"),t()(),i(16,"button",16),x(17,"i",17),i(18,"span",12),n(19,"Import File"),t()()()()()(),i(20,"div",18)(21,"div",19)(22,"data-table",20),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(23,wv,2,1,"ng-template",null,0,P)(25,Pv,2,3,"ng-template",null,1,P)(27,kv,10,2,"ng-template",null,2,P),t()}if(o&2){let c=w(28);l(12),s("routerLink",Ce(7,Tv)),l(10),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Ee,Xe,Je,et,Re,L,Le]})}}return a})();var Fv=["debitNoteNumberTemplate"],Mv=["invoiceIdTemplate"],Av=["totalAmountTemplate"],Nv=["statusTemplate"],Vv=["actionsTemplate"];function Bv(a,d){if(a&1){let e=I();i(0,"button",11),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onDebitNoteClick(r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.debit_note_number||"-"," ")}}function Rv(a,d){if(a&1&&(i(0,"span",12),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function Lv(a,d){a&1&&(i(0,"button",20)(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",18),n(4,"Delete"),t()())}function qv(a,d){if(a&1){let e=I();i(0,"button",13),x(1,"i",14),t(),i(2,"mat-menu",15,3)(4,"button",16),S("click",function(){let r=b
1(e).$implicit,c=p();return y(c.onDebitNoteClick(r.id))}),i(5,"mat-icon",17),n(6,"visibility"),t(),i(7,"span",18),n(8,"View"),t()(),u(9,Lv,5,0,"button",19),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var Ba=(()=>{class a{constructor(e,o,r,c,g){this.oService=e,this.router=o,this.snackBar=r,this.notificationService=c,this.cService=g,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"debit_note_number",label:"Debit Note Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Debit Note No."}},{key:"supplier_name",label:"Supplier Name",selected:!0,dataType:"text",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Supplier"}},{key:"grn",label:"GRN No",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search GRN No."}},{key:"invoice",label:"Invoice Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice Number"}},{key:"debit_note_date",label:"Debit Note Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"debit_note_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"total_amount",label:"Total Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"debit_note_amount",label:"Debit Note Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-debit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"DEBIT-NOTE-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={debit_note_number:this.debitNoteNumberTemplate,invoice_id:this.invoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search,note_type:"RECEIVED"};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getDebitNoteList(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}onExportRequest(e){let o={type:"DEBIT",format:e.fileType},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.creditDebitNoteExport(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"receivable_debit_note_list.pdf":"receivable_debit_note_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onDebitNoteClick(e){e&&this.router.navigate(["/finance-management/receivable-debit-notes/details",e])}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.buyer[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}onGrnClick(e){this.router.navigate(["shipments/details",e])}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-debit-notes"]],viewQuery:function(o,r){if(o&1&&(N(Fv,7),N(Mv,7),N(Av,7),N(Nv,7),N(Vv,7)),o&2){let c;V(c=B())&&(r.debitNoteNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:14,vars:6,consts:[["debitNoteNumberTemplate",""],["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["appTranslate",""],["mat-menu-item","",4,"ngIf"],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",4)(1,"div",5)(2,"div",6)(3,"h2",7),n(4,"Debit Notes "),t()()(),i(5,"div",8)(6,"div",9)(7,"data-table",10),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}
1)("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(8,Bv,2,1,"ng-template",null,0,P)(10,Rv,2,3,"ng-template",null,1,P)(12,qv,10,2,"ng-template",null,2,P),t()}if(o&2){let c=w(13);l(7),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Xe,Je,et,Re,L,Le]})}}return a})();var Gv=["buyerGST"],Uv=()=>({toolbar:!1}),tn=()=>({standalone:!0});function jv(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order"),t())}function $v(a,d){a&1&&(i(0,"span",15),n(1,"Work Order"),t())}function zv(a,d){a&1&&(i(0,"span"),x(1,"i",119),i(2,"span",15),n(3,"Deal Room"),t()())}function Wv(a,d){a&1&&(i(0,"span")(1,"div",120)(2,"span",121),n(3,"Loading..."),t()(),i(4,"span",15),n(5,"Opening..."),t()())}function Qv(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order Details"),t())}function Yv(a,d){a&1&&(i(0,"span",15),n(1,"Work Order Details"),t())}function Hv(a,d){a&1&&(i(0,"span",15),n(1,"PO Creation Date"),t())}function Kv(a,d){a&1&&(i(0,"span",15),n(1,"WO Creation Date"),t())}function Zv(a,d){a&1&&(i(0,"div",124),n(1," Po Creation Date should be Required "),t())}function Jv(a,d){a&1&&(i(0,"div",124),n(1," Po Creation Date cannot be in past "),t())}function Xv(a,d){if(a&1&&(i(0,"div",122),u(1,Zv,2,0,"div",123)(2,Jv,2,0,"div",123),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.sentToSupplierForm.get("pocDate"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.sentToSupplierForm.get("pocDate"))==null||o.errors==null?null:o.errors.pastDate)}}function eg(a,d){a&1&&(i(0,"span",15),n(1,"PO Expiry Date"),t())}function tg(a,d){a&1&&(i(0,"span",15),n(1,"WO Expiry Date"),t())}function ig(a,d){a&1&&(i(0,"div",124),n(1,"Po Expiry Date should be Required "),t())}function ng(a,d){a&1&&(i(0,"div",124),n(1,"Po Expiry Date cannot be in past "),t())}function ag(a,d){if(a&1&&(i(0,"div",122),u(1,ig,2,0,"div",123)(2,ng,2,0,"div",123),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.sentToSupplierForm.get("poExpairyDate"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.sentToSupplierForm.get("poExpairyDate"))==null||o.errors==null?null:o.errors.pastDate)}}function rg(a,d){a&1&&(i(0,"div",124),n(1," Payment Mode should be Required "),t())}function lg(a,d){if(a&1&&(i(0,"div",122),u(1,rg,2,0,"div",123),t()),a&2){let e,o=p(2);l(),s("ngIf",(e=o.sentToSupplierForm.get("paymentMode"))==null||e.errors==null?null:e.errors.required)}}function og(a,d){if(a&1){let e=I();i(0,"mat-chip-row",132),S("removed",function(){let r=b(e).$implicit,c=p(3),g=w(48);return y(c.openDocDeleteDialog(g,r))})("edited",function(r){let c=b(e).$implicit,g=p(3);return y(g.edit(c,r))}),n(1),i(2,"button",133)(3,"mat-icon"),n(4,"cancel"),t()()()}if(a&2){let e=d.$implicit;s("editable",!0)("title",e.value)("aria-description","press enter to edit "+e.value),l(),m(" ",e.value," "),l(),Be("aria-label","remove "+e.value)}}function sg(a,d){a&1&&(i(0,"div",122)(1,"div",124),n(2,"At least one document is required when Additional Services is set to Yes"),t()())}function dg(a,d){if(a&1){let e=I();i(0,"div",125)(1,"div",28)(2,"label",126)(3,"span",15),n(4,"Documents required from Supplier"),t(),i(5,"span",127),n(6,"*"),t()(),i(7,"mat-form-field",128)(8,"mat-chip-grid",129,3),u(10,og,5,5,"mat-chip-row",130),i(11,"input",131),S("matChipInputTokenEnd",function(r){b(e);let c=p(2);return y(c.add(r))}),t()()(),u(12,sg,3,0,"div",32),t()()}if(a&2){let e,o=w(9),r=p(2);l(10),s("ngForOf",r.supplierDocuments),l(),s("matChipInputFor",o)("matChipInputSeparatorKeyCodes",r.separatorKeysCodes)("matChipInputAddOnBlur",r.addOnBlur),l(),s("ngIf",(((e=r.sentToSupplierForm.get("supplierDocuments"))==null?null:e.touched)||r.submitted)&&((e=r.sentToSupplierForm.get("supplierDocuments"))==null||e.errors==null?null:e.errors.required))}}function cg(a,d){if(a&1&&x(0,"app-loader",134),a&2){let e=p(2);s("isLoading",e.loadingStates.orderDetails)("useBlockPosition",!0)}}function pg(a,d){a&1&&(i(0,"span",138),n(1," Not available at the moment "),t())}function mg(a,d){if(a&1&&(i(0,"div",51)(1,"div",135)(2,"div",78)(3,"p",136),u(4,pg,2,0,"span",137),t()()()()),a&2){let e=p(2);l(4),s("ngIf",e.supplierData&&!e.supplierData.seller_address)}}function ug(a,d){if(a&1&&(i(0,"span",141),n(1),t()),a&2){let e=p(3);l(),f(e.supplierData==null||e.supplierData.seller_details==null?null:e.supplierData.seller_details.company_name)}}function _g(a,d){a&1&&(i(0,"span",138),n(1," Not available"),t())}function vg(a,d){if(a&1&&(i(0,"span",141),n(1),t()),a&2){let e=p(3);l(),f(e.supplierData.seller_gst_list[0])}}function gg(a,d){a&1&&(i(0,"span",138),n(1," Not available"),t())}function fg(a,d){if(a&1&&(i(0,"span",141),n(1),t()),a&2){let e=p(3);l(),m(" ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.full_address," ")}}function hg(a,d){a&1&&(i(0,"span",138),n(1," No Address Found "),t())}function xg(a,d){if(a&1&&(i(0,"div",51)(1,"div",135)(2,"div",78)(3,"p",136)(4,"span",15),n(5,"Seller Name: "),t(),u(6,ug,2,1,"span",139)(7,_g,2,0,"span",137),t(),i(8,"p",136)(9,"span",15),n(10,"GST No:"),t(),u(11,vg,2,1,"span",140)(12,gg,2,0,"ng-template",null,4,P),t(),i(14,"p",136)(15,"span",15),n(16,"Seller Address:"),t(),x(17,"br"),u(18,fg,2,1,"span",139)(19,hg,2,0,"span",137),t()()()()),a&2){let e=w(13),o=p(2);l(6),s("ngIf",o.supplierData.seller_details.company_name),l(),s("ngIf",!o.supplierData.seller_details.company_name),l(4),s("ngIf",o.supplierData==null||o.supplierData.seller_gst_list==null?null:o.supplierData.seller_gst_list.length)("ngIfElse",e),l(7),s("ngIf",o.supplierData&&o.supplierData.seller_address&&o.Object.keys(o.supplierData.seller_address).length),l(),s("ngIf",o.supplierData&&(!o.supplierData.seller_address||!o.Object.keys(o.supplierData.seller_address).length))}}function bg(a,d){if(a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",141),n(4),t()()),a&2){let e=p(2);l(4),m(" ",e.shippingAddress==null?null:e.shippingAddress.full_address," ")}}function yg(a,d){a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",138),n(4," Not available "),t()())}function Sg(a,d){a&1&&(i(0,"option",144),n(1," Select GST"),t())}function Cg(a,d){a&1&&(i(0,"option",145),n(1," No GST Available"),t())}function Eg(a,d){if(a&1&&(i(0,"option",146),n(1),t()),a&2){let e=d.$implicit;s("value",e),l(),m(" ",e,"")}}function Ig(a,d){if(a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",141),n(4),t()()),a&2){let e=p(2);l(4),m(" ",e.billingAddress==null?null:e.billingAddress.full_address," ")}}function Dg(a,d){a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",138),n(4," Not available "),t()())}function Tg(a,d){if(a&1){let e=I();i(0,"div",147),x(1,"img",148),i(2,"button",149),S("click",function(){b(e);let r=p(2);return y(r.removeLogo())}),x(3,"i",150),t()()}
1if(a&2){let e=p(2);l(),s("viewerOptions",Ce(2,Uv))("src",e.logoViewUrl.data,q)}}function wg(a,d){a&1&&(i(0,"small",15),n(1,"No logo selected"),t())}function Pg(a,d){if(a&1&&(i(0,"div"),x(1,"app-loader",151),t()),a&2){let e=p(2);l(),s("isLoading",e.logoViewUrl.isLoading)("useBlockPosition",!0)}}function Og(a,d){if(a&1&&(i(0,"th"),n(1),i(2,"small"),n(3),t()()),a&2){let e=d.$implicit;l(),m(" ",e.title," "),l(2),f(e.subtitle)}}function kg(a,d){if(a&1&&(i(0,"span",158)(1,"span"),n(2),t()()),a&2){let e=d.$implicit;l(2),D("",e.name,": ",e.value,"")}}function Fg(a,d){if(a&1&&(i(0,"span",158)(1,"span"),n(2),t()()),a&2){let e=d.$implicit;l(2),D("",e.name,": ",e.value,"")}}function Mg(a,d){if(a&1&&(i(0,"span",158)(1,"span"),n(2),t()()),a&2){let e=d.$implicit;l(2),D("",e.name,": ",e.value,"")}}function Ag(a,d){if(a&1&&(F(0),i(1,"div",155),n(2),t(),i(3,"p",156),u(4,kg,3,2,"span",157)(5,Fg,3,2,"span",157)(6,Mg,3,2,"span",157),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function Ng(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),f(e.offered_qty)}}function Vg(a,d){if(a&1){let e=I();i(0,"input",159),ve("ngModelChange",function(r){b(e);let c=p().$implicit;return _e(c.offered_qty,r)||(c.offered_qty=r),y(r)}),t()}if(a&2){let e=p().$implicit;ue("ngModel",e.offered_qty),s("ngModelOptions",Ce(2,tn))}}function Bg(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),f(e.required_qty)}}function Rg(a,d){if(a&1){let e=I();i(0,"input",159),ve("ngModelChange",function(r){b(e);let c=p().$implicit;return _e(c.required_qty,r)||(c.required_qty=r),y(r)}),t()}if(a&2){let e=p().$implicit;ue("ngModel",e.required_qty),s("ngModelOptions",Ce(2,tn))}}function Lg(a,d){if(a&1&&(F(0),i(1,"div",155)(2,"div")(3,"p",160),n(4),_(5,"currencyFormat"),t(),i(6,"p",160),n(7),_(8,"currencyFormat"),t(),i(9,"p",160),n(10),_(11,"currencyFormat"),t(),i(12,"p",160),n(13),_(14,"currencyFormat"),t(),i(15,"p",160),n(16),_(17,"currencyFormat"),t(),i(18,"p",160),n(19),_(20,"currencyFormat"),t(),i(21,"p",160),n(22),_(23,"currencyFormat"),t(),i(24,"p",160),n(25),_(26,"currencyFormat"),t(),i(27,"p",160),n(28),_(29,"currencyFormat"),t(),x(30,"div",161),i(31,"p",162)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst)," "),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst)," "),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst)," "),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst)," "),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function qg(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",152),n(3),t(),u(4,Ag,7,4,"ng-template",null,5,P),x(6,"i",153),i(7,"p")(8,"small"),n(9),t()()(),i(10,"td"),u(11,Ng,2,1,"ng-container",40)(12,Vg,1,3,"input",154),t(),i(13,"td"),u(14,Bg,2,1,"ng-container",40)(15,Rg,1,3,"input",154),t(),i(16,"td"),n(17),_(18,"currencyFormat"),i(19,"small"),n(20,"/unit"),t()(),i(21,"td"),n(22),_(23,"currencyFormat"),t(),i(24,"td"),n(25),_(26,"currencyFormat"),t(),i(27,"td"),n(28),_(29,"currencyFormat"),t(),i(30,"td"),n(31),_(32,"currencyFormat"),u(33,Lg,35,34,"ng-template",null,6,P),x(35,"i",153),t()()),a&2){let e=d.$implicit,o=w(5),r=w(34),c=p(3);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(3),m("SKU ID: ",e.display_item_id,""),l(2),s("ngIf",!c.isRegenerate),l(),s("ngIf",c.isRegenerate),l(2),s("ngIf",!c.isRegenerate),l(),s("ngIf",c.isRegenerate),l(2),m("",v(18,13,e.unit_price)," "),l(5),f(v(23,15,e.gross_total)),l(3),f(v(26,17,e.discount)),l(3),f(v(29,19,e.gst)),l(3),m(" ",v(32,21,e.total_amount)," "),l(4),s("ngbPopover",r)}}function Gg(a,d){if(a&1&&(i(0,"tbody"),u(1,qg,36,23,"tr",103),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Ug(a,d){if(a&1&&(F(0),i(1,"div",155),n(2),t(),i(3,"p",164),n(4),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),m(" ",e.short_description," ")}}function jg(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),f(e.required_qty)}}function $g(a,d){if(a&1){let e=I();i(0,"input",159),ve("ngModelChange",function(r){b(e);let c=p().$implicit;return _e(c.required_qty,r)||(c.required_qty=r),y(r)}),t()}if(a&2){let e=p().$implicit;ue("ngModel",e.required_qty),s("ngModelOptions",Ce(2,tn))}}function zg(a,d){if(a&1&&(F(0),i(1,"div",155)(2,"div")(3,"p",160),n(4),t(),i(5,"p",160),n(6),t(),i(7,"p",160),n(8),t(),i(9,"p",160),n(10),t(),i(11,"p",160),n(12),t(),i(13,"p",160),n(14),t(),i(15,"p",160),n(16),t(),i(17,"p",160),n(18),t(),i(19,"p",160),n(20),t(),x(21,"div",161),i(22,"p",162)(23,"b"),n(24),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: \u20B9 ",e.gross_total," "),l(2),m(" Discount: \u20B9 ",e.discount," "),l(2),m(" Net Total: \u20B9 ",e.gross_total-e.discount," "),l(2),D(" Tax (",e.gst_percentage,"%): \u20B9 ",e.gst,""),l(2),D(" SGST (",e.sgst_percentage,"%): \u20B9 ",e.sgst,""),l(2),D(" CGST (",e.cgst_percentage,"%): \u20B9 ",e.cgst,""),l(2),D(" IGST (",e.igst_percentage,"%): \u20B9 ",e.igst,""),l(2),m(" Logistics: \u20B9 ",e.logistics_charges," "),l(2),m(" Insurance: \u20B9 ",e.insurance_charges," "),l(4),m("Total Payable: \u20B9 ",e.net_amount," ")}}function Wg(a,d){if(a&1&&(i(0,"tr")(1,"td",163),n(2),t(),i(3,"td")(4,"span",152),n(5),t(),u(6,Ug,5,2,"ng-template",null,5,P),x(8,"i",153),t(),i(9,"td"),u(10,jg,2,1,"ng-container",40)(11,$g,1,3,"input",154),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),t(),i(18,"td"),n(19),u(20,zg,25,14,"ng-template",null,6,P),x(22,"i",153),t()()),a&2){let e=d.$implicit,o=w(7),r=w(21),c=p(3);l(2),m(" ",e.display_item_id,""),l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),s("ngIf",!c.isRegenerate),l(),s("ngIf",c.isRegenerate),l(2),m("\u20B9 ",e.gross_total,""),l(2),m("\u20B9 ",e.logistics_charges,""),l(2),m("\u20B9 ",e.gst,""),l(2),m("\u20B9 ",e.net_amount," "),l(3),s("ngbPopover",r)}}function Qg(a,d){if(a&1&&(i(0,"tbody"),u(1,Wg,23,10,"tr",103),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Yg(a,d){if(a&1&&(F(0),i(1,"div",155),n(2),t(),i(3,"p",164),n(4),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),m(" ",e.short_description," ")}}function Hg(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),f(e.offered_qty)}}function Kg(a,d){if(a&1){let e=I();i(0,"input",159),ve("ngModelChange",function(r){b(e);let c=p().$implicit;return _e(c.offered_qty,r)||(c.offered_qty=r),y(r)}),t()}if(a&2){let e=p().$implicit;ue("ngModel",e.offered_qty),s("ngModelOptions",Ce(2,tn))}}function Zg(a,d){if(a&1&&(F(0),i(1,"div",155)(2,"div")(3,"p",160),n(4),t(),i(5,"p",160),n(6),t(),i(7,"p",160),n(8),t(),x(9,"div",161),i(10,"p",162)(11,"b"),n(12),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Bid Total Value: \u20B9 ",e.gross_total," "),l(2),m(" Tax: \u20B9 ",e.gst,""),l(2),m(" Logistics: \u20B9 ",e.logistics_charges," "),l(4),m("Net Price: \u20B9 ",e.net_amount," ")}}function Jg(a,d){if(a&1&&(i(0,"tr")(1,"td",163),n(2),t(),i(3,"td")(4,"span",152),n(5),t(),u(6,Yg,5,2,"ng-template",null,5,P),x(8,"i",153),t(),i(9,"td"),u(10,Hg,2,1,"ng-container",40)(11,Kg,1,3,"input",154),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),t(),i(18,"td"),n(19),u(20,Zg,13,4,"ng-template",null,6,P),x(22,"i",153),t()()),a&2){let e=d.$implicit,o=w(7),r=w(21),c=p(3);l(2),m(" ",e.display_item_id,""),l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),s("ngIf",!c.isRegenerate),l(
1),s("ngIf",c.isRegenerate),l(2),m("\u20B9 ",e.unit_price," "),l(2),m("\u20B9 ",e.discount,""),l(2),m("\u20B9 ",e.gst,""),l(2),m(" \u20B9 ",e.net_amount," "),l(3),s("ngbPopover",r)}}function Xg(a,d){if(a&1&&(i(0,"tbody"),u(1,Jg,23,10,"tr",103),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function e2(a,d){if(a&1){let e=I();i(0,"li",165)(1,"button",166),S("click",function(){b(e);let r=p(2);return y(r.addAnotherInstallment())}),x(2,"i",167),i(3,"span",15),n(4,"Add New Payment"),t()()()}}function t2(a,d){a&1&&(i(0,"span",184),n(1,"Payment % is required"),t())}function i2(a,d){a&1&&(i(0,"span",184),n(1,"Payment % must be greater than zero"),t())}function n2(a,d){if(a&1&&(i(0,"div",182),u(1,t2,2,0,"span",183)(2,i2,2,0,"span",183),t()),a&2){let e,o,r=p().$implicit;l(),s("ngIf",(e=r.get("payment"))==null?null:e.hasError("required")),l(),s("ngIf",(o=r.get("payment"))==null?null:o.hasError("greaterThanZero"))}}function a2(a,d){a&1&&(i(0,"span",184),n(1,"Due date is required"),t())}function r2(a,d){a&1&&(i(0,"span",184),n(1,"Due date cannot be in the past"),t())}function l2(a,d){if(a&1&&(i(0,"div",182),u(1,a2,2,0,"span",183)(2,r2,2,0,"span",183),t()),a&2){let e,o,r=p().$implicit;l(),s("ngIf",(e=r.get("timeline"))==null?null:e.hasError("required")),l(),s("ngIf",((o=r.get("timeline"))==null?null:o.hasError("pastDate"))||((o=r.get("timeline"))==null?null:o.hasError("invalidDate")))}}function o2(a,d){if(a&1){let e=I();i(0,"div",179)(1,"button",185),S("click",function(){b(e);let r=p().index,c=p(4);return y(c.Ondeletepayment(r))}),x(2,"i",186),i(3,"span",15),n(4,"Remove Payment"),t()()()}}function s2(a,d){if(a&1&&(i(0,"div",173)(1,"div",174)(2,"div",63)(3,"label")(4,"span",15),n(5,"Payment Title:"),t(),i(6,"sup",30),n(7,"*"),t()(),x(8,"input",175),t(),i(9,"div",63)(10,"label")(11,"span",15),n(12,"Payment %:"),t(),i(13,"sup",30),n(14,"*"),t()(),x(15,"input",176),u(16,n2,3,2,"div",177),t(),i(17,"div",63)(18,"label")(19,"span",15),n(20,"Due Date:"),t(),i(21,"sup",30),n(22,"*"),t()(),x(23,"input",178),u(24,l2,3,2,"div",177),t(),i(25,"div",179)(26,"label",15),n(27,"Note"),t(),x(28,"textarea",180),t(),u(29,o2,5,0,"div",181),t()()),a&2){let e,o,r=d.$implicit,c=d.index,g=p(4);s("formGroupName",c),l(15),s("allowDecimals",!0),l(),s("ngIf",(((e=r.get("payment"))==null?null:e.touched)||((e=r.get("payment"))==null?null:e.dirty)||g.submitted)&&((e=r.get("payment"))==null?null:e.invalid)),l(7),s("min",g.curDate),l(),s("ngIf",(((o=r.get("timeline"))==null?null:o.touched)||((o=r.get("timeline"))==null?null:o.dirty)||g.submitted)&&((o=r.get("timeline"))==null?null:o.invalid)),l(5),s("ngIf",c>0)}}function d2(a,d){if(a&1&&(F(0,171),u(1,s2,30,6,"div",172),M()),a&2){let e=p(3);l(),s("ngForOf",e.payment.controls)}}function c2(a,d){if(a&1&&(i(0,"div",168)(1,"h4",169),n(2,"Payment Terms:"),t(),u(3,d2,2,1,"ng-container",170),t()),a&2){let e=p(2);l(3),s("ngIf",e.sentToSupplierForm.get("payment"))}}function p2(a,d){if(a&1){let e=I();i(0,"li",165)(1,"button",166),S("click",function(){b(e);let r=p(3);return y(r.OnAddAnotherAsn())}),x(2,"i",167),i(3,"span",15),n(4,"Add New Shipment"),t()()()}}function m2(a,d){if(a&1&&(i(0,"option",146),n(1),t()),a&2){let e=d.$implicit;s("value",e.product_id),l(),m(" ",e.product_name," ")}}function u2(a,d){if(a&1){let e=I();i(0,"button",206),S("click",function(){b(e);let r=p().index,c=p().index,g=p(5);return y(g.OnAddProducts(c,r))}),x(1,"i",207),t()}}function _2(a,d){if(a&1){let e=I();i(0,"button",208),S("click",function(){b(e);let r=p().index,c=p().index,g=p(5);return y(g.OndeleteProducts(c,r))}),x(1,"i",209),t()}}function v2(a,d){if(a&1&&(i(0,"div",197)(1,"div",198)(2,"label")(3,"span",15),n(4,"Product:"),t(),i(5,"sup",30),n(6,"*"),t()(),i(7,"select",199)(8,"option",200),n(9,"Select Product"),t(),u(10,m2,2,2,"option",86),t()(),i(11,"div",201)(12,"label")(13,"span",15),n(14,"Quantity:"),t(),i(15,"sup",30),n(16,"*"),t()(),x(17,"input",202),t(),i(18,"div",203),u(19,u2,2,0,"button",204)(20,_2,2,0,"button",205),t()()),a&2){let e=d.index,o=p(6);s("formGroupName",e),l(10),s("ngForOf",o.supplierData==null?null:o.supplierData.items),l(9),s("ngIf",e===0),l(),s("ngIf",e>0)}}function g2(a,d){if(a&1){let e=I();i(0,"div",210)(1,"button",185),S("click",function(){b(e);let r=p().index,c=p(5);return y(c.RemoveShiment(r))}),x(2,"i",186),i(3,"span",15),n(4,"Remove Shipment"),t()()()}}function f2(a,d){if(a&1&&(i(0,"div",190)(1,"div",191)(2,"div",63)(3,"label")(4,"span",15),n(5,"Shipment Title:"),t(),i(6,"sup",30),n(7,"*"),t()(),x(8,"input",192),t(),i(9,"div",63)(10,"label")(11,"span",15),n(12,"Timeline in Days:"),t(),i(13,"sup",30),n(14,"*"),t()(),x(15,"input",193),t()(),i(16,"div",194),u(17,v2,21,4,"div",195),t(),u(18,g2,5,0,"div",196),t()),a&2){let e=d.index,o=p(5);s("formGroupName",e),l(17),s("ngForOf",o.prodArray(e).controls),l(),s("ngIf",e>0)}}function h2(a,d){if(a&1&&(F(0,188),u(1,f2,19,3,"div",189),M()),a&2){let e=p(4);l(),s("ngForOf",e.asn.controls)}}function x2(a,d){if(a&1&&(i(0,"div",168)(1,"h4",169),n(2,"Shipment Terms:"),t(),u(3,h2,2,1,"ng-container",187),t()),a&2){let e=p(3);l(3),s("ngIf",e.sentToSupplierForm.get("asn"))}}function b2(a,d){if(a&1){let e=I();i(0,"div",106)(1,"ul",107)(2,"li",108)(3,"p",82),n(4,"Would you like to create multiple shipments?"),t()(),i(5,"li",108)(6,"label",109)(7,"input",110),S("change",function(r){b(e);let c=p(2);return y(c.OnChangeShipment(r))}),t(),i(8,"span")(9,"span",15),n(10,"NO"),t(),i(11,"span",15),n(12,"YES"),t()(),x(13,"a"),t()(),u(14,p2,5,0,"li",111),t(),u(15,x2,4,1,"div",112),t()}if(a&2){let e,o,r=p(2);l(14),s("ngIf",!((e=r.sentToSupplierForm.get("shipmentDisable"))!=null&&e.value)),l(),s("ngIf",!((o=r.sentToSupplierForm.get("shipmentDisable"))!=null&&o.value))}}function y2(a,d){a&1&&(i(0,"span",15),n(1,"Choose file"),t())}function S2(a,d){a&1&&(i(0,"span",15),n(1,"Uploading..."),t())}function C2(a,d){if(a&1&&x(0,"app-loader",220),a&2){let e=p(3);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function E2(a,d){if(a&1){let e=I();i(0,"li",108)(1,"p",221)(2,"a",222),n(3),t(),i(4,"span",223)(5,"i",224),S("click",function(){let r=b
1(e).$implicit;p();let c=w(9),g=p(2);return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function I2(a,d){if(a&1){let e=I();i(0,"div",211)(1,"div",51)(2,"div",28)(3,"label",212),n(4,"Terms & Conditions:"),t(),x(5,"textarea",213),t()(),i(6,"div",214)(7,"div",215)(8,"input",216,7),S("change",function(r){b(e);let c=p(2);return y(c.fileChange(r))}),t(),i(10,"label",217),u(11,y2,2,0,"span",39)(12,S2,2,0,"span",39),t(),u(13,C2,1,2,"app-loader",35),t()(),i(14,"div",51)(15,"ul",218),u(16,E2,6,2,"li",219),t()()()}if(a&2){let e=p(2);l(8),s("title",e.termsDocsTooltip)("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function D2(a,d){a&1&&(i(0,"span",15),n(1,"Choose file"),t())}function T2(a,d){a&1&&(i(0,"span",15),n(1,"Uploading..."),t())}function w2(a,d){if(a&1&&x(0,"app-loader",220),a&2){let e=p(3);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function P2(a,d){if(a&1){let e=I();i(0,"li",108)(1,"p",221)(2,"a",222),n(3),t(),i(4,"span",223)(5,"i",224),S("click",function(){let r=b(e).$implicit;p();let c=w(9),g=p(2);return y(g.OnClickDeleteDoc(r.name,c))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function O2(a,d){if(a&1){let e=I();i(0,"div",211)(1,"div",51)(2,"div",28)(3,"label",212),n(4,"Terms & Conditions:"),t(),x(5,"textarea",213),t()(),i(6,"div",214)(7,"div",215)(8,"input",216,7),S("change",function(r){b(e);let c=p(2);return y(c.fileChange(r))}),t(),i(10,"label",217),u(11,D2,2,0,"span",39)(12,T2,2,0,"span",39),t(),u(13,w2,1,2,"app-loader",35),t()(),i(14,"div",51)(15,"ul",218),u(16,P2,6,2,"li",219),t()()()}if(a&2){let e=p(2);l(8),s("title",e.termsDocsTooltip)("disabled",e.loadingStates.termsDocs),l(3),s("ngIf",!e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(),s("ngIf",e.loadingStates.termsDocs),l(3),s("ngForOf",e.uploadedTermsDocs)}}function k2(a,d){if(a&1&&(i(0,"div",225)(1,"div",226)(2,"div",78)(3,"ul",227)(4,"li",228)(5,"b",15),n(6,"Gross Total:"),t(),i(7,"span",229),n(8),_(9,"currencyFormat"),t()(),i(10,"li",228)(11,"b",15),n(12,"Discount:"),t(),i(13,"span",230),n(14),_(15,"currencyFormat"),t()(),i(16,"li",228)(17,"b",15),n(18,"Net Total:"),t(),i(19,"span",229),n(20),_(21,"currencyFormat"),t()(),i(22,"li",231)(23,"span",15),n(24,"SGST:"),t(),i(25,"span",229),n(26),_(27,"currencyFormat"),t()(),i(28,"li",231)(29,"span",15),n(30,"CGST:"),t(),i(31,"span",229),n(32),_(33,"currencyFormat"),t()(),i(34,"li",231)(35,"span",15),n(36,"IGST:"),t(),i(37,"span",229),n(38),_(39,"currencyFormat"),t()(),i(40,"li",228)(41,"b",15),n(42,"Total Tax Amount:"),t(),i(43,"span",229),n(44),_(45,"currencyFormat"),t()(),i(46,"li",228)(47,"b",15),n(48,"Logistics:"),t(),i(49,"span",229),n(50),_(51,"currencyFormat"),t()(),i(52,"li",228)(53,"b",15),n(54,"Insurance:"),t(),i(55,"span",229),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",232)(59,"span",15),n(60,"Total Payable Amount:"),t(),i(61,"span",229),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.supplierData==null?null:e.supplierData.gross)),l(6),m("(-) ",v(15,12,e.supplierData==null?null:e.supplierData.discount_amount),""),l(6),f(v(21,14,e.supplierData==null?null:e.supplierData.net_charges)),l(6),f(v(27,16,e.supplierData==null?null:e.supplierData.sgst)),l(6),f(v(33,18,e.supplierData==null?null:e.supplierData.cgst)),l(6),f(v(39,20,e.supplierData==null?null:e.supplierData.igst)),l(6),f(v(45,22,e.supplierData==null?null:e.supplierData.gst_amount)),l(6),f(v(51,24,e.supplierData==null?null:e.supplierData.logistics_charges)),l(6),f(v(57,26,e.supplierData==null?null:e.supplierData.insurance_charges)),l(6),f(v(63,28,e.supplierData==null?null:e.supplierData.total_amount))}}function F2(a,d){if(a&1&&(i(0,"div",225)(1,"div",226)(2,"div",78)(3,"ul",227)(4,"li",228)(5,"b",15),n(6,"Gross Total:"),t(),i(7,"span",229),n(8),_(9,"currencyFormat"),t()(),i(10,"li",228)(11,"b",15),n(12,"Discount:"),t(),i(13,"span",230),n(14),_(15,"currencyFormat"),t()(),i(16,"li",228)(17,"b",15),n(18,"Net Total:"),t(),i(19,"span",229),n(20),_(21,"currencyFormat"),t()(),i(22,"li",231)(23,"span",15),n(24,"SGST:"),t(),i(25,"span",229),n(26),_(27,"currencyFormat"),t()(),i(28,"li",231)(29,"span",15),n(30,"CGST:"),t(),i(31,"span",229),n(32),_(33,"currencyFormat"),t()(),i(34,"li",231)(35,"span",15),n(36,"IGST:"),t(),i(37,"span",229),n(38),_(39,"currencyFormat"),t()(),i(40,"li",228)(41,"b",15),n(42,"Total Tax Amount:"),t(),i(43,"span",229),n(44),_(45,"currencyFormat"),t()(),i(46,"li",228)(47,"b",15),n(48,"Logistics:"),t(),i(49,"span",229),n(50),_(51,"currencyFormat"),t()(),i(52,"li",228)(53,"b",15),n(54,"Insurance:"),t(),i(55,"span",229),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",232)(59,"span",15),n(60,"Total Payable Amou
1nt:"),t(),i(61,"span",229),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.supplierData==null?null:e.supplierData.gross)),l(6),m("(-) ",v(15,12,e.supplierData==null?null:e.supplierData.discount_amount),""),l(6),f(v(21,14,e.supplierData==null?null:e.supplierData.net_charges)),l(6),f(v(27,16,e.supplierData==null?null:e.supplierData.sgst)),l(6),f(v(33,18,e.supplierData==null?null:e.supplierData.cgst)),l(6),f(v(39,20,e.supplierData==null?null:e.supplierData.igst)),l(6),f(v(45,22,e.supplierData==null?null:e.supplierData.gst_amount)),l(6),f(v(51,24,e.supplierData==null?null:e.supplierData.logistics_charges)),l(6),f(v(57,26,e.supplierData==null?null:e.supplierData.insurance_charges)),l(6),f(v(63,28,e.supplierData==null?null:e.supplierData.total_amount))}}function M2(a,d){if(a&1&&(i(0,"div",225)(1,"div",226)(2,"div",78)(3,"ul",227)(4,"li",228)(5,"b",15),n(6,"Gross Total:"),t(),i(7,"span",229),n(8),_(9,"currencyFormat"),t()(),i(10,"li",228)(11,"b",15),n(12,"Discount:"),t(),i(13,"span",230),n(14),_(15,"currencyFormat"),t()(),i(16,"li",228)(17,"b",15),n(18,"Net Total:"),t(),i(19,"span",229),n(20),_(21,"currencyFormat"),t()(),i(22,"li",231)(23,"span",15),n(24,"SGST:"),t(),i(25,"span",229),n(26),_(27,"currencyFormat"),t()(),i(28,"li",231)(29,"span",15),n(30,"CGST:"),t(),i(31,"span",229),n(32),_(33,"currencyFormat"),t()(),i(34,"li",231)(35,"span",15),n(36,"IGST:"),t(),i(37,"span",229),n(38),_(39,"currencyFormat"),t()(),i(40,"li",228)(41,"b",15),n(42,"Total Tax Amount:"),t(),i(43,"span",229),n(44),_(45,"currencyFormat"),t()(),i(46,"li",228)(47,"b",15),n(48,"Logistics:"),t(),i(49,"span",229),n(50),_(51,"currencyFormat"),t()(),i(52,"li",228)(53,"b",15),n(54,"Insurance:"),t(),i(55,"span",229),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",232)(59,"span",15),n(60,"Total Payable Amount:"),t(),i(61,"span",229),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.supplierData==null?null:e.supplierData.gross)),l(6),m("(-) ",v(15,12,e.supplierData==null?null:e.supplierData.discount_amount),""),l(6),f(v(21,14,e.supplierData==null?null:e.supplierData.net_charges)),l(6),f(v(27,16,e.supplierData==null?null:e.supplierData.sgst)),l(6),f(v(33,18,e.supplierData==null?null:e.supplierData.cgst)),l(6),f(v(39,20,e.supplierData==null?null:e.supplierData.igst)),l(6),f(v(45,22,e.supplierData==null?null:e.supplierData.gst_amount)),l(6),f(v(51,24,e.supplierData==null?null:e.supplierData.logistics_charges)),l(6),f(v(57,26,e.supplierData==null?null:e.supplierData.insurance_charges)),l(6),f(v(63,28,e.supplierData==null?null:e.supplierData.total_amount))}}function A2(a,d){if(a&1){let e=I();i(0,"div",41)(1,"form",42)(2,"div",43)(3,"div",44)(4,"div",45)(5,"h2",46)(6,"a",47),x(7,"i",48),t(),u(8,jv,2,0,"span",39)(9,$v,2,0,"span",39),t()(),i(10,"div",49)(11,"button",50),S("click",function(){b(e);let r=p();return y(r.toDealRoom())}),u(12,zv,4,0,"span",40)(13,Wv,6,0,"span",40),t()()()(),i(14,"div",51)(15,"div",52)(16,"div",53)(17,"h3",54),u(18,Qv,2,0,"span",39)(19,Yv,2,0,"span",39),t()(),i(20,"div",55)(21,"div",11)(22,"div",56)(23,"div",28)(24,"label",57),u(25,Hv,2,0,"span",39)(26,Kv,2,0,"span",39),i(27,"sup",30),n(28,"*"),t()(),i(29,"div",58)(30,"input",59),S("input",function(){b(e);let r=p();return y(r.OnChangeCreateDate())}),t(),u(31,Xv,3,2,"div",32),t()()(),i(32,"div",56)(33,"div",28)(34,"label",57),u(35,eg,2,0,"span",39)(36,tg,2,0,"span",39),i(37,"sup",30),n(38,"*"),t()(),i(39,"div",58),x(40,"input",60),u(41,ag,3,2,"div",32),t()()(),i(42,"div",56)(43,"div",28)(44,"label",57)(45,"span",15),n(46,"Payment Mode"),t(),i(47,"sup",30),n(48,"*"),t()(),i(49,"select",61)(50,"option",62),n(51,"Select "),t(),i(52,"option",15),n(53,"Online Transfer"),t(),i(54,"option",15),n(55,"Cash"),t(),i(56,"option",15),n(57,"Credit Card"),t(),i(58,"option",15),n(59,"Debit Card"),t()(),u(60,lg,2,1,"div",32),t()(),i(61,"div",63)(62,"div",28)(63,"p",64)(64,"span",15),n(65,"Do you want Additional Services Documents?"),t(),i(66,"sup",30),n(67,"*"),t()(),i(68,"div",65)(69,"div",66),x(70,"input",67),i(71,"label",68),n(72,"Yes"),t()(),i(73,"div",66),x(74,"input",69),i(75,"label",70),n(76,"No"),t()()()()(),u(77,dg,13,5,"div",71),t()()(),i(78,"div",52)(79,"div",53)(80,"h3",72),n(81,"
1Supplier Details"),t()(),i(82,"div",55)(83,"div",11)(84,"div",73),u(85,cg,1,2,"app-loader",74),t(),u(86,mg,5,1,"div",75)(87,xg,20,6,"div",75),t()()(),i(88,"div",52)(89,"div",53)(90,"h3",72),n(91,"Buyer Details"),t()(),i(92,"div",55)(93,"div",11)(94,"div",76)(95,"div",77)(96,"div",78)(97,"p",79),n(98,"Shipping Address "),t(),u(99,bg,5,1,"p",80)(100,yg,5,0,"p",80),t()()(),i(101,"div",76)(102,"div",77)(103,"div",78)(104,"p",79),n(105,"Billing Address "),t(),i(106,"div",81)(107,"label",82),n(108,"GST NO"),t(),i(109,"select",83),S("change",function(r){b(e);let c=p();return y(c.onGSTSelect(r))}),u(110,Sg,2,0,"option",84)(111,Cg,2,0,"option",85)(112,Eg,2,2,"option",86),i(113,"option",87),x(114,"i",88),i(115,"span",15),n(116,"Add New GST"),t()()()(),u(117,Ig,5,1,"p",80)(118,Dg,5,0,"p",80),t()()(),i(119,"div",89)(120,"div",90)(121,"div",78)(122,"div",91),u(123,Tg,4,3,"div",92)(124,wg,2,0,"small",39)(125,Pg,2,2,"div",40),t(),i(126,"div",93)(127,"input",94),S("change",function(r){b(e);let c=p();return y(c.OnLogoChange(r))}),t(),i(128,"label",95),n(129),i(130,"span",15),n(131,"Logo"),t()()()()()()()()(),i(132,"div",52)(133,"div",96)(134,"h3",72),n(135," Order Summary "),t()(),i(136,"div",97)(137,"div",98)(138,"div",99)(139,"div",100)(140,"table",101)(141,"thead",102)(142,"tr"),u(143,Og,4,2,"th",103),t()(),F(144,104),u(145,Gg,2,1,"tbody",105)(146,Qg,2,1,"tbody",105)(147,Xg,2,1,"tbody",105),M(),t()()()()()(),i(148,"div",52)(149,"div",53)(150,"h3",72),n(151,"Order Terms & Fulfillment"),t()(),i(152,"div",55)(153,"div",106)(154,"ul",107)(155,"li",108)(156,"p",82),n(157,"Would you like to pay in installments?"),t()(),i(158,"li",108)(159,"label",109)(160,"input",110),S("change",function(r){b(e);let c=p();return y(c.OnChangePayment(r))}),t(),i(161,"span")(162,"span",15),n(163,"NO"),t(),i(164,"span",15),n(165,"YES"),t()(),x(166,"a"),t()(),u(167,e2,5,0,"li",111),t(),u(168,c2,4,1,"div",112),t(),u(169,b2,16,2,"div",113),t()(),i(170,"div",114)(171,"div",115)(172,"div",116)(173,"div",53)(174,"h3",72),n(175,"Terms & Conditions"),t()(),i(176,"div",55)(177,"div",104),u(178,I2,17,6,"div",117)(179,O2,17,6,"div",117),t()()()(),F(180,104),u(181,k2,64,30,"div",118)(182,F2,64,30,"div",118)(183,M2,64,30,"div",118),M(),t()()()()}if(a&2){let e,o,r,c,g,h,C=p();l(),s("formGroup",C.sentToSupplierForm),l(7),s("ngIf",!C.isWorkOrder),l(),s("ngIf",C.isWorkOrder),l(2),s("disabled",C.loadingStates.dealRoom),l(),s("ngIf",!C.loadingStates.dealRoom),l(),s("ngIf",C.loadingStates.dealRoom),l(5),s("ngIf",!C.isWorkOrder),l(),s("ngIf",C.isWorkOrder),l(6),s("ngIf",!C.isWorkOrder),l(),s("ngIf",C.isWorkOrder),l(4),s("min",C.curDate),l(),s("ngIf",((e=C.sentToSupplierForm.get("pocDate"))==null?null:e.touched)&&((e=C.sentToSupplierForm.get("pocDate"))==null?null:e.dirty)||C.submitted),l(4),s("ngIf",!C.isWorkOrder),l(),s("ngIf",C.isWorkOrder),l(4),s("min",C.minDate),l(),s("ngIf",((o=C.sentToSupplierForm.get("poExpairyDate"))==null?null:o.touched)&&((o=C.sentToSupplierForm.get("poExpairyDate"))==null?null:o.dirty)||C.submitted),l(19),s("ngIf",((r=C.sentToSupplierForm.get("paymentMode"))==null?null:r.touched)&&((r=C.sentToSupplierForm.get("paymentMode"))==null?null:r.dirty)||C.submitted),l(17),s("ngIf",((c=C.sentToSupplierForm.get("additionsServices"))==null?null:c.value)==="Yes"),l(8),s("ngIf",C.loadingStates.orderDetails),l(),s("ngIf",C.supplierData&&!C.supplierData.seller_details),l(),s("ngIf",C.supplierData&&C.supplierData.seller_details),l(12),s("ngIf",C.shippingAddress),l(),s("ngIf",!C.shippingAddress),l(10),s("ngIf",C.supplierData==null?null:C.supplierData.buyer_gst_list),l(),s("ngIf",(C.supplierData==null?null:C.supplierData.buyer_gst_list)==0),l(),s("ngForOf",C.supplierData==null?null:C.supplierData.buyer_gst_list),l(5),s("ngIf",C.billingAddress),l(),s("ngIf",!C.billingAddress),l(5),s("ngIf",C.logoViewUrl.data),l(),s("ngIf",!C.logoViewUrl.data&&!C.logoViewUrl.isLoading),l(),s("ngIf",C.logoViewUrl.isLoading),l(2),s("title",C.logoViewUrl.data?C.logoFileName||"Logo uploaded":"No file chosen"),l(2),m("",C.logoViewUrl.data?"Change":"Choose"," "),l(14),s("ngForOf",C.getTableHeaders(C.supplierData==null?null:C.supplierData.source)),l(),s("ngSwitch",C.supplierData==null?null:C.supplierData.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","DirectBuy"),l(20),s("ngIf",!((g=C.sentToSupplierForm.get("paymentdisable"))!=null&&g.value)),l(),s("ngIf",!((h=C.sentToSupplierForm.get("paymentdisable"))!=null&&h.value)),l(),s("ngIf",!C.isWorkOrder),l(8),s("ngSwitch",C.supplierData==null?null:C.supplierData.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitch",C.supplierData==null?null:C.supplierData.source),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction")}}function N2(a,d){a&1&&(i(0,"span"),x(1,"i",234),i(2,"span",15),n(3,"Send to Seller"),t()())}function V2(a,d){a&1&&(i(0,"span")(1,"div",120)(2,"span",121),n(3,"Loading..."),t()(),i(4,"span",15),n(5,"Sending..."),t()())}function B2(a,d){if(a&1){let e=I();i(0,"button",233),S("click",function(){b(e);let r=p();return y(r.SendToSupplier())}),u(1,N2,4,0,"span",40)(2,V2,6,0,"span",40),t()}if(a&2){let e=p();s("disabled",e.loadingStates.sendToSupplier),l(),s("ngIf",!e.loadingStates.sendToSupplier),l(),s("ngIf",e.loadingStates.sendToSupplier)}}function R2(a,d){a&1&&(i(0,"span"),x(1,"i",234),i(2,"span",15),n(3,"Send to Seller"),t()())}function L2(a,d){a&1&&(i(0,"span")(1,"div",120)(2,"span",121),n(3,"Loading..."),t()(),i(4,"span",15),n(5,"Sending..."),t()())}function q2(a,d){if(a&1){let e=I();i(0,"button",235),S("click",function(){b(e);let r=p();return y(r.RegeneratePo())}),u(1,R2,4,0,"span",40)(2,L2,6,0,"span",40),t()}if(a&2){let e=p();s("disabled",e.loadingStates.sendToSupplier),l(),s("ngIf",!e.loadingStates.sendToSupplier),l(),s("ngIf",e.loadingStates.sendToSupplier)}}function G2(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order"),t())}function U2(a,d){a&1&&(i(0,"span",15),n(1,"Work Order"),t())}function j2(a,d){if(a&1&&x(0,"img",258),a&2){let e=p(2);s("src",e.logoViewUrl.data,q)}}function $2(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order Details"),t())}function z2(a,d){a&1&&(i(0,"span",15),n(1,"Work Order Details"),t())}function W2(a,d){a&1&&(i(0,"span",15),n(1,"PO No."),t())}function Q2(a,d){a&1&&(i(0,"span",15),n(1,"WO No."),t())}function Y2(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order Creation Date"),t())}function H2(a,d){a&1&&(i(0,"span",15),n(1,"Work Order Creation Date"),t())}function K2(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order Expiry Date"),t())}function Z2(a,d){a&1&&(i(0,"span",15),n(1,"Work Order Expiry Date"),t())}function J2(a,d){a&1&&(i(0,"span",15),n(1,"Purchase Order State/ City"),t())}function X2(a,d){a&1&&(i(0,"span",15),n(1,"Work Order State/ City"),t())}function ef(a,d){a&1&&(i(0,"span",15),n(1,"Place Of Supply "),t())}function tf(a,d){a&1&&(i(0,"span",15),n(1,"Place Of Service "),t())}function nf(a,d){if(a&1&&(i(0,"span",141),n(1),t()),a&2){let e=p(2);l(),f(e.supplierData==null||e.supplierData.seller_details==null?null:e.supplierData.seller_details.company_name)}}function af(a,d){a&1&&(i(0,"span",138),n(1,"Not available"),t())}function rf(a,d){if(a&1&&(i(0,"span",141),n(1),t()),a&2){let e=p(2);l(),f(e.supplierData.seller_gst_list[0])}}function lf(a,d){a&1&&(i(0,"span",138),n(1,"Not available"),t())}function of(a,d){if(a&1&&(i(0,"span",141),n(1),t()),a&2){let e=p(2);l(),se(" ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.street,", ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.region,", ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.city,", ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.postcode," ")}}function sf(a,d){a&1&&(i(0,"span",138),n(1," No Address Found "),t())}function df(a,d){if(a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",141),n(4),t()()),a&2){let e=p(2);l(4),se(" ",e.shippingAddress==null?null:e.shippingAddress.street,", ",e.shippingAddress==null?null:e.shippingAddress.region,", ",e.shippingAddress==null?null:e.shippingAddress.city,", ",e.shippingAddress==null?null:e.shippingAddress.postcode," ")}}function cf(a,d){a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",138),n(4," Not available "),t()())}function pf(a,d){if(a&1&&(i(0,"p",259),n(1),t()),a&2){let e,o=p(2);l(),m(" ",(e=o.sentToSupplierForm.get("buyerGSTnumber"))==null?null:e.value,"")}}function mf(a,d){a&1&&(i(0,"p",260),n(1,"Not Selected"),t())}function uf(a,d){if(a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",141),n(4),t()()),a&2){let e=p(2);l(4),se(" ",e.billingAddress==null?null:e.billingAddress.street,", ",e.billingAddress==null?null:e.billingAddress.region,", ",e.billingAddress==null?null:e.billingAddress.city,", ",e.billingAddress==null?null:e.billingAddress.postcode," ")}}function _f(a,d){a&1&&(i(0,"p",142)(1,"b",143),n(2,"Address:"),t(),i(3,"span",138),n(4," Not available "),t()())}function vf(a,d){a&1&&(i(0,"span",15),n(1," Product Name"),t())}function gf(a,d){a&1&&(i(0,"span",15),n(1," Service Name"),t())}function ff(a,d){if(a&1&&(i(0,"thead",102)(1,"tr")(2,"th"),u(3,vf,2,0,"span",39)(4,gf,2,0,"span",39),t(),i(5,"th",15),n(6," Offered Qty"),t(),i(7,"th",15),n(8," Required Qty"),t(),i(9,"th",15),n(10," Quoted"),t(),i(11,"th",15),n(12," Gross Total"),t(),i(13,"th",15),n(14," Discount"),t(),i(15,"th",15),n(16," Tax"),t(),i(17,"th",15),n(18," Total Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function hf(a,d){a&1&&(i(0,"span",15),n(1," Product Name"),t())}function xf(a,d){a&1&&(i(0,"span",15),n(1," Service Name"),t())}function bf(a,d){if(a&1&&(i(0,"thead",102)(1,"tr")(2,"th"),u(3,hf,2,0,"span",39)(4,xf,2,0,"span",39),t(),i(5,"th",15),n(6," Offered Qty"),t(),i(7,"th",15),n(8," Required Qty"),t(),i(9,"th",15),n(10," Quoted"),t(),i(11,"th",15),n(12," Gross Total"),t(),i(13,"th",15),n(14," Discount"),t(),i(15,"th",15),n(16," Tax"),t(),i(17,"th",15),n(18," Total Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function yf(a,d){a&1&&(i(0,"span",15),n(1," Product Name"),t())}function Sf(a,d){a&1&&(i(0,"span",15),n(1," Service Name"),t())}function Cf(a,d){if(a&1&&(i(0,"thead",102)(1,"tr")(2,"th"),u(3,yf,2,0,"span",39)(4,Sf,2,0,"span",39),t(),i(5,"th",15),n(6," Quantity"),t(),i(7,"th",15),n(8," Bid Total Value"),t(),i(9,"th",15),n(10,"Logistics "),t(),i(11,"th",15),n(12,"Tax"),t(),i(13,"th",15),n(14,"Net Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function Ef(a,d){if(a&1&&(i(0,"span",158),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function If(a,d){if(a&1&&(i(0,"span",158),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Df(a,d){if(a&1&&(i(0,"span",158),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Tf(a,d){if(a&1&&(F(0),i(1,"div",155),n(2),t(),i(3,"p",156),u(4,Ef,2,2,"span",157)(5,If,2,2,"span",157)(6,Df,2,2,"span",157),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function wf(a,d){if(a&1&&(F(0),i(1,"div",155)(2,"div")(3,"p",160)(4,"span",15),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",160),n(9),_(10,"currencyFormat"),t(),i(11,"p",160),n(12),_(13,"currencyFormat"),t(),i(14,"p",160),n(15),_(16,"currencyFormat"),t(),i(17,"p",160),n(18),_(19,"currencyFormat"),t(),i(20,"p",160),n(21),_(22,"currencyFormat"),t(),i(23,"p",160),n(24),_(25,"currencyFormat"),t(),i(26,"p",160),n(27),_(28,"currencyFormat"),t(),i(29,"p",160),n(30),_(31,"currencyFormat"),t(),x(32,"div",161),i(33,"p",162)(34,"b"),n(35),_(36,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(3),m(" Discount: ",v(10,16,e.discount)," "),l(3),m(" Net Total: ",v(13,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(16,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(19,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(22,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(25,26,e.igst),""),l(3),m(" Logistics: ",v(28,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(31,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(36,32,e.total_amount)," ")}}function Pf(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span"),n(3),t(),u(4,Tf,7,4,"ng-template",null,5,P),x(6,"i",153),i(7,"p")(8,"small"),n(9),t()()(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),i(17,"small"),n(18,"/unit"),t()(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),t(),i(28,"td"),n(29),_(30,"currencyFormat"),u(31,wf,37,34,"ng-template",null,6,P),x(33,"i",153),t()()),a&2){let e=d.$implicit,o=w(5),r=w(32);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(3),m("SKU ID: ",e.display_item_id,""),l(2),m("",e.offered_qty," "),l(2),f(e.required_qty),l(2),m("",v(16,11,e.unit_price)," "),l(5),f(v(21,13,e.gross_total)),l(3),f(v(24,15,e.discount)),l(3),f(v(27,17,e.gst)),l(3),m(" ",v(30,19,e.total_amount)," "),l(4),s("ngbPopover",r)}}function Of(a,d){if(a&1&&(i(0,"tbody"),u(1,Pf,34,21,"tr",103),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function kf(a,d){if(a&1&&(i(0,"span",158),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Ff(a,d){if(a&1&&(i(0,"span",158),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Mf(a,d){if(a&1&&(i(0,"span",158),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Af(a,d){if(a&1&&(F(0),i(1,"div",155),n(2),t(),i(3,"p",156),u(4,kf,2,2,"span",157)(5,Ff,2,2,"span",157)(6,Mf,2,2,"span",157),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function Nf(a,d){if(a&1&&(F(0),i(1,"div",155)(2,"div")(3,"p",160)(4,"span",15),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",160),n(9),_(10,"currencyFormat"),t(),i(11,"p",160),n(12),_(13,"currencyFormat"),t(),i(14,"p",160),n(15),_(16,"currencyFormat"),t(),i(17,"p",160),n(18),_(19,"currencyFormat"),t(),i(20,"p",160),n(21),_(22,"currencyFormat"),t(),i(23,"p",160),n(24),_(25,"currencyFormat"),t(),i(26,"p",160),n(27),_(28,"currencyFormat"),t(),i(29,"p",160),n(30),_(31,"currencyFormat"),t(),x(32,"div",161),i(33,"p",162)(34,"b"),n(35),_(36,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(3),m(" Discount: ",v(10,16,e.discount)," "),l(3),m(" Net Total: ",v(13,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(16,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(19,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(22,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(25,26,e.igst),""),l(3),m(" Logistics: ",v(28,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(31,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(36,32,e.total_amount)," ")}}function Vf(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span"),n(3),t(),u(4,Af,7,4,"ng-template",null,5,P),x(6,"i",153),i(7,"p")(8,"small"),n(9),t()()(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),i(17,"small"),n(18,"/unit"),t()(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),t(),i(28,"td"),n(29),_(30,"currencyFormat"),u(31,Nf,37,34,"ng-template",null,6,P),x(33,"i",153),t()()),a&2){let e=d.$implicit,o=w(5),r=w(32);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(3),m("SKU ID: ",e.display_item_id,""),l(2),m("",e.offered_qty," "),l(2),f(e.required_qty),l(2),m("",v(16,11,e.unit_price)," "),l(5),f(v(21,13,e.gross_total)),l(3),f(v(24,15,e.discount)),l(3),f(v(27,17,e.gst)),l(3),m(" ",v(30,19,e.total_amount)," "),l(4),s("
1ngbPopover",r)}}function Bf(a,d){if(a&1&&(i(0,"tbody"),u(1,Vf,34,21,"tr",103),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Rf(a,d){if(a&1&&(F(0),i(1,"div",155),n(2),t(),i(3,"p",164),n(4),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),m(" ",e.short_description," ")}}function Lf(a,d){if(a&1&&(F(0),i(1,"div",155)(2,"div")(3,"p",160),n(4),t(),i(5,"p",160),n(6),t(),i(7,"p",160),n(8),t(),x(9,"div",161),i(10,"p",162)(11,"b"),n(12),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Bid Total Value: \u20B9 ",e.gross_total," "),l(2),m(" Tax: \u20B9 ",e.gst,""),l(2),m(" Logistics: \u20B9 ",e.logistics_charges," "),l(4),m("Net Price: \u20B9 ",e.net_amount," ")}}function qf(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),u(5,Rf,5,2,"ng-template",null,5,P),x(7,"i",153),t(),i(8,"td"),n(9),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),u(18,Lf,13,4,"ng-template",null,6,P),x(20,"i",153),t()()),a&2){let e=d.$implicit,o=w(6),r=w(19);l(2),m(" ",e.display_item_id,""),l(2),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),m("",e.required_qty," "),l(2),m("\u20B9 ",e.gross_total,""),l(2),m("\u20B9 ",e.logistics_charges,""),l(2),m("\u20B9 ",e.gst,""),l(2),m("\u20B9 ",e.net_amount," "),l(3),s("ngbPopover",r)}}function Gf(a,d){if(a&1&&(i(0,"tbody"),u(1,qf,21,9,"tr",103),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Uf(a,d){if(a&1&&(i(0,"div",245)(1,"div",51)(2,"div",28)(3,"label",261),n(4,"Terms & Conditions:"),t(),i(5,"p",262),n(6),t()()()()),a&2){let e,o=p(2);l(6),m(" ",(e=o.sentToSupplierForm.get("termsandConditions"))==null?null:e.value,"")}}function jf(a,d){if(a&1&&(i(0,"li",108)(1,"p",221)(2,"a",222),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function $f(a,d){if(a&1&&(i(0,"div")(1,"div",226)(2,"div",78)(3,"ul",227)(4,"li",228)(5,"b",15),n(6,"Gross Total:"),t(),i(7,"span",229),n(8),_(9,"currencyFormat"),t()(),i(10,"li",228)(11,"b",15),n(12,"Discount:"),t(),i(13,"span",230),n(14),_(15,"currencyFormat"),t()(),i(16,"li",228)(17,"b",15),n(18,"Net Total:"),t(),i(19,"span",229),n(20),_(21,"currencyFormat"),t()(),i(22,"li",231)(23,"span",15),n(24,"SGST:"),t(),i(25,"span",229),n(26),_(27,"currencyFormat"),t()(),i(28,"li",231)(29,"span",15),n(30,"CGST: "),t(),i(31,"span",229),n(32),_(33,"currencyFormat"),t()(),i(34,"li",231)(35,"span",15),n(36,"IGST:"),t(),i(37,"span",229),n(38),_(39,"currencyFormat"),t()(),i(40,"li",228)(41,"b",15),n(42,"Total Tax Amount:"),t(),i(43,"span",229),n(44),_(45,"currencyFormat"),t()(),i(46,"li",228)(47,"b",15),n(48,"Logistics:"),t(),i(49,"span",229),n(50),_(51,"currencyFormat"),t()(),i(52,"li",228)(53,"b",15),n(54,"Insurance:"),t(),i(55,"span",229),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",232)(59,"span",15),n(60,"Total Payable Amount: "),t(),i(61,"span",229),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.supplierData==null?null:e.supplierData.gross),""),l(6),m("(-) ",v(15,12,e.supplierData==null?null:e.supplierData.discount_amount),""),l(6),m(" ",v(21,14,e.supplierData==null?null:e.supplierData.net_charges),""),l(6),m(" ",v(27,16,e.supplierData==null?null:e.supplierData.sgst),""),l(6),m(" ",v(33,18,e.supplierData==null?null:e.supplierData.cgst),""),l(6),m(" ",v(39,20,e.supplierData==null?null:e.supplierData.igst),""),l(6),m(" ",v(45,22,e.supplierData==null?null:e.supplierData.gst_amount),""),l(6),m(" ",v(51,24,e.supplierData==null?null:e.supplierData.logistics_charges),""),l(6),m(" ",v(57,26,e.supplierData==null?null:e.supplierData.insurance_charges),""),l(6),m(" ",v(63,28,e.supplierData==null?null:e.supplierData.total_amount),"")}}function zf(a,d){if(a&1&&(i(0,"div")(1,"div",226)(2,"div",78)(3,"ul",227)(4,"li",228)(5,"b",15),n(6,"Gross Total:"),t(),i(7,"span",229),n(8),_(9,"currencyFormat"),t()(),i(10,"li",228)(11,"b",15),n(12,"Discount:"),t(),i(13,"span",230),n(14),_(15,"currencyFormat"),t()(),i(16,"li",228)(17,"b",15),n(18,"Net Total:"),t(),i(19,"span",229),n(20),_(21,"currencyFormat"),t()(),i(22,"li",231)(23,"span",15),n(24,"SGST:"),t(),i(25,"span",229),n(26),_(27,"currencyFormat"),t()(),i(28,"li",231)(29,"span",15),n(30,"CGST: "),t(),i(31,"span",229),n(32),_(33,"currencyFormat"),t()(),i(34,"li",231)(35,"span",15),n(36,"IGST:"),t(),i(37,"span",229),n(38),_(39,"currencyFormat"),t()(),i(40,"li",228)(41,"b",15),n(42,"Total Tax Amount:"),t(),i(43,"span",229),n(44),_(45,"currencyFormat"),t()(),i(46,"li",228)(47,"b",15),n(48,"Logistics:"),t(),i(49,"span",229),n(50),_(51,"currencyFormat"),t()(),i(52,"li",228)(53,"b",15),n(54,"Insurance:"),t(),i(55,"span",229),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",232)(59,"span",15),n(60,"Total Payable Amou
1nt: "),t(),i(61,"span",229),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.supplierData==null?null:e.supplierData.gross),""),l(6),m("(-) ",v(15,12,e.supplierData==null?null:e.supplierData.discount_amount),""),l(6),m(" ",v(21,14,e.supplierData==null?null:e.supplierData.net_charges),""),l(6),m(" ",v(27,16,e.supplierData==null?null:e.supplierData.sgst),""),l(6),m(" ",v(33,18,e.supplierData==null?null:e.supplierData.cgst),""),l(6),m(" ",v(39,20,e.supplierData==null?null:e.supplierData.igst),""),l(6),m(" ",v(45,22,e.supplierData==null?null:e.supplierData.gst_amount),""),l(6),m(" ",v(51,24,e.supplierData==null?null:e.supplierData.logistics_charges),""),l(6),m(" ",v(57,26,e.supplierData==null?null:e.supplierData.insurance_charges),""),l(6),m(" ",v(63,28,e.supplierData==null?null:e.supplierData.total_amount),"")}}function Wf(a,d){if(a&1&&(i(0,"p",277)(1,"b",15),n(2,"Note:"),t(),n(3),t()),a&2){let e=p().$implicit;l(3),m(" ",e.note," ")}}function Qf(a,d){if(a&1&&(i(0,"div",269)(1,"div",78)(2,"div",270)(3,"div",271)(4,"h6",272),n(5),t(),i(6,"small",273)(7,"span",15),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",274)(12,"h6",275),n(13),_(14,"currencyFormat"),t()()(),u(15,Wf,4,1,"p",276),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%) "),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function Yf(a,d){if(a&1&&(i(0,"div",266)(1,"h4",267),n(2,"Payment Terms"),t(),u(3,Qf,16,10,"div",268),t()),a&2){let e=p(3);l(3),s("ngForOf",e.previewPaymentTerms)}}function Hf(a,d){if(a&1&&(i(0,"div",285)(1,"div",286)(2,"div",282)(3,"h6",287),n(4),t(),i(5,"small",273)(6,"span",15),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",288)(10,"small",289),n(11,"Quantity"),t(),i(12,"h6",290),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function Kf(a,d){if(a&1&&(i(0,"div",280)(1,"div",281)(2,"div",270)(3,"div",282)(4,"h6",283),n(5),t(),i(6,"small",273)(7,"span",15),n(8,"Timeline:"),t(),n(9),i(10,"span",15),n(11,"day(s)"),t()()()()(),u(12,Hf,14,3,"div",284),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," "),l(3),s("ngForOf",e.products)}}function Zf(a,d){if(a&1&&(i(0,"div",278)(1,"h4",267),n(2,"Shipment Terms"),t(),u(3,Kf,13,3,"div",279),t()),a&2){let e=p(3);l(3),s("ngForOf",e.previewShipmentTerms)}}function Jf(a,d){if(a&1&&(i(0,"div",263)(1,"div",53)(2,"h3",72),n(3,"Order Terms & Fulfillment"),t()(),i(4,"div",55)(5,"div",11),u(6,Yf,4,1,"div",264)(7,Zf,4,1,"div",265),t()()()),a&2){let e=p(2);l(6),s("ngIf",e.previewPaymentTerms.length),l(),s("ngIf",e.previewShipmentTerms.length)}}function Xf(a,d){if(a&1){let e=I();i(0,"div",236)(1,"div",102)(2,"div",21)(3,"div",27)(4,"button",237),S("click",function(){b(e);let r=p();return y(r.OnClickClosePreview())}),n(5,"\xD7"),t(),i(6,"div",11)(7,"div",51)(8,"h3",238),u(9,G2,2,0,"span",39)(10,U2,2,0,"span",39),t()(),i(11,"div",51),u(12,j2,1,1,"img",239),t()(),i(13,"div",52)(14,"div",53)(15,"h3",54),u(16,$2,2,0,"span",39)(17,z2,2,0,"span",39),t()(),i(18,"div",55)(19,"div",240)(20,"div",241)(21,"div",242),u(22,W2,2,0,"span",39)(23,Q2,2,0,"span",39),t(),i(24,"div",243),n(25),t()(),i(26,"div",241)(27,"div",244),n(28,"Additional Services Documents"),t(),i(29,"div",243),n(30),t()(),i(31,"div",241)(32,"div",242),u(33,Y2,2,0,"span",39)(34,H2,2,0,"span",39),t(),i(35,"div",243),n(36),_(37,"date"),t()(),i(38,"div",241)(39,"div",242),u(40,K2,2,0,"span",39)(41,Z2,2,0,"span",39),t(),i(42,"div",243),n(43),_(44,"date"),t()(),i(45,"div",241)(46,"div",242),u(47,J2,2,0,"span",39)(48,X2,2,0,"span",39),t(),i(49,"div",243),n(50),t()(),i(51,"div",241)(52,"div",242),u(53,ef,2,0,"span",39)(54,tf,2,0,"span",39),t(),i(55,"div",243),n(56),t()(),i(57,"div",241)(58,"div",244),n(59,"Payment Mode"),t(),i(60,"div",243),n(61),t()()()()(),i(62,"div",52)(63,"div",53)(64,"h3",72),n(65,"Supplier Details"),t()(),i(66,"div",55)(67,"div",245)(68,"div",51)(69,"div",135)(70,"div",78)(71,"p",136)(72,"span",15),n(73,"Seller Name:"),t(),u(74,nf,2,1,"span",139)(75,af,2,0,"span",137),t(),i(76,"p",136)(77,"span",15),n(78,"GST No:"),t(),u(79,rf,2,1,"span",140)(80,lf,2,0,"ng-template",null,8,P),t(),i(82,"p",136)(83,"span",15),n(84,"Seller Address:"),t(),x(85,"br"),u(86,of,2,4,"span",139)(87,sf,2,0,"span",137),t()()()()()()(),i(88,"div",52)(89,"div",53)(90,"h3",72),n(91,"Buyer Details"),t()(),i(92,"div",55)(93,"div",245)(94,"div",246)(95,"div",77)(96,"div",78)(97,"p",79),n(98,"Shipping Address "),t(),u(99,df,5,4,"p",80)(100,cf,5,0,"p",80),t()()(),i(101,"div",246)(102,"div",135)(103,"div",78)(104,"p",79),n(105,"Billing Address "),t(),i(106,"div",81)(107,"label",82),n(108,"GST NO:\xA0"),t(),u(109,pf,2,1,"p",247)(110,mf,2,0,"p",248),t(),u(111,uf,5,4,"p",80)(112,_f,5,0,"p",80),t()()()()()(),i(113,"div",52)(114,"div",53)(115,"h3",72),n(116,"Order Summary"),t()(),i(117,"div",55)(118,"div",99)(119,"div",249)(120,"table",250),u(121,ff,19,2,"thead",251)(122,bf,19,2,"thead",251)(123,Cf,15,2,"thead",251)(124,Of,2,1,"tbody",105)(125,Bf,2,1,"tbody",105)(126,Gf,2,1,"tbody",105),t()()()()(),i(127,"div",252)(128,"div",253)(129,"div",116)(130,"div",53)(131,"h3",72),n(132,"Terms & Conditions"),t()(),i(133,"div",55),u(134,Uf,7,1,"div",254),i(135,"div",11)(136,"div",51)(137,"ul",218),u(138,jf,4,2,"li",219),t()()()()()(),i(139,"div",255),u(140,$f,64,30,"div",105)(141,zf,64,30,"div",105),t()(),u(142,Jf,8,2,"div",256),t(),i(143,"div",36)(144,"button",257),S("click",function(){b(e);let r=p();return y(r.OnClickClosePreview())}),n(145," Close "),t()()()()()}if(a&2){let e,o,r,c,g,h,C,k=w(81),O=p();l(9),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(2),s("ngIf",O.logoViewUrl.data),l(4),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(5),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(2),f(O.supplierData==null?null:O.supplierData.po_number),l(5),m("",(e=O.sentToSupplierForm.get("additionsServices"))==null?null:e.value," "),l(3),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(2),m(" ",U(37,47,(o=O.sentToSupplierForm.get("pocDate"))==null?null:o.value,"dd-MM-yyyy"),""),l(4),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(2),m(" ",U(44,50,(r=O.sentToSupplierForm.get("poExpairyDate"))==null?null:r.value,"dd-MM-yyyy")," "),l(4),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(2),f(O.shippingAddress==null?null:O.shippingAddress.region),l(3),s("ngIf",!O.isWorkOrder),l(),s("ngIf",O.isWorkOrder),l(2),m("",O.shippingAddress==null?null:O.shippingAddress.region," "),l(5),m(" ",(c=O.sentToSupplierForm.get("paymentMode"))==null?null:c.value,""),l(13),s("ngIf",O.supplierData.seller_details.company_name),l(),s("ngIf",!O.supplierData.seller_details.company_name),l(4),s("ngIf",O.supplierData==null||O.supplierData.seller_gst_list==null?null:O.supplierData.seller_gst_list.length)("ngIfElse",k),l(7),s("ngIf",O.supplierData&&O.supplierData.seller_address&&O.Object.keys(O.supplierData.seller_address).length),l(),s("ngIf",O.supplierData&&(!O.supplierData.seller_address||!O.Object.keys(O.supplierData.seller_address).length)),l(12),s("ngIf",O.shippingAddress),l(),s("ngIf",!O.shippingAddress),l(9),s("ngIf",(g=O.sentToSupplierForm.get("buyerGSTnumber"))==null?null:g.value),l(),s("ngIf",!((h=O.sentToSupplierForm.get("buyerGSTnumber"))!=null&&h.value)),l(),s("ngIf",O.billingAddress),l(),s("ngIf",!O.billingAddress),l(8),s("ngSwitch",O.supplierData==null?null:O.supplierData.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(8),s("ngIf",(C=O.sentToSupplierForm.get("termsandConditions"))==null?null:C.value),l(4),s("ngForOf",O.uploadedTermsDocs),l(),s("ngSwitch",O.supplierData==null?null:O.supplierData.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngIf",O.previewPaymentTerms.length||O.previewShipmentTerms.length)}}function eh(a,d){a&1&&(i(0,"div",124),n(1," GST Number is required"),t())}function th(a,d){a&1&&(i(0,"div",124),n(1," Invalid GST Number format"),t())}function ih(a,d){if(a&1&&(i(0,"div",122),u(1,eh,2,0,"div",123)(2,th,2,0,"div",123),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.addGSTForm.get("gstNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.addGSTForm.get("gstNumber"))==null||o.errors==null?null:o.errors.pattern)}}function nh(a,d){if(a&1&&x(0,"app-loader",220),a&2){let e=p();s("isLoading",e.loadingStates.gstDocs)("useBlockPosition",!0)}}function ah(a,d){a&1&&(i(0,"div",124),n(1,"GST Number is required"),t())}function rh(a,d){if(a&1&&(i(0,"div",122),u(1,ah,2,0,"div",123),t()),a&2){let e,o=p();l(),s("ngIf",(e=o.addGSTForm.get("gstFile"))==null||e.errors==null?null:e.errors.required)}}function lh(a,d){a&1&&(i(0,"span",15),n(1,"Add GST"),t())}function oh(a,d){a&1&&(i(0,"span")(1,"div",120)(2,"span",121),n(3,"Loading..."),t()(),i(4,"span",15),n(5,"Adding..."),t()())}function sh(a,d){if(a&1){let e=I();i(0,"div",291)(1,"div",20)(2,"div",292)(3,"div",293)(4,"button",294),S("click",function(){b(e);let r=p();return y(r.onCloseModel())}),n(5,"\xD7"),t(),i(6,"p",15),n(7,"Are you sure you want to delete? "),t(),i(8,"button",295),S("click",function(){b(e);let r=p();return y(r.deleteDocument())}),n(9,"Yes"),t(),i(10,"button",296),S("click",function(){b(e);let r=p();return y(r.onCloseModel())}),n(11,"No"),t()()()()()}}function Ra(){return a=>{let d=a.value;return d==null||d===""||Number(d)>0?null:{greaterThanZero:!0}}}var La=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O){this.router=e,this.activatedRoute=o,this.financeOrderService=r,this.fb=c,this.dialog=g,this.snackBar=h,this.notificationService=C,this.drService=k,this.navService=O,this.isRegenerate=!1,this.paymentCheck=!1,this.shipmentCheck=!1,this.imageUrl="",this.logoViewUrl={data:null,isLoading:!1},this.logoFileName="",this.uploadedTermsDocs=[],this.isBuyer=!1,this.isSeller=!1,this.subscribedObservables=[],this.Object=Object,this.loadingStates={orderDetails:!1,sendToSupplier:!1,terms
1Docs:!1,gstDocs:!1,addGST:!1,dealRoom:!1},this.announcer=Dn(Ln),this.addOnBlur=!0,this.separatorKeysCodes=[13,188],this.supplierDocuments=[];var Q=new Date;this.curDate=Q.getFullYear()+"-"+("0"+(Q.getMonth()+1)).slice(-2)+"-"+("0"+Q.getDate()).slice(-2)}ngOnInit(){this.buildForm(),this.activatedRoute.queryParams.subscribe(o=>{this.poId=o.id,this.isRegenerate=String(o.regenerate)==="true",this.GetOrderDetailsByPO()});let e=this.navService.currentStatus.subscribe(o=>{o==="B"||o===""?(this.isBuyer=!0,this.isSeller=!1):(this.isSeller=!0,this.isBuyer=!1)});this.subscribedObservables=[e],this.minDate=this.curDate}ngAfterViewInit(){$("#addGSTModal").on("hidden.bs.modal",()=>{this.resetBuyerGST()})}ngOnDestroy(){this.unsubscribeAllObservables(this.subscribedObservables)}unsubscribeAllObservables(e){e.forEach(o=>o.unsubscribe())}supplierDocumentsValidator(e){return this.sentToSupplierForm&&this.sentToSupplierForm.get("additionsServices")?.value==="Yes"&&(!this.supplierDocuments||this.supplierDocuments.length===0)?{required:!0}:null}get totalAmount(){return Math.round(this.supplierData?.gross-this.supplierData?.discount_amount+this.supplierData?.gst_amount+this.supplierData?.shipping_charges+this.supplierData?.logistics_charges+this.supplierData?.insurance_charges)}get isWorkOrder(){return String(this.supplierData?.order_type||"").toUpperCase()==="WO"}OnChangeCreateDate(){let e=this.sentToSupplierForm.get("pocDate").value,o=new Date,r=o.getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2);if(e<r){var c=new Date(r);let g=c.getFullYear()+"-"+("0"+(c.getMonth()+1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2);this.minDate=g}else{var c=new Date(e);let h=c.getFullYear()+"-"+("0"+(c.getMonth()+1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2);this.minDate=h}this.sentToSupplierForm.get("poExpairyDate").setValue("")}buildForm(){this.sentToSupplierForm=this.fb.group({buyerGSTnumber:[null],pocDate:[this.curDate,[E.required,pi()]],poExpairyDate:["",[E.required,pi()]],paymentMode:["",E.required],termsandConditions:[""],additionsServices:["Yes"],supplierDocuments:["",this.supplierDocumentsValidator.bind(this)],paymentdisable:[!0],shipmentDisable:[!0]}),this.addGSTForm=this.fb.group({gstNumber:["",[E.required,E.pattern(/^([0]{1}[1-9]{1}|[1-2]{1}[0-9]{1}|[3]{1}[0-7]{1})([A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1})$/)]],gstFile:["",[E.required,E.minLength(1)]]}),this.sentToSupplierForm.get("additionsServices")?.valueChanges.subscribe(()=>{this.sentToSupplierForm.get("supplierDocuments")?.updateValueAndValidity()})}paymentFormArray(){return this.paymentCheck==!0?this.fb.group({paymentTitle:["",E.required],payment:["",[E.required,Ra()]],timeline:["",[E.required,pi()]],note:[""]}):this.fb.group({paymentTitle:[""],payment:[""],timeline:[""],note:[""]})}asnDetails(){return this.shipmentCheck==!0?this.fb.group({shipmentTitle:["",E.required],asnTimeline:["",E.required],shipmentDate:["",[pi()]],product:this.fb.array([this.prodDetails()])}):this.fb.group({shipmentTitle:[""],asnTimeline:[""],shipmentDate:[""],product:this.fb.array([this.prodDetails()])})}prodDetails(){return this.shipmentCheck==!0?this.fb.group({productId:["",E.required],noOfProds:["",E.required]}):this.fb.group({productId:[""],noOfProds:[""]})}OnAddProducts(e,o){this.asn.controls[e].get("product").push(this.fb.group({productId:["",E.required],noOfProds:["",E.required]}))}get payment(){return this.sentToSupplierForm.get("payment")}get asn(){return this.sentToSupplierForm.get("asn")}prodArray(e){return this.sentToSupplierForm.get("asn").controls[e].get("product")}get previewPaymentTerms(){if(!this.sentToSupplierForm||this.sentToSupplierForm.get("paymentdisable")?.value)return[];let e=this.supplierData?.total_amount||0;return(this.sentToSupplierForm.value.payment||[]).filter(o=>o.paymentTitle||o.payment).map(o=>({title:o.paymentTitle,percentage:Number(o.payment),amount:+(Number(o.payment)/100*e).toFixed(2),due_date:o.timeline,note:o.note||""}))}get previewShipmentTerms(){return!this.sentToSupplierForm||this.sentToSupplierForm.get("shipmentDisable")?.value?[]:(this.sentToSupplierForm.value.asn||[]).filter(e=>e.shipmentTitle||e.asnTimeline).map(e=>({title:e.shipmentTitle,timeline_days:Number(e.asnTimeline),products:(e.product||[]).map(o=>{let r=this.supplierData?.items?.find(c=>c.product_id===Number(o.productId));return{product_name:r?.product_name||"",sku:r?.display_item_id||"",qty:o.noOfProds}})}))}GetOrderDetailsByPO(){try{this.loadingStates.orderDetails=!0;let e={};e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe(o=>{try{this.supplierData=o.response.data,this.sentToSupplierForm=this.fb.group({buyerGSTnumber:[this.supplierData.buyer_gst_list[0]?.gst_number??""],pocDate:[this.supplierData.expiry_date?this.supplierData.expiry_date:this.sentToSupplierForm.get("pocDate").value,[E.required,pi()]],poExpairyDate:[this.supplierData.expiry_date,[E.required,pi()]],paymentMode:["",E.required],payment:this.fb.array([this.paymentFormArray()]),asn:this.fb.array([this.asnDetails()]),termsandConditions:[""],additionsServices:["Yes"],supplierDocuments:["",this.supplierDocumentsValidator.bind(this)],paymentdisable:[!0],shipmentDisable:[!0]}),this.sentToSupplierForm.get("additionsServices")?.valueChanges.subscribe(()=>{this.sentToSupplierForm.get("supplierDocuments")?.updateValueAndValidity()}),this.supplierData.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.supplierData.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.loadingStates.orderDetails=!1}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1}},o=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1}}addAnotherInstallment(){this.sentToSupplierForm.get("payment").push(this.fb.group({paymentTitle:["",E.required],payment:["",[E.required,Ra()]],timeline:["",[E.required,pi()]],note:[""]}))}OndeleteProducts(e,o){this.sentToSupplierForm.get("asn").controls[e].get("product").removeAt(o)}Ondeletepayment(e){this.sentToSupplierForm.get("payment").removeAt(e)}OnAddAnotherAsn(){this.sentToSupplierForm.get("asn").push(this.fb.group({shipmentTitle:["",E.required],asnTimeline:["",E.required],shipmentDate:["",[pi()]],product:this.fb.array([this.prodDetails()])}))}RemoveShiment(e){this.sentToSupplierForm.get("asn").removeAt(e)}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}OnclickPreview(e){this.dialogref=this.dialog.open(e)}OnClickClosePreview(){this.dialogref.close()}validatePaymentTerms(){return this.sentToSupplierForm.get("paymentdisable").value?!0:this.sentToSupplierForm.value.payment.reduce((r,c)=>r+Number(c.payment||0),0)!==100?(this.notificationService.showError("Payment percentages must add up to 100%"),!1):!0}validateShipmentTerms(){if(!!this.sentToSupplierForm.get("shipmentDisable").value)return!0;for(let o of this.supplierData?.items||[])if(this.sentToSupplierForm.value.asn.reduce((c,g)=>c+g.product.filter(h=>
1Number(h.productId)===Number(o.product_id)).reduce((h,C)=>h+Number(C.noOfProds||0),0),0)!==Number(o.required_qty))return this.notificationService.showError(`Shipment quantities for "${o.product_name}" must match PO quantity (${o.required_qty})`),!1;return!0}SendToSupplier(){try{if(this.submitted=!0,!this.validatePaymentTerms()||!this.validateShipmentTerms())return;if(this.sentToSupplierForm.valid){this.loadingStates.sendToSupplier=!0;let e=A({po_id:""+this.poId},this.buildTermsPayload());this.financeOrderService.GeneratePoSteptwo(e).subscribe({next:o=>{o.responseCode===200?(this.notificationService.showSuccess(o.response.response),this.router.navigate(["finance-management/payable-purchase-orders"],{replaceUrl:!0})):this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToSupplier=!1},error:o=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToSupplier=!1}})}else this.reportInvalidForm()}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToSupplier=!1}}RegeneratePo(){try{if(this.submitted=!0,!this.validateRegenerateQuantities()||!this.validatePaymentTerms()||!this.validateShipmentTerms())return;if(!this.sentToSupplierForm.valid){this.reportInvalidForm();return}this.loadingStates.sendToSupplier=!0;let e=this.supplierData||{},o=h=>(e.address||[]).find(C=>C.addressType===h),r=o("shipping"),c=o("billing"),g=A({source_id:""+(e.source_id??""),source:e.source||"rfq",quote_id:0,po_number:"",shipping_address:r?.rfqAddressId??r?.id??"",billing_address:c?.rfqAddressId??c?.id??"",warehouse_id:e.warehouse_id??"",is_qa_required:e.is_qa_required??"No",order_type:e.order_type||"PO",regenerate_from_po_id:""+this.poId,items:(e.items||[]).map(h=>({item_id:""+(h.item_id??""),product_id:""+h.product_id,product_name:""+(h.product_name??""),qty:""+(h.required_qty??""),required_qty:""+(h.required_qty??""),offered_qty:""+(h.offered_qty??"")}))},this.buildTermsPayload());this.financeOrderService.regeneratePo(g).subscribe({next:h=>{h.responseCode===200?(this.notificationService.showSuccess(typeof h.response=="string"?h.response:h.response?.response||"PO regenerated successfully!"),this.router.navigate(["finance-management/payable-purchase-orders"],{replaceUrl:!0})):this.notificationService.showError(typeof h.response=="string"&&h.response?h.response:"Something went wrong!"),this.loadingStates.sendToSupplier=!1},error:h=>{let C=h?.error?.response;this.notificationService.showError(typeof C=="string"&&C?C:"Something went wrong!"),this.loadingStates.sendToSupplier=!1}})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToSupplier=!1}}validateRegenerateQuantities(){let e=this.supplierData?.source,o=e==="rfq"||e==="auction",r=e==="rfq"||e==="DirectBuy";for(let c of this.supplierData?.items||[]){if(o&&!(Number(c.required_qty)>0))return this.notificationService.showError(`Required quantity for "${c.product_name}" must be greater than 0`),!1;if(r&&!(Number(c.offered_qty)>0))return this.notificationService.showError(`Offered quantity for "${c.product_name}" must be greater than 0`),!1}return!0}buildTermsPayload(){let e=this.sentToSupplierForm.value,o={};o.expiry_date=e.poExpairyDate,o.gst=e.buyerGSTnumber,o.payment_mode=e.paymentMode,o.terms=e.termsandConditions,o.logo_path=this.logoUrl??"",o.service_documents_required=e.additionsServices,o.additionalDocumentsTags=this.supplierDocuments.map(h=>h.value),o.terms_document_path=this.uploadedTermsDocs.map(h=>({path:h.path,filename:h.name})),e.additionsServices==="Yes"&&(o.supplier_documents_required=this.supplierDocuments.map(h=>h.value).toString());let r=!this.sentToSupplierForm.get("paymentdisable").value,c=!this.sentToSupplierForm.get("shipmentDisable").value;o.multiplePaymentTerms=r?"YES":"NO",o.multipleShipmentTerms=c?"YES":"NO";let g=this.supplierData?.total_amount||0;return o.paymentTerms=r?e.payment.map(h=>({title:h.paymentTitle,timeline_days:Number(h.payment),percentage:Number(h.payment),amount:+(Number(h.payment)/100*g).toFixed(2),due_date:h.timeline,note:h.note||"",status:"",gateway_name:"",reference_id:""})):[],o.shipmentTerms=c?e.asn.map(h=>({title:h.shipmentTitle,timeline_days:Number(h.asnTimeline),shipment_date:h.shipmentDate||null,products:h.product.map(C=>{let k=this.supplierData?.items?.find(O=>O.product_id===Number(C.productId));return{product_id:Number(C.productId),product_name:k?.product_name||"",po_qty:k?.required_qty||"",qty:C.noOfProds,unit_price:k?.unit_price||0,discount_percentage:k?.discount||0,gst_percentage:k?.gst_percentage||0,sku:k?.display_item_id||""}})})):[],o}
1reportInvalidForm(){let e=this.collectInvalidControls(this.sentToSupplierForm);console.warn("[SendToSupplier] Invalid controls:",e);let o=e[0]?.path;this.snackBar.open(`Invalid Form: Please check the entered details!${o?" ("+o+")":""}`,"Ok",{duration:5e3}),setTimeout(()=>{this.scrollToFirstItemOfClass("error-field")},500)}collectInvalidControls(e,o=""){let r=[];if(e instanceof zi||e instanceof jn){let c=e.controls;return Object.keys(c).forEach(g=>{r.push(...this.collectInvalidControls(c[g],o?`${o}.${g}`:g))}),r}return e.invalid&&r.push({path:o,errors:e.errors,value:e.value}),r}scrollToFirstItemOfClass(e){let o=document.getElementsByClassName(e);o.length>0&&o[0].scrollIntoView({behavior:"smooth",block:"center"})}OnChangePayment(e){let o=e.target.checked;this.paymentCheck=o,this.sentToSupplierForm.get("paymentdisable").setValue(!o);let r=this.sentToSupplierForm.get("payment");r.clear(),r.push(this.paymentFormArray())}OnChangeShipment(e){let o=e.target.checked;this.shipmentCheck=o,this.sentToSupplierForm.get("shipmentDisable").setValue(!o);let r=this.sentToSupplierForm.get("asn");r.clear(),r.push(this.asnDetails())}get termsDocsTooltip(){let e=(this.uploadedTermsDocs||[]).map(o=>o.name).filter(Boolean);return e.length?e.join(", "):"No file chosen"}fileChange(e){try{let o=e.target.files;if(console.log(e),o.length>0)for(let r=0;r<o.length;r++){let c=o[r];if(this.uploadedTermsDocs.some(h=>(h.name||"").toLowerCase()===c.name.toLowerCase())){this.notificationService.showError(`"${c.name}" is already uploaded. Please choose a different document.`),e.target.value="";continue}this.loadingStates.termsDocs=!0;let g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",this.supplierData.po_number),this.financeOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError("File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},h=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}OnLogoChange(e){try{let o=e.target.files[0];if(o&&!o.type.match(/^image\/(png|jpeg|jpg)$/)){this.notificationService.showError("Only PNG, JPEG and JPG image files are allowed"),e.target.value="";return}let r=e.target.files;if(r.length>0){this.logoViewUrl.isLoading=!0;let c=r[0],g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",this.supplierData.po_number),this.financeOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?(this.logoUrl=h.response.filepath,this.logoViewUrl.data=h.response.fileViewPath,this.logoFileName=c.name):this.notificationService.showError(`Error: ${h.response}`),e.target.value="",this.logoViewUrl.isLoading=!1},h=>{this.notificationService.showError("Something went wrong!"),this.logoViewUrl.isLoading=!1,e.target.value=""})}}catch{this.notificationService.showError("Something went wrong!"),this.logoViewUrl.isLoading=!1,e.target.value=""}}removeLogo(){this.logoUrl=null,this.logoFileName="",this.logoViewUrl={data:null,isLoading:!1}}toDealRoom(){try{this.loadingStates.dealRoom=!0;let e=()=>{switch(this.supplierData.source){case"rfq":return"rfq";case"auction":return"auction";default:return"direct"}},o=()=>{switch(this.supplierData.source){case"rfq":return this.supplierData.dealroom_source_id;case"auction":return this.supplierData.dealroom_source_id;default:return""}},r={source:e(),source_id:Number(o()),receiver_id:this.supplierData.dealroom_receiver_id};this.drService.initiateChat(r).subscribe(c=>{c.responseCode===200?(this.drService.setBuyerOrSeller("B"),this.router.navigate(["deal-room",e(),c.room_id,"chat"])):this.notificationService.showError("Something went wrong!"),this.loadingStates.dealRoom=!1},c=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.dealRoom=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.dealRoom=!1}}getTableHeaders(e){let o=[{title:"Product Name",subtitle:""},{title:"Quantity",subtitle:""}
1,{title:"Bid Total Value",subtitle:""},{title:"Logistics",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],r=[{title:"Product Name",subtitle:""},{title:"Offered Qty",subtitle:""},{title:"Required Qty",subtitle:""},{title:"Quoted",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],c=[{title:"Product Name",subtitle:""},{title:"Quantity",subtitle:""},{title:"Basic Price",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],g;switch(e){case"auction":g=o;break;case"rfq":g=r;break;case"DirectBuy":g=c;break;default:return[]}return this.isWorkOrder&&g.length&&g[0].title==="Product Name"&&(g=[j(A({},g[0]),{title:"Service Name"}),...g.slice(1)]),g}onGSTSelect(e){e.target.value==="select"&&$("#addGSTModal").modal("show")}onGSTDocumentChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.gstDocs=!0;let r=o[0],c=new FormData;c.append("file",r),c.append("source","company"),c.append("source_id",this.addGSTForm.get("gstNumber").value),this.financeOrderService.FileUpload(c).subscribe({next:g=>{g.responseCode===200?this.addGSTForm.get("gstFile").setValue(g.response.filepath):this.notificationService.showError("File Upload Failed"),this.loadingStates.gstDocs=!1},error:g=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.gstDocs=!1}})}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.gstDocs=!1}}resetBuyerGST(){this.sentToSupplierForm.get("buyerGSTnumber").setValue("")}resetGSTForm(){this.addGSTForm.reset(),this.fileInput.nativeElement.value=""}
1addNewGST(){if(this.addGSTForm.invalid){Object.keys(this.addGSTForm.controls).forEach(o=>{this.addGSTForm.get(o).markAsDirty(),this.addGSTForm.get(o).markAsTouched()});return}let e={gst:[{gst_number:this.addGSTForm.get("gstNumber").value,gst_document:this.addGSTForm.get("gstFile").value}]};this.loadingStates.addGST=!0,this.financeOrderService.addNewGST(e).subscribe({next:o=>{o.responseCode===200?(this.notificationService.showSuccess(o.response.response),this.resetGSTForm(),this.GetOrderDetailsByPO(),$("#addGSTModal").modal("hide")):this.notificationService.showError("Something went wrong!"),this.loadingStates.addGST=!1},error:o=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.addGST=!1}})}add(e){let o=(e.value||"").trim();o&&(this.supplierDocuments.push({value:o}),this.sentToSupplierForm.get("supplierDocuments")?.updateValueAndValidity()),e.chipInput.clear()}removeDocument(e){let o=this.supplierDocuments.indexOf(e);o>=0&&(this.supplierDocuments.splice(o,1),this.announcer.announce(`Removed ${e}`),this.sentToSupplierForm.get("supplierDocuments")?.updateValueAndValidity())}edit(e,o){let r=o.value.trim();if(!r){this.removeDocument(e);return}let c=this.supplierDocuments.indexOf(e);c>=0&&(this.supplierDocuments[c].value=r)}deleteDocument(){this.removeDocument(this.deleteDocIndex),this.onCloseModel()}onCloseModel(){this.dialogref.close()}openDocDeleteDialog(e,o){this.deleteDocIndex=o,this.dialogref=this.dialog.open(e)}static{this.\u0275fac=function(o){return new(o||a)(T(K),T(de),T(z),T(ft),T(Ae),T(tt),T(H),T(Qt),T(fa))}}static{this.\u0275cmp=R({type:a,selectors:[["app-sent-to-supplier"]],viewQuery:function(o,r){if(o&1&&N(Gv,5),o&2){let c;V(c=B())&&(r.fileInput=c.first)}},decls:49,vars:13,consts:[["dialog",""],["buyerGST",""],["dialog1",""],["chipGrid",""],["noSellerGst",""],["prods",""],["popContent",""],["docsinput",""],["noSellerGstPreview",""],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],["class","row11",4,"ngIf"],[1,"row"],[1,"col-12","text-right","mt-3"],["type","button","data-toggle","modal",1,"mod-btn","mod-btn-outline-primary","btn-sm","mr-10",3,"click"],[1,"uil","uil-eye"],["appTranslate",""],["type","button","data-toggle","modal","data-target","#sent-to-supplier-model-confirm","class","mod-btn mod-btn-primary btn-sm mr-10",3,"disabled","click",4,"ngIf"],["type","button","class","mod-btn mod-btn-primary btn-sm mr-10",3,"disabled","click",4,"ngIf"],[3,"formGroup"],["id","addGSTModal","tabindex","-1","aria-labelledby","addGSTModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[3,"ngSubmit","formGroup"],[1,"modal-header"],["id","addGSTModalLabel","appTranslate","",1,"modal-title"],["type","button","data-dismiss","modal","aria-label","Close",1,"close"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["for","gstNumber"],[1,"text-danger"],["type","text","id","gstNumber","formControlName","gstNumber","placeholder","Enter GST Number",1,"form-control"],["class","errorClass",4,"ngIf"],["for","gstDocument"],["type","file",1,"form-control-file",3,"change","disabled"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],[1,"modal-footer"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light",3,"disabled"],["type","submit",1,"mod-btn","mod-btn-primary",3,"disabled"],["appTranslate","",4,"ngIf"],[4,"ngIf"],[1,"row11"],[1,"row",3,"formGroup"],[1,"col-12","sticky-top11"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],[1,"col-md-6","col-12","text-right"],[1,"mod-btn","mod-btn-primary","btn-sm",3,"click","disabled"],[1,"col-12"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"col-md-4","col-sm-6"],["for","",1,"fw-600"],[1,"icon-input","date"],["type","date","formControlName","pocDate","placeholder","",1,"form-control","form-control-sm11",3,"input","min"],["type","date","placeholder","","formControlName","poExpairyDate",1,"form-control","form-control-sm11",3,"min"],["formControlName","paymentMode",1,"form-control","form-control-sm11"],["value","","appTranslate",""],[1,"col-md-4"],[1,"fw-600","m-0","mb-2"],[1,"form-check","form-check-inline"],[1,"form-group","mx-2"],["type","radio","id","add-serv-yes","formControlName","additionsServices","value","Yes",1,"form-check-input"],["for","add-serv-yes","appTranslate","",1,"form-check-label"],["type","radio","id","add-serv-no","formControlName","additionsServices","value","No",1,"form-check-input"],["for","add-serv-no","appTranslate","",1,"form-check-label"],["class","col-md-4 col-12",4,"ngIf"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"col-12","mb-15"],["size","medium",3,"isLoading","useBlockPosition",4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-md"],[1,"card","h-100"],[1,"card-body"],["appTranslate","",1,"fw-600","mb-2"],["class","fw-600",4,"ngIf"],[1,"form-group","mb-1","form-inline"],["appTranslate","",1,"fw-600","mb-0"],["formControlName","buyerGSTnumber",1,"ml-15","form-control","form-control-sm11",3,"change"],["disabled","","selected","","value","","appTranslate","",4,"ngIf"],["disabled","","appTranslate","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["value","select"],[1,"uil","uil-plus-circle"],[1,"col-12","col-md-3"],[1,"card","bg-light","h-100"],[1,"text-center"],["class","doc-logo__wrap mx-auto",4,"ngIf"],[1,"custom-file","mt-15"],["type","file","id","imgInp",1,"custom-file-input",3,"change","title"],["for","imgInp",1,"custom-file-label"],["data-toggle","collapse","data-target","#coll__OrderSummary","aria-expanded","false",1,"mod-card-header","border-bottom-0","cardCollapseArrow"],["id","coll__OrderSummary",1,"collapse","show"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],[4,"ngFor","ngForOf"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"mb-3"],[1,"list-inline","d-flex","align-items-center"],[1,"list-inline-item"],[1,"toggleSwitch","ml-0","mt-2"],["type","checkbox",3,"change"],["class","list-inline-item ml-auto",4,"ngIf"],["class","position-relative border rounded-lg px-15 py-15 blurCard",4,"ngIf"],["class","mb-3",4,"ngIf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],["class","row mt-15",4,"ngSwitchCase"],["class","col-12 col-lg splitedSummaryRightSide",4,"ngSwitchCase"],[1,"uil","uil-comments-alt"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"errorClass"],["class","error-field","appTranslate","",4,"ngIf"],["appTranslate","",1,"error-field"],[1,"col-md-4","col-12"],["for","",1,"d-block"],[1,"required"],["appearance","outline","subscriptSizing","dynamic",1,"example-chip-list","w-100","DocumentsRequiredFormSupplierMatFormField"],["aria-label","Enter document name"],[3,"editable","t
1itle","aria-description","removed","edited",4,"ngFor","ngForOf"],["placeholder","New document...",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes","matChipInputAddOnBlur"],[3,"removed","edited","editable","title","aria-description"],["matChipRemove",""],["size","medium",3,"isLoading","useBlockPosition"],[1,"card"],[1,"fw-600","mb-1"],["class","text-secondary","appTranslate","",4,"ngIf"],["appTranslate","",1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary",4,"ngIf","ngIfElse"],[1,"text-secondary"],[1,"fw-600"],["appTranslate","",1,"fw-600"],["disabled","","selected","","value","","appTranslate",""],["disabled","","appTranslate",""],[3,"value"],[1,"doc-logo__wrap","mx-auto"],["ngxViewer","","id","po-logo","alt","your logo",1,"doc-logo__img",3,"viewerOptions","src"],["type","button","matTooltip","Remove Logo","aria-label","Remove Logo",1,"doc-logo__remove",3,"click"],[1,"ri-close-line"],[3,"isLoading","useBlockPosition"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],["type","number","min","1","onlyNumbers","","class","form-control form-control-sm fin-qty-input",3,"ngModel","ngModelOptions","ngModelChange",4,"ngIf"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],["type","number","min","1","onlyNumbers","",1,"form-control","form-control-sm","fin-qty-input",3,"ngModelChange","ngModel","ngModelOptions"],[1,"text-dark","mb-1"],[1,"border-t"],[1,"text-secondary","mb-1"],[1,"product-id-cell"],[1,"text-secondary","font-12"],[1,"list-inline-item","ml-auto"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"uil","uil-plus"],[1,"position-relative","border","rounded-lg","px-15","py-15","blurCard"],["appTranslate","",1,"font-weight-bolder","font-14"],["formArrayName","payment",4,"ngIf"],["formArrayName","payment"],["class","shpCard mb-20",3,"formGroupName",4,"ngFor","ngForOf"],[1,"shpCard","mb-20",3,"formGroupName"],[1,"row","gut-row","gut-3"],["type","text","formControlName","paymentTitle","placeholder","Payment Title",1,"form-control","form-control-sm"],["type","number","min","0","formControlName","payment","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm",3,"allowDecimals"],["class","invalid-error",4,"ngIf"],["type","date","formControlName","timeline",1,"form-control","form-control-sm",3,"min"],[1,"col-md-12","mt-2"],["formControlName","note","placeholder","Enter Note (if any)","rows","2",1,"form-control","form-control-sm"],["class","col-md-12 mt-2",4,"ngIf"],[1,"invalid-error"],["class","text-danger","appTranslate","",4,"ngIf"],["appTranslate","",1,"text-danger"],["type","button",1,"mod-btn","mod-btn-outline-danger","btn-sm",3,"click"],[1,"uil","uil-trash-alt"],["formArrayName","asn",4,"ngIf"],["formArrayName","asn"],["class","shpCard mb-20 p-3",3,"formGroupName",4,"ngFor","ngForOf"],[1,"shpCard","mb-20","p-3",3,"formGroupName"],[1,"form-row"],["type","text","formControlName","shipmentTitle","placeholder","First Shipment",1,"form-control","form-control-sm"],["type","number","min","0","formControlName","asnTimeline","onlyNumbers","","placeholder","4",1,"form-control","form-control-sm"],["formArrayName","product"],["class","row gut-row gut-3 mt-2",3,"formGroupName",4,"ngFor","ngForOf"],["class","mt-2",4,"ngIf"],[1,"row","gut-row","gut-3","mt-2",3,"formGroupName"],[1,"col-md-7"],["formControlName","productId",1,"form-control","form-control-sm"],["value","","disabled","","appTranslate",""],[1,"col-md-3"],["type","number","min","0","formControlName","noOfProds","onlyNumbers","","placeholder","10",1,"form-control","form-control-sm"],[1,"col-md-auto","d-flex","align-items-center","pt-3"],["type","button","class","p-0 btn text-theme font-20 no-focus",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger font-20",3,"click",4,"ngIf"],["type","button",1,"p-0","btn","text-theme","font-20","no-focus",3,"click"],[1,"fas","fa-plus-circle"],["type","button",1,"p-0","btn","btn-basic","text-danger","font-20",3,"click"],[1,"fas","fa-times-circle"],[1,"mt-2"],[1,"row","mt-15"],["for","","appTranslate","",1,"fw-600"],["rows","5","formControlName","termsandConditions","placeholder","Please write T & C, if any concern in PO",1,"form-control"],[1,"col-12","col-md-4"],[1,"custom-file","mt-15","mb
1-30px"],["type","file","multiple","","id","imgInp_01",1,"custom-file-input",3,"change","title","disabled"],["for","imgInp_01",1,"custom-file-label"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],["size","small",3,"isLoading","useBlockPosition"],[1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"],[1,"ml-auto","pl-15","text-danger","cursor-pointer"],[1,"uil","uil-times-circle","font-18",3,"click"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"],["type","button","data-toggle","modal","data-target","#sent-to-supplier-model-confirm",1,"mod-btn","mod-btn-primary","btn-sm","mr-10",3,"click","disabled"],[1,"uil","uil-message"],["type","button",1,"mod-btn","mod-btn-primary","btn-sm","mr-10",3,"click","disabled"],["id","sent-to-supplier-model",1,"h-80vh","w-60vw"],["type","button","data-dismiss","modal",1,"close",3,"click"],[1,"font-20px","text-center","text-capitalize"],["class","img-flui max-h-100px",3,"src",4,"ngIf"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],[1,"mod-meta-label"],[1,"mod-meta-value"],["appTranslate","",1,"mod-meta-label"],[1,"row","mt-30"],[1,"col-md-6"],["class","mb-0",4,"ngIf"],["class","mb-0 pl-1","appTranslate","",4,"ngIf"],["id","product_table",1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table",3,"ngSwitch"],["class","",4,"ngSwitchCase"],[1,"row","mt-1","gut-row","gut-4","justify-content-end"],[1,"col-md-8","col-12","col-xl-9"],["class","row mt-30",4,"ngIf"],[1,"col-md-4","col-12","col-xl-3",3,"ngSwitch"],["class","mod-card mb-4 mt-4",4,"ngIf"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"img-flui","max-h-100px",3,"src"],[1,"mb-0"],["appTranslate","",1,"mb-0","pl-1"],["for","","appTranslate","",1,"fw-600","mb-15"],[1,"font-12","text-secondary","mb-2"],[1,"mod-card","mb-4","mt-4"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-12","mb-30"],["appTranslate","",1,"fw-600","font-16","theme-color","mb-3"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],["class","note mt-2 mb-0",4,"ngIf"],[1,"note","mt-2","mb-0"],[1,"col-12","mb-20"],["class","shipments-cards",4,"ngFor","ngForOf"],[1,"shipments-cards"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],["id","changePwd__modal","aria-modal","true",1,"modal","fade","show","d-block","pr-20"],[1,"modal-content","br-0"],[1,"modal-body","text-center"],["type","button","data-dismiss","modal",1,"close","curserType",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-outline-danger","btn-sm","px-5","mr-15",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm","px-5",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"div",9),u(1,A2,184,48,"div",10),i(2,"div",11)(3,"div",12)(4,"button",13),S("click",function(){b(c);let h=w(11);return y(r.OnclickPreview(h))}),x(5,"i",14),i(6,"span",15),n(7,"Preview"),t()(),u(8,B2,3,3,"button",16)(9,q2,3,3,"button",17),t()()(),u(10,Xf,146,53,"ng-template",18,0,P),i(12,"div",19)(13,"div",20)(14,"div",21)(15,"form",22),S("ngSubmit",function(){return b(c),y(r.addNewGST())}),i(16,"div",23)(17,"h5",24),n(18,"Add GST"),t(),i(19,"button",25)(20,"span",26),n(21,"\xD7"),t()()(),i(22,"div",27)(23,"div",28)(24,"label",29)(25,"span",15),n(26,"GST Number"),t(),i(27,"sup",30),n(28,"*"),t()(),x(29,"input",31),u(30,ih,3,2,"div",32),t(),i(31,"div",28)(32,"label",33)(33,"span",15),n(34,"GST Document"),t(),i(35,"sup",30),n(36,"*"),t()(),i(37,"input",34,1),S("change",function(h){return b(c),y(r.onGSTDocumentChange(h))}),t(),u(39,nh,1,2,"app-loader",35)(40,rh,2,1,"div",32),t()(),i(41,"div",36)(42,"button",37),n(43,"Close"),t(),i(44,"button",38),u(45,lh,2,0,"span",39)(46,oh,6,0,"span",40),t()()()()()(),u(47,sh,12,0,"ng-template",null,2,P)}if(o&2){let c,g;
1l(),s("ngIf",r.supplierData),l(7),s("ngIf",!r.isRegenerate),l(),s("ngIf",r.isRegenerate),l(),s("formGroup",r.sentToSupplierForm),l(5),s("formGroup",r.addGSTForm),l(15),s("ngIf",((c=r.addGSTForm.get("gstNumber"))==null?null:c.touched)||((c=r.addGSTForm.get("gstNumber"))==null?null:c.dirty)),l(7),s("disabled",r.loadingStates.gstDocs),l(2),s("ngIf",r.loadingStates.gstDocs),l(),s("ngIf",((g=r.addGSTForm.get("gstFile"))==null?null:g.touched)||((g=r.addGSTForm.get("gstFile"))==null?null:g.dirty)),l(2),s("disabled",r.loadingStates.addGST),l(2),s("disabled",r.loadingStates.addGST),l(),s("ngIf",!r.loadingStates.addGST),l(),s("ngIf",r.loadingStates.addGST)}},dependencies:[rt,J,W,pt,mt,It,Et,Re,Oe,He,Ke,Ne,at,Ye,Oi,Pe,Ie,gt,Pt,dt,Se,Zt,Z,De,L,ut,We,Qe,yt,St,pa,ma,da,ca,st,ae],styles:['.rfq-pages[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .rfq-pages[_ngcontent-%COMP%] select[_ngcontent-%COMP%], .rfq-pages[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font-size:1rem}.btn-basic[_ngcontent-%COMP%]{line-height:0;font-size:13px;padding:0 8px;background:transparent;border:none}.blur[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.blurCard[_ngcontent-%COMP%]{transition:.3s}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:5px;padding:15px}.shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:focus, .shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:active{outline:none!important;box-shadow:none!important}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--theme-primary)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--theme-primary);border-color:var(--theme-primary);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.errorClass[_ngcontent-%COMP%]{color:red;font-weight:700}.disableClass[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;background-color:#fff;opacity:.55;z-index:999;cursor:not-allowed}.blur[_ngcontent-%COMP%] .blurCard[_ngcontent-%COMP%]:before{content:"";cursor:not-allowed}.toggleSwitch[_ngcontent-%COMP%] span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:none}@media only screen{.toggleSwitch[_ngcontent-%COMP%]{display:inline-block;height:16px;position:relative;overflow:visible;padding:0;margin-left:50px;cursor:pointer;width:38px}.toggleSwitch[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.toggleSwitch[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{line-height:20px;height:20px;vertical-align:middle;position:relative;z-index:3;display:block;width:100%}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{line-height:20px;height:20px;vertical-align:middle;position:absolute;left:-50px;width:100%;margin:0;padding-right:50px;text-align:left;white-space:nowrap}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:absolute;z-index:5;display:block;width:50%;margin-left:50px;text-align:left;width:100%;left:15%;top:-2px;font-size:10px!important;opacity:0}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{color:#ccc;opacity:1;left:45%}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:before{content:"";display:block;width:100%;height:100%;position:absolute;left:50px;top:-2px;background-color:#fafafa;border:1px solid #ccc;border-radius:30px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;transition:all .2s ease-out}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{position:absolute;opacity:0;z-index:5}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus ~ a[_ngcontent-%COMP%]{outline:none}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus + label[_ngcontent-%COMP%]{outline:none}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ a[_ngcontent-%COMP%]{border-color:#fff;left:100%;margin-left:-8px}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ span[_ngcontent-%COMP%]:before{border-color:var(--theme-sub-prime);box-shadow:inset 0 0 0 30px var(--theme-sub-prime)}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{opacity:0}
1.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-of-type{opacity:1;color:#fff}.toggleSwitch[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:50%;z-index:4;display:block;height:100%;padding:0;left:2px;width:18px;background-color:#fff;border:1px solid #CCC;border-radius:100%;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;transition:all .2s ease-out;box-shadow:0 1px 2px #0000000d}.toggleSwitch.large[_ngcontent-%COMP%]{width:60px;height:27px}.toggleSwitch.large[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:27px}.toggleSwitch.large[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{height:29px;line-height:28px}.toggleSwitch.large[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:1.1em}.toggleSwitch.large[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{left:50%}.toggleSwitch.large[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ a[_ngcontent-%COMP%]{left:41px}.toggleSwitch.xlarge[_ngcontent-%COMP%]{width:80px;height:36px}.toggleSwitch.xlarge[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:36px}.toggleSwitch.xlarge[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{height:38px;line-height:37px}.toggleSwitch.xlarge[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:1.4em}.toggleSwitch.xlarge[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{left:50%}.toggleSwitch.xlarge[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ a[_ngcontent-%COMP%]{left:52px}}.h-80vh[_ngcontent-%COMP%]{height:80vh}.DocumentsRequiredFormSupplierMatFormField[_ngcontent-%COMP%] .mat-mdc-form-field-infix{padding:4px 0!important;min-height:33.5px!important}.DocumentsRequiredFormSupplierMatFormField[_ngcontent-%COMP%] .mat-mdc-chip{height:24px!important;margin-top:1px!important;margin-bottom:1px!important;max-width:100%}.DocumentsRequiredFormSupplierMatFormField[_ngcontent-%COMP%] .mdc-evolution-chip__cell--primary, .DocumentsRequiredFormSupplierMatFormField[_ngcontent-%COMP%] .mat-mdc-chip-action.mdc-evolution-chip__action--primary{min-width:0;overflow:hidden}.DocumentsRequiredFormSupplierMatFormField[_ngcontent-%COMP%] .mat-mdc-chip-action-label{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.doc-logo__wrap[_ngcontent-%COMP%]{position:relative;display:block;width:100%;line-height:0}.doc-logo__remove[_ngcontent-%COMP%]{position:absolute;top:-8px;right:-8px;width:22px;height:22px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--mod-border);border-radius:50%;background:var(--mod-surface);color:var(--mod-error);box-shadow:var(--mod-shadow-sm);cursor:pointer;line-height:1;transition:background var(--mod-transition),color var(--mod-transition)}.doc-logo__remove[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px}.doc-logo__remove[_ngcontent-%COMP%]:hover, .doc-logo__remove[_ngcontent-%COMP%]:focus{background:var(--mod-error);border-color:var(--mod-error);color:#fff;outline:none}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;
1color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.totalCalculationCard[_ngcontent-%COMP%]{height:auto}.totalCalculationCard[_ngcontent-%COMP%] .card-footer[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.totalCalculationCard[_ngcontent-%COMP%] .card-footer[_ngcontent-%COMP%] .float-right[_ngcontent-%COMP%]{float:none;text-align:right;white-space:nowrap}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .fin-qty-input[_ngcontent-%COMP%]{width:96px;min-width:80px;display:inline-block}']})}}return a})();var dh=()=>({toolbar:!1});function ch(a,d){a&1&&(i(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13),x(5,"i",14),i(6,"h3",15),n(7,"Access Restricted"),t(),i(8,"p",16),n(9,"You do not have the necessary permissions to view this content. Please contact your administrator for further assistance."),t()()()()()())}function ph(a,d){a&1&&(i(0,"span",45),n(1,"Purchase Order"),t())}function mh(a,d){a&1&&(i(0,"span",45),n(1,"Work Order"),t())}function uh(a,d){a&1&&(i(0,"span"),x(1,"i",73),i(2,"span",45),n(3,"Deal Room"),t()())}function _h(a,d){a&1&&(i(0,"span")(1,"div",74)(2,"span",75),n(3,"Loading..."),t()(),i(4,"span",45),n(5,"Opening..."),t()())}function vh(a,d){if(a&1){let e=I();i(0,"button",72),S("click",function(){b(e);let r=p(3);return y(r.toDealRoom())}),u(1,uh,4,0,"span",28)(2,_h,6,0,"span",28),t()}if(a&2){let e=p(3);s("disabled",e.loadingStates.dealRoom),l(),s("ngIf",!e.loadingStates.dealRoom),l(),s("ngIf",e.loadingStates.dealRoom)}}function gh(a,d){a&1&&(i(0,"span"),x(1,"i",76),i(2,"span",45),n(3,"Print"),t()())}function fh(a,d){a&1&&(i(0,"span")(1,"div",74)(2,"span",75),n(3,"Loading..."),t()(),i(4,"span",45),n(5,"Printing..."),t()())}function hh(a,d){a&1&&(i(0,"span",45),n(1,"Purchase Order Details"),t())}function xh(a,d){a&1&&(i(0,"span",45),n(1,"Work Order Details"),t())}function bh(a,d){a&1&&(i(0,"span",45),n(1,"PO No."),t())}function yh(a,d){a&1&&(i(0,"span",45),n(1,"WO No."),t())}function Sh(a,d){a&1&&(i(0,"span",45),n(1,"Purchase Order Date"),t())}function Ch(a,d){a&1&&(i(0,"span",45),n(1,"Work Order Date"),t())}function Eh(a,d){a&1&&(i(0,"span",45),n(1,"Purchase Order Expiry Date"),t())}function Ih(a,d){a&1&&(i(0,"span",45),n(1,"Work Order Expiry Date"),t())}function Dh(a,d){if(a&1){let e=I();i(0,"button",77),S("click",function(){b(e);let r=p(3);return y(r.onSourceClick())}),n(1),t()}if(a&2){let e=p(3);s("title",e.supplierData==null?null:e.supplierData.display_source_id),l(),m(" ",(e.supplierData==null?null:e.supplierData.display_source_id)||"--"," ")}}function Th(a,d){if(a&1&&n(0),a&2){let e=p(3);f((e.supplierData==null?null:e.supplierData.display_source_id)||"--")}}function wh(a,d){a&1&&(i(0,"span",45),n(1,"Place of Supply"),t())}function Ph(a,d){a&1&&(i(0,"span",45),n(1,"Place of Service"),t())}function Oh(a,d){if(a&1&&(i(0,"p",81),n(1),t()),a&2){let e=d.$implicit;l(),m(" ",e,"")}}function kh(a,d){if(a&1&&(F(0),u(1,Oh,2,1,"p",80),M()),a&2){let e=p(5);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.additionalDocumentsTags)}}function Fh(a,d){if(a&1){let e=I();i(0,"span",82,2),S("mouseenter",function(){b(e);let r=w(1),c=p(5);return y(c.toggleWithGreeting(r))})("mouseleave",function(){b(e);let r=w(1),c=p(5);return y(c.toggleWithGreeting(r))}),i(2,"small",45),n(3,"view requested files"),t()()}if(a&2){p();let e=w(3);s("ngbPopover",e)}}function Mh(a,d){if(a&1&&(i(0,"div",36),n(1),u(2,kh,2,1,"ng-template",null,1,P)(4,Fh,4,1,"span",79),t()),a&2){let e=p(4);l(),m(" ",e.supplierData==null?null:e.supplierData.service_documents_required," "),l(3),s("ngIf",(e.supplierData==null?null:e.supplierData.service_documents_required)==="yes")}}function Ah(a,d){if(a&1&&(i(0,"div",34)(1,"div",37),n(2," Additional Services Documents"),t(),u(3,Mh,5,2,"div",78),t()),a&2){let e=p(3);l(3),s("ngIf",(e.supplierData==null?null:e.supplierData.source)==="rfq"&&(e.supplierData==null?null:e.supplierData.service_documents_required)!=="")}}function Nh(a,d){a&1&&(i(0,"span",83),n(1," Not available at the moment "),t())}function Vh(a,d){if(a&1&&(i(0,"div",18)(1,"div",43)(2,"div",13)(3,"p",44),u(4,Nh,2,0,"span",47),t()()()()),a&2){let e=p(3);
1l(4),s("ngIf",e.poDetails&&!(e.poDetails!=null&&e.poDetails.seller_billing_address))}}function Bh(a,d){if(a&1&&(i(0,"span",84),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null||e.poDetails.seller_details==null?null:e.poDetails.seller_details.company_name)}}function Rh(a,d){a&1&&(i(0,"span",83),n(1,"Not available"),t())}function Lh(a,d){a&1&&(i(0,"span",84)(1,"div",85)(2,"span",75),n(3,"Loading..."),t()()())}function qh(a,d){if(a&1&&(i(0,"span",84),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails.seller_gst_list[0])}}function Gh(a,d){a&1&&(i(0,"span",83),n(1,"Not available"),t())}function Uh(a,d){if(a&1&&(i(0,"span",84),n(1),t()),a&2){let e=p(3);l(),m(" ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.full_address," ")}}function jh(a,d){a&1&&(i(0,"span",83),n(1," No Address Found "),t())}function $h(a,d){if(a&1&&(i(0,"p",86)(1,"span",87),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name," ")}}function zh(a,d){if(a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",84),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.shippingAddress==null?null:e.shippingAddress.full_address," ")}}function Wh(a,d){a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",83),n(4," Not available "),t()())}function Qh(a,d){if(a&1&&(i(0,"p",86)(1,"span",87),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name," ")}}function Yh(a,d){a&1&&(i(0,"span",84)(1,"div",85)(2,"span",75),n(3,"Loading..."),t()()())}function Hh(a,d){if(a&1&&(i(0,"span",84),n(1),t()),a&2){let e=p(3);l(),f(e.supplierData==null?null:e.supplierData.gstn)}}function Kh(a,d){a&1&&(i(0,"span",83),n(1,"Not available"),t())}function Zh(a,d){if(a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",84),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.billingAddress==null?null:e.billingAddress.full_address," ")}}function Jh(a,d){a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",83),n(4," Not available "),t()())}function Xh(a,d){if(a&1&&(i(0,"div",89)(1,"div",90),x(2,"img",91),t()()),a&2){let e=p(3);l(2),s("viewerOptions",Ce(2,dh))("src",e.poDetails==null?null:e.poDetails.logo_path,q)}}function ex(a,d){if(a&1&&(i(0,"th",92)(1,"span"),n(2),t(),i(3,"small"),n(4),t()()),a&2){let e=d.$implicit;l(2),m("",e.title," "),l(2),f(e.subtitle)}}function tx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function ix(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function nx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function ax(a,d){if(a&1&&(F(0),i(1,"div",96),n(2),t(),i(3,"p",97),u(4,tx,2,2,"span",98)(5,ix,2,2,"span",98)(6,nx,2,2,"span",98),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function rx(a,d){if(a&1&&(F(0),i(1,"div",96)(2,"div")(3,"p",100),n(4),_(5,"currencyFormat"),t(),i(6,"p",100),n(7),_(8,"currencyFormat"),t(),i(9,"p",100),n(10),_(11,"currencyFormat"),t(),i(12,"p",100),n(13),_(14,"currencyFormat"),t(),i(15,"p",100),n(16),_(17,"currencyFormat"),t(),i(18,"p",100),n(19),_(20,"currencyFormat"),t(),i(21,"p",100),n(22),_(23,"currencyFormat"),t(),i(24,"p",100),n(25),_(26,"currencyFormat"),t(),i(27,"p",100),n(28),_(29,"currencyFormat"),t(),x(30,"div",101),i(31,"p",86)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function lx(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,ax,7,4,"ng-template",null,3,P),x(6,"i",95),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),_(15,"currencyFormat"),i(16,"small",45),n(17,"/unit"),t()(),i(18,"td"),n(19),_(20,"currencyFormat"),t(),i(21,"td"),n(22),_(23,"currencyFormat"),t(),i(24,"td"),n(25),_(26,"currencyFormat"),t(),i(27,"td"),n(28),_(29,"currencyFormat"),u(30,rx,35,34,"ng-template",null,4,P),x(32,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(31);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),f(e.required_qty),l(2),m("",v(15,11,e.unit_price)," "),l(5),f(v(20,13,e.gross_total)),l(3),f(v(23,15,e.discount)),l(3),f(v(26,17,e.gst)),l(3),m(" ",v(29,19,e.total_amount)," "),l(4),s("ngbPopover",r)}}function ox(a,d){if(a&1&&(i(0,"tbody"),u(1,lx,33,21,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function sx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function dx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function cx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function px(a,d){if(a&1&&(F(0),i(1,"div",96),n(2),t(),i(3,"p",97),u(4,sx,2,2,"span",98)(5,dx,2,2,"span",98)(6,cx,2,2,"span",98),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function mx(a,d){if(a&1&&(F(0),i(1,"div",96)(2,"div")(3,"p",100),n(4),_(5,"currencyFormat"),t(),i(6,"p",100),n(7),_(8,"currencyFormat"),t(),i(9,"p",100),n(10),_(11,"currencyFormat"),t(),i(12,"p",100),n(13),_(14,"currencyFormat"),t(),i(15,"p",100),n(16),_(17,"currencyFormat"),t(),x(18,"div",101),i(19,"p",86)(20,"b"),n(21),_(22,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Total Bid Value: ",v(5,10,e.gross_total)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(8,12,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(11,14,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(14,16,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(17,18,e.igst),""),l(5),m("Total Payable: ",v(22,20,e.total_amount)," ")}}function ux(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,px,7,4,"ng-template",null,3,P),x(6,"i",95),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),u(20,mx,23,22,"ng-template",null,4,P),x(22,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(21);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(13,8,e.gross_total)),l(3),f(v(16,10,e.gst)),l(3),m(" ",v(19,12,e.total_amount)," "),l(4),s("ngbPopover",r)}}function _x(a,d){if(a&1&&(i(0,"tbody"),u(1,ux,23,14,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function vx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function gx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function fx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function hx(a,d){if(a&1&&(F(0),i(1,"div",96),n(2),t(),i(3,"p",97),u(4,vx,2,2,"span",98)(5,gx,2,2,"span",98)(6,fx,2,2,"span",98),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function xx(a,d){if(a&1&&(F(0),i(1,"div",96)(2,"div")(3,"p",100),n(4),_(5,"currencyFormat"),t(),i(6,"p",100),n(7),_(8,"currencyFormat"),t(),i(9,"p",100),n(10),_(11,"currencyFormat"),t(),i(12,"p",100),n(13),_(14,"currencyFormat"),t(),i(15,"p",100),n(16),_(17,"currencyFormat"),t(),i(18,"p",100),n(19),_(20,"currencyFormat"),t(),i(21,"p",100),n(22),_(23,"currencyFormat"),t(),i(24,"p",100),n(25),_(26,"currencyFormat"),t(),i(27,"p",100),n(28),_(29,"currencyFormat"),t(),x(30,"div",101),i(31,"p",86)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function bx(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,hx,7,4,"ng-template",null,3,P),x(6,"i",95),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),t(),i(20,"td"),n(21),_(22,"currencyFormat"),u(23,xx,35,34,"ng-template",null,4,P),x(25,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(24);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(3),f(v(16,11,e.discount)),l(3),f(v(19,13,e.gst)),l(3),m(" ",v(22,15,e.total_amount)," "),l(4),s("ngbPopover",r)}}function yx(a,d){if(a&1&&(i(0,"tbody"),u(1,bx,26,17,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Sx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Cx(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Ex(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Ix(a,d){if(a&1&&(F(0),i(1,"div",96),n(2),t(),i(3,"p",97),u(4,Sx,2,2,"span",98)(5,Cx,2,2,"span",98)(6,Ex,2,2,"span",98),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function Dx(a,d){if(a&1&&(F(0),i(1,"div",96)(2,"div")(3,"p",100),n(4),_(5,"currencyFormat"),t(),i(6,"p",100),n(7),_(8,"currencyFormat"),t(),i(9,"p",100),n(10),_(11,"currencyFormat"),t(),i(12,"p",100),n(13),_(14,"currencyFormat"),t(),i(15,"p",100),n(16),_(17,"currencyFormat"),t(),i(18,"p",100),n(19),_(20,"currencyFormat"),t(),i(21,"p",100),n(22),_(23,"currencyFormat"),t(),i(24,"p",100),n(25),_(26,"currencyFormat"),t(),x(27,"div",101),i(28,"p",86)(29,"b"),n(30),_(31,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit,o=p(4);l(4),m(" Gross Total: ",v(5,13,e.gross_total)," "),l(3),m(" Discount: ",v(8,15,e.discount)," "),l(3),m(" Net Total: ",v(11,
117,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,19,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,21,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,23,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,25,e.igst),""),l(3),m(" Additional Charges: ",v(26,27,o.getAdditionalCharges())," "),l(5),m("Total Payable: ",v(31,29,e.total_amount)," ")}}function Tx(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,Ix,7,4,"ng-template",null,3,P),x(6,"i",95),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small",45),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,Dx,32,31,"ng-template",null,4,P),x(27,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(5),f(v(18,11,e.gross_total)),l(3),f(v(21,13,e.discount)),l(3),m(" ",v(24,15,e.total_amount)," "),l(4),s("ngbPopover",r)}}function wx(a,d){if(a&1&&(i(0,"tbody"),u(1,Tx,28,17,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Px(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",45),n(3,"Additional Charge:"),t(),n(4,"\xA0"),i(5,"b"),n(6),t()(),i(7,"td",102)(8,"span",45),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e,o=d.$implicit,r=p(4);l(),Be("colspan",(((e=r.getTableHeaders(r.supplierData==null?null:r.supplierData.source))==null?null:e.length)||3)-2),l(5),f(o.description),l(5),f(v(12,3,o.amount))}}function Ox(a,d){if(a&1&&(i(0,"tbody"),u(1,Px,13,5,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.additional_charges)}}function kx(a,d){if(a&1&&(i(0,"tbody")(1,"tr")(2,"td",103),n(3,"No data available"),t()()()),a&2){let e,o=p(3);l(2),Be("colspan",((e=o.getTableHeaders(o.supplierData==null?null:o.supplierData.source))==null?null:e.length)||1)}}function Fx(a,d){if(a&1){let e=I();i(0,"a",123),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function Mx(a,d){if(a&1){let e=I();i(0,"a",123),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function Ax(a,d){if(a&1&&(i(0,"div")(1,"p",121)(2,"b",45),n(3,"Note:"),t(),n(4),t(),u(5,Fx,2,0,"a",122)(6,Mx,2,0,"a",122),t()),a&2){let e=p().$implicit;l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded&&e.note.length>120),l(),s("ngIf",e._expanded)}}function Nx(a,d){if(a&1&&(i(0,"div",114)(1,"div",13)(2,"div",115)(3,"div",116)(4,"h6",117),n(5),t(),i(6,"small",118)(7,"span",45),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",119)(12,"h6",120),n(13),_(14,"currencyFormat"),t()()(),u(15,Ax,7,5,"div",28),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%)"),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function Vx(a,d){if(a&1&&(i(0,"div",109)(1,"div",43)(2,"div",110)(3,"a",111),n(4,"Payment Terms"),t()(),i(5,"div",112)(6,"div",13),u(7,Nx,16,10,"div",113),t()()()()),a&2){let e=p(4);l(7),s("ngForOf",e.poDetails==null?null:e.poDetails.payment_terms)}}function Bx(a,d){if(a&1&&(i(0,"div",133)(1,"div",134)(2,"div",130)(3,"h6",135),n(4),t(),i(5,"small",118)(6,"span",45),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",136)(10,"small",137),n(11,"Quantity"),t(),i(12,"h6",138),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function Rx(a,d){if(a&1&&(i(0,"div",128)(1,"div",129)(2,"div",115)(3,"div",130)(4,"h6",131),n(5),t(),i(6,"small",118)(7,"span",45),n(8,"Timeline:"),t(),n(9),i(10,"span",45),n(11,"day(s)"),t()()()()(),u(12,Bx,14,3,"div",132),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," "),l(3),s("ngForOf",e.products)}}function Lx(a,d){if(a&1&&(i(0,"div",124)(1,"div",43)(2,"div",125)(3,"a",111),n(4,"Shipment Terms"),t()(),i(5,"div",126),u(6,Rx,13,3,"div",127),t()()()),a&2){let e=p(4);l(6),s("ngForOf",e.poDetails==null?null:e.poDetails.shipment_terms)}}function qx(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Logistics:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),f(v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges))}}function Gx(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Insurance:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),f(v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges))}}function Ux(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Gross Total:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",144)(8,"b",45),n(9,"Discount:"),t(),i(10,"span",145),n(11),_(12,"currencyFormat"),t()(),i(13,"li",144)(14,"b",45),n(15,"Net Total:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"SGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",146)(26,"span",45),n(27,"CGST:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),i(31,"li",146)(32,"span",45),n(33,"IGST:"),t(),i(34,"span",142),n(35),_(36,"currencyFormat"),t()(),i(37,"li",144)(38,"b",45),n(39,"Total Tax Amount:"),t(),i(40,"span",142),n(41),_(42,"currencyFormat"),t()(),u(43,qx,6,3,"li",147)(44,Gx,6,3,"li",147),t()),a&2){let e=p(5);l(5),f(v(6,9,e.poDetails==null?null:e.poDetails.gross)),l(6),m("(-) ",v(12,11,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),f(v(18,13,e.po
1Details==null?null:e.poDetails.net_charges)),l(6),f(v(24,15,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(30,17,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(36,19,e.poDetails==null?null:e.poDetails.igst)),l(6),f(v(42,21,e.poDetails==null?null:e.poDetails.gst_amount)),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0)}}function jx(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,Ux,45,23,"ul",140),t(),i(4,"div",141)(5,"span",45),n(6,"Total Payable Amount:"),t(),i(7,"span",142),n(8),_(9,"currencyFormat"),t()()()()),a&2){let e=p(4);l(3),s("ngIf",!e.loadingStates.poDetails),l(5),f(v(9,2,e.poDetails==null?null:e.poDetails.total_amount))}}function $x(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Logistics:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),f(v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges))}}function zx(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Insurance:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),f(v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges))}}function Wx(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Gross Total:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",144)(8,"b",45),n(9,"Discount:"),t(),i(10,"span",145),n(11),_(12,"currencyFormat"),t()(),i(13,"li",144)(14,"b",45),n(15,"Net Total:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"SGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",146)(26,"span",45),n(27,"CGST:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),i(31,"li",146)(32,"span",45),n(33,"IGST:"),t(),i(34,"span",142),n(35),_(36,"currencyFormat"),t()(),i(37,"li",144)(38,"b",45),n(39,"Total Tax Amount:"),t(),i(40,"span",142),n(41),_(42,"currencyFormat"),t()(),u(43,$x,6,3,"li",147)(44,zx,6,3,"li",147),t()),a&2){let e=p(5);l(5),f(v(6,9,e.poDetails==null?null:e.poDetails.gross)),l(6),m("(-) ",v(12,11,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),f(v(18,13,e.poDetails==null?null:e.poDetails.net_charges)),l(6),f(v(24,15,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(30,17,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(36,19,e.poDetails==null?null:e.poDetails.igst)),l(6),f(v(42,21,e.poDetails==null?null:e.poDetails.gst_amount)),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0)}}function Qx(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,Wx,45,23,"ul",140),t(),i(4,"div",141)(5,"span",45),n(6,"Total Payable Amount:"),t(),i(7,"span",142),n(8),_(9,"currencyFormat"),t()()()()),a&2){let e=p(4);l(3),s("ngIf",!e.loadingStates.poDetails),l(5),f(v(9,2,e.poDetails==null?null:e.poDetails.total_amount))}}function Yx(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Logistics:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),f(v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges))}}function Hx(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Total Bid Value:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",146)(8,"span",45),n(9,"SGST:"),t(),i(10,"span",142),n(11),_(12,"currencyFormat"),t()(),i(13,"li",146)(14,"span",45),n(15,"CGST:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"IGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",144)(26,"b",45),n(27,"Total Tax Amount:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),u(31,Yx,6,3,"li",147),t()),a&2){let e=p(5);l(5),f(v(6,6,e.poDetails==null?null:e.poDetails.gross)),l(6),f(v(12,8,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(18,10,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(24,12,e.poDetails==null?null:e.poDetails.igst)),l(6),f(v(30,14,e.poDetails==null?null:e.poDetails.gst_amount)),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0)}}function Kx(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,Hx,32,16,"ul",140),t(),i(4,"div",141)(5,"span",45),n(6,"Total Payable Amou
1nt:"),t(),i(7,"span",142),n(8),_(9,"currencyFormat"),t()()()()),a&2){let e=p(4);l(3),s("ngIf",!e.loadingStates.poDetails),l(5),f(v(9,2,e.poDetails==null?null:e.poDetails.total_amount))}}function Zx(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Gross Total:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",144)(8,"b",45),n(9,"Discount:"),t(),i(10,"span",145),n(11),_(12,"currencyFormat"),t()(),i(13,"li",144)(14,"b",45),n(15,"Net Total:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"SGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",146)(26,"span",45),n(27,"CGST:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),i(31,"li",146)(32,"span",45),n(33,"IGST:"),t(),i(34,"span",142),n(35),_(36,"currencyFormat"),t()(),i(37,"li",144)(38,"b",45),n(39,"Total Tax Amount:"),t(),i(40,"span",142),n(41),_(42,"currencyFormat"),t()(),i(43,"li",144)(44,"b",45),n(45,"Additional Charges:"),t(),i(46,"span",142),n(47),_(48,"currencyFormat"),t()()()),a&2){let e=p(5);l(5),f(v(6,8,e.poDetails==null?null:e.poDetails.gross)),l(6),m("(-) ",v(12,10,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),f(v(18,12,e.poDetails==null?null:e.poDetails.net_charges)),l(6),f(v(24,14,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(30,16,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(36,18,e.po
1Details==null?null:e.poDetails.igst)),l(6),f(v(42,20,e.poDetails==null?null:e.poDetails.gst_amount)),l(6),f(v(48,22,e.getAdditionalCharges()))}}function Jx(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,Zx,49,24,"ul",140),t(),i(4,"div",141)(5,"span",45),n(6,"Total Payable Amount:"),t(),i(7,"span",142),n(8),_(9,"currencyFormat"),t()()()()),a&2){let e=p(4);l(3),s("ngIf",!e.loadingStates.poDetails),l(5),f(v(9,2,e.poDetails==null?null:e.poDetails.total_amount))}}function Xx(a,d){if(a&1&&(i(0,"div",104)(1,"div",105)(2,"div",29)(3,"div",30)(4,"h3",40),n(5,"Order Terms & Fulfillment"),t()(),i(6,"div",32)(7,"div",17),u(8,Vx,8,1,"div",106)(9,Lx,7,1,"div",107),t()()()(),i(10,"div",108),u(11,jx,10,4,"div",61)(12,Qx,10,4,"div",61)(13,Kx,10,4,"div",61)(14,Jx,10,4,"div",61),t()()),a&2){let e=p(3);l(8),s("ngIf",(e.poDetails==null?null:e.poDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.poDetails==null?null:e.poDetails.multiple_shipment_terms)==="YES"),l(),s("ngSwitch",e.poDetails==null?null:e.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}function eb(a,d){if(a&1&&x(0,"app-loader",148),a&2){let e=p(3);s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function tb(a,d){if(a&1&&(i(0,"p",149),n(1),t()),a&2){let e=p(3);l(),m(" ",e.poDetails!=null&&e.poDetails.terms?e.poDetails==null?null:e.poDetails.terms:"No Terms & Conditions Provided","")}}function ib(a,d){if(a&1&&(i(0,"div",150),x(1,"app-loader",148),i(2,"small",151),n(3,"Loading documents..."),t()()),a&2){let e=p(3);l(),s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function nb(a,d){if(a&1&&(i(0,"li",154)(1,"a",155),x(2,"i",156),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(2),m(" ",e.filename," ")}}function ab(a,d){if(a&1&&(i(0,"ul",152),u(1,nb,4,2,"li",153),t()),a&2){let e=p(3);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function rb(a,d){if(a&1&&(i(0,"div",158),x(1,"app-loader",159),i(2,"small",151),n(3,"Loading financial summary..."),t()()),a&2){let e=p(5);l(),s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function lb(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Logistics:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function ob(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Insurance:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges),"")}}function sb(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Gross Total:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",144)(8,"b",45),n(9,"Discount:"),t(),i(10,"span",145),n(11),_(12,"currencyFormat"),t()(),i(13,"li",144)(14,"b",45),n(15,"Net Total:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"SGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",146)(26,"span",45),n(27,"CGST:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),i(31,"li",146)(32,"span",45),n(33,"IGST:"),t(),i(34,"span",142),n(35),_(36,"currencyFormat"),t()(),i(37,"li",144)(38,"b",45),n(39,"Total Tax Amount:"),t(),i(40,"span",142),n(41),_(42,"currencyFormat"),t()(),u(43,lb,6,3,"li",147)(44,ob,6,3,"li",147),t()),a&2){let e=p(5);l(5),m(" ",v(6,9,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(12,11,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(18,13,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(24,15,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(30,17,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(36,19,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(42,21,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0)}}function db(a,d){a&1&&(i(0,"span")(1,"div",74)(2,"span",75),n(3,"Loading..."),t()(),i(4,"span",45),n(5,"Loading total..."),t()())}function cb(a,d){if(a&1&&(i(0,"span")(1,"span",45),n(2,"Total Payable Amou
1nt:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(5);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.total_amount),"")}}function pb(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,rb,4,2,"div",157)(4,sb,45,23,"ul",140),t(),i(5,"div",141),u(6,db,6,0,"span",28)(7,cb,6,3,"span",28),t()()()),a&2){let e=p(4);l(3),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails),l(2),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails)}}function mb(a,d){if(a&1&&(i(0,"div",158),x(1,"app-loader",159),i(2,"small",151),n(3,"Loading financial summary..."),t()()),a&2){let e=p(5);l(),s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function ub(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Logistics:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function _b(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Insurance:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges),"")}}function vb(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Gross Total:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",144)(8,"b",45),n(9,"Discount:"),t(),i(10,"span",145),n(11),_(12,"currencyFormat"),t()(),i(13,"li",144)(14,"b",45),n(15,"Net Total:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"SGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",146)(26,"span",45),n(27,"CGST:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),i(31,"li",146)(32,"span",45),n(33,"IGST:"),t(),i(34,"span",142),n(35),_(36,"currencyFormat"),t()(),i(37,"li",144)(38,"b",45),n(39,"Total Tax Amount:"),t(),i(40,"span",142),n(41),_(42,"currencyFormat"),t()(),u(43,ub,6,3,"li",147)(44,_b,6,3,"li",147),t()),a&2){let e=p(5);l(5),m(" ",v(6,9,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(12,11,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(18,13,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(24,15,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(30,17,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(36,19,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(42,21,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0)}}function gb(a,d){a&1&&(i(0,"span")(1,"div",74)(2,"span",75),n(3,"Loading..."),t()(),i(4,"span",45),n(5,"Loading total..."),t()())}function fb(a,d){if(a&1&&(i(0,"span")(1,"span",45),n(2,"Total Payable Amount:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(5);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.total_amount),"")}}function hb(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,mb,4,2,"div",157)(4,vb,45,23,"ul",140),t(),i(5,"div",141),u(6,gb,6,0,"span",28)(7,fb,6,3,"span",28),t()()()),a&2){let e=p(4);l(3),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails),l(2),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails)}}function xb(a,d){if(a&1&&(i(0,"div",158),x(1,"app-loader",159),i(2,"small",151),n(3,"Loading financial summary..."),t()()),a&2){let e=p(5);l(),s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function bb(a,d){if(a&1&&(i(0,"li",144)(1,"b",45),n(2,"Logistics:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(6);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function yb(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Total Bid Value:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",146)(8,"span",45),n(9,"SGST: "),t(),i(10,"span",142),n(11),_(12,"currencyFormat"),t()(),i(13,"li",146)(14,"span",45),n(15,"CGST:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"IGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",144)(26,"b",45),n(27,"Total Tax Amount:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),u(31,bb,6,3,"li",147),t()),a&2){let e=p(5);l(5),m(" ",v(6,6,e.poDetails==null?null:e.poDetails.gross),""),l(6),m(" ",v(12,8,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(18,10,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(24,12,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(30,14,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0)}}function Sb(a,d){a&1&&(i(0,"span")(1,"div",74)(2,"span",75),n(3,"Loading..."),t()(),i(4,"span",45),n(5,"Loading total..."),t()())}function Cb(a,d){if(a&1&&(i(0,"span")(1,"span",45),n(2,"Total Payable Amou
1nt:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(5);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.total_amount),"")}}function Eb(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,xb,4,2,"div",157)(4,yb,32,16,"ul",140),t(),i(5,"div",141),u(6,Sb,6,0,"span",28)(7,Cb,6,3,"span",28),t()()()),a&2){let e=p(4);l(3),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails),l(2),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails)}}function Ib(a,d){if(a&1&&(i(0,"div",158),x(1,"app-loader",159),i(2,"small",151),n(3,"Loading financial summary..."),t()()),a&2){let e=p(5);l(),s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function Db(a,d){if(a&1&&(i(0,"ul",143)(1,"li",144)(2,"b",45),n(3,"Gross Total:"),t(),i(4,"span",142),n(5),_(6,"currencyFormat"),t()(),i(7,"li",144)(8,"b",45),n(9,"Discount:"),t(),i(10,"span",145),n(11),_(12,"currencyFormat"),t()(),i(13,"li",144)(14,"b",45),n(15,"Net Total:"),t(),i(16,"span",142),n(17),_(18,"currencyFormat"),t()(),i(19,"li",146)(20,"span",45),n(21,"SGST:"),t(),i(22,"span",142),n(23),_(24,"currencyFormat"),t()(),i(25,"li",146)(26,"span",45),n(27,"CGST:"),t(),i(28,"span",142),n(29),_(30,"currencyFormat"),t()(),i(31,"li",146)(32,"span",45),n(33,"IGST:"),t(),i(34,"span",142),n(35),_(36,"currencyFormat"),t()(),i(37,"li",144)(38,"b",45),n(39,"Total Tax Amount:"),t(),i(40,"span",142),n(41),_(42,"currencyFormat"),t()(),i(43,"li",144)(44,"b",45),n(45,"Additional Charges:"),t(),i(46,"span",142),n(47),_(48,"currencyFormat"),t()()()),a&2){let e=p(5);l(5),m(" ",v(6,8,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(12,10,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(18,12,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(24,14,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(30,16,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(36,18,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(42,20,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(48,22,e.getAdditionalCharges()),"")}}function Tb(a,d){a&1&&(i(0,"span")(1,"div",74)(2,"span",75),n(3,"Loading..."),t()(),i(4,"span",45),n(5,"Loading total..."),t()())}function wb(a,d){if(a&1&&(i(0,"span")(1,"span",45),n(2,"Total Payable Amount:"),t(),i(3,"span",142),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(5);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.total_amount),"")}}function Pb(a,d){if(a&1&&(i(0,"div")(1,"div",139)(2,"div",13),u(3,Ib,4,2,"div",157)(4,Db,49,24,"ul",140),t(),i(5,"div",141),u(6,Tb,6,0,"span",28)(7,wb,6,3,"span",28),t()()()),a&2){let e=p(4);l(3),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails),l(2),s("ngIf",e.loadingStates.poDetails),l(),s("ngIf",!e.loadingStates.poDetails)}}function Ob(a,d){if(a&1&&(i(0,"div",108),u(1,pb,8,4,"div",61)(2,hb,8,4,"div",61)(3,Eb,8,4,"div",61)(4,Pb,8,4,"div",61),t()),a&2){let e=p(3);s("ngSwitch",e.poDetails==null?null:e.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}function kb(a,d){if(a&1){let e=I();i(0,"div",17)(1,"div",18)(2,"div",19)(3,"div",20)(4,"h2",21)(5,"a",22),x(6,"i",23),t(),u(7,ph,2,0,"span",24)(8,mh,2,0,"span",24),t()(),i(9,"div",25),u(10,vh,3,3,"button",26),i(11,"button",27),S("click",function(){b(e);let r=p(2);return y(r.printPO())}),u(12,gh,4,0,"span",28)(13,fh,6,0,"span",28),t()()()(),i(14,"div",18)(15,"div",29)(16,"div",30)(17,"h3",31),u(18,hh,2,0,"span",24)(19,xh,2,0,"span",24),t()(),i(20,"div",32)(21,"div",33)(22,"div",34)(23,"div",35),u(24,bh,2,0,"span",24)(25,yh,2,0,"span",24),t(),i(26,"div",36),n(27),t()(),i(28,"div",34)(29,"div",35),u(30,Sh,2,0,"span",24)(31,Ch,2,0,"span",24),t(),i(32,"div",36),n(33),_(34,"date"),t()(),i(35,"div",34)(36,"div",35),u(37,Eh,2,0,"span",24)(38,Ih,2,0,"span",24),t(),i(39,"div",36),n(40),_(41,"date"),t()(),i(42,"div",34)(43,"div",37),n(44,"Source"),t(),i(45,"div",36),n(46),t()(),i(47,"div",34)(48,"div",37),n(49,"Source ID"),t(),i(50,"div",36),u(51,Dh,2,2,"button",38)(52,Th,1,1,"ng-template",null,0,P),t()(),i(54,"div",34)(55,"div",35),u(56,wh,2,0,"span",24)(57,Ph,2,0,"span",24),t(),i(58,"div",36),n(59),t()(),i(60,"div",34)(61,"div",37),n(62,"Payment Mode"),t(),i(63,"div",36),n(64),_(65,"titlecase"),t()(),u(66,Ah,4,1,"div",39),t()()(),i(67,"div",29)(68,"div",30)(69,"h3",40),n(70,"Supplier Details"),t()(),i(71,"div",32)(72,"div",17),u(73,Vh,5,1,"div",41),i(74,"div",42)(75,"div",43)(76,"div",13)(77,"p",44)(78,"span",45),n(79,"Seller Name: "),t(),u(80,Bh,2,1,"span",46)(81,Rh,2,0,"span",47),t(),i(82,"p",44)(83,"span",45),n(84,"GST No:"),t(),u(85,Lh,4,0,"span",46)(86,qh,2,1,"span",46)(87,Gh,2,0,"span",47),t(),i(88,"p",44)(89,"span",45),n(90,"Seller Address:"),t(),x(91,"br"),u(92,Uh,2,1,"span",46)(93,jh,2,0,"span",47),t()()()()()()(),i(94,"div",29)(95,"div",30)(96,"h3",40),n(97,"Buyer Details"),t()(),i(98,"div",32)(99,"div",17)(100,"div",48)(101,"div",49)(102,"div",13)(103,"p",50),n(104,"Shipping Address "),t(),u(105,$h,4,1,"p",51)(106,zh,5,1,"p",52)(107,Wh,5,0,"p",52),t()()(),i(108,"div",48)(109,"div",43)(110,"div",13)(111,"p",50),n(112,"Billing Address "),t(),u(113,Qh,4,1,"p",51),i(114,"p",44)(115,"span",45),n(116,"GST No:"),t(),u(117,Yh,4,0,"span",46)(118,Hh,2,1,"span",46)(119,Kh,2,0,"span",47),t(),u(120,Zh,5,1,"p",52)(121,Jh,5,0,"p",52),t()()(),u(122,Xh,3,3,"div",53),t()()(),i(123,"div",29)(124,"div",54)(125,"h3",40),n(126,"Order Summary"),t()(),i(127,"div",55)(128,"div",56)(129,"div",57)(130,"table",58)(131,"thead",59)(132,"tr"),u(133,ex,5,2,"th",60),t()(),u(134,ox,2,1,"tbody",61)(135,_x,2,1,"tbody",61)(136,yx,2,1,"tbody",61)(137,wx,2,1,"tbody",61)(138,Ox,2,1,"tbody",28)(139,kx,4,1,"tbody",28),t()()()()(),u(140,Xx,15,7,"div",62),i(141,"div",63)(142,"div",48)(143,"div",64)(144,"div",30)(145,"h3",40),n(146,"Terms & Conditions"),t()(),i(147,"div",32)(148,"div",65)(149,"div",66),u(150,eb,1,2,"app-loader",67)(151,tb,2,1,"p",68),t()(),i(152,"div",65),u(153,ib,4,2,"div",69)(154,ab,2,1,"ul",70),t()()()(),u(155,Ob,5,5,"div",71),t()()()}if(a&2){let e=w(53),o=p(2);l(7),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),s("ngIf",(o.supplierData==null?null:o.supplierData.source)!=="Manual"),l(),s("disabled",o.loadingStates.print),l(),s("ngIf",!o.loadingStates.print),l(),s("ngIf",o.loadingStates.print),l(5),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(5),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(o.supplierData==null?null:o.supplierData.po_number),l(3),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(U(34,60,o.supplierData==null?null:o.supplierData.po_date,"dd-MM-yyyy")),l(4),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),m("",U(41,63,o.supplierData==null?null:o.supplierData.expiry_date,"dd-MM-yyyy")," "),l(6),f((o.supplierData==null?null:o.supplierData.source)||"--"),l(5),s("ngIf",o.canOpenSource)("ngIfElse",e),l(5),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f((o.shippingAddress==null?null:o.shippingAddress.region)||"--"),l(5),m(" ",o.supplierData!=null&&o.supplierData.payment_mode?v(65,66,o.supplierData.payment_mode):"--"," "),l(2),s("ngIf",(o.supplierData==null?null:o.supplierData.source)==="rfq"),l(7),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_details)),l(7),s("ngIf",o.poDetails==null?null:o.poDetails.seller_details.company_name),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_details.company_name)),l(4),s("ngIf",o.loadingStates.poDetails),l(),s("ngIf",!o.loadingStates.poDetails&&(o.poDetails==null||o.poDetails.seller_gst_list==null?null:o.poDetails.seller_gst_list.length)),l(),s("ngIf",!o.loadingStates.poDetails&&!(!(o.poDetails==null||o.poDetails.seller_gst_list==null)&&o.poDetails.seller_gst_list.length)),l(5),s("ngIf",o.supplierData&&o.supplierData.seller_address&&o.Object.keys(o.supplierData.seller_address).length),l(),s("ngIf",o.supplierData&&(!o.supplierData.seller_address||!o.Object.keys(o.supplierData.seller_address).length)),l(7),s("ngClass",(o.poDetails==null?null:o.poDetails.source)!=="DirectBuy"&&(o.poDetails!=null&&o.poDetails.logo_path)?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(),s("ngIf",o.shippingAddress),l(),s("ngIf",!o.shippingAddress),l(),s("ngClass",(o.poDetails==null?null:o.poDetails.source)!=="DirectBuy"&&(o.poDetails!=null&&o.poDetails.logo_path)?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(4),s("ngIf",o.loadingStates.orderDetails),l(),s("ngIf",!o.loadingStates.orderDetails&&o.supplierData.gstn),l(),s("ngIf",!o.loadingStates.orderDetails&&!o.supplierData.gstn),l(),s("ngIf",o.billingAddress),l(),s("ngIf",!o.billingAddress),l(),s("ngIf",(o.poDetails==null?null:o.poDetails.source)!=="DirectBuy"&&(o.poDetails==null?null:o.poDetails.logo_path)),l(8),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(3),s("ngForOf",o.getTableHeaders(o.supplierData==null?null:o.supplierData.source)),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","Manual"),l(),s("ngIf",o.poDetails==null||o.poDetails.additional_charges==null?null:o.poDetails.additional_charges.length),l(),s("ngIf",!(!(o.supplierData==null||o.supplierData.items==null)&&o.supplierData.items.length)),l(),s("ngIf",(o.poDetails==null?null:o.poDetails.multiple_payment_terms)==="YES"||(o.poDetails==null?null:o.poDetails.multiple_shipment_terms)==="YES"),l(2),s("ngClass",(o.poDetails==null?null:o.poDetails.multiple_payment_terms)==="YES"||(o.poDetails==null?null:o.poDetails.multiple_shipment_terms)==="YES"?"col-12":"col-12 col-lg splitedSummaryLefttSide"),l(8),s("ngIf",o.loadingStates.poDetails),l(),s("ngIf",!o.loadingStates.poDetails),l(2),s("ngIf",o.loadingStates.poDetails),l(),s("ngIf",!o.loadingStates.poDetails&&(o.poDetails==null?null:o.poDetails.detail_terms_document)),l(),s("ngIf",!((o.poDetails==null?null:o.poDetails.multiple_payment_terms)==="YES"||(o.poDetails==null?null:o.poDetails.multiple_shipment_terms)==="YES"))}}function Fb(a,d){if(a&1&&(i(0,"div",6),u(1,ch,10,0,"div",7)(2,kb,156,68,"div",8),t()),a&2){let e=p();l(),s("ngIf",!e.viewAccess),l(),s("ngIf",e.supplierData&&e.viewAccess)}}var qa=(()=>{class a{constructor(e,o,r,c,g,h){this.financeOrderService=e,this.activatedRoute=o,this.drService=r,this.router=c,this.notificationService=g,this.cService=h,this.accessList=[],this.initialLoad=!1,this.Object=Object,this.loadingStates={orderDetails:!1,poDetails:!1,dealRoom:!1,print:!1}}get canOpenSource(){let e=(this.supplierData?.source||"").toLowerCase();return!!this.supplierData?.source_id&&(e==="rfq"||e==="auction")}onSourceClick(){let e=(this.supplierData?.source||"").toLowerCase(),o=this.supplierData?.source_id;if(!o)return;let r="";if(e==="rfq"?r="/rfq/buyer/rfq-details/"+o:e==="auction"&&(r="/buyer-auction/buyer-auction-detail
1s/"+o),!r)return;let c=window.location.href.replace(this.router.url,"");window.open(c+r,"_blank")}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.poId=e.id}),this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e,this.viewAccess?(this.GetOrderDetailsByPO(),this.GetPODetails()):this.initialLoad=!0)})}GetOrderDetailsByPO(){try{this.loadingStates.orderDetails=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe({next:o=>{this.supplierData=o.response.data,this.supplierData.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.supplierData.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.loadingStates.orderDetails=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get totalAmount(){if(this.poDetails!==null)return this.poDetails.gross-this.poDetails.discount_amount+this.poDetails.gst_amount+this.poDetails.shipping_charges+this.poDetails.logistics_charges+this.poDetails.insurance_charges}get isWorkOrder(){return String(this.supplierData?.order_type||this.poDetails?.order_type||"").toUpperCase()==="WO"}GetPODetails(){try{this.loadingStates.poDetails=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe({next:o=>{this.poDetails=o.response.data,this.poDetails.net_charges=Math.round(this.poDetails.net_charges),this.loadingStates.poDetails=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.poDetails=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.poDetails=!1}}getAdditionalCharges(){return this.poDetails?.additional_charges?.length?this.poDetails.additional_charges.reduce((e,o)=>e+(parseFloat(o.amount)||0),0):0}getTableHeaders(e){let o=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Total Bid Value",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],r=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""},{title:"Required Qty",subtitle:""},{title:"Quoted",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],c=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Basic Price",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],g=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""}
1,{title:"Quoted Price/Unit",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Total Payable",subtitle:""}],h;switch(e){case"auction":h=o;break;case"rfq":h=r;break;case"DirectBuy":h=c;break;case"Manual":h=g;break;default:return[]}return this.isWorkOrder&&h.length&&h[0].title==="Product Name"&&(h=[j(A({},h[0]),{title:"Service Name"}),...h.slice(1)]),h}toDealRoom(){try{this.loadingStates.dealRoom=!0;let e=()=>{switch(this.supplierData.source){case"rfq":return"rfq";case"auction":return"auction";default:return"direct"}},o=()=>{switch(this.supplierData.source){case"rfq":return this.supplierData.dealroom_source_id;case"auction":return this.supplierData.dealroom_source_id;default:return""}},r={source:e(),source_id:Number(o()),receiver_id:this.supplierData.dealroom_receiver_id};this.drService.initiateChat(r).subscribe(c=>{c.responseCode===200?(this.drService.setBuyerOrSeller("B"),this.router.navigate(["deal-room",e(),c.room_id,"chat"])):this.notificationService.showError("Something went wrong!"),this.loadingStates.dealRoom=!1},c=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.dealRoom=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.dealRoom=!1}}getPoType(e){let o=e?.toLowerCase();return o==="rfq"?"PO_RFQ":o==="auction"?"PO_AUCTION":o==="directbuy"||o==="direct"?"PO_DIRECT_BUY":o==="manual"||o==="manual"?"PO_MANUAL":"PO_RFQ"}printPO(){this.loadingStates.print=!0;let e=this.getPoType(this.supplierData?.source);this.financeOrderService.printPdf(e,Number(this.poId)).subscribe({next:o=>{this.loadingStates.print=!1,Te(o)},error:()=>{this.loadingStates.print=!1}})}get viewAccess(){return!0}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Qt),T(K),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-sent-to-supplier-view"]],decls:1,vars:1,consts:[["plainSourceId",""],["fileList",""],["prodname","ngbPopover"],["prods",""],["popContent",""],["id","content","class","rfq-pages generate-po-page container-fluid overflow-hidden-non-i",4,"ngIf"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],["class","container-fluid text-center my-5",4,"ngIf"],["class","row",4,"ngIf"],[1,"container-fluid","text-center","my-5"],[1,"row","justify-content-center"],[1,"col-12","col-md-8"],[1,"card","p-4"],[1,"card-body"],[1,"uil","uil-lock-alt","display-4","text-danger","mb-3"],["appTranslate","",1,"card-title"],["appTranslate","",1,"card-text"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate","",4,"ngIf"],[1,"col-md-6","col-12","text-right"],["class","mod-btn mod-btn-primary btn-sm mr-2",3,"disabled","click",4,"ngIf"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],[1,"mod-meta-label"],[1,"mod-meta-value"],["appTranslate","",1,"mod-meta-label"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngIf"],["appTranslate","",1,"mod-card-title","mb-0"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-6","col-lg-12"],[1,"card"],[1,"fw-600","mb-1"],["appTranslate",""],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[3,"ngClass"],[1,"card","h-100"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],["class","fw-600",4,"ngIf"],["class","col-12 col-md-auto",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],[1,""],["class","text-nowrap",4,"ngFor","ngForOf"],[4,"ngSwitchCase"],["class","row mt-1 gut-row gut-4 align-items-start",4,"ngIf"],[1,"row","mt-1","gut-row","gut-x-4"],[1,"mod-card","mb-4","h-100"],[1,"col-12","pl-0"],[1,"form-group"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","font-12 text-secondary mb-2",4,"ngIf"],["class","text-center p-3",4,"ngIf"],["class","list-inline",4,"ngIf"],["class","col-lg col-12 splitedSummaryRightSide",3,"ngSwitch",4,"ngIf"],[1,"mod-btn","mod-btn-primary","btn-sm","mr-2",3,"click","disabled"],[1,"uil","uil-comments-alt"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"uil","uil-print"],["type","button",1,"mod-btn-action",3,"click","title"],["class","mod-meta-value",4,"ngIf"],["placement","top","triggers","manual","class","ml-3 badge fileListBadge",3,"ngbPopover","mouseenter","mouseleave",4,"ngIf"],["class","mb-0",4,"ngFor","ngForOf"],[1,"mb-0"],["placement","top","triggers","manual",1,"ml-3","badge","fileListBadge",3,"mouseenter","mouseleave","ngbPopover"],["appTranslate","",1,"text-secondary"],[1,"text-secondary"],["role","status",1,"spinner-border","spinner-border-sm"],[1,"text-secondary","mb-1"],["appTranslate","",1,"fw-600"],[1,"fw-600"],[1,"col-12","col-md-auto"],[1,"doc-logo"],["ngxViewer","","fallback","./../../../../assets/img/placeholderimage.png",1,"doc-logo__img",3,"viewerOptions","src"],[1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","2",1,"cell-300"],["appTranslate","",1,"text-center","text-secondary"],[1,"row","mt-1","gut-row","gut-4","align-items-start"],[1,"col-12","col-lg","splitedSummaryLefttSide"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-lg","col-12","splitedSummaryRightSide",3,"ngSwitch"],[1,"col-12","mb-30"],["data-toggle","collapse","data-target","#coll__PaymentTerms","aria-expanded","fal
1se",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","coll__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20"],["data-toggle","collapse","data-target","#coll__ShipmentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["id","coll__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],[1,"card","totalCalculationCard"],["class","list-unstyled mb-0",4,"ngIf"],[1,"card-footer"],[1,"float-right"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],["class","mb-2",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition"],[1,"font-12","text-secondary","mb-2"],[1,"text-center","p-3"],["appTranslate","",1,"text-muted","d-block","mt-2"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["class","text-center p-4",4,"ngIf"],[1,"text-center","p-4"],["size","medium",3,"isLoading","useBlockPosition"]],template:function(o,r){o&1&&u(0,Fb,3,2,"div",5),o&2&&s("ngIf",r.initialLoad)},dependencies:[nt,J,W,pt,mt,Se,Zt,Z,De,Lt,L,Rt,st,ae],styles:[".pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--theme-primary)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--theme-primary);border-color:var(--theme-primary);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.shipmentmargin[_ngcontent-%COMP%]{margin-bottom:77px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{vertical-align:top}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;max-width:100px}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.fileListBadge[_ngcontent-%COMP%]{padding:2px 5px;border-radius:3px;background-color:#ddf3ff;color:#006fae}.fileListBadge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1rem}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;
1color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.width-69px[_ngcontent-%COMP%]{width:69px}.doc-logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:180px;max-width:100%;height:100%;min-height:104px;padding:12px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-lg)}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:88px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 767.98px){.doc-logo[_ngcontent-%COMP%]{width:100%;min-height:88px}}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:140px;white-space:normal;word-break:break-all}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}"]})}}return a})();var Mb=()=>({toolbar:!1});function Ab(a,d){a&1&&(i(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12),x(5,"i",13),i(6,"h3",14),n(7,"Access Restricted"),t(),i(8,"p",15),n(9,"You do not have the necessary permissions to view this content. Please contact your administrator for further assistance."),t()()()()()())}function Nb(a,d){a&1&&(i(0,"span"),x(1,"i",67),i(2,"span",23),n(3,"Print"),t()())}function Vb(a,d){a&1&&(i(0,"span")(1,"div",68)(2,"span",69),n(3,"Loading..."),t()(),i(4,"span",23),n(5,"Printing..."),t()())}function Bb(a,d){if(a&1){let e=I();i(0,"button",70),S("click",function(){b(e);let r=p(3);return y(r.onSourceClick())}),n(1),t()}if(a&2){let e=p(3);s("title",(e.supplierData==null?null:e.supplierData.display_source_id)||(e.supplierData==null?null:e.supplierData.source_id)),l(),m(" ",(e.supplierData==null?null:e.supplierData.display_source_id)||(e.supplierData==null?null:e.supplierData.source_id)||"--"," ")}}function Rb(a,d){if(a&1&&n(0),a&2){let e=p(3);f((e.supplierData==null?null:e.supplierData.display_source_id)||(e.supplierData==null?null:e.supplierData.source_id)||"--")}}function Lb(a,d){a&1&&(i(0,"span",71),n(1," Not available at the moment "),t())}function qb(a,d){if(a&1&&(i(0,"div",17)(1,"div",41)(2,"div",42)(3,"p",43),u(4,Lb,2,0,"span",45),t()()()()),a&2){let e=p(3);l(4),s("ngIf",e.poDetails&&!(e.poDetails!=null&&e.poDetails.seller_billing_address))}}function Gb(a,d){if(a&1&&(i(0,"span",72),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null||e.poDetails.seller_details==null?null:e.poDetails.seller_details.company_name)}}function Ub(a,d){a&1&&(i(0,"span",71),n(1,"Not available"),t())}function jb(a,d){if(a&1&&(i(0,"span",72),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null?null:e.poDetails.seller_gst)}}function $b(a,d){a&1&&(i(0,"span",71),n(1,"Not available"),t())}function zb(a,d){if(a&1&&(i(0,"span",72),n(1),t()),a&2){let e=p(3);l(),se(" ",e.poDetails==null||e.poDetails.seller_billing_address==null?null:e.poDetails.seller_billing_address.street,", ",e.poDetails==null||e.poDetails.seller_billing_address==null?null:e.poDetails.seller_billing_address.region,", ",e.poDetails==null||e.poDetails.seller_billing_address==null?null:e.poDetails.seller_billing_address.city,", ",e.poDetails==null||e.poDetails.seller_billing_address==null?null:e.poDetails.seller_billing_address.postcode," ")}}function Wb(a,d){a&1&&(i(0,"span",71),n(1," No Address Found "),t())}function Qb(a,d){if(a&1&&(i(0,"p",73)(1,"b",74),n(2,"Address:"),t(),i(3,"span",72),n(4),t()()),a&2){let e=p(3);l(4),se(" ",e.shippingAddress==null?null:e.shippingAddress.street,", ",e.shippingAddress==null?null:e.shippingAddress.region,", ",e.shippingAddress==null?null:e.shippingAddress.city,", ",e.shippingAddress==null?null:e.shippingAddress.postcode," ")}}function Yb(a,d){a&1&&(i(0,"p",73)(1,"b",74),n(2,"Address:"),t(),i(3,"span",71),n(4," Not available "),t()())}function Hb(a,d){if(a&1&&(i(0,"span",72),n(1),t()),a&2){let e=p(3);l(),f(e.supplierData==null?null:e.supplierData.gstn)}}function Kb(a,d){a&1&&(i(0,"span",71),n(1,"Not available"),t())}function Zb(a,d){if(a&1&&(i(0,"p",73)(1,"b",74),n(2,"Address:"),t(),i(3,"span",72),n(4),t()()),a&2){let e=p(3);l(4),se(" ",e.billingAddress==null?null:e.billingAddress.street,", ",e.billingAddress==null?null:e.billingAddress.region,", ",e.billingAddress==null?null:e.billingAddress.city,", ",e.billingAddress==null?null:e.billingAddress.postcode," ")}}function Jb(a,d){a&1&&(i(0,"p",73)(1,"b",74),n(2,"Address:"),t(),i(3,"span",71),n(4," Not available "),t()())}function Xb(a,d){if(a&1&&(i(0,"div",75)(1,"div",76),x(2,"img",77),t()()),a&2){let e=p(3);l(2),s("viewerOptions",Ce(2,Mb))("src",e.poDetails==null?null:e.poDetails.logo_path,q)}}function ey(a,d){if(a&1&&(i(0,"th",78)(1,"span"),n(2),t(),i(3,"small"),n(4),t()()),a&2){let e=d.$implicit;l(2),m("",e.title," "),l(2),f(e.subtitle)}}function ty(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function iy(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function ny(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function ay(a,d){if(a&1&&(F(0),i(1,"div",82),n(2),t(),i(3,"p",83),u(4,ty,2,2,"span",84)(5,iy,2,2,"span",84)(6,ny,2,2,"span",84),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function ry(a,d){if(a&1&&(i(0,"p",86)(1,"small")(2,"span",23),n(3,"SKU ID:"),t(),n(4),t()()),a&2){let e=p().$implicit;l(4),m(" ",e.display_item_id,"")}}function ly(a,d){if(a&1&&(F(0),i(1,"div",82)(2,"div")(3,"p",87)(4,"span",23),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",87)(9,"span",23),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",87)(14,"span",23),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",87),n(19),_(20,"currencyFormat"),t(),i(21,"p",87),n(22),_(23,"currencyFormat"),t(),i(24,"p",87),n(25),_(26,"currencyFormat"),t(),i(27,"p",87),n(28),_(29,"currencyFormat"),t(),i(30,"p",87)(31,"span",23),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",87)(36,"span",23),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",88),i(41,"p",89)(42,"b")(43,"
1span",23),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.total_amount)," ")}}function oy(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",79),n(3),t(),u(4,ay,7,4,"ng-template",null,1,P),x(6,"i",80),u(7,ry,5,1,"p",81),t(),i(8,"td"),n(9),_(10,"currencyFormat"),t(),i(11,"td"),n(12),_(13,"currencyFormat"),u(14,ly,47,34,"ng-template",null,2,P),x(16,"i",80),t()()),a&2){let e=d.$implicit,o=w(5),r=w(15);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(),s("ngIf",e.display_item_id),l(2),f(v(10,6,e.gst)),l(3),m(" ",v(13,8,e.total_amount)," "),l(4),s("ngbPopover",r)}}function sy(a,d){if(a&1&&(i(0,"li",92)(1,"a",93),x(2,"i",94),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(2),m(" ",e.filename," ")}}function dy(a,d){if(a&1&&(i(0,"ul",90),u(1,sy,4,2,"li",91),t()),a&2){let e=p(3);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function cy(a,d){if(a&1&&(i(0,"div")(1,"div",95)(2,"div",42)(3,"ul",96)(4,"li",97)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",98),n(8),_(9,"currencyFormat"),t()(),i(10,"li",97)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",99),n(14),_(15,"currencyFormat"),t()(),i(16,"li",97)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",98),n(20),_(21,"currencyFormat"),t()(),i(22,"li",100)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",98),n(26),_(27,"currencyFormat"),t()(),i(28,"li",100)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",98),n(32),_(33,"currencyFormat"),t()(),i(34,"li",100)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",98),n(38),_(39,"currencyFormat"),t()(),i(40,"li",97)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",98),n(44),_(45,"currencyFormat"),t()(),i(46,"li",97)(47,"b",23),n(48,"Logistics:"),t(),i(49,"span",98),n(50),_(51,"currencyFormat"),t()(),i(52,"li",97)(53,"b",23),n(54,"Insurance:"),t(),i(55,"span",98),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",101)(59,"span",23),n(60,"Total Payable Amount:"),t(),i(61,"span",98),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function py(a,d){if(a&1&&(i(0,"div")(1,"div",95)(2,"div",42)(3,"ul",96)(4,"li",97)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",98),n(8),_(9,"currencyFormat"),t()(),i(10,"li",97)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",99),n(14),_(15,"currencyFormat"),t()(),i(16,"li",97)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",98),n(20),_(21,"currencyFormat"),t()(),i(22,"li",100)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",98),n(26),_(27,"currencyFormat"),t()(),i(28,"li",100)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",98),n(32),_(33,"currencyFormat"),t()(),i(34,"li",100)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",98),n(38),_(39,"currencyFormat"),t()(),i(40,"li",97)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",98),n(44),_(45,"currencyFormat"),t()(),i(46,"li",97)(47,"b",23),n(48,"Logistics:"),t(),i(49,"span",98),n(50),_(51,"currencyFormat"),t()(),i(52,"li",97)(53,"b",23),n(54,"Insurance:"),t(),i(55,"span",98),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",101)(59,"span",23),n(60,"Total Payable Amou
1nt:"),t(),i(61,"span",98),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function my(a,d){if(a&1&&(i(0,"div")(1,"div",95)(2,"div",42)(3,"ul",96)(4,"li",97)(5,"b",23),n(6,"Total Bid Value:"),t(),i(7,"span",98),n(8),_(9,"currencyFormat"),t()(),i(10,"li",100)(11,"span",23),n(12,"SGST: "),t(),i(13,"span",98),n(14),_(15,"currencyFormat"),t()(),i(16,"li",100)(17,"span",23),n(18,"CGST:"),t(),i(19,"span",98),n(20),_(21,"currencyFormat"),t()(),i(22,"li",100)(23,"span",23),n(24,"IGST:"),t(),i(25,"span",98),n(26),_(27,"currencyFormat"),t()(),i(28,"li",97)(29,"b",23),n(30,"Total Tax Amount:"),t(),i(31,"span",98),n(32),_(33,"currencyFormat"),t()(),i(34,"li",97)(35,"b",23),n(36,"Logistics:"),t(),i(37,"span",98),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",101)(41,"span",23),n(42,"Total Payable Amount:"),t(),i(43,"span",98),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,7,e.poDetails==null?null:e.poDetails.gross),""),l(6),m(" ",v(15,9,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(21,11,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(27,13,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(33,15,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(39,17,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(45,19,e.poDetails==null?null:e.poDetails.total_amount),"")}}function uy(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",18)(3,"div",19)(4,"h2",20)(5,"a",21),x(6,"i",22),t(),i(7,"span",23),n(8,"Purchase Order"),t()()(),i(9,"div",24)(10,"button",25),S("click",function(){b(e);let r=p(2);return y(r.printPO())}),u(11,Nb,4,0,"span",26)(12,Vb,6,0,"span",26),t()()()(),i(13,"div",17)(14,"div",27)(15,"div",28)(16,"h3",29)(17,"span",23),n(18,"Purchase Order ID:"),t(),n(19),t()(),i(20,"div",12)(21,"div",30)(22,"div",31)(23,"div",32)(24,"p",33),n(25,"Status:"),t(),i(26,"b"),n(27),t()()()()()(),i(28,"div",27)(29,"div",28)(30,"h3",34),n(31,"Purchase Order Details"),t()(),i(32,"div",12)(33,"div",35)(34,"div",36)(35,"div",37),n(36,"PO No."),t(),i(37,"div",38),n(38),t()(),i(39,"div",36)(40,"div",37),n(41,"Source ID"),t(),i(42,"div",38),u(43,Bb,2,2,"button",39)(44,Rb,1,1,"ng-template",null,0,P),t()(),i(46,"div",36)(47,"div",37),n(48,"Purchase Order Date"),t(),i(49,"div",38),n(50),_(51,"date"),t()()()()(),i(52,"div",27)(53,"div",28)(54,"h3",34),n(55,"Supplier Details"),t()(),i(56,"div",12)(57,"div",16),u(58,qb,5,1,"div",40),i(59,"div",17)(60,"div",41)(61,"div",42)(62,"p",43)(63,"span",23),n(64,"Seller Name:"),t(),u(65,Gb,2,1,"span",44)(66,Ub,2,0,"span",45),t(),i(67,"p",43)(68,"span",23),n(69,"GST No:"),t(),u(70,jb,2,1,"span",44)(71,$b,2,0,"span",45),t(),i(72,"p",43)(73,"span",23),n(74,"Seller Address:"),t(),x(75,"br"),u(76,zb,2,4,"span",44)(77,Wb,2,0,"span",45),t()()()()()()(),i(78,"div",27)(79,"div",28)(80,"h3",34),n(81,"Buyer Details"),t()(),i(82,"div",12)(83,"div",16)(84,"div",46)(85,"div",47)(86,"div",42)(87,"p",48),n(88,"Shipping Address "),t(),u(89,Qb,5,4,"p",49)(90,Yb,5,0,"p",49),t()()(),i(91,"div",46)(92,"div",41)(93,"div",42)(94,"p",48),n(95,"Billing Address "),t(),i(96,"p",43)(97,"span",23),n(98,"GST No:"),t(),u(99,Hb,2,1,"span",44)(100,Kb,2,0,"span",45),t(),u(101,Zb,5,4,"p",49)(102,Jb,5,0,"p",49),t()()(),u(103,Xb,3,3,"div",50),t()()(),i(104,"div",27)(105,"div",51)(106,"h3",34),n(107,"Order Summary"),t()(),i(108,"div",52)(109,"div",53)(110,"div",54)(111,"table",55)(112,"thead",56)(113,"tr"),u(114,ey,5,2,"th",57),t()(),i(115,"tbody"),u(116,oy,17,10,"tr",58),t()()()()()(),i(117,"div",59)(118,"div",60)(119,"div",61)(120,"div",28)(121,"h3",34),n(122,"Terms & Conditions"),t()(),i(123,"div",12)(124,"div",62)(125,"p",63),n(126),t()(),u(127,dy,2,1,"ul",64),t()()(),i(128,"div",65),u(129,cy,64,30,"div",66)(130,py,64,30,"div",66)(131,my,46,21,"div",66),t()()()()}if(a&2){let e=w(45),o=p(2);
1l(10),s("disabled",o.isPrintLoading),l(),s("ngIf",!o.isPrintLoading),l(),s("ngIf",o.isPrintLoading),l(7),m(" ",o.supplierData==null?null:o.supplierData.po_number,""),l(8),f(o.supplierData==null?null:o.supplierData.buyer_status),l(11),f(o.supplierData==null?null:o.supplierData.po_number),l(5),s("ngIf",o.canOpenSource)("ngIfElse",e),l(7),f(U(51,33,o.supplierData==null?null:o.supplierData.po_date,"dd-MM-yyyy")),l(8),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_details)),l(7),s("ngIf",o.poDetails==null?null:o.poDetails.seller_details.company_name),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_details.company_name)),l(4),s("ngIf",(o.poDetails==null?null:o.poDetails.seller_gst)&&(o.poDetails==null?null:o.poDetails.seller_gst.length)),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_gst)||!(o.poDetails!=null&&o.poDetails.seller_gst.length)),l(5),s("ngIf",o.poDetails&&(o.poDetails==null?null:o.poDetails.seller_billing_address)),l(),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_billing_address)),l(7),s("ngClass",o.poDetails!=null&&o.poDetails.logo_path?"col-md":"col-md-6"),l(5),s("ngIf",o.shippingAddress),l(),s("ngIf",!o.shippingAddress),l(),s("ngClass",o.poDetails!=null&&o.poDetails.logo_path?"col-md":"col-md-6"),l(8),s("ngIf",o.supplierData.gstn),l(),s("ngIf",!o.supplierData.gstn),l(),s("ngIf",o.billingAddress),l(),s("ngIf",!o.billingAddress),l(),s("ngIf",o.poDetails==null?null:o.poDetails.logo_path),l(11),s("ngForOf",o.getTableHeaders(o.supplierData==null?null:o.supplierData.source)),l(2),s("ngForOf",o.supplierData==null?null:o.supplierData.items),l(10),f(o.poDetails==null?null:o.poDetails.terms),l(),s("ngIf",o.poDetails==null?null:o.poDetails.detail_terms_document),l(),s("ngSwitch",o.poDetails==null?null:o.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","Directbuy"),l(),s("ngSwitchCase","auction")}}function _y(a,d){if(a&1&&(i(0,"div",5),u(1,Ab,10,0,"div",6)(2,uy,132,36,"div",7),t()),a&2){let e=p();l(),s("ngIf",!e.viewAccess),l(),s("ngIf",e.supplierData&&e.viewAccess)}}var Ga=(()=>{class a{constructor(e,o,r,c,g,h){this.financeOrderService=e,this.activatedRoute=o,this.drService=r,this.router=c,this.notificationService=g,this.cService=h,this.isLoading=!1,this.isPrintLoading=!1,this.accessList=[],this.initialLoad=!1}get canOpenSource(){let e=(this.supplierData?.source||"").toLowerCase();return!!this.supplierData?.source_id&&(e==="rfq"||e==="auction")}onSourceClick(){let e=(this.supplierData?.source||"").toLowerCase(),o=this.supplierData?.source_id;if(!o)return;let r="";if(e==="rfq"?r="/rfq/buyer/rfq-details/"+o:e==="auction"&&(r="/buyer-auction/buyer-auction-details/"+o),!r)return;let c=window.location.href.replace(this.router.url,"");window.open(c+r,"_blank")}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.poId=e.id}),this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e,this.viewAccess?(this.GetOrderDetailsByPO(),this.GetPODetails()):this.initialLoad=!0)})}GetOrderDetailsByPO(){try{this.isLoading=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe({next:o=>{this.supplierData=o.response.data,this.supplierData.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.supplierData.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.isLoading=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get totalAmount(){if(this.poDetails!==null)return this.poDetails.gross-this.poDetails.discount_amount+this.poDetails.gst_amount+this.poDetails.shipping_charges+this.poDetails.logistics_charges+this.poDetails.insurance_charges}GetPODetails(){try{this.isLoading=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe({next:o=>{this.poDetails=o.response.data,this.poDetails.net_charges=Math.round(this.poDetails.net_charges),this.isLoading=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}getTableHeaders(e){return[{title:"Product Name",subtitle:""},{title:"Tax",subtitle:""}
1,{title:"Total Payable",subtitle:""}]}toDealRoom(){try{this.isLoading=!0;let e=()=>{switch(this.supplierData.source){case"rfq":return"rfq";case"auction":return"auction";default:return"direct"}},o=()=>{switch(this.supplierData.source){case"rfq":return this.supplierData.dealroom_source_id;case"auction":return this.supplierData.dealroom_source_id;default:return""}},r={source:e(),source_id:Number(o()),receiver_id:this.supplierData.dealroom_receiver_id};this.drService.initiateChat(r).subscribe(c=>{c.responseCode===200?(this.drService.setBuyerOrSeller("B"),this.router.navigate(["deal-room",e(),c.room_id,"chat"])):this.notificationService.showError("Something went wrong!"),this.isLoading=!1},c=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}printPO(){this.isPrintLoading=!0,this.financeOrderService.printPdf("PO_MANUAL",Number(this.poId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}get viewAccess(){return!0}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Qt),T(K),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-po-manual-entry"]],decls:2,vars:2,consts:[["plainSourceId",""],["prods",""],["popContent",""],[3,"isLoading"],["id","content","class","rfq-pages generate-po-page container-fluid overflow-hidden-non-i",4,"ngIf"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],["class","container-fluid text-center my-5",4,"ngIf"],["class","row",4,"ngIf"],[1,"container-fluid","text-center","my-5"],[1,"row","justify-content-center"],[1,"col-12","col-md-8"],[1,"mod-card","p-4"],[1,"mod-card-body"],[1,"uil","uil-lock-alt","display-4","text-danger","mb-3"],["appTranslate","",1,"card-title"],["appTranslate","",1,"card-text"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"row","align-items-center"],[1,"col-md-4","align-items-center","col-12"],[1,"border","rounded-lg","p-2"],["appTranslate","",1,"theme-color","font-12","mb-0"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["class","col-12",4,"ngIf"],[1,"card"],[1,"card-body"],[1,"fw-600","mb-1"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[3,"ngClass"],[1,"card","h-100"],["appTranslate","",1,"fw-600","mb-2"],["class","fw-600",4,"ngIf"],["class","col-12 col-md-auto",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],["class","text-nowrap",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],["class","list-inline",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[4,"ngSwitchCase"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["type","button",1,"mod-btn-action",3,"click","title"],["appTranslate","",1,"text-secondary"],[1,"text-secondary"],[1,"fw-600"],["appTranslate","",1,"fw-600"],[1,"col-12","col-md-auto"],[1,"doc-logo"],["ngxViewer","","fallback","./../../../../assets/img/placeholderimage.png","alt","buyer logo",1,"doc-logo__img",3,"viewerOptions","src"],[1,"text-nowrap"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],["class","mb-0",4,"ngIf"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"mb-0"],[1,"text-dark","mb-1"],[1,"border-t"],[1,"text-secondary","mb-1"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"]],template:function(o,r){o&1&&(x(0,"app-loader",3),u(1,_y,3,2,"div",4)),o&2&&(s("isLoading",r.isLoading),l(
1),s("ngIf",r.initialLoad))},dependencies:[nt,J,W,pt,mt,Se,Zt,Z,De,Lt,L,st,ae],styles:[".pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--theme-primary)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--theme-primary);border-color:var(--theme-primary);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.shipmentmargin[_ngcontent-%COMP%]{margin-bottom:77px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{vertical-align:top}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;max-width:100px}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.doc-logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:180px;max-width:100%;height:100%;min-height:104px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 767.98px){.doc-logo[_ngcontent-%COMP%]{width:100%;min-height:88px}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child > p[_ngcontent-%COMP%]{max-width:240px;overflow-wrap:anywhere;word-break:break-word}}"]})}}return a})();var vy=()=>({toolbar:!1});function gy(a,d){a&1&&(i(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12),x(5,"i",13),i(6,"h3",14),n(7,"Access Restricted"),t(),i(8,"p",15),n(9,"You do not have the necessary permissions to view this content. Please contact your administrator for further assistance."),t()()()()()())}function fy(a,d){a&1&&(i(0,"span"),x(1,"i",81),i(2,"span",23),n(3,"Print"),t()())}function hy(a,d){a&1&&(i(0,"span")(1,"div",82)(2,"span",83),n(3,"Loading..."),t()(),i(4,"span",23),n(5,"Printing..."),t()())}function xy(a,d){if(a&1){let e=I();i(0,"button",84),S("click",function(){b(e);let r=p(3);return y(r.onSourceClick())}),n(1),t()}if(a&2){let e=p(3);s("title",(e.supplierData==null?null:e.supplierData.display_source_id)||(e.supplierData==null?null:e.supplierData.source_id)),l(),m(" ",(e.supplierData==null?null:e.supplierData.display_source_id)||(e.supplierData==null?null:e.supplierData.source_id)||"--"," ")}}function by(a,d){if(a&1&&n(0),a&2){let e=p(3);f((e.supplierData==null?null:e.supplierData.display_source_id)||(e.supplierData==null?null:e.supplierData.source_id)||"--")}}function yy(a,d){if(a&1&&(i(0,"div",47)(1,"div",48),n(2," Additional Services Documents"),t(),i(3,"div",49),n(4),t()()),a&2){let e=p(3);l(4),m(" ",(e.supplierData==null?null:e.supplierData.service_documents_required)==""?"--":e.supplierData==null?null:e.supplierData.service_documents_required," ")}}function Sy(a,d){if(a&1&&(i(0,"div",47)(1,"div",48),n(2," Payment Mode "),t(),i(3,"div",49),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.supplierData==null?null:e.supplierData.payment_mode," ")}}function Cy(a,d){a&1&&(i(0,"span",85),n(1," Not available at the moment "),t())}function Ey(a,d){if(a&1&&(i(0,"div",17)(1,"div",53)(2,"div",12)(3,"p",54),u(4,Cy,2,0,"span",56),t()()()()),a&2){let e=p(3);l(4),s("ngIf",e.poDetails&&!(e.poDetails!=null&&e.poDetails.seller_billing_address))}}function Iy(a,d){if(a&1&&(i(0,"span",86),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null||e.poDetails.seller_details==null?null:e.poDetails.seller_details.company_name)}}function Dy(a,d){a&1&&(i(0,"span",85),n(1,"Not available"),t())}function Ty(a,d){if(a&1&&(i(0,"span",86),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null?null:e.poDetails.seller_gst)}}function wy(a,d){a&1&&(i(0,"span",85),n(1,"Not available"),t())}function Py(a,d){if(a&1&&(i(0,"span",86),n(1),t()),a&2){let e=p(3);
1l(),m(" ",e.poDetails==null||e.poDetails.seller_billing_address==null?null:e.poDetails.seller_billing_address.full_address," ")}}function Oy(a,d){a&1&&(i(0,"span",85),n(1," No Address Found "),t())}function ky(a,d){if(a&1&&(i(0,"p",87)(1,"span",88),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name,"")}}function Fy(a,d){if(a&1&&(i(0,"p",89)(1,"b",88),n(2,"Address:"),t(),i(3,"span",86),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.getAddressDisplay(e.shippingAddress)," ")}}function My(a,d){a&1&&(i(0,"p",89)(1,"b",88),n(2,"Address:"),t(),i(3,"span",85),n(4," Not available "),t()())}function Ay(a,d){if(a&1&&(i(0,"p",87)(1,"span",88),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name,"")}}function Ny(a,d){if(a&1&&(i(0,"span",86),n(1),t()),a&2){let e=p(3);l(),f(e.supplierData==null?null:e.supplierData.gstn)}}function Vy(a,d){a&1&&(i(0,"span",85),n(1,"Not available"),t())}function By(a,d){if(a&1&&(i(0,"p",89)(1,"b",88),n(2,"Address:"),t(),i(3,"span",86),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.getAddressDisplay(e.billingAddress)," ")}}function Ry(a,d){a&1&&(i(0,"p",89)(1,"b",88),n(2,"Address:"),t(),i(3,"span",85),n(4," Not available "),t()())}function Ly(a,d){if(a&1&&(i(0,"div",90)(1,"div",91),x(2,"img",92),t()()),a&2){let e=p(3);l(2),s("viewerOptions",Ce(2,vy))("src",e.poDetails==null?null:e.poDetails.logo_path,q)}}function qy(a,d){if(a&1&&(i(0,"th",93)(1,"span"),n(2),t(),i(3,"small"),n(4),t()()),a&2){let e=d.$implicit;l(2),m("",e.title," "),l(2),f(e.subtitle)}}function Gy(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Uy(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function jy(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function $y(a,d){if(a&1&&(F(0),i(1,"div",98),n(2),t(),i(3,"p",99),u(4,Gy,2,2,"span",100)(5,Uy,2,2,"span",100)(6,jy,2,2,"span",100),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function zy(a,d){if(a&1&&(F(0),i(1,"div",98)(2,"div")(3,"p",102),n(4),_(5,"currencyFormat"),t(),i(6,"p",102),n(7),_(8,"currencyFormat"),t(),i(9,"p",102),n(10),_(11,"currencyFormat"),t(),i(12,"p",102),n(13),_(14,"currencyFormat"),t(),i(15,"p",102),n(16),_(17,"currencyFormat"),t(),i(18,"p",102),n(19),_(20,"currencyFormat"),t(),i(21,"p",102),n(22),_(23,"currencyFormat"),t(),i(24,"p",102),n(25),_(26,"currencyFormat"),t(),i(27,"p",102),n(28),_(29,"currencyFormat"),t(),x(30,"div",103),i(31,"p",87)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function Wy(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",95),n(3),t(),u(4,$y,7,4,"ng-template",null,1,P),x(6,"i",96),t(),i(7,"td",97),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),_(15,"currencyFormat"),i(16,"small"),n(17,"/unit"),t()(),i(18,"td"),n(19),_(20,"currencyFormat"),t(),i(21,"td"),n(22),_(23,"currencyFormat"),t(),i(24,"td"),n(25),_(26,"currencyFormat"),t(),i(27,"td"),n(28),_(29,"currencyFormat"),u(30,zy,35,34,"ng-template",null,2,P),x(32,"i",96),t()()),a&2){let e=d.$implicit,o=w(5),r=w(31);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),f(e.required_qty),l(2),m("",v(15,11,e.unit_price)," "),l(5),f(v(20,13,e.gross_total)),l(3),f(v(23,15,e.discount)),l(3),f(v(26,17,e.gst)),l(3),m(" ",v(29,19,e.total_amount)," "),l(4),s("ngbPopover",r)}}function Qy(a,d){if(a&1&&(i(0,"tbody"),u(1,Wy,33,21,"tr",94),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function Yy(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Hy(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Ky(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Zy(a,d){if(a&1&&(F(0),i(1,"div",98),n(2),t(),i(3,"p",99),u(4,Yy,2,2,"span",100)(5,Hy,2,2,"span",100)(6,Ky,2,2,"span",100),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function Jy(a,d){if(a&1&&(F(0),i(1,"div",98)(2,"div")(3,"p",102),n(4),_(5,"currencyFormat"),t(),i(6,"p",102),n(7),_(8,"currencyFormat"),t(),i(9,"p",102),n(10),_(11,"currencyFormat"),t(),i(12,"p",102),n(13),_(14,"currencyFormat"),t(),i(15,"p",102),n(16),_(17,"currencyFormat"),t(),x(18,"div",103),i(19,"p",87)(20,"b"),n(21),_(22,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Total Bid Value: ",v(5,10,e.gross_total)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(8,12,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(11,14,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(14,16,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(17,18,e.igst),""),l(5),m("Total Payable: ",v(22,20,e.total_amount)," ")}}function Xy(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",95),n(3),t(),u(4,Zy,7,4,"ng-template",null,1,P),x(6,"i",96),t(),i(7,"td",97),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),u(20,Jy,23,22,"ng-template",null,2,P),x(22,"i",96),t()()),a&2){let e=d.$implicit,o=w(5),r=w(21);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(13,8,e.gross_total)),l(3),f(v(16,10,e.gst)),l(3),m(" ",v(19,12,e.total_amount)," "),l(4),s("ngbPopover",r)}}function eS(a,d){if(a&1&&(i(0,"tbody"),u(1,Xy,23,14,"tr",94),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function tS(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function iS(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function nS(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function aS(a,d){if(a&1&&(F(0),i(1,"div",98),n(2),t(),i(3,"p",99),u(4,tS,2,2,"span",100)(5,iS,2,2,"span",100)(6,nS,2,2,"span",100),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function rS(a,d){if(a&1&&(F(0),i(1,"div",98)(2,"div")(3,"p",102),n(4),_(5,"currencyFormat"),t(),i(6,"p",102),n(7),_(8,"currencyFormat"),t(),i(9,"p",102),n(10),_(11,"currencyFormat"),t(),i(12,"p",102),n(13),_(14,"currencyFormat"),t(),i(15,"p",102),n(16),_(17,"currencyFormat"),t(),i(18,"p",102),n(19),_(20,"currencyFormat"),t(),i(21,"p",102),n(22),_(23,"currencyFormat"),t(),i(24,"p",102),n(25),_(26,"currencyFormat"),t(),i(27,"p",102),n(28),_(29,"currencyFormat"),t(),x(30,"div",103),i(31,"p",87)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.net_amount)," ")}}function lS(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",95),n(3),t(),u(4,aS,7,4,"ng-template",null,1,P),x(6,"i",96),t(),i(7,"td",97),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),t(),i(20,"td"),n(21),_(22,"currencyFormat"),u(23,rS,35,34,"ng-template",null,2,P),x(25,"i",96),t()()),a&2){let e=d.$implicit,o=w(5),r=w(24);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m(" ",v(13,9,e.unit_price)," "),l(3),m(" ",v(16,11,e.discount),""),l(3),m(" ",v(19,13,e.gst),""),l(3),m(" ",v(22,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function oS(a,d){if(a&1&&(i(0,"tbody"),u(1,lS,26,17,"tr",94),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function sS(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function dS(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function cS(a,d){if(a&1&&(i(0,"span",101),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function pS(a,d){if(a&1&&(F(0),i(1,"div",98),n(2),t(),i(3,"p",99),u(4,sS,2,2,"span",100)(5,dS,2,2,"span",100)(6,cS,2,2,"span",100),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function mS(a,d){if(a&1&&(F(0),i(1,"div",98)(2,"div")(3,"p",102),n(4),_(5,"currencyFormat"),t(),i(6,"p",102),n(7),_(8,"currencyFormat"),t(),i(9,"p",102),n(10),_(11,"currencyFormat"),t(),i(12,"p",102),n(13),_(14,"currencyFormat"),t(),i(15,"p",102),n(16),_(17,"currencyFormat"),t(),i(18,"p",102),n(19),_(20,"currencyFormat"),t(),i(21,"p",102),n(22),_(23,"currencyFormat"),t(),i(24,"p",102),n(25),_(26,"currencyFormat"),t(),x(27,"div",103),i(28,"p",87)(29,"b"),n(30),_(31,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit,o=p(4);l(4),m(" Gross Total: ",v(5,13,e.gross_total)," "),l(3),m(" Discount: ",v(8,15,e.discount)," "),l(3),m(" Net Total: ",v(11,
117,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,19,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,21,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,23,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,25,e.igst),""),l(3),m(" Additional Charges: ",v(26,27,o.getAdditionalCharges())," "),l(5),m("Total Payable: ",v(31,29,e.total_amount)," ")}}function uS(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",95),n(3),t(),u(4,pS,7,4,"ng-template",null,1,P),x(6,"i",96),t(),i(7,"td",97),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,mS,32,31,"ng-template",null,2,P),x(27,"i",96),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(5),f(v(18,11,e.gross_total)),l(3),f(v(21,13,e.discount)),l(3),m(" ",v(24,15,e.total_amount)," "),l(4),s("ngbPopover",r)}}function _S(a,d){if(a&1&&(i(0,"tbody"),u(1,uS,28,17,"tr",94),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function vS(a,d){if(a&1&&(i(0,"li",106)(1,"a",107),x(2,"i",108),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(2),m(" ",e.filename," ")}}function gS(a,d){if(a&1&&(i(0,"ul",104),u(1,vS,4,2,"li",105),t()),a&2){let e=p(3);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function fS(a,d){if(a&1&&(i(0,"div")(1,"div",109)(2,"div",12)(3,"ul",110)(4,"li",111)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",112),n(8),_(9,"currencyFormat"),t()(),i(10,"li",111)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",113),n(14),_(15,"currencyFormat"),t()(),i(16,"li",111)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",112),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",112),n(26),_(27,"currencyFormat"),t()(),i(28,"li",114)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",112),n(32),_(33,"currencyFormat"),t()(),i(34,"li",114)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",112),n(38),_(39,"currencyFormat"),t()(),i(40,"li",111)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",112),n(44),_(45,"currencyFormat"),t()(),i(46,"li",111)(47,"b",23),n(48,"Logistics:"),t(),i(49,"span",112),n(50),_(51,"currencyFormat"),t()(),i(52,"li",111)(53,"b",23),n(54,"Insurance:"),t(),i(55,"span",112),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",115)(59,"span",23),n(60,"Total Payable Amount:"),t(),i(61,"span",112),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function hS(a,d){if(a&1&&(i(0,"div")(1,"div",109)(2,"div",12)(3,"ul",110)(4,"li",111)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",112),n(8),_(9,"currencyFormat"),t()(),i(10,"li",111)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",113),n(14),_(15,"currencyFormat"),t()(),i(16,"li",111)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",112),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",112),n(26),_(27,"currencyFormat"),t()(),i(28,"li",114)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",112),n(32),_(33,"currencyFormat"),t()(),i(34,"li",114)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",112),n(38),_(39,"currencyFormat"),t()(),i(40,"li",111)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",112),n(44),_(45,"currencyFormat"),t()(),i(46,"li",111)(47,"b",23),n(48,"Logistics:"),t(),i(49,"span",112),n(50),_(51,"currencyFormat"),t()(),i(52,"li",111)(53,"b",23),n(54,"Insurance:"),t(),i(55,"span",112),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",115)(59,"span",23),n(60,"Total Payable Amou
1nt:"),t(),i(61,"span",112),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function xS(a,d){if(a&1&&(i(0,"div")(1,"div",109)(2,"div",12)(3,"ul",110)(4,"li",111)(5,"b",23),n(6,"Total Bid Value:"),t(),i(7,"span",112),n(8),_(9,"currencyFormat"),t()(),i(10,"li",114)(11,"span",23),n(12,"SGST: "),t(),i(13,"span",112),n(14),_(15,"currencyFormat"),t()(),i(16,"li",114)(17,"span",23),n(18,"CGST:"),t(),i(19,"span",112),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",23),n(24,"IGST:"),t(),i(25,"span",112),n(26),_(27,"currencyFormat"),t()(),i(28,"li",111)(29,"b",23),n(30,"Total Tax Amount:"),t(),i(31,"span",112),n(32),_(33,"currencyFormat"),t()(),i(34,"li",111)(35,"b",23),n(36,"Logistics:"),t(),i(37,"span",112),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",115)(41,"span",23),n(42,"Total Payable Amount:"),t(),i(43,"span",112),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,7,e.poDetails==null?null:e.poDetails.gross),""),l(6),m(" ",v(15,9,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(21,11,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(27,13,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(33,15,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(39,17,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(45,19,e.poDetails==null?null:e.poDetails.total_amount),"")}}function bS(a,d){if(a&1&&(i(0,"div")(1,"div",109)(2,"div",12)(3,"ul",110)(4,"li",111)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",112),n(8),_(9,"currencyFormat"),t()(),i(10,"li",111)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",113),n(14),_(15,"currencyFormat"),t()(),i(16,"li",111)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",112),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",112),n(26),_(27,"currencyFormat"),t()(),i(28,"li",114)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",112),n(32),_(33,"currencyFormat"),t()(),i(34,"li",114)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",112),n(38),_(39,"currencyFormat"),t()(),i(40,"li",111)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",112),n(44),_(45,"currencyFormat"),t()(),i(46,"li",111)(47,"b",23),n(48,"Additional Charges:"),t(),i(49,"span",112),n(50),_(51,"currencyFormat"),t()()()(),i(52,"div",115)(53,"span",23),n(54,"Total Payable Amount:"),t(),i(55,"span",112),n(56),_(57,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,9,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,11,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,13,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,15,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,17,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,19,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,21,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,23,e.getAdditionalCharges()),""),l(6),m(" ",v(57,25,e.poDetails==null?null:e.poDetails.total_amount),"")}}function yS(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",18)(3,"div",19)(4,"h2",20)(5,"a",21),x(6,"i",22),t(),i(7,"span",23),n(8,"Purchase Order"),t()()(),i(9,"div",24)(10,"button",25),S("click",function(){b(e);let r=p(2);return y(r.printDocument())}),u(11,fy,4,0,"span",26)(12,hy,6,0,"span",26),t()()()(),i(13,"div",17)(14,"div",27)(15,"div",28)(16,"h3",29)(17,"span",23),n(18,"Purchase Order ID:"),t(),n(19),t(),i(20,"button",30),S("click",function(){b(e);let r=p(2);return y(r.toDealRoom())}),x(21,"i",31),i(22,"span",23),n(23,"Deal Room"),t()()(),i(24,"div",32)(25,"div",33)(26,"div",34)(27,"ul",35)(28,"li",23),n(29,"Generate PO "),t(),i(30,"li",23),n(31,"PO Sent"),t(),i(32,"li",36),n(33," PO Cancelled "),t(),i(34,"li",37),n(35," Invoice Approved "),t()()(),i(36,"div",38)(37,"div",39)(38,"p",40),n(39,"Status:"),t(),i(40,"b",41),n(41),t()()()(),i(42,"div",42)(43,"h4",43)(44,"span",23),n(45,"Remarks:"),t(),i(46,"p",44),n(47),t()()()()(),i(48,"div",27)(49,"div",28)(50,"h3",45),n(51,"Purchase Order Details"),t()(),i(52,"div",32)(53,"div",46)(54,"div",47)(55,"div",48),n(56,"PO No."),t(),i(57,"div",49),n(58),t()(),i(59,"div",47)(60,"div",48),n(61,"Source ID"),t(),i(62,"div",49),u(63,xy,2,2,"button",50)(64,by,1,1,"ng-template",null,0,P),t()(),i(66,"div",47)(67,"div",48),n(68,"Purchase Order Date"),t(),i(69,"div",49),n(70),_(71,"date"),t()(),i(72,"div",47)(73,"div",48),n(74,"Purchase Order Expiry Date"),t(),i(75,"div",49),n(76),_(77,"date"),t()(),i(78,"div",47)(79,"div",48),n(80,"Place of Supply"),t(),i(81,"div",49),n(82),t()(),u(83,yy,5,1,"div",51)(84,Sy,5,1,"div",51),t()()(),i(85,"div",27)(86,"div",28)(87,"h3",45),n(88,"Supplier Details"),t()(),i(89,"div",32)(90,"div",16),u(91,Ey,5,1,"div",52),i(92,"div",17)(93,"div",53)(94,"div",12)(95,"p",54)(96,"span",23),n(97,"Seller Name: "),t(),u(98,Iy,2,1,"span",55)(99,Dy,2,0,"span",56),t(),i(100,"p",54)(101,"span",23),n(102,"GST No:"),t(),u(103,Ty,2,1,"span",55)(104,wy,2,0,"span",56),t(),i(105,"p",54)(106,"span",23),n(107,"Seller Address:"),t(),x(108,"br"),u(109,Py,2,1,"span",55)(110,Oy,2,0,"span",56),t()()()()()()(),i(111,"div",27)(112,"div",28)(113,"h3",45),n(114,"Buyer Details"),t()(),i(115,"div",32)(116,"div",16)(117,"div",57)(118,"div",58)(119,"div",12)(120,"p",59),n(121,"Shipping Address "),t(),u(122,ky,4,1,"p",60)(123,Fy,5,1,"p",61)(124,My,5,0,"p",61),t()()(),i(125,"div",57)(126,"div",53)(127,"div",12)(128,"p",59),n(129,"Billing Address "),t(),u(130,Ay,4,1,"p",60),i(131,"p",54)(132,"span",23),n(133,"GST No:"),t(),u(134,Ny,2,1,"span",55)(135,Vy,2,0,"span",56),t(),u(136,By,5,1,"p",61)(137,Ry,5,0,"p",61),t()()(),u(138,Ly,3,3,"div",62),t()()(),i(139,"div",27)(140,"div",63)(141,"h3",45),n(142,"Order Summary"),t()(),i(143,"div",64)(144,"div",65)(145,"div",66)(146,"table",67)(147,"thead",68)(148,"tr"),u(149,qy,5,2,"th",69),t()(),u(150,Qy,2,1,"tbody",70)(151,eS,2,1,"tbody",70)(152,oS,2,1,"tbody",70)(153,_S,2,1,"tbody",70),t()()()()(),i(154,"div",71)(155,"div",72)(156,"div",73)(157,"div",28)(158,"h3",45),n(159,"Terms & Conditions"),t()(),i(160,"div",32)(161,"div",74)(162,"p",75),n(163),t()(),u(164,gS,2,1,"ul",76),t()()(),i(165,"div",77),u(166,fS,64,30,"div",70)(167,hS,64,30,"div",70)(168,xS,46,21,"div",70)(169,bS,58,27,"div",70),t()(),i(170,"div",16)(171,"div",78)(172,"button",79),S("click",function(){b(e);let r=p(2);return y(r.regeneratePo())}),x(173,"i",80),i(174,"span",23),n(175," Regenerate PO"),t()()()()()()}if(a&2){let e=w(65),o=p(2);
1l(10),s("disabled",o.isPrintLoading),l(),s("ngIf",!o.isPrintLoading),l(),s("ngIf",o.isPrintLoading),l(7),m(" ",o.supplierData==null?null:o.supplierData.po_number,""),l(15),s("ngClass",(o.supplierData==null?null:o.supplierData.buyer_status)=="Invoice Approved"?"is-active":""),l(7),f(o.supplierData==null?null:o.supplierData.buyer_status),l(6),m("",o.supplierData!=null&&o.supplierData.rejectReason?o.supplierData==null?null:o.supplierData.rejectReason:"--"," "),l(6),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(5),f(o.supplierData==null?null:o.supplierData.po_number),l(5),s("ngIf",o.canOpenSource)("ngIfElse",e),l(7),f(U(71,47,o.supplierData==null?null:o.supplierData.po_date,"dd-MM-yyyy")),l(6),m("",U(77,50,o.supplierData==null?null:o.supplierData.expiry_date,"dd-MM-yyyy")," "),l(6),f((o.shippingAddress==null?null:o.shippingAddress.region)||"--"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","rfq"),l(7),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_details)),l(7),s("ngIf",o.poDetails==null?null:o.poDetails.seller_details.company_name),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_details.company_name)),l(4),s("ngIf",(o.poDetails==null?null:o.poDetails.seller_gst)&&(o.poDetails==null?null:o.poDetails.seller_gst.length)),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_gst)||!(o.poDetails!=null&&o.poDetails.seller_gst.length)),l(5),s("ngIf",o.poDetails&&(o.poDetails==null?null:o.poDetails.seller_billing_address)),l(),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_billing_address)),l(7),s("ngClass",o.poDetails!=null&&o.poDetails.logo_path?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(),s("ngIf",o.getAddressDisplay(o.shippingAddress)),l(),s("ngIf",!o.getAddressDisplay(o.shippingAddress)),l(),s("ngClass",o.poDetails!=null&&o.poDetails.logo_path?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(4),s("ngIf",o.supplierData.gstn),l(),s("ngIf",!o.supplierData.gstn),l(),s("ngIf",o.getAddressDisplay(o.billingAddress)),l(),s("ngIf",!o.getAddressDisplay(o.billingAddress)),l(),s("ngIf",o.poDetails==null?null:o.poDetails.logo_path),l(8),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(3),s("ngForOf",o.getTableHeaders(o.supplierData==null?null:o.supplierData.source)),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","Manual"),l(10),f(o.poDetails!=null&&o.poDetails.terms?o.poDetails==null?null:o.poDetails.terms:"No Terms & Conditions Provided"),l(),s("ngIf",o.poDetails==null?null:o.poDetails.detail_terms_document),l(),s("ngSwitch",o.poDetails==null?null:o.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}function SS(a,d){if(a&1&&(i(0,"div",5),u(1,gy,10,0,"div",6)(2,yS,176,53,"div",7),t()),a&2){let e=p();l(),s("ngIf",!e.viewAccess),l(),s("ngIf",e.supplierData&&e.viewAccess)}}var Ua=(()=>{class a{constructor(e,o,r,c,g,h){this.financeOrderService=e,this.activatedRoute=o,this.drService=r,this.router=c,this.notificationService=g,this.cService=h,this.isLoading=!1,this.accessList=[],this.initialLoad=!1,this.isPrintLoading=!1}get canOpenSource(){let e=(this.supplierData?.source||"").toLowerCase();return!!this.supplierData?.source_id&&(e==="rfq"||e==="auction")}onSourceClick(){let e=(this.supplierData?.source||"").toLowerCase(),o=this.supplierData?.source_id;if(!o)return;let r="";if(e==="rfq"?r="/rfq/buyer/rfq-details/"+o:e==="auction"&&(r="/buyer-auction/buyer-auction-details/"+o),!r)return;let c=window.location.href.replace(this.router.url,"");window.open(c+r,"_blank")}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.poId=e.id}),this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e,this.viewAccess?(this.GetOrderDetailsByPO(),this.GetPODetails()):this.initialLoad=!0)})}GetOrderDetailsByPO(){try{this.isLoading=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe({next:o=>{this.supplierData=o.response.data,this.supplierData.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.supplierData.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.isLoading=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get totalAmount(){if(this.poDetails!==null)return this.poDetails.gross-this.poDetails.discount_amount+this.poDetails.gst_amount+this.poDetails.shipping_charges+this.poDetails.logistics_charges+this.poDetails.insurance_charges}GetPODetails(){try{this.isLoading=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe({next:o=>{this.poDetails=o.response.data,this.poDetails.net_charges=Math.round(this.poDetails.net_charges),this.isLoading=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}getAddressDisplay(e){return e?e.full_address&&String(e.full_address).trim()?e.full_address:[e.street,e.city,e.regi
1on,e.postcode,e.country_id].filter(o=>o&&String(o).trim()).join(", "):""}getAdditionalCharges(){return this.poDetails?.additional_charges?.length?this.poDetails.additional_charges.reduce((e,o)=>e+(parseFloat(o.amount)||0),0):0}getTableHeaders(e){let o=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Total Bid Value",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],r=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""},{title:"Required Qty",subtitle:""},{title:"Quoted",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],c=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Basic Price",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],g=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""}
1,{title:"Quoted Price/Unit",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Total Payable",subtitle:""}];switch(e){case"auction":return o;case"rfq":return r;case"DirectBuy":return c;case"Manual":return g;default:return[]}}toDealRoom(){try{this.isLoading=!0;let e=()=>{switch(this.supplierData.source){case"rfq":return"rfq";case"auction":return"auction";default:return"direct"}},o=()=>{switch(this.supplierData.source){case"rfq":return this.supplierData.dealroom_source_id;case"auction":return this.supplierData.dealroom_source_id;default:return""}},r={source:e(),source_id:Number(o()),receiver_id:this.supplierData.dealroom_receiver_id};this.drService.initiateChat(r).subscribe(c=>{c.responseCode===200?(this.drService.setBuyerOrSeller("B"),this.router.navigate(["deal-room",e(),c.room_id,"chat"])):this.notificationService.showError("Something went wrong!"),this.isLoading=!1},c=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}get viewAccess(){return!0}regeneratePo(){this.router.navigate(["finance-management/payable-purchase-orders/send"],{queryParams:{id:this.poId,regenerate:!0}})}getPoType(e){let o=e?.toLowerCase();return o==="rfq"?"PO_RFQ":o==="auction"?"PO_AUCTION":o==="directbuy"||o==="direct"?"PO_DIRECT_BUY":"PO_RFQ"}printDocument(){this.isPrintLoading=!0;let e=this.getPoType(this.supplierData?.source);this.financeOrderService.printPdf(e,Number(this.poId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Qt),T(K),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-po-cancelled"]],decls:2,vars:2,consts:[["plainSourceId",""],["prods",""],["popContent",""],[3,"isLoading"],["id","content","class","rfq-pages generate-po-page container-fluid overflow-hidden-non-i",4,"ngIf"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],["class","container-fluid text-center my-5",4,"ngIf"],["class","row",4,"ngIf"],[1,"container-fluid","text-center","my-5"],[1,"row","justify-content-center"],[1,"col-12","col-md-8"],[1,"card","p-4"],[1,"card-body"],[1,"uil","uil-lock-alt","display-4","text-danger","mb-3"],["appTranslate","",1,"card-title"],["appTranslate","",1,"card-text"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"uil","uil-comments-alt"],[1,"mod-card-body"],[1,"row","align-items-center","mb-4"],[1,"col-md-8","col-xl-10"],[1,"list-unstyled","multi-steps"],["appTranslate","",1,"is-active","red"],["appTranslate","",3,"ngClass"],[1,"col-md-4","col-xl-2"],[1,"border","rounded-lg","p-2"],["appTranslate","",1,"theme-color","font-12","mb-0"],[1,"text-danger"],[1,"card-danger","mb-0"],[1,"fw-600","font-14","mb-0"],[1,"text-danger","d-inline"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-meta-grid",3,"ngSwitch"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngSwitchCase"],["class","col-12",4,"ngIf"],[1,"card"],[1,"fw-600","mb-1"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[3,"ngClass"],[1,"card","h-100"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],["class","fw-600",4,"ngIf"],["class","col-12 col-md-auto",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],[1,""],["class","text-nowrap",4,"ngFor","ngForOf"],[4,"ngSwitchCase"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],["class","list-inline",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[1,"col-12","text-right","mt-3"],["type","button",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"uil","uil-refresh"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["type","button",1,"mod-btn-action",3,"click","title"],["appTranslate","",1,"text-secondary"],[1,"text-secondary"],[1,"text-secondary","mb-1"],["appTranslate","",1,"fw-600"],[1,"fw-600"],[1,"col-12","col-md-auto"],[1,"doc-logo"],["ngxViewer","","fallback","./../../../../assets/img/placeholderimage.png","alt","buyer logo",1,"doc-logo__img",3,"viewerOptions","src"],[1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"]],template:function(o,r){o&1&&(x(0,"app-loader",3),u(1,SS,3,2,"div",4)),o&2&&(s("isLoading",r.isLoading),l(
1),s("ngIf",r.initialLoad))},dependencies:[nt,J,W,pt,mt,Se,Zt,Z,De,Lt,L,st,ae],styles:[".rfq-pages[_ngcontent-%COMP%] .card-danger[_ngcontent-%COMP%]{color:#1b1b1bde;background-color:#fff8f9;border:1px solid #f64e60;padding:15px;border-radius:8px}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]{color:#f64e60}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]:before{background-color:#ffe2e5;border-color:#f64e60;color:#f64e60}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.max-h-150px[_ngcontent-%COMP%]{max-height:150px}.doc-logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:180px;max-width:100%;height:100%;min-height:104px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 767.98px){.doc-logo[_ngcontent-%COMP%]{width:100%;min-height:88px}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();function CS(a,d){a&1&&(i(0,"span"),x(1,"i",59),i(2,"span",15),n(3,"Print"),t()())}function ES(a,d){a&1&&(i(0,"span")(1,"div",60)(2,"span",61),n(3,"Loading..."),t()(),i(4,"span",15),n(5,"Printing..."),t()())}function IS(a,d){if(a&1){let e=I();i(0,"button",67),S("click",function(){b(e);let r=p(2).$implicit,c=p();return y(c.onCellClick(r))}),n(1),t()}if(a&2){let e=p(2).$implicit;l(),f(e.value)}}function DS(a,d){if(a&1&&(i(0,"span"),n(1),_(2,"date"),t()),a&2){let e=p(3).$implicit;l(),f(U(2,1,e.value,"dd-MM-yyyy"))}}function TS(a,d){if(a&1&&(n(0),_(1,"titlecase")),a&2){let e=p(3).$implicit;f(v(1,1,e.value))}}function wS(a,d){if(a&1&&(F(0),u(1,DS,3,4,"span",68)(2,TS,2,3,"ng-template",null,1,P),M()),a&2){let e=w(3),o=p(2).$implicit;l(),s("ngIf",o.isDate)("ngIfElse",e)}}function PS(a,d){if(a&1){let e=I();i(0,"button",67),S("click",function(){b(e);let r=p(3).index,c=p();return y(c.onCellClick(c.invoiceTableData[r+1]))}),n(1),t()}if(a&2){let e=p(3).index,o=p();l(),f(o.invoiceTableData[e+1].value)}}function OS(a,d){if(a&1&&(i(0,"span"),n(1),_(2,"date"),t()),a&2){let e=p(4).index,o=p();l(),f(U(2,1,o.invoiceTableData[e+1].value,"dd-MM-yyyy"))}}function kS(a,d){if(a&1&&n(0),a&2){let e=p(4).index,o=p();f(o.invoiceTableData[e+1].value)}}function FS(a,d){if(a&1&&(F(0),u(1,OS,3,4,"span",68)(2,kS,1,1,"ng-template",null,2,P),M()),a&2){let e=w(3),o=p(3).index,r=p();l(),s("ngIf",r.invoiceTableData[o+1].isDate)("ngIfElse",e)}}function MS(a,d){if(a&1&&(i(0,"div",62)(1,"div",63),n(2),t(),i(3,"div",64),u(4,PS,2,1,"button",65)(5,FS,4,2,"ng-container",18),t()()),a&2){let e=p(2).index,o=p();l(2),f(o.invoiceTableData[e+1].label),l(2),s("ngIf",o.invoiceTableData[e+1].clickType),l(),s("ngIf",!o.invoiceTableData[e+1].clickType)}}function AS(a,d){if(a&1&&(F(0),i(1,"div",62)(2,"div",63),n(3),t(),i(4,"div",64),u(5,IS,2,1,"button",65)(6,wS,4,2,"ng-container",18),t()(),u(7,MS,6,3,"div",66),M()),a&2){let e=p(),o=e.$implicit,r=e.index,c=p();l(3),f(o.label),l(2),s("ngIf",o.clickType),l(),s("ngIf",!o.clickType),l(),s("ngIf",c.invoiceTableData[r+1])}}function NS(a,d){if(a&1&&(F(0),u(1,AS,8,4,"ng-container",18),M()),a&2){let e=d.even;l(),s("ngIf",e)}}function VS(a,d){if(a&1&&(i(0,"span",30),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.seller_gst)}}function BS(a,d){a&1&&(i(0,"span",69),n(1,"Not Available"),t())}function RS(a,d){if(a&1&&x(0,"img",73),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function LS(a,d){if(a&1&&(i(0,"div",70)(1,"div",71),u(2,RS,1,1,"img",72),t()()),a&2){let e=p();l(2),s("ngIf",e.invoiceDetails&&e.invoiceDetails.seller_details&&e.invoiceDetails.seller_details.company_logoViewPath)}}function qS(a,d){if(a&1&&(i(0,"div",19)(1,"div",20)(2,"h3",21),n(3,"Company Bank Details"),t()(),i(4,"div",22)(5,"div",74)(6,"div",75)(7,"span",76),x(8,"i",77),t(),i(9,"div",78)(10,"h4",79),n(11),t(),i(12,"span",80),n(13),t()()(),i(14,"div",81)(15,"div",82)(16,"span",83),n(17,"Account Holder"),t(),i(18,"span",84),n(19),t()(),i(20,"div",82)(21,"span",83),n(22,"Account Number"),t(),i(23,"span",84),n(24),t()(),i(25,"div",82)(26,"span",83),n(27,"IFSC Code"),t(),i(28,"span",84),n(29),t()(),i(30,"div",82)(31,"span",83),n(32,"Branch"),t(),i(33,"span",84),n(34),t()()()()()()),a&2){let e=p();l(11),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_name),l(2),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch),l(6),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_name),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_number),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_ifsc),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch)}}function GS(a,d){if(a&1&&(i(0,"p",85)(1,"span",28),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function US(a,d){if(a&1&&(i(0,"p",85)(1,"span",28),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function jS(a,d){if(a&1&&(i(0,"span",30),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function $S(a,d){a&1&&(i(0,"span",69),n(1,"Not Available"),t())}function zS(a,d){if(a&1&&(i(0,"span",91),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function WS(a,d){if(a&1&&(i(0,"span",91),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function QS(a,d){if(a&1&&(i(0,"span",91),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function YS(a,d){if(a&1&&(F(0),i(1,"div",88),n(2),t(),i(3,"p",89),u(4,zS,2,2,"span",90)(5,WS,2,2,"span",90)(6,QS,2,2,"span",90),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function HS(a,d){if(a&1&&(F(0),i(1,"div",88)(2,"div")(3,"p",92)(4,"span",15),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",92)(9,"span",15),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",92)(14,"span",15),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",92),n(19),_(20,"currencyFormat"),t(),i(21,"p",92),n(22),_(23,"currencyFormat"),t(),i(24,"p",92),n(25),_(26,"currencyFormat"),t(),i(27,"p",92),n(28),_(29,"currencyFormat"),t(),i(30,"p",92)(31,"span",15),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",92)(36,"span",15),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",93),i(41,"p",85)(42,"b")(43,"
1span",15),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.total_amount)," ")}}function KS(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",86),n(3),t(),u(4,YS,7,4,"ng-template",null,3,P),x(6,"i",87),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,HS,47,34,"ng-template",null,4,P),x(30,"i",87),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.discount)),l(3),f(v(21,14,e.gross_total)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function ZS(a,d){if(a&1&&(i(0,"tr")(1,"td",94)(2,"span",15),n(3,"Advance Note:"),t(),i(4,"b"),n(5),t()(),i(6,"td",95)(7,"span",15),n(8,"Advance Amount:"),t(),i(9,"b"),n(10),_(11,"currencyFormat"),t()()()),a&2){let e=p();l(5),f(e.advanceDetails.terms),l(5),f(v(11,2,e.advanceDetails.amount))}}function JS(a,d){if(a&1&&(i(0,"tr")(1,"td",94)(2,"span",15),n(3,"Additional Charge:"),t(),n(4,"\xA0 "),i(5,"b"),n(6),t()(),i(7,"td",95)(8,"span",15),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(6),f(e.description),l(5),f(v(12,2,e.amount))}}function XS(a,d){if(a&1&&(F(0),u(1,JS,13,4,"tr",24),M()),a&2){let e=p();l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function eC(a,d){if(a&1&&(i(0,"div",101)(1,"a",102)(2,"div",103)(3,"ul",104)(4,"li",105),x(5,"i",106),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(5),m(" ",e.name," ")}}function tC(a,d){if(a&1&&(i(0,"div",99),u(1,eC,7,2,"div",100),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.docs)}}function iC(a,d){a&1&&(i(0,"span",107),n(1," No files uploaded "),t())}function nC(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),u(4,tC,2,1,"div",98)(5,iC,2,0,"ng-template",null,5,P),t()()),a&2){let e=d.$implicit,o=w(6);l(2),m(" ",e.collectionName," "),l(2),s("ngIf",e.docs.length>0)("ngIfElse",o)}}function aC(a,d){a&1&&(i(0,"tr")(1,"td",108)(2,"p",109),n(3,"No documents available"),t()()())}function rC(a,d){if(a&1&&(i(0,"div",19)(1,"div",40)(2,"h3",21),n(3,"Additional Services Documents"),t()(),i(4,"div",41)(5,"div",96)(6,"table",43)(7,"thead",44)(8,"tr")(9,"th",97),n(10,"Document Name"),t(),i(11,"th",97),n(12,"Files"),t()()(),i(13,"tbody"),u(14,nC,7,3,"tr",24)(15,aC,4,0,"tr",18),t()()()()()),a&2){let e=p();l(14),s("ngForOf",e.additionalDocs),l(),s("ngIf",!e.additionalDocs.length)}}function lC(a,d){if(a&1){let e=I();i(0,"a",127),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function oC(a,d){if(a&1){let e=I();i(0,"a",127),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function sC(a,d){if(a&1&&(i(0,"div")(1,"p",125)(2,"b",15),n(3,"Note:"),t(),n(4),t(),u(5,lC,2,0,"a",126)(6,oC,2,0,"a",126),t()),a&2){let e=p().$implicit;l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded&&e.note.length>120),l(),s("ngIf",e._expanded)}}function dC(a,d){if(a&1&&(i(0,"div",118)(1,"div",50)(2,"div",119)(3,"div",120)(4,"h6",121),n(5),t(),i(6,"small",122)(7,"span",15),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",123)(12,"h6",124),n(13),_(14,"currencyFormat"),t()()(),u(15,sC,7,5,"div",18),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%)"),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function cC(a,d){if(a&1&&(i(0,"div",112)(1,"div",113)(2,"div",114)(3,"a",115),n(4,"Payment Terms"),t()(),i(5,"div",116)(6,"div",50),u(7,dC,
116,10,"div",117),t()()()()),a&2){let e=p(2);l(7),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.payment_terms)}}function pC(a,d){if(a&1&&(i(0,"div",137)(1,"div",138)(2,"div",134)(3,"h6",139),n(4),t(),i(5,"small",122)(6,"span",15),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",140)(10,"small",141),n(11,"Quantity"),t(),i(12,"h6",142),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function mC(a,d){if(a&1&&(i(0,"div",132)(1,"div",133)(2,"div",119)(3,"div",134)(4,"h6",135),n(5),t(),i(6,"small",122)(7,"span",15),n(8,"Timeline:"),t(),n(9),i(10,"span",15),n(11,"day(s)"),t()()()()(),u(12,pC,14,3,"div",136),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," "),l(3),s("ngForOf",e.products)}}function uC(a,d){if(a&1&&(i(0,"div",128)(1,"div",113)(2,"div",129)(3,"a",115),n(4,"Shipment Terms"),t()(),i(5,"div",130),u(6,mC,13,3,"div",131),t()()()),a&2){let e=p(2);l(6),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.shipment_terms)}}function _C(a,d){if(a&1&&(i(0,"div",19)(1,"div",20)(2,"h3",21),n(3,"Order Terms & Fulfillment"),t()(),i(4,"div",22)(5,"div",8),u(6,cC,8,1,"div",110)(7,uC,7,1,"div",111),t()()()),a&2){let e=p();l(6),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_shipment_terms)==="YES")}}function vC(a,d){if(a&1&&(i(0,"li",148)(1,"a",149),x(2,"i",106),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.drive_path,q),l(2),m(" ",e.filename," ")}}function gC(a,d){if(a&1&&(i(0,"div",143)(1,"div",20)(2,"h3",21),n(3,"Terms & Conditions"),t()(),i(4,"div",22)(5,"div",144)(6,"p",145),n(7),t()(),i(8,"ul",146),u(9,vC,4,2,"li",147),t()()()),a&2){let e=p();l(7),m(" ",e.invoiceDetails!=null&&e.invoiceDetails.terms?e.invoiceDetails.terms:"No Terms Provided",""),l(2),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.detail_seller_terms_and_conditions_path)}}function fC(a,d){if(a&1){let e=I();i(0,"button",155),S("click",function(){b(e);let r=p(2);return y(r.OnClickApprove())}),x(1,"i",156),i(2,"span",15),n(3," Approve"),t()()}}function hC(a,d){if(a&1){let e=I();i(0,"button",155),S("click",function(){b(e);let r=p(2);return y(r.onClickApproveAndPayAdvance())}),x(1,"i",156),i(2,"span",15),n(3," Approve & Pay Advance"),t()()}}function xC(a,d){if(a&1){let e=I();i(0,"div",150)(1,"button",151),S("click",function(){b(e);let r=p(),c=w(186);return y(r.OnClickRejectInvoice(c))}),x(2,"i",152),i(3,"span",15),n(4,"Reject"),t()(),u(5,fC,4,0,"button",153)(6,hC,4,0,"button",154),t()}if(a&2){let e=p();l(5),s("ngIf",!(!(e.invoiceDetails==null||e.invoiceDetails.installments[0]==null)&&e.invoiceDetails.installments[0].amount)),l(),s("ngIf",e.invoiceDetails==null||e.invoiceDetails.installments[0]==null?null:e.invoiceDetails.installments[0].amount)}}function bC(a,d){a&1&&(i(0,"div",169)(1,"span",61),n(2,"Loading..."),t()())}function yC(a,d){if(a&1){let e=I();i(0,"div",157)(1,"div",158)(2,"div",159)(3,"h4",160),n(4,"Reject Invoice"),t(),i(5,"button",161),S("click",function(){b(e);let r=p();return y(r.OnClickClose())}),n(6,"\xD7"),t()(),i(7,"div",162)(8,"div",144)(9,"label",163),n(10,"Remarks"),t(),i(11,"textarea",164),ve("ngModelChange",function(r){b(e);let c=p();return _e(c.remarks,r)||(c.remarks=r),y(r)}),t()(),i(12,"div",165)(13,"button",166),S("click",function(){b(e);let r=p();return y(r.OnClickClose())}),n(14,"Cancel"),t(),i(15,"button",167),S("click",function(){b(e);let r=p();return y(r.OnRejectInvoice())}),u(16,bC,3,0,"div",168),i(17,"span",15),n(18,"Reject Invoice"),t()()()()()()}if(a&2){let e=p();l(11),ue("ngModel",e.remarks),l(4),s("disabled",e.isLoading||e.remarks.trim().length==0),l(),s("ngIf",e.isLoading)}}var ja=(()=>{class a{constructor(e,o,r,c,g){this.router=e,this.activatedRoute=o,this.financeOrderService=r,this.dialog=c,this.notificationService=g,this.isManualEntry=!1,this.remarks="",this.isLoading=!1,this.isPrintLoading=!1,this.invoiceTableData=[],this.additionalDocs=[]}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{console.log(e),this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.isManualEntry=e.source==="Manual",this.GetInvoiceDetails()})}OnClickPayment(){this.router.navigate(["finance-management/payable-payments/po"])}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}openPathInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}onCellClick(e){e?.clickType==="po"?this.onPoNumberClick():e?.clickType==="source"&&this.onSourceIdClick()}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openPathInNewTab("/rfq/buyer/rfq-details/"+o):e==="auction"&&this.openPathInNewTab("/buyer-auction/buyer-auction-detail
1s/"+(this.invoiceDetails?.source_main_id||o)))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openPathInNewTab("/finance-management/payable-purchase-orders/view?id="+this.invoiceDetails.po_id)}OnClickRejectInvoice(e){this.dialogRef=this.dialog.open(e,{panelClass:"reject-modal"})}redirectIfAlreadyActioned(){let e=this.invoiceDetails||{},o=this.invoiceType==="child"?"child":"parent",r={invoiceId:this.invoiceId,invoiceType:o,origin:"vendor-bills"},c=String(e.status_code||"").toLowerCase();if(c){if(c==="invoice_created")return!1;let C=lt.buyer?.[o]?.[c];return!C||C.endsWith("/approve")?!1:(this.router.navigate([C],{queryParams:r,replaceUrl:!0}),!0)}let g=String(e.buyer_status||"").toLowerCase().trim();if(["","invoice created","invoice received"].includes(g))return!1;let h=g.includes("reject")?"finance-management/payable-invoices/rejected":"finance-management/payable-payments/po";return this.router.navigate([h],{queryParams:r,replaceUrl:!0}),!0}GetInvoiceDetails(){try{this.isLoading=!0;let e={};e.invoice_id=this.invoiceId,e.invoice_type=this.invoiceType,e.user_type="BUYER",this.financeOrderService.GetInvoiceDetails(e).subscribe(o=>{if(console.log(o),this.invoiceDetails=o.response.data,!this.isManualEntry&&this.redirectIfAlreadyActioned())return;this.invoiceDetails.buyer_address.filter(g=>g.addressType=="billing").forEach(g=>this.billingAddres=g),this.invoiceDetails.buyer_address.filter(g=>g.addressType=="shipping").forEach(g=>this.shippingAddrdres=g),this.buildInvoiceTableData(),this.additionalDocs=[];let r=g=>`${g.docName||""}|${g.filename||g.file_name||g.name||""}|${g.drive_path||g.path||g.viewPath||g.file_path||""}`,c=new Set;(this.invoiceDetails.additionalDocuments||[]).forEach(g=>{let h=r(g);if(c.has(h))return;c.add(h);let C=this.additionalDocs.findIndex(k=>k.collectionName===g.docName);C===-1?this.additionalDocs.push({collectionName:g.docName,docs:[g]}):this.additionalDocs[C].docs.push(g)}),this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}OnClickApprove(){try{this.isLoading=!0;let e=new Si;e.po_id=""+this.invoiceDetails.po_id,e.invoice_id=""+this.invoiceId,e.status_type="approve",this.financeOrderService.ApproveStatusForInvoice(e).subscribe(o=>{console.log(o),this.notificationService.showSuccess(o.response.response),this.isLoading=!1,this.router.navigate(["finance-management/payable-payments/po"],{queryParams:{invoiceId:this.invoiceId,invoiceType:"parent"},replaceUrl:!0})},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}onClickApproveAndPayAdvance(){try{this.isLoading=!0;let e=A(A({},this.invoiceDetails.billing_address),this.invoiceDetails.buyerCompanyDetails),o=new Si;o.po_id=""+this.invoiceDetails.po_id,o.invoice_id=""+this.invoiceId,o.status_type="approve",this.financeOrderService.ApproveStatusForInvoice(o).subscribe(r=>{console.log(r),this.financeOrderService.paynow({source:"po",source_id:this.invoiceId,orderAmount:this.invoiceDetails?.installments[0].amount,customerName:e.firstname+" "+e.lastname,customerPhone:e.contact_number?e.contact_number:"",customerEmail:e.email,backURL:"/finance-management/payable-payments",orderCurrency:"INR",orderNote:"",module:"po",gateway_name:ni.production?null:"stripe"}).subscribe(c=>{console.log(c),c.response&&window.location.replace(c.response.url),this.isLoading=!1},c=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})},r=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}OnClickClose(){this.dialogRef.close()}printInvoice(){this.isPrintLoading=!0;let e=this.invoiceType==="child"?"TAX_INVOICE":"PROFORMA_INVOICE";this.financeOrderService.printPdf(e,Number(this.invoiceId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1,this.notificationService.showError("Failed to generate print document.")}})}OnRejectInvoice(){try{this.isLoading=!0;let e=new Si;e.po_id=""+this.invoiceDetails.po_id,e.invoice_id=""+this.invoiceId,e.status_type="reject",e.reason=this.remarks,this.financeOrderService.ApproveStatusForInvoice(e).subscribe(o=>{console.log(o),this.notificationService.showSuccess(o.response.response),this.dialogRef.close(),this.isLoading=!1,this.router.navigate(["finance-management/payable-invoices"],{queryParams:{invoiceId:""+this.invoiceId,invoiceType:"parent"}})},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}get totalAmount(){if(this.invoiceDetails!==null)return this.invoiceDetails?.gross-this.invoiceDetails?.discount_amount+this.invoiceDetails?.gst_amount+this.invoiceDetails?.shipping_charges+this.invoiceDetails?.logistics_charges+this.invoiceDetails?.insurance_charges}
1get advanceDetails(){if(this.invoiceDetails&&this.invoiceDetails.receipts){let e=this.invoiceDetails.receipts.filter(o=>o.advance_payment==="yes");if(e.length)return e[0]}return{terms:"Not Available",amount:"0"}}get advanceNote(){return this.invoiceDetails&&this.invoiceDetails.installments&&this.invoiceDetails.installments.length?this.invoiceDetails.installments[0].terms:"Not available"}get advanceAmount(){return this.invoiceDetails&&this.invoiceDetails.installments&&this.invoiceDetails.installments.length?this.invoiceDetails.installments[0].amount:"0"}buildInvoiceTableData(){this.invoiceTableData=[],this.invoiceDetails&&(this.invoiceTableData.push({label:"Invoice Number",value:this.invoiceDetails.invoice_id}),this.invoiceTableData.push({label:"PO No.",value:this.invoiceDetails.po_number,clickType:this.invoiceDetails.po_id?"po":null}),this.invoiceTableData.push({label:"Source ID",value:this.invoiceDetails.display_source_id||this.invoiceDetails.source_id||"--",clickType:this.canOpenSource?"source":null}),this.invoiceTableData.push({label:"Invoice Date",value:this.invoiceDetails.proforma_created_date,isDate:!0}),this.invoiceTableData.push({label:"Additional Services Documents",value:this.invoiceDetails.service_documents_required}),this.invoiceTableData.push({label:"Place of Supply",value:this.shippingAddrdres?.region||"Not Available"}),this.invoiceTableData.push({label:"Source",value:this.invoiceDetails?.source||"N/A"}),this.invoiceDetails.source==="rfq"&&this.invoiceTableData.push({label:"Payment Mode",value:this.invoiceDetails.payment_mode}),this.invoiceDetails.delivery_date&&this.invoiceTableData.push({label:"Delivery Date",value:this.invoiceDetails.delivery_date,isDate:!0}),this.invoiceDetails.delivery_mode&&this.invoiceTableData.push({label:"Delivery Mode",value:this.invoiceDetails.delivery_mode}),this.invoiceDetails.source==="auction"&&this.invoiceDetails.auction_details&&(this.invoiceTableData.push({label:"Auction ID",value:this.invoiceDetails.auction_details.auction_id}),this.invoiceTableData.push({label:"Bid Amount",value:this.invoiceDetails.auction_details.bid_amount})),this.invoiceDetails.source)}static{this.\u0275fac=function(o){return new(o||a)(T(K),T(de),T(z),T(Ae),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-invoice-approve"]],decls:187,vars:66,consts:[["dialog",""],["normalValue",""],["normalValue2",""],["prods",""],["popContent",""],["noFiles",""],[3,"isLoading"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[4,"ngFor","ngForOf"],[1,"col-md","col-12"],[1,"mod-card","border-0"],[1,"mod-card-body","p-2"],["appTranslate","",1,"fw-600"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["class","col-md-auto col-12 ",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"mod-card","h-100"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],["class","mod-card mb-4 h-100",4,"ngIf"],[1,"col-lg","col-12","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"],["class","col-12 text-right my-3",4,"ngIf"],["id","invoice-model-approve",1,"modal","fade"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"mod-meta-tile"],[1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf"],["class","mod-meta-tile",4,"ngIf"],["type","button",1,"mod-btn-action",3,"click"],[4,"ngIf","ngIfElse"],["appTranslate","",1,"text-secondary"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"ri-bank-line"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],[1,"text-secondary","mb-1"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","5"],["colspan","2",1,"cell-300"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["scope","col","a
1ppTranslate",""],["class","row w-100",4,"ngIf","ngIfElse"],[1,"row","w-100"],["class","col-auto",4,"ngFor","ngForOf"],[1,"col-auto"],["target","_blank",1,"card",3,"href"],[1,"card-body","p-2"],[1,"list-inline","align-items-center","mb-0"],[1,"list-inline-item","theme-color","font-12","fw-600"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["appTranslate","",1,"text-muted","small"],["colspan","2"],["appTranslate","",1,"text-center","mb-0"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-12","mb-30"],[1,"card"],["data-toggle","collapse","data-target","#pia__PaymentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","pia__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20"],["data-toggle","collapse","data-target","#pia__ShipmentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["id","pia__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],[1,"list-inline","mb-0"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"col-12","text-right","my-3"],["type","button","data-toggle","modal","data-target","#invoice-model-reject",1,"mod-btn","mod-btn-outline-danger","mr-10",3,"click"],[1,"uil","uil-times-circle"],["type","button","data-toggle","modal","class","mod-btn mod-btn-primary mr-10 ",3,"click",4,"ngIf"],["type","button","data-toggle","modal","class","mod-btn mod-btn-primary mr-10 ",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"mod-btn","mod-btn-primary","mr-10",3,"click"],[1,"uil","uil-check-circle"],[1,"w-480px"],[1,"modal-content"],[1,"modal-header"],["appTranslate","",1,"modal-title","fw-600","font-14","text-danger"],["type","button","data-dismiss","modal",1,"close",3,"click"],[1,"modal-body"],["appTranslate","",1,"font-14-i","fw-600"],["rows","5","placeholder"," Write Text Here",1,"form-control",3,"ngModelChange","ngModel"],[1,"text-right"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-soft-primary","btn-sm","mr-2",3,"click"],["type","button",1,"mod-btn","mod-btn-danger","btn-sm",3,"click","disabled"],["class","spinner-border mr-1 w-h-1rem","role","status",4,"ngIf"],["role","status",1,"spinner-border","mr-1","w-h-1rem"]],template:function(o,r){if(o&1){let c=I();x(0,"app-loader",6),i(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",10)(5,"div",11)(6,"h2",12)(7,"a",13),x(8,"i",14),t(),i(9,"span",15),n(10,"Proforma Invoice"),t()()(),i(11,"div",16)(12,"button",17),S("click",function(){return b(c),y(r.printInvoice())}),u(13,CS,4,0,"span",18)(14,ES,6,0,"span",18),t()()()(),i(15,"div",9)(16,"div",19)(17,"div",20)(18,"h3",21),n(19,"Proforma Invoice"),t()(),i(20,"div",22)(21,"div",23),u(22,NS,2,1,"ng-container",24),t()()(),i(23,"div",19)(24,"div",20)(25,"h3",21),n(26,"Seller Details "),t()(),i(27,"div",22)(28,"div",8)(29,"div",25)(30,"div",26)(31,"div",27)(32,"p",28),n(33,"Shipping From :"),t(),i(34,"p",29)(35,"span",15),n(36,"Seller Name:"),t(),i(37,"span",30),n(38),t()(),i(39,"p",29)(40,"span",15),n(41,"GST No:"),t(),u(42,VS,2,1,"span",31)(43,BS,2,0,"span",32),t(),i(44,"p",29)(45,"span",15),n(46,"Seller Address:"),t(),i(47,"span",30),n(48),t()()()()(),u(49,LS,3,1,"div",33),t()()(),u(50,qS,35,6,"div",34),i(51,"div",19)(52,"div",20)(53,"h3",21),n(54,"Buyer Address"),t()(),i(55,"div",22)(56,"div",35)(57,"div",36)(58,"div",37)(59,"div",22)(60,"p",38),n(61,"Shipping Address : "),t(),u(62,GS,4,1,"p",39),i(63,"p",30),n(64),t()()()(),i(65,"div",36)(66,"div",37)(67,"div",22)(68,"p",38),n(69,"Billing Address : "),t(),u(70,US,4,1,"p",39),i(71,"p",30),n(72),t(),i(73,"p",29)(74,"span",15),n(75,"GST No:"),t(),u(76,jS,2,1,"span",31)(77,$S,2,0,"span",32),t()()()()()()(),i(78,"div",19)(79,"div",40)(80,"h3",21),n(81,"Order Summary"),t()(),i(82,"div",41)(83,"div",42)(84,"table",43)(85,"thead",44)(86,"tr")(87,"th",15),n(88," Product Name"),t(),i(89,"th",15),n(90," Product ID"),t(),i(91,"th",15),n(92," Quantity"),t(),i(93,"th",15),n(94,"Quoted "),t(),i(95,"th",15),n(96," Discount"),t(),i(97,"th",15),n(98," Gross Total"),t(),i(99,"th",15),n(100," Tax"),t(),i(101,"th",15),n(102," Total Payable"),t()()(),i(103,"tbody"),u(104,KS,31,20,"tr",24)(105,ZS,12,4,"tr",18)(106,XS,2,1,"ng-container",18),t()()()()(),u(107,rC,16,2,"div",34)(108,_C,8,2,"div",34),i(109,"div",45)(110,"div",46),u(111,gC,10,2,"div",47),t(),i(112,"div",48)(113,"div",49)(114,"div",50)(115,"ul",51)(116,"li",52)(117,"b",15),n(118,"Gross Total:"),t(),i(119,"span",53),n(120
1),_(121,"currencyFormat"),t()(),i(122,"li",52)(123,"b",15),n(124,"Discount:"),t(),i(125,"span",54),n(126),_(127,"currencyFormat"),t()(),i(128,"li",52)(129,"b",15),n(130," Net Total:"),t(),i(131,"span",53),n(132),_(133,"currencyFormat"),t()(),i(134,"li",55)(135,"span",15),n(136,"SGST:"),t(),i(137,"span",53),n(138),_(139,"currencyFormat"),t()(),i(140,"li",55)(141,"span",15),n(142,"CGST:"),t(),i(143,"span",53),n(144),_(145,"currencyFormat"),t()(),i(146,"li",55)(147,"span",15),n(148,"IGST:"),t(),i(149,"span",53),n(150),_(151,"currencyFormat"),t()(),i(152,"li",52)(153,"b",15),n(154,"TotalTax Amount:"),t(),i(155,"span",53),n(156),_(157,"currencyFormat"),t()(),i(158,"li",52)(159,"b",15),n(160,"Logistics:"),t(),i(161,"span",53),n(162),_(163,"currencyFormat"),t()(),i(164,"li",52)(165,"b",15),n(166,"Insurance:"),t(),i(167,"span",53),n(168),_(169,"currencyFormat"),t()(),i(170,"li",52)(171,"b",15),n(172,"Additional Charges:"),t(),i(173,"span",53),n(174),_(175,"currencyFormat"),t()()()(),i(176,"div",56)(177,"span",15),n(178,"Total Payable Amount:"),t(),i(179,"span",53),n(180),_(181,"currencyFormat"),t()()()()(),i(182,"div",8),u(183,xC,7,2,"div",57),t()()()(),i(184,"div",58),u(185,yC,19,3,"ng-template",null,0,P),t()}o&2&&(s("isLoading",r.isLoading),l(12),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(8),s("ngForOf",r.invoiceTableData),l(16),f(r.invoiceDetails==null||r.invoiceDetails.seller_details==null?null:r.invoiceDetails.seller_details.company_name),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.seller_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.seller_gst)),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.payment_mode)!=="Cash"&&((r.invoiceDetails==null?null:r.invoiceDetails.bank_name)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_number)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_ifsc))),l(12),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(6),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.gst),l(),s("ngIf",!(!(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null)&&r.invoiceDetails.buyerCompanyDetails.gst)),l(27),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.items),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!=="DirectBuy"&&+(r.advanceDetails==null?null:r.advanceDetails.amount)>0),l(),s("ngIf",!(+(r.advanceDetails==null?null:r.advanceDetails.amount)>0)),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required)=="yes"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.multiple_payment_terms)==="YES"||(r.invoiceDetails==null?null:r.
1invoiceDetails.multiple_shipment_terms)==="YES"),l(3),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.shipments)=="no"&&(r.invoiceDetails==null?null:r.invoiceDetails.instalments)=="no"),l(9),m(" ",v(121,44,r.invoiceDetails==null?null:r.invoiceDetails.gross),""),l(6),m("(-) ",v(127,46,r.invoiceDetails==null?null:r.invoiceDetails.discount_amount),""),l(6),m(" ",v(133,48,r.invoiceDetails==null?null:r.invoiceDetails.net_charges),""),l(6),m(" ",v(139,50,r.invoiceDetails==null?null:r.invoiceDetails.sgst),""),l(6),m(" ",v(145,52,r.invoiceDetails==null?null:r.invoiceDetails.cgst),""),l(6),m(" ",v(151,54,r.invoiceDetails==null?null:r.invoiceDetails.igst),""),l(6),m(" ",v(157,56,r.invoiceDetails==null?null:r.invoiceDetails.gst_amount),""),l(6),m(" ",v(163,58,r.invoiceDetails==null?null:r.invoiceDetails.logistics_charges),""),l(6),m(" ",v(169,60,r.invoiceDetails==null?null:r.invoiceDetails.insurance_charges),""),l(6),m(" ",v(175,62,r.invoiceDetails==null?null:r.invoiceDetails.additional_charges_amount),""),l(6),m(" ",v(181,64,r.invoiceDetails==null?null:r.invoiceDetails.total_amount),""),l(3),s("ngIf",!r.isManualEntry&&(r.invoiceDetails==null?null:r.invoiceDetails.source)!=="Manual"))},dependencies:[J,W,Ne,Pe,Pt,Se,Z,De,L,Rt,st,ae],styles:["td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.reject-modal[_ngcontent-%COMP%] .mat-dialog-container[_ngcontent-%COMP%]{padding:0!important} .mat-dialog-container{padding:0!important}.w-h-1rem[_ngcontent-%COMP%]{width:1rem;height:1rem}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.width-69px[_ngcontent-%COMP%]{width:69px}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:140px;white-space:normal;word-break:break-all}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}"]})}}return a})();function SC(a,d){a&1&&(i(0,"span"),x(1,"i",57),i(2,"span",14),n(3,"Print"),t()())}function CC(a,d){a&1&&(i(0,"span")(1,"div",58)(2,"span",59),n(3,"Loading..."),t()(),i(4,"span",14),n(5,"Printing..."),t()())}function EC(a,d){if(a&1){let e=I();i(0,"button",60),S("click",function(){b(e);let r=p();return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function IC(a,d){if(a&1&&n(0),a&2){let e=p();f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function DC(a,d){if(a&1){let e=I();i(0,"button",60),S("click",function(){b(e);let r=p();return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p();l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function TC(a,d){if(a&1&&n(0),a&2){let e=p();f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function wC(a,d){if(a&1&&x(0,"img",64),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function PC(a,d){if(a&1&&(i(0,"div",61)(1,"div",62),u(2,wC,1,1,"img",63),t()()),a&2){let e=p();l(2),s("ngIf",e.invoiceDetails&&e.invoiceDetails.seller_details&&e.invoiceDetails.seller_details.company_logoViewPath)}}function OC(a,d){if(a&1&&(i(0,"p",65)(1,"span",29),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function kC(a,d){if(a&1&&(i(0,"p",65)(1,"span",29),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function FC(a,d){if(a&1&&(i(0,"span",31),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.buyer_gst)}}function MC(a,d){a&1&&(i(0,"span",66),n(1,"Not Available"),t())}function AC(a,d){if(a&1&&(i(0,"span",76),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function NC(a,d){if(a&1&&(i(0,"span",76),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function VC(a,d){if(a&1&&(i(0,"span",76),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function BC(a,d){if(a&1&&(F(0),i(1,"div",73),n(2),t(),i(3,"p",74),u(4,AC,2,2,"span",75)(5,NC,2,2,"span",75)(6,VC,2,2,"span",75),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function RC(a,d){if(a&1&&(F(0,77),i(1,"div",73)(2,"div")(3,"p",78)(4,"span",14),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",78)(9,"span",14),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",78)(14,"span",14),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",78)(19,"span",14),n(20,"Tax"),t(),n(21),_(22,"currencyFormat"),t(),i(23,"p",78)(24,"span",14),n(25,"SGST"),t(),n(26),_(27,"currencyFormat"),t(),i(28,"p",78)(29,"span",14),n(30,"CGST"),t(),n(31),_(32,"currencyFormat"),t(),i(33,"p",78)(34,"span",14),n(35,"IGST"),t(),n(36),_(37,"currencyFormat"),t(),x(38,"div",79),i(39,"p",65)(40,"b")(41,"span",14),n(42,"Total :"),t(),n(43),_(44,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,12,e.gross_total)," "),l(5),m(" ",v(12,14,e.discount)," "),l(5),m(" ",v(17,16,e.net_amount)," "),l(5),D(" (",e.gst_percentage,"%): ",v(22,18,e.gst)," "),l(5),D(" (",e.
1sgst_percentage,"%): ",v(27,20,e.sgst)," "),l(5),D(" (",e.cgst_percentage,"%): ",v(32,22,e.cgst)," "),l(5),D(" (",e.igst_percentage,"%): ",v(37,24,e.igst)," "),l(7),m(" ",v(44,26,e.total_amount)," ")}}function LC(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",70),n(3),t(),u(4,BC,7,4,"ng-template",null,2,P),x(6,"i",71),t(),i(7,"td",72),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,RC,45,28,"ng-template",null,3,P),x(30,"i",71),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.discount)),l(3),f(v(21,14,e.gross_total)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function qC(a,d){if(a&1&&(i(0,"tr")(1,"td",80)(2,"span",14),n(3,"Additional Charge:"),t(),n(4,"\xA0"),i(5,"b"),n(6),t()(),i(7,"td",81)(8,"span",14),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(6),f(e.description),l(5),f(v(12,2,e.amount))}}function GC(a,d){if(a&1&&(i(0,"table",67)(1,"thead",68)(2,"tr")(3,"th",14),n(4," Product Name"),t(),i(5,"th",14),n(6," Product ID"),t(),i(7,"th",14),n(8," Required Qty"),t(),i(9,"th",14),n(10,"Quoted"),t(),i(11,"th",14),n(12," Discount"),t(),i(13,"th",14),n(14," Gross Total"),t(),i(15,"th",14),n(16," Tax"),t(),i(17,"th",14),n(18," Total"),t()()(),i(19,"tbody"),u(20,LC,31,20,"tr",69)(21,qC,13,4,"tr",69),t()()),a&2){let e=p();l(20),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function UC(a,d){a&1&&(i(0,"li")(1,"p",82),n(2," No attachments available "),t()())}function jC(a,d){if(a&1&&(i(0,"li",83)(1,"a",84),x(2,"i",85),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.document_ViewPath||e.fileViewPath||e.viewPath||e.path||e.document_path,q),l(2),m(" ",e.filename," ")}}function $C(a,d){if(a&1&&(i(0,"li",87)(1,"b",14),n(2,"Logistics:"),t(),i(3,"span",56),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(2);l(4),m(" ",v(5,1,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),"")}}function zC(a,d){if(a&1&&(i(0,"li",87)(1,"b",14),n(2,"Insurance:"),t(),i(3,"span",56),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(2);l(4),m(" ",v(5,1,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),"")}}function WC(a,d){if(a&1&&(i(0,"p",78)(1,"span"),n(2),_(3,"currencyFormat"),t()()),a&2){let e=p().$implicit;l(2),D("",e.description,": ",v(3,2,e.amount),"")}}function QC(a,d){if(a&1&&(F(0),u(1,WC,4,4,"p",92),M()),a&2){let e=d.$implicit;l(),s("ngIf",e.description)}}function YC(a,d){if(a&1&&(F(0),i(1,"div",73)(2,"div"),u(3,QC,2,1,"ng-container",69),x(4,"div",79),i(5,"p",65)(6,"b")(7,"span",14),n(8,"Total Additional Charges:"),t(),n(9),_(10,"currencyFormat"),t()()()(),M()),a&2){let e=p(2);l(3),s("ngForOf",!(e.invoiceDetails==null||e.invoiceDetails.additional_charges==null)&&e.invoiceDetails.additional_charges.length?e.invoiceDetails==null?null:e.invoiceDetails.additional_charges:e.invoiceDetails==null?null:e.invoiceDetails.amount_splits),l(6),m(" ",v(10,2,e.additionalCharges)," ")}}function HC(a,d){if(a&1){let e=I();i(0,"i",93,5),S("mouseenter",function(){b(e);let r=w(1),c=p(2);return y(c.toggleWithGreeting(r))})("mouseleave",function(){b(e);let r=w(1),c=p(2);return y(c.toggleWithGreeting(r))}),t()}if(a&2){p();let e=w(49);s("ngbPopover",e)}}function KC(a,d){if(a&1&&(i(0,"ul",86)(1,"li",87)(2,"b",14),n(3,"Gross Total:"),t(),i(4,"span",56),n(5),_(6,"currencyFormat"),t()(),i(7,"li",87)(8,"b",14),n(9,"Discount:"),t(),i(10,"span",88),n(11),_(12,"currencyFormat"),t()(),i(13,"li",87)(14,"b",14),n(15,"Net Amount:"),t(),i(16,"span",56),n(17),_(18,"currencyFormat"),t()(),i(19,"li",89)(20,"span",14),n(21,"SGST:"),t(),i(22,"span",56),n(23),_(24,"currencyFormat"),t()(),i(25,"li",89)(26,"span",14),n(27,"CGST:"),t(),i(28,"span",56),n(29),_(30,"currencyFormat"),t()(),i(31,"li",89)(32,"span",14),n(33,"IGST: "),t(),i(34,"span",56),n(35),_(36,"currencyFormat"),t()(),i(37,"li",87)(38,"b",14),n(39,"Total Tax Amount:"),t(),i(40,"span",56),n(41),_(42,"currencyFormat"),t()(),u(43,$C,6,3,"li",90)(44,zC,6,3,"li",90),i(45,"li")(46,"b",14),n(47,"Additional Charges:"),t(),u(48,YC,11,4,"ng-template",null,4,P)(50,HC,2,1,"i",91),i(51,"span",56),n(52),_(53,"currencyFormat"),t()()()),a&2){let e=p();l(5),m(" ",v(6,11,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(12,13,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(18,15,e.invoiceDetails==null?null:e.invoiceDetails.net_charges)," "),l(6),m(" ",v(24,17,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(30,19,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(36,21,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(42,23,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(2),s("ngIf",+(e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges)>0),l(),s("ngIf",+(e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges)>0),l(6),s("ngIf",(e.invoiceDetails==null||e.invoiceDetails.additional_charges==null?null:e.invoiceDetails.additional_charges.length)>0||(e.invoiceDetails==null||e.invoiceDetails.amount_splits==null?null:e.invoiceDetails.amount_splits.length)>0),l(2),m(" ",v(53,25,e.additionalCharges),"")}}var $a=(()=>{class a{constructor(e,o,r,c){this.activatedRoute=e,this.financeOrderService=o,this.router=r,this.http=c,this.current=!0,this.isPrintLoading=!1}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}openPathInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openPathInNewTab("/rfq/buyer/rfq-details/"+o):e==="auction"&&this.openPathInNewTab("/buyer-auction/buyer-auction-detail
1s/"+(this.invoiceDetails?.source_main_id||o)))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openPathInNewTab("/finance-management/payable-purchase-orders/view?id="+this.invoiceDetails.po_id)}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.GetInvoiceDetails()}),this.financeOrderService.GetProfileData().subscribe(e=>{this.customerProfile=e.response})}GetInvoiceDetails(){let e=new Vt;e.invoice_id=this.invoiceId,e.invoice_type=this.invoiceType,this.financeOrderService.GetTaxInvoiceDetails(e).subscribe(o=>{this.invoiceDetails=o.response.data,this.invoiceDetails.buyer_address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddres=r),this.invoiceDetails.buyer_address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddrdres=r)})}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}OnChangeCurrentAmount(){this.current=!0,this.total=!1}OnChangetoTotalAmount(){this.current=!1,this.total=!0,this.invoiceDetails.net_charges==0?this.totalInvoiceAmount=this.invoiceDetails.amount:this.totalInvoiceAmount=this.invoiceDetails.net_charges}OnClickPaymentMake(){this.current==!1?this.amounttobePaid=this.totalInvoiceAmount:this.amounttobePaid=this.tobePaidAmount,this.path=ni.apiUrl+"po/payment.php",this.notifyUrl=ni.apiUrl+"po/payment.php";let e={};e.appId="596614781dd48ea3a1aafaa7116695",e.customerEmail=this.customerProfile.data.email,e.customerName=this.customerProfile.data.firstname,e.customerPhone=this.customerProfile.data.mobile_number,e.notifyUrl=ni.apiUrl+"po/payment.php",e.orderAmount=this.amounttobePaid,e.orderCurrency="INR",e.orderId="",e.orderNote="",e.returnUrl=this.notifyUrl,e.source=this.invoiceType,e.source_id=this.invoiceId,e.backURL=ni.apiUrl+"finance-management/payable-invoices/view?invoiceId="+this.invoiceId+"&invoiceType="+this.invoiceType,this.postdat=e,this.financeOrderService.PaymentSignatureGeneration(e).subscribe(o=>{console.log(o.response),this.signature=o.response.signature,this.orderId=o.response.order_id,setInterval(()=>{this.signature!==""&&document.getElementById("paymentForm").submit()},5e3)})}onSubmit(e){console.log("rdsffd"),this.http.post("https://test.cashfree.com/billpay/checkout/post/submit",this.postdat).subscribe(o=>console.log(o),o=>console.log(o))}paymentGateWay(){}get additionalCharges(){let e=Array.isArray(this.invoiceDetails?.additional_charges)&&this.invoiceDetails.additional_charges.length?this.invoiceDetails.additional_charges:this.invoiceDetails?.amount_splits;return Array.isArray(e)?e.reduce((o,r)=>o+(parseInt(r?.amount)||0),0):0}printDocument(){this.isPrintLoading=!0,this.financeOrderService.printPdf("TAX_INVOICE",Number(this.invoiceId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(de),T(z),T(K),T(Mn))}}static{this.\u0275cmp=R({type:a,selectors:[["app-view-buyer-invoice"]],decls:124,vars:38,consts:[["plainPoNumber",""],["plainSourceId",""],["prods",""],["popContent",""],["addCharges",""],["p3","ngbPopover"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],[1,"mod-card-title","mb-0"],[1,"col-md","col-12"],["appTranslate","",1,"fw-600"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","col-md-auto col-12",4,"ngIf"],[1,"col-md-6"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"fw-600","mb-2"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["class","table mod-table",4,"ngIf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"font-12","text-secondary","mb-2"],[1,"form-group","mb-0","mt-3"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],["class","list-unstyled mb-0",4,"ngIf"],[1,"card-footer"],[1,"float-right"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],[1,"sr-only"],["type","button",1,"mod-btn-action",3,"click"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"text-secondary","mb-1"],["appTranslate","",1,"text-secondary"],[1,"table","mod-table"],[1,""],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"ml-n-75px"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","6"],["colspan","2",1,"cell-300"],["appTranslate","",1,"font-12","text-secondary","mb-2"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],["class","mb-2",4,"ngIf"],["class","uil uil-info-circle","placement","left","triggers","manual",3,"ngbPopover","mouseenter","mouseleave",4,"ngIf"],["class","text-dark mb-1",4,"ngIf"],["placement","left","triggers","manual",1,"uil","uil-info-circle",3,"mouseenter","mouseleave","ngbPopover"]],template:function(o,r){if(o&1){let c=I();i(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",10)(5,"h2",11)(6,"a",12),x(7,"i",13),t(),i(8,"span",14),n(9,"Tax Invoice"),t()()(),i(10,"div",15)(11,"button",16),S("click",function(){return b(c),y(r.printDocument())}),u(12,SC,4,0,"span",17)(13,CC,6,0,"span",17),t()()()(),i(14,"div",8)(15,"div",18)(16,"div",19)(17,"h3",20),n(18,"Invoice Details"),t()(),i(19,"div",21)(20,"div",22)(21,"div",23)(22,"div",24),n(23,"Proforma Invoice Number"),t(),i(24,"div",25),n(25),t()(),i(26,"div",23)(27,"div",24),n(28,"PO No."),t(),i(29,"div",25),u(30,EC,2,1,"button",26)(31,IC,1,1,"ng-template",null,0,P),t()(),i(33,"div",23)(34,"div",24),n(35,"Source ID"),t(),i(36,"div",25),u(37,DC,2,1,"button",26)(38,TC,1,1,"ng-template",null,1,P),t()()()()(),i(40,"div",18)(41,"div",19)(42,"h3",27)(43,"span",14),n(44,"Tax Invoice ID:"),t(),n(45),t()(),i(46,"div",21)(47,"div",7)(48,"div",28)(49,"p",29),n(50,"Shipping From :"),t(),i(51,"p",30)(52,"span",14),n(53,"Seller Name:"),t(),i(54,"span",31),n(55),t()(),i(56,"p",30)(57,"span",14),n(58,"GST No:"),t(),i(59,"span",31),n(60),t()(),i(61,"p",30)(62,"span",14),n(63,"Seller Address:"),t(),i(64,"span",31),n(65),t()()(),u(66,PC,3,1,"div",32),t()()(),i(67,"div",18)(68,"div",19)(69,"h3",20),n(70,"Buyer Address"),t()(),i(71,"div",21)(72,"div",7)(73,"div",33)(74,"p",34),n(75,"Shipping Address : "),t(),u(76,OC,4,1,"p",35),i(77,"p",31),n(78),t()(),i(79,"div",33)(80,"p",34),n(81,"Billing Address : "),t(),u(82,kC,4,1,"p",35),i(83,"p",31),n(84),t(),i(85,"p",36)(86,"span",14),n(87,"GST No:"),t(),u(88,FC,2,1,"span",37)(89,MC,2,0,"span",38),t()()()()(),i(90,"div",18)(91,"div",39)(92,"h3",20),n(93,"Order Summary"),t()(),i(94,"div",40)(95,"div",41)(96,"div",42),u(97,GC,22,2,"table",43),t()()()(),i(98,"div",44)(99,"div",45)(100,"div",46)(101,"div",19)(102,"h3",20),n(103,"Terms And Conditions"),t()(),i(104,"div",21)(105,"p",47),n(106),t(),i(107,"div",48)(108,"label",29),n(109,"Attachments"),t(),i(110,"ul",49),u(111,UC,3,0,"li",17)(112,jC,4,2,"li",50),t()()()()(),i(113,"div",51)(114,"div",52)(115,"div",53),u(116,KC,54,27,"ul",54),t(),i(117,"div",55)(118,"span",14),n(119,"Total Payable Amou
1nt:"),t(),i(120,"span",56),n(121),_(122,"currencyFormat"),_(123,"currencyFormat"),t()()()()()()()()}if(o&2){let c=w(32),g=w(39);l(11),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(12),f(r.invoiceDetails==null?null:r.invoiceDetails.parent_display_invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",c),l(7),s("ngIf",r.canOpenSource)("ngIfElse",g),l(8),m(" ",r.invoiceDetails==null?null:r.invoiceDetails.invoice_id,""),l(10),f(r.invoiceDetails==null||r.invoiceDetails.seller_details==null?null:r.invoiceDetails.seller_details.company_name),l(5),f(r.invoiceDetails==null?null:r.invoiceDetails.seller_gst),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(10),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(4),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.buyer_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.buyer_gst)),l(8),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.items.length)!==0),l(9),f(r.invoiceDetails!=null&&r.invoiceDetails.terms?r.invoiceDetails.terms:"No Terms Provided"),l(5),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.attachments)||(r.invoiceDetails==null?null:r.invoiceDetails.attachments.length)===0),l(),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.attachments),l(4),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.items.length)!==0),l(5),m(" ",(r.invoiceDetails==null?null:r.invoiceDetails.items.length)!==0?v(122,34,r.invoiceDetails==null?null:r.invoiceDetails.total_amount):v(123,36,r.invoiceDetails==null?null:r.invoiceDetails.amount),"")}},dependencies:[J,W,Se,Z,L,ae],styles:["td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();function ZC(a,d){a&1&&(i(0,"span"),x(1,"i",59),i(2,"span",14),n(3,"Print"),t()())}
1function JC(a,d){a&1&&(i(0,"span")(1,"div",60)(2,"span",61),n(3,"Loading..."),t()(),i(4,"span",14),n(5,"Printing..."),t()())}function XC(a,d){if(a&1&&(i(0,"span",30),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.seller_gst)}}function e3(a,d){a&1&&(i(0,"span",62),n(1,"Not Available"),t())}function t3(a,d){if(a&1&&x(0,"img",66),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function i3(a,d){if(a&1&&(i(0,"div",63)(1,"div",64),u(2,t3,1,1,"img",65),t()()),a&2){let e=p();l(2),s("ngIf",e.invoiceDetails&&e.invoiceDetails.seller_details&&e.invoiceDetails.seller_details.company_logoViewPath)}}function n3(a,d){if(a&1){let e=I();i(0,"button",67),S("click",function(){b(e);let r=p();return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function a3(a,d){if(a&1&&n(0),a&2){let e=p();f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function r3(a,d){if(a&1){let e=I();i(0,"button",67),S("click",function(){b(e);let r=p();return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p();l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function l3(a,d){if(a&1&&n(0),a&2){let e=p();f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function o3(a,d){if(a&1&&(i(0,"div",36)(1,"div",37),n(2," Additional Services Documents "),t(),i(3,"div",38),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.service_documents_required," ")}}function s3(a,d){if(a&1&&(i(0,"div",36)(1,"div",37),n(2," Payment Mode "),t(),i(3,"div",38),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.payment_mode,"")}}function d3(a,d){if(a&1&&(i(0,"div",18)(1,"div",19)(2,"h3",34),n(3,"Company Bank Details"),t()(),i(4,"div",21)(5,"div",68)(6,"div",69)(7,"span",70),x(8,"i",71),t(),i(9,"div",72)(10,"h4",73),n(11),t(),i(12,"span",74),n(13),t()()(),i(14,"div",75)(15,"div",76)(16,"span",77),n(17,"Account Holder"),t(),i(18,"span",78),n(19),t()(),i(20,"div",76)(21,"span",77),n(22,"Account Number"),t(),i(23,"span",78),n(24),t()(),i(25,"div",76)(26,"span",77),n(27,"IFSC Code"),t(),i(28,"span",78),n(29),t()(),i(30,"div",76)(31,"span",77),n(32,"Branch"),t(),i(33,"span",78),n(34),t()()()()()()),a&2){let e=p();l(11),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_name),l(2),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch),l(6),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_name),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_number),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_ifsc),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch)}}function c3(a,d){if(a&1&&(i(0,"div",84)(1,"a",85)(2,"div",27)(3,"ul",86)(4,"li",87),x(5,"i",88),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(5),m(" ",e.name," ")}}function p3(a,d){if(a&1&&(i(0,"div",82),u(1,c3,7,2,"div",83),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.docs)}}function m3(a,d){a&1&&(i(0,"span",89),n(1," No files uploaded "),t())}function u3(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),u(4,p3,2,1,"div",81)(5,m3,2,0,"ng-template",null,2,P),t()()),a&2){let e=d.$implicit,o=w(6);l(2),m(" ",e.collectionName," "),l(2),s("ngIf",e.docs.length>0)("ngIfElse",o)}}function _3(a,d){a&1&&(i(0,"tr")(1,"td",90)(2,"p",91),n(3,"No documents available"),t()()())}function v3(a,d){if(a&1&&(i(0,"div",18)(1,"div",47)(2,"h3",34),n(3,"Additional Services Documents"),t()(),i(4,"div",48)(5,"div",79)(6,"table",50)(7,"thead",51)(8,"tr")(9,"th",80),n(10,"Document Name"),t(),i(11,"th",80),n(12,"Files"),t()()(),i(13,"tbody"),u(14,u3,7,3,"tr",53)(15,_3,4,0,"tr",17),t()()()()()),a&2){let e=p();l(14),s("ngForOf",e.additionalDocs),l(),s("ngIf",!e.additionalDocs.length)}}function g3(a,d){if(a&1&&(i(0,"p",92)(1,"span",28),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function f3(a,d){if(a&1&&(i(0,"p",92)(1,"span",28),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function h3(a,d){if(a&1&&(i(0,"span",30),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function x3(a,d){a&1&&(i(0,"span",62),n(1,"Not Available"),t())}function b3(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function y3(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function S3(a,d){if(a&1&&(i(0,"span",99),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function C3(a,d){if(a&1&&(F(0),i(1,"div",96),n(2),t(),i(3,"p",97),u(4,b3,2,2,"span",98)(5,y3,2,2,"span",98)(6,S3,2,2,"span",98),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function E3(a,d){if(a&1&&(F(0),i(1,"div",96)(2,"div")(3,"p",100)(4,"span",14),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",100)(9,"span",14),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",100)(14,"span",14),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",100)(19,"span",14),n(20,"Tax"),t(),n(21),_(22,"currencyFormat"),t(),i(23,"p",100)(24,"span",14),n(25,"SGST"),t(),n(26),_(27,"currencyFormat"),t(),i(28,"p",100)(29,"span",14),n(30,"CGST"),t(),n(31),_(32,"currencyFormat"),t(),i(33,"p",100)(34,"span",14),n(35,"IGST"),t(),n(36),_(37,"currencyFormat"),t(),i(38,"p",100)(39,"span",14),n(40,"Logistics:"),t(),n(41),_(42,"currencyFormat"),t(),i(43,"p",100)(44,"span",14),n(45,"Insurance:"),t(),n(46),_(47,"currencyFormat"),t(),x(48,"div",101),i(49,"p",92)(50,"b")(51,"span",14),n(52,"Total Payable:"),t(),n(53),_(54,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.gross_total-e.discount)," "),l(5),D(" (",e.gst_percentage,"%): ",v(22,20,e.gst)," "),l(5),D(" (",e.
1sgst_percentage,"%): ",v(27,22,e.sgst)," "),l(5),D(" (",e.cgst_percentage,"%): ",v(32,24,e.cgst)," "),l(5),D(" (",e.igst_percentage,"%): ",v(37,26,e.igst)," "),l(5),m(" ",v(42,28,e.logistics_charges)," "),l(5),m(" ",v(47,30,e.insurance_charges)," "),l(7),m(" ",v(54,32,e.total_amount)," ")}}function I3(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",93),n(3),t(),u(4,C3,7,4,"ng-template",null,3,P),x(6,"i",94),t(),i(7,"td",95),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,E3,55,34,"ng-template",null,4,P),x(30,"i",94),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),f(e.required_qty),l(2),m(" ",v(13,10,e.unit_price)," "),l(5),m(" ",v(18,12,e.discount),""),l(3),m(" ",v(21,14,e.gross_total),""),l(3),m(" ",v(24,16,e.gst),""),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function D3(a,d){if(a&1&&(i(0,"tr")(1,"td",102)(2,"span",14),n(3,"Advance Note:"),t(),i(4,"b"),n(5),t()(),i(6,"td",103)(7,"span",14),n(8,"Advance Amount:"),t(),i(9,"b"),n(10),_(11,"currencyFormat"),t()()()),a&2){let e=p();l(5),f(e.advanceDetails.terms),l(5),f(v(11,2,e.advanceDetails.amount))}}function T3(a,d){if(a&1&&(i(0,"tr")(1,"td",102)(2,"span",14),n(3,"Additional Charge:"),t(),n(4,"\xA0 "),i(5,"b"),n(6),t()(),i(7,"td",103)(8,"span",14),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(6),f(e.description),l(5),f(v(12,2,e.amount))}}function w3(a,d){if(a&1&&(F(0),u(1,T3,13,4,"tr",53),M()),a&2){let e=p();l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function P3(a,d){if(a&1&&(i(0,"li",108)(1,"a",109),x(2,"i",88),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.drive_path,q),l(2),m(" ",e.filename," ")}}function O3(a,d){if(a&1&&(i(0,"div",104)(1,"div",19)(2,"h3",34),n(3,"Terms & Conditions"),t()(),i(4,"div",21)(5,"p",105),n(6),t(),i(7,"ul",106),u(8,P3,4,2,"li",107),t()()()),a&2){let e=p();l(6),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.terms,""),l(2),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.detail_seller_terms_and_conditions_path)}}function k3(a,d){if(a&1&&(i(0,"div")(1,"div",110)(2,"div",44)(3,"ul",111)(4,"li",112)(5,"b",14),n(6,"Total Bid Value:"),t(),i(7,"span",113),n(8),_(9,"currencyFormat"),t()(),i(10,"li",114)(11,"span",14),n(12,"SGST:"),t(),i(13,"span",113),n(14),_(15,"currencyFormat"),t()(),i(16,"li",114)(17,"span",14),n(18,"CGST:"),t(),i(19,"span",113),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",14),n(24,"IGST:"),t(),i(25,"span",113),n(26),_(27,"currencyFormat"),t()(),i(28,"li",112)(29,"b",14),n(30,"Total Tax Amount:"),t(),i(31,"span",113),n(32),_(33,"currencyFormat"),t()(),i(34,"li",112)(35,"b",14),n(36,"Logistics:"),t(),i(37,"span",113),n(38),_(39,"currencyFormat"),t()(),i(40,"li",112)(41,"b",14),n(42,"Insurance:"),t(),i(43,"span",113),n(44),_(45,"currencyFormat"),t()(),i(46,"li",112)(47,"b",14),n(48,"Additional Charges:"),t(),i(49,"span",113),n(50),_(51,"currencyFormat"),t()()()(),i(52,"div",115)(53,"span",14),n(54,"Total Payable Amount:"),t(),i(55,"span",113),n(56),_(57,"currencyFormat"),t()()()()),a&2){let e=p();l(8),m(" ",v(9,9,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m(" ",v(15,11,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(21,13,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(27,15,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(33,17,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(39,19,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(45,21,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(51,23,e.invoiceDetails==null?null:e.invoiceDetails.additional_charges_amount),""),l(6),f(v(57,25,e.invoiceDetails==null?null:e.invoiceDetails.total_amount))}}function F3(a,d){if(a&1&&(i(0,"div")(1,"div",110)(2,"div",44)(3,"ul",111)(4,"li",112)(5,"b",14),n(6,"Gross Total:"),t(),i(7,"span",113),n(8),_(9,"currencyFormat"),t()(),i(10,"li",112)(11,"b",14),n(12,"Discount:"),t(),i(13,"span",116),n(14),_(15,"currencyFormat"),t()(),i(16,"li",112)(17,"b",14),n(18,"Net Total:"),t(),i(19,"span",113),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",14),n(24,"SGST:"),t(),i(25,"span",113),n(26),_(27,"currencyFormat"),t()(),i(28,"li",114)(29,"span",14),n(30,"CGST:"),t(),i(31,"span",113),n(32),_(33,"currencyFormat"),t()(),i(34,"li",114)(35,"span",14),n(36,"IGST:"),t(),i(37,"span",113),n(38),_(39,"currencyFormat"),t()(),i(40,"li",112)(41,"b",14),n(42,"Total Tax Amount:"),t(),i(43,"span",113),n(44),_(45,"currencyFormat"),t()(),i(46,"li",112)(47,"b",14),n(48,"Logistics:"),t(),i(49,"span",113),n(50),_(51,"currencyFormat"),t()(),i(52,"li",112)(53,"b",14),n(54,"Insurance:"),t(),i(55,"span",113),n(56),_(57,"currencyFormat"),t()(),i(58,"li",112)(59,"b",14),n(60,"Additional Charges:"),t(),i(61,"span",113),n(62),_(63,"currencyFormat"),t()()()(),i(64,"div",115)(65,"span",14),n(66,"Total Payable Amou
1nt:"),t(),i(67,"span",113),n(68),_(69,"currencyFormat"),t()()()()),a&2){let e=p();l(8),m(" ",v(9,11,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,13,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,15,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,17,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,19,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,21,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,23,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,25,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(57,27,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(63,29,e.invoiceDetails==null?null:e.invoiceDetails.additional_charges_amount),""),l(6),m(" ",v(69,31,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),"")}}function M3(a,d){if(a&1&&(i(0,"div")(1,"div",110)(2,"div",44)(3,"ul",111)(4,"li",112)(5,"b",14),n(6,"Gross Total:"),t(),i(7,"span",113),n(8),_(9,"currencyFormat"),t()(),i(10,"li",112)(11,"b",14),n(12,"Discount:"),t(),i(13,"span",116),n(14),_(15,"currencyFormat"),t()(),i(16,"li",112)(17,"b",14),n(18,"Net Total:"),t(),i(19,"span",113),n(20),_(21,"currencyFormat"),t()(),i(22,"li",114)(23,"span",14),n(24,"SGST:"),t(),i(25,"span",113),n(26),_(27,"currencyFormat"),t()(),i(28,"li",114)(29,"span",14),n(30,"CGST:"),t(),i(31,"span",113),n(32),_(33,"currencyFormat"),t()(),i(34,"li",114)(35,"span",14),n(36,"IGST:"),t(),i(37,"span",113),n(38),_(39,"currencyFormat"),t()(),i(40,"li",112)(41,"b",14),n(42,"Total Tax Amount:"),t(),i(43,"span",113),n(44),_(45,"currencyFormat"),t()(),i(46,"li",112)(47,"b",14),n(48,"Logistics:"),t(),i(49,"span",113),n(50),_(51,"currencyFormat"),t()(),i(52,"li",112)(53,"b",14),n(54,"Insurance:"),t(),i(55,"span",113),n(56),_(57,"currencyFormat"),t()(),i(58,"li",112)(59,"b",14),n(60,"Additional Charges:"),t(),i(61,"span",113),n(62),_(63,"currencyFormat"),t()()()(),i(64,"div",115)(65,"span",14),n(66,"Total Payable Amount:"),t(),i(67,"span",113),n(68),_(69,"currencyFormat"),t()()()()),a&2){let e=p();l(8),m(" ",v(9,11,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,13,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,15,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,17,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,19,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,21,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,23,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,25,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(57,27,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(63,29,e.invoiceDetails==null?null:e.invoiceDetails.additional_charges_amount),""),l(6),m(" ",v(69,31,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),"")}}var za=(()=>{class a{constructor(e,o,r,c){this.notificationService=e,this.activatedRoute=o,this.router=r,this.financeOrderService=c,this.isLoading=!1,this.additionalDocs=[],this.isPrintLoading=!1}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}openPathInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openPathInNewTab("/rfq/buyer/rfq-details/"+o):e==="auction"&&this.openPathInNewTab("/buyer-auction/buyer-auction-details/"+(this.invoiceDetails?.source_main_id||o)))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openPathInNewTab("/finance-management/payable-purchase-orders/view?id="+this.invoiceDetails.po_id)}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.GetInvoiceDetails()})}GetInvoiceDetails(){try{this.isLoading=!0;let e=new Vt;
1e.invoice_id=this.invoiceId,e.invoice_type=this.invoiceType,this.financeOrderService.GetInvoiceDetails(e).subscribe(o=>{console.log(o),this.invoiceDetails=o.response.data,this.invoiceDetails.buyer_address.filter(g=>g.addressType=="billing").forEach(g=>this.billingAddres=g),this.invoiceDetails.buyer_address.filter(g=>g.addressType=="shipping").forEach(g=>this.shippingAddrdres=g),this.additionalDocs=[];let r=g=>`${g.docName||""}|${g.filename||g.file_name||g.name||""}|${g.drive_path||g.path||g.viewPath||g.file_path||""}`,c=new Set;(this.invoiceDetails.additionalDocuments||[]).forEach(g=>{let h=r(g);if(c.has(h))return;c.add(h);let C=this.additionalDocs.findIndex(k=>k.collectionName===g.docName);C===-1?this.additionalDocs.push({collectionName:g.docName,docs:[g]}):this.additionalDocs[C].docs.push(g)}),this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get advanceDetails(){if(this.invoiceDetails&&this.invoiceDetails.receipts){let e=this.invoiceDetails.receipts.filter(o=>o.advance_payment==="yes");if(e.length)return e[0]}return{terms:"Not Available",amount:"0"}}printDocument(){this.isPrintLoading=!0,this.financeOrderService.printPdf("TAX_INVOICE",Number(this.invoiceId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(H),T(de),T(K),T(z))}}static{this.\u0275cmp=R({type:a,selectors:[["app-reject-invoice-view"]],decls:155,vars:45,consts:[["plainPoNumber",""],["plainSourceId",""],["noFiles",""],["prods",""],["popContent",""],[3,"isLoading"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"card-danger","mb-30"],[1,"fw-600","font-14","mb-0"],[1,"text-danger","d-inline"],[1,"col-md","col-12"],[1,"card","border-0"],[1,"card-body","p-2"],["appTranslate","",1,"fw-600"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["class","col-md-auto col-12",4,"ngIf"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"col-md-6"],[1,"card"],[1,"card-body"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],["appTranslateText",""],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],["class","mod-card mb-4 h-100",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[4,"ngSwitchCase"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["appTranslate","",1,"text-secondary"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["alt","your image",1,"doc-logo__img",3,"src"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"ri-bank-line"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["scope","col","a
1ppTranslate",""],["class","row w-100",4,"ngIf","ngIfElse"],[1,"row","w-100"],["class","col-auto",4,"ngFor","ngForOf"],[1,"col-auto"],["target","_blank",1,"card",3,"href"],[1,"list-inline","align-items-center","mb-0"],[1,"list-inline-item","theme-color","font-12","fw-600"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["appTranslate","",1,"text-muted","small"],["colspan","2"],["appTranslate","",1,"text-center","mb-0"],[1,"text-secondary","mb-1"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","5"],["colspan","2",1,"cell-300"],[1,"mod-card","mb-4","h-100"],[1,"font-12","text-secondary","mb-2"],[1,"list-inline","mb-0"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"card","totalCalculationCard","mb-4"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"mb-2","ml-2"],[1,"card-footer"],[1,"float-right","text-danger"]],template:function(o,r){if(o&1){let c=I();x(0,"app-loader",5),i(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"h2",11)(7,"a",12),x(8,"i",13),t(),i(9,"span",14),n(10,"Proforma Invoice"),t()()(),i(11,"div",15)(12,"button",16),S("click",function(){return b(c),y(r.printDocument())}),u(13,ZC,4,0,"span",17)(14,JC,6,0,"span",17),t()()()(),i(15,"div",8)(16,"div",18)(17,"div",19)(18,"h3",20)(19,"span",14),n(20,"Invoice ID:"),t(),n(21),t()(),i(22,"div",21)(23,"div",22)(24,"h4",23)(25,"span",14),n(26,"Remarks:"),t(),i(27,"p",24),n(28),t()()(),i(29,"div",7)(30,"div",25)(31,"div",26)(32,"div",27)(33,"p",28),n(34,"Shipping From :"),t(),i(35,"p",29)(36,"span",14),n(37,"Seller Name:"),t(),i(38,"span",30),n(39),t()(),i(40,"p",29)(41,"span",14),n(42,"GST No:"),t(),u(43,XC,2,1,"span",31)(44,e3,2,0,"span",32),t(),i(45,"p",29)(46,"span",14),n(47,"Seller Address:"),t(),i(48,"span",30),n(49),t()()()()(),u(50,i3,3,1,"div",33),t()()(),i(51,"div",18)(52,"div",19)(53,"h3",34),n(54,"Proforma Invoice"),t()(),i(55,"div",21)(56,"div",35)(57,"div",36)(58,"div",37),n(59,"Invoice Number"),t(),i(60,"div",38),n(61),t()(),i(62,"div",36)(63,"div",37),n(64,"PO No."),t(),i(65,"div",38),u(66,n3,2,1,"button",39)(67,a3,1,1,"ng-template",null,0,P),t()(),i(69,"div",36)(70,"div",37),n(71,"Source ID"),t(),i(72,"div",38),u(73,r3,2,1,"button",39)(74,l3,1,1,"ng-template",null,1,P),t()(),i(76,"div",36)(77,"div",37),n(78,"Invoice Date"),t(),i(79,"div",38),n(80),t()(),i(81,"div",36)(82,"div",37),n(83,"Invoice State/City"),t(),i(84,"div",38),n(85),t()(),u(86,o3,5,1,"div",40)(87,s3,5,1,"div",40),t()()(),u(88,d3,35,6,"div",41)(89,v3,16,2,"div",41),i(90,"div",18)(91,"div",19)(92,"h3",34),n(93,"Buyer Address"),t()(),i(94,"div",21)(95,"div",7)(96,"div",42)(97,"div",43)(98,"div",44)(99,"p",45),n(100,"Shipping Address : "),t(),u(101,g3,4,1,"p",46),i(102,"p",30),n(103),t()()()(),i(104,"div",42)(105,"div",43)(106,"div",44)(107,"p",45),n(108,"Billing Address : "),t(),u(109,f3,4,1,"p",46),i(110,"p",30),n(111),t(),i(112,"p",29)(113,"span",14),n(114,"GST No:"),t(),u(115,h3,2,1,"span",31)(116,x3,2,0,"span",32),t()()()()()()(),i(117,"div",18)(118,"div",47)(119,"h3",34),n(120,"Order Summary"),t()(),i(121,"div",48)(122,"div",49)(123,"table",50)(124,"thead",51)(125,"tr")(126,"th",14),n(127," Product Name"),t(),i(128,"th",14),n(129," Product ID"),t(),i(130,"th",14),n(131," Quantity"),t(),i(132,"th",52),n(133,"Quoted "),i(134,"small",14),n(135,"(Price per unit)"),t()(),i(136,"th",14),n(137," Discount"),t(),i(138,"th",14),n(139," Gross Total"),t(),i(140,"th",14),n(141," GST"),t(),i(142,"th",14),n(143," Total Payable"),t()()(),i(144,"tbody"),u(145,I3,31,20,"tr",53)(146,D3,12,4,"tr",17)(147,w3,2,1,"ng-container",17),t()()()()(),i(148,"div",54)(149,"div",55),u(150,O3,9,2,"div",56),t(),i(151,"div",57),u(152,k3,58,27,"div",58)(153,F3,70,33,"div",58)(154,M3,70,33,"div",58),t()()()()()}if(o&2){let c=w(68),g=w(75);s("isLoading",r.isLoading),l(12),s("disabled",r.isPrintLoading),l(
1),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(7),m(" ",r.invoiceDetails==null?null:r.invoiceDetails.invoice_id," "),l(7),m("",r.invoiceDetails!=null&&r.invoiceDetails.reason?r.invoiceDetails==null?null:r.invoiceDetails.reason:"-N/A-"," "),l(11),f(r.invoiceDetails==null||r.invoiceDetails.seller_details==null?null:r.invoiceDetails.seller_details.company_name),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.seller_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.seller_gst)),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(11),f(r.invoiceDetails==null?null:r.invoiceDetails.invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",c),l(7),s("ngIf",r.canOpenSource)("ngIfElse",g),l(7),f(r.invoiceDetails==null?null:r.invoiceDetails.proforma_created_date),l(5),f(r.shippingAddrdres==null?null:r.shippingAddrdres.region),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)==="rfq"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)==="rfq"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.payment_mode)!=="Cash"&&((r.invoiceDetails==null?null:r.invoiceDetails.bank_name)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_number)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_ifsc))),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required)==="yes"),l(12),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(6),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.gst),l(),s("ngIf",!(!(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null)&&r.invoiceDetails.buyerCompanyDetails.gst)),l(29),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.items),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!=="DirectBuy"&&+(r.advanceDetails==null?null:r.advanceDetails.amount)>0),l(),s("ngIf",!(+(r.advanceDetails==null?null:r.advanceDetails.amount)>0)),l(3),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.shipments)=="no"&&(r.invoiceDetails==null?null:r.invoiceDetails.instalments)=="no"),l(),s("ngSwitch",r.invoiceDetails==null?null:r.invoiceDetails.source),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy")}},dependencies:[J,W,pt,mt,Se,Z,De,L,vt,ae],styles:[".rfq-pages[_ngcontent-%COMP%] .card-danger[_ngcontent-%COMP%]{color:#1b1b1bde;background-color:#fff8f9;border:1px solid #f64e60;padding:15px;border-radius:8px}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]{color:#f64e60}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]:before{background-color:#ffe2e5;border-color:#f64e60;color:#f64e60}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.max-h-150px[_ngcontent-%COMP%]{max-height:150px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();
1function N3(a,d){a&1&&(i(0,"span"),x(1,"i",107),i(2,"span",16),n(3,"Print"),t()())}function V3(a,d){a&1&&(i(0,"span")(1,"div",108)(2,"span",109),n(3,"Loading..."),t()(),i(4,"span",16),n(5,"Printing..."),t()())}function B3(a,d){if(a&1){let e=I();i(0,"div",110)(1,"p",111)(2,"span")(3,"span",16),n(4,"The seller has requested a payment of"),t(),n(5),_(6,"currencyFormat"),x(7,"br"),i(8,"span",16),n(9,"Remarks:"),t(),n(10),t()(),i(11,"button",112),S("click",function(){b(e);let r=p();return y(r.onRequestPaymentClick())}),n(12," Pay Now "),t()()}if(a&2){let e=p();l(5),m(" ",v(6,2,e.paymentRequested.amount)," "),l(5),m(" ",e.paymentRequested.remarks,"")}}function R3(a,d){if(a&1){let e=I();i(0,"button",113),S("click",function(){b(e);let r=p();return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function L3(a,d){if(a&1&&n(0),a&2){let e=p();f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function q3(a,d){if(a&1){let e=I();i(0,"button",113),S("click",function(){b(e);let r=p();return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p();l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function G3(a,d){if(a&1&&n(0),a&2){let e=p();f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function U3(a,d){if(a&1&&(i(0,"div",26)(1,"div",27),n(2," Additional Services Documents "),t(),i(3,"div",28),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.service_documents_required," ")}}function j3(a,d){if(a&1&&(i(0,"div",26)(1,"div",27),n(2," Payment Mode "),t(),i(3,"div",28),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.payment_mode,"")}}function $3(a,d){if(a&1&&(i(0,"span",36),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.seller_gst)}}function z3(a,d){a&1&&(i(0,"span",114),n(1,"Not Available"),t())}function W3(a,d){if(a&1&&x(0,"img",115),a&2){let e=p();s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function Q3(a,d){if(a&1&&(i(0,"div",21)(1,"div",22)(2,"h3",23),n(3,"Company Bank Details"),t()(),i(4,"div",24)(5,"div",116)(6,"div",117)(7,"span",118),x(8,"i",119),t(),i(9,"div",120)(10,"h4",121),n(11),t(),i(12,"span",122),n(13),t()()(),i(14,"div",123)(15,"div",124)(16,"span",125),n(17,"Account Holder"),t(),i(18,"span",126),n(19),t()(),i(20,"div",124)(21,"span",125),n(22,"Account Number"),t(),i(23,"span",126),n(24),t()(),i(25,"div",124)(26,"span",125),n(27,"IFSC Code"),t(),i(28,"span",126),n(29),t()(),i(30,"div",124)(31,"span",125),n(32,"Branch"),t(),i(33,"span",126),n(34),t()()()()()()),a&2){let e=p();l(11),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_name),l(2),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch),l(6),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_name),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_number),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_ifsc),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch)}}function Y3(a,d){if(a&1&&(i(0,"p",127)(1,"span",34),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function H3(a,d){if(a&1&&(i(0,"p",127)(1,"span",34),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function K3(a,d){if(a&1&&(i(0,"span",36),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function Z3(a,d){a&1&&(i(0,"span",114),n(1,"Not Available"),t())}function J3(a,d){if(a&1&&(i(0,"span",134),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function X3(a,d){if(a&1&&(i(0,"span",134),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function e4(a,d){if(a&1&&(i(0,"span",134),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function t4(a,d){if(a&1&&(F(0),i(1,"div",131),n(2),t(),i(3,"p",132),u(4,J3,2,2,"span",133)(5,X3,2,2,"span",133)(6,e4,2,2,"span",133),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function i4(a,d){if(a&1&&(F(0),i(1,"div",131)(2,"div")(3,"p",135),n(4),_(5,"currencyFormat"),t(),i(6,"p",135),n(7),_(8,"currencyFormat"),t(),i(9,"p",135),n(10),_(11,"currencyFormat"),t(),i(12,"p",135),n(13),_(14,"currencyFormat"),t(),i(15,"p",135),n(16),_(17,"currencyFormat"),t(),i(18,"p",135),n(19),_(20,"currencyFormat"),t(),i(21,"p",135),n(22),_(23,"currencyFormat"),t(),i(24,"p",135),n(25),_(26,"currencyFormat"),t(),i(27,"p",135),n(28),_(29,"currencyFormat"),t(),x(30,"div",136),i(31,"p",127)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function n4(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",128),n(3),t(),u(4,t4,7,4,"ng-template",null,3,P),x(6,"i",129),i(7,"p",130)(8,"small")(9,"span",16),n(10,"SKU ID:"),t(),n(11),t()()(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),i(17,"small",16),n(18,"/unit"),t()(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),t(),i(28,"td"),n(29),_(30,"currencyFormat"),u(31,i4,35,34,"ng-template",null,4,P),x(33,"i",129),t()()),a&2){let e=d.$implicit,o=w(5),r=w(32);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(5),m(" ",e.display_item_id,""),l(2),f(e.required_qty),l(2),m("",v(16,10,e.unit_price)," "),l(5),f(v(21,12,e.discount)),l(3),f(v(24,14,e.gross_total)),l(3),f(v(27,16,e.gst)),l(3),m(" ",v(30,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function a4(a,d){if(a&1&&(i(0,"tr")(1,"td",137)(2,"span",16),n(3,"Advance Note: "),t(),i(4,"b"),n(5),t()(),i(6,"td",138)(7,"p")(8,"span",16),n(9,"Advance Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()()),a&2){let e=p();l(5),f(e.advanceDetails.terms),l(6),f(v(12,2,e.advanceDetails.amount))}}function r4(a,d){if(a&1&&(i(0,"div",144)(1,"a",145)(2,"div",33)(3,"ul",146)(4,"li",147),x(5,"i",148),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(5),m(" ",e.name," ")}}function l4(a,d){if(a&1&&(i(0,"div",142),u(1,r4,7,2,"div",143),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.docs)}}function o4(a,d){a&1&&(i(0,"span",149),n(1," No files uploaded "),t())}function s4(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),u(4,l4,2,1,"div",141)(5,o4,2,0,"ng-template",null,5,P),t()()),a&2){let e=d.$implicit,o=w(6);l(2),m(" ",e.collectionName," "),l(2),s("ngIf",e.docs.length>0)("ngIfElse",o)}}function d4(a,d){a&1&&(i(0,"tr")(1,"td",150)(2,"p",151),n(3,"No documents available"),t()()())}function c4(a,d){if(a&1&&(i(0,"div",21)(1,"div",49)(2,"h3",23),n(3,"Additional Services Documents"),t()(),i(4,"div",50)(5,"div",139)(6,"table",52)(7,"thead",53)(8,"tr")(9,"th",140),n(10,"Document Name"),t(),i(11,"th",140),n(12,"Files"),t()()(),i(13,"tbody"),u(14,s4,7,3,"tr",55)(15,d4,4,0,"tr",19),t()()()()()),a&2){let e=p();l(14),s("ngForOf",e.additionalDocs),l(),s("ngIf",!e.additionalDocs.length)}}function p4(a,d){if(a&1){let e=I();i(0,"a",169),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function m4(a,d){if(a&1){let e=I();i(0,"a",169),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function u4(a,d){if(a&1&&(i(0,"div")(1,"p",167)(2,"b",16),n(3,"Note:"),t(),n(4),t(),u(5,p4,2,0,"a",168)(6,m4,2,0,"a",168),t()),a&2){let e=p().$implicit;l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded&&e.note.length>120),l(),s("ngIf",e._expanded)}}function _4(a,d){if(a&1&&(i(0,"div",160)(1,"div",46)(2,"div",161)(3,"div",162)(4,"h6",163),n(5),t(),i(6,"small",164)(7,"span",16),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",165)(12,"h6",166),n(13),_(14,"currencyFormat"),t()()(),u(15,u4,7,5,"div",19),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%)"),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function v4(a,d){if(a&1&&(i(0,"div",154)(1,"div",155)(2,"div",156)(3,"a",157),n(4,"Payment Terms"),t()(),i(5,"div",158)(6,"div",46),u(7,_4,16,10,"div",159),t()()()()),a&2){let e=p(2);l(7),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.payment_terms)}}function g4(a,d){if(a&1&&(i(0,"div",179)(1,"div",180)(2,"div",176)(3,"h6",181),n(4),t(),i(5,"small",164)(6,"span",16),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",182)(10,"small",183),n(11,"Quantity"),t(),i(12,"h6",184),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function f4(a,d){if(a&1&&(i(0,"div",174)(1,"div",175)(2,"div",161)(3,"div",176)(4,"h6",177),n(5),t(),i(6,"small",164)(7,"span",16),n(8,"Timeline:"),t(),n(9),t()()()(),u(10,g4,14,3,"div",178),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," day(s)"),l(),s("ngForOf",e.products)}}function h4(a,d){if(a&1&&(i(0,"div",170)(1,"div",155)(2,"div",171)(3,"a",157),n(4,"Shipment Terms"),t()(),i(5,"div",172),u(6,f4,11,3,"div",173),t()()()),a&2){let e=p(2);l(6),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.shipment_terms)}}function x4(a,d){if(a&1&&(i(0,"div",21)(1,"div",22)(2,"h3",23),n(3,"Order Terms & Fulfillment"),t()(),i(4,"div",24)(5,"div",9),u(6,v4,8,1,"div",152)(7,h4,7,1,"div",153),t()()()),a&2){let e=p();l(6),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_shipment_terms)==="YES")}}function b4(a,d){a&1&&(i(0,"li")(1,"p",190),n(2," No attachments available"),t()())}function y4(a,d){if(a&1&&(i(0,"li",191)(1,"a",192),x(2,"i",148),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.drive_path,q),l(2),m(" ",e.filename," ")}}function S4(a,d){if(a&1&&(i(0,"div",185)(1,"div",22)(2,"h3",23),n(3,"Terms & Conditions"),t()(),i(4,"div",24)(5,"div",186)(6,"p",187),n(7),t()(),i(8,"div",186)(9,"label",34),n(10,"Attachments"),t(),i(11,"ul",188),u(12,b4,3,0,"li",19)(13,y4,4,2,"li",189),t()()()()),a&2){let e=p();l(7),f(e.invoiceDetails!=null&&e.invoiceDetails.terms?e.invoiceDetails.terms:"No terms provided."),l(5),s("ngIf",!(e.invoiceDetails!=null&&e.invoiceDetails.detail_seller_terms_and_conditions_path)||(e.invoiceDetails==null?null:e.invoiceDetails.detail_seller_terms_and_conditions_path.length)===0),l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.detail_seller_terms_and_conditions_path)}}function C4(a,d){if(a&1&&(i(0,"li",210)(1,"b"),n(2),_(3,"plainDateTime"),t(),i(4,"h6",53)(5,"span",16),n(6,"Amount:"),t(),n(7),_(8,"currencyFormat"),t(),i(9,"p")(10,"span",16),n(11,"Mode"),t(),n(12),x(13,"br"),i(14,"span",16),n(15,"Status"),t(),n(16),t()()),a&2){let e=d.$implicit;l(2),f(U(3,4,e==null?null:e.txn_time,"DD-MM-YYYY hh:mm A")),l(5),m(" ",v(8,7,e==null?null:e.amount)," "),l(5),m(" : ",e==null?null:e.payment_mode," "),l(4),m(": ",e==null?null:e.buyer_status," ")}}function E4(a,d){if(a&1){let e=I();i(0,"div",201)(1,"div",202)(2,"a",203),S("click",function(){b(e);let r=p(2);return y(r.togglePaymentHistory())}),x(3,"i",204),i(4,"span",16),n(5,"Payment History"),t(),x(6,"span",205),t()(),i(7,"div",206)(8,"div",207)(9,"ul",208),u(10,C4,17,9,"li",209),t()()()()}if(a&2){let e=p(2);l(2),Be("aria-expanded",e.isPaymentHistoryExpanded),l(4),re("uil-angle-up",e.isPaymentHistoryExpanded)("uil-angle-down",!e.isPaymentHistoryExpanded),l(4),s("ngForOf",e.paymentHistory)}}function I4(a,d){if(a&1&&(i(0,"div",193)(1,"div",194)(2,"div",46)(3,"ul",195)(4,"li",196)(5,"b",16),n(6,"Total Bid Value :"),t(),i(7,"span",197),n(8),_(9,"currencyFormat"),t()(),i(10,"li",198)(11,"span",16),n(12,"SGST:"),t(),i(13,"span",197),n(14),_(15,"currencyFormat"),t()(),i(16,"li",198)(17,"span",16),n(18,"CGST:"),t(),i(19,"span",197),n(20),_(21,"currencyFormat"),t()(),i(22,"li",198)(23,"span",16),n(24,"IGST: "),t(),i(25,"span",197),n(26
1),_(27,"currencyFormat"),t()(),i(28,"li",196)(29,"b",16),n(30,"Total Tax Amount:"),t(),i(31,"span",197),n(32),_(33,"currencyFormat"),t()(),i(34,"li",196)(35,"b",16),n(36,"Logistics:"),t(),i(37,"span",197),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",199)(41,"span",16),n(42,"Total Payable Amount:"),t(),i(43,"span",197),n(44),_(45,"currencyFormat"),t()()(),u(46,E4,11,6,"div",200),t()),a&2){let e=p();l(8),m(" ",v(9,8,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m(" ",v(15,10,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(21,12,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(27,14,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(33,16,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(39,18,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(45,20,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),""),l(2),s("ngIf",e.paymentHistory==null?null:e.paymentHistory.length)}}function D4(a,d){if(a&1&&(i(0,"li",215)(1,"b"),n(2),_(3,"plainDateTime"),t(),i(4,"h6",53)(5,"span",16),n(6,"Amount:"),t(),n(7),_(8,"currencyFormat"),t(),i(9,"p")(10,"span",16),n(11,"Mode"),t(),n(12),x(13,"br"),i(14,"span",16),n(15,"Status"),t(),n(16),t()()),a&2){let e=d.$implicit;l(2),f(U(3,4,e==null?null:e.txn_time,"DD-MM-YYYY hh:mm A")),l(5),m(" ",v(8,7,e==null?null:e.amount)," "),l(5),m(" : ",e==null?null:e.payment_mode," "),l(4),m(": ",e==null?null:e.buyer_status," ")}}function T4(a,d){if(a&1){let e=I();i(0,"div",201)(1,"div",202)(2,"a",203),S("click",function(){b(e);let r=p(2);return y(r.togglePaymentHistory())}),x(3,"i",204),i(4,"span",16),n(5,"Payment History"),t(),x(6,"span",205),t()(),i(7,"div",206)(8,"div",213)(9,"ul",208),u(10,D4,17,9,"li",214),t()()()()}if(a&2){let e=p(2);l(2),Be("aria-expanded",e.isPaymentHistoryExpanded),l(4),re("uil-angle-up",e.isPaymentHistoryExpanded)("uil-angle-down",!e.isPaymentHistoryExpanded),l(4),s("ngForOf",e.paymentHistory)}}function w4(a,d){if(a&1&&(i(0,"div",193)(1,"div",194)(2,"div",46)(3,"ul",195)(4,"li",196)(5,"b",16),n(6,"Gross Total:"),t(),i(7,"span",197),n(8),_(9,"currencyFormat"),t()(),i(10,"li",196)(11,"b",16),n(12,"Discount:"),t(),i(13,"span",211),n(14),_(15,"currencyFormat"),t()(),i(16,"li",196)(17,"b",16),n(18,"Net Total:"),t(),i(19,"span",197),n(20),_(21,"currencyFormat"),t()(),i(22,"li",198)(23,"span",16),n(24,"SGST:"),t(),i(25,"span",197),n(26),_(27,"currencyFormat"),t()(),i(28,"li",198)(29,"span",16),n(30,"CGST:"),t(),i(31,"span",197),n(32),_(33,"currencyFormat"),t()(),i(34,"li",198)(35,"span",16),n(36,"IGST:"),t(),i(37,"span",197),n(38),_(39,"currencyFormat"),t()(),i(40,"li",196)(41,"b",16),n(42,"Total Tax Amount:"),t(),i(43,"span",197),n(44),_(45,"currencyFormat"),t()(),i(46,"li",196)(47,"b",16),n(48,"Logistics:"),t(),i(49,"span",197),n(50),_(51,"currencyFormat"),t()(),i(52,"li",196)(53,"b",16),n(54,"Insurance:"),t(),i(55,"span",197),n(56),_(57,"currencyFormat"),t()(),i(58,"li",196)(59,"b",16),n(60,"Total Payable Amount:"),t(),i(61,"span",197),n(62),_(63,"currencyFormat"),t()(),i(64,"li",212)(65,"b",16),n(66,"Remaining Amount:"),t(),i(67,"span",197),n(68),_(69,"currencyFormat"),t()()()(),i(70,"div",199)(71,"span",16),n(72,"Balance Payable Amount:"),t(),i(73,"span",197),n(74),_(75,"currencyFormat"),t()()(),u(76,T4,11,6,"div",200),t()),a&2){let e=p();l(8),m(" ",v(9,13,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,15,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,17,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,19,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,21,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,23,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,25,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,27,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(57,29,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(63,31,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),""),l(6),m(" ",v(69,33,e.invoiceDetails==null?null:e.invoiceDetails.balance_amount),""),l(6),m(" ",v(75,35,e.invoiceDetails==null?null:e.invoiceDetails.balance_amount),""),l(2),s("ngIf",e.paymentHistory==null?null:e.paymentHistory.length)}}function P4(a,d){a&1&&(i(0,"button",216),n(1," View Tax Invoices "),t())}function O4(a,d){if(a&1){let e=I();i(0,"button",217),S("click",function(){b(e);let r=p();return y(r.onPayNowClick())}),n(1,"Pay Now"),t()}}function k4(a,d){if(a&1&&(i(0,"div",218)(1,"span",16),n(2,"Amount cannot exceed the remaining payable amount"),t(),n(3),_(4,"currencyFormat"),t()),a&2){let e=p();l(3),m(" (",v(4,1,e.invoiceDetails==null?null:e.invoiceDetails.balance_amount),") ")}}
1function F4(a,d){a&1&&(i(0,"div",219),n(1," Transaction time cannot be in the future "),t())}function M4(a,d){if(a&1){let e=I();i(0,"p",220),n(1),i(2,"span",221)(3,"a",222),x(4,"i",223),t(),i(5,"span",224),S("click",function(){let r=b(e).index,c=p();return y(c.removeFile(r))}),n(6,"X"),t()()()}if(a&2){let e=d.$implicit;l(),m(" ",e.name," "),l(2),s("href",e.viewPath,q)}}function A4(a,d){if(a&1){let e=I();i(0,"button",225),S("click",function(){b(e);let r=p();return y(r.OnClickPaymentMake())}),n(1," Make Payment "),t()}}function N4(a,d){a&1&&x(0,"span",228)}function V4(a,d){if(a&1){let e=I();i(0,"button",226),S("click",function(){b(e);let r=p();return y(r.OnClickPaymentMake())}),u(1,N4,1,0,"span",227),i(2,"span",16),n(3,"Add Payment"),t()()}if(a&2){let e=p();s("disabled",e.isLoading),l(),s("ngIf",e.isLoading)}}function B4(a,d){a&1&&(i(0,"div",10)(1,"p",229),n(2," No Invoices Found "),t()())}function R4(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),_(7,"date"),t(),x(8,"td"),i(9,"td",232)(10,"button",233),S("click",function(){let r=b(e).$implicit,c=p(2);return y(c.OnClickViewInvoice(r.invoice_id))}),i(11,"span",16),n(12,"View Tax Invoice"),t(),x(13,"i",234),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.invoice_number),l(2),f(e.po_number),l(2),f(v(7,3,e.created_date))}}function L4(a,d){if(a&1&&(i(0,"div",230)(1,"table",231)(2,"thead",53)(3,"tr")(4,"th",16),n(5,"Invoice Id"),t(),i(6,"th",16),n(7,"PO Id"),t(),i(8,"th",16),n(9,"Created On"),t(),i(10,"th"),n(11,"\xA0"),t(),i(12,"th"),n(13,"\xA0"),t()()(),i(14,"tbody"),u(15,R4,14,5,"tr",55),t()()()),a&2){let e=p();l(15),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.invoices)}}function q4(a,d){if(a&1&&x(0,"img",115),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function G4(a,d){if(a&1&&(i(0,"span",36),n(1),t()),a&2){let e=p(3);l(),f(e.invoiceDetails==null?null:e.invoiceDetails.seller_gst)}}function U4(a,d){a&1&&(i(0,"span",114),n(1,"Not Available"),t())}function j4(a,d){if(a&1&&(i(0,"div",32)(1,"div",33)(2,"p",34),n(3,"Shipping From :"),t(),i(4,"p",35)(5,"span",16),n(6,"Seller Name:"),t(),i(7,"span",36),n(8),t()(),i(9,"p",35)(10,"span",16),n(11,"GST No:"),t(),u(12,G4,2,1,"span",37)(13,U4,2,0,"span",38),t(),i(14,"p",35)(15,"span",16),n(16,"Seller Address:"),t(),i(17,"span",36),n(18),t()()()()),a&2){let e=p(2);l(8),f(e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.firstname),l(4),s("ngIf",e.invoiceDetails==null?null:e.invoiceDetails.seller_gst),l(),s("ngIf",!(e.invoiceDetails!=null&&e.invoiceDetails.seller_gst)),l(5),se(" ",e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.street,", ",e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.region," ",e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.city,", ",e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.postcode,"")}}function $4(a,d){if(a&1){let e=I();i(0,"button",113),S("click",function(){b(e);let r=p(2);return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p(2);l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function z4(a,d){if(a&1&&n(0),a&2){let e=p(2);f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function W4(a,d){if(a&1){let e=I();i(0,"button",113),S("click",function(){b(e);let r=p(2);return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p(2);l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function Q4(a,d){if(a&1&&n(0),a&2){let e=p(2);f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function Y4(a,d){if(a&1&&(i(0,"p",127)(1,"span",34),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function H4(a,d){if(a&1&&(i(0,"p",127)(1,"span",34),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function K4(a,d){if(a&1&&(i(0,"span",36),n(1),t()),a&2){let e=p(2);l(),f(e.invoiceDetails==null?null:e.invoiceDetails.buyer_gst)}}function Z4(a,d){a&1&&(i(0,"span",114),n(1,"Not Available"),t())}function J4(a,d){a&1&&(i(0,"thead",53)(1,"tr")(2,"th",16),n(3," Product Name"),t(),i(4,"th",16),n(5," Quantity"),t(),i(6,"th",16),n(7,"Quoted"),t(),i(8,"th",16),n(9," Discount"),t(),i(10,"th",16),n(11," Gross Total"),t(),i(12,"th",16),n(13," GST"),t(),i(14,"th",16),n(15," Net Payable"),t()()())}function X4(a,d){a&1&&(i(0,"thead",53)(1,"tr")(2,"th",16),n(3,"Product ID"),t(),i(4,"th",16),n(5," Product Name"),t(),i(6,"th",16),n(7," Quantity"),t(),i(8,"th",16),n(9," Bid Total Value"),t(),i(10,"th",16),n(11,"Logistics "),t(),i(12,"th",16),n(13,"Tax"),t(),i(14,"th",16),n(15,"Net Payable"),t()()())}function eE(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),_(7,"currencyFormat"),i(8,"small",16),n(9,"/unit"),t()(),i(10,"td"),n(11),_(12,"currencyFormat"),t(),i(13,"td"),n(14),_(15,"currencyFormat"),t(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t()()),a&2){let e=d.$implicit;l(2),m(" ",e.product_name," "),l(2),m("",e.offered_qty," "),l(2),m("",v(7,7,e.unit_price)," "),l(5),f(v(12,9,e.discount)),l(3),f(v(15,11,e.gross_total)),l(3),f(v(18,13,e.gst)),l(3),m(" ",v(21,15,e.total_amount)," ")}}function tE(a,d){if(a&1&&(i(0,"tbody"),u(1,eE,22,17,"tr",55),i(2,"tr")(3,"td",137)(4,"span",16),n(5,"Advance Note:"),t(),i(6,"b"),n(7),t()(),i(8,"td",150)(9,"p")(10,"span",16),n(11,"Advance Amount:"),t(),i(12,"b"),n(13),_(14,"currencyFormat"),t()()()()()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(6),f(e.advanceDetails.terms),l(6),f(v(14,3,e.advanceDetails.amount))}}function iE(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),t()()),a&2){let e=d.$implicit;l(2),m(" ",e.display_item_id,""),l(2),m(" ",e.product_name," "),l(2),m("",e.required_qty," "),l(2),m("\u20B9 ",e.gross_total,""),l(2),m("\u20B9 ",e.logistics_charges,""),l(2),m("\u20B9 ",e.gst,""),l(2),m(" \u20B9 ",e.net_amount," ")}}function nE(a,d){if(a&1&&(i(0,"tbody"),u(1,iE,15,7,"tr",55),i(2,"tr")(3,"td",250)(4,"span",16),n(5,"Advance Note:"),t(),n(6),t(),i(7,"td",251)(8,"p")(9,"span",16),n(10,"Advance Amount:"),t(),n(11),t()()()()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(5),m(" ",!(e.invoiceDetails==null||e.invoiceDetails.installments==null)&&e.invoiceDetails.installments.terms?e.invoiceDetails==null?null:e.invoiceDetails.installments[0].terms:"Not Available",""),l(5),m(" ",!(e.invoiceDetails==null||e.invoiceDetails.installments==null)&&e.invoiceDetails.installments.amount?e.invoiceDetails==null?null:e.invoiceDetails.installments[0].amount:0," ")}}function aE(a,d){if(a&1&&(i(0,"div",252)(1,"div",253)(2,"div",46)(3,"ul",195)(4,"li",196)(5,"b",16),n(6,"Gross Total:"),t(),i(7,"span",197),n(8),_(9,"currencyFormat"),t()(),i(10,"li",196)(11,"b",16),n(12,"Discount:"),t(),i(13,"span",211),n(14),_(15,"currencyFormat"),t()(),i(16,"li",196)(17,"b",16),n(18,"Net Total:"),t(),i(19,"span",197),n(20),_(21,"currencyFormat"),t()(),i(22,"li",198)(23,"span",16),n(24,"SGST:"),t(),i(25,"span",197),n(26
vendor: 6,266 bytes, line 1
1),_(27,"currencyFormat"),t()(),i(28,"li",198)(29,"span",16),n(30,"CGST:"),t(),i(31,"span",197),n(32),_(33,"currencyFormat"),t()(),i(34,"li",198)(35,"span",16),n(36,"IGST:"),t(),i(37,"span",197),n(38),_(39,"currencyFormat"),t()(),i(40,"li",196)(41,"b",16),n(42,"Total Tax Amount:"),t(),i(43,"span",197),n(44),_(45,"currencyFormat"),t()(),i(46,"li",196)(47,"b",16),n(48,"Logistics:"),t(),i(49,"span",197),n(50),_(51,"currencyFormat"),t()(),i(52,"li",196)(53,"b",16),n(54,"Insurance:"),t(),i(55,"span",197),n(56),_(57,"currencyFormat"),t()(),i(58,"li",196)(59,"b",16),n(60,"Total Payable Amount:"),t(),i(61,"span",197),n(62),_(63,"currencyFormat"),t()(),i(64,"li",212)(65,"b",16),n(66,"Remaining Amount:"),t(),i(67,"span",197),n(68),_(69,"currencyFormat"),t()()()(),i(70,"div",199)(71,"span",16),n(72,"Balance Payable Amount:"),t(),i(73,"span",197),n(74),_(75,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,12,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,14,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,16,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,18,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,20,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,22,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,24,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,26,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(57,28,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(63,30,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),""),l(6),m(" ",v(69,32,e.invoiceDetails==null?null:e.invoiceDetails.balance_amount),""),l(6),m(" ",v(75,34,e.invoiceDetails==null?null:e.invoiceDetails.balance_amount),"")}}function rE(a,d){if(a&1&&(i(0,"div",252)(1,"div",253)(2,"div",46)(3,"ul",195)(4,"li",196)(5,"b",16),n(6,"Total Bid Value :"),t(),i(7,"span",197),n(8),_(9,"currencyFormat"),t()(),i(10,"li",198)(11,"span",16),n(12,"SGST:"),t(),i(13,"span",197),n(14),_(15,"currencyFormat"),t()(),i(16,"li",198)(17,"span",16),n(18,"CGST:"),t(),i(19,"span",197),n(20),_(21,"currencyFormat"),t()(),i(22,"li",198)(23,"span",16),n(24,"IGST:"),t(),i(25,"span",197),n(26),_(27,"currencyFormat"),t()(),i(28,"li",196)(29,"b",16),n(30,"Total Tax Amount:"),t(),i(31,"span",197),n(32),_(33,"currencyFormat"),t()(),i(34,"li",196)(35,"b",16),n(36,"Logistics:"),t(),i(37,"span",197),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",199)(41,"span",16),n(42,"Total Payable Amount:"),t(),i(43,"span",197),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,7,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m(" ",v(15,9,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(21,11,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(27,13,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(33,15,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(39,17,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(45,19,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),"")}}function lE(a,d){if(a&1&&(i(0,"div",235)(1,"div",9)(2,"div",10)(3,"div",21)(4,"div",24)(5,"div",236)(6,"div",237),u(7,q4,1,1,"img",41),t(),i(8,"div",238)(9,"h2",16),n(10,"Proforma Invoice"),t(),i(11,"div")(12,"h6",239)(13,"span",16),n(14,"Invoice ID:"),t(),n(15),t()()()(),i(16,"div",9)(17,"div",240),u(18,j4,19,7,"div",241),t()()()(),i(19,"div",21)(20,"div",22)(21,"h3",23),n(22,"Company Bank Details"),t()(),i(23,"div",24)(24,"div",116)(25,"div",117)(26,"span",118),x(27,"i",119),t(),i(28,"div",120)(29,"h4",121),n(30),t(),i(31,"span",122),n(32),t()()(),i(33,"div",123)(34,"div",124)(35,"span",125),n(36,"Account Holder"),t(),i(37,"span",126),n(38),t()(),i(39,"div",124)(40,"span",125),n(41,"Account Number"),t(),i(42,"span",126),n(43),t()(),i(44,"div",124)(45,"span",125),n(46,"IFSC Code"),t(),i(47,"span",126),n(48),t()(),i(49,"div",124)(50,"span",125),n(51,"Branch"),t(),i(52,"span",126),n(53),t()()()()()(),i(54,"div",21)(55,"div",22)(56,"h3",23),n(57,"Proforma Invoice"),t()(),i(58,"div",24)(59,"div",25)(60,"div",26)(61,"div",27),n(62,"Invoice Number"),t(),i(63,"div",28),n(64),t()(),i(65,"div",26)(66,"div",27),n(67,"PO No."),t(),i(68,"div",28),u(69,$4,2,1,"button",29)(70,z4,1,1,"ng-template",null,6,P),t()(),i(72,"div",26)(73,"div",27),n(74,"Source ID"),t(),i(75,"div",28),u(76,W4,2,1,"button",29)(77,Q4,1,1,"ng-template",null,7,P),t()(),i(79,"div",26)(80,"div",27),n(81,"Invoice Date"),t(),i(82,"div",28),n(83),_(84,"date"),t()(),i(85,"div",26)(86,"div",27),n(87,"Additional Services Documents "),t(),i(88,"div",28),n(89),t()(),i(90,"div",26)(91,"div",27),n(92,"Invoice State/City"),t(),i(93,"div",28),n(94),t()(),i(95,"div",26)(96,"div",27),n(97,"Payment Terms"),t(),i(98,"div",28),n(99),t()()()()(),i(100,"div",21)(101,"div",22)(102,"h3",23),n(103,"Buyer Address"),t()(),i(104,"div",24)(105,"div",43)(106,"div",237)(107,"div",45)(108,"div",46)(109,"p",47),n(110,"Shipping Address : "),t(),u(111,Y4,4,1,"p",48),i(112,"p",36),n(113),t()()()(),i(114,"div",237)(115,"div",45)(116,"div",46)(117,"p",47),n(118,"Billing Address : "),t(),u(119,H4,4,1,"p",48),i(120,"p",36),n(121),t(),i(122,"p",35)(123,"span",16),n(124,"GST No:"),t(),u(125,K4,2,1,"span",37)(126,Z4,2,0,"span",38),t()()()()()()(),i(127,"div",21)(128,"div",22)(129,"h3",23),n(130,"Order Summary"),t()(),i(131,"div",24)(132,"div",242)(133,"div",243)(134,"table",52),u(135,J4,16,0,"thead",244)(136,X4,16,0,"thead",244)(137,tE,15,5,"tbody",19)(138,nE,12,3,"tbody",19),t()()()()(),i(139,"div",245),x(140,"div",77),u(141,aE,76,36,"div",246)(142,rE,46,21,"div",246),t(),x(143,"div",247),i(144,"div",21)(145,"div",22)(146,"h3",23),n(147,"Terms & Conditions"),t()(),i(148,"div",24)(149,"div",248)(150,"p",187),n(151),t()()()(),i(152,"div",9)(153,"div",10)(154,"div",10)(155,"p",249),n(156,"This is a system generated invoice, no signature is required."),t()()()()()()()),a&2){let e=w(71),o=w(78),r=p();l(7),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(8),m(" ",r.invoiceDetails==null?null:r.
1invoiceDetails.invoice_id,""),l(3),s("ngIf",r.invoiceDetails.seller_address),l(12),f(r.invoiceDetails==null?null:r.invoiceDetails.bank_name),l(2),f(r.invoiceDetails==null?null:r.invoiceDetails.bank_branch),l(6),f(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_name),l(5),f(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_number),l(5),f(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_ifsc),l(5),f(r.invoiceDetails==null?null:r.invoiceDetails.bank_branch),l(11),f(r.invoiceDetails==null?null:r.invoiceDetails.invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",e),l(7),s("ngIf",r.canOpenSource)("ngIfElse",o),l(7),f(U(84,37,r.invoiceDetails==null?null:r.invoiceDetails.cdate,"dd-MM-yyyy")),l(6),m("",r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required," "),l(5),f(r.shippingAddrdres==null?null:r.shippingAddrdres.region),l(5),f(r.invoiceDetails==null?null:r.invoiceDetails.payment_mode),l(12),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(6),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.buyer_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.buyer_gst)),l(9),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!=="auction"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)=="auction"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!="auction"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)=="auction"),l(3),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!="auction"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)=="auction"),l(9),m(" ",r.invoiceDetails==null?null:r.invoiceDetails.terms," ")}}var Wa=(()=>{class a{constructor(e,o,r,c){this.router=e,this.activatedRoute=o,this.financeOrderService=r,this.notificationService=c,this.manualInvoiceFiles=[],this.isPrintLoading=!1,this.current=!0,this.total=!1,this.manual=!1,this.isLoading=!1,this.additionalDocs=[],this.paymentHistory=[],this.isPaymentHistoryExpanded=!1,this.paymentRequested={display:!1,amount:0,remarks:""};let g=new Date;this.currentDate=this.formatDateTimeLocal(g)}formatDateTimeLocal(e){let o=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0"),g=String(e.getHours()).padStart(2,"0"),h=String(e.getMinutes()).padStart(2,"0");return`${o}-${r}-${c}T${g}:${h}`}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{let o=e.invoiceId!==this.invoiceId||e.invoiceType!==this.invoiceType;this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,o&&this.GetInvoiceDetails()}),this.financeOrderService.GetProfileData().subscribe(e=>{console.log(e.response.data.email),this.customerProfile=e.response}),this.commercePage=window.location.href,this.locationPath=this.commercePage.substring(0,this.commercePage.indexOf("/po-make-payemnt?invoiceId=24&invoiceType=parent"))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openInNewTab("/finance-management/payable-purchase-orders/view?id="+this.invoiceDetails.po_id)}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openInNewTab("/rfq/buyer/rfq-details/"+o):e==="auction"&&this.openInNewTab("/buyer-auction/buyer-auction-detail
1s/"+(this.invoiceDetails?.source_main_id||o)))}OnClickViewInvoice(e){let o=this.router.serializeUrl(this.router.createUrlTree(["finance-management/payable-invoices/view"],{queryParams:{invoiceId:e,invoiceType:"child"}}));this.openInNewTab(o)}openInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}printInvoice(){this.isPrintLoading=!0;let e=this.invoiceType==="child"?"TAX_INVOICE":"PROFORMA_INVOICE";this.financeOrderService.printPdf(e,Number(this.invoiceId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1,this.notificationService.showError("Failed to generate print document.")}})}GetInvoiceDetails(){let e=new Vt;e.invoice_id=this.invoiceId,e.invoice_type=this.invoiceType,this.financeOrderService.GetInvoiceDetails(e).subscribe(o=>{console.log(o),this.invoiceDetails=o.response.data,this.invoiceDetails.buyer_address.filter(h=>h.addressType=="billing").forEach(h=>this.billingAddres=h),this.invoiceDetails.buyer_address.filter(h=>h.addressType=="shipping").forEach(h=>this.shippingAddrdres=h);let r=this.invoiceDetails.items||[];(this.invoiceDetails.shipment_terms||[]).forEach(h=>{(h.products||[]).forEach(C=>{let k=r.find(O=>C.po_item_id&&Number(O.item_id)===Number(C.po_item_id)||C.product_id&&Number(O.product_id)===Number(C.product_id));k&&(C.product_name=C.product_name||k.product_name,C.sku=C.sku||k.sku||k.display_item_id)})}),this.additionalDocs=[];let c=h=>`${h.docName||""}|${h.filename||h.file_name||h.name||""}|${h.drive_path||h.path||h.viewPath||h.file_path||""}`,g=new Set;(this.invoiceDetails.additionalDocuments||[]).forEach(h=>{let C=c(h);if(g.has(C))return;g.add(C);let k=this.additionalDocs.findIndex(O=>O.collectionName===h.docName);k===-1?this.additionalDocs.push({collectionName:h.docName,docs:[h]}):this.additionalDocs[k].docs.push(h)}),this.getPaymentHistory(),this.paymentRequested={display:!!Object.keys(this.invoiceDetails.display_activity).length,amount:this.invoiceDetails.display_activity?.amount||0,remarks:this.invoiceDetails.display_activity?.reason||""},this.invoiceDetails.buyer_status==="Payment Success"?this.showPaymentButton=!1:this.showPaymentButton=!0})}getPaymentHistory(){this.financeOrderService.getPaymentHistory({poId:this.invoiceDetails.po_id}).subscribe(e=>{console.log(e),e.responseCode===200?this.paymentHistory=e.response.list:this.notificationService.showError("Failed to fetch payment history")},e=>{this.notificationService.showError("Something went wrong while fetching payment history")})}OnChangeCurrentAmount(){this.current=!0,this.total=!1,this.manual=!1}OnChangetoTotalAmount(){this.total=!0,this.current=!1,this.manual=!1,this.totalInvoiceAmount=this.invoiceDetails.balance_amount}OnChangeToManualPayment(){this.manual=!0,this.current=!1,this.total=!1}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}handleFileLoad(e){try{let o=e.target.files;if(o.length>0)for(let r=0;r<o.length;r++){this.isLoading=!0;let c=o[r],g=new FormData;g.append("file",c),g.append("source","payment"),g.append("source_id",""),console.log(c),this.financeOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.manualInvoiceFiles=[...this.manualInvoiceFiles,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError("File Upload Failed"),this.isLoading=!1,e.target.value=null},h=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1,e.target.value=null})}}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1,e.target.value=null}}removeFile(e){this.manualInvoiceFiles.splice(e,1)}OnClickPaymentMake(){return yn(this,null,function*(){try{if(this.manual){let o=Number(this.manualInvoiceAmount)||0,r=Number(this.invoiceDetails?.balance_amount)||0;if(o<=0){this.notificationService.showError("Please enter a valid payment amount.");return}if(o>r){this.notificationService.showError("Payment amount cannot exceed the remaining payable amount.");return}}switch(this.isLoading=!0,!0){case this.current:this.amounttobePaid=this.tobePaidAmount;break;case this.total:this.amounttobePaid=this.totalInvoiceAmount;break;case this.manual:this.amounttobePaid=this.manualInvoiceAmount;break;default:break}let e={source:this.invoiceDetails?.source==="auction"?"auction":"invoice",source_id:this.invoiceId,orderAmount:this.amounttobePaid,customerName:this.customerProfile.data.firstname+" "+this.customerProfile.data.lastname,customerPhone:this.customerProfile.data.mobile_number?this.customerProfile.data.mobile_number:"",customerEmail:this.customerProfile.data.email,backURL:window.location.href,orderCurrency:"INR",orderNote:"test",module:"po",gateway_name:this.manual?"manual":ni.paymentGateWayKey};if(this.manual){if(this.isDateInFuture(this.manualInvoiceTransactionTime)){this.isLoading=!1;return}e.transaction_id=this.manualInvoiceTransactionId,e.txn_time=this.manualInvoiceTransactionTime,e.attachments=[...this.manualInvoiceFiles.map(o=>o.path)]}this.financeOrderService.paynow(e).subscribe(o=>{if(o.responseCode!==200){this.notificationService.showError("Something went wrong!"),this.isLoading=!1;return}
1if(o.responseCode===200){if(this.manual){this.notificationService.showSuccess("Payment recorded successfully."),this.isLoading=!1,this.manualInvoiceAmount=0,this.manualInvoiceTransactionId="",this.manualInvoiceTransactionTime="",this.manualInvoiceFiles=[],setTimeout(()=>{document.getElementById("po-payment-modal-close")?.click()},500);return}window.location.replace(o.response.url)}},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}})}payInvoice(e,o){this.tobePaidAmount=e,this.selectedChildInvoiceId=o}payAdvanceAmount(){this.financeOrderService.paynow({source:"po",source_id:this.invoiceId,orderAmount:this.invoiceDetails?.installments[0].amount,customerName:this.customerProfile.data.firstname+" "+this.customerProfile.data.lastname,customerPhone:this.customerProfile.data.mobile_number,customerEmail:this.customerProfile.data.email,backURL:window.location.href,orderCurrency:"INR",orderNote:"",module:"po",gateway_name:this.manual?"manual":ni.production?null:"stripe"}).subscribe(e=>{console.log(e),e.response&&window.location.replace(e.response.url)})}get advanceDetails(){if(this.invoiceDetails&&this.invoiceDetails.receipts){let e=this.invoiceDetails.receipts.filter(o=>o.advance_payment==="yes");if(e.length)return e[0]}return{terms:"Not Available",amount:"0"}}isDateInFuture(e){return new Date(e)>new Date}togglePaymentHistory(){this.isPaymentHistoryExpanded=!this.isPaymentHistoryExpanded}onRequestPaymentClick(){this.OnChangeCurrentAmount(),this.tobePaidAmount=this.paymentRequested.amount,this.onPayNowClick()}onPayNowClick(){this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{pay:"true"},queryParamsHandling:"merge",replaceUrl:!0})}static{this.\u0275fac=function(o){return new(o||a)(T(K),T(de),T(z),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-po-payment"]],decls:239,vars:60,consts:[["plainPoNumber",""],["plainSourceId",""],["fileInput",""],["prods",""],["popContent",""],["noFiles",""],["plainPoNumber2",""],["plainSourceId2",""],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],["class","req-part-card row flex justify-content-between",4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngIf"],[1,"col-md","col-12"],[1,"card","border-0"],[1,"card-body","p-2"],["appTranslate","",1,"fw-600"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"card","h-100"],[1,"card-body"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],["appTranslate","",1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],["class","mod-card mb-4 h-100",4,"ngIf"],["class","col-12 col-lg splitedSummaryRightSide",4,"ngIf"],[1,"col-12","text-right","mt-3"],["type","button","data-toggle","modal","data-target","#viewInvs__modal","class","mod-btn mod-btn-outline-primary mr-10","appTranslate","",4,"ngIf"],["type","button","data-toggle","modal","data-target","#invMakePay__modal","class","mod-btn mod-btn-primary","appTranslate","",3,"click",4,"ngIf"],["id","invMakePay__modal",1,"modal","fade","invMakePay__modal","z-1051"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-bottom-0"],["appTranslate","",1,"modal-title","font-16","fw-600"],["type","button","id","po-payment-modal-close","data-dismiss","modal",1,"close",3,"disabled"],[1,"modal-body"],[1,"card","shadow-none","border-0"],[1,"card-body","p-0"],[1,"custom-control","custom-radio"],["type","radio","id","pay_chk_01","aria-expanded","true","data-toggle","collapse","data-target","#pay_col_01","name","payment","checked","","value","customEx",1,"custom-control-input",3,"change"],["for","pay_chk_01","appTranslate","",1,"custom-control-label","font-14-i","fw-600"],["id","pay_col_01","data-parent","#invMakePay__modal",1,"collapse","show","border","border-top-0"],["appTranslate","",1,"col-4","fw-600"],[1,"col-8"],[1,"price-input"],["type","text","name","","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],["type","radio","data-toggle","collapse","data-target","#pay_col_02","id","pay_chk_02","name","payment","value","customEx",1,"custom-control-input",3,"change"],["for","pay_chk_02","appTranslate","",1,"custom-control-label","font-14-i","fw-600"],["id","pay_col_02","data-parent","#invMakePay__modal",1,"collapse","border","border-top-0"],["type","text","name","","readonly","",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],["type","radio","data-toggle","collapse","data-target","#pay_col_03","id","pay_chk_03","name","payment","value","customEx",1,"custom-control-input",3,"change"],["for","pay_chk_03","appTranslate","",1,"custom-control-label","font-14-i","fw-600"],["id","pay_col_03","data-parent","#invMakePay__modal",1,"collapse","border","border-top-0"],["class","font-12 color-red mt-1",4,"ngIf"],[1,"row","pt-2"],["type","text","name","",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],["type","datetime-local","name","",1,"form-control","form-control-sm",3,"ngModelChange","max","ngModel"],["class","text-danger small","appTranslate","",4,"ngIf"],["appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"referenceFile__selectedFileName"],["multiple","","type","file",3,"change"],["class","mt-2",4,"ngFor","ngForOf"],[1,"text-center","mt-15"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-soft-primary","mr-2",3,"disabled"],["type","submit","class","mod-btn mod-btn-primary","appTranslate","",3,"click",4,"ngIf"],["type","submit","class","mod-btn mod-btn-primary",3,"disabled","click",4,"ngIf"],["id","viewInvs__modal",1,"modal","fade","viewInvs__modal"],[1,"modal-dialog","modal
1-dialog-centered","max-w-650px"],["type","button","data-dismiss","modal",1,"close"],["class","col-12",4,"ngIf"],["class","col-md-12",4,"ngIf"],["id","invoice-print",1,"non-i-d-none","h-100-non-i"],["id","content","class","rfq-pages generate-po-page container-fluid mt-0 h-100-non-i ",4,"ngIf"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"req-part-card","row","flex","justify-content-between"],[1,"fw-600","mb-0"],["data-toggle","modal","data-target","#invMakePay__modal","appTranslate","",1,"ml-2","mod-btn","btn-sm","mod-btn-primary","px-xl-3","ml-xl-2","px-xxl-5",3,"click"],["type","button",1,"mod-btn-action",3,"click"],["appTranslate","",1,"text-secondary"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"ri-bank-line"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],[1,"text-secondary","mb-1"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"mb-0"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","5"],["colspan","2",1,"cell-300"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["scope","col","appTranslate",""],["class","row w-100",4,"ngIf","ngIfElse"],[1,"row","w-100"],["class","col-auto",4,"ngFor","ngForOf"],[1,"col-auto"],["target","_blank",1,"card",3,"href"],[1,"list-inline","align-items-center","mb-0"],[1,"list-inline-item","theme-color","font-12","fw-600"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["appTranslate","",1,"text-muted","small"],["colspan","2"],["appTranslate","",1,"text-center","mb-0"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-12","mb-30"],[1,"card"],["data-toggle","collapse","data-target","#ppp__PaymentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","ppp__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20"],["data-toggle","collapse","data-target","#ppp__ShipmentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["id","ppp__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],["appTranslate","",1,"font-12","text-secondary","mb-2"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color",3,"href"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard","mb-4","h-auto"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"mb-2","ml-2"],[1,"card-footer"],["class","card rfqColorLeftBox03",4,"ngIf"],[1,"card","rfqColorLeftBox03"],[1,"card-header"],["data-toggle","collapse","href","#paymentHistory",1,"card-link","collaspsed",3,"click"],[1,"ri-history-fill","mr-1"],[1,"uil","ml-auto"],["
1id","paymentHistory",1,"collapse"],[1,"card-body","pt-0"],[1,"sellerQuotationHistory"],["class","pb-0",4,"ngFor","ngForOf"],[1,"pb-0"],[1,"float-right","text-danger"],[1,"hilight-element"],[1,"card-body","py-0"],["class","pb-3",4,"ngFor","ngForOf"],[1,"pb-3"],["type","button","data-toggle","modal","data-target","#viewInvs__modal","appTranslate","",1,"mod-btn","mod-btn-outline-primary","mr-10"],["type","button","data-toggle","modal","data-target","#invMakePay__modal","appTranslate","",1,"mod-btn","mod-btn-primary",3,"click"],[1,"font-12","color-red","mt-1"],["appTranslate","",1,"text-danger","small"],[1,"mt-2"],[1,"float-right","d-block"],["target","_blank",1,"cursor-p","mr-1",3,"href"],[1,"uil","uil-external-link-alt","text-primary"],[1,"cursor-p",3,"click"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"click"],["type","submit",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["class","spinner-border spinner-border-sm","role","status","aria-hidden","true",4,"ngIf"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"],["appTranslate","",1,"text-center"],[1,"col-md-12"],[1,"table","border"],[1,"text-right"],["type","button","data-dismiss","modal",1,"mb-2","mx-2","mod-btn","btn-sm","mod-btn-outline-primary",3,"click"],[1,"uil","uil-external-link-alt"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","mt-0","h-100-non-i"],[1,"row","align-items-center","mb-15"],[1,"col-6"],[1,"col-6","text-right"],[1,"theme-color"],[1,"col-md-8","col-12","col-xl-9"],["class","card border-0",4,"ngIf"],["id","coll__OrderSummary"],["id","product_table",1,"table-responsive","mod-table-wrapper"],["class","",4,"ngIf"],[1,"row","mt-30"],["class","col-4",4,"ngIf"],[1,"break-after-page"],[1,"form-group","mb-0"],["appTranslate","",1,"font-12","text-secondary","text-center","mb-2"],["colspan","7"],["colspan","1"],[1,"col-4"],[1,"card","totalCalculationCard"]],template:function(o,r){if(o&1){let c=I();i(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"h2",13)(6,"a",14),x(7,"i",15),t(),i(8,"span",16),n(9,"Proforma Invoice"),t()()(),i(10,"div",17)(11,"button",18),S("click",function(){return b(c),y(r.printInvoice())}),u(12,N3,4,0,"span",19)(13,V3,6,0,"span",19),t()()()(),i(14,"div",10),u(15,B3,13,4,"div",20),i(16,"div",21)(17,"div",22)(18,"h3",23),n(19,"Proforma Invoice"),t()(),i(20,"div",24)(21,"div",25)(22,"div",26)(23,"div",27),n(24,"Invoice Number"),t(),i(25,"div",28),n(26),t()(),i(27,"div",26)(28,"div",27),n(29,"PO No."),t(),i(30,"div",28),u(31,R3,2,1,"button",29)(32,L3,1,1,"ng-template",null,0,P),t()(),i(34,"div",26)(35,"div",27),n(36,"Source ID"),t(),i(37,"div",28),u(38,q3,2,1,"button",29)(39,G3,1,1,"ng-template",null,1,P),t()(),i(41,"div",26)(42,"div",27),n(43,"Invoice Date"),t(),i(44,"div",28),n(45),t()(),i(46,"div",26)(47,"div",27),n(48,"Invoice Due in Day(s)"),t(),i(49,"div",28),n(50),t()(),i(51,"div",26)(52,"div",27),n(53,"Invoice State/City"),t(),i(54,"div",28),n(55),t()(),u(56,U3,5,1,"div",30)(57,j3,5,1,"div",30),t()()(),i(58,"div",21)(59,"div",22)(60,"h3",23),n(61,"Seller Details"),t()(),i(62,"div",24)(63,"div",9)(64,"div",31)(65,"div",32)(66,"div",33)(67,"p",34),n(68,"Shipping From :"),t(),i(69,"p",35)(70,"span",16),n(71,"Seller Name:"),t(),i(72,"span",36),n(73),t()(),i(74,"p",35)(75,"span",16),n(76,"GST No:"),t(),u(77,$3,2,1,"span",37)(78,z3,2,0,"span",38),t(),i(79,"p",35)(80,"span",16),n(81,"Seller Address:"),t(),i(82,"span",36),n(83),t()()()()(),i(84,"div",39)(85,"div",40),u(86,W3,1,1,"img",41),t()()()()(),u(87,Q3,35,6,"div",42),i(88,"div",21)(89,"div",22)(90,"h3",23),n(91,"Buyer Address"),t()(),i(92,"div",24)(93,"div",43)(94,"div",44)(95,"div",45)(96,"div",46)(97,"p",47),n(98,"Shipping Address : "),t(),u(99,Y3,4,1,"p",48),i(100,"p",36),n(101),t()()()(),i(102,"div",44)(103,"div",45)(104,"div",46)(105,"p",47),n(106,"Billing Address : "),t(),u(107,H3,4,1,"p",48),i(108,"p",36),n(109),t(),i(110,"p",35)(111,"span",16),n(112,"GST No:"),t(),u(113,K3,2,1,"span",37)(114,Z3,2,0,"span",38),t()()()()()()(),i(115,"div",21)(116,"div",49)(117,"h3",23),n(118,"Order Summary"),t()(),i(119,"div",50)(120,"div",51)(121,"table",52)(122,"thead",53)(123,"tr")(124,"th",54),n(125," Product Name"),t(),i(126,"th",54),n(127," Quantity"),t(),i(128,"th",54),n(129,"Quoted"),t(),i(130,"th",54),n(131," Discount"),t(),i(132,"th",54),n(133," Gross Total"),t(),i(134,"th",54),n(135," Tax"),t(),i(136,"th",54),n(137," Total Payable"),t()()(),i(138,"tbody"),u(139,n4,34,20,"tr",55)(140,a4,13,4,"tr",19),t()()()()(),u(141,c4,16,2,"div",42)(142,x4,8,2,"div",42),i(143,"div",56)(144,"div",57),u(145,S4,14,3,"div",58),t(),u(146,I4,47,22,"div",59)(147,w4,77,37,"div",59),t(),i(148,"div",9)(149,"div",60),u(150,P4,2,0,"button",61)(151,O4,2,0,"button",62),t()()()()(),i(152,"div",63)(153,"div",64)(154,"div",65)(155,"div",66)(156,"h4",67),n(157,"Make Payment"),t(),i(158,"button",68),n(1
159,"\xD7"),t()(),i(160,"div",69)(161,"div",70)(162,"div",71)(163,"div",72)(164,"input",73),S("change",function(){return b(c),y(r.OnChangeCurrentAmount())}),t(),i(165,"label",74),n(166," Pay Partial Amount"),t()(),i(167,"div",75)(168,"div",9)(169,"div",76),n(170,"Payable Amount"),t(),i(171,"div",77)(172,"div",78)(173,"input",79),ve("ngModelChange",function(h){return b(c),_e(r.tobePaidAmount,h)||(r.tobePaidAmount=h),y(h)}),t()()()()(),i(174,"div",72)(175,"input",80),S("change",function(){return b(c),y(r.OnChangetoTotalAmount())}),t(),i(176,"label",81),n(177,"Pay Total Amount"),t()(),i(178,"div",82)(179,"div",9)(180,"div",76),n(181,"Pay Total Amount"),t(),i(182,"div",77)(183,"div",78)(184,"input",83),ve("ngModelChange",function(h){return b(c),_e(r.totalInvoiceAmount,h)||(r.totalInvoiceAmount=h),y(h)}),t()()()()(),i(185,"div",72)(186,"input",84),S("change",function(){return b(c),y(r.OnChangeToManualPayment())}),t(),i(187,"label",85),n(188,"Add Manual Payment"),t()(),i(189,"div",86)(190,"div",9)(191,"div",76),n(192,"Amount"),t(),i(193,"div",77)(194,"div",78)(195,"input",79),ve("ngModelChange",function(h){return b(c),_e(r.manualInvoiceAmount,h)||(r.manualInvoiceAmount=h),y(h)}),t()(),u(196,k4,5,3,"div",87),t()(),i(197,"div",88)(198,"div",76),n(199,"Transaction Id"),t(),i(200,"div",77)(201,"div",78)(202,"input",89),ve("ngModelChange",function(h){return b(c),_e(r.manualInvoiceTransactionId,h)||(r.manualInvoiceTransactionId=h),y(h)}),t()()()(),i(203,"div",88)(204,"div",76),n(205,"Transaction Time"),t(),i(206,"div",77)(207,"div",78)(208,"input",90),ve("ngModelChange",function(h){return b(c),_e(r.manualInvoiceTransactionTime,h)||(r.manualInvoiceTransactionTime=h),y(h)}),t()(),u(209,F4,2,0,"div",91),t()(),i(210,"div",88)(211,"div",76),n(212,"Reference File"),t(),i(213,"div",77)(214,"div")(215,"button",92),S("click",function(){b(c);let h=w(219);return y(h.click())}),n(216,"Select Files"),t(),i(217,"span",93)(218,"input",94,2),S("change",function(h){return b(c),y(r.handleFileLoad(h))}),t()()(),u(220,M4,7,2,"p",95),t()()()()(),i(221,"div",96)(222,"button",97),n(223,"Cancel "),t(),u(224,A4,2,0,"button",98)(225,V4,4,2,"button",99),t()()()()(),i(226,"div",100)(227,"div",101)(228,"div",65)(229,"div",66)(230,"h4",67),n(231,"Tax Invoices"),t(),i(232,"button",102),n(233,"\xD7"),t()(),i(234,"div",69),u(235,B4,3,0,"div",103)(236,L4,16,1,"div",104),t()()()(),i(237,"div",105),u(238,lE,157,40,"div",106),t()}if(o&2){let c=w(33),g=w(40);l(11),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(2),s("ngIf",r.paymentRequested.display),l(11),f(r.invoiceDetails==null?null:r.invoiceDetails.invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",c),l(7),s("ngIf",r.canOpenSource)("ngIfElse",g),l(7),f(r.invoiceDetails==null?null:r.invoiceDetails.cdate),l(5),f(r.invoiceDetails!=null&&r.invoiceDetails.invoice_due_days?r.invoiceDetails==null?null:r.invoiceDetails.invoice_due_days:"-"),l(5),f(r.shippingAddrdres==null?null:r.shippingAddrdres.region),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)==="rfq"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)==="rfq"),l(16),f(r.invoiceDetails==null||r.invoiceDetails.seller_details==null?null:r.invoiceDetails.seller_details.company_name),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.seller_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.seller_gst)),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(3),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.payment_mode)!=="Cash"),l(12),s("ngIf",(r.invoiceDetails==null?null:r.
1invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(6),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.gst),l(),s("ngIf",!(!(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null)&&r.invoiceDetails.buyerCompanyDetails.gst)),l(25),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.items),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!=="DirectBuy"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required)=="yes"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.multiple_payment_terms)==="YES"||(r.invoiceDetails==null?null:r.invoiceDetails.multiple_shipment_terms)==="YES"),l(3),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!=="DirectBuy"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)=="auction"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)!="auction"),l(3),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.invoices==null?null:r.invoiceDetails.invoices.length),l(),s("ngIf",r.showPaymentButton),l(7),s("disabled",r.isLoading),l(15),ue("ngModel",r.tobePaidAmount),l(11),ue("ngModel",r.totalInvoiceAmount),l(11),ue("ngModel",r.manualInvoiceAmount),l(),s("ngIf",r.manualInvoiceAmount>((r.invoiceDetails==null?null:r.invoiceDetails.balance_amount)||0)),l(6),ue("ngModel",r.manualInvoiceTransactionId),l(6),s("max",r.currentDate),ue("ngModel",r.manualInvoiceTransactionTime),l(),s("ngIf",r.manualInvoiceTransactionTime&&r.isDateInFuture(r.manualInvoiceTransactionTime)),l(11),s("ngForOf",r.manualInvoiceFiles),l(2),s("disabled",r.isLoading),l(2),s("ngIf",!r.manual),l(),s("ngIf",r.manual),l(10),s("ngIf",(r.invoiceDetails==null||r.invoiceDetails.invoices==null?null:r.invoiceDetails.invoices.length)===0),l(),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.invoices==null?null:r.invoiceDetails.invoices.length),l(2),s("ngIf",r.invoiceDetails)}},dependencies:[J,W,Ne,Pe,Pt,dt,Se,Z,L,ut,st,Yi,ae],styles:['.invMakePay__modal[_ngcontent-%COMP%] .custom-control[_ngcontent-%COMP%]{border:1px solid #dee2e6;padding:15px 15px 15px 40px}.invMakePay__modal[_ngcontent-%COMP%] .collapse.show[_ngcontent-%COMP%]{background:#f6f6f6;padding:30px}.invMakePay__modal[_ngcontent-%COMP%] .custom-control[_ngcontent-%COMP%] input[aria-expanded=true][_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{color:#007bff;font-weight:600}.hilight-element[_ngcontent-%COMP%]{margin:0 -10px;padding:10px;border:dashed 1px #B7E1FF;background:#eef8ff;border-radius:5px}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.z-1051[_ngcontent-%COMP%]{z-index:1051}.referenceFile__selectedFileName[_ngcontent-%COMP%]{visibility:hidden;position:absolute;overflow:hidden;width:0px;height:0px;border:none;margin:0;padding:0}.rfqColorLeftBox03[_ngcontent-%COMP%]{margin-top:30px;background-color:var(--theme-bg-light3);margin-bottom:30px;border:1px solid var(--mod-border);border-radius:var(--mod-radius-lg);box-shadow:var(--mod-shadow-sm);min-width:0;transition:box-shadow var(--mod-transition)}.rfqColorLeftBox03[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{background-color:transparent;border-bottom:0;padding:0}.rfqColorLeftBox03[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--theme-blue);font-weight:600;padding:1.25rem;display:flex;align-items:center;gap:6px}.rfqColorLeftBox03[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%] span.uil[_ngcontent-%COMP%]{transform:none;font-size:1.5rem;line-height:1}.sellerQuotationHistory[_ngcontent-%COMP%]{list-style:none;padding-left:8px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{position:relative;padding-left:12px;padding-bottom:20px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:not(:last-child){border-left:1px dashed var(--buyer-blue)}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:first-child:before{transition:all ease-in-out 1s;outline:1px solid rgba(29,55,93,.13);animation:_ngcontent-%COMP%_pluse01 1s linear infinite alternate;border:1px solid rgba(29,55,93,.33)}@keyframes _ngcontent-%COMP%_pluse01{0%{outline-width:1px;border-width:1px}to{outline-width:8px;border-width:5px}}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{content:"";top:0;left:0;transform:translate(-50%);position:absolute;width:11px;height:11px;border-radius:50%;background-color:var(--buyer-blue)}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{font-weight:400;color:#707070;font-size:13px;display:block;position:relative;top:-5px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{color:var(--buyer-blue);font-weight:600;margin-bottom:4px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--theme-blue2);margin-bottom:0;font-size:12px}.width-69px[_ngcontent-%COMP%]{width:69px}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;
1color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.req-part-card[_ngcontent-%COMP%]{border-radius:5px;border-left:5px solid #0685c3;background-color:#e5edf4;padding:24px 15px;margin:10px 0}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child > p[_ngcontent-%COMP%]{max-width:240px;overflow-wrap:anywhere;word-break:break-word}}']})}}return a})();var oE=["sellerGST"];function sE(a,d){a&1&&(i(0,"span"),x(1,"i",127),i(2,"span",19),n(3,"Print"),t()())}function dE(a,d){a&1&&(i(0,"span")(1,"div",128)(2,"span",129),n(3,"Loading..."),t()(),i(4,"span",19),n(5,"Printing..."),t()())}function cE(a,d){a&1&&(i(0,"span",19),n(1,"PO ID:"),t())}function pE(a,d){a&1&&(i(0,"span",19),n(1,"WO ID:"),t())}function mE(a,d){a&1&&(i(0,"option",141),n(1," Select GST"),t())}function uE(a,d){a&1&&(i(0,"option",142),n(1," No GST Available"),t())}function _E(a,d){if(a&1&&(i(0,"option",143),n(1),t()),a&2){let e=d.$implicit;s("value",e),l(),m(" ",e,"")}}function vE(a,d){a&1&&(i(0,"div",146),n(1," GST is required"),t())}function gE(a,d){if(a&1&&(i(0,"div",144),u(1,vE,2,0,"div",145),t()),a&2){let e,o=p(3);l(),s("ngIf",(e=o.sendToBuyerForm.get("sellerGst"))==null||e.errors==null?null:e.errors.required)}}function fE(a,d){if(a&1){let e=I();i(0,"div",130)(1,"div",131)(2,"p",132),n(3,"Shipping From :"),t(),i(4,"p",95)(5,"span",19),n(6,"Seller Name:"),t(),i(7,"span",94),n(8),t()(),i(9,"div",133)(10,"label",134)(11,"span",19),n(12,"GST NO"),t(),i(13,"sup",20),n(14,"*"),t()(),i(15,"select",135),S("change",function(r){b(e);let c=p(2);return y(c.onGSTSelect(r))}),u(16,mE,2,0,"option",136)(17,uE,2,0,"option",137)(18,_E,2,2,"option",138),i(19,"option",139),x(20,"i",140),i(21,"span",19),n(22," Add New GST "),t()()()(),u(23,gE,2,1,"div",22),i(24,"p",95)(25,"span",19),n(26,"Seller Address:"),t(),x(27,"br"),i(28,"span",94),n(29),t()()()()}if(a&2){let e,o=p(2);l(8),f(o.OrderDetails.seller_details==null?null:o.OrderDetails.seller_details.company_name),l(8),s("ngIf",o.OrderDetails.seller_gst_list),l(),s("ngIf",o.OrderDetails.seller_gst_list==0),l(),s("ngForOf",o.OrderDetails.seller_gst_list),l(5),s("ngIf",((e=o.sendToBuyerForm.get("sellerGst"))==null?null:e.touched)&&((e=o.sendToBuyerForm.get("sellerGst"))==null?null:e.dirty)||o.submitted),l(6),m(" ",o.OrderDetails.seller_address.full_address,"")}}function hE(a,d){if(a&1&&(i(0,"div",149),x(1,"img",150),t()),a&2){let e=p(3);l(),s("src",e.OrderDetails.seller_details.company_logoViewPath,q)}}function xE(a,d){if(a&1&&(i(0,"div",147),u(1,hE,2,1,"div",148),t()),a&2){let e=p(2);l(),s("ngIf",e.OrderDetails&&e.OrderDetails.seller_details&&e.OrderDetails.seller_details.company_logoViewPath)}}function bE(a,d){a&1&&(i(0,"div",146),n(1," Creation date is required "),t())}function yE(a,d){if(a&1&&(i(0,"div",144),u(1,bE,2,0,"div",145),t()),a&2){let e,o=p(2);l(),s("ngIf",(e=o.sendToBuyerForm.get("creationDate"))==null||e.errors==null?null:e.errors.required)}}function SE(a,d){a&1&&(i(0,"div",146),n(1," Invoice due days is required "),t())}function CE(a,d){a&1&&(i(0,"div",146),n(1," Invoice due days cannot be less than 1 "),t())}function EE(a,d){if(a&1&&(i(0,"div",144),u(1,SE,2,0,"div",145)(2,CE,2,0,"div",145),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.sendToBuyerForm.get("invoiceDueDays"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.sendToBuyerForm.get("invoiceDueDays"))==null||o.errors==null?null:o.errors.min)}}function IE(a,d){if(a&1&&x(0,"app-loader",165),a&2){let e=p(3);
1s("isLoading",e.loadingStates.bankDetails)("useBlockPosition",!0)}}function DE(a,d){if(a&1){let e=I();i(0,"a",166),S("click",function(){let r=b(e).$implicit,c=p(3);return y(c.selectBankAccount(r))}),i(1,"span",167),n(2),t(),i(3,"small",168),n(4),t()()}if(a&2){let e=d.$implicit;l(2),f(e.bank_name),l(2),D("",e.account_name," - ",e.account_number,"")}}function TE(a,d){a&1&&(i(0,"div",169),n(1,"No saved bank accounts"),t())}function wE(a,d){if(a&1&&(i(0,"div",170)(1,"div",171)(2,"h4",172),n(3),t(),i(4,"span",173),n(5),t()(),i(6,"div",174)(7,"div",175)(8,"span",176),n(9,"Account Holder"),t(),i(10,"span",177),n(11),t()(),i(12,"div",175)(13,"span",176),n(14,"Account Number"),t(),i(15,"span",177),n(16),t()(),i(17,"div",175)(18,"span",176),n(19,"IFSC Code"),t(),i(20,"span",177),n(21),t()(),i(22,"div",175)(23,"span",176),n(24,"Branch"),t(),i(25,"span",177),n(26),t()()()()),a&2){let e,o,r,c,g,h,C=p(3);l(3),f((e=C.sendToBuyerForm.get("bankName"))==null?null:e.value),l(2),f((o=C.sendToBuyerForm.get("branch"))==null?null:o.value),l(6),f((r=C.sendToBuyerForm.get("accountName"))==null?null:r.value),l(5),f((c=C.sendToBuyerForm.get("accountNumber"))==null?null:c.value),l(5),f((g=C.sendToBuyerForm.get("ifscCode"))==null?null:g.value),l(5),f((h=C.sendToBuyerForm.get("branch"))==null?null:h.value)}}function PE(a,d){if(a&1&&(i(0,"div",68)(1,"div",69)(2,"h3",82),n(3,"Company Bank Details"),t()(),i(4,"div",71),u(5,IE,1,2,"app-loader",151),i(6,"div",152)(7,"div",153)(8,"div",154)(9,"label",46)(10,"span",19),n(11,"Select Bank account"),t(),i(12,"sup",20),n(13,"*"),t()(),i(14,"div",155)(15,"div",156)(16,"span"),n(17),t(),x(18,"i",157),t(),i(19,"div",158),u(20,DE,5,3,"a",159)(21,TE,2,0,"div",160),t()()()(),i(22,"div",161)(23,"button",162),x(24,"i",163),n(25," Add New "),t()()(),u(26,wE,27,6,"div",164),t()()),a&2){let e,o,r=p(2);l(5),s("ngIf",r.loadingStates.bankDetails),l(12),f((e=r.sendToBuyerForm.get("bankName"))!=null&&e.value?((e=r.sendToBuyerForm.get("bankName"))==null?null:e.value)+" - "+((e=r.sendToBuyerForm.get("accountNumber"))==null?null:e.value):"Select bank account"),l(3),s("ngForOf",r.bankDetails),l(),s("ngIf",!r.bankDetail
1s.length),l(5),s("ngIf",(o=r.sendToBuyerForm.get("accountNumber"))==null?null:o.value)}}function OE(a,d){a&1&&(i(0,"div",85),n(1,"Place of Supply"),t())}function kE(a,d){a&1&&(i(0,"div",85),n(1,"Place of Service"),t())}function FE(a,d){a&1&&(i(0,"div",85),n(1,"PO No."),t())}function ME(a,d){a&1&&(i(0,"div",85),n(1,"WO No."),t())}function AE(a,d){if(a&1&&(i(0,"div",84)(1,"div",85),n(2," Payment Mode "),t(),i(3,"div",86),n(4),t()()),a&2){let e=p(2);l(4),m(" ",e.OrderDetails==null?null:e.OrderDetails.payment_mode," ")}}function NE(a,d){if(a&1&&(i(0,"p",178)(1,"span",132),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.OrderDetails==null?null:e.OrderDetails.buyer_company_name)||(e.shippingAddress==null?null:e.shippingAddress.company_name),"")}}function VE(a,d){if(a&1&&(i(0,"p",178)(1,"span",132),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.OrderDetails==null?null:e.OrderDetails.buyer_company_name)||(e.billingAddress==null?null:e.billingAddress.company_name),"")}}function BE(a,d){if(a&1&&(i(0,"span",94),n(1),t()),a&2){let e=p(2);l(),f(e.OrderDetails==null?null:e.OrderDetails.gstn)}}function RE(a,d){a&1&&(i(0,"span",179),n(1,"Not Available"),t())}function LE(a,d){a&1&&(i(0,"th",19),n(1," Product Name"),t())}function qE(a,d){a&1&&(i(0,"th",19),n(1," Service Name"),t())}function GE(a,d){if(a&1&&(i(0,"thead",180)(1,"tr"),u(2,LE,2,0,"th",30)(3,qE,2,0,"th",30),i(4,"th",19),n(5," Product Id"),t(),i(6,"th",19),n(7," Quantity"),t(),i(8,"th",19),n(9," Quoted"),t(),i(10,"th",19),n(11," Gross Total"),t(),i(12,"th",19),n(13," Discount"),t(),i(14,"th",19),n(15," Tax"),t(),i(16,"th",19),n(17," Total Payable"),t()()()),a&2){let e=p(2);l(2),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function UE(a,d){a&1&&(i(0,"thead",180)(1,"tr")(2,"th",19),n(3," Product Name"),t(),i(4,"th",19),n(5," Product Id"),t(),i(6,"th",19),n(7," Quantity"),t(),i(8,"th",19),n(9," Basic Price"),t(),i(10,"th",19),n(11," Discount"),t(),i(12,"th",19),n(13," Tax"),t(),i(14,"th",19),n(15," Total Payable"),t()()())}function jE(a,d){a&1&&(i(0,"thead",180)(1,"tr")(2,"th",19),n(3," Product Name"),t(),i(4,"th",19),n(5," Product Id"),t(),i(6,"th",19),n(7," Quantity"),t(),i(8,"th",19),n(9," Bid Total Value"),t(),i(10,"th",19),n(11,"Logistics "),t(),i(12,"th",19),n(13,"Tax"),t(),i(14,"th",19),n(15,"Net Payable"),t()()())}function $E(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function zE(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function WE(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function QE(a,d){if(a&1&&(F(0),i(1,"div",185),n(2),t(),i(3,"p",186),u(4,$E,2,2,"span",187)(5,zE,2,2,"span",187)(6,WE,2,2,"span",187),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function YE(a,d){if(a&1&&(F(0),i(1,"div",185)(2,"div")(3,"p",189),n(4),_(5,"currencyFormat"),t(),i(6,"p",189),n(7),_(8,"currencyFormat"),t(),i(9,"p",189),n(10),_(11,"currencyFormat"),t(),i(12,"p",189),n(13),_(14,"currencyFormat"),t(),i(15,"p",189),n(16),_(17,"currencyFormat"),t(),i(18,"p",189),n(19),_(20,"currencyFormat"),t(),i(21,"p",189),n(22),_(23,"currencyFormat"),t(),i(24,"p",189),n(25),_(26,"currencyFormat"),t(),i(27,"p",189),n(28),_(29,"currencyFormat"),t(),x(30,"div",190),i(31,"p",178)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst)," "),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst)," "),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst)," "),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function HE(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",182),n(3),t(),u(4,QE,7,4,"ng-template",null,3,P),x(6,"i",183),t(),i(7,"td",184),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,YE,35,34,"ng-template",null,4,P),x(30,"i",183),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.gross_total)),l(3),f(v(21,14,e.discount)),l(3),f(v(24,16,e.gst)),l(3),m("",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function KE(a,d){if(a&1&&(i(0,"tbody"),u(1,HE,31,20,"tr",181),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function ZE(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function JE(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function XE(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function e5(a,d){if(a&1&&(F(0),i(1,"div",185),n(2),t(),i(3,"p",186),u(4,ZE,2,2,"span",187)(5,JE,2,2,"span",187)(6,XE,2,2,"span",187),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function t5(a,d){if(a&1&&(F(0),i(1,"div",185)(2,"div")(3,"p",189),n(4),_(5,"currencyFormat"),t(),i(6,"p",189),n(7),_(8,"currencyFormat"),t(),i(9,"p",189),n(10),_(11,"currencyFormat"),t(),i(12,"p",189),n(13),_(14,"currencyFormat"),t(),i(15,"p",189),n(16),_(17,"currencyFormat"),t(),i(18,"p",189),n(19),_(20,"currencyFormat"),t(),i(21,"p",189),n(22),_(23,"currencyFormat"),t(),i(24,"p",189),n(25),_(26,"currencyFormat"),t(),i(27,"p",189),n(28),_(29,"currencyFormat"),t(),x(30,"div",190),i(31,"p",178)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst)," "),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst)," "),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst)," "),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.net_amount)," ")}}function i5(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",182),n(3),t(),u(4,e5,7,4,"ng-template",null,3,P),x(6,"i",183),t(),i(7,"td",184),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,t5,35,34,"ng-template",null,4,P),x(27,"i",183),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(5),f(v(18,11,e.discount)),l(3),f(v(21,13,e.gst)),l(3),m("",v(24,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function n5(a,d){if(a&1&&(i(0,"tbody"),u(1,i5,28,17,"tr",181),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function a5(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function r5(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function l5(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function o5(a,d){if(a&1&&(F(0),i(1,"div",185),n(2),t(),i(3,"p",186),u(4,a5,2,2,"span",187)(5,r5,2,2,"span",187)(6,l5,2,2,"span",187),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function s5(a,d){if(a&1&&(F(0),i(1,"div",185)(2,"div")(3,"p",189),n(4),_(5,"currencyFormat"),t(),i(6,"p",189),n(7),_(8,"currencyFormat"),t(),i(9,"p",189),n(10),_(11,"currencyFormat"),t(),x(12,"div",190),i(13,"p",178)(14,"b"),n(15),_(16,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Bid Total Value: ",v(5,4,e.gross_total)," "),l(3),m(" Tax: ",v(8,6,e.gst),""),l(3),m(" Logistics: ",v(11,8,e.logistics_charges)," "),l(5),m("Net Price: ",v(16,10,e.net_amount)," ")}}function d5(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",182),n(3),t(),u(4,o5,7,4,"ng-template",null,3,P),x(6,"i",183),t(),i(7,"td",184),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),t(),i(20,"td"),n(21),_(22,"currencyFormat"),u(23,s5,17,12,"ng-template",null,4,P),x(25,"i",183),t()()),a&2){let e=d.$implicit,o=w(5),r=w(24);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(13,9,e.gross_total)),l(3),f(v(16,11,e.logistics_charges)),l(3),f(v(19,13,e.gst)),l(3),m(" ",v(22,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function c5(a,d){if(a&1&&(i(0,"tbody"),u(1,d5,26,17,"tr",181),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function p5(a,d){a&1&&(F(0),i(1,"p",198),n(2,"Maximum 3 files are allowed per document"),t(),M())}function m5(a,d){a&1&&(i(0,"span",20),n(1,"\xA0*"),t())}function u5(a,d){if(a&1&&(i(0,"div",144)(1,"small",205),n(2),t()()),a&2){let e=p().$implicit,o=p(3);l(2),f(o.getDocumentValidationError(e.id))}}function _5(a,d){if(a&1&&(i(0,"div",206),x(1,"app-loader",207),t()),a&2){let e=p().$implicit,o=p(3);l(),s("isLoading",o.isRowLoading(e.id))("useBlockPosition",!0)}}function v5(a,d){if(a&1){let e=I();i(0,"div",209)(1,"small",210),n(2),t(),i(3,"button",211),S("click",function(){let r=b(e).$implicit,c=p(2).$implicit,g=p(3);return y(g.removeFile(c.id,r.id))}),an(),i(4,"svg",212),x(5,"path",213),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.name)}
1}function g5(a,d){if(a&1&&(i(0,"div"),u(1,v5,6,1,"div",208),t()),a&2){let e=p().$implicit,o=p(3);l(),s("ngForOf",o.getDocFiles(e.id))}}function f5(a,d){a&1&&(i(0,"span",215),n(1,"No files uploaded"),t())}function h5(a,d){if(a&1&&u(0,f5,2,0,"span",214),a&2){let e=p().$implicit,o=p(3);s("ngIf",!o.isRowLoading(e.id))}}function x5(a,d){if(a&1){let e=I();i(0,"div")(1,"input",216),S("change",function(r){b(e);let c=p().$implicit,g=p(3);return y(g.onFileSelected(r,c.id))}),t(),i(2,"label",217),n(3," Upload "),t()()}if(a&2){let e=p().$implicit,o=p(3);l(),s("multiple",e.max>1)("id","upload-"+e.id),l(),Ni(o.getDocumentValidationError(e.id)?"btn btn-outline-danger btn-sm mb-0":"btn btn-outline-theme btn-sm mb-0"),s("for","upload-"+e.id)}}function b5(a,d){a&1&&(i(0,"div",218)(1,"small",39),n(2,"Uploading..."),t()())}function y5(a,d){a&1&&(i(0,"span",219),an(),i(1,"svg",220),x(2,"path",221),t(),Tn(),i(3,"span",19),n(4,"Complete"),t()())}function S5(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"div")(3,"span",199),n(4),u(5,m5,2,0,"span",200),t()(),u(6,u5,3,1,"div",22),t(),i(7,"td"),u(8,_5,2,2,"div",201)(9,g5,2,1,"div",202)(10,h5,1,1,"ng-template",null,6,P),t(),i(12,"td",149),u(13,x5,4,5,"div",31)(14,b5,3,0,"div",203)(15,y5,5,0,"span",204),t()()),a&2){let e=d.$implicit,o=w(11),r=p(3);l(4),f(e.name),l(),s("ngIf",e.required),l(),s("ngIf",r.getDocumentValidationError(e.id)),l(2),s("ngIf",r.isRowLoading(e.id)),l(),s("ngIf",!r.isRowLoading(e.id)&&r.getDocFiles(e.id).length>0)("ngIfElse",o),l(4),s("ngIf",!r.isDocumentFull(e.id)&&!r.isRowLoading(e.id)),l(),s("ngIf",r.isRowLoading(e.id)),l(),s("ngIf",r.isDocumentFull(e.id)&&!r.isRowLoading(e.id))}}function C5(a,d){if(a&1&&(i(0,"div",191)(1,"div",192)(2,"h3",82),n(3,"Additional Documents"),t()(),i(4,"div",100)(5,"div",193)(6,"table",194)(7,"thead",180)(8,"tr")(9,"th",195),n(10,"Document Name"),t(),i(11,"th",196)(12,"span",19),n(13,"Files"),t(),u(14,p5,3,0,"ng-template",null,5,P),x(16,"i",183),t(),i(17,"th",197),n(18,"Upload"),t()()(),i(19,"tbody"),u(20,S5,16,9,"tr",181),t()()()()()),a&2){let e=w(15),o=p(2);l(16),s("ngbPopover",e),l(4),s("ngForOf",o.additionalServiceDocs)}}function E5(a,d){if(a&1){let e=I();i(0,"a",235),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function I5(a,d){if(a&1){let e=I();i(0,"a",235),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function D5(a,d){if(a&1&&(i(0,"div")(1,"p",233)(2,"b",19),n(3,"Note:"),t(),n(4),t(),u(5,E5,2,0,"a",234)(6,I5,2,0,"a",234),t()),a&2){let e=p().$implicit;l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded),l(),s("ngIf",e._expanded)}}function T5(a,d){if(a&1&&(i(0,"div",226)(1,"div",91)(2,"div",227)(3,"div",228)(4,"h6",229),n(5),t(),i(6,"small",230),n(7),_(8,"date"),t()(),i(9,"div",231)(10,"h6",232),n(11),_(12,"currencyFormat"),t()()(),u(13,D5,7,5,"div",31),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%)"),l(2),m("Due Date: ",U(8,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(12,8,e.amount)),l(2),s("ngIf",e.note)}}function w5(a,d){if(a&1&&(i(0,"div",222)(1,"div",68)(2,"div",223)(3,"h3",82),n(4,"Payment Terms"),t()(),i(5,"div",224)(6,"div",71),u(7,T5,14,10,"div",225),t()()()()),a&2){let e=p(2);l(7),s("ngForOf",e.poDetails==null?null:e.poDetails.payment_terms)}}function P5(a,d){if(a&1&&(i(0,"div",245)(1,"div",246)(2,"div",242)(3,"h6",247),n(4),t(),i(5,"small",230),n(6),t()(),i(7,"div",248)(8,"small",249),n(9,"Quantity"),t(),i(10,"h6",250),n(11),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(2),m("SKU: ",e.sku,""),l(5),f(e.qty)}}function O5(a,d){if(a&1&&(i(0,"div",240)(1,"div",241)(2,"div",227)(3,"div",242)(4,"h6",243),n(5),t(),i(6,"small",230),n(7),t()()()(),u(8,P5,12,3,"div",244),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(2),m("Timeline: ",e.timeline_days," day(s)"),l(),s("ngForOf",e.products)}}function k5(a,d){if(a&1&&(i(0,"div",236)(1,"div",68)(2,"div",237)(3,"h3",82),n(4,"Shipment Terms"),t()(),i(5,"div",238),u(6,O5,9,3,"div",239),t()()()),a&2){let e=p(2);l(6),s("ngForOf",e.poDetails==null?null:e.poDetails.shipment_terms)}}function F5(a,d){a&1&&(i(0,"span",19),n(1,"Choose file"),t())}function M5(a,d){a&1&&(i(0,"span",19),n(1,"Uploading..."),t())}function A5(a,d){if(a&1&&x(0,"app-loader",207),a&2){let e=p(2);s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function N5(a,d){if(a&1){let e=I();i(0,"li",251)(1,"p",252)(2,"a",253),n(3),t(),i(4,"span",254)(5,"i",255),S("click",function(){let r=b
1(e).$implicit,c=p(2);return y(c.OnClickDeleteTermsDoc(r.name))}),t()()()()}if(a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function V5(a,d){if(a&1&&(i(0,"div")(1,"div",256)(2,"div",91)(3,"ul",257)(4,"li",258)(5,"b",19),n(6,"Gross Total:"),t(),i(7,"span",259),n(8),_(9,"currencyFormat"),t()(),i(10,"li",258)(11,"b",19),n(12,"Discount:"),t(),i(13,"span",260),n(14),_(15,"currencyFormat"),t()(),i(16,"li",258)(17,"b",19),n(18,"Net Total:"),t(),i(19,"span",259),n(20),_(21,"currencyFormat"),t()(),i(22,"li",261)(23,"span",19),n(24,"SGST:"),t(),i(25,"span",259),n(26),_(27,"currencyFormat"),t()(),i(28,"li",261)(29,"span",19),n(30,"CGST:"),t(),i(31,"span",259),n(32),_(33,"currencyFormat"),t()(),i(34,"li",261)(35,"span",19),n(36,"IGST:"),t(),i(37,"span",259),n(38),_(39,"currencyFormat"),t()(),i(40,"li",258)(41,"b",19),n(42,"Total Tax Amount:"),t(),i(43,"span",259),n(44),_(45,"currencyFormat"),t()(),i(46,"li",258)(47,"b",19),n(48,"Logistics:"),t(),i(49,"span",259),n(50),_(51,"currencyFormat"),t()(),i(52,"li",258)(53,"b",19),n(54,"Insurance:"),t(),i(55,"span",259),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",262)(59,"span",19),n(60,"Total Payable Amount:"),t(),i(61,"span",259),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.poDetails==null?null:e.poDetails.gross)),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),f(v(21,14,e.poDetails==null?null:e.poDetails.net_charges)),l(6),f(v(27,16,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(33,18,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(39,20,e.poDetails==null?null:e.poDetails.igst)),l(6),f(v(45,22,e.poDetails==null?null:e.poDetails.gst_amount)),l(6),f(v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges)),l(6),f(v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges)),l(6),f(v(63,28,e.poDetails==null?null:e.poDetails.total_amount))}}function B5(a,d){if(a&1&&(i(0,"div")(1,"div",256)(2,"div",91)(3,"ul",257)(4,"li",258)(5,"b",19),n(6,"Gross Total:"),t(),i(7,"span",259),n(8),_(9,"currencyFormat"),t()(),i(10,"li",258)(11,"b",19),n(12,"Discount:"),t(),i(13,"span",260),n(14),_(15,"currencyFormat"),t()(),i(16,"li",258)(17,"b",19),n(18,"Net Total:"),t(),i(19,"span",259),n(20),_(21,"currencyFormat"),t()(),i(22,"li",261)(23,"span",19),n(24,"SGST:"),t(),i(25,"span",259),n(26),_(27,"currencyFormat"),t()(),i(28,"li",261)(29,"span",19),n(30,"CGST:"),t(),i(31,"span",259),n(32),_(33,"currencyFormat"),t()(),i(34,"li",261)(35,"span",19),n(36,"IGST:"),t(),i(37,"span",259),n(38),_(39,"currencyFormat"),t()(),i(40,"li",258)(41,"b",19),n(42,"Total Tax Amount:"),t(),i(43,"span",259),n(44),_(45,"currencyFormat"),t()(),i(46,"li",258)(47,"b",19),n(48,"Logistics:"),t(),i(49,"span",259),n(50),_(51,"currencyFormat"),t()(),i(52,"li",258)(53,"b",19),n(54,"Insurance:"),t(),i(55,"span",259),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",262)(59,"span",19),n(60,"Total Payable Amount:"),t(),i(61,"span",259),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.poDetails==null?null:e.poDetails.gross)),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),f(v(21,14,e.poDetails==null?null:e.poDetails.net_charges)),l(6),f(v(27,16,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(33,18,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(39,20,e.poDetails==null?null:e.poDetails.igst)),l(6),f(v(45,22,e.poDetails==null?null:e.poDetails.gst_amount)),l(6),f(v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges)),l(6),f(v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges)),l(6),f(v(63,28,e.poDetails==null?null:e.poDetails.total_amount))}}function R5(a,d){if(a&1&&(i(0,"div")(1,"div",256)(2,"div",91)(3,"ul",257)(4,"li",258)(5,"b",19),n(6,"Total Bid Value:"),t(),i(7,"span",259),n(8),_(9,"currencyFormat"),t()(),i(10,"li",261)(11,"span",19),n(12,"SGST:"),t(),i(13,"span",259),n(14),_(15,"currencyFormat"),t()(),i(16,"li",261)(17,"span",19),n(18,"CGST:"),t(),i(19,"span",259),n(20),_(21,"currencyFormat"),t()(),i(22,"li",261)(23,"span",19),n(24,"IGST:"),t(),i(25,"span",259),n(26),_(27,"currencyFormat"),t()(),i(28,"li",258)(29,"b",19),n(30,"Total Tax Amount:"),t(),i(31,"span",259),n(32),_(33,"currencyFormat"),t()(),i(34,"li",258)(35,"b",19),n(36,"Logistics:"),t(),i(37,"span",259),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",262)(41,"span",19),n(42,"Total Payable Amou
1nt:"),t(),i(43,"span",259),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,7,e.poDetails==null?null:e.poDetails.gross)),l(6),f(v(15,9,e.poDetails==null?null:e.poDetails.sgst)),l(6),f(v(21,11,e.poDetails==null?null:e.poDetails.cgst)),l(6),f(v(27,13,e.poDetails==null?null:e.poDetails.igst)),l(6),f(v(33,15,e.poDetails==null?null:e.poDetails.gst_amount)),l(6),f(v(39,17,e.poDetails==null?null:e.poDetails.logistics_charges)),l(6),f(v(45,19,e.totalAmount))}}function L5(a,d){a&1&&(i(0,"span"),x(1,"i",263),i(2,"span",19),n(3,"Send To Buyer"),t()())}function q5(a,d){a&1&&(i(0,"span")(1,"div",128)(2,"span",129),n(3,"Loading..."),t()(),i(4,"span",19),n(5,"Sending..."),t()())}function G5(a,d){if(a&1&&(i(0,"span",94),n(1),t()),a&2){let e,o=p(3);l(),f((e=o.sendToBuyerForm.get("sellerGst"))==null?null:e.value)}}function U5(a,d){a&1&&(i(0,"span",179),n(1,"Not Selected"),t())}function j5(a,d){if(a&1&&(i(0,"div",149),x(1,"img",150),t()),a&2){let e=p(3);l(),s("src",e.OrderDetails.seller_details.company_logoViewPath,q)}}function $5(a,d){if(a&1&&(i(0,"div",68)(1,"div",69)(2,"h3",82),n(3,"Company Bank Details"),t()(),i(4,"div",71)(5,"div",278)(6,"div",279)(7,"span",280),x(8,"i",37),t(),i(9,"div",281)(10,"h4",282),n(11),t(),i(12,"span",283),n(13),t()()(),i(14,"div",284)(15,"div",175)(16,"span",285),n(17,"Account Holder"),t(),i(18,"span",286),n(19),t()(),i(20,"div",175)(21,"span",285),n(22,"Account Number"),t(),i(23,"span",286),n(24),t()(),i(25,"div",175)(26,"span",285),n(27,"IFSC Code"),t(),i(28,"span",286),n(29),t()(),i(30,"div",175)(31,"span",285),n(32,"Branch"),t(),i(33,"span",286),n(34),t()()()()()()),a&2){let e,o,r,c,g,h,C=p(3);l(11),m("",(e=C.sendToBuyerForm.get("bankName"))==null?null:e.value," "),l(2),f((o=C.sendToBuyerForm.get("branch"))==null?null:o.value),l(6),f((r=C.sendToBuyerForm.get("accountName"))==null?null:r.value),l(5),f((c=C.sendToBuyerForm.get("accountNumber"))==null?null:c.value),l(5),f((g=C.sendToBuyerForm.get("ifscCode"))==null?null:g.value),l(5),f((h=C.sendToBuyerForm.get("branch"))==null?null:h.value)}}function z5(a,d){a&1&&(i(0,"div",85),n(1,"PO No."),t())}function W5(a,d){a&1&&(i(0,"div",85),n(1,"WO No."),t())}function Q5(a,d){if(a&1&&(i(0,"div",84)(1,"div",85),n(2," Payment Mode "),t(),i(3,"div",86),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.OrderDetails==null?null:e.OrderDetails.payment_mode," ")}}function Y5(a,d){if(a&1&&(i(0,"li",251)(1,"p",252)(2,"a",253),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),D("",e.docName," - ",e.name,"")}}function H5(a,d){a&1&&(i(0,"span",215),n(1,"No documents uploaded"),t())}function K5(a,d){if(a&1&&(i(0,"div",68)(1,"div",69)(2,"h3",82),n(3,"Additional Documents"),t()(),i(4,"div",71)(5,"ul",287),u(6,Y5,4,3,"li",121),t(),u(7,H5,2,0,"span",214),t()()),a&2){let e=p(3);l(6),s("ngForOf",e.uploadedAdditionalDocs),l(),s("ngIf",!e.uploadedAdditionalDocs.length)}}function Z5(a,d){if(a&1&&(i(0,"p",178)(1,"span",132),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",(e.OrderDetails==null?null:e.OrderDetails.buyer_company_name)||(e.shippingAddress==null?null:e.shippingAddress.company_name),"")}}function J5(a,d){if(a&1&&(i(0,"p",178)(1,"span",132),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",(e.OrderDetails==null?null:e.OrderDetails.buyer_company_name)||(e.billingAddress==null?null:e.billingAddress.company_name),"")}}function X5(a,d){if(a&1&&(i(0,"span",94),n(1),t()),a&2){let e=p(3);l(),f(e.OrderDetails==null?null:e.OrderDetails.gstn)}}function e6(a,d){a&1&&(i(0,"span",179),n(1,"Not Available"),t())}function t6(a,d){a&1&&(i(0,"th",19),n(1," Product Name"),t())}function i6(a,d){a&1&&(i(0,"th",19),n(1," Service Name"),t())}function n6(a,d){if(a&1&&(i(0,"thead",180)(1,"tr"),u(2,t6,2,0,"th",30)(3,i6,2,0,"th",30),i(4,"th",19),n(5," Product ID"),t(),i(6,"th",19),n(7," Quantity"),t(),i(8,"th",19),n(9," Quoted"),t(),i(10,"th",19),n(11," Discount"),t(),i(12,"th",19),n(13," Gross Total"),t(),i(14,"th",19),n(15," GST"),t(),i(16,"th",19),n(17," Net Payable"),t()()()),a&2){let e=p(3);l(2),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function a6(a,d){a&1&&(i(0,"thead",180)(1,"tr")(2,"th",19),n(3," Product Name"),t(),i(4,"th",19),n(5," Product ID"),t(),i(6,"th",19),n(7," Quantity"),t(),i(8,"th",19),n(9," Quoted"),t(),i(10,"th",19),n(11," Discount"),t(),i(12,"th",19),n(13," Gross Total"),t(),i(14,"th",19),n(15," GST"),t(),i(16,"th",19),n(17," Net Payable"),t()()())}function r6(a,d){a&1&&(i(0,"thead",180)(1,"tr")(2,"th",19),n(3," Product Name"),t(),i(4,"th",19),n(5," Product ID"),t(),i(6,"th",19),n(7," Quantity"),t(),i(8,"th",19),n(9," Bid Total Value"),t(),i(10,"th",19),n(11,"Logistics "),t(),i(12,"th",19),n(13,"Tax"),t(),i(14,"th",19),n(15,"Net Payable"),t()()())}function l6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function o6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function s6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function d6(a,d){if(a&1&&(F(0),i(1,"div",185),n(2),t(),i(3,"p",186),u(4,l6,2,2,"span",187)(5,o6,2,2,"span",187)(6,s6,2,2,"span",187),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function c6(a,d){if(a&1&&(F(0),i(1,"div",185)(2,"div")(3,"p",189),n(4),_(5,"currencyFormat"),t(),i(6,"p",189),n(7),_(8,"currencyFormat"),t(),i(9,"p",189),n(10),_(11,"currencyFormat"),t(),i(12,"p",189),n(13),_(14,"currencyFormat"),t(),i(15,"p",189),n(16),_(17,"currencyFormat"),t(),i(18,"p",189),n(19),_(20,"currencyFormat"),t(),i(21,"p",189),n(22),_(23,"currencyFormat"),t(),i(24,"p",189),n(25),_(26,"currencyFormat"),t(),i(27,"p",189),n(28),_(29,"currencyFormat"),t(),x(30,"div",190),i(31,"p",178)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst)," "),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst)," "),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst)," "),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst)," "),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function p6(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span"),n(3),t(),u(4,d6,7,4,"ng-template",null,3,P),x(6,"i",183),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,c6,35,34,"ng-template",null,4,P),x(30,"i",183),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),m(" ",e.product_name,""),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.discount)),l(3),f(v(21,14,e.gross_total)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function m6(a,d){if(a&1&&(i(0,"tbody"),u(1,p6,31,20,"tr",181),t()),a&2){let e=p(3);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function u6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function _6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function v6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function g6(a,d){if(a&1&&(F(0),i(1,"div",185),n(2),t(),i(3,"p",186),u(4,u6,2,2,"span",187)(5,_6,2,2,"span",187)(6,v6,2,2,"span",187),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function f6(a,d){if(a&1&&(F(0),i(1,"div",185)(2,"div")(3,"p",189),n(4),_(5,"currencyFormat"),t(),i(6,"p",189),n(7),_(8,"currencyFormat"),t(),i(9,"p",189),n(10),_(11,"currencyFormat"),t(),i(12,"p",189),n(13),_(14,"currencyFormat"),t(),i(15,"p",189),n(16),_(17,"currencyFormat"),t(),i(18,"p",189),n(19),_(20,"currencyFormat"),t(),i(21,"p",189),n(22),_(23,"currencyFormat"),t(),i(24,"p",189),n(25),_(26,"currencyFormat"),t(),i(27,"p",189),n(28),_(29,"currencyFormat"),t(),x(30,"div",190),i(31,"p",178)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst)," "),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst)," "),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst)," "),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst)," "),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function h6(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span"),n(3),t(),u(4,g6,7,4,"ng-template",null,3,P),x(6,"i",183),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,f6,35,34,"ng-template",null,4,P),x(30,"i",183),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),m(" ",e.product_name,""),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.discount)),l(3),f(v(21,14,e.gross_total)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function x6(a,d){if(a&1&&(i(0,"tbody"),u(1,h6,31,20,"tr",181),t()),a&2){let e=p(3);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function b6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function y6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function S6(a,d){if(a&1&&(i(0,"span",188),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function C6(a,d){if(a&1&&(F(0),i(1,"div",185),n(2),t(),i(3,"p",186),u(4,b6,2,2,"span",187)(5,y6,2,2,"span",187)(6,S6,2,2,"span",187),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function E6(a,d){if(a&1&&(F(0),i(1,"div",185)(2,"div")(3,"p",189),n(4),_(5,"currencyFormat"),t(),i(6,"p",189),n(7),_(8,"currencyFormat"),t(),i(9,"p",189),n(10),_(11,"currencyFormat"),t(),x(12,"div",190),i(13,"p",178)(14,"b"),n(15),_(16,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Bid Total Value: ",v(5,4,e.gross_total)," "),l(3),m(" Tax: ",v(8,6,e.gst)," "),l(3),m(" Logistics: ",v(11,8,e.logistics_charges)," "),l(5),m("Net Price: ",v(16,10,e.net_amount)," ")}}function I6(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span"),n(3),t(),u(4,C6,7,4,"ng-template",null,3,P),x(6,"i",183),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),t(),i(20,"td"),n(21),_(22,"currencyFormat"),u(23,E6,17,12,"ng-template",null,4,P),x(25,"i",183),t()()),a&2){let e=d.$implicit,o=w(5),r=w(24);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),m(" ",v(13,9,e.gross_total),""),l(3),m(" ",v(16,11,e.logistics_charges)," "),l(3),m(" ",v(19,13,e.gst),""),l(3),m(" ",v(22,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function D6(a,d){if(a&1&&(i(0,"tbody"),u(1,I6,26,17,"tr",181),t()),a&2){let e=p(3);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function T6(a,d){if(a&1&&(i(0,"li",251)(1,"p",252)(2,"a",253),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.viewPath,q),l(),f(e.name)}}function w6(a,d){if(a&1&&(i(0,"div",60)(1,"div",17)(2,"label",291),n(3,"Uploaded Document(s)"),t(),i(4,"ul",292),u(5,T6,4,2,"li",121),t()()()),a&2){let e=p(4);l(5),s("ngForOf",e.uploadedTermsDocs)}}function P6(a,d){if(a&1&&(i(0,"div",288)(1,"div",60)(2,"div",17)(3,"label",289),n(4,"Terms & Conditions:"),t(),i(5,"p",112),n(6),t()()(),u(7,w6,6,1,"div",290),t()),a&2){let e=p(3);l(6),m("",e.poDetails==null?null:e.poDetails.terms," "),l(),s("ngIf",e.uploadedTermsDocs.length)}}function O6(a,d){if(a&1&&(i(0,"div")(1,"div",256)(2,"div",91)(3,"ul",257)(4,"li",258)(5,"b",19),n(6,"Gross Total:"),t(),i(7,"span",259),n(8),_(9,"currencyFormat"),t()(),i(10,"li",258)(11,"b",19),n(12,"Discount:"),t(),i(13,"span",260),n(14),_(15,"currencyFormat"),t()(),i(16,"li",258)(17,"b",19),n(18,"Net Total:"),t(),i(19,"span",259),n(20),_(21,"currencyFormat"),t()(),i(22,"li",261)(23,"span",19),n(24,"SGST: "),t(),i(25,"span",259),n(26),_(27,"currencyFormat"),t()(),i(28,"li",261)(29,"span",19),n(30,"CGST: "),t(),i(31,"span",259),n(32),_(33,"currencyFormat"),t()(),i(34,"li",261)(35,"span",19),n(36,"IGST:"),t(),i(37,"span",259),n(38),_(39,"currencyFormat"),t()(),i(40,"li",258)(41,"b",19),n(42,"Total Tax Amount:"),t(),i(43,"span",259),n(44),_(45,"currencyFormat"),t()(),i(46,"li",258)(47,"b",19),n(48,"Logistics:"),t(),i(49,"span",259),n(50),_(51,"currencyFormat"),t()(),i(52,"li",258)(53,"b",19),n(54,"Insurance:"),t(),i(55,"span",259),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",262)(59,"span",19),n(60,"Total Payable Amou
1nt:"),t(),i(61,"span",259),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function k6(a,d){if(a&1&&(i(0,"div")(1,"div",256)(2,"div",91)(3,"ul",257)(4,"li",258)(5,"b",19),n(6,"Gross Total:"),t(),i(7,"span",259),n(8),_(9,"currencyFormat"),t()(),i(10,"li",258)(11,"b",19),n(12,"Discount:"),t(),i(13,"span",260),n(14),_(15,"currencyFormat"),t()(),i(16,"li",258)(17,"b",19),n(18,"Net Total:"),t(),i(19,"span",259),n(20),_(21,"currencyFormat"),t()(),i(22,"li",261)(23,"span",19),n(24,"SGST: "),t(),i(25,"span",259),n(26),_(27,"currencyFormat"),t()(),i(28,"li",261)(29,"span",19),n(30,"CGST: "),t(),i(31,"span",259),n(32),_(33,"currencyFormat"),t()(),i(34,"li",261)(35,"span",19),n(36,"IGST:"),t(),i(37,"span",259),n(38),_(39,"currencyFormat"),t()(),i(40,"li",258)(41,"b",19),n(42,"Total Tax Amount:"),t(),i(43,"span",259),n(44),_(45,"currencyFormat"),t()(),i(46,"li",258)(47,"b",19),n(48,"Logistics:"),t(),i(49,"span",259),n(50),_(51,"currencyFormat"),t()(),i(52,"li",258)(53,"b",19),n(54,"Insurance:"),t(),i(55,"span",259),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",262)(59,"span",19),n(60,"Total Payable Amount:"),t(),i(61,"span",259),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function F6(a,d){if(a&1&&(i(0,"div")(1,"div",256)(2,"div",91)(3,"ul",257)(4,"li",258)(5,"b",19),n(6,"Total Bid Value:"),t(),i(7,"span",259),n(8),_(9,"currencyFormat"),t()(),i(10,"li",261)(11,"span",19),n(12,"SGST:"),t(),i(13,"span",259),n(14),_(15,"currencyFormat"),t()(),i(16,"li",261)(17,"span",19),n(18,"CGST:"),t(),i(19,"span",259),n(20),_(21,"currencyFormat"),t()(),i(22,"li",261)(23,"span",19),n(24,"IGST:"),t(),i(25,"span",259),n(26),_(27,"currencyFormat"),t()(),i(28,"li",258)(29,"b",19),n(30,"Total Tax Amount:"),t(),i(31,"span",259),n(32),_(33,"currencyFormat"),t()(),i(34,"li",258)(35,"b",19),n(36,"Logistics:"),t(),i(37,"span",259),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",262)(41,"span",19),n(42,"Total Payable Amount:"),t(),i(43,"span",259),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,7,e.poDetails==null?null:e.poDetails.gross),""),l(6),m(" ",v(15,9,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(21,11,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(27,13,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(33,15,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(39,17,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),f(v(45,19,e.totalAmount))}}function M6(a,d){if(a&1){let e=I();i(0,"div",264)(1,"div",180)(2,"div",10)(3,"div",16)(4,"button",41),S("click",function(){b(e);let r=p(2);return y(r.OnCloseModal())}),n(5,"\xD7"),t(),i(6,"div",89)(7,"div",60)(8,"h3",265),n(9,"Proforma Invoice"),t()()(),i(10,"div",89)(11,"div",266)(12,"div",267)(13,"div",131)(14,"p",132),n(15,"Shipping From :"),t(),i(16,"p",95)(17,"span",19),n(18,"Seller Name:"),t(),i(19,"span",94),n(20),t()(),i(21,"p",95)(22,"span",19),n(23,"GST No:"),t(),u(24,G5,2,1,"span",96
1)(25,U5,2,0,"span",97),t(),i(26,"p",95)(27,"span",19),n(28,"Seller Address:"),t(),x(29,"br"),i(30,"span",94),n(31),t()()()()(),i(32,"div",268),u(33,j5,2,1,"div",148),t()(),u(34,$5,35,6,"div",81),i(35,"div",68)(36,"div",69)(37,"h3",82),n(38,"Proforma Invoice"),t()(),i(39,"div",71)(40,"div",83)(41,"div",84)(42,"div",85),n(43,"Additional Services Documents"),t(),i(44,"div",86),n(45),t()(),i(46,"div",84)(47,"div",85),n(48,"Invoice State/City"),t(),i(49,"div",86),n(50),t()(),i(51,"div",84),u(52,z5,2,0,"div",87)(53,W5,2,0,"div",87),i(54,"div",86),n(55),t()(),u(56,Q5,5,1,"div",88),t()()(),u(57,K5,8,2,"div",81),i(58,"div",68)(59,"div",69)(60,"h3",82),n(61,"Buyer Address"),t()(),i(62,"div",71)(63,"div",89)(64,"div",45)(65,"div",90)(66,"div",91)(67,"p",269)(68,"span",19),n(69,"Shipping Address :"),t()(),u(70,Z5,4,1,"p",93),i(71,"p",94),n(72),t()()()(),i(73,"div",45)(74,"div",90)(75,"div",91)(76,"p",92),n(77,"Billing Address : "),t(),u(78,J5,4,1,"p",93),i(79,"p",95)(80,"span",19),n(81,"GST No:"),t(),u(82,X5,2,1,"span",96)(83,e6,2,0,"span",97),t(),i(84,"p",94),n(85),t()()()()()()(),i(86,"div",76)(87,"div",60)(88,"div",267)(89,"div",270)(90,"a",271),n(91," Order Summary "),t()(),i(92,"div",99)(93,"div",91)(94,"div",101)(95,"div",272)(96,"table",103),u(97,n6,18,2,"thead",104)(98,a6,18,0,"thead",104)(99,r6,16,0,"thead",104)(100,m6,2,1,"tbody",105)(101,x6,2,1,"tbody",105)(102,D6,2,1,"tbody",105),t()()()()()()()(),i(103,"div",273)(104,"div",274)(105,"div",89),u(106,P6,8,2,"div",275),t()(),i(107,"div",276),u(108,O6,64,30,"div",105)(109,k6,64,30,"div",105)(110,F6,46,21,"div",105),t()()(),i(111,"div",27)(112,"button",277),S("click",function(){b(e);let r=p(2);return y(r.OnCloseModal())}),n(113," Close "),t()()()()()}if(a&2){let e,o,r=p(2);l(20),f(r.OrderDetails==null?null:r.OrderDetails.seller_address.firstname),l(4),s("ngIf",(e=r.sendToBuyerForm.get("sellerGst"))==null?null:e.value),l(),s("ngIf",!((o=r.sendToBuyerForm.get("sellerGst"))!=null&&o.value)),l(6),se(" ",r.OrderDetails==null?null:r.OrderDetails.seller_address.street,", ",r.OrderDetails==null?null:r.OrderDetails.seller_address.region,", ",r.OrderDetails==null?null:r.OrderDetails.seller_address.city,",",r.OrderDetails==null?null:r.OrderDetails.seller_address.postcode,""),l(2),s("ngIf",r.OrderDetails&&r.OrderDetails.seller_details&&r.OrderDetails.seller_details.company_logoViewPath),l(),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.payment_mode)!=="Cash"),l(11),f(r.OrderDetails==null?null:r.OrderDetails.service_documents_required),l(5),f(r.shippingAddress==null?null:r.shippingAddress.region),l(2),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),f(r.OrderDetails==null?null:r.OrderDetails.po_number),l(),s("ngIf",r.OrderDetails.source==="rfq"),l(),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.service_documents_required)==="yes"),l(13),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.buyer_company_name)||(r.shippingAddress==null?null:r.shippingAddress.company_name)),l(2),se(" ",r.shippingAddress==null?null:r.shippingAddress.street,", ",r.shippingAddress==null?null:r.shippingAddress.region,",",r.shippingAddress==null?null:r.shippingAddress.city," ,",r.shippingAddress==null?null:r.shippingAddress.postcode," "),l(6),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.buyer_company_name)||(r.billingAddress==null?null:r.billingAddress.company_name)),l(4),s("ngIf",r.OrderDetails==null?null:r.OrderDetails.gstn),l(),s("ngIf",!(r.OrderDetails!=null&&r.OrderDetails.gstn)),l(2),se(" ",r.billingAddress==null?null:r.billingAddress.street,", ",r.billingAddress==null?null:r.billingAddress.region,",",r.billingAddress==null?null:r.billingAddress.city," ,",r.billingAddress==null?null:r.billingAddress.postcode," "),l(11),s("ngSwitch",r.poDetails==null?null:r.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(4),s("ngIf",(r.poDetails==null?null:r.poDetails.shipments)=="no"&&(r.poDetails==null?null:r.poDetails.instalments)=="no"),l(),s("ngSwitch",r.poDetails==null?null:r.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction")}}function A6(a,d){if(a&1){let e=I();i(0,"div",293)(1,"div")(2,"div",10)(3,"div",294)(4,"div",295),x(5,"i",296),t(),i(6,"p",297),n(7," Invoice has been successfully sent to buyer"),t(),i(8,"a",298),S("click",function(){b(e);let r=p(2);return y(r.SendTOBuyerView())}),n(9,"Okay"),t()()()()()}}function N6(a,d){if(a&1){let e=I();i(0,"div",58)(1,"form",59)(2,"div",60)(3,"div",61)(4,"div",62)(5,"h2",63)(6,"a",64),x(7,"i",65),t(),i(8,"span",19),n(9,"Proforma Invoice"),t()()(),i(10,"div",66)(11,"button",67),S("click",function(){b(e);let r=p();return y(r.printPO())}),u(12,sE,4,0,"span",31)(13,dE,6,0,"span",31),t()()()(),i(14,"div",60)(15,"div",68)(16,"div",69)(17,"h3",70),u(18,cE,2,0,"span",30)(19,pE,2,0,"span",30),n(20),t()(),i(21,"div",71)(22,"div",72)(23,"div",73),u(24,fE,30,6,"div",74),t(),u(25,xE,2,1,"div",75),t(),i(26,"div",76)(27,"div",77)(28,"div",17)(29,"label",78)(30,"span",19),n(31,"Invoice Created Date"),t(),i(32,"sup",20),n(33,"*"),t()(),x(34,"input",79),u(35,yE,2,1,"div",22),t()(),i(36,"div",77)(37,"div",17)(38,"label",78)(39,"span",19),n(40,"Invoice Due In Day(s)"),t(),i(41,"sup",20),n(42,"*"),t()(),x(43,"input",80),u(44,EE,3,2,"div",22),t()()()()(),u(45,PE,27,5,"div",81),i(46,"div",68)(47,"div",69)(48,"h3",82),n(49,"Proforma Invoice"),t()(),i(50,"div",71)(51,"div",83)(52,"div",84)(53,"div",85),n(54,"Additional Documents"),t(),i(55,"div",86),n(56),t()(),i(57,"div",84),u(58,OE,2,0,"div",87)(59,kE,2,0,"div",87),i(60,"div",86),n(61),t()(),i(62,"div",84),u(63,FE,2,0,"div",87)(64,ME,2,0,"div",87),i(65,"div",86),n(66),t()(),u(67,AE,5,1,"div",88),t()()(),i(68,"div",68)(69,"div",69)(70,"h3",82),n(71,"Buyer Address"),t()(),i(72,"div",71)(73,"div",89)(74,"div",45)(75,"div",90)(76,"div",91)(77,"p",92),n(78,"Shipping Address : "),t(),u(79,NE,4,1,"p",93),i(80,"p",94),n(81),t()()()(),i(82,"div",45)(83,"div",90)(84,"div",91)(85,"p",92),n(86,"Billing Address : "),t(),u(87,VE,4,1,"p",93),i(88,"p",95)(89,"span",19),n(90,"GST No:"),t(),u(91,BE,2,1,"span",96
1)(92,RE,2,0,"span",97),t(),i(93,"p",94),n(94),t()()()()()()(),i(95,"div",68)(96,"div",98)(97,"h3",82),n(98,"Order Summary"),t()(),i(99,"div",99)(100,"div",100)(101,"div",101)(102,"div",102)(103,"table",103),u(104,GE,18,2,"thead",104)(105,UE,16,0,"thead",104)(106,jE,16,0,"thead",104)(107,KE,2,1,"tbody",105)(108,n5,2,1,"tbody",105)(109,c5,2,1,"tbody",105),t()()()()()(),u(110,C5,21,2,"div",106)(111,w5,8,1,"div",107)(112,k5,7,1,"div",108),i(113,"div",109)(114,"div",110)(115,"div",111)(116,"div",69)(117,"h3",82),n(118,"Terms & Conditions:"),t()(),i(119,"div",71)(120,"div",17)(121,"p",112),n(122),t()(),i(123,"div",113)(124,"div",114)(125,"div",115)(126,"div",116)(127,"label",117),n(128,"Upload Proforma Invoice Terms Document(s)"),t(),i(129,"input",118),S("change",function(r){b(e);let c=p();return y(c.OnTermsDocUpload(r))}),t(),i(130,"label",119),u(131,F5,2,0,"span",30)(132,M5,2,0,"span",30),t(),u(133,A5,1,2,"app-loader",25),t()(),i(134,"div",113)(135,"ul",120),u(136,N5,6,2,"li",121),t()()()()()()(),i(137,"div",122),u(138,V5,64,30,"div",105)(139,B5,64,30,"div",105)(140,R5,46,21,"div",105),t()(),i(141,"div",89)(142,"div",123)(143,"button",124),S("click",function(){b(e);let r=w(151),c=p();return y(c.OnClickPreview(r))}),x(144,"i",125),i(145,"span",19),n(146,"Preview"),t()(),i(147,"button",126),S("click",function(){b(e);let r=w(153),c=p();return y(c.OnClickSendToBuyer(r))}),u(148,L5,4,0,"span",31)(149,q5,6,0,"span",31),t()()()()(),u(150,M6,114,40,"ng-template",null,1,P)(152,A6,10,0,"ng-template",null,2,P),t()}if(a&2){let e,o,r=p();l(),s("formGroup",r.sendToBuyerForm),l(10),s("disabled",r.isPrintLoading||r.loadingStates.sendToBuyer),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(5),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(),m(" ",r.OrderDetails==null?null:r.OrderDetails.po_number," "),l(4),s("ngIf",r.OrderDetails.seller_address),l(),s("ngIf",r.OrderDetails&&r.OrderDetails.seller_details&&r.OrderDetails.seller_details.company_logoViewPath),l(10),s("ngIf",((e=r.sendToBuyerForm.get("creationDate"))==null?null:e.touched)&&((e=r.sendToBuyerForm.get("creationDate"))==null?null:e.dirty)||r.submitted),l(8),s("min",1),l(),s("ngIf",((o=r.sendToBuyerForm.get("invoiceDueDays"))==null?null:o.touched)&&((o=r.sendToBuyerForm.get("invoiceDueDays"))==null?null:o.dirty)||r.submitted),l(),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.payment_mode)!=="Cash"),l(11),f(r.OrderDetails==null?null:r.OrderDetails.service_documents_required),l(2),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),f(r.shippingAddress==null?null:r.shippingAddress.region),l(2),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),f(r.OrderDetails==null?null:r.OrderDetails.po_number),l(),s("ngIf",r.OrderDetails.source==="rfq"),l(12),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.buyer_company_name)||(r.shippingAddress==null?null:r.shippingAddress.company_name)),l(2),m(" ",r.shippingAddress==null?null:r.shippingAddress.full_address," "),l(6),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.buyer_company_name)||(r.billingAddress==null?null:r.billingAddress.company_name)),l(4),s("ngIf",r.OrderDetails==null?null:r.OrderDetails.gstn),l(),s("ngIf",!(r.OrderDetails!=null&&r.OrderDetails.gstn)),l(2),m(" ",r.billingAddress==null?null:r.billingAddress.full_address," "),l(9),s("ngSwitch",r.poDetails==null?null:r.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.service_documents_required)=="yes"),l(),s("ngIf",(r.poDetails==null?null:r.poDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(r.poDetails==null?null:r.poDetails.multiple_shipment_terms)==="YES"),l(10),f(r.poDetails!=null&&r.poDetails.terms?r.poDetails.terms:"No terms provided by the buyer."),l(7),s("disabled",r.loadingStates.termsDocs),l(2),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(3),s("ngForOf",r.uploadedTermsDocs),l(),s("ngSwitch",r.poDetails==null?null:r.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(3),s("disabled",r.loadingStates.sendToBuyer),l(4),s("disabled",r.loadingStates.sendToBuyer),l(),s("ngIf",!r.loadingStates.sendToBuyer),l(),s("ngIf",r.loadingStates.sendToBuyer)}}function V6(a,d){a&1&&(i(0,"div",146),n(1," GST Number is required"),t())}function B6(a,d){a&1&&(i(0,"div",146),n(1," Invalid GST Number format"),t())}function R6(a,d){if(a&1&&(i(0,"div",144),u(1,V6,2,0,"div",145)(2,B6,2,0,"div",145),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.addGSTForm.get("gstNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.addGSTForm.get("gstNumber"))==null||o.errors==null?null:o.errors.pattern)}}function L6(a,d){if(a&1&&x(0,"app-loader",207),a&2){let e=p();s("isLoading",e.loadingStates.gstDocs)("useBlockPosition",!0)}}function q6(a,d){if(a&1){let e=I();i(0,"div",299),x(1,"i",300),i(2,"span",301),n(3),t(),i(4,"button",302),S("click",function(){b(e);let r=p();return y(r.removeGSTDocument())}),x(5,"i",303),t()()}
1if(a&2){let e=p();l(2),s("title",e.gstFileName),l(),m(" ",e.gstFileName||"GST document","")}}function G6(a,d){a&1&&(i(0,"span",19),n(1,"Add GST"),t())}function U6(a,d){a&1&&(i(0,"span")(1,"div",128)(2,"span",129),n(3,"Loading..."),t()(),i(4,"span",19),n(5,"Adding..."),t()())}function j6(a,d){a&1&&(i(0,"span"),n(1,"Account number is required"),t())}function $6(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid account number"),t())}function z6(a,d){if(a&1&&(i(0,"div",304),u(1,j6,2,0,"span",31)(2,$6,2,0,"span",31),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("accountNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("accountNumber"))==null||o.errors==null?null:o.errors.pattern)}}function W6(a,d){a&1&&(i(0,"span"),n(1,"IFSC code is required"),t())}function Q6(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid IFSC code"),t())}function Y6(a,d){if(a&1&&(i(0,"div",304),u(1,W6,2,0,"span",31)(2,Q6,2,0,"span",31),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.bankForm.get("ifsc"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.bankForm.get("ifsc"))==null||o.errors==null?null:o.errors.pattern)}}function H6(a,d){a&1&&(i(0,"div",304),n(1,"Account holder name is required"),t())}function K6(a,d){a&1&&(i(0,"div",304),n(1,"Bank name is required"),t())}function Z6(a,d){a&1&&(i(0,"div",304),n(1,"Branch is required"),t())}function J6(a){document.getElementById(a)?.click()}var Qa=(()=>{class a{constructor(e,o,r,c,g,h,C,k){this.router=e,this.activatedRoute=o,this.financeOrderService=r,this.onboardingService=c,this.financeService=g,this.fb=h,this.dialog=C,this.notificationService=k,this.termsDoc=[],this.termsPath=[],this.gstFileName="",this.uploadedTermsDocs=[],this.bankDetails=[],this.bankSubmitting=!1,this.bankVerifying=!1,this.isLogisticChargesEnabled=!0,this.isInsuranceChargesEnabled=!0,this.additionalServiceDocs=[],this.additionalServiceDocsFiles={},this.rowLoadingStates={},this.isPrintLoading=!1,this.loadingStates={bankDetails:!1,poDetails:!1,orderDetails:!1,sendToBuyer:!1,termsDocs:!1,gstDocs:!1,addGST:!1},this.setMinDate()}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.poId=e.id,this.GetOrderDetailsByPO(),this.GetPoDetailsById(),this.getBankDetails()}),this.sendToBuyerForm=this.fb.group({sellerGst:["",E.required],accountNumber:[""],bankName:[""],accountName:[""],branch:[""],ifscCode:[""],documentName:[""],creationDate:[this.getTodayDate(),E.required],invoiceDueDays:[1,[E.required,E.min(1)]],paymentdisable:[!0],shipmentDisable:[!0],payment:this.fb.array([this.paymentFormArray()]),asn:this.fb.array([this.asnDetails()])}),this.sendToBuyerForm.get("payment").disable(),this.sendToBuyerForm.get("asn").disable(),this.addGSTForm=this.fb.group({gstNumber:["",[E.required,E.pattern(/^([0]{1}[1-9]{1}|[1-2]{1}[0-9]{1}|[3]{1}[0-7]{1})([A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1})$/)]],gstFile:["",E.required]}),this.initializeBankForm()}ngAfterViewInit(){$("#addGSTModal").on("hidden.bs.modal",()=>{this.resetGSTForm()})}get isWorkOrder(){return String(this.OrderDetails?.order_type||this.poDetails?.order_type||"").toUpperCase()==="WO"}get payment(){return this.sendToBuyerForm.get("payment")}get asn(){return this.sendToBuyerForm.get("asn")}prodArray(e){return this.asn.at(e).get("product")}paymentFormArray(){return this.fb.group({paymentTitle:[""],payment:[""],timeline:[""],note:[""]})}asnDetails(){return this.fb.group({shipmentTitle:[""],asnTimeline:[""],shipmentDate:[""],product:this.fb.array([this.prodDetails()])})}prodDetails(){return this.fb.group({productId:[""],noOfProds:[""]})}OnChangePayment(e){let o=e.target.checked;this.sendToBuyerForm.get("paymentdisable").setValue(!o),this.payment.clear(),o?(this.payment.push(this.fb.group({paymentTitle:["",E.required],payment:["",E.required],timeline:["",E.required],note:[""]})),this.payment.enable()):(this.payment.push(this.paymentFormArray()),this.payment.disable())}addAnotherInstallment(){this.payment.push(this.fb.group({paymentTitle:["",E.required],payment:["",E.required],timeline:["",E.required],note:[""]}))}Ondeletepayment(e){this.payment.removeAt(e)}OnChangeShipment(e){let o=e.target.checked;this.sendToBuyerForm.get("shipmentDisable").setValue(!o),this.asn.clear(),o?(this.asn.push(this.fb.group({shipmentTitle:["",E.required],asnTimeline:["",E.required],shipmentDate:["",E.required],product:this.fb.array([this.fb.group({productId:["",E.required],noOfProds:["",E.required]})])})),this.asn.enable()):(this.asn.push(this.asnDetails()),this.asn.disable())}OnAddAnotherAsn(){this.asn.push(this.fb.group({shipmentTitle:["",E.required],asnTimeline:["",E.required],shipmentDate:["",E.required],product:this.fb.array([this.fb.group({productId:["",E.required],noOfProds:["",E.required]})])}))}RemoveShiment(e){this.asn.removeAt(e)}OnAddProducts(e){this.prodArray(e).push(this.fb.group({productId:["",E.required],noOfProds:["",E.required]}))}OndeleteProducts(e,o){this.prodArray(e).removeAt(o)}validatePaymentTerms(){return this.sendToBuyerForm.get("paymentdisable").value?!0:this.payment.getRawValue().reduce((r,c)=>r+Number(c.payment||0),0)!==100?(this.notificationService.showError("Payment percentages must add up to 100%"),!1):!0}validateShipmentTerms(){if(!!this.sendToBuyerForm.get("shipmentDisable").value)return!0;for(let o of this.OrderDetails?.items||[])if(this.asn.getRawValue().reduce((c,g)=>c+g.product.filter(h=>
1Number(h.productId)===Number(o.product_id)).reduce((h,C)=>h+Number(C.noOfProds||0),0),0)!==Number(o.required_qty))return this.notificationService.showError(`Shipment quantities for "${o.product_name}" must match PO quantity (${o.required_qty})`),!1;return!0}getTodayDate(){let e=new Date,o=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0"),c=e.getFullYear();return`${o}-${r}-${c}`}setMinDate(){let e=new Date;this.todaysDate=e.toISOString().split("T")[0]}SendTOBuyerView(){this.dialogRef.close(),this.router.navigate(["finance-management/receivable-purchase-orders/view"],{queryParams:{invoiceId:this.invoiceId},replaceUrl:!0})}OnClickPreview(e){this.previewDialogRef=this.dialog.open(e)}OnCloseModal(){this.previewDialogRef.close()}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}getBankDetails(){this.loadingStates.bankDetails=!0,this.onboardingService.bankdetailsList().subscribe({next:e=>{e.responseCode===200?this.bankDetails=e.response.list:this.notificationService.showError("Something went wrong!"),this.loadingStates.bankDetails=!1},error:e=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.bankDetails=!1}})}GetPoDetailsById(){try{this.loadingStates.poDetails=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe(o=>{this.poDetails=o.response.data,this.poDetails.logistics_charges=this.poDetails.logistics_charges||null,this.poDetails.insurance_charges=this.poDetails.insurance_charges||null,this.poDetails.tempTotalValue=Number(this.poDetails.total_amount);let r=this.poDetails.items||[];(this.poDetails.shipment_terms||[]).forEach(c=>{(c.products||[]).forEach(g=>{let h=r.find(C=>g.po_item_id&&Number(C.item_id)===Number(g.po_item_id)||g.product_id&&Number(C.product_id)===Number(g.product_id));h&&(g.product_name=g.product_name||h.product_name,g.sku=g.sku||h.sku||h.display_item_id)})}),this.loadingStates.poDetails=!1},o=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.poDetails=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.poDetails=!1}}get totalAmount(){if(this.poDetails&&this.poDetails.gross)return this.poDetails.gross-this.poDetails.discount_amount+this.poDetails.gst_amount+this.poDetails.shipping_charges+this.poDetails.logistics_charges+this.poDetails.insurance_charges}GetOrderDetailsByPO(){try{this.loadingStates.orderDetails=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe(o=>{this.OrderDetails=o.response.data,this.OrderDetails.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.OrderDetails.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.loadingStates.orderDetails=!1,this.additionalServiceDocs=this.OrderDetails.additionalDocumentsTags.map((r,c)=>({id:c.toString(),name:r,required:!0,max:3})),this.checkForPaymentModeChanges()},o=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1}}OnClickSendToBuyer(e){try{if(this.submitted=!0,!this.validatePaymentTerms()||!this.validateShipmentTerms())return;if(this.sendToBuyerForm.valid){if(this.OrderDetails&&this.OrderDetails.service_documents_required=="yes"){let r=this.validateAdditionalDocuments();if(!r.isValid)return document.getElementById("additional-service-documents-section")?.scrollIntoView({behavior:"smooth",block:"center"}),this.notificationService.showError(r.message)}this.loadingStates.sendToBuyer=!0;let o={};o.po_id=""+this.poId,o.account_name=this.sendToBuyerForm.value.accountName,o.bank_name=this.sendToBuyerForm.value.bankName,o.account_number=this.sendToBuyerForm.value.accountNumber,o.branch=this.sendToBuyerForm.value.branch,o.ifsc=this.sendToBuyerForm.value.ifscCode,o.seller_gst=this.sendToBuyerForm.value.sellerGst,o.invoice_due_days=this.sendToBuyerForm.value.invoiceDueDays,o.advance_note="",o.advance_percentage=0,o.advance_amount=0,o.seller_terms_and_conditions_path=this.uploadedTermsDocs.map(r=>({path:r.path,filename:r.name})),o.additional_documents=[],o.documents=[],Object.keys(this.additionalServiceDocsFiles).forEac
1h(r=>{(this.additionalServiceDocsFiles[r]||[]).forEach(g=>{let h={};h.name=g.name,h.path=g.path,h.docName=g.docName,o.additional_documents.push(h)})}),o.invoice_number="",o.net_amount=this.totalAmount,o.logistics=this.poDetails.logistics_charges||0,o.insurance=this.poDetails.insurance_charges||0,o.multiple_payment_terms=this.poDetails?.multiple_payment_terms||"NO",o.multiple_shipment_terms=this.poDetails?.multiple_shipment_terms||"NO",o.payment_terms=(this.poDetails?.payment_terms||[]).map(r=>({title:r.title||"",percentage:r.percentage||0,amount:r.amount||0,timeline_days:r.timeline_days||0,due_date:r.due_date||"",note:r.note||"",status:r.status||"",gateway_name:r.gateway_name||"",reference_id:r.reference_id||""})),o.shipment_terms=(this.poDetails?.shipment_terms||[]).map(r=>({title:r.title||"",timeline_days:r.timeline_days||0,products:(r.products||[]).map(c=>({product_id:c.product_id||0,product_name:c.product_name||"",po_qty:c.po_qty||"",qty:c.qty||"",unit_price:c.unit_price||0,discount_percentage:c.discount_percentage||0,gst_percentage:c.gst_percentage||0,sku:c.sku||""}))})),this.financeOrderService.CreateInvoice(o).subscribe({next:r=>{r.responseCode===200?(this.invoiceId=r.response.invoice_id,this.invoiceType=r.response.invoice_type,this.dialogRef=this.dialog.open(e,{disableClose:!0}),this.loadingStates.sendToBuyer=!1):(this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToBuyer=!1)},error:r=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToBuyer=!1}})}else{let o=this.sendToBuyerForm.controls;o.sellerGst.invalid?this.notificationService.showError("Please select a GST number."):o.invoiceDueDays.invalid?this.notificationService.showError("Invoice due days must be at least 1."):o.accountNumber.invalid||o.bankName.invalid||o.accountName.invalid||o.branch.invalid||o.ifscCode.invalid?this.notificationService.showError("Please fill in all bank account details."):this.notificationService.showError("Please fill in all required fields."),setTimeout(()=>{this.scrollToFirstItemOfClass("error-field")},500)}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.sendToBuyer=!1}}scrollToFirstItemOfClass(e){let o=document.getElementsByClassName(e);o.length>0&&o[0].scrollIntoView({behavior:"smooth",block:"center"})}OnTermsDocUpload(e){try{let o=e.target.files;if(o.length>0)for(let r=0;r<o.length;r++){let c=o[r];if(this.uploadedTermsDocs.some(h=>(h.name||"").toLowerCase()===c.name.toLowerCase())){this.notificationService.showError(`"${c.name}" is already uploaded. Please choose a different document.`),e.target.value="";continue}this.loadingStates.termsDocs=!0;let g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",this.poDetails.po_number),this.financeOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError("File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},h=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1}}OnClickDeleteTermsDoc(e){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(o=>o.name!==e)}onGSTSelect(e){e.target.value==="select"&&(this.sendToBuyerForm.get("sellerGst").setValue(""),$("#addGSTModal").modal("show"))}onGSTDocumentChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.gstDocs=!0;let r=o[0],c=new FormData;c.append("file",r),c.append("source","company"),c.append("source_id",this.addGSTForm.get("gstNumber").value),this.financeOrderService.FileUpload(c).subscribe({next:g=>{g.responseCode===200?(this.addGSTForm.get("gstFile").setValue(g.response.filepath),this.gstFileName=r.name):this.notificationService.showError("File Upload Failed"),this.loadingStates.gstDocs=!1},error:g=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.gstDocs=!1}})}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.gstDocs=!1}}resetBuyerGST(){this.sendToBuyerForm.get("sellerGst").setValue("")}resetGSTForm(){this.addGSTForm.reset(),this.gstFileName="",this.fileInput&&(this.fileInput.nativeElement.value="")}removeGSTDocument(){this.addGSTForm.get("gstFile").setValue(""),this.gstFileName="",this.fileInput&&(this.fileInput.nativeElement.value="")}addNewGST(){this.loadingStates.addGST=!0;let e={gst:[{gst_number:this.addGSTForm.get("gstNumber").value,gst_document:this.addGSTForm.get("gstFile").value}]};this.financeOrderService.addNewGST(e).subscribe({next:o=>{o.responseCode===200?(this.notificationService.showSuccess(o.response.response),this.resetGSTForm(),this.GetOrderDetailsByPO(),$("#addGSTModal").modal("hide")):this.notificationService.showError("Something went wrong!"),this.loadingStates.addGST=!1},error:o=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.addGST=!1}})}selectBankAccount(e){e&&this.sendToBuyerForm.patchValue({accountNumber:e.account_number,bankName:e.bank_name,accountName:e.account_name,branch:e.branch_name,ifscCode:e.ifsc})}initializeBankForm(){this.bankForm=this.fb.group({accountNumber:["",[E.required,E.pattern("^[0-9]+$")]],ifsc:["",[E.required,E.pattern("^[A-Z]{4}0[A-Z0-9]{6}$")]],accountHolder:["",[E.required]],bankName:["",[E.required]],branch:["",[E.required]]})}saveBankAccount(){let e=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let o=this.bankForm.get("accountNumber");if(o?.setValue(String(o.value??"").replace(/\s/g,""),{emitEvent:!1}
1),this.bankForm.updateValueAndValidity(),this.bankForm.invalid){this.bankForm.markAllAsTouched(),this.notificationService.showError("Please fill all required bank details correctly.");return}let r=this.bankForm.value,c={bank_details:[{bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch,ledger_number:"",micr_code:"",account_type:"",ledger_folio_number:"",cancelled_cheque:"",is_default:"0"}]};this.bankSubmitting=!0,this.onboardingService.AddBankDetails(c).subscribe({next:g=>{this.bankSubmitting=!1,g.responseCode==200?(this.notificationService.showSuccess(g.response?.response||"Bank account added successfully"),this.selectBankAccount({bank_name:r.bankName,account_name:r.accountHolder,account_number:r.accountNumber,ifsc:r.ifsc,branch_name:r.branch}),this.getBankDetails(),this.bankForm.reset(),J6("closeAddBankModal")):this.notificationService.showError(g.response)},error:()=>{this.bankSubmitting=!1,this.notificationService.showError("Failed to add bank account. Please try again.")}})}verifyBankAccount(){let e=this.bankForm.get("accountNumber"),o=this.bankForm.get("ifsc");e?.setValue(String(e.value??"").replace(/\s/g,""),{emitEvent:!1}),o?.setValue(String(o.value??"").replace(/\s/g,"").toUpperCase(),{emitEvent:!1});let r=e?.value,c=o?.value;if(!r||!c){e?.markAsTouched(),o?.markAsTouched(),this.notificationService.showError("Enter account number and IFSC to verify.");return}let g={name:this.bankForm.get("accountHolder")?.value||"",phone:"",account_number:r,ifsc:c};this.bankVerifying=!0,this.financeService.verifyBankAccount(g).subscribe({next:h=>{this.bankVerifying=!1,this.handleBankVerificationResult(h?.response?.data)},error:h=>{this.bankVerifying=!1;let C=h?.error?.response?.data;C?this.handleBankVerificationResult(C):this.notificationService.showError("Bank account verification failed. Please try again.")}})}handleBankVerificationResult(e){if(e?.accountStatus==="VALID"){let o=e?.data||{};this.bankForm.patchValue({accountHolder:o.nameAtBank||this.bankForm.get("accountHolder")?.value||"",bankName:o.bankName||this.bankForm.get("bankName")?.value||"",branch:o.branch||this.bankForm.get("branch")?.value||""}),this.notificationService.showSuccess(e?.message||"Bank account verified successfully.")}else this.notificationService.showError(e?.message||"Unable to verify the bank account.")}checkForPaymentModeChanges(){let e=["accountNumber","bankName","accountName","branch","ifscCode"];this.OrderDetails&&this.OrderDetails.payment_mode==="Cash"?e.forEach(o=>{this.sendToBuyerForm.controls[o].clearValidators(),this.sendToBuyerForm.controls[o].updateValueAndValidity()}):e.forEach(o=>{this.sendToBuyerForm.controls[o].setValidators([E.required]),this.sendToBuyerForm.controls[o].updateValueAndValidity()})}
1get enableLogisticsCharges(){return this.isLogisticChargesEnabled?!0:!!(this.poDetails&&(!this.poDetails.logistics_charges||this.poDetails.logistics_charges===0))}get enableInsuranceCharges(){return this.isInsuranceChargesEnabled?!0:!!(this.poDetails&&(!this.poDetails.insurance_charges||this.poDetails.insurance_charges===0))}updateCharges(){this.poDetails.total_amount=Number(this.poDetails.tempTotalValue)+(Number(this.poDetails.logistics_charges)||0)+(Number(this.poDetails.insurance_charges)||0)}logisticsFocusOut(){this.updateCharges(),this.isLogisticChargesEnabled=!1}insuranceFocusOut(){this.updateCharges(),this.isInsuranceChargesEnabled=!1}isDocumentFull(e){let o=this.additionalServiceDocs.find(c=>c.id===e),r=this.additionalServiceDocsFiles[e]||[];return o?r.length>=o.max:!1}isRowLoading(e){return this.rowLoadingStates[e]||!1}validateAdditionalDocuments(){if(!this.additionalServiceDocs||this.additionalServiceDocs.length===0)return{isValid:!0,message:""};let e=[];for(let o of this.additionalServiceDocs)(this.additionalServiceDocsFiles[o.id]||[]).length===0&&e.push(o.name);return e.length>0?{isValid:!1,message:e.length===1?`Please upload at least one file for: ${e[0]}`:`Please upload at least one file for each of the following documents: ${e.join(", ")}`}:{isValid:!0,message:""}}getDocumentValidationError(e){return this.submitted&&(this.additionalServiceDocsFiles[e]||[]).length===0?`At least one file is required for ${this.additionalServiceDocs.find(c=>c.id===e)?.name||"this document"}`:""}removeFile(e,o){this.additionalServiceDocsFiles[e]&&(this.additionalServiceDocsFiles[e]=this.additionalServiceDocsFiles[e].filter(r=>r.id!==o))}getDocFiles(e){return this.additionalServiceDocsFiles[e]||[]}get uploadedAdditionalDocs(){let e=this.additionalServiceDocsFiles||{};return Object.keys(e).reduce((o,r)=>o.concat(e[r]||[]),[])}getPoType(e){let o=e?.toLowerCase();return o==="rfq"?"PO_RFQ":o==="auction"?"PO_AUCTION":o==="directbuy"||o==="direct"?"PO_DIRECT_BUY":"PO_RFQ"}printPO(){this.isPrintLoading=!0;let e=this.getPoType(this.OrderDetails?.source);this.financeOrderService.printPdf(e,Number(this.poId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1,this.notificationService.showError("Failed to generate print document.")}})}onFileSelected(e,o){let r=e.target.files;if(!r)return;let c=this.additionalServiceDocs.find(Q=>Q.id===o);if(!c)return;let g=this.additionalServiceDocsFiles[o]||[],h=c.max-g.length;if(r.length>h&&h>0){this.notificationService.showError(`You cannot select more than ${h} file(s) for ${c.name}. Maximum ${c.max} files allowed per document.`),e.target.value="";return}else if(r.length>c.max){this.notificationService.showError(`You cannot select more than ${c.max} file(s) for ${c.name}.`),e.target.value="";return}let C=(this.additionalServiceDocsFiles[o]||[]).map(Q=>(Q.name||"").toLowerCase()),k=Array.from(r).slice(0,h).filter(Q=>C.includes(Q.name.toLowerCase())?(this.notificationService.showError(`"${Q.name}" is already uploaded for ${c.name}. Please choose a different document.`),!1):!0);if(!k.length){e.target.value="";return}this.rowLoadingStates[o]=!0;let O=k.length;k.forEach(Q=>{let G=new FormData;G.append("file",Q,Q.name),G.append("source","invoice"),G.append("source_id",this.poDetails.po_number),this.financeOrderService.FileUpload(G).subscribe({next:X=>{if(X.responseCode===200){let pe={id:Date.now()+Math.random(),name:X.response.file_name,path:X.response.filepath,viewPath:X.response.fileViewPath,docName:c.name};this.additionalServiceDocsFiles[o]||(this.additionalServiceDocsFiles[o]=[]),this.additionalServiceDocsFiles[o].push(pe)}else this.notificationService.showError("File Upload Failed");O--,O===0&&(this.rowLoadingStates[o]=!1)},error:X=>{this.notificationService.showError("Something went wrong!"),O--,O===0&&(this.rowLoadingStates[o]=!1)}})}),e.target.value=""}static{this.\u0275fac=function(o){return new(o||a)(T(K),T(de),T(z),T(Jt),T(Dt),T(ft),T(Ae),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-send-to-buyer"]],viewQuery:function(o,r){if(o&1&&N(oE,5),o&2){let c;V(c=B())&&(r.fileInput=c.first)}},decls:99,vars:20,consts:[["sellerGST",""],["previewdialog",""],["dialog",""],["prods",""],["popContent",""],["fileInfo",""],["noFiles",""],["id","content","class","rfq-pages generate-po-page container-fluid overflow-hidden-non-i",4,"ngIf"],["id","addGSTModal","tabindex","-1","aria-labelledby","addGSTModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[3,"ngSubmit","formGroup"],[1,"modal-header"],["id","addGSTModalLabel","appTranslate","",1,"modal-title"],["type","button","data-dismiss","modal","aria-label","Close",1,"close"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["for","gstNumber"],["appTranslate",""],[1,"text-danger"],["type","text","id","gstNumber","formControlName","gstNumber","placeholder","Enter GST Number",1,"form-control"],["class","errorClass",4,"ngIf"],["for","gstDocument"],["type","file",1,"form-control-file",3,"change","disabled"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","d-flex align-items-center mt-2 p-2 border rounded",4,"ngIf"],[1,"modal-footer"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light",3,"disabled"],["type","submit",1,"mod-btn","mod-btn-primary",3,"disabled"],["appTranslate","",4,"ngIf"],[4,"ngIf"],["id","addBankModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-header","align-items-start"],[1,"d-flex","align-items-center"],[1,"fin-modal-icon"],[1,"ri-bank-line"],[1,"modal-title","mb-0"],[1,"text-muted"],["type","button","id","closeAddBankModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"fin-verify-box"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"mod-form-label"],["type","text","formControlName","accountNumber","placeholder","Enter account number",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","ifsc","placeholder","Enter IFSC Code",1,"form-control","mod-input"],[1,"col-12","text-center"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],[1,"row","gut-row","gut-3","mt-2"],["type","text","formControlName","accountHolder","placeholder","Enter account holder name",1,"form-control","mod-input"],["type","text","formControlName","bankName","placeholder","Enter bank name",1,"form-control","mod-input"],["type","text","formControlName","branch","placeholder","Enter branch",1,"form-control","mod-input"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row",3,"formGroup"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back","cursor-pointer"],[1,"uil","uil-arrow-left"],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","mt-15","mb-30"],[1,"col-md","col-12"],["class","card border-0",4,"ngIf"],["class","col-md-auto col-12 ",4,"ngIf"],[1,"row","mt-30"],[1,"col-md-3","col-sm-6"],["for","",1,"fw-600"],["type","text","formControlName","creationDate","readonly","","name","",1,"form-control","form-control-sm11"],["type","number","formControlName","invoiceDueDays","onlyNumbers","",1,"form-control","form-control-sm11",3,"min"],["class","mod-card mb-4",4,"ngIf"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["class","mod-meta-label","appTranslate","",4,"ngIf"],["class","mod-meta-tile",4,"ngIf"],[1,"row"],[1,"card","h-100"],[1,"card-body"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"text-secondary"],[1,"fw-600","mb-1"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["data-toggle","collapse","data-target","#coll__OrderSummary","aria-expanded","false",1,"mod-card-header","border-bottom-0","cardCollapseArrow"],["id","coll__OrderSummary",1,"collapse","show"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],["class","",4,"ngSwitchCase"],[4,"ngSwitchCase"],["class","mod-card mb-4","id","additional-service-documents-section",4,"ngIf"],["class","col-12 mb-30 p-0",4,"ngIf"],["class","col-12 mb-20 p-0",4,"ngIf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"font-12","text-secondary","mb-2"],[1,"col-12","pl-0"],[1,"row","mx-0"],[1,"col-4","pl-0","form-group"],[1,"custom-file"],["for","termsUpload","appTranslate","",1,"fw-600","mb-2"],["type","file","multiple","","id","termsUpload",1,"custom-file-input",3,"change","disabled"],["for","termsUpload",1,"custom-file-label","top-auto"],[1,"list-inline","mt-2"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[1,"col-12","text-right","mt-3"],["type","button","data-toggle","modal",1,"mod-btn","mod-btn-outline-primary","mr-10",3,"click","disabled"],[1,"uil","uil-eye"],["type","button","data-toggle","modal",1,"mod-btn","mod-btn-primary",3,"click","disabled"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"card","border-0"],[1,"card-body","p-2"],["appTranslate","",1,"fw-600"],[1,"form-group","mb-1","form-inline"],[1,"fw-600","mb-0"],["formControlName","sellerGst","required","",1,"ml-15","form-control","form-control-sm11",3,"change"],["disabled","","selected","","value","","appTranslate","",4,"ngIf"],["disabled","","appTranslate","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["value","select"],[1,"uil","uil-plus-circle"],["disabled","","selected","","value","","appTranslate",""],["disabled","","appTranslate",""],[3,"value"],[1,"errorClass"],["class","error-field","appTranslate","",4,"ngIf"],["appTranslate","",1,"error-field"],[1,"col-md-auto","col-12"],["class","text-center",4,"ngIf"],[1,"text-center"],["alt","your image",1,"doc-logo__img",3,"src"],["size","medium",3,"isLoading","useBlockPosition",4,"ngIf"],[1,"row","align-items-end","gut-row","gut-3"],[1,"col-md"],[1,"form-group","mb-0"],[1,"dropdown","w-100"],["data-toggle","dropdown","data-display","static",1,"form-control","fin-select-toggle","d-flex","justify-content-between","align-items-center","dropdown-toggle"],[1,"ri-arrow-down-s-line"],[1,"dropdown-menu","w-100","fin-buyer-dropdown"],["class","dropdown-item fin-buyer-item","href","javascript:void(0)",3,"click",4,"ngFor","ngForOf"],["class","dropdown-item text-muted",4,"ngIf"],[1,"col-md-auto"],["type","button","data-toggle","modal","data-target","#addBankModal",1,"mod-btn","mod-btn-outline-primary"],[1,"ri-add-line"],["class","fin-bank-card mt-3",4,"ngIf"],["size","medium",3,"isLoading","useBlockPosition"],["href","javascript:void(0)",1,"dropdown-item","fin-buyer-item",3,"click"],[1,"fin-buyer-item__name"],[1,"fin-buyer-item__meta"],[1,"dropdown-item","text-muted"],[1,"fin-bank-card","mt-3"],[1,"fin-bank-card__head"],[1,"fin-bank-card__name"],[1,"fin-bank-card__city"],[1,"row","fin-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"text-secondary","mb-1"],["appTranslate","",1,"text-secondary"],[1,""],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["id","additional-service-documents-section",1,"mod-card","mb-4"],[1,"mod-card-header","border-bottom-0"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],["scope","col","a
1ppTranslate",""],["scope","col"],["scope","col","appTranslate","",1,"text-center"],["appTranslate","",1,"mb-0"],[1,"font-weight-medium"],["class","text-danger",4,"ngIf"],["class","d-flex align-items-center text-muted",4,"ngIf"],[4,"ngIf","ngIfElse"],["class","d-flex align-items-center justify-content-center",4,"ngIf"],["class","badge badge-success",4,"ngIf"],[1,"error-field","text-danger"],[1,"d-flex","align-items-center","text-muted"],["size","small",3,"isLoading","useBlockPosition"],["class","d-flex align-items-center justify-content-between bg-light rounded p-2 mb-1 file-item",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","justify-content-between","bg-light","rounded","p-2","mb-1","file-item"],[1,"text-truncate","flex-grow-1","mr-2"],["type","button","title","Remove file",1,"btn","btn-link","btn-sm","text-muted","p-0",3,"click"],["width","12","height","12","fill","currentColor","viewBox","0 0 16 16"],["d","M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"],["class","text-muted small","appTranslate","",4,"ngIf"],["appTranslate","",1,"text-muted","small"],["type","file",1,"d-none",3,"change","multiple","id"],["appTranslate","",3,"for"],[1,"d-flex","align-items-center","justify-content-center"],[1,"badge","badge-success"],["width","12","height","12","fill","currentColor","viewBox","0 0 16 16",1,"mr-1"],["d","M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"],[1,"col-12","mb-30","p-0"],["data-toggle","collapse","data-target","#stb__PaymentTerms","aria-expanded","false",1,"mod-card-header","cardCollapseArrow"],["id","stb__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20","p-0"],["data-toggle","collapse","data-target","#stb__ShipmentTerms","aria-expanded","false",1,"mod-card-header","cardCollapseArrow"],["id","stb__ShipmentTerms",1,"collapse","show"],["class","shipments-cards mod-card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","mod-card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],[1,"qty-label"],[1,"amount"],[1,"list-inline-item"],[1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","border-style-dotted-i","theme-color"],["target","_blank",3,"href"],[1,"ml-auto","pl-15","text-danger","cursor-pointer"],[1,"uil","uil-times-circle","font-18",3,"click"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"],[1,"uil","uil-message"],["id","send-to-byer-model",1,"h-80vh","w-60vw"],[1,"font-20px","text-center","text-capitalize"],[1,"col-md-8","col-12","col-xl-9"],[1,"card"],[1,"col-md-4","col-12","col-xl-3"],[1,"fw-600","mb-2"],["data-toggle","collapse","data-target","#coll__OrderSummary","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","text-dark"],["id","product_table",1,"table-responsive","mod-table-wrapper"],[1,"row","mt-1","gut-row","gut-4"],[1,"col-md-8","col-12","col-xl-8"],["class","col-md-12 mb-140px",4,"ngIf"],[1,"col-md-4","col-12","col-xl-4",3,"ngSwitch"],["type","button","data-dismiss","modal","a
1ppTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],[1,"list-inline","mb-0"],[1,"col-md-12","mb-140px"],["for","","appTranslate","",1,"fw-600","mb-15"],["class","col-12",4,"ngIf"],["for","","appTranslate","",1,"fw-600"],[1,"list-inline"],["id","send-to-buyer-model-confirm",1,""],[1,"modal-body","text-center"],[1,"text-center","mx-auto","theme-color","modal-check-icon"],[1,"uil","uil-file-check-alt"],["appTranslate","",1,"text-secondary","text-center","mt-15"],["type","button","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm","text-white",3,"click"],[1,"d-flex","align-items-center","mt-2","p-2","border","rounded"],[1,"far","fa-file-pdf","text-danger","mr-2"],[1,"text-truncate",2,"max-width","300px",3,"title"],["type","button","matTooltip","Delete",1,"btn","btn-link","text-danger","ml-auto","p-0",3,"click"],[1,"ri-delete-bin-line","font-16"],[1,"invalid-error"]],template:function(o,r){if(o&1){let c=I();u(0,N6,154,51,"div",7),i(1,"div",8)(2,"div",9)(3,"div",10)(4,"form",11),S("ngSubmit",function(){return b(c),y(r.addNewGST())}),i(5,"div",12)(6,"h5",13),n(7,"Add GST"),t(),i(8,"button",14)(9,"span",15),n(10,"\xD7"),t()()(),i(11,"div",16)(12,"div",17)(13,"label",18)(14,"span",19),n(15,"GST Number"),t(),i(16,"sup",20),n(17,"*"),t()(),x(18,"input",21),u(19,R6,3,2,"div",22),t(),i(20,"div",17)(21,"label",23)(22,"span",19),n(23,"GST Document"),t(),i(24,"sup",20),n(25,"*"),t()(),i(26,"input",24,0),S("change",function(h){return b(c),y(r.onGSTDocumentChange(h))}),t(),u(28,L6,1,2,"app-loader",25)(29,q6,6,2,"div",26),t()(),i(30,"div",27)(31,"button",28),n(32,"Close"),t(),i(33,"button",29),u(34,G6,2,0,"span",30)(35,U6,6,0,"span",31),t()()()()()(),i(36,"div",32)(37,"div",33)(38,"div",10)(39,"div",34)(40,"div",35)(41,"span",36),x(42,"i",37),t(),i(43,"div")(44,"h5",38),n(45,"Add New bank details"),t(),i(46,"small",39),n(47,"Verify using Account No. & IFSC"),t()()(),x(48,"button",40),i(49,"button",41),S("click",function(){return b(c),y(r.bankForm.reset())}),n(50,"\xD7"),t()(),i(51,"form",42)(52,"div",16)(53,"div",43)(54,"div",44)(55,"div",45)(56,"label",46),n(57,"Account Number "),i(58,"sup",20),n(59,"*"),t()(),x(60,"input",47),u(61,z6,3,2,"div",48),t(),i(62,"div",45)(63,"label",46),n(64,"IFSC Code "),i(65,"sup",20),n(66,"*"),t()(),x(67,"input",49),u(68,Y6,3,2,"div",48),t(),i(69,"div",50)(70,"button",51),S("click",function(){return b(c),y(r.verifyBankAccount())}),n(71),t()()()(),i(72,"div",52)(73,"div",45)(74,"label",46),n(75,"Account Holder Name "),i(76,"sup",20),n(77,"*"),t()(),x(78,"input",53),u(79,H6,2,0,"div",48),t(),i(80,"div",45)(81,"label",46),n(82,"Bank Name "),i(83,"sup",20),n(84,"*"),t()(),x(85,"input",54),u(86,K6,2,0,"div",48),t(),i(87,"div",45)(88,"label",46),n(89,"Branch "),i(90,"sup",20),n(91,"*"),t()(),x(92,"input",55),u(93,Z6,2,0,"div",48),t()()(),i(94,"div",27)(95,"button",56),S("click",function(){return b(c),y(r.bankForm.reset())}),n(96,"Cancel"),t(),i(97,"button",57),S("click",function(){return b(c),y(r.saveBankAccount())}),n(98),t()()()()()()}if(o&2){let c,g,h,C,k,O,Q;s("ngIf",r.OrderDetails),l(4),s("formGroup",r.addGSTForm),l(15),s("ngIf",((c=r.addGSTForm.get("gstNumber"))==null?null:c.touched)||((c=r.addGSTForm.get("gstNumber"))==null?null:c.dirty)),l(7),s("disabled",r.loadingStates.gstDocs),l(2),s("ngIf",r.loadingStates.gstDocs),l(),s("ngIf",(g=r.addGSTForm.get("gstFile"))==null?null:g.value),l(2),s("disabled",r.loadingStates.addGST),l(2),s("disabled",r.loadingStates.addGST),l(),s("ngIf",!r.loadingStates.addGST),l(),s("ngIf",r.loadingStates.addGST),l(16),s("formGroup",r.bankForm),l(10),s("ngIf",((h=r.bankForm.get("accountNumber"))==null?null:h.touched)&&((h=r.bankForm.get("accountNumber"))==null?null:h.invalid)),l(7),s("ngIf",((C=r.bankForm.get("ifsc"))==null?null:C.touched)&&((C=r.bankForm.get("ifsc"))==null?null:C.invalid)),l(2),s("disabled",r.bankVerifying),l(
1),m(" ",r.bankVerifying?"Verifying...":"Verify Account"," "),l(8),s("ngIf",((k=r.bankForm.get("accountHolder"))==null?null:k.touched)&&((k=r.bankForm.get("accountHolder"))==null?null:k.invalid)),l(7),s("ngIf",((O=r.bankForm.get("bankName"))==null?null:O.touched)&&((O=r.bankForm.get("bankName"))==null?null:O.invalid)),l(7),s("ngIf",((Q=r.bankForm.get("branch"))==null?null:Q.touched)&&((Q=r.bankForm.get("branch"))==null?null:Q.invalid)),l(4),s("disabled",r.bankSubmitting),l(),m(" ",r.bankSubmitting?"Saving...":"Save bank account"," ")}},dependencies:[rt,J,W,pt,mt,Et,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Wi,gt,dt,Se,Z,De,L,We,Qe,st,ae],styles:['.btn-basic[_ngcontent-%COMP%]{line-height:0;font-size:13px;padding:0 8px;background:transparent;border:none}.blur[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.blurCard[_ngcontent-%COMP%]{transition:.3s}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:5px;padding:15px}.shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:focus, .shpCard[_ngcontent-%COMP%] .no-focus[_ngcontent-%COMP%]:active{outline:none!important;box-shadow:none!important}.toggleSwitch[_ngcontent-%COMP%] span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:none}@media only screen{.toggleSwitch[_ngcontent-%COMP%]{display:inline-block;height:16px;position:relative;overflow:visible;padding:0;margin-left:50px;cursor:pointer;width:38px}.toggleSwitch[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.toggleSwitch[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{line-height:20px;height:20px;vertical-align:middle;position:relative;z-index:3;display:block;width:100%}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{line-height:20px;height:20px;vertical-align:middle;position:absolute;left:-50px;width:100%;margin:0;padding-right:50px;text-align:left;white-space:nowrap}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:absolute;z-index:5;display:block;width:50%;margin-left:50px;text-align:left;width:100%;left:15%;top:-2px;font-size:10px!important;opacity:0}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{color:#ccc;opacity:1;left:45%}.toggleSwitch[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:before{content:"";display:block;width:100%;height:100%;position:absolute;left:50px;top:-2px;background-color:#fafafa;border:1px solid #ccc;border-radius:30px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;transition:all .2s ease-out}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{position:absolute;opacity:0;z-index:5}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus ~ a[_ngcontent-%COMP%]{outline:none}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus + label[_ngcontent-%COMP%]{outline:none}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ a[_ngcontent-%COMP%]{border-color:#fff;left:100%;margin-left:-8px}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ span[_ngcontent-%COMP%]:before{border-color:var(--theme-sub-prime);box-shadow:inset 0 0 0 30px var(--theme-sub-prime)}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{opacity:0}.toggleSwitch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-of-type{opacity:1;color:#fff}.toggleSwitch[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:50%;z-index:4;display:block;height:100%;padding:0;left:2px;width:18px;background-color:#fff;border:1px solid #CCC;border-radius:100%;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;transition:all .2s ease-out;box-shadow:0 1px 2px #0000000d}.toggleSwitch.large[_ngcontent-%COMP%]{width:60px;height:27px}.toggleSwitch.large[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:27px}.toggleSwitch.large[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{height:29px;line-height:28px}
1.toggleSwitch.large[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:1.1em}.toggleSwitch.large[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{left:50%}.toggleSwitch.large[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ a[_ngcontent-%COMP%]{left:41px}.toggleSwitch.xlarge[_ngcontent-%COMP%]{width:80px;height:36px}.toggleSwitch.xlarge[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:36px}.toggleSwitch.xlarge[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{height:38px;line-height:37px}.toggleSwitch.xlarge[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:1.4em}.toggleSwitch.xlarge[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-of-type{left:50%}.toggleSwitch.xlarge[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ a[_ngcontent-%COMP%]{left:52px}}.rfq-pages[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .rfq-pages[_ngcontent-%COMP%] select[_ngcontent-%COMP%], .rfq-pages[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font-size:1rem}.pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--seller-green)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative} .cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.5} .cdk-overlay-dark-backdrop{background:#000}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.errorClass[_ngcontent-%COMP%]{color:red;font-weight:700}.h-200[_ngcontent-%COMP%]{height:200px}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--seller-green)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--seller-green)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--seller-green);border-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--seller-green);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--seller-green);color:#fff}.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--seller-green)}.top-auto[_ngcontent-%COMP%]{top:auto}.left-10px[_ngcontent-%COMP%]{left:10px}.h-80vh[_ngcontent-%COMP%]{height:80vh}.w-60vw[_ngcontent-%COMP%]{width:60vw}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.mb-140px[_ngcontent-%COMP%]{margin-bottom:140px}.modal-check-icon[_ngcontent-%COMP%]{border:2px solid var(--seller-green);border-radius:50%;line-height:70px;width:75px;height:75px;font-size:43px}.editableInputField[_ngcontent-%COMP%]{border-bottom:green 1px dashed;border-left:0px;border-right:0px;border-top:0px}.editableInputField[_ngcontent-%COMP%]:focus, .editableInputField[_ngcontent-%COMP%]:active, .editableInputField[_ngcontent-%COMP%]:hover{border-bottom:green 2px solid;outline:none;box-shadow:none}.file-item[_ngcontent-%COMP%]{max-width:300px}.file-item[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{line-height:1.2}.btn-link[_ngcontent-%COMP%]:hover{text-decoration:none}
1.font-weight-medium[_ngcontent-%COMP%]{font-weight:500}label.btn[_ngcontent-%COMP%]{cursor:pointer}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle}.badge[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin-bottom:1px}.btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin-bottom:2px}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.fin-bank-card[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden;border:1px solid #f1e0d9}.fin-bank-card__head[_ngcontent-%COMP%]{background:var(--theme-bg-light);padding:14px 18px}.fin-bank-card__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;margin:0;color:#000}.fin-bank-card__city[_ngcontent-%COMP%]{font-size:13px;color:#777}.fin-bank-card__body[_ngcontent-%COMP%]{padding:16px 18px}.fin-modal-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:8px;background:var(--theme-bg-light);margin-right:12px}.fin-modal-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:var(--theme-primary, #6b2f1a)}.fin-verify-box[_ngcontent-%COMP%]{border:1px solid #ececec;border-radius:8px;padding:18px;margin-bottom:8px}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}']})}}return a})();function X6(a,d){if(a&1){let e=I();i(0,"button",65),S("click",function(){b(e);let r=p(2);return y(r.cancelInvoice())}),x(1,"i",66),i(2,"span",14),n(3,"Cancel Invoice"),t()()}if(a&2){let e=p(2);s("disabled",e.isLoading)}}function eI(a,d){a&1&&(i(0,"span"),x(1,"i",67),i(2,"span",14),n(3,"Print"),t()())}function tI(a,d){a&1&&(i(0,"span")(1,"div",68)(2,"span",69),n(3,"Loading..."),t()(),i(4,"span",14),n(5,"Printing..."),t()())}function iI(a,d){a&1&&(i(0,"div",25),n(1,"PO No."),t())}function nI(a,d){a&1&&(i(0,"div",25),n(1,"WO No."),t())}function aI(a,d){if(a&1){let e=I();i(0,"button",70),S("click",function(){b(e);let r=p(2);return y(r.onSourceClick())}),n(1),t()}if(a&2){let e=p(2);s("title",e.invoiceDetails==null?null:e.invoiceDetails.display_source_id),l(),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||"--"," ")}}function rI(a,d){if(a&1&&n(0),a&2){let e=p(2);m("",(e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||"--"," ")}}function lI(a,d){a&1&&(i(0,"div",25),n(1,"Place of Supply"),t())}function oI(a,d){a&1&&(i(0,"div",25),n(1,"Place of Service"),t())}function sI(a,d){if(a&1&&(i(0,"div",24)(1,"div",25),n(2," Payment Mode "),t(),i(3,"div",26),n(4),t()()),a&2){let e=p(2);l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.payment_mode,"")}}function dI(a,d){if(a&1&&(i(0,"span",43),n(1),t()),a&2){let e=p(3);l(),f(e.invoiceDetails==null?null:e.invoiceDetails.seller_gst)}}function cI(a,d){a&1&&(i(0,"span",74),n(1,"Not Available"),t())}function pI(a,d){if(a&1&&(i(0,"div",71)(1,"div",72)(2,"p",73),n(3,"Shipping From :"),t(),i(4,"p",45)(5,"span",14),n(6,"Seller Name:\xA0"),t(),i(7,"span",43),n(8),t()(),i(9,"p",45)(10,"span",14),n(11,"GST No:\xA0"),t(),u(12,dI,2,1,"span",46)(13,cI,2,0,"span",47),t(),i(14,"p",45)(15,"span",14),n(16,"Seller Address:"),t(),i(17,"span",43),n(18),t()()()()),a&2){let e=p(2);l(8),f(e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.firstname),l(4),s("ngIf",e.invoiceDetails==null?null:e.invoiceDetails.seller_gst),l(),s("ngIf",!(e.invoiceDetails!=null&&e.invoiceDetails.seller_gst)),l(5),m(" ",e.invoiceDetails==null||e.invoiceDetails.seller_address==null?null:e.invoiceDetails.seller_address.full_address,"")}}function mI(a,d){if(a&1&&(i(0,"div",75),x(1,"img",76),t()),a&2){let e=p(2);l(),s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function uI(a,d){if(a&1&&(i(0,"div",19)(1,"div",20)(2,"h3",21),n(3,"Company Bank Details"),t()(),i(4,"div",22)(5,"div",77)(6,"div",78)(7,"span",79),x(8,"i",80),t(),i(9,"div",81)(10,"h4",82),n(11),t(),i(12,"span",83),n(13),t()()(),i(14,"div",84)(15,"div",85)(16,"span",86),n(17,"Account Holder"),t(),i(18,"span",87),n(19),t()(),i(20,"div",85)(21,"span",86),n(22,"Account Number"),t(),i(23,"span",87),n(24),t()(),i(25,"div",85)(26,"span",86),n(27,"IFSC Code"),t(),i(28,"span",87),n(29),t()(),i(30,"div",85)(31,"span",86),n(32,"Branch"),t(),i(33,"span",87),n(34),t()()()()()()),a&2){let e=p(2);l(11),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_name),l(2),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch),l(6),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_name),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_number),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_ifsc),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch)}}function _I(a,d){if(a&1&&(i(0,"p",88)(1,"span",73),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)||(e.shippingAddrdres==null?null:e.shippingAddrdres.company_name),"")}}function vI(a,d){if(a&1&&(i(0,"p",88)(1,"span",73),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)||(e.billingAddres==null?null:e.billingAddres.company_name),"")}}function gI(a,d){if(a&1&&(i(0,"span",43),n(1),t()),a&2){let e=p(2);l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function fI(a,d){a&1&&(i(0,"span",74),n(1,"Not Available"),t())}function hI(a,d){a&1&&(i(0,"th",14),n(1," Product Name"),t())}function xI(a,d){a&1&&(i(0,"th",14),n(1," Service Name"),t())}function bI(a,d){if(a&1&&(i(0,"thead",89)(1,"tr"),u(2,hI,2,0,"th",90)(3,xI,2,0,"th",90),i(4,"th",14),n(5," Product ID"),t(),i(6,"th",14),n(7," Quantity"),t(),i(8,"th",14),n(9,"Quoted"),t(),i(10,"th",14),n(11," Gross Total"),t(),i(12,"th",14),n(13," Discount"),t(),i(14,"th",14),n(15," Tax"),t(),i(16,"th",14),n(17," Total Payable"),t()()()),a&2){let e=p(2);l(2),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function yI(a,d){a&1&&(i(0,"thead",89)(1,"tr")(2,"th",14),n(3," Product Name"),t(),i(4,"th",14),n(5," Product ID"),t(),i(6,"th",14),n(7," Quantity"),t(),i(8,"th",14),n(9," Basic Price"),t(),i(10,"th",14),n(11," Discount"),t(),i(12,"th",14),n(13," Tax"),t(),i(14,"th",14),n(15," Total Payable"),t()()())}function SI(a,d){a&1&&(i(0,"thead",89)(1,"tr")(2,"th",14),n(3," Product Name"),t(),i(4,"th",14),n(5," Product ID"),t(),i(6,"th",14),n(7," Quantity"),t(),i(8,"th",14),n(9," Total Bid Value"),t(),i(10,"th",14),n(11,"Tax"),t(),i(12,"th",14),n(13,"Total Payable"),t()()())}function CI(a,d){a&1&&(i(0,"thead",89)(1,"tr")(2,"th",14),n(3," Product Name"),t(),i(4,"th",14),n(5," Product ID"),t(),i(6,"th",14),n(7," Offered Quantity"),t(),i(8,"th",14),n(9," Quoted Price/Unit"),t(),i(10,"th",14),n(11," Gross Total"),t(),i(12,"th",14),n(13," Discount"),t(),i(14,"th",14),n(15," Total Payable"),t()()())}function EI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function II(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function DI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function TI(a,d){if(a&1&&(F(0),i(1,"div",95),n(2),t(),i(3,"p",96
1),u(4,EI,2,2,"span",97)(5,II,2,2,"span",97)(6,DI,2,2,"span",97),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function wI(a,d){if(a&1&&(F(0),i(1,"div",95)(2,"div")(3,"p",99),n(4),_(5,"currencyFormat"),t(),i(6,"p",99),n(7),_(8,"currencyFormat"),t(),i(9,"p",99),n(10),_(11,"currencyFormat"),t(),i(12,"p",99),n(13),_(14,"currencyFormat"),t(),i(15,"p",99),n(16),_(17,"currencyFormat"),t(),i(18,"p",99),n(19),_(20,"currencyFormat"),t(),i(21,"p",99),n(22),_(23,"currencyFormat"),t(),i(24,"p",99),n(25),_(26,"currencyFormat"),t(),i(27,"p",99),n(28),_(29,"currencyFormat"),t(),x(30,"div",100),i(31,"p",88)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function PI(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",92),n(3),t(),u(4,TI,7,4,"ng-template",null,1,P),x(6,"i",93),t(),i(7,"td",94),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,wI,35,34,"ng-template",null,2,P),x(30,"i",93),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.gross_total)),l(3),f(v(21,14,e.discount)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function OI(a,d){if(a&1&&(i(0,"tr")(1,"td",101)(2,"span",14),n(3," Advance Note: "),t(),i(4,"b"),n(5),t()(),i(6,"td",102)(7,"span",14),n(8,"Advance Amount:"),t(),i(9,"b"),n(10),_(11,"currencyFormat"),t()()()),a&2){let e=p(3);l(5),f(e.advanceDetails.terms),l(5),f(v(11,2,e.advanceDetails.amount))}}function kI(a,d){if(a&1&&(i(0,"tr")(1,"td",101)(2,"span",14),n(3,"Additional Charge:"),t(),n(4,"\xA0"),i(5,"b"),n(6),t()(),i(7,"td",102)(8,"span",14),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(6),f(e.description),l(5),f(v(12,2,e.amount))}}function FI(a,d){if(a&1&&(F(0),u(1,kI,13,4,"tr",91),M()),a&2){let e=p(3);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function MI(a,d){if(a&1&&(i(0,"tbody"),u(1,PI,31,20,"tr",91)(2,OI,12,4,"tr",18)(3,FI,2,1,"ng-container",18),t()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(),s("ngIf",+(e.advanceDetails==null?null:e.advanceDetails.amount)>0),l(),s("ngIf",!(+(e.advanceDetails==null?null:e.advanceDetails.amount)>0))}}function AI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function NI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function VI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function BI(a,d){if(a&1&&(F(0),i(1,"div",95),n(2),t(),i(3,"p",96),u(4,AI,2,2,"span",97)(5,NI,2,2,"span",97)(6,VI,2,2,"span",97),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function RI(a,d){if(a&1&&(F(0),i(1,"div",95)(2,"div")(3,"p",99),n(4),_(5,"currencyFormat"),t(),i(6,"p",99),n(7),_(8,"currencyFormat"),t(),i(9,"p",99),n(10),_(11,"currencyFormat"),t(),i(12,"p",99),n(13),_(14,"currencyFormat"),t(),i(15,"p",99),n(16),_(17,"currencyFormat"),t(),i(18,"p",99),n(19),_(20,"currencyFormat"),t(),i(21,"p",99),n(22),_(23,"currencyFormat"),t(),i(24,"p",99),n(25),_(26,"currencyFormat"),t(),i(27,"p",99),n(28),_(29,"currencyFormat"),t(),x(30,"div",100),i(31,"p",88)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.net_amount)," ")}}function LI(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",92),n(3),t(),u(4,BI,7,4,"ng-template",null,1,P),x(6,"i",93),t(),i(7,"td",94),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,RI,35,34,"ng-template",null,2,P),x(27,"i",93),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m(" ",e.product_name,""),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m(" ",v(13,9,e.unit_price)," "),l(5),m(" ",v(18,11,e.discount),""),l(3),m(" ",v(21,13,e.gst),""),l(3),m(" ",v(24,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function qI(a,d){if(a&1&&(i(0,"tr")(1,"td",101),n(2," Advance Note: "),i(3,"b"),n(4),t()(),i(5,"td",103),n(6," Advance Amount: "),i(7,"b"),n(8),t()()()),a&2){let e=p(3);l(4),f(e.advanceDetails.terms),l(4),f(e.advanceDetails.amount)}}function GI(a,d){if(a&1&&(i(0,"tr")(1,"td",101),n(2," Additional Charge:\xA0"),i(3,"b"),n(4),t()(),i(5,"td",103),n(6," Amount: "),i(7,"b"),n(8),_(9,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(4),f(e.description),l(4),f(v(9,2,e.amount))}}function UI(a,d){if(a&1&&(F(0),u(1,GI,10,4,"tr",91),M()),a&2){let e=p(3);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function jI(a,d){if(a&1&&(i(0,"tbody"),u(1,LI,28,17,"tr",91)(2,qI,9,2,"tr",18)(3,UI,2,1,"ng-container",18),t()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(),s("ngIf",+(e.advanceDetails==null?null:e.advanceDetails.amount)>0),l(),s("ngIf",!(+(e.advanceDetails==null?null:e.advanceDetails.amount)>0))}}function $I(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function zI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function WI(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function QI(a,d){if(a&1&&(F(0),i(1,"div",95),n(2),t(),i(3,"p",96),u(4,$I,2,2,"span",97)(5,zI,2,2,"span",97)(6,WI,2,2,"span",97),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function YI(a,d){if(a&1&&(F(0),i(1,"div",95)(2,"div")(3,"p",99),n(4),_(5,"currencyFormat"),t(),i(6,"p",99),n(7),_(8,"currencyFormat"),t(),i(9,"p",99),n(10),_(11,"currencyFormat"),t(),i(12,"p",99),n(13),_(14,"currencyFormat"),t(),i(15,"p",99),n(16),_(17,"currencyFormat"),t(),x(18,"div",100),i(19,"p",88)(20,"b"),n(21),_(22,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Total Bid Value: ",v(5,10,e.gross_total)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(8,12,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(11,14,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(14,16,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(17,18,e.igst),""),l(5),m("Total Payable: ",v(22,20,e.total_amount)," ")}}function HI(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",92),n(3),t(),u(4,QI,7,4,"ng-template",null,1,P),x(6,"i",93),t(),i(7,"td",94),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),u(20,YI,23,22,"ng-template",null,2,P),x(22,"i",93),t()()),a&2){let e=d.$implicit,o=w(5),r=w(21);l(3),m(" ",e.product_name,""),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(13,8,e.gross_total)),l(3),f(v(16,10,e.gst)),l(3),m(" ",v(19,12,e.total_amount)," "),l(4),s("ngbPopover",r)}}function KI(a,d){if(a&1&&(i(0,"tr")(1,"td",104),n(2," Advance Note: "),i(3,"b"),n(4),t()(),i(5,"td",103),n(6," Advance Amount: "),i(7,"b"),n(8),t()()()),a&2){let e=p(3);l(4),f(e.advanceDetails.terms),l(4),f(e.advanceDetails.amount)}}function ZI(a,d){if(a&1&&(i(0,"tr")(1,"td",104),n(2," Additional Charge:\xA0"),i(3,"b"),n(4),t()(),i(5,"td",103),n(6," Amount: "),i(7,"b"),n(8),_(9,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(4),f(e.description),l(4),f(v(9,2,e.amount))}}function JI(a,d){if(a&1&&(F(0),u(1,ZI,10,4,"tr",91),M()),a&2){let e=p(3);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function XI(a,d){if(a&1&&(i(0,"tbody"),u(1,HI,23,14,"tr",91)(2,KI,9,2,"tr",18)(3,JI,2,1,"ng-container",18),t()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(),s("ngIf",+(e.advanceDetails==null?null:e.advanceDetails.amount)>0),l(),s("ngIf",!(+(e.advanceDetails==null?null:e.advanceDetails.amount)>0))}}function eD(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function tD(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function iD(a,d){if(a&1&&(i(0,"span",98),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function nD(a,d){if(a&1&&(F(0),i(1,"div",95),n(2),t(),i(3,"p",96
1),u(4,eD,2,2,"span",97)(5,tD,2,2,"span",97)(6,iD,2,2,"span",97),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function aD(a,d){if(a&1&&(F(0),i(1,"div",95)(2,"div")(3,"p",99),n(4),_(5,"currencyFormat"),t(),i(6,"p",99),n(7),_(8,"currencyFormat"),t(),i(9,"p",99),n(10),_(11,"currencyFormat"),t(),i(12,"p",99),n(13),_(14,"currencyFormat"),t(),i(15,"p",99),n(16),_(17,"currencyFormat"),t(),i(18,"p",99),n(19),_(20,"currencyFormat"),t(),i(21,"p",99),n(22),_(23,"currencyFormat"),t(),i(24,"p",99),n(25),_(26,"currencyFormat"),t(),x(27,"div",100),i(28,"p",88)(29,"b"),n(30),_(31,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit,o=p(3);l(4),m(" Gross Total: ",v(5,13,e.gross_total)," "),l(3),m(" Discount: ",v(8,15,e.discount)," "),l(3),m(" Net Total: ",v(11,17,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,19,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,21,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,23,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,25,e.igst),""),l(3),m(" Additional Charges: ",v(26,27,o.getAdditionalCharges())," "),l(5),m("Total Payable: ",v(31,29,e.net_amount)," ")}}function rD(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",92),n(3),t(),u(4,nD,7,4,"ng-template",null,1,P),x(6,"i",93),t(),i(7,"td",94),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,aD,32,31,"ng-template",null,2,P),x(27,"i",93),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m(" ",e.product_name,""),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m(" ",v(13,9,e.unit_price)," "),l(5),m(" ",v(18,11,e.discount),""),l(3),m(" ",v(21,13,e.gst),""),l(3),m(" ",v(24,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function lD(a,d){if(a&1&&(i(0,"tr")(1,"td",101),n(2," Advance Note: "),i(3,"b"),n(4),t()(),i(5,"td",103),n(6," Advance Amount: "),i(7,"b"),n(8),t()()()),a&2){let e=p(3);l(4),f(e.advanceDetails.terms),l(4),f(e.advanceDetails.amount)}}function oD(a,d){if(a&1&&(i(0,"tr")(1,"td",101),n(2," Additional Charge:\xA0"),i(3,"b"),n(4),t()(),i(5,"td",103),n(6," Amount: "),i(7,"b"),n(8),_(9,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(4),f(e.description),l(4),f(v(9,2,e.amount))}}function sD(a,d){if(a&1&&(F(0),u(1,oD,10,4,"tr",91),M()),a&2){let e=p(3);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function dD(a,d){if(a&1&&(i(0,"tbody"),u(1,rD,28,17,"tr",91)(2,lD,9,2,"tr",18)(3,sD,2,1,"ng-container",18),t()),a&2){let e=p(2);l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(),s("ngIf",+(e.advanceDetails==null?null:e.advanceDetails.amount)>0),l(),s("ngIf",!(+(e.advanceDetails==null?null:e.advanceDetails.amount)>0))}}function cD(a,d){if(a&1&&(i(0,"div",112)(1,"a",113)(2,"div",72)(3,"ul",114)(4,"li",115),x(5,"i",116),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(5),m(" ",e.name," ")}}function pD(a,d){if(a&1&&(i(0,"div",110),u(1,cD,7,2,"div",111),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.docs)}}function mD(a,d){a&1&&(i(0,"span",117),n(1," No files uploaded "),t())}function uD(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),u(4,pD,2,1,"div",109)(5,mD,2,0,"ng-template",null,3,P),t()()),a&2){let e=d.$implicit,o=w(6);l(2),m(" ",e.collectionName," "),l(2),s("ngIf",e.docs.length>0)("ngIfElse",o)}}function _D(a,d){a&1&&(i(0,"tr")(1,"td",118)(2,"p",119),n(3,"No documents available"),t()()())}function vD(a,d){if(a&1&&(i(0,"div",19)(1,"div",105)(2,"h3",21),n(3,"Additional Services Documents"),t()(),i(4,"div",50)(5,"div",106)(6,"table",107)(7,"thead",89)(8,"tr")(9,"th",108),n(10,"Document Name"),t(),i(11,"th",108),n(12,"Files"),t()()(),i(13,"tbody"),u(14,uD,7,3,"tr",91)(15,_D,4,0,"tr",18),t()()()()()),a&2){let e=p(2);l(14),s("ngForOf",e.additionalDocs),l(),s("ngIf",!e.additionalDocs.length)}}function gD(a,d){if(a&1){let e=I();i(0,"a",137),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function fD(a,d){if(a&1){let e=I();i(0,"a",137),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function hD(a,d){if(a&1&&(i(0,"div")(1,"p",135)(2,"b",14),n(3,"Note:"),t(),n(4),t(),u(5,gD,2,0,"a",136)(6,fD,2,0,"a",136),t()),a&2){let e=p().$implicit;
1l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded),l(),s("ngIf",e._expanded)}}function xD(a,d){if(a&1&&(i(0,"div",128)(1,"div",40)(2,"div",129)(3,"div",130)(4,"h6",131),n(5),t(),i(6,"small",132)(7,"span",14),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",133)(12,"h6",134),n(13),_(14,"currencyFormat"),t()()(),u(15,hD,7,5,"div",18),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%) "),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function bD(a,d){if(a&1&&(i(0,"div",122)(1,"div",123)(2,"div",124)(3,"a",125),n(4,"Payment Terms"),t()(),i(5,"div",126)(6,"div",40),u(7,xD,16,10,"div",127),t()()()()),a&2){let e=p(3);l(7),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.payment_terms)}}function yD(a,d){if(a&1&&(i(0,"div",147)(1,"div",148)(2,"div",144)(3,"h6",149),n(4),t(),i(5,"small",132)(6,"span",14),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",150)(10,"small",151),n(11,"Quantity"),t(),i(12,"h6",152),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function SD(a,d){if(a&1&&(i(0,"div",142)(1,"div",143)(2,"div",129)(3,"div",144)(4,"h6",145),n(5),t(),i(6,"small",132)(7,"span",14),n(8,"Timeline:"),t(),n(9),i(10,"span",14),n(11,"day(s)"),t()()()()(),u(12,yD,14,3,"div",146),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," "),l(3),s("ngForOf",e.products)}}function CD(a,d){if(a&1&&(i(0,"div",138)(1,"div",123)(2,"div",139)(3,"a",125),n(4,"Shipment Terms"),t()(),i(5,"div",140),u(6,SD,13,3,"div",141),t()()()),a&2){let e=p(3);l(6),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.shipment_terms)}}function ED(a,d){if(a&1&&(i(0,"div",19)(1,"div",20)(2,"h3",21),n(3,"Order Terms & Fulfillment"),t()(),i(4,"div",22)(5,"div",7),u(6,bD,8,1,"div",120)(7,CD,7,1,"div",121),t()()()),a&2){let e=p(2);l(6),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_shipment_terms)==="YES")}}function ID(a,d){if(a&1&&(i(0,"li",153)(1,"a",113)(2,"div",72)(3,"ul",114)(4,"li",115),x(5,"i",116),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.drive_path,q),l(5),m(" ",e.filename,"")}}function DD(a,d){if(a&1&&(i(0,"div")(1,"div",154)(2,"div",40)(3,"ul",155)(4,"li",156)(5,"b",14),n(6,"Gross Total:"),t(),i(7,"span",157),n(8),_(9,"currencyFormat"),t()(),i(10,"li",156)(11,"b",14),n(12,"Discount:"),t(),i(13,"span",158),n(14),_(15,"currencyFormat"),t()(),i(16,"li",156)(17,"b",14),n(18,"Net Total:"),t(),i(19,"span",157),n(20),_(21,"currencyFormat"),t()(),i(22,"li",159)(23,"span",14),n(24,"SGST:"),t(),i(25,"span",157),n(26),_(27,"currencyFormat"),t()(),i(28,"li",159)(29,"span",14),n(30,"CGST:"),t(),i(31,"span",157),n(32),_(33,"currencyFormat"),t()(),i(34,"li",159)(35,"span",14),n(36,"IGST:"),t(),i(37,"span",157),n(38),_(39,"currencyFormat"),t()(),i(40,"li",156)(41,"b",14),n(42,"Total Tax Amount:"),t(),i(43,"span",157),n(44),_(45,"currencyFormat"),t()(),i(46,"li",156)(47,"b",14),n(48,"Logistics:"),t(),i(49,"span",157),n(50),_(51,"currencyFormat"),t()(),i(52,"li",156)(53,"b",14),n(54,"Insurance:"),t(),i(55,"span",157),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",160)(59,"span",14),n(60,"Total Payable Amount: "),t(),i(61,"span",157),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,12,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,14,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,16,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,18,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,20,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,22,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,24,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),"")}}function TD(a,d){if(a&1&&(i(0,"div")(1,"div",154)(2,"div",40)(3,"ul",155)(4,"li",156)(5,"b",14),n(6,"Gross Total:"),t(),i(7,"span",157),n(8),_(9,"currencyFormat"),t()(),i(10,"li",156)(11,"b",14),n(12,"Discount:"),t(),i(13,"span",158),n(14),_(15,"currencyFormat"),t()(),i(16,"li",156)(17,"b",14),n(18,"Net Total:"),t(),i(19,"span",157),n(20),_(21,"currencyFormat"),t()(),i(22,"li",159)(23,"span",14),n(24,"SGST:"),t(),i(25,"span",157),n(26),_(27,"currencyFormat"),t()(),i(28,"li",159)(29,"span",14),n(30,"CGST:"),t(),i(31,"span",157),n(32),_(33,"currencyFormat"),t()(),i(34,"li",159)(35,"span",14),n(36,"IGST:"),t(),i(37,"span",157),n(38),_(39,"currencyFormat"),t()(),i(40,"li",156)(41,"b",14),n(42,"Total Tax Amount:"),t(),i(43,"span",157),n(44),_(45,"currencyFormat"),t()(),i(46,"li",156)(47,"b",14),n(48,"Logistics:"),t(),i(49,"span",157),n(50),_(51,"currencyFormat"),t()(),i(52,"li",156)(53,"b",14),n(54,"Insurance:"),t(),i(55,"span",157),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",160)(59,"span",14),n(60,"Total Payable Amou
1nt: "),t(),i(61,"span",157),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,12,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,14,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,16,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,18,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,20,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,22,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,24,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),"")}}function wD(a,d){if(a&1&&(i(0,"div")(1,"div",154)(2,"div",40)(3,"ul",155)(4,"li",156)(5,"b",14),n(6,"Total Bid Value:"),t(),i(7,"span",157),n(8),_(9,"currencyFormat"),t()(),i(10,"li",159)(11,"span",14),n(12,"SGST:"),t(),i(13,"span",157),n(14),_(15,"currencyFormat"),t()(),i(16,"li",159)(17,"span",14),n(18,"CGST:"),t(),i(19,"span",157),n(20),_(21,"currencyFormat"),t()(),i(22,"li",159)(23,"span",14),n(24,"IGST:"),t(),i(25,"span",157),n(26),_(27,"currencyFormat"),t()(),i(28,"li",156)(29,"b",14),n(30,"Total Tax Amount:"),t(),i(31,"span",157),n(32),_(33,"currencyFormat"),t()(),i(34,"li",156)(35,"b",14),n(36,"Logistics:"),t(),i(37,"span",157),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",160)(41,"span",14),n(42,"Total Payable Amount: "),t(),i(43,"span",157),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,7,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m(" ",v(15,9,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(21,11,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(27,13,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(33,15,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(39,17,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),""),l(6),f(v(45,19,e.totalAmount))}}function PD(a,d){if(a&1&&(i(0,"div")(1,"div",154)(2,"div",40)(3,"ul",155)(4,"li",156)(5,"b",14),n(6,"Gross Total:"),t(),i(7,"span",157),n(8),_(9,"currencyFormat"),t()(),i(10,"li",156)(11,"b",14),n(12,"Discount:"),t(),i(13,"span",158),n(14),_(15,"currencyFormat"),t()(),i(16,"li",156)(17,"b",14),n(18,"Net Total:"),t(),i(19,"span",157),n(20),_(21,"currencyFormat"),t()(),i(22,"li",159)(23,"span",14),n(24,"SGST:"),t(),i(25,"span",157),n(26),_(27,"currencyFormat"),t()(),i(28,"li",159)(29,"span",14),n(30,"CGST:"),t(),i(31,"span",157),n(32),_(33,"currencyFormat"),t()(),i(34,"li",159)(35,"span",14),n(36,"IGST:"),t(),i(37,"span",157),n(38),_(39,"currencyFormat"),t()(),i(40,"li",156)(41,"b",14),n(42,"Total Tax Amount:"),t(),i(43,"span",157),n(44),_(45,"currencyFormat"),t()(),i(46,"li",156)(47,"b",14),n(48,"Additional Charges:"),t(),i(49,"span",157),n(50),_(51,"currencyFormat"),t()()()(),i(52,"div",160)(53,"span",14),n(54,"Total Payable Amount: "),t(),i(55,"span",157),n(56),_(57,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,9,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(15,11,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(21,13,e.invoiceDetails==null?null:e.invoiceDetails.net_charges),""),l(6),m(" ",v(27,15,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(33,17,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(39,19,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(45,21,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(6),m(" ",v(51,23,e.getAdditionalCharges()),""),l(6),m(" ",v(57,25,e.invoiceDetails==null?null:e.invoiceDetails.total_amount),"")}}function OD(a,d){if(a&1){let e=I();i(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",10)(5,"h2",11)(6,"a",12),x(7,"i",13),t(),n(8),i(9,"span",14),n(10,"Invoice"),t()()(),i(11,"div",15),u(12,X6,4,1,"button",16),i(13,"button",17),S("click",function(){b(e);let r=p();return y(r.printInvoice())}),u(14,eI,4,0,"span",18)(15,tI,6,0,"span",18),t()()()(),i(16,"div",8)(17,"div",19)(18,"div",20)(19,"h3",21),n(20,"Proforma Invoice"),t()(),i(21,"div",22)(22,"div",23)(23,"div",24)(24,"div",25),n(25,"Invoice Number"),t(),i(26,"div",26),n(27),t()(),i(28,"div",24),u(29,iI,2,0,"div",27)(30,nI,2,0,"div",27),i(31,"div",26),n(32),t()(),i(33,"div",24)(34,"div",25),n(35,"Source ID"),t(),i(36,"div",26),u(37,aI,2,2,"button",28)(38,rI,1,1,"ng-template",null,0,P),t()(),i(40,"div",24)(41,"div",25),n(42,"Invoice Date"),t(),i(43,"div",26),n(44),_(45,"date"),t()(),i(46,"div",24)(47,"div",25),n(48,"Invoice Due in Day(s)"),t(),i(49,"div",26),n(50),t()(),i(51,"div",24)(52,"div",25),n(53,"Additional Services Documents "),t(),i(54,"div",26),n(55),t()(),i(56,"div",24),u(57,lI,2,0,"div",27)(58,oI,2,0,"div",27),i(59,"div",26),n(60),t()(),u(61,sI,5,1,"div",29),t()()(),i(62,"div",19)(63,"div",20)(64,"h3",30)(65,"span",14),n(66,"Invoice ID:"),t(),n(67),t()(),i(68,"div",22)(69,"div",31)(70,"div",32),u(71,pI,19,4,"div",33),t(),i(72,"div",34),u(73,mI,2,1,"div",35),t()()()(),u(74,uI,35,6,"div",36),i(75,"div",19)(76,"div",20)(77,"h3",21),n(78,"Buyer Address"),t()(),i(79,"div",22)(80,"div",37)(81,"div",38)(82,"div",39)(83,"div",40)(84,"p",41)(85,"span",14),n(86,"Shipping Address : "),t()(),u(87,_I,4,1,"p",42),i(88,"p",43),n(89),t()()()(),i(90,"div",38)(91,"div",39)(92,"div",40)(93,"p",44),n(94,"Billing Address : "),t(),u(95,vI,4,1,"p",42),i(96,"p",43),n(97),t(),i(98,"p",45)(99,"span",14),n(100,"GST No:"),t(),u(101,gI,2,1,"span",46)(102,fI,2,0,"span",47),t()()()()()()(),i(103,"div",19)(104,"div",48)(105,"h3",21),n(106,"Order Summary"),t()(),i(107,"div",49)(108,"div",50)(109,"div",51)(110,"div",52)(111,"table",53),u(112,bI,18,2,"thead",54)(113,yI,16,0,"thead",54)(114,SI,14,0,"thead",54)(115,CI,16,0,"thead",54)(116,MI,4,3,"tbody",55)(117,jI,4,3,"tbody",55)(118,XI,4,3,"tbody",55)(119,dD,4,3,"tbody",55),t()()()()()(),u(120,vD,16,2,"div",36)(121,ED,8,2,"div",36),i(122,"div",56)(123,"div",57)(124,"div",58)(125,"div",20)(126,"h3",21),n(127,"Terms & Conditions:"),t()(),i(128,"div",22)(129,"div",59)(130,"p",60),n(131),t()(),i(132,"ul",61),u(133,ID,7,2,"li",62),t()()()(),i(134,"div",63),u(135,DD,64,30,"div",55)(136,TD,64,30,"div",55)(137,wD,46,21,"div",55)(138,PD,58,27,"div",55),t()(),i(139,"div",7),x(140,"div",64),t()()()()}if(a&2){let e=w(39),o=p();l(8),m(" ",o.invoiceType==="child"?"Tax":"Proforma"," "),l(4),s("ngIf",o.canCancel),l(),s("disabled",o.isPrintLoading),l(
1),s("ngIf",!o.isPrintLoading),l(),s("ngIf",o.isPrintLoading),l(12),f(o.invoiceDetails==null?null:o.invoiceDetails.invoice_id),l(2),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(o.invoiceDetails==null?null:o.invoiceDetails.po_number),l(5),s("ngIf",o.canOpenSource)("ngIfElse",e),l(7),m("",U(45,46,o.invoiceDetails==null?null:o.invoiceDetails.proforma_created_date,"dd-MM-yyyy")," "),l(6),f(o.invoiceDetails!=null&&o.invoiceDetails.invoice_due_days?o.invoiceDetails==null?null:o.invoiceDetails.invoice_due_days:"-"),l(5),m("",o.invoiceDetails==null?null:o.invoiceDetails.service_documents_required," "),l(2),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(o.shippingAddrdres==null?null:o.shippingAddrdres.region),l(),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.source)==="rfq"),l(6),m(" ",o.invoiceDetails==null?null:o.invoiceDetails.invoice_id," "),l(4),s("ngIf",o.invoiceDetails.seller_address),l(2),s("ngIf",o.invoiceDetails&&o.invoiceDetails.seller_details&&o.invoiceDetails.seller_details.company_logoViewPath),l(),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.payment_mode)!=="Cash"),l(13),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.buyer_company_name)||(o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null?null:o.invoiceDetails.buyerCompanyDetails.company_name)||(o.shippingAddrdres==null?null:o.shippingAddrdres.company_name)),l(2),m(" ",o.shippingAddrdres==null?null:o.shippingAddrdres.full_address," "),l(6),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.buyer_company_name)||(o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null?null:o.invoiceDetails.buyerCompanyDetails.company_name)||(o.billingAddres==null?null:o.billingAddres.company_name)),l(2),m(" ",o.billingAddres==null?null:o.billingAddres.full_address," "),l(4),s("ngIf",o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null?null:o.invoiceDetails.buyerCompanyDetails.gst),l(),s("ngIf",!(!(o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null)&&o.invoiceDetails.buyerCompanyDetails.gst)),l(9),s("ngSwitch",o.invoiceDetails==null?null:o.invoiceDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual"),l(),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.service_documents_required)=="yes"),l(),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.multiple_payment_terms)==="YES"||(o.invoiceDetails==null?null:o.invoiceDetails.multiple_shipment_terms)==="YES"),l(10),m(" ",o.invoiceDetails!=null&&o.invoiceDetails.terms?o.invoiceDetails.terms:"No Terms Provided",""),l(2),s("ngForOf",o.invoiceDetails==null?null:o.invoiceDetails.detail_seller_terms_and_conditions_path),l(),s("ngSwitch",o.invoiceDetails==null?null:o.invoiceDetails.source),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}var Ya=(()=>{class a{constructor(e,o,r,c){this.financeOrderService=e,this.activatedRoute=o,this.router=r,this.notificationService=c,this.isLoading=!1,this.isPrintLoading=!1,this.additionalDocs=[]}get isWorkOrder(){return String(this.invoiceDetails?.order_type||"").toUpperCase()==="WO"}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}onSourceClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;if(!o)return;let r="";if(e==="rfq"?r="/rfq/sellers/rfq-details/"+o:e==="auction"&&(r="/auction/seller-auction-details/"+o),!r)return;let c=window.location.href.replace(this.router.url,"");window.open(c+r,"_blank")}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.GetInvoiceDetails()}),less.modifyVars({"@theme":"#024A2F"})}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}GetInvoiceDetails(){try{this.isLoading=!0;let e=new Vt;
1e.invoice_id=Number(this.invoiceId),this.invoiceType==="child"?this.financeOrderService.GetTaxInvoiceDetails(e).subscribe(o=>{this.invoiceDetails=o.response.data,this.enrichShipmentTermProducts(),this.invoiceDetails&&(this.invoiceDetails.buyer_address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddres=r),this.invoiceDetails.buyer_address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddrdres=r)),this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}):this.financeOrderService.GetInvoiceDetails(e).subscribe(o=>{this.invoiceDetails=o.response.data,this.enrichShipmentTermProducts(),this.invoiceDetails&&(this.invoiceDetails.buyer_address.filter(g=>g.addressType=="billing").forEach(g=>this.billingAddres=g),this.invoiceDetails.buyer_address.filter(g=>g.addressType=="shipping").forEach(g=>this.shippingAddrdres=g)),this.additionalDocs=[];let r=g=>`${g.docName||""}|${g.filename||g.file_name||g.name||""}|${g.drive_path||g.path||g.viewPath||g.file_path||""}`,c=new Set;(this.invoiceDetails.additionalDocuments||[]).forEach(g=>{let h=r(g);if(c.has(h))return;c.add(h);let C=this.additionalDocs.findIndex(k=>k.collectionName===g.docName);C===-1?this.additionalDocs.push({collectionName:g.docName,docs:[g]}):this.additionalDocs[C].docs.push(g)}),this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}get totalAmount(){if(this.invoiceDetails!==null)return this.invoiceDetails?.gross-this.invoiceDetails?.discount_amount+this.invoiceDetails?.gst_amount+this.invoiceDetails?.shipping_charges+this.invoiceDetails?.logistics_charges+this.invoiceDetails?.insurance_charges}getAdditionalCharges(){return this.invoiceDetails?.additional_charges?.length?this.invoiceDetails.additional_charges.reduce((e,o)=>e+(parseFloat(o.amount)||0),0):0}get advanceDetails(){if(this.invoiceDetails&&this.invoiceDetails.receipts){let e=this.invoiceDetails.receipts.filter(o=>o.advance_payment==="yes");if(e.length)return e[0]}return{terms:"Not Available",amount:"0"}}OnClickRegenerateInvoice(){this.router.navigate(["finance-management/receivable-invoices/create-from-po"],{queryParams:{poId:this.invoiceDetails.po_id}})}printInvoice(){this.isPrintLoading=!0;let e=this.invoiceType==="child"?"TAX_INVOICE":"PROFORMA_INVOICE";this.financeOrderService.printPdf(e,Number(this.invoiceId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1,this.notificationService.showError("Failed to generate print document.")}})}enrichShipmentTermProducts(){let e=this.invoiceDetails?.items||[];(this.invoiceDetails?.shipment_terms||[]).forEach(o=>{(o.products||[]).forEach(r=>{let c=e.find(g=>r.po_item_id&&Number(g.item_id)===Number(r.po_item_id)||r.product_id&&Number(g.product_id)===Number(r.product_id));c&&(r.product_name=r.product_name||c.product_name,r.sku=r.sku||c.sku||c.display_item_id)})})}get canCancel(){if((this.invoiceDetails?.source||"").toLowerCase()==="manual")return!1;let e=["invoice created","invoice received"],o=(this.invoiceDetails?.buyer_status||"").toLowerCase(),r=(this.invoiceDetails?.seller_status||"").toLowerCase();return e.includes(o)&&e.includes(r)}cancelInvoice(){try{this.isLoading=!0;let e=new Si;e.po_id=""+this.invoiceDetails.po_id,e.invoice_id=""+this.invoiceId,e.status_type="cancel",this.financeOrderService.ApproveStatusForInvoice(e).subscribe({next:o=>{this.notificationService.showSuccess("Invoice cancelled successfully"),this.isLoading=!1,this.GetInvoiceDetails()},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(K),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-send-to-buyer-view"]],decls:2,vars:2,consts:[["plainSourceId",""],["prods",""],["popContent",""],["noFiles",""],[3,"isLoading"],["id","content","class","rfq-pages generate-po-page container-fluid overflow-hidden-non-i",4,"ngIf"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button","class","mod-btn mod-btn-outline-danger btn-sm mr-2",3,"disabled","click",4,"ngIf"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["class","mod-meta-label","appTranslate","",4,"ngIf"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngIf"],[1,"mod-card-title","mb-0"],[1,"row","mt-15","mb
1-30"],[1,"col-md","col-12"],["class","card border-0",4,"ngIf"],[1,"col-md-auto","col-12"],["class","text-center",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"card","h-100","mb-0"],[1,"card-body"],[1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"text-secondary"],["appTranslate","",1,"fw-600","mb-2"],[1,"fw-600","mb-1"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["data-toggle","collapse","data-target","#coll__OrderSummary","aria-expanded","false",1,"mod-card-header","border-bottom-0","cardCollapseArrow"],["id","coll__OrderSummary",1,"collapse","show"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],["class","",4,"ngSwitchCase"],[4,"ngSwitchCase"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[1,"col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-danger","btn-sm","mr-2",3,"click","disabled"],[1,"uil","uil-times-circle"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["type","button",1,"mod-btn-action",3,"click","title"],[1,"card","border-0"],[1,"card-body","p-2"],["appTranslate","",1,"fw-600"],["appTranslate","",1,"text-secondary"],[1,"text-center"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"ri-bank-line"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],[1,"text-secondary","mb-1"],[1,""],["appTranslate","",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","5"],["colspan","2",1,"cell-300"],["colspan","1"],["colspan","4"],[1,"mod-card-header","border-bottom-0"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],["scope","col","appTranslate",""],["class","row w-100",4,"ngIf","ngIfElse"],[1,"row","w-100"],["class","col-auto",4,"ngFor","ngForOf"],[1,"col-auto"],["target","_blank",1,"card",3,"href"],[1,"list-inline","align-items-center","mb-0"],[1,"list-inline-item","theme-color","font-12","fw-600"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["appTranslate","",1,"text-muted","small"],["colspan","2"],["appTranslate","",1,"text-center","mb-0"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-12","mb-30"],[1,"card"],["data-toggle","collapse","data-target","#stbv__PaymentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","stbv__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20"],["data-toggle","collapse","data-target","#stbv__ShipmentTerms","aria-expanded","fal
1se",1,"card-header","cardCollapseArrow","bg-white"],["id","stbv__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],[1,"list-inline-item"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"]],template:function(o,r){o&1&&(x(0,"app-loader",4),u(1,OD,141,49,"div",5)),o&2&&(s("isLoading",r.isLoading),l(),s("ngIf",r.invoiceDetails))},dependencies:[J,W,pt,mt,Se,Z,De,L,st,ae],styles:[".pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--seller-green)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--seller-green)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--seller-green)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--seller-green);border-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--seller-green);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--seller-green);color:#fff}.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--seller-green)}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{vertical-align:top}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;width:100px}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.fileListBadge[_ngcontent-%COMP%]{padding:2px 5px;border-radius:3px;background-color:#ddf3ff;color:#006fae}.fileListBadge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1rem}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;
1color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.width-69px[_ngcontent-%COMP%]{width:69px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();function kD(a,d){a&1&&(i(0,"span",37),n(1,"Purchase Order"),t())}function FD(a,d){a&1&&(i(0,"span",37),n(1,"Work Order"),t())}function MD(a,d){if(a&1){let e=I();i(0,"button",65),S("click",function(){b(e);let r=p(2);return y(r.toDealRoom())}),x(1,"i",66),i(2,"span",37),n(3,"Deal Room"),t()()}}function AD(a,d){a&1&&(i(0,"span"),x(1,"i",67),i(2,"span",37),n(3,"Print"),t()())}function ND(a,d){a&1&&(i(0,"span")(1,"div",68)(2,"span",69),n(3,"Loading..."),t()(),i(4,"span",37),n(5,"Printing..."),t()())}function VD(a,d){a&1&&(i(0,"span",37),n(1,"Purchase Order Details"),t())}function BD(a,d){a&1&&(i(0,"span",37),n(1,"Work Order Details"),t())}function RD(a,d){a&1&&(i(0,"span",37),n(1,"PO No."),t())}function LD(a,d){a&1&&(i(0,"span",37),n(1,"WO No."),t())}function qD(a,d){if(a&1){let e=I();i(0,"button",70),S("click",function(){b(e);let r=p(2);return y(r.onSourceClick())}),n(1),t()}if(a&2){let e=p(2);s("title",e.supplierData==null?null:e.supplierData.display_source_id),l(),m(" ",(e.supplierData==null?null:e.supplierData.display_source_id)||"--"," ")}}function GD(a,d){if(a&1&&n(0),a&2){let e=p(2);f((e.supplierData==null?null:e.supplierData.display_source_id)||"--")}}function UD(a,d){a&1&&(i(0,"span",37),n(1,"Purchase Order Date"),t())}function jD(a,d){a&1&&(i(0,"span",37),n(1,"Work Order Date"),t())}function $D(a,d){a&1&&(i(0,"span",37),n(1,"Purchase Order Expiry Date"),t())}function zD(a,d){a&1&&(i(0,"span",37),n(1,"Work Order Expiry Date"),t())}function WD(a,d){a&1&&(i(0,"span",37),n(1,"Place of Supply"),t())}function QD(a,d){a&1&&(i(0,"span",37),n(1,"Place of Service"),t())}function YD(a,d){if(a&1&&(i(0,"p",74),n(1),t()),a&2){let e=d.$implicit;l(),m(" ",e,"")}}function HD(a,d){if(a&1&&(F(0),u(1,YD,2,1,"p",73),M()),a&2){let e=p(4);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.additionalDocumentsTags)}}function KD(a,d){if(a&1){let e=I();i(0,"span",75,2),S("mouseenter",function(){b(e);let r=w(1),c=p(4);return y(c.toggleWithGreeting(r))})("mouseleave",function(){b(e);let r=w(1),c=p(4);return y(c.toggleWithGreeting(r))}),i(2,"small",37),n(3,"view requested files"),t()()}if(a&2){p();let e=w(3);s("ngbPopover",e)}}function ZD(a,d){if(a&1&&(i(0,"div",27),n(1),u(2,HD,2,1,"ng-template",null,1,P)(4,KD,4,1,"span",72),t()),a&2){let e=p(3);l(),m(" ",e.supplierData==null?null:e.supplierData.service_documents_required," "),l(3),s("ngIf",(e.supplierData==null?null:e.supplierData.service_documents_required)==="yes")}}function JD(a,d){if(a&1&&(i(0,"div",25)(1,"div",28),n(2," Additional Services Documents"),t(),u(3,ZD,5,2,"div",71),t()),a&2){let e=p(2);l(3),s("ngIf",(e.supplierData==null?null:e.supplierData.source)==="rfq"&&(e.supplierData==null?null:e.supplierData.service_documents_required)!=="")}}function XD(a,d){if(a&1&&(i(0,"div",25)(1,"div",28),n(2," Payment Mode "),t(),i(3,"div",27),n(4),t()()),a&2){let e=p(2);l(4),m(" ",e.supplierData==null?null:e.supplierData.payment_mode," ")}}function eT(a,d){a&1&&(i(0,"span",76),n(1," Not available at the moment "),t())}function tT(a,d){if(a&1&&(i(0,"div",9)(1,"div",34)(2,"div",35)(3,"p",36),u(4,eT,2,0,"span",39),t()()()()),a&2){let e=p(2);l(4),s("ngIf",e.supplierData&&!e.supplierData.seller_address)}}function iT(a,d){if(a&1&&(i(0,"span",77),n(1),t()),a&2){let e=p(2);l(),f(e.supplierData==null||e.supplierData.seller_details==null?null:e.supplierData.seller_details.company_name)}}function nT(a,d){a&1&&(i(0,"span",76),n(1,"Not available"),t())}function aT(a,d){if(a&1&&(i(0,"span",77),n(1),t()),a&2){let e=p(2);l(),f(e.supplierData==null?null:e.supplierData.seller_gst)}}function rT(a,d){a&1&&(i(0,"span",76),n(1,"Not available"),t())}function lT(a,d){if(a&1&&(i(0,"span",77),n(1),t()),a&2){let e=p(2);l(),se(" ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.street,", ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.region,", ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.city,", ",e.supplierData==null||e.supplierData.seller_address==null?null:e.supplierData.seller_address.postcode," ")}}function oT(a,d){a&1&&(i(0,"span",76),n(1," No Address Found "),t())}function sT(a,d){if(a&1&&(i(0,"p",78)(1,"span",79),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);
1l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name,"")}}function dT(a,d){if(a&1&&(i(0,"p",80)(1,"b",79),n(2,"Address:"),t(),i(3,"span",77),n(4),t()()),a&2){let e=p(2);l(4),se(" ",e.shippingAddress==null?null:e.shippingAddress.street,", ",e.shippingAddress==null?null:e.shippingAddress.region,", ",e.shippingAddress==null?null:e.shippingAddress.city,", ",e.shippingAddress==null?null:e.shippingAddress.postcode," ")}}function cT(a,d){a&1&&(i(0,"p",80)(1,"b",79),n(2,"Address:"),t(),i(3,"span",76),n(4," Not available "),t()())}function pT(a,d){if(a&1&&(i(0,"p",78)(1,"span",79),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name,"")}}function mT(a,d){if(a&1&&(i(0,"span",77),n(1),t()),a&2){let e=p(2);l(),f(e.supplierData==null?null:e.supplierData.gstn)}}function uT(a,d){a&1&&(i(0,"span",76),n(1,"Not available"),t())}function _T(a,d){if(a&1&&(i(0,"p",80)(1,"b",79),n(2,"Address:"),t(),i(3,"span",77),n(4),t()()),a&2){let e=p(2);l(4),se(" ",e.billingAddress==null?null:e.billingAddress.street,", ",e.billingAddress==null?null:e.billingAddress.region,", ",e.billingAddress==null?null:e.billingAddress.city,", ",e.billingAddress==null?null:e.billingAddress.postcode," ")}}function vT(a,d){a&1&&(i(0,"p",80)(1,"b",79),n(2,"Address:"),t(),i(3,"span",76),n(4," Not available "),t()())}function gT(a,d){if(a&1&&(i(0,"div",81)(1,"div",82),x(2,"img",83),t()()),a&2){let e=p(2);l(2),s("src",e.poDetails.buyer_profile,q)}}function fT(a,d){if(a&1&&(i(0,"th",84)(1,"span"),n(2),t()()),a&2){let e=d.$implicit;l(2),f(e.title)}}function hT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function xT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function bT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function yT(a,d){if(a&1&&(F(0),i(1,"div",89),n(2),t(),i(3,"p",90),u(4,hT,2,2,"span",91)(5,xT,2,2,"span",91)(6,bT,2,2,"span",91),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function ST(a,d){if(a&1&&(F(0),i(1,"div",89)(2,"div")(3,"p",93)(4,"span",37),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",93)(9,"span",37),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",93)(14,"span",37),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",93),n(19),_(20,"currencyFormat"),t(),i(21,"p",93),n(22),_(23,"currencyFormat"),t(),i(24,"p",93),n(25),_(26,"currencyFormat"),t(),i(27,"p",93),n(28),_(29,"currencyFormat"),t(),i(30,"p",93)(31,"span",37),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",93)(36,"span",37),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",94),i(41,"p",78)(42,"b")(43,"span",37),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.total_amount)," ")}}function CT(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",86),n(3),t(),u(4,yT,7,4,"ng-template",null,3,P),x(6,"i",87),t(),i(7,"td",88),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),_(15,"currencyFormat"),i(16,"small"),n(17,"/unit"),t()(),i(18,"td"),n(19),_(20,"currencyFormat"),t(),i(21,"td"),n(22),_(23,"currencyFormat"),t(),i(24,"td"),n(25),_(26,"currencyFormat"),t(),i(27,"td"),n(28),_(29,"currencyFormat"),u(30,ST,47,34,"ng-template",null,4,P),x(32,"i",87),t()()),a&2){let e=d.$implicit,o=w(5),r=w(31);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),f(e.required_qty),l(2),m("",v(15,11,e.unit_price)," "),l(5),f(v(20,13,e.gross_total)),l(3),f(v(23,15,e.discount)),l(3),f(v(26,17,e.gst)),l(3),m(" ",v(29,19,e.total_amount)," "),l(4),s("ngbPopover",r)}}function ET(a,d){if(a&1&&(i(0,"tbody"),u(1,CT,33,21,"tr",85),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function IT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function DT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function TT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function wT(a,d){if(a&1&&(F(0),i(1,"div",89),n(2),t(),i(3,"p",90),u(4,IT,2,2,"span",91)(5,DT,2,2,"span",91)(6,TT,2,2,"span",91),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function PT(a,d){if(a&1&&(F(0),i(1,"div",89)(2,"div")(3,"p",93)(4,"span",37),n(5,"Total Bid Value:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",93),n(9),_(10,"currencyFormat"),t(),i(11,"p",93),n(12),_(13,"currencyFormat"),t(),i(14,"p",93),n(15),_(16,"currencyFormat"),t(),i(17,"p",93),n(18),_(19,"currencyFormat"),t(),x(20,"div",94),i(21,"p",78)(22,"b")(23,"span",37),n(24,"Total Payable:"),t(),n(25),_(26,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,10,e.gross_total)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(10,12,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(13,14,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(16,16,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(19,18,e.igst),""),l(7),m(" ",v(26,20,e.total_amount)," ")}}function OT(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",86),n(3),t(),u(4,wT,7,4,"ng-template",null,3,P),x(6,"i",87),t(),i(7,"td",88),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),u(20,PT,27,22,"ng-template",null,4,P),x(22,"i",87),t()()),a&2){let e=d.$implicit,o=w(5),r=w(21);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(13,8,e.gross_total)),l(3),m(" ",v(16,10,e.gst),""),l(3),m(" ",v(19,12,e.total_amount)," "),l(4),s("ngbPopover",r)}}function kT(a,d){if(a&1&&(i(0,"tbody"),u(1,OT,23,14,"tr",85),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function FT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function MT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function AT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function NT(a,d){if(a&1&&(F(0),i(1,"div",89),n(2),t(),i(3,"p",90),u(4,FT,2,2,"span",91)(5,MT,2,2,"span",91)(6,AT,2,2,"span",91),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function VT(a,d){if(a&1&&(F(0),i(1,"div",89)(2,"div")(3,"p",93)(4,"span",37),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",93)(9,"span",37),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",93)(14,"span",37),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",93)(19,"span",37),n(20,"Tax "),t(),n(21),_(22,"currencyFormat"),t(),i(23,"p",93)(24,"span",37),n(25,"SGST"),t(),n(26),_(27,"currencyFormat"),t(),i(28,"p",93)(29,"span",37),n(30,"CGST"),t(),n(31),_(32,"currencyFormat"),t(),i(33,"p",93)(34,"span",37),n(35,"IGST"),t(),n(36),_(37,"currencyFormat"),t(),i(38,"p",93)(39,"span",37),n(40," Logistics:"),t(),n(41),_(42,"currencyFormat"),t(),i(43,"p",93)(44,"span",37),n(45,"Insurance:"),t(),n(46),_(47,"currencyFormat"),t(),x(48,"div",94),i(49,"p",78)(50,"b")(51,"span",37),n(52,"Total Payable:"),t(),n(53),_(54,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.gross_total-e.discount)," "),l(5),D("(",e.gst_percentage,"%): ",v(22,20,e.gst)," "),l(5),D(" (",e.
1sgst_percentage,"%): ",v(27,22,e.sgst)," "),l(5),D(" (",e.cgst_percentage,"%): ",v(32,24,e.cgst)," "),l(5),D(" (",e.igst_percentage,"%): ",v(37,26,e.igst)," "),l(5),m(" ",v(42,28,e.logistics_charges)," "),l(5),m(" ",v(47,30,e.insurance_charges)," "),l(7),m(" ",v(54,32,e.net_amount)," ")}}function BT(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",86),n(3),t(),u(4,NT,7,4,"ng-template",null,3,P),x(6,"i",87),t(),i(7,"td",88),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),t(),i(20,"td"),n(21),_(22,"currencyFormat"),u(23,VT,55,34,"ng-template",null,4,P),x(25,"i",87),t()()),a&2){let e=d.$implicit,o=w(5),r=w(24);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m(" ",v(13,9,e.unit_price)," "),l(3),m(" ",v(16,11,e.discount),""),l(3),m(" ",v(19,13,e.gst),""),l(3),m(" ",v(22,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function RT(a,d){if(a&1&&(i(0,"tbody"),u(1,BT,26,17,"tr",85),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function LT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function qT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function GT(a,d){if(a&1&&(i(0,"span",92),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function UT(a,d){if(a&1&&(F(0),i(1,"div",89),n(2),t(),i(3,"p",90),u(4,LT,2,2,"span",91)(5,qT,2,2,"span",91)(6,GT,2,2,"span",91),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function jT(a,d){if(a&1&&(F(0),i(1,"div",89)(2,"div")(3,"p",93)(4,"span",37),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",93)(9,"span",37),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",93)(14,"span",37),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",93),n(19),_(20,"currencyFormat"),t(),i(21,"p",93),n(22),_(23,"currencyFormat"),t(),i(24,"p",93),n(25),_(26,"currencyFormat"),t(),i(27,"p",93),n(28),_(29,"currencyFormat"),t(),i(30,"p",93)(31,"span",37),n(32,"Additional Charges:"),t(),n(33),_(34,"currencyFormat"),t(),x(35,"div",94),i(36,"p",78)(37,"b")(38,"span",37),n(39,"Total Payable:"),t(),n(40),_(41,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit,o=p(3);l(6),m(" ",v(7,13,e.gross_total)," "),l(5),m(" ",v(12,15,e.discount)," "),l(5),m(" ",v(17,17,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,19,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,21,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,23,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,25,e.igst),""),l(5),m(" ",v(34,27,o.getAdditionalCharges())," "),l(7),m(" ",v(41,29,e.total_amount)," ")}}function $T(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",86),n(3),t(),u(4,UT,7,4,"ng-template",null,3,P),x(6,"i",87),t(),i(7,"td",88),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,jT,42,31,"ng-template",null,4,P),x(27,"i",87),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(5),f(v(18,11,e.gross_total)),l(3),f(v(21,13,e.discount)),l(3),m(" ",v(24,15,e.total_amount)," "),l(4),s("ngbPopover",r)}}function zT(a,d){if(a&1&&(i(0,"tbody"),u(1,$T,28,17,"tr",85),t()),a&2){let e=p(2);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function WT(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",37),n(3,"Additional Charge:"),t(),n(4,"\xA0"),i(5,"b"),n(6),t()(),i(7,"td",95)(8,"span",37),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e,o=d.$implicit,r=p(3);l(),Be("colspan",(((e=r.getTableHeaders(r.supplierData==null?null:r.supplierData.source))==null?null:e.length)||3)-2),l(5),f(o.description),l(5),f(v(12,3,o.amount))}}function QT(a,d){if(a&1&&(i(0,"tbody"),u(1,WT,13,5,"tr",85),t()),a&2){let e=p(2);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.additional_charges)}}function YT(a,d){if(a&1){let e=I();i(0,"a",111),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function HT(a,d){if(a&1){let e=I();i(0,"a",111),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function KT(a,d){if(a&1&&(i(0,"div")(1,"p",109)(2,"b",37),n(3,"Note:"),t(),n(4),t(),u(5,YT,2,0,"a",110)(6,HT,2,0,"a",110),t()),a&2){let e=p().$implicit;
1l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded&&e.note.length>120),l(),s("ngIf",e._expanded)}}function ZT(a,d){if(a&1&&(i(0,"div",102)(1,"div",35)(2,"div",103)(3,"div",104)(4,"h6",105),n(5),t(),i(6,"small",106)(7,"span",37),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",107)(12,"h6",108),n(13),_(14,"currencyFormat"),t()()(),u(15,KT,7,5,"div",19),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%) "),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function JT(a,d){if(a&1&&(i(0,"div",97)(1,"div",34)(2,"div",98)(3,"a",99),n(4,"Payment Terms"),t()(),i(5,"div",100)(6,"div",35),u(7,ZT,16,10,"div",101),t()()()()),a&2){let e=p(3);l(7),s("ngForOf",e.poDetails==null?null:e.poDetails.payment_terms)}}function XT(a,d){if(a&1&&(i(0,"div",120)(1,"div",121)(2,"div",117)(3,"h6",122),n(4),t(),i(5,"small",106)(6,"span",37),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",123)(10,"small",124),n(11,"Quantity"),t(),i(12,"h6",125),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function ew(a,d){if(a&1&&(i(0,"div",115)(1,"div",116)(2,"div",103)(3,"div",117)(4,"h6",118),n(5),t(),i(6,"small",106)(7,"span",37),n(8,"Timeline:"),t(),n(9),t()()()(),u(10,XT,14,3,"div",119),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," day(s)"),l(),s("ngForOf",e.products)}}function tw(a,d){if(a&1&&(i(0,"div",9)(1,"div",34)(2,"div",112)(3,"a",99),n(4,"Shipment Terms"),t()(),i(5,"div",113),u(6,ew,11,3,"div",114),t()()()),a&2){let e=p(3);l(6),s("ngForOf",e.poDetails==null?null:e.poDetails.shipment_terms)}}function iw(a,d){if(a&1&&(i(0,"div",20)(1,"div",21)(2,"h3",31),n(3,"Order Terms & Fulfillment"),t()(),i(4,"div",23)(5,"div",8),u(6,JT,8,1,"div",96)(7,tw,7,1,"div",32),t()()()),a&2){let e=p(2);l(6),s("ngIf",(e.poDetails==null?null:e.poDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.poDetails==null?null:e.poDetails.multiple_shipment_terms)==="YES")}}function nw(a,d){if(a&1&&x(0,"app-loader",126),a&2){let e=p(2);s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function aw(a,d){if(a&1&&(i(0,"p",127),n(1),t()),a&2){let e=p(2);l(),m(" ",e.poDetails!=null&&e.poDetails.terms?e.poDetails==null?null:e.poDetails.terms:"No Terms & Conditions Provided","")}}function rw(a,d){if(a&1&&(i(0,"div",128),x(1,"app-loader",126),i(2,"small",129),n(3,"Loading documents..."),t()()),a&2){let e=p(2);l(),s("isLoading",e.loadingStates.poDetails)("useBlockPosition",!0)}}function lw(a,d){if(a&1&&(i(0,"li",132)(1,"a",133),x(2,"i",134),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(2),m(" ",e.filename," ")}}function ow(a,d){if(a&1&&(i(0,"ul",130),u(1,lw,4,2,"li",131),t()),a&2){let e=p(2);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function sw(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Logistics:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function dw(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Insurance:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges),"")}}function cw(a,d){if(a&1&&(i(0,"div")(1,"div",135)(2,"div",35)(3,"ul",136)(4,"li",137)(5,"b",37),n(6,"Gross Total:"),t(),i(7,"span",138),n(8),_(9,"currencyFormat"),t()(),i(10,"li",137)(11,"b",37),n(12,"Discount:"),t(),i(13,"span",139),n(14),_(15,"currencyFormat"),t()(),i(16,"li",137)(17,"b",37),n(18,"Net Total:"),t(),i(19,"span",138),n(20),_(21,"currencyFormat"),t()(),i(22,"li",140)(23,"span",37),n(24,"SGST:"),t(),i(25,"span",138),n(26),_(27,"currencyFormat"),t()(),i(28,"li",140)(29,"span",37),n(30,"CGST:"),t(),i(31,"span",138),n(32),_(33,"currencyFormat"),t()(),i(34,"li",140)(35,"span",37),n(36,"IGST:"),t(),i(37,"span",138),n(38),_(39,"currencyFormat"),t()(),i(40,"li",137)(41,"b",37),n(42,"TotalTax Amount:"),t(),i(43,"span",138),n(44),_(45,"currencyFormat"),t()(),u(46,sw,6,3,"li",141)(47,dw,6,3,"li",141),t()(),i(48,"div",142)(49,"span",37),n(50,"Total Payable Amou
1nt:"),t(),i(51,"span",138),n(52),_(53,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0),l(5),m(" ",v(53,24,e.poDetails==null?null:e.poDetails.total_amount),"")}}function pw(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Logistics:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function mw(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Insurance:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges),"")}}function uw(a,d){if(a&1&&(i(0,"div")(1,"div",135)(2,"div",35)(3,"ul",136)(4,"li",137)(5,"b",37),n(6,"Gross Total:"),t(),i(7,"span",138),n(8),_(9,"currencyFormat"),t()(),i(10,"li",137)(11,"b",37),n(12,"Discount:"),t(),i(13,"span",139),n(14),_(15,"currencyFormat"),t()(),i(16,"li",137)(17,"b",37),n(18,"Net Total:"),t(),i(19,"span",138),n(20),_(21,"currencyFormat"),t()(),i(22,"li",140)(23,"span",37),n(24,"SGST:"),t(),i(25,"span",138),n(26),_(27,"currencyFormat"),t()(),i(28,"li",140)(29,"span",37),n(30,"CGST:"),t(),i(31,"span",138),n(32),_(33,"currencyFormat"),t()(),i(34,"li",140)(35,"span",37),n(36,"IGST:"),t(),i(37,"span",138),n(38),_(39,"currencyFormat"),t()(),i(40,"li",137)(41,"b",37),n(42,"Total Tax Amount:"),t(),i(43,"span",138),n(44),_(45,"currencyFormat"),t()(),u(46,pw,6,3,"li",141)(47,mw,6,3,"li",141),t()(),i(48,"div",142)(49,"span",37),n(50,"Total Payable Amount:"),t(),i(51,"span",138),n(52),_(53,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0),l(5),m(" ",v(53,24,e.poDetails==null?null:e.poDetails.total_amount),"")}}function _w(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Logistics:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function vw(a,d){if(a&1&&(i(0,"div")(1,"div",135)(2,"div",35)(3,"ul",136)(4,"li",137)(5,"b",37),n(6,"Total Bid Value:"),t(),i(7,"span",138),n(8),_(9,"currencyFormat"),t()(),i(10,"li",140)(11,"span",37),n(12,"SGST:"),t(),i(13,"span",138),n(14),_(15,"currencyFormat"),t()(),i(16,"li",140)(17,"span",37),n(18,"CGST:"),t(),i(19,"span",138),n(20),_(21,"currencyFormat"),t()(),i(22,"li",140)(23,"span",37),n(24,"IGST:"),t(),i(25,"span",138),n(26),_(27,"currencyFormat"),t()(),i(28,"li",137)(29,"b",37),n(30,"Total Tax Amount:"),t(),i(31,"span",138),n(32),_(33,"currencyFormat"),t()(),u(34,_w,6,3,"li",141),t()(),i(35,"div",142)(36,"span",37),n(37,"Total Payable Amount:"),t(),i(38,"span",138),n(39),_(40,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,7,e.poDetails==null?null:e.poDetails.gross),""),l(6),m(" ",v(15,9,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(21,11,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(27,13,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(33,15,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(5),f(v(40,17,e.totalAmount))}}function gw(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Logistics:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.logistics_charges),"")}}function fw(a,d){if(a&1&&(i(0,"li",137)(1,"b",37),n(2,"Insurance:"),t(),i(3,"span",138),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(3);l(4),m(" ",v(5,1,e.poDetails==null?null:e.poDetails.insurance_charges),"")}}function hw(a,d){if(a&1&&(i(0,"div")(1,"div",135)(2,"div",35)(3,"ul",136)(4,"li",137)(5,"b",37),n(6,"Gross Total:"),t(),i(7,"span",138),n(8),_(9,"currencyFormat"),t()(),i(10,"li",137)(11,"b",37),n(12,"Discount:"),t(),i(13,"span",139),n(14),_(15,"currencyFormat"),t()(),i(16,"li",137)(17,"b",37),n(18,"Net Total:"),t(),i(19,"span",138),n(20),_(21,"currencyFormat"),t()(),i(22,"li",140)(23,"span",37),n(24,"SGST:"),t(),i(25,"span",138),n(26),_(27,"currencyFormat"),t()(),i(28,"li",140)(29,"span",37),n(30,"CGST:"),t(),i(31,"span",138),n(32),_(33,"currencyFormat"),t()(),i(34,"li",140)(35,"span",37),n(36,"IGST:"),t(),i(37,"span",138),n(38),_(39,"currencyFormat"),t()(),i(40,"li",137)(41,"b",37),n(42,"Total Tax Amount:"),t(),i(43,"span",138),n(44),_(45,"currencyFormat"),t()(),u(46,gw,6,3,"li",141)(47,fw,6,3,"li",141),t()(),i(48,"div",142)(49,"span",37),n(50,"Total Payable Amou
1nt:"),t(),i(51,"span",138),n(52),_(53,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(2),s("ngIf",+(e.poDetails==null?null:e.poDetails.logistics_charges)>0),l(),s("ngIf",+(e.poDetails==null?null:e.poDetails.insurance_charges)>0),l(5),m(" ",v(53,24,e.poDetails==null?null:e.poDetails.total_amount),"")}}function xw(a,d){if(a&1){let e=I();i(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"h2",12)(5,"a",13),x(6,"i",14),t(),u(7,kD,2,0,"span",15)(8,FD,2,0,"span",15),t()(),i(9,"div",16),u(10,MD,4,0,"button",17),i(11,"button",18),S("click",function(){b(e);let r=p();return y(r.printPO())}),u(12,AD,4,0,"span",19)(13,ND,6,0,"span",19),t()()()(),i(14,"div",9)(15,"div",20)(16,"div",21)(17,"h3",22),u(18,VD,2,0,"span",15)(19,BD,2,0,"span",15),t()(),i(20,"div",23)(21,"div",24)(22,"div",25)(23,"div",26),u(24,RD,2,0,"span",15)(25,LD,2,0,"span",15),t(),i(26,"div",27),n(27),t()(),i(28,"div",25)(29,"div",28),n(30,"Source ID"),t(),i(31,"div",27),u(32,qD,2,2,"button",29)(33,GD,1,1,"ng-template",null,0,P),t()(),i(35,"div",25)(36,"div",26),u(37,UD,2,0,"span",15)(38,jD,2,0,"span",15),t(),i(39,"div",27),n(40),_(41,"date"),t()(),i(42,"div",25)(43,"div",26),u(44,$D,2,0,"span",15)(45,zD,2,0,"span",15),t(),i(46,"div",27),n(47),_(48,"date"),t()(),i(49,"div",25)(50,"div",26),u(51,WD,2,0,"span",15)(52,QD,2,0,"span",15),t(),i(53,"div",27),n(54),t()(),u(55,JD,4,1,"div",30)(56,XD,5,1,"div",30),t()()(),i(57,"div",20)(58,"div",21)(59,"h3",31),n(60,"Supplier Details"),t()(),i(61,"div",23)(62,"div",8),u(63,tT,5,1,"div",32),i(64,"div",33)(65,"div",34)(66,"div",35)(67,"p",36)(68,"span",37),n(69,"Seller Name:"),t(),u(70,iT,2,1,"span",38)(71,nT,2,0,"span",39),t(),i(72,"p",36)(73,"span",37),n(74,"GST No:"),t(),u(75,aT,2,1,"span",38)(76,rT,2,0,"span",39),t(),i(77,"p",36)(78,"span",37),n(79,"Seller Address:"),t(),x(80,"br"),u(81,lT,2,4,"span",38)(82,oT,2,0,"span",39),t()()()()()()(),i(83,"div",20)(84,"div",21)(85,"h3",31),n(86,"Buyer Details"),t()(),i(87,"div",23)(88,"div",8)(89,"div",40)(90,"div",41)(91,"div",35)(92,"p",42),n(93,"Shipping Address "),t(),u(94,sT,4,1,"p",43)(95,dT,5,4,"p",44)(96,cT,5,0,"p",44),t()()(),i(97,"div",40)(98,"div",41)(99,"div",35)(100,"p",42),n(101,"Billing Address "),t(),u(102,pT,4,1,"p",43),i(103,"p",36)(104,"span",37),n(105,"GST No:"),t(),u(106,mT,2,1,"span",38)(107,uT,2,0,"span",39),t(),u(108,_T,5,4,"p",44)(109,vT,5,0,"p",44),t()()(),u(110,gT,3,1,"div",45),t()()(),i(111,"div",20)(112,"div",46)(113,"h3",31),n(114,"Order Summary"),t()(),i(115,"div",47)(116,"div",48)(117,"div",49)(118,"table",50)(119,"thead",51)(120,"tr"),u(121,fT,3,1,"th",52),t()(),u(122,ET,2,1,"tbody",53)(123,kT,2,1,"tbody",53)(124,RT,2,1,"tbody",53)(125,zT,2,1,"tbody",53)(126,QT,2,1,"tbody",19),t()()()()(),u(127,iw,8,2,"div",54),i(128,"div",55)(129,"div",56)(130,"div",57)(131,"div",21)(132,"h3",31),n(133,"Terms & Conditions"),t()(),i(134,"div",23)(135,"div",58),u(136,nw,1,2,"app-loader",59)(137,aw,2,1,"p",60),t(),u(138,rw,4,2,"div",61)(139,ow,2,1,"ul",62),t()()(),i(140,"div",63),u(141,cw,54,26,"div",53)(142,uw,54,26,"div",53)(143,vw,41,19,"div",53)(144,hw,54,26,"div",53),t()(),i(145,"div",8),x(146,"div",64),t()()()}if(a&2){let e=w(34),o=p();l(7),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),s("ngIf",(o.supplierData==null?null:o.supplierData.source)!=="Manual"),l(),s("disabled",o.isPrintLoading),l(),s("ngIf",!o.isPrintLoading),l(),s("ngIf",o.isPrintLoading),l(5),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(5),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(o.supplierData==null?null:o.supplierData.po_number),l(5),s("ngIf",o.canOpenSource)("ngIfElse",e),l(5),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(U(41,59,o.supplierData==null?null:o.supplierData.po_date,"dd-MM-yyyy")),l(4),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),m("",U(48,62,o.supplierData==null?null:o.supplierData.expiry_date,"dd-MM-yyyy")," "),l(4),s("ngIf",!o.isWorkOrder),l(),s("ngIf",o.isWorkOrder),l(2),f(o.shippingAddress==null?null:o.shippingAddress.city),l(),s("ngIf",(o.supplierData==null?null:o.supplierData.source)==="rfq"),l(),s("ngIf",(o.supplierData==null?null:o.supplierData.source)==="rfq"),l(7),s("ngIf",o.supplierData&&!o.supplierData.seller_details),l(7),s("ngIf",o.supplierData.seller_details.company_name),l(),s("ngIf",!o.supplierData.seller_details.company_name),l(4),s("ngIf",o.supplierData.seller_gst_list&&o.supplierData.seller_gst_list.length>0),l(),s("ngIf",o.supplierData.seller_gst_list&&o.supplierData.seller_gst_list.length==0),l(5),s("ngIf",o.supplierData&&o.supplierData.seller_address),l(),s("ngIf",o.supplierData&&!o.supplierData.seller_address),l(7),s("ngClass",o.poDetails!=null&&o.poDetails.buyer_profile?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(),s("ngIf",o.shippingAddress),l(),s("ngIf",!o.shippingAddress),l(),s("ngClass",o.poDetails!=null&&o.poDetails.buyer_profile?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(4),s("ngIf",o.supplierData.gstn),l(),s("ngIf",!o.supplierData.gstn),l(),s("ngIf",o.billingAddress),l(),s("ngIf",!o.billingAddress),l(),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_profile),l(8),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(3),s("ngForOf",o.getTableHeaders(o.supplierData==null?null:o.supplierData.source)),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","Manual"),l(),s("ngIf",o.poDetails==null||o.poDetails.additional_charges==null?null:o.poDetails.additional_charges.length),l(),s("ngIf",(o.poDetails==null?null:o.poDetails.multiple_payment_terms)==="YES"||(o.poDetails==null?null:o.poDetails.multiple_shipment_terms)==="YES"),l(9),s("ngIf",o.loadingStates.poDetails),l(),s("ngIf",!o.loadingStates.poDetails),l(),s("ngIf",o.loadingStates.poDetails),l(),s("ngIf",!o.loadingStates.poDetails&&(o.poDetails==null?null:o.poDetails.detail_terms_document)),l(),s("ngSwitch",o.poDetails==null?null:o.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}var Ha=(()=>{class a{constructor(e,o,r,c,g){this.financeOrderService=e,this.activatedRoute=o,this.drService=r,this.router=c,this.notificationService=g,this.isLoading=!1,this.isPrintLoading=!1,this.loadingStates={orderDetails:!1,poDetails:!1,dealRoom:!1}}get canOpenSource(){let e=(this.supplierData?.source||"").toLowerCase();return!!this.supplierData?.source_id&&(e==="rfq"||e==="auction")}onSourceClick(){let e=(this.supplierData?.source||"").toLowerCase(),o=this.supplierData?.source_id;if(!o)return;let r="";if(e==="rfq"?r="/rfq/sellers/rfq-details/"+o:e==="auction"&&(r="/auction/seller-auction-detail
1s/"+o),!r)return;let c=window.location.href.replace(this.router.url,"");window.open(c+r,"_blank")}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.poId=e.id,this.GetOrderDetailsByPO(),this.GetPODetails()})}GetOrderDetailsByPO(){try{this.loadingStates.poDetails=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe(o=>{console.log(o),this.supplierData=o.response.data,this.supplierData.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.supplierData.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.loadingStates.orderDetails=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.orderDetails=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get totalAmount(){if(this.poDetails!==null)return this.poDetails.gross-this.poDetails.discount_amount+this.poDetails.gst_amount+this.poDetails.shipping_charges+this.poDetails.logistics_charges+this.poDetails.insurance_charges}get isWorkOrder(){return String(this.supplierData?.order_type||this.poDetails?.order_type||"").toUpperCase()==="WO"}GetPODetails(){try{this.loadingStates.poDetails=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe(o=>{console.log(o),this.poDetails=o.response.data,this.poDetails.net_charges=Math.round(this.poDetails.net_charges),this.loadingStates.poDetails=!1})}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.poDetails=!1}}toDealRoom(){try{this.isLoading=!0;let e=()=>{switch(this.supplierData.source){case"rfq":return"rfq";case"auction":return"auction";default:return"direct"}},o=()=>{switch(this.supplierData.source){case"rfq":return this.supplierData.dealroom_source_id;case"auction":return this.supplierData.dealroom_source_id;default:return"0"}},r={source:e(),source_id:Number(o()),receiver_id:this.supplierData.dealroom_buyer_receiver_id};this.drService.initiateChat(r).subscribe(c=>{c.responseCode===200?(this.drService.setBuyerOrSeller("S"),this.router.navigate(["deal-room",e(),c.room_id,"chat"])):this.notificationService.showError("Something went wrong!"),this.isLoading=!1},c=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}getAdditionalCharges(){return this.poDetails?.additional_charges?.length?this.poDetails.additional_charges.reduce((e,o)=>e+(parseFloat(o.amount)||0),0):0}getPoType(e){let o=e?.toLowerCase();return o==="rfq"?"PO_RFQ":o==="auction"?"PO_AUCTION":o==="directbuy"||o==="direct"?"PO_DIRECT_BUY":"PO_RFQ"}printPO(){this.isPrintLoading=!0;let e=this.getPoType(this.supplierData?.source);this.financeOrderService.printPdf(e,Number(this.poId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1}})}getTableHeaders(e){let o=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Total Bid Value",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],r=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""},{title:"Required Qty",subtitle:""},{title:"Quoted",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],c=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Basic Price",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],g=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""}
1,{title:"Quoted Price/Unit",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Total Payable",subtitle:""}],h;switch(e){case"auction":h=o;break;case"rfq":h=r;break;case"DirectBuy":h=c;break;case"Manual":h=g;break;default:return[]}return this.isWorkOrder&&h.length&&h[0].title==="Product Name"&&(h=[j(A({},h[0]),{title:"Service Name"}),...h.slice(1)]),h}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Qt),T(K),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-seller-po-view"]],decls:3,vars:2,consts:[["plainSourceId",""],["fileList",""],["prodname","ngbPopover"],["prods",""],["popContent",""],[3,"isLoading"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],["class","row",4,"ngIf"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate","",4,"ngIf"],[1,"col-md-6","col-12","text-right"],["class","mod-btn mod-btn-primary btn-sm mr-2",3,"click",4,"ngIf"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],[1,"mod-meta-label"],[1,"mod-meta-value"],["appTranslate","",1,"mod-meta-label"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngIf"],["appTranslate","",1,"mod-card-title","mb-0"],["class","col-12",4,"ngIf"],[1,"col-12","col-lg-12","col-md-6"],[1,"card"],[1,"card-body"],[1,"fw-600","mb-1"],["appTranslate",""],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[3,"ngClass"],[1,"card","h-100"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],["class","fw-600",4,"ngIf"],["class","col-12 col-md-auto",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],[1,""],["class","text-nowrap",4,"ngFor","ngForOf"],[4,"ngSwitchCase"],["class","mod-card mb-4",4,"ngIf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","font-12 text-secondary mb-2",4,"ngIf"],["class","text-center p-3",4,"ngIf"],["class","list-inline",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[1,"col-12","text-right","mt-3"],[1,"mod-btn","mod-btn-primary","btn-sm","mr-2",3,"click"],[1,"uil","uil-comments-alt"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["type","button",1,"mod-btn-action",3,"click","title"],["class","mod-meta-value",4,"ngIf"],["placement","top","triggers","manual","class","ml-3 badge fileListBadge",3,"ngbPopover","mouseenter","mouseleave",4,"ngIf"],["class","mb-0",4,"ngFor","ngForOf"],[1,"mb-0"],["placement","top","triggers","manual",1,"ml-3","badge","fileListBadge",3,"mouseenter","mouseleave","ngbPopover"],["appTranslate","",1,"text-secondary"],[1,"text-secondary"],[1,"text-secondary","mb-1"],["appTranslate","",1,"fw-600"],[1,"fw-600"],[1,"col-12","col-md-auto"],[1,"doc-logo"],["alt","buyer logo",1,"doc-logo__img",3,"src"],[1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","2",1,"cell-300"],["class","col-12 mb-30",4,"ngIf"],[1,"col-12","mb-30"],["data-toggle","collapse","data-target","#spv__PaymentTerms","aria-expanded","fal
1se",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","spv__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],["data-toggle","collapse","data-target","#spv__ShipmentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["id","spv__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],["size","small",3,"isLoading","useBlockPosition"],[1,"font-12","text-secondary","mb-2"],[1,"text-center","p-3"],["appTranslate","",1,"text-muted","d-block","mt-2"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],["class","mb-2",4,"ngIf"],[1,"card-footer"]],template:function(o,r){o&1&&(x(0,"app-loader",5),i(1,"div",6),u(2,xw,147,65,"div",7),t()),o&2&&(s("isLoading",r.isLoading),l(2),s("ngIf",r.supplierData))},dependencies:[nt,J,W,pt,mt,Se,Z,De,L,st,ae],styles:[".pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--theme-blue)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--theme-blue);border-color:var(--theme-blue);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.shipmentmargin[_ngcontent-%COMP%]{margin-bottom:77px}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--theme-blue)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--theme-blue);border-color:var(--theme-blue);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--theme-blue)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--theme-blue)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--theme-blue);border-color:var(--theme-blue)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--theme-blue);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--theme-blue);color:#fff}
1.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--theme-blue)}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{vertical-align:top}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;width:100px}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.fileListBadge[_ngcontent-%COMP%]{padding:2px 5px;border-radius:3px;background-color:#ddf3ff;color:#006fae}.fileListBadge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1rem}.width-69px[_ngcontent-%COMP%]{width:69px}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.doc-logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:180px;max-width:100%;height:100%;min-height:104px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 767.98px){.doc-logo[_ngcontent-%COMP%]{width:100%;min-height:88px}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var bw=()=>({toolbar:!1});function yw(a,d){a&1&&(i(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12),x(5,"i",13),i(6,"h3",14),n(7,"Access Restricted"),t(),i(8,"p",15),n(9,"You do not have the necessary permissions to view this content. Please contact your administrator for further assistance."),t()()()()()())}function Sw(a,d){a&1&&(i(0,"span"),x(1,"i",78),i(2,"span",23),n(3,"Print"),t()())}function Cw(a,d){a&1&&(i(0,"span")(1,"div",79)(2,"span",80),n(3,"Loading..."),t()(),i(4,"span",23),n(5,"Printing..."),t()())}function Ew(a,d){if(a&1){let e=I();i(0,"button",81),S("click",function(){b(e);let r=p(3);return y(r.toDealRoom())}),x(1,"i",82),i(2,"span",23),n(3,"Deal Room"),t()()}}function Iw(a,d){if(a&1){let e=I();i(0,"button",83),S("click",function(){b(e);let r=p(3);return y(r.onSourceClick())}),n(1),t()}if(a&2){let e=p(3);s("title",e.supplierData==null?null:e.supplierData.display_source_id),l(),m(" ",(e.supplierData==null?null:e.supplierData.display_source_id)||"--"," ")}}function Dw(a,d){if(a&1&&n(0),a&2){let e=p(3);f((e.supplierData==null?null:e.supplierData.display_source_id)||"--")}}function Tw(a,d){if(a&1&&(i(0,"div",46)(1,"div",47),n(2," Additional Services Documents"),t(),i(3,"div",48),n(4),t()()),a&2){let e=p(3);l(4),m(" ",(e.supplierData==null?null:e.supplierData.service_documents_required)==""?"--":e.supplierData==null?null:e.supplierData.service_documents_required," ")}}function ww(a,d){if(a&1&&(i(0,"div",46)(1,"div",47),n(2," Payment Mode "),t(),i(3,"div",48),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.supplierData==null?null:e.supplierData.payment_mode," ")}}function Pw(a,d){a&1&&(i(0,"span",84),n(1," Not available at the moment "),t())}function Ow(a,d){if(a&1&&(i(0,"div",17)(1,"div",53)(2,"div",12)(3,"p",54),u(4,Pw,2,0,"span",56),t()()()()),a&2){let e=p(3);
1l(4),s("ngIf",e.poDetails&&!(e.poDetails!=null&&e.poDetails.seller_billing_address))}}function kw(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null||e.poDetails.seller_details==null?null:e.poDetails.seller_details.company_name)}}function Fw(a,d){a&1&&(i(0,"span",84),n(1,"Not available"),t())}function Mw(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=p(3);l(),f(e.poDetails==null?null:e.poDetails.seller_gst)}}function Aw(a,d){a&1&&(i(0,"span",84),n(1,"Not available"),t())}function Nw(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=p(3);l(),m(" ",e.poDetails==null||e.poDetails.seller_billing_address==null?null:e.poDetails.seller_billing_address.full_address," ")}}function Vw(a,d){a&1&&(i(0,"span",84),n(1," No Address Found "),t())}function Bw(a,d){if(a&1&&(i(0,"p",86)(1,"span",87),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name,"")}}function Rw(a,d){if(a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",85),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.shippingAddress==null?null:e.shippingAddress.full_address," ")}}function Lw(a,d){a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",84),n(4," Not available "),t()())}function qw(a,d){if(a&1&&(i(0,"p",86)(1,"span",87),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(3);l(3),m(" ",e.poDetails==null?null:e.poDetails.buyer_company_name,"")}}function Gw(a,d){if(a&1&&(i(0,"span",85),n(1),t()),a&2){let e=p(3);l(),f(e.supplierData==null?null:e.supplierData.gstn)}}function Uw(a,d){a&1&&(i(0,"span",84),n(1,"Not available"),t())}function jw(a,d){if(a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",85),n(4),t()()),a&2){let e=p(3);l(4),m(" ",e.billingAddress==null?null:e.billingAddress.full_address," ")}}function $w(a,d){a&1&&(i(0,"p",88)(1,"b",87),n(2,"Address:"),t(),i(3,"span",84),n(4," Not available "),t()())}function zw(a,d){if(a&1&&(i(0,"div",89)(1,"div",90),x(2,"img",91),t()()),a&2){let e=p(3);l(2),s("viewerOptions",Ce(2,bw))("src",e.poDetails==null?null:e.poDetails.logo_path,q)}}function Ww(a,d){if(a&1&&(i(0,"th",92)(1,"span"),n(2),t(),i(3,"small"),n(4),t()()),a&2){let e=d.$implicit;l(2),m("",e.title," "),l(2),f(e.subtitle)}}function Qw(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Yw(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Hw(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function Kw(a,d){if(a&1&&(F(0),i(1,"div",97),n(2),t(),i(3,"p",98),u(4,Qw,2,2,"span",99)(5,Yw,2,2,"span",99)(6,Hw,2,2,"span",99),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function Zw(a,d){if(a&1&&(F(0),i(1,"div",97)(2,"div")(3,"p",101),n(4),_(5,"currencyFormat"),t(),i(6,"p",101),n(7),_(8,"currencyFormat"),t(),i(9,"p",101),n(10),_(11,"currencyFormat"),t(),i(12,"p",101),n(13),_(14,"currencyFormat"),t(),i(15,"p",101),n(16),_(17,"currencyFormat"),t(),i(18,"p",101),n(19),_(20,"currencyFormat"),t(),i(21,"p",101),n(22),_(23,"currencyFormat"),t(),i(24,"p",101),n(25),_(26,"currencyFormat"),t(),i(27,"p",101),n(28),_(29,"currencyFormat"),t(),x(30,"div",102),i(31,"p",86)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.total_amount)," ")}}function Jw(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,Kw,7,4,"ng-template",null,1,P),x(6,"i",95),t(),i(7,"td",96),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),_(15,"currencyFormat"),i(16,"small",23),n(17,"/unit"),t()(),i(18,"td"),n(19),_(20,"currencyFormat"),t(),i(21,"td"),n(22),_(23,"currencyFormat"),t(),i(24,"td"),n(25),_(26,"currencyFormat"),t(),i(27,"td"),n(28),_(29,"currencyFormat"),u(30,Zw,35,34,"ng-template",null,2,P),x(32,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(31);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),f(e.required_qty),l(2),m("",v(15,11,e.unit_price)," "),l(5),f(v(20,13,e.gross_total)),l(3),f(v(23,15,e.discount)),l(3),f(v(26,17,e.gst)),l(3),m(" ",v(29,19,e.total_amount)," "),l(4),s("ngbPopover",r)}}function Xw(a,d){if(a&1&&(i(0,"tbody"),u(1,Jw,33,21,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function eP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function tP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function iP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function nP(a,d){if(a&1&&(F(0),i(1,"div",97),n(2),t(),i(3,"p",98),u(4,eP,2,2,"span",99)(5,tP,2,2,"span",99)(6,iP,2,2,"span",99),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function aP(a,d){if(a&1&&(F(0),i(1,"div",97)(2,"div")(3,"p",101),n(4),_(5,"currencyFormat"),t(),i(6,"p",101),n(7),_(8,"currencyFormat"),t(),i(9,"p",101),n(10),_(11,"currencyFormat"),t(),i(12,"p",101),n(13),_(14,"currencyFormat"),t(),i(15,"p",101),n(16),_(17,"currencyFormat"),t(),x(18,"div",102),i(19,"p",86)(20,"b"),n(21),_(22,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Total Bid Value: ",v(5,10,e.gross_total)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(8,12,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(11,14,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(14,16,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(17,18,e.igst),""),l(5),m("Total Payable: ",v(22,20,e.total_amount)," ")}}function rP(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,nP,7,4,"ng-template",null,1,P),x(6,"i",95),t(),i(7,"td",96),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),u(20,aP,23,22,"ng-template",null,2,P),x(22,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(21);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(13,8,e.gross_total)),l(3),f(v(16,10,e.gst)),l(3),m(" ",v(19,12,e.total_amount)," "),l(4),s("ngbPopover",r)}}function lP(a,d){if(a&1&&(i(0,"tbody"),u(1,rP,23,14,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function oP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function sP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function dP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function cP(a,d){if(a&1&&(F(0),i(1,"div",97),n(2),t(),i(3,"p",98),u(4,oP,2,2,"span",99)(5,sP,2,2,"span",99)(6,dP,2,2,"span",99),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function pP(a,d){if(a&1&&(F(0),i(1,"div",97)(2,"div")(3,"p",101),n(4),_(5,"currencyFormat"),t(),i(6,"p",101),n(7),_(8,"currencyFormat"),t(),i(9,"p",101),n(10),_(11,"currencyFormat"),t(),i(12,"p",101),n(13),_(14,"currencyFormat"),t(),i(15,"p",101),n(16),_(17,"currencyFormat"),t(),i(18,"p",101),n(19),_(20,"currencyFormat"),t(),i(21,"p",101),n(22),_(23,"currencyFormat"),t(),i(24,"p",101),n(25),_(26,"currencyFormat"),t(),i(27,"p",101),n(28),_(29,"currencyFormat"),t(),x(30,"div",102),i(31,"p",86)(32,"b"),n(33),_(34,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(4),m(" Gross Total: ",v(5,14,e.gross_total)," "),l(3),m(" Discount: ",v(8,16,e.discount)," "),l(3),m(" Net Total: ",v(11,
118,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,26,e.igst),""),l(3),m(" Logistics: ",v(26,28,e.logistics_charges)," "),l(3),m(" Insurance: ",v(29,30,e.insurance_charges)," "),l(5),m("Total Payable: ",v(34,32,e.net_amount)," ")}}function mP(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,cP,7,4,"ng-template",null,1,P),x(6,"i",95),t(),i(7,"td",96),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td"),n(18),_(19,"currencyFormat"),t(),i(20,"td"),n(21),_(22,"currencyFormat"),u(23,pP,35,34,"ng-template",null,2,P),x(25,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(24);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(3),f(v(16,11,e.discount)),l(3),f(v(19,13,e.gst)),l(3),m(" ",v(22,15,e.net_amount)," "),l(4),s("ngbPopover",r)}}function uP(a,d){if(a&1&&(i(0,"tbody"),u(1,mP,26,17,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function _P(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function vP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function gP(a,d){if(a&1&&(i(0,"span",100),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function fP(a,d){if(a&1&&(F(0),i(1,"div",97),n(2),t(),i(3,"p",98),u(4,_P,2,2,"span",99)(5,vP,2,2,"span",99)(6,gP,2,2,"span",99),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function hP(a,d){if(a&1&&(F(0),i(1,"div",97)(2,"div")(3,"p",101),n(4),_(5,"currencyFormat"),t(),i(6,"p",101),n(7),_(8,"currencyFormat"),t(),i(9,"p",101),n(10),_(11,"currencyFormat"),t(),i(12,"p",101),n(13),_(14,"currencyFormat"),t(),i(15,"p",101),n(16),_(17,"currencyFormat"),t(),i(18,"p",101),n(19),_(20,"currencyFormat"),t(),i(21,"p",101),n(22),_(23,"currencyFormat"),t(),i(24,"p",101),n(25),_(26,"currencyFormat"),t(),x(27,"div",102),i(28,"p",86)(29,"b"),n(30),_(31,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit,o=p(4);l(4),m(" Gross Total: ",v(5,13,e.gross_total)," "),l(3),m(" Discount: ",v(8,15,e.discount)," "),l(3),m(" Net Total: ",v(11,
117,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(14,19,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(17,21,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(20,23,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(23,25,e.igst),""),l(3),m(" Additional Charges: ",v(26,27,o.getAdditionalCharges())," "),l(5),m("Total Payable: ",v(31,29,e.total_amount)," ")}}function xP(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",94),n(3),t(),u(4,fP,7,4,"ng-template",null,1,P),x(6,"i",95),t(),i(7,"td",96),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small",23),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,hP,32,31,"ng-template",null,2,P),x(27,"i",95),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(5),f(v(18,11,e.gross_total)),l(3),f(v(21,13,e.discount)),l(3),m(" ",v(24,15,e.total_amount)," "),l(4),s("ngbPopover",r)}}function bP(a,d){if(a&1&&(i(0,"tbody"),u(1,xP,28,17,"tr",93),t()),a&2){let e=p(3);l(),s("ngForOf",e.supplierData==null?null:e.supplierData.items)}}function yP(a,d){if(a&1&&(i(0,"li",105)(1,"a",106),x(2,"i",107),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(2),m(" ",e.filename," ")}}function SP(a,d){if(a&1&&(i(0,"ul",103),u(1,yP,4,2,"li",104),t()),a&2){let e=p(3);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function CP(a,d){if(a&1&&(i(0,"div")(1,"div",108)(2,"div",12)(3,"ul",109)(4,"li",110)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",111),n(8),_(9,"currencyFormat"),t()(),i(10,"li",110)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",112),n(14),_(15,"currencyFormat"),t()(),i(16,"li",110)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",111),n(20),_(21,"currencyFormat"),t()(),i(22,"li",113)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",111),n(26),_(27,"currencyFormat"),t()(),i(28,"li",113)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",111),n(32),_(33,"currencyFormat"),t()(),i(34,"li",113)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",111),n(38),_(39,"currencyFormat"),t()(),i(40,"li",110)(41,"b",23),n(42,"Total Total Tax Amount:"),t(),i(43,"span",111),n(44),_(45,"currencyFormat"),t()(),i(46,"li",110)(47,"b",23),n(48,"Logistics:"),t(),i(49,"span",111),n(50),_(51,"currencyFormat"),t()(),i(52,"li",110)(53,"b",23),n(54,"Insurance:"),t(),i(55,"span",111),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",114)(59,"span",23),n(60,"Total Payable Amount:"),t(),i(61,"span",111),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function EP(a,d){if(a&1&&(i(0,"div")(1,"div",108)(2,"div",12)(3,"ul",109)(4,"li",110)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",111),n(8),_(9,"currencyFormat"),t()(),i(10,"li",110)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",112),n(14),_(15,"currencyFormat"),t()(),i(16,"li",110)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",111),n(20),_(21,"currencyFormat"),t()(),i(22,"li",113)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",111),n(26),_(27,"currencyFormat"),t()(),i(28,"li",113)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",111),n(32),_(33,"currencyFormat"),t()(),i(34,"li",113)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",111),n(38),_(39,"currencyFormat"),t()(),i(40,"li",110)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",111),n(44),_(45,"currencyFormat"),t()(),i(46,"li",110)(47,"b",23),n(48,"Logistics:"),t(),i(49,"span",111),n(50),_(51,"currencyFormat"),t()(),i(52,"li",110)(53,"b",23),n(54,"Insurance:"),t(),i(55,"span",111),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",114)(59,"span",23),n(60,"Total Payable Amou
1nt:"),t(),i(61,"span",111),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,12,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,14,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,16,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,18,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,20,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,22,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,24,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.poDetails==null?null:e.poDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.poDetails==null?null:e.poDetails.total_amount),"")}}function IP(a,d){if(a&1&&(i(0,"div")(1,"div",108)(2,"div",12)(3,"ul",109)(4,"li",110)(5,"b",23),n(6,"Total Bid Value:"),t(),i(7,"span",111),n(8),_(9,"currencyFormat"),t()(),i(10,"li",113)(11,"span",23),n(12,"SGST: "),t(),i(13,"span",111),n(14),_(15,"currencyFormat"),t()(),i(16,"li",113)(17,"span",23),n(18,"CGST:"),t(),i(19,"span",111),n(20),_(21,"currencyFormat"),t()(),i(22,"li",113)(23,"span",23),n(24,"IGST:"),t(),i(25,"span",111),n(26),_(27,"currencyFormat"),t()(),i(28,"li",110)(29,"b",23),n(30,"Total Tax Amount:"),t(),i(31,"span",111),n(32),_(33,"currencyFormat"),t()(),i(34,"li",110)(35,"b",23),n(36,"Logistics:"),t(),i(37,"span",111),n(38),_(39,"currencyFormat"),t()()()(),i(40,"div",114)(41,"span",23),n(42,"Total Payable Amount:"),t(),i(43,"span",111),n(44),_(45,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,7,e.poDetails==null?null:e.poDetails.gross),""),l(6),m(" ",v(15,9,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(21,11,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(27,13,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(33,15,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(39,17,e.poDetails==null?null:e.poDetails.logistics_charges),""),l(6),m(" ",v(45,19,e.poDetails==null?null:e.poDetails.total_amount),"")}}function DP(a,d){if(a&1&&(i(0,"div")(1,"div",108)(2,"div",12)(3,"ul",109)(4,"li",110)(5,"b",23),n(6,"Gross Total:"),t(),i(7,"span",111),n(8),_(9,"currencyFormat"),t()(),i(10,"li",110)(11,"b",23),n(12,"Discount:"),t(),i(13,"span",112),n(14),_(15,"currencyFormat"),t()(),i(16,"li",110)(17,"b",23),n(18,"Net Total:"),t(),i(19,"span",111),n(20),_(21,"currencyFormat"),t()(),i(22,"li",113)(23,"span",23),n(24,"SGST:"),t(),i(25,"span",111),n(26),_(27,"currencyFormat"),t()(),i(28,"li",113)(29,"span",23),n(30,"CGST:"),t(),i(31,"span",111),n(32),_(33,"currencyFormat"),t()(),i(34,"li",113)(35,"span",23),n(36,"IGST:"),t(),i(37,"span",111),n(38),_(39,"currencyFormat"),t()(),i(40,"li",110)(41,"b",23),n(42,"Total Tax Amount:"),t(),i(43,"span",111),n(44),_(45,"currencyFormat"),t()(),i(46,"li",110)(47,"b",23),n(48,"Additional Charges:"),t(),i(49,"span",111),n(50),_(51,"currencyFormat"),t()()()(),i(52,"div",114)(53,"span",23),n(54,"Total Payable Amount:"),t(),i(55,"span",111),n(56),_(57,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,9,e.poDetails==null?null:e.poDetails.gross),""),l(6),m("(-) ",v(15,11,e.poDetails==null?null:e.poDetails.discount_amount),""),l(6),m(" ",v(21,13,e.poDetails==null?null:e.poDetails.net_charges),""),l(6),m(" ",v(27,15,e.poDetails==null?null:e.poDetails.sgst),""),l(6),m(" ",v(33,17,e.poDetails==null?null:e.poDetails.cgst),""),l(6),m(" ",v(39,19,e.poDetails==null?null:e.poDetails.igst),""),l(6),m(" ",v(45,21,e.poDetails==null?null:e.poDetails.gst_amount),""),l(6),m(" ",v(51,23,e.getAdditionalCharges()),""),l(6),m(" ",v(57,25,e.poDetails==null?null:e.poDetails.total_amount),"")}}function TP(a,d){if(a&1){let e=I();i(0,"div",16)(1,"div",17)(2,"div",18)(3,"div",19)(4,"h2",20)(5,"a",21),x(6,"i",22),t(),i(7,"span",23),n(8,"Purchase Order"),t()()(),i(9,"div",24)(10,"button",25),S("click",function(){b(e);let r=p(2);return y(r.printDocument())}),u(11,Sw,4,0,"span",26)(12,Cw,6,0,"span",26),t()()()(),i(13,"div",17)(14,"div",27)(15,"div",28)(16,"h3",29)(17,"span",23),n(18,"Purchase Order ID:"),t(),n(19),t(),u(20,Ew,4,0,"button",30),t(),i(21,"div",31)(22,"div",32)(23,"div",33)(24,"ul",34)(25,"li",23),n(26,"Generate PO "),t(),i(27,"li",23),n(28,"PO Sent"),t(),i(29,"li",35),n(30," PO Cancelled "),t(),i(31,"li",36),n(32," Invoice Approved "),t()()(),i(33,"div",37)(34,"div",38)(35,"p",39),n(36,"
1Status:"),t(),i(37,"b",40),n(38),t()()()(),i(39,"div",41)(40,"h4",42)(41,"span",23),n(42,"Remarks:"),t(),i(43,"p",43),n(44),t()()()()(),i(45,"div",27)(46,"div",28)(47,"h3",44),n(48,"Purchase Order Details"),t()(),i(49,"div",31)(50,"div",45)(51,"div",46)(52,"div",47),n(53,"PO No."),t(),i(54,"div",48),n(55),t()(),i(56,"div",46)(57,"div",47),n(58,"Source ID"),t(),i(59,"div",48),u(60,Iw,2,2,"button",49)(61,Dw,1,1,"ng-template",null,0,P),t()(),i(63,"div",46)(64,"div",47),n(65,"Purchase Order Date"),t(),i(66,"div",48),n(67),_(68,"date"),t()(),i(69,"div",46)(70,"div",47),n(71,"Purchase Order Expiry Date"),t(),i(72,"div",48),n(73),_(74,"date"),t()(),i(75,"div",46)(76,"div",47),n(77,"Place of Supply"),t(),i(78,"div",48),n(79),t()(),F(80,50),u(81,Tw,5,1,"div",51)(82,ww,5,1,"div",51),M(),t()()(),i(83,"div",27)(84,"div",28)(85,"h3",44),n(86,"Supplier Details"),t()(),i(87,"div",31)(88,"div",16),u(89,Ow,5,1,"div",52),i(90,"div",17)(91,"div",53)(92,"div",12)(93,"p",54)(94,"span",23),n(95,"Seller Name: "),t(),u(96,kw,2,1,"span",55)(97,Fw,2,0,"span",56),t(),i(98,"p",54)(99,"span",23),n(100,"GST No:"),t(),u(101,Mw,2,1,"span",55)(102,Aw,2,0,"span",56),t(),i(103,"p",54)(104,"span",23),n(105,"Seller Address:"),t(),x(106,"br"),u(107,Nw,2,1,"span",55)(108,Vw,2,0,"span",56),t()()()()()()(),i(109,"div",27)(110,"div",28)(111,"h3",44),n(112,"Buyer Details"),t()(),i(113,"div",31)(114,"div",16)(115,"div",57)(116,"div",58)(117,"div",12)(118,"p",59),n(119,"Shipping Address "),t(),u(120,Bw,4,1,"p",60)(121,Rw,5,1,"p",61)(122,Lw,5,0,"p",61),t()()(),i(123,"div",57)(124,"div",53)(125,"div",12)(126,"p",59),n(127,"Billing Address "),t(),u(128,qw,4,1,"p",60),i(129,"p",54)(130,"span",23),n(131,"GST No:"),t(),u(132,Gw,2,1,"span",55)(133,Uw,2,0,"span",56),t(),u(134,jw,5,1,"p",61)(135,$w,5,0,"p",61),t()()(),u(136,zw,3,3,"div",62),t()()(),i(137,"div",27)(138,"div",63)(139,"h3",44),n(140,"Order Summary"),t()(),i(141,"div",64)(142,"div",65)(143,"div",66)(144,"table",67)(145,"thead",68)(146,"tr"),u(147,Ww,5,2,"th",69),t()(),u(148,Xw,2,1,"tbody",70)(149,lP,2,1,"tbody",70)(150,uP,2,1,"tbody",70)(151,bP,2,1,"tbody",70),t()()()()(),i(152,"div",71)(153,"div",72)(154,"div",73)(155,"div",28)(156,"h3",44),n(157,"Terms & Conditions"),t()(),i(158,"div",31)(159,"div",74)(160,"p",75),n(161),t()(),u(162,SP,2,1,"ul",76),t()()(),i(163,"div",77),u(164,CP,64,30,"div",70)(165,EP,64,30,"div",70)(166,IP,46,21,"div",70)(167,DP,58,27,"div",70),t()()()()}if(a&2){let e=w(62),o=p(2);l(10),s("disabled",o.isPrintLoading),l(),s("ngIf",!o.isPrintLoading),l(),s("ngIf",o.isPrintLoading),l(7),m(" ",o.supplierData==null?null:o.supplierData.po_number,""),l(),s("ngIf",(o.supplierData==null?null:o.supplierData.source)!=="Manual"),l(11),s("ngClass",(o.supplierData==null?null:o.supplierData.seller_status)=="Invoice Approved"?"is-active":""),l(7),f(o.supplierData==null?null:o.supplierData.seller_status),l(6),m("",o.supplierData!=null&&o.supplierData.rejectReason?o.supplierData==null?null:o.supplierData.rejectReason:"--"," "),l(11),f(o.supplierData==null?null:o.supplierData.po_number),l(5),s("ngIf",o.canOpenSource)("ngIfElse",e),l(7),f(U(68,48,o.supplierData==null?null:o.supplierData.po_date,"dd-MM-yyyy")),l(6),m("",U(74,51,o.supplierData==null?null:o.supplierData.expiry_date,"dd-MM-yyyy")," "),l(6),f(o.shippingAddress==null?null:o.shippingAddress.region),l(),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","rfq"),l(7),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_details)),l(7),s("ngIf",o.poDetails==null?null:o.poDetails.seller_details.company_name),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_details.company_name)),l(4),s("ngIf",(o.poDetails==null?null:o.poDetails.seller_gst)&&(o.poDetails==null?null:o.poDetails.seller_gst.length)),l(),s("ngIf",!(o.poDetails!=null&&o.poDetails.seller_gst)||!(o.poDetails!=null&&o.poDetails.seller_gst.length)),l(5),s("ngIf",o.poDetails&&(o.poDetails==null?null:o.poDetails.seller_billing_address)),l(),s("ngIf",o.poDetails&&!(o.poDetails!=null&&o.poDetails.seller_billing_address)),l(7),s("ngClass",o.poDetails!=null&&o.poDetails.logo_path?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(),s("ngIf",o.shippingAddress),l(),s("ngIf",!o.shippingAddress),l(),s("ngClass",o.poDetails!=null&&o.poDetails.logo_path?"col-md":"col-md-6"),l(5),s("ngIf",o.poDetails==null?null:o.poDetails.buyer_company_name),l(4),s("ngIf",o.supplierData.gstn),l(),s("ngIf",!o.supplierData.gstn),l(),s("ngIf",o.billingAddress),l(),s("ngIf",!o.billingAddress),l(),s("ngIf",o.poDetails==null?null:o.poDetails.logo_path),l(8),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(3),s("ngForOf",o.getTableHeaders(o.supplierData==null?null:o.supplierData.source)),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","Manual"),l(10),f(o.poDetails!=null&&o.poDetails.terms?o.poDetails==null?null:o.poDetails.terms:"No Terms & Conditions Provided"),l(
1),s("ngIf",o.poDetails==null?null:o.poDetails.detail_terms_document),l(),s("ngSwitch",o.supplierData==null?null:o.supplierData.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}function wP(a,d){if(a&1&&(i(0,"div",5),u(1,yw,10,0,"div",6)(2,TP,168,54,"div",7),t()),a&2){let e=p();l(),s("ngIf",!e.viewAccess),l(),s("ngIf",e.supplierData&&e.viewAccess)}}var Ka=(()=>{class a{constructor(e,o,r,c,g,h){this.financeOrderService=e,this.activatedRoute=o,this.drService=r,this.router=c,this.notificationService=g,this.cService=h,this.isLoading=!1,this.accessList=[],this.initialLoad=!1,this.isPrintLoading=!1}get canOpenSource(){let e=(this.supplierData?.source||"").toLowerCase();return!!this.supplierData?.source_id&&(e==="rfq"||e==="auction")}onSourceClick(){let e=(this.supplierData?.source||"").toLowerCase(),o=this.supplierData?.source_id;if(!o)return;let r="";if(e==="rfq"?r="/rfq/sellers/rfq-details/"+o:e==="auction"&&(r="/auction/seller-auction-details/"+o),!r)return;let c=window.location.href.replace(this.router.url,"");window.open(c+r,"_blank")}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.poId=e.id}),this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e,this.viewAccess?(this.GetOrderDetailsByPO(),this.GetPODetails()):this.initialLoad=!0)})}GetOrderDetailsByPO(){try{this.isLoading=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe({next:o=>{this.supplierData=o.response.data,this.supplierData.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.supplierData.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.isLoading=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get totalAmount(){if(this.poDetails!==null)return this.poDetails.gross-this.poDetails.discount_amount+this.poDetails.gst_amount+this.poDetails.shipping_charges+this.poDetails.logistics_charges+this.poDetails.insurance_charges}GetPODetails(){try{this.isLoading=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe({next:o=>{this.poDetails=o.response.data,this.poDetails.net_charges=Math.round(this.poDetails.net_charges),this.isLoading=!1},error:()=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1},complete:()=>{this.initialLoad=!0}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}getAdditionalCharges(){return this.poDetails?.additional_charges?.length?this.poDetails.additional_charges.reduce((e,o)=>e+(parseFloat(o.amount)||0),0):0}getTableHeaders(e){let o=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Total Bid Value",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],r=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""},{title:"Required Qty",subtitle:""},{title:"Quoted",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],c=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Quantity",subtitle:""},{title:"Basic Price",subtitle:""},{title:"Discount",subtitle:""},{title:"Tax",subtitle:""},{title:"Total Payable",subtitle:""}],g=[{title:"Product Name",subtitle:""},{title:"Product ID",subtitle:""},{title:"Offered Qty",subtitle:""}
1,{title:"Quoted Price/Unit",subtitle:""},{title:"Gross Total",subtitle:""},{title:"Discount",subtitle:""},{title:"Total Payable",subtitle:""}];switch(e){case"auction":return o;case"rfq":return r;case"DirectBuy":return c;case"Manual":return g;default:return[]}}toDealRoom(){try{this.isLoading=!0;let e=()=>{switch(this.supplierData.source){case"rfq":return"rfq";case"auction":return"auction";default:return"direct"}},o=()=>{switch(this.supplierData.source){case"rfq":return this.supplierData.dealroom_source_id;case"auction":return this.supplierData.dealroom_source_id;default:return""}},r={source:e(),source_id:Number(o()),receiver_id:this.supplierData.dealroom_buyer_receiver_id};this.drService.initiateChat(r).subscribe(c=>{c.responseCode===200?(this.drService.setBuyerOrSeller("S"),this.router.navigate(["deal-room",e(),c.room_id,"chat"])):this.notificationService.showError("Something went wrong!"),this.isLoading=!1},c=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}get viewAccess(){return!0}getPoType(e){let o=e?.toLowerCase();return o==="rfq"?"PO_RFQ":o==="auction"?"PO_AUCTION":o==="directbuy"||o==="direct"?"PO_DIRECT_BUY":"PO_RFQ"}printDocument(){this.isPrintLoading=!0;let e=this.getPoType(this.supplierData?.source);this.financeOrderService.printPdf(e,Number(this.poId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Qt),T(K),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-seller-po-cancelled"]],decls:2,vars:2,consts:[["plainSourceId",""],["prods",""],["popContent",""],[3,"isLoading"],["id","content","class","rfq-pages generate-po-page container-fluid overflow-hidden-non-i",4,"ngIf"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],["class","container-fluid text-center my-5",4,"ngIf"],["class","row",4,"ngIf"],[1,"container-fluid","text-center","my-5"],[1,"row","justify-content-center"],[1,"col-12","col-md-8"],[1,"card","p-4"],[1,"card-body"],[1,"uil","uil-lock-alt","display-4","text-danger","mb-3"],["appTranslate","",1,"card-title"],["appTranslate","",1,"card-text"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],["class","mod-btn mod-btn-primary btn-sm",3,"click",4,"ngIf"],[1,"mod-card-body"],[1,"row","align-items-center","mb-4"],[1,"col-md-8","col-xl-10"],[1,"list-unstyled","multi-steps"],["appTranslate","",1,"is-active","red"],["appTranslate","",3,"ngClass"],[1,"col-md-4","col-xl-2"],[1,"border","rounded-lg","p-2"],["appTranslate","",1,"theme-color","font-12","mb-0"],[1,"text-danger"],[1,"card-danger","mb-0"],[1,"fw-600","font-14","mb-0"],[1,"text-danger","d-inline"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"title","click",4,"ngIf","ngIfElse"],[3,"ngSwitch"],["class","mod-meta-tile",4,"ngSwitchCase"],["class","col-12",4,"ngIf"],[1,"card"],[1,"fw-600","mb-1"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],[3,"ngClass"],[1,"card","h-100"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],["class","fw-600",4,"ngIf"],["class","col-12 col-md-auto",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],[1,""],["class","text-nowrap",4,"ngFor","ngForOf"],[4,"ngSwitchCase"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],["class","list-inline",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"uil","uil-comments-alt"],["type","button",1,"mod-btn-action",3,"click","title"],["appTranslate","",1,"text-secondary"],[1,"text-secondary"],[1,"text-secondary","mb-1"],["appTranslate","",1,"fw-600"],[1,"fw-600"],[1,"col-12","col-md-auto"],[1,"doc-logo"],["ngxViewer","","fallback","./../../../../assets/img/placeholderimage.png","alt","buyer logo",1,"doc-logo__img",3,"viewerOptions","src"],[1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"]],template:function(o,r){o&1&&(x(0,"app-loader",3),u(1,wP,3,2,"div",4)),o&2&&(s("isLoading",r.isLoading),l(
vendor: 5,042 bytes, line 1
1),s("ngIf",r.initialLoad))},dependencies:[nt,J,W,pt,mt,Se,Zt,Z,De,Lt,L,st,ae],styles:[".rfq-pages[_ngcontent-%COMP%] .card-danger[_ngcontent-%COMP%]{color:#1b1b1bde;background-color:#fff8f9;border:1px solid #f64e60;padding:15px;border-radius:8px}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]{color:#f64e60}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]:before{background-color:#ffe2e5;border-color:#f64e60;color:#f64e60}.max-h-150px[_ngcontent-%COMP%]{max-height:150px}.pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--seller-green)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative} .mat-dialog-container{overflow-y:scroll!important;height:700px!important}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.disableClass[_ngcontent-%COMP%]{top:0;left:0;width:100%;background-color:#fff;opacity:.55;z-index:999;cursor:not-allowed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--seller-green)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--seller-green);border-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--seller-green);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--seller-green);color:#fff}.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--seller-green)} .mat-dialog-container{padding:0!important}.hilight-element[_ngcontent-%COMP%]{margin:0 -10px;padding:10px;border:dashed 1px #6bbb9d;background:#edfff8;border-radius:5px}.doc-logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:180px;max-width:100%;height:100%;min-height:104px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 767.98px){.doc-logo[_ngcontent-%COMP%]{width:100%;min-height:88px}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var PP=()=>({toolbar:!1});function OP(a,d){a&1&&(i(0,"span",31),n(1,"Purchase Order"),t())}function kP(a,d){a&1&&(i(0,"span",31),n(1,"Work Order"),t())}function FP(a,d){a&1&&(i(0,"span"),x(1,"i",55),i(2,"span",31),n(3,"Print"),t()())}function MP(a,d){a&1&&(i(0,"span")(1,"div",56)(2,"span",57),n(3,"Loading..."),t()(),i(4,"span",31),n(5,"Printing..."),t()())}function AP(a,d){a&1&&(i(0,"span",31),n(1,"Purchase Order Details"),t())}function NP(a,d){a&1&&(i(0,"span",31),n(1,"Work Order Details"),t())}function VP(a,d){a&1&&(i(0,"span",31),n(1,"PO No."),t())}function BP(a,d){a&1&&(i(0,"span",31),n(1,"WO No."),t())}function RP(a,d){a&1&&(i(0,"span",31),n(1,"Purchase Order Date"),t())}function LP(a,d){a&1&&(i(0,"span",31),n(1,"Work Order Date"),t())}function qP(a,d){a&1&&(i(0,"span",31),n(1,"Purchase Order Expiry Date"),t())}function GP(a,d){a&1&&(i(0,"span",31),n(1,"Work Order Expiry Date"),t())}function UP(a,d){a&1&&(i(0,"span",31),n(1,"Place of Supply"),t())}function jP(a,d){a&1&&(i(0,"span",31),n(1,"Place of Service"),t())}function $P(a,d){if(a&1&&(i(0,"p",61),n(1),t()),a&2){let e=d.$implicit;l(),m(" ",e,"")}}function zP(a,d){if(a&1&&(F(0),u(1,$P,2,1,"p",60),M()),a&2){let e=p(3);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.additionalDocumentsTags)}}function WP(a,d){if(a&1){let e=I();i(0,"span",62,1),S("mouseenter",function(){b(e);let r=w(1),c=p(3);return y(c.toggleWithGreeting(r))})("mouseleave",function(){b(e);let r=w(1),c=p(3);return y(c.toggleWithGreeting(r))}
1),i(2,"small",31),n(3,"view requested files"),t()()}if(a&2){p();let e=w(3);s("ngbPopover",e)}}function QP(a,d){if(a&1&&(i(0,"div",24),n(1),u(2,zP,2,1,"ng-template",null,0,P)(4,WP,4,1,"span",59),t()),a&2){let e=p(2);l(),m(" ",e.OrderDetails==null?null:e.OrderDetails.service_documents_required," "),l(3),s("ngIf",(e.OrderDetails==null?null:e.OrderDetails.service_documents_required)==="yes")}}function YP(a,d){if(a&1&&(i(0,"div",22)(1,"div",25),n(2," Additional Services Documents"),t(),u(3,QP,5,2,"div",58),t()),a&2){let e=p();l(3),s("ngIf",(e.OrderDetails==null?null:e.OrderDetails.source)==="rfq"&&(e.OrderDetails==null?null:e.OrderDetails.service_documents_required)!=="")}}function HP(a,d){if(a&1&&(i(0,"div",22)(1,"div",25),n(2,"Payment Mode"),t(),i(3,"div",24),n(4),t()()),a&2){let e=p();l(4),f(e.OrderDetails==null?null:e.OrderDetails.payment_mode)}}function KP(a,d){if(a&1&&(i(0,"span",32),n(1),t()),a&2){let e=p();l(),f(e.OrderDetails==null?null:e.OrderDetails.buyer_company_name)}}function ZP(a,d){a&1&&(i(0,"span",63),n(1,"Not available"),t())}function JP(a,d){if(a&1&&(i(0,"span",32),n(1),t()),a&2){let e=p();l(),f(e.poDetails==null?null:e.poDetails.gstn)}}function XP(a,d){a&1&&(i(0,"span",63),n(1,"Not available"),t())}function e7(a,d){if(a&1&&(i(0,"div",64)(1,"div",65),x(2,"img",66),t()()),a&2){let e=p();l(2),s("viewerOptions",Ce(2,PP))("src",e.poDetails.logo_path,q)}}function t7(a,d){a&1&&(i(0,"span",31),n(1,"Product Name"),t())}function i7(a,d){a&1&&(i(0,"span",31),n(1,"Service Name"),t())}function n7(a,d){if(a&1&&(i(0,"thead",72)(1,"tr")(2,"th"),u(3,t7,2,0,"span",13)(4,i7,2,0,"span",13),t(),i(5,"th",31),n(6,"Product ID"),t(),i(7,"th",31),n(8,"Quantity"),t(),i(9,"th",31),n(10,"Quoted"),t(),i(11,"th",31),n(12,"Gross Total"),t(),i(13,"th",31),n(14,"Discount"),t(),i(15,"th",31),n(16,"Tax"),t(),i(17,"th",31),n(18,"Total Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function a7(a,d){a&1&&(i(0,"span",31),n(1,"Product Name"),t())}function r7(a,d){a&1&&(i(0,"span",31),n(1,"Service Name"),t())}function l7(a,d){if(a&1&&(i(0,"thead",72)(1,"tr")(2,"th"),u(3,a7,2,0,"span",13)(4,r7,2,0,"span",13),t(),i(5,"th",31),n(6,"Product ID"),t(),i(7,"th",31),n(8,"Quantity"),t(),i(9,"th",31),n(10,"Basic Price"),t(),i(11,"th",31),n(12,"Discount"),t(),i(13,"th",31),n(14,"Tax"),t(),i(15,"th",31),n(16,"Total Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function o7(a,d){a&1&&(i(0,"span",31),n(1,"Product Name"),t())}function s7(a,d){a&1&&(i(0,"span",31),n(1,"Service Name"),t())}function d7(a,d){if(a&1&&(i(0,"thead",72)(1,"tr")(2,"th"),u(3,o7,2,0,"span",13)(4,s7,2,0,"span",13),t(),i(5,"th",31),n(6,"Product ID"),t(),i(7,"th",31),n(8,"Quantity"),t(),i(9,"th",31),n(10,"Total Bid Value"),t(),i(11,"th",31),n(12,"Tax"),t(),i(13,"th",31),n(14,"Total Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function c7(a,d){a&1&&(i(0,"span",31),n(1,"Product Name"),t())}function p7(a,d){a&1&&(i(0,"span",31),n(1,"Service Name"),t())}function m7(a,d){if(a&1&&(i(0,"thead",72)(1,"tr")(2,"th"),u(3,c7,2,0,"span",13)(4,p7,2,0,"span",13),t(),i(5,"th",31),n(6,"Product ID"),t(),i(7,"th",31),n(8,"Offered Quantity"),t(),i(9,"th",31),n(10,"Quoted Price/Unit"),t(),i(11,"th",31),n(12,"Gross Total"),t(),i(13,"th",31),n(14,"Discount"),t(),i(15,"th",31),n(16,"Total Payable"),t()()()),a&2){let e=p(2);l(3),s("ngIf",!e.isWorkOrder),l(),s("ngIf",e.isWorkOrder)}}function u7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function _7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function v7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function g7(a,d){if(a&1&&(F(0),i(1,"div",77),n(2),t(),i(3,"p",78),u(4,u7,2,2,"span",79)(5,_7,2,2,"span",79)(6,v7,2,2,"span",79),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function f7(a,d){if(a&1&&(F(0),i(1,"div",77)(2,"div")(3,"p",81)(4,"span",31),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",81)(9,"span",31),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",81)(14,"span",31),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",81),n(19),_(20,"currencyFormat"),t(),i(21,"p",81),n(22),_(23,"currencyFormat"),t(),i(24,"p",81),n(25),_(26,"currencyFormat"),t(),i(27,"p",81),n(28),_(29,"currencyFormat"),t(),i(30,"p",81)(31,"span",31),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",81)(36,"span",31),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",82),i(41,"p",83)(42,"b")(43,"
1span",31),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.total_amount)," ")}}function h7(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",74),n(3),t(),u(4,g7,7,4,"ng-template",null,2,P),x(6,"i",75),t(),i(7,"td",76),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,f7,47,34,"ng-template",null,3,P),x(30,"i",75),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.gross_total)),l(3),f(v(21,14,e.discount)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function x7(a,d){if(a&1&&(i(0,"tbody"),u(1,h7,31,20,"tr",73),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function b7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function y7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function S7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function C7(a,d){if(a&1&&(F(0),i(1,"div",77),n(2),t(),i(3,"p",78),u(4,b7,2,2,"span",79)(5,y7,2,2,"span",79)(6,S7,2,2,"span",79),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function E7(a,d){if(a&1&&(F(0),i(1,"div",77)(2,"div")(3,"p",81)(4,"span",31),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",81)(9,"span",31),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",81)(14,"span",31),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",81),n(19),_(20,"currencyFormat"),t(),i(21,"p",81),n(22),_(23,"currencyFormat"),t(),i(24,"p",81),n(25),_(26,"currencyFormat"),t(),i(27,"p",81),n(28),_(29,"currencyFormat"),t(),i(30,"p",81)(31,"span",31),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",81)(36,"span",31),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",82),i(41,"p",83)(42,"b")(43,"span",31),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.net_amount)," ")}}function I7(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",74),n(3),t(),u(4,C7,7,4,"ng-template",null,2,P),x(6,"i",75),t(),i(7,"td",76),n(8),t(),i(9,"td"),n(10),_(11,"currencyFormat"),t(),i(12,"td"),n(13),_(14,"currencyFormat"),t(),i(15,"td"),n(16),_(17,"currencyFormat"),t(),i(18,"td"),n(19),_(20,"currencyFormat"),t(),i(21,"td"),n(22),_(23,"currencyFormat"),u(24,E7,47,34,"ng-template",null,3,P),x(26,"i",75),t()()),a&2){let e=d.$implicit,o=w(5),r=w(25);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",v(11,9,e.offered_qty)," "),l(3),f(v(14,11,e.gross_total)),l(3),f(v(17,13,e.discount)),l(3),f(v(20,15,e.gst)),l(3),m(" ",v(23,17,e.net_amount)," "),l(4),s("ngbPopover",r)}}function D7(a,d){if(a&1&&(i(0,"tbody"),u(1,I7,27,19,"tr",73),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function T7(a,d){if(a&1&&(F(0),i(1,"div",77),n(2),t(),i(3,"p",78),n(4),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),m(" ",e.short_description," ")}}function w7(a,d){if(a&1&&(F(0),i(1,"div",77)(2,"div")(3,"p",81)(4,"span",31),n(5,"Bid Total Value:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",81)(9,"span",31),n(10,"Tax:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",81)(14,"span",31),n(15,"Logistics:"),t(),n(16),_(17,"currencyFormat"),t(),x(18,"div",82),i(19,"p",83)(20,"b")(21,"span",31),n(22,"Net Price:"),t(),n(23),_(24,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,4,e.gross_total)," "),l(5),m(" ",v(12,6,e.gst)," "),l(5),m(" ",v(17,8,e.logistics_charges)," "),l(7),m(" ",v(24,10,e.net_amount)," ")}}function P7(a,d){if(a&1&&(i(0,"tr")(1,"td",76),n(2),t(),i(3,"td")(4,"span",74),n(5),t(),u(6,T7,5,2,"ng-template",null,2,P),x(8,"i",75),t(),i(9,"td",76),n(10),t(),i(11,"td"),n(12),t(),i(13,"td"),n(14),_(15,"currencyFormat"),t(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,w7,25,12,"ng-template",null,3,P),x(27,"i",75),t()()),a&2){let e=d.$implicit,o=w(7),r=w(26);l(2),m(" ",e.display_item_id,""),l(3),m(" ",e.product_name,""),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),f(v(15,10,e.gross_total)),l(3),f(v(18,12,e.logistics_charges)),l(3),f(v(21,14,e.gst)),l(3),m(" ",v(24,16,e.net_amount)," "),l(4),s("ngbPopover",r)}}function O7(a,d){if(a&1&&(i(0,"tbody"),u(1,P7,28,18,"tr",73),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function k7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function F7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function M7(a,d){if(a&1&&(i(0,"span",80),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function A7(a,d){if(a&1&&(F(0),i(1,"div",77),n(2),t(),i(3,"p",78),u(4,k7,2,2,"span",79)(5,F7,2,2,"span",79)(6,M7,2,2,"span",79),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function N7(a,d){if(a&1&&(F(0),i(1,"div",77)(2,"div")(3,"p",81)(4,"span",31),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",81)(9,"span",31),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",81)(14,"span",31),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",81),n(19),_(20,"currencyFormat"),t(),i(21,"p",81),n(22),_(23,"currencyFormat"),t(),i(24,"p",81),n(25),_(26,"currencyFormat"),t(),i(27,"p",81),n(28),_(29,"currencyFormat"),t(),i(30,"p",81)(31,"span",31),n(32,"Additional Charges:"),t(),n(33),_(34,"currencyFormat"),t(),x(35,"div",82),i(36,"p",83)(37,"b")(38,"span",31),n(39,"Total Payable:"),t(),n(40),_(41,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit,o=p(3);l(6),m(" ",v(7,13,e.gross_total)," "),l(5),m(" ",v(12,15,e.discount)," "),l(5),m(" ",v(17,17,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,19,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,21,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,23,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,25,e.igst),""),l(5),m(" ",v(34,27,o.getAdditionalCharges())," "),l(7),m(" ",v(41,29,e.total_amount)," ")}}function V7(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",74),n(3),t(),u(4,A7,7,4,"ng-template",null,2,P),x(6,"i",75),t(),i(7,"td",76),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(1
15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),u(25,N7,42,31,"ng-template",null,3,P),x(27,"i",75),t()()),a&2){let e=d.$implicit,o=w(5),r=w(26);l(3),m("",e.product_name," "),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.offered_qty," "),l(2),m("",v(13,9,e.unit_price)," "),l(5),f(v(18,11,e.gross_total)),l(3),f(v(21,13,e.discount)),l(3),m(" ",v(24,15,e.total_amount)," "),l(4),s("ngbPopover",r)}}function B7(a,d){if(a&1&&(i(0,"tbody"),u(1,V7,28,17,"tr",73),t()),a&2){let e=p(2);l(),s("ngForOf",e.OrderDetails==null?null:e.OrderDetails.items)}}function R7(a,d){if(a&1&&(i(0,"div",7)(1,"div",67)(2,"div",68)(3,"table",69),u(4,n7,19,2,"thead",70)(5,l7,17,2,"thead",70)(6,d7,15,2,"thead",70)(7,m7,17,2,"thead",70)(8,x7,2,1,"tbody",71)(9,D7,2,1,"tbody",71)(10,O7,2,1,"tbody",71)(11,B7,2,1,"tbody",71),t()()()()),a&2){let e=p();l(3),s("ngSwitch",e.poDetails==null?null:e.poDetails.source),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","Manual")}}function L7(a,d){if(a&1){let e=I();i(0,"a",103),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function q7(a,d){if(a&1){let e=I();i(0,"a",103),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function G7(a,d){if(a&1&&(i(0,"div")(1,"p",101)(2,"b",31),n(3,"Note:"),t(),n(4),t(),u(5,L7,2,0,"a",102)(6,q7,2,0,"a",102),t()),a&2){let e=p().$implicit;l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded),l(),s("ngIf",e._expanded)}}function U7(a,d){if(a&1&&(i(0,"div",94)(1,"div",29)(2,"div",95)(3,"div",96)(4,"h6",97),n(5),t(),i(6,"small",98)(7,"span",31),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",99)(12,"h6",100),n(13),_(14,"currencyFormat"),t()()(),u(15,G7,7,5,"div",16),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%)"),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function j7(a,d){if(a&1&&(i(0,"div",89)(1,"div",28)(2,"div",90)(3,"a",91),n(4,"Payment Terms"),t()(),i(5,"div",92)(6,"div",29),u(7,U7,16,10,"div",93),t()()()()),a&2){let e=p(2);l(7),s("ngForOf",e.poDetails==null?null:e.poDetails.payment_terms)}}function $7(a,d){if(a&1&&(i(0,"div",113)(1,"div",114)(2,"div",110)(3,"h6",115),n(4),t(),i(5,"small",98)(6,"span",31),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",116)(10,"small",117),n(11,"Quantity"),t(),i(12,"h6",118),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function z7(a,d){if(a&1&&(i(0,"div",108)(1,"div",109)(2,"div",95)(3,"div",110)(4,"h6",111),n(5),t(),i(6,"small",98)(7,"span",31),n(8,"Timeline:"),t(),n(9),i(10,"span",31),n(11,"day(s)"),t()()()()(),u(12,$7,14,3,"div",112),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," "),l(3),s("ngForOf",e.products)}}function W7(a,d){if(a&1&&(i(0,"div",104)(1,"div",28)(2,"div",105)(3,"a",91),n(4,"Shipment Terms"),t()(),i(5,"div",106),u(6,z7,13,3,"div",107),t()()()),a&2){let e=p(2);l(6),s("ngForOf",e.poDetails==null?null:e.poDetails.shipment_terms)}}function Q7(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li")(5,"b",31),n(6,"Bid Total Value:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li")(11,"b",31),n(12,"Net Price:"),t(),i(13,"span",121),n(14),_(15,"currencyFormat"),t()(),i(16,"li")(17,"b",31),n(18,"Tax:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li")(23,"b",31),n(24,"Logistics:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()()()(),i(28,"div",122)(29,"span",31),n(30,"Net Payable:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,5,e.OrderDetails==null?null:e.OrderDetails.gross)),l(6),f(v(15,7,(e.OrderDetails==null?null:e.OrderDetails.gross)-(e.OrderDetails==null?null:e.OrderDetails.discount_amount))),l(6),f(v(21,9,e.OrderDetails==null?null:e.OrderDetails.gst_amount)),l(6),f(v(27,11,e.OrderDetails==null?null:e.OrderDetails.logistics_charges)),l(6),f(v(33,13,e.totalAmount))}}function Y7(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li",123)(5,"b",31),n(6,"Gross Total:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li",123)(11,"b",31),n(12,"Discount:"),t(),i(13,"span",124),n(14),_(15,"currencyFormat"),t()(),i(16,"li",123)(17,"b",31),n(18,"Net Total:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li",125)(23,"span",31),n(24,"SGST:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()(),i(28,"li",125)(29,"span",31),n(30,"CGST:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()(),i(34,"li",125)(35,"span",31),n(36,"IGST:"),t(),i(37,"span",121),n(38),_(39,"currencyFormat"),t()(),i(40,"li",123)(41,"b",31),n(42,"Total Tax Amount:"),t(),i(43,"span",121),n(44),_(45,"currencyFormat"),t()(),i(46,"li",123)(47,"b",31),n(48,"Logistics:"),t(),i(49,"span",121),n(50),_(51,"currencyFormat"),t()(),i(52,"li",123)(53,"b",31),n(54,"Insurance:"),t(),i(55,"span",121),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",122)(59,"span",31),n(60,"Total Payable Amou
1nt:"),t(),i(61,"span",121),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.OrderDetails.gross)),l(6),m("(-) ",v(15,12,e.OrderDetails.discount_amount),""),l(6),f(v(21,14,e.OrderDetails.net_charges)),l(6),f(v(27,16,e.OrderDetails.sgst)),l(6),f(v(33,18,e.OrderDetails.cgst)),l(6),f(v(39,20,e.OrderDetails.igst)),l(6),f(v(45,22,e.OrderDetails.gst_amount)),l(6),f(v(51,24,e.OrderDetails.logistics_charges)),l(6),f(v(57,26,e.OrderDetails.insurance_charges)),l(6),f(v(63,28,e.OrderDetails.total_amount))}}function H7(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li",123)(5,"b",31),n(6,"Gross Total:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li",123)(11,"b",31),n(12,"Discount:"),t(),i(13,"span",124),n(14),_(15,"currencyFormat"),t()(),i(16,"li",123)(17,"b",31),n(18,"Net Total:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li",125)(23,"span",31),n(24,"SGST:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()(),i(28,"li",125)(29,"span",31),n(30,"CGST:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()(),i(34,"li",125)(35,"span",31),n(36,"IGST:"),t(),i(37,"span",121),n(38),_(39,"currencyFormat"),t()(),i(40,"li",123)(41,"b",31),n(42,"Total Tax Amount:"),t(),i(43,"span",121),n(44),_(45,"currencyFormat"),t()(),i(46,"li",123)(47,"b",31),n(48,"Logistics:"),t(),i(49,"span",121),n(50),_(51,"currencyFormat"),t()(),i(52,"li",123)(53,"b",31),n(54,"Insurance:"),t(),i(55,"span",121),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",122)(59,"span",31),n(60,"Total Payable Amount:"),t(),i(61,"span",121),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,10,e.OrderDetails.gross)),l(6),m("(-) ",v(15,12,e.OrderDetails.discount_amount),""),l(6),f(v(21,14,e.OrderDetails.net_charges)),l(6),f(v(27,16,e.OrderDetails.sgst)),l(6),f(v(33,18,e.OrderDetails.cgst)),l(6),f(v(39,20,e.OrderDetails.igst)),l(6),f(v(45,22,e.OrderDetails.gst_amount)),l(6),f(v(51,24,e.OrderDetails.logistics_charges)),l(6),f(v(57,26,e.OrderDetails.insurance_charges)),l(6),f(v(63,28,e.OrderDetails.total_amount))}}function K7(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li",123)(5,"b",31),n(6,"Gross Total:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li",123)(11,"b",31),n(12,"Discount:"),t(),i(13,"span",124),n(14),_(15,"currencyFormat"),t()(),i(16,"li",123)(17,"b",31),n(18,"Net Total:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li",125)(23,"span",31),n(24,"SGST:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()(),i(28,"li",125)(29,"span",31),n(30,"CGST:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()(),i(34,"li",125)(35,"span",31),n(36,"IGST:"),t(),i(37,"span",121),n(38),_(39,"currencyFormat"),t()(),i(40,"li",123)(41,"b",31),n(42,"Total Tax Amount:"),t(),i(43,"span",121),n(44),_(45,"currencyFormat"),t()(),i(46,"li",123)(47,"b",31),n(48,"Additional Charges:"),t(),i(49,"span",121),n(50),_(51,"currencyFormat"),t()()()(),i(52,"div",122)(53,"span",31),n(54,"Total Payable Amount:"),t(),i(55,"span",121),n(56),_(57,"currencyFormat"),t()()()()),a&2){let e=p(2);l(8),f(v(9,9,e.OrderDetails==null?null:e.OrderDetails.gross)),l(6),m("(-) ",v(15,11,e.OrderDetails==null?null:e.OrderDetails.discount_amount),""),l(6),f(v(21,13,e.OrderDetails==null?null:e.OrderDetails.net_charges)),l(6),f(v(27,15,e.OrderDetails==null?null:e.OrderDetails.sgst)),l(6),f(v(33,17,e.OrderDetails==null?null:e.OrderDetails.cgst)),l(6),f(v(39,19,e.OrderDetails==null?null:e.OrderDetails.igst)),l(6),f(v(45,21,e.OrderDetails==null?null:e.OrderDetails.gst_amount)),l(6),f(v(51,23,e.getAdditionalCharges())),l(6),f(v(57,25,e.OrderDetails==null?null:e.OrderDetails.total_amount))}}function Z7(a,d){if(a&1&&(i(0,"div",84)(1,"div",85)(2,"div",17)(3,"div",18)(4,"h3",27),n(5,"Order Terms & Fulfillment"),t()(),i(6,"div",20)(7,"div",6),u(8,j7,8,1,"div",86)(9,W7,7,1,"div",87),t()()()(),i(10,"div",88),u(11,Q7,34,15,"div",71)(12,Y7,64,30,"div",71)(13,H7,64,30,"div",71)(14,K7,58,27,"div",71),t()()),a&2){let e=p();l(8),s("ngIf",(e.poDetails==null?null:e.poDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.poDetails==null?null:e.poDetails.multiple_shipment_terms)==="YES"),l(),s("ngSwitch",e.poDetails==null?null:e.poDetails.source),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","Manual")}}function J7(a,d){if(a&1&&(i(0,"li",134)(1,"a",135),x(2,"i",136),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(2),m(" ",e.filename," ")}}function X7(a,d){if(a&1&&(i(0,"ul",132),u(1,J7,4,2,"li",133),t()),a&2){let e=p(3);l(),s("ngForOf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function e8(a,d){if(a&1&&(i(0,"div",85)(1,"div",128)(2,"div",18)(3,"h3",27),n(4,"Terms & Conditions:"),t()(),i(5,"div",20)(6,"div",129)(7,"p",130),n(8),t()(),u(9,X7,2,1,"ul",131),t()()()),a&2){let e=p(2);
1l(8),f(e.poDetails!=null&&e.poDetails.terms?e.poDetails.terms:"No Terms & Conditions Provided."),l(),s("ngIf",e.poDetails==null?null:e.poDetails.detail_terms_document)}}function t8(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li")(5,"b",31),n(6,"Bid Total Value:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li")(11,"b",31),n(12,"Net Price:"),t(),i(13,"span",121),n(14),_(15,"currencyFormat"),t()(),i(16,"li")(17,"b",31),n(18,"Tax:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li")(23,"b",31),n(24,"Logistics:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()()()(),i(28,"div",122)(29,"span",31),n(30,"Net Payable:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,5,e.OrderDetails==null?null:e.OrderDetails.gross),""),l(6),m(" ",v(15,7,(e.OrderDetails==null?null:e.OrderDetails.gross)-(e.OrderDetails==null?null:e.OrderDetails.discount_amount)),""),l(6),m(" ",v(21,9,e.OrderDetails==null?null:e.OrderDetails.gst_amount),""),l(6),m(" ",v(27,11,e.OrderDetails==null?null:e.OrderDetails.logistics_charges),""),l(6),m(" ",v(33,13,e.totalAmount),"")}}function i8(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li",123)(5,"b",31),n(6,"Gross Total:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li",123)(11,"b",31),n(12,"Discount:"),t(),i(13,"span",124),n(14),_(15,"currencyFormat"),t()(),i(16,"li",123)(17,"b",31),n(18,"Net Total:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li",125)(23,"span",31),n(24,"SGST:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()(),i(28,"li",125)(29,"span",31),n(30,"CGST:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()(),i(34,"li",125)(35,"span",31),n(36,"IGST: "),t(),i(37,"span",121),n(38),_(39,"currencyFormat"),t()(),i(40,"li",123)(41,"b",31),n(42,"Total Tax Amount:"),t(),i(43,"span",121),n(44),_(45,"currencyFormat"),t()(),i(46,"li",123)(47,"b",31),n(48,"Logistics:"),t(),i(49,"span",121),n(50),_(51,"currencyFormat"),t()(),i(52,"li",123)(53,"b",31),n(54,"Insurance:"),t(),i(55,"span",121),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",122)(59,"span",31),n(60,"Total Payable Amount:"),t(),i(61,"span",121),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.OrderDetails.gross),""),l(6),m("(-) ",v(15,12,e.OrderDetails.discount_amount),""),l(6),m(" ",v(21,14,e.OrderDetails.net_charges),""),l(6),m(" ",v(27,16,e.OrderDetails.sgst),""),l(6),m(" ",v(33,18,e.OrderDetails.cgst),""),l(6),m(" ",v(39,20,e.OrderDetails.igst),""),l(6),m(" ",v(45,22,e.OrderDetails.gst_amount),""),l(6),m(" ",v(51,24,e.OrderDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.OrderDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.OrderDetails.total_amount),"")}}function n8(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29)(3,"ul",120)(4,"li",123)(5,"b",31),n(6,"Gross Total:"),t(),i(7,"span",121),n(8),_(9,"currencyFormat"),t()(),i(10,"li",123)(11,"b",31),n(12,"Discount:"),t(),i(13,"span",124),n(14),_(15,"currencyFormat"),t()(),i(16,"li",123)(17,"b",31),n(18,"Net Total:"),t(),i(19,"span",121),n(20),_(21,"currencyFormat"),t()(),i(22,"li",125)(23,"span",31),n(24,"SGST:"),t(),i(25,"span",121),n(26),_(27,"currencyFormat"),t()(),i(28,"li",125)(29,"span",31),n(30,"CGST:"),t(),i(31,"span",121),n(32),_(33,"currencyFormat"),t()(),i(34,"li",125)(35,"span",31),n(36,"IGST: "),t(),i(37,"span",121),n(38),_(39,"currencyFormat"),t()(),i(40,"li",123)(41,"b",31),n(42,"Total Tax Amount:"),t(),i(43,"span",121),n(44),_(45,"currencyFormat"),t()(),i(46,"li",123)(47,"b",31),n(48,"Logistics:"),t(),i(49,"span",121),n(50),_(51,"currencyFormat"),t()(),i(52,"li",123)(53,"b",31),n(54,"Insurance:"),t(),i(55,"span",121),n(56),_(57,"currencyFormat"),t()()()(),i(58,"div",122)(59,"span",31),n(60,"Total Payable Amount:"),t(),i(61,"span",121),n(62),_(63,"currencyFormat"),t()()()()),a&2){let e=p(3);l(8),m(" ",v(9,10,e.OrderDetails.gross),""),l(6),m("(-) ",v(15,12,e.OrderDetails.discount_amount),""),l(6),m(" ",v(21,14,e.OrderDetails.net_charges),""),l(6),m(" ",v(27,16,e.OrderDetails.sgst),""),l(6),m(" ",v(33,18,e.OrderDetails.cgst),""),l(6),m(" ",v(39,20,e.OrderDetails.igst),""),l(6),m(" ",v(45,22,e.OrderDetails.gst_amount),""),l(6),m(" ",v(51,24,e.OrderDetails.logistics_charges),""),l(6),m(" ",v(57,26,e.OrderDetails.insurance_charges),""),l(6),m(" ",v(63,28,e.OrderDetails.total_amount),"")}}function a8(a,d){if(a&1&&(i(0,"div",139),x(1,"app-loader",140),i(2,"
1small",141),n(3,"Loading financial summary..."),t()()),a&2){let e=p(4);l(),s("isLoading",e.loadingStates.orderDetails)("useBlockPosition",!0)}}function r8(a,d){if(a&1&&(i(0,"ul",120)(1,"li",123)(2,"b",31),n(3,"Gross Total:"),t(),i(4,"span",121),n(5),_(6,"currencyFormat"),t()(),i(7,"li",123)(8,"b",31),n(9,"Discount:"),t(),i(10,"span",124),n(11),_(12,"currencyFormat"),t()(),i(13,"li",123)(14,"b",31),n(15,"Net Total:"),t(),i(16,"span",121),n(17),_(18,"currencyFormat"),t()(),i(19,"li",125)(20,"span",31),n(21,"SGST:"),t(),i(22,"span",121),n(23),_(24,"currencyFormat"),t()(),i(25,"li",125)(26,"span",31),n(27,"CGST:"),t(),i(28,"span",121),n(29),_(30,"currencyFormat"),t()(),i(31,"li",125)(32,"span",31),n(33,"IGST:"),t(),i(34,"span",121),n(35),_(36,"currencyFormat"),t()(),i(37,"li",123)(38,"b",31),n(39,"Total Tax Amount:"),t(),i(40,"span",121),n(41),_(42,"currencyFormat"),t()(),i(43,"li",123)(44,"b",31),n(45,"Additional Charges:"),t(),i(46,"span",121),n(47),_(48,"currencyFormat"),t()()()),a&2){let e=p(4);l(5),m(" ",v(6,8,e.OrderDetails==null?null:e.OrderDetails.gross),""),l(6),m("(-) ",v(12,10,e.OrderDetails==null?null:e.OrderDetails.discount_amount),""),l(6),m(" ",v(18,12,e.OrderDetails==null?null:e.OrderDetails.net_charges),""),l(6),m(" ",v(24,14,e.OrderDetails==null?null:e.OrderDetails.sgst),""),l(6),m(" ",v(30,16,e.OrderDetails==null?null:e.OrderDetails.cgst),""),l(6),m(" ",v(36,18,e.OrderDetails==null?null:e.OrderDetails.igst),""),l(6),m(" ",v(42,20,e.OrderDetails==null?null:e.OrderDetails.gst_amount),""),l(6),m(" ",v(48,22,e.getAdditionalCharges()),"")}}function l8(a,d){a&1&&(i(0,"span")(1,"div",56)(2,"span",57),n(3,"Loading..."),t()(),i(4,"span",31),n(5,"Loading total..."),t()())}function o8(a,d){if(a&1&&(i(0,"span")(1,"span",31),n(2,"Total Payable Amount:"),t(),i(3,"span",121),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(4);l(4),m(" ",v(5,1,e.OrderDetails==null?null:e.OrderDetails.total_amount),"")}}function s8(a,d){if(a&1&&(i(0,"div")(1,"div",119)(2,"div",29),u(3,a8,4,2,"div",137)(4,r8,49,24,"ul",138),t(),i(5,"div",122),u(6,l8,6,0,"span",16)(7,o8,6,3,"span",16),t()()()),a&2){let e=p(3);l(3),s("ngIf",e.loadingStates.orderDetails),l(),s("ngIf",!e.loadingStates.orderDetails),l(2),s("ngIf",e.loadingStates.orderDetails),l(),s("ngIf",!e.loadingStates.orderDetails)}}function d8(a,d){if(a&1&&(i(0,"div",88),u(1,t8,34,15,"div",71)(2,i8,64,30,"div",71)(3,n8,64,30,"div",71)(4,s8,8,4,"div",71),t()),a&2){let e=p(2);s("ngSwitch",e.poDetails==null?null:e.poDetails.source),l(),s("ngSwitchCase","auction"),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","DirectBuy"),l(),s("ngSwitchCase","Manual")}}function c8(a,d){if(a&1&&(i(0,"div",84),u(1,e8,10,2,"div",126)(2,d8,5,5,"div",127),t()),a&2){let e=p();l(),s("ngIf",!((e.poDetails==null?null:e.poDetails.multiple_payment_terms)==="YES"||(e.poDetails==null?null:e.poDetails.multiple_shipment_terms)==="YES")),l(),s("ngIf",!((e.poDetails==null?null:e.poDetails.multiple_payment_terms)==="YES"||(e.poDetails==null?null:e.poDetails.multiple_shipment_terms)==="YES"))}}function p8(a,d){if(a&1){let e=I();i(0,"div",142)(1,"button",143),x(2,"i",144),i(3,"span",31),n(4,"Cancel"),t()(),i(5,"button",145),S("click",function(){b(e);let r=p();return y(r.CreateInvoice())}),x(6,"i",146),i(7,"span",31),n(8," Create Proforma Invoice"),t()()()}}var Za=(()=>{class a{constructor(e,o,r,c,g){this.router=e,this.financeOrderService=o,this.activatedRoute=r,this.notificationService=c,this.fb=g,this.isLoading=!1,this.isPrintLoading=!1,this.loadingStates={orderDetails:!1,poDetails:!1,dealRoom:!1},this.rejectPoForm=this.fb.group({rejectPoReason:["",[E.required,E.pattern(/^.*[^\s].*$/)]]})}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{console.log(e.poId),this.poId=e.poId,this.GetOrderDetailsByPO(),this.GetPoDetailsById()})}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}CreateInvoice(){this.router.navigate(["finance-management/receivable-purchase-orders/send"],{queryParams:{id:this.poId},replaceUrl:!0})}GetPoDetailsById(){try{this.isLoading=!0;let e=new xt;e.po_id=this.poId,this.financeOrderService.GetPoDetails(e).subscribe(o=>{console.log(o),this.poDetails=o.response.data,this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}get totalAmount(){if(this.OrderDetails&&this.OrderDetails.gross)return this.OrderDetails.gross-this.OrderDetails.discount_amount+this.OrderDetails.gst_amount+this.OrderDetails.shipping_charges+this.OrderDetails.logistics_charges+this.OrderDetails.insurance_charges}get isWorkOrder(){return String(this.OrderDetails?.order_type||this.poDetails?.order_type||"").toUpperCase()==="WO"}getAdditionalCharges(){return this.poDetails?.additional_charges?.length?this.poDetails.additional_charges.reduce((e,o)=>e+(parseFloat(o.amount)||0),0):0}GetOrderDetailsByPO(){try{this.isLoading=!0;let e=new At;e.po_id=this.poId,this.financeOrderService.getOrderDetailsByPOid(e).subscribe(o=>{console.log(o),this.OrderDetails=o.response.data,this.OrderDetails.address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddress=r),this.OrderDetails.address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddress=r),this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}getPoType(e){let o=e?.toLowerCase();return o==="rfq"?"PO_RFQ":o==="auction"?"PO_AUCTION":o==="directbuy"||o==="direct"?"PO_DIRECT_BUY":o==="manual"?"PO_MANUAL":"PO_RFQ"}printPO(){this.isPrintLoading=!0;let e=this.getPoType(this.poDetails?.source);this.financeOrderService.printPdf(e,Number(this.poId)).subscribe({next:o=>{this.isPrintLoading=!1,Te(o)},error:()=>{this.isPrintLoading=!1}})}OnClickCancel(){try{this.isLoading=!0;let e={};e.po_id=this.poId,e.status_type="reject",e.rejectReason=this.rejectPoForm.value.rejectPoReason,this.financeOrderService.rejectPo(e).subscribe({next:o=>{o.responseCode==200&&(this.notificationService.showSuccess("PO Cancelled Successfully"),this.router.navigate(["/finance-management/payable-purchase-orders/cancelled"],{queryParams:{id:this.poId},replaceUrl:!0})),this.isLoading=!1},error:o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}static{this.\u0275fac=function(o){return new(o||a)(T(K),T(z),T(de),T(H),T(ft))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-invoice"]],decls:139,vars:57,consts:[["fileList",""],["prodname","ngbPopover"],["prods",""],["popContent",""],[3,"isLoading"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate","",4,"ngIf"],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],[1,"mod-meta-label"],[1,"mod-meta-value"],["appTranslate","",1,"mod-meta-label"],["class","mod-meta-tile",4,"ngIf"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"card"],[1,"card-body"],[1,"fw-600","mb-1"],["appTranslate",""],[1,"text-secondary"],[3,"ngClass"],[1,"card","h-100"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["appTranslate","",1,"fw-600","mb-2"],[1,"fw-600"],["appTranslate","",1,"fw-600"],["class","col-12 col-md-auto",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],["class","col-12",4,"ngIf"],["class","row gut-row gut-x-4 mb-4",4,"ngIf"],["class","col-12 text-right mt-3",4,"ngIf"],["id","cancelQuotePopUp",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","ml-auto","mr-auto"],[1,"modal-content"],[3,"formGroup"],[1,"modal-body","text-center"],["type","text","formControlName","rejectPoReason",1,"form-control","change"],[1,"total-margin"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-soft-primary","btn-sm","mr-2"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click","disabled"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["class","mod-meta-value",4,"ngIf"],["placement","top","triggers","manual","class","ml-3 badge fileListBadge",3,"ngbPopover","mouseenter","mouseleave",4,"ngIf"],["class","mb-0",4,"ngFor","ngForOf"],[1,"mb-0"],["placement","top","triggers","manual",1,"ml-3","badge","fileListBadge",3,"mouseenter","mouseleave","ngbPopover"],["appTranslate","",1,"text-secondary"],[1,"col-12","col-md-auto"],[1,"doc-logo"],["ngxViewer","","alt","buyer-logo",1,"doc-logo__img",3,"viewerOptions","src"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table",3,"ngSwitch"],["class","",4,"ngSwitchCase"],[4,"ngSwitchCase"],[1,""],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],[1,"text-secondary","mb-1"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide",3,"ngSwitch"],[1,"col-12","mb-30"],["data-toggle","collapse","data-target","#cfi__PaymentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","cfi__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20"],["data-toggle","collapse","data-target","#cfi__ShipmentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["id","cfi__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],[1,"card","totalCalculationCard"],[1,"list-unstyled","mb-0"],[1,"float-right"],[1,"card-footer"],[1,"mb-2"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],["class","col-12 col-lg splitedSummaryLefttSide",4,"ngIf"],["class","col-12 col-lg splitedSummaryRightSide",3,"ngSwitch",4,"ngIf"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],["class","list-inline",4,"ngIf"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["class","text-center p-4",4,"ngIf"],["class","list-unstyled mb-0",4,"ngIf"],[1,"text-center","p-4"],["size","medium",3,"isLoading","useBlockPosition"],["appTranslate","",1,"text-muted","d-block","mt-2"],[1,"col-12","text-right","mt-3"],["type","button","data-toggle","modal","data-target","#cancelQuotePopUp",1,"mod-btn","mod-btn-soft-primary","mr-2"],[1,"uil","uil-times-circle"],["type","button",1,"mod-btn","mod-btn-primary","mr-10",3,"click"],[1,"uil","uil-message"]],template:function(o,r){o&1&&(x(0,"app-loader",4),i(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8)(5,"div",9)(6,"h2",10)(7,"a",11),x(8,"i",12),t(),u(9,OP,2,0,"span",13)(10,kP,2,0,"span",13),t()(),i(11,"div",14)(12,"button",15),S("click",function(){return r.printPO()}),u(13,FP,4,0,"span",16)(14,MP,6,0,"span",16),t()()()(),i(15,"div",7)(16,"div",17)(17,"div",18)(18,"h3",19),u(19,AP,2,0,"span",13)(20,NP,2,0,"span",13),t()(),i(21,"div",20)(22,"div",21)(23,"div",22)(24,"div",23),u(25,VP,2,0,"span",13)(26,BP,2,0,"span",13),t(),i(27,"div",24),n(28),t()(),i(29,"div",22)(30,"div",23),u(31,RP,2,0,"span",13)(32,LP,2,0,"span",13),t(),i(33,"div",24),n(34),_(35,"date"),t()(),i(36,"div",22)(37,"div",23),u(38,qP,2,0,"span",13)(39,GP,2,0,"span",13),t(),i(40,"div",24),n(41),_(42,"date"),t()(),i(43,"div",22)(44,"div",23),u(45,UP,2,0,"span",13)(46,jP,2,0,"span",13),t(),i(47,"div",24),n(48),t()(),i(49,"div",22)(50,"div",25),n(51,"Source"),t(),i(52,"div",24),n(53),_(54,"titlecase"),t()(),u(55,YP,4,1,"div",26)(56,HP,5,
11,"div",26),t()()(),i(57,"div",17)(58,"div",18)(59,"h3",27),n(60,"Supplier Details"),t()(),i(61,"div",20)(62,"div",6)(63,"div",7)(64,"div",28)(65,"div",29)(66,"p",30)(67,"span",31),n(68,"Seller Name:"),t(),i(69,"span",32),n(70),t()(),i(71,"p",30)(72,"span",31),n(73,"Seller Address:"),t(),x(74,"br"),i(75,"span",32),n(76),t()()()()()()()(),i(77,"div",17)(78,"div",18)(79,"h3",27),n(80,"Buyer Details"),t()(),i(81,"div",20)(82,"div",6)(83,"div",33)(84,"div",34)(85,"div",29)(86,"p",30)(87,"span",31),n(88,"Buyer Name:"),t(),u(89,KP,2,1,"span",35)(90,ZP,2,0,"span",36),t(),i(91,"p",37),n(92,"Shipping Address "),t(),i(93,"p",38)(94,"b",39),n(95,"Address:"),t(),i(96,"span",32),n(97),t()()()()(),i(98,"div",33)(99,"div",34)(100,"div",29)(101,"p",37),n(102,"Billing Address "),t(),i(103,"p",30)(104,"span",31),n(105,"GST No:"),t(),u(106,JP,2,1,"span",35)(107,XP,2,0,"span",36),t(),i(108,"p",38)(109,"b",39),n(110,"Address:"),t(),i(111,"span",32),n(112),t()()()()(),u(113,e7,3,3,"div",40),t()()(),i(114,"div",17)(115,"div",41)(116,"h3",27),n(117,"Order Summary"),t()(),i(118,"div",42)(119,"div",6),u(120,R7,12,9,"div",43),t()()(),u(121,Z7,15,7,"div",44)(122,c8,3,2,"div",44),i(123,"div",6),u(124,p8,9,0,"div",45),t()()()(),i(125,"div",46)(126,"div",47)(127,"div",48)(128,"form",49)(129,"div",50)(130,"span")(131,"span",31),n(132,"Reject Reason:"),t(),x(133,"textarea",51),t(),i(134,"div",52)(135,"button",53),n(136,"Cancel"),t(),i(137,"button",54),S("click",function(){return r.OnClickCancel()}),n(138,"Confirm"),t()()()()()()()),o&2&&(s("isLoading",r.isLoading),l(9),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(5),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(5),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),f(r.OrderDetails==null?null:r.OrderDetails.po_number),l(3),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),f(U(35,49,r.OrderDetails==null?null:r.OrderDetails.po_date,"dd-MM-yyyy")),l(4),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),m("",U(42,52,r.OrderDetails==null?null:r.OrderDetails.expiry_date,"dd-MM-yyyy")," "),l(4),s("ngIf",!r.isWorkOrder),l(),s("ngIf",r.isWorkOrder),l(2),f(r.shippingAddress==null?null:r.shippingAddress.city),l(5),f(v(54,55,r.OrderDetails==null?null:r.OrderDetails.source)||"N/A"),l(2),s("ngIf",(r.OrderDetails==null?null:r.OrderDetails.source)==="rfq"),l(),s("ngIf",r.OrderDetails.source==="rfq"),l(14),f(r.OrderDetails==null||r.OrderDetails.seller_details==null?null:r.OrderDetails.seller_details.company_name),l(6),se(" ",r.OrderDetails==null||r.OrderDetails.seller_address==null?null:r.OrderDetails.seller_address.street,", ",r.OrderDetails==null||r.OrderDetails.seller_address==null?null:r.OrderDetails.seller_address.region,",",r.OrderDetails==null||r.OrderDetails.seller_address==null?null:r.OrderDetails.seller_address.city," ,",r.OrderDetails==null||r.OrderDetails.seller_address==null?null:r.OrderDetails.seller_address.postcode,""),l(7),s("ngClass",r.poDetails.logo_path?"col-md":"col-md-6"),l(6),s("ngIf",r.OrderDetails.buyer_company_name),l(),s("ngIf",!r.OrderDetails.buyer_company_name),l(7),se(" ",r.shippingAddress==null?null:r.shippingAddress.street,", ",r.shippingAddress==null?null:r.shippingAddress.region,",",r.shippingAddress==null?null:r.shippingAddress.city," ,",r.shippingAddress==null?null:r.shippingAddress.postcode," "),l(),s("ngClass",r.poDetails.logo_path?"col-md":"col-md-6"),l(8),s("ngIf",r.poDetails.gstn),l(),s("ngIf",!r.poDetails.gstn),l(5),se(" ",r.billingAddress==null?null:r.billingAddress.street,", ",r.billingAddress==null?null:r.billingAddress.region,",",r.billingAddress==null?null:r.billingAddress.city," ,",r.billingAddress==null?null:r.billingAddress.postcode,""),l(),s("ngIf",r.poDetails.logo_path),l(7),s("ngIf",r.poDetails),l(),s("ngIf",r.poDetails&&((r.poDetails==null?null:r.poDetails.multiple_payment_terms)==="YES"||(r.poDetails==null?null:r.poDetails.multiple_shipment_terms)==="YES")),l(),s("ngIf",r.poDetails),l(2),s("ngIf",(r.poDetails==null?null:r.poDetails.source)!=="Manual"),l(4),s("formGroup",r.rejectPoForm),l(9),s("disabled",!r.rejectPoForm.valid))},dependencies:[nt,J,W,pt,mt,Oe,Ne,Pe,Ie,Se,Zt,Z,De,L,We,Qe,Rt,st,ae],styles:[".pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--seller-green)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}
1.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--seller-green)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--seller-green)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--seller-green);border-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--seller-green);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--seller-green);color:#fff}.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--seller-green)}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.fileListBadge[_ngcontent-%COMP%]{padding:2px 5px;border-radius:3px;background-color:#ddf3ff;color:#006fae}.fileListBadge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1rem}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.doc-logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:180px;max-width:100%;height:100%;min-height:104px;padding:12px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-lg)}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:88px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}@media (max-width: 767.98px){.doc-logo[_ngcontent-%COMP%]{width:100%;min-height:88px}}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();function m8(a,d){a&1&&(i(0,"span"),x(1,"i",95),i(2,"span",17),n(3,"Print"),t()())}function u8(a,d){a&1&&(i(0,"span")(1,"div",96)(2,"span",97),n(3,"Loading..."),t()(),i(4,"span",17),n(5,"Printing..."),t()())}function _8(a,d){if(a&1){let e=I();i(0,"button",98),S("click",function(){b(e);let r=p();return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function v8(a,d){if(a&1&&n(0),a&2){let e=p();f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function g8(a,d){if(a&1){let e=I();i(0,"button",98),S("click",function(){b(e);let r=p();return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p();l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function f8(a,d){if(a&1&&n(0),a&2){let e=p();f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function h8(a,d){if(a&1&&(i(0,"div",26)(1,"div",27),n(2,"Payment Mode "),t(),i(3,"div",28),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.payment_mode,"")}}function x8(a,d){if(a&1&&(i(0,"span",38),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.seller_details==null?null:e.invoiceDetails.seller_details.gst)}}function b8(a,d){a&1&&(i(0,"span",99),n(1,"Not Available"),t())}function y8(a,d){if(a&1&&x(0,"img",103),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function S8(a,d){if(a&1&&(i(0,"div",100)(1,"div",101),u(2,y8,1,1,"img",102),t()()),a&2){let e=p();l(2),s("ngIf",e.invoiceDetails&&e.invoiceDetails.seller_details&&e.invoiceDetails.seller_details.company_logoViewPath)}}function C8(a,d){if(a&1&&(i(0,"div",21)(1,"div",22)(2,"h3",23),n(3,"Company Bank Details"),t()(),i(4,"div",24)(5,"div",104)(6,"div",105)(
17,"span",106),x(8,"i",107),t(),i(9,"div",108)(10,"h4",109),n(11),t(),i(12,"span",110),n(13),t()()(),i(14,"div",111)(15,"div",112)(16,"span",113),n(17,"Account Holder"),t(),i(18,"span",114),n(19),t()(),i(20,"div",112)(21,"span",113),n(22,"Account Number"),t(),i(23,"span",114),n(24),t()(),i(25,"div",112)(26,"span",113),n(27,"IFSC Code"),t(),i(28,"span",114),n(29),t()(),i(30,"div",112)(31,"span",113),n(32,"Branch"),t(),i(33,"span",114),n(34),t()()()()()()),a&2){let e=p();l(11),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_name),l(2),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch),l(6),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_name),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_number),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_ifsc),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch)}}function E8(a,d){if(a&1&&(i(0,"p",115)(1,"span",36),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function I8(a,d){if(a&1&&(i(0,"p",115)(1,"span",36),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function D8(a,d){if(a&1&&(i(0,"span",38),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function T8(a,d){a&1&&(i(0,"span",99),n(1,"Not Available"),t())}function w8(a,d){if(a&1&&(i(0,"span",122),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function P8(a,d){if(a&1&&(i(0,"span",122),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function O8(a,d){if(a&1&&(i(0,"span",122),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function k8(a,d){if(a&1&&(F(0),i(1,"div",119),n(2),t(),i(3,"p",120),u(4,w8,2,2,"span",121)(5,P8,2,2,"span",121)(6,O8,2,2,"span",121),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function F8(a,d){if(a&1&&(F(0),i(1,"div",119)(2,"div")(3,"p",123)(4,"span",17),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",123)(9,"span",17),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",123)(14,"span",17),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",123),n(19),_(20,"currencyFormat"),t(),i(21,"p",123),n(22),_(23,"currencyFormat"),t(),i(24,"p",123),n(25),_(26,"currencyFormat"),t(),i(27,"p",123),n(28),_(29,"currencyFormat"),t(),i(30,"p",123)(31,"span",17),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",123)(36,"span",17),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",124),i(41,"p",115)(42,"b")(43,"span",17),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.total_amount)," ")}}function M8(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",116),n(3),t(),u(4,k8,7,4,"ng-template",null,3,P),x(6,"i",117),t(),i(7,"td",118),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small"),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,F8,47,34,"ng-template",null,4,P),x(30,"i",117),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),m("",v(13,10,e.unit_price)," "),l(5),f(v(18,12,e.gross_total)),l(3),f(v(21,14,e.discount)),l(3),f(v(24,16,e.gst)),l(3),m(" ",v(27,18,e.total_amount)," "),l(4),s("ngbPopover",r)}}function A8(a,d){if(a&1&&(i(0,"div",131)(1,"a",132)(2,"div",35)(3,"ul",133)(4,"li",134),x(5,"i",135),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(5),m(" ",e.name," ")}}function N8(a,d){if(a&1&&(i(0,"div",129),u(1,A8,7,2,"div",130),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.docs)}}function V8(a,d){a&1&&(i(0,"span",136),n(1," No files uploaded "),t())}function B8(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),u(4,N8,2,1,"div",128)(5,V8,2,0,"ng-template",null,5,P),t()()),a&2){let e=d.$implicit,o=w(6);l(2),m(" ",e.collectionName," "),l(2),s("ngIf",e.docs.length>0)("ngIfElse",o)}}function R8(a,d){a&1&&(i(0,"tr")(1,"td",137)(2,"p",138),n(3,"No documents available"),t()()())}function L8(a,d){if(a&1&&(i(0,"div",21)(1,"div",125)(2,"h3",23),n(3,"Additional Services Documents"),t()(),i(4,"div",50)(5,"div",126)(6,"table",52)(7,"thead",53)(8,"tr")(9,"th",127),n(10,"Document Name"),t(),i(11,"th",127),n(12,"Files"),t()()(),i(13,"tbody"),u(14,B8,7,3,"tr",54)(15,R8,4,0,"tr",20),t()()()()()),a&2){let e=p();l(14),s("ngForOf",e.additionalServiceDocs),l(),s("ngIf",!e.additionalServiceDocs.length)}}function q8(a,d){if(a&1){let e=I();i(0,"a",156),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!0)}),n(1,"View More"),t()}}function G8(a,d){if(a&1){let e=I();i(0,"a",156),S("click",function(){b(e);let r=p(2).$implicit;return y(r._expanded=!1)}),n(1,"View Less"),t()}}function U8(a,d){if(a&1&&(i(0,"div")(1,"p",154)(2,"b",17),n(3,"Note:"),t(),n(4),t(),u(5,q8,2,0,"a",155)(6,G8,2,0,"a",155),t()),a&2){let e=p().$implicit;
1l(),re("short-note",!e._expanded),l(3),m(" ",e.note," "),l(),s("ngIf",!e._expanded),l(),s("ngIf",e._expanded)}}function j8(a,d){if(a&1&&(i(0,"div",147)(1,"div",45)(2,"div",148)(3,"div",149)(4,"h6",150),n(5),t(),i(6,"small",151)(7,"span",17),n(8,"Due Date:"),t(),n(9),_(10,"date"),t()(),i(11,"div",152)(12,"h6",153),n(13),_(14,"currencyFormat"),t()()(),u(15,U8,7,5,"div",20),t()()),a&2){let e=d.$implicit;l(5),D("",e.title," (",e.percentage,"%)"),l(4),m(" ",U(10,5,e.due_date,"dd-MM-yyyy"),""),l(4),f(v(14,8,e.amount)),l(2),s("ngIf",e.note)}}function $8(a,d){if(a&1&&(i(0,"div",141)(1,"div",142)(2,"div",143)(3,"a",144),n(4,"Payment Terms"),t()(),i(5,"div",145)(6,"div",45),u(7,j8,16,10,"div",146),t()()()()),a&2){let e=p(2);l(7),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.payment_terms)}}function z8(a,d){if(a&1&&(i(0,"div",166)(1,"div",167)(2,"div",163)(3,"h6",168),n(4),t(),i(5,"small",151)(6,"span",17),n(7,"SKU:"),t(),n(8),t()(),i(9,"div",169)(10,"small",170),n(11,"Quantity"),t(),i(12,"h6",171),n(13),t()()()()),a&2){let e=d.$implicit;l(4),f(e.product_name),l(4),m(" ",e.sku,""),l(5),f(e.qty)}}function W8(a,d){if(a&1&&(i(0,"div",161)(1,"div",162)(2,"div",148)(3,"div",163)(4,"h6",164),n(5),t(),i(6,"small",151)(7,"span",17),n(8,"Timeline:"),t(),n(9),i(10,"span",17),n(11,"day(s)"),t()()()()(),u(12,z8,14,3,"div",165),t()),a&2){let e=d.$implicit;l(5),f(e.title),l(4),m(" ",e.timeline_days," "),l(3),s("ngForOf",e.products)}}function Q8(a,d){if(a&1&&(i(0,"div",157)(1,"div",142)(2,"div",158)(3,"a",144),n(4,"Shipment Terms"),t()(),i(5,"div",159),u(6,W8,13,3,"div",160),t()()()),a&2){let e=p(2);l(6),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.shipment_terms)}}function Y8(a,d){if(a&1&&(i(0,"div",21)(1,"div",22)(2,"h3",23),n(3,"Order Terms & Fulfillment"),t()(),i(4,"div",24)(5,"div",10),u(6,$8,8,1,"div",139)(7,Q8,7,1,"div",140),t()()()),a&2){let e=p();l(6),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_payment_terms)==="YES"),l(),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.multiple_shipment_terms)==="YES")}}function H8(a,d){if(a&1&&(i(0,"li",172)(1,"a",173),x(2,"i",135),i(3,"span",174),n(4),t()()()),a&2){let e=d.$implicit;l(),s("href",e.drive_path,q),l(2),s("title",e.filename),l(),f(e.filename)}}function K8(a,d){if(a&1&&(i(0,"li",184)(1,"b"),n(2),_(3,"plainDateTime"),t(),i(4,"h6",53)(5,"span",17),n(6,"Amount:"),t(),n(7),_(8,"currencyFormat"),t(),i(9,"p")(10,"span",17),n(11,"Mode"),t(),n(12),x(13,"br"),i(14,"span",17),n(15,"Status"),t(),n(16),t()()),a&2){let e=d.$implicit;l(2),f(U(3,4,e==null?null:e.txn_time,"DD-MM-YYYY hh:mm A")),l(5),m(" ",v(8,7,e==null?null:e.amount)," "),l(5),m(" : ",e==null?null:e.payment_mode," "),l(4),m(": ",e==null?null:e.buyer_status," ")}}function Z8(a,d){if(a&1){let e=I();i(0,"div",175)(1,"div",176)(2,"a",177),S("click",function(){b(e);let r=p();return y(r.togglePaymentHistory())}),x(3,"i",178),i(4,"span",17),n(5,"Payment History"),t(),x(6,"span",179),t()(),i(7,"div",180)(8,"div",181)(9,"ul",182),u(10,K8,17,9,"li",183),t()()()()}if(a&2){let e=p();l(2),Be("aria-expanded",e.isPaymentHistoryExpanded),l(4),re("uil-angle-up",e.isPaymentHistoryExpanded)("uil-angle-down",!e.isPaymentHistoryExpanded),l(4),s("ngForOf",e.paymentHistory)}}function J8(a,d){if(a&1){let e=I();i(0,"button",185),S("click",function(){b(e);let r=p(),c=w(279);return y(r.OnClickGenarateChildInv(c,"",null,null))}),n(1," Generate Tax Invoice "),t()}}function X8(a,d){a&1&&(i(0,"button",186),n(1," View / Generate Tax Invoice "),t())}function e9(a,d){a&1&&(i(0,"div",53)(1,"p",187),n(2,"No Invoices Found"),t()())}function t9(a,d){if(a&1){let e=I();i(0,"button",194),S("click",function(){b(e);let r=p(2),c=w(279);return y(r.OnClickGenarateChildInv(c,"",null,null))}),n(1," Generate Tax Invoice "),t()}}function i9(a,d){if(a&1){let e=I();i(0,"button",202),S("click",function(){b(e);let r=p().$implicit,c=p(2);return y(c.sendToQA(r))}),n(1,"Send to QA"),t()}if(a&2){let e=p().$implicit,o=p(2);s("disabled",e.qaSent||o.isQaPending(e))}}function n9(a,d){if(a&1){let e=I();i(0,"button",203),S("click",function(){b(e);let r=p().$implicit,c=p(2);return y(c.createasn(r.invoice_id))}),n(1,"Create ASN"),t()}}function a9(a,d){if(a&1){let e=I();i(0,"button",203),S("click",function(){b(e);let r=p().$implicit,c=p(2);return y(c.createsr(r.invoice_id))}),n(1,"Create SR"),t()}}function r9(a,d){if(a&1){let e=I();i(0,"button",203),S("click",function(){b(e);let r=p(2).$implicit,c=p(2);return y(c.editasn(r.invoice_id))}),n(1,"Edit ASN"),t()}}function l9(a,d){if(a&1){let e=I();i(0,"button",203),S("click",function(){b(e);let r=p(2).$implicit,c=p(2);return y(c.viewasn(r.asn_id))}),n(1,"View ASN"),t()}}function o9(a,d){if(a&1){let e=I();i(0,"button",203),S("click",function(){b(e);let r=p(2).$implicit,c=p(2);return y(c.viewsr(r.asn_id))}),n(1,"View SR"),t()}}function s9(a,d){if(a&1&&(i(0,"div",204),u(1,r9,2,0,"button",200)(2,l9,2,0,"button",200)(3,o9,2,0,"button",200),t()),a&2){let e=p().$implicit,o=p(2);l(),s("ngIf",e.code==="asn_saved"),l(),s("ngIf",e.code!=="asn_saved"&&!o.isWorkOrder),l(),s("ngIf",e.code!=="asn_saved"&&o.isWorkOrder)}}function d9(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),_(7,"date"),t(),i(8,"td")(9,"a",195),n(10),t()(),x(11,"td"),i(12,"td",196)(13,"button",197),S("click",function(){let r=b
1(e).$implicit,c=p(2);return y(c.OnClickViewInvoice(r.invoice_id))}),i(14,"span",17),n(15,"View Tax Invoice"),t(),x(16,"i",198),t(),u(17,i9,2,1,"button",199)(18,n9,2,0,"button",200)(19,a9,2,0,"button",200)(20,s9,4,3,"div",201),t()()}if(a&2){let e=d.$implicit,o=p(2);l(2),f(e.invoice_number),l(2),f(e.po_number),l(2),f(U(7,9,e.created_date,"dd-MM-yyyy")),l(3),s("ngClass",e.buyer_status=="Payment Success"?"badge badge-green-s status-badge":"badge badge-blue-s status-badge"),l(),m(" ",e.buyer_status," "),l(7),s("ngIf",!e.asn_id&&(o.invoiceDetails==null?null:o.invoiceDetails.is_qa_required)==="YES"&&!o.isQaCompleted(e)),l(),s("ngIf",!e.asn_id&&((o.invoiceDetails==null?null:o.invoiceDetails.is_qa_required)!=="YES"||o.isQaCompleted(e))&&!o.isWorkOrder),l(),s("ngIf",!e.asn_id&&((o.invoiceDetails==null?null:o.invoiceDetails.is_qa_required)!=="YES"||o.isQaCompleted(e))&&o.isWorkOrder),l(),s("ngIf",e.asn_id)}}function c9(a,d){if(a&1&&(i(0,"div",53)(1,"div",188),u(2,t9,2,0,"button",189),t(),i(3,"div",190)(4,"div",191)(5,"table",192)(6,"thead",53)(7,"tr")(8,"th",193),n(9,"Invoice Id"),t(),i(10,"th",193),n(11,"PO Id"),t(),i(12,"th",193),n(13,"Created On"),t(),i(14,"th",193),n(15,"Status"),t(),i(16,"th"),n(17,"\xA0"),t(),i(18,"th"),n(19,"\xA0"),t()()(),i(20,"tbody"),u(21,d9,21,12,"tr",54),t()()()()()),a&2){let e=p();l(2),s("ngIf",(e.invoiceDetails==null?null:e.invoiceDetails.can_tax_invoice_generate)==="YES"&&!e.isAuctionEA),l(19),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.invoices)}}function p9(a,d){if(a&1&&(i(0,"span",38),n(1),t()),a&2){let e=p(2);l(),f(e.invoiceDetails==null||e.invoiceDetails.seller_details==null?null:e.invoiceDetails.seller_details.gst)}}function m9(a,d){a&1&&(i(0,"span",99),n(1,"Not Available"),t())}function u9(a,d){if(a&1&&x(0,"img",103),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function _9(a,d){if(a&1&&(i(0,"p",115)(1,"span",36),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function v9(a,d){if(a&1&&(i(0,"p",115)(1,"span",36),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p(2);l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name)," ")}}function g9(a,d){if(a&1&&(i(0,"span",38),n(1),t()),a&2){let e=p(2);l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function f9(a,d){a&1&&(i(0,"span",99),n(1,"Not Available"),t())}function h9(a,d){if(a&1&&(i(0,"span",122),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function x9(a,d){if(a&1&&(i(0,"span",122),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function b9(a,d){if(a&1&&(i(0,"span",122),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function y9(a,d){if(a&1&&(F(0),i(1,"div",119),n(2),t(),i(3,"p",120),u(4,h9,2,2,"span",121)(5,x9,2,2,"span",121)(6,b9,2,2,"span",121),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function S9(a,d){if(a&1&&(F(0),i(1,"p",244)(2,"span",17),n(3,"Combined quantity of all tax invoices exceeds the required quantity."),t(),x(4,"br"),i(5,"span",17),n(6,"Max quantity allowed is"),t(),n(7),t(),M()),a&2){let e=p(2).$implicit,o=p(3);l(7),m(" ",o.minOrderQuantity(e)," ")}}function C9(a,d){if(a&1&&(i(0,"div",243)(1,"span",17),n(2,"quantity exceeded"),t(),u(3,S9,8,1,"ng-template",null,7,P),x(5,"i",117),t()),a&2){let e=w(4);l(5),s("ngbPopover",e)}}function E9(a,d){if(a&1&&(F(0),i(1,"div",119)(2,"div")(3,"p",123)(4,"span",17),n(5,"Basic Price:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",123)(9,"span",17),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",123)(14,"span",17),n(15,"Gross Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",123)(19,"span",17),n(20,"GST:"),t(),n(21),_(22,"currencyFormat"),t(),x(23,"div",124),i(24,"p",115)(25,"b")(26,"span",17),n(27,"Net Price:"),t(),n(28),_(29,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,5,e.basicAmount1)," "),l(5),m(" ",v(12,7,e.discountForShow)," "),l(5),m(" ",v(17,9,e.basicAmount1-e.discountForShow)," "),l(5),m(" ",v(22,11,e.gstForShow)," "),l(7),m(" ",v(29,13,e.gross_amount_For_cal)," ")}}function I9(a,d){if(a&1){let e=I();i(0,"tr")(1,"td")(2,"span"),n(3),t(),u(4,y9,7,4,"ng-template",null,3,P),x(6,"i",117),t(),i(7,"td"),n(8),t(),i(9,"td")(10,"input",240),ve("ngModelChange",function(r){let c=b(e).$implicit;return _e(c.off_by_chinv,r)||(c.off_by_chinv=r),y(r)}
1),S("input",function(){let r=b(e),c=r.$implicit,g=r.index,h=p(3);return y(h.OnClickOffredQty(c,g))}),t(),u(11,C9,6,1,"div",241),t(),i(12,"td",242),n(13),_(14,"currencyFormat"),i(15,"small"),n(16,"/unit"),t()(),i(17,"td",242),n(18),t(),i(19,"td",242),n(20),_(21,"currencyFormat"),t(),i(22,"td",242),n(23),_(24,"currencyFormat"),t(),i(25,"td",242),n(26),_(27,"currencyFormat"),t(),i(28,"td",242),n(29),_(30,"currencyFormat"),u(31,E9,30,15,"ng-template",null,6,P),x(33,"i",117),t()()}if(a&2){let e=d.$implicit,o=w(5),r=w(32),c=p(3);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),s("max",c.minOrderQuantity(e))("min",c.invoiceDetails.source==="DirectBuy"?e.required_qty:0),ue("ngModel",e.off_by_chinv),s("disabled",c.invoiceDetails.source==="DirectBuy")("title",c.invoiceDetails.source==="DirectBuy"?"Direct Buy Product (Cannot be changed)":""),l(),s("ngIf",e.exceededQtyShow),l(2),m("",v(14,16,e.unit_price)," "),l(5),f(e.required_qty),l(2),f(v(21,18,e.discountForShow)),l(3),f(v(24,20,e.basicAmount1)),l(3),f(v(27,22,e.gstForShow)),l(3),m(" ",v(30,24,e.gross_amount_For_cal)," "),l(4),s("ngbPopover",r)}}function D9(a,d){if(a&1&&(i(0,"table",239)(1,"thead",53)(2,"tr")(3,"th",17),n(4," Product Name"),t(),i(5,"th",17),n(6," Product ID"),t(),i(7,"th",17),n(8," Offered Qty"),t(),i(9,"th",17),n(10," Quoted "),t(),i(11,"th",17),n(12," Required Qty"),t(),i(13,"th",17),n(14," Discount"),t(),i(15,"th",17),n(16," Gross Total"),t(),i(17,"th",17),n(18," Tax"),t(),i(19,"th",17),n(20," Total Payable"),t()()(),i(21,"tbody"),u(22,I9,34,26,"tr",54),t()()),a&2){let e=p(2);l(22),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items)}}function T9(a,d){if(a&1){let e=I();i(0,"div",245)(1,"div",10)(2,"div",246)(3,"button",247),S("click",function(){b(e);let r=p(2);return y(r.addAnotherInstallment())}),x(4,"i",248),t(),i(5,"span",249),S("click",function(){b(e);let r=p(2);return y(r.addAnotherInstallment())}),n(6,"Add Additional Charges"),t()()()()}}function w9(a,d){if(a&1){let e=I();i(0,"button",247),S("click",function(){b(e);let r=p(3);return y(r.addAnotherInstallment())}),x(1,"i",248),t()}}function P9(a,d){if(a&1){let e=I();i(0,"button",259),S("click",function(){b(e);let r=p().index,c=p(2);return y(c.Ondeletepayment(r))}),x(1,"i",260),t()}}function O9(a,d){if(a&1){let e=I();i(0,"div",250)(1,"div",251)(2,"label",17),n(3,"Description"),t(),x(4,"textarea",252),t(),i(5,"div",251)(6,"label",17),n(7,"Amount"),t(),i(8,"input",253),S("keyup",function(r){b(e);let c=p(2);return y(c.OnKeyupOnPrice(r))}),t()(),i(9,"div",254)(10,"div",255)(11,"div",256),u(12,w9,2,0,"button",257)(13,P9,2,0,"button",258),t()()()()}if(a&2){let e=d.index,o=p(2);s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.payment.controls.length>1||e==0&&o.payment.controls.length==1)}}function k9(a,d){a&1&&(i(0,"div",263),n(1," Expected Delivery Date cannot be in the past "),t())}function F9(a,d){if(a&1&&(i(0,"div",261),u(1,k9,2,0,"div",262),t()),a&2){let e,o=p(2);l(),s("ngIf",(e=o.parentInvoiceForm.get("deliveryDate"))==null||e.errors==null?null:e.errors.pastDate)}}function M9(a,d){if(a&1){let e=I();i(0,"span",267)(1,"i",268),S("click",function(){b(e);let r=p().$implicit,c=p(2);return y(c.OnClickDeleteTermsDoc(r))}),t()()}}function A9(a,d){if(a&1&&(i(0,"li",172)(1,"p",264)(2,"a",265),n(3),t(),u(4,M9,2,0,"span",266),t()()),a&2){let e=d.$implicit;l(2),s("title",e.filename)("href",e.drive_path,q),l(),m(" ",e.filename," "),l(),s("ngIf",e.deletable)}}function N9(a,d){if(a&1){let e=I();i(0,"input",273),ve("ngModelChange",function(r){b(e);let c=p(3);return _e(c.invoiceDetails.logisticscharges,r)||(c.invoiceDetails.logisticscharges=r),y(r)}),S("focusout",function(){b(e);let r=p(3);return y(r.logisticsFocusOut())}),t()}if(a&2){let e=p(3);ue("ngModel",e.invoiceDetails.logisticscharges),s("allowDecimals",!0)}}function V9(a,d){if(a&1){let e=I();i(0,"span",274),S("click",function(){b(e);let r=p(3);return y(r.isLogisticChargesEnabled=!0)}),x(1,"i",275),n(2),_(3,"currencyFormat"),t()}if(a&2){let e=p(3);l(2),m(" ",v(3,1,e.invoiceDetails.logisticscharges),"")}}function B9(a,d){if(a&1){let e=I();i(0,"input",276),ve("ngModelChange",function(r){b(e);let c=p(3);return _e(c.invoiceDetails.insurancecharges,r)||(c.invoiceDetails.insurancecharges=r),y(r)}),S("focusout",function(){b(e);let r=p(3);return y(r.insuranceFocusOut())}),t()}if(a&2){let e=p(3);ue("ngModel",e.invoiceDetails.insurancecharges),s("allowDecimals",!0)}}function R9(a,d){if(a&1){let e=I();i(0,"span",274),S("click",function(){b(e);let r=p(3);return y(r.isInsuranceChargesEnabled=!0)}),x(1,"i",275),n(2),_(3,"currencyFormat"),t()}if(a&2){let e=p(3);l(2),m(" ",v(3,1,e.invoiceDetails.insurancecharges),"")}}function L9(a,d){if(a&1&&(i(0,"p",123),n(1),_(2,"currencyFormat"),t()),a&2){let e=p().$implicit;
1l(),D(" ",e.description,": ",v(2,2,e.price)," ")}}function q9(a,d){if(a&1&&(F(0),u(1,L9,3,4,"p",277),M()),a&2){let e=d.$implicit;l(),s("ngIf",e.description)}}function G9(a,d){if(a&1&&(F(0),i(1,"div",119)(2,"div"),u(3,q9,2,1,"ng-container",54),x(4,"div",124),i(5,"p",115)(6,"b")(7,"span",17),n(8,"Total Additional Charges:"),t(),n(9),_(10,"currencyFormat"),t()()()(),M()),a&2){let e=p(4);l(3),s("ngForOf",e.parentInvoiceForm.value.orderDetails),l(6),m(" ",v(10,2,e.additionalCharges)," ")}}function U9(a,d){if(a&1&&(i(0,"li",65)(1,"b",17),n(2,"Additional Charges:"),t(),u(3,G9,11,4,"ng-template",null,8,P),x(5,"i",117),i(6,"span",66),n(7),_(8,"currencyFormat"),t()()),a&2){let e=w(4),o=p(3);l(5),s("ngbPopover",e),l(2),m(" ",v(8,2,o.additionalCharges),"")}}function j9(a,d){if(a&1&&(i(0,"div",45)(1,"ul",64)(2,"li",65)(3,"b",17),n(4,"Gross Total:"),t(),i(5,"span",66),n(6),_(7,"currencyFormat"),t()(),i(8,"li",65)(9,"b",17),n(10,"Discount:"),t(),i(11,"span",67),n(12),_(13,"currencyFormat"),t()(),i(14,"li",65)(15,"b",17),n(16,"Net Total:"),t(),i(17,"span",66),n(18),_(19,"currencyFormat"),t()(),i(20,"li",68)(21,"span",17),n(22,"SGST:"),t(),i(23,"span",66),n(24),_(25,"currencyFormat"),t()(),i(26,"li",68)(27,"span",17),n(28,"CGST:"),t(),i(29,"span",66),n(30),_(31,"currencyFormat"),t()(),i(32,"li",68)(33,"span",17),n(34,"IGST:"),t(),i(35,"span",66),n(36),_(37,"currencyFormat"),t()(),i(38,"li",65)(39,"b",17),n(40,"Total Tax Amount:"),t(),i(41,"span",66),n(42),_(43,"currencyFormat"),t()(),i(44,"li",65)(45,"b",17),n(46,"Logistics:"),t(),i(47,"span",66),u(48,N9,1,2,"input",269)(49,V9,4,3,"span",270),t()(),i(50,"li",65)(51,"b",17),n(52,"Insurance:"),t(),i(53,"span",66),u(54,B9,1,2,"input",271)(55,R9,4,3,"span",270),t()(),u(56,U9,9,4,"li",272),t()()),a&2){let e=p(2);l(6),m(" ",v(7,12,e.invoiceDetails==null?null:e.invoiceDetails.basicAmountForShow),""),l(6),m("(-) ",v(13,14,e.invoiceDetails==null?null:e.invoiceDetails.discountAmount),""),l(6),m(" ",v(19,16,e.invoiceDetails==null?null:e.invoiceDetails.netAmoutForShow),""),l(6),m(" ",v(25,18,e.invoiceDetails==null?null:e.invoiceDetails.taxInvoiceSgst),""),l(6),m(" ",v(31,20,e.invoiceDetails==null?null:e.invoiceDetails.taxInvoiceCgst),""),l(6),m(" ",v(37,22,e.invoiceDetails==null?null:e.invoiceDetails.taxInvoiceIgst),""),l(6),m(" ",v(43,24,e.invoiceDetails==null?null:e.invoiceDetails.gstamount),""),l(6),s("ngIf",e.enableLogisticsCh
1arges),l(),s("ngIf",!e.enableLogisticsCharges),l(5),s("ngIf",e.enableInsuranceCharges),l(),s("ngIf",!e.enableInsuranceCharges),l(),s("ngIf",(e.parentInvoiceForm==null||e.parentInvoiceForm.value==null||e.parentInvoiceForm.value.orderDetails==null?null:e.parentInvoiceForm.value.orderDetails.length)>0)}}function $9(a,d){a&1&&(i(0,"span"),x(1,"i",278),i(2,"span",17),n(3,"Send To Buyer"),t()())}function z9(a,d){a&1&&(i(0,"span"),x(1,"div",279),i(2,"span",17),n(3,"Sending..."),t()())}function W9(a,d){if(a&1){let e=I();i(0,"div",205)(1,"div",206)(2,"div",78)(3,"div",207)(4,"h1",80),n(5,"Tax Invoice Generation"),t(),i(6,"button",208),S("click",function(){b(e);let r=p();return y(r.OnClickCloseModel())}),x(7,"i",209),t()(),i(8,"div",82)(9,"div",210)(10,"div",10)(11,"div",211)(12,"div",142)(13,"div",35)(14,"p",36),n(15,"Shipping From :"),t(),i(16,"p",37)(17,"span",17),n(18,"Seller Name:"),t(),i(19,"span",38),n(20),t()(),i(21,"p",37)(22,"span",17),n(23,"GST No:"),t(),u(24,p9,2,1,"span",39)(25,m9,2,0,"span",40),t(),i(26,"p",37)(27,"span",17),n(28,"Seller Address:"),t(),i(29,"span",38),n(30),t()()()()(),i(31,"div",212)(32,"div",101),u(33,u9,1,1,"img",102),t()()(),i(34,"div",21)(35,"div",22)(36,"h3",23),n(37,"Buyer Address"),t()(),i(38,"div",24)(39,"div",10)(40,"div",43)(41,"div",44)(42,"div",45)(43,"p",46),n(44,"Shipping Address : "),t(),u(45,_9,4,1,"p",47),i(46,"p",38),n(47),t()()()(),i(48,"div",43)(49,"div",44)(50,"div",45)(51,"p",46),n(52,"Billing Address : "),t(),u(53,v9,4,1,"p",47),i(54,"p",38),n(55),t(),i(56,"p",37)(57,"span",17),n(58,"GST No:"),t(),u(59,g9,2,1,"span",39)(60,f9,2,0,"span",40),t()()()()()()(),i(61,"div",213)(62,"div",141)(63,"div",142)(64,"div",214)(65,"a",215),n(66," Order Summary "),t()(),i(67,"div",216)(68,"div",45)(69,"div",217),u(70,D9,23,1,"table",218)(71,T9,7,0,"div",219),i(72,"fieldset",220)(73,"div",221),u(74,O9,14,3,"div",222),t(),i(75,"div",223)(76,"div",58)(77,"label",224),n(78,"Expected Delivery Date"),t(),x(79,"input",225),u(80,F9,2,1,"div",226),t()()()()()()()()(),i(81,"div",213)(82,"div",227)(83,"div",58)(84,"label",17),n(85,"Terms And Conditions"),t(),i(86,"textarea",228),ve("ngModelChange",function(r){b(e);let c=p();return _e(c.termsandcondtns,r)||(c.termsandcondtns=r),y(r)}),t()(),i(87,"div",58)(88,"label",229),n(89,"Upload Attachments"),t(),i(90,"div",230)(91,"input",231),S("change",function(r){b(e);let c=p();return y(c.fileChange(r,""))}),t(),i(92,"label",232),n(93,"Choose file"),t()()(),i(94,"ul",60),u(95,A9,5,4,"li",61),t()(),i(96,"div",233)(97,"div",234),u(98,j9,57,26,"div",235),i(99,"div",70)(100,"span",17),n(101,"Net Payable:"),t(),i(102,"span",66),n(103),_(104,"currencyFormat"),t()()()()()()(),i(105,"div",236)(106,"button",237),S("click",function(){b(e);let r=p();return y(r.OnClickCloseModel())}),n(107,"Cancel"),t(),i(108,"button",238),S("click",function(){b(e);let r=p();return y(r.OnClickSendtoBuyer())}),u(109,$9,4,0,"span",20)(110,z9,4,0,"span",20),t()()()()()}if(a&2){let e,o=p();l(20),f(o.invoiceDetails==null||o.invoiceDetails.seller_address==null?null:o.invoiceDetails.seller_address.firstname),l(4),s("ngIf",o.invoiceDetails==null||o.invoiceDetails.seller_details==null?null:o.invoiceDetails.seller_details.gst),l(),s("ngIf",!(!(o.invoiceDetails==null||o.invoiceDetails.seller_details==null)&&o.invoiceDetails.seller_details.gst)),l(5),se(" ",o.invoiceDetails==null||o.invoiceDetails.seller_address==null?null:o.invoiceDetails.seller_address.street,", ",o.invoiceDetails==null||o.invoiceDetails.seller_address==null?null:o.invoiceDetails.seller_address.region," ",o.invoiceDetails==null||o.invoiceDetails.seller_address==null?null:o.invoiceDetails.seller_address.city,", ",o.invoiceDetails==null||o.invoiceDetails.seller_address==null?null:o.invoiceDetails.seller_address.postcode,""),l(3),s("ngIf",o.invoiceDetails&&o.invoiceDetails.seller_details&&o.invoiceDetails.seller_details.company_logoViewPath),l(12),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.buyer_company_name)||(o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null?null:o.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",o.shippingAddrdres==null?null:o.shippingAddrdres.street," ",o.shippingAddrdres==null?null:o.shippingAddrdres.region,", ",o.shippingAddrdres==null?null:o.shippingAddrdres.city,", ",o.shippingAddrdres==null?null:o.shippingAddrdres.postcode," "),l(6),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.buyer_company_name)||(o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null?null:o.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",o.billingAddres==null?null:o.billingAddres.street," ",o.billingAddres==null?null:o.billingAddres.region,", ",o.billingAddres==null?null:o.billingAddres.city,", ",o.billingAddres==null?null:o.billingAddres.postcode," "),l(4),s("ngIf",o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null?null:o.invoiceDetails.buyerCompanyDetails.gst),l(),s("ngIf",!(!(o.invoiceDetails==null||o.invoiceDetails.buyerCompanyDetails==null)&&o.invoiceDetails.buyerCompanyDetails.gst)),l(10),s("ngIf",(o.invoiceDetails==null?null:o.invoiceDetails.items.length)!==0),l(),s("ngIf",!o.payment.controls.length),l(),s("ngClass",o.advShow==!0?"disableClass":"")("formGroup",o.parentInvoiceForm)("disabled",o.advShow),l(2),s("ngForOf",o.payment.controls),l(5),s("min",o.todayDate),l(),s("ngIf",((e=o.parentInvoiceForm.get("deliveryDate"))==null?null:e.touched)&&((e=o.parentInvoiceForm.get("deliveryDate"))==null?null:e.dirty)),l(6),ue("ngModel",o.termsandcondtns),l(9),s("ngForOf",o.additionalDocs),l(3),s("ngIf",o.priceBreakupShow==!1),l(5),m(" ",v(104,35,o.invoiceDetails==null?null:o.invoiceDetails.grossAmountForShow),""),l(5),s("disabled",o.isSendingToBuyer),l(),s("ngIf",!o.isSendingToBuyer),l(),s("ngIf",o.isSendingToBuyer)}}var Ja=(()=>{class a{get isFullyPaid(){let e=Number(this.invoiceDetails?.balance_amount);return!isNaN(e)&&e<=0}constructor(e,o,r,c,g,h,C){this.orderService=e,this.activatedRoute=o,this.dialog=r,this.router=c,this.fb=g,this.snackBar=h,this.notificationService=C,this.price=0,this.termsandcondtns="",this.description="",this.priceBreakupShow=!1,this.additionalDocs=[],this.requestPayment={amount:"",note:""},this.isLogisticChargesEnabled=!0,this.isInsuranceChargesEnabled=!0,this.additionalServiceDocs=[],this.paymentHistory=[],this.isPaymentHistoryExpanded=!1,this.isSendingToBuyer=!1,this.isPrintLoading=!1;let k=new Date;this.todayDate=k.toISOString().slice(0,10)}
1get isAuctionEA(){return this.invoiceDetails?.source==="Auction-EA"}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}openPathInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openPathInNewTab("/rfq/sellers/rfq-details/"+o):e==="auction"&&this.openPathInNewTab("/auction/seller-auction-details/"+(this.invoiceDetails?.source_main_id||o)))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openPathInNewTab("/finance-management/receivable-purchase-orders/seller-view?id="+this.invoiceDetails.po_id)}ngOnInit(){this.buildForm(),this.activatedRoute.queryParams.subscribe(e=>{this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.GetInvoiceDetails()}),this.invoiceDetails?.items.forEach(e=>{e.off_by_chinv==0&&(e.basicAmount1=0,e.gstForShow=0,e.discountForShow=0,e.gross_amount_For_cal=0)})}notPastDateValidator(){return e=>{let o=e.value;if(!o)return null;let r=o.split("-");if(r.length!==3)return{invalidDate:!0};let c=parseInt(r[0],10),g=parseInt(r[1],10)-1,h=parseInt(r[2],10);if(isNaN(c)||isNaN(g)||isNaN(h))return{invalidDate:!0};let C=new Date(c,g,h),k=new Date;return k.setHours(0,0,0,0),C<k?{pastDate:!0}:null}}buildForm(){this.parentInvoiceForm=this.fb.group({orderDetails:this.fb.array([]),deliveryDate:["",[this.notPastDateValidator()]]})}get payment(){return this.parentInvoiceForm.get("orderDetails")}addAnotherInstallment(){this.parentInvoiceForm.get("orderDetails").push(this.fb.group({price:[0],description:[""]}))}Ondeletepayment(e){this.parentInvoiceForm.get("orderDetails").controls[e].get("price").setValue(0),this.parentInvoiceForm.get("orderDetails").controls[e].get("description").setValue("");let o=this.invoiceDetails.items.map(r=>r.gross_amount_For_cal);this.invoiceDetails.grossAmountForShow=o.reduce((r,c)=>r+c,0)+this.additionalCharges,this.parentInvoiceForm.get("orderDetails").removeAt(e)}GetInvoiceDetails(){let e=new Vt;e.invoice_id=Number(this.invoiceId),e.invoice_type=this.invoiceType,this.orderService.GetInvoiceDetails(e).subscribe(o=>{console.log(o),this.invoiceDetails=o.response.data,this.termsandcondtns=this.invoiceDetails.terms??"",this.additionalDocs=this.invoiceDetails.detail_seller_terms_and_conditions_path,this.invoiceDetails.buyer_address.filter(h=>h.addressType=="billing").forEach(h=>this.billingAddres=h),this.invoiceDetails.buyer_address.filter(h=>h.addressType=="shipping").forEach(h=>this.shippingAddrdres=h);let r=this.invoiceDetails.items||[];(this.invoiceDetails.shipment_terms||[]).forEach(h=>{(h.products||[]).forEach(C=>{let k=r.find(O=>C.po_item_id&&Number(O.item_id)===Number(C.po_item_id)||C.product_id&&Number(O.product_id)===Number(C.product_id));k&&(C.product_name=C.product_name||k.product_name,C.sku=C.sku||k.sku||k.display_item_id)})}),this.invoiceDetails.items.forEach(h=>this.invoiceDetails?.source==="DirectBuy"?h.off_by_chinv=h.required_qty:h.off_by_chinv=0),this.invoiceDetails.items.forEach((h,C)=>{h.off_by_chinv==0?(console.log("this.invoiceDetails.products"),h.basicAmount1=0,this.invoiceDetails.grossAmountForShow=0,this.invoiceDetails.netAmoutForShow=0,this.invoiceDetails.basicAmountForShow=0,this.invoiceDetails.discountAmount=0,this.invoiceDetails.gstamount=0,this.invoiceDetails.taxInvoiceSgst=0,this.invoiceDetails.taxInvoiceCgst=0,this.invoiceDetails.taxInvoiceIgst=0,h.gstForShow=0,h.discountForShow=0,h.gross_amount_For_cal=0,console.log(h.discountForShow)):this.OnClickOffredQty(h,C)}),this.additionalServiceDocs=[];let c=h=>`${h.docName||""}|${h.filename||h.file_name||h.name||""}|${h.drive_path||h.path||h.viewPath||h.file_path||""}`,g=new Set;(this.invoiceDetails.additionalDocuments||[]).forEach(h=>{let C=c(h);if(g.has(C))return;g.add(C);let k=this.additionalServiceDocs.findIndex(O=>O.collectionName===h.docName);k===-1?this.additionalServiceDocs.push({collectionName:h.docName,docs:[h]}):this.additionalServiceDocs[k].docs.push(h)}),this.getPaymentHistory()})}getPaymentHistory(){this.orderService.getPaymentHistory({poId:this.invoiceDetails.po_id}).subscribe(e=>{console.log(e),e.responseCode===200?this.paymentHistory=e.response.list:this.notificationService.showError("Failed to fetch payment history")},e=>{this.notificationService.showError("Something went wrong while fetching payment history")})}OnClickDeleteDoc(e){this.additionalDocs=this.additionalDocs.filter(o=>o.drive_path!==e.drive_path)}OnClickGenarateChildInv(e,o,r,c){o==""?(this.invoiceDetails.items.forEac
1h(g=>this.invoiceDetails?.source==="DirectBuy"?g.off_by_chinv=g.required_qty:g.off_by_chinv=0),this.buildForm(),this.dialogRef=this.dialog.open(e),this.invoiceDetails.items.forEach((g,h)=>{g.off_by_chinv==0?(console.log("this.poRfqData.data.products"),g.basicAmount1=0,g.gstForShow=0,g.discountForShow=0,g.gross_amount_For_cal=0):this.OnClickOffredQty(g,h)})):this.router.navigate(["finance-management/receivable-invoices/view"],{queryParams:{invoiceId:r,invoiceType:"child"}})}OnClickViewInvoice(e){let o=this.router.createUrlTree(["finance-management/receivable-invoices/view"],{queryParams:{invoiceId:e,invoiceType:"child"}}),r=window.location.href.replace(this.router.url,"");window.open(r+o,"_blank")}get isWorkOrder(){return String(this.invoiceDetails?.order_type||"").toUpperCase()==="WO"}createasn(e){this.router.navigate(["shipments/outbound-asn/create-asn/"+e])}createsr(e){this.router.navigate(["shipments/outbound-asn/service-report/"+e])}isQaPending(e){let o=(e?.buyer_status??"").toString().trim().toLowerCase();return o==="qa pending"||o==="qa_pending"}isQaCompleted(e){let o=(e?.buyer_status??"").toString().trim().toLowerCase();return o==="qa completed"||o==="qa_completed"}sendToQA(e){if(e?.qaSent||this.isQaPending(e))return;let o=e?.invoice_id;if(!o)return;let r=new Vt;r.invoice_id=Number(o),r.invoice_type="child",this.orderService.GetTaxInvoiceDetails(r).subscribe({next:c=>{let g=c?.response?.data;if(!g){this.notificationService.showError("Something went wrong!");return}let h=(g.items||[]).map(O=>({product_id:Number(O.item_id??O.product_id),product_name:O.product_name,total_quantity:Number(O.offered_qty??O.required_qty??0)})),C=h.reduce((O,Q)=>O+(Q.total_quantity||0),0),k={record_type:"QA",grn_id:"",po_id:this.invoiceDetails?.po_id??null,invoice_id:Number(this.invoiceId)||null,tax_invoice_id:o,assignee_id:null,source:this.invoiceDetails?.source??null,source_id:this.invoiceDetails?.po_id??null,received_date:this.todayDate,total_items:h.length,total_quantity:C,products:h};this.orderService.createQaQc(k).subscribe({next:O=>{O.responseCode===200?(e.qaSent=!0,this.notificationService.showSuccess(O.response?.response||"Sent to QA successfully")):this.notificationService.showError("Something went wrong!")},error:()=>this.notificationService.showError("Something went wrong!")})},error:()=>this.notificationService.showError("Something went wrong!")})}editasn(e){this.router.navigate(["shipments/outbound-asn/edit/"+e])}viewasn(e){this.router.navigate(["shipments/outbound-shipments/view/"+e])}viewsr(e){this.router.navigate(["shipments/service-report/details/"+e])}OnKeyupOnPrice(e){this.parentInvoiceForm.value.orderDetails.filter(r=>r.price=="").forEach(r=>{r.price=0});let o=this.invoiceDetails.items.map(r=>r.gross_amount_For_cal);this.invoiceDetails.grossAmountForShow=o.reduce((r,c)=>r+c,0)+this.additionalCharges}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get totalAmount(){if(this.invoiceDetails)return this.invoiceDetails.gross-this.invoiceDetails.discount_amount+this.invoiceDetails.gst_amount+this.invoiceDetails.shipping_charges+this.invoiceDetails.logistics_charges+this.invoiceDetails.insurance_charges}minOrderQuantity(e){if(this.invoiceDetails&&this.invoiceDetails.source==="DirectBuy")return e.required_qty;let o=this.invoiceDetails.invoice_items_with_qty.filter(c=>c.sales_order_item_id==e.sales_order_item_id),r=0;return o.length&&o.forEach(c=>{r=r+Number(c.total_qty)}),e.required_qty-r>0?e.required_qty-r:0}OnClickOffredQty(e,o){let r=this.invoiceDetails.items[o];Number(r.off_by_chinv)>this.minOrderQuantity(e)?(console.log("Amount Exceeded"),r.exceededQtyShow=!0):r.exceededQtyShow=!1,this.invoiceDetails.items.filter(Y=>Y.off_by_chinv>0).forEach(Y=>Y.checked=!0);let c=e.unit_price*e.off_by_chinv,g=c*e.discount_percent/100,h=e.gst/e.required_qty*e.off_by_chinv;r.basicAmount1=e.unit_price*e.off_by_chinv,r.gstForShow=r.gst/r.required_qty*r.off_by_chinv,r.discountForShow=c*e.discount_percent/100,r.off_by_chinv>=0&&(r.gross_amount_For_cal=Math.round(c-g+h+e.logistics_charges/e.required_qty*e.off_by_chinv+e.shipping_charges/e.required_qty*e.off_by_chinv+e.insurance_charges/e.required_qty*e.off_by_chinv)),this.invoiceDetails.items.forEac
1h(Y=>{Y.off_by_chinv==0&&(Y.basicAmount1=0,this.invoiceDetails.grossAmountForShow=0,this.invoiceDetails.netAmoutForShow=0,this.invoiceDetails.basicAmountForShow=0,this.invoiceDetails.discountAmount=0,this.invoiceDetails.gstamount=0,this.invoiceDetails.taxInvoiceSgst=0,this.invoiceDetails.taxInvoiceCgst=0,this.invoiceDetails.taxInvoiceIgst=0,Y.discountForShow=0,Y.gross_amount_For_cal=0)});let C=this.invoiceDetails.items.map(Y=>Y.basicAmount1),k=this.invoiceDetails.items.map(Y=>Y.gross_amount_For_cal),O=this.invoiceDetails.items.map(Y=>Y.discountForShow),Q=this.invoiceDetails.items.map(Y=>Y.basicAmount1-Y.discountForShow),G=this.invoiceDetails.items.filter(Y=>Y.checked==!0).map(Y=>Y.gstForShow),X=Number(this.invoiceDetails.logisticscharges??0),pe=Number(this.invoiceDetails.insurancecharges??0);this.invoiceDetails.basicAmountForShow=C.reduce((Y,le)=>Y+le,0),this.invoiceDetails.grossAmountForShow=k.reduce((Y,le)=>Y+le,0)+this.additionalCharges+X+pe,this.invoiceDetails.netAmoutForShow=Q.reduce((Y,le)=>Y+le,0),this.invoiceDetails.gstamount=Math.round(G.reduce((Y,le)=>Y+le,0)),this.invoiceDetails.discountAmount=O.reduce((Y,le)=>Y+le,0),this.invoiceDetails.taxInvoiceSgst=this.invoiceDetails.same_region?Math.round(this.invoiceDetails.gstamount/2):0,this.invoiceDetails.taxInvoiceCgst=this.invoiceDetails.same_region?Math.round(this.invoiceDetails.gstamount/2):0,this.invoiceDetails.taxInvoiceIgst=this.invoiceDetails.same_region?0:this.invoiceDetails.gstamount}get additionalCharges(){return this.parentInvoiceForm.value.orderDetails.filter(r=>r.price=="").forEach(r=>{r.price=0}),this.parentInvoiceForm.value.orderDetails.map(r=>parseInt(r.price)).reduce((r,c)=>r+c,0)}fileChange(e,o){let r=e.target.files;if(r.length>0)for(let c=0;c<r.length;c++){let g=r[c],h=new FormData;h.append("file",g),h.append("source","invoice"),h.append("source_id",this.invoiceDetails.po_number),console.log(g),this.orderService.FileUpload(h).subscribe(C=>{console.log(C.response.filepath),C.responseCode==200?this.additionalDocs.push({filename:C.response.file_name,drive_path:C.response.fileViewPath,deletable:!0}):this.snackBar.open("One or more file uploads failed!","",{duration:3e3})})}}OnClickDeleteTermsDoc(e){this.additionalDocs=this.additionalDocs.filter(r=>r.drive_path!==e.drive_path);let o=document.getElementById("imgInp_01");o&&(o.value="")}OnClickSendtoBuyer(){if(!this.isSendingToBuyer){if(this.invoiceDetails.grossAmountForShow===0)return this.snackBar.open("Please add items to the invoice","",{duration:3e3});if(this.parentInvoiceForm.get("deliveryDate")?.errors?.pastDate&&console.log("Please fix the expected delivery date!"),this.invoiceDetails.items.filter(e=>e.exceededQtyShow==!0).length>0)this.snackBar.open("One of the product Qty is exceeded Required Qty","",{duration:3e3});else if(this.amountExceeded==!0)this.snackBar.open("Invoice Amount is exceeded","",{duration:3e3});else{let e={};e.invoice_id=""+this.invoiceId,e.invoice_number="",e.type="INVOICE",e.installment_id=""+this.installmentId,e.amount_details=[],e.advance_payment="NO",e.products=[],e.attachments=this.additionalDocs.map(o=>({path:o.drive_path,name:o.filename})),this.parentInvoiceForm.value.orderDetails.filter(o=>o.price>0).length>0?this.parentInvoiceForm.value.orderDetails.forEach(o=>{let r=new Xi;r.amount=o.price,r.description=o.description,e.amount_details.push(r)}):e.amount_details=[],e.invoice_due_days=null,e.logistics=this.invoiceDetails.logisticscharges??0,e.insurance=this.invoiceDetails.insurancecharges??0,e.amount=this.invoiceDetails.grossAmountForShow,e.terms=this.termsandcondtns,this.invoiceDetails.items.forEach(o=>{let r=new en;r.product_id=""+o.item_id,r.quantity=""+o.off_by_chinv,e.products.push(r)}),console.log(e),this.isSendingToBuyer=!0,this.orderService.CreateChildInvoice(e).subscribe({next:o=>{this.isSendingToBuyer=!1,console.log(o.response),o.responseCode==200?(this.dialogRef.close(),this.notificationService.showSuccess(o.response.response),this.GetInvoiceDetails()):this.notificationService.showError(o?.response||"Failed to create the tax invoice.")},error:()=>{this.isSendingToBuyer=!1,this.notificationService.showError("Failed to create the tax invoice.")}})}}}OnClickCloseModel(){this.dialogRef.close()}
1handleRequestPayment(){let e={invoice_id:this.invoiceId,po_id:this.invoiceDetails.po_id,amount:Number(this.requestPayment.amount)||0,note:(this.requestPayment.note||"").trim()};this.orderService.requestPayment(e).subscribe(o=>{if(o.responseCode==200){let r=(typeof o.response=="string"?o.response:o.response?.response||o.response?.message)||"Payment request sent successfully";this.notificationService.showSuccess(r),this.requestPayment.amount="",this.requestPayment.note="",this.GetInvoiceDetails()}else this.notificationService.showError(o?.response||"Failed to request payment. Please try again later.")},o=>{this.notificationService.showError(o?.error?.response||"Failed to request payment. Please try again later.")})}get advanceDetails(){if(this.invoiceDetails&&this.invoiceDetails.receipts){let e=this.invoiceDetails.receipts.filter(o=>o.advance_payment==="yes");if(e.length)return e[0]}return{terms:"Not Available",amount:"0"}}get enableLogisticsCharges(){return this.isLogisticChargesEnabled?!0:!!(this.invoiceDetails&&(!this.invoiceDetails.logisticscharges||this.invoiceDetails.logisticscharges===0))}get enableInsuranceCharges(){return this.isInsuranceChargesEnabled?!0:!!(this.invoiceDetails&&(!this.invoiceDetails.insurancecharges||this.invoiceDetails.insurancecharges===0))}updateCharges(){let e=this.invoiceDetails.items.map(c=>c.gross_amount_For_cal),o=Number(this.invoiceDetails.logisticscharges??0),r=Number(this.invoiceDetails.insurancecharges??0);this.invoiceDetails.grossAmountForShow=e.reduce((c,g)=>c+g,0)+this.additionalCharges+o+r}logisticsFocusOut(){this.updateCharges(),this.isLogisticChargesEnabled=!1}insuranceFocusOut(){this.updateCharges(),this.isInsuranceChargesEnabled=!1}togglePaymentHistory(){this.isPaymentHistoryExpanded=!this.isPaymentHistoryExpanded}printDocument(){this.isPrintLoading=!0,this.orderService.printPdf("PROFORMA_INVOICE",Number(this.invoiceId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de),T(Ae),T(K),T(ft),T(tt),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-parent-invoice"]],decls:280,vars:87,consts:[["plainPoNumber",""],["plainSourceId",""],["dialog",""],["prods",""],["popContent",""],["noFiles",""],["popContent1",""],["qtyWarning",""],["addCharges",""],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngIf"],[1,"mod-card-title","mb-0"],[1,"row","mt-15","mb-30"],[1,"col-md","col-12"],[1,"card","border-0"],[1,"card-body","p-2"],["appTranslate","",1,"fw-600"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["class","col-md-auto col-12 ",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"col-md-6"],[1,"card","h-100"],[1,"card-body"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],["data-toggle","collapse","data-target","#coll__OrderSummary","aria-expanded","false",1,"mod-card-header","border-bottom-0","cardCollapseArrow"],["id","coll__OrderSummary",1,"collapse","show"],[1,"mod-card-body","p-0"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"form-group"],[1,"font-12","text-secondary","mb-2"],[1,"list-inline"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard","h-auto"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"hilight-element"],[1,"card-footer"],["class","card rfqColorLeftBox03",4,"ngIf"],[1,"col-12","text-right","mt-5"],["data-toggle","modal","data-target","#reqPayment__modal","type","button","appTranslate","",1,"mod-btn","mod-btn-outline-primary","mx-2",3,"disabled"],["type","button","class","mod-btn mod-btn-primary mx-2","appTranslate","",3,"click",4,"ngIf"],["data-toggle","modal","data-target","#viewInvs__modal","type","button","class","mod-btn mod-btn-primary mx-2","appTranslate","",4,"ngIf"],["id","reqPayment__modal",1,"modal","fade","reqPayment__modal"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-bottom-0"],["appTranslate","",1,"modal-title","font-16","fw-600"],["type","button","data-dismiss","modal",1,"close"],[1,"modal-body"],[1,"form-group","row"],["appTranslate","",1,"col-sm-2","col-form-label"],[1,"col-sm-10"],["type","number","placeholder","Enter the amount",1,"form-control",3,"ngModelChange","ngModel"],["type","text","placeholder","Enter Note",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-12","text-right"],["data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],["id","viewInvs__modal",1,"modal","fade","viewInvs__modal"],[1,"modal-dialog","modal-dialog-centered","modal-xl"],[1,"modal-body","px-4"],["class","",4,"ngIf"],[1,"z-index-1050"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["type","button",1,"mod-btn-action",3,"click"],["appTranslate","",1,"text-secondary"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"ri-bank-line"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],[1,"text-secondary","mb-1"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],[1,"mod-card-header","border-bottom-0"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["scope","col","appTranslate",""],["class","row w-100",4,"ngIf","ngIfElse"],[1,"row","w-100"],["class","col-auto",4,"ngFor","ngForOf"],[1,"col-auto"],["target","_blank",1,"card",3,"href"],[1,"list-inline","align-items-center","mb-0"],[1,"list-inline-item","theme-color","font-12","fw-600"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["appTranslate","",1,"text-muted","small"],["colspan","2"],["appTranslate","",1,"text-center","mb-0"],["class","col-12 mb-30",4,"ngIf"],["class","col-12 mb-20",4,"ngIf"],[1,"col-12","mb-30"],[1,"card"],["data-toggle","collapse","data-target","#pi__PaymentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","theme-color"],["id","pi__PaymentTerms",1,"collapse","show"],["class","card deposit-card active mb-4",4,"ngFor","ngForOf"],[1,"card","deposit-card","active","mb-4"],[1,"d-flex","justify-content-between","align-items-center"],[1,"deposit-card__left-content"],[1,"title","h6"],[1,"date"],[1,"deposit-card__right-content","align-items-center"],[1,"amount","fw-600","mb-1","text-nowrap"],[1,"note","mt-2","mb-0"],["href","javascript:void(0)","class","text-primary font-12","appTranslate","",3,"click",4,"ngIf"],["href","javascript:void(0)","appTranslate","",1,"text-primary","font-12",3,"click"],[1,"col-12","mb-20"],["data-toggle","collapse","data-target","#pi__ShipmentTerms","aria-expanded","false",1,"card-header","cardCollapseArrow","bg-white"],["id","pi__ShipmentTerms",1,"collapse","show"],["class","shipments-cards card-body",4,"ngFor","ngForOf"],[1,"shipments-cards","card-body"],[1,"shipments-card","active","mb-3"],[1,"shipments-card__left"],[1,"shipment-title"],["class","card shipments-card product-card mb-20",4,"ngFor","ngForOf"],[1,"card","shipments-card","product-card","mb-20"],[1,"card-body","d-flex","justify-content-between","align-items-center"],[1,"title"],[1,"shipments-card__right"],["appTranslate","",1,"qty-label"],[1,"amount"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"],[1,"span__filename",3,"title"],[1,"card","rfqColorLeftBox03"],[1,"card-header"],["data-toggle","collapse","href","#paymentHistory",1,"card-link","collaspsed",3,"click"],[1,"ri-history-fill","mr-1"],[1,"uil","ml-auto"],["
1id","paymentHistory",1,"collapse"],[1,"card-body","pt-0"],[1,"sellerQuotationHistory"],["class","pb-0",4,"ngFor","ngForOf"],[1,"pb-0"],["type","button","appTranslate","",1,"mod-btn","mod-btn-primary","mx-2",3,"click"],["data-toggle","modal","data-target","#viewInvs__modal","type","button","appTranslate","",1,"mod-btn","mod-btn-primary","mx-2"],["appTranslate","",1,"text-center"],[1,"float-right","mb-2"],["type","button","class","mod-btn mod-btn-primary btn-sm mx-2","data-dismiss","modal","appTranslate","",3,"click",4,"ngIf"],[1,"table-dashboard"],[1,"table-responsive"],[1,"table"],["appTranslate","",1,"text-nowrap"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm","mx-2",3,"click"],[3,"ngClass"],[1,"text-right","d-flex","gap-10","flex-nowrap"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm","text-nowrap",3,"click"],[1,"uil","uil-external-link-alt"],["type","button","class","mod-btn mod-btn-primary btn-sm text-nowrap","appTranslate","",3,"disabled","click",4,"ngIf"],["type","button","data-dismiss","modal","class","mod-btn mod-btn-primary btn-sm text-nowrap","appTranslate","",3,"click",4,"ngIf"],["class","d-inline",4,"ngIf"],["type","button","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm","text-nowrap",3,"click","disabled"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm","text-nowrap",3,"click"],[1,"d-inline"],["id","",1,""],[1,"modal-dialog","modal
1-xl","modal-dialog-scrollable","my-0"],[1,"modal-header"],["type","button","data-dismiss","modal",1,"close",3,"click"],[1,"ri-close-large-line"],[1,"container-fluid","px-1"],[1,"col-md-8","col-12","col-xl-9"],[1,"col-md-4","col-12","col-xl-3"],[1,"row","mt-30"],["data-toggle","collapse","data-target","#modalcoll__OrderSummary","aria-expanded","true",1,"card-header","cardCollapseArrow","bg-white"],["appTranslate","",1,"card-link","d-block","fw-600","font-16","text-dark"],["id","modalcoll__OrderSummary",1,"collapse","show"],["id","product_table",1,"table-responsive"],["class","table border",4,"ngIf"],["class","my-3",4,"ngIf"],[3,"ngClass","formGroup","disabled"],["formArrayName","orderDetails"],["class","row ",3,"formGroupName",4,"ngFor","ngForOf"],[1,"col-md-3","col-sm-6","p-0"],["for","","appTranslate",""],["type","date","formControlName","deliveryDate","name","",1,"form-control","form-control-sm",3,"min"],["class","errorClass",4,"ngIf"],[1,"col-md-12","col-lg-8"],["readonly","","rows","5",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],["for","","appTranslate","",1,"fw-600"],[1,"custom-file"],["type","file","multiple","","id","imgInp_01",1,"custom-file-input",3,"change"],["for","imgInp_01","appTranslate","",1,"custom-file-label"],[1,"col-md-8","offset-md-4","col-lg-4","offset-lg-0"],[1,"card","totalCalculationCard"],["class","card-body",4,"ngIf"],[1,"modal-footer"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-soft-primary","btn-sm","mr-2",3,"click"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-primary","btn-sm","modalSubmit__gntInvoiceBtn",3,"click","disabled"],[1,"table","border"],["type","number","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","max-width-70px",3,"ngModelChange","input","max","min","ngModel","disabled","title"],["class","mt-1",4,"ngIf"],[1,"text-nowrap"],[1,"mt-1"],[1,"mb-0"],[1,"my-3"],[1,"col"],["type","button",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-5","form-group"],["rows","1","formControlName","description",1,"form-control","form-control-sm"],["type","number","formControlName","price","min","0",1,"form-control","form-control-sm",3,"keyup"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class"," p-0 btn btn-basic text-theme pay-add-more font-20",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20",3,"click",4,"ngIf"],["type","button",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],[1,"errorClass"],["class","error-field text-danger","appTranslate","",4,"ngIf"],["appTranslate","",1,"error-field","text-danger"],[1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",1,"a__filename",3,"title","href"],["class","ml-auto pl-15 text-danger cursor-p",4,"ngIf"],[1,"ml-auto","pl-15","text-danger","cursor-p"],[1,"uil","uil-times-circle","font-18",3,"click"],["class","bg-transparent text-right editableInputField","type","text","onlyNumbers","","placeholder","Add logistics amount",3,"ngModel","allowDecimals","ngModelChange","focusout",4,"ngIf"],[3,"click",4,"ngIf"],["class","bg-transparent text-right editableInputField","type","text","onlyNumbers","","placeholder","Add insurance amount",3,"ngModel","allowDecimals","ngModelChange","focusout",4,"ngIf"],["class","mb-2",4,"ngIf"],["type","text","onlyNumbers","","placeholder","Add logistics amount",1,"bg-transparent","text-right","editableInputField",3,"ngModelChange","focusout","ngModel","allowDecimals"],[3,"click"],[1,"uil","uil-pen","font-16"],["type","text","onlyNumbers","","placeholder","Add insurance amount",1,"bg-transparent","text-right","editableInputField",3,"ngModelChange","focusout","ngModel","allowDecimals"],["class","text-dark mb-1",4,"ngIf"],[1,"uil","uil-message"],["role","status",1,"spinner-border","spinner-border-sm","mr-1"]],template:function(o,r){if(o&1){let c=I();i(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"h2",14)(6,"a",15),x(7,"i",16),t(),i(8,"span",17),n(9,"Proforma Invoice"),t()()(),i(10,"div",18)(11,"button",19),S("click",function(){return b(c),y(r.printDocument())}),u(12,m8,4,0,"span",20)(13,u8,6,0,"span",20),t()()()(),i(14,"div",11)(15,"div",21)(16,"div",22)(17,"h3",23),n(18,"Proforma Invoice"),t()(),i(19,"div",24)(20,"div",25)(21,"div",26)(22,"div",27),n(23,"Invoice Number"),t(),i(24,"div",28),n(25),t()(),i(26,"div",26)(27,"div",27),n(28,"PO No."),t(),i(29,"div",28),u(30,_8,2,1,"button",29)(31,v8,1,1,"ng-template",null,0,P),t()(),i(33,"div",26)(34,"div",27),n(35,"Source ID"),t(),i(36,"div",28),u(37,g8,2,1,"button",29)(38,f8,1,1,"ng-template",null,1,P),t()(),i(40,"div",26)(41,"div",27),n(42,"Invoice Date"),t(),i(43,"div",28),n(44),_(45,"date"),t()(),i(46,"div",26)(47,"div",27),n(48,"Invoice Due in Day(s)"),t(),i(49,"div",28),n(50),t()(),i(51,"div",26)(52,"div",27),n(53,"Additional Services Documents "),t(),i(54,"div",28),n(55),t()(),i(56,"div",26)(57,"div",27),n(58,"Invoice State/City"),t(),i(59,"div",28),n(60),t()(),u(61,h8,5,1,"div",30),t()()(),i(62,"div",21)(63,"div",22)(64,"h3",31)(65,"span",17),n(66,"Invoice ID:"),t(),n(67),t()(),i(68,"div",24)(69,"div",32)(70,"div",33)(71,"div",34)(72,"div",35)(73,"p",36),n(74,"Shipping From :"),t(),i(75,"p",37)(76,"span",17),n(77,"Seller Name:"),t(),i(78,"span",38),n(79),t()(),i(80,"p",37)(81,"span",17),n(82,"GST No:"),t(),u(83,x8,2,1,"span",39)(84,b8,2,0,"span",40),t(),i(85,"p",37)(86,"span",17),n(87,"Seller Address:"),t(),i(88,"span",38),n(89),t()()()()(),u(90,S8,3,1,"div",41),t()()(),u(91,C8,35,6,"div",42),i(92,"div",21)(93,"div",22)(94,"h3",23),n(95,"Buyer Address"),t()(),i(96,"div",24)(97,"div",10)(98,"div",43)(99,"div",44)(100,"div",45)(101,"p",46),n(102,"Shipping Address : "),t(),u(103,E8,4,1,"p",47),i(104,"p",38),n(105),t()()()(),i(106,"div",43)(107,"div",44)(108,"div",45)(109,"p",46),n(110,"Billing Address : "),t(),u(111,I8,4,1,"p",47),i(112,"p",38),n(113),t(),i(114,"p",37)(115,"span",17),n(116,"GST No:"),t(),u(117,D8,2,1,"span",39)(118,T8,2,0,"span",40),t()()()()()()(),i(119,"div",21)(120,"div",48)(121,"h3",23),n(122," Order Summary "),t()(),i(123,"div",49)(124,"div",50)(125,"div",51)(126,"table",52)(127,"thead",53)(128,"tr")(129,"th",17),n(130," Product Name"),t(),i(131,"th",17),n(132," Product ID"),t(),i(133,"th",17),n(134," Required Qty"),t(),i(135,"th",17),n(136," Quoted"),t(),i(137,"th",17),n(138," Gross Total"),t(),i(139,"th",17),n(140," Discount"),t(),i(141,"th",17),n(142," Tax"),t(),i(143,"th",17),n(144," Total Payable"),t()()(),i(145,"tbody"),u(146,M8,31,20,"tr",54),t()()()()()(),u(147,L8,16,2,"div",42)(148,Y8,8,2,"div",42),i(149,"div",55)(150,"div",56)(151,"div",57)(152,"div",22)(153,"h3",23),n(154,"Terms & Conditions:"),t()(),i(155,"div",24)(156,"div",58)(157,"p",59),n(158),t()(),i(159,"ul",60),u(160,H8,5,3,"li",61),t()()()(),i(161,"div",62)(162,"div",63)(163,"div",45)(164,"ul",64)(165,"li",65)(166,"b",17),n(167,"Gross Total:"),t(),i(168,"span",66),n(169),_(170,"currencyFormat"),t()(),i(171,"li",65)(172,"b",17),n(173,"Discount:"),t(),i(174,"span",67),n(175),_(176,"currencyFormat"),t()(),i(177,"li",65)(178,"b",17),n(179,"Net Total:"),t(),i(180,"span",66),n(181),_(182,"currencyFormat"),t()(),i(183,"li",68)(184,"span",17),n(185,"SGST:"),t(),i(186,"span",66),n(187),_(188,"currencyFormat"),t()(),i(189,"li",68)(190,"span",17),n(191,"CGST:"),t(),i(192,"span",66),n(193),_(194,"currencyFormat"),t()(),i(195,"li",68)(196,"span",17),n(197,"IGST:"),t(),i(198,"span",66),n(199),_(200,"currencyFormat"),t()(),i(201,"li",65)(202,"b",17),n(203,"Total Tax Amount:"),t(),i(204,"span",66),n(205),_(206,"currencyFormat"),t()(),i(207,"li",65)(208,"b",17),n(209,"Logistics:"),t(),i(210,"span",66),n(211),_(212,"currencyFormat"),t()(),i(213,"li",65)(214,"b",17),n(215,"Insurance:"),t(),i(216,"span",66),n(217),_(218,"currencyFormat"),t()(),i(219,"li",65)(220,"b",17),n(221,"Total Payable Amou
1nt:"),t(),i(222,"span",66),n(223),_(224,"currencyFormat"),t()(),i(225,"li",69)(226,"b",17),n(227,"Remaining Amount:"),t(),i(228,"span",66),n(229),_(230,"currencyFormat"),t()()()(),i(231,"div",70)(232,"span",17),n(233,"Balance Payable Amount:"),t(),i(234,"span",66),n(235),_(236,"currencyFormat"),t()()(),u(237,Z8,11,6,"div",71),t()(),i(238,"div",10)(239,"div",72)(240,"button",73),n(241," Request Payment "),t(),u(242,J8,2,0,"button",74)(243,X8,2,0,"button",75),t()()()(),i(244,"div",76)(245,"div",77)(246,"div",78)(247,"div",79)(248,"h4",80),n(249,"Request Payment"),t(),i(250,"button",81),n(251,"\xD7"),t()(),i(252,"div",82)(253,"div",83)(254,"label",84),n(255,"Amount"),t(),i(256,"div",85)(257,"input",86),ve("ngModelChange",function(h){return b(c),_e(r.requestPayment.amount,h)||(r.requestPayment.amount=h),y(h)}),t()()(),i(258,"div",83)(259,"label",84),n(260,"Note"),t(),i(261,"div",85)(262,"textarea",87),ve("ngModelChange",function(h){return b(c),_e(r.requestPayment.note,h)||(r.requestPayment.note=h),y(h)}),t()()(),i(263,"div",10)(264,"div",88)(265,"button",89),S("click",function(){return b(c),y(r.handleRequestPayment())}),n(266,"Request"),t()()()()()()(),i(267,"div",90)(268,"div",91)(269,"div",78)(270,"div",79)(271,"h4",80),n(272,"Tax Invoices"),t(),i(273,"button",81),n(274,"\xD7"),t()(),i(275,"div",92),u(276,e9,3,0,"div",93)(277,c9,22,2,"div",93),t()()()(),u(278,W9,111,37,"ng-template",94,2,P),t()}if(o&2){let c=w(32),g=w(39);l(11),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(12),f(r.invoiceDetails==null?null:r.invoiceDetails.invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",c),l(7),s("ngIf",r.canOpenSource)("ngIfElse",g),l(7),m("",U(45,60,r.invoiceDetails==null?null:r.invoiceDetails.proforma_created_date,"dd-MM-yyyy")," "),l(6),f(r.invoiceDetails!=null&&r.invoiceDetails.invoice_due_days?r.invoiceDetails==null?null:r.invoiceDetails.invoice_due_days:"-"),l(5),m("",r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required," "),l(5),f(r.shippingAddrdres==null?null:r.shippingAddrdres.region),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.source)==="rfq"),l(6),m(" ",r.invoiceDetails==null?null:r.invoiceDetails.invoice_id," "),l(12),f(r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.firstname),l(4),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.seller_details==null?null:r.invoiceDetails.seller_details.gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.seller_details.gst)),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.payment_mode)!=="Cash"&&((r.invoiceDetails==null?null:r.invoiceDetails.bank_name)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_number)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_ifsc))),l(12),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(6),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.
1invoiceDetails.buyerCompanyDetails.gst),l(),s("ngIf",!(!(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null)&&r.invoiceDetails.buyerCompanyDetails.gst)),l(28),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.items),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required)=="yes"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.multiple_payment_terms)==="YES"||(r.invoiceDetails==null?null:r.invoiceDetails.multiple_shipment_terms)==="YES"),l(10),m(" ",r.invoiceDetails!=null&&r.invoiceDetails.terms?r.invoiceDetails.terms:"No Terms Provided.",""),l(2),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.detail_seller_terms_and_conditions_path),l(9),m(" ",v(170,63,r.invoiceDetails==null?null:r.invoiceDetails.gross),""),l(6),m("(-) ",v(176,65,r.invoiceDetails==null?null:r.invoiceDetails.discount_amount),""),l(6),m(" ",v(182,67,r.invoiceDetails==null?null:r.invoiceDetails.net_charges),""),l(6),m(" ",v(188,69,r.invoiceDetails==null?null:r.invoiceDetails.sgst),""),l(6),m(" ",v(194,71,r.invoiceDetails==null?null:r.invoiceDetails.cgst),""),l(6),m(" ",v(200,73,r.invoiceDetails==null?null:r.invoiceDetails.igst),""),l(6),m(" ",v(206,75,r.invoiceDetails==null?null:r.invoiceDetails.gst_amount),""),l(6),m(" ",v(212,77,r.invoiceDetails==null?null:r.invoiceDetails.logistics_charges),""),l(6),m(" ",v(218,79,r.invoiceDetails==null?null:r.invoiceDetails.insurance_charges),""),l(6),m(" ",v(224,81,r.invoiceDetails==null?null:r.invoiceDetails.total_amount),""),l(6),m(" ",v(230,83,r.invoiceDetails==null?null:r.invoiceDetails.balance_amount),""),l(6),m(" ",v(236,85,r.invoiceDetails==null?null:r.invoiceDetails.balance_amount),""),l(2),s("ngIf",r.paymentHistory==null?null:r.paymentHistory.length),l(3),s("disabled",r.isFullyPaid),l(2),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.invoices.length)===0&&!r.isAuctionEA),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.invoices.length)>0),l(14),ue("ngModel",r.requestPayment.amount),l(5),ue("ngModel",r.requestPayment.note),l(14),s("ngIf",(r.invoiceDetails==null||r.invoiceDetails.invoices==null?null:r.invoiceDetails.invoices.length)===0),l(),s("ngIf",r.invoiceDetails==null||r.invoiceDetails.invoices==null?null:r.invoiceDetails.invoices.length)}},dependencies:[rt,nt,J,W,Ne,at,Pe,Ie,gt,Un,Pt,dt,Se,Z,L,ut,We,Qe,yt,St,st,Yi,ae],styles:['.pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--theme-blue)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--theme-blue);border-color:var(--theme-blue);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative} .mat-dialog-container{overflow-y:scroll!important;height:700px!important}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.disableClass[_ngcontent-%COMP%]{top:0;left:0;width:100%;background-color:#fff;opacity:.55;z-index:999;cursor:not-allowed}.blur[_ngcontent-%COMP%] .blurCard[_ngcontent-%COMP%]:before{content:"";cursor:not-allowed}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--theme-blue)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--theme-blue);border-color:var(--theme-blue);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--theme-blue)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--theme-blue)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--theme-blue);border-color:var(--theme-blue)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--theme-blue);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--theme-blue);color:#fff}
1.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--theme-blue)} .mat-dialog-container{padding:0!important}.hilight-element[_ngcontent-%COMP%]{margin:0 -10px;padding:10px;border:dashed 1px var(--theme-sub-prime);background:var(--theme-bg-light3);border-radius:5px}.width-100px[_ngcontent-%COMP%]{width:100px}.width-69px[_ngcontent-%COMP%]{width:69px}.width-80px[_ngcontent-%COMP%]{width:80px}.max-width-70px[_ngcontent-%COMP%]{max-width:70px}.max-width-200px[_ngcontent-%COMP%]{max-width:200px}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.span__filename[_ngcontent-%COMP%], .a__filename[_ngcontent-%COMP%]{max-width:150px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.z-index-1050[_ngcontent-%COMP%]{z-index:1050}.overflow-x-hidden-i[_ngcontent-%COMP%]{overflow-x:hidden!important}.break-after-page[_ngcontent-%COMP%]{break-after:page}.editableInputField[_ngcontent-%COMP%]{border-bottom:green 1px dashed;border-left:0px;border-right:0px;border-top:0px}.editableInputField[_ngcontent-%COMP%]:focus, .editableInputField[_ngcontent-%COMP%]:active, .editableInputField[_ngcontent-%COMP%]:hover{border-bottom:green 2px solid;outline:none;box-shadow:none}.rfqColorLeftBox03[_ngcontent-%COMP%]{margin-top:30px;background-color:var(--theme-bg-light3);margin-bottom:30px;border:1px solid var(--mod-border);border-radius:var(--mod-radius-lg);box-shadow:var(--mod-shadow-sm);min-width:0;transition:box-shadow var(--mod-transition)}.rfqColorLeftBox03[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{background-color:transparent;border-bottom:0;padding:0}.rfqColorLeftBox03[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--theme-green);font-weight:600;padding:1.25rem;display:flex;align-items:center;gap:6px}.rfqColorLeftBox03[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%] span.uil[_ngcontent-%COMP%]{transform:none;font-size:1.5rem;line-height:1}.deposit-card[_ngcontent-%COMP%]{background:#f5f5f5}.deposit-card[_ngcontent-%COMP%] .short-note[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.deposit-card__left-content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.deposit-card__left-content[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:13px;color:#777}.deposit-card__right-content[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0;color:#000}.deposit-card.active[_ngcontent-%COMP%]{background:#fff;border-color:#dcdcdc;box-shadow:0 2px 6px #00000014}.shipments-card__left[_ngcontent-%COMP%] .shipment-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:4px;color:#000}.shipments-card__left[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{font-size:12px;color:#777}.shipments-card__right[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:0}.shipments-card__right[_ngcontent-%COMP%] .qty-label[_ngcontent-%COMP%]{font-size:12px;color:#777;display:block}.shipments-card.product-card[_ngcontent-%COMP%]{background:#f6f6f6}.sellerQuotationHistory[_ngcontent-%COMP%]{list-style:none;padding-left:8px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{position:relative;padding-left:12px;padding-bottom:20px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:not(:last-child){border-left:1px dashed var(--seller-green)}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:first-child:before{transition:all ease-in-out 1s;outline:1px solid rgba(29,55,93,.13);animation:_ngcontent-%COMP%_pluse01 1s linear infinite alternate;border:1px solid rgba(29,55,93,.33)}@keyframes _ngcontent-%COMP%_pluse01{0%{outline-width:1px;border-width:1px}to{outline-width:8px;border-width:5px}}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{content:"";top:0;left:0;transform:translate(-50%);position:absolute;width:11px;height:11px;border-radius:50%;background-color:var(--seller-green)}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{font-weight:400;color:#707070;font-size:13px;display:block;position:relative;top:-5px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{color:var(--seller-green);font-weight:600;margin-bottom:4px}.sellerQuotationHistory[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--seller-green);margin-bottom:0;font-size:12px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}']})}}return a})();function Q9(a,d){a&1&&(i(0,"span"),x(1,"i",60),i(2,"span",14),n(3,"Print"),t()())}
1function Y9(a,d){a&1&&(i(0,"span")(1,"div",61)(2,"span",62),n(3,"Loading..."),t()(),i(4,"span",14),n(5,"Printing..."),t()())}function H9(a,d){if(a&1){let e=I();i(0,"button",63),S("click",function(){b(e);let r=p();return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function K9(a,d){if(a&1&&n(0),a&2){let e=p();f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function Z9(a,d){if(a&1){let e=I();i(0,"button",63),S("click",function(){b(e);let r=p();return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p();l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function J9(a,d){if(a&1&&n(0),a&2){let e=p();f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function X9(a,d){if(a&1&&(i(0,"span",31),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.seller_gst)}}function eO(a,d){a&1&&(i(0,"span",64),n(1,"Not Available"),t())}function tO(a,d){if(a&1&&x(0,"img",68),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function iO(a,d){if(a&1&&(i(0,"div",65)(1,"div",66),u(2,tO,1,1,"img",67),t()()),a&2){let e=p();l(2),s("ngIf",e.invoiceDetails&&e.invoiceDetails.seller_details&&e.invoiceDetails.seller_details.company_logoViewPath)}}function nO(a,d){if(a&1&&(i(0,"p",69)(1,"span",29),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function aO(a,d){if(a&1&&(i(0,"p",69)(1,"span",29),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function rO(a,d){if(a&1&&(i(0,"span",31),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.buyer_gst)}}function lO(a,d){a&1&&(i(0,"span",64),n(1,"Not Available"),t())}function oO(a,d){if(a&1&&(F(0),i(1,"div",78),n(2),t(),i(3,"p",79),n(4),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),m(" ",e.short_description," ")}}function sO(a,d){if(a&1&&(F(0,80),i(1,"div",78)(2,"div",78)(3,"div")(4,"p",81)(5,"span",14),n(6,"Gross Total:"),t(),n(7),_(8,"currencyFormat"),t(),i(9,"p",81)(10,"span",14),n(11,"Discount:"),t(),n(12),_(13,"currencyFormat"),t(),i(14,"p",81)(15,"span",14),n(16,"Net Total:"),t(),n(17),_(18,"currencyFormat"),t(),i(19,"p",81),n(20),_(21,"currencyFormat"),t(),i(22,"p",81),n(23),_(24,"currencyFormat"),t(),i(25,"p",81),n(26),_(27,"currencyFormat"),t(),i(28,"p",81),n(29),_(30,"currencyFormat"),t(),x(31,"div",82),i(32,"p",69)(33,"b")(34,"span",14),n(35,"Total :"),t(),n(36),_(37,"currencyFormat"),t()()()()(),M()),a&2){let e=p().$implicit;l(7),m(" ",v(8,12,e.gross_total)," "),l(5),m(" ",v(13,14,e.discount)," "),l(5),m(" ",v(18,16,e.net_amount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(21,18,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(24,20,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(27,22,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(30,24,e.igst),""),l(7),m(" ",v(37,26,e.total_amount)," ")}}function dO(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",74),n(3),t(),u(4,oO,5,2,"ng-template",null,2,P),x(6,"i",75),i(7,"p",76)(8,"small")(9,"span",14),n(10,"SKU ID:"),t(),n(11),t()()(),i(12,"td",77),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),_(18,"currencyFormat"),i(19,"small"),n(20,"/unit"),t()(),i(21,"td"),n(22),_(23,"currencyFormat"),t(),i(24,"td"),n(25),_(26,"currencyFormat"),t(),i(27,"td"),n(28),_(29,"currencyFormat"),t(),i(30,"td"),n(31),_(32,"currencyFormat"),u(33,sO,38,28,"ng-template",null,3,P),x(35,"i",75),t()()),a&2){let e=d.$implicit,o=w(5),r=w(34);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(5),m(" ",e.display_item_id,""),l(2),f(e.display_item_id),l(2),m("",e.required_qty," "),l(2),m("",v(18,11,e.unit_price)," "),l(5),f(v(23,13,e.discount)),l(3),f(v(26,15,e.gross_total)),l(3),f(v(29,17,e.gst)),l(3),m(" ",v(32,19,e.total_amount)," "),l(4),s("ngbPopover",r)}}function cO(a,d){if(a&1&&(i(0,"tr")(1,"td",83)(2,"span",14),n(3,"Additional Charge:"),t(),n(4,"\xA0"),i(5,"b"),n(6),t()(),i(7,"td",84)(8,"span",14),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(6),f(e.description),l(5),f(v(12,2,e.amount))}}function pO(a,d){if(a&1&&(i(0,"table",70)(1,"thead",71)(2,"tr")(3,"th",72),n(4," Product Name"),t(),i(5,"th",72),n(6," Product ID"),t(),i(7,"th",72),n(8," Quantity"),t(),i(9,"th",72),n(10,"Quoted"),t(),i(11,"th",72),n(12," Discount"),t(),i(13,"th",72),n(14," Gross Total"),t(),i(15,"th",72),n(16," Tax"),t(),i(17,"th",72),n(18," Total "),t()()(),i(19,"tbody"),u(20,dO,36,21,"tr",73)(21,cO,13,4,"tr",73),t()()),a&2){let e=p();l(20),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.items),l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function mO(a,d){a&1&&(i(0,"li",85)(1,"p",64),n(2,"No attachments available"),t()())}function uO(a,d){if(a&1&&(i(0,"li",85)(1,"a",86),x(2,"i",87),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.document_ViewPath||e.fileViewPath||e.viewPath||e.path,q),l(2),m(" ",e.filename," ")}}function _O(a,d){if(a&1&&(i(0,"li",89)(1,"b",14),n(2,"Logistics:"),t(),i(3,"span",56),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(2);l(4),m(" ",v(5,1,e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges),"")}}function vO(a,d){if(a&1&&(i(0,"li",89)(1,"b",14),n(2,"Insurance:"),t(),i(3,"span",56),n(4),_(5,"currencyFormat"),t()()),a&2){let e=p(2);l(4),m(" ",v(5,1,e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges),"")}}function gO(a,d){if(a&1&&(i(0,"p",81)(1,"span"),n(2),_(3,"currencyFormat"),t()()),a&2){let e=p().$implicit;
1l(2),D("",e.description,": ",v(3,2,e.amount),"")}}function fO(a,d){if(a&1&&(F(0),u(1,gO,4,4,"p",94),M()),a&2){let e=d.$implicit;l(),s("ngIf",e.description)}}function hO(a,d){if(a&1&&(F(0),i(1,"div",78)(2,"div"),u(3,fO,2,1,"ng-container",73),x(4,"div",82),i(5,"p",69)(6,"b")(7,"span",14),n(8,"Total Additional Charges:"),t(),n(9),_(10,"currencyFormat"),t()()()(),M()),a&2){let e=p(2);l(3),s("ngForOf",!(e.invoiceDetails==null||e.invoiceDetails.additional_charges==null)&&e.invoiceDetails.additional_charges.length?e.invoiceDetails==null?null:e.invoiceDetails.additional_charges:e.invoiceDetails==null?null:e.invoiceDetails.amount_splits),l(6),m(" ",v(10,2,e.additionalCharges)," ")}}function xO(a,d){if(a&1){let e=I();i(0,"i",95,5),S("mouseenter",function(){b(e);let r=w(1),c=p(2);return y(c.toggleWithGreeting(r))})("mouseleave",function(){b(e);let r=w(1),c=p(2);return y(c.toggleWithGreeting(r))}),t()}if(a&2){p();let e=w(49);s("ngbPopover",e)}}function bO(a,d){if(a&1&&(i(0,"ul",88)(1,"li",89)(2,"b",14),n(3,"Gross Total:"),t(),i(4,"span",56),n(5),_(6,"currencyFormat"),t()(),i(7,"li",89)(8,"b",14),n(9,"Discount:"),t(),i(10,"span",90),n(11),_(12,"currencyFormat"),t()(),i(13,"li",89)(14,"b",14),n(15,"Net Amount:"),t(),i(16,"span",56),n(17),_(18,"currencyFormat"),t()(),i(19,"li",91)(20,"span",14),n(21,"SGST:"),t(),i(22,"span",56),n(23),_(24,"currencyFormat"),t()(),i(25,"li",91)(26,"span",14),n(27,"CGST:"),t(),i(28,"span",56),n(29),_(30,"currencyFormat"),t()(),i(31,"li",91)(32,"span",14),n(33,"IGST: "),t(),i(34,"span",56),n(35),_(36,"currencyFormat"),t()(),i(37,"li",89)(38,"b",14),n(39,"Total Tax Amount:"),t(),i(40,"span",56),n(41),_(42,"currencyFormat"),t()(),u(43,_O,6,3,"li",92)(44,vO,6,3,"li",92),i(45,"li")(46,"b",14),n(47,"Additional Charges:"),t(),u(48,hO,11,4,"ng-template",null,4,P)(50,xO,2,1,"i",93),i(51,"span",56),n(52),_(53,"currencyFormat"),t()()()),a&2){let e=p();l(5),m(" ",v(6,11,e.invoiceDetails==null?null:e.invoiceDetails.gross),""),l(6),m("(-) ",v(12,13,e.invoiceDetails==null?null:e.invoiceDetails.discount_amount),""),l(6),m(" ",v(18,15,e.invoiceDetails==null?null:e.invoiceDetails.net_charges)," "),l(6),m(" ",v(24,17,e.invoiceDetails==null?null:e.invoiceDetails.sgst),""),l(6),m(" ",v(30,19,e.invoiceDetails==null?null:e.invoiceDetails.cgst),""),l(6),m(" ",v(36,21,e.invoiceDetails==null?null:e.invoiceDetails.igst),""),l(6),m(" ",v(42,23,e.invoiceDetails==null?null:e.invoiceDetails.gst_amount),""),l(2),s("ngIf",+(e.invoiceDetails==null?null:e.invoiceDetails.logistics_charges)>0),l(),s("ngIf",+(e.invoiceDetails==null?null:e.invoiceDetails.insurance_charges)>0),l(6),s("ngIf",(e.invoiceDetails==null||e.invoiceDetails.additional_charges==null?null:e.invoiceDetails.additional_charges.length)>0||(e.invoiceDetails==null||e.invoiceDetails.amount_splits==null?null:e.invoiceDetails.amount_splits.length)>0),l(2),m(" ",v(53,25,e.additionalCharges),"")}}function yO(a,d){if(a&1){let e=I();i(0,"button",96),S("click",function(){b(e);let r=p();return y(r.sendToQA())}),n(1," Send to QA "),t()}if(a&2){let e=p();s("disabled",(e.invoiceDetails==null?null:e.invoiceDetails.qaSent)||e.isQaPending(e.invoiceDetails))}}function SO(a,d){if(a&1){let e=I();i(0,"button",97),S("click",function(){b(e);let r=p();return y(r.createasn(r.invoiceId))}),n(1," Create ASN "),t()}}function CO(a,d){if(a&1){let e=I();i(0,"button",97),S("click",function(){b(e);let r=p();return y(r.createsrn(r.invoiceId))}),n(1," Create SR "),t()}}var Xa=(()=>{class a{constructor(e,o,r,c){this.activatedRoute=e,this.financeOrderService=o,this.router=r,this.notificationService=c,this.isPrintLoading=!1;let g=new Date;this.todayDate=g.toISOString().slice(0,10)}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}openPathInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openPathInNewTab("/rfq/sellers/rfq-details/"+o):e==="auction"&&this.openPathInNewTab("/auction/seller-auction-detail
1s/"+(this.invoiceDetails?.source_main_id||o)))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openPathInNewTab("/finance-management/receivable-purchase-orders/seller-view?id="+this.invoiceDetails.po_id)}ngOnInit(){less.modifyVars({"@theme":"#024A2F"}),this.activatedRoute.queryParams.subscribe(e=>{this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.GetInvoiceDetails()})}GetInvoiceDetails(){let e=new Vt;e.invoice_id=this.invoiceId,e.invoice_type=this.invoiceType,this.financeOrderService.GetTaxInvoiceDetails(e).subscribe(o=>{this.invoiceDetails=o.response.data,this.invoiceDetails.buyer_address.filter(r=>r.addressType=="billing").forEach(r=>this.billingAddres=r),this.invoiceDetails.buyer_address.filter(r=>r.addressType=="shipping").forEach(r=>this.shippingAddrdres=r)})}isQaPending(e){let o=(e?.buyer_status??"").toString().trim().toLowerCase();return o==="qa pending"||o==="qa_pending"}isQaCompleted(e){let o=(e?.buyer_status??"").toString().trim().toLowerCase();return o==="qa completed"||o==="qa_completed"}get isWorkOrder(){return String(this.invoiceDetails?.order_type||"").toUpperCase()==="WO"}createasn(e){this.router.navigate(["shipments/outbound-asn/create-asn/"+e])}createsrn(e){this.router.navigate(["shipments/outbound-asn/service-report/"+e])}sendToQA(){let e=this.invoiceDetails;if(!e||e.qaSent||this.isQaPending(e))return;let r=(e?.items||[]).map(h=>({product_id:Number(h.item_id??h.product_id),product_name:h.product_name,total_quantity:Number(h.offered_qty??h.required_qty??0)})),c=r.reduce((h,C)=>h+(C.total_quantity||0),0),g={record_type:"QA",grn_id:"",po_id:e?.po_id??null,invoice_id:e?.proforma_invoice_main_id??e?.proforma_invoice_id??null,tax_invoice_id:Number(this.invoiceId)||e?.invoice_id||null,assignee_id:null,source:e?.source??null,source_id:e?.po_id??null,received_date:this.todayDate,total_items:r.length,total_quantity:c,products:r};this.financeOrderService.createQaQc(g).subscribe({next:h=>{h.responseCode===200?(e.qaSent=!0,this.notificationService.showSuccess(h.response?.response||"Sent to QA successfully")):this.notificationService.showError("Something went wrong!")},error:()=>this.notificationService.showError("Something went wrong!")})}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}get additionalCharges(){let e=Array.isArray(this.invoiceDetails?.additional_charges)&&this.invoiceDetails.additional_charges.length?this.invoiceDetails.additional_charges:this.invoiceDetails?.amount_splits;return Array.isArray(e)?e.reduce((o,r)=>o+(parseInt(r?.amount)||0),0):0}printDocument(){this.isPrintLoading=!0,this.financeOrderService.printPdf("TAX_INVOICE",Number(this.invoiceId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(de),T(z),T(K),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-view-seller-invoice"]],decls:131,vars:40,consts:[["plainPoNumber",""],["plainSourceId",""],["prods",""],["popContent",""],["addCharges",""],["p3","ngbPopover"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"mod-meta-grid"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],[1,"mod-card-title","mb-0"],[1,"col-md","col-12"],["appTranslate","",1,"fw-600"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["class","col-md-auto col-12 ",4,"ngIf"],[1,"col-md-6"],[1,"card","h-100"],[1,"card-body"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["class","table mod-table",4,"ngIf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"font-12","text-secondary","mb-2"],[1,"form-group","mb-0","mt-3"],[1,"list-inline"],["class","list-inline-item",4,"ngIf"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],["class","list-unstyled mb-0",4,"ngIf"],[1,"card-footer"],[1,"float-right"],[1,"col-12","text-right","mt-5"],["type","button","class","mod-btn mod-btn-primary mx-2","appTranslate","",3,"disabled","click",4,"ngIf"],["type","button","class","mod-btn mod-btn-primary mx-2","appTranslate","",3,"click",4,"ngIf"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["type","button",1,"mod-btn-action",3,"click"],["appTranslate","",1,"text-secondary"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"text-secondary","mb-1"],[1,"table","mod-table"],[1,""],["appTranslate","",1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"mb-0"],[1,"product-id-cell"],[1,"newClass"],[1,"text-secondary","font-12"],[1,"ml-n-75px"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","6"],["colspan","2",1,"cell-300"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","border-style-dotted-i","theme-color",3,"href"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],["class","mb-2",4,"ngIf"],["class","uil uil-info-circle","placement","left","triggers","manual",3,"ngbPopover","mouseenter","mouseleave",4,"ngIf"],["class","text-dark mb-1",4,"ngIf"],["placement","left","triggers","manual",1,"uil","uil-info-circle",3,"mouseenter","mouseleave","ngbPopover"],["type","button","appTranslate","",1,"mod-btn","mod-btn-primary","mx-2",3,"click","disabled"],["type","button","appTranslate","",1,"mod-btn","mod-btn-primary","mx-2",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",10)(5,"h2",11)(6,"a",12),x(7,"i",13),t(),i(8,"span",14),n(9,"Tax Invoice"),t()()(),i(10,"div",15)(11,"button",16),S("click",function(){return b(c),y(r.printDocument())}),u(12,Q9,4,0,"span",17)(13,Y9,6,0,"span",17),t()()()(),i(14,"div",8)(15,"div",18)(16,"div",19)(17,"h3",20),n(18,"Invoice Details"),t()(),i(19,"div",21)(20,"div",22)(21,"div",23)(22,"div",24),n(23,"Proforma Invoice Number"),t(),i(24,"div",25),n(25),t()(),i(26,"div",23)(27,"div",24),n(28,"PO No."),t(),i(29,"div",25),u(30,H9,2,1,"button",26)(31,K9,1,1,"ng-template",null,0,P),t()(),i(33,"div",23)(34,"div",24),n(35,"Source ID"),t(),i(36,"div",25),u(37,Z9,2,1,"button",26)(38,J9,1,1,"ng-template",null,1,P),t()()()()(),i(40,"div",18)(41,"div",19)(42,"h3",27)(43,"span",14),n(44,"Tax Invoice ID:"),t(),n(45),t()(),i(46,"div",21)(47,"div",7)(48,"div",28)(49,"p",29),n(50,"Shipping From :"),t(),i(51,"p",30)(52,"span",14),n(53,"Seller Name:"),t(),i(54,"span",31),n(55),t()(),i(56,"p",30)(57,"span",14),n(58,"GST No:"),t(),u(59,X9,2,1,"span",32)(60,eO,2,0,"span",33),t(),i(61,"p",30)(62,"span",14),n(63,"Seller Address:"),t(),i(64,"span",31),n(65),t()()(),u(66,iO,3,1,"div",34),t()()(),i(67,"div",18)(68,"div",19)(69,"h3",20),n(70,"Buyer Address"),t()(),i(71,"div",21)(72,"div",7)(73,"div",35)(74,"div",36)(75,"div",37)(76,"p",38),n(77,"Shipping Address : "),t(),u(78,nO,4,1,"p",39),i(79,"p",31),n(80),t()()()(),i(81,"div",35)(82,"div",36)(83,"div",37)(84,"p",38),n(85,"Billing Address : "),t(),u(86,aO,4,1,"p",39),i(87,"p",31),n(88),t(),i(89,"p",30)(90,"span",14),n(91,"GST No:"),t(),u(92,rO,2,1,"span",32)(93,lO,2,0,"span",33),t()()()()()()(),i(94,"div",18)(95,"div",40)(96,"h3",20),n(97,"Order Summary"),t()(),i(98,"div",41)(99,"div",42),u(100,pO,22,2,"table",43),t()()(),i(101,"div",44)(102,"div",45)(103,"div",46)(104,"div",19)(105,"h3",20),n(106,"Terms And Conditions"),t()(),i(107,"div",21)(108,"p",47),n(109),t(),i(110,"div",48)(111,"label",29),n(112,"Attachments"),t(),i(113,"ul",49),u(114,mO,3,0,"li",50)(115,uO,4,2,"li",51),t()()()()(),i(116,"div",52)(117,"div",53)(118,"div",37),u(119,bO,54,27,"ul",54),t(),i(120,"div",55)(121,"span",14),n(122,"Total Payable Amou
1nt:"),t(),i(123,"span",56),n(124),_(125,"currencyFormat"),t()()()()(),i(126,"div",7)(127,"div",57),u(128,yO,2,1,"button",58)(129,SO,2,0,"button",59)(130,CO,2,0,"button",59),t()()()()()}if(o&2){let c=w(32),g=w(39);l(11),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(12),f(r.invoiceDetails==null?null:r.invoiceDetails.parent_display_invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",c),l(7),s("ngIf",r.canOpenSource)("ngIfElse",g),l(8),m(" ",r.invoiceDetails==null?null:r.invoiceDetails.invoice_id," "),l(10),f(r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.firstname),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.seller_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.seller_gst)),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(12),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(6),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.buyer_gst),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.buyer_gst)),l(7),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.items.length)!==0),l(9),m(" ",r.invoiceDetails!=null&&r.invoiceDetails.terms?r.invoiceDetails.terms:"No terms provided"," "),l(5),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.attachments)||(r.invoiceDetails==null?null:r.invoiceDetails.attachments.length)===0),l(),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.attachments),l(4),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.items.length)!==0),l(5),f(v(125,38,r.invoiceDetails==null?null:r.invoiceDetails.total_amount)),l(4),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.asn_id)&&(r.invoiceDetails==null?null:r.invoiceDetails.is_qa_required)==="YES"&&!r.isQaCompleted(r.invoiceDetails)),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.asn_id)&&((r.invoiceDetails==null?null:r.invoiceDetails.is_qa_required)!=="YES"||r.isQaCompleted(r.invoiceDetails))&&!r.isWorkOrder),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.asn_id)&&((r.invoiceDetails==null?null:r.invoiceDetails.is_qa_required)!=="YES"||r.isQaCompleted(r.invoiceDetails))&&r.isWorkOrder)}},dependencies:[J,W,Se,Z,L,ae],styles:["td.semi-supplier[_ngcontent-%COMP%] span[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{position:absolute;right:0;top:10px;font-size:16px;cursor:pointer}td.semi-supplier[_ngcontent-%COMP%], td.semi-remove[_ngcontent-%COMP%]{padding-right:20px;padding-left:5px;position:relative}td.semi-supplier[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:14px}tr.semi-theadtr[_ngcontent-%COMP%]{background:#f7f7f7}.pagination.theme-color[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--theme-blue)}.pagination.theme-color[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:var(--theme-blue);border-color:var(--theme-blue);color:#fff}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}
1.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--theme-blue)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--theme-blue)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--theme-blue);border-color:var(--theme-blue);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--theme-blue)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--theme-blue)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--theme-blue);border-color:var(--theme-blue)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--theme-blue);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--theme-blue);color:#fff}.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--theme-blue)} .mat-dialog-container{padding:0!important}.hilight-element[_ngcontent-%COMP%]{margin:0 -10px;padding:10px;border:dashed 1px #6bbb9d;background:#edfff8;border-radius:5px}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.non-i-d-none[_ngcontent-%COMP%]{display:none}.h-100-non-i[_ngcontent-%COMP%]{height:100%}.break-after-page[_ngcontent-%COMP%]{break-after:page}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();function EO(a,d){a&1&&(i(0,"span"),x(1,"i",71),i(2,"span",14),n(3,"Print"),t()())}function IO(a,d){a&1&&(i(0,"span")(1,"div",72)(2,"span",73),n(3,"Loading..."),t()(),i(4,"span",14),n(5,"Printing..."),t()())}function DO(a,d){if(a&1&&(i(0,"span",35),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.seller_details==null?null:e.invoiceDetails.seller_details.gst)}}function TO(a,d){a&1&&(i(0,"span",74),n(1,"Not Available"),t())}function wO(a,d){if(a&1&&x(0,"img",78),a&2){let e=p(2);s("src",e.invoiceDetails.seller_details.company_logoViewPath,q)}}function PO(a,d){if(a&1&&(i(0,"div",75)(1,"div",76),u(2,wO,1,1,"img",77),t()()),a&2){let e=p();l(2),s("ngIf",e.invoiceDetails&&e.invoiceDetails.seller_details&&e.invoiceDetails.seller_details.company_logoViewPath)}}function OO(a,d){if(a&1&&(i(0,"div",18)(1,"div",19)(2,"h3",30),n(3,"Company Bank Details"),t()(),i(4,"div",21)(5,"div",79)(6,"div",80)(7,"span",81),x(8,"i",82),t(),i(9,"div",83)(10,"h4",84),n(11),t(),i(12,"span",85),n(13),t()()(),i(14,"div",86)(15,"div",87)(16,"span",88),n(17,"Account Holder"),t(),i(18,"span",89),n(19),t()(),i(20,"div",87)(21,"span",88),n(22,"Account Number"),t(),i(23,"span",89),n(24),t()(),i(25,"div",87)(26,"span",88),n(27,"IFSC Code"),t(),i(28,"span",89),n(29),t()(),i(30,"div",87)(31,"span",88),n(32,"Branch"),t(),i(33,"span",89),n(34),t()()()()()()),a&2){let e=p();l(11),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_name),l(2),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch),l(6),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_name),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_number),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_account_ifsc),l(5),f(e.invoiceDetails==null?null:e.invoiceDetails.bank_branch)}}function kO(a,d){if(a&1){let e=I();i(0,"button",90),S("click",function(){b(e);let r=p();return y(r.onPoNumberClick())}),n(1),t()}if(a&2){let e=p();l(),f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function FO(a,d){if(a&1&&n(0),a&2){let e=p();f(e.invoiceDetails==null?null:e.invoiceDetails.po_number)}}function MO(a,d){if(a&1){let e=I();i(0,"button",90),S("click",function(){b(e);let r=p();return y(r.onSourceIdClick())}),n(1),t()}if(a&2){let e=p();l(),f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function AO(a,d){if(a&1&&n(0),a&2){let e=p();f((e.invoiceDetails==null?null:e.invoiceDetails.display_source_id)||(e.invoiceDetails==null?null:e.invoiceDetails.source_id)||"--")}}function NO(a,d){if(a&1&&(i(0,"div",41)(1,"div",42),n(2," Additional Services Documents "),t(),i(3,"div",43),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.service_documents_required," ")}}function VO(a,d){if(a&1&&(i(0,"div",41)(1,"div",42),n(2," Payment Mode "),t(),i(3,"div",43),n(4),t()()),a&2){let e=p();l(4),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.payment_mode,"")}}function BO(a,d){if(a&1&&(i(0,"div",96)(1,"a",97)(2,"div",98)(3,"ul",99)(4,"li",100),x(5,"i",101),n(6),t()()()()()),a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(5),m(" ",e.name," ")}}function RO(a,d){if(a&1&&(i(0,"div",94),u(1,BO,7,2,"div",95),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.docs)}}function LO(a,d){a&1&&(i(0,"span",102),n(1," No files uploaded "),t())}function qO(a,d){if(a&1&&(i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),u(4,RO,2,1,"div",93)(5,LO,2,0,"ng-template",null,2,P),t()()),a&2){let e=d.$implicit,o=w(6);l(2),m(" ",e.collectionName," "),l(2),s("ngIf",e.docs.length>0)("ngIfElse",o)}}function GO(a,d){a&1&&(i(0,"tr")(1,"td",103)(2,"p",104),n(3,"No documents available"),t()()())}
1function UO(a,d){if(a&1&&(i(0,"div",18)(1,"div",49)(2,"h3",30),n(3,"Additional Services Documents"),t()(),i(4,"div",50)(5,"div",91)(6,"table",52)(7,"thead",53)(8,"tr")(9,"th",92),n(10,"Document Name"),t(),i(11,"th",92),n(12,"Files"),t()()(),i(13,"tbody"),u(14,qO,7,3,"tr",55)(15,GO,4,0,"tr",17),t()()()()()),a&2){let e=p();l(14),s("ngForOf",e.additionalDocs),l(),s("ngIf",!e.additionalDocs.length)}}function jO(a,d){if(a&1&&(i(0,"p",105)(1,"span",106),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function $O(a,d){if(a&1&&(i(0,"p",105)(1,"span",106),n(2,"Buyer:"),t(),n(3),t()),a&2){let e=p();l(3),m(" ",(e.invoiceDetails==null?null:e.invoiceDetails.buyer_company_name)||(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.company_name),"")}}function zO(a,d){if(a&1&&(i(0,"span",35),n(1),t()),a&2){let e=p();l(),f(e.invoiceDetails==null||e.invoiceDetails.buyerCompanyDetails==null?null:e.invoiceDetails.buyerCompanyDetails.gst)}}function WO(a,d){a&1&&(i(0,"span",74),n(1,"Not Available"),t())}function QO(a,d){if(a&1&&(i(0,"span",113),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function YO(a,d){if(a&1&&(i(0,"span",113),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function HO(a,d){if(a&1&&(i(0,"span",113),n(1),t()),a&2){let e=d.$implicit;l(),D("",e.name,": ",e.value,"")}}function KO(a,d){if(a&1&&(F(0),i(1,"div",110),n(2),t(),i(3,"p",111),u(4,QO,2,2,"span",112)(5,YO,2,2,"span",112)(6,HO,2,2,"span",112),t(),M()),a&2){let e=p().$implicit;l(2),m(" ",e.product_name," "),l(2),s("ngForOf",e==null||e.attributes==null?null:e.attributes.configurableAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.filterAttributes),l(),s("ngForOf",e==null||e.attributes==null?null:e.attributes.keyAttributes)}}function ZO(a,d){if(a&1&&(F(0),i(1,"div",110)(2,"div")(3,"p",114)(4,"span",14),n(5,"Gross Total:"),t(),n(6),_(7,"currencyFormat"),t(),i(8,"p",114)(9,"span",14),n(10,"Discount:"),t(),n(11),_(12,"currencyFormat"),t(),i(13,"p",114)(14,"span",14),n(15,"Net Total:"),t(),n(16),_(17,"currencyFormat"),t(),i(18,"p",114),n(19),_(20,"currencyFormat"),t(),i(21,"p",114),n(22),_(23,"currencyFormat"),t(),i(24,"p",114),n(25),_(26,"currencyFormat"),t(),i(27,"p",114),n(28),_(29,"currencyFormat"),t(),i(30,"p",114)(31,"span",14),n(32,"Logistics:"),t(),n(33),_(34,"currencyFormat"),t(),i(35,"p",114)(36,"span",14),n(37,"Insurance:"),t(),n(38),_(39,"currencyFormat"),t(),x(40,"div",115),i(41,"p",105)(42,"b")(43,"span",14),n(44,"Total Payable:"),t(),n(45),_(46,"currencyFormat"),t()()()(),M()),a&2){let e=p().$implicit;l(6),m(" ",v(7,14,e.gross_total)," "),l(5),m(" ",v(12,16,e.discount)," "),l(5),m(" ",v(17,18,e.gross_total-e.discount)," "),l(3),D(" Tax (",e.gst_percentage,"%): ",v(20,20,e.gst),""),l(3),D(" SGST (",e.sgst_percentage,"%): ",v(23,22,e.sgst),""),l(3),D(" CGST (",e.cgst_percentage,"%): ",v(26,24,e.cgst),""),l(3),D(" IGST (",e.igst_percentage,"%): ",v(29,26,e.igst),""),l(5),m(" ",v(34,28,e.logistics_charges)," "),l(5),m(" ",v(39,30,e.insurance_charges)," "),l(7),m(" ",v(46,32,e.net_amount)," ")}}function JO(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",107),n(3),t(),u(4,KO,7,4,"ng-template",null,3,P),x(6,"i",108),t(),i(7,"td",109),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),i(14,"small",14),n(15,"/unit"),t()(),i(16,"td"),n(17),_(18,"currencyFormat"),t(),i(19,"td"),n(20),_(21,"currencyFormat"),t(),i(22,"td"),n(23),_(24,"currencyFormat"),t(),i(25,"td"),n(26),_(27,"currencyFormat"),u(28,ZO,47,34,"ng-template",null,4,P),x(30,"i",108),t()()),a&2){let e=d.$implicit,o=w(5),r=w(29);l(3),f(e.product_name),l(3),s("ngbPopover",o),l(2),f(e.display_item_id),l(2),f(e.required_qty),l(2),m(" ",v(13,10,e.unit_price)," "),l(5),m(" ",v(18,12,e.discount),""),l(3),m(" ",v(21,14,e.gross_total),""),l(3),m(" ",v(24,16,e.gst),""),l(3),m(" ",v(27,18,e.net_amount)," "),l(4),s("ngbPopover",r)}}function XO(a,d){if(a&1&&(i(0,"tr")(1,"td",116)(2,"span",14),n(3,"Advance Note:"),t(),i(4,"b"),n(5),t()(),i(6,"td",117)(7,"span",14),n(8,"Advance Amount:"),t(),i(9,"b"),n(10),t()()()),a&2){let e=p();l(5),f(!(e.invoiceDetails==null||e.invoiceDetails.installments[0]==null)&&e.invoiceDetails.installments[0].terms?e.invoiceDetails==null||e.invoiceDetails.installments[0]==null?null:e.invoiceDetails.installments[0].terms:"Not available"),l(5),f(!(e.invoiceDetails==null||e.invoiceDetails.installments[0]==null)&&e.invoiceDetails.installments[0].amount?e.invoiceDetails==null||e.invoiceDetails.installments[0]==null?null:e.invoiceDetails.installments[0].amount:0)}}function ek(a,d){if(a&1&&(i(0,"tr")(1,"td",116)(2,"span",14),n(3,"Additional Charge:"),t(),n(4,"\xA0 "),i(5,"b"),n(6),t()(),i(7,"td",117)(8,"span",14),n(9,"Amount:"),t(),i(10,"b"),n(11),_(12,"currencyFormat"),t()()()),a&2){let e=d.$implicit;l(6),f(e.description),l(5),f(v(12,2,e.amount))}}function tk(a,d){if(a&1&&(F(0),u(1,ek,13,4,"tr",55),M()),a&2){let e=p();l(),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.additional_charges)}}function ik(a,d){if(a&1&&(i(0,"li",122)(1,"a",123),x(2,"i",101),n(3),t()()),a&2){let e=d.$implicit;l(),s("href",e.drive_path,q),l(2),m(" ",e.filename," ")}}function nk(a,d){if(a&1&&(i(0,"div",118)(1,"div",19)(2,"h3",30),n(3,"Terms & Conditions:"),t()(),i(4,"div",21)(5,"p",119),n(6),t(),i(7,"ul",120),u(8,ik,4,2,"li",121),t()()()),a&2){let e=p();l(6),m(" ",e.invoiceDetails==null?null:e.invoiceDetails.terms,""),l(2),s("ngForOf",e.invoiceDetails==null?null:e.invoiceDetails.detail_seller_terms_and_conditions_path)}}var er=(()=>{class a{constructor(e,o,r,c){this.notificationService=e,this.activatedRoute=o,this.financeOrderService=r,this.router=c,this.isLoading=!1,this.additionalDocs=[],this.isPrintLoading=!1}get canOpenSource(){let e=(this.invoiceDetails?.source||"").toLowerCase();return!!this.invoiceDetails?.source_id&&(e==="rfq"||e==="auction")}openPathInNewTab(e){let o=window.location.href.replace(this.router.url,"");window.open(o+e,"_blank")}onSourceIdClick(){let e=(this.invoiceDetails?.source||"").toLowerCase(),o=this.invoiceDetails?.source_id;o&&(e==="rfq"?this.openPathInNewTab("/rfq/sellers/rfq-details/"+o):e==="auction"&&this.openPathInNewTab("/auction/seller-auction-detail
1s/"+(this.invoiceDetails?.source_main_id||o)))}onPoNumberClick(){this.invoiceDetails?.po_id&&this.openPathInNewTab("/finance-management/receivable-purchase-orders/seller-view?id="+this.invoiceDetails.po_id)}ngOnInit(){this.activatedRoute.queryParams.subscribe(e=>{this.invoiceId=e.invoiceId,this.invoiceType=e.invoiceType,this.GetInvoiceDetails()})}GetInvoiceDetails(){try{this.isLoading=!0;let e={};e.invoice_id=this.invoiceId,e.invoice_type=this.invoiceType,this.financeOrderService.GetInvoiceDetails(e).subscribe(o=>{this.invoiceDetails=o.response.data,this.invoiceDetails.buyer_address.filter(g=>g.addressType=="billing").forEach(g=>this.billingAddres=g),this.invoiceDetails.buyer_address.filter(g=>g.addressType=="shipping").forEach(g=>this.shippingAddrdres=g),this.additionalDocs=[];let r=g=>`${g.docName||""}|${g.filename||g.file_name||g.name||""}|${g.drive_path||g.path||g.viewPath||g.file_path||""}`,c=new Set;(this.invoiceDetails.additionalDocuments||[]).forEach(g=>{let h=r(g);if(c.has(h))return;c.add(h);let C=this.additionalDocs.findIndex(k=>k.collectionName===g.docName);C===-1?this.additionalDocs.push({collectionName:g.docName,docs:[g]}):this.additionalDocs[C].docs.push(g)}),this.isLoading=!1},o=>{this.notificationService.showError("Something went wrong!"),this.isLoading=!1})}catch{this.notificationService.showError("Something went wrong!"),this.isLoading=!1}}toggleWithGreeting(e){e.isOpen()?e.close():e.open()}regenerateInvoice(){this.invoiceDetails?this.router.navigate(["finance-management/receivable-purchase-orders/send"],{queryParams:{id:this.invoiceDetails.po_id}}):this.notificationService.showError("Something went wrong!")}printDocument(){this.isPrintLoading=!0,this.financeOrderService.printPdf("TAX_INVOICE",Number(this.invoiceId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(H),T(de),T(z),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-seller-reject-invoice-view"]],decls:237,vars:73,consts:[["plainPoNumber",""],["plainSourceId",""],["noFiles",""],["prods",""],["popContent",""],[3,"isLoading"],["id","content",1,"rfq-pages","generate-po-page","container-fluid","overflow-hidden-non-i"],[1,"row"],[1,"col-12"],[1,"row","align-items-center","mb-3"],[1,"col-md-6","col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-6","col-12","text-right"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"mod-card","mb-4"],[1,"mod-card-header"],[1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","align-items-center"],[1,"col-md-8","col-xl-10"],[1,"list-unstyled","multi-steps"],["appTranslate","",1,"is-active","red"],[1,"col-md-4","col-xl-2"],[1,"border","rounded-lg","p-2"],["appTranslate","",1,"theme-color","font-12","mb-0"],[1,"text-danger"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"card-danger"],[1,"text-danger","fw-600","font-14","mb-0"],[1,"col-md","col-12"],[1,"fw-600","mb-1"],[1,"text-secondary"],["class","text-secondary",4,"ngIf"],["class","text-secondary","appTranslate","",4,"ngIf"],["class","col-md-auto col-12",4,"ngIf"],["class","mod-card mb-4",4,"ngIf"],[1,"mod-meta-grid",3,"ngSwitch"],[1,"mod-meta-tile"],["appTranslate","",1,"mod-meta-label"],[1,"mod-meta-value"],["type","button","class","mod-btn-action",3,"click",4,"ngIf","ngIfElse"],["class","mod-meta-tile",4,"ngSwitchCase"],[1,"col-md-6"],["appTranslate","",1,"fw-600","mb-2"],["class","text-secondary mb-1",4,"ngIf"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table"],[1,""],["appTranslateText",""],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],["class","mod-card mb-4 h-100",4,"ngIf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"float-right","text-danger"],[1,"mb-2","ml-2"],[1,"card-footer"],[1,"col-12","text-right","mb-4"],["type","button",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],[1,"uil","uil-refresh"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["appTranslate","",1,"text-secondary"],[1,"col-md-auto","col-12"],[1,"text-center"],["alt","your image","class","doc-logo__img",3,"src",4,"ngIf"],["alt","your image",1,"doc-logo__img",3,"src"],[1,"mod-bank-card"],[1,"mod-bank-card__head"],[1,"mod-bank-card__icon"],[1,"ri-bank-line"],[1,"mod-bank-card__meta"],[1,"mod-bank-card__name"],[1,"mod-bank-card__city"],[1,"row","mod-bank-card__body"],[1,"col-md-3"],["appTranslate","",1,"mod-info-block__label"],[1,"mod-info-block__value"],["type","button",1,"mod-btn-action",3,"click"],[1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],["scope","col","a
1ppTranslate",""],["class","row w-100",4,"ngIf","ngIfElse"],[1,"row","w-100"],["class","col-auto",4,"ngFor","ngForOf"],[1,"col-auto"],["target","_blank",1,"card",3,"href"],[1,"card-body","p-2"],[1,"list-inline","align-items-center","mb-0"],[1,"list-inline-item","theme-color","font-12","fw-600"],[1,"far","fa-file-pdf","font-18","pr-15","text-danger"],["appTranslate","",1,"text-muted","small"],["colspan","2"],["appTranslate","",1,"text-center","mb-0"],[1,"text-secondary","mb-1"],["appTranslate","",1,"fw-600"],[1,"mod-clamp-2"],["container","body","triggers","mouseenter:mouseleave",1,"text-secondary","ri-information-2-line","cursor-p",3,"ngbPopover"],[1,"product-id-cell"],[1,"newClass"],[1,"font-12","text-secondary"],["class","badge badge-blue-s py-1 my-1 mx-1 rounded text-dark",4,"ngFor","ngForOf"],[1,"badge","badge-blue-s","py-1","my-1","mx-1","rounded","text-dark"],[1,"text-dark","mb-1"],[1,"border-t"],["colspan","6"],["colspan","1"],[1,"mod-card","mb-4","h-100"],[1,"font-12","text-secondary","mb-2"],[1,"list-inline","mb-0"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],["target","_blank",1,"d-flex","align-items-center","mb-2","p-2","border","font-italic","theme-color","border-style-dotted-i",3,"href"]],template:function(o,r){if(o&1){let c=I();x(0,"app-loader",5),i(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"h2",11)(7,"a",12),x(8,"i",13),t(),i(9,"span",14),n(10,"Proforma Invoice"),t()()(),i(11,"div",15)(12,"button",16),S("click",function(){return b(c),y(r.printDocument())}),u(13,EO,4,0,"span",17)(14,IO,6,0,"span",17),t()()()(),i(15,"div",8)(16,"div",18)(17,"div",19)(18,"h3",20)(19,"span",14),n(20,"Invoice ID:"),t(),n(21),t()(),i(22,"div",21)(23,"div",22)(24,"div",23)(25,"ul",24)(26,"li",14),n(27,"Generate PO"),t(),i(28,"li",14),n(29,"PO Sent"),t(),i(30,"li",25),n(31,"Invoice Rejected"),t(),i(32,"li",14),n(33,"Invoice Approved"),t()()(),i(34,"div",26)(35,"div",27)(36,"p",28),n(37,"Status:"),t(),i(38,"b",29),n(39),t()()()()()(),i(40,"div",18)(41,"div",19)(42,"h3",30),n(43,"Remarks"),t()(),i(44,"div",21)(45,"div",31)(46,"p",32),n(47),t()()()(),i(48,"div",18)(49,"div",19)(50,"h3",30),n(51,"Shipping From"),t()(),i(52,"div",21)(53,"div",7)(54,"div",33)(55,"p",34)(56,"span",14),n(57,"Seller Name:"),t(),i(58,"span",35),n(59),t()(),i(60,"p",34)(61,"span",14),n(62,"GST No:"),t(),u(63,DO,2,1,"span",36)(64,TO,2,0,"span",37),t(),i(65,"p",34)(66,"span",14),n(67,"Seller Address:"),t(),i(68,"span",35),n(69),t()()(),u(70,PO,3,1,"div",38),t()()(),u(71,OO,35,6,"div",39),i(72,"div",18)(73,"div",19)(74,"h3",30),n(75,"Proforma Invoice"),t()(),i(76,"div",21)(77,"div",40)(78,"div",41)(79,"div",42),n(80,"Invoice Number"),t(),i(81,"div",43),n(82),t()(),i(83,"div",41)(84,"div",42),n(85,"PO No."),t(),i(86,"div",43),u(87,kO,2,1,"button",44)(88,FO,1,1,"ng-template",null,0,P),t()(),i(90,"div",41)(91,"div",42),n(92,"Source ID"),t(),i(93,"div",43),u(94,MO,2,1,"button",44)(95,AO,1,1,"ng-template",null,1,P),t()(),i(97,"div",41)(98,"div",42),n(99,"Invoice Date"),t(),i(100,"div",43),n(101),t()(),i(102,"div",41)(103,"div",42),n(104,"Invoice State/City"),t(),i(105,"div",43),n(106),t()(),u(107,NO,5,1,"div",45)(108,VO,5,1,"div",45),t()()(),u(109,UO,16,2,"div",39),i(110,"div",18)(111,"div",19)(112,"h3",30),n(113,"Buyer Address"),t()(),i(114,"div",21)(115,"div",7)(116,"div",46)(117,"p",47),n(118,"Shipping Address : "),t(),u(119,jO,4,1,"p",48),i(120,"p",35),n(121),t()(),i(122,"div",46)(123,"p",47),n(124,"Billing Address : "),t(),u(125,$O,4,1,"p",48),i(126,"p",35),n(127),t(),i(128,"p",34)(129,"span",14),n(130,"GST No:"),t(),u(131,zO,2,1,"span",36)(132,WO,2,0,"span",37),t()()()()(),i(133,"div",18)(134,"div",49)(135,"h3",30),n(136,"Order Summary"),t()(),i(137,"div",50)(138,"div",51)(139,"table",52)(140,"thead",53)(141,"tr")(142,"th",14),n(143," Product Name"),t(),i(144,"th",14),n(145," Product ID"),t(),i(146,"th",14),n(147," Quantity"),t(),i(148,"th",54),n(149,"Quoted "),i(150,"small",14),n(151,"(Price per unit)"),t()(),i(152,"th",14),n(153," Discount"),t(),i(154,"th",14),n(155," Gross Total"),t(),i(156,"th",14),n(157," GST"),t(),i(158,"th",14),n(159," Total Payable"),t()()(),i(160,"tbody"),u(161,JO,31,20,"tr",55)(162,XO,11,2,"tr",17)(163,tk,2,1,"ng-container",17),t()()()()(),i(164,"div",56)(165,"div",57),u(166,nk,9,2,"div",58),t(),i(167,"div",59)(168,"div",60)(169,"div",61)(170,"ul",62)(171,"li",63)(172,"b",14),n(173,"Gross Total:"),t(),i(174,"span",64),n(175),_(176,"currencyFormat"),t()(),i(177,"li",63)(178,"b",14),n(179,"Discount:"),t(),i(180,"span",65),n(181),_(182,"currencyFormat"),t()(),i(183,"li",63)(184,"b",14),n(185,"Net Total:"),t(),i(186,"span",64),n(187),_(188,"currencyFormat"),t()(),i(189,"li",66)(190,"span",14),n(191,"SGST:"),t(),i(192,"span",64),n(193),_(194,"currencyFormat"),t()(),i(195,"li",66)(196,"span",14),n(197,"CGST:"),t(),i(198,"span",64),n(199),_(200,"currencyFormat"),t()(),i(201,"li",66)(202,"span",14),n(203,"IGST:"),t(),i(204,"span",64),n(205),_(206,"currencyFormat"),t()(),i(207,"li",63)(208,"b",14),n(209,"Total Tax Amount:"),t(),i(210,"span",64),n(211),_(212,"currencyFormat"),t()(),i(213,"li",63)(214,"b",14),n(215,"Logistics:"),t(),i(216,"span",64),n(217),_(218,"currencyFormat"),t()(),i(219,"li",63)(220,"b",14),n(221,"Insurance:"),t(),i(222,"span",64),n(223),_(224,"currencyFormat"),t()()()(),i(225,"div",67)(226,"span",14),n(227,"Total Payable Amou
1nt:"),t(),i(228,"span",64),n(229),_(230,"currencyFormat"),t()()()()(),i(231,"div",7)(232,"div",68)(233,"button",69),S("click",function(){return b(c),y(r.regenerateInvoice())}),x(234,"i",70),i(235,"span",14),n(236,"Regenerate Invoice"),t()()()()()()()}if(o&2){let c=w(89),g=w(96);s("isLoading",r.isLoading),l(12),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(7),m(" ",r.invoiceDetails==null?null:r.invoiceDetails.invoice_id," "),l(18),f(r.invoiceDetails==null?null:r.invoiceDetails.seller_status),l(8),m("",r.invoiceDetails!=null&&r.invoiceDetails.reason?r.invoiceDetails==null?null:r.invoiceDetails.reason:"--"," "),l(12),f(r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.firstname),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.seller_details),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.seller_details)),l(5),se(" ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.street,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.region," ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.city,", ",r.invoiceDetails==null||r.invoiceDetails.seller_address==null?null:r.invoiceDetails.seller_address.postcode,""),l(),s("ngIf",r.invoiceDetails&&r.invoiceDetails.seller_details&&r.invoiceDetails.seller_details.company_logoViewPath),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.bank_name)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_number)||(r.invoiceDetails==null?null:r.invoiceDetails.bank_account_ifsc)),l(6),s("ngSwitch",r.invoiceDetails==null?null:r.invoiceDetails.source),l(5),f(r.invoiceDetails==null?null:r.invoiceDetails.invoice_id),l(5),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.po_id)("ngIfElse",c),l(7),s("ngIf",r.canOpenSource)("ngIfElse",g),l(7),f(r.invoiceDetails==null?null:r.invoiceDetails.proforma_created_date),l(5),f(r.shippingAddrdres==null?null:r.shippingAddrdres.region),l(),s("ngSwitchCase","rfq"),l(),s("ngSwitchCase","rfq"),l(),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.service_documents_required)==="yes"),l(10),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.shippingAddrdres==null?null:r.shippingAddrdres.street," ",r.shippingAddrdres==null?null:r.shippingAddrdres.region,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.city,", ",r.shippingAddrdres==null?null:r.shippingAddrdres.postcode," "),l(4),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.buyer_company_name)||(r.invoiceDetails==null||r.invoiceDetails.buyerCompanyDetails==null?null:r.invoiceDetails.buyerCompanyDetails.company_name)),l(2),se(" ",r.billingAddres==null?null:r.billingAddres.street," ",r.billingAddres==null?null:r.billingAddres.region,", ",r.billingAddres==null?null:r.billingAddres.city,", ",r.billingAddres==null?null:r.billingAddres.postcode," "),l(4),s("ngIf",r.invoiceDetails==null?null:r.invoiceDetails.buyerCompanyDetails),l(),s("ngIf",!(r.invoiceDetails!=null&&r.invoiceDetails.buyerCompanyDetails.gst)),l(29),s("ngForOf",r.invoiceDetails==null?null:r.invoiceDetails.items),l(),s("ngIf",+(r.invoiceDetails==null||r.invoiceDetails.installments[0]==null?null:r.invoiceDetails.installments[0].amount)>0),l(),s("ngIf",!(+(r.invoiceDetails==null||r.invoiceDetails.installments[0]==null?null:r.invoiceDetails.installments[0].amount)>0)),l(3),s("ngIf",(r.invoiceDetails==null?null:r.invoiceDetails.shipments)=="no"&&(r.invoiceDetails==null?null:r.invoiceDetails.instalments)=="no"),l(9),m(" ",v(176,53,r.invoiceDetails==null?null:r.invoiceDetails.gross),""),l(6),m("(-) ",v(182,55,r.invoiceDetails==null?null:r.invoiceDetails.discount_amount),""),l(6),m(" ",v(188,57,r.invoiceDetails==null?null:r.invoiceDetails.net_charges),""),l(6),m(" ",v(194,59,r.invoiceDetails==null?null:r.invoiceDetails.sgst),""),l(6),m(" ",v(200,61,r.invoiceDetails==null?null:r.
1invoiceDetails.cgst),""),l(6),m(" ",v(206,63,r.invoiceDetails==null?null:r.invoiceDetails.igst),""),l(6),m(" ",v(212,65,r.invoiceDetails==null?null:r.invoiceDetails.gst_amount),""),l(6),m(" ",v(218,67,r.invoiceDetails==null?null:r.invoiceDetails.logistics_charges),""),l(6),m(" ",v(224,69,r.invoiceDetails==null?null:r.invoiceDetails.insurance_charges),""),l(6),m(" ",v(230,71,r.invoiceDetails==null?null:r.invoiceDetails.total_amount),"")}},dependencies:[J,W,pt,mt,Se,Z,De,L,vt,ae],styles:[".rfq-pages[_ngcontent-%COMP%] .card-danger[_ngcontent-%COMP%]{color:#1b1b1bde;background-color:#fff8f9;border:1px solid #f64e60;padding:15px;border-radius:8px}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]{color:#f64e60}.multi-steps[_ngcontent-%COMP%] > li.is-active.red[_ngcontent-%COMP%]:before{background-color:#ffe2e5;border-color:#f64e60;color:#f64e60}td.tab-head[_ngcontent-%COMP%]{max-width:100px;background-color:#f7f7f7;font-weight:600}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--seller-green)}.sub-title[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:before{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:after, .multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:after{background-color:#ededed}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:before{background-color:#fff;border-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:after{background-color:var(--seller-green)}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%]:before{background-color:var(--seller-green);border-color:var(--seller-green);color:#fff}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]{color:gray}.multi-steps[_ngcontent-%COMP%] > li.is-active[_ngcontent-%COMP%] ~ li[_ngcontent-%COMP%]:before{background-color:#ededed;border-color:#ededed}.theme-color[_ngcontent-%COMP%], .text-theme[_ngcontent-%COMP%]{color:var(--seller-green)!important}.theme-bg[_ngcontent-%COMP%]{background-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]{color:var(--seller-green);border-color:var(--seller-green)}.btn-outline-theme[_ngcontent-%COMP%]:hover{background-color:var(--seller-green);color:#fff!important}.btn-theme[_ngcontent-%COMP%]{background-color:var(--seller-green);color:#fff}.head-line-seperator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:var(--seller-green)} .mat-dialog-container{padding:0!important}.hilight-element[_ngcontent-%COMP%]{margin:0 -10px;padding:10px;border:dashed 1px #6bbb9d;background:#edfff8;border-radius:5px}.max-h-150px[_ngcontent-%COMP%]{max-height:150px}.doc-logo__img[_ngcontent-%COMP%]{display:block;width:180px;max-width:100%;height:96px;object-fit:contain;padding:4px;background:var(--mod-surface);border:1px solid var(--mod-border);border-radius:var(--mod-radius-md)}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();function ak(a,d){a&1&&(i(0,"span"),x(1,"i",45),i(2,"span",6),n(3,"Print"),t()())}function rk(a,d){a&1&&(i(0,"span")(1,"div",46)(2,"span",47),n(3,"Loading..."),t()(),i(4,"span",6),n(5,"Printing..."),t()())}function lk(a,d){a&1&&(i(0,"tr")(1,"td",48),n(2,"No Products Found"),t()())}function ok(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",49),n(3),t()(),i(4,"td"),n(5),t(),i(6,"td"),n(7),t(),i(8,"td"),n(9),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),t()()),a&2){let e=d.$implicit;l(2),s("title",e.product_name),l(),f(e.product_name),l(2),f(e.product_sku),l(2),f(e.invoice_qty),l(2),f(e.rejected_qty),l(2),f(e.debit_qty),l(2),f(e.unit_price),l(2),f(e.tax_percent),l(2),f(e.total_price)}}function sk(a,d){a&1&&(i(0,"li",50)(1,"p",51),n(2,"No Attachments"),t()())}function dk(a,d){if(a&1&&(i(0,"li",50)(1,"p",52)(2,"a",53),n(3),t()()()),a&2){let e=d.$implicit;
1l(2),s("href",e.url,q),l(),f(e.name)}}var tr=(()=>{class a{constructor(e,o){this.financeService=e,this.route=o,this.debitNoteDetails={},this.debitNoteItems=[],this.debitNoteAttachments={},this.isPrintLoading=!1}ngOnInit(){this.debitNoteId=this.route.snapshot.paramMap.get("id"),this.getDebitNoteDetails()}getDebitNoteDetails(){let e={id:this.debitNoteId,type:"PAYABLE"};this.financeService.getDebitNoteDetailsById(e).subscribe({next:o=>{this.debitNoteDetails=o.response||{},this.debitNoteItems=o.response.items||[],this.debitNoteAttachments=o.response.attachments,console.log(this.debitNoteItems)}})}printDocument(){this.isPrintLoading=!0,this.financeService.printPdf("DEBIT_NOTE_RECEIVED",Number(this.debitNoteId),"RECEIVABLE").subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de))}}static{this.\u0275cmp=R({type:a,selectors:[["app-debit-note-details"]],decls:160,vars:32,consts:[[1,"createCommonModuleMain","debit-note-details-main"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-auto"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"create-debit-note-form"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-4"],[1,"col-md-12","col-xl-4"],["appTranslate","",1,"finance-note-label"],[1,"finance-note-value"],[1,"col-md-12","col-xl-12"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table","mb-0"],[1,""],["appTranslate","",1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"mod-card","mod-card-body","mt-24","mb-3"],["appTranslate","",1,"mt-5"],[1,"row","mt-2"],[1,"col-12"],[1,"list-inline"],["class","list-inline-item mt-2",4,"ngIf"],["class","list-inline-item mt-2",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"card-footer"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["colspan","8","appTranslate","",1,"text-center","text-danger"],[1,"mod-clamp-2",3,"title"],[1,"list-inline-item","mt-2"],["appTranslate","",1,"text-muted"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3)(4,"a",4),x(5,"i",5),t(),i(6,"span",6),n(7,"Debit Note"),t()()(),i(8,"div",7)(9,"button",8),S("click",function(){return r.printDocument()}),u(10,ak,4,0,"span",9)(11,rk,6,0,"span",9),t()()(),i(12,"form",10)(13,"div",11)(14,"div",12)(15,"h3",13),n(16,"Reference Details"),t()(),i(17,"div",14)(18,"div",15)(19,"div",16)(20,"h6",17),n(21,"GRN ID"),t(),i(22,"p",18),n(23),t()(),i(24,"div",16)(25,"h6",17),n(26,"GRN Date"),t(),i(27,"p",18),n(28),t()(),i(29,"div",16)(30,"h6",17),n(31,"PO Number"),t(),i(32,"p",18),n(33),t()(),i(34,"div",16)(35,"h6",17),n(36,"Supplier Name"),t(),i(37,"p",18),n(38),t()(),i(39,"div",16)(40,"h6",17),n(41,"GST Number"),t(),i(42,"p",18),n(43),t()(),i(44,"div",19)(45,"h6",17),n(46,"Address"),t(),i(47,"p",18),n(48),t()()()()(),i(49,"div",11)(50,"div",12)(51,"h3",13),n(52,"Invoice Details"),t()(),i(53,"div",14)(54,"div",15)(55,"div",16)(56,"h6",17),n(57,"Invoice Number"),t(),i(58,"p",18),n(59),t()(),i(60,"div",16)(61,"h6",17),n(62,"Invoice Date"),t(),i(63,"p",18),n(64),t()(),i(65,"div",16)(66,"h6",17),n(67,"Original Invoice Amount"),t(),i(68,"p",18),n(69),t()()()()(),i(70,"div",11)(71,"div",12)(72,"h3",13),n(73,"Debit Note Details"),t()(),i(74,"div",14)(75,"div",15)(76,"div",16)(77,"h6",17),n(78,"Debit Note Number"),t(),i(79,"p",18),n(80),t()(),i(81,"div",16)(82,"h6",17),n(83,"Debit Note Date"),t(),i(84,"p",18),n(85),t()()()()(),i(86,"div",11)(87,"div",20)(88,"h3",13),n(89,"Product Details"),t()(),i(90,"div",21)(91,"div",22)(92,"div",23)(93,"table",24)(94,"thead",25)(95,"tr")(96,"th",26),n(97," Product Name"),t(),i(98,"th",26),n(99," Product SKU ID"),t(),i(100,"th",26),n(101," Invoice Quantity"),t(),i(102,"th",26),n(103," Rejected Quantity"),t(),i(104,"th",26),n(105," Debit Quantity"),t(),i(106,"th",26),n(107," Unit price"),t(),i(108,"th",26),n(109," Tax (%)"),t(),i(110,"th",26),n(111," Total Price"),t()()(),i(112,"tbody"),u(113,lk,3,0,"tr",9)(114,ok,18,9,"tr",27),t()()()()()(),i(115,"div",28)(116,"div",29)(117,"div",30)(118,"div",12)(119,"h3",13),n(120,"Reason for Debit Note"),t()(),i(121,"div",14)(122,"div",31)(123,"p"),n(124),t()(),i(125,"h5",32),n(126,"Attachements"),t(),i(127,"div",33)(128,"div",34)(129,"ul",35),u(130,sk,3,0,"li",36)(131,dk,4,2,"li",37),t()()()()()(),i(132,"div",38)(133,"div",39)(134,"div",40)(135,"ul",41)(136,"li",42)(137,"span",6),n(138,"Gross Total:"),t(),i(139,"span",43),n(140),_(141,"currencyFormat"),t()(),i(142,"li",42)(143,"span",6),n(144,"Net Total:"),t(),i(145,"span",43),n(146),_(147,"currencyFormat"),t()(),i(148,"li",42)(149,"span",6),n(150,"GST (%):"),t(),i(151,"span",43),n(152),_(153,"currencyFormat"),t()()()(),i(154,"div",44)(155,"span",6),n(156,"Total Debit Note Amount : "),t(),i(157,"span",43),n(158),_(159,"currencyFormat"),t()()()()()()()),o&2&&(l(4),s("backButtonFallback","/finance-management/payable-debit-notes"),l(5),s("disabled",r.isPrintLoading),l(
1),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(12),f(r.debitNoteDetails.grn_id||"--"),l(5),f(r.debitNoteDetails.grn_date||"--"),l(5),f(r.debitNoteDetails.po_number||"--"),l(5),f(r.debitNoteDetails.supplier_name||"--"),l(5),f(r.debitNoteDetails.supplier_gst||"--"),l(5),f(r.debitNoteDetails.supplier_address||"--"),l(11),f(r.debitNoteDetails.invoice_number||"--"),l(5),f(r.debitNoteDetails.invoice_date||"--"),l(5),f(r.debitNoteDetails.invoice_amount||"--"),l(11),f(r.debitNoteDetails.debit_note_number||"--"),l(5),f(r.debitNoteDetails.debit_note_date||"--"),l(28),s("ngIf",r.debitNoteItems.length===0),l(),s("ngForOf",r.debitNoteItems),l(10),f(r.debitNoteDetails.reason||"--"),l(6),s("ngIf",!r.debitNoteAttachments||r.debitNoteAttachments.length===0),l(),s("ngForOf",r.debitNoteAttachments),l(9),m(" ",r.debitNoteDetails.invoice_amount?v(141,24,r.debitNoteDetails.invoice_amount):"--",""),l(6),m(" ",r.debitNoteDetails.subtotal?v(147,26,r.debitNoteDetails.subtotal):"--",""),l(6),m(" ",r.debitNoteDetails.tax_amount?v(153,28,r.debitNoteDetails.tax_amount):"--",""),l(6),m(" ",r.debitNoteDetails.total_amount?v(159,30,r.debitNoteDetails.total_amount):"--",""))},dependencies:[J,W,Oe,Ie,qt,Z,L,ae],styles:[".finance-note-bottom-border[_ngcontent-%COMP%]{border-bottom:1px solid #dedede;padding-bottom:3rem;margin-bottom:3rem}.finance-detail-titles[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:600;color:#343a40!important;font-size:1.2rem}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(2){width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var ck=["financeDrawer"];function pk(a,d){a&1&&(i(0,"mat-option",81)(1,"span",9),n(2,"Loading..."),t()())}function mk(a,d){if(a&1&&(i(0,"mat-option",82)(1,"span"),n(2),t(),i(3,"small",83),n(4),t()()),a&2){let e=d.$implicit;s("value",e.grn_number),l(2),f(e.grn_number),l(2),D(" \u2014 ",e.supplier_name," \xB7 ",e.po_number,"")}}function uk(a,d){a&1&&(i(0,"mat-option",81)(1,"span",9),n(2,"No GRNs found"),t()())}function _k(a,d){a&1&&(i(0,"div",84)(1,"span",9),n(2,"GRN NO is required"),t()())}function vk(a,d){a&1&&(i(0,"div",84)(1,"span",9),n(2,"Debit Note Number is required"),t()())}function gk(a,d){a&1&&(i(0,"div",84)(1,"span",9),n(2,"Debit Note Date is required"),t()())}function fk(a,d){a&1&&(i(0,"p",87),n(1,"Loading products..."),t())}function hk(a,d){a&1&&(i(0,"p",87),n(1,"Select a GRN to load its products"),t())}function xk(a,d){a&1&&(i(0,"p",87),n(1,"No products found for the selected GRN"),t())}function bk(a,d){if(a&1&&(i(0,"div",85),u(1,fk,2,0,"p",86)(2,hk,2,0,"p",86)(3,xk,2,0,"p",86),t()),a&2){let e=p();l(),s("ngIf",e.isGrnDetailsLoading),l(),s("ngIf",!e.isGrnDetailsLoading&&!e.grnId),l(),s("ngIf",!e.isGrnDetailsLoading&&e.grnId)}}function yk(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),t(),i(7,"td"),n(8),t(),i(9,"td"),n(10),t(),i(11,"td"),n(12),_(13,"currencyFormat"),t(),i(14,"td",91),n(15),t(),i(16,"td"),n(17),t(),i(18,"td"),n(19),t(),i(20,"td",92),n(21),_(22,"currencyFormat"),t(),i(23,"td",93)(24,"a",94),S("click",function(){let r=b(e).index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(25,"i",95),t(),i(26,"a",96),S("click",function(){let r=b(e).index,c=p(2);return y(c.requestDeleteProduct(r))}),x(27,"i",97),t()()()}if(a&2){let e,o,r,c=d.$implicit,g=p(2);l(2),f(c.productName),l(2),f(c.skuId||"-"),l(2),f((e=c.invoiceQty)!==null&&e!==void 0?e:"-"),l(2),f((o=c.receivedQty)!==null&&o!==void 0?o:"-"),l(2),f((r=c.rejectedQty)!==null&&r!==void 0?r:"-"),l(2),f(v(13,10,c.unitPrice)),l(3),f(c.adjustmentType||"full"),l(2),f(c.adjustmentType==="partial"?c.adjustmentPercent+"%":"\u2014"),l(2),m("",c.tax||0,"%"),l(2),f(v(22,12,g.lineDebitAmount(c)))}}function Sk(a,d){if(a&1&&(i(0,"div",88)(1,"table",89)(2,"thead")(3,"tr")(4,"th",9),n(5,"Product"),t(),i(6,"th",9),n(7,"SKU"),t(),i(8,"th",9),n(9,"Invoice Qty"),t(),i(10,"th",9),n(11,"Received Qty"),t(),i(12,"th",9),n(13,"Re
1jected Qty"),t(),i(14,"th",9),n(15,"Unit Price"),t(),i(16,"th",9),n(17,"Adjustment Type"),t(),i(18,"th",9),n(19,"Adjustment %"),t(),i(20,"th",9),n(21,"Tax(%)"),t(),i(22,"th",9),n(23,"Debit Amount"),t(),x(24,"th"),t()(),i(25,"tbody"),u(26,yk,28,14,"tr",90),t()()()),a&2){let e=p();l(26),s("ngForOf",e.productFormValues)("ngForTrackBy",e.trackByIndex)}}function Ck(a,d){a&1&&(i(0,"div",98),n(1," At least one product is required. "),t())}function Ek(a,d){if(a&1){let e=I();i(0,"div",99)(1,"button",100),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",101),t(),i(3,"span",102),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function Ik(a,d){if(a&1){let e=I();i(0,"button",100),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",101),t()}}function Dk(a,d){if(a&1){let e=I();i(0,"button",112),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",113),t()}}function Tk(a,d){if(a&1){let e=I();i(0,"div",103)(1,"div",104)(2,"label",24),n(3,"Description"),t(),x(4,"textarea",105),t(),i(5,"div",104)(6,"label",24),n(7,"Amount"),t(),i(8,"input",106),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",107)(10,"div",108)(11,"div",109),u(12,Ik,2,0,"button",110)(13,Dk,2,0,"button",111),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function wk(a,d){a&1&&(i(0,"span",9),n(1,"Attachments"),t())}function Pk(a,d){a&1&&(i(0,"span",9),n(1,"Uploading..."),t())}function Ok(a,d){if(a&1&&x(0,"app-loader",114),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function kk(a,d){if(a&1){let e=I();i(0,"span",117)(1,"a",118),n(2),t(),i(3,"i",119),S("click",function(){let r=b(e).$implicit,c=p(2),g=w(114);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function Fk(a,d){if(a&1&&(i(0,"div",115),u(1,kk,4,2,"span",116),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function Mk(a,d){a&1&&x(0,"span",120)}function vn(a){document.getElementById(a)?.click()}var ir=(()=>{class a{constructor(e,o,r,c){this.fbs=e,this.router=o,this.FinanceOrderService=r,this.notificationService=c,this.productFormValues=[],this.uploadedTermsDocs=[],this.submitted=!1,this.productRequiredError=!1,this.confirmDeleteIndex=null,this.formControlListeners=[],this.allowedFileTypes=[".pdf",".doc",".docx"],this.isSubmitting=!1,this.grnId=null,this.asnId=null,this.poId=null,this.invoiceId=null,this.supplierId=null,this.buyerId=null,this.isGrnDetailsLoading=!1,this.grnList=[],this.isGrnLoading=!1,this.grnSearch$=new ti,this.loadingStates={termsDocs:!1},this.debitNoteForm=this.fbs.group({grnNo:["",E.required],grnDate:[""],poNumber:[""],supplierName:[""],gstNumber:[""],supplierAddress:[""],invoiceNo:[""],invoiceDate:[""],invoiceOriginalAmount:[""],debitNoteNumber:["",E.required],debitNoteDate:["",E.required],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fbs.array([]),totalPayableAmount:0,termsandConditions:[""],remarks:[""]})}ngOnInit(){this.formControlListeners.push(this.debitNoteForm.valueChanges.subscribe(()=>this.calculateSummary())),this.prefillDebitNoteNumber(),this.setupGrnSearch(),this.grnSearch$.next("")}setupGrnSearch(){this.grnSearch$.pipe(Cn(300),En(),In(e=>(this.isGrnLoading=!0,this.FinanceOrderService.getGrnList({userType:"BUYER",search:(e||"").trim()}).pipe(Sn(()=>ui({response:{data:[]}})))))).subscribe(e=>{this.grnList=e?.response?.data||[],this.isGrnLoading=!1})}onGrnInput(){this.clearGrnReference(),this.grnSearch$.next(this.debitNoteForm.get("grnNo")?.value||"")}clearGrnReference(){this.grnId=null,this.asnId=null,this.poId=null,this.invoiceId=null,this.supplierId=null,this.buyerId=null,this.productFormValues=[],this.productRequiredError=!1}selectGrn(e){let o=this.grnList.find(r=>r.grn_number===e);
1o&&(this.grnId=o.id??null,this.asnId=o.asn_id??null,this.poId=o.po_id??null,this.invoiceId=o.invoice_id??null,this.supplierId=o.supplier_id??null,this.buyerId=o.buyer_id??null,this.debitNoteForm.patchValue({grnNo:o.grn_number??o.grn_id??"",grnDate:o.grn_date??"",poNumber:o.po_number??"",supplierName:o.supplier_name??"",gstNumber:o.supplier_gst||o.gst_number||"",supplierAddress:o.supplier_address??"",invoiceNo:o.invoice_number??"",invoiceDate:o.invoice_date??"",invoiceOriginalAmount:o.invoice_original_amount??""}),this.loadGrnProducts())}loadGrnProducts(){let e=this.asnId??this.grnId;e&&(this.isGrnDetailsLoading=!0,this.FinanceOrderService.getGrnDetails({asn_id:e}).subscribe({next:o=>{this.isGrnDetailsLoading=!1;let r=o?.response?.data;if(!r){this.notificationService.showError("Failed to load the GRN products.");return}this.poId=r.po_id??r.po_main_id??this.poId,this.invoiceId=r.invoice_main_id??this.invoiceId,this.supplierId=r.seller_id??this.supplierId,this.buyerId=r.buyer_id??this.buyerId;let c=r.products||r.packages?.[0]?.asn_products||[];this.productFormValues=c.map(g=>{let h=Number(g.received_qty??g.received_quantity??g.sent_quantity??g.quantity??0)||0,C=Number(g.invoice_qty??g.requested_qty??g.requested_quantity??h)||0;return{productId:g.product_id??g.item_id??null,parentId:g.parent_id??null,productName:g.product_name||g.name||"",skuId:g.sku||g.sku_id||"",invoiceQty:C,receivedQty:h,rejectedQty:Number(g.rejected_qty??g.rejected_quantity??0)||0,unitPrice:Number(g.price_per_unit??g.unit_price??0)||0,tax:Number(g.gst_percentage??g.tax_percent??g.tax??0)||0,adjustmentType:"full",adjustmentPercent:0}}),this.productRequiredError=!1},error:()=>{this.isGrnDetailsLoading=!1,this.notificationService.showError("Failed to load the GRN products.")}}))}prefillDebitNoteNumber(){this.FinanceOrderService.getDebitNoteNextNumber({type:"DEBIT_NOTE"}).subscribe({next:e=>{let o=e?.response?.debit_note_number;o&&this.debitNoteForm.patchValue({debitNoteNumber:o})},error:()=>{}})}lineBase(e){return(Number(e?.receivedQty)||0)*(Number(e?.unitPrice)||0)}lineAdjustment(e){let o=this.lineBase(e);return String(e?.adjustmentType).toLowerCase()==="partial"?o*(Number(e?.adjustmentPercent)||0)/100:o}lineTaxAdjustment(e){return this.lineAdjustment(e)*(Number(e?.tax)||0)/100}lineDebitAmount(e){return this.lineAdjustment(e)+this.lineTaxAdjustment(e)}get adjustmentAmountTotal(){return this.productFormValues.reduce((e,o)=>e+this.lineAdjustment(o),0)}get taxAdjustmentTotal(){return this.productFormValues.reduce((e,o)=>e+this.lineTaxAdjustment(o),0)}get totalDebitAmount(){return this.adjustmentAmountTotal+this.taxAdjustmentTotal+this.getAdditionalCharges}calculateSummary(){}get additionalChargesArray(){return this.debitNoteForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.additionalChargesArray;return!e||e.length===0?0:e.controls.reduce((o,r)=>{let c=Number(r.get("amount")?.value)||0;return o+c},0)}addAdditionalCharge(){this.debitNoteForm.get("additionalCharges").push(this.fbs.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.debitNoteForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.productRequiredError=!1}requestDeleteProduct(e){this.confirmDeleteIndex=e,vn("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null,this.productRequiredError=this.productFormValues.length===0),vn("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,vn("closeDeleteConfirmModal")}trackByIndex(e){return e}toInt(e){let o=parseInt(e,10);return isNaN(o)?null:o}onSubmit(){if(this.submitted=!0,this.debitNoteForm.markAllAsTouched(),!this.productFormValues.length){this.productRequiredError=!0,this.notificationService.showError("Please add at least one product.");return}
1if(this.debitNoteForm.invalid){this.notificationService.showError("Please fill all required fields.");return}let e=this.debitNoteForm.value,o={grn_id:this.grnId??this.toInt(e.grnNo),grn_date:e.grnDate||null,po_number:this.poId??this.toInt(e.poNumber),supplier_id:this.supplierId,supplier_name:e.supplierName||"",supplier_gst:e.gstNumber||"",supplier_address:e.supplierAddress||"",invoice_id:this.invoiceId??this.toInt(e.invoiceNo),buyer_id:this.buyerId,debit_note_date:e.debitNoteDate,debit_note_number:e.debitNoteNumber||"",reason:e.remarks||"",attachments:this.uploadedTermsDocs.map(r=>r.path),adjustment_amount:this.adjustmentAmountTotal,tax_amount:this.taxAdjustmentTotal,additional_charges_total:this.getAdditionalCharges,total_debit_amount:this.totalDebitAmount,products:this.productFormValues.map(r=>({product_id:r.parentId??r.productId??null,product_name:r.productName,product_sku:r.skuId||"",invoice_qty:Number(r.invoiceQty)||0,received_qty:Number(r.receivedQty)||0,rejected_qty:Number(r.rejectedQty)||0,debit_qty:Number(r.receivedQty)||0,unit_price:Number(r.unitPrice)||0,tax_percent:Number(r.tax)||0,adjustment_type:String(r.adjustmentType||"full").toUpperCase(),adju
1stment_percentage:String(r.adjustmentType).toLowerCase()==="partial"?Number(r.adjustmentPercent)||0:100,adjustment_amount:this.lineAdjustment(r),tax_adjustment:this.lineTaxAdjustment(r),debit_amount:this.lineDebitAmount(r)}))};this.isSubmitting=!0,this.FinanceOrderService.createDebitNote(o).subscribe({next:r=>{if(this.isSubmitting=!1,r?.responseCode===200){let c=typeof r?.response?.response=="string"&&r.response.response||typeof r?.response=="string"&&r.response||"Debit note created successfully.";this.notificationService.showSuccess(c),this.router.navigate(["/finance-management/payable-debit-notes"])}else this.notificationService.showError(typeof r?.response=="string"?r.response:"Failed to create debit note.")},error:()=>{this.isSubmitting=!1,this.notificationService.showError("Something went wrong!")}})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=o[r],g=new FormData;g.append("file",c),g.append("source","po"),g.append("source_id",""),this.FinanceOrderService.FileUpload(g).subscribe(h=>{h.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:h.response.file_name,path:h.response.filepath,viewPath:h.response.fileViewPath}]:this.notificationService.showError(h.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},h=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(K),T(z),T(H))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-debit-note"]],viewQuery:function(o,r){if(o&1&&N(ck,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:184,vars:41,consts:[["grnAuto","matAutocomplete"],["docsinput",""],["financeDrawer",""],[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"create-debit-note-form",3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-3"],[1,"col-md-12","col-xl-4","form-group"],[1,"mod-form-label"],[1,"text-danger"],["type","text","formControlName","grnNo","placeholder","Search GRN Number","autocomplete","off",1,"form-control","mod-input",3,"input","matAutocomplete"],[3,"optionSelected"],["disabled","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-error",4,"ngIf"],["appTranslate","",1,"mod-form-label"],["type","date","formControlName","grnDate","readonly","",1,"form-control","mod-input"],["type","text","formControlName","poNumber","placeholder"," Purchase Order Number","readonly","",1,"form-control","mod-input"],["type","text","formControlName","supplierName","placeholder","Supplier Name","readonly","",1,"form-control","mod-input"],["type","text","formControlName","gstNumber","placeholder","GST Number","readonly","",1,"form-control","mod-input"],[1,"col-md-12","col-xl-12","form-group"],["type","text","formControlName","supplierAddress","readonly","",1,"form-control","mod-input"],["type","text","formControlName","invoiceNo","placeholder"," Invoice Number","readonly","",1,"form-control","mod-input"],["type","date","formControlName","invoiceDate","readonly","",1,"form-control","mod-input"],["type","text","formControlName","invoiceOriginalAmount","placeholder","Enter Original Invoice Amount","readonly","",1,"form-control","mod-input"],["type","text","formControlName","debitNoteNumber","placeholder","Enter Debit Note Number",1,"form-control","mod-input"],["type","date","formControlName","debitNoteDate",1,"form-control","mod-input"],[1,"table-dashboard"],[1,"col-12","px-0"],["class","fin-empty-products text-center py-4",4,"ngIf"],["class","table-responsive mod-table-wrapper","id","product_table",4,"ngIf"],["class","invali
1d-error mt-2","appTranslate","",4,"ngIf"],[1,"mt-4"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"col-md-8"],[1,"mod-card","h-100"],[1,"form-group"],["rows","6","formControlName","termsandConditions","placeholder","Please enter any applicable terms and conditions for this debit note.",1,"form-control","mod-input"],["type","file","id","debitNoteAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","debitNoteAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"col-md-4"],[1,"list-unstyled","fin-summary"],["appTranslateText",""],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["backButton","","type","button","appTranslate","",1,"mod-btn","mod-btn-light","mr-2",3,"backButtonFallback"],["type","submit",1,"mod-btn","mod-btn-primary",3,"disabled"],["class","spinner-border spinner-border-sm mr-1","role","status",4,"ngIf"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title","d-flex","align-items-cente"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],[1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],["moduleType","FINANCE","productType","PRODUCT",3,"productAdded","debitNoteMode"],["disabled",""],[3,"value"],[1,"text-muted"],[1,"invalid-error"],[1,"fin-empty-products","text-center","py-4"],["class","text-muted mb-0","appTranslate","",4,"ngIf"],["appTranslate","",1,"text-muted","mb-0"],["id","product_table",1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","table-dashboard","fin-product-table","mb-0"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"text-capitalize"],[1,"text-nowrap","fw-600"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],["appTranslate","",1,"invalid-error","mt-2"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class"," p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"],["role","status",1,"spinner-border","spinner-border-sm","mr-1"]],template:function(o,r){if(o&1){let c=I();i(0,"main",3)(1,"div",4)(2,"div",5)(3,"h2",6)(4,"a",7),x(5,"i",8),t(),i(6,"span",9),n(7,"Debit Note"),t()()()(),i(8,"form",10),S("ngSubmit",function(){return b(c),y(r.onSubmit())}),i(9,"div",11)(10,"div",12)(11,"h3",13),n(12,"Reference Details"),t()(),i(13,"div",14)(14,"div",15)(15,"div",16)(16,"label",17)(17,"span",9),n(18,"GRN"),t(),i(19,"sup",18),n(20,"*"),t()(),i(21,"input",19),S("input",function(){return b(c),y(r.onGrnInput())}),t(),i(22,"mat-autocomplete",20,0),S("optionSelected",function(h){return b(c),y(r.selectGrn(h.option.value))}),u(24,pk,3,0,"mat-option",21)(25,mk,5,4,"mat-option",22)(26,uk,3,0,"mat-option",21),t(),u(27,_k,3,0,"div",23),t(),i(28,"div",16)(29,"label",24),n(30,"GRN Date "),t(),x(31,"input",25),t(),i(32,"div",16)(33,"label",24),n(34,"PO Number "),t(),x(35,"input",26),t(),i(36,"div",16)(37,"label",24),n(38,"Supplier Name "),t(),x(39,"input",27),t(),i(40,"div",16)(41,"label",24),n(42,"GST Number "),t(),x(43,"input",28),t(),i(44,"div",29)(45,"label",24),n(46,"Supplier Address "),t(),x(47,"input",30),t()()()(),i(48,"div",11)(49,"div",12)(50,"h3",13),n(51,"Invoice Details"),t()(),i(52,"div",14)(53,"div",15)(54,"div",16)(55,"label",24),n(56," Invoice Number "),t(),x(57,"input",31),t(),i(58,"div",16)(59,"label",24),n(60," Invoice Date "),t(),x(61,"input",32),t(),i(62,"div",16)(63,"label",24),n(64," Original Invoice Amount"),t(),x(65,"input",33),t()()()(),i(66,"div",11)(67,"div",12)(68,"h3",13),n(69,"Debit Note Details"),t()(),i(70,"div",14)(71,"div",15)(72,"div",16)(73,"label",17)(74,"span",9),n(75,"Debit Note Number"),t(),i(76,"sup",18),n(77,"*"),t()(),x(78,"input",34),u(79,vk,3,0,"div",23),t(),i(80,"div",16)(81,"label",17)(82,"span",9),n(83,"Debit Note Date"),t(),i(84,"sup",18),n(85,"*"),t()(),x(86,"input",35),u(87,gk,3,0,"div",23),t()()()(),i(88,"div",11)(89,"div",12)(90,"h3",13),n(91,"Product Details"),t()(),i(92,"div",14)(93,"div",36)(94,"div",37),u(95,bk,4,3,"div",38)(96,Sk,27,2,"div",39)(97,Ck,2,0,"div",40),t(),i(98,"div",41),u(99,Ek,5,0,"div",42),i(100,"div",43),u(101,Tk,14,3,"div",44),t()()()()(),i(102,"div",45)(103,"div",46)(104,"div",47)(105,"div",12)(106,"h3",13),n(107,"Terms & Conditions"),t()(),i(108,"div",14)(109,"div",48)(110,"label",24),n(111,"Terms"),t(),x(112,"textarea",49),t(),i(113,"input",50,1),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(115,"label",51),x(116,"i",52),u(117,wk,2,0,"span",53)(118,Pk,2,0,"span",53),t(),u(119,Ok,1,2,"app-loader",54)(120,Fk,2,1,"div",55),t()()(),i(121,"div",56)(122,"div",47)(123,"div",12)(124,"h3",13),n(125,"Debit Note Summary"),t()(),i(126,"div",14)(127,"ul",57)(128,"li",58),n(129," Adjustment Amount "),i(130,"span"),n(131),_(132,"currencyFormat"),t()(),i(133,"li",58),n(134," Tax Adjustment "),i(135,"span"),n(136),_(137,"currencyFormat"),t()(),i(138,"li",58),n(139," Additional Charges "),i(140,"span"),n(141),_(142,"currencyFormat"),t()()()(),i(143,"div",59),n(144," Total Debit Amount "),i(145,"span"),n(146),_(147,"currencyFormat"),t()()()()(),i(148,"div",60)(149,"div",61)(150,"div",62)(151,"button",63),n(152,"Cancel"),t(),i(153,"button",64),u(154,Mk,1,0,"span",65),i(155,"span",9),n(156,"Save"),t()()()()()()(),x(157,"button",66)(158,"button",67),i(159,"div",68)(160,"div",69)(161,"div",70)(162,"div",71)(163,"h4",72),x(164,"i",73),i(165,"span",9),n(166,"Delete Product"),t()()(),i(167,"div",74)(168,"p",75),n(169),_(170,"t"),_(171,"async"),i(172,"strong"),n(173),t(),n(174,"? "),t(),i(175,"p",76),n(176,"This action cannot be undone."),t()(),i(177,"div",77)(178,"button",78),S("click",function(){return b(c),y(r.cancelDelete())}),n(179,"No, Keep it"),t(),i(180,"button",79),S("click",function(){return b(c),y(r.confirmDelete())}),n(181,"Yes, Delete"),t()()()()(),i(182,"app-common-bom-product-drawer",80,2),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C=w(23);l(4),s("backButtonFallback","/finance-management/payable-debit-notes"),l(4),s("formGroup",r.debitNoteForm),l(13),s("matAutocomplete",C),l(3),s("ngIf",r.isGrnLoading),l(
1),s("ngForOf",r.grnList),l(),s("ngIf",!r.isGrnLoading&&r.grnList.length===0),l(),s("ngIf",((c=r.debitNoteForm.get("grnNo"))==null?null:c.touched)&&((c=r.debitNoteForm.get("grnNo"))==null?null:c.invalid)),l(52),s("ngIf",((g=r.debitNoteForm.get("debitNoteNumber"))==null?null:g.touched)&&((g=r.debitNoteForm.get("debitNoteNumber"))==null?null:g.invalid)),l(8),s("ngIf",((h=r.debitNoteForm.get("debitNoteDate"))==null?null:h.touched)&&((h=r.debitNoteForm.get("debitNoteDate"))==null?null:h.invalid)),l(8),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",r.productFormValues.length),l(),s("ngIf",(r.submitted||r.productRequiredError)&&(!r.productFormValues||r.productFormValues.length===0)),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(11),f(v(132,29,r.adjustmentAmountTotal)),l(5),f(v(137,31,r.taxAdjustmentTotal)),l(5),f(v(142,33,r.getAdditionalCharges)),l(5),f(v(147,35,r.totalDebitAmount)),l(5),s("backButtonFallback","/finance-management/payable-debit-notes"),l(2),s("disabled",r.debitNoteForm.invalid||r.isSubmitting),l(),s("ngIf",r.isSubmitting),l(15),m("",v(171,39,v(170,37,"Are you sure you want to delete"))," "),l(4),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:""),l(9),s("debitNoteMode",!0)}},dependencies:[rt,J,W,Et,Oe,Ne,at,Pe,Ie,gt,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ki,Fi,On,ae,Bn],styles:[".searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.max-w-80px[_ngcontent-%COMP%]{max-width:80px}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.min-w-154px[_ngcontent-%COMP%]{min-width:154px}.ml-20[_ngcontent-%COMP%]{margin-left:20px}.min-h-21[_ngcontent-%COMP%]{min-height:21px}.border-right-black[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.125)}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;margin-top:80px;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}
1.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal;cursor:pointer}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;border:1px solid #ececec;border-radius:8px;overflow:hidden;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-theme[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:18px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}"]})}}return a})();var Ak=["creditNoteNumberTemplate"],Nk=["invoiceIdTemplate"],Vk=["totalAmountTemplate"],Bk=["statusTemplate"],Rk=["actionsTemplate"];function Lk(a,d){if(a&1){let e=I();i(0,"button",11),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onCreditNoteClick(r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.credit_note_number||"-"," ")}}function qk(a,d){if(a&1&&(i(0,"span",12),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function Gk(a,d){a&1&&(i(0,"button",20)(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",18),n(4,"Delete"),t()())}function Uk(a,d){if(a&1){let e=I();i(0,"button",13),x(1,"i",14),t(),i(2,"mat-menu",15,3)(4,"button",16),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onCreditNoteClick(r.id))}),i(5,"mat-icon",17),n(6,"visibility"),t(),i(7,"span",18),n(8,"View"),t()(),u(9,Gk,5,0,"button",19),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var nr=(()=>{class a{constructor(e,o,r,c,g){this.oService=e,this.router=o,this.snackBar=r,this.notificationService=c,this.cService=g,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"credit_note_number",label:"Credit Note Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Credit Note No."}},{key:"customer_name",label:"Supplier Name",selected:!0,dataType:"text",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Supplier"}},{key:"grn_no",label:"GRN No.",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search GRN No."}},{key:"invoice_no",label:"Invoice Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice Number"}},{key:"credit_note_date",label:"Credit Note Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"credit_note_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"total_amount",label:"Credit Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"adjusted_amount",label:"Balance Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-credit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"CREDIT-NOTE-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={credit_note_number:this.creditNoteNumberTemplate,invoice_id:this.invoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search,note_type:"RECEIVED"};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getCreditNoteList(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}
1onExportRequest(e){let o={type:"CREDIT",format:e.fileType},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.creditDebitNoteExport(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_credit_note_list.pdf":"payable_credit_note_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onCreditNoteClick(e){e&&this.router.navigate(["/finance-management/payable-credit-notes/details",e])}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.buyer[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payable-credit-notes"]],viewQuery:function(o,r){if(o&1&&(N(Ak,7),N(Nk,7),N(Vk,7),N(Bk,7),N(Rk,7)),o&2){let c;V(c=B())&&(r.creditNoteNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:14,vars:6,consts:[["creditNoteNumberTemplate",""],["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["appTranslate",""],["mat-menu-item","",4,"ngIf"],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",4)(1,"div",5)(2,"div",6)(3,"h2",7),n(4,"Credit Notes "),t()()(),i(5,"div",8)(6,"div",9)(7,"data-table",10),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))})("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(8,Lk,2,1,"ng-template",null,0,P)(10,qk,2,3,"ng-template",null,1,P)(12,Uk,10,2,"ng-template",null,2,P),t()}if(o&2){let c=w(13);l(7),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Xe,Je,et,Re,L,Le]})}}return a})();var jk=["creditNoteNumberTemplate"],$k=["invoiceIdTemplate"],zk=["totalAmountTemplate"],Wk=["statusTemplate"],Qk=["actionsTemplate"];function Yk(a,d){if(a&1){let e=I();i(0,"button",11),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onCreditNoteClick(r.id))}),n(1),t()}if(a&2){let e=d.$implicit;l(),m(" ",e.credit_note_number||"-"," ")}}function Hk(a,d){if(a&1&&(i(0,"span",12),n(1),t()),a&2){let e=d.$implicit;$e("background",e.status_color),l(),m(" ",e.status," ")}}function Kk(a,d){a&1&&(i(0,"button",20)(1,"mat-icon"),n(2,"delete"),t(),i(3,"span",18),n(4,"Delete"),t()())}function Zk(a,d){if(a&1){let e=I();i(0,"button",13),x(1,"i",14),t(),i(2,"mat-menu",15,3)(4,"button",16),S("click",function(){let r=b(e).$implicit,c=p();return y(c.onCreditNoteClick(r.id))}),i(5,"mat-icon",17),n(6,"visibility"),t(),i(7,"span",18),n(8,"View"),t()(),u(9,Kk,5,0,"button",19),t()}if(a&2){let e=d.$implicit,o=w(3);s("matMenuTriggerFor",o),l(9),s("ngIf",e.source=="Manual")}}var ar=(()=>{class a{constructor(e,o,r,c,g){this.oService=e,this.router=o,this.snackBar=r,this.notificationService=c,this.cService=g,this.cellTemplates={},this.tableData=[],this.pageLength=0,this.isLoading=!1,this.accessList=[],this.toolTipContent=Ze}ngOnInit(){this.cService.getModuleAccessList.subscribe(e=>{e&&(this.accessList=e)}),this.initializeTableConfig(),this.initializeCellTemplates()}initializeTableConfig(){let e=[{key:"credit_note_number",label:"Credit Note Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Credit Note No."}},{key:"customer_name",label:"Customer Name",selected:!0,dataType:"text",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Customer"}}
1,{key:"grn_no",label:"GRN No",selected:!0,dataType:"number",ellipsis:{maxLength:20,showTooltip:!0},sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search GRN No."}},{key:"invoice_no",label:"Invoice Number",selected:!0,dataType:"custom",sortable:{enabled:!0},filterable:{enabled:!0,type:"text",placeholder:"Search Invoice Number"}},{key:"credit_note_date",label:"Credit Note Date",selected:!0,dataType:"date",dateConfig:{format:"DD/MM/YYYY"},sortable:{enabled:!0},filterable:{enabled:!0,type:"daterange",apiKey:"credit_note_date__range",fromPlaceholder:"From Date",toPlaceholder:"To Date"}},{key:"total_amount",label:"Credit Amount",selected:!0,dataType:"custom",sortable:{enabled:!0}},{key:"status",label:"Status",selected:!0,dataType:"custom",sortable:{enabled:!0}}];this.tableConfig={tableId:"finance-payable-credit-notes",columns:e,features:{columnVisibility:!0,columnFilters:!0,tableSearch:!0,filterPanel:!1,pagination:!0,export:!0,refresh:!0,sorting:!0,stickyHeader:!1,stickyColumns:!1,selection:!1},pagination:{pageSize:10,pageSizeOptions:[5,10,25,100],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0},columnPersistence:{moduleName:"CREDIT-NOTE-LIST",useBackendApi:!0,useLocalStorage:!0},statePersistence:{storage:"queryParams"},emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!1}}}initializeCellTemplates(){this.cellTemplates={credit_note_number:this.creditNoteNumberTemplate,invoice_id:this.invoiceIdTemplate,total_amount:this.totalAmountTemplate,status:this.statusTemplate}}checkAccess(e){return!0}onDataRequest(e){this.isLoading=!0;let o={page:e.currentPage,page_size:e.pageLength,status:e.status,search:e.search,note_type:"ISSUED"};e.ordering&&(o.ordering=e.ordering),e.filters&&Object.keys(e.filters).length>0&&(o.filters=A({},e.filters)),this.oService.getCreditNoteList(o).subscribe({next:r=>{this.tableData=r.response?.data||[],this.pageLength=r.response?.count||0,this.tableActions=r.response?.actions,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load data"),this.isLoading=!1}})}onExportRequest(e){let o={type:"CREDIT",format:e.fileType},r=this.snackBar.open("The file is preparing to download...","",{duration:void 0});this.oService.creditDebitNoteExport(o).subscribe({next:c=>{r.dismiss();let g=new Blob([c],{type:e.fileType==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),h=window.URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download=e.fileType==="pdf"?"payable_credit_note_list.pdf":"payable_credit_note_list.xlsx",document.body.appendChild(C),C.click(),window.URL.revokeObjectURL(h)},error:()=>{r.dismiss(),this.snackBar.open("Export failed","",{duration:3e3})}})}onCreditNoteClick(e){e&&this.router.navigate(["/finance-management/receivable-credit-notes/details",e])}onInvoiceClick(e,o,r){if(!e||!o||!r)return;let c;r==="parent_invoice"?c="parent":r==="child_invoice"?c="child":c=r,this.router.navigate([lt.buyer[c][e]],{queryParams:{invoiceId:o,invoiceType:c}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(K),T(tt),T(H),T(ge))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-credit-notes"]],viewQuery:function(o,r){if(o&1&&(N(jk,7),N($k,7),N(zk,7),N(Wk,7),N(Qk,7)),o&2){let c;V(c=B())&&(r.creditNoteNumberTemplate=c.first),V(c=B())&&(r.invoiceIdTemplate=c.first),V(c=B())&&(r.totalAmountTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:14,vars:6,consts:[["creditNoteNumberTemplate",""],["statusTemplate",""],["actionsTemplate",""],["actionsMenu","matMenu"],[1,"mod-list-page"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"mod-card"],[1,"mod-card-body"],[3,"dataRequest","exportRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["type","button",1,"mod-btn-action",3,"click"],[1,"mod-table-badge","text-white","text-uppercase"],["type","button",1,"mod-btn-icon",3,"matMenuTriggerFor"],[1,"ri-more-2-fill"],[1,"dashboardActions--menu"],["mat-menu-item","",1,"min-h-0px",3,"click"],[1,"menu-option-icon"],["appTranslate",""],["mat-menu-item","",4,"ngIf"],["mat-menu-item",""]],template:function(o,r){if(o&1){let c=I();i(0,"main",4)(1,"div",5)(2,"div",6)(3,"h2",7),n(4,"Credit Notes "),t()()(),i(5,"div",8)(6,"div",9)(7,"data-table",10),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}
1)("exportRequest",function(h){return b(c),y(r.onExportRequest(h))}),t()()(),u(8,Yk,2,1,"ng-template",null,0,P)(10,Hk,2,3,"ng-template",null,1,P)(12,Zk,10,2,"ng-template",null,2,P),t()}if(o&2){let c=w(13);l(7),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c)}},dependencies:[W,Xe,Je,et,Re,L,Le]})}}return a})();var gn=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-payable-credit-notes"]],decls:2,vars:0,consts:[["appTranslate",""]],template:function(o,r){o&1&&(i(0,"p",0),n(1,"create-payable-credit-notes works!"),t())},dependencies:[L]})}}return a})();function Jk(a,d){a&1&&(i(0,"span"),x(1,"i",47),i(2,"span",6),n(3,"Print"),t()())}function Xk(a,d){a&1&&(i(0,"span")(1,"div",48)(2,"span",49),n(3,"Loading..."),t()(),i(4,"span",6),n(5,"Printing..."),t()())}function eF(a,d){a&1&&(i(0,"li",50)(1,"p",51),n(2,"No Attachments"),t()())}function tF(a,d){if(a&1&&(i(0,"li",50)(1,"p",52)(2,"a",53),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.url,q),l(),f(e.name)}}function iF(a,d){a&1&&(i(0,"tr")(1,"td",54),n(2,"No Products Found"),t()())}function nF(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",55),n(3),t()(),i(4,"td",56),n(5),t(),i(6,"td"),n(7),t(),i(8,"td"),n(9),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),t(),i(18,"td"),n(19),t()()),a&2){let e=d.$implicit;l(2),s("title",e.product_name),l(),f(e.product_name),l(2),f(e.product_sku),l(2),f(e.invoice_qty),l(2),f(e.rejected_qty),l(2),f(e.debit_qty),l(2),f(e.accepted_qty),l(2),f(e.unit_price),l(2),f(e.tax_percent),l(2),f(e.total_price)}}var rr=(()=>{class a{constructor(e,o){this.financeService=e,this.route=o,this.creditNoteDetails={},this.creditNoteItems=[],this.creditNoteAttachments={},this.isPrintLoading=!1}ngOnInit(){this.creditNoteId=this.route.snapshot.paramMap.get("id"),this.getCreditNoteDetails()}getCreditNoteDetails(){let e={id:this.creditNoteId,type:"PAYABLE"};this.financeService.getCreditNoteDetailsById(e).subscribe({next:o=>{this.creditNoteDetails=o.response||{},this.creditNoteItems=o.response.items||[],this.creditNoteAttachments=o.response.attachments,console.log(this.creditNoteItems)}})}printDocument(){this.isPrintLoading=!0,this.financeService.printPdf("CREDIT_NOTE_RECEIVED",Number(this.creditNoteId),"PAYABLE").subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de))}}static{this.\u0275cmp=R({type:a,selectors:[["app-payable-credit-note-details"]],decls:191,vars:37,consts:[[1,"createCommonModuleMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-auto"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"create-debit-note-form"],[1,"row"],[1,"col-md-12","basic-debit-noteCreationCol"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-4"],[1,"col-md-12","col-xl-4"],["appTranslate","",1,"finance-note-label"],[1,"finance-note-value","linkHoverBlue"],[1,"finance-note-value"],[1,"col-md-12","col-xl-12"],["appTranslate","",1,"finance-note-label","mt-4"],[1,"mod-card","mod-card-body"],["appTranslate","",1,"h5","fw-600","text-dark","mb-0","mt-4"],[1,"list-inline"],["class","list-inline-item mt-2",4,"ngIf"],["class","list-inline-item mt-2",4,"ngFor","ngForOf"],[1,"badge","badge-green-s","commonBadge","py-2","px-4"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table","mb-0"],[1,""],["appTranslate","",1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"card-footer"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],[1,"list-inline-item","mt-2"],["appTranslate","",1,"text-muted"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"],["colspan","8","appTranslate","",1,"text-center","text-danger"],[1,"mod-clamp-2",3,"title"],[1,"product-id-cell"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3)(4,"a",4),x(5,"i",5),t(),i(6,"span",6),n(7,"Credit Note"),t()()(),i(8,"div",7)(9,"button",8),S("click",function(){return r.printDocument()}),u(10,Jk,4,0,"span",9)(11,Xk,6,0,"span",9),t()()(),i(12,"form",10)(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14)(17,"h3",15),n(18,"Reference Details"),t()(),i(19,"div",16)(20,"div",17)(21,"div",18)(22,"h6",19),n(23,"GRN ID"),t(),i(24,"p",20),n(25),t()(),i(26,"div",18)(27,"h6",19),n(28,"GRN Date"),t(),i(29,"p",21),n(30),t()(),i(31,"div",18)(32,"h6",19),n(33,"PO Number"),t(),i(34,"p",20),n(35),t()(),i(36,"div",18)(37,"h6",19),n(38,"Supplier Name"),t(),i(39,"p",21),n(4
10),t()(),i(41,"div",18)(42,"h6",19),n(43,"GST Number"),t(),i(44,"p",21),n(45),t()(),i(46,"div",22)(47,"h6",19),n(48,"Address"),t(),i(49,"p",21),n(50),t()()()()(),i(51,"div",13)(52,"div",14)(53,"h3",15),n(54,"Invoice Details"),t()(),i(55,"div",16)(56,"div",17)(57,"div",18)(58,"h6",19),n(59,"Invoice Number"),t(),i(60,"p",20),n(61),t()(),i(62,"div",18)(63,"h6",19),n(64,"Invoice Date"),t(),i(65,"p",21),n(66),t()(),i(67,"div",18)(68,"h6",19),n(69,"Original Invoice Amount"),t(),i(70,"p",21),n(71),t()()()()(),i(72,"div",13)(73,"div",14)(74,"h3",15),n(75,"Debit Note Details"),t()(),i(76,"div",16)(77,"div",17)(78,"div",18)(79,"h6",19),n(80,"Debit Note Number"),t(),i(81,"p",20),n(82),t()(),i(83,"div",18)(84,"h6",19),n(85,"Debit Note Date"),t(),i(86,"p",21),n(87),t()()(),i(88,"h6",23),n(89,"Debit Note Reason/Remarks"),t(),i(90,"div",24)(91,"p"),n(92),t()(),i(93,"h5",25),n(94,"Attachements"),t(),i(95,"ul",26),u(96,eF,3,0,"li",27)(97,tF,4,2,"li",28),t()()(),i(98,"div",13)(99,"div",14)(100,"h3",15),n(101,"Credit Note Details"),t()(),i(102,"div",16)(103,"div",17)(104,"div",18)(105,"h6",19),n(106,"Credit Note Number"),t(),i(107,"p",21),n(108),t()(),i(109,"div",18)(110,"h6",19),n(111,"Credit Note Date"),t(),i(112,"p",21),n(113),t()(),i(114,"div",18)(115,"h6",19),n(116,"Credit Note Type"),t(),i(117,"p",21),n(118),t()(),i(119,"div",18)(120,"h6",19),n(121,"Settlement Type"),t(),i(122,"p",21),n(123),t()(),i(124,"div",18)(125,"h6",19),n(126,"Status"),t(),i(127,"p",21)(128,"span",29),n(129),t()()()()()(),i(130,"div",13)(131,"div",30)(132,"h3",15),n(133,"Product Details"),t()(),i(134,"div",31)(135,"div",32)(136,"div",33)(137,"table",34)(138,"thead",35)(139,"tr")(140,"th",36),n(141," Product Name"),t(),i(142,"th",36),n(143," Product SKU ID"),t(),i(144,"th",36),n(145," Invoice Quantity"),t(),i(146,"th",36),n(147," Rejected Quantity"),t(),i(148,"th",36),n(149," Debit Quantity"),t(),i(150,"th",36),n(151," Accepted Quantity"),t(),i(152,"th",36),n(153," Unit price"),t(),i(154,"th",36),n(155," Tax (%)"),t(),i(156,"th",36),n(157," Total Price"),t()()(),i(158,"tbody"),u(159,iF,3,0,"tr",9)(160,nF,20,10,"tr",37),t()()()()()(),i(161,"div",38),x(162,"div",39),i(163,"div",40)(164,"div",41)(165,"div",42)(166,"ul",43)(167,"li",44)(168,"span",6),n(169,"Gross Total:"),t(),i(170,"span",45),n(171),_(172,"currencyFormat"),t()(),i(173,"li",44)(174,"span",6),n(175,"Net Total:"),t(),i(176,"span",45),n(177),_(178,"currencyFormat"),t()(),i(179,"li",44)(180,"span",6),n(181,"GST (%):"),t(),i(182,"span",45),n(183),_(184,"currencyFormat"),t()()()(),i(185,"div",46)(186,"span",6),n(187,"Total Credit Note Amount : "),t(),i(188,"span",45),n(189),_(190,"currencyFormat"),t()()()()()()()()()),o&2&&(l(4),s("backButtonFallback","finance-management/payable-credit-notes"),l(5),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(14),f(r.creditNoteDetails.grn_id||"--"),l(5),f(r.creditNoteDetails.grn_date||"--"),l(5),f(r.creditNoteDetails.po_number||"--"),l(5),f(r.creditNoteDetails.supplier_name||"--"),l(5),f(r.creditNoteDetails.supplier_gst||"--"),l(5),f(r.creditNoteDetails.supplier_address||"--"),l(11),m("",r.creditNoteDetails.invoice_number||"--"," "),l(5),f(r.creditNoteDetails.invoice_date||"--"),l(5),f(r.creditNoteDetails.invoice_amount||"--"),l(11),m(" ",r.creditNoteDetails.debit_note_number||"--",""),l(5),f(r.creditNoteDetails.debit_note_date||"--"),l(5),m(" ",r.creditNoteDetails.remarks||"--",""),l(4),s("ngIf",!r.creditNoteAttachments||r.creditNoteAttachments.length===0),l(),s("ngForOf",r.creditNoteAttachments),l(11),f(r.creditNoteDetails.credit_note_number||"--"),l(5),f(r.creditNoteDetails.credit_note_date||"--"),l(5),f(r.creditNoteDetails.credit_note_type||"--"),l(5),f(r.creditNoteDetails.settlement_type||"--"),l(6),m(" ",r.creditNoteDetails.status||"--",""),l(30),s("ngIf",r.creditNoteItems.length===0),l(),s("ngForOf",r.creditNoteItems),l(11),m(" ",r.creditNoteDetails.invoice_amount?v(172,29,r.creditNoteDetails.invoice_amount):"--",""),l(6),m(" ",r.creditNoteDetails.subtotal?v(178,31,r.creditNoteDetails.subtotal):"--",""),l(6),m(" ",r.creditNoteDetails.tax_amount?v(184,33,r.creditNoteDetails.tax_amount):"--",""),l(6),m(" ",r.creditNoteDetails.total_amount?v(190,35,r.creditNoteDetails.total_amount):"--",""))},dependencies:[J,W,Oe,Ie,qt,Z,L,ae],styles:[".finance-note-bottom-border[_ngcontent-%COMP%]{border-bottom:1px solid #dedede;padding-bottom:3rem;margin-bottom:3rem}.finance-detail-titles[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:600;color:#343a40!important;font-size:1.2rem}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var fn=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-receivable-credit-notes"]],decls:2,vars:0,consts:[["appTranslate",""]],template:function(o,r){o&1&&(i(0,"p",0),n(1,"create-receivable-credit-notes works!"),t())},dependencies:[L]})}}return a})();
1function aF(a,d){a&1&&(i(0,"span"),x(1,"i",46),i(2,"span",6),n(3,"Print"),t()())}function rF(a,d){a&1&&(i(0,"span")(1,"div",47)(2,"span",48),n(3,"Loading..."),t()(),i(4,"span",6),n(5,"Printing..."),t()())}function lF(a,d){a&1&&(i(0,"tr")(1,"td",49),n(2,"No Products Found"),t()())}function oF(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",50),n(3),t()(),i(4,"td",51),n(5),t(),i(6,"td"),n(7),t(),i(8,"td"),n(9),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),t(),i(18,"td"),n(19),t()()),a&2){let e=d.$implicit;l(2),s("title",e.product_name),l(),f(e.product_name),l(2),f(e.product_sku),l(2),f(e.invoice_qty),l(2),f(e.rejected_qty),l(2),f(e.debit_qty),l(2),f(e.accepted_qty),l(2),f(e.unit_price),l(2),f(e.tax_percent),l(2),f(e.total_price)}}function sF(a,d){a&1&&(i(0,"li",52)(1,"p",53),n(2,"No Attachments"),t()())}function dF(a,d){if(a&1&&(i(0,"li",52)(1,"p",54)(2,"a",55),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.url,q),l(),f(e.name)}}var lr=(()=>{class a{constructor(e,o){this.financeService=e,this.route=o,this.creditNoteDetails={},this.creditNoteItems=[],this.creditNoteAttachments={},this.isPrintLoading=!1}ngOnInit(){this.creditNoteId=this.route.snapshot.paramMap.get("id"),this.getCreditNoteDetails()}getCreditNoteDetails(){let e={id:this.creditNoteId,type:"RECEIVABLE"};this.financeService.getCreditNoteDetailsById(e).subscribe({next:o=>{this.creditNoteDetails=o.response||{},this.creditNoteItems=o.response.items||[],this.creditNoteAttachments=o.response.attachments,console.log(this.creditNoteItems)}})}printDocument(){this.isPrintLoading=!0,this.financeService.printPdf("CREDIT_NOTE_ISSUED",Number(this.creditNoteId),"RECEIVABLE").subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-credit-note-details"]],decls:195,vars:37,consts:[[1,"createCommonModuleMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-auto"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"create-debit-note-form"],[1,"row"],[1,"col-md-12","basic-debit-noteCreationCol"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-4"],[1,"col-md-12","col-xl-4"],["appTranslate","",1,"finance-note-label"],[1,"finance-note-value","linkHoverBlue"],[1,"finance-note-value"],[1,"col-md-12","col-xl-12"],[1,"badge","badge-green-s","commonBadge","py-2","px-4"],[1,"mod-card","mod-card-body"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table","mb-0"],[1,""],["appTranslate","",1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"list-inline"],["class","list-inline-item mt-2",4,"ngIf"],["class","list-inline-item mt-2",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"card-footer"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["colspan","8","appTranslate","",1,"text-center","text-danger"],[1,"mod-clamp-2",3,"title"],[1,"product-id-cell"],[1,"list-inline-item","mt-2"],["appTranslate","",1,"text-muted"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3)(4,"a",4),x(5,"i",5),t(),i(6,"span",6),n(7,"Credit Note"),t()()(),i(8,"div",7)(9,"button",8),S("click",function(){return r.printDocument()}),u(10,aF,4,0,"span",9)(11,rF,6,0,"span",9),t()()(),i(12,"form",10)(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14)(17,"h3",15),n(18,"Reference Details"),t()(),i(19,"div",16)(20,"div",17)(21,"div",18)(22,"h6",19),n(23,"GRN ID"),t(),i(24,"p",20),n(25),t()(),i(26,"div",18)(27,"h6",19),n(28,"GRN Date"),t(),i(29,"p",21),n(30),t()(),i(31,"div",18)(32,"h6",19),n(33,"PO Number"),t(),i(34,"p",20),n(35),t()(),i(36,"div",18)(37,"h6",19),n(38,"Buyer Name"),t(),i(39,"p",21),n(4
10),t()(),i(41,"div",18)(42,"h6",19),n(43,"GST Number"),t(),i(44,"p",21),n(45),t()(),i(46,"div",22)(47,"h6",19),n(48,"Address"),t(),i(49,"p",21),n(50),t()()()()(),i(51,"div",13)(52,"div",14)(53,"h3",15),n(54,"Invoice Details"),t()(),i(55,"div",16)(56,"div",17)(57,"div",18)(58,"h6",19),n(59,"Invoice Number"),t(),i(60,"p",20),n(61),t()(),i(62,"div",18)(63,"h6",19),n(64,"Invoice Date"),t(),i(65,"p",21),n(66),t()(),i(67,"div",18)(68,"h6",19),n(69,"Original Invoice Amount"),t(),i(70,"p",21),n(71),t()()()()(),i(72,"div",13)(73,"div",14)(74,"h3",15),n(75,"Debit Note Details"),t()(),i(76,"div",16)(77,"div",17)(78,"div",18)(79,"h6",19),n(80,"Debit Note Number"),t(),i(81,"p",20),n(82),t()(),i(83,"div",18)(84,"h6",19),n(85,"Debit Note Date"),t(),i(86,"p",21),n(87),t()()()()(),i(88,"div",13)(89,"div",14)(90,"h3",15),n(91,"Credit Note Details"),t()(),i(92,"div",16)(93,"div",17)(94,"div",18)(95,"h6",19),n(96,"Credit Note Number"),t(),i(97,"p",21),n(98),t()(),i(99,"div",18)(100,"h6",19),n(101,"Credit Note Date"),t(),i(102,"p",21),n(103),t()(),i(104,"div",18)(105,"h6",19),n(106,"Credit Note Type"),t(),i(107,"p",21),n(108),t()(),i(109,"div",18)(110,"h6",19),n(111,"Settlement Type"),t(),i(112,"p",21),n(113),t()(),i(114,"div",18)(115,"h6",19),n(116,"Status"),t(),i(117,"p",21)(118,"span",23),n(119),t()()(),i(120,"div",22)(121,"h6",19),n(122,"Credit Note Reason/Remarks"),t(),i(123,"div",24)(124,"p"),n(125),t()()()()()(),i(126,"div",13)(127,"div",25)(128,"h3",15),n(129,"Product Details"),t()(),i(130,"div",26)(131,"div",27)(132,"div",28)(133,"table",29)(134,"thead",30)(135,"tr")(136,"th",31),n(137," Product Name"),t(),i(138,"th",31),n(139," Product SKU ID"),t(),i(140,"th",31),n(141," Invoice Quantity"),t(),i(142,"th",31),n(143," Rejected Quantity"),t(),i(144,"th",31),n(145," Debit Quantity"),t(),i(146,"th",31),n(147," Accepted Quantity"),t(),i(148,"th",31),n(149," Unit price"),t(),i(150,"th",31),n(151," Tax (%)"),t(),i(152,"th",31),n(153," Total Price"),t()()(),i(154,"tbody"),u(155,lF,3,0,"tr",9)(156,oF,20,10,"tr",32),t()()()()()(),i(157,"div",33)(158,"div",34)(159,"div",35)(160,"div",14)(161,"h3",15),n(162,"Attachements"),t()(),i(163,"div",16)(164,"ul",36),u(165,sF,3,0,"li",37)(166,dF,4,2,"li",38),t()()()(),i(167,"div",39)(168,"div",40)(169,"div",41)(170,"ul",42)(171,"li",43)(172,"span",6),n(173,"Gross Total:"),t(),i(174,"span",44),n(175),_(176,"currencyFormat"),t()(),i(177,"li",43)(178,"span",6),n(179,"Net Total:"),t(),i(180,"span",44),n(181),_(182,"currencyFormat"),t()(),i(183,"li",43)(184,"span",6),n(185,"GST (%):"),t(),i(186,"span",44),n(187),_(188,"currencyFormat"),t()()()(),i(189,"div",45)(190,"span",6),n(191,"Total Debit Note Amount : "),t(),i(192,"span",44),n(193),_(194,"currencyFormat"),t()()()()()()()()()),o&2&&(l(4),s("backButtonFallback","finance-management/payable-credit-notes"),l(5),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(14),f(r.creditNoteDetails.grn_id||"--"),l(5),f(r.creditNoteDetails.grn_date||"--"),l(5),f(r.creditNoteDetails.po_number||"--"),l(5),f(r.creditNoteDetails.buyer_name||"--"),l(5),f(r.creditNoteDetails.buyer_gst||"--"),l(5),f(r.creditNoteDetails.buyer_address||"--"),l(11),m("",r.creditNoteDetails.invoice_number||"--"," "),l(5),f(r.creditNoteDetails.invoice_date||"--"),l(5),f(r.creditNoteDetails.invoice_amount||"--"),l(11),f(r.creditNoteDetails.debit_note_number||"--"),l(5),f(r.creditNoteDetails.debit_note_date||"--"),l(11),f(r.creditNoteDetails.credit_note_number||"--"),l(5),f(r.creditNoteDetails.credit_note_date||"--"),l(5),f(r.creditNoteDetails.credit_note_type||"--"),l(5),f(r.creditNoteDetails.settlement_type||"--"),l(6),m(" ",r.creditNoteDetails.status||"--",""),l(6),m(" ",r.creditNoteDetails.remarks||"--",""),l(30),s("ngIf",r.creditNoteItems.length===0),l(),s("ngForOf",r.creditNoteItems),l(9),s("ngIf",!r.creditNoteAttachments||r.creditNoteAttachments.length===0),l(),s("ngForOf",r.creditNoteAttachments),l(9),m(" ",r.creditNoteDetails.invoice_amount?v(176,29,r.creditNoteDetails.invoice_amount):"--",""),l(6),m(" ",r.creditNoteDetails.subtotal?v(182,31,r.creditNoteDetails.subtotal):"--",""),l(6),m(" ",r.creditNoteDetails.tax_amount?v(188,33,r.creditNoteDetails.tax_amount):"--",""),l(6),m(" ",r.creditNoteDetails.total_amount?v(194,35,r.creditNoteDetails.total_amount):"--",""))},dependencies:[J,W,Oe,Ie,qt,Z,L,ae],styles:[".finance-note-bottom-border[_ngcontent-%COMP%]{border-bottom:1px solid #dedede;padding-bottom:3rem;margin-bottom:3rem}.finance-detail-titles[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:600;color:#343a40!important;font-size:1.2rem}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var hn=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-receivable-debit-notes"]],decls:193,vars:3,consts:[[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"create-debit-note-form"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-3"],[1,"col-md-12","col-xl-4","form-group"],[1,"mod-form-label"],[1,"text-danger"],["type","text","placeholder","Enter GRN Number",1,"form-control","mod-input"],["appTranslate","",1,"mod-form-label"],["type","date","readonly","",1,"form-control","mod-input"],["type","text","placeholder"," Purchase Order Number","readonly","",1,"form-control","mod-input"],["type","text","placeholder","Supplier Name","readonly","",1,"form-control","mod-input"],["type","text","placeholder","GST Number","readonly","",1,"form-control","mod-input"],[1,"col-md-12","col-xl-12","form-group"],["type","text","placeholder","Plot No. 45, Industrial Area, Phase II, Chandigarh, India - 160002","readonly","",1,"form-control","mod-input"],["type","text","placeholder"," Invoice Number","readonly","",1,"form-control","mod-input"],["type","text","placeholder","Enter Original Invoice Amount","readonly","",1,"form-control","mod-input"],["type","text","placeholder","Enter Debit Note Number",1,"form-control","mod-input"],["type","date",1,"form-control","mod-input"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","mb-0"],[1,"row","mt-1","mb-24"],[1,"col-md-7","col-12","col-xl-8"],[1,"mod-card"],[1,"form-group"],["appTranslate","",1,"fw-600","mod-form-label"],["rows","5","placeholder","Please write Reason for Debit Note, if any concern in PO",1,"form-control","mod-input"],[1,"row"],[1,"col-12"],[1,"custom-file"],["type","file","id","imgInp_01","multiple","",1,"custom-file-input"],["for","imgInp_01","appTranslate","",1,"custom-file-label"],[1,"list-inline"],[1,"list-inline-item","mt-2"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["href","#","target","_blank"],[1,"ml-auto","pl-15","text-danger","cursor-pointer"],[1,"uil","uil-times-circle","font-18"],[1,"col-md-5","col-12","col-xl-4"],[1,"mod-card","h-100"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"mb-2","ml-2"],[1,"mod-card-footer","theme-bg","text-white","fw-600"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["backButton","","type","button","appTranslate","",1,"mod-btn","mod-btn-light",3,"backButtonFallback"],["backButton","","type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"backButtonFallback"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3)(4,"a",4),x(5,"i",5),t(),i(6,"span",6),n(7,"Debit Note"),t()()()(),i(8,"form",7)(9,"div",8)(10,"div",9)(11,"h3",10),n(12,"Reference Details"),t()(),i(13,"div",11)(14,"div",12)(15,"div",13)(16,"label",14)(17,"span",6),n(18,"GRN"),t(),i(19,"sup",15),n(20,"*"),t()(),x(21,"input",16),t(),i(22,"div",13)(23,"label",17),n(24,"GRN Date "),t(),x(25,"input",18),t(),i(26,"div",13)(27,"label",17),n(28,"PO Number "),t(),x(29,"input",19),t(),i(30,"div",13)(31,"label",17),n(32,"Supplier Name "),t(),x(33,"input",20),t(),i(34,"div",13)(35,"label",17),n(36,"GST Number "),t(),x(37,"input",21),t(),i(38,"div",22)(39,"label",17),n(4
10,"Supplier Address "),t(),x(41,"input",23),t()()()(),i(42,"div",8)(43,"div",9)(44,"h3",10),n(45,"Invoice Details"),t()(),i(46,"div",11)(47,"div",12)(48,"div",13)(49,"label",17),n(50," Invoice Number "),t(),x(51,"input",24),t(),i(52,"div",13)(53,"label",17),n(54," Invoice Date "),t(),x(55,"input",18),t(),i(56,"div",13)(57,"label",17),n(58," Original Invoice Amount"),t(),x(59,"input",25),t()()()(),i(60,"div",8)(61,"div",9)(62,"h3",10),n(63,"Debit Note Details"),t()(),i(64,"div",11)(65,"div",12)(66,"div",13)(67,"label",14)(68,"span",6),n(69,"Debit Note Number"),t(),i(70,"sup",15),n(71,"*"),t()(),x(72,"input",26),t(),i(73,"div",13)(74,"label",14)(75,"span",6),n(76,"Debit Note Date"),t(),i(77,"sup",15),n(78,"*"),t()(),x(79,"input",27),t()()()(),i(80,"div",8)(81,"div",9)(82,"h3",10),n(83,"Product Details"),t()(),i(84,"div",11)(85,"div",28)(86,"div",29)(87,"table",30)(88,"thead")(89,"tr")(90,"th",6),n(91," Product Name"),t(),i(92,"th",6),n(93," Product SKU ID"),t(),i(94,"th",6),n(95," Invoice Quantity"),t(),i(96,"th",6),n(97," Rejected Quantity"),t(),i(98,"th",6),n(99," Debit Quantity"),t(),i(100,"th",6),n(101," Unit price"),t(),i(102,"th",6),n(103," Tax (%)"),t(),i(104,"th",6),n(105," Total Price"),t()()(),i(106,"tbody")(107,"tr")(108,"td"),n(109,"Schaeffler Axial Deep Groove Ball Bearing [51134-MP]"),t(),i(110,"td"),n(111,"0f0ab22196b73936a24c4bc235286d7c"),t(),i(112,"td"),n(113,"1002"),t(),i(114,"td"),n(115,"100"),t(),i(116,"td"),n(117,"12"),t(),i(118,"td"),n(119,"10"),t(),i(120,"td"),n(121,"10"),t(),i(122,"td"),n(123,"10"),t()()()()()()()(),i(124,"div",31)(125,"div",32)(126,"div",33)(127,"div",11)(128,"div",34)(129,"label",35),n(130,"Reason for Debit Note"),t(),x(131,"textarea",36),t(),i(132,"div",37)(133,"div",38)(134,"div",39),x(135,"input",40),i(136,"label",41),n(137,"Choose file"),t()()(),i(138,"div",38)(139,"ul",42)(140,"li",43)(141,"p",44)(142,"a",45),n(143,"Document1.pdf"),t(),i(144,"span",46),x(145,"i",47),t()()(),i(146,"li",43)(147,"p",44)(148,"a",45),n(149,"Document2.pdf"),t(),i(150,"span",46),x(151,"i",47),t()()()()()()()()(),i(152,"div",48)(153,"div",49)(154,"div",11)(155,"ul",50)(156,"li",51)(157,"b",6),n(158,"Subtotal (Taxable Value):"),t(),i(159,"span",52),n(160,"\u20B9 63,00,100.00"),t()(),i(161,"li",51)(162,"b",6),n(163,"Total Tax Credit :"),t(),i(164,"span",52),n(165," \u20B9 0.00"),t()(),i(166,"li",53)(167,"span",6),n(168,"SGST:"),t(),i(169,"span",52),n(170,"\u20B9 5,67,009.00"),t()(),i(171,"li",53)(172,"span",6),n(173,"CGST:"),t(),i(174,"span",52),n(175,"\u20B9 5,67,009.00"),t()(),i(176,"li",53)(177,"span",6),n(178,"IGST:"),t(),i(179,"span",52),n(180,"\u20B9 0.00"),t()()()(),i(181,"div",54)(182,"span",6),n(183,"Total Adjustment Amount:"),t(),i(184,"span",52),n(185,"\u20B9 74,34,118.00"),t()()()()(),i(186,"div",55)(187,"div",56)(188,"div",57)(189,"button",58),n(190,"Cancel"),t(),i(191,"button",59),n(192,"Save"),t()()()()()()),o&2&&(l(4),s("backButtonFallback","/templates/tools/quality-check-temp/list/"),l(185),s("backButtonFallback","/templates/tools/rfq-temp"),l(2),s("backButtonFallback","/templates/tools/finance-temp"))},dependencies:[Oe,Ie,qt,Z,L]})}}return a})();function cF(a,d){a&1&&(i(0,"span"),x(1,"i",48),i(2,"span",6),n(3,"Print"),t()())}function pF(a,d){a&1&&(i(0,"span")(1,"div",49)(2,"span",50),n(3,"Loading..."),t()(),i(4,"span",6),n(5,"Printing..."),t()())}function mF(a,d){a&1&&(i(0,"tr")(1,"td",51),n(2,"No Products Found"),t()())}function uF(a,d){if(a&1&&(i(0,"tr")(1,"td")(2,"span",52),n(3),t()(),i(4,"td",53),n(5),t(),i(6,"td"),n(7),t(),i(8,"td"),n(9),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),t(),i(16,"td"),n(17),t()()),a&2){let e=d.$implicit;l(2),s("title",e.product_name),l(),f(e.product_name),l(2),f(e.product_sku),l(2),f(e.invoice_qty),l(2),f(e.rejected_qty),l(2),f(e.debit_qty),l(2),f(e.unit_price),l(2),f(e.tax_percent),l(2),f(e.total_price)}}function _F(a,d){a&1&&(i(0,"li",54)(1,"p",55),n(2,"No Attachments"),t()())}function vF(a,d){if(a&1&&(i(0,"li",54)(1,"p",56)(2,"a",57),n(3),t()()()),a&2){let e=d.$implicit;l(2),s("href",e.url,q),l(),f(e.name)}}var or=(()=>{class a{constructor(e,o){this.financeService=e,this.route=o,this.debitNoteDetails={},this.debitNoteItems=[],this.debitNoteAttachments={},this.isPrintLoading=!1}
1ngOnInit(){this.debitNoteId=this.route.snapshot.paramMap.get("id"),this.getDebitNoteDetails()}getDebitNoteDetails(){let e={id:this.debitNoteId,type:"RECEIVABLE"};this.financeService.getDebitNoteDetailsById(e).subscribe({next:o=>{this.debitNoteDetails=o.response||{},this.debitNoteItems=o.response.items||[],this.debitNoteAttachments=o.response.attachments,console.log(this.debitNoteItems)}})}printDocument(){this.isPrintLoading=!0,this.financeService.printPdf("DEBIT_NOTE_ISSUED",Number(this.debitNoteId)).subscribe({next:e=>{this.isPrintLoading=!1,Te(e)},error:()=>{this.isPrintLoading=!1}})}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(de))}}static{this.\u0275cmp=R({type:a,selectors:[["app-receivable-debit-note-details"]],decls:162,vars:32,consts:[[1,"createCommonModuleMain","debit-note-details-main"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-auto"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click","disabled"],[4,"ngIf"],[1,"create-debit-note-form"],[1,"row"],[1,"col-md-12","basic-debit-noteCreationCol"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row","gut-row","gut-4"],[1,"col-md-12","col-xl-4"],["appTranslate","",1,"finance-note-label"],[1,"finance-note-value","linkHoverBlue"],[1,"finance-note-value"],[1,"col-md-12","col-xl-12"],[1,"mod-card-header","border-bottom-0"],[1,"mod-card-body","p-0"],[1,"table-dashboard"],["id","product_table",1,"table-responsive","mod-table-wrapper","mod-table-top-radius-flush","mod-thin-scrollbar"],[1,"table","mod-table","mb-0"],[1,""],["appTranslate","",1,"text-nowrap"],[4,"ngFor","ngForOf"],[1,"row","gut-row","gut-x-4","mb-4"],[1,"col-12","col-lg","splitedSummaryLefttSide"],[1,"mod-card","mb-4","h-100"],[1,"mod-card","mod-card-body","mt-24","mb-3"],["appTranslate","",1,"mt-5"],[1,"row","mt-2"],[1,"col-12"],[1,"list-inline"],["class","list-inline-item mt-2",4,"ngIf"],["class","list-inline-item mt-2",4,"ngFor","ngForOf"],[1,"col-12","col-lg","splitedSummaryRightSide"],[1,"card","totalCalculationCard"],[1,"card-body"],[1,"list-unstyled","mb-0"],[1,"mb-2"],[1,"float-right"],[1,"card-footer"],[1,"uil","uil-print"],["role","status",1,"spinner-border","spinner-border-sm","mr-2"],["appTranslate","",1,"sr-only"],["colspan","8","appTranslate","",1,"text-center","text-danger"],[1,"mod-clamp-2",3,"title"],[1,"product-id-cell"],[1,"list-inline-item","mt-2"],["appTranslate","",1,"text-muted"],[1,"d-flex","align-items-center","mb-4","px-2","py-1","border","font-italic","theme-color","border-style-dotted-i"],["target","_blank",3,"href"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3)(4,"a",4),x(5,"i",5),t(),i(6,"span",6),n(7,"Debit Note"),t()()(),i(8,"div",7)(9,"button",8),S("click",function(){return r.printDocument()}),u(10,cF,4,0,"span",9)(11,pF,6,0,"span",9),t()()(),i(12,"form",10)(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14)(17,"h3",15),n(18,"Reference Details"),t()(),i(19,"div",16)(20,"div",17)(21,"div",18)(22,"h6",19),n(23,"GRN ID"),t(),i(24,"p",20),n(25),t()(),i(26,"div",18)(27,"h6",19),n(28,"GRN Date"),t(),i(29,"p",21),n(30),t()(),i(31,"div",18)(32,"h6",19),n(33,"PO Number"),t(),i(34,"p",20),n(35),t()(),i(36,"div",18)(37,"h6",19),n(38,"Buyer Name"),t(),i(39,"p",21),n(40),t()(),i(41,"div",18)(42,"h6",19),n(43,"GST Number"),t(),i(44,"p",21),n(45),t()(),i(46,"div",22)(47,"h6",19),n(48,"Address"),t(),i(49,"p",21),n(50),t()()()()(),i(51,"div",13)(52,"div",14)(53,"h3",15),n(54,"Invoice Details"),t()(),i(55,"div",16)(56,"div",17)(57,"div",18)(58,"h6",19),n(59,"Invoice Number"),t(),i(60,"p",20),n(61),t()(),i(62,"div",18)(63,"h6",19),n(64,"Invoice Date"),t(),i(65,"p",21),n(66),t()(),i(67,"div",18)(68,"h6",19),n(69,"Original Invoice Amount"),t(),i(70,"p",21),n(71),t()()()()(),i(72,"div",13)(73,"div",14)(74,"h3",15),n(75,"Debit Note Details"),t()(),i(76,"div",16)(77,"div",17)(78,"div",18)(79,"h6",19),n(80,"Debit Note Number"),t(),i(81,"p",21),n(82),t()(),i(83,"div",18)(84,"h6",19),n(85,"Debit Note Date"),t(),i(86,"p",21),n(87),t()()()()(),i(88,"div",13)(89,"div",23)(90,"h3",15),n(91,"Product Details"),t()(),i(92,"div",24)(93,"div",25)(94,"div",26)(95,"table",27)(96,"thead",28)(97,"tr")(98,"th",29),n(99," Product Name"),t(),i(100,"th",29),n(101," Product SKU ID"),t(),i(102,"th",29),n(103," Invoice Quantity"),t(),i(104,"th",29),n(105," Rejected Quantity"),t(),i(106,"th",29),n(107," Debit Quantity"),t(),i(108,"th",29),n(109," Unit price"),t(),i(110,"th",29),n(111," Tax (%)"),t(),i(112,"th",29),n(113," Total Price"),t()()(),i(114,"tbody"),u(115,mF,3,0,"tr",9)(116,uF,18,9,"tr",30),t()()()()()(),i(117,"div",31)(118,"div",32)(119,"div",33)(120,"div",14)(121,"h3",15),n(122,"Reason for Debit Note"),t()(),i(123,"div",16)(124,"div",34)(125,"p"),n(126),t()(),i(127,"h5",35),n(128,"Attachements"),t(),i(129,"div",36)(130,"div",37)(131,"ul",38),u(132,_F,3,0,"li",39)(133,vF,4,2,"li",40),t()()()()()(),i(134,"div",41)(135,"div",42)(136,"div",43)(137,"ul",44)(138,"li",45)(139,"span",6),n(140,"Gross Total:"),t(),i(141,"span",46),n(142),_(143,"currencyFormat"),t()(),i(144,"li",45)(145,"span",6),n(146,"Net Total:"),t(),i(147,"span",46),n(148),_(149,"currencyFormat"),t()(),i(150,"li",45)(151,"span",6),n(152,"GST (%):"),t(),i(153,"span",46),n(154),_(155,"currencyFormat"),t()()()(),i(156,"div",47)(1
157,"span",6),n(158,"Total Debit Note Amount : "),t(),i(159,"span",46),n(160),_(161,"currencyFormat"),t()()()()()()()()()),o&2&&(l(4),s("backButtonFallback","/finance-management/payable-debit-notes"),l(5),s("disabled",r.isPrintLoading),l(),s("ngIf",!r.isPrintLoading),l(),s("ngIf",r.isPrintLoading),l(14),f(r.debitNoteDetails.grn_id||"--"),l(5),f(r.debitNoteDetails.grn_date||"--"),l(5),f(r.debitNoteDetails.po_number||"--"),l(5),f(r.debitNoteDetails.buyer_name||"--"),l(5),f(r.debitNoteDetails.buyer_gst||"--"),l(5),f(r.debitNoteDetails.buyer_address||"--"),l(11),m("",r.debitNoteDetails.invoice_number||"--"," "),l(5),f(r.debitNoteDetails.invoice_date||"--"),l(5),f(r.debitNoteDetails.invoice_amount||"--"),l(11),f(r.debitNoteDetails.debit_note_number||"--"),l(5),f(r.debitNoteDetails.debit_note_date||"--"),l(28),s("ngIf",r.debitNoteItems.length===0),l(),s("ngForOf",r.debitNoteItems),l(10),f(r.debitNoteDetails.reason||"--"),l(6),s("ngIf",!r.debitNoteAttachments||r.debitNoteAttachments.length===0),l(),s("ngForOf",r.debitNoteAttachments),l(9),m(" ",r.debitNoteDetails.invoice_amount?v(143,24,r.debitNoteDetails.invoice_amount):"--",""),l(6),m(" ",r.debitNoteDetails.subtotal?v(149,26,r.debitNoteDetails.subtotal):"--",""),l(6),m(" ",r.debitNoteDetails.tax_amount?v(155,28,r.debitNoteDetails.tax_amount):"--",""),l(6),m(" ",r.debitNoteDetails.total_amount?v(161,30,r.debitNoteDetails.total_amount):"--",""))},dependencies:[J,W,Oe,Ie,qt,Z,L,ae],styles:[".finance-note-bottom-border[_ngcontent-%COMP%]{border-bottom:1px solid #dedede;padding-bottom:3rem;margin-bottom:3rem}.finance-detail-titles[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:600;color:#343a40!important;font-size:1.2rem}#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .mod-clamp-2[_ngcontent-%COMP%]{display:-webkit-inline-box;max-width:240px;vertical-align:middle}@media (max-width: 1599.98px){#product_table[_ngcontent-%COMP%] .mod-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.product-id-cell[_ngcontent-%COMP%]{width:140px;white-space:normal;word-break:break-all}}"]})}}return a})();var li=a=>({"is-invalid":a});function gF(a,d){a&1&&(i(0,"div",7),n(1,"Bank Name is required "),t())}function fF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid Bank Name"),t())}function hF(a,d){if(a&1&&(i(0,"div",40),u(1,gF,2,0,"div",41)(2,fF,2,0,"div",41),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.Payment.get("BankName"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.Payment.get("BankName"))==null||o.errors==null?null:o.errors.pattern)}}function xF(a,d){a&1&&(i(0,"div",7),n(1,"Company Name or Holder Name is required"),t())}function bF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid Company Name or Holder Name"),t())}function yF(a,d){if(a&1&&(i(0,"div",40),u(1,xF,2,0,"div",41)(2,bF,2,0,"div",41),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.Payment.get("CompanyName"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.Payment.get("CompanyName"))==null||o.errors==null?null:o.errors.pattern)}}function SF(a,d){a&1&&(i(0,"div",7),n(1,"Account Number is required"),t())}function CF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid Account Number"),t())}function EF(a,d){if(a&1&&(i(0,"div",40),u(1,SF,2,0,"div",41)(2,CF,2,0,"div",41),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.Payment.get("AccountNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.Payment.get("AccountNumber"))==null||o.errors==null?null:o.errors.pattern)}}function IF(a,d){a&1&&(i(0,"div",42),n(1," Enter valid Account Number "),t())}function DF(a,d){a&1&&(i(0,"div",7),n(1,"IFSC code is required "),t())}function TF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid IFSC code"),t())}function wF(a,d){if(a&1&&(i(0,"div",40),u(1,DF,2,0,"div",41)(2,TF,2,0,"div",41),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.Payment.get("IFSCcode"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.Payment.get("IFSCcode"))==null||o.errors==null?null:o.errors.pattern)}}function PF(a,d){a&1&&(i(0,"div",7),n(1,"Branch name is required "),t())}function OF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid Branch name"),t())}function kF(a,d){if(a&1&&(i(0,"div",40),u(1,PF,2,0,"div",41)(2,OF,2,0,"div",41),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.Payment.get("branch"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.Payment.get("branch"))==null||o.errors==null?null:o.errors.pattern)}}function FF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid Ledger Number"),t())}function MF(a,d){if(a&1&&(i(0,"div",40),u(1,FF,2,0,"div",41),t()),a&2){let e,o=p();l(),s("ngIf",(e=o.Payment.get("LedgerNumber"))==null||e.errors==null?null:e.errors.pattern)}}function AF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid MIRC code"),t())}function NF(a,d){if(a&1&&(i(0,"div",40),u(1,AF,2,0,"div",41),t()),a&2){let e,o=p();l(),s("ngIf",(e=o.Payment.get("MIRCCode"))==null||e.errors==null?null:e.errors.pattern)}}function VF(a,d){if(a&1&&(i(0,"option",43),n(1),t()),a&2){let e=d.$implicit;
1s("value",e.id),l(),f(e.name)}}function BF(a,d){a&1&&(i(0,"div",7),n(1,"Account type is required"),t())}function RF(a,d){if(a&1&&(i(0,"div",40),u(1,BF,2,0,"div",41),t()),a&2){let e,o=p();l(),s("ngIf",(e=o.Payment.get("Accounttype"))==null||e.errors==null?null:e.errors.required)}}function LF(a,d){a&1&&(i(0,"div",7),n(1,"Please enter valid Ledger Folio Number"),t())}function qF(a,d){if(a&1&&(i(0,"div",40),u(1,LF,2,0,"div",41),t()),a&2){let e,o=p();l(),s("ngIf",(e=o.Payment.get("LedgerFolioNumber"))==null||e.errors==null?null:e.errors.pattern)}}function GF(a,d){if(a&1&&(F(0),i(1,"a",47),x(2,"i",48),i(3,"span"),n(4),t()(),M()),a&2){let e=p(2);l(),s("href",e.Upload_Cancel_Check,q),l(3),f(e.cancelcheck||"View PDF")}}function UF(a,d){if(a&1&&(i(0,"a",49),x(1,"img",50),t()),a&2){let e=p(2);s("href",e.Upload_Cancel_Check,q),l(),s("src",e.Upload_Cancel_Check,q)}}function jF(a,d){if(a&1){let e=I();i(0,"div")(1,"a",44),S("click",function(){b(e);let r=p();return y(r.removeCheck())}),x(2,"i",45),t(),u(3,GF,5,2,"ng-container",46)(4,UF,2,2,"ng-template",null,0,P),t()}if(a&2){let e=w(5),o=p();l(3),s("ngIf",o.isCancelCheckPdf)("ngIfElse",e)}}var sr=(()=>{class a{constructor(e,o,r){this.onboardSer=e,this.notifyService=o,this.router=r,this.imageUrl="",this.imagePath="",this.Upload_Cancel_Check="",this.isCancelCheckPdf=!1,this.AccountType=[{id:"SAVING",name:"Saving"},{id:"CURRENT",name:"Current"}]}ngOnInit(){this.Payment=new zi({BankName:new Yt(null,[E.required,E.pattern("[a-zA-Z][a-zA-Z ]+")]),CompanyName:new Yt(null,[E.required,E.pattern("[a-zA-Z][a-zA-Z ]+")]),AccountNumber:new Yt(null,[E.required,E.pattern("^[0-9]+$")]),ConfirmAccountNumber:new Yt(null,[E.required,E.pattern("^[0-9]+$")]),IFSCcode:new Yt(null,[E.required,E.pattern("^[A-Z]{4}0[A-Z0-9]{6}$")]),branch:new Yt(null,[E.required,E.pattern("^[a-zA-Z ]+$")]),LedgerNumber:new Yt(null,[E.pattern("^[0-9]+$")]),MIRCCode:new Yt(null,[E.pattern("^[0-9]+$")]),Accounttype:new Yt("",[E.required]),LedgerFolioNumber:new Yt(null,[E.pattern("^[0-9]+$")]),cancelled_cheque:new Yt("")})}confirmAccountNum(e){this.sanitizePositiveNumberInput("ConfirmAccountNumber"),this.cNumber=this.Payment.get("ConfirmAccountNumber")?.value,this.AccountNumber=this.Payment.value.AccountNumber}onFileimageChange(e){let o=e.target.files;if(o.length>0){let r=o[0],c=r.type==="application/pdf"||r.name.toLowerCase().endsWith(".pdf"),g=new FormData;g.append("file",r),g.append("source","onboarding"),g.append("source_id","check"),this.onboardSer.FileUpload(g).subscribe(h=>{h.responseCode==200?(this.imageUrl=h.response.file_name,this.imagePath=h.response.filepath,this.Upload_Cancel_Check=h.response.fileViewPath,this.cancelcheck=h.response.file_name,this.isCancelCheckPdf=c,this.notifyService.showSuccess(h?.response?.response)):this.notifyService.showError(h?.response)})}}removeCheck(){this.cancelcheck="",this.Upload_Cancel_Check="",this.imagePath="",this.isCancelCheckPdf=!1,this.Payment.controls.cancelled_cheque.setValue("")}allowAlphaNumericSpace(e){/^[a-zA-Z0-9 ]$/.test(e.key)||e.preventDefault()}allowAlphaNumericOnly(e){/^[a-zA-Z0-9]$/.test(e.key)||e.preventDefault()}allowAlphabetsSpace(e){/^[a-zA-Z ]$/.test(e.key)||e.preventDefault()}allowPositiveNumbers(e){/^[0-9]$/.test(e.key)||e.preventDefault()}sanitizePositiveNumberInput(e){let o=this.Payment.get(e);if(!o)return;let r=String(o.value??"").replace(/\D/g,"");o.value!==r&&o.setValue(r,{emitEvent:!1})}sanitizeAlphaNumericUppercase(e){let o=this.Payment.get(e);if(!o)return;let r=String(o.value??"").replace(/[^a-zA-Z0-9]/g,"").toUpperCase();o.value!==r&&o.setValue(r,{emitEvent:!1})}sanitizeAlphabetsSpace(e){let o=this.Payment.get(e);if(!o)return;let r=String(o.value??"").replace(/[^a-zA-Z ]/g,"");o.value!==r&&o.setValue(r,{emitEvent:!1})}get isAccountNumberMismatch(){return this.Payment.get("ConfirmAccountNumber")?.touched&&this.AccountNumber!==this.cNumber}onSubmit(){if(this.Payment.invalid||this.AccountNumber!==this.cNumber){this.Payment.markAllAsTouched();return}let e={bank_details:[{bank_name:this.Payment.value.BankName,account_name:this.Payment.value.CompanyName,account_number:this.Payment.value.AccountNumber,ifsc:this.Payment.value.IFSCcode,branch_name:this.Payment.value.branch,ledger_number:this.Payment.value.LedgerNumber??"",micr_code:this.Payment.value.MIRCCode??"",account_type:this.Payment.value.Accountt
1ype,ledger_folio_number:this.Payment.value.LedgerFolioNumber??"",cancelled_cheque:this.imagePath,is_default:"0"}]};this.onboardSer.AddBankDetails(e).subscribe(o=>{o.responseCode=="200"?(this.notifyService.showSuccess(o.response.response),this.router.navigate(["finance-management/bank-accounts"])):this.notifyService.showError(o.response)})}static{this.\u0275fac=function(o){return new(o||a)(T(Jt),T(H),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-add-bank-account"]],decls:112,vars:46,consts:[["cancelCheckImagePreview",""],[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"add-bank-details-form",3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-body"],[1,"row","gut-row","gut-4"],[1,"col-md-12","col-xl-4"],[1,"form-group"],[1,"mod-form-label"],[1,"text-danger"],["type","text","placeholder","Enter Bank Name","formControlName","BankName",1,"form-control","mod-input",3,"keypress","ngClass"],["class","invalid-feedback",4,"ngIf"],["type","text","placeholder","Enter Company Name or Holder Name","formControlName","CompanyName",1,"form-control","mod-input",3,"keypress","ngClass"],["type","text","placeholder","Enter Account Number","formControlName","AccountNumber","onlyNumbers","",1,"form-control","mod-input",3,"keypress","input","ngClass"],["type","text","placeholder","Enter Confirm Account Number","formControlName","ConfirmAccountNumber","onlyNumbers","",1,"form-control","mod-input",3,"keypress","input","ngClass"],["class","text-danger font-12 mt-1","appTranslate","",4,"ngIf"],["type","text","placeholder","SBIN0001234","formControlName","IFSCcode",1,"form-control","mod-input",3,"keypress","input","ngClass"],["type","text","placeholder","Enter Branch Name","formControlName","branch",1,"form-control","mod-input",3,"keypress","input","ngClass"],["appTranslate","",1,"mod-form-label"],["type","text","placeholder","123456","formControlName","LedgerNumber",1,"form-control","mod-input",3,"keypress","input","ngClass"],["type","text","placeholder","123456789","formControlName","MIRCCode","onlyNumbers","",1,"form-control","mod-input",3,"keypress","input","ngClass"],["formControlName","Accounttype",1,"form-control","mod-input",3,"ngClass"],["value","","appTranslate",""],[3,"value",4,"ngFor","ngForOf"],["type","text","placeholder","Enter Ledger Folio Number","formControlName","LedgerFolioNumber",1,"form-control","mod-input",3,"keypress","input","ngClass"],["for","imgInp_01","appTranslate","",1,"mod-form-label"],[1,"custom-file"],["type","file","id","imgInp_01","formControlName","cancelled_cheque","accept","image/*,application/pdf","multiple","",1,"custom-file-input",3,"change"],["for","imgInp_01",1,"custom-file-label"],[4,"ngIf"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row"],[1,"col-auto","ml-auto"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],[1,"invalid-feedback"],["appTranslate","",4,"ngIf"],["appTranslate","",1,"text-danger","font-12","mt-1"],[3,"value"],[1,"del","curserType",3,"click"],[1,"uil","uil-trash-alt"],[4,"ngIf","ngIfElse"],["target","_blank",1,"font-italic","theme-color","d-inline-flex","align-items-center",3,"href"],[1,"far","fa-file-pdf","font-18","pr-2","text-danger"],["target","_blank",1,"font-italic","theme-color",3,"href"],["fallback","./../../../assets/img/placeholderimage.png",3,"src"]],template:function(o,r){if(o&1&&(i(0,"main",1)(1,"div",2)(2,"div",3)(3,"h2",4)(4,"a",5),x(5,"i",6),t(),i(6,"span",7),n(7,"Add Bank Details"),t()()()(),i(8,"form",8),S("ngSubmit",function(){return r.onSubmit()}),i(9,"div",9)(10,"div",10)(11,"div",11)(12,"div",12)(13,"div",13)(14,"label",14)(15,"span",7),n(16,"Bank Name"),t(),i(17,"sup",15),n(18,"*"),t()(),i(19,"input",16),S("keypress",function(g){return r.allowAlphaNumericSpace(g)}),t(),u(20,hF,3,2,"div",17),t()(),i(21,"div",12)(22,"div",13)(23,"label",14)(24,"span",7),n(25,"Company Name or Holder Name"),t(),i(26,"sup",15),n(27,"*"),t()(),i(28,"input",18),S("keypress",function(g){return r.allowAlphaNumericSpace(g)}
1),t(),u(29,yF,3,2,"div",17),t()(),i(30,"div",12)(31,"div",13)(32,"label",14)(33,"span",7),n(34,"Account Number"),t(),i(35,"sup",15),n(36,"*"),t()(),i(37,"input",19),S("keypress",function(g){return r.allowPositiveNumbers(g)})("input",function(g){return r.sanitizePositiveNumberInput("AccountNumber"),r.confirmAccountNum(g)}),t(),u(38,EF,3,2,"div",17),t()(),i(39,"div",12)(40,"div",13)(41,"label",14)(42,"span",7),n(43,"Confirm Account Number"),t(),i(44,"sup",15),n(45,"*"),t()(),i(46,"input",20),S("keypress",function(g){return r.allowPositiveNumbers(g)})("input",function(g){return r.confirmAccountNum(g)}),t(),u(47,IF,2,0,"div",21),t()(),i(48,"div",12)(49,"div",13)(50,"label",14)(51,"span",7),n(52,"IFSC code"),t(),i(53,"sup",15),n(54,"*"),t()(),i(55,"input",22),S("keypress",function(g){return r.allowAlphaNumericOnly(g)})("input",function(){return r.sanitizeAlphaNumericUppercase("IFSCcode")}),t(),u(56,wF,3,2,"div",17),t()(),i(57,"div",12)(58,"div",13)(59,"label",14)(60,"span",7),n(61,"Branch name"),t(),i(62,"sup",15),n(63,"*"),t()(),i(64,"input",23),S("keypress",function(g){return r.allowAlphabetsSpace(g)}
1)("input",function(){return r.sanitizeAlphabetsSpace("branch")}),t(),u(65,kF,3,2,"div",17),t()(),i(66,"div",12)(67,"div",13)(68,"label",24),n(69,"Ledger Number"),t(),i(70,"input",25),S("keypress",function(g){return r.allowPositiveNumbers(g)})("input",function(){return r.sanitizePositiveNumberInput("LedgerNumber")}),t(),u(71,MF,2,1,"div",17),t()(),i(72,"div",12)(73,"div",13)(74,"label",24),n(75,"MIRC code"),t(),i(76,"input",26),S("keypress",function(g){return r.allowPositiveNumbers(g)})("input",function(){return r.sanitizePositiveNumberInput("MIRCCode")}),t(),u(77,NF,2,1,"div",17),t()(),i(78,"div",12)(79,"div",13)(80,"label",14)(81,"span",7),n(82,"Account type"),t(),i(83,"sup",15),n(84,"*"),t()(),i(85,"select",27)(86,"option",28),n(87,"Choose Account type"),t(),u(88,VF,2,2,"option",29),t(),u(89,RF,2,1,"div",17),t()(),i(90,"div",12)(91,"div",13)(92,"label",24),n(93,"Ledger Folio Number"),t(),i(94,"input",30),S("keypress",function(g){return r.allowPositiveNumbers(g)})("input",function(){return r.sanitizePositiveNumberInput("LedgerFolioNumber")}),t(),u(95,qF,2,1,"div",17),t()(),i(96,"div",12)(97,"div",13)(98,"label",31),n(99,"Upload cancel Check"),t(),i(100,"div",32)(101,"input",33),S("change",function(g){return r.onFileimageChange(g)}),t(),i(102,"label",34)(103,"span",7),n(104,"Choose file:"),t(),n(105),t()()(),u(106,jF,6,2,"div",35),t()()()(),i(107,"div",36)(108,"div",37)(109,"div",38)(110,"button",39),n(111," Save "),t()()()()()()),o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be;l(4),s("backButtonFallback","finance-management/bank-accounts"),l(4),s("formGroup",r.Payment),l(11),s("ngClass",ze(26,li,((c=r.Payment.get("BankName"))==null?null:c.touched)&&((c=r.Payment.get("BankName"))==null?null:c.errors))),l(),s("ngIf",((g=r.Payment.get("BankName"))==null?null:g.invalid)&&((g=r.Payment.get("BankName"))==null?null:g.touched)),l(8),s("ngClass",ze(28,li,((h=r.Payment.get("CompanyName"))==null?null:h.touched)&&((h=r.Payment.get("CompanyName"))==null?null:h.errors))),l(),s("ngIf",((C=r.Payment.get("CompanyName"))==null?null:C.invalid)&&((C=r.Payment.get("CompanyName"))==null?null:C.touched)),l(8),s("ngClass",ze(30,li,((k=r.Payment.get("AccountNumber"))==null?null:k.touched)&&((k=r.Payment.get("AccountNumber"))==null?null:k.errors))),l(),s("ngIf",((O=r.Payment.get("AccountNumber"))==null?null:O.invalid)&&((O=r.Payment.get("AccountNumber"))==null?null:O.touched)),l(8),s("ngClass",ze(32,li,((Q=r.Payment.get("ConfirmAccountNumber"))==null?null:Q.touched)&&((Q=r.Payment.get("ConfirmAccountNumber"))==null?null:Q.errors))),l(),s("ngIf",r.isAccountNumberMismatch),l(8),s("ngClass",ze(34,li,((G=r.Payment.get("IFSCcode"))==null?null:G.touched)&&((G=r.Payment.get("IFSCcode"))==null?null:G.errors))),l(),s("ngIf",((X=r.Payment.get("IFSCcode"))==null?null:X.invalid)&&((X=r.Payment.get("IFSCcode"))==null?null:X.touched)),l(8),s("ngClass",ze(36,li,((pe=r.Payment.get("branch"))==null?null:pe.touched)&&((pe=r.Payment.get("branch"))==null?null:pe.errors))),l(),s("ngIf",((Y=r.Payment.get("branch"))==null?null:Y.invalid)&&((Y=r.Payment.get("branch"))==null?null:Y.touched)),l(5),s("ngClass",ze(38,li,((le=r.Payment.get("LedgerNumber"))==null?null:le.touched)&&((le=r.Payment.get("LedgerNumber"))==null?null:le.errors))),l(),s("ngIf",((ee=r.Payment.get("LedgerNumber"))==null?null:ee.invalid)&&((ee=r.Payment.get("LedgerNumber"))==null?null:ee.touched)),l(5),s("ngClass",ze(40,li,((fe=r.Payment.get("MIRCCode"))==null?null:fe.touched)&&((fe=r.Payment.get("MIRCCode"))==null?null:fe.errors))),l(),s("ngIf",((oe=r.Payment.get("MIRCCode"))==null?null:oe.invalid)&&((oe=r.Payment.get("MIRCCode"))==null?null:oe.touched)),l(8),s("ngClass",ze(42,li,((te=r.Payment.get("Accounttype"))==null?null:te.touched)&&((te=r.Payment.get("Accounttype"))==null?null:te.errors))),l(3),s("ngForOf",r.AccountType),l(),s("ngIf",((me=r.Payment.get("Accounttype"))==null?null:me.invalid)&&((me=r.Payment.get("Accounttype"))==null?null:me.touched)),l(5),s("ngClass",ze(44,li,((ce=r.Payment.get("LedgerFolioNumber"))==null?null:ce.touched)&&((ce=r.Payment.get("LedgerFolioNumber"))==null?null:ce.errors))),l(),s("ngIf",((be=r.Payment.get("LedgerFolioNumber"))==null?null:be.invali
1d)&&((be=r.Payment.get("LedgerFolioNumber"))==null?null:be.touched)),l(10),m(" ",r.cancelcheck," "),l(),s("ngIf",r.Upload_Cancel_Check==null?null:r.Upload_Cancel_Check.length),l(4),s("disabled",r.Payment.invalid||r.AccountNumber!==r.cNumber)}},dependencies:[nt,J,W,Oe,He,Ke,Ne,Ye,Pe,Ie,dt,Z,Lt,L,We,Qe]})}}return a})();var dr=a=>["/finance-management/my-documents/details",a],cr=a=>({module:a}),$F=(a,d)=>[a,d];function zF(a,d){a&1&&(i(0,"div",16)(1,"div",17)(2,"span",18),n(3,"Loading..."),t()()())}function WF(a,d){a&1&&(i(0,"div",19),x(1,"i",20),i(2,"p",21),n(3,"No documents found"),t()())}function QF(a,d){if(a&1&&(i(0,"span",60),n(1),i(2,"span",34),n(3,"Failed"),t()()),a&2){let e=p().$implicit;l(),m(" ",e.failed_rows," ")}}function YF(a,d){if(a&1){let e=I();i(0,"div",23)(1,"div",24)(2,"div",25)(3,"div",26)(4,"div",27),x(5,"i",28),t()(),i(6,"div",29)(7,"h6",30)(8,"a",31),n(9),t()(),i(10,"small",32),n(11),t(),i(12,"small",33)(13,"span",34),n(14,"By:"),t(),n(15),t()(),i(16,"div",35)(17,"span",36),n(18,"Upload"),t(),i(19,"span",37),n(20),_(21,"titlecase"),t()(),i(22,"div",38)(23,"h6",39),n(24,"Type"),t(),i(25,"p",40),n(26),t()(),i(27,"div",41)(28,"div",42)(29,"div",43)(30,"span",44),n(31,"Rows Processed"),t(),i(32,"span",45),n(33),i(34,"span",46),n(35),t()()(),i(36,"div",47),x(37,"div",48),t(),i(38,"div",49)(39,"span",50),n(40),i(41,"span",34),n(42,"% Success"),t()(),u(43,QF,4,1,"span",51),t()()(),i(44,"div",52)(45,"button",53),x(46,"i",54),t(),i(47,"div",55)(48,"button",56),x(49,"i",57),i(50,"span",34),n(51,"View"),t()(),i(52,"button",58),S("click",function(){let r=b(e).$implicit,c=p(2);return y(c.deleteDocument(r))}),x(53,"i",59),i(54,"span"),n(55),t()()()()()()()}if(a&2){let e=d.$implicit,o=p(2);l(8),s("routerLink",ze(20,dr,e.id))("queryParams",ze(22,cr,e.module)),l(),f(e.file_name),l(2),f(e.updated_at),l(4),m(" ",e.uploaded_by,""),l(4),s("ngClass",o.getStatusBadgeClass(e.status)),l(),m(" ",v(21,18,e.status)," "),l(6),f(o.getFileType(e.module)),l(7),m(" ",e.success_rows," / "),l(2),f(e.total_rows),l(2),s("ngClass",wn(24,$F,o.getProgressBarClass(o.getSuccessRate(e)),o.getProgressBarColor(o.getSuccessRate(e)))),l(2),s("ngClass",o.getSuccessRateColor(o.getSuccessRate(e))),l(),m(" ",o.getSuccessRate(e),""),l(3),s("ngIf",e.failed_rows>0),l(5),s("routerLink",ze(27,dr,e.id))("queryParams",ze(29,cr,e.module)),l(4),s("disabled",o.deletingIds.has(e.id)),l(3),f(o.deletingIds.has(e.id)?"Deleting...":"Delete")}}function HF(a,d){if(a&1&&(F(0),u(1,YF,56,31,"div",22),M()),a&2){let e=p();l(),s("ngForOf",e.fileList)}}var pr=(()=>{class a{constructor(e,o,r){this.oService=e,this.notificationService=o,this.matDialog=r,this.fileList=[],this.pageLength=0,this.pageSize=10,this.pageIndex=0,this.pageSizeOptions=[5,10,25,50],this.searchTerm="",this.isLoading=!1,this.deletingIds=new Set}ngOnInit(){this.loadFiles()}loadFiles(){this.isLoading=!0;let e={module:"po",pageLength:this.pageSize,currentPage:this.pageIndex+1,search:this.searchTerm,status:""};this.oService.getBulkUploadList(e).subscribe({next:o=>{this.fileList=o.response?.data||[],this.pageLength=o.response?.total_count||0,this.isLoading=!1},error:o=>{this.notificationService.showError(o.error?.message||"Failed to load documents"),this.isLoading=!1}})}onPageChange(e){this.pageSize=e.pageSize,this.pageIndex=e.pageIndex,this.loadFiles()}onSearch(e){this.searchTerm=e,this.pageIndex=0,this.loadFiles()}onRefresh(){this.loadFiles()}sampleFile(){this.oService.getPoUploadTemplate().subscribe({next:e=>{let o=e.body,r=e.headers.get("content-disposition"),c="po_upload_template.xlsx";if(r){let C=r.match(/filename="(.+)"/);C&&C[1]&&(c=C[1])}let g=window.URL.createObjectURL(o),h=document.createElement("a");h.href=g,h.download=c,document.body.appendChild(h),h.click(),document.body.removeChild(h),window.URL.revokeObjectURL(g)},error:()=>{this.notificationService.showError("Failed to download template")}})}bulkupload(){this.dialogRef=this.matDialog.open(Kt,{data:{type:"Finance_Management_po"},width:"50%",height:"auto",panelClass:"custom-dialog-container"}),this.dialogRef.afterClosed().subscribe(e=>{e==="success"&&this.loadFiles()})}getSuccessRate(e){return!e.total_rows||e.total_rows===0?0:Math.round(e.success_rows/e.total_rows*100)}getProgressBarClass(e){if(!e)return"w-10";let o=Math.round(e/10)*10;return`w-${Math.min(Math.max(o,10),100)}`}getProgressBarColor(e){return e>=50?"bg-info":"bg-danger"}getSuccessRateColor(e){return e>=50?"text-info":"text-danger"}getStatusBadgeClass(e){if(!e)return"";let o=e.toLowerCase();return o==="completed"?"success":o==="failed"?"failed":"info"}deleteDocument(e){this.matDialog.open(Hi,{data:{type:"Document"},width:"400px"}).afterClosed().subscribe(r=>{r==="yes"&&(this.deletingIds.add(e.id),this.oService.deleteBulkUpload({bulk_upload_id:e.id},e.module).subscribe({next:c=>{this.deletingIds.delete(e.id),c?.responseCode===200?(this.notificationService.showSuccess("Document deleted successfully"),this.loadFiles()):this.notificationService.showError(c?.response||"Failed to delete document")},error:()=>{this.deletingIds.delete(e.id),this.notificationService.showError("Failed to delete document")}}))})}getFileType(e){return e?e.toLowerCase()==="po"?"Purchase Orders":"Invoice":""}static{this.\u0275fac=function(o){return new(o||a)(T(z),T(H),T(Ae))}}static{this.\u0275cmp=R({type:a,selectors:[["app-my-documents"]],decls:17,vars:8,consts:[[1,"catlog-bomb-files-page-main"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],["appTranslate","",1,"mod-page-title"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center"],[1,"mod-card"],[1,"mod-card-body"],[1,"row","justify-content-between","align-items-center","mb-4"],[1,"col-md-4","ml-auto"],[1,"mod-search-box","w-100"],[1,"ri-search-line","mod-search-icon"],["type","text","placeholder","Search...",1,"mod-search-input",3,"input","value"],["class","d-flex justify-content-center align-items-center py-5",4,"ngIf"],["class","d-flex flex-column justify-content-center align-items-center py-5 text-muted",4,"ngIf"],[4,"ngIf"],[3,"page","length","pageSize","pageIndex","pageSizeOptions"],[1,"d-flex","justify-content-center","align-items-center","py-5"],["role","status",1,"spinner-border","text-primary"],["appTranslate","",1,"sr-only"],[1,"d-flex","flex-column","justify-content-center","align-items-center","py-5","text-muted"],[1,"ri-inbox-line",2,"font-size","48px"],["appTranslate","",1,"mt-2"],["class","card bomb-file-card mb-3",4,"ngFor","ngForOf"],[1,"card","bomb-file-card","mb-3"],[1,"card-body"],[1,"row","align-items-center"],[1,"col-md-auto","mb-lg-0","col-lg-1","col-sm-2","col-2","mb-3"],[1,"d-flex","justify-content-center","align-items-center","bom-side-icon-box"],[1,"ri-article-line"],[1,"col-lg-3","mb-lg-0","col-md-4","col-sm-10","col-10","mb-3"],[1,"mb-1","file-name"],[3,"routerLink","queryParams"],[1,"text-muted","d-block"],[1,"text-muted"],["appTranslate",""],[1,"col-lg-2","mb-lg-0","col-md-3","col-sm-6","col-12","status-bom-catlog","mb-3"],["appTranslate","",1,"status-label"],[1,"status-badge","ml-2",3,"ngClass"],[1,"col-lg-2","mb-lg-0","col-md-3","col-sm-6","col-12","mb-3"],["appTranslate","",1,"status-label","ml-2"],[1,"ml-2","text-nowrap"],[1,"col-lg-3","mb-lg-0","col-md-10","col-sm-6","col-10","mb-3"],[1,"match-lines-wrapper"],[1,"d-flex","justify-content-between","mb-1"],["appTranslate","",1,"match-title"],[1,"match-count"],[1,"right-count"],[1,"progress","match-progress"],[1,"progress-bar","match-progress-bar",3,"ngClass"],[1,"d-flex","justify-content-between","mt-1"],[1,"match-percent",3,"ngClass"],["class","match-percent text-danger",4,"ngIf"],[1,"col-md-auto","col-sm-6","col-lg-1","mb-lg-0","mb-3","col-2","d-flex","justify-content-center","align-items-center"],["data-toggle","dropdown","aria-haspopup","true","aria-expanded","fal
1se","type","button",1,"bom-view-icon","d-flex","justify-content-center","align-items-center"],[1,"ri-more-2-fill"],[1,"dropdown-menu","dropdown-menu-right","bom-catlog-custom-action-menu"],["type","button",1,"dropdown-item",3,"routerLink","queryParams"],[1,"ri-eye-line"],["type","button",1,"dropdown-item","text-danger",3,"click","disabled"],[1,"ri-delete-bin-line"],[1,"match-percent","text-danger"]],template:function(o,r){o&1&&(i(0,"main",0)(1,"div",1)(2,"div",2)(3,"h2",3),n(4,"My Documents"),t()(),x(5,"div",4),t(),i(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9),x(11,"i",10),i(12,"input",11),S("input",function(g){return r.onSearch(g.target.value)}),t()()()(),u(13,zF,4,0,"div",12)(14,WF,4,0,"div",13)(15,HF,2,1,"ng-container",14),i(16,"mat-paginator",15),S("page",function(g){return r.onPageChange(g)}),t()()()()),o&2&&(l(12),s("value",r.searchTerm),l(),s("ngIf",r.isLoading),l(),s("ngIf",!r.isLoading&&r.fileList.length===0),l(),s("ngIf",!r.isLoading),l(),s("length",r.pageLength)("pageSize",r.pageSize)("pageIndex",r.pageIndex)("pageSizeOptions",r.pageSizeOptions))},dependencies:[nt,J,W,Ee,Zn,L,Rt],styles:[".catlog-bomb-files-page-main[_ngcontent-%COMP%] .bomb-catlog--pageTitle[_ngcontent-%COMP%]{font-size:1.4rem;color:var(--text-dark);font-weight:600}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-side-icon-box[_ngcontent-%COMP%]{border-radius:5px;width:64px;height:64px;background-color:#eee}@media (max-width: 992px){.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-side-icon-box[_ngcontent-%COMP%]{width:44px;height:44px}}@media (max-width: 400px){.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-side-icon-box[_ngcontent-%COMP%]{width:39px;height:39px}}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-side-icon-box[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px;color:#a1a1a1}@media (max-width: 576px){.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-side-icon-box[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .file-name[_ngcontent-%COMP%]{font-weight:500;font-size:16px;color:#000}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-bom-catlog[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-label[_ngcontent-%COMP%]{color:#777;font-size:14px}@media (max-width: 575px){.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-label[_ngcontent-%COMP%]{margin-left:0!important}}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:4px 10px;border-radius:4px;font-size:12px;font-weight:500;width:100px;display:flex;align-items:center;justify-content:center}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge.success[_ngcontent-%COMP%]{background:#e0ffed;color:#05a146;font-size:12px;padding:5px 17px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge.failed[_ngcontent-%COMP%]{background:#ffeaee;color:#d90429;font-size:12px;padding:5px 17px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge.info[_ngcontent-%COMP%]{background:#e2f4ff;color:#0074bd;font-size:12px;padding:5px 17px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge.info--processing[_ngcontent-%COMP%]{background:#e9e9e9;padding:5px 17px;font-size:12px;color:#6b7280}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge.info--failed[_ngcontent-%COMP%]{background:#ffeaee;padding:5px 17px;font-size:12px;color:#d90429}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .status-badge.partially[_ngcontent-%COMP%]{background:#ffdfd7;color:#f45027;font-size:12px;padding:5px 17px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-lines-wrapper[_ngcontent-%COMP%]{max-width:220px;margin-left:20px}@media (max-width: 992px){.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-lines-wrapper[_ngcontent-%COMP%]{margin-left:0;max-width:100%}}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-title[_ngcontent-%COMP%], .catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-count[_ngcontent-%COMP%]{font-size:14px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-title[_ngcontent-%COMP%] .right-count[_ngcontent-%COMP%], .catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-count[_ngcontent-%COMP%] .right-count[_ngcontent-%COMP%]{color:#6b7280}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%]{height:6px;border-radius:6px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-10[_ngcontent-%COMP%]{width:10%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-20[_ngcontent-%COMP%]{width:20%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-30[_ngcontent-%COMP%]{width:30%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-40[_ngcontent-%COMP%]{width:40%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-50[_ngcontent-%COMP%]{width:50%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-60[_ngcontent-%COMP%]{width:60%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-70[_ngcontent-%COMP%]{width:70%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-80[_ngcontent-%COMP%]{width:80%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-90[_ngcontent-%COMP%]{width:90%}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-progress[_ngcontent-%COMP%] .w-100[_ngcontent-%COMP%]{width:100%}
1.catlog-bomb-files-page-main[_ngcontent-%COMP%] .match-percent[_ngcontent-%COMP%]{font-size:11px;text-align:right;margin-top:4px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-view-icon[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:4px;background:transparent;border:1px solid #e9e9e9;cursor:pointer}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-view-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:18px;color:#666}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-view-icon[_ngcontent-%COMP%]:hover{background:#f2f2f2}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-catlog-custom-action-menu[_ngcontent-%COMP%]{min-width:160px;padding:0}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-catlog-custom-action-menu[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;font-size:14px}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-catlog-custom-action-menu[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:6px;font-size:20px;display:flex;align-items:center;justify-content:center}.catlog-bomb-files-page-main[_ngcontent-%COMP%] .bom-catlog-custom-action-menu[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%]:hover{background-color:var(--mat-menu-item-hover-state-layer-color)}"]})}}return a})();var KF=["unitPriceTemplate"],ZF=["grossTotalTemplate"],JF=["totalPayableTemplate"],XF=["statusTemplate"],eM=["matchStatusTemplate"],tM=["errorTemplate"],iM=["actionsTemplate"],nM=()=>["completed","partially completed","submitted","failed"],oi=a=>({show:a}),mr=(a,d,e)=>({"badge-success":a,"badge-danger":d,"badge-warning":e});function aM(a,d){a&1&&x(0,"span",118)}function rM(a,d){if(a&1){let e=I();i(0,"div",14)(1,"button",116),S("click",function(){b(e);let r=p();return y(r.submitBulkUpload())}),u(2,aM,1,0,"span",16),i(3,"span",18),n(4,"Submit"),t()()()}if(a&2){let e=p();l(),s("disabled",e.isSubmitting),l(),s("ngIf",e.isSubmitting)}}function lM(a,d){a&1&&x(0,"span",118)}function oM(a,d){a&1&&x(0,"i",119)}function sM(a,d){if(a&1&&(i(0,"div",120)(1,"div",121)(2,"div",122)(3,"div",123),n(4,"Total Rows"),t(),i(5,"div",124),n(6),t()()(),i(7,"div",121)(8,"div",125)(9,"div",123),n(10,"Matched"),t(),i(11,"div",124),n(12),t()()(),i(13,"div",121)(14,"div",126)(15,"div",123),n(16,"Unmatched"),t(),i(17,"div",124),n(18),t()()(),i(19,"div",121)(20,"div",127)(21,"div",123),n(22,"Multi Match"),t(),i(23,"div",124),n(24),t()()(),i(25,"div",121)(26,"div",126)(27,"div",123),n(28,"Failed"),t(),i(29,"div",124),n(30),t()()(),i(31,"div",121)(32,"div",122)(33,"div",123),n(34,"Match Rate"),t(),i(35,"div",124),n(36),t()()()()),a&2){let e,o,r,c,g,h,C=p();l(6),f((e=C.uploadDetails.total_rows)!==null&&e!==void 0?e:0),l(6),f((o=C.uploadDetails.matched_rows)!==null&&o!==void 0?o:0),l(6),f((r=C.uploadDetails.unmatched_rows)!==null&&r!==void 0?r:0),l(6),f((c=C.uploadDetails.multi_matched_rows)!==null&&c!==void 0?c:0),l(6),f((g=C.uploadDetails.failed_rows)!==null&&g!==void 0?g:0),l(6),m("",(h=C.uploadDetails.match_rate_percent)!==null&&h!==void 0?h:0,"%")}}function dM(a,d){if(a&1&&(i(0,"span"),n(1),t()),a&2){let e=p().$implicit;l(),m("\u20B9 ",e.unit_price,"")}}function cM(a,d){a&1&&(i(0,"span"),n(1,"--"),t())}function pM(a,d){if(a&1&&u(0,dM,2,1,"span",44)(1,cM,2,0,"span",44),a&2){let e=d.$implicit;s("ngIf",e.unit_price!=null),l(),s("ngIf",e.unit_price==null)}}function mM(a,d){if(a&1&&(i(0,"span"),n(1),t()),a&2){let e=p().$implicit;l(),m("\u20B9 ",e.gross_total,"")}}function uM(a,d){a&1&&(i(0,"span"),n(1,"--"),t())}function _M(a,d){if(a&1&&u(0,mM,2,1,"span",44)(1,uM,2,0,"span",44),a&2){let e=d.$implicit;s("ngIf",e.gross_total!=null),l(),s("ngIf",e.gross_total==null)}}function vM(a,d){if(a&1&&(i(0,"span"),n(1),t()),a&2){let e=p().$implicit;l(),m("\u20B9 ",e.total_payable,"")}}function gM(a,d){a&1&&(i(0,"span"),n(1,"--"),t())}function fM(a,d){if(a&1&&u(0,vM,2,1,"span",44)(1,gM,2,0,"span",44),a&2){let e=d.$implicit;s("ngIf",e.total_payable!=null),l(),s("ngIf",e.total_payable==null)}}function hM(a,d){if(a&1&&(i(0,"span",128),n(1),_(2,"titlecase"),t()),a&2){let e=d.$implicit;s("ngClass",rn(4,mr,e.status==="success",e.status==="failed",e.status==="pending")),l(),f(v(2,2,e.status))}}function xM(a,d){if(a&1&&(i(0,"span",128),n(1),_(2,"titlecase"),t()),a&2){let e=d.$implicit;s("ngClass",rn(4,mr,e.match_status==="matched",e.match_status==="unmatched",e.match_status==="multimatched")),l(),f(v(2,2,e.match_status))}}function bM(a,d){if(a&1&&(i(0,"li",132),n(1),t()),a&2){let e=d.$implicit;l(),f(e)}}function yM(a,d){if(a&1&&(F(0),i(1,"ul",130),u(2,bM,2,1,"li",131),t(),M()),a&2){let e=p().$implicit;l(2),s("ngForOf",e.error.row_errors)}}function SM(a,d){a&1&&(i(0,"span",133),n(1,"--"),t())}function CM(a,d){if(a&1&&u(0,yM,3,1,"ng-container",129)(1,SM,2,0,"ng-template",null,7,P),a&2){let e=d.$implicit,o=w(2);s("ngIf",(e.error==null||e.error.row_errors==null?null:e.error.row_errors.length)>0)("ngIfElse",o)}}function EM(a,d){a&1&&(i(0,"span"),n(1,"View / Change"),t())}function IM(a,d){a&1&&(i(0,"span"),n(1,"Search / Create"),t())}function DM(a,d){a&1&&(i(0,"span"),n(1,"Match Product"),t())}function TM(a,d){if(a&1){let e=I();
1i(0,"a",134),S("click",function(){let r=b(e).$implicit,c=p();return y(c.openProductPopup(r.product_name,r.ids,r))}),u(1,EM,2,0,"span",44)(2,IM,2,0,"span",44)(3,DM,2,0,"span",44),t()}if(a&2){let e=d.$implicit;l(),s("ngIf",e.match_status==="matched"),l(),s("ngIf",e.match_status==="unmatched"),l(),s("ngIf",e.match_status==="multimatched")}}function wM(a,d){if(a&1){let e=I();i(0,"div",135),S("click",function(){b(e);let r=p();return y(r.closeCustomPopOut("view-or-change"))}),t()}if(a&2){let e=p();s("ngClass",ze(1,oi,e.isCustomPopOutOpen("view-or-change")))}}function PM(a,d){a&1&&(i(0,"div",136)(1,"div",137)(2,"span",138),n(3,"Loading..."),t()(),i(4,"p",139),n(5,"Searching products..."),t()())}function OM(a,d){if(a&1){let e=I();i(0,"div",140)(1,"div",141),x(2,"img",142),i(3,"h3",143),n(4,"No result Found"),t(),i(5,"p",144)(6,"span",18),n(7,"We couldn't find any matching products."),t(),x(8,"br"),n(9," You can "),i(10,"strong",18),n(11,"create a new product"),t(),n(12," or use "),i(13,"strong",18),n(14,"AI"),t(),n(15," to generate one instantly. "),t(),i(16,"div",145)(17,"button",146),S("click",function(){b(e);let r=p();return y(r.onGenerateAiFromViewProduct())}),n(18," Generate with AI "),t(),i(19,"button",147),S("click",function(){b(e);let r=p();return y(r.onCreateFromViewProduct())}),n(20," Create Manually "),t()()()()}}function kM(a,d){if(a&1&&(i(0,"tr")(1,"td",164),n(2),t(),i(3,"td",165),n(4),t()()),a&2){let e=d.$implicit;l(2),f(e.name),l(2),f(e.value)}}function FM(a,d){if(a&1&&(i(0,"div",160)(1,"h6",161),n(2,"Key Attributes"),t(),i(3,"div",162)(4,"table",163)(5,"tbody"),u(6,kM,5,2,"tr",102),t()()()()),a&2){let e=p().$implicit;l(6),s("ngForOf",e.data[0].keyAttributes)}}function MM(a,d){if(a&1){let e=I();i(0,"div",149)(1,"div",150),x(2,"img",151),i(3,"div",152)(4,"h5",153),n(5),t(),i(6,"p",154)(7,"span",18),n(8,"SKU code:"),t(),n(9),t()()(),i(10,"div",155)(11,"p"),n(12),t()(),u(13,FM,7,1,"div",156),i(14,"button",157),S("click",function(){b(e);let r=p(2);return y(r.showFullDesc=!r.showFullDesc)}),n(15),t(),i(16,"div",158)(17,"button",159),S("click",function(){let r=b(e).$implicit,c=p(2);return y(c.confirmproduct(r))}),n(18,"Select"),t(),i(19,"button",147),S("click",function(){let r=b(e).$implicit,c=p(2);return y(c.onEditFromViewProduct(r))}),n(20,"Edit"),t()()()}if(a&2){let e=d.$implicit,o=p(2);l(2),s("src",e.data[0]==null?null:e.data[0].image_ViewPath,q),l(3),f(e.data[0]==null?null:e.data[0].name),l(4),m(" ",e.data[0]==null?null:e.data[0].sku,""),l(2),re("clamp",!o.showFullDesc),l(),m(" ",(e.data[0]==null?null:e.data[0].description)||"No description available"," "),l(),s("ngIf",o.showFullDesc&&(e.data[0]==null||e.data[0].keyAttributes==null?null:e.data[0].keyAttributes.length)>0),l(2),m(" ",o.showFullDesc?"Read Less":"Read More"," ")}}function AM(a,d){if(a&1&&(F(0),u(1,MM,21,8,"div",148),M()),a&2){let e=p();l(),s("ngForOf",e.masterProducts)}}function NM(a,d){if(a&1){let e=I();i(0,"div",135),S("click",function(){b(e);let r=p();return y(r.closeCustomPopOut("edit-product"))}),t()}if(a&2){let e=p();s("ngClass",ze(1,oi,e.isCustomPopOutOpen("edit-product")))}}function VM(a,d){if(a&1){let e=I();i(0,"li",74)(1,"div",166),x(2,"img",167),i(3,"button",168),S("click",function(){let r=b(e).index,c=p();return y(c.deleteEditProductImage(r))}),x(4,"i",169),t()()()}if(a&2){let e=d.$implicit;l(2),s("src",e.imageView,q)}}function BM(a,d){a&1&&(i(0,"div",170)(1,"div",171)(2,"span",138),n(3,"Loading..."),t()()())}function RM(a,d){if(a&1){let e=I();i(0,"i",180),S("click",function(){b(e);let r=p(2).$implicit,c=p();return y(c.toggleEditAttribute(r))}),t()}}function LM(a,d){if(a&1){let e=I();i(0,"i",181),S("click",function(){b(e);let r=p(2).$implicit,c=p();return y(c.toggleEditAttribute(r))}),t()}}function qM(a,d){if(a&1){let e=I();i(0,"div",176),u(1,RM,1,0,"i",177)(2,LM,1,0,"i",178),i(3,"i",179),S("click",function(){b(e);let r=p().index,c=p();return y(c.deleteAttribute(r))}),t()()}if(a&2){let e=p().$implicit;l(),s("ngIf",e.isEditing),l(),s("ngIf",!e.isEditing)}}function GM(a,d){if(a&1){let e=I();i(0,"div",172)(1,"span",173),n(2),t(),i(3,"input",174),ve("ngModelChange",function(r){let c=b(e).$implicit;return _e(c.value,r)||(c.value=r),y(r)}),t(),u(4,qM,4,2,"div",175),t()}if(a&2){let e=d.$implicit;l(2),f(e.name),l(),ue("ngModel",e.value),s("disabled",!e.isNew||!e.isEditing),l(),s("ngIf",e.isNew)}}function UM(a,d){a&1&&x(0,"span",118)}function jM(a,d){if(a&1){let e=I();i(0,"div",135),S("click",function(){b(e);let r=p();return y(r.closeCustomPopOut("create-product"))}),t()}if(a&2){let e=p();s("ngClass",ze(1,oi,e.isCustomPopOutOpen("create-product")))}}function $M(a,d){a&1&&(i(0,"span",18),n(1,"Select Industry Category....."),t())}function zM(a,d){if(a&1&&(i(0,"span"),n(1),t()),a&2){let e=p();l(),f(e.selectedCategory.name)}}function WM(a,d){if(a&1){let e=I();i(0,"span",183),S("click",function(r){b(e);let c=p().$implicit,g=p(3);return y(g.toggleAndLoadCategory(c,r))}),x(1,"i",184),t()}if(a&2){let e=p().$implicit;l(),re("rotate",e.expanded)}}function QM(a,d){a&1&&x(0,"span",188)}function YM(a,d){if(a&1){let e=I();i(0,"span",183),S("click",function(r){b(e);let c=p().$implicit,g=p(5);return y(g.toggleAndLoadCategory(c,r))}),x(1,"i",184),t()}if(a&2){let e=p().$implicit;l(),re("rotate",e.expanded)}}function HM(a,d){a&1&&x(0,"span",188)}function KM(a,d){if(a&1){let e=I();i(0,"li")(1,"div",182),x(2,"span",188),i(3,"span",185),S("click",function(){let r=b
1(e).$implicit,c=p(7);return y(c.selectCategory(r))}),n(4),t()()()}if(a&2){let e=d.$implicit,o=p(7);l(),re("active",(o.selectedCategory==null?null:o.selectedCategory.id)===e.id),l(3),m(" ",e.name," ")}}function ZM(a,d){if(a&1&&(i(0,"ul"),u(1,KM,5,3,"li",102),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.children)}}function JM(a,d){if(a&1){let e=I();F(0),i(1,"li")(2,"div",182),u(3,YM,2,2,"span",186)(4,HM,1,0,"span",187),i(5,"span",185),S("click",function(){let r=b(e).$implicit,c=p(5);return y(c.selectCategory(r))}),n(6),t()(),u(7,ZM,2,1,"ul",44),t(),M()}if(a&2){let e=d.$implicit,o=p(5);l(2),re("active",(o.selectedCategory==null?null:o.selectedCategory.id)===e.id),l(),s("ngIf",e.hasChildren),l(),s("ngIf",!e.hasChildren),l(2),m(" ",e.name," "),l(),s("ngIf",e.expanded&&(e.children==null?null:e.children.length)>0)}}function XM(a,d){if(a&1&&(i(0,"ul"),u(1,JM,8,6,"ng-container",102),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.children)}}function eA(a,d){if(a&1){let e=I();F(0),i(1,"li")(2,"div",182),u(3,WM,2,2,"span",186)(4,QM,1,0,"span",187),i(5,"span",185),S("click",function(){let r=b(e).$implicit,c=p(3);return y(c.selectCategory(r))}),n(6),t()(),u(7,XM,2,1,"ul",44),t(),M()}if(a&2){let e=d.$implicit,o=p(3);l(2),re("active",(o.selectedCategory==null?null:o.selectedCategory.id)===e.id&&e.level>=3),l(),s("ngIf",e.hasChildren),l(),s("ngIf",!e.hasChildren),l(2),m(" ",e.name," "),l(),s("ngIf",e.expanded&&(e.children==null?null:e.children.length)>0)}}function tA(a,d){if(a&1&&(i(0,"ul"),u(1,eA,8,6,"ng-container",102),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.children)}}function iA(a,d){if(a&1){let e=I();F(0),i(1,"li")(2,"div",182)(3,"span",183),S("click",function(r){let c=b(e).$implicit,g=p();return y(g.toggleAndLoadCategory(c,r))}),x(4,"i",184),t(),i(5,"span",185),S("click",function(){let r=b(e).$implicit,c=p();return y(c.selectCategory(r))}),n(6),t()(),u(7,tA,2,1,"ul",44),t(),M()}if(a&2){let e=d.$implicit,o=p();l(2),re("active",(o.selectedCategory==null?null:o.selectedCategory.id)===e.id&&e.level>=3),l(2),re("rotate",e.expanded),l(2),m(" ",e.name," "),l(),s("ngIf",e.expanded&&(e.children==null?null:e.children.length)>0)}}function nA(a,d){if(a&1){let e=I();i(0,"i",180),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.toggleCreateAttribute(r))}),t()}}function aA(a,d){if(a&1){let e=I();i(0,"i",181),S("click",function(){b(e);let r=p().$implicit,c=p();return y(c.toggleCreateAttribute(r))}),t()}}function rA(a,d){if(a&1){let e=I();i(0,"div",172)(1,"span",173),n(2),t(),i(3,"input",174),ve("ngModelChange",function(r){let c=b(e).$implicit;return _e(c.value,r)||(c.value=r),y(r)}),t(),i(4,"div",176),u(5,nA,1,0,"i",177)(6,aA,1,0,"i",178),i(7,"i",179),S("click",function(){let r=b(e).index,c=p();return y(c.deleteCreateAttribute(r))}),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.name),l(),ue("ngModel",e.value),s("disabled",!e.isEditing),l(2),s("ngIf",e.isEditing),l(),s("ngIf",!e.isEditing)}}function lA(a,d){a&1&&x(0,"span",118)}function oA(a,d){if(a&1){let e=I();i(0,"div",135),S("click",function(){b(e);let r=p();return y(r.closeCustomPopOut("generate-ai-product"))}),t()}if(a&2){let e=p();s("ngClass",ze(1,oi,e.isCustomPopOutOpen("generate-ai-product")))}}function sA(a,d){a&1&&(i(0,"span",18),n(1,"Select Industry Category....."),t())}function dA(a,d){if(a&1&&(i(0,"span"),n(1),t()),a&2){let e=p();l(),f(e.selectedAiCategory.name)}}function cA(a,d){if(a&1){let e=I();i(0,"span",183),S("click",function(r){b(e);let c=p().$implicit,g=p(3);return y(g.toggleAndLoadCategory(c,r))}),x(1,"i",184),t()}if(a&2){let e=p().$implicit;l(),re("rotate",e.expanded)}}function pA(a,d){a&1&&x(0,"span",188)}function mA(a,d){if(a&1){let e=I();i(0,"span",183),S("click",function(r){b(e);let c=p().$implicit,g=p(5);return y(g.toggleAndLoadCategory(c,r))}),x(1,"i",184),t()}if(a&2){let e=p().$implicit;l(),re("rotate",e.expanded)}}function uA(a,d){a&1&&x(0,"span",188)}function _A(a,d){if(a&1){let e=I();i(0,"li")(1,"div",182),x(2,"span",188),i(3,"span",185),S("click",function(){let r=b(e).$implicit,c=p(7);return y(c.selectAiCategory(r))}),n(4),t()()()}if(a&2){let e=d.$implicit,o=p(7);l(),re("active",(o.selectedAiCategory==null?null:o.selectedAiCategory.id)===e.id),l(3),m(" ",e.name," ")}}function vA(a,d){if(a&1&&(i(0,"ul"),u(1,_A,5,3,"li",102),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.children)}}function gA(a,d){if(a&1){let e=I();F(0),i(1,"li")(2,"div",182),u(3,mA,2,2,"span",186)(4,uA,1,0,"span",187),i(5,"span",185),S("click",function(){let r=b
1(e).$implicit,c=p(5);return y(c.selectAiCategory(r))}),n(6),t()(),u(7,vA,2,1,"ul",44),t(),M()}if(a&2){let e=d.$implicit,o=p(5);l(2),re("active",(o.selectedAiCategory==null?null:o.selectedAiCategory.id)===e.id),l(),s("ngIf",e.hasChildren),l(),s("ngIf",!e.hasChildren),l(2),m(" ",e.name," "),l(),s("ngIf",e.expanded&&(e.children==null?null:e.children.length)>0)}}function fA(a,d){if(a&1&&(i(0,"ul"),u(1,gA,8,6,"ng-container",102),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.children)}}function hA(a,d){if(a&1){let e=I();F(0),i(1,"li")(2,"div",182),u(3,cA,2,2,"span",186)(4,pA,1,0,"span",187),i(5,"span",185),S("click",function(){let r=b(e).$implicit,c=p(3);return y(c.selectAiCategory(r))}),n(6),t()(),u(7,fA,2,1,"ul",44),t(),M()}if(a&2){let e=d.$implicit,o=p(3);l(2),re("active",(o.selectedAiCategory==null?null:o.selectedAiCategory.id)===e.id&&e.level>=3),l(),s("ngIf",e.hasChildren),l(),s("ngIf",!e.hasChildren),l(2),m(" ",e.name," "),l(),s("ngIf",e.expanded&&(e.children==null?null:e.children.length)>0)}}function xA(a,d){if(a&1&&(i(0,"ul"),u(1,hA,8,6,"ng-container",102),t()),a&2){let e=p().$implicit;l(),s("ngForOf",e.children)}}function bA(a,d){if(a&1){let e=I();F(0),i(1,"li")(2,"div",182)(3,"span",183),S("click",function(r){let c=b(e).$implicit,g=p();return y(g.toggleAndLoadCategory(c,r))}),x(4,"i",184),t(),i(5,"span",185),S("click",function(){let r=b(e).$implicit,c=p();return y(c.selectAiCategory(r))}),n(6),t()(),u(7,xA,2,1,"ul",44),t(),M()}if(a&2){let e=d.$implicit,o=p();l(2),re("active",(o.selectedAiCategory==null?null:o.selectedAiCategory.id)===e.id&&e.level>=3),l(2),re("rotate",e.expanded),l(2),m(" ",e.name," "),l(),s("ngIf",e.expanded&&(e.children==null?null:e.children.length)>0)}}function yA(a,d){a&1&&x(0,"span",118)}function SA(a,d){if(a&1){let e=I();i(0,"div",135),S("click",function(){b(e);let r=p();return y(r.closeCustomPopOut("ai-product-preview"))}),t()}if(a&2){let e=p();s("ngClass",ze(1,oi,e.isCustomPopOutOpen("ai-product-preview")))}}function CA(a,d){if(a&1&&(i(0,"div",50)(1,"label",189),n(2,"Description"),t(),i(3,"p"),n(4),t()()),a&2){let e=p(3);l(4),f(e.aiGeneratedProduct.description)}}function EA(a,d){if(a&1&&(i(0,"div",50)(1,"label",189),n(2,"Category"),t(),i(3,"p"),n(4),t()()),a&2){let e=p(3);l(4),f(e.aiGeneratedProduct.categories)}}function IA(a,d){if(a&1&&(i(0,"tr")(1,"td",164),n(2),t(),i(3,"td",165),n(4),t()()),a&2){let e=d.$implicit;l(2),f(e.key||e.name),l(2),f(e.value)}}function DA(a,d){if(a&1&&(i(0,"div")(1,"label",189),n(2,"Key Attributes"),t(),i(3,"div",162)(4,"table",163)(5,"tbody"),u(6,IA,5,2,"tr",102),t()()()()),a&2){let e=p(3);l(6),s("ngForOf",e.aiGeneratedProduct.keyAttributes)}}function TA(a,d){a&1&&x(0,"span",118)}function wA(a,d){if(a&1){let e=I();F(0),i(1,"div",50)(2,"label",189),n(3,"Product Name"),t(),i(4,"p",190),n(5),t()(),u(6,CA,5,1,"div",191)(7,EA,5,1,"div",191)(8,DA,7,1,"div",44),i(9,"div",192)(10,"button",91),S("click",function(){b(e);let r=p(2);return y(r.onBackFromAiPreview())}),n(11,"Back"),t(),i(12,"button",92),S("click",function(){b(e);let r=p(2);return y(r.confirmAiProduct())}),u(13,TA,1,0,"span",16),n(14),t()(),M()}if(a&2){let e=p(2);l(5),f(e.aiGeneratedProduct.productName||e.aiGeneratedProduct.name),l(),s("ngIf",e.aiGeneratedProduct.description),l(),s("ngIf",e.aiGeneratedProduct.categories),l(),s("ngIf",(e.aiGeneratedProduct.keyAttributes==null?null:e.aiGeneratedProduct.keyAttributes.length)>0),l(2),s("disabled",e.isSubmitting),l(2),s("disabled",e.isSubmitting),l(),s("ngIf",e.isSubmitting),l(),m(" ",e.isSubmitting?"Registering...":"Confirm & Match"," ")}}function PA(a,d){a&1&&x(0,"span",118)}function OA(a,d){if(a&1){let e=I();F(0),i(1,"p",193)(2,"strong",18),n(3,"Product:"),t(),n(4),t(),i(5,"div",50)(6,"label")(7,"span",18),n(8,"Enter Seller SKU"),t(),i(9,"sup",51),n(10,"*"),t()(),i(11,"input",194),ve("ngModelChange",function(r){b(e);let c=p(2);return _e(c.sellerSku,r)||(c.sellerSku=r),y(r)}),t()(),i(12,"div",192)(13,"button",92),S("click",function(){b(e);let r=p(2);return y(r.callSelectAndSell())}),u(14,PA,1,0,"span",16),n(15),t()(),M()}if(a&2){let e=p(2);l(4),m(" ",e.selectedLLMProduct==null?null:e.selectedLLMProduct.product_name," "),l(7),ue("ngModel",e.sellerSku),l(2),s("disabled",!e.sellerSku.trim()||e.isSubmitting),l(),s("ngIf",e.isSubmitting),l(),m(" ",e.isSubmitting?"Confirming...":"Confirm & Add"," ")}}function kA(a,d){if(a&1&&(i(0,"div",36),u(1,wA,15,8,"ng-container",44)(2,OA,16,5,"ng-container",44),t()),a&2){let e=p();l(),s("ngIf",!e.showSellerSkuInput),l(),s("ngIf",e.showSellerSkuInput)}}var ur=(()=>{class a{constructor(e,o,r,c,g,h){this.route=e,this.location=o,this.oService=r,this.notificationService=c,this.commonService=g,this.matDialog=h,this.cellTemplates={},this.uploadId=0,this.module="po",this.uploadDetails=null,this.tableData=[],this.pageLength=0,this.isLoading=!1,this.matchStatus="all",this.show
1FullDesc=!1,this.lastTableParams=null,this.masterProducts=[],this.currentProductName="",this.currerntProductbomIds=[],this.currentRowData=null,this.searchText="",this.isLoadingMasterProducts=!1,this.isSubmitting=!1,this.editProduct={name:"",description:"",keyAttributes:[],sku:"",Bluet_SKU:"",qty:"",price:"",Seller_SKU:"",hsn_code:"",moq:"",country:"",typeId:"",tax:""},this.editProductImages=[],this.editProductLoader=!1,this.allowedImageTypes=["image/jpeg","image/png","image/gif"],this.newAttribute={name:"",value:""},this.createProduct={name:"",description:"",keyAttributes:[],categoryId:"",categoryName:""},this.newCreateAttribute={name:"",value:""},this.level1Cat=[],this.selectedCategory=null,this.isCategoryCollapsed=!1,this.categoryPath={industry:"",category:"",sub_category:"",sub_category_1:""},this.selectedAiCategory=null,this.isAiCategoryCollapsed=!1,this.aiProduct={product_name:"",additional_hints:""},this.aiGeneratedProduct=null,this.selectedLLMProduct=null,this.showSellerSkuInput=!1,this.sellerSku="",this.downloading=!1,this.customPopOutStates={}}ngOnInit(){this.uploadId=Number(this.route.snapshot.paramMap.get("id")),this.module=this.route.snapshot.queryParamMap.get("module")||"po",this.initializeTableConfig(),this.initializeCellTemplates(),this.getCategories()}initializeTableConfig(){let e=[{key:"po_number",label:"PO Number",selected:!0,dataType:"text",clientSideFilterable:"text"},{key:"po_creation_date",label:"PO Creation Date",selected:!0,dataType:"text",clientSideFilterable:"daterange"},{key:"po_expiry_date",label:"PO Expiry Date",selected:!0,dataType:"text",clientSideFilterable:"daterange"},{key:"product_name",label:"Product Name",selected:!0,dataType:"text",clientSideFilterable:"text"},{key:"match_status",label:"Match Status",selected:!0,dataType:"custom",clientSideFilterable:"multiselect"},{key:"matched_product_name",label:"Matched Product",selected:!0,dataType:"text",clientSideFilterable:"text"},{key:"qty",label:"Quantity",selected:!0,dataType:"number",clientSideFilterable:"numberrange"},{key:"unit_price",label:"Unit Price",selected:!0,dataType:"custom",clientSideFilterable:"numberrange"},{key:"gross_total",label:"Gross Total",selected:!0,dataType:"custom",clientSideFilterable:"numberrange"},{key:"discount_percentage",label:"Discount %",selected:!0,dataType:"number",clientSideFilterable:"multiselect"},{key:"gst_percentage",label:"GST %",selected:!0,dataType:"number",clientSideFilterable:"multiselect"},{key:"total_payable",label:"Total Payable",selected:!0,dataType:"custom",clientSideFilterable:"numberrange"},{key:"payment_mode",label:"Payment Mode",selected:!0,dataType:"text",ellipsis:{maxLength:30,showTooltip:!0},clientSideFilterable:"multiselect"},{key:"vendor",label:"Vendor Name",selected:!0,dataType:"text",clientSideFilterable:"text"},{key:"gstin",label:"GST",selected:!0,dataType:"text",clientSideFilterable:"text"},{key:"address",label:"Address",selected:!0,dataType:"text",ellipsis:{maxLength:30,showTooltip:!0}},{key:"city",label:"City",selected:!0,dataType:"text",clientSideFilterable:"multiselect"},{key:"state",label:"State",selected:!0,dataType:"text",clientSideFilterable:"multiselect"},{key:"pincode",label:"Pincode",selected:!0,dataType:"text"},{key:"country",label:"Country",selected:!0,dataType:"text",clientSideFilterable:"multiselect"},{key:"contact_name",label:"Contact Name",selected:!0,dataType:"text",clientSideFilterable:"text"},{key:"contact_number",label:"Contact Number",selected:!0,dataType:"text"},{key:"contact_email",label:"Contact Email",selected:!0,dataType:"text"},{key:"shipping_address",label:"Shipping Address",selected:!0,dataType:"text",ellipsis:{maxLength:30,showTooltip:!0}},{key:"billing_address",label:"Billing Address",selected:!0,dataType:"text",ellipsis:{maxLength:30,showTooltip:!0}},{key:"terms",label:"Terms",selected:!0,dataType:"text",ellipsis:{maxLength:40,showTooltip:!0}},{key:"error",label:"Error",selected:!0,dataType:"custom"}];this.tableConfig={tableId:"finance-my-documents-detail",columns:e,features:{columnVisibility:!1,columnFilters:!1,tableSearch:!1,filterPanel:!1,pagination:!1,export:!1,refresh:!1,sorting:!1,stickyHeader:!1,stickyColumns:!0,selection:!1,clientSideFilter:!0},pagination:{pageSize:10,pageSizeOptions:[5,10,25,50],serverSide:!0},search:{placeholder:"Search...",debounceMs:400,serverSide:!0}
1,emptyState:{message:"No records found",icon:"ri-inbox-line"},actions:{position:"last",width:"auto",sticky:!0}}}initializeCellTemplates(){this.cellTemplates={unit_price:this.unitPriceTemplate,gross_total:this.grossTotalTemplate,total_payable:this.totalPayableTemplate,status:this.statusTemplate,match_status:this.matchStatusTemplate,error:this.errorTemplate}}onDataRequest(e){this.lastTableParams=e,this.isLoading=!0;let o={bulk_upload_id:this.uploadId,pageLength:e.pageLength,currentPage:e.currentPage,search:e.search||""};this.oService.getPoUploadDetails(o,this.module).subscribe({next:r=>{this.uploadDetails=r.response?.bulk_upload||null,this.tableData=(r.response?.items||[]).map(c=>A(A({},c),c.edited_row_data||c.row_data||{})),this.pageLength=r.response?.total_count||0,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load document details"),this.isLoading=!1}})}onMatchStatus(e){this.isLoading=!0;let o={bulk_upload_id:this.uploadId,pageLength:this.lastTableParams.pageLength,currentPage:this.lastTableParams.currentPage,search:this.lastTableParams.search||"",match_status:e};this.oService.getPoUploadDetails(o,this.module).subscribe({next:r=>{this.uploadDetails=r.response?.bulk_upload||null,this.tableData=(r.response?.items||[]).map(c=>A(A({},c),c.edited_row_data||c.row_data||{})),this.pageLength=r.response?.total_count||0,this.isLoading=!1,this.tableConfig=j(A({},this.tableConfig),{features:j(A({},this.tableConfig.features),{pagination:this.pageLength>10})})},error:r=>{this.notificationService.showError(r.error?.message||"Failed to load document details"),this.isLoading=!1}})}static{this.DOWNLOAD_LABELS={all:"Download All",matched:"Download Matched",unmatched:"Download Unmatched",multimatched:"Download Multiple Matches"}}get downloadLabel(){return a.DOWNLOAD_LABELS[this.matchStatus]??"Download"}get downloadFileName(){return this.module+"-"+this.uploadId+"-"+this.matchStatus+".xlsx"}downloadItems(){this.downloading||(this.downloading=!0,this.oService.downloadUploadItems({bulk_upload_id:this.uploadId,match_status:this.matchStatus},this.module).subscribe({next:e=>{if(this.downloading=!1,e?.type?.includes("json")){e.text().then(o=>{let r="";try{r=JSON.parse(o)?.message}catch{}this.notificationService.showError(r||"Failed to download the file")});return}this.saveBlob(e,this.downloadFileName)},error:()=>{this.downloading=!1,this.notificationService.showError("Failed to download the file")}}))}saveBlob(e,o){let r=window.URL.createObjectURL(e),c=document.createElement("a");c.href=r,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c),window.URL.revokeObjectURL(r)}submitBulkUpload(){if(!this.uploadDetails||this.uploadDetails.total_rows===0){this.notificationService.showError("No rows to submit");return}if(this.uploadDetails.unmatched_rows>0){this.matDialog.open(Hi,{data:{message:"All the products are not matched. Do you want to continue with the matched products?"},width:"400px"}).afterClosed().subscribe(o=>{o==="yes"&&this.doSubmitBulkUpload()});return}this.doSubmitBulkUpload()}doSubmitBulkUpload(){this.isSubmitting=!0,this.oService.submitBulkUpload({bulk_upload_id:this.uploadId},this.module).subscribe(e=>{this.isSubmitting=!1,e?.responseCode===200?(this.notificationService.showSuccess("Document submitted successfully"),this.goBack()):this.notificationService.showError(e?.response||"Failed to submit document")},()=>{this.isSubmitting=!1,this.notificationService.showError("Failed to submit document")})}goBack(){this.location.back()}toggleCustomPopOut(e){this.customPopOutStates[e]=!this.customPopOutStates[e],this.handleBodyScroll()}closeCustomPopOut(e){this.customPopOutStates[e]=!1,this.handleBodyScroll()}openCustomPopOut(e){this.customPopOutStates[e]=!0,this.handleBodyScroll()}isCustomPopOutOpen(e){return this.customPopOutStates[e]||!1}handleBodyScroll(){let e=Object.values(this.customPopOutStates).some(o=>o);document.body.classList.toggle("customPopOutOpenedAtBody",e)}openProductPopup(e,o,r){this.currentProductName=e,this.currerntProductbomIds=o||[],this.currentRowData=r?.row_data||r?.edited_row_data||null,this.searchText="",this.getBomMasterProducts(e),this.openCustomPopOut("view-or-change")}getBomMasterProducts(e){this.isLoadingMasterProducts=!0;let o={product_name:e,pageLength:10,currentPage:1};this.commonService.getBommasterProducts(o).subscribe(r=>{this.isLoadingMasterProducts=!1,r.responseCode==200?this.masterProducts=r.response.data:(this.notificationService.showError("Failed to fetch master products"),this.masterProducts=[])},r=>{this.isLoadingMasterProducts=!1,this.notificationService.showError("Failed to fetch master products"),this.masterProducts=[]})}onSearchProduct(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText.trim()?this.getBomMasterProducts(this.searchText):this.getBomMasterProducts(this.currentProductName)},300)}confirmproduct(e){let o=e.data[0],r=o.keyAttributes?.length>0?o.keyAttributes.map(h=>({name:h.name,value:h.value})):[],c=o.images?.length>0?o.images.map(h=>({imageType:h.imageType,image:h.image})):[],g={};o.Bluet_SKU&&(g.Bluet_SKU=o.Bluet_SKU),o.sku&&(g.sku=o.sku),o.price&&(g.price=o.price),o.hsn_code&&(g.hsn_code=o.hsn_code),o.qty&&(g.qty=o.qty),o.moq&&(g.moq=o.moq),o.country&&(g.country=o.country),o.description&&(g.description=o.description),o.tax&&(g.tax=o.tax),o.productType&&(g.productType=
1o.productType),r.length>0&&(g.key_attributes=r),c.length>0&&(g.images=c),this.commonService.selectAndSell(g).subscribe(h=>{if(h.responseCode==200){let C=j(A({},this.currentRowData||{}),{product_name:o.name,matched_master_product_id:h.response?.matched_product_id,vendor_product_id:h.response?.matched_vendor_product_id,match_status:"matched"});this.oService.updatePoUploadItem({bulk_upload_item_ids:this.currerntProductbomIds,match_status:"matched",matched_product_id:h.response?.matched_product_id,matched_vendor_product_id:h.response?.matched_vendor_product_id,edited_row_data:C,status:"completed"},this.module).subscribe(k=>{k.responseCode==200?(this.notificationService.showSuccess("Product matched successfully"),this.closeCustomPopOut("view-or-change"),this.lastTableParams&&this.onDataRequest(this.lastTableParams)):this.notificationService.showError("Failed to match product")},()=>{this.notificationService.showError("Failed to match product")})}else this.notificationService.showError("Failed to match product")},()=>{this.notificationService.showError("Failed to match product")})}onEditFromViewProduct(e){let o=e.data[0];this.editProduct={name:o?.name||"",description:o?.description||"",keyAttributes:o?.keyAttributes?JSON.parse(JSON.stringify(o.keyAttributes)):[],sku:o?.sku||"",Bluet_SKU:o?.Bluet_SKU||"",qty:o?.qty||"",price:o?.price||"",Seller_SKU:o?.Seller_SKU||"",hsn_code:o?.hsn_code||"",moq:o?.moq||"",country:o?.country||"",typeId:o?.typeId||"",tax:o?.tax||""},this.editProduct.keyAttributes.forEach(r=>{r.isEditing=!1,r.isNew=!1}),this.editProductImages=[],o?.images&&o.images.length>0&&(this.editProductImages=o.images.map(r=>({image:r.image,imageView:r.imageView||r.image_ViewPath||r.image,imageType:r.imageType||"bluet"}))),this.closeCustomPopOut("view-or-change"),this.openCustomPopOut("edit-product")}onBackFromEditProduct(){this.closeCustomPopOut("edit-product"),this.openCustomPopOut("view-or-change")}toggleEditAttribute(e){e.isEditing=!e.isEditing}deleteAttribute(e){this.editProduct.keyAttributes.splice(e,1)}addNewAttribute(){this.newAttribute.name&&this.newAttribute.value&&(this.editProduct.keyAttributes.push({id:0,name:this.newAttribute.name,value:this.newAttribute.value,isEditing:!1,isNew:!0}),this.newAttribute={name:"",value:""})}confirmEditProduct(){let e={};this.editProduct.name&&(e.product_name=this.editProduct.name),this.editProduct.description&&(e.description=this.editProduct.description),this.editProduct.sku&&(e.sku=this.editProduct.sku),this.editProduct.Bluet_SKU&&(e.Bluet_SKU=this.editProduct.Bluet_SKU),this.editProduct.qty&&(e.qty=this.editProduct.qty),this.editProduct.price&&(e.price=this.editProduct.price),this.editProduct.Seller_SKU&&(e.Seller_SKU=this.editProduct.Seller_SKU),this.editProduct.hsn_code&&(e.hsn_code=this.editProduct.hsn_code),this.editProduct.moq&&(e.moq=this.editProduct.moq),this.editProduct.country&&(e.country=this.editProduct.country),this.editProduct.typeId&&(e.typeId=this.editProduct.typeId),this.editProduct.tax&&(e.tax=this.editProduct.tax),this.editProduct.keyAttributes?.length>0&&(e.key_attributes=this.editProduct.keyAttributes.map(o=>({name:o.name,value:o.value}))),this.editProductImages?.length>0&&(e.images=this.editProductImages.map(o=>({imageType:o.imageType||"bluet",image:o.image}))),this.isSubmitting=!0,this.commonService.selectAndSell(e).subscribe(o=>{if(o.responseCode==200){let r=j(A({},this.currentRowData||{}),{product_name:this.editProduct.name,matched_master_product_id:o.response?.matched_product_id,vendor_product_id:o.response?.matched_vendor_product_id,match_status:"matched"});this.oService.updatePoUploadItem({bulk_upload_item_ids:this.currerntProductbomIds,match_status:"matched",matched_product_id:o.response?.matched_product_id,matched_vendor_product_id:o.response?.matched_vendor_product_id,edited_row_data:r,status:"completed"},this.module).subscribe(()=>{this.isSubmitting=!1,this.notificationService.showSuccess("Product edited and matched successfully"),this.closeCustomPopOut("edit-product"),this.lastTableParams&&this.onDataRequest(this.lastTableParams)},()=>{this.isSubmitting=!1,this.notificationService.showError("Product saved but failed to update match")})}else this.isSubmitting=!1,this.notificationService.showError("Failed to edit and save product")},()=>{this.isSubmitting=!1,this.notificationService.showError("Failed to edit and save product")})}handleEditProductImageInput(e){if(!e||e.length===0)return;let o=e[0];if(!this.allowedImageTypes.includes(o.type)){this.notificationService.showError("Unsupported file type. Please select a valid image file.");return}if(o.size===0){this.notificationService.showError("File is empty. Please select a valid file.");return}this.editProductLoader=!0;let r=new FormData;r.append("file",o),r.append("source","seller_product"),r.append("source_id","vendorProduct"),this.commonService.FileUpload(r).subscribe({next:c=>{this.editProductLoader=!1,c.responseCode===200?this.editProductImages.push({image:c.response.filepath,imageView:c.response.fileViewPath,imageType:"bluet"}):this.notificationService.showError("File could not be uploaded")},error:()=>{this.editProductLoader=!1,this.notificationService.showError("An error occurred during file upload")}})}deleteEditProductImage(e){this.editProductImages.splice(e,1)}
1onCreateFromViewProduct(){this.getCategories(),this.resetCreateProduct(),this.closeCustomPopOut("view-or-change"),this.openCustomPopOut("create-product")}onBackFromCreateProduct(){this.closeCustomPopOut("create-product"),this.openCustomPopOut("view-or-change")}resetCreateProduct(){this.createProduct={name:"",description:"",keyAttributes:[],categoryId:"",categoryName:""},this.newCreateAttribute={name:"",value:""},this.selectedCategory=null,this.isCategoryCollapsed=!1,this.categoryPath={industry:"",category:"",sub_category:"",sub_category_1:""}}getCategories(){this.commonService.getEsCategories({category_id:""}).subscribe(e=>{e.responseCode==200&&(this.level1Cat=e.response.list.map(o=>j(A({},o),{expanded:!1,children:[],hasChildren:!0,level:1})))})}toggleAndLoadCategory(e,o){o.stopPropagation(),e.expanded=!e.expanded,e.expanded&&(e.level===1?(this.categoryPath.industry=e.id,this.categoryPath.category="",this.categoryPath.sub_category="",this.categoryPath.sub_category_1=""):e.level===2?(this.categoryPath.category=e.id,this.categoryPath.sub_category="",this.categoryPath.sub_category_1=""):e.level===3&&(this.categoryPath.sub_category=e.id,this.categoryPath.sub_category_1="")),e.expanded&&e.children.length===0&&this.commonService.getEsCategories({category_id:e.id}).subscribe(r=>{r.responseCode==200&&r.response.list.length>0?e.children=r.response.list.map(c=>j(A({},c),{expanded:!1,children:[],hasChildren:!0,level:e.level+1,parent:e})):e.hasChildren=!1})}selectCategory(e){e.level>=3&&(this.selectedCategory=e,this.createProduct.categoryId=e.id,this.createProduct.categoryName=e.name,e.level===3?(this.categoryPath.sub_category=e.id,this.categoryPath.sub_category_1=""):e.level===4&&(this.categoryPath.sub_category_1=e.id),this.isCategoryCollapsed?this.isCategoryCollapsed=!1:(this.isCategoryCollapsed=!0,setTimeout(()=>{this.isCategoryCollapsed=!1},0)))}toggleCreateAttribute(e){e.isEditing=!e.isEditing}deleteCreateAttribute(e){this.createProduct.keyAttributes.splice(e,1)}addNewCreateAttribute(){this.newCreateAttribute.name&&this.newCreateAttribute.value&&(this.createProduct.keyAttributes.push({id:0,name:this.newCreateAttribute.name,value:this.newCreateAttribute.value,isEditing:!1}),this.newCreateAttribute={name:"",value:""})}createNewProduct(){let e={};this.createProduct.categoryId&&(e.categoryId=this.createProduct.categoryId),this.createProduct.categoryName&&(e.categoryName=this.createProduct.categoryName),this.createProduct.name&&(e.product_name=this.createProduct.name),this.createProduct.description&&(e.description=this.createProduct.description),this.createProduct.keyAttributes?.length>0&&(e.keyAttributes=this.createProduct.keyAttributes.map(o=>({name:o.name,value:o.value}))),this.categoryPath.industry&&(e.industry=this.categoryPath.industry),this.categoryPath.category&&(e.category=this.categoryPath.category),this.categoryPath.sub_category&&(e.sub_category=this.categoryPath.sub_category),this.categoryPath.sub_category_1&&(e.sub_category_1=this.categoryPath.sub_category_1),this.isSubmitting=!0,this.commonService.createTempProduct({products:[e]}).subscribe(o=>{this.isSubmitting=!1,o.responseCode==200?(this.notificationService.showSuccess("Product created and added successfully"),this.closeCustomPopOut("create-product"),this.lastTableParams&&this.onDataRequest(this.lastTableParams)):this.notificationService.showError("Failed to create and add product")},()=>{this.isSubmitting=!1,this.notificationService.showError("Failed to create and add product")})}onGenerateAiFromViewProduct(){this.closeCustomPopOut("view-or-change"),this.openCustomPopOut("generate-ai-product")}onBackFromGenerateAiProduct(){this.closeCustomPopOut("generate-ai-product"),this.openCustomPopOut("view-or-change")}generateAiProduct(){let e={};this.aiProduct.product_name&&(e.product_name=this.aiProduct.product_name),this.selectedAiCategory?.id&&(e.buyer_industry=this.selectedAiCategory.id),this.aiProduct.additional_hints&&(e.additional_hints=this.aiProduct.additional_hints),this.isSubmitting=!0,this.commonService.generateAiProduct(e).subscribe(o=>{this.isSubmitting=!1,o.responseCode==200&&o.response?(this.aiGeneratedProduct=o.response,this.closeCustomPopOut("generate-ai-product"),this.openCustomPopOut("ai-product-preview")):this.notificationService.showError("Failed to generate AI product")},()=>{this.isSubmitting=!1,this.notificationService.showError("Failed to generate AI product")})}onBackFromAiPreview(){this.closeCustomPopOut("ai-product-preview"),this.openCustomPopOut("generate-ai-product")}confirmAiProduct(){this.isSubmitting=!0,this.commonService.addProductToLLM(this.aiGeneratedProduct).subscribe(e=>{if(this.isSubmitting=!1,e?.responseCode===200){let o=e?.response;this.selectedLLMProduct={product_name:o?.product_name||this.aiGeneratedProduct?.productName||this.aiGeneratedProduct?.name,sku:o?.sku},this.showSellerSkuInput=!0}else this.notificationService.showError("Failed to register AI product")},()=>{this.isSubmitting=!1,this.notificationService.showError("Failed to register AI product")})}callSelectAndSell(){if(!this.sellerSku.trim()){this.notificationService.showError("Please enter Seller SKU");return}
1let e=this.aiGeneratedProduct,o=e.keyAttributes?.length>0?e.keyAttributes.map(g=>({name:g.key||g.name,value:String(g.value??"")})):[],r=e.images?.length>0?e.images.map(g=>({imageType:g.imageType,image:g.image})):[],c={};e.Bluet_SKU&&(c.Bluet_SKU=e.Bluet_SKU),this.selectedLLMProduct?.sku&&(c.sku=this.selectedLLMProduct.sku),e.price&&(c.price=e.price),e.hsn_code&&(c.hsn_code=e.hsn_code),e.qty&&(c.qty=e.qty),e.moq&&(c.moq=e.moq),e.country&&(c.country=e.country),e.description&&(c.description=e.description),e.tax&&(c.tax=e.tax),e.productType&&(c.productType=e.productType),o.length>0&&(c.key_attributes=o),r.length>0&&(c.images=r),c.Seller_SKU=this.sellerSku,this.isSubmitting=!0,this.commonService.selectAndSell(c).subscribe(g=>{g.responseCode==200?this.oService.updatePoUploadItem({bulk_upload_item_ids:this.currerntProductbomIds,match_status:"matched",matched_product_id:g.response?.matched_product_id,matched_vendor_product_id:g.response?.matched_vendor_product_id,edited_row_data:j(A({},this.currentRowData||{}),{product_name:this.selectedLLMProduct?.product_name})},this.module).subscribe(h=>{this.isSubmitting=!1,h.responseCode==200?(this.notificationService.showSuccess("AI Product matched successfully"),this.showSellerSkuInput=!1,this.sellerSku="",this.selectedLLMProduct=null,this.closeCustomPopOut("ai-product-preview"),this.lastTableParams&&this.onDataRequest(this.lastTableParams)):this.notificationService.showError("Product confirmed but failed to update item")},()=>{this.isSubmitting=!1,this.notificationService.showError("Product confirmed but failed to update item")}):(this.isSubmitting=!1,this.notificationService.showError("Failed to confirm AI product"))},()=>{this.isSubmitting=!1,this.notificationService.showError("Failed to confirm AI product")})}selectAiCategory(e){(e.level>=3||!e.hasChildren)&&(this.selectedAiCategory=e),(e.level>=3||!e.hasChildren)&&(this.isAiCategoryCollapsed?this.isAiCategoryCollapsed=!1:(this.isAiCategoryCollapsed=!0,setTimeout(()=>{this.isAiCategoryCollapsed=!1},100)))}resetAiProduct(){this.aiProduct={product_name:"",additional_hints:""},this.selectedAiCategory=null,this.isAiCategoryCollapsed=!1}static{this.\u0275fac=function(o){return new(o||a)(T(de),T(Pn),T(z),T(H),T(ge),T(Ae))}}static{this.\u0275cmp=R({type:a,selectors:[["app-my-documents-detail"]],viewQuery:function(o,r){if(o&1&&(N(KF,7),N(ZF,7),N(JF,7),N(XF,7),N(eM,7),N(tM,7),N(iM,7)),o&2){let c;V(c=B())&&(r.unitPriceTemplate=c.first),V(c=B())&&(r.grossTotalTemplate=c.first),V(c=B())&&(r.totalPayableTemplate=c.first),V(c=B())&&(r.statusTemplate=c.first),V(c=B())&&(r.matchStatusTemplate=c.first),V(c=B())&&(r.errorTemplate=c.first),V(c=B())&&(r.actionsTemplate=c.first)}},decls:300,vars:90,consts:[["unitPriceTemplate",""],["grossTotalTemplate",""],["totalPayableTemplate",""],["statusTemplate",""],["matchStatusTemplate",""],["errorTemplate",""],["actionsTemplate",""],["noError",""],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],[1,"btn","btn-title-back",3,"click"],[1,"uil","uil-arrow-left"],["class","col-md-auto",4,"ngIf"],[1,"col-md-auto"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],["class","spinner-border spinner-border-sm mr-1","role","status",4,"ngIf"],["class","uil uil-import mr-1",4,"ngIf"],["appTranslate",""],[1,"form-control","mod-input",2,"min-width","190px",3,"ngModelChange","ngModel"],["value","all","appTranslate",""],["value","matched","appTranslate",""],["value","unmatched","appTranslate",""],["value","multimatched","appTranslate",""],[1,"mod-card","default-min-hight"],[1,"mod-card-body"],["class","row stats-row mb-4",4,"ngIf"],[3,"dataRequest","config","data","totalRecords","isLoading","cellTemplates","actionsTemplate"],["class","customPopOut__backdrop",3,"ngClass","click",4,"ngIf"],[1,"customPopOut__offCanvas","customPopOut__view-or-change",3,"ngClass"],[1,"customPopOut__offCanvas--header","align-items-start"],[1,"fw-400","text-secondary","h6"],[1,"fw-600","text-dark"],[1,"fw-400","text-secondary","font-13"],["type","button",1,"close-btn","ml-auto",3,"click"],[1,"ri-close-large-line"],[1,"customPopOut__offCanvas--body","scrollbar"],[1,"input-group","input-group-table-search","mb-30"],["type","text","placeholder","Search...",1,"form-control",3,"ngModelChange","keyup","ngModel"],[1,"input-group-prepend",3,"click"],[1,"input-group-text",2,"cursor","pointer"],[1,"ri-search-line"],["class","text-center py-5",4,"ngIf"],["class","empty-state",4,"ngIf"],[4,"ngIf"],[1,"customPopOut__offCanvas","customPopOut__edit-product",3,"ngClass"],[1,"customPopOut__offCanvas--header"],["type","button",1,"close-btn",3,"click"],[1,"ri-arrow-left-line"],["appTranslate","",1,"fw-500","mb-0","ml-3"],[1,"form-group"],[1,"text-danger"],["type","text","placeholder","Product name","required","",1,"form-control",3,"ngModelChange","ngModel"],["rows","4",1,"form-control",3,"ngModelChange","ngModel"],[1,"edit-product-details"],["appTranslate","",1,"section-title"],[1,"row"],[1,"col-md-6"],["type","number","placeholder","Enter Available Quantity",1,"form-control",3,"ngModelChange","ngModel"],["type","number","placeholder","Enter Price Per Unit",1,"form-control",3,"ngModelChange","ngModel"],["type","text","placeholder","Enter Seller SKU Code","required","",1,"form-control",3,"ngModelChange","ngModel"],["type","text","placeholder","Enter Tax Code","disabled","",1,"form-control",3,"ngModelChange","ngModel"],["type","number","placeholder","Enter Minimum Order Quantity",1,"form-control",3,"ngModelChange","ngModel"],[1,"form-control",3,"ngModelChange","ngModel"],["value","","appTranslate",""],["value","IN","appTranslate",""],["value","1","appTranslate",""],["value","2","appTranslate",""],["value","3","appTranslate",""],["value","4","appTranslate",""],["type","number","placeholder","Enter Tax in Percentage",1,"form-control",3,"ngModelChange","ngModel"],[1,"edit-product-images"],[1,"list-inline","edit-product-images-list","d-flex","flex-wrap"],["class","list-inline-item",4,"ngFor","ngForOf"],[1,"list-inline-item"],[1,"edit-product-image-upload"],["type","file","accept","image/*",3,"change"],[1,"edit-product-image-upload-content"],[1,"uil","uil-plus-circle"],["class","edit-product-image-loader",4,"ngIf"],[1,"key-attributes"],["class","attribute-row",4,"ngFor","ngForOf"],[1,"add-attribute-box"],[1,"row","gap-2"],[1,"col-md","pr-2"],["placeholder","e.g. Color",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-md","px-2"],["placeholder","e.g. Red",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-md-auto","d-flex","align-items-end","pl-2"],["appTranslate","",1,"mod-btn","mod-btn-outline-primary","btn-block",3,"click"],[1,"popout-footer","d-flex","justify-content-end"],["appTranslate","",1,"mod-btn","mod-btn-outline-primary","mr-2",3,"click","disabled"],[1,"mod-btn","mod-btn-primary",3,"click","disabled"],[1,"targetIndustry__form-group","mb-24"],[1,"card"],[1,"card-header","bg-white"],["data-toggle","collapse","href","#targetIndustryCreate",1,"card-link"],["appTranslate","",4,"ngIf"],[1,"ri-arrow-down-s-line"],["id","targetIndustryCreate"],[1,"card-body","category-tree-scroll"],[1,"tree"],[4,"ngFor","ngForOf"],[1,"customPopOut__offCanvas","customPopOut__generate-ai-product",3,"ngClass"],[1,"generate-ai-product__form-group"],["appTranslate","",1,"generate-ai-product__label"],["type","text","placeholder","Enter product name",1,"form-control",3,"ngModelChange","ngModel"],["appTranslate","",1,"generate-ai-product__hint"],["rows","5","placeholder","Enter additional details about your product...",1,"form-control",3,"ngModelChange","ngModel"],[1,"targetIndustry__form-group"],["data-toggle","collapse","href","#targetIndustryAi",1,"card-link"],["id","targetIndustryAi"],[1,"generate-ai-product__ai-note"],[1,"generate-ai-product__ai-icon"],[1,"generate-ai-product__actions"],["type","button","appTranslate","",1,"mod-btn","mod-btn-outline-primary",3,"click","disabled"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["class","customPopOut__offCanvas--body scrollbar",4,"ngIf"],["role","status",1,"spinner-border","spinner-border-sm","mr-1"],[1,"uil","uil-import","mr-1"],[1,"row","stats-row","mb-4"],[1,"col-md-2","col-sm-6","mb-3"],[1,"stat-card"],["appTranslate","",1,"stat-label"],[1,"stat-value"],[1,"stat-card","stat-card--success"],[1,"stat-card","stat-card--danger"],[1,"stat-card","stat-card--warning"],[1,"badge",3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"mb-0","pl-3"],["class","text-danger small",4,"ngFor","ngForOf"],[1,"text-danger","small"],[1,"text-muted"],[1,"mod-btn-action",3,"click"],[1,"customPopOut__backdrop",3,"click","ngClass"],[1,"text-center","py-5"],["role","status",1,"spinner-border","text-primary"],["appTranslate","",1,"sr-only"],["appTranslate","",1,"mt-3"],[1,"empty-state"],[1,"empty-state__content"],["src","assets/img/common/empty-search.png","alt","No result found",1,"empty-state__image"],["appTranslate","",1,"empty-state__title"],["appTranslateText","",1,"empty-state__description"],[1,"empty-state__actions"],["type","button","appTranslate","",1,"mod-btn","mod-btn-outline-primary",3,"click"],["type","button","appTranslate","",1,"mod-btn","mod-btn-primary",3,"click"],["class","catalogCard",4,"ngFor","ngForOf"],[1,"catalogCard"],[1,"catalogCard__header","d-flex"],["fallback","./../../../../assets/img/placeholderimage.png","alt","product",1,"catalogCard__img",3,"src"],[1,"catalogCard__info"],[1,"catalogCard__title"],[1,"catalogCard__sku"],[1,"catalogCard__desc"],["class","catalogCard__attributes",4,"ngIf"],["type","button",1,"btn","btn-link","catalogCard__toggle",3,"click"],[1,"catalogCard__footer","d-flex","justify-content-end"],["type","button","appTranslate","",1,"mod-btn","mod-btn-outline-primary","mr-2",3,"click"],[1,"catalogCard__attributes"],["appTranslate","",1,"mb-3"],[1,"table-responsive"],[1,"table","table-bordered","attributeTable","mb-0"],[1,"attrLabel"],[1,"attrValue"],[1,"edit-product-image-preview"],["fallback","assets/img/placeholderimage.png",1,"img-fluid",3,"src"],["type","button",1,"edit-product-image-remove",3,"click"],[1,"uil","uil-trash-alt"],[1,"edit-product-image-loader"],["role","status",1,"spinner-border","spinner-border-sm","text-primary"],[1,"attribute-row"],[1,"attr-name"],["type","text",1,"form-control","attr-value",3,"ngModelChange","ngModel","disabled"],["class","attr-actions",4,"ngIf"],[1,"attr-actions"],["class","ri-check-line text-success",3,"click",4,"ngIf"],["class","ri-pencil-line edit",3,"click",4,"ngIf"],[1,"ri-delete-bin-line","delete",3,"click"],[1,"ri-check-line","text-success",3,"click"],[1,"ri-pencil-line","edit",3,"click"],[1,"tree-node"],[1,"arrow",3,"click"],[1,"ri-arrow-right-s-line"],[1,"label",3,"click"],["class","arrow",3,"click",4,"ngIf"],["class","arrow placeholder",4,"ngIf"],[1,"arrow","placeholder"],["appTranslate","",1,"text-muted","font-13"],[1,"fw-500"],["class","form-group",4,"ngIf"],[1,"popout-footer","d-flex","justify-content-end","mt-3"],[1,"mb-1"],["type","text","placeholder","Enter Seller SKU",1,"form-control",3,"ngModelChange","ngModel"]],template:function(o,r){if(o&1){let c=I();i(0,"main")(1,"div",8)(2,"div",9)(3,"h2",10)(4,"a",11),S("click",function(){return b(c),y(r.goBack())}),x(5,"i",12),t(),n(6),t()(),u(7,rM,5,2,"div",13),i(8,"div",14)(9,"button",15),S("click",function(){return b(c),y(r.downloadItems())}),u(10,lM,1,0,"span",16)(11,oM,1,0,"i",17),i(12,"span",18),n(13),t()()(),i(14,"div",14)(15,"select",19),ve("ngModelChange",function(h){return b(c),_e(r.matchStatus,h)||(r.matchStatus=h),y(h)}),S("ngModelChange",function(h){return b(c),y(r.onMatchStatus(h))}),i(16,"option",20),n(17,"All"),t(),i(18,"option",21),n(19,"Matched"),t(),i(20,"option",22),n(21,"Unmatched"),t(),i(22,"option",23),n(23,"Multiple Matches"),t()()()(),i(24,"div",24)(25,"div",25),u(26,sM,37,6,"div",26),i(27,"data-table",27),S("dataRequest",function(h){return b(c),y(r.onDataRequest(h))}),t()()()(),u(28,pM,2,2,"ng-template",null,0,P)(30,_M,2,2,"ng-template",null,1,P)(32,fM,2,2,"ng-template",null,2,P)(34,hM,3,8,"ng-template",null,3,P)(36,xM,3,8,"ng-template",null,4,P)(38,CM,3,2,"ng-template",null,5,P)(40,TM,4,3,"ng-template",null,6,P)(42,wM,1,3,"div",28),i(43,"div",29)(44,"div",30)(45,"div")(46,"h3",31)(47,"span",18),n(48,"Search Result:"),t(),i(49,"span",32),n(50),t()(),i(51,"h4",33)(52,"span",18),n(53,"Results:"),t(),i(54,"span",32),n(55),t()()(),i(56,"button",34),S("click",function(){return b(c),y(r.closeCustomPopOut("view-or-change"))}),x(57,"i",35),t()(),i(58,"div",36)(59,"div",37)(60,"input",38),ve("ngModelChange",function(h){return b(c),_e(r.searchText,h)||(r.searchText=h),y(h)}),S("keyup",function(){return b(c),y(r.onSearchProduct())}),t(),i(61,"div",39),S("click",function(){return b(c),y(r.onSearchProduct())}),i(62,"span",40),x(63,"i",41),t()()(),u(64,PM,6,0,"div",42)(65,OM,21,0,"div",43)(66,AM,2,1,"ng-container",44),t()(),u(67,NM,1,3,"div",28),i(68,"div",45)(69,"div",46)(70,"button",47),S("click",function(){return b(c),y(r.onBack
1FromEditProduct())}),x(71,"i",48),t(),i(72,"h5",49),n(73,"Edit Product"),t(),i(74,"button",34),S("click",function(){return b(c),y(r.closeCustomPopOut("edit-product"))}),x(75,"i",35),t()(),i(76,"div",36)(77,"div",50)(78,"label")(79,"span",18),n(80,"Product name"),t(),i(81,"sup",51),n(82,"*"),t()(),i(83,"input",52),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.name,h)||(r.editProduct.name=h),y(h)}),t()(),i(84,"div",50)(85,"label",18),n(86,"Product Description"),t(),i(87,"textarea",53),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.description,h)||(r.editProduct.description=h),y(h)}),t()(),i(88,"div",54)(89,"h6",55),n(90,"Product Details"),t(),i(91,"div",56)(92,"div",57)(93,"div",50)(94,"label",18),n(95,"Available Quantity"),t(),i(96,"input",58),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.qty,h)||(r.editProduct.qty=h),y(h)}),t()()(),i(97,"div",57)(98,"div",50)(99,"label",18),n(100,"Price Per Unit"),t(),i(101,"input",59),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.price,h)||(r.editProduct.price=h),y(h)}),t()()(),i(102,"div",57)(103,"div",50)(104,"label")(105,"span",18),n(106,"Seller SKU Code"),t(),i(107,"sup",51),n(108,"*"),t()(),i(109,"input",60),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.Seller_SKU,h)||(r.editProduct.Seller_SKU=h),y(h)}),t()()(),i(110,"div",57)(111,"div",50)(112,"label",18),n(113,"Tax Code"),t(),i(114,"input",61),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.hsn_code,h)||(r.editProduct.hsn_code=h),y(h)}),t()()(),i(115,"div",57)(116,"div",50)(117,"label",18),n(118,"Minimum Order Quantity"),t(),i(119,"input",62),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.moq,h)||(r.editProduct.moq=h),y(h)}),t()()(),i(120,"div",57)(121,"div",50)(122,"label",18),n(123,"Country Of Origin"),t(),i(124,"select",63),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.country,h)||(r.editProduct.country=h),y(h)}),i(125,"option",64),n(126,"Select Country Of Origin"),t(),i(127,"option",65),n(128,"India"),t()()()(),i(129,"div",57)(130,"div",50)(131,"label",18),n(132,"Product Type"),t(),i(133,"select",63),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.typeId,h)||(r.editProduct.typeId=h),y(h)}),i(134,"option",64),n(135,"Select Product Type"),t(),i(136,"option",66),n(137,"New"),t(),i(138,"option",67),n(139,"Old"),t(),i(140,"option",68),n(141,"Return"),t(),i(142,"option",69),n(143,"Shelf Pulls"),t()()()(),i(144,"div",57)(145,"div",50)(146,"label",18),n(147,"Tax (in %)"),t(),i(148,"input",70),ve("ngModelChange",function(h){return b(c),_e(r.editProduct.tax,h)||(r.editProduct.tax=h),y(h)}),t()()()()(),i(149,"div",71)(150,"h6",55),n(151,"Product Images"),t(),i(152,"ul",72),u(153,VM,5,1,"li",73),i(154,"li",74)(155,"div",75)(156,"input",76),S("change",function(h){return b(c),y(r.handleEditProductImageInput(h.target.files))}),t(),i(157,"div",77),x(158,"i",78),i(159,"span",18),n(160,"Add Image"),t()(),u(161,BM,4,0,"div",79),t()()()(),i(162,"div",80)(163,"h6",55),n(164,"Key Attributes"),t(),u(165,GM,5,4,"div",81),t(),i(166,"div",82)(167,"div",83)(168,"div",84)(169,"label",18),n(170,"Attribute Name"),t(),i(171,"input",85),ve("ngModelChange",function(h){return b(c),_e(r.newAttribute.name,h)||(r.newAttribute.name=h),y(h)}),t()(),i(172,"div",86)(173,"label",18),n(174,"Attribute Value"),t(),i(175,"input",87),ve("ngModelChange",function(h){return b(c),_e(r.newAttribute.value,h)||(r.newAttribute.value=h),y(h)}),t()(),i(176,"div",88)(177,"button",89),S("click",function(){return b(c),y(r.addNewAttribute())}),n(178,"Submit"),t()()()(),i(179,"div",90)(180,"button",91),S("click",function(){return b(c),y(r.onBackFromEditProduct())}),n(181,"Cancel"),t(),i(182,"button",92),S("click",function(){return b(c),y(r.confirmEditProduct())}),u(183,UM,1,0,"span",16),n(184),t()()()(),u(185,jM,1,3,"div",28),i(186,"div",45)(187,"div",46)(188,"button",47),S("click",function(){return b(c),y(r.onBackFromCreateProduct())}),x(189,"i",48),t(),i(190,"h5",49),n(191,"Create Product"),t(),i(192,"button",34),S("click",function(){return b(c),y(r.closeCustomPopOut("create-product"))}),x(193,"i",35),t()(),i(194,"div",36)(195,"div",93)(196,"label")(197,"span",18),n(198,"Target Industry"),t(),i(199,"sup",51),n(200,"*"),t()(),i(201,"div",94)(202,"div",95)(203,"a",96),u(204,$M,2,0,"span",97)(205,zM,2,1,"span",44),x(206,"i",98),t()(),i(207,"div",99)(208,"div",100)(209,"ul",101),u(210,iA,8,6,"ng-container",102),t()()()()(),i(211,"div",50)(212,"label")(213,"span",18),n(214,"Product name"),t(),i(215,"sup",51),n(216,"*"),t()(),i(217,"input",52),ve("ngModelChange",function(h){return b(c),_e(r.createProduct.name,h)||(r.createProduct.name=h),y(h)}),t()(),i(218,"div",50)(219,"label",18),n(220,"Product Description"),t(),i(221,"textarea",53),ve("ngModelChange",function(h){return b(c),_e(r.createProduct.description,h)||(r.createProduct.description=h),y(h)}),t()(),i(222,"div",80)(223,"h6",55),n(224,"Key Attributes"),t(),u(225,rA,8,5,"div",81),t(),i(226,"div",82)(227,"div",83)(228,"div",84)(229,"label",18),n(230,"Attribute Name"),t(),i(231,"input",85),ve("ngModelChange",function(h){return b(c),_e(r.newCreateAttribute.name,h)||(r.newCreateAttribute.name=h),y(h)}),t()(),i(232,"div",86)(233,"label",18),n(234,"Attribute Value"),t(),i(235,"input",87),ve("ngModelChange",function(h){return b(c),_e(r.newCreateAttribute.value,h)||(r.newCreateAttribute.value=h),y(h)}),t()(),i(236,"div",88)(237,"button",89),S("click",function(){return b(c),y(r.addNewCreateAttribute())}),n(238,"Submit"),t()()()(),i(239,"div",90)(240,"button",91),S("click",function(){return b(c),y(r.onBack
1FromCreateProduct())}),n(241,"Cancel"),t(),i(242,"button",92),S("click",function(){return b(c),y(r.createNewProduct())}),u(243,lA,1,0,"span",16),n(244),t()()()(),u(245,oA,1,3,"div",28),i(246,"div",103)(247,"div",46)(248,"button",47),S("click",function(){return b(c),y(r.onBackFromGenerateAiProduct())}),x(249,"i",48),t(),i(250,"h5",49),n(251,"Generate Product with AI"),t(),i(252,"button",34),S("click",function(){return b(c),y(r.closeCustomPopOut("generate-ai-product"))}),x(253,"i",35),t()(),i(254,"div",36)(255,"div",104)(256,"label",105),n(257,"Product name"),t(),i(258,"input",106),ve("ngModelChange",function(h){return b(c),_e(r.aiProduct.product_name,h)||(r.aiProduct.product_name=h),y(h)}),t()(),i(259,"div",104)(260,"label",105),n(261,"Add more Details"),t(),i(262,"p",107),n(263," Describe your product idea in details. The more context you provide the better the output "),t(),i(264,"textarea",108),ve("ngModelChange",function(h){return b(c),_e(r.aiProduct.additional_hints,h)||(r.aiProduct.additional_hints=h),y(h)}),t()(),i(265,"div",109)(266,"label",18),n(267,"Target Industry"),t(),i(268,"div",94)(269,"div",95)(270,"a",110),u(271,sA,2,0,"span",97)(272,dA,2,1,"span",44),x(273,"i",98),t()(),i(274,"div",111)(275,"div",100)(276,"ul",101),u(277,bA,8,6,"ng-container",102),t()()()()(),i(278,"div",112)(279,"span",113),n(280,"i"),t(),i(281,"p")(282,"span",18),n(283,"Our AI is generating comprehensive product name & descriptions, and target persona based on your inputs. This may take a few moments."),t()()(),i(284,"div",114)(285,"button",115),S("click",function(){return b(c),y(r.closeCustomPopOut("generate-ai-product"))}),n(286," Cancel "),t(),i(287,"button",116),S("click",function(){return b(c),y(r.generateAiProduct())}),u(288,yA,1,0,"span",16),n(289),t()()()(),u(290,SA,1,3,"div",28),i(291,"div",45)(292,"div",46)(293,"button",47),S("click",function(){return b(c),y(r.onBackFromAiPreview())}),x(294,"i",48),t(),i(295,"h5",49),n(296,"Review AI Generated Product"),t(),i(297,"button",34),S("click",function(){return b(c),y(r.closeCustomPopOut("ai-product-preview"))}),x(298,"i",35),t()(),u(299,kA,3,2,"div",117),t()}if(o&2){let c=w(41);l(6),m(" ",(r.uploadDetails==null?null:r.uploadDetails.file_name)||"Document Detail"," "),l(),s("ngIf",r.uploadDetails&&!Ce(79,nM).includes(r.uploadDetails.submit_status)),l(2),s("disabled",r.downloading||!r.uploadDetails),l(),s("ngIf",r.downloading),l(
1),s("ngIf",!r.downloading),l(2),f(r.downloadLabel),l(2),ue("ngModel",r.matchStatus),l(11),s("ngIf",r.uploadDetails),l(),s("config",r.tableConfig)("data",r.tableData)("totalRecords",r.pageLength)("isLoading",r.isLoading)("cellTemplates",r.cellTemplates)("actionsTemplate",c),l(15),s("ngIf",r.isCustomPopOutOpen("view-or-change")),l(),s("ngClass",ze(80,oi,r.isCustomPopOutOpen("view-or-change"))),l(7),f(r.currentProductName),l(5),f(r.masterProducts.length),l(5),ue("ngModel",r.searchText),l(4),s("ngIf",r.isLoadingMasterProducts),l(),s("ngIf",!r.isLoadingMasterProducts&&r.masterProducts.length===0),l(),s("ngIf",!r.isLoadingMasterProducts),l(),s("ngIf",r.isCustomPopOutOpen("edit-product")),l(),s("ngClass",ze(82,oi,r.isCustomPopOutOpen("edit-product"))),l(15),ue("ngModel",r.editProduct.name),l(4),ue("ngModel",r.editProduct.description),l(9),ue("ngModel",r.editProduct.qty),l(5),ue("ngModel",r.editProduct.price),l(8),ue("ngModel",r.editProduct.Seller_SKU),l(5),ue("ngModel",r.editProduct.hsn_code),l(5),ue("ngModel",r.editProduct.moq),l(5),ue("ngModel",r.editProduct.country),l(9),ue("ngModel",r.editProduct.typeId),l(15),ue("ngModel",r.editProduct.tax),l(5),s("ngForOf",r.editProductImages),l(8),s("ngIf",r.editProductLoader),l(4),s("ngForOf",r.editProduct.keyAttributes),l(6),ue("ngModel",r.newAttribute.name),l(4),ue("ngModel",r.newAttribute.value),l(5),s("disabled",r.isSubmitting),l(2),s("disabled",!r.editProduct.name||!r.editProduct.Seller_SKU||r.isSubmitting),l(),s("ngIf",r.isSubmitting),l(),m(" ",r.isSubmitting?"Saving...":"Confirm"," "),l(),s("ngIf",r.isCustomPopOutOpen("create-product")),l(),s("ngClass",ze(84,oi,r.isCustomPopOutOpen("create-product"))),l(18),s("ngIf",!r.selectedCategory),l(),s("ngIf",r.selectedCategory),l(2),re("collapse",!r.isCategoryCollapsed)("show",r.isCategoryCollapsed),l(3),s("ngForOf",r.level1Cat),l(7),ue("ngModel",r.createProduct.name),l(4),ue("ngModel",r.createProduct.description),l(4),s("ngForOf",r.createProduct.keyAttributes),l(6),ue("ngModel",r.newCreateAttribute.name),l(4),ue("ngModel",r.newCreateAttribute.value),l(5),s("disabled",r.isSubmitting),l(2),s("disabled",!r.createProduct.name||!r.createProduct.categoryId||r.isSubmitting),l(),s("ngIf",r.isSubmitting),l(),m(" ",r.isSubmitting?"Saving...":"Save"," "),l(),s("ngIf",r.isCustomPopOutOpen("generate-ai-product")),l(),s("ngClass",ze(86,oi,r.isCustomPopOutOpen("generate-ai-product"))),l(12),ue("ngModel",r.aiProduct.product_name),l(6),ue("ngModel",r.aiProduct.additional_hints),l(7),s("ngIf",!r.selectedAiCategory),l(),s("ngIf",r.selectedAiCategory),l(2),re("collapse",!r.isAiCategoryCollapsed)("show",r.isAiCategoryCollapsed),l(3),s("ngForOf",r.level1Cat),l(8),s("disabled",r.isSubmitting),l(2),s("disabled",!r.aiProduct.product_name||r.isSubmitting),l(),s("ngIf",r.isSubmitting),l(),m(" ",r.isSubmitting?"Generating...":"Generate Product"," "),l(),s("ngIf",r.isCustomPopOutOpen("ai-product-preview")),l(),s("ngClass",ze(88,oi,r.isCustomPopOutOpen("ai-product-preview"))),l(8),s("ngIf",r.aiGeneratedProduct)}},dependencies:[rt,nt,J,W,He,Ke,Ne,at,Ye,Pe,Wi,Pt,Lt,L,vt,Le,Rt],styles:[".default-min-hight[_ngcontent-%COMP%]{min-height:calc(100vh - 170px)!important}.stats-row[_ngcontent-%COMP%] .stat-card[_ngcontent-%COMP%]{background:#fff;border-radius:6px;padding:16px 18px;border:1px solid #e9e9e9;border-left-width:4px;box-shadow:0 1px 4px #0000000f;height:100%}.stats-row[_ngcontent-%COMP%] .stat-card[_ngcontent-%COMP%] .stat-label[_ngcontent-%COMP%]{font-size:13px;color:#888;margin-bottom:6px}.stats-row[_ngcontent-%COMP%] .stat-card[_ngcontent-%COMP%] .stat-value[_ngcontent-%COMP%]{font-size:22px;font-weight:600;color:#333}.stats-row[_ngcontent-%COMP%] .stat-card--success[_ngcontent-%COMP%]{border-left-color:#28a745}.stats-row[_ngcontent-%COMP%] .stat-card--warning[_ngcontent-%COMP%]{border-left-color:#fd7e14}.stats-row[_ngcontent-%COMP%] .stat-card--danger[_ngcontent-%COMP%]{border-left-color:#dc3545}"]})}}return a})();var FA=["financeDrawer"];function MA(a,d){a&1&&(i(0,"div",140),n(1,"WO Number is required"),t())}function AA(a,d){a&1&&(i(0,"div",140),n(1,"WO creation date cannot be after expiry date"),t())}function NA(a,d){a&1&&(i(0,"div",140),n(1,"WO expiry date cannot be before creation date"),t())}function VA(a,d){a&1&&(i(0,"mat-option",141),x(1,"div",142),n(2," Searching... "),t())}function BA(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function RA(a,d){a&1&&(i(0,"mat-option",141),n(1,"No matches found"),t())}function LA(a,d){a&1&&(i(0,"div",140),n(1,"Seller Name is required"),t())}function qA(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("state"))==null?null:e.value,"")}}function GA(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("city"))==null?null:e.value,"")}}function UA(a,d){if(a&1&&(i(0,"div",155)(1,"span",153),n(2,"Service From"),t(),i(3,"span",154),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.purchaseOrderForm.get("sellerAddress"))==null?null:e.value)}}function jA(a,d){if(a&1&&(i(0,"div",147)(1,"h4",148),n(2),t(),i(3,"p",149),n(4),u(5,qA,2,1,"ng-container",51)(6,GA,2,1,"ng-container",51),t(),x(7,"hr",150),i(8,"div",20),u(9,UA,5,1,"div",151),i(10,"div",152)(11,"span",153),n(12,"City"),t(),i(13,"span",154),n(14),t()(),i(15,"div",152)(16,"span",153),n(17,"State"),t(),i(18,"span",154),n(19),t()(),i(20,"div",152)(21,"span",153),n(22,"Country"),t(),i(23,"span",154),n(24),t()()()()),a&2){let e,o,r,c,g,h,C,k,O=p();l(2),f((e=O.purchaseOrderForm.get("sellerName"))==null?null:e.value),l(2),m(" ",(o=O.purchaseOrderForm.get("gstNumber"))==null?null:o.value," "),l(),s("ngIf",(r=O.purchaseOrderForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=O.purchaseOrderForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=O.purchaseOrderForm.get("sellerAddress"))==null?null:g.value),l(5),f(((h=O.purchaseOrderForm.get("city"))==null?null:h.value)||"--"),l(5),f(((C=O.purchaseOrderForm.get("state"))==null?null:C.value)||"--"),l(5),f(((k=O.purchaseOrderForm.get("country"))==null?null:k.value)||"--")}}function $A(a,d){a&1&&x(0,"input",160)}function zA(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),m(" - ",e.email,"")}}function WA(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),u(6,zA,2,1,"ng-container",51),t()()()),a&2){let e=d.$implicit;s("value",e.id),l(3),f(e.name),l(2),m(" ",e.phone,""),l(),s("ngIf",e.email)}}function QA(a,d){a&1&&(i(0,"mat-option",141),n(1,"No users found"),t())}function YA(a,d){if(a&1){let e=I();i(0,"mat-form-field",40)(1,"mat-select",161,6),S("selectionChange",function(r){b(e);let c=w(2),g=p(2);return y(g.onSelectContactOption(r.value,c))}),i(3,"mat-select-trigger"),n(4),t(),i(5,"div",42),S("click",function(r){return b(e),y(r.stopPropagation())}),i(6,"mat-form-field",43)(7,"input",162),S("input",function(r){b(e);let c=p(2);return y(c.onContactSearch(r.target.value))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(8,WA,7,4,"mat-option",46)(9,QA,2,0,"mat-option",45),i(10,"mat-option",47),x(11,"i",48),n(12," Add User "),t()()(),x(13,"button",163)}if(a&2){let e,o=p(2);l(),s("value",o.selectedContactUserId),l(3),m(" ",((e=o.purchaseOrderForm.get("contactName"))==null?null:e.value)||"Type to search or select contact"," "),l(3),s("value",o.contactSearch),l(),s("ngForOf",o.filteredContactUsers),l(),s("ngIf",!o.filteredContactUsers.length),l(),s("value",o.ADD_CONTACT)}}function HA(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function KA(a,d){a&1&&(i(0,"span"),n(1,"Contact number should contain up to 10 digits"),t())}function ZA(a,d){if(a&1&&(i(0,"div",164),u(1,HA,2,0,"span",51)(2,KA,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonNumber"))==null||o.errors==null)&&o.errors.required))}}function JA(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function XA(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email address"),t())}function eN(a,d){if(a&1&&(i(0,"div",164),u(1,JA,2,0,"span",51)(2,XA,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonEmail"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonEmail"))==null||o.errors==null)&&o.errors.required))}}function tN(a,d){if(a&1){let e=I();F(0),i(1,"div",16)(2,"div",17)(3,"h3",156),n(4,"Contact Details "),i(5,"sup",24),n(6,"*"),t()()(),i(7,"div",19)(8,"div",20)(9,"div",21)(10,"div",22)(11,"label",39),n(12,"Contact Name "),i(13,"sup",24),n(14,"*"),t()(),u(15,$A,1,0,"input",157)(16,YA,14,6,"ng-template",null,5,P),t()(),i(18,"div",21)(19,"div",22)(20,"label",39),n(21,"Phone No. "),i(22,"sup",24),n(23,"*"),t()(),i(24,"input",158),S("input",function(){b(e);let r=p();return y(r.onContactPhoneInput())}),t(),u(25,ZA,3,2,"div",115),t()(),i(26,"div",21)(27,"div",22)(28,"label",39),n(29,"Email "),i(30,"sup",24),n(31,"*"),t()(),x(32,"input",159),u(33,eN,3,2,"div",115),t()()()()(),M()}
1if(a&2){let e,o,r=w(17),c=p();l(15),s("ngIf",c.newSellerAdded)("ngIfElse",r),l(9),s("readOnly",c.contactPhoneLocked),l(),s("ngIf",((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.touched)&&((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.invalid)),l(7),s("readOnly",c.contactEmailLocked),l(),s("ngIf",((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.touched)&&((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.invalid))}}function iN(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname)+" - "+(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].city)," ")}}function nN(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function aN(a,d){a&1&&(i(0,"mat-option",141),n(1,"No addresses found"),t())}function rN(a,d){if(a&1&&(i(0,"div",165),x(1,"i",166),i(2,"div")(3,"span",167),n(4),t(),i(5,"span",168),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname),l(2),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].full_address)}}function lN(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname)+" - "+(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].city)," ")}}function oN(a,d){if(a&1&&(i(0,"mat-option",143)(1,"div",144)(2,"div",145),n(3),t(),i(4,"div",146),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function sN(a,d){a&1&&(i(0,"mat-option",141),n(1,"No addresses found"),t())}function dN(a,d){if(a&1&&(i(0,"div",165),x(1,"i",166),i(2,"div")(3,"span",167),n(4),t(),i(5,"span",168),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname),l(2),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].full_address)}}function cN(a,d){if(a&1){let e=I();i(0,"button",169),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(1,"i",48),i(2,"span",13),n(3,"Add Service"),t()()}}function pN(a,d){if(a&1){let e=I();i(0,"div",170)(1,"p",171),n(2,"Add services in work order"),t(),i(3,"button",172),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(4,"i",48),n(5," Add Service "),t()()}}function mN(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),t(),i(7,"td"),n(8),_(9,"currencyFormat"),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td",176)(18,"a",177),S("click",function(){let r=b(e).index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(19,"i",178),t(),i(20,"a",179),S("click",function(){let r=b(e).index,c=p(2);return y(c.requestDeleteProduct(r))}),x(21,"i",180),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.productName),l(2),f(e.skuId||"-"),l(2),f(e.quantity),l(2),f(v(9,7,e.unitPrice)),l(3),m("",e.discount,"%"),l(2),m("",e.tax,"%"),l(2),f(v(16,9,e.totalPayable))}}function uN(a,d){if(a&1&&(i(0,"div",173)(1,"table",174)(2,"thead")(3,"tr")(4,"th",13),n(5,"Product/service Name"),t(),i(6,"th",13),n(7,"SKU"),t(),i(8,"th",13),n(9,"Quantity"),t(),i(10,"th",13),n(11,"Quoted Price/Unit"),t(),i(12,"th",13),n(13,"Discount"),t(),i(14,"th",13),n(15,"GST Rate"),t(),i(16,"th",13),n(17,"Total Amount"),t(),x(18,"th"),t()(),i(19,"tbody"),u(20,mN,22,11,"tr",175),t()()()),a&2){let e=p();l(20),s("ngForOf",e.productFormValues)}}function _N(a,d){a&1&&(i(0,"div",181),n(1," At least one product is required. "),t())}function vN(a,d){if(a&1){let e=I();i(0,"div",182)(1,"button",183),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",184),t(),i(3,"span",185),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function gN(a,d){if(a&1){let e=I();i(0,"button",183),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",184),t()}}function fN(a,d){if(a&1){let e=I();i(0,"button",195),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",196),t()}}function hN(a,d){if(a&1){let e=I();i(0,"div",186)(1,"div",187)(2,"label",77),n(3,"Description"),t(),x(4,"textarea",188),t(),i(5,"div",187)(6,"label",77),n(7,"Amount"),t(),i(8,"input",189),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",190)(10,"div",191)(11,"div",192),u(12,gN,2,0,"button",193)(13,fN,2,0,"button",194),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function xN(a,d){a&1&&(i(0,"span",13),n(1,"Attachments"),t())}function bN(a,d){a&1&&(i(0,"span",13),n(1,"Uploading..."),t())}function yN(a,d){if(a&1&&x(0,"app-loader",197),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function SN(a,d){if(a&1){let e=I();i(0,"span",200)(1,"a",201),n(2),t(),i(3,"i",202),S("click",function(){let r=b
1(e).$implicit,c=p(2),g=w(159);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function CN(a,d){if(a&1&&(i(0,"div",198),u(1,SN,4,2,"span",199),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function EN(a,d){a&1&&(i(0,"div",164),n(1,"Organization name is required"),t())}function IN(a,d){a&1&&(i(0,"div",164),n(1,"Address is required"),t())}function DN(a,d){if(a&1&&(i(0,"option",143),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function TN(a,d){a&1&&(i(0,"div",164),n(1,"State is required"),t())}function wN(a,d){a&1&&(i(0,"div",164),n(1,"City is required"),t())}function PN(a,d){a&1&&(i(0,"div",164),n(1,"Country is required"),t())}function ON(a,d){a&1&&(i(0,"div",164),n(1,"Postal code must be 6 digits"),t())}function kN(a,d){a&1&&(i(0,"div",164),n(1,"Contact name is required"),t())}function FN(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function MN(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function AN(a,d){if(a&1&&(i(0,"div",164),u(1,FN,2,0,"span",51)(2,MN,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.sellerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.sellerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function NN(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function VN(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function BN(a,d){if(a&1&&(i(0,"div",164),u(1,NN,2,0,"span",51)(2,VN,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.sellerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.sellerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function RN(a,d){a&1&&(i(0,"div",164),n(1,"Name is required"),t())}function LN(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function qN(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid 10-digit phone number"),t())}function GN(a,d){if(a&1&&(i(0,"div",164),u(1,LN,2,0,"span",51)(2,qN,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.userForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function UN(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function jN(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function $N(a,d){if(a&1&&(i(0,"div",164),u(1,UN,2,0,"span",51)(2,jN,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.userForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function Ti(a){document.getElementById(a)?.click()}var xn=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O,Q){this.fbs=e,this.financeService=o,this.fb=r,this.commonService=c,this.dialog=g,this.FinanceOrderService=h,this.notificationService=C,this.ref=k,this.activatedRoute=O,this.router=Q,this.states=[],this.submitted=!1,this.selectedFiles=[],this.showDropdown=!1,this.searchList=[],this.filteredSellers$=new Gi,this.sellerOptions=[],this.searchInput$=new ti,this.isSearchLoading=!1,this.disableGstField=!1,this.displaySearchList=!1,this.allowedFileTypes=[".pdf",".doc",".docx"],this.minValue=0,this.countryCode="IN",this.shippingAddressResponse=[],this.billingAddressResponse=[],this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.enableAddressSelection=!1,this.isLoading=!1,this.isAddressLoading=!1,this.sameAsShippingAddress=!1,this.formControlListeners=[],this.productFormValues=[],this.uploadedTermsDocs=[],this.selectedOption="no",this.approverPayload=[],this.prIdFromRoute=null,this.regenerateFromPoId=null,this.prefillPoData=null,this.addressDataReady=!1,this.sellerSubmitting=!1,this.sellerSearchTerm="",this.newSellerAdded=!1,this.userSubmitting=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.selectedContactUserId=null,this.shippingAddrSearch="",this.billingAddrSearch="",this.loadingStates={termsDocs:!1},this.editingProductIndex=null,this.confirmDeleteIndex=null,this.ADD_SELLER="__add_seller__",this.ADD_CONTACT="__add_contact__",this.ADD_SHIPPING_ADDRESS="__add_shipping_address__",this.ADD_BILLING_ADDRESS="__add_billing_address__",this.purchaseOrderForm=this.fbs.group({poNumber:["",E.required],poCreationDate:[""],poExpiryDate:[""],paymentMode:[""],sellerName:new _i("",[E.required]),vendorId:0,gstNumber:[""],sellerAddress:[""],city:[""],state:[""],pincode:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],country:[""],contactName:["",E.required],contactPersonNumber:["",[E.required,E.maxLength(10),E.pattern(/^\d+$/)]],contactPersonEmail
1:["",[E.required,E.email]],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fbs.array([]),totalPayableAmount:0,hasApprovers:["no"],termsandConditions:[""]},{validators:this.poDateRangeValidator}),this.generatePoForm()}sanitizeDigits(e,o){let r=String(e||"").replace(/\D/g,"");return o?r.slice(0,o):r}sanitizeAlphabetic(e){return String(e||"").replace(/[^A-Za-z ]/g,"")}poDateRangeValidator(e){let o=e.get("poCreationDate")?.value,r=e.get("poExpiryDate")?.value;return!o||!r?null:r<o?{poDateRange:!0}:null}get poCreationDateValue(){return this.purchaseOrderForm?.get("poCreationDate")?.value||""}get poExpiryDateValue(){return this.purchaseOrderForm?.get("poExpiryDate")?.value||""}get isPoDateRangeInvalid(){return!!this.purchaseOrderForm?.errors?.poDateRange}limitPositiveNumber(e,o){let r=this.purchaseOrderForm.get(e);if(!r)return;let c=this.sanitizeDigits(r.value,o);r.value!==c&&r.setValue(c,{emitEvent:!1})}limitAlphabetic(e){let o=this.purchaseOrderForm.get(e);if(!o)return;let r=this.sanitizeAlphabetic(o.value);o.value!==r&&o.setValue(r,{emitEvent:!1})}ngOnInit(){this.onSearchSellers({target:{value:""}}
1),this.getAddressData(),this.getStates(),this.initializeAddProductForm(),this.initializeSellerForm(),this.initializeUserForm(),this.activatedRoute.queryParams.subscribe(e=>{e.regenerateFromPoId&&(this.regenerateFromPoId=e.regenerateFromPoId,this.fetchAndPrefillPO(this.regenerateFromPoId))})}requestDeleteProduct(e){this.confirmDeleteIndex=e,Ti("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null),Ti("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,Ti("closeDeleteConfirmModal")}calculateSummary(){let e=C=>Math.round((Number(C)||0)*100+Number.EPSILON)/100,o=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal,0));this.purchaseOrderForm.patchValue({grossTotal:o},{emitEvent:!1});let r=e(this.productFormValues.reduce((C,k)=>C+k.grossTotal*k.discount/100,0));this.purchaseOrderForm.patchValue({discount:r},{emitEvent:!1});let c=e(this.productFormValues.reduce((C,k)=>C+(k.grossTotal-k.grossTotal*k.discount/100)*k.tax/100,0));this.purchaseOrderForm.patchValue({taxes:c},{emitEvent:!1});let g=e(o-r);this.purchaseOrderForm.patchValue({netTotal:g},{emitEvent:!1});let h=e(g+c+this.getAdditionalCharges);this.purchaseOrderForm.patchValue({totalPayableAmount:h},{emitEvent:!1})}get additionalChargesArray(){return this.purchaseOrderForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.additionalChargesArray;return!e||e.length===0?0:e.controls.reduce((o,r)=>o+(Number(r.get("amount")?.value)||0),0)}addAdditionalCharge(){this.purchaseOrderForm.get("additionalCharges").push(this.fbs.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.purchaseOrderForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}initializeAddProductForm(){this.formControlListeners.push(this.purchaseOrderForm.valueChanges.subscribe(()=>this.calculateSummary()))}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.calculateSummary()}resetForm(){this.purchaseOrderForm.reset(),this.GeneratePoForm.reset(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingAddrSearch="",this.billingAddrSearch="",this.sellerSearchTerm="",this.filteredSellers$=ui([]),this.sellerOptions=[],this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newSellerAdded=!1,this.selectedContactUserId=null,this.disableGstField=!1,this.productFormValues=[],this.uploadedTermsDocs=[],this.editingProductIndex=null,this.confirmDeleteIndex=null,this.calculateSummary(),this.ref.detectChanges(),this.submitted=!1}onSave(){if(this.submitted=!0,this.purchaseOrderForm.markAllAsTouched(),this.purchaseOrderForm.invali
1d)return;let e={};try{e=JSON.parse(localStorage.getItem("userDetails")||"{}")}catch{e={}}let o={order_type:"WO",po_number:this.purchaseOrderForm.value.poNumber,po_creation_date:this.purchaseOrderForm.value.poCreationDate,po_expiry_date:this.purchaseOrderForm.value.poExpiryDate,payment_mode:this.purchaseOrderForm.value.paymentMode,seller_name:this.purchaseOrderForm.value.sellerName,vendor_id:this.purchaseOrderForm.value.vendorId,seller_gst:this.purchaseOrderForm.value.gstNumber,seller_address:this.purchaseOrderForm.value.sellerAddress,city:this.purchaseOrderForm.value.city,state:this.purchaseOrderForm.value.state,pincode:this.purchaseOrderForm.value.pincode,country:this.purchaseOrderForm.value.country,user_type:"BUYER",contact_name:this.purchaseOrderForm.value.contactName,contact_number:this.purchaseOrderForm.value.contactPersonNumber,contact_email:this.purchaseOrderForm.value.contactPersonEmail,terms:this.purchaseOrderForm.value.termsandConditions,terms_document_path:[],shipping_address:this.selectedShippingAddress[0]?.entity_id,billing_address:this.selectedBillingAddress[0]?.entity_id,items:[],additional_charges:[...this.purchaseOrderForm.value.additionalCharges],approvalUsers:[],total_payable_amount:this.purchaseOrderForm.value.totalPayableAmount,po_required:1,is_qa_required:"NO",buyer_organization_id:e?.vendorId??null,buyer_user_id:e?.userId??null,seller_organization_id:this.purchaseOrderForm.value.vendorId||null,seller_user_id:this.selectedContactUserId??null};o.terms_document_path=this.uploadedTermsDocs.map(r=>({path:r.path,filename:r.name})),o.items=this.productFormValues.map(r=>A({product_name:r.productName,product_id:r.parentId??r.productId,qty:r.quantity,unit_price:r.unitPrice,discount_percentage:r.discount,gst_percentage:r.tax,sku:r.skuId||"",selected_options:r.selectedConfigOptions||[]},r.isTemp&&{is_temp_product:!0,category:r.category,sub_category:r.subCategory,product_group:r.productGroup,sub_product_group:r.subProductGroup})),o.approvalUsers=this.approverPayload.map(r=>({customer_id:r.customer_id,level:r.level})),this.financeService.pomanualCreate(o).subscribe({next:r=>{r.responseCode===200?(this.notificationService.showSuccess("Work Order created successfully"),this.router.navigate(["finance-management/payable-purchase-orders"])):this.notificationService.showError(r.response||"Failed to create Work Order")},error:r=>{let c=r?.error?.response;this.notificationService.showError(typeof c=="string"&&c?c:"Failed to create Work Order. Please try again.")}})}onOptionChange(e){this.selectedOption=e,this.purchaseOrderForm.get("hasApprovers").setValue(e)}onApproversChange(e){this.approverPayload=e,this.prResponse.approve_users=e.map(o=>j(A({},o),{status:"A"}))}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:e.target.value}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.filteredSellers$=ui(c),this.sellerOptions=c,this.isSearchLoading=!1}}})}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}selectSeller(e){if(!e)return this.removeSeller();this.purchaseOrderForm.patchValue({sellerName:e.vendorData.company_name,vendorId:e.vendorData.vendor_id,gstNumber:e.vendorData.gst,sellerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vend
1orData.region,country:e.vendorData.country_id}),this.disableGstField=!0,this.displaySearchList=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newSellerAdded=!1,this.selectedContactUserId=null,this.getContactUsers()}removeSeller(){this.purchaseOrderForm.patchValue({sellerName:"",gstNumber:"",sellerAddress:"",city:"",state:"",country:""})}onSelectSellerOption(e,o){if(e===this.ADD_SELLER){Ti("openAddSellerModal"),this.restoreSelectValue(o,this.purchaseOrderForm.get("vendorId")?.value);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}onSelectContactOption(e,o){if(e===this.ADD_CONTACT){this.openAddContactUser(),Ti("openAddContactUserModal"),this.restoreSelectValue(o,this.selectedContactUserId);return}let r=this.contactUsers.find(c=>c.id===e);r&&this.selectContactUser(r)}onSelectShippingAddress(e,o){if(e===this.ADD_SHIPPING_ADDRESS){this.setAddAddressMode("shipping",!0),this.restoreSelectValue(o,this.selectedShippingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"shipping")}onSelectBillingAddress(e,o){if(e===this.ADD_BILLING_ADDRESS){this.setAddAddressMode("billing",!0),this.restoreSelectValue(o,this.selectedBillingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"billing")}initializeSellerForm(){this.sellerForm=this.fbs.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveSeller(){if(this.sellerForm.invalid){this.sellerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required seller details correctly.");return}let e=this.sellerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"seller",password:"Test@1234",is_live_user:!1};this.sellerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.sellerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Seller added successfully"),this.applySellerToPo(e,r),this.sellerForm.reset(),Ti("closeAddSellerModal")):this.notificationService.showError(r?.response||"Failed to add seller")},error:()=>{this.sellerSubmitting=!1,this.notificationService.showError("Failed to add seller. Please try again.")}})}applySellerToPo(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,c=o?.response?.user?.id??null;this.purchaseOrderForm.patchValue({sellerName:e.organization_name,gstNumber:e.gst,sellerAddress:e.address,city:e.city,state:e.state,country:e.country_id,pincode:this.sanitizeDigits(e.postal_code,6),contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,vendorId:r}),this.selectedContactUserId=c,this.disableGstField=!0,this.contactUsers=[],this.contactSearch="",this.newSellerAdded=!0,this.contactUserSelected=!0,this.contactPhoneLocked=!0,this.contactEmailLocked=!0;let g=this.purchaseOrderForm.get("contactPersonNumber");g?.setValidators([E.required]),g?.updateValueAndValidity({emitEvent:!1}),this.getContactUsers()}get filteredContactUsers(){return this.contactUsers||[]}getOrgId(){return this.purchaseOrderForm.get("vendorId")?.value||null}getContactUsers(e="",o){let r=this.getOrgId();r&&this.financeService.userList({org_id:r,search:e}).subscribe({next:c=>{let g=c?.response?.list??[];this.contactUsers=(Array.isArray(g)?g:[]).map(h=>({id:h.id,name:h.full_name||[h.firstName,h.lastName].filter(Boolean).join(" ")||"",phone:h.phoneNumber||"",email:h.email||"",raw:h})),o?.()},error:()=>{this.contactUsers=[]}})}selectNewContactUser(e){this.getContactUsers("",()=>{let o=this.contactUsers.find(r=>e.email&&r.email&&r.email.toLowerCase()===e.email.toLowerCase()||e.phone&&r.phone&&String(r.phone)===String(e.phone));this.selectContactUser(o||{name:e.name,phone:e.phone,email:e.email})})}onContactSearch(e){this.contactSearch=e||"",this.getContactUsers(this.contactSearch)}selectContactUser(e){if(!e)return;this.selectedContactUserId=e.id??e.raw?.id??null,this.purchaseOrderForm.patchValue({contactName:e.name||"",contactPersonNumber:e.phone||this.purchaseOrderForm.get("contactPersonNumber")?.value||"",contactPersonEmail:e.email||this.purchaseOrderForm.get("contactPersonEmail")?.value||""});let o=this.purchaseOrderForm.get("contactPersonNumber");e.phone?o?.setValidators([E.required]):o?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),o?.updateValueAndValidity({emitEvent:!1}),this.contactPhoneLocked=!!e.phone,this.contactEmailLocked=!!e.email,this.contactUserSelected=!0}onContactPhoneInput(){let e=this.purchaseOrderForm.get("contactPersonNumber");e?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}initializeUserForm(){this.userForm=this.fbs.group({name:["",[E.required]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}openAddContactUser(){this.userForm?.reset()}
1saveContactUser(){if(this.userForm.invalid){this.userForm.markAllAsTouched(),this.notificationService.showError("Please fill all user details correctly.");return}let e=this.getOrgId();if(!e){this.notificationService.showError("Please select a seller first.");return}let o=this.userForm.value,r={email:o.email,phoneNumber:o.phone,firstName:o.name,org_id:e,is_live_user:!1};this.userSubmitting=!0,this.financeService.addUser(r).subscribe({next:c=>{this.userSubmitting=!1,c?.responseCode===200?(this.notificationService.showSuccess(c.response?.response||"User added successfully"),this.selectNewContactUser({name:o.name,phone:o.phone,email:o.email}),this.userForm.reset(),Ti("closeAddContactUserModal")):this.notificationService.showError(c?.response||"Failed to add user")},error:()=>{this.userSubmitting=!1,this.notificationService.showError("Failed to add user. Please try again.")}})}getAddressData(){this.isAddressLoading=!0,this.commonService.getAddressList({perPage:10,pageNumber:1}).subscribe(e=>{let o=e.total_count||0;e.wo_number&&this.purchaseOrderForm.patchValue({poNumber:e.wo_number}),this.shippingAddressResponse=e.response||[],this.billingAddressResponse=e.response||[],this.enableAddressSelection=!0,this.isAddressLoading=!1,this.addressDataReady=!0,this.prefillPoData&&this.applyPrefill(),o>10&&this.commonService.getAddressList({perPage:o,pageNumber:1}).subscribe(r=>{let c=r.response||[];this.shippingAddressResponse=c,this.billingAddressResponse=c})})}generatePoForm(){this.GeneratePoForm=this.fb.group({selectedSeller:[""],shippingAddress:["",E.required],billingAddress:["",E.required]})}closeOpenDropdowns(){document.querySelectorAll(".dropdown-menu.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll(".dropdown.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll('[data-toggle="dropdown"][aria-expanded="true"]').forEach(e=>e.setAttribute("aria-expanded","false"))}setAddAddressMode(e,o){this.addAddressMode=e,o&&(this.closeOpenDropdowns(),setTimeout(()=>{this.dialog.open(Ht,{data:{}}).afterClosed().subscribe(c=>{c&&(this.poRfqData?.data&&(this.addAddressMode==="shipping"&&(this.poRfqData.data.delivery_address=A({},c)),this.addAddressMode==="billing"&&(this.poRfqData.data.billing_address=A({},c))),this.getAddressData())})},0)),(!this.shippingAddressResponse.length||!this.billingAddressResponse.length)&&this.getAddressData()}filterAddresses(e){let o=this.shippingAddressResponse||[];if(!e||!e.trim())return o;let r=e.toLowerCase();return o.filter(c=>(c.firstname||"").toLowerCase().includes(r)||(c.lastname||"").toLowerCase().includes(r)||(c.full_address||"").toLowerCase().includes(r)||(c.city||"").toLowerCase().includes(r))}onSameAsShippingChange(e){this.sameAsShippingAddress=e.target.checked,this.sameAsShippingAddress?this.selectedShippingAddress?.length&&this.changeSelectedAddress(this.selectedShippingAddress[0],"billing"):(this.selectedBillingAddress=[],this.GeneratePoForm.patchValue({billingAddress:""}))}changeSelectedAddress(e,o){let r=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})];o==="shipping"&&(this.selectedShippingAddress=r,this.GeneratePoForm.patchValue({shippingAddress:String(e.entity_id)})),o==="billing"&&(this.selectedBillingAddress=r,this.GeneratePoForm.patchValue({billingAddress:String(e.entity_id)}))}selectShippingAddress(){this.poRfqData.data.delivery_address=j(A({},this.selectedShippingAddress[0]),{address_id:this.selectedShippingAddress[0].entity_id}),this.GeneratePoForm.patchValue({shippingAddress:String(this.selectedShippingAddress[0].entity_id)})}selectBillingAddress(){this.poRfqData.data.billing_address=j(A({},this.selectedBillingAddress[0]),{address_id:this.selectedBillingAddress[0].entity_id}),this.GeneratePoForm.patchValue({billingAddress:String(this.selectedBillingAddress[0].entity_id)})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=new FormData;c.append("file",o[r]),c.append("source","po"),c.append("source_id",""),this.FinanceOrderService.FileUpload(c).subscribe(g=>{g.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:g.response.file_name,path:g.response.filepath,viewPath:g.response.fileViewPath}]:this.notificationService.showError(g.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}fetchAndPrefillPO(e){let o=new xt;o.po_id=e,this.FinanceOrderService.GetPoDetails(o).subscribe({next:r=>{this.prefillPoData=r.response.data,this.addressDataReady&&this.applyPrefill()},error:()=>this.notificationService.showError("Failed to load PO details for regeneration.")})}applyPrefill(){let e=this.prefillPoData;if(!e)return;this.purchaseOrderForm.patchValue({poNumber:e.po_number,poCreationDate:e.po_date?e.po_date.split(" ")[0]:"",poExpiryDate:e.expiry_date?e.expiry_date.split(" ")[0]:"",paymentMode:this.mapPaymentMode(e.payment_mode),sellerName:e.seller_details?.company_name??"",vendorId:e.seller_vendor_id,gstNumber:e.seller_gst||(e.seller_gst_list?.[0]??""),sellerAddress:e.seller_details?.address??"",city:e.seller_details?.city??"",state:e.seller_details?.region??"",pincode:this.sanitizeDigits(e.seller_billing_address?.postcode??"",6),country:e.seller_details?.country_id??"",termsandConditions:e.terms??""}),this.disableGstField=!0,this.productFormValues=(e.items??[]).map(g=>({productName:g.product_name,productId:g.product_id,skuId:g.display_item_id||g.item_id||"",quantity:g.offered_qty??g.required_qty??0,unitPrice:g.unit_price,grossTotal:g.gross_total,discount:g.discount_percent??0,tax:g.tax_percent??0,totalPayable:g.total_amount,selectedConfigOptions:[],configurableOptionsFull:[]}));let o=this.purchaseOrderForm.get("additionalCharges");o.clear(),[{description:"Logistics",amount:e.logistics_charges},{description:"Insurance",amount:e.insurance_charges},{description:"Shipping",amount:e.shipping_charges}
1].forEach(g=>{g.amount&&o.push(this.fbs.group({description:[g.description],amount:[g.amount]}))}),this.calculateSummary();let r=(e.address??[]).find(g=>g.addressType==="shipping"),c=(e.address??[]).find(g=>g.addressType==="billing");if(r){let g=this.shippingAddressResponse.find(h=>h.entity_id==r.id);g&&this.changeSelectedAddress(g,"shipping")}if(c){let g=this.billingAddressResponse.find(h=>h.entity_id==c.id);g&&this.changeSelectedAddress(g,"billing")}}mapPaymentMode(e){return{"Bank Transfer":"bankTransfer","Online Transfer":"bankTransfer","Cheque/DD":"chequeDd",Cash:"cash",Card:"card","Wallet/UPI":"walletUpi","Payment Gateway":"paymentGateway"}[e]??""}ngOnDestroy(){this.formControlListeners.forEach(e=>e.unsubscribe())}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Dt),T(ft),T(ge),T(Ae),T(z),T(H),T(Wt),T(de),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-work-order"]],viewQuery:function(o,r){if(o&1&&N(FA,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:373,vars:83,consts:[["sellerSelect",""],["shippingAddrSelect",""],["billingAddrSelect",""],["docsinput",""],["financeDrawer",""],["contactNameDropdown",""],["contactSelect",""],[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group"],["for","",1,"mod-form-label"],[1,"text-danger"],["type","text","formControlName","poNumber","placeholder","Enter WO Number",1,"form-control","mod-input"],["class","invalid-error","appTranslate","",4,"ngIf"],["for","","appTranslate","",1,"mod-form-label"],["type","date","formControlName","poCreationDate","placeholder","Enter date",1,"form-control","mod-input"],["type","date","formControlName","poExpiryDate","placeholder","Enter date",1,"form-control","mod-input"],["formControlName","paymentMode",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],["value","bankTransfer","appTranslate",""],["value","chequeDd","appTranslate",""],["value","cash","appTranslate",""],["value","card","appTranslate",""],["value","walletUpi","appTranslate",""],["value","paymentGateway","appTranslate",""],[1,"col-md-8"],[1,"mod-form-label"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or enter new seller",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search seller...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[1,"text-primary","fw-500",3,"value"],[1,"ri-add-line"],["type","button","id","openAddSellerModal","data-toggle","modal","data-target","#addSellerModal",1,"d-none"],["class","fin-info-block mt-2",4,"ngIf"],[4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"shpCard","h-100"],["appTranslate","",1,"h6","fw-600","mb-3"],["panelClass","address-select-panel no-checkmark","placeholder","Select Service Address",3,"selectionChange"],["matInput","","placeholder","Search address...",3,"input","keydown.space","click","value"],["class","mod-address-chip mt-3",4,"ngIf"],[1,"d-flex","align-items-center","mb-3"],["appTranslate","",1,"h6","fw-600","mb-0"],[1,"custom-control","custom-checkbox","fin-check","ml-4"],["type","checkbox","id","sameAsShipping",1,"custom-control-input",3,"change","checked","disabled"],["for","sameAsShipping","appTranslate","",1,"custom-control-label","mr-2"],["panelClass","address-select-panel no-checkmark","placeholder","Select Billing Address",3,"selectionChange","value","disabled"],["type","button","class","mod-btn mod-btn-outline-primary btn-sm",3,"click",4,"ngIf"],[1,"table-dashboard"],[1,"col-12","px-0"],["class","fin-empty-products text-center py-4",4,"ngIf"],["class","table-responsive mod-table-wrapper",4,"ngIf"],["class","invali
1d-error mt-2","appTranslate","",4,"ngIf"],[1,"col-12","px-0","mt-4"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"mod-card","h-100"],["appTranslate","",1,"mod-form-label"],["rows","6","formControlName","termsandConditions","placeholder","Please write T & C, if any concern in WO",1,"form-control","mod-input"],["type","file","id","poAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","poAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"list-unstyled","fin-summary"],["appTranslateText",""],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/payable-purchase-orders","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title","d-flex","align-items-center"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],["appTranslateText","",1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],["id","addSellerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-title"],["type","button","id","closeAddSellerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"modal-body"],["type","text","formControlName","organization_name","placeholder","Enter seller name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],[1,"col-12"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addContactUserModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-dialog-scrollable"],["type","button","id","closeAddContactUserModal","data-dismiss","modal",1,"d-none"],["type","text","formControlName","name","placeholder","Enter name",1,"form-control","mod-input"],["type","text","inputmode","numeric","formControlName","phone","placeholder","Enter phone number","maxlength","10",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter email id",1,"form-control","mod-input"],["moduleType","FINANCE","productType","SERVICE",3,"productAdded"],["appTranslate","",1,"invalid-error"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12 mb-3",4,"ngIf"],[1,"col-sm-4"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"col-12","mb-3"],[1,"mod-card-title","mb-0"],["type","text","class","form-control mod-input","formControlName","contactName","readonly","",4,"ngIf","ngIfElse"],["type","text","inputmode","numeric","maxlength","10","formControlName","contactPersonNumber","placeholder","Enter Number",1,"form-control","mod-input",3,"input","readOnly"],["type","text","formControlName","contactPersonEmail","placeholder","Enter Email id",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","contactName","readonly","",1,"form-control","mod-input"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or select contact",3,"selectionChange","value"],["matInput","","placeholder","Search user...",3,"input","keydown.space","click","value"],["type","button","id","openAddContactUserModal","data-toggle","modal","data-target","#addContactUserModal",1,"d-none"],[1,"invalid-error"],[1,"mod-address-chip","mt-3"],[1,"ri-map-pin-line"],[1,"mod-address-chip__title"],[1,"mod-address-chip__addr"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"fin-empty-products","text-center","py-4"],[1,"text-muted","mb-3"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click"],[1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","table-dashboard","fin-product-table"],[4,"ngFor","ngForOf"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],["appTranslate","",1,"invalid-error","mt-2"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class","p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",7)(1,"div",8)(2,"div",9)(3,"h2",10)(4,"a",11),x(5,"i",12),t(),i(6,"span",13),n(7,"Create Work Order"),t()()(),x(8,"div",14),t(),i(9,"form",15),S("ngSubmit",function(){return b(c),y(r.onSave())}),i(10,"div",16)(11,"div",17)(12,"h3",18),n(13,"Work Order Information"),t()(),i(14,"div",19)(15,"div",20)(16,"div",21)(17,"div",22)(18,"label",23)(19,"span",13),n(20,"WO Number"),t(),i(21,"sup",24),n(22,"*"),t()(),x(23,"input",25),u(24,MA,2,0,"div",26),t()(),i(25,"div",21)(26,"div",22)(27,"label",27),n(28,"WO Creation Date"),t(),x(29,"input",28),u(30,AA,2,0,"div",26),t()(),i(31,"div",21)(32,"div",22)(33,"label",27),n(34,"WO Expiry Date"),t(),x(35,"input",29),u(36,NA,2,0,"div",26),t()(),i(37,"div",21)(38,"div",22)(39,"label",27),n(40," Payment Mode"),t(),i(41,"select",30)(42,"o
1ption",31),n(43,"Select Payment Mode"),t(),i(44,"option",32),n(45,"Bank Transfer"),t(),i(46,"option",33),n(47,"Cheque/DD"),t(),i(48,"option",34),n(49,"Cash"),t(),i(50,"option",35),n(51,"Card"),t(),i(52,"option",36),n(53,"Wallet/UPI"),t(),i(54,"option",37),n(55,"Payment Gateway"),t()()()()()()(),i(56,"div",16)(57,"div",17)(58,"h3",18),n(59,"Supplier Details"),t()(),i(60,"div",19)(61,"div",20)(62,"div",38)(63,"div",22)(64,"label",39)(65,"span",13),n(66,"Seller Name"),t(),i(67,"sup",24),n(68,"*"),t()(),i(69,"mat-form-field",40)(70,"mat-select",41,0),S("selectionChange",function(h){b(c);let C=w(71);return y(r.onSelectSellerOption(h.value,C))}),i(72,"mat-select-trigger"),n(73),t(),i(74,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(75,"mat-form-field",43)(76,"input",44),S("input",function(h){return b(c),y(r.onSearchSellers(h))})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(77,VA,3,0,"mat-option",45)(78,BA,6,5,"mat-option",46)(79,RA,2,0,"mat-option",45),i(80,"mat-option",47),x(81,"i",48),n(82," Add New Seller "),t()()(),x(83,"button",49),u(84,LA,2,0,"div",26),t()()(),u(85,jA,25,8,"div",50),t()(),u(86,tN,34,6,"ng-container",51),i(87,"div",16)(88,"div",17)(89,"h3",18),n(90,"Buyer Details"),t()(),i(91,"div",19)(92,"div",52)(93,"div",53)(94,"div",54)(95,"h4",55),n(96,"Service Address"),t(),i(97,"mat-form-field",40)(98,"mat-select",56,1),S("selectionChange",function(h){b(c);let C=w(99);return y(r.onSelectShippingAddress(h.value,C))}),u(100,iN,2,1,"mat-select-trigger",51),i(101,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(102,"mat-form-field",43)(103,"input",57),S("input",function(h){return b(c),y(r.shippingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(104,nN,6,4,"mat-option",46)(105,aN,2,0,"mat-option",45),i(106,"mat-option",47),x(107,"i",48),n(108," Add New Address "),t()()(),u(109,rN,7,2,"div",58),t()(),i(110,"div",53)(111,"div",54)(112,"div",59)(113,"h4",60),n(114,"Billing Address"),t(),i(115,"div",61)(116,"input",62),S("change",function(h){return b(c),y(r.onSameAsShippingChange(h))}),t(),i(117,"label",63),n(118,"Same as Service Address"),t()()(),i(119,"mat-form-field",40)(120,"mat-select",64,2),S("selectionChange",function(h){b(c);let C=w(121);return y(r.onSelectBillingAddress(h.value,C))}),u(122,lN,2,1,"mat-select-trigger",51),i(123,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(124,"mat-form-field",43)(125,"input",57),S("input",function(h){return b(c),y(r.billingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(126,oN,6,4,"mat-option",46)(127,sN,2,0,"mat-option",45),i(128,"mat-option",47),x(129,"i",48),n(130," Add New Address "),t()()(),u(131,dN,7,2,"div",58),t()()()()(),i(132,"div",16)(133,"div",17)(134,"h3",18),n(135,"Service Details"),t(),u(136,cN,4,0,"button",65),t(),i(137,"div",19)(138,"div",66)(139,"div",67),u(140,pN,6,0,"div",68)(141,uN,21,1,"div",69)(142,_N,2,0,"div",70),t(),i(143,"div",71),u(144,vN,5,0,"div",72),i(145,"div",73),u(146,hN,14,3,"div",74),t()()()()(),i(147,"div",75)(148,"div",38)(149,"div",76)(150,"div",17)(151,"h3",18),n(152,"Terms & Conditions"),t()(),i(153,"div",19)(154,"div",22)(155,"label",77),n(156,"Terms"),t(),x(157,"textarea",78),t(),i(158,"input",79,3),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(160,"label",80),x(161,"i",81),u(162,xN,2,0,"span",82)(163,bN,2,0,"span",82),t(),u(164,yN,1,2,"app-loader",83)(165,CN,2,1,"div",84),t()()(),i(166,"div",21)(167,"div",76)(168,"div",17)(169,"h3",18),n(170,"WO Summary"),t()(),i(171,"div",19)(172,"ul",85)(173,"li",86),n(174," Gross Total "),i(175,"span"),n(176),_(177,"currencyFormat"),t()(),i(178,"li")(179,"span",13),n(180,"Discount"),t(),i(181,"span",24),n(182),_(183,"currencyFormat"),t()(),i(184,"li",86),n(185," Net Total "),i(186,"span"),n(187),_(188,"currencyFormat"),t()(),i(189,"li",86),n(190," GST "),i(191,"span"),n(192),_(193,"currencyFormat"),t()(),i(194,"li",86),n(195," Additional Charges "),i(196,"span"),n(197),_(198,"currencyFormat"),t()()()(),i(199,"div",87),n(200," Total Payable Amou
1nt "),i(201,"span"),n(202),_(203,"currencyFormat"),t()()()()(),i(204,"div",88)(205,"div",89)(206,"div",90)(207,"button",91),n(208,"Cancel"),t(),i(209,"button",92),n(210,"Save"),t()()()()()(),x(211,"button",93)(212,"button",94),i(213,"div",95)(214,"div",96)(215,"div",97)(216,"div",98)(217,"h4",99),x(218,"i",100),i(219,"span",13),n(220,"Delete Product"),t()()(),i(221,"div",101)(222,"p",102),n(223,"Are you sure you want to delete "),i(224,"strong"),n(225),t(),n(226,"? "),t(),i(227,"p",103),n(228,"This action cannot be undone."),t()(),i(229,"div",104)(230,"button",105),S("click",function(){return b(c),y(r.cancelDelete())}),n(231,"No, Keep it"),t(),i(232,"button",106),S("click",function(){return b(c),y(r.confirmDelete())}),n(233,"Yes, Delete"),t()()()()(),i(234,"div",107)(235,"div",108)(236,"div",97)(237,"div",98)(238,"h5",109),n(239,"Add New Seller"),t(),x(240,"button",110),i(241,"button",111),S("click",function(){return b(c),y(r.sellerForm.reset())}),n(242,"\xD7"),t()(),i(243,"form",112)(244,"div",113)(245,"div",52)(246,"div",53)(247,"label",39),n(248,"Seller Name / Company Name "),i(249,"sup",24),n(250,"*"),t()(),x(251,"input",114),u(252,EN,2,0,"div",115),t(),i(253,"div",53)(254,"label",39),n(255,"GST"),t(),x(256,"input",116),t(),i(257,"div",53)(258,"label",39),n(259,"PAN"),t(),x(260,"input",117),t()(),i(261,"h3",118),n(262,"Service From"),t(),i(263,"div",52)(264,"div",119)(265,"label",39),n(266,"Address "),i(267,"sup",24),n(268,"*"),t()(),x(269,"input",120),u(270,IN,2,0,"div",115),t(),i(271,"div",53)(272,"label",39),n(273,"State "),i(274,"sup",24),n(275,"*"),t()(),i(276,"select",121)(277,"option",122),n(278,"Select State"),t(),u(279,DN,2,2,"option",46),t(),u(280,TN,2,0,"div",115),t(),i(281,"div",53)(282,"label",39),n(283,"City "),i(284,"sup",24),n(285,"*"),t()(),x(286,"input",123),u(287,wN,2,0,"div",115),t(),i(288,"div",53)(289,"label",39),n(290,"Country "),i(291,"sup",24),n(292,"*"),t()(),i(293,"select",124)(294,"option",122),n(295,"Select Country"),t(),i(296,"option",125),n(297,"India"),t()(),u(298,PN,2,0,"div",115),t(),i(299,"div",53)(300,"label",39),n(301,"Postal Code"),t(),x(302,"input",126),u(303,ON,2,0,"div",115),t()(),i(304,"h3",118),n(305,"Contact Details"),t(),i(306,"div",52)(307,"div",53)(308,"label",39),n(309,"Contact Name "),i(310,"sup",24),n(311,"*"),t()(),x(312,"input",127),u(313,kN,2,0,"div",115),t(),i(314,"div",53)(315,"label",39),n(316,"Phone No. "),i(317,"sup",24),n(318,"*"),t()(),x(319,"input",128),u(320,AN,3,2,"div",115),t(),i(321,"div",53)(322,"label",39),n(323,"Email Id "),i(324,"sup",24),n(325,"*"),t()(),x(326,"input",129),u(327,BN,3,2,"div",115),t()()(),i(328,"div",130)(329,"button",131),S("click",function(){return b(c),y(r.sellerForm.reset())}),n(330,"Cancel"),t(),i(331,"button",132),S("click",function(){return b(c),y(r.saveSeller())}),n(332),t()()()()()(),i(333,"div",133)(334,"div",134)(335,"div",97)(336,"div",98)(337,"h5",109),n(338,"Add User"),t(),x(339,"button",135),i(340,"button",111),S("click",function(){return b(c),y(r.userForm.reset())}),n(341,"\xD7"),t()(),i(342,"form",112)(343,"div",113)(344,"div",52)(345,"div",119)(346,"label",39),n(347,"Name "),i(348,"sup",24),n(349,"*"),t()(),x(350,"input",136),u(351,RN,2,0,"div",115),t(),i(352,"div",119)(353,"label",39),n(354,"Phone Number "),i(355,"sup",24),n(356,"*"),t()(),x(357,"input",137),u(358,GN,3,2,"div",115),t(),i(359,"div",119)(360,"label",39),n(361,"Email "),i(362,"sup",24),n(363,"*"),t()(),x(364,"input",138),u(365,$N,3,2,"div",115),t()()(),i(366,"div",130)(367,"button",131),S("click",function(){return b(c),y(r.userForm.reset())}),n(368,"Cancel"),t(),i(369,"button",132),S("click",function(){return b(c),y(r.saveContactUser())}),n(370),t()()()()()(),i(371,"app-common-bom-product-drawer",139,4),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve,qe,Ge,Ue,je;l(4),s("backButtonFallback","/finance-management/payable-purchase-orders"),l(5),s("formGroup",r.purchaseOrderForm),l(15),s("ngIf",((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.touched)&&((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.invalid)),l(5),Be("max",r.poExpiryDateValue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((g=r.purchaseOrderForm.get("poCreationDate"))==null?null:g.touched)),l(5),Be("min",r.poCreationDateV
1alue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((h=r.purchaseOrderForm.get("poExpiryDate"))==null?null:h.touched)),l(34),s("value",(C=r.purchaseOrderForm.get("vendorId"))==null?null:C.value),l(3),m(" ",((k=r.purchaseOrderForm.get("sellerName"))==null?null:k.value)||"Type to search or enter new seller"," "),l(3),s("value",r.sellerSearchTerm),l(),s("ngIf",r.isSearchLoading),l(),s("ngForOf",r.sellerOptions),l(),s("ngIf",!r.isSearchLoading&&r.sellerSearchTerm&&r.sellerOptions.length===0),l(),s("value",r.ADD_SELLER),l(4),s("ngIf",((O=r.purchaseOrderForm.get("sellerName"))==null?null:O.touched)&&((O=r.purchaseOrderForm.get("sellerName"))==null?null:O.invalid)),l(),s("ngIf",(Q=r.purchaseOrderForm.get("sellerName"))==null?null:Q.value),l(),s("ngIf",(G=r.purchaseOrderForm.get("sellerName"))==null?null:G.value),l(14),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(3),s("value",r.shippingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.shippingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.shippingAddrSearch).length),l(),s("value",r.ADD_SHIPPING_ADDRESS),l(3),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(7),s("checked",r.sameAsShippingAddress)("disabled",!r.selectedShippingAddress||r.selectedShippingAddress.length==0),l(4),s("value",(X=r.selectedBillingAddress==null||r.selectedBillingAddress[0]==null?null:r.selectedBillingAddress[0].entity_id)!==null&&X!==void 0?X:null)("disabled",r.sameAsShippingAddress),l(2),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(3),s("value",r.billingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.billingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.billingAddrSearch).length),l(),s("value",r.ADD_BILLING_ADDRESS),l(3),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(5),s("ngIf",r.productFormValues.length),l(4),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",r.productFormValues.length),l(),s("ngIf",r.submitted&&(!r.productFormValues||r.productFormValues.length===0)),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(11),f(v(177,71,(pe=r.purchaseOrderForm.get("grossTotal"))==null?null:pe.value)),l(6),m("- ",v(183,73,(Y=r.purchaseOrderForm.get("discount"))==null?null:Y.value),""),l(5),f(v(188,75,(le=r.purchaseOrderForm.get("netTotal"))==null?null:le.value)),l(5),f(v(193,77,(ee=r.purchaseOrderForm.get("taxes"))==null?null:ee.value)),l(5),f(v(198,79,r.getAdditionalCharges)),l(5),f(v(203,81,(fe=r.purchaseOrderForm.get("totalPayableAmount"))==null?null:fe.value)),l(7),s("disabled",r.purchaseOrderForm.invali
1d||!r.productFormValues||r.productFormValues.length===0),l(16),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:""),l(18),s("formGroup",r.sellerForm),l(9),s("ngIf",((oe=r.sellerForm.get("organization_name"))==null?null:oe.touched)&&((oe=r.sellerForm.get("organization_name"))==null?null:oe.invalid)),l(18),s("ngIf",((te=r.sellerForm.get("address"))==null?null:te.touched)&&((te=r.sellerForm.get("address"))==null?null:te.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((me=r.sellerForm.get("state"))==null?null:me.touched)&&((me=r.sellerForm.get("state"))==null?null:me.invalid)),l(7),s("ngIf",((ce=r.sellerForm.get("city"))==null?null:ce.touched)&&((ce=r.sellerForm.get("city"))==null?null:ce.invalid)),l(11),s("ngIf",((be=r.sellerForm.get("country_id"))==null?null:be.touched)&&((be=r.sellerForm.get("country_id"))==null?null:be.invalid)),l(5),s("ngIf",((Fe=r.sellerForm.get("postal_code"))==null?null:Fe.touched)&&((Fe=r.sellerForm.get("postal_code"))==null?null:Fe.invalid)),l(10),s("ngIf",((Me=r.sellerForm.get("contact_name"))==null?null:Me.touched)&&((Me=r.sellerForm.get("contact_name"))==null?null:Me.invalid)),l(7),s("ngIf",((Ve=r.sellerForm.get("phone"))==null?null:Ve.touched)&&((Ve=r.sellerForm.get("phone"))==null?null:Ve.invalid)),l(7),s("ngIf",((qe=r.sellerForm.get("email"))==null?null:qe.touched)&&((qe=r.sellerForm.get("email"))==null?null:qe.invalid)),l(4),s("disabled",r.sellerSubmitting),l(),m(" ",r.sellerSubmitting?"Saving...":"Save Seller"," "),l(10),s("formGroup",r.userForm),l(9),s("ngIf",((Ge=r.userForm.get("name"))==null?null:Ge.touched)&&((Ge=r.userForm.get("name"))==null?null:Ge.invalid)),l(7),s("ngIf",((Ue=r.userForm.get("phone"))==null?null:Ue.touched)&&((Ue=r.userForm.get("phone"))==null?null:Ue.invalid)),l(7),s("ngIf",((je=r.userForm.get("email"))==null?null:je.touched)&&((je=r.userForm.get("email"))==null?null:je.invalid)),l(4),s("disabled",r.userSubmitting),l(),m(" ",r.userSubmitting?"Submitting...":"Submit"," ")}},dependencies:[rt,J,W,Ee,It,Mt,Et,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Ot,gt,kt,Ft,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ae],styles:[".searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.max-w-80px[_ngcontent-%COMP%]{max-width:80px}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.min-w-154px[_ngcontent-%COMP%]{min-width:154px}.ml-20[_ngcontent-%COMP%]{margin-left:20px}.min-h-21[_ngcontent-%COMP%]{min-height:21px}.border-right-black[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.125)}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}
1.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal;cursor:pointer}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;border:1px solid #ececec;border-radius:8px;overflow:hidden;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-theme[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:18px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}"]})}}return a})();var zN=["financeDrawer"];function WN(a,d){a&1&&(i(0,"div",141),n(1,"WO Number is required"),t())}function QN(a,d){a&1&&(i(0,"div",141),n(1,"WO creation date cannot be after expiry date"),t())}function YN(a,d){a&1&&(i(0,"div",141),n(1,"WO expiry date cannot be before creation date"),t())}function HN(a,d){a&1&&(i(0,"mat-option",142),x(1,"div",143),n(2," Searching... "),t())}function KN(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.vendorData.vendor_id),l(3),m(" ",e.vendorData.company_name," "),l(2),wt(" ",e.vendorData.gst," - ",e.vendorData.region," - ",e.vendorData.city," ")}}function ZN(a,d){a&1&&(i(0,"mat-option",142),n(1,"No matches found"),t())}function JN(a,d){a&1&&(i(0,"div",141),n(1,"Buyer Name is required"),t())}function XN(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("state"))==null?null:e.value,"")}}function eV(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e,o=p(2);l(),m(" - ",(e=o.purchaseOrderForm.get("city"))==null?null:e.value,"")}}function tV(a,d){if(a&1&&(i(0,"div",156)(1,"span",154),n(2,"Service At"),t(),i(3,"span",155),n(4),t()()),a&2){let e,o=p(2);l(4),f((e=o.purchaseOrderForm.get("buyerAddress"))==null?null:e.value)}}function iV(a,d){if(a&1&&(i(0,"div",148)(1,"h4",149),n(2),t(),i(3,"p",150),n(4),u(5,XN,2,1,"ng-container",51)(6,eV,2,1,"ng-container",51),t(),x(7,"hr",151),i(8,"div",20),u(9,tV,5,1,"div",152),i(10,"div",153)(11,"span",154),n(12,"City"),t(),i(13,"span",155),n(14),t()(),i(15,"div",153)(16,"span",154),n(17,"State"),t(),i(18,"span",155),n(19),t()(),i(20,"div",153)(21,"span",154),n(22,"Country"),t(),i(23,"span",155),n(24),t()()()()),a&2){let e,o,r,c,g,h,C,k,O=p();l(2),f((e=O.purchaseOrderForm.get("buyerName"))==null?null:e.value),l(2),m(" ",(o=O.purchaseOrderForm.get("buyerGst"))==null?null:o.value," "),l(),s("ngIf",(r=O.purchaseOrderForm.get("state"))==null?null:r.value),l(),s("ngIf",(c=O.purchaseOrderForm.get("city"))==null?null:c.value),l(3),s("ngIf",(g=O.purchaseOrderForm.get("buyerAddress"))==null?null:g.value),l(5),f(((h=O.purchaseOrderForm.get("city"))==null?null:h.value)||"--"),l(5),f(((C=O.purchaseOrderForm.get("state"))==null?null:C.value)||"--"),l(5),f(((k=O.purchaseOrderForm.get("country"))==null?null:k.value)||"--")}}function nV(a,d){a&1&&x(0,"input",161)}function aV(a,d){if(a&1&&(F(0),n(1),M()),a&2){let e=p().$implicit;l(),m(" - ",e.email,"")}}function rV(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),u(6,aV,2,1,"ng-container",51),t()()()),a&2){let e=d.$implicit;s("value",e.id),l(3),f(e.name),l(2),m(" ",e.phone,""),l(),s("ngIf",e.email)}}function lV(a,d){a&1&&(i(0,"mat-option",142),n(1,"No users found"),t())}function oV(a,d){if(a&1){let e=I();i(0,"mat-form-field",40)(1,"mat-select",162,6),S("selectionChange",function(r){b(e);let c=w(2),g=p(2);return y(g.onSelectContactOption(r.value,c))}),i(3,"mat-select-trigger"),n(4),t(),i(5,"div",42),S("click",function(r){return b(e),y(r.stopPropagation())}),i(6,"mat-form-field",43)(7,"input",163),S("input",function(r){b(e);let c=p(2);return y(c.onContactSearch(r.target.value))})("keydown.space",function(r){return b(e),y(r.stopPropagation())})("click",function(r){return b(e),y(r.stopPropagation())}),t()()(),u(8,rV,7,4,"mat-option",46)(9,lV,2,0,"mat-option",45),i(10,"mat-option",47),x(11,"i",48),n(12," Add User "),t()()(),x(13,"button",164)}if(a&2){let e,o=p(2);l(),s("value",o.selectedContactUserId),l(3),m(" ",((e=o.purchaseOrderForm.get("contactName"))==null?null:e.value)||"Type to search or select contact"," "),l(3),s("value",o.contactSearch),l(),s("ngForOf",o.filteredContactUsers),l(),s("ngIf",!o.filteredContactUsers.length),l(),s("value",o.ADD_CONTACT)}}function sV(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function dV(a,d){a&1&&(i(0,"span"),n(1,"Contact number should contain up to 10 digits"),t())}function cV(a,d){if(a&1&&(i(0,"div",165),u(1,sV,2,0,"span",51)(2,dV,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonNumber"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonNumber"))==null||o.errors==null)&&o.errors.required))}}function pV(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function mV(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email address"),t())}function uV(a,d){if(a&1&&(i(0,"div",165),u(1,pV,2,0,"span",51)(2,mV,2,0,"span",51),t()),a&2){let e,o,r=p(2);l(),s("ngIf",(e=r.purchaseOrderForm.get("contactPersonEmail"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.purchaseOrderForm.get("contactPersonEmail"))==null||o.errors==null)&&o.errors.required))}}function _V(a,d){if(a&1){let e=I();F(0),i(1,"div",16)(2,"div",17)(3,"h3",157),n(4,"Contact Details "),i(5,"sup",24),n(6,"*"),t()()(),i(7,"div",19)(8,"div",20)(9,"div",21)(10,"div",22)(11,"label",39),n(12,"Contact Name "),i(13,"sup",24),n(14,"*"),t()(),u(15,nV,1,0,"input",158)(16,oV,14,6,"ng-template",null,5,P),t()(),i(18,"div",21)(19,"div",22)(20,"label",39),n(21,"Phone No. "),i(22,"sup",24),n(23,"*"),t()(),i(24,"input",159),S("input",function(){b(e);let r=p();return y(r.onContactPhoneInput())}),t(),u(25,cV,3,2,"div",116),t()(),i(26,"div",21)(27,"div",22)(28,"label",39),n(29,"Email "),i(30,"sup",24),n(31,"*"),t()(),x(32,"input",160),u(33,uV,3,2,"div",116),t()()()()(),M()}
1if(a&2){let e,o,r=w(17),c=p();l(15),s("ngIf",c.newBuyerAdded)("ngIfElse",r),l(9),s("readOnly",c.contactPhoneLocked),l(),s("ngIf",((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.touched)&&((e=c.purchaseOrderForm.get("contactPersonNumber"))==null?null:e.invalid)),l(7),s("readOnly",c.contactEmailLocked),l(),s("ngIf",((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.touched)&&((o=c.purchaseOrderForm.get("contactPersonEmail"))==null?null:o.invalid))}}function vV(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname)+" - "+(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].city)," ")}}function gV(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function fV(a,d){if(a&1&&(i(0,"mat-option",142),n(1),t()),a&2){let e=p();l(),f(e.isBuyerSelected?"No addresses found":"Select a buyer first")}}function hV(a,d){if(a&1&&(i(0,"div",166),x(1,"i",167),i(2,"div")(3,"span",168),n(4),t(),i(5,"span",169),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].firstname),l(2),f(e.selectedShippingAddress[0]==null?null:e.selectedShippingAddress[0].full_address)}}function xV(a,d){if(a&1&&(i(0,"mat-select-trigger"),n(1),t()),a&2){let e=p();l(),m(" ",(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname)+" - "+(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].city)," ")}}function bV(a,d){if(a&1&&(i(0,"mat-option",144)(1,"div",145)(2,"div",146),n(3),t(),i(4,"div",147),n(5),t()()()),a&2){let e=d.$implicit;s("value",e.entity_id),l(3),D("",e.firstname," ",e.lastname,""),l(2),f(e.full_address)}}function yV(a,d){if(a&1&&(i(0,"mat-option",142),n(1),t()),a&2){let e=p();l(),f(e.isBuyerSelected?"No addresses found":"Select a buyer first")}}function SV(a,d){if(a&1&&(i(0,"div",166),x(1,"i",167),i(2,"div")(3,"span",168),n(4),t(),i(5,"span",169),n(6),t()()()),a&2){let e=p();l(4),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].firstname),l(2),f(e.selectedBillingAddress[0]==null?null:e.selectedBillingAddress[0].full_address)}}function CV(a,d){if(a&1){let e=I();i(0,"button",170),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(1,"i",48),i(2,"span",13),n(3,"Add Service"),t()()}}function EV(a,d){if(a&1){let e=I();i(0,"div",171)(1,"p",172),n(2,"Add services in work order"),t(),i(3,"button",173),S("click",function(){b(e);let r=p();return y(r.openFinanceDrawer())}),x(4,"i",48),i(5,"span",13),n(6,"Add Service"),t()()()}}function IV(a,d){if(a&1){let e=I();i(0,"tr")(1,"td"),n(2),t(),i(3,"td"),n(4),t(),i(5,"td"),n(6),t(),i(7,"td"),n(8),_(9,"currencyFormat"),t(),i(10,"td"),n(11),t(),i(12,"td"),n(13),t(),i(14,"td"),n(15),_(16,"currencyFormat"),t(),i(17,"td",177)(18,"a",178),S("click",function(){let r=b(e).index,c=p(2);return y(c.openFinanceDrawerEdit(r))}),x(19,"i",179),t(),i(20,"a",180),S("click",function(){let r=b(e).index,c=p(2);return y(c.requestDeleteProduct(r))}),x(21,"i",181),t()()()}if(a&2){let e=d.$implicit;l(2),f(e.productName),l(2),f(e.skuId||"-"),l(2),f(e.quantity),l(2),f(v(9,7,e.unitPrice)),l(3),m("",e.discount,"%"),l(2),m("",e.tax,"%"),l(2),f(v(16,9,e.totalPayable))}}function DV(a,d){if(a&1&&(i(0,"div",174)(1,"table",175)(2,"thead")(3,"tr")(4,"th",13),n(5,"Product/service Name"),t(),i(6,"th",13),n(7,"SKU"),t(),i(8,"th",13),n(9,"Quantity"),t(),i(10,"th",13),n(11,"Quoted Price/Unit"),t(),i(12,"th",13),n(13,"Discount"),t(),i(14,"th",13),n(15,"GST Rate"),t(),i(16,"th",13),n(17,"Total Amount"),t(),x(18,"th"),t()(),i(19,"tbody"),u(20,IV,22,11,"tr",176),t()()()),a&2){let e=p();l(20),s("ngForOf",e.productFormValues)}}function TV(a,d){a&1&&(i(0,"div",182),n(1,"At least one product is required."),t())}function wV(a,d){if(a&1){let e=I();i(0,"div",183)(1,"button",184),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),x(2,"i",185),t(),i(3,"span",186),S("click",function(){b(e);let r=p();return y(r.addAdditionalCharge())}),n(4,"Add Additional Charges"),t()()}}function PV(a,d){if(a&1){let e=I();i(0,"button",184),S("click",function(){b(e);let r=p(2);return y(r.addAdditionalCharge())}),x(1,"i",185),t()}}function OV(a,d){if(a&1){let e=I();i(0,"button",196),S("click",function(){b(e);let r=p().index,c=p();return y(c.removeAdditionalCharge(r))}),x(1,"i",197),t()}}function kV(a,d){if(a&1){let e=I();i(0,"div",187)(1,"div",188)(2,"label",78),n(3,"Description"),t(),x(4,"textarea",189),t(),i(5,"div",188)(6,"label",78),n(7,"Amount"),t(),i(8,"input",190),S("input",function(){b(e);let r=p();return y(r.onAdditionalChargeChange())}),t()(),i(9,"div",191)(10,"div",192)(11,"div",193),u(12,PV,2,0,"button",194)(13,OV,2,0,"button",195),t()()()()}if(a&2){let e=d.index,o=p();s("formGroupName",e),l(12),s("ngIf",e==0),l(),s("ngIf",e>0&&o.additionalChargesArray.controls.length>1||e==0&&o.additionalChargesArray.controls.length==1)}}function FV(a,d){a&1&&(i(0,"span",13),n(1,"Attachments"),t())}function MV(a,d){a&1&&(i(0,"span",13),n(1,"Uploading..."),t())}function AV(a,d){if(a&1&&x(0,"app-loader",198),a&2){let e=p();s("isLoading",e.loadingStates.termsDocs)("useBlockPosition",!0)}}function NV(a,d){if(a&1){let e=I();i(0,"span",201)(1,"a",202),n(2),t(),i(3,"i",203),S("click",function(){let r=b
1(e).$implicit,c=p(2),g=w(159);return y(c.OnClickDeleteDoc(r.name,g))}),t()()}if(a&2){let e=d.$implicit;l(),s("href",e.viewPath,q),l(),f(e.name)}}function VV(a,d){if(a&1&&(i(0,"div",199),u(1,NV,4,2,"span",200),t()),a&2){let e=p();l(),s("ngForOf",e.uploadedTermsDocs)}}function BV(a,d){a&1&&(i(0,"div",165),n(1,"Organization name is required"),t())}function RV(a,d){a&1&&(i(0,"div",165),n(1,"Address is required"),t())}function LV(a,d){if(a&1&&(i(0,"option",144),n(1),t()),a&2){let e=d.$implicit;s("value",e.default_name),l(),f(e.default_name)}}function qV(a,d){a&1&&(i(0,"div",165),n(1,"State is required"),t())}function GV(a,d){a&1&&(i(0,"div",165),n(1,"City is required"),t())}function UV(a,d){a&1&&(i(0,"div",165),n(1,"Country is required"),t())}function jV(a,d){a&1&&(i(0,"div",165),n(1,"Postal code must be 6 digits"),t())}function $V(a,d){a&1&&(i(0,"div",165),n(1,"Contact name is required"),t())}function zV(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function WV(a,d){a&1&&(i(0,"span"),n(1,"Phone number must be 10 digits"),t())}function QV(a,d){if(a&1&&(i(0,"div",165),u(1,zV,2,0,"span",51)(2,WV,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.buyerForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function YV(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function HV(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function KV(a,d){if(a&1&&(i(0,"div",165),u(1,YV,2,0,"span",51)(2,HV,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.buyerForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.buyerForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function ZV(a,d){a&1&&(i(0,"div",165),n(1,"Name is required"),t())}function JV(a,d){a&1&&(i(0,"span"),n(1,"Phone number is required"),t())}function XV(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid 10-digit phone number"),t())}function eB(a,d){if(a&1&&(i(0,"div",165),u(1,JV,2,0,"span",51)(2,XV,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("phone"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",!(!((o=r.userForm.get("phone"))==null||o.errors==null)&&o.errors.required))}}function tB(a,d){a&1&&(i(0,"span"),n(1,"Email is required"),t())}function iB(a,d){a&1&&(i(0,"span"),n(1,"Enter a valid email"),t())}function nB(a,d){if(a&1&&(i(0,"div",165),u(1,tB,2,0,"span",51)(2,iB,2,0,"span",51),t()),a&2){let e,o,r=p();l(),s("ngIf",(e=r.userForm.get("email"))==null||e.errors==null?null:e.errors.required),l(),s("ngIf",(o=r.userForm.get("email"))==null||o.errors==null?null:o.errors.email)}}function wi(a){document.getElementById(a)?.click()}var bn=(()=>{class a{constructor(e,o,r,c,g,h,C,k,O){this.fbs=e,this.financeService=o,this.fb=r,this.commonService=c,this.dialog=g,this.FinanceOrderService=h,this.notificationService=C,this.ref=k,this.router=O,this.states=[],this.submitted=!1,this.selectedFiles=[],this.showDropdown=!1,this.searchList=[],this.sellerOptions=[],this.searchInput$=new ti,this.isSearchLoading=!1,this.disableGstField=!1,this.displaySearchList=!1,this.allowedFileTypes=[".pdf",".doc",".docx"],this.minValue=0,this.countryCode="IN",this.shippingAddressResponse=[],this.billingAddressResponse=[],this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.enableAddressSelection=!1,this.isLoading=!1,this.isAddressLoading=!1,this.sameAsShippingAddress=!1,this.formControlListeners=[],this.productFormValues=[],this.uploadedTermsDocs=[],this.selectedOption="no",this.approverPayload=[],this.prIdFromRoute=null,this.buyerSubmitting=!1,this.sellerSearchTerm="",this.newBuyerAdded=!1,this.userSubmitting=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.selectedContactUserId=null,this.shippingAddrSearch="",this.billingAddrSearch="",this.loadingStates={termsDocs:!1},this.editingProductIndex=null,this.confirmDeleteIndex=null,this.ADD_SUPPLIER="__add_supplier__",this.ADD_CONTACT="__add_contact__",this.ADD_SHIPPING_ADDRESS="__add_shipping_address__",this.ADD_BILLING_ADDRESS="__add_billing_address__",this.purchaseOrderForm=this.fbs.group({poNumber:["",E.required],poCreationDate:[""],poExpiryDate:[""],paymentMode:[""],buyerName:new _i("",[E.required]),vendorId:0,buyerGst:[""],buyerAddress:[""],city:[""],state:[""],pincode:[""],country:[""],contactName:["",E.required],contactPersonNumber:["",[E.required,E.maxLength(10),E.pattern(/^\d+$/)]],contactPersonEmail
1:["",[E.required,E.email]],grossTotal:0,discount:0,netTotal:0,taxes:0,additionalCharges:this.fbs.array([]),totalPayableAmount:0,approvalStatus:[""],approverName:[""],approvalDate:[""],termsandConditions:[""]},{validators:this.poDateRangeValidator}),this.generatePoForm()}poDateRangeValidator(e){let o=e.get("poCreationDate")?.value,r=e.get("poExpiryDate")?.value;return!o||!r?null:r<o?{poDateRange:!0}:null}get poCreationDateValue(){return this.purchaseOrderForm?.get("poCreationDate")?.value||""}get poExpiryDateValue(){return this.purchaseOrderForm?.get("poExpiryDate")?.value||""}get isPoDateRangeInvalid(){return!!this.purchaseOrderForm?.errors?.poDateRange}ngOnInit(){this.onSearchSellers({target:{value:""}}),this.getAddressData(),this.getStates(),this.initializeAddProductForm(),this.initializeBuyerForm(),this.initializeUserForm()}sanitizeDigits(e,o){let r=String(e||"").replace(/\D/g,"");return o?r.slice(0,o):r}requestDeleteProduct(e){this.confirmDeleteIndex=e,wi("openDeleteConfirmModal")}confirmDelete(){this.confirmDeleteIndex!==null&&(this.productFormValues.splice(this.confirmDeleteIndex,1),this.calculateSummary(),this.confirmDeleteIndex=null),wi("closeDeleteConfirmModal")}cancelDelete(){this.confirmDeleteIndex=null,wi("closeDeleteConfirmModal")}calculateSummary(){let e=h=>Math.round((Number(h)||0)*100+Number.EPSILON)/100,o=e(this.productFormValues.reduce((h,
1C)=>h+C.grossTotal,0));this.purchaseOrderForm.patchValue({grossTotal:o},{emitEvent:!1});let r=e(this.productFormValues.reduce((h,C)=>h+C.grossTotal*C.discount/100,0));this.purchaseOrderForm.patchValue({discount:r},{emitEvent:!1});let c=e(this.productFormValues.reduce((h,C)=>h+(C.grossTotal-C.grossTotal*C.discount/100)*C.tax/100,0));this.purchaseOrderForm.patchValue({taxes:c},{emitEvent:!1});let g=e(o-r);this.purchaseOrderForm.patchValue({netTotal:g},{emitEvent:!1}),this.purchaseOrderForm.patchValue({totalPayableAmount:e(g+c+this.getAdditionalCharges)},{emitEvent:!1})}get additionalChargesArray(){return this.purchaseOrderForm.get("additionalCharges")}get getAdditionalCharges(){let e=this.purchaseOrderForm.get("additionalCharges");return!e||e.length===0?0:e.controls.reduce((o,r)=>o+(Number(r.get("amount")?.value)||0),0)}addAdditionalCharge(){this.purchaseOrderForm.get("additionalCharges").push(this.fbs.group({description:[""],amount:[0]}))}removeAdditionalCharge(e){this.purchaseOrderForm.get("additionalCharges").removeAt(e),this.calculateSummary()}onAdditionalChargeChange(){this.calculateSummary()}initializeAddProductForm(){this.formControlListeners.push(this.purchaseOrderForm.valueChanges.subscribe(()=>this.calculateSummary()))}handleSearchDisplay(e){e===!1?setTimeout(()=>{this.displaySearchList=e},200):this.displaySearchList=e}openFinanceDrawer(){this.financeDrawer?.openFinance()}openFinanceDrawerEdit(e){this.financeDrawer?.openFinance(this.productFormValues[e],e)}onDrawerProductAdded(e){let o=e?._editIndex??-1,g=e||{},{_editIndex:r}=g,c=Bt(g,["_editIndex"]);o>=0?this.productFormValues[o]=A(A({},this.productFormValues[o]),c):this.productFormValues.push(c),this.calculateSummary()}resetForm(){this.purchaseOrderForm.reset(),this.GeneratePoForm.reset(),this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingAddrSearch="",this.billingAddrSearch="",this.sellerSearchTerm="",this.sellerOptions=[],this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newBuyerAdded=!1,this.selectedContactUserId=null,this.disableGstField=!1,this.productFormValues=[],this.uploadedTermsDocs=[],this.editingProductIndex=null,this.confirmDeleteIndex=null,this.calculateSummary(),this.ref.detectChanges(),this.submitted=!1}onSave(){if(this.submitted=!0,this.purchaseOrderForm.markAllAsTouched(),this.purchaseOrderForm.invali
1d)return;let e={};try{e=JSON.parse(localStorage.getItem("userDetails")||"{}")}catch{e={}}let o={order_type:"WO",po_number:this.purchaseOrderForm.value.poNumber,po_creation_date:this.purchaseOrderForm.value.poCreationDate,po_expiry_date:this.purchaseOrderForm.value.poExpiryDate,payment_mode:this.purchaseOrderForm.value.paymentMode,seller_name:this.purchaseOrderForm.value.sellerName||" ",buyer_name:this.purchaseOrderForm.value.buyerName,buyer_gst:this.purchaseOrderForm.value.buyerGst,buyer_address:this.purchaseOrderForm.value.buyerAddress,city:this.purchaseOrderForm.value.city,state:this.purchaseOrderForm.value.state,pincode:this.purchaseOrderForm.value.pincode,country:this.purchaseOrderForm.value.country,user_type:"SELLER",contact_name:this.purchaseOrderForm.value.contactName,contact_number:this.purchaseOrderForm.value.contactPersonNumber,contact_email:this.purchaseOrderForm.value.contactPersonEmail,vendor_id:this.purchaseOrderForm.value.vendorId,seller_gst:" ",seller_address:"",terms:this.purchaseOrderForm.value.termsandConditions,terms_document_path:[],shipping_address:this.selectedShippingAddress[0]?.entity_id,billing_address:this.selectedBillingAddress[0]?.entity_id,items:[],additional_charges:[...this.purchaseOrderForm.value.additionalCharges],approvalUsers:[],total_payable_amount:this.purchaseOrderForm.value.totalPayableAmount,po_required:1,is_qa_required:"NO",seller_organization_id:e?.vendorId??null,seller_user_id:e?.userId??null,buyer_organization_id:this.purchaseOrderForm.value.vendorId||null,buyer_user_id:this.selectedContactUserId??null};o.terms_document_path=this.uploadedTermsDocs.map(r=>({path:r.path,filename:r.name})),o.items=this.productFormValues.map(r=>A({product_name:r.productName,product_id:r.parentId??r.productId,qty:r.quantity,unit_price:r.unitPrice,discount_percentage:r.discount,gst_percentage:r.tax,sku:r.skuId||"",selected_options:r.selectedConfigOptions||[]},r.isTemp&&{is_temp_product:!0,category:r.category,sub_category:r.subCategory,product_group:r.productGroup,sub_product_group:r.subProductGroup})),o.approvalUsers=this.approverPayload.map(r=>({customer_id:r.customer_id,level:r.level})),this.financeService.pomanualCreate(o).subscribe({next:r=>{r.responseCode===200?(this.notificationService.showSuccess("Work Order created successfully"),this.router.navigate(["finance-management/receivable-purchase-orders"])):this.notificationService.showError(typeof r?.response=="string"?r.response:"Failed to create Work Order.")},error:r=>{let c=r?.error?.response;this.notificationService.showError(typeof c=="string"&&c?c:"Failed to create Work Order. Please try again.")}})}onOptionChange(e){this.selectedOption=e,this.purchaseOrderForm.get("hasApprovers").setValue(e)}onApproversChange(e){this.approverPayload=e,this.prResponse.approve_users=e.map(o=>j(A({},o),{status:"A"}))}onSearchSellers(e){this.sellerSearchTerm=e?.target?.value||"",this.disableGstField=!1,this.isSearchLoading=!0,this.financeService.sellerList({currentPage:1,pageLength:10,search:e.target.value}).subscribe({next:o=>{if(o.responseCode===200){let r=this.getLoggedInVendorId(),c=(o.response.vendorData||[]).filter(g=>Number(g.vendorId??g.vendorData?.vendor_id)!==Number(r));this.sellerOptions=c,this.isSearchLoading=!1}}})}getLoggedInVendorId(){try{return JSON.parse(localStorage.getItem("userDetails")||"{}")?.vendorId??null}catch{return null}}getStates(){this.financeService.getRegionList("").subscribe({next:e=>{e.responseCode===200&&(this.states=e.response.list)}})}onSelectSellerOption(e,o){if(e===this.ADD_SUPPLIER){wi("openAddBuyerModal"),this.restoreSelectValue(o,this.purchaseOrderForm.get("vendorId")?.value);return}let r=this.sellerOptions.find(c=>c.vendorData?.vendor_id===e);r&&this.selectSeller(r)}restoreSelectValue(e,o){e&&setTimeout(()=>{e.value=o??null})}onSelectContactOption(e,o){if(e===this.ADD_CONTACT){this.openAddContactUser(),wi("openAddContactUserModal"),this.restoreSelectValue(o,this.selectedContactUserId);return}let r=this.contactUsers.find(c=>c.id===e);r&&this.selectContactUser(r)}selectSeller(e){if(!e)return this.removeSeller();
1this.purchaseOrderForm.patchValue({buyerName:e.vendorData.company_name,vendorId:e.vendorData.vendor_id,buyerGst:e.vendorData.gst,buyerAddress:e.vendorData.address,city:e.vendorData.city,state:e.vendorData.region,country:e.vendorData.country_id}),this.disableGstField=!0,this.displaySearchList=!1,this.contactUsers=[],this.contactSearch="",this.contactUserSelected=!1,this.contactPhoneLocked=!1,this.contactEmailLocked=!1,this.newBuyerAdded=!1,this.selectedContactUserId=null,this.getContactUsers(),this.loadBuyerAddresses(e.vendorData.vendor_id)}removeSeller(){this.purchaseOrderForm.patchValue({buyerName:"",buyerGst:"",buyerAddress:"",city:"",state:"",country:""})}initializeBuyerForm(){this.buyerForm=this.fbs.group({organization_name:["",[E.required,E.maxLength(255)]],gst:["",[E.maxLength(50)]],pan:["",[E.maxLength(50)]],address:["",[E.required,E.maxLength(500)]],state:["",[E.required,E.maxLength(100)]],city:["",[E.required,E.maxLength(100)]],country_id:["",[E.required,E.maxLength(50)]],postal_code:["",[E.minLength(6),E.maxLength(6),E.pattern(/^\d+$/)]],contact_name:["",[E.required,E.maxLength(255)]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}
1saveBuyer(){if(this.buyerForm.invalid){this.buyerForm.markAllAsTouched(),this.notificationService.showError("Please fill all required buyer details correctly.");return}let e=this.buyerForm.value,o={organization_name:e.organization_name,gst:e.gst||"",pan:e.pan||"",address:e.address,state:e.state,city:e.city,country_id:e.country_id,postal_code:e.postal_code||"",contact_name:e.contact_name,phone:e.phone,email:e.email,partner_type:"buyer",password:"Test@1234",is_live_user:!1};this.buyerSubmitting=!0,this.financeService.createPartner(o).subscribe({next:r=>{this.buyerSubmitting=!1,r?.responseCode===200?(this.notificationService.showSuccess("Buyer added successfully"),this.applyBuyerToPo(e,r),this.buyerForm.reset(),wi("closeAddBuyerModal")):this.notificationService.showError(r?.response||"Failed to add buyer")},error:()=>{this.buyerSubmitting=!1,this.notificationService.showError("Failed to add buyer. Please try again.")}})}applyBuyerToPo(e,o){let r=o?.response?.organization?.id??o?.response?.vendor_id??o?.response?.id??0,c=o?.response?.user?.id??null;this.purchaseOrderForm.patchValue({buyerName:e.organization_name,buyerGst:e.gst,buyerAddress:e.address,city:e.city,state:e.state,country:e.country_id,pincode:this.sanitizeDigits(e.postal_code,6),contactName:e.contact_name,contactPersonNumber:e.phone,contactPersonEmail:e.email,vendorId:r}),this.selectedContactUserId=c,this.disableGstField=!0,this.contactUsers=[],this.contactSearch="",this.newBuyerAdded=!0,this.contactUserSelected=!0,this.contactPhoneLocked=!0,this.contactEmailLocked=!0;let g=this.purchaseOrderForm.get("contactPersonNumber");g?.setValidators([E.required]),g?.updateValueAndValidity({emitEvent:!1}),this.getContactUsers(),this.loadBuyerAddresses(r)}get filteredContactUsers(){return this.contactUsers||[]}getOrgId(){return this.purchaseOrderForm.get("vendorId")?.value||null}getContactUsers(e="",o){let r=this.getOrgId();r&&this.financeService.userList({org_id:r,search:e}).subscribe({next:c=>{let g=c?.response?.list??[];this.contactUsers=(Array.isArray(g)?g:[]).map(h=>({id:h.id,name:h.full_name||[h.firstName,h.lastName].filter(Boolean).join(" ")||"",phone:h.phoneNumber||"",email:h.email||"",raw:h})),o?.()},error:()=>{this.contactUsers=[]}})}selectNewContactUser(e){this.getContactUsers("",()=>{let o=this.contactUsers.find(r=>e.email&&r.email&&r.email.toLowerCase()===e.email.toLowerCase()||e.phone&&r.phone&&String(r.phone)===String(e.phone));this.selectContactUser(o||{name:e.name,phone:e.phone,email:e.email})})}onContactSearch(e){this.contactSearch=e||"",this.getContactUsers(this.contactSearch)}selectContactUser(e){if(!e)return;this.selectedContactUserId=e.id??e.raw?.id??null,this.purchaseOrderForm.patchValue({contactName:e.name||"",contactPersonNumber:e.phone||this.purchaseOrderForm.get("contactPersonNumber")?.value||"",contactPersonEmail:e.email||this.purchaseOrderForm.get("contactPersonEmail")?.value||""});let o=this.purchaseOrderForm.get("contactPersonNumber");e.phone?o?.setValidators([E.required]):o?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),o?.updateValueAndValidity({emitEvent:!1}),this.contactPhoneLocked=!!e.phone,this.contactEmailLocked=!!e.email,this.contactUserSelected=!0}onContactPhoneInput(){let e=this.purchaseOrderForm.get("contactPersonNumber");e?.setValidators([E.required,E.maxLength(10),E.pattern(/^\d+$/)]),e?.updateValueAndValidity({emitEvent:!1})}initializeUserForm(){this.userForm=this.fbs.group({name:["",[E.required]],phone:["",[E.required,E.minLength(10),E.maxLength(10),E.pattern(/^\d+$/)]],email:["",[E.required,E.email]]})}openAddContactUser(){this.userForm?.reset()}
1saveContactUser(){if(this.userForm.invalid){this.userForm.markAllAsTouched(),this.notificationService.showError("Please fill all user details correctly.");return}let e=this.getOrgId();if(!e){this.notificationService.showError("Please select a buyer first.");return}let o=this.userForm.value,r={email:o.email,phoneNumber:o.phone,firstName:o.name,org_id:e,is_live_user:!1};this.userSubmitting=!0,this.financeService.addUser(r).subscribe({next:c=>{this.userSubmitting=!1,c?.responseCode===200?(this.notificationService.showSuccess(c.response?.response||"User added successfully"),this.selectNewContactUser({name:o.name,phone:o.phone,email:o.email}),this.userForm.reset(),wi("closeAddContactUserModal")):this.notificationService.showError(c?.response||"Failed to add user")},error:()=>{this.userSubmitting=!1,this.notificationService.showError("Failed to add user. Please try again.")}})}getAddressData(e){this.isAddressLoading=!0;let o={perPage:10,pageNumber:1};e&&(o.org_id=e),this.commonService.getAddressList(o).subscribe(r=>{let c=r.total_count||0,g=this.purchaseOrderForm.get("poNumber");if(r.wo_number&&!g?.dirty&&!g?.value&&g?.setValue(r.wo_number),this.shippingAddressResponse=r.response||[],this.billingAddressResponse=r.response||[],this.enableAddressSelection=!0,this.isAddressLoading=!1,c>10){let h={perPage:c,pageNumber:1};e&&(h.org_id=e),this.commonService.getAddressList(h).subscribe(C=>{let k=C.response||[];this.shippingAddressResponse=k,this.billingAddressResponse=k})}})}get isBuyerSelected(){return!!this.getOrgId()}onAddressDropdownOpened(e){e&&this.isBuyerSelected&&this.shippingAddressResponse.length===0&&this.getAddressData(this.getOrgId())}loadBuyerAddresses(e){this.selectedShippingAddress=[],this.selectedBillingAddress=[],this.sameAsShippingAddress=!1,this.shippingAddrSearch="",this.billingAddrSearch="",this.GeneratePoForm.patchValue({shippingAddress:"",billingAddress:""}),this.shippingAddressResponse=[],this.billingAddressResponse=[],e&&this.getAddressData(e)}generatePoForm(){this.GeneratePoForm=this.fb.group({selectedSeller:[""],shippingAddress:["",E.required],billingAddress:["",E.required]})}closeOpenDropdowns(){document.querySelectorAll(".dropdown-menu.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll(".dropdown.show").forEach(e=>e.classList.remove("show")),document.querySelectorAll('[data-toggle="dropdown"][aria-expanded="true"]').forEach(e=>e.setAttribute("aria-expanded","false"))}setAddAddressMode(e,o){if(o&&!this.isBuyerSelected){this.notificationService.showError("Please select a buyer first.");return}this.addAddressMode=e,o&&(this.closeOpenDropdowns(),setTimeout(()=>{this.dialog.open(Ht,{data:{addressType:e,org_id:this.getOrgId()}}).afterClosed().subscribe(c=>{c&&(this.poRfqData?.data&&(this.addAddressMode==="shipping"&&(this.poRfqData.data.delivery_address=A({},c)),this.addAddressMode==="billing"&&(this.poRfqData.data.billing_address=A({},c))),this.getAddressData(this.getOrgId()))})},0)),(!this.shippingAddressResponse.length||!this.billingAddressResponse.length)&&this.getAddressData(this.getOrgId())}filterAddresses(e){if(!this.isBuyerSelected)return[];let o=this.shippingAddressResponse||[];if(!e||!e.trim())return o;let r=e.toLowerCase();return o.filter(c=>(c.firstname||"").toLowerCase().includes(r)||(c.lastname||"").toLowerCase().includes(r)||(c.full_address||"").toLowerCase().includes(r)||(c.city||"").toLowerCase().includes(r))}onSameAsShippingChange(e){this.sameAsShippingAddress=e.target.checked,this.sameAsShippingAddress?this.selectedShippingAddress?.length&&this.changeSelectedAddress(this.selectedShippingAddress[0],"billing"):(this.selectedBillingAddress=[],this.GeneratePoForm.patchValue({billingAddress:""}))}onSelectShippingAddress(e,o){if(e===this.ADD_SHIPPING_ADDRESS){this.setAddAddressMode("shipping",!0),this.restoreSelectValue(o,this.selectedShippingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"shipping")}onSelectBillingAddress(e,o){if(e===this.ADD_BILLING_ADDRESS){this.setAddAddressMode("billing",!0),this.restoreSelectValue(o,this.selectedBillingAddress?.[0]?.entity_id);return}let r=(this.shippingAddressResponse||[]).find(c=>c.entity_id===e);r&&this.changeSelectedAddress(r,"billing")}changeSelectedAddress(e,o){let r=[j(A({},e),{entity_id:e.entity_id,rfqAddressId:"",isActive:e.is_active,addressType:o,deliveryLocation:e.city})];o==="shipping"&&(this.selectedShippingAddress=r,this.GeneratePoForm.patchValue({shippingAddress:String(e.entity_id)}
1)),o==="billing"&&(this.selectedBillingAddress=r,this.GeneratePoForm.patchValue({billingAddress:String(e.entity_id)}))}selectShippingAddress(){this.poRfqData.data.delivery_address=j(A({},this.selectedShippingAddress[0]),{address_id:this.selectedShippingAddress[0].entity_id}),this.GeneratePoForm.patchValue({shippingAddress:String(this.selectedShippingAddress[0].entity_id)})}selectBillingAddress(){this.poRfqData.data.billing_address=j(A({},this.selectedBillingAddress[0]),{address_id:this.selectedBillingAddress[0].entity_id}),this.GeneratePoForm.patchValue({billingAddress:String(this.selectedBillingAddress[0].entity_id)})}fileChange(e){try{let o=e.target.files;if(o.length>0){this.loadingStates.termsDocs=!0;for(let r=0;r<o.length;r++){let c=new FormData;c.append("file",o[r]),c.append("source","po"),c.append("source_id",""),this.FinanceOrderService.FileUpload(c).subscribe(g=>{g.responseCode===200?this.uploadedTermsDocs=[...this.uploadedTermsDocs,{name:g.response.file_name,path:g.response.filepath,viewPath:g.response.fileViewPath}]:this.notificationService.showError(g.response||"File Upload Failed"),this.loadingStates.termsDocs=!1,e.target.value=""},()=>{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""})}}}catch{this.notificationService.showError("Something went wrong!"),this.loadingStates.termsDocs=!1,e.target.value=""}}OnClickDeleteDoc(e,o){this.uploadedTermsDocs=this.uploadedTermsDocs.filter(r=>r.name!==e),o&&(o.value="")}ngOnDestroy(){this.formControlListeners.forEach(e=>e.unsubscribe())}static{this.\u0275fac=function(o){return new(o||a)(T(Ct),T(Dt),T(ft),T(ge),T(Ae),T(z),T(H),T(Wt),T(K))}}static{this.\u0275cmp=R({type:a,selectors:[["app-create-receivable-work-order"]],viewQuery:function(o,r){if(o&1&&N(zN,5),o&2){let c;V(c=B())&&(r.financeDrawer=c.first)}},decls:373,vars:85,consts:[["sellerSelect",""],["shippingAddrSelect",""],["billingAddrSelect",""],["docsinput",""],["financeDrawer",""],["contactNameDropdown",""],["contactSelect",""],[1,"splittedCreateCardMain"],[1,"row","justify-content-between","align-items-center","mb-3"],[1,"col-md"],[1,"mod-page-title","d-flex","align-items-center"],["backButton","",1,"btn","btn-title-back",3,"backButtonFallback"],[1,"uil","uil-arrow-left"],["appTranslate",""],[1,"col-md-auto"],[3,"ngSubmit","formGroup"],[1,"mod-card","mb-4"],[1,"mod-card-header"],["appTranslate","",1,"mod-card-title","mb-0"],[1,"mod-card-body"],[1,"row"],[1,"col-md-4"],[1,"form-group"],["for","",1,"mod-form-label"],[1,"text-danger"],["type","text","formControlName","poNumber","placeholder","Enter WO Number",1,"form-control","mod-input"],["class","invalid-error","appTranslate","",4,"ngIf"],["for","","appTranslate","",1,"mod-form-label"],["type","date","formControlName","poCreationDate","placeholder","Enter date",1,"form-control","mod-input"],["type","date","formControlName","poExpiryDate","placeholder","Enter date",1,"form-control","mod-input"],["formControlName","paymentMode",1,"form-control","mod-input"],["value","","disabled","","selected","","appTranslate",""],["value","bankTransfer","appTranslate",""],["value","chequeDd","appTranslate",""],["value","cash","appTranslate",""],["value","card","appTranslate",""],["value","walletUpi","appTranslate",""],["value","paymentGateway","appTranslate",""],[1,"col-md-8"],[1,"mod-form-label"],["appearance","outline",1,"w-100","compact-form-field"],["panelClass","address-select-panel no-checkmark","placeholder","Search or enter buyer name",3,"selectionChange","value"],[1,"fin-dropdown-search","px-2","pt-2",3,"click"],["appearance","outline",1,"compact-form-field","flex","mb-0","w-100"],["matInput","","placeholder","Search buyer...",3,"input","keydown.space","click","value"],["disabled","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[1,"text-primary","fw-500",3,"value"],[1,"ri-add-line"],["type","button","id","openAddBuyerModal","data-toggle","modal","data-target","#addBuyerModal",1,"d-none"],["class","fin-info-block mt-2",4,"ngIf"],[4,"ngIf"],[1,"row","gut-row","gut-3"],[1,"col-md-6"],[1,"shpCard","h-100"],["appTranslate","",1,"h6","fw-600","mb-3"],["panelClass","address-select-panel no-checkmark","placeholder","Select Service Address",3,"openedChange","selectionChange"],["matInput","","placeholder","Search address...",3,"input","keydown.space","click","value"],[1,"text-primary","fw-500",3,"value","disabled"],["class","mod-address-chip mt-3",4,"ngIf"],[1,"d-flex","align-items-center","mb-3"],["appTranslate","",1,"h6","fw-600","mb-0"],[1,"custom-control","custom-checkbox","fin-check","ml-4"],["type","checkbox","id","sameAsShipping",1,"custom-control-input",3,"change","checked","disabled"],["for","sameAsShipping","appTranslate","",1,"custom-control-label","mr-2"],["panelClass","address-select-panel no-checkmark","placeholder","Select Billing Address",3,"openedChange","selectionChange","value","disabled"],["type","button","class","mod-btn mod-btn-outline-primary btn-sm",3,"click",4,"ngIf"],[1,"table-dashboard"],[1,"col-12","px-0"],["class","fin-empty-products text-center py-4",4,"ngIf"],["class","table-responsive mod-table-wrapper",4,"ngIf"],["class","invali
1d-error mt-2","appTranslate","",4,"ngIf"],[1,"col-12","px-0","mt-4"],["class","col",4,"ngIf"],["formArrayName","additionalCharges"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","gut-row","gut-4","mt-1","mb-24"],[1,"mod-card","h-100"],["appTranslate","",1,"mod-form-label"],["rows","6","formControlName","termsandConditions","placeholder","Please write T & C, if any concern in WO",1,"form-control","mod-input"],["type","file","id","poAttachments","multiple","",1,"d-none",3,"change","disabled"],["for","poAttachments",1,"mod-btn","mod-btn-soft-primary","mb-0"],[1,"ri-attachment-2"],["appTranslate","",4,"ngIf"],["size","small",3,"isLoading","useBlockPosition",4,"ngIf"],["class","fin-attach-list",4,"ngIf"],[1,"list-unstyled","fin-summary"],["appTranslateText",""],["appTranslateText","",1,"fin-summary__total"],[1,"splittedCreateCardMain--floatSaveBar"],[1,"row","w-100"],[1,"col-auto","ml-auto"],["type","button","routerLink","/finance-management/receivable-purchase-orders/create","appTranslate","",1,"mod-btn","mod-btn-light","mr-2"],["type","submit","appTranslate","",1,"mod-btn","mod-btn-primary",3,"disabled"],["id","openDeleteConfirmModal","data-toggle","modal","data-target","#deleteConfirmModal",1,"d-none"],["id","closeDeleteConfirmModal","data-dismiss","modal",1,"d-none"],["id","deleteConfirmModal","data-backdrop","static","data-keyboard","false",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title","d-flex","align-items-center"],[1,"uil","uil-exclamation-triangle","mr-1"],[1,"modal-body","pt-2"],["appTranslateText","",1,"mb-0"],["appTranslate","",1,"text-secondary","font-13","mt-1","mb-0"],[1,"modal-footer","border-top-0","pt-0"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-light","btn-sm",3,"click"],["type","button","data-dismiss","modal","appTranslate","",1,"mod-btn","mod-btn-primary","btn-sm",3,"click"],["id","addBuyerModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal-lg","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-title"],["type","button","id","closeAddBuyerModal","data-dismiss","modal",1,"d-none"],["type","button","data-dismiss","modal",1,"close",3,"click"],[3,"formGroup"],[1,"modal-body"],["type","text","formControlName","organization_name","placeholder","Enter buyer name / company name",1,"form-control","mod-input"],["class","invalid-error",4,"ngIf"],["type","text","formControlName","gst","placeholder","Enter GST",1,"form-control","mod-input"],["type","text","formControlName","pan","placeholder","Enter PAN",1,"form-control","mod-input"],[1,"h6","fw-600","mt-4","mb-3"],[1,"col-12"],["type","text","formControlName","address","placeholder","Street / building /area",1,"form-control","mod-input"],["formControlName","state",1,"form-control","mod-input"],["value","","disabled","","selected",""],["type","text","formControlName","city","placeholder","Enter City",1,"form-control","mod-input"],["formControlName","country_id",1,"form-control","mod-input"],["value","IN"],["type","text","inputmode","numeric","maxlength","6","formControlName","postal_code","placeholder","Enter Postal Code",1,"form-control","mod-input"],["type","text","formControlName","contact_name","placeholder","Enter Contact name",1,"form-control","mod-input"],["type","text","inputmode","numeric","maxlength","10","formControlName","phone","placeholder","Enter Number",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter Email Id",1,"form-control","mod-input"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"mod-btn","mod-btn-light",3,"click"],["type","button",1,"mod-btn","mod-btn-primary",3,"click","disabled"],["id","addContactUserModal","tabindex","-1",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-dialog-scrollable"],["type","button","id","closeAddContactUserModal","data-dismiss","modal",1,"d-none"],["type","text","formControlName","name","placeholder","Enter name",1,"form-control","mod-input"],["type","text","inputmode","numeric","formControlName","phone","placeholder","Enter phone number","maxlength","10",1,"form-control","mod-input"],["type","email","formControlName","email","placeholder","Enter email id",1,"form-control","mod-input"],["moduleType","FINANCE","productType","SERVICE",3,"productAdded"],["appTranslate","",1,"invalid-error"],["disabled",""],["role","status",1,"spinner-grow","spinner-grow-sm","text-secondary"],[3,"value"],[1,"address-card","py-1"],[1,"address-name","fw-500","text-dark"],[1,"address-text","text-muted","small"],[1,"fin-info-block","mt-2"],[1,"fin-info-block__title"],[1,"fin-info-block__sub"],[1,"fin-info-block__divider"],["class","col-12 mb-3",4,"ngIf"],[1,"col-sm-4"],["appTranslate","",1,"fin-info-block__label"],[1,"fin-info-block__value"],[1,"col-12","mb-3"],[1,"mod-card-title","mb-0"],["type","text","class","form-control mod-input","formControlName","contactName","readonly","",4,"ngIf","ngIfElse"],["type","text","inputmode","numeric","maxlength","10","formControlName","contactPersonNumber","placeholder","Enter Number",1,"form-control","mod-input",3,"input","readOnly"],["type","text","formControlName","contactPersonEmail","placeholder","Enter Email id",1,"form-control","mod-input",3,"readOnly"],["type","text","formControlName","contactName","readonly","",1,"form-control","mod-input"],["panelClass","address-select-panel no-checkmark","placeholder","Type to search or select contact",3,"selectionChange","value"],["matInput","","placeholder","Search user...",3,"input","keydown.space","click","value"],["type","button","id","openAddContactUserModal","data-toggle","modal","data-target","#addContactUserModal",1,"d-none"],[1,"invalid-error"],[1,"mod-address-chip","mt-3"],[1,"ri-map-pin-line"],[1,"mod-address-chip__title"],[1,"mod-address-chip__addr"],["type","button",1,"mod-btn","mod-btn-outline-primary","btn-sm",3,"click"],[1,"fin-empty-products","text-center","py-4"],[1,"text-muted","mb-3"],["type","button",1,"mod-btn","mod-btn-outline-primary",3,"click"],[1,"table-responsive","mod-table-wrapper"],[1,"table","mod-table","table-dashboard","fin-product-table"],[4,"ngFor","ngForOf"],[1,"text-center","text-nowrap"],["href","javascript:void(0)","title","Edit",1,"text-theme","mr-2",3,"click"],[1,"ri-pencil-line"],["href","javascript:void(0)","title","Delete",1,"text-danger",3,"click"],[1,"ri-close-line"],["appTranslate","",1,"invalid-error","mt-2"],[1,"col"],["type","button","matTooltip","Add charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-theme","pay-add-more","font-20",3,"click"],[1,"plus-i","fas","fa-plus-circle"],["type","button","appTranslate","",1,"ml-2",3,"click"],[1,"row",3,"formGroupName"],[1,"col-4","form-group"],["rows","1","formControlName","description","placeholder","Enter description",1,"form-control","form-control-sm","mod-input"],["type","number","formControlName","amount","min","0","placeholder","Enter amount","onlyNumbers","","appRemoveZeroOnFocus","",1,"form-control","form-control-sm","mod-input",3,"input"],[1,"col-2","form-group"],[1,"col-12","col-md-auto","symbol-plus-col","margin-top-28px"],[1,"pay-add","symbol-plus-col","form-group"],["type","button","class","p-0 btn btn-basic text-theme pay-add-more font-20","matTooltip","Add charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","class","p-0 btn btn-basic text-danger pay-remove font-20","matTooltip","Remove charge","matTooltipPosition","above",3,"click",4,"ngIf"],["type","button","matTooltip","Remove charge","matTooltipPosition","above",1,"p-0","btn","btn-basic","text-danger","pay-remove","font-20",3,"click"],[1,"fas","fa-times-circle"],["size","small",3,"isLoading","useBlockPosition"],[1,"fin-attach-list"],["class","fin-file-chip",4,"ngFor","ngForOf"],[1,"fin-file-chip"],["target","_blank",1,"fin-file-chip__name",3,"href"],[1,"ri-close-line",3,"click"]],template:function(o,r){if(o&1){let c=I();i(0,"main",7)(1,"div",8)(2,"div",9)(3,"h2",10)(4,"a",11),x(5,"i",12),t(),i(6,"span",13),n(7,"Create Work Order"),t()()(),x(8,"div",14),t(),i(9,"form",15),S("ngSubmit",function(){return b(c),y(r.onSave())}),i(10,"div",16)(11,"div",17)(12,"h3",18),n(13,"Work Order Information"),t()(),i(14,"div",19)(15,"div",20)(16,"div",21)(17,"div",22)(18,"label",23)(19,"span",13),n(20,"WO Number"),t(),i(21,"sup",24),n(22,"*"),t()(),x(23,"input",25),u(24,WN,2,0,"div",26),t()(),i(25,"div",21)(26,"div",22)(27,"label",27),n(28,"WO Creation Date"),t(),x(29,"input",28),u(30,QN,2,0,"div",26),t()(),i(31,"div",21)(32,"div",22)(33,"label",27),n(34,"WO Expiry Date"),t(),x(35,"input",29),u(36,YN,2,0,"div",26),t()(),i(37,"div",21)(38,"div",22)(39,"label",27),n(40," Payment Mode"),t(),i(41,"select",30)(42,"o
1ption",31),n(43,"Select Payment Mode"),t(),i(44,"option",32),n(45,"Bank Transfer"),t(),i(46,"option",33),n(47,"Cheque/DD"),t(),i(48,"option",34),n(49,"Cash"),t(),i(50,"option",35),n(51,"Card"),t(),i(52,"option",36),n(53,"Wallet/UPI"),t(),i(54,"option",37),n(55,"Payment Gateway"),t()()()()()()(),i(56,"div",16)(57,"div",17)(58,"h3",18),n(59,"Buyer Details"),t()(),i(60,"div",19)(61,"div",20)(62,"div",38)(63,"div",22)(64,"label",39)(65,"span",13),n(66,"Buyer Name"),t(),i(67,"sup",24),n(68,"*"),t()(),i(69,"mat-form-field",40)(70,"mat-select",41,0),S("selectionChange",function(h){b(c);let C=w(71);return y(r.onSelectSellerOption(h.value,C))}),i(72,"mat-select-trigger"),n(73),t(),i(74,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(75,"mat-form-field",43)(76,"input",44),S("input",function(h){return b(c),y(r.onSearchSellers(h))})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(77,HN,3,0,"mat-option",45)(78,KN,6,5,"mat-option",46)(79,ZN,2,0,"mat-option",45),i(80,"mat-option",47),x(81,"i",48),n(82," Add New Buyer "),t()()(),x(83,"button",49),u(84,JN,2,0,"div",26),t()()(),u(85,iV,25,8,"div",50),t()(),u(86,_V,34,6,"ng-container",51),i(87,"div",16)(88,"div",17)(89,"h3",18),n(90,"Buyer Address Details"),t()(),i(91,"div",19)(92,"div",52)(93,"div",53)(94,"div",54)(95,"h4",55),n(96,"Service Address"),t(),i(97,"mat-form-field",40)(98,"mat-select",56,1),S("openedChange",function(h){return b(c),y(r.onAddressDropdownOpened(h))})("selectionChange",function(h){b(c);let C=w(99);return y(r.onSelectShippingAddress(h.value,C))}),u(100,vV,2,1,"mat-select-trigger",51),i(101,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(102,"mat-form-field",43)(103,"input",57),S("input",function(h){return b(c),y(r.shippingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(104,gV,6,4,"mat-option",46)(105,fV,2,1,"mat-option",45),i(106,"mat-option",58),x(107,"i",48),n(108," Add New Address "),t()()(),u(109,hV,7,2,"div",59),t()(),i(110,"div",53)(111,"div",54)(112,"div",60)(113,"h4",61),n(114,"Billing Address"),t(),i(115,"div",62)(116,"input",63),S("change",function(h){return b(c),y(r.onSameAsShippingChange(h))}),t(),i(117,"label",64),n(118,"Same as Service Address"),t()()(),i(119,"mat-form-field",40)(120,"mat-select",65,2),S("openedChange",function(h){return b(c),y(r.onAddressDropdownOpened(h))})("selectionChange",function(h){b(c);let C=w(121);return y(r.onSelectBillingAddress(h.value,C))}),u(122,xV,2,1,"mat-select-trigger",51),i(123,"div",42),S("click",function(h){return b(c),y(h.stopPropagation())}),i(124,"mat-form-field",43)(125,"input",57),S("input",function(h){return b(c),y(r.billingAddrSearch=h.target.value)})("keydown.space",function(h){return b(c),y(h.stopPropagation())})("click",function(h){return b(c),y(h.stopPropagation())}),t()()(),u(126,bV,6,4,"mat-option",46)(127,yV,2,1,"mat-option",45),i(128,"mat-option",58),x(129,"i",48),n(130," Add New Address "),t()()(),u(131,SV,7,2,"div",59),t()()()()(),i(132,"div",16)(133,"div",17)(134,"h3",18),n(135,"Service Details"),t(),u(136,CV,4,0,"button",66),t(),i(137,"div",19)(138,"div",67)(139,"div",68),u(140,EV,7,0,"div",69)(141,DV,21,1,"div",70)(142,TV,2,0,"div",71),t(),i(143,"div",72),u(144,wV,5,0,"div",73),i(145,"div",74),u(146,kV,14,3,"div",75),t()()()()(),i(147,"div",76)(148,"div",38)(149,"div",77)(150,"div",17)(151,"h3",18),n(152,"Terms & Conditions"),t()(),i(153,"div",19)(154,"div",22)(155,"label",78),n(156,"Terms"),t(),x(157,"textarea",79),t(),i(158,"input",80,3),S("change",function(h){return b(c),y(r.fileChange(h))}),t(),i(160,"label",81),x(161,"i",82),u(162,FV,2,0,"span",83)(163,MV,2,0,"span",83),t(),u(164,AV,1,2,"app-loader",84)(165,VV,2,1,"div",85),t()()(),i(166,"div",21)(167,"div",77)(168,"div",17)(169,"h3",18),n(170,"WO Summary"),t()(),i(171,"div",19)(172,"ul",86)(173,"li",87),n(174," Gross Total "),i(175,"span"),n(176),_(177,"currencyFormat"),t()(),i(178,"li")(179,"span",13),n(180,"Discount"),t(),i(181,"span",24),n(182),_(183,"currencyFormat"),t()(),i(184,"li",87),n(185," Net Total "),i(186,"span"),n(187),_(188,"currencyFormat"),t()(),i(189,"li",87),n(190," GST "),i(191,"span"),n(192),_(193,"currencyFormat"),t()(),i(194,"li",87),n(195," Additional Charges "),i(196,"span"),n(197),_(198,"currencyFormat"),t()()()(),i(199,"div",88),n(200," Total Payable Amou
1nt "),i(201,"span"),n(202),_(203,"currencyFormat"),t()()()()(),i(204,"div",89)(205,"div",90)(206,"div",91)(207,"button",92),n(208,"Cancel"),t(),i(209,"button",93),n(210,"Save"),t()()()()()(),x(211,"button",94)(212,"button",95),i(213,"div",96)(214,"div",97)(215,"div",98)(216,"div",99)(217,"h4",100),x(218,"i",101),i(219,"span",13),n(220,"Delete Product"),t()()(),i(221,"div",102)(222,"p",103),n(223,"Are you sure you want to delete "),i(224,"strong"),n(225),t(),n(226,"? "),t(),i(227,"p",104),n(228,"This action cannot be undone."),t()(),i(229,"div",105)(230,"button",106),S("click",function(){return b(c),y(r.cancelDelete())}),n(231,"No, Keep it"),t(),i(232,"button",107),S("click",function(){return b(c),y(r.confirmDelete())}),n(233,"Yes, Delete"),t()()()()(),i(234,"div",108)(235,"div",109)(236,"div",98)(237,"div",99)(238,"h5",110),n(239,"Add New Buyer"),t(),x(240,"button",111),i(241,"button",112),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(242,"\xD7"),t()(),i(243,"form",113)(244,"div",114)(245,"div",52)(246,"div",53)(247,"label",39),n(248,"Buyer Name / Company Name "),i(249,"sup",24),n(250,"*"),t()(),x(251,"input",115),u(252,BV,2,0,"div",116),t(),i(253,"div",53)(254,"label",39),n(255,"GST"),t(),x(256,"input",117),t(),i(257,"div",53)(258,"label",39),n(259,"PAN"),t(),x(260,"input",118),t()(),i(261,"h3",119),n(262,"Service At"),t(),i(263,"div",52)(264,"div",120)(265,"label",39),n(266,"Address "),i(267,"sup",24),n(268,"*"),t()(),x(269,"input",121),u(270,RV,2,0,"div",116),t(),i(271,"div",53)(272,"label",39),n(273,"State "),i(274,"sup",24),n(275,"*"),t()(),i(276,"select",122)(277,"option",123),n(278,"Select State"),t(),u(279,LV,2,2,"option",46),t(),u(280,qV,2,0,"div",116),t(),i(281,"div",53)(282,"label",39),n(283,"City "),i(284,"sup",24),n(285,"*"),t()(),x(286,"input",124),u(287,GV,2,0,"div",116),t(),i(288,"div",53)(289,"label",39),n(290,"Country "),i(291,"sup",24),n(292,"*"),t()(),i(293,"select",125)(294,"option",123),n(295,"Select Country"),t(),i(296,"option",126),n(297,"India"),t()(),u(298,UV,2,0,"div",116),t(),i(299,"div",53)(300,"label",39),n(301,"Postal Code"),t(),x(302,"input",127),u(303,jV,2,0,"div",116),t()(),i(304,"h3",119),n(305,"Contact Details"),t(),i(306,"div",52)(307,"div",53)(308,"label",39),n(309,"Contact Name "),i(310,"sup",24),n(311,"*"),t()(),x(312,"input",128),u(313,$V,2,0,"div",116),t(),i(314,"div",53)(315,"label",39),n(316,"Phone No. "),i(317,"sup",24),n(318,"*"),t()(),x(319,"input",129),u(320,QV,3,2,"div",116),t(),i(321,"div",53)(322,"label",39),n(323,"Email Id "),i(324,"sup",24),n(325,"*"),t()(),x(326,"input",130),u(327,KV,3,2,"div",116),t()()(),i(328,"div",131)(329,"button",132),S("click",function(){return b(c),y(r.buyerForm.reset())}),n(330,"Cancel"),t(),i(331,"button",133),S("click",function(){return b(c),y(r.saveBuyer())}),n(332),t()()()()()(),i(333,"div",134)(334,"div",135)(335,"div",98)(336,"div",99)(337,"h5",110),n(338,"Add User"),t(),x(339,"button",136),i(340,"button",112),S("click",function(){return b(c),y(r.userForm.reset())}),n(341,"\xD7"),t()(),i(342,"form",113)(343,"div",114)(344,"div",52)(345,"div",120)(346,"label",39),n(347,"Name "),i(348,"sup",24),n(349,"*"),t()(),x(350,"input",137),u(351,ZV,2,0,"div",116),t(),i(352,"div",120)(353,"label",39),n(354,"Phone Number "),i(355,"sup",24),n(356,"*"),t()(),x(357,"input",138),u(358,eB,3,2,"div",116),t(),i(359,"div",120)(360,"label",39),n(361,"Email "),i(362,"sup",24),n(363,"*"),t()(),x(364,"input",139),u(365,nB,3,2,"div",116),t()()(),i(366,"div",131)(367,"button",132),S("click",function(){return b(c),y(r.userForm.reset())}),n(368,"Cancel"),t(),i(369,"button",133),S("click",function(){return b(c),y(r.saveContactUser())}),n(370),t()()()()()(),i(371,"app-common-bom-product-drawer",140,4),S("productAdded",function(h){return b(c),y(r.onDrawerProductAdded(h))}),t()}if(o&2){let c,g,h,C,k,O,Q,G,X,pe,Y,le,ee,fe,oe,te,me,ce,be,Fe,Me,Ve,qe,Ge,Ue,je;l(4),s("backButtonFallback","/finance-management/receivable-purchase-orders"),l(5),s("formGroup",r.purchaseOrderForm),l(15),s("ngIf",((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.touched)&&((c=r.purchaseOrderForm.get("poNumber"))==null?null:c.invalid)),l(5),Be("max",r.poExpiryDateValue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((g=r.purchaseOrderForm.get("poCreationDate"))==null?null:g.touched)),l(5),Be("min",r.poCreationDateV
1alue||null),l(),s("ngIf",r.isPoDateRangeInvalid&&((h=r.purchaseOrderForm.get("poExpiryDate"))==null?null:h.touched)),l(34),s("value",(C=r.purchaseOrderForm.get("vendorId"))==null?null:C.value),l(3),m(" ",((k=r.purchaseOrderForm.get("buyerName"))==null?null:k.value)||"Search or enter buyer name"," "),l(3),s("value",r.sellerSearchTerm),l(),s("ngIf",r.isSearchLoading),l(),s("ngForOf",r.sellerOptions),l(),s("ngIf",!r.isSearchLoading&&r.sellerSearchTerm&&r.sellerOptions.length===0),l(),s("value",r.ADD_SUPPLIER),l(4),s("ngIf",((O=r.purchaseOrderForm.get("buyerName"))==null?null:O.touched)&&((O=r.purchaseOrderForm.get("buyerName"))==null?null:O.invalid)),l(),s("ngIf",(Q=r.purchaseOrderForm.get("buyerName"))==null?null:Q.value),l(),s("ngIf",(G=r.purchaseOrderForm.get("buyerName"))==null?null:G.value),l(14),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(3),s("value",r.shippingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.shippingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.shippingAddrSearch).length),l(),s("value",r.ADD_SHIPPING_ADDRESS)("disabled",!r.isBuyerSelected),l(3),s("ngIf",r.selectedShippingAddress==null?null:r.selectedShippingAddress.length),l(7),s("checked",r.sameAsShippingAddress)("disabled",!r.selectedShippingAddress||r.selectedShippingAddress.length==0),l(4),s("value",(X=r.selectedBillingAddress==null||r.selectedBillingAddress[0]==null?null:r.selectedBillingAddress[0].entity_id)!==null&&X!==void 0?X:null)("disabled",r.sameAsShippingAddress),l(2),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(3),s("value",r.billingAddrSearch),l(),s("ngForOf",r.filterAddresses(r.billingAddrSearch)),l(),s("ngIf",!r.filterAddresses(r.billingAddrSearch).length),l(),s("value",r.ADD_BILLING_ADDRESS)("disabled",!r.isBuyerSelected),l(3),s("ngIf",r.selectedBillingAddress==null?null:r.selectedBillingAddress.length),l(5),s("ngIf",r.productFormValues.length),l(4),s("ngIf",!r.productFormValues||r.productFormValues.length===0),l(),s("ngIf",r.productFormValues.length),l(),s("ngIf",r.submitted&&(!r.productFormValues||r.productFormValues.length===0)),l(2),s("ngIf",!r.additionalChargesArray.controls.length),l(2),s("ngForOf",r.additionalChargesArray.controls),l(12),s("disabled",r.loadingStates.termsDocs),l(4),s("ngIf",!r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.loadingStates.termsDocs),l(),s("ngIf",r.uploadedTermsDocs==null?null:r.uploadedTermsDocs.length),l(11),f(v(177,73,(pe=r.purchaseOrderForm.get("grossTotal"))==null?null:pe.value)),l(6),m("- ",v(183,75,(Y=r.purchaseOrderForm.get("discount"))==null?null:Y.value),""),l(5),f(v(188,77,(le=r.purchaseOrderForm.get("netTotal"))==null?null:le.value)),l(5),f(v(193,79,(ee=r.purchaseOrderForm.get("taxes"))==null?null:ee.value)),l(5),f(v(198,81,r.getAdditionalCharges)),l(5),f(v(203,83,(fe=r.purchaseOrderForm.get("totalPayableAmount"))==null?null:fe.value)),l(7),s("disabled",r.purchaseOrderForm.invali
1d||!r.productFormValues||r.productFormValues.length===0),l(16),f(r.confirmDeleteIndex!==null?r.productFormValues[r.confirmDeleteIndex]==null?null:r.productFormValues[r.confirmDeleteIndex].productName:""),l(18),s("formGroup",r.buyerForm),l(9),s("ngIf",((oe=r.buyerForm.get("organization_name"))==null?null:oe.touched)&&((oe=r.buyerForm.get("organization_name"))==null?null:oe.invalid)),l(18),s("ngIf",((te=r.buyerForm.get("address"))==null?null:te.touched)&&((te=r.buyerForm.get("address"))==null?null:te.invalid)),l(9),s("ngForOf",r.states),l(),s("ngIf",((me=r.buyerForm.get("state"))==null?null:me.touched)&&((me=r.buyerForm.get("state"))==null?null:me.invalid)),l(7),s("ngIf",((ce=r.buyerForm.get("city"))==null?null:ce.touched)&&((ce=r.buyerForm.get("city"))==null?null:ce.invalid)),l(11),s("ngIf",((be=r.buyerForm.get("country_id"))==null?null:be.touched)&&((be=r.buyerForm.get("country_id"))==null?null:be.invalid)),l(5),s("ngIf",((Fe=r.buyerForm.get("postal_code"))==null?null:Fe.touched)&&((Fe=r.buyerForm.get("postal_code"))==null?null:Fe.invalid)),l(10),s("ngIf",((Me=r.buyerForm.get("contact_name"))==null?null:Me.touched)&&((Me=r.buyerForm.get("contact_name"))==null?null:Me.invalid)),l(7),s("ngIf",((Ve=r.buyerForm.get("phone"))==null?null:Ve.touched)&&((Ve=r.buyerForm.get("phone"))==null?null:Ve.invalid)),l(7),s("ngIf",((qe=r.buyerForm.get("email"))==null?null:qe.touched)&&((qe=r.buyerForm.get("email"))==null?null:qe.invalid)),l(4),s("disabled",r.buyerSubmitting),l(),m(" ",r.buyerSubmitting?"Saving...":"Save Buyer"," "),l(10),s("formGroup",r.userForm),l(9),s("ngIf",((Ge=r.userForm.get("name"))==null?null:Ge.touched)&&((Ge=r.userForm.get("name"))==null?null:Ge.invalid)),l(7),s("ngIf",((Ue=r.userForm.get("phone"))==null?null:Ue.touched)&&((Ue=r.userForm.get("phone"))==null?null:Ue.invalid)),l(7),s("ngIf",((je=r.userForm.get("email"))==null?null:je.touched)&&((je=r.userForm.get("email"))==null?null:je.invalid)),l(4),s("disabled",r.userSubmitting),l(),m(" ",r.userSubmitting?"Submitting...":"Submit"," ")}},dependencies:[rt,J,W,Ee,It,Mt,Et,Oe,He,Ke,Ne,at,Ye,Pe,Ie,Ot,gt,kt,Ft,bt,dt,Z,De,L,vt,ut,Gt,We,Qe,yt,St,ae],styles:[".searchList[_ngcontent-%COMP%]{position:absolute;width:97%;z-index:6;overflow:scroll;height:200px;left:0}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%]{margin:0 20px}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]{padding:.5rem;cursor:pointer}.searchList[_ngcontent-%COMP%] .list-group[_ngcontent-%COMP%] .list-group-item[_ngcontent-%COMP%]:hover{background-color:#f3f4f7}.max-w-80px[_ngcontent-%COMP%]{max-width:80px}.ml-n-75px[_ngcontent-%COMP%]{margin-left:-75px}.min-w-154px[_ngcontent-%COMP%]{min-width:154px}.ml-20[_ngcontent-%COMP%]{margin-left:20px}.border-right-black[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.125)}.addressTable[_ngcontent-%COMP%]{height:calc(100vh - 230px);overflow-y:auto}.addressTable[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.m-670[_ngcontent-%COMP%]{top:5px;margin-left:68%}.hilight-element[_ngcontent-%COMP%]{width:100%;overflow:hidden;padding:7px;border:solid 1px #B7E1FF;background:#eef8ff;border-radius:5px}.invalid-error[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.parentWarehouseInput[_ngcontent-%COMP%]:is(:focus-within, [_ngcontent-%COMP%]:focus) + .parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{display:block}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;position:absolute;z-index:10;width:100%}.parentWarehouseOptionsDrpDown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2n){background-color:#f8f9fa}.parentWarehouseOptionsDrpDown--span1[_ngcontent-%COMP%]{font-weight:500;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parentWarehouseOptionsDrpDown--span2[_ngcontent-%COMP%]{font-weight:500;font-size:.85rem;color:#665757;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.margin-top-28px[_ngcontent-%COMP%]{margin-top:28px}.fin-select-toggle[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--mod-radius-md)}.fin-select-toggle[_ngcontent-%COMP%]:after{display:none!important}.fin-select-toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-select-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;color:#666;flex-shrink:0}.fin-buyer-dropdown[_ngcontent-%COMP%]{max-height:320px;overflow-y:auto;padding:6px;box-shadow:0 4px 16px #00000014}.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 1rem)}
1.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 1rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-shrink:0}@media (min-width: 576px){.modal-dialog-scrollable[_ngcontent-%COMP%]{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-height:calc(100vh - 3.5rem)}}@media (max-width: 575.98px){.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] >
1 .mod-btn[_ngcontent-%COMP%], .modal-dialog-scrollable[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > .modal-footer[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{flex:1 1 auto;margin:0}}.fin-dropdown-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:#fff;padding:2px 4px 8px}.fin-dropdown-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:38px;border-radius:var(--mod-radius-md)}.fin-buyer-item[_ngcontent-%COMP%]{display:block;padding:10px 12px;border-radius:6px;white-space:normal;cursor:pointer}.fin-buyer-item__name[_ngcontent-%COMP%]{display:block;font-weight:600;color:#000}.fin-buyer-item__meta[_ngcontent-%COMP%]{display:block;color:#777;font-size:13px}.fin-buyer-item--add[_ngcontent-%COMP%] .fin-buyer-item__meta[_ngcontent-%COMP%]{color:var(--theme-primary, #a24b2b)}.fin-info-block[_ngcontent-%COMP%]{background:var(--theme-bg-light);border-radius:8px;padding:20px}.fin-info-block__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000;margin-bottom:4px}.fin-info-block__sub[_ngcontent-%COMP%]{color:#777;font-size:14px;margin-bottom:12px}.fin-info-block__divider[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.08);margin:12px 0}.fin-info-block__label[_ngcontent-%COMP%]{display:block;font-size:13px;color:#888;margin-bottom:2px}.fin-info-block__value[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:600;color:#000}.shpCard[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ebecec;border-radius:var(--mod-radius-lg);padding:15px}.shpCard[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%], .shpCard[_ngcontent-%COMP%] .fin-select-toggle[_ngcontent-%COMP%]{border-radius:var(--mod-radius-md)}.fin-check[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:auto}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{line-height:18px;cursor:pointer}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;top:0}.fin-check[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{border-color:#adb5bd}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:before{background-color:var(--theme-sub-prime);border-color:var(--theme-sub-prime)}.fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:focus:not(:checked) ~ .custom-control-label[_ngcontent-%COMP%]:before, .fin-check[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:active ~ .custom-control-label[_ngcontent-%COMP%]:before{box-shadow:none;border-color:var(--theme-sub-prime)}.fin-empty-products[_ngcontent-%COMP%]{border:1px dashed #e2e2e2;border-radius:8px}.fin-product-table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0;border:1px solid #ececec;border-radius:8px;overflow:hidden;margin-bottom:0}.fin-product-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:var(--theme-bg-light);font-weight:600;border:none;border-bottom:1px solid #ececec;padding:14px 16px;white-space:nowrap}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:none;border-bottom:1px solid #f0f0f0;padding:14px 16px;vertical-align:middle}.fin-product-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.fin-product-table[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .fin-product-table[_ngcontent-%COMP%] .ri-close-line[_ngcontent-%COMP%]{font-size:22px;line-height:1;vertical-align:middle}.fin-attach-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fin-file-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 12px;background:#fff;color:var(--theme-primary);border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 1px 4px #0000001f;font-size:13px}.fin-file-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;font-size:16px;flex-shrink:0;transition:color .15s ease}.fin-file-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{color:#dc3545}.fin-summary[_ngcontent-%COMP%]{margin-bottom:0}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;font-weight:600;color:#000}.fin-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid #f2f2f2}.fin-summary__total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;
1background:var(--theme-bg-light);padding:18px 20px;font-size:15px;font-weight:700;color:#000;border-radius:0 0 var(--mod-radius-lg) var(--mod-radius-lg)}"]})}}return a})();var _r=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275mod=$i({type:a})}static{this.\u0275inj=ji({imports:[Fn,Vi,Hn,na,aa,Wn,ta,Qn,ia,$n,Kn,Gn,qn,Jn,Xn,sa,zn,An,la,_a,va,Yn,ea,ga,ua]})}}return a})();var aB=[{path:"",component:ha,children:[{path:"",component:xa},{path:"payable-purchase-orders",component:ka},{path:"payable-work-orders/create",component:xn},{path:"payable-work-orders/edit/:id",component:xn},{path:"receivable-work-orders/create",component:bn},{path:"receivable-work-orders/edit/:id",component:bn},{path:"payable-purchase-orders/create",component:mn},{path:"payable-purchase-orders/edit/:id",component:mn},{path:"payable-purchase-orders/details/:id",component:un},{path:"payable-invoices",component:ln},{path:"payable-invoices/create",component:Ri},{path:"payable-invoices/edit/:id",component:Ri},{path:"payable-invoices/details/:id",component:on},{path:"purchase-orders",component:ln},{path:"purchase-orders/create",component:Ri},{path:"purchase-orders/edit/:id",component:Ri},{path:"purchase-orders/details/:id",component:on},{path:"payable-payments",component:ba},{path:"payable-payments/create",component:Ea},{path:"payable-payments/details/:id",component:Ia},{path:"payable-credit-notes",component:nr},{path:"payable-credit-notes/create",component:gn},{path:"payable-credit-notes/edit/:id",component:gn},{path:"payable-credit-notes/details/:id",component:rr},{path:"payable-debit-notes",component:Va},{path:"payable-debit-notes/create",component:ir},{path:"payable-debit-notes/details/:id",component:tr},{path:"payable-reports",component:Da},{path:"receivable-purchase-orders",component:Fa},{path:"receivable-purchase-orders/create",component:_n},{path:"receivable-purchase-orders/edit/:id",component:_n},{path:"receivable-purchase-orders/details/:id",component:un},{path:"receivable-invoices",component:ya},{path:"receivable-invoices/create",component:dn},{path:"receivable-invoices/edit/:id",component:dn},{path:"receivable-invoices/details/:id",component:Ta},{path:"receivable-receipts",component:Sa},{path:"receivable-receipts/create",component:pn},{path:"receivable-receipts/edit/:id",component:pn},{path:"receivable-receipts/details/:id",component:Oa},{path:"receivable-credit-notes",component:ar},{path:"receivable-credit-notes/create",component:fn},{path:"receivable-credit-notes/edit/:id",component:fn},{path:"receivable-credit-notes/details/:id",component:lr},{path:"receivable-debit-notes",component:Ba},{path:"receivable-debit-notes/create",component:hn},{path:"receivable-debit-notes/edit/:id",component:hn},{path:"receivable-debit-notes/details/:id",component:or},{path:"receivable-reports",component:wa},{path:"bank-accounts",component:Pa},{path:"bank-accounts/create",component:sr},{path:"my-documents",component:pr},{path:"my-documents/details/:id",component:ur},{path:"transactions",component:Ma},{path:"reconcilation",component:Aa},{path:"fund-transfers",component:Na},{path:"payable-purchase-orders/send",component:La},{path:"payable-purchase-orders/view",component:qa},{path:"payable-purchase-orders/manual-entry",component:Ga},{path:"payable-purchase-orders/cancelled",component:Ua},{path:"payable-invoices/approve",component:ja},{path:"payable-invoices/view",component:$a},{path:"payable-invoices/rejected",component:za},{path:"payable-payments/po",component:Wa},{path:"receivable-purchase-orders/send",component:Qa},{path:"receivable-purchase-orders/view",component:Ya},{path:"receivable-purchase-orders/seller-view",component:Ha},{path:"receivable-purchase-orders/cancelled",component:Ka},{path:"receivable-invoices/create-from-po",component:Za},{path:"receivable-invoices/parent",component:Ja},{path:"receivable-invoices/view",component:Xa},{path:"receivable-invoices/rejected",component:er}]}],Z$=(()=>{class a{static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275mod=$i({type:a})}static{this.\u0275inj=ji({imports:[_r,Vi.forChild(aB),Vi]})}}return a})();export{Z$ as FinanceManagementRoutingModule};
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.