dealpos 12.2.2 → 12.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[2527],{70900:(H,w,d)=>{d.r(w),d.d(w,{AdjustmentModule:()=>Xo});var a=d(81180),c=d(36895),l=d(24006),T=d(88796),P=d(98085),v=d(93669),S=d(30273),M=d(42011),N=d(88441),I=d(9116),C=d(4077),x=d(96700),y=(()=>{return(n=y||(y={}))[n.InProgress=1]="InProgress",n[n.Waiting=2]="Waiting",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",y;var n})(),t=d(94650),Z=d(89156),g=d(97185),D=d(24424),u=d(51161),h=d(10266);function m(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",19)(1,"button",20),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.reject())}),t._UZ(2,"i",21),t._uU(3,"Reject "),t.qZA(),t.TgZ(4,"button",20),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.accept())}),t._UZ(5,"i",22),t._uU(6,"Accept "),t.qZA()()}}const _=function(){return["/menu/Adjustment/Adjustment/Archive/Form"]},f=function(n){return{ID:n}};function O(n,r){if(1&n&&(t.TgZ(0,"a",23),t._UZ(1,"i",24),t._uU(2,"Edit "),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,_))("queryParams",t.VKq(3,f,e.data.ID))}}function j(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",20),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.delete())}),t._UZ(1,"i",25),t._uU(2,"Delete "),t.qZA()}}function E(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"th"),t._uU(2,"Journal Link"),t.qZA(),t.TgZ(3,"td"),t._uU(4,":"),t.qZA(),t.TgZ(5,"td")(6,"a",26),t._uU(7,"View Journal"),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(6),t.MGl("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",t.LSH)}}function Ot(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",44),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentInfoExport","Adjustment#"+i.data.Adjustment.Number+".csv"))}),t._uU(1,"Export"),t.qZA()}}function Pt(n,r){1&n&&(t.TgZ(0,"th",45),t._uU(1,"Cost"),t.qZA())}function wt(n,r){1&n&&(t.TgZ(0,"th",45),t._uU(1,"Price"),t.qZA())}function Nt(n,r){if(1&n&&(t.ynx(0),t._UZ(1,"p",50),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("innerHTML",e.Note,t.oJD)}}const G=function(n,r){return{"text-success":n,"text-danger":r}};function kt(n,r){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Tol(t.WLB(3,G,e.Quantity>0,e.Quantity<0)),t.xp6(1),t.Oqu(e.Quantity)}}function jt(n,r){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Tol(t.WLB(3,G,e.Quantity>0,e.Quantity<0)),t.xp6(1),t.Oqu(e.Quantity)}}function Ut(n,r){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Tol(t.WLB(3,G,e.Counted>0,e.Counted<0)),t.xp6(1),t.Oqu(e.Counted)}}function qt(n,r){if(1&n&&(t._UZ(0,"td",52),t.ALo(1,"number")),2&n){const e=t.oxw().$implicit;t.Q6J("innerHTML",t.lcZ(1,1,e.UnitCost),t.oJD)}}function Jt(n,r){if(1&n&&(t._UZ(0,"td",52),t.ALo(1,"number")),2&n){const e=t.oxw().$implicit;t.Q6J("innerHTML",t.lcZ(1,1,e.UnitPrice),t.oJD)}}function Et(n,r){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",46),t.TgZ(2,"td")(3,"a",47),t._uU(4),t.qZA(),t.TgZ(5,"div"),t._uU(6),t.qZA(),t.YNc(7,Nt,2,1,"ng-container",14),t.qZA(),t.YNc(8,kt,2,6,"td",48),t.YNc(9,jt,2,6,"td",48),t.YNc(10,Ut,2,6,"td",48),t.YNc(11,qt,2,3,"td",49),t.YNc(12,Jt,2,3,"td",49),t.qZA()),2&n){const e=r.$implicit,o=r.index,i=t.oxw(3);t.xp6(1),t.Q6J("innerHTML",o+1+".",t.oJD),t.xp6(2),t.Q6J("queryParams",t.VKq(10,f,e.VariantID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",null!=e.Note),t.xp6(1),t.Q6J("ngIf",4==i.data.Adjustment.StateID),t.xp6(1),t.Q6J("ngIf",i.data.Adjustment.StateID<4&&1==i.data.Adjustment.TypeID),t.xp6(1),t.Q6J("ngIf",i.data.Adjustment.StateID<4&&2==i.data.Adjustment.TypeID),t.xp6(1),t.Q6J("ngIf",i.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",i.roleService.sell.PriceVisible)}}function Qt(n,r){if(1&n&&(t.TgZ(0,"td",53)(1,"b"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA()()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(t.lcZ(3,1,t.xi3(4,3,e.data.DifferencesArray,"TotalCost")))}}function Ft(n,r){if(1&n&&(t.TgZ(0,"td",54)(1,"b"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA()()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(t.lcZ(3,1,t.xi3(4,3,e.data.DifferencesArray,"TotalPrice")))}}const mt=function(){return["/print/Adjustment"]};function Lt(n,r){if(1&n&&(t.TgZ(0,"div",9)(1,"div",27)(2,"div")(3,"h2"),t._uU(4),t.qZA()(),t.TgZ(5,"div",28)(6,"a",29),t._UZ(7,"i",30),t._uU(8,"Print "),t.qZA(),t.YNc(9,Ot,2,0,"a",31),t.qZA()(),t.TgZ(10,"div",12)(11,"div",32)(12,"table",33)(13,"thead",34)(14,"tr")(15,"th",35),t._uU(16,"No"),t.qZA(),t.TgZ(17,"th",36),t._uU(18,"Name"),t.qZA(),t.TgZ(19,"th",37),t._uU(20,"Qty"),t.qZA(),t.YNc(21,Pt,2,0,"th",38),t.YNc(22,wt,2,0,"th",38),t.qZA()(),t.TgZ(23,"tbody"),t.YNc(24,Et,13,12,"tr",39),t.qZA(),t.TgZ(25,"tfoot")(26,"tr")(27,"td",40)(28,"b"),t._uU(29,"Total :"),t.qZA()(),t.TgZ(30,"td",41)(31,"b"),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA()(),t.YNc(35,Qt,5,6,"td",42),t.YNc(36,Ft,5,6,"td",43),t.qZA()()()()()()),2&n){const e=t.oxw(2);t.xp6(4),t.hij("Adjusted Inventory (",e.data.DifferencesArray.length," SKU)"),t.xp6(2),t.Q6J("routerLink",t.DdM(15,mt))("queryParams",t.VKq(16,f,e.id)),t.xp6(3),t.Q6J("ngIf",e.roleService.global.Export&&4==e.data.Adjustment.StateID),t.xp6(12),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.PriceVisible),t.xp6(2),t.Q6J("ngForOf",e.data.DifferencesArray),t.xp6(8),t.Oqu(t.lcZ(33,10,t.xi3(34,12,e.data.DifferencesArray,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.PriceVisible)}}function Yt(n,r){if(1&n&&(t.TgZ(0,"h2"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij("Counted Inventory (",e.data.CountedArray.length," SKU)")}}function Ht(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",44),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.exportCSV(i.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+i.data.Adjustment.Number+".csv"))}),t._UZ(1,"i",56),t._uU(2,"Export"),t.qZA()}}function Kt(n,r){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",46),t.TgZ(2,"td")(3,"a",47),t._uU(4),t.qZA(),t.TgZ(5,"div"),t._uU(6),t.qZA()(),t.TgZ(7,"td",51),t._uU(8),t.qZA(),t.TgZ(9,"td",51),t._uU(10),t.qZA(),t.TgZ(11,"td",51),t._uU(12),t.qZA()()),2&n){const e=r.$implicit,o=r.index;t.xp6(1),t.Q6J("innerHTML",o+1+".",t.oJD),t.xp6(2),t.Q6J("queryParams",t.VKq(9,f,e.VariantID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(e.Counted),t.xp6(2),t.Oqu(e.Actual),t.xp6(1),t.Tol(t.WLB(11,G,e.Difference>0,e.Difference<0)),t.xp6(1),t.Oqu(e.Difference)}}function Vt(n,r){if(1&n&&(t.TgZ(0,"div",9)(1,"div",27)(2,"div"),t.YNc(3,Yt,2,1,"h2",14),t.qZA(),t.TgZ(4,"div",28)(5,"a",29),t._UZ(6,"i",30),t._uU(7,"Print "),t.qZA(),t.YNc(8,Ht,3,0,"a",31),t.qZA()(),t.TgZ(9,"div",12)(10,"div",32)(11,"table",33)(12,"thead",34)(13,"tr")(14,"th",35),t._uU(15,"No"),t.qZA(),t.TgZ(16,"th",36),t._uU(17,"Name"),t.qZA(),t.TgZ(18,"th",55),t._uU(19,"Counted"),t.qZA(),t.TgZ(20,"th",55),t._uU(21,"Actual"),t.qZA(),t.TgZ(22,"th",55),t._uU(23,"Difference"),t.qZA()()(),t.TgZ(24,"tbody"),t.YNc(25,Kt,13,14,"tr",39),t.qZA()()()()()),2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngIf",e.data.CountedArray.length>0&&2==e.data.Adjustment.TypeID),t.xp6(2),t.Q6J("routerLink",t.DdM(5,mt))("queryParams",t.VKq(6,f,e.id)),t.xp6(3),t.Q6J("ngIf",e.roleService.global.Export&&4==e.data.Adjustment.StateID),t.xp6(17),t.Q6J("ngForOf",e.data.CountedArray)}}function Rt(n,r){if(1&n&&(t.TgZ(0,"span")(1,"b"),t._uU(2,"Modified:"),t.qZA(),t._uU(3),t.ALo(4,"date"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(3),t.AsE(" ",t.xi3(4,2,e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Modified.User," ")}}function Gt(n,r){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,m,7,0,"div",2),t.TgZ(3,"div",3),t.YNc(4,O,3,5,"a",4),t.YNc(5,j,3,0,"button",5),t.qZA()(),t.TgZ(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"div"),t._UZ(13,"h2",11),t.qZA()(),t.TgZ(14,"div",12)(15,"table",13)(16,"tr")(17,"th"),t._uU(18,"Date"),t.qZA(),t.TgZ(19,"td"),t._uU(20,":"),t.qZA(),t._UZ(21,"td",11),t.qZA(),t.TgZ(22,"tr")(23,"th"),t._uU(24,"PIC"),t.qZA(),t.TgZ(25,"td"),t._uU(26,":"),t.qZA(),t._UZ(27,"td",11),t.qZA(),t.TgZ(28,"tr")(29,"th"),t._uU(30,"Type"),t.qZA(),t.TgZ(31,"td"),t._uU(32,":"),t.qZA(),t._UZ(33,"td",11),t.qZA(),t.TgZ(34,"tr")(35,"th"),t._uU(36,"State"),t.qZA(),t.TgZ(37,"td"),t._uU(38,":"),t.qZA(),t._UZ(39,"td",11),t.qZA(),t.TgZ(40,"tr")(41,"th"),t._uU(42,"Note"),t.qZA(),t.TgZ(43,"td"),t._uU(44,":"),t.qZA(),t._UZ(45,"td",11),t.qZA(),t.YNc(46,E,8,1,"tr",14),t.qZA()()()(),t.TgZ(47,"div",15),t.YNc(48,Lt,37,18,"div",16),t.YNc(49,Vt,26,8,"div",16),t.qZA()(),t.TgZ(50,"div",17),t._UZ(51,"i",18),t.TgZ(52,"span")(53,"b"),t._uU(54,"Created:"),t.qZA(),t._uU(55),t.ALo(56,"date"),t.qZA(),t.YNc(57,Rt,5,5,"span",14),t.qZA()()()()),2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",!e.toggleAccRej),t.xp6(2),t.Q6J("ngIf",e.roleService.adjustment.Edit&&2!=e.data.Adjustment.TypeID&&3!=e.data.Adjustment.StateID),t.xp6(1),t.Q6J("ngIf",e.roleService.adjustment.Delete),t.xp6(8),t.Q6J("innerHTML",e.data.Adjustment.OutletName,t.oJD),t.xp6(8),t.Q6J("innerHTML",e.data.Adjustment.Date,t.oJD),t.xp6(6),t.Q6J("innerHTML",e.data.Adjustment.PIC,t.oJD),t.xp6(6),t.Q6J("innerHTML",e.data.Adjustment.TypeLabel,t.oJD),t.xp6(6),t.Q6J("innerHTML",e.data.Adjustment.StateLabel,t.oJD),t.xp6(6),t.Q6J("innerHTML",e.data.Adjustment.Note,t.oJD),t.xp6(1),t.Q6J("ngIf",e.data.AppsAccoutingActive&&e.roleService.accounting.View),t.xp6(2),t.Q6J("ngIf",e.data.DifferencesArray.length>0),t.xp6(1),t.Q6J("ngIf",(null==e.data.CountedArray?null:e.data.CountedArray.length)>0&&2==e.data.Adjustment.TypeID),t.xp6(6),t.AsE(" ",t.xi3(56,18,e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Created.User," "),t.xp6(2),t.Q6J("ngIf",e.data.CreatedInfo.Modified.User)}}let Bt=(()=>{class n extends C.n{constructor(e,o,i,s,p,A){super(e,"Adjustment/AuditInventoryAdjustmentInfo",null,null,i),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"csvConverter",void 0),(0,a.Z)(this,"router",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"toggleAccRej",!1),(0,a.Z)(this,"isEditable",!1),this.toastr=o,this.csvConverter=s,this.router=p,this.roleService=A}preGetList(){const e=this.route.snapshot.queryParams;this.id=e.ID,this.pageData.Filter=e}postInit(e){this.menuData.H=e.PageTitle,this.toggleAccRej=!(e.Adjustment.StateID<=2&&this.roleService.adjustment.Approval&&e.Config.WithApproval),(1==this.data.Adjustment.StateID||2==this.data.Adjustment.StateID)&&(this.isEditable=!0)}exportCSV(e,o,i){this.httpService.post(`/api/${o}`,JSON.stringify(this.id)).subscribe(s=>{e.convertToCSV(s,i)})}reject(){confirm("Are you sure you want to reject this?")&&(this.data.Order={ID:this.data.Adjustment.ID,Number:this.data.Adjustment.Number,Date:this.data.Adjustment.Date,PIC:this.data.Adjustment.PIC,Note:this.data.Adjustment.Note,EntityID:this.data.Adjustment.EntityID,TypeID:this.data.Adjustment.TypeID,StateID:y.Rejected},this.httpService.post("/API/Adjustment/RejectCountedItem",JSON.stringify(this.data)).subscribe({next:o=>{this.toastr.success("Success reject adjustment",x.n.Success),this.toggleAccRej=!0,this.isEditable=!1,this.getListData()},error:o=>{this.toastr.error(o,x.n.Error)}}))}accept(){confirm("Are you sure you want to accept this?")&&(this.data.Order={ID:this.data.Adjustment.ID,Number:this.data.Adjustment.Number,Date:this.data.Adjustment.Date,PIC:this.data.Adjustment.PIC,Note:this.data.Adjustment.Note,EntityID:this.data.Adjustment.EntityID,TypeID:this.data.Adjustment.TypeID,StateID:y.Accepted},this.data.Items=[],this.data.DifferencesArray.forEach(o=>{2===this.data.Order.TypeID&&(o.Quantity=o.Counted),this.data.Items.push(o)}),this.httpService.post("/API/Adjustment/AcceptCountedItem",JSON.stringify(this.data)).subscribe({next:o=>{this.toastr.success("Success accept adjustment",x.n.Success),this.toggleAccRej=!0,this.isEditable=!1,this.getListData()},error:o=>{this.toastr.error(o,x.n.Error)}}))}delete(){confirm("Are you sure you want to delete this?")&&this.httpService.post("/api/Adjustment/DeleteInventoryAdjustmentInfo",JSON.stringify(this.data.Adjustment.ID)).subscribe(()=>{this.toastr.success("Success delete record.",x.n.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(g._W),t.Y36(I.gz),t.Y36(D.O),t.Y36(I.F0),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-adjustment-info"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn-group me-5",4,"ngIf"],[1,"btn-group","ms-5"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-3"],[1,"card"],[1,"card-header"],[3,"innerHTML"],[1,"card-body"],[1,"table-sm","table-borderless"],[4,"ngIf"],[1,"col-sm-9"],["class","card",4,"ngIf"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file","me-3"],[1,"btn-group","me-5"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-thumbs-down","me-3"],[1,"fa-solid","fa-thumbs-up","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"fa-solid","fa-trash","me-3"],[3,"href"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-3"],["class","btn btn-outline-secondary btn-sm","role","button",3,"click",4,"ngIf"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[1,"text-end",2,"width","80px"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end","empty-column"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"text-end",2,"width","120px"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],["class","text-end",3,"class",4,"ngIf"],["class","text-end",3,"innerHTML",4,"ngIf"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end",3,"innerHTML"],["matTooltipPosition","above","matTooltip","Total from Quantity x Cost",1,"text-end","empty-column"],["matTooltipPosition","above","matTooltip","Total from Quantity x Price",1,"text-end","empty-column"],[1,"text-end",2,"width","100px"],[1,"fa-solid","fa-upload","me-3"]],template:function(e,o){1&e&&t.YNc(0,Gt,58,21,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[c.sg,c.O5,I.rH,S.p,h.gM,c.JJ,c.uU,v.qU]})),n})();var B=d(17554),k=d(65412),_t=d(3077),tt=d(11594),Q=d(83902);function $t(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),t._UZ(1,"i",32),t._uU(2,"Delete "),t.qZA()}}function Wt(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",33),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openExportModal())}),t._UZ(1,"i",34),t._uU(2," Export"),t.qZA()}}const zt=function(){return["/menu/Adjustment/Adjustment/Archive/Form"]};function Xt(n,r){1&n&&(t.TgZ(0,"a",35),t._uU(1,"New"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,zt))}function te(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"th",36)(1,"input",37),t.NdJ("change",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.onSelectAllData(i.target.checked))}),t.qZA()()}}function ee(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",43),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw().$implicit;return t.KtG(s.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)}}function ne(n,r){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Quantity))}}const oe=function(n){return{"text-success":n}};function ie(n,r){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Tol(t.VKq(5,oe,e.Quantity>0)),t.xp6(1),t.hij(" +",t.lcZ(2,3,e.Quantity),"")}}const ae=function(n){return{"text-danger":n}};function re(n,r){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Tol(t.VKq(5,ae,e.Quantity<0)),t.xp6(1),t.hij(" ",t.lcZ(2,3,e.Quantity),"")}}const se=function(){return["/menu/Adjustment/Adjustment/Archive/Info"]},ce=function(n){return{ID:n}},le=function(n,r){return{"text-success":n,"text-danger":r}};function de(n,r){if(1&n&&(t.TgZ(0,"tr",38),t.YNc(1,ee,2,1,"td",39),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td")(5,"a",40),t._uU(6),t.qZA()(),t.TgZ(7,"td"),t._uU(8),t.ALo(9,"date"),t.qZA(),t.YNc(10,ne,3,3,"td",41),t.YNc(11,ie,3,7,"td",42),t.YNc(12,re,3,7,"td",42),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.TgZ(15,"td"),t._uU(16),t.qZA(),t.TgZ(17,"td"),t._uU(18),t.qZA()()),2&n){const e=r.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.roleService.adjustment.Delete),t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(17,se))("queryParams",t.VKq(18,ce,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.xi3(9,14,e.Date,"dd MMM yyyy")),t.xp6(2),t.Q6J("ngIf",0==e.Quantity),t.xp6(1),t.Q6J("ngIf",e.Quantity>0),t.xp6(1),t.Q6J("ngIf",e.Quantity<0),t.xp6(2),t.Oqu(e.TypeLabel),t.xp6(1),t.Tol(t.WLB(20,le,4==e.StateID,3==e.StateID)),t.xp6(1),t.hij(" ",e.StateLabel,""),t.xp6(2),t.Oqu(e.Note)}}function pe(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.Number=i)})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,$t,3,0,"a",2),t.YNc(3,Wt,3,0,"button",3),t.YNc(4,Xt,2,2,"a",4),t.qZA(),t.TgZ(5,"filters")(6,"div",5)(7,"div",6)(8,"div")(9,"h6"),t._uU(10,"Outlet"),t.qZA(),t.TgZ(11,"ng-select",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.EntityID=i)}),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"From"),t.qZA(),t.TgZ(15,"datepicker",8),t.NdJ("dateChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.From=i)}),t.qZA()(),t.TgZ(16,"div")(17,"h6"),t._uU(18,"To"),t.qZA(),t.TgZ(19,"datepicker",9),t.NdJ("dateChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.To=i)}),t.qZA()()(),t.TgZ(20,"div",10)(21,"div")(22,"h6"),t._uU(23,"Quantity From - To"),t.qZA(),t.TgZ(24,"div",11)(25,"div",12)(26,"input",13),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.QuantityFrom=i)}),t.qZA()(),t.TgZ(27,"div",12)(28,"input",14),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.QuantityTo=i)}),t.qZA()()()(),t.TgZ(29,"div")(30,"h6"),t._uU(31,"State"),t.qZA(),t.TgZ(32,"ng-select",15),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.State=i)}),t.qZA()(),t.TgZ(33,"div")(34,"h6"),t._uU(35,"Rows"),t.qZA(),t.TgZ(36,"input",16),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.RowCount=i)}),t.qZA()(),t.TgZ(37,"div")(38,"h6"),t._uU(39,"Exclude Zero"),t.qZA(),t.TgZ(40,"radio-options",17),t.NdJ("modelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.ExcludeZero=i)}),t.qZA()()(),t.TgZ(41,"a",18),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.hideMore=!i.hideMore)}),t._uU(42),t._UZ(43,"i",19),t.qZA()()(),t.TgZ(44,"content")(45,"div",20)(46,"div",21)(47,"table",22)(48,"thead",23)(49,"tr"),t.YNc(50,te,2,0,"th",24),t.TgZ(51,"th",25),t._uU(52,"Outlet"),t.qZA(),t.TgZ(53,"th",25),t._uU(54,"Number"),t.qZA(),t.TgZ(55,"th",26),t._uU(56,"Date"),t.qZA(),t.TgZ(57,"th",27),t._uU(58,"Qty"),t.qZA(),t.TgZ(59,"th",28),t._uU(60,"Type"),t.qZA(),t.TgZ(61,"th",26),t._uU(62,"State"),t.qZA(),t.TgZ(63,"th"),t._uU(64,"Note"),t.qZA()()(),t.TgZ(65,"tbody"),t.YNc(66,de,19,23,"tr",29),t.qZA()()(),t.TgZ(67,"POS-complex-pagination",30),t.NdJ("jumpToPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("previousPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("nextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())}),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",e.getSelectedData().length>0),t.xp6(1),t.Q6J("ngIf",e.roleService.global.Export),t.xp6(1),t.Q6J("ngIf",e.roleService.adjustment.Create),t.xp6(7),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.From),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.To),t.xp6(1),t.Tol(e.hideMore?"show":""),t.xp6(6),t.Q6J("ngModel",e.pageData.Filter.QuantityFrom),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.QuantityTo),t.xp6(4),t.Q6J("items",e.pageData.Options.States)("ngModel",e.pageData.Filter.State),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeZero),t.xp6(2),t.Oqu(e.hideMore?"More":"Less"),t.xp6(8),t.Q6J("ngIf",e.roleService.adjustment.Delete),t.xp6(16),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("total",e.data.Data.length)("pageData",e.pageData)}}let ue=(()=>{class n extends C.n{constructor(e,o,i,s,p){super(e,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",o),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"csvConverter",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"matDialog",void 0),(0,a.Z)(this,"hideMore",!1),this.toastr=o,this.csvConverter=i,this.roleService=s,this.matDialog=p}openExportModal(){this.matDialog.open(B.H,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(g._W),t.Y36(D.O),t.Y36(u.N),t.Y36(k.uw))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-inventory-adjustment"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"items","ngModel","ngModelChange"],["placeholder","From","appearance","outline",3,"isFloatingLabel","date","dateChange"],["placeholder","To","appearance","outline",3,"isFloatingLabel","date","dateChange"],["container","",1,"collapse"],[1,"row","g-0"],[1,"col-6"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["type","text","autoNum","",1,"ms-3","form-control",3,"ngModel","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose an State",3,"items","ngModel","ngModelChange"],["type","text",3,"ngModel","ngModelChange"],[3,"model","modelChange"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px;",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","180px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"total","pageData","jumpToPage","previousPage","nextPage"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end"]],template:function(e,o){1&e&&t.YNc(0,pe,68,24,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[c.sg,c.O5,I.rH,S.p,l.Fj,l.Wl,l.JJ,l.On,P.QB,T.w9,_t.v,tt.P,Q.b,h.gM,c.JJ,c.uU]})),n})();var et=d(22863),me=d(11989),K=d(94768),b=d(67327),U=d(54850),nt=d(77579),gt=d(39841),ht=d(82722),q=d(39300),V=d(24351),R=d(18505),ft=d(86751),Ct=d(94601),xt=d(47634),_e=d(31906),vt=d(29521),$=d(42046),ge=d(50494),ot=d(98818),W=d(54004),Zt=d(61135),z=(()=>{return(n=z||(z={}))[n.ADJUST_DIFFERENCES=1]="ADJUST_DIFFERENCES",n[n.UPDATE_INVENTORY=2]="UPDATE_INVENTORY",z;var n})();class it{constructor(){(0,a.Z)(this,"CountedItems",void 0),(0,a.Z)(this,"Items",void 0),(0,a.Z)(this,"Order",void 0),(0,a.Z)(this,"OrderItems",void 0),this.Items=[],this.Order=new he}}class he{constructor(){(0,a.Z)(this,"AdjustedQuantity",void 0),(0,a.Z)(this,"Bin",void 0),(0,a.Z)(this,"Created",void 0),(0,a.Z)(this,"CreatorID",void 0),(0,a.Z)(this,"Date",void 0),(0,a.Z)(this,"EntityID",void 0),(0,a.Z)(this,"EntityName",void 0),(0,a.Z)(this,"ID",void 0),(0,a.Z)(this,"Modified",void 0),(0,a.Z)(this,"ModifierID",void 0),(0,a.Z)(this,"Note",void 0),(0,a.Z)(this,"Number",void 0),(0,a.Z)(this,"PIC",void 0),(0,a.Z)(this,"Quantity",void 0),(0,a.Z)(this,"ReviewDate",void 0),(0,a.Z)(this,"ReviewerID",void 0),(0,a.Z)(this,"StateID",void 0),(0,a.Z)(this,"StateLabel",void 0),(0,a.Z)(this,"TotalPrice",void 0),(0,a.Z)(this,"TypeID",void 0),(0,a.Z)(this,"TypeLabel",void 0),(0,a.Z)(this,"UnitCost",void 0),(0,a.Z)(this,"UnitPrice",void 0),this.ID=b.gT.GuidEmpty,this.EntityID="",this.StateID=1,this.TypeID=z.ADJUST_DIFFERENCES}}let bt=(()=>{class n{constructor(){(0,a.Z)(this,"_Data",new Zt.X(new it)),(0,a.Z)(this,"Data$",this._Data.asObservable())}get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275prov",t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})),n})();var at=d(50),fe=d(70852);let rt=(()=>{class n{constructor(e,o,i,s){(0,a.Z)(this,"adjustmentDataService",void 0),(0,a.Z)(this,"backEndService",void 0),(0,a.Z)(this,"factoryService",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"_notifyNewItem",new nt.x),(0,a.Z)(this,"notifyNewItem$",this._notifyNewItem.asObservable()),this.adjustmentDataService=e,this.backEndService=o,this.factoryService=i,this.toastr=s}getItemByCode(e,o){let i;return this.backEndService.getVarianByCode(e,o).pipe((0,W.U)(s=>{let p=this.patchVariantToItem(s);return i=p.Variant,p.UnitCost=i.UnitCost,p}))}getItemById(e,o){let i;return this.backEndService.getVariantById(e,o).pipe((0,W.U)(s=>{let p=this.patchVariantToItem(s);return i=p.Variant,p.UnitCost=i.UnitCost,p}))}patchVariantToItem(e){let o=new K.t;return e=this.factoryService.generateVariantObj(e),o.patchByVariant(e),o}updateCartItem(e){const o=this.adjustmentDataService.Data;o.Items=e,this.adjustmentDataService.pushNewValue(o)}addNewItem(e,o){let i=this.checkBehaviourRowItem(e,o);this.updateCartItem(i)}addCartItemByCode(e,o){this.backEndService.getVarianByCode(e,o).subscribe(i=>{this.createNewCartItem(i)})}createNewCartItem(e){let o=new K.t;o.patchByVariant(e),o.UnitPrice=e.UnitPrice,this.addNewItem(o)}removeItem(e){const o=this.adjustmentDataService.Data;o.Items.splice(e.index,1),this.updateCartItem(o.Items)}updateItem(e){const o=this.adjustmentDataService.Data.Items;o[e.index]=e.item,this.updateCartItem(o)}checkBehaviourRowItem(e,o=!1){let i=[];if(o)i=this.adjustmentDataService.Data.Items,this._notifyNewItem.next("NEW"),i.push(e);else{i=null!=this.adjustmentDataService.Data.Items?this.adjustmentDataService.Data.Items:Array();const s=i.findIndex(A=>A.VariantID===e.VariantID),p=e.Quantity;-1===s?(e.Quantity=b.gT.IsNotEmpty(p)?p:1,this._notifyNewItem.next("NEW"),i.push(e)):b.gT.IsNotEmpty(p)?i[s].Quantity+=p:i[s].Quantity++}return i}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.LFG(bt),t.LFG(at.M),t.LFG(fe.L),t.LFG(g._W))}),(0,a.Z)(n,"\u0275prov",t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})),n})();var Tt=d(58393),F=d(63165),It=d(54825),Ce=d(34782),yt=d(29766);function xe(n,r){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"ng-select",5),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.serials=i)})("change",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.onSelectSerial(i))}),t.ALo(2,"async"),t.qZA(),t.BQk()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("items",t.lcZ(2,3,e.serialOptions$))("ngModel",e.serials)("multiple",!0)}}function ve(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"p-chips",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.addSerial(i))})("onFocus",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onFocusAddSerial())})("onBlur",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onBlurAddSerial())}),t.qZA(),t.TgZ(2,"button",8),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.submitSerial())}),t._UZ(3,"i",9),t.TgZ(4,"strong",10),t._uU(5,"ADD"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("placeholder","E.g. Serial1 Serial2")("allowDuplicate",!1)("ngModel",e.serials)}}function Ze(n,r){if(1&n&&(t.ynx(0),t.YNc(1,xe,3,5,"ng-container",3),t.YNc(2,ve,6,3,"ng-template",null,4,t.W1O),t.BQk()),2&n){const e=t.MAs(3),o=t.oxw();t.xp6(1),t.Q6J("ngIf",o.isSellAdjustment)("ngIfElse",e)}}function be(n,r){1&n&&(t.ynx(0),t._UZ(1,"th",18),t.BQk())}function Te(n,r){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"td",20)(2,"i",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw().index,s=t.oxw(2);return t.KtG(s.onRemoveSerial(i))}),t.qZA()(),t.BQk()}}function Ie(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"tr"),t.YNc(1,Te,3,0,"ng-container",2),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td")(5,"input",19),t.NdJ("ngModelChange",function(i){const p=t.CHM(e).$implicit;return t.KtG(p.Qty=i)})("change",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.serialQtyChange())}),t.qZA()()()}if(2&n){const e=r.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!o.isDisabled),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Q6J("ngModel",e.Qty)("disabled",o.isDisabled)}}function ye(n,r){if(1&n&&(t.ynx(0),t.TgZ(1,"div",11)(2,"div",1)(3,"div",12)(4,"table",13)(5,"thead",14)(6,"tr"),t.YNc(7,be,2,0,"ng-container",2),t.TgZ(8,"th",15),t._uU(9,"Serial"),t.qZA(),t.TgZ(10,"th",16),t._uU(11,"Quantity"),t.qZA()()(),t.TgZ(12,"tbody"),t.YNc(13,Ie,6,4,"tr",17),t.qZA()()()()(),t.BQk()),2&n){const e=t.oxw();t.xp6(7),t.Q6J("ngIf",!e.isDisabled),t.xp6(6),t.Q6J("ngForOf",e.itemSerial)}}const Ae=function(n){return{"mb-8":n}};let Se=(()=>{class n{set cartItem(e){e&&(this._cartItem=e,this.itemSerial=e?.Serial?e?.Serial:[],this.isSellAdjustment=e.Quantity<0,this.isSellAdjustment&&this.initSerialOptionsObservable())}get cartItem(){return this._cartItem}constructor(e){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"entityID",void 0),(0,a.Z)(this,"isDisabled",void 0),(0,a.Z)(this,"_cartItem",void 0),(0,a.Z)(this,"cartItemChange",void 0),(0,a.Z)(this,"focusInputSerial",void 0),(0,a.Z)(this,"blurInputSerial",void 0),(0,a.Z)(this,"serials",[]),(0,a.Z)(this,"serialsChange",void 0),(0,a.Z)(this,"itemSerial",[]),(0,a.Z)(this,"isSellAdjustment",!1),(0,a.Z)(this,"serialOptions$",void 0),(0,a.Z)(this,"selectedSerialCode",void 0),this.httpService=e,this.cartItemChange=new t.vpe,this.blurInputSerial=new t.vpe,this.focusInputSerial=new t.vpe,this.serialsChange=new t.vpe}addSerial(e){this.serials=e,this.serialsChange.emit(this.serials)}serialQtyChange(){this.updateCartItem()}onRemoveSerial(e){this.itemSerial.splice(e,1)}onFocusAddSerial(){this.focusInputSerial.emit(!0)}onBlurAddSerial(){this.blurInputSerial.emit(!0)}submitSerial(){this.itemSerial=[...this.itemSerial,...this.generateSerialData()],this.serials=[],this.updateCartItem()}generateSerialData(){return this.serials.filter(i=>-1==this.itemSerial.findIndex(s=>s.Code==i)).map(i=>({Code:i,Qty:this.isSellAdjustment?-1:1}))}onSelectSerial(e){this.itemSerial=e.length>this.itemSerial.length?[...this.itemSerial,...this.generateSerialData()]:this.itemSerial.filter(o=>-1!==e.findIndex(i=>i.Serial==o.Code)),this.updateCartItem()}updateCartItem(){this.cartItem.Serial=this.itemSerial,this.cartItem.Quantity=this.cartItem.calculateSerialQty(),this.cartItem.generateNoteFromSerial(),this.cartItemChange.emit(this.cartItem)}initSerialOptionsObservable(){this.serialOptions$=this.httpService.post(U.W.GetVariantSerial,{entityID:this.entityID,variantID:this.cartItem.VariantID}).pipe((0,Ce.d)())}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["app-tab-serial"]],inputs:{entityID:"entityID",isDisabled:["disabled","isDisabled"],cartItem:"cartItem",serials:"serials"},outputs:{cartItemChange:"cartItemChange",focusInputSerial:"onFocus",blurInputSerial:"onBlur",serialsChange:"serialsChange"},decls:4,vars:5,consts:[[1,"row","mt-8",3,"ngClass"],[1,"col-12"],[4,"ngIf"],[4,"ngIf","ngIfElse"],["SELL_BUY",""],["bindLabel","Serial","appendTo","body","bindValue","Serial","placeholder","Select Serial",3,"items","ngModel","multiple","ngModelChange","change"],[1,"input-group","mb-3"],[3,"placeholder","allowDuplicate","ngModel","ngModelChange","onFocus","onBlur"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-3"],[1,"headings-font-family","h4","font-weight-bold"],[1,"row"],[1,"table-responsive"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],["type","text","placeholder","Serial Quantity","autoNum","",1,"form-control","text-end",3,"ngModel","disabled","ngModelChange","change"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t.YNc(2,Ze,4,2,"ng-container",2),t.qZA()(),t.YNc(3,ye,14,2,"ng-container",2)),2&e&&(t.Q6J("ngClass",t.VKq(3,Ae,!o.isDisabled)),t.xp6(2),t.Q6J("ngIf",!o.isDisabled),t.xp6(1),t.Q6J("ngIf",o.itemSerial.length>0))},dependencies:[c.mk,c.sg,c.O5,l.Fj,l.JJ,l.On,T.w9,Q.b,yt.cL,c.Ov],styles:["p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:520px;max-width:570px;border:1px solid #C8D3DF;border-top-right-radius:0;border-bottom-right-radius:0}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}"]})),n})();const st=function(n){return{selected:n}};function De(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",3),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onTabChange(i.modalItemState.INVENTORY))}),t._uU(1," Product "),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,st,e.modalItemState.INVENTORY==e.currentStateTab))}}function Me(n,r){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"a",3),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onTabChange(i.modalItemState.SERIAL))}),t._uU(2," Serial "),t.qZA(),t.BQk()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngClass",t.VKq(1,st,e.modalItemState.SERIAL==e.currentStateTab))}}function Oe(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",16)(1,"div",17)(2,"autocompleteV2",18),t.NdJ("onSelect",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.addItem(i))})("keyup.enter",function(i){return i.stopPropagation()})("onInputEnter",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.scanCode(i))}),t.qZA()()()}}function Pe(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",12)(1,"h5"),t._uU(2,"Cost"),t.qZA(),t.TgZ(3,"input",13),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.item.Cost=i)}),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.item.Cost)}}function we(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",8)(1,"div",17)(2,"h5",19),t._uU(3,"Note"),t.qZA(),t.TgZ(4,"POS-tinymce-editor",20),t.NdJ("valueChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.item.Note=i)}),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("value",e.item.Note)}}function Ne(n,r){if(1&n){const e=t.EpF();t.ynx(0),t.YNc(1,Oe,3,0,"div",7),t.TgZ(2,"div")(3,"div",8)(4,"div",9)(5,"h5"),t._uU(6,"Qty"),t.qZA(),t.TgZ(7,"input",10,11),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.item.Quantity=i)}),t.qZA()(),t.TgZ(9,"div",12)(10,"h5"),t._uU(11,"Price"),t.qZA(),t.TgZ(12,"input",13),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.item.Price=i)}),t.qZA()(),t.YNc(13,Pe,4,1,"div",14),t.qZA(),t.YNc(14,we,5,1,"div",15),t.qZA(),t.BQk()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.isEdit),t.xp6(6),t.Q6J("ngModel",e.item.Quantity)("disabled",e.isAdjustmentEdit&&e.isItemSerial),t.xp6(5),t.Q6J("ngModel",e.item.Price),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",!e.isItemSerial)}}function ke(n,r){1&n&&(t.ynx(0),t._UZ(1,"i",33),t.TgZ(2,"h6"),t._uU(3,"No Image"),t.qZA(),t.BQk())}function je(n,r){if(1&n&&t._UZ(0,"img",34),2&n){const e=t.oxw(2);t.Q6J("src",e.item.Variant.ThumbnailUrl,t.LSH)}}const Ue=function(){return["/menu/Products/Catalog/Variants/Info"]},qe=function(n){return{ID:n}};function Je(n,r){if(1&n&&(t.ynx(0),t.TgZ(1,"div",16)(2,"div",21)(3,"a",22),t.YNc(4,ke,4,0,"ng-container",23),t.YNc(5,je,1,1,"ng-template",null,24,t.W1O),t.qZA()(),t.TgZ(7,"div",25)(8,"div",26),t._UZ(9,"i",27),t.TgZ(10,"div",28),t._uU(11,"Inventory"),t.qZA()(),t.TgZ(12,"table",29)(13,"tbody")(14,"tr")(15,"td",30),t._uU(16," On Hand "),t.qZA(),t.TgZ(17,"td",31),t._uU(18),t.ALo(19,"number"),t.qZA()(),t.TgZ(20,"tr")(21,"td",32),t._uU(22," Allocated "),t.qZA(),t.TgZ(23,"td",31),t._uU(24),t.ALo(25,"number"),t.qZA()(),t.TgZ(26,"tr")(27,"td",32),t._uU(28,"Available"),t.qZA(),t.TgZ(29,"td",31),t._uU(30),t.ALo(31,"number"),t.qZA()(),t.TgZ(32,"tr")(33,"td",32),t._uU(34,"ROP"),t.qZA(),t.TgZ(35,"td",31),t._uU(36),t.ALo(37,"number"),t.qZA()(),t.TgZ(38,"tr")(39,"td",32),t._uU(40,"Max"),t.qZA(),t.TgZ(41,"td",31)(42,"span"),t._uU(43),t.ALo(44,"number"),t.qZA()()()()()()(),t.BQk()),2&n){const e=t.MAs(6),o=t.oxw();t.xp6(3),t.Q6J("routerLink",t.DdM(19,Ue))("queryParams",t.VKq(20,qe,null==o.item||null==o.item.Variant?null:o.item.Variant.ID)),t.xp6(1),t.Q6J("ngIf",null==(null==o.item||null==o.item.Variant?null:o.item.Variant.ThumbnailUrl))("ngIfElse",e),t.xp6(14),t.hij(" ",t.lcZ(19,9,o.onHand)," "),t.xp6(6),t.hij(" ",t.lcZ(25,11,o.allocated)," "),t.xp6(6),t.hij(" ",t.lcZ(31,13,o.onHand-o.allocated)," "),t.xp6(6),t.hij(" ",t.lcZ(37,15,o.rop)," "),t.xp6(7),t.Oqu(t.lcZ(44,17,o.max))}}function Ee(n,r){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"app-tab-serial",35),t.NdJ("cartItemChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.item=i)})("onFocus",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onFocusAddSerial())})("onBlur",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onBlurAddSerial())})("serialsChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.serials=i)}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("entityID",e.entityID)("cartItem",e.item)("serials",e.serials)("disabled",e.isAdjustmentEdit)}}let Qe=(()=>{class n{constructor(e,o,i,s,p,A){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"cartItemService",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"currentStateTab",void 0),(0,a.Z)(this,"modalItemState",ot.Y),(0,a.Z)(this,"onHand",void 0),(0,a.Z)(this,"allocated",void 0),(0,a.Z)(this,"rop",void 0),(0,a.Z)(this,"max",void 0),(0,a.Z)(this,"extraTitle",void 0),(0,a.Z)(this,"config",void 0),(0,a.Z)(this,"item",void 0),(0,a.Z)(this,"isEdit",!1),(0,a.Z)(this,"toggleInventory",!1),(0,a.Z)(this,"entityID",void 0),(0,a.Z)(this,"separatorKeysCodes",[vt.K5,vt.OC]),(0,a.Z)(this,"constants",b.gT),(0,a.Z)(this,"isFocusSerialInput",!1),(0,a.Z)(this,"isItemSerial",!1),(0,a.Z)(this,"serialOptions",void 0),(0,a.Z)(this,"queryInventoryOnOpen",void 0),(0,a.Z)(this,"adjusmentType",void 0),(0,a.Z)(this,"isAdjustmentEdit",!1),(0,a.Z)(this,"serials",[]),this.httpService=e,this.toastr=o,this.data=i,this.dialogRef=s,this.cartItemService=p,this.roleService=A,this.config=new $.O,this.entityID=i.entityID,this.queryInventoryOnOpen=!1,this.currentStateTab=ot.Y.INPUT,this.adjusmentType=i.adjustmentType,this.isAdjustmentEdit=this.data.isAdjustmentEdit,b.gT.IsNotEmpty(i.itemInfo)?(this.isEdit=!0,this.item=(0,ge.yE)(K.t,this.data.itemInfo.item),this.roleService.inventory.View&&this.requestUnitInStock(),this.config.title=this.item.Variant.Name,null!=this.item.Variant.Ordered&&(this.extraTitle=` Inventory: ${this.item.Variant.UnitsInStock}, Allocated: ${this.item.Variant.Ordered}`,this.toggleInventory=!0)):(this.item=new K.t,this.config.title="Add Item"),this.config.customWidth="650px"}ngOnInit(){this.isItemSerial=this.checkIsSerial()}onOk(){if(!this.isFocusSerialInput){if(this.generateSerial(),!this.item.checkMatchSerialWithQuantity())return void this.toastr.warning("Serial must be equal with the quantity","Warning!");this.isEdit?this.cartItemService.updateItem({item:this.item,index:this.data.itemInfo.index}):this.cartItemService.addNewItem(this.item,!0),this.dialogRef.close()}}generateSerial(){this.isItemSerial&&(!this.item?.Serial||0==this.item?.Serial?.length)&&(this.item.Quantity=this.serials.length,this.item.Serial=this.serials.map(e=>({Qty:1,Code:e})),this.item=b.gT.customSerialAsItemNote([this.item])[0])}addItem(e){this.cartItemService.getItemById(e,this.data.entityID).subscribe(o=>{this.item=o,this.config.title=this.item.Variant.Name})}onTabChange(e){this.currentStateTab=e,e==ot.Y.INVENTORY&&!this.queryInventoryOnOpen&&this.requestUnitInStock()}requestUnitInStock(){b.gT.IsEmpty(this.entityID)?this.toastr.error("Please select outlet before proceeding..",x.n.Error):this.httpService.post("/API/catalog/variant/GetInventoryByVariantID",JSON.stringify({id:this.item.Variant.ID,entityID:this.entityID})).subscribe(o=>{this.queryInventoryOnOpen=!0,this.onHand=o.OnHand,this.allocated=o.Allocated,this.rop=o.ROP,this.max=o.Max})}scanCode(e){this.cartItemService.getItemByCode(e,this.entityID).subscribe(o=>{this.item=o,this.config.title=this.item.Variant.Name,this.toggleInventory=!1})}onFocusAddSerial(){this.isFocusSerialInput=!0}onBlurAddSerial(){this.isFocusSerialInput=!1}checkIsSerial(){return null!=this.item.Variant&&4==this.item.Variant.TypeID}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(g._W),t.Y36(k.WI),t.Y36(k.so),t.Y36(rt),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-item"]],decls:13,vars:9,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"ngClass","click"],["class","btn btn-link",3,"ngClass","click",4,"ngIf"],[4,"ngIf"],[1,"container-fluid","mt-5"],["class","row",4,"ngIf"],[1,"row","mt-5"],[1,"col-auto"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModel","disabled","ngModelChange"],["qty",""],[1,"col-auto","ps-0"],["type","text","autoNum","",1,"mt-5","form-control",2,"width","100px",3,"ngModel","ngModelChange"],["class","col-auto ps-0",4,"ngIf"],["class","row mt-5",4,"ngIf"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","keyup.enter","onInputEnter"],[1,"mb-5"],["height","220px",3,"value","valueChange"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-muted"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],["SHOW_IMAGE",""],[1,"col-sm-6"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family","Roboto Slab"],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","text-start",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[3,"entityID","cartItem","serials","disabled","cartItemChange","onFocus","onBlur","serialsChange"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div")(5,"a",3),t.NdJ("click",function(){return o.onTabChange(o.modalItemState.INPUT)}),t._uU(6," Cart "),t.qZA(),t.YNc(7,De,2,3,"a",4),t.YNc(8,Me,3,3,"ng-container",5),t.qZA()()(),t.TgZ(9,"div",6),t.YNc(10,Ne,15,6,"ng-container",5),t.YNc(11,Je,45,22,"ng-container",5),t.YNc(12,Ee,2,4,"ng-container",5),t.qZA()()()),2&e&&(t.Q6J("config",o.config),t.xp6(5),t.Q6J("ngClass",t.VKq(7,st,o.modalItemState.INPUT==o.currentStateTab)),t.xp6(2),t.Q6J("ngIf",o.roleService.inventory.View&&(null==o.item||null==o.item.Variant?null:o.item.Variant.Name)),t.xp6(1),t.Q6J("ngIf",1==o.adjusmentType&&o.isItemSerial),t.xp6(2),t.Q6J("ngIf",o.modalItemState.INPUT==o.currentStateTab),t.xp6(1),t.Q6J("ngIf",o.modalItemState.INVENTORY==o.currentStateTab),t.xp6(1),t.Q6J("ngIf",o.modalItemState.SERIAL==o.currentStateTab))},dependencies:[c.mk,c.O5,I.rH,l.Fj,l.JJ,l.On,Tt.J,F.M,Q.b,It.V,Se,c.JJ],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}autocompleteV2[_ngcontent-%COMP%] mat-form-field input{padding:10px 15px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}"]})),n})(),Fe=(()=>{class n{constructor(e,o){(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"adjustmentData",void 0),(0,a.Z)(this,"config",void 0),this.data=e,this.dialogRef=o,this.config=new $.O,this.config.title="Note",this.adjustmentData=this.data}onOk(e){"Enter"!=e&&this.dialogRef.close()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(k.WI),t.Y36(k.so))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-note"]],decls:9,vars:3,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["type","text","placeholder","PIC",1,"text","w-100",3,"ngModel","ngModelChange"],[1,"row","mt-5"],["placeholder","Notes",2,"width","250px","height","120px",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(s){return o.onOk(s)})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),t.NdJ("ngModelChange",function(s){return o.adjustmentData.Order.PIC=s}),t.qZA()()(),t.TgZ(6,"div",5)(7,"div",3)(8,"textarea",6),t.NdJ("ngModelChange",function(s){return o.adjustmentData.Order.Note=s}),t.qZA()()()()()()),2&e&&(t.Q6J("config",o.config),t.xp6(5),t.Q6J("ngModel",o.adjustmentData.Order.PIC),t.xp6(3),t.Q6J("ngModel",o.adjustmentData.Order.Note))},dependencies:[l.Fj,l.JJ,l.On,F.M]})),n})(),Le=(()=>{class n{constructor(e,o,i){(0,a.Z)(this,"backEndService",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"adjustmentData",void 0),(0,a.Z)(this,"config",void 0),this.backEndService=e,this.data=o,this.dialogRef=i,this.config=new $.O,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0,this.adjustmentData=this.data}submit(e){this.adjustmentData.Items.forEach(o=>delete o.UnitPriceOriginal),this.adjustmentData.Order.StateID=e,this.backEndService.submitTransaction(this.adjustmentData,U.W.SubmitAdjustment).subscribe(o=>{this.dialogRef.close(o)})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(at.M),t.Y36(k.WI),t.Y36(k.so))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-submit"]],decls:9,vars:1,consts:[[3,"config","onCancel"],[1,"container-fluid",2,"width","500px","display","flex","justify-content","space-around"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-file-pen"],[1,"btn","btn-outline-secondary","ms-5",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid","fa-user-magnifying-glass"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2),t.NdJ("click",function(){return o.submit(1)}),t._UZ(4,"i",3),t._uU(5," Save as Draft "),t.qZA(),t.TgZ(6,"div",4),t.NdJ("click",function(){return o.submit(2)}),t._UZ(7,"i",5),t._uU(8," Submit for Review "),t.qZA()()()()),2&e&&t.Q6J("config",o.config)},dependencies:[F.M]})),n})();var At=d(23945),Ye=d(26128),He=d(241);function Ke(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.openOutletModal())}),t._UZ(2,"i",3)(3,"input",4),t.ALo(4,"limitTo"),t.qZA(),t.TgZ(5,"div",5)(6,"datepicker",6),t.NdJ("dateChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.adjustmentData.Order.Date=i)}),t.qZA()(),t.TgZ(7,"div",7),t._UZ(8,"i",8),t.TgZ(9,"input",9),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.adjustmentData.Order.Number=i)}),t.qZA()(),t.TgZ(10,"div",10)(11,"ng-select",11),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.adjustmentData.Order.TypeID=i)}),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("value",t.xi3(4,7,e.outletName,20))("placeholder",e.outletName),t.xp6(3),t.Q6J("date",e.adjustmentData.Order.Date),t.xp6(3),t.Q6J("ngModel",e.adjustmentData.Order.Number),t.xp6(2),t.Q6J("disabled",e.isEdit)("ngModel",e.adjustmentData.Order.TypeID)("items",e.adjustmentTypes)}}let Ve=(()=>{class n{constructor(){(0,a.Z)(this,"adjustmentData",void 0),(0,a.Z)(this,"adjustmentTypes",void 0),(0,a.Z)(this,"outletName",void 0),(0,a.Z)(this,"isEdit",void 0),(0,a.Z)(this,"onOpenOutletModal",new t.vpe)}openOutletModal(){this.onOpenOutletModal.emit()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-toolbar"]],inputs:{adjustmentData:"adjustmentData",adjustmentTypes:"adjustmentTypes",outletName:"outletName",isEdit:"isEdit"},outputs:{onOpenOutletModal:"onOpenOutletModal"},decls:1,vars:1,consts:[["class","row header g-0 py-4 border-bottom",4,"ngIf"],[1,"row","header","g-0","py-4","border-bottom"],[1,"col-auto",3,"click"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["readonly","",1,"outlet","cursor",3,"value","placeholder"],[1,"col-auto","me-5","date"],["appearance","fill","name","orderDate",3,"date","dateChange"],[1,"col-auto","me-5"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Order number",1,"fa-regular","fa-file-lines"],["type","text","placeholder","Adjustment Number",1,"number",2,"width","180px",3,"ngModel","ngModelChange"],[1,"col-auto","me-5","d-flex"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"outlet-multiple",2,"width","381px",3,"disabled","ngModel","items","ngModelChange"]],template:function(e,o){1&e&&t.YNc(0,Ke,12,10,"div",0),2&e&&t.Q6J("ngIf",o.adjustmentData)},dependencies:[c.O5,l.Fj,l.JJ,l.On,P.QB,T.w9,h.gM,v.OI],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px,#f9e79f 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:-moz-fit-content;height:fit-content}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#ffffff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:150px}.col-auto.supplier[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}"]})),n})(),Re=(()=>{class n{constructor(){(0,a.Z)(this,"onSubmit",new t.vpe),(0,a.Z)(this,"onOpenVoidModal",new t.vpe),(0,a.Z)(this,"onOpenNoteModal",new t.vpe)}submit(){this.onSubmit.emit()}openVoidModal(){this.onOpenVoidModal.emit()}openNoteModal(){this.onOpenNoteModal.emit()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-cart-action"]],outputs:{onSubmit:"onSubmit",onOpenVoidModal:"onOpenVoidModal",onOpenNoteModal:"onOpenNoteModal"},decls:10,vars:0,consts:[[1,"mt-5","d-flex","action-button","justify-content-between",2,"padding-left","120px"],[1,"btn","btn-gray","fw-bold","border","text-dark",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-note-sticky"],[1,"btn","btn-gray","fw-bold","border","text-dark","mx-5",2,"height","60px","width","120px",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"btn","btn-success","d-flex","justify-content-around","align-items-center",2,"height","60px","width","200px",3,"click"],[1,"fw-bold"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"button",1),t.NdJ("click",function(){return o.openNoteModal()}),t._UZ(2,"i",2),t._uU(3," NOTE "),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){return o.openVoidModal()}),t._UZ(5,"i",4),t._uU(6," VOID "),t.qZA(),t.TgZ(7,"button",5),t.NdJ("click",function(){return o.submit()}),t.TgZ(8,"span",6),t._uU(9,"PROCESS"),t.qZA()()())},styles:[".btn-gray[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#fff 0%,#eee 100%)}.action-button[_ngcontent-%COMP%]{width:550px}"]})),n})();function Ge(n,r){if(1&n&&(t.TgZ(0,"div",21)(1,"div",20),t._uU(2),t.qZA(),t.TgZ(3,"div",20),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&n){const e=r.$implicit;t.xp6(2),t.Oqu(e.Variant.Name),t.xp6(2),t.Oqu(t.lcZ(5,2,e.Quantity))}}const St=function(n){return{ID:n}},Be=function(){return["/menu/Adjustment/Adjustment/Archive/Info"]};let $e=(()=>{class n{constructor(){(0,a.Z)(this,"total",void 0),(0,a.Z)(this,"cartItems",void 0),(0,a.Z)(this,"completeInfo",void 0),(0,a.Z)(this,"onUndo",new t.vpe),(0,a.Z)(this,"onNewForm",new t.vpe)}undo(){this.onUndo.emit()}newForm(){this.onNewForm.emit()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-complete"]],inputs:{total:"total",cartItems:"cartItems",completeInfo:"completeInfo"},outputs:{onUndo:"onUndo",onNewForm:"onNewForm"},decls:31,vars:16,consts:[[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer","bg-light-gray","py-3"],["type","button","routerLink","/print/Adjustment","target","_blank",1,"btn","btn-light-gray",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col","text-start"],[1,"row","justify-content-between","mb-5"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),t._UZ(5,"i",5),t._uU(6,"Inventory Adjustment Complete"),t.qZA()(),t.TgZ(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),t.NdJ("click",function(){return o.newForm()}),t._uU(11,"New Adjustment (F8)"),t.qZA()()()(),t.TgZ(12,"div",10)(13,"a",11),t._UZ(14,"i",12),t._uU(15,"Print "),t.qZA()()()(),t.TgZ(16,"div",13)(17,"div",2)(18,"div",14)(19,"h2",15)(20,"a",16),t._uU(21),t.qZA()()(),t.TgZ(22,"div",17),t.YNc(23,Ge,6,4,"div",18),t.TgZ(24,"div",19)(25,"div",20),t._uU(26,"Total Quantity:"),t.qZA(),t.TgZ(27,"div",20),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA()()()()()()),2&e&&(t.xp6(13),t.Q6J("queryParams",t.VKq(11,St,o.completeInfo.OrderID)),t.xp6(7),t.Q6J("routerLink",t.DdM(13,Be))("queryParams",t.VKq(14,St,o.completeInfo.OrderID)),t.xp6(1),t.hij("#",o.completeInfo.InvoiceNumber,""),t.xp6(2),t.Q6J("ngForOf",o.cartItems),t.xp6(5),t.Oqu(t.lcZ(29,6,t.xi3(30,8,o.cartItems,"Quantity"))))},dependencies:[c.sg,I.rH,c.JJ,v.qU]})),n})();var X=d(41206),L=d(28255),We=d(67376);const ze=["cartContainer"];function Xe(n,r){1&n&&t._UZ(0,"th",19)}function tn(n,r){1&n&&t._UZ(0,"th",20)}function en(n,r){1&n&&(t.TgZ(0,"th",21),t._uU(1,"Cost"),t.qZA())}function nn(n,r){1&n&&(t.TgZ(0,"th",22),t._uU(1,"Total"),t.qZA())}function on(n,r){if(1&n&&(t.TgZ(0,"td")(1,"small"),t._uU(2),t.qZA()()),2&n){const e=t.oxw().index;t.xp6(2),t.hij("",e+1,".")}}function an(n,r){if(1&n&&(t.TgZ(0,"i"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",e.Variant.CategoryName," ")}}function rn(n,r){if(1&n&&(t.ynx(0),t._UZ(1,"span",30),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("innerHTML",e.Note,t.oJD)}}function sn(n,r){if(1&n&&(t.TgZ(0,"td",28),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu("null"!=e.Variant.UOM?e.Variant.UOMName:"")}}function cn(n,r){if(1&n&&(t.TgZ(0,"td",28),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function ln(n,r){if(1&n&&(t.TgZ(0,"td",28),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost*e.Quantity))}}function dn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"tr",23),t.NdJ("click",function(){const i=t.CHM(e),s=i.$implicit,p=i.index,A=t.oxw();return t.KtG(A.onSelect({item:s,index:p}))})("contextmenu",function(i){const s=t.CHM(e),p=s.$implicit,A=s.index,ut=t.oxw();return t.KtG(ut.onContextMenu(i,p,A))}),t.TgZ(1,"td",24)(2,"i",25),t.NdJ("click",function(){const i=t.CHM(e),s=i.$implicit,p=i.index,A=t.oxw();return t.KtG(A.onRemove({item:s,index:p}))}),t.qZA()(),t.YNc(3,on,3,1,"td",26),t.TgZ(4,"td")(5,"span",27),t._uU(6),t.qZA(),t.YNc(7,an,2,1,"i",26),t.YNc(8,rn,2,1,"ng-container",26),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td",28),t._uU(12),t.ALo(13,"number"),t.TgZ(14,"span"),t._uU(15),t.qZA()(),t.YNc(16,sn,2,1,"td",29),t.YNc(17,cn,3,3,"td",29),t.YNc(18,ln,3,3,"td",29),t.qZA()}if(2&n){const e=r.$implicit,o=t.oxw();t.xp6(3),t.Q6J("ngIf",o.appConfig.ModuleSell.Grid.RowNumberVisible),t.xp6(3),t.Oqu(e.Variant.Name),t.xp6(1),t.Q6J("ngIf",o.appConfig.ModuleSell.Grid.CategoryVisible),t.xp6(1),t.Q6J("ngIf",e.Note),t.xp6(2),t.Oqu(e.Variant.Code),t.xp6(2),t.hij(" ",t.lcZ(13,10,e.Quantity),""),t.xp6(3),t.Oqu(e.UnitQuantity>1?"@"+e.UnitQuantity:""),t.xp6(1),t.Q6J("ngIf",o.appConfig.ModuleSell.Grid.UOMVisible),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost)}}function pn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",31),t.NdJ("click",function(){const s=t.CHM(e).item,p=t.oxw();return t.KtG(p.onReverse(s,!0))}),t._uU(1,"Return"),t.qZA(),t.TgZ(2,"button",31),t.NdJ("click",function(){const s=t.CHM(e).item,p=t.oxw();return t.KtG(p.onReverse(s,!1))}),t._uU(3,"Purchase"),t.qZA()}}let un=(()=>{class n{onContextMenu(e,o,i){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",o.Index=i,this.contextMenu.menuData={item:o},this.contextMenu.openMenu()}onDrop(e){(0,X.bA)(this.cartItems,e.previousIndex,e.currentIndex),this.cartItemService.updateCartItem(this.cartItems),this.onDragItem.emit(this.cartItems),this.cartItemsChange.emit(this.cartItems)}constructor(e,o,i){(0,a.Z)(this,"loadService",void 0),(0,a.Z)(this,"cartItemService",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"cartItems",void 0),(0,a.Z)(this,"cartItemsChange",void 0),(0,a.Z)(this,"onSelectItem",void 0),(0,a.Z)(this,"onReturnItem",void 0),(0,a.Z)(this,"onPurchaseItem",void 0),(0,a.Z)(this,"onRemoveItem",void 0),(0,a.Z)(this,"onDragItem",void 0),(0,a.Z)(this,"entities",void 0),(0,a.Z)(this,"cartContainer",void 0),(0,a.Z)(this,"contextMenu",void 0),(0,a.Z)(this,"contextMenuPosition",{x:"0px",y:"0px"}),(0,a.Z)(this,"destroy$",void 0),(0,a.Z)(this,"appConfig",void 0),this.loadService=e,this.cartItemService=o,this.roleService=i,this.cartItems=[],this.destroy$=new nt.x,this.onSelectItem=new t.vpe,this.onReturnItem=new t.vpe,this.onPurchaseItem=new t.vpe,this.onRemoveItem=new t.vpe,this.onDragItem=new t.vpe,this.cartItemsChange=new t.vpe,this.cartItemService.notifyNewItem$.pipe((0,q.h)(s=>b.gT.IsNotEmpty(s))).subscribe({next:s=>{setTimeout(()=>{this.cartContainer.nativeElement.scrollTop=this.cartContainer.nativeElement.scrollHeight},1)}})}ngOnInit(){this.initAppConfig()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initAppConfig(){this.appConfig=this.loadService.Data.AppConfigJSON,this.entities=this.loadService.Data.Entities}onRemove(e){this.onRemoveItem.emit(e)}onSelect(e){this.onSelectItem.emit(e)}onReverse(e,o){o?(e.Quantity>0&&(e.Quantity=-1*e.Quantity),this.onReturnItem.emit(e)):(e.Quantity<0&&(e.Quantity=-1*e.Quantity),this.onPurchaseItem.emit(e))}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(At.O),t.Y36(rt),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-cart-display"]],viewQuery:function(e,o){if(1&e&&(t.Gf(ze,5),t.Gf(L.p6,7)),2&e){let i;t.iGM(i=t.CRH())&&(o.cartContainer=i.first),t.iGM(i=t.CRH())&&(o.contextMenu=i.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem",onDragItem:"onDragItem"},decls:24,vars:10,consts:[[1,"cashier"],[1,"row","g-0","cart-table","border-bottom"],["cdkScrollable","",1,"col"],["cartContainer",""],[1,"table"],[1,"border-start-0"],[2,"width","18px"],["style","width: 36px",4,"ngIf"],[1,"text-start",2,"width","250px"],[2,"cursor","pointer","width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 0.75rem",4,"ngIf"],["class","text-end","style","width: 90px;",4,"ngIf"],["class","text-end","style","width: 85px;",4,"ngIf"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"click","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["contextMenu","matMenu"],["matMenuContent",""],[2,"width","36px"],[1,"text-end",2,"width","0.75rem"],[1,"text-end",2,"width","90px"],[1,"text-end",2,"width","85px"],["cdkDrag","",1,"item",3,"click","contextmenu"],[1,"cursor"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"click"],[4,"ngIf"],[1,"d-block"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHTML"],["mat-menu-item","",3,"click"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2,3)(4,"table",4)(5,"thead")(6,"tr",5),t._UZ(7,"th",6),t.YNc(8,Xe,1,0,"th",7),t.TgZ(9,"th",8),t._uU(10,"Item"),t.qZA(),t.TgZ(11,"th",9),t._uU(12,"Code"),t.qZA(),t.TgZ(13,"th",10),t._uU(14,"Qty"),t.qZA(),t.YNc(15,tn,1,0,"th",11),t.YNc(16,en,2,0,"th",12),t.YNc(17,nn,2,0,"th",13),t.qZA()(),t.TgZ(18,"tbody",14),t.NdJ("cdkDropListDropped",function(s){return o.onDrop(s)}),t.YNc(19,dn,19,12,"tr",15),t.qZA()()()(),t._UZ(20,"div",16),t.TgZ(21,"mat-menu",null,17),t.YNc(23,pn,4,0,"ng-template",18),t.qZA()()),2&e){const i=t.MAs(22);t.xp6(8),t.Q6J("ngIf",o.appConfig.ModuleSell.Grid.RowNumberVisible),t.xp6(7),t.Q6J("ngIf",o.appConfig.ModuleSell.Grid.UOMVisible),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Q6J("ngForOf",o.cartItems),t.xp6(1),t.Udp("left",o.contextMenuPosition.x)("top",o.contextMenuPosition.y),t.Q6J("matMenuTriggerFor",i)}},dependencies:[c.sg,c.O5,We.PQ,L.VK,L.OP,L.KA,L.p6,X.Wj,X.Zt,h.gM,c.JJ],styles:[".cashier[_ngcontent-%COMP%]{width:550px;max-width:37rem;min-width:33rem}div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#FBFBF7}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:9px 5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0}.cdk-drag-preview[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.item[_ngcontent-%COMP%]:last-child{border:none}.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]})),n})();const mn=function(){return["/menu/Adjustment/Adjustment/Archive"]};function _n(n,r){1&n&&(t.TgZ(0,"a",4),t._uU(1,"Cancel"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,mn))}function gn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",11)(1,"POS-cart-header",12),t.NdJ("onCreateItem",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.selectItem())})("onOpenUploadModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openUploadModal())})("onAddItem",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.addItem(i))})("onScanCode",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.onScanBarcode(i))}),t.qZA(),t.TgZ(2,"POS-cart-display",13),t.NdJ("onRemoveItem",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.removeItem(i))})("onSelectItem",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.selectItem(i))})("onDragItem",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.saveItemAfterDrag(i))}),t.qZA(),t.TgZ(3,"POS-cart-action",14),t.NdJ("onSubmit",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.submit())})("onOpenVoidModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openVoidModal())})("onOpenNoteModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openNoteModal())}),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("cartItems",e.cartItems)("isUpload",!0),t.xp6(1),t.Q6J("cartItems",e.cartItems)}}function hn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"POS-toolbar",6),t.NdJ("onOpenOutletModal",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.openOutletModal())}),t.qZA(),t.TgZ(2,"div",7)(3,"div",8),t._UZ(4,"pos-quick-key",9),t.qZA(),t.YNc(5,gn,4,3,"div",10),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("adjustmentData",e.adjustmentData)("adjustmentTypes",e.adjustmentTypes)("outletName",e.outletName)("isEdit",e.isEdit),t.xp6(3),t.Q6J("quickKeyId",e.quickKeyId)("outletID",e.outletID),t.xp6(1),t.Q6J("ngIf",e.adjustmentStorage)}}function fn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",15)(1,"POS-complete",16),t.NdJ("onUndo",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.undo())})("onNewForm",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.newForm())}),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("total",e.total)("cartItems",e.cartItems)("completeInfo",e.completeInfo)}}let Cn=(()=>{class n extends et.M{constructor(e,o,i,s,p,A,ut,ti,ei,ni){super(e),(0,a.Z)(this,"adjustmentDataService",void 0),(0,a.Z)(this,"firstLoadService",void 0),(0,a.Z)(this,"matDialog",void 0),(0,a.Z)(this,"backEndService",void 0),(0,a.Z)(this,"quickKeyService",void 0),(0,a.Z)(this,"cartItemService",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"router",void 0),(0,a.Z)(this,"route",void 0),(0,a.Z)(this,"quickKeyId",void 0),(0,a.Z)(this,"adjustmentData",void 0),(0,a.Z)(this,"adjustmentStorage",void 0),(0,a.Z)(this,"adjustmentTypes",void 0),(0,a.Z)(this,"outletID",b.gT.GuidEmpty),(0,a.Z)(this,"outletName","Choose an Outlet"),(0,a.Z)(this,"entities",void 0),(0,a.Z)(this,"cartItems",void 0),(0,a.Z)(this,"completeInfo",void 0),(0,a.Z)(this,"isComplete",void 0),(0,a.Z)(this,"total",0),(0,a.Z)(this,"destroy$",void 0),(0,a.Z)(this,"isEdit",void 0),this.adjustmentDataService=o,this.firstLoadService=i,this.matDialog=s,this.backEndService=p,this.quickKeyService=A,this.cartItemService=ut,this.toastr=ti,this.router=ei,this.route=ni,this.destroy$=new nt.x,this.adjustmentDataService.Data$.pipe((0,ht.R)(this.destroy$)).subscribe(J=>{this.adjustmentData=J,this.fillCartItems()}),this.quickKeyService.onSelectQuickeyItem$.pipe((0,ht.R)(this.destroy$),(0,q.h)(J=>b.gT.IsNotEmpty(J.id)),(0,V.b)(J=>this.cartItemService.getItemById(J.id,J.entityID))).subscribe(J=>this.cartItemService.addNewItem(J))}handleF8(){this.isComplete&&this.newForm()}ngOnInit(){this.initLoadForm()}ngOnDestroy(){this.adjustmentDataService.pushNewValue(new it),this.quickKeyService.Data=new me.AM,this.destroy$.next(!0),this.destroy$.complete()}initLoadForm(){this.menuData$.subscribe(()=>{let e=this.adjustmentData.Order.ID;b.gT.IsEmpty(e)&&b.gT.IsNotEmpty(this.route.snapshot.queryParams.ID)&&(e=this.route.snapshot.queryParams.ID,this.isEdit=!0),this.firstLoadService.getStorage(U.W.LoadFormAdjustment,e,this.adjustmentData.Order.EntityID).subscribe(i=>{this.fillData(i),b.gT.IsEmpty(e)&&this.entities.length>1?this.openOutletModal():1==this.entities.length&&(0,gt.a)([this.backEndService.generateNumber(this.outletID,U.W.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,U.W.GetQuickKey)]).subscribe(([s,p])=>{this.adjustmentData.Order.Number=s.Number,this.initQuickKey(p)})})})}fillData(e){if(this.adjustmentStorage=e,this.isEdit&&(this.menuData.H=`Edit Adjustment #${e.Data.Order.Number}`),this.firstLoadService.pageState=_e.U.AdjustmentPage,this.entities=this.adjustmentStorage.Entities,1==this.entities.length&&(this.outletID=this.entities[0].ID,this.outletName=this.entities[0].Name,this.adjustmentData.Order.EntityID=this.outletID),this.adjustmentTypes=this.adjustmentStorage.AdjustmentTypes,this.adjustmentData.Order.TypeID=this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType,b.gT.IsEmpty(this.adjustmentData.Order.Date)&&(this.adjustmentData.Order.Date=this.adjustmentStorage.ServerTime.toString()),b.gT.IsNotEmpty(e.Data)){this.adjustmentDataService.pushNewValue(e.Data),this.outletID=e.Data.Order.EntityID;const o=this.entities.find(i=>i.ID==this.outletID);this.outletName=o.Name,this.quickKeyId=o.QuickKeyTemplateID,this.backEndService.getQuickKey(this.outletID,U.W.GetQuickKey).subscribe(i=>this.initQuickKey(i))}}fillCartItems(){let e;this.cartItems=[],this.adjustmentData.Items.forEach(o=>{e=new K.t,o.Variant.Serial=o.Serial,e.Quantity=o.Quantity,e.patchByVariant(o.Variant),this.cartItems.push(e)})}openOutletModal(){this.isEdit||this.matDialog.open(ft.X,{data:{Entities:this.entities}}).afterClosed().pipe((0,q.h)(e=>b.gT.IsNotEmpty(e)),(0,R.b)(e=>{this.outletName=e.outlet.Name,this.outletID=e.outlet.ID,this.quickKeyId=e.outlet.QuickKeyTemplateID,this.adjustmentData.Order.EntityID=this.outletID}),(0,V.b)(()=>(0,gt.a)([this.backEndService.generateNumber(this.outletID,U.W.AdjustmentGenerateNumber),this.backEndService.getQuickKey(this.outletID,U.W.GetQuickKey)]))).subscribe(([e,o])=>{this.adjustmentData.Order.Number=e.Number,this.initQuickKey(o)})}initQuickKey(e){this.quickKeyService.Data=e,this.quickKeyService.EntityID=this.outletID}saveItemAfterDrag(e){this.cartItemService.updateCartItem(e)}removeItem(e){this.cartItemService.removeItem(e)}selectItem(e){this.matDialog.open(Qe,{data:{itemInfo:e,entityID:this.outletID,adjustmentType:this.adjustmentData.Order.TypeID,isAdjustmentEdit:this.isEdit}})}addItem(e){this.cartItemService.getItemById(e,this.outletID).subscribe(o=>this.cartItemService.addNewItem(o))}onScanBarcode(e){this.cartItemService.addCartItemByCode(e,this.outletID)}openUploadModal(){this.matDialog.open(Ct.h).afterClosed().pipe((0,q.h)(e=>b.gT.IsNotEmpty(e)&&e.length>0)).subscribe(e=>e.forEach(o=>this.cartItemService.addNewItem(o,!0)))}openNoteModal(){this.matDialog.open(Fe,{data:this.adjustmentData})}openVoidModal(){this.matDialog.open(xt.s).afterClosed().pipe((0,q.h)(e=>e)).subscribe(()=>{const e=this.adjustmentData.Order.Number;this.adjustmentDataService.pushNewValue(new it),this.adjustmentData.Order.EntityID=this.outletID,this.adjustmentData.Order.Number=e,this.initLoadForm()})}submit(){if(b.gT.IsEmpty(this.adjustmentData.Order.EntityID))return this.toastr.error("Please select outlet before proceeding..",x.n.Error),void this.openOutletModal();0!=this.cartItems.length?b.gT.IsEmpty(this.adjustmentData.Order.Number)?this.toastr.error("Number cannot be empty.",x.n.Error):1===this.adjustmentStorage.AppConfigJSON.ModuleAdjustment.Basic.Workflow?(this.adjustmentData.Order.StateID=4,this.adjustmentData.Items.forEach(e=>delete e.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,U.W.SubmitAdjustment).subscribe(e=>{this.completeInfo=e,this.isComplete=!0,this.adjustmentData.Order.ID=e.OrderID,this.calculateTotal()})):this.isEdit?(this.adjustmentData.Items.forEach(e=>delete e.UnitPriceOriginal),this.backEndService.submitTransaction(this.adjustmentData,U.W.SubmitAdjustment).subscribe(e=>{this.completeInfo=e,this.isComplete=!0,this.adjustmentData.Order.ID=e.OrderID,this.calculateTotal()})):this.matDialog.open(Le,{data:this.adjustmentData}).afterClosed().pipe((0,q.h)(e=>b.gT.IsNotEmpty(e))).subscribe(e=>{this.completeInfo=e,this.isComplete=!0,this.adjustmentData.Order.ID=e.OrderID,this.calculateTotal()}):this.toastr.error("You must have at least one item.",x.n.Error)}calculateTotal(){this.cartItems.forEach(e=>this.total+=e.Cost)}undo(){this.isComplete=!1,this.initLoadForm()}newForm(){this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]).then(()=>window.location.reload())}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(bt),t.Y36(At.O),t.Y36(k.uw),t.Y36(at.M),t.Y36(Ye.w),t.Y36(rt),t.Y36(g._W),t.Y36(I.F0),t.Y36(I.gz))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-new-inventory-adjustment"]],hostBindings:function(e,o){1&e&&t.NdJ("keydown.F8",function(){return o.handleF8()},!1,t.Jf7)},features:[t.qOj],decls:6,vars:6,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","container-fluid",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid"],[3,"adjustmentData","adjustmentTypes","outletName","isEdit","onOpenOutletModal"],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[3,"quickKeyId","outletID"],["class","col-auto cart ms-5",4,"ngIf"],[1,"col-auto","cart","ms-5"],[3,"cartItems","isUpload","onCreateItem","onOpenUploadModal","onAddItem","onScanCode"],[3,"cartItems","onRemoveItem","onSelectItem","onDragItem"],[3,"onSubmit","onOpenVoidModal","onOpenNoteModal"],[1,"container-fluid","mt-5"],[3,"total","cartItems","completeInfo","onUndo","onNewForm"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0)(1,"actions"),t.YNc(2,_n,2,2,"a",1),t.qZA(),t.TgZ(3,"content"),t.YNc(4,hn,6,7,"div",2),t.YNc(5,fn,2,3,"div",3),t.qZA()()),2&e&&(t.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",o.menuData),t.xp6(2),t.Q6J("ngIf",!o.isComplete),t.xp6(2),t.Q6J("ngIf",!o.isComplete),t.xp6(1),t.Q6J("ngIf",o.isComplete))},dependencies:[c.O5,I.rH,S.p,He.w,M.H,Ve,Re,$e,un]})),n})(),xn=(()=>{class n{constructor(e){(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"pageNumber",1),(0,a.Z)(this,"pageSize",100),(0,a.Z)(this,"config",void 0),this.dialogRef=e,this.config=new $.O,this.config.title="Export Adjustment Report",this.config.customWidth="382px"}onOk(){this.dialogRef.close({pageNumber:this.pageNumber,pageSize:this.pageSize})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(k.so))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-export-report"]],decls:11,vars:3,consts:[[3,"config","onCancel","onClose","onOk"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","name","pageNumber","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","pageNumber"],["type","text","name","pageSize","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","pageSize"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()})("onOk",function(){return o.onOk()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),t.NdJ("ngModelChange",function(s){return o.pageNumber=s}),t.qZA(),t.TgZ(5,"label",4),t._uU(6,"Page Number"),t.qZA()(),t.TgZ(7,"div",2)(8,"input",5),t.NdJ("ngModelChange",function(s){return o.pageSize=s}),t.qZA(),t.TgZ(9,"label",6),t._uU(10,"Page Size"),t.qZA()()()()()),2&e&&(t.Q6J("config",o.config),t.xp6(4),t.Q6J("ngModel",o.pageNumber),t.xp6(4),t.Q6J("ngModel",o.pageSize))},dependencies:[l.Fj,l.JJ,l.On,F.M,Q.b]})),n})();var vn=d(11365),Zn=d(75026);let ct=(()=>{class n{constructor(e){(0,a.Z)(this,"http",void 0),(0,a.Z)(this,"currentUntilPage",void 0),(0,a.Z)(this,"toggleFetchTotalData",void 0),(0,a.Z)(this,"totalData",void 0),(0,a.Z)(this,"pageNumber",void 0),(0,a.Z)(this,"isNextBtnDisabled",void 0),(0,a.Z)(this,"isOnLastPage",void 0),this.http=e}calcCurrentUntilPage(e,o,i){this.currentUntilPage=e*(o-1)+i}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,o,i){this.isNextBtnDisabled=0==i||!(i<e*o)}setTotalData(e,o,i){this.toggleFetchTotalData=!0,this.http.post(e,o).pipe((0,R.b)(i)).subscribe(s=>this.totalData=s)}setPaginationState(e,o,i){this.calcCurrentUntilPage(e,o,i),this.setPageNumber(o),this.setPaginationButtonState(e,o,i)}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.LFG(Z.O))}),(0,a.Z)(n,"\u0275prov",t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})),n})(),bn=(()=>{class n{constructor(e,o){(0,a.Z)(this,"state",void 0),(0,a.Z)(this,"filter$",new Zt.X(void 0)),(0,a.Z)(this,"fetchData$",void 0),(0,a.Z)(this,"fetchLoader$",void 0),this.state=o,this.fetchData$=i=>s=>e.post(i,s).pipe((0,W.U)(p=>p.Data),(0,R.b)(p=>this.state.setPaginationState(s.RowCount,s.PageNumber,p.length))),this.fetchLoader$=i=>()=>e.post(i)}getLoader$(e,o){return e.pipe((0,V.b)(this.fetchLoader$(o)),(0,R.b)(i=>this.filter$.next(i.Filter)))}getInfiniteListData$(e){return this.filter$.pipe((0,q.h)(o=>void 0!==o),(0,V.b)(this.fetchData$(e)),(0,vn.M)(this.filter$),(0,R.b)(([o,i])=>this.state.setPaginationState(i.RowCount,i.PageNumber,o.length)),(0,Zn.R)((o,i)=>{const[s,p]=o,[A]=i;return 1==p.PageNumber?[A,p]:[s.concat(A),p]}),(0,W.U)(([o])=>o))}filterFromFirstPage(e){e.PageNumber=1,this.filter$.next(e)}nextPage(e){e.PageNumber+=1,this.filter$.next(e)}fetchTotalData(e,o){this.state.setTotalData(e,o)}fetchAllData(e,o){this.state.setTotalData(e,o,i=>{const s={...o};s.PageNumber=1,s.RowCount=i,this.filter$.next(s)})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.LFG(Z.O),t.LFG(ct))}),(0,a.Z)(n,"\u0275prov",t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})),n})();function Tn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"span",8),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onFetchTotalData())}),t.TgZ(1,"i",9),t._uU(2,"?"),t.qZA()()}}function In(n,r){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(t.lcZ(2,1,e.state.totalData))}}function yn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onNextPage())}),t._UZ(1,"i",11),t._uU(2," Next"),t.qZA()}}function An(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",12),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onConcatAllData())}),t._UZ(1,"i",13),t._uU(2," Show All"),t.qZA()}}let Sn=(()=>{class n{constructor(e){(0,a.Z)(this,"state",void 0),(0,a.Z)(this,"fetchTotalData",new t.vpe),(0,a.Z)(this,"fetchAllData",new t.vpe),(0,a.Z)(this,"nextPage",new t.vpe),this.state=e}ngOnInit(){}onFetchTotalData(){this.fetchTotalData.emit()}onNextPage(){this.nextPage.emit()}onConcatAllData(){this.fetchAllData.emit()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(ct))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-infinite-list"]],outputs:{fetchTotalData:"fetchTotalData",fetchAllData:"fetchAllData",nextPage:"nextPage"},decls:11,vars:8,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.ALo(4,"number"),t.YNc(5,Tn,3,0,"span",3),t.YNc(6,In,3,3,"span",4),t._uU(7),t.qZA()(),t.TgZ(8,"div",5),t.YNc(9,yn,3,0,"a",6),t.YNc(10,An,3,0,"a",7),t.qZA()()),2&e&&(t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,o.state.currentUntilPage)," of "),t.xp6(2),t.Q6J("ngIf",!o.state.toggleFetchTotalData),t.xp6(1),t.Q6J("ngIf",o.state.toggleFetchTotalData),t.xp6(1),t.hij(" records ~ ",o.state.pageNumber," Page "),t.xp6(2),t.Q6J("ngIf",o.state.isNextBtnDisabled&&!o.state.isOnLastPage),t.xp6(1),t.Q6J("ngIf",o.state.isNextBtnDisabled&&!o.state.isOnLastPage))},dependencies:[c.O5,c.JJ]})),n})(),Dn=(()=>{class n{}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275mod",t.oAB({type:n})),(0,a.Z)(n,"\u0275inj",t.cJS({imports:[c.ez]})),n})();function Mn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",17),t.NdJ("click",function(){t.CHM(e);const i=t.oxw().ngIf,s=t.oxw();return t.KtG(s.openExportModal(i.Filter))}),t._UZ(1,"i",18),t._uU(2," Export"),t.qZA()}}function On(n,r){1&n&&(t.TgZ(0,"th",19),t._uU(1,"@ Cost"),t.qZA())}function Pn(n,r){1&n&&(t.TgZ(0,"th",19),t._uU(1,"@ Price"),t.qZA())}function wn(n,r){if(1&n&&(t.TgZ(0,"th",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.UnitCost),"")}}function Nn(n,r){if(1&n&&(t.TgZ(0,"th",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.UnitPrice),"")}}function kn(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"th",29),t._uU(2),t.qZA(),t.TgZ(3,"th",30),t._uU(4),t.qZA(),t.TgZ(5,"th",31),t._uU(6),t.ALo(7,"number"),t.qZA(),t.YNc(8,wn,3,3,"th",32),t.YNc(9,Nn,3,3,"th",32),t.qZA()),2&n){const e=r.$implicit,o=t.oxw(3);t.xp6(2),t.hij(" ",e.VariantName,""),t.xp6(2),t.hij(" ",e.VariantCode,""),t.xp6(2),t.Oqu(t.lcZ(7,5,e.Quantity)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.UnitPriceEditor)}}const jn=function(){return["/menu/Adjustment/Adjustment/Archive/Info"]},Un=function(n){return{ID:n}};function qn(n,r){if(1&n&&(t.TgZ(0,"div")(1,"div",20)(2,"div",21)(3,"a",22),t._UZ(4,"span",23),t.ALo(5,"date"),t._UZ(6,"small",24),t.ALo(7,"date"),t.TgZ(8,"small",25),t._uU(9),t.qZA()()()(),t.TgZ(10,"div")(11,"strong",26),t._uU(12),t.qZA(),t._UZ(13,"div",27),t.qZA(),t.TgZ(14,"table",28)(15,"tbody"),t.YNc(16,kn,10,7,"tr",15),t.qZA()()()),2&n){const e=r.$implicit;t.xp6(3),t.Q6J("routerLink",t.DdM(14,jn))("queryParams",t.VKq(15,Un,e.ID)),t.xp6(1),t.Q6J("innerHTML",e.EntityName+" #"+e.Number+" - "+t.xi3(5,8,e.Created,"dd MMM yyyy"),t.oJD),t.xp6(2),t.Q6J("innerHTML","("+t.xi3(7,11,e.Created,"HH:mm")+")",t.oJD),t.xp6(3),t.hij(" ",e.PIC,""),t.xp6(3),t.hij("[Q:",e.Quantity,"]"),t.xp6(1),t.Q6J("innerHTML",e.Note,t.oJD),t.xp6(3),t.Q6J("ngForOf",e.Items)}}function Jn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){const p=t.CHM(e).ngIf;return t.KtG(p.Filter.Number=i)})("onSubmit",function(){const s=t.CHM(e).ngIf,p=t.oxw();return t.KtG(p.search(s.Filter))}),t.TgZ(1,"actions"),t.YNc(2,Mn,3,0,"button",2),t.qZA(),t.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),t._uU(8,"Outlets"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(i){const p=t.CHM(e).ngIf;return t.KtG(p.Filter.EntityID=i)}),t.qZA()(),t.TgZ(10,"div")(11,"h6"),t._uU(12,"From"),t.qZA(),t.TgZ(13,"datepicker",6),t.NdJ("dateChange",function(i){const p=t.CHM(e).ngIf;return t.KtG(p.Filter.From=i)}),t.qZA()(),t.TgZ(14,"div")(15,"h6"),t._uU(16,"To"),t.qZA(),t.TgZ(17,"datepicker",7),t.NdJ("dateChange",function(i){const p=t.CHM(e).ngIf;return t.KtG(p.Filter.To=i)}),t.qZA()()()()(),t.TgZ(18,"content")(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr")(23,"th",11),t._uU(24,"Name"),t.qZA(),t.TgZ(25,"th",12),t._uU(26,"Code"),t.qZA(),t.TgZ(27,"th",13),t._uU(28,"Qty"),t.qZA(),t.YNc(29,On,2,0,"th",14),t.YNc(30,Pn,2,0,"th",14),t.qZA()()(),t.YNc(31,qn,17,17,"div",15),t.ALo(32,"async"),t.TgZ(33,"POS-infinite-list",16),t.NdJ("nextPage",function(){const s=t.CHM(e).ngIf,p=t.oxw();return t.KtG(p.nextPage(s.Filter))})("fetchTotalData",function(){const s=t.CHM(e).ngIf,p=t.oxw();return t.KtG(p.fetchTotalData(s.Filter))})("fetchAllData",function(){const s=t.CHM(e).ngIf,p=t.oxw();return t.KtG(p.fetchAllData(s.Filter))}),t.qZA()()()()}if(2&n){const e=r.ngIf,o=t.oxw();t.Q6J("pageData",o.menuData)("text",e.Filter.Number),t.xp6(2),t.Q6J("ngIf",o.roleService.global.Export),t.xp6(7),t.Q6J("items",e.Entities)("ngModel",e.Filter.EntityID),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.Filter.From),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.Filter.To),t.xp6(12),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.UnitPriceEditor),t.xp6(1),t.Q6J("ngForOf",t.lcZ(32,12,o.data$))}}let En=(()=>{class n extends et.M{constructor(e,o,i,s,p,A){super(e),(0,a.Z)(this,"infPagination",void 0),(0,a.Z)(this,"matDialog",void 0),(0,a.Z)(this,"csvConverter",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"dataEndpoint","/api/Adjustment/AuditAdjustmentReport"),(0,a.Z)(this,"loaderEndpoint","api/AdjustmentLoader/AuditAdjustmentReport"),(0,a.Z)(this,"countEndpoint","/api/Adjustment/AuditAdjustmentReportCount"),(0,a.Z)(this,"data$",void 0),(0,a.Z)(this,"loader$",void 0),(0,a.Z)(this,"loader",void 0),this.infPagination=o,this.matDialog=s,this.csvConverter=p,this.roleService=A,this.loader$=o.getLoader$(this.menuData$,this.loaderEndpoint),this.data$=o.getInfiniteListData$(this.dataEndpoint)}search(e){this.infPagination.filterFromFirstPage(e)}nextPage(e){this.infPagination.nextPage(e)}fetchTotalData(e){this.infPagination.fetchTotalData(this.countEndpoint,e)}fetchAllData(e){this.infPagination.fetchAllData(this.countEndpoint,e)}onOpenExportDialog(e){this.matDialog.open(xn).afterClosed().pipe((0,q.h)(o=>b.gT.IsNotEmpty(o))).subscribe(o=>{e.RowCount=o.pageSize,e.PageNumber=o.pageNumber,this.exportCSV("AdjustmentExport/AuditAdjustmentReport","AdjustmentReport.csv",e)})}exportCSV(e,o,i){this.httpService.post(`/api/${e}`,i).subscribe(s=>{this.csvConverter.convertToCSV(s,o)})}openExportModal(e){this.matDialog.open(B.H,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:e,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(bn),t.Y36(ct),t.Y36(k.uw),t.Y36(D.O),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-adjustment-reports"]],features:[t.qOj],decls:2,vars:3,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"items","ngModel","ngModelChange"],["placeholder","From","appearance","outline",3,"isFloatingLabel","date","dateChange"],["placeholder","To","appearance","outline",3,"isFloatingLabel","date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","w-100"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 80px",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","fetchAllData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"mt-5","ms-3"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"fst-italic","text-dark",3,"innerHTML"],[1,"fst-italic","text-dark"],[1,"text-danger","ms-3"],[3,"innerHTML"],[1,"table","table-bordered"],[1,"fw-normal",2,"width","645px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","60px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","50px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","80px"]],template:function(e,o){1&e&&(t.YNc(0,Jn,34,14,"mainpanel-cmp",0),t.ALo(1,"async")),2&e&&t.Q6J("ngIf",t.lcZ(1,1,o.loader$))},dependencies:[c.sg,c.O5,I.rH,S.p,l.JJ,l.On,P.QB,T.w9,Sn,c.Ov,c.JJ,c.uU]})),n})();function Qn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.ok())}),t._uU(1,"Upload"),t.qZA()}}function Fn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.confirmAdjustment())}),t._uU(1,"Confirm Adjustment"),t.qZA()}}function Ln(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",25)(1,"button",26),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.downloadData())}),t._UZ(2,"i",27),t._uU(3,"Download current inventory "),t.qZA()()}}function Yn(n,r){if(1&n&&(t.TgZ(0,"tr",33),t._UZ(1,"td",34)(2,"td",34)(3,"td",35),t.ALo(4,"number"),t._UZ(5,"td",35),t.ALo(6,"number"),t._UZ(7,"td",35),t.ALo(8,"number"),t.qZA()),2&n){const e=r.$implicit;t.Tol(e.QuantityDifferences<0?"danger":"success"),t.xp6(1),t.Q6J("innerHTML",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHTML",e.Code,t.oJD),t.xp6(1),t.Q6J("innerHTML",t.lcZ(4,9,e.Expected),t.oJD),t.xp6(2),t.Q6J("innerHTML",t.lcZ(6,11,e.Counted),t.oJD),t.xp6(2),t.Tol(e.QuantityDifferences<0?"text-danger":"text-success"),t.Q6J("innerHTML",t.lcZ(8,13,e.QuantityDifferences),t.oJD)}}function Hn(n,r){if(1&n&&(t.TgZ(0,"table",28)(1,"thead",29)(2,"tr")(3,"th"),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th",30),t._uU(6,"Code"),t.qZA(),t.TgZ(7,"th",31),t._uU(8,"Expected Stock"),t.qZA(),t.TgZ(9,"th",31),t._uU(10,"Counted Stock\t"),t.qZA(),t.TgZ(11,"th",31),t._uU(12,"Differences\t"),t.qZA()()(),t.TgZ(13,"tbody"),t.YNc(14,Yn,9,15,"tr",32),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(14),t.Q6J("ngForOf",e.opNames)}}const Kn=function(n){return{show:n}};function Vn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Qn,2,0,"button",2),t.YNc(3,Fn,2,0,"button",2),t.qZA(),t.TgZ(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5",6),t._uU(9,"Outlet"),t.qZA(),t.TgZ(10,"small",7),t._uU(11,"Stock take location"),t.qZA()(),t.TgZ(12,"div",8)(13,"div",9)(14,"div",10)(15,"div")(16,"ng-select",11),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.formData.EntityID=i)})("change",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.getEntityName(i))}),t.qZA()(),t.YNc(17,Ln,4,0,"div",12),t.qZA()()()(),t.TgZ(18,"div",4)(19,"div",5)(20,"h5",6),t._uU(21,"Counted Inventory"),t.qZA(),t.TgZ(22,"small",7),t._uU(23,".csv format"),t.qZA()(),t.TgZ(24,"div",8)(25,"div",9)(26,"div",13)(27,"input",14),t.NdJ("change",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.onSelectFile(i.target))}),t.qZA()()()()(),t.TgZ(28,"div",15)(29,"div",5)(30,"h5",6),t._uU(31,"Advanced"),t.qZA(),t.TgZ(32,"small",7),t._uU(33,"More Options"),t.qZA()(),t.TgZ(34,"div",8)(35,"div",9)(36,"div",16)(37,"label",6),t._uU(38,"Product Without Inventory"),t.qZA(),t.TgZ(39,"small",17),t._uU(40,"Download product Without Inventories"),t.qZA(),t.TgZ(41,"div",18)(42,"radio-options",19),t.NdJ("modelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.formData.ProductWithoutInventory=i)}),t.qZA()()()()(),t.YNc(43,Hn,15,1,"table",20),t.qZA(),t.TgZ(44,"a",21),t._uU(45,"More Options"),t.qZA(),t.TgZ(46,"div",22)(47,"div",23),t._uU(48,"Tips"),t.qZA(),t.TgZ(49,"ol")(50,"li"),t._uU(51,"Choose your outlet then download the csv spreadsheet"),t.qZA(),t.TgZ(52,"li"),t._uU(53,"Fill the Quantity column beside the Expected column"),t.qZA(),t.TgZ(54,"li"),t._uU(55,"Upload your file using the Green Button on the top right corner"),t.qZA(),t.TgZ(56,"li"),t._uU(57,"Analyze the upload file on your screen and Confirm the Adjustment."),t.qZA(),t.TgZ(58,"li"),t._uU(59,'Inventory Adjustment only works for Product with type "Standard" / product with stock.'),t.qZA(),t.TgZ(60,"li"),t._uU(61,'"Composite" Product is not shown in the CSV you Download.'),t.qZA()()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.adjustment.Create&&!e.uploaded),t.xp6(1),t.Q6J("ngIf",e.uploaded),t.xp6(13),t.Q6J("items",e.pageData.Entities)("ngModel",e.formData.EntityID),t.xp6(1),t.Q6J("ngIf",e.roleService.adjustment.Create||e.roleService.adjustment.Edit),t.xp6(11),t.Tol(t.VKq(13,Kn,e.opNames.length>0)),t.xp6(14),t.Q6J("options",e.productOptions)("model",e.formData.ProductWithoutInventory),t.xp6(1),t.Q6J("ngIf",e.opNames.length>0)}}let Rn=(()=>{class n extends C.n{constructor(e,o,i,s,p){super(e,null,"Outlet/GetByUserAccessWrite"),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"csvConverter",void 0),(0,a.Z)(this,"router",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"formData",void 0),(0,a.Z)(this,"outletName",void 0),(0,a.Z)(this,"flag",void 0),(0,a.Z)(this,"uploaded",!1),(0,a.Z)(this,"opNames",void 0),(0,a.Z)(this,"productOptions",[{Key:"0",Value:"No"},{Key:"1",Value:"Yes"},{Key:"-1",Value:"Exclude Zero"}]),(0,a.Z)(this,"csvResult",void 0),(0,a.Z)(this,"file",void 0),this.toastr=o,this.csvConverter=i,this.router=s,this.roleService=p,this.formData={},this.opNames=[]}preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}onSelectFile(e){this.file=e.files[0]}ok(){const e=new FormData;e.append("Data",this.file),e.append("EntityID",this.formData.EntityID),e.append("ProductWithoutInventory",this.formData.ProductWithoutInventory),this.httpService.postFormData("/API/Adjustment/GetPreviewImportCSV",e).subscribe({next:o=>{this.opNames=o,this.uploaded=!0},error:o=>{this.toastr.error(o.error.Message?o.error.Message:o.error,x.n.Error)}})}downloadData(){const e="StockTake_"+this.outletName+"_"+this.getFormatedDate();this.httpService.post("/API/InventoryExport/GetStockTakeSpreadsheet",JSON.stringify(this.formData)).subscribe(o=>this.csvConverter.convertToCSV(o,e))}getEntityName(e){this.outletName=e.Name}getFormatedDate(){const e=new Date;return(e.getDate()<10?"0":"")+e.getDate()+(e.getMonth()+1<10?"0":"")+(e.getMonth()+1)+e.getFullYear().toString().substr(-2)}confirmAdjustment(){let e=[];if(this.opNames.forEach(s=>{e.push({VariantID:s.ID,Quantity:s.QuantityDifferences,Cost:s.UnitCost,Price:s.UnitPrice})}),e.length<1)return alert("You must atleast have one item to adjust!"),!1;let o=new Date;null!=this.formData.InventoryDate&&(o=new Date(this.formData.InventoryDate)),this.httpService.post("/API/Adjustment/SubmitUseDefault",{Order:{EntityID:this.formData.EntityID,Date:o},Items:e,TypeID:1}).subscribe({next:s=>{this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:s.OrderID}}).then(()=>window.location.reload())},error:s=>{this.toastr.error(s,x.n.Error)}})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(g._W),t.Y36(D.O),t.Y36(I.F0),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-csv-stock-take"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-md-2"],[1,"fw-bold"],[1,"h6","fst-italic"],[1,"col-md-10"],[1,"row"],[1,"col-md-12","mb-10",2,"display","flex"],["bindLabel","Name","bindValue","ID",2,"width","200px",3,"items","ngModel","ngModelChange","change"],["class","ms-5",4,"ngIf"],["id","import-section",1,"col-md-6","mb-10"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"],[1,"row","extra-options","border-bottom","mt-10","ms-2","collapse"],[1,"col-md-5"],[1,"ms-3","h6","fst-italic"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","14px"],["name","productInventory",3,"options","model","modelChange"],["class","table table-bordered mt-3",4,"ngIf"],["data-bs-toggle","collapse","data-bs-target",".extra-options","aria-expanded","true",1,"more","ms-2"],[1,"border","mt-5","ms-2"],[1,"fst-italic","text-primary","fw-bold","h5","ms-12","mt-3"],[1,"btn","btn-success",3,"click"],[1,"ms-5"],[1,"btn","btn-outline-secondary",2,"height","37px !important","font-size","13px !important",3,"click"],[1,"fa","fa-download","me-3"],[1,"table","table-bordered","mt-3"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[1,"text-end",2,"width","120px"],["class","red",3,"class",4,"ngFor","ngForOf"],[1,"red"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"]],template:function(e,o){1&e&&t.YNc(0,Vn,62,15,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData)},dependencies:[c.sg,c.O5,S.p,l.JJ,l.On,T.w9,tt.P,c.JJ],styles:[".col-md-5[_ngcontent-%COMP%]{font-size:.875rem;height:-moz-fit-content;height:fit-content}.col-md-5.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;padding-bottom:3px}"]})),n})();var Gn=d(54147);class Bn extends et.M{constructor(r){super(r),(0,a.Z)(this,"loaderData",void 0),(0,a.Z)(this,"products",void 0),(0,a.Z)(this,"originalProducts",void 0),(0,a.Z)(this,"adjustmentID",void 0),(0,a.Z)(this,"completeInfo",void 0),(0,a.Z)(this,"error",void 0),(0,a.Z)(this,"loaderApi",void 0),(0,a.Z)(this,"productsApi",void 0),(0,a.Z)(this,"submitApi",void 0),(0,a.Z)(this,"requestPayload",void 0),this.loaderApi="/API/AdjustmentLoader/StockTakeByCSV",this.productsApi="/API/Adjustment/GetSpreadsheet",this.submitApi="/API/Adjustment/SubmitUseDefault",this.requestPayload=3,this.products=this.originalProducts=[],this.getDataFromLoader()}getDataFromLoader(){this.menuData$.pipe((0,V.b)(()=>this.httpService.post(this.loaderApi,JSON.stringify(this.requestPayload)))).subscribe(r=>this.loaderData=r)}getProduct(r){this.products=[],this.httpService.post(this.productsApi,JSON.stringify(r)).subscribe(e=>{e.forEach(o=>{o.Counted="",this.products.push(o),this.originalProducts.push(o)})})}submitAdjustment(r){this.httpService.post(this.submitApi,JSON.stringify(r)).subscribe({next:e=>{this.adjustmentID=e.OrderID,this.completeInfo=e,this.error=null,this.onSubmitSuccess()},error:e=>{this.error=e}})}onSubmitSuccess(){}}var Y=d(58425),lt=d(96308);const $n=["stepper"];function Wn(n,r){1&n&&(t._UZ(0,"i",47),t._uU(1,"Filter"))}function zn(n,r){1&n&&(t.TgZ(0,"small",48),t._uU(1,"Outlet option is required."),t.qZA())}function Xn(n,r){1&n&&(t._UZ(0,"i",49),t._uU(1,"Input"))}function to(n,r){1&n&&(t.TgZ(0,"th",34),t._uU(1,"Expected"),t.qZA())}function eo(n,r){1&n&&(t.TgZ(0,"th",34),t._uU(1,"Changes"),t.qZA())}function no(n,r){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Quantity)}}function oo(n,r){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t._UZ(2,"i",56),t._uU(3),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",e.Quantity," "),t.xp6(2),t.AsE(" ",e.Counted," (",(e.Counted-e.Quantity>0?"+":"")+(e.Counted-e.Quantity),")")}}function io(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"i",57),t.NdJ("click",function(){t.CHM(e);const i=t.oxw().$implicit,s=t.oxw(3);return t.KtG(s.clear(i))}),t.qZA()}}const Dt=function(){return["/menu/Products/Catalog/Variants/Info"]},dt=function(n){return{ID:n}},ao=function(n){return{"bg-gradient-warning":n}};function ro(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",50),t._uU(4),t.qZA(),t.TgZ(5,"td",50),t._uU(6),t.qZA(),t.TgZ(7,"td")(8,"a",51),t._uU(9),t.qZA()(),t.TgZ(10,"td"),t._uU(11),t.qZA(),t.YNc(12,no,2,1,"td",52),t.TgZ(13,"td")(14,"input",53),t.NdJ("ngModelChange",function(i){const p=t.CHM(e).$implicit;return t.KtG(p.Counted=i)}),t.qZA()(),t.YNc(15,oo,4,3,"td",52),t.TgZ(16,"td",54),t.YNc(17,io,1,0,"i",55),t.qZA()()}if(2&n){const e=r.$implicit,o=r.index,i=t.oxw(3);t.xp6(2),t.Oqu(o+1+"."),t.xp6(2),t.Oqu(e.CategoryName),t.xp6(2),t.Oqu(e.ProductName),t.xp6(2),t.Q6J("routerLink",t.DdM(14,Dt))("queryParams",t.VKq(15,dt,e.ID)),t.xp6(1),t.Oqu(e.Model),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",i.roleService.inventory.View),t.xp6(2),t.Tol(t.VKq(17,ao,""!==e.Counted&&e.Counted!=e.Quantity&&!i.roleService.inventory.View)),t.Q6J("modifyValueOnWheel",!1)("ngModel",e.Counted),t.xp6(1),t.Q6J("ngIf",""!==e.Counted&&i.roleService.inventory.View),t.xp6(2),t.Q6J("ngIf",""!==e.Counted)}}const pt=function(n){return{"nb-button-override":n}};function so(n,r){if(1&n&&(t.TgZ(0,"div",22)(1,"button",43),t._uU(2," Back "),t.qZA(),t.TgZ(3,"button",58),t._uU(4," Next "),t.qZA()()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,pt,e.currentSubStatus!=e.subStatusEnum.PAID))}}function co(n,r){1&n&&(t._UZ(0,"i",59),t._uU(1,"Review"))}function lo(n,r){1&n&&(t.TgZ(0,"th",34),t._uU(1,"Expected"),t.qZA())}function po(n,r){1&n&&(t.TgZ(0,"th",34),t._uU(1,"Differences"),t.qZA())}function uo(n,r){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Oqu(e.Quantity)}}function mo(n,r){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3).$implicit;t.xp6(1),t.hij("+",e.Counted-e.Quantity,"")}}function _o(n,r){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3).$implicit;t.xp6(1),t.Oqu(e.Counted-e.Quantity)}}function go(n,r){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,mo,2,1,"span",52),t.YNc(2,_o,2,1,"span",52),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",e.Counted>e.Quantity),t.xp6(1),t.Q6J("ngIf",e.Counted<e.Quantity)}}function ho(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",50),t._uU(4),t.qZA(),t.TgZ(5,"td")(6,"a",51),t._uU(7),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.YNc(10,uo,2,1,"td",52),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.YNc(13,go,3,2,"td",52),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,i=e.index,s=t.oxw(3);t.Tol(o.Counted<o.Quantity?"soft-yellow":"soft-green"),t.xp6(2),t.Oqu(i+1+"."),t.xp6(2),t.Oqu(o.ProductName),t.xp6(2),t.Q6J("routerLink",t.DdM(11,Dt))("queryParams",t.VKq(12,dt,o.ID)),t.xp6(1),t.Oqu(o.Model),t.xp6(2),t.Oqu(o.Code),t.xp6(1),t.Q6J("ngIf",s.roleService.inventory.View),t.xp6(2),t.hij(" ",o.Counted," "),t.xp6(1),t.Q6J("ngIf",s.roleService.inventory.View)}}function fo(n,r){if(1&n&&(t.ynx(0),t.YNc(1,ho,14,14,"tr",60),t.BQk()),2&n){const e=r.$implicit;t.xp6(1),t.Q6J("ngIf",""!==e.Counted&&e.Counted!=e.Quantity)}}function Co(n,r){1&n&&(t._UZ(0,"i",61),t._uU(1,"Finish"))}function xo(n,r){if(1&n&&(t.TgZ(0,"div",62),t._UZ(1,"i",63),t._uU(2),t.qZA()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(e.error.error.Message)}}const vo=function(n){return{custom:n}};function Zo(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mat-stepper",4,5),t.NdJ("selectionChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.onNextStep(i))}),t.TgZ(2,"mat-step",6),t.YNc(3,Wn,2,0,"ng-template",7),t.TgZ(4,"div",8)(5,"div",9)(6,"div",10)(7,"div",9)(8,"h3",11),t._uU(9,"Outlet"),t.qZA()(),t.TgZ(10,"div",12)(11,"ng-select",13,14),t.NdJ("change",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.toggleIsFilterFilled())})("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.filter.EntityID=i)}),t.qZA(),t.YNc(13,zn,2,0,"small",15),t.qZA()()(),t.TgZ(14,"div",16)(15,"div",10)(16,"div",9)(17,"h3",11),t._uU(18,"Category "),t.TgZ(19,"small",17)(20,"em"),t._uU(21,"Optional"),t.qZA()()()(),t.TgZ(22,"div",12)(23,"ng-select",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.filter.CategoryID=i)}),t.qZA()()()(),t.TgZ(24,"div",16)(25,"div",10)(26,"div",9)(27,"h3",11),t._uU(28,"Contain Text "),t.TgZ(29,"small",17)(30,"em"),t._uU(31,"Optional"),t.qZA()()()(),t.TgZ(32,"div",19)(33,"input",20),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.filter.ProductName=i)}),t.qZA()()()(),t.TgZ(34,"div",16)(35,"div",10)(36,"div",9)(37,"h3",11),t._uU(38,"Note "),t.TgZ(39,"small",17)(40,"em"),t._uU(41,"Optional"),t.qZA()()()(),t.TgZ(42,"div",12)(43,"textarea",21),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.note=i)}),t.qZA()()()()(),t.TgZ(44,"div",22)(45,"button",23),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.validateFilter())}),t._uU(46,"Next"),t.qZA()()(),t.TgZ(47,"mat-step",24),t.YNc(48,Xn,2,0,"ng-template",7),t.TgZ(49,"div",25)(50,"table",26),t.NdJ("matSortChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.sortData(i))}),t.TgZ(51,"thead",27)(52,"tr")(53,"th",28),t._uU(54,"No"),t.qZA(),t.TgZ(55,"th",29),t._uU(56,"Category"),t.qZA(),t.TgZ(57,"th",30),t._uU(58,"Product"),t.qZA(),t.TgZ(59,"th",31),t._uU(60,"Variant"),t.qZA(),t.TgZ(61,"th",32),t._uU(62,"Code"),t.qZA(),t.YNc(63,to,2,0,"th",33),t.TgZ(64,"th",34),t._uU(65,"Counted"),t.qZA(),t.YNc(66,eo,2,0,"th",35),t._UZ(67,"th",28),t.qZA()(),t.TgZ(68,"tbody"),t.YNc(69,ro,18,19,"tr",36),t.qZA()()(),t.YNc(70,so,5,3,"div",37),t.qZA(),t.TgZ(71,"mat-step",38),t.YNc(72,co,2,0,"ng-template",7),t.TgZ(73,"div",25)(74,"div",39)(75,"table",40),t.NdJ("matSortChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.sortData(i))}),t.TgZ(76,"thead",27)(77,"tr"),t._UZ(78,"th",28),t.TgZ(79,"th",41),t._uU(80,"Name"),t.qZA(),t.TgZ(81,"th",42),t._uU(82,"Variant"),t.qZA(),t.TgZ(83,"th",34),t._uU(84,"Code"),t.qZA(),t.YNc(85,lo,2,0,"th",33),t.TgZ(86,"th",34),t._uU(87,"Counted"),t.qZA(),t.YNc(88,po,2,0,"th",33),t.qZA()(),t.TgZ(89,"tbody"),t.YNc(90,fo,2,1,"ng-container",36),t.qZA()()()(),t.TgZ(91,"div",22)(92,"button",43),t._uU(93," Back "),t.qZA(),t.TgZ(94,"button",44),t._uU(95," Confirm Adjustment "),t.qZA()()(),t.TgZ(96,"mat-step",45),t.YNc(97,Co,2,0,"ng-template",7),t.YNc(98,xo,3,1,"div",46),t.qZA()()}if(2&n){const e=t.MAs(12),o=t.oxw(2);t.Q6J("linear",!0),t.xp6(2),t.Q6J("completed",o.isFilterFilled),t.xp6(9),t.Tol(t.VKq(23,vo,e.touched&&null==o.filter.EntityID)),t.Q6J("items",o.loaderData.Entities)("ngModel",o.filter.EntityID)("clearable",!1),t.xp6(2),t.Q6J("ngIf",e.touched&&null==o.filter.EntityID),t.xp6(10),t.Q6J("items",o.loaderData.Categories)("ngModel",o.filter.CategoryID),t.xp6(10),t.Q6J("ngModel",o.filter.ProductName),t.xp6(10),t.Q6J("ngModel",o.note),t.xp6(1),t.Q6J("ngClass",t.VKq(25,pt,o.currentSubStatus!=o.subStatusEnum.PAID)),t.xp6(1),t.Q6J("disabled",!o.roleService.adjustment.Create),t.xp6(18),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(3),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(3),t.Q6J("ngForOf",o.products),t.xp6(1),t.Q6J("ngIf",o.products.length>0),t.xp6(15),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(3),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(2),t.Q6J("ngForOf",o.products),t.xp6(1),t.Q6J("ngClass",t.VKq(27,pt,o.currentSubStatus!=o.subStatusEnum.PAID)),t.xp6(7),t.Q6J("ngIf",o.error)}}function bo(n,r){1&n&&(t.TgZ(0,"div",80),t._uU(1," Difference"),t.qZA())}function To(n,r){if(1&n&&(t.TgZ(0,"div",85),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Tol(e.Quantity-e.OriginalQuantity<0?"text-danger":"text-success"),t.xp6(1),t.Oqu((e.Quantity-e.OriginalQuantity>0?"+":" ")+(e.Quantity-e.OriginalQuantity))}}function Io(n,r){if(1&n&&(t.TgZ(0,"div",87)(1,"div",84),t._uU(2),t.qZA(),t.TgZ(3,"div",85),t._uU(4),t.qZA(),t.YNc(5,To,2,3,"div",86),t.qZA()),2&n){const e=r.$implicit,o=t.oxw(3);t.xp6(2),t.AsE("",e.Name," (",e.Model,")"),t.xp6(2),t.Oqu(e.Quantity),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View)}}function yo(n,r){if(1&n&&(t.TgZ(0,"div",85),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"sum"),t.ALo(5,"sum"),t.ALo(6,"sum"),t.ALo(7,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Tol(t.xi3(1,3,e.Items,"Quantity")-t.xi3(2,6,e.Items,"OriginalQuantity")<0?"text-danger":"text-success"),t.xp6(3),t.hij(" ",(t.xi3(4,9,e.Items,"Quantity")-t.xi3(5,12,e.Items,"OriginalQuantity")>0?"+":" ")+(t.xi3(6,15,e.Items,"Quantity")-t.xi3(7,18,e.Items,"OriginalQuantity"))," ")}}const Ao=function(){return["/menu/Adjustment/Adjustment/Archive/Info"]};function So(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",64)(1,"div",65)(2,"div",66)(3,"div",67)(4,"h1",68),t._UZ(5,"i",61),t._uU(6,"Inventory Adjustment Completed"),t.qZA()(),t.TgZ(7,"div",69)(8,"div",70)(9,"div",71)(10,"a",72),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.newStockCount())}),t._uU(11,"New Adjustment (F8)"),t.qZA()()()()()(),t.TgZ(12,"div",73)(13,"div",66)(14,"div",74)(15,"h2",75)(16,"a",76),t._uU(17),t.qZA()()(),t.TgZ(18,"div",77)(19,"div",78)(20,"div",79),t._uU(21,"Product Name (Variant)"),t.qZA(),t.TgZ(22,"div",80),t._uU(23,"Counted"),t.qZA(),t.YNc(24,bo,2,0,"div",81),t.qZA(),t.YNc(25,Io,6,4,"div",82),t.TgZ(26,"div",83)(27,"div",84),t._uU(28,"Total"),t.qZA(),t.TgZ(29,"div",85),t._uU(30),t.ALo(31,"sum"),t.qZA(),t.YNc(32,yo,8,21,"div",86),t.qZA()()()()()}if(2&n){const e=t.oxw(2);t.xp6(16),t.Q6J("routerLink",t.DdM(10,Ao))("queryParams",t.VKq(11,dt,e.adjustmentID)),t.xp6(1),t.hij("Adjustment #",e.completeInfo.InvoiceNumber,""),t.xp6(7),t.Q6J("ngIf",e.roleService.inventory.View),t.xp6(1),t.Q6J("ngForOf",e.Items),t.xp6(5),t.Oqu(t.xi3(31,7,e.Items,"Quantity")),t.xp6(2),t.Q6J("ngIf",e.roleService.inventory.View)}}function Do(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.filter.ProductName=i)})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.filterProduct(i.filter.ProductName))}),t.TgZ(1,"content"),t.YNc(2,Zo,99,29,"mat-stepper",2),t.YNc(3,So,33,13,"div",3),t.qZA()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.filter.ProductName)("hideSearchBox","input"!=e.currentStep)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",e.loaderData&&!e.isCompleted),t.xp6(1),t.Q6J("ngIf",e.isCompleted)}}let Mo=(()=>{class n extends Bn{constructor(e,o,i,s){super(e),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"ngZone",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"stepper",void 0),(0,a.Z)(this,"isFilterFilled",void 0),(0,a.Z)(this,"currentStep",void 0),(0,a.Z)(this,"Items",void 0),(0,a.Z)(this,"note",void 0),(0,a.Z)(this,"isCompleted",!1),(0,a.Z)(this,"filter",void 0),(0,a.Z)(this,"oldFilter",void 0),(0,a.Z)(this,"currentSubStatus",void 0),(0,a.Z)(this,"subStatusEnum",Gn.y),this.toastr=o,this.ngZone=i,this.roleService=s,this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:b.gT.GuidEmpty},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy"},this.Items=[],this.initSubscriptionStatus()}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}handleF8(){"finish"==this.currentStep&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}onNextStep(e){if("filter"==e.selectedStep.label)this.currentStep="filter";else if("input"==e.selectedStep.label)this.currentStep="input",(this.oldFilter.CategoryID!=this.filter.CategoryID||this.oldFilter.EntityID!=this.filter.EntityID||this.filter.ProductName!=this.oldFilter.ProductName)&&(this.getProduct(this.filter),this.oldFilter=Object.assign({},this.filter));else if("review"==e.selectedStep.label){this.products=this.originalProducts,this.currentStep="review";let o=0;this.products.forEach(i=>{""!==i.Counted&&i.Counted!=i.Quantity&&(i.Status=i.Counted>i.Quantity?"Over":"Under",o++)}),o&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",x.n.Warning)}else"finish"==e.selectedStep.label&&(this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(s=>{""!==s.Counted&&s.Counted!=s.Quantity&&this.Items.push({Name:s.ProductName,Cost:s.UnitCost,Price:s.UnitQuantity,Quantity:s.Counted,OriginalQuantity:s.Quantity,VariantID:s.ID,Model:s.Model})}),this.Items.length>0?this.submitAdjustment({Items:this.Items,Order:{Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||b.gT.GuidEmpty},TypeID:2}):this.toastr.error("Adjust at least 1 product",x.n.Error))}validateFilter(){this.isFilterFilled||this.toastr.error("Outlet is required",x.n.Error)}clear(e){e.Counted=""}newStockCount(){window.location.reload()}onSubmitSuccess(){this.isCompleted=!0}sortData(e){const o=this.products.slice();this.products=e.active&&""!==e.direction?o.sort((i,s)=>{const p="asc"===e.direction,A=typeof i[e.active];switch(b.gT.IsEmpty(i.Code)&&(i.Code=""),b.gT.IsEmpty(s.Code)&&(s.Code=""),A){case"string":return this.compare(i[e.active].toLocaleLowerCase(),s[e.active].toLocaleLowerCase(),p);case"number":return this.compare(i[e.active],s[e.active],p);default:return 0}}):this.originalProducts}compare(e,o,i){return(e<o?-1:1)*(i?1:-1)}filterProduct(e){""!=e?(e=e.toLowerCase(),this.products=this.originalProducts.filter(o=>o.ProductName.toLowerCase().includes(e))):this.products=this.originalProducts}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(g._W),t.Y36(t.R0b),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(e,o){if(1&e&&t.Gf($n,5),2&e){let i;t.iGM(i=t.CRH())&&(o.stepper=i.first)}},hostBindings:function(e,o){1&e&&t.NdJ("keydown.F8",function(){return o.handleF8()},!1,t.Jf7)("keydown.ArrowRight",function(){return o.handleNextButton()},!1,t.Jf7)("keydown.ArrowLeft",function(){return o.handlePreviousButton()},!1,t.Jf7)},features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit"],[3,"linear","selectionChange",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],[3,"linear","selectionChange"],["stepper",""],["label","filter",3,"completed"],["matStepLabel",""],[1,"row","px-5","w-50","mx-auto"],[1,"col-12"],[1,"row"],[1,"fw-normal","text-dark","m-0"],[1,"col-12","mt-3"],["placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"items","ngModel","clearable","change","ngModelChange"],["outletFilter","ngModel"],["style","color: red;",4,"ngIf"],[1,"col-12",2,"margin-top","25px"],[1,"text-muted","h6"],["placeholder","Choose a category","bindLabel","Value","bindValue","Key",3,"items","ngModel","ngModelChange"],[1,"col-12","mt-3","mb-0"],["type","text","name","text","placeholder","Type the product name you want to adjust",1,"form-control",3,"ngModel","ngModelChange"],["rows","6","type","text","name","note",1,"form-control",3,"ngModel","ngModelChange"],[1,"mt-5","nb-button",3,"ngClass"],["mat-button","","matStepperNext","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-outline-secondary","ms-auto","me-0","d-block",3,"disabled","click"],["label","input"],[1,"container-fluid","px-0"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],["style","width: 75px;",4,"ngIf"],[2,"width","75px"],["style","width: 75px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],["label","review"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["mat-button","","matStepperPrevious","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5"],["mat-button","","matStepperNext","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success"],["label","finish"],["class","alert",4,"ngIf"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],[4,"ngIf"],["type","text","autoNum","",1,"form-control",3,"modifyValueOnWheel","ngModel","ngModelChange"],[1,"text-center"],["class","fa-solid fa-delete-left fa-2x clear align-middle","matTooltipPosition","above","matTooltip","reset counter",3,"click",4,"ngIf"],[1,"fa-solid","fa-right-long"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle",3,"click"],["mat-button","","matStepperNext","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-outline-secondary"],[1,"fa-solid","fa-user-check","me-3"],[3,"class",4,"ngIf"],[1,"fa-solid","fa-check","me-3"],[1,"alert"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"container-fluid","row","mt-5"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)","background-color","rgba(203, 203, 210, 0.15) !important"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],[1,"row","justify-content-between"],[1,"col-6",2,"font-size","14px"],[1,"col-3",2,"font-size","14px"],["class","col-3","style","font-size: 14px;",4,"ngIf"],["class","row justify-content-between my-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],["class","col-3",3,"class",4,"ngIf"],[1,"row","justify-content-between","my-5"]],template:function(e,o){1&e&&t.YNc(0,Do,4,6,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.loaderData)},dependencies:[c.mk,c.sg,c.O5,I.rH,S.p,l.Fj,l.JJ,l.On,T.w9,Y.C0,Y.VY,Y.Vq,Y.Ic,Y.fd,Q.b,h.gM,lt.YE,lt.nU,v.qU],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons";ng-select.custom[_ngcontent-%COMP%] .ng-select-container{border:1px solid red!important}.soft-green[_ngcontent-%COMP%]{background-color:#acd1af}.soft-yellow[_ngcontent-%COMP%]{background-color:#eeee9b}.alert[_ngcontent-%COMP%]{color:#691917;background-color:#f4d6d5;border-color:#f0c5c4}input[_ngcontent-%COMP%]::-webkit-outer-spin-button, input[_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.nb-button[_ngcontent-%COMP%]{position:absolute;right:10px;top:-2px;z-index:9999}.nb-button-override[_ngcontent-%COMP%]{top:40px!important}']})),n})();function Oo(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.confirmAdjust())}),t._uU(1,"Confirm Adjustment"),t.qZA()}}const Po=function(){return["/menu/Products/Catalog/Products/Info"]},wo=function(n){return{ID:n}};function No(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"tr",16)(1,"td"),t._UZ(2,"a",17),t.qZA(),t._UZ(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),t.TgZ(8,"td",20)(9,"input",21),t.NdJ("ngModelChange",function(i){const p=t.CHM(e).$implicit;return t.KtG(p.NewQuantity=i)}),t.qZA()(),t.TgZ(10,"td",20),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"td")(14,"a",22),t.NdJ("click",function(){const s=t.CHM(e).$implicit,p=t.oxw(2);return t.KtG(p.confirmAdjust(s))}),t._uU(15,"Adjust"),t.qZA()()()}if(2&n){const e=r.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(12,Po))("queryParams",t.VKq(13,wo,e.ProductID))("innerHTML",e.ProductName,t.oJD),t.xp6(1),t.Q6J("innerHTML",e.ParentCode,t.oJD),t.xp6(1),t.Q6J("innerHTML",e.Model,t.oJD),t.xp6(1),t.Q6J("innerHTML",e.ParentModel,t.oJD),t.xp6(1),t.Q6J("innerHTML",e.Ratio,t.oJD),t.xp6(1),t.Q6J("innerHTML",e.Inventory,t.oJD),t.xp6(2),t.Q6J("ngModel",e.NewQuantity),t.xp6(2),t.hij(" ",t.lcZ(12,10,e.Inventory-e.NewQuantity*e.Ratio)," ")}}function ko(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,Oo,2,0,"button",2),t.qZA(),t.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),t._uU(8,"Outlets"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.EntityID=i)}),t.qZA()()()()(),t.TgZ(10,"content")(11,"div",6)(12,"div",7)(13,"table",8)(14,"thead",9)(15,"tr")(16,"th"),t._uU(17,"Product Name"),t.qZA(),t.TgZ(18,"th",10),t._uU(19,"Code"),t.qZA(),t.TgZ(20,"th",10),t._uU(21,"From"),t.qZA(),t.TgZ(22,"th",10),t._uU(23,"To"),t.qZA(),t.TgZ(24,"th",11),t._uU(25,"Ratio"),t.qZA(),t.TgZ(26,"th",11),t._uU(27,"Inventory"),t.qZA(),t.TgZ(28,"th",12),t._uU(29,"Convert Qty "),t.qZA(),t.TgZ(30,"th",12),t._uU(31,"Remaining"),t.qZA(),t._UZ(32,"th",13),t.qZA()(),t.TgZ(33,"tbody"),t.YNc(34,No,16,15,"tr",14),t.qZA()()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.adjustment.Create),t.xp6(7),t.Q6J("items",e.pageData.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(25),t.Q6J("ngForOf",e.Items)}}let jo=(()=>{class n extends C.n{constructor(e,o,i,s){super(e,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite"),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"router",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"Items",void 0),this.toastr=o,this.router=i,this.roleService=s}preGetList(){b.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(e){this.Items=e,this.Items.forEach(o=>o.NewQuantity=Math.floor(o.Inventory/o.Ratio))}confirmAdjust(e){let o=[],i=[];return e?i.push(e):i=this.Items,i.forEach(p=>{let A={VariantID:p.ParentID,Quantity:p.NewQuantity,Cost:p.UnitCost*p.Ratio,Price:p.UnitPrice*p.Ratio};o.push(A),A={VariantID:p.ID,Quantity:p.NewQuantity*p.Ratio*-1,Cost:p.UnitCost,Price:p.UnitPrice},o.push(A)}),o.length<1?(alert("You must atleast have one item to adjust!"),!1):b.gT.IsEmpty(this.pageData.Filter.EntityID)?(alert("Outlet is require"),!1):void this.httpService.post("/API/Adjustment/SubmitUseDefault",JSON.stringify({Order:{EntityID:this.pageData.Filter.EntityID},Items:o})).subscribe({next:p=>{p.Success?this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:p.OrderID}}).then(()=>window.location.reload()):this.toastr.success(p.Message,x.n.Success)},error:p=>{this.toastr.error(p,x.n.Error)}})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(g._W),t.Y36(I.F0),t.Y36(u.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-convert-inventory"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID",3,"items","ngModel","ngModelChange"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","125px"],[1,"text-end",2,"width","125px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"click"],[1,"border-bottom"],[3,"routerLink","queryParams","innerHTML"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"],[1,"text-end"],["type","text","autoNum","",1,"text-end",3,"ngModel","ngModelChange"],[3,"click"]],template:function(e,o){1&e&&t.YNc(0,ko,35,6,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[c.sg,c.O5,I.rH,S.p,l.Fj,l.JJ,l.On,T.w9,Q.b,c.JJ]})),n})();function Uo(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.openExportModal())}),t._UZ(1,"i",17),t._uU(2," Export"),t.qZA()}}function qo(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"td",14)(1,"input",21),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw().$implicit;return t.KtG(s.Quantity=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.Quantity)}}function Jo(n,r){if(1&n&&(t.TgZ(0,"td",14),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.Quantity,"")}}function Eo(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"tr",18)(1,"td")(2,"i",19),t.NdJ("click",function(){const s=t.CHM(e).index,p=t.oxw();return t.KtG(p.products.splice(s,1))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",14),t._uU(6),t.qZA(),t.YNc(7,qo,2,1,"td",20),t.YNc(8,Jo,2,1,"td",20),t.qZA()}if(2&n){const e=r.$implicit,o=t.oxw();t.xp6(4),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",o.roleService.adjustment.InventoryProductCount),t.xp6(1),t.Q6J("ngIf",!o.roleService.adjustment.InventoryProductCount)}}function Fo(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",19),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openExportModal())}),t._UZ(1,"i",20),t._uU(2," Export"),t.qZA()}}function Lo(n,r){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=r.$implicit;t.xp6(1),t.Oqu(e+" ")}}function Yo(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",18),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",18),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",21),t.YNc(12,Lo,2,1,"span",15),t.qZA()()),2&n){const e=r.$implicit;t.xp6(2),t.Oqu(e.ProductCode),t.xp6(2),t.Oqu(e.ProductName),t.xp6(2),t.Oqu(t.lcZ(7,5,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(10,7,e.Qty)),t.xp6(3),t.Q6J("ngForOf",e.Models)}}function Ho(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,Fo,3,0,"button",2),t.qZA(),t.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),t._uU(8,"Outlets"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.EntityID=i)}),t.qZA()(),t.TgZ(10,"div")(11,"h6"),t._uU(12,"Categories"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.CategoryID=i)}),t.qZA()(),t.TgZ(14,"div")(15,"h6"),t._uU(16,"Sort By"),t.qZA(),t.TgZ(17,"ng-select",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.pageData.Filter.SortByid=i)}),t.qZA()()()()(),t.TgZ(18,"content")(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr")(23,"th",11),t._uU(24,"Code"),t.qZA(),t.TgZ(25,"th",12),t._uU(26,"Name"),t.qZA(),t.TgZ(27,"th",13),t._uU(28,"UnitPrice"),t.qZA(),t.TgZ(29,"th",14),t._uU(30,"Qty"),t.qZA(),t.TgZ(31,"th"),t._uU(32,"Available Models"),t.qZA()()(),t.TgZ(33,"tbody"),t.YNc(34,Yo,13,9,"tr",15),t.qZA(),t.TgZ(35,"tfoot")(36,"tr",16),t._UZ(37,"td",17),t.TgZ(38,"td",18),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t._UZ(42,"td"),t.qZA()()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.global.Export),t.xp6(7),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(4),t.Q6J("items",e.pageData.Options.Categories)("ngModel",e.pageData.Filter.CategoryID),t.xp6(4),t.Q6J("items",e.pageData.Options.SortBy)("ngModel",e.pageData.Filter.SortByid),t.xp6(17),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(40,11,t.xi3(41,13,e.data.Data,"Qty")))}}const Ko=[{path:"Adjustment/Archive",component:ue},{path:"Adjustment/Archive/Info",component:Bt},{path:"Adjustment/Archive/Form",component:Cn},{path:"Tools/Count_Product_Inventory",component:(()=>{class n extends C.n{constructor(e,o,i,s){super(e),(0,a.Z)(this,"csvConverter",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"matDialog",void 0),(0,a.Z)(this,"productCode",void 0),(0,a.Z)(this,"products",void 0),this.csvConverter=o,this.roleService=i,this.matDialog=s,this.products=[]}onBarcodeEnter(e){const o=this.products.findIndex(i=>i.Code===e);-1!=o?this.products[o].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",JSON.stringify({code:e})).subscribe(i=>{i.Quantity=1,this.products.push(i)}),this.productCode=null}openExportModal(){this.matDialog.open(B.H,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:{Products:this.products,Export:!0,FormatType:this.pageData.Filter.FormatType},getAllDataLengthAPI:"",pagination:!1}})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(D.O),t.Y36(u.N),t.Y36(k.uw))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-count-product-inventory"]],features:[t.qOj],decls:27,vars:6,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"barcode","barcode_counter","text-end"],[1,"me-5"],["aria-hidden","true",1,"fa-solid","fa-barcode","fa-2x","icon"],["type","text","placeholder","Scan Barcode Here","autofocus","",2,"width","200px",3,"ngModel","keyup.enter","ngModelChange"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0)(1,"actions"),t.YNc(2,Uo,3,0,"button",1),t.qZA(),t.TgZ(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"span",6),t._uU(10,"Barcode"),t.qZA(),t._UZ(11,"i",7),t.TgZ(12,"input",8),t.NdJ("keyup.enter",function(){return o.onBarcodeEnter(o.productCode)})("ngModelChange",function(s){return o.productCode=s}),t.qZA()(),t.TgZ(13,"div",9)(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr"),t._UZ(18,"th",13),t.TgZ(19,"th"),t._uU(20,"Name"),t.qZA(),t.TgZ(21,"th",14),t._uU(22,"Code"),t.qZA(),t.TgZ(23,"th",14),t._uU(24,"Qty"),t.qZA()()(),t.TgZ(25,"tbody"),t.YNc(26,Eo,9,4,"tr",15),t.qZA()()()()()()()()()()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.roleService.global.Export),t.xp6(10),t.Q6J("ngModel",o.productCode),t.xp6(14),t.Q6J("ngForOf",o.products))},dependencies:[c.sg,c.O5,S.p,l.Fj,l.JJ,l.On,Q.b],styles:[".barcode_counter[_ngcontent-%COMP%]{position:fixed;right:10px;bottom:20px;background:#ffffff;border:1px solid #ddd;padding:8px 10px;border-radius:3px}.barcode_counter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;border:1px solid #b7b7b7;background-repeat:no-repeat;background-position:5px -211px;padding:4px 5px 4px 35px}.barcode_counter[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{position:relative;left:35px;vertical-align:middle}.barcode_counter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:5px;color:#868686;left:30px;position:relative;margin-left:-25px}"]})),n})()},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:jo},{path:"Tools/Product_Sheet",component:(()=>{class n extends C.n{constructor(e,o,i,s){super(e,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet"),(0,a.Z)(this,"csvConverter",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"matDialog",void 0),this.csvConverter=o,this.roleService=i,this.matDialog=s}openExportModal(){this.matDialog.open(B.H,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(D.O),t.Y36(u.N),t.Y36(k.uw))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-product-sheet"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"items","ngModel","ngModelChange"],["placeholder","Choose a category","bindLabel","Value","bindValue","Key",3,"items","ngModel","ngModelChange"],["bindLabel","Value","bindValue","Key",3,"items","ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","70px"],[2,"width","260px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[2,"word-spacing","20px"]],template:function(e,o){1&e&&t.YNc(0,Ho,43,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[c.sg,c.O5,S.p,l.JJ,l.On,T.w9,c.JJ,v.qU]})),n})()},{path:"Report/Adjustment",component:En},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:Mo},{path:"Adjustment/Stock_Take_by_CSV",component:Rn},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}];let Vo=(()=>{class n{}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275mod",t.oAB({type:n})),(0,a.Z)(n,"\u0275inj",t.cJS({imports:[I.Bz.forChild(Ko),I.Bz]})),n})();var Ro=d(12138),Mt=d(97392),Go=d(65131),Bo=d(59549),$o=d(77331),Wo=d(3238),zo=d(56709);let Xo=(()=>{class n{}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275mod",t.oAB({type:n})),(0,a.Z)(n,"\u0275inj",t.cJS({imports:[c.ez,Vo,S.R,l.u5,v.dr,P.ZU,T.A0,N.S,M.D,Tt.Q,F.d,L.Tx,X._t,_t.T,F.d,Y.T5,Ro.U5,Mt.Ps,tt.K,Go.X,h.AV,Bo.lN,$o.Hi,Wo.XK,zo.p9,Mt.Ps,lt.JX,ft.U,xt.G,Ct.E,It.O,yt.Gg,Dn]})),n})()},69753:(H,w,d)=>{d.d(w,{O:()=>c});var a=d(81180);class c{constructor(){(0,a.Z)(this,"ID",void 0),(0,a.Z)(this,"Name",void 0),(0,a.Z)(this,"Code",void 0),(0,a.Z)(this,"UnitCost",void 0),(0,a.Z)(this,"UnitPrice",void 0),(0,a.Z)(this,"UnitExpense",void 0),(0,a.Z)(this,"Start",void 0),(0,a.Z)(this,"Finish",void 0),(0,a.Z)(this,"UnitQuantity",void 0),(0,a.Z)(this,"PriceDiscount",void 0),(0,a.Z)(this,"UnitPriceOriginal",void 0),(0,a.Z)(this,"Description",void 0),(0,a.Z)(this,"UOM",void 0),(0,a.Z)(this,"UOMName",void 0),(0,a.Z)(this,"ImageUrl",void 0),(0,a.Z)(this,"TypeID",void 0),(0,a.Z)(this,"SellPriceType",void 0),(0,a.Z)(this,"UnitsInStock",void 0),(0,a.Z)(this,"Ordered",void 0),(0,a.Z)(this,"OrderPrice",void 0),(0,a.Z)(this,"OrderPriceDiscount",void 0),(0,a.Z)(this,"Taxable",void 0),(0,a.Z)(this,"LoyaltyPoint",void 0),(0,a.Z)(this,"LoyaltyPointRedeemable",void 0),(0,a.Z)(this,"CategoryName",void 0),(0,a.Z)(this,"CategoryID",void 0),(0,a.Z)(this,"CategoryTypeID",void 0),(0,a.Z)(this,"Serial",void 0),(0,a.Z)(this,"PriceTypeID",void 0),(0,a.Z)(this,"PriceNote",void 0),(0,a.Z)(this,"PaymentTypeID",void 0),(0,a.Z)(this,"Config",void 0),(0,a.Z)(this,"ThumbnailUrl",void 0),(0,a.Z)(this,"Storage",void 0),(0,a.Z)(this,"DiscountAmount",void 0),(0,a.Z)(this,"Component",void 0),(0,a.Z)(this,"PriceBook",void 0),(0,a.Z)(this,"VariantUnitQuantity",void 0),(0,a.Z)(this,"SerialNote",void 0)}}},3077:(H,w,d)=>{d.d(w,{T:()=>Z,v:()=>t});var a=d(81180),c=d(36895),l=d(94650),T=d(24006),P=d(65131),v=d(89156),S=d(83902);function M(g,D){if(1&g&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&g){const u=l.oxw();l.xp6(1),l.AsE(" Showing ",u.pageData.Filter.PageNumber*u.total-u.total+1," - ",u.pageData.Filter.PageNumber*u.total," ")}}function N(g,D){if(1&g&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&g){const u=l.oxw();l.xp6(1),l.AsE(" Showing ",u.pageData.Filter.RowCount*u.pageData.Filter.PageNumber-u.pageData.Filter.RowCount+1," - ",u.pageData.Filter.RowCount*u.pageData.Filter.PageNumber-u.pageData.Filter.RowCount+u.total," ")}}function I(g,D){if(1&g){const u=l.EpF();l.TgZ(0,"span",8),l.NdJ("click",function(){l.CHM(u);const m=l.oxw();return l.KtG(m.StoreRowsCountAPIResult())}),l.TgZ(1,"i",9),l._uU(2,"?"),l.qZA()()}}function C(g,D){if(1&g&&(l.TgZ(0,"span"),l._uU(1),l.ALo(2,"number"),l.qZA()),2&g){const u=l.oxw();l.xp6(1),l.hij(" of ",l.lcZ(2,1,u.listTotal),"")}}function x(g,D){if(1&g){const u=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(u);const m=l.oxw();return l.KtG(m.onPreviousPage())}),l._UZ(1,"i",11),l._uU(2," Previous"),l.qZA()}}function y(g,D){if(1&g){const u=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(u);const m=l.oxw();return l.KtG(m.onNextPage())}),l._UZ(1,"i",12),l._uU(2," Next"),l.qZA()}}let t=(()=>{class g{constructor(u){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"pageData",void 0),(0,a.Z)(this,"total",void 0),(0,a.Z)(this,"api",void 0),(0,a.Z)(this,"jumpToPage",new l.vpe),(0,a.Z)(this,"previousPage",new l.vpe),(0,a.Z)(this,"nextPage",new l.vpe),(0,a.Z)(this,"pageNumber",1),(0,a.Z)(this,"showingNumber",this.pageNumber),(0,a.Z)(this,"listTotal",-1),this.httpService=u}onJumpToPage(u){"Enter"===u.key&&(this.pageData.Filter.PageNumber=this.pageNumber,this.showingNumber=this.pageNumber,this.jumpToPage.emit())}onPreviousPage(){this.pageData.Filter.PageNumber-=1,this.pageNumber=this.pageData.Filter.PageNumber,this.showingNumber=this.pageNumber,this.previousPage.emit()}onNextPage(){this.pageData.Filter.PageNumber+=1,this.pageNumber=this.pageData.Filter.PageNumber,this.showingNumber=this.pageNumber,this.nextPage.emit()}StoreRowsCountAPIResult(){this.httpService.post("/api/"+this.api,JSON.stringify(this.pageData.Filter)).subscribe(u=>{this.listTotal=u.Count?u.Count:u,this.pageData.HideStoreApiCount=!0})}}return(0,a.Z)(g,"\u0275fac",function(u){return new(u||g)(l.Y36(v.O))}),(0,a.Z)(g,"\u0275cmp",l.Xpm({type:g,selectors:[["POS-complex-pagination"]],inputs:{pageData:"pageData",total:"total",api:"api"},outputs:{jumpToPage:"jumpToPage",previousPage:"previousPage",nextPage:"nextPage"},decls:12,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[4,"ngIf"],["style","cursor: pointer",3,"click",4,"ngIf"],["type","text","autoNum","",1,"text-end",2,"width","45px",3,"ngModel","keyup","ngModelChange"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm text-primary",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],[1,"border","p-3"],[1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-left"],[1,"fa-solid","fa-arrow-right"]],template:function(u,h){1&u&&(l.TgZ(0,"div",0)(1,"div",1)(2,"div",2),l.YNc(3,M,2,2,"span",3),l.YNc(4,N,2,2,"span",3),l.YNc(5,I,3,0,"span",4),l.YNc(6,C,3,3,"span",3),l._uU(7," records ~ Page "),l.TgZ(8,"input",5),l.NdJ("keyup",function(_){return h.onJumpToPage(_)})("ngModelChange",function(_){return h.pageNumber=_}),l.qZA()()(),l.TgZ(9,"div",6),l.YNc(10,x,3,0,"a",7),l.YNc(11,y,3,0,"a",7),l.qZA()()),2&u&&(l.xp6(3),l.Q6J("ngIf",h.pageData.Filter.RowCount==h.total),l.xp6(1),l.Q6J("ngIf",h.pageData.Filter.RowCount!=h.total),l.xp6(1),l.Q6J("ngIf",!h.pageData.HideStoreApiCount),l.xp6(1),l.Q6J("ngIf",h.pageData.HideStoreApiCount),l.xp6(2),l.Q6J("ngModel",h.pageNumber),l.xp6(2),l.Q6J("ngIf",1!=h.pageData.Filter.PageNumber),l.xp6(1),l.Q6J("ngIf",h.total>=h.pageData.Filter.RowCount))},dependencies:[c.O5,T.Fj,T.JJ,T.On,S.b,c.JJ]})),g})(),Z=(()=>{class g{}return(0,a.Z)(g,"\u0275fac",function(u){return new(u||g)}),(0,a.Z)(g,"\u0275mod",l.oAB({type:g})),(0,a.Z)(g,"\u0275inj",l.cJS({imports:[c.ez,T.u5,T.UX,P.X]})),g})()},11594:(H,w,d)=>{d.d(w,{K:()=>I,P:()=>N});var a=d(81180),c=d(94650),l=d(10266),T=d(71948),P=d(36895),v=d(24006);const S=function(C,x){return{color:C,"font-weight":x}};function M(C,x){if(1&C&&(c.TgZ(0,"mat-radio-button",2),c._uU(1),c.qZA()),2&C){const y=x.$implicit,t=x.index,Z=c.oxw();c.Akn(c.WLB(7,S,Z.model==y.Key&&Z.activeBold?"#0976b4":"",Z.model==y.Key&&Z.activeBold?"700":"")),c.Q6J("disabled",Z.exception==y.Value)("matTooltip",Z.title.length>0?Z.title[t]:"")("value",y.Key)("name",Z.name),c.xp6(1),c.hij("",y.Value," ")}}let N=(()=>{class C{constructor(){(0,a.Z)(this,"model",void 0),(0,a.Z)(this,"disabled",void 0),(0,a.Z)(this,"modelChange",new c.vpe),(0,a.Z)(this,"options",[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}]),(0,a.Z)(this,"border",!1),(0,a.Z)(this,"name",void 0),(0,a.Z)(this,"title",[]),(0,a.Z)(this,"exception",void 0),(0,a.Z)(this,"activeBold",void 0)}change(y){this.modelChange.emit(y)}}return(0,a.Z)(C,"\u0275fac",function(y){return new(y||C)}),(0,a.Z)(C,"\u0275cmp",c.Xpm({type:C,selectors:[["radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"disabled","ngModel","ngModelChange"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(y,t){1&y&&(c.TgZ(0,"mat-radio-group",0),c.NdJ("ngModelChange",function(g){return t.change(g)}),c.YNc(1,M,2,10,"mat-radio-button",1),c.qZA()),2&y&&(c.Q6J("disabled",t.disabled)("ngModel",t.model),c.xp6(1),c.Q6J("ngForOf",t.options))},dependencies:[T.VQ,T.U0,P.sg,v.JJ,v.On,l.gM],styles:[".mat-mdc-radio-button .mdc-radio{padding:8px;margin:0}.mat-mdc-radio-button .mdc-radio .mdc-radio__background:before{top:-8px;left:-8px;width:36px;height:36px}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:0;right:0;left:0;width:36px;height:36px}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#0976b4!important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{background-color:#0976b4!important;border-color:#0976b4!important}\n"],encapsulation:2})),C})(),I=(()=>{class C{}return(0,a.Z)(C,"\u0275fac",function(y){return new(y||C)}),(0,a.Z)(C,"\u0275mod",c.oAB({type:C})),(0,a.Z)(C,"\u0275inj",c.cJS({imports:[T.Fk,P.ez,v.u5,l.AV]})),C})()},29766:(H,w,d)=>{d.d(w,{Gg:()=>D,cL:()=>g});var a=d(36895),c=d(94650),l=d(24006),T=d(10805),P=d(51740);const v=["inputtext"];function S(u,h){1&u&&c.GkF(0)}function M(u,h){if(1&u&&(c.TgZ(0,"span",12),c._uU(1),c.qZA()),2&u){const m=c.oxw().$implicit,_=c.oxw();c.xp6(1),c.Oqu(_.field?_.resolveFieldData(m,_.field):m)}}function N(u,h){if(1&u){const m=c.EpF();c.TgZ(0,"span",13),c.NdJ("click",function(f){c.CHM(m);const O=c.oxw().index,j=c.oxw();return c.KtG(j.removeItem(f,O))}),c.qZA()}}const I=function(u){return{$implicit:u}};function C(u,h){if(1&u){const m=c.EpF();c.TgZ(0,"li",7,8),c.NdJ("click",function(f){const j=c.CHM(m).$implicit,E=c.oxw();return c.KtG(E.onItemClick(f,j))}),c.YNc(2,S,1,0,"ng-container",9),c.YNc(3,M,2,1,"span",10),c.YNc(4,N,1,0,"span",11),c.qZA()}if(2&u){const m=h.$implicit,_=c.oxw();c.xp6(2),c.Q6J("ngTemplateOutlet",_.itemTemplate)("ngTemplateOutletContext",c.VKq(4,I,m)),c.xp6(1),c.Q6J("ngIf",!_.itemTemplate),c.xp6(1),c.Q6J("ngIf",!_.disabled)}}function x(u,h){if(1&u){const m=c.EpF();c.TgZ(0,"li")(1,"i",14),c.NdJ("click",function(){c.CHM(m);const f=c.oxw();return c.KtG(f.clear())}),c.qZA()()}}const y=function(u,h){return{"p-inputtext p-chips-multiple-container":!0,"p-focus":u,"p-disabled":h}},t=function(u){return{"p-chips-clearable":u}},Z={provide:l.JU,useExisting:(0,c.Gpc)(()=>g),multi:!0};let g=(()=>{class u{constructor(m,_){this.el=m,this.cd=_,this.allowDuplicate=!0,this.showClear=!1,this.onAdd=new c.vpe,this.onRemove=new c.vpe,this.onFocus=new c.vpe,this.onBlur=new c.vpe,this.onChipClick=new c.vpe,this.onClear=new c.vpe,this.onModelChange=()=>{},this.onModelTouched=()=>{}}ngAfterContentInit(){this.templates.forEach(m=>{m.getType(),this.itemTemplate=m.template}),this.updateFilledState()}onClick(){this.inputViewChild.nativeElement.focus()}onInput(){this.updateFilledState()}onPaste(m){this.disabled||(this.separator&&((m.clipboardData||window.clipboardData).getData("Text").split(this.separator).forEach(f=>{this.addItem(m,f,!0)}),this.inputViewChild.nativeElement.value=""),this.updateFilledState())}updateFilledState(){this.filled=!(!this.value||0===this.value.length)||this.inputViewChild&&this.inputViewChild.nativeElement&&""!=this.inputViewChild.nativeElement.value}onItemClick(m,_){this.onChipClick.emit({originalEvent:m,value:_})}writeValue(m){this.value=m,this.updateMaxedOut(),this.updateFilledState(),this.cd.markForCheck()}registerOnChange(m){this.onModelChange=m}registerOnTouched(m){this.onModelTouched=m}setDisabledState(m){this.disabled=m,this.cd.markForCheck()}resolveFieldData(m,_){if(m&&_){if(-1==_.indexOf("."))return m[_];{let j=_.split("."),E=m;for(var f=0,O=j.length;f<O;++f)E=E[j[f]];return E}}return null}onInputFocus(m){this.focus=!0,this.onFocus.emit(m)}onInputBlur(m){this.focus=!1,this.addOnBlur&&this.inputViewChild.nativeElement.value&&this.addItem(m,this.inputViewChild.nativeElement.value,!1),this.onModelTouched(),this.onBlur.emit(m)}removeItem(m,_){if(this.disabled)return;let f=this.value[_];this.value=this.value.filter((O,j)=>j!=_),this.onModelChange(this.value),this.onRemove.emit({originalEvent:m,value:f}),this.updateFilledState(),this.updateMaxedOut()}addItem(m,_,f){this.value=this.value||[],_&&_.trim().length&&(this.allowDuplicate||-1===this.value.indexOf(_))&&(this.value=[...this.value,_],this.onModelChange(this.value),this.onAdd.emit({originalEvent:m,value:_})),this.updateFilledState(),this.updateMaxedOut(),this.inputViewChild.nativeElement.value="",f&&m.preventDefault()}clear(){this.value=null,this.updateFilledState(),this.onModelChange(this.value),this.onClear.emit()}onKeydown(m){switch(m.which){case 8:if(0===this.inputViewChild.nativeElement.value.length&&this.value&&this.value.length>0){this.value=[...this.value];let _=this.value.pop();this.onModelChange(this.value),this.onRemove.emit({originalEvent:m,value:_}),this.updateFilledState()}break;case 13:this.addItem(m,this.inputViewChild.nativeElement.value,!0);break;case 9:this.addOnTab&&""!==this.inputViewChild.nativeElement.value&&this.addItem(m,this.inputViewChild.nativeElement.value,!0);break;default:this.max&&this.value&&this.max===this.value.length?m.preventDefault():this.separator&&(this.separator===m.key||m.key.match(this.separator))&&this.addItem(m,this.inputViewChild.nativeElement.value,!0)}}updateMaxedOut(){this.inputViewChild&&this.inputViewChild.nativeElement&&(this.max&&this.value&&this.max===this.value.length?(this.inputViewChild.nativeElement.blur(),this.inputViewChild.nativeElement.disabled=!0):(this.disabled&&this.inputViewChild.nativeElement.blur(),this.inputViewChild.nativeElement.disabled=this.disabled||!1))}}return u.\u0275fac=function(m){return new(m||u)(c.Y36(c.SBq),c.Y36(c.sBO))},u.\u0275cmp=c.Xpm({type:u,selectors:[["p-chips"]],contentQueries:function(m,_,f){if(1&m&&c.Suo(f,T.jx,4),2&m){let O;c.iGM(O=c.CRH())&&(_.templates=O)}},viewQuery:function(m,_){if(1&m&&c.Gf(v,5),2&m){let f;c.iGM(f=c.CRH())&&(_.inputViewChild=f.first)}},hostAttrs:[1,"p-element","p-inputwrapper"],hostVars:6,hostBindings:function(m,_){2&m&&c.ekj("p-inputwrapper-filled",_.filled)("p-inputwrapper-focus",_.focus)("p-chips-clearable",_.showClear)},inputs:{style:"style",styleClass:"styleClass",disabled:"disabled",field:"field",placeholder:"placeholder",max:"max",ariaLabelledBy:"ariaLabelledBy",tabindex:"tabindex",inputId:"inputId",allowDuplicate:"allowDuplicate",inputStyle:"inputStyle",inputStyleClass:"inputStyleClass",addOnTab:"addOnTab",addOnBlur:"addOnBlur",separator:"separator",showClear:"showClear"},outputs:{onAdd:"onAdd",onRemove:"onRemove",onFocus:"onFocus",onBlur:"onBlur",onChipClick:"onChipClick",onClear:"onClear"},features:[c._Bn([Z])],decls:7,vars:21,consts:[[3,"ngClass","ngStyle","click"],[3,"ngClass"],["class","p-chips-token",3,"click",4,"ngFor","ngForOf"],[1,"p-chips-input-token",3,"ngClass"],["type","text",3,"disabled","ngStyle","keydown","input","paste","focus","blur"],["inputtext",""],[4,"ngIf"],[1,"p-chips-token",3,"click"],["token",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","p-chips-token-label",4,"ngIf"],["class","p-chips-token-icon pi pi-times-circle",3,"click",4,"ngIf"],[1,"p-chips-token-label"],[1,"p-chips-token-icon","pi","pi-times-circle",3,"click"],[1,"p-chips-clear-icon","pi","pi-times",3,"click"]],template:function(m,_){1&m&&(c.TgZ(0,"div",0),c.NdJ("click",function(){return _.onClick()}),c.TgZ(1,"ul",1),c.YNc(2,C,5,6,"li",2),c.TgZ(3,"li",3)(4,"input",4,5),c.NdJ("keydown",function(O){return _.onKeydown(O)})("input",function(){return _.onInput()})("paste",function(O){return _.onPaste(O)})("focus",function(O){return _.onInputFocus(O)})("blur",function(O){return _.onInputBlur(O)}),c.qZA()(),c.YNc(6,x,2,0,"li",6),c.qZA()()),2&m&&(c.Tol(_.styleClass),c.Q6J("ngClass","p-chips p-component")("ngStyle",_.style),c.xp6(1),c.Q6J("ngClass",c.WLB(16,y,_.focus,_.disabled)),c.xp6(1),c.Q6J("ngForOf",_.value),c.xp6(1),c.Q6J("ngClass",c.VKq(19,t,_.showClear&&!_.disabled)),c.xp6(1),c.Tol(_.inputStyleClass),c.Q6J("disabled",_.disabled)("ngStyle",_.inputStyle),c.uIk("id",_.inputId)("placeholder",_.value&&_.value.length?null:_.placeholder)("tabindex",_.tabindex)("aria-labelledby",_.ariaLabelledBy),c.xp6(2),c.Q6J("ngIf",null!=_.value&&_.filled&&!_.disabled&&_.showClear))},dependencies:[a.mk,a.sg,a.O5,a.tP,a.PC],styles:[".p-chips{display:inline-flex}.p-chips-multiple-container{margin:0;padding:0;list-style-type:none;cursor:text;overflow:hidden;display:flex;align-items:center;flex-wrap:wrap}.p-chips-token{cursor:default;display:inline-flex;align-items:center;flex:0 0 auto;max-width:100%}.p-chips-token-label{min-width:0%;overflow:auto}.p-chips-token-label::-webkit-scrollbar{display:none}.p-chips-input-token{flex:1 1 auto;display:inline-flex}.p-chips-token-icon{cursor:pointer}.p-chips-input-token input{border:0 none;outline:0 none;background-color:transparent;margin:0;padding:0;box-shadow:none;border-radius:0;width:100%}.p-fluid .p-chips{display:flex}.p-chips-clear-icon{position:absolute;top:50%;margin-top:-.5rem;cursor:pointer}.p-chips-clearable .p-inputtext{position:relative}\n"],encapsulation:2,changeDetection:0}),u})(),D=(()=>{class u{}return u.\u0275fac=function(m){return new(m||u)},u.\u0275mod=c.oAB({type:u}),u.\u0275inj=c.cJS({imports:[a.ez,P.j,T.m8,P.j,T.m8]}),u})()},51740:(H,w,d)=>{d.d(w,{j:()=>P,o:()=>T});var a=d(94650),c=d(36895),l=d(24006);let T=(()=>{class v{constructor(M,N,I){this.el=M,this.ngModel=N,this.cd=I}ngAfterViewInit(){this.updateFilledState(),this.cd.detectChanges()}ngDoCheck(){this.updateFilledState()}onInput(M){this.updateFilledState()}updateFilledState(){this.filled=this.el.nativeElement.value&&this.el.nativeElement.value.length||this.ngModel&&this.ngModel.model}}return v.\u0275fac=function(M){return new(M||v)(a.Y36(a.SBq),a.Y36(l.On,8),a.Y36(a.sBO))},v.\u0275dir=a.lG2({type:v,selectors:[["","pInputText",""]],hostAttrs:[1,"p-inputtext","p-component","p-element"],hostVars:2,hostBindings:function(M,N){1&M&&a.NdJ("input",function(C){return N.onInput(C)}),2&M&&a.ekj("p-filled",N.filled)}}),v})(),P=(()=>{class v{}return v.\u0275fac=function(M){return new(M||v)},v.\u0275mod=a.oAB({type:v}),v.\u0275inj=a.cJS({imports:[c.ez]}),v})()}}]);