dealpos 10.7.7 → 10.8.1

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.
Files changed (58) hide show
  1. package/POS/116.c306121a81295ab8b3ec.js +1 -0
  2. package/POS/126.89e782a007b66eb7bb2f.js +1 -0
  3. package/POS/140.40ef3a1ce6a1d50edea1.js +1 -0
  4. package/POS/149.0e563068412de1e8e3a1.js +1 -0
  5. package/POS/151.15a82c2f1098e1d31371.js +1 -0
  6. package/POS/195.dcd59b5b53a65edbbab8.js +1 -0
  7. package/POS/{239.6191065c633a14161c57.js → 239.dab61bc73c3922cb94c5.js} +0 -0
  8. package/POS/24.bdd2b07e8b574d37f24c.js +1 -0
  9. package/POS/272.6ab0d22e453dad4c5367.js +1 -0
  10. package/POS/316.04c3620d79cfa41ce6ec.js +1 -0
  11. package/POS/{24.e93be48464b4c409bbce.js → 36.1d09dc58f9c1d525c0c5.js} +1 -1
  12. package/POS/435.0a54e2ad6b49b6ff1ce2.js +1 -0
  13. package/POS/467.2915a50d19c88a78db53.js +1 -0
  14. package/POS/{542.fe6bc53adef223e47b49.js → 542.91990e1875195957526c.js} +0 -0
  15. package/POS/564.4b57507c99c39f4ccd9a.js +1 -0
  16. package/POS/58.194ff55f9e603827d098.js +1 -0
  17. package/POS/588.81c1c05b85a8977dc61b.js +1 -0
  18. package/POS/{598.babb0cd6f0a69945960c.js → 598.eee333e3463bac5ab23c.js} +0 -0
  19. package/POS/661.3f26fa2eccf0affea8ec.js +1 -0
  20. package/POS/{731.0d5b663d4c40baa79273.js → 731.5dbd5a11a37efd1debfe.js} +0 -0
  21. package/POS/732.d22246c25c607a990645.js +1 -0
  22. package/POS/832.f257d248a68a467971fa.js +1 -0
  23. package/POS/862.a58f9358698072e975eb.js +1 -0
  24. package/POS/94.fa6aeaf180b79e76266d.js +1 -0
  25. package/POS/942.b075e9b86bf8a984cb22.js +1 -0
  26. package/POS/{952.6deb17e8024195b24e02.js → 952.360046fe32ce60f90ed5.js} +1 -1
  27. package/POS/967.41f548c072fcfaf7567c.js +1 -0
  28. package/POS/968.54c25d8c8393fe3250a2.js +1 -0
  29. package/POS/common.af67f7e5e66906586407.js +1 -0
  30. package/POS/main.353cc4edd034d0829c8b.js +1 -0
  31. package/POS/pos-index.html +2 -2
  32. package/POS/runtime.5c8a4fc1b1833f361371.js +1 -0
  33. package/POS/{styles.36816a18f007fc2d796c.css → styles.b97c0b00038423e30f94.css} +2 -2
  34. package/Scripts/Angular/Controller/Sell.js +8 -8
  35. package/package.json +1 -1
  36. package/POS/116.96de79e8ba2cd6abcb6f.js +0 -1
  37. package/POS/126.e16808e02de4c9fc26f9.js +0 -1
  38. package/POS/140.49ba72bf74ceca417968.js +0 -1
  39. package/POS/149.05872e4a252a57975828.js +0 -1
  40. package/POS/195.dc574c53ade3e1f3abfc.js +0 -1
  41. package/POS/228.b07787e26475edef5b4c.js +0 -1
  42. package/POS/272.04b519487b683c9931c1.js +0 -1
  43. package/POS/316.d7880603c387c18b0533.js +0 -1
  44. package/POS/467.31f7f06a5730be126080.js +0 -1
  45. package/POS/564.1b2e52f18a9c2a611c6b.js +0 -1
  46. package/POS/588.d16b8265d4d96a35c3a8.js +0 -1
  47. package/POS/661.90842fad8f892567b5a6.js +0 -1
  48. package/POS/732.8730fe7e3c3eff70e208.js +0 -1
  49. package/POS/774.bf6d4401357e434844ec.js +0 -1
  50. package/POS/832.6f0f380adbe8a375ae97.js +0 -1
  51. package/POS/862.e1337548a721c71883ce.js +0 -1
  52. package/POS/94.8507f081e09f84f2e385.js +0 -1
  53. package/POS/942.e5294706af16e25e32f1.js +0 -1
  54. package/POS/968.10c37edcb02b2021d4cb.js +0 -1
  55. package/POS/992.514db68005b752af99ac.js +0 -1
  56. package/POS/common.c378b61ecbb5f7d84d27.js +0 -1
  57. package/POS/main.18dfc39e810a32166ecf.js +0 -1
  58. package/POS/runtime.d75ed3e2521dd057e767.js +0 -1
@@ -0,0 +1 @@
1
+ (self.webpackChunkinv_web_app=self.webpackChunkinv_web_app||[]).push([[116],{25116:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VariantsModule:()=>ui});var i=n(38583),o=n(33018),r=n(19171);let a=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-Variants"]],decls:1,vars:0,template:function(t,e){1&t&&o._UZ(0,"router-outlet")},directives:[r.lC],styles:[""]}),t})();var l=n(95369),s=n(79765),c=n(46782),u=n(20143),d=n(65107),g=n(39075),Z=n(49344),p=n(34133),h=n(95602),v=n(36691),f=n(90665),m=n(8136),A=n(86640),T=n(82613),q=n(54585);const b=function(t){return{"bg-light":t}};function y(t,e){if(1&t&&(o.TgZ(0,"span",16),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw();o.Q6J("ngClass",o.VKq(2,b,!e.variantLoad.HasInventoryEdit)),o.xp6(1),o.Oqu(t.getUnitsInStock)}}function x(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"input",17),o.NdJ("ngModelChange",function(e){o.CHM(t);const n=o.oxw().$implicit,i=o.oxw();return n.setUnitsInStock=e,i.updateEntities()}),o.qZA()}if(2&t){const t=o.oxw().$implicit;o.Q6J("ngModel",t.getUnitsInStock)}}function I(t,e){if(1&t&&(o.TgZ(0,"span",16),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw();o.Q6J("ngClass",o.VKq(2,b,!e.variantLoad.HasProductCreate&&!e.variantLoad.HasProductEditor)),o.xp6(1),o.hij(" ",t.getMinStock," ")}}function M(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"input",17),o.NdJ("ngModelChange",function(e){o.CHM(t);const n=o.oxw().$implicit,i=o.oxw();return n.setMinStock=e,i.updateEntities()}),o.qZA()}if(2&t){const t=o.oxw().$implicit;o.Q6J("ngModel",t.getMinStock)}}function C(t,e){if(1&t&&(o.TgZ(0,"span",16),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw();o.Q6J("ngClass",o.VKq(2,b,!e.variantLoad.HasProductCreate&&!e.variantLoad.HasProductEditor)),o.xp6(1),o.hij(" ",t.getMaxStock," ")}}function U(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"input",17),o.NdJ("ngModelChange",function(e){o.CHM(t);const n=o.oxw().$implicit,i=o.oxw();return n.setMaxStock=e,i.updateEntities()}),o.qZA()}if(2&t){const t=o.oxw().$implicit;o.Q6J("ngModel",t.getMaxStock)}}function P(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td",12),o._uU(2),o.qZA(),o.TgZ(3,"td",13),o._uU(4,":"),o.qZA(),o.TgZ(5,"td"),o.YNc(6,y,2,4,"span",14),o.YNc(7,x,1,1,"input",15),o.qZA(),o.TgZ(8,"td"),o.YNc(9,I,2,4,"span",14),o.YNc(10,M,1,1,"input",15),o.qZA(),o.TgZ(11,"td"),o.YNc(12,C,2,4,"span",14),o.YNc(13,U,1,1,"input",15),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(2),o.Oqu(t.getName),o.xp6(4),o.Q6J("ngIf",!n.variantLoad.HasInventoryEdit),o.xp6(1),o.Q6J("ngIf",n.variantLoad.HasInventoryEdit),o.xp6(2),o.Q6J("ngIf",!n.variantLoad.HasProductCreate&&!n.variantLoad.HasProductEditor),o.xp6(1),o.Q6J("ngIf",n.variantLoad.HasProductCreate||n.variantLoad.HasProductEditor),o.xp6(2),o.Q6J("ngIf",!n.variantLoad.HasProductCreate&&!n.variantLoad.HasProductEditor),o.xp6(1),o.Q6J("ngIf",n.variantLoad.HasProductCreate||n.variantLoad.HasProductEditor)}}function _(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"input",20),o.NdJ("input",function(e){return o.CHM(t),o.oxw(2).updateMinStock(e.target.value)}),o.qZA()}}function J(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"input",20),o.NdJ("input",function(e){return o.CHM(t),o.oxw(2).updateMaxStock(e.target.value)}),o.qZA()}}function O(t,e){if(1&t&&(o.TgZ(0,"tfoot"),o.TgZ(1,"tr"),o._UZ(2,"td",18),o.TgZ(3,"td"),o.YNc(4,_,1,0,"input",19),o.qZA(),o.TgZ(5,"td"),o.YNc(6,J,1,0,"input",19),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(4),o.Q6J("ngIf",t.variantLoad.HasProductCreate||t.variantLoad.HasProductEditor),o.xp6(2),o.Q6J("ngIf",t.variantLoad.HasProductCreate||t.variantLoad.HasProductEditor)}}let S=(()=>{class t{constructor(t){this.variantService=t,this.entities=[],this.destroy$=new s.xQ}ngOnInit(){this.subscribeEntites(),this.subscribeVariantLoad()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}subscribeEntites(){this.variantService.getEntities$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.entities=t})}subscribeVariantLoad(){this.variantService.getVariantLoad$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantLoad=t})}updateMinStock(t){this.entities=this.entities.map(e=>(e.setMinStock=t,e)),this.updateEntities()}updateMaxStock(t){this.entities=this.entities.map(e=>(e.setMaxStock=t,e)),this.updateEntities()}updateEntities(){this.variantService.updateEntities(this.entities)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-inventory"]],decls:17,vars:6,consts:[[1,"table","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],[1,"border-right",3,"click"],[1,"fas","fa-sort",2,"cursor","pointer"],[1,"border-right",2,"width","10px"],[1,"border-right","text-right",2,"width","120px"],["title","Minimum Inventory for this outlet before it gets re-alerted",1,"border-right","text-right",2,"width","120px"],["title","Maximum Inventory that this outlet should have",1,"border-right","text-right",2,"width","120px"],[1,"table-bordered"],[4,"ngFor","ngForOf"],[4,"ngIf"],[2,"vertical-align","middle"],[1,"sep"],["class","form-control text-right",3,"ngClass",4,"ngIf"],["type","text","class","form-control text-right","autoNum","",3,"ngModel","ngModelChange",4,"ngIf"],[1,"form-control","text-right",3,"ngClass"],["type","text","autoNum","",1,"form-control","text-right",3,"ngModel","ngModelChange"],["colspan","3"],["placeholder","set all outlet","class","form-control text-right","autoNum","",3,"input",4,"ngIf"],["placeholder","set all outlet","autoNum","",1,"form-control","text-right",3,"input"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr",2),o.TgZ(3,"th",3),o.NdJ("click",function(){return e.outletNameSortDir=e.outletNameSortDir?null:"asc"}),o._uU(4," Outlet "),o._UZ(5,"i",4),o.qZA(),o._UZ(6,"th",5),o.TgZ(7,"th",6),o._uU(8,"Inventory"),o.qZA(),o.TgZ(9,"th",7),o._uU(10," Buffer "),o.qZA(),o.TgZ(11,"th",8),o._uU(12," Threshold "),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"tbody",9),o.YNc(14,P,14,7,"tr",10),o.ALo(15,"sortBy"),o.qZA(),o.YNc(16,O,7,2,"tfoot",11),o.qZA()),2&t&&(o.xp6(14),o.Q6J("ngForOf",o.Dn7(15,2,e.entities,e.outletNameSortDir,"Name")),o.xp6(2),o.Q6J("ngIf",(null==e.variantLoad?null:e.variantLoad.Entities.length)>1))},directives:[i.sg,i.O5,i.mk,f.Fj,m.b,f.JJ,f.On],pipes:[q.W7],styles:[""]}),t})();var w=n(64821),N=n(22238),D=n(38096),Q=n(18134);let k=(()=>{class t{constructor(t,e,n){this.dialogRef=e,this.variantService=n,this.destroy$=new s.xQ,this.composite=Object.assign(new w.L,t)}ngOnInit(){this.initModalConfig()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initModalConfig(){this.modalConfig=new D.O,this.modalConfig.title="Add New Composite?",this.modalConfig.hideMoreButton=!0}onSelectProduct(t){this.variantService.getVariantById(t).pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.setComposite(t)})}setComposite(t){this.composite.setVariant={Variant:t},this.composite.setComponentID=t.getID,this.composite.setQuantity=1,this.composite.setCostCurrency=t.getCostCurrencyID,this.composite.setPriceCurrency=t.getPriceCurrencyID}onOk(){this.dialogRef.close(this.composite)}onClose(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(N.WI),o.Y36(N.so),o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-modal-component"]],decls:14,vars:3,consts:[[3,"config","onOk","onCancel"],[1,"container-fluid"],[1,"row"],[1,"col-sm-12",2,"width","100%"],[1,"form-label-group"],["id","inputNameorCode","inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"form-control",3,"inputTextValue","onSelect"],["for","inputNameorCode"],["type","text","id","QtyComposite","placeholder","Quantity","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","QtyComposite"]],template:function(t,e){1&t&&(o.TgZ(0,"modal-material",0),o.NdJ("onOk",function(){return e.onOk()})("onCancel",function(){return e.onClose()}),o.TgZ(1,"content"),o.TgZ(2,"div",1),o.TgZ(3,"div",2),o.TgZ(4,"div",3),o.TgZ(5,"div",4),o.TgZ(6,"autocompleteV2",5),o.NdJ("onSelect",function(t){return e.onSelectProduct(t)}),o.qZA(),o.TgZ(7,"label",6),o._uU(8,"Input product name / code :"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(9,"div",3),o.TgZ(10,"div",4),o.TgZ(11,"input",7),o.NdJ("ngModelChange",function(t){return e.composite.setQuantity=t}),o.qZA(),o.TgZ(12,"label",8),o._uU(13,"Quantity"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("config",e.modalConfig),o.xp6(6),o.Q6J("inputTextValue",null==e.composite||null==e.composite.getVariant?null:e.composite.getVariant.getName),o.xp6(5),o.Q6J("ngModel",null==e.composite?null:e.composite.getQuantity))},directives:[Q.M,v.J,f.Fj,m.b,f.JJ,f.On],styles:[""]}),t})();function L(t,e){1&t&&(o.TgZ(0,"th",12),o._uU(1,"Unit Cost"),o.qZA())}function V(t,e){1&t&&(o.TgZ(0,"th",12),o._uU(1,"Total"),o.qZA())}function Y(t,e){if(1&t&&(o.TgZ(0,"td",15),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,null==t.getVariant||null==t.getVariant.Variant?null:t.getVariant.Variant.getUnitCost))}}function H(t,e){if(1&t&&(o.TgZ(0,"td",15),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,(null==t.getVariant||null==t.getVariant.Variant?null:t.getVariant.Variant.getUnitCost)*t.getQuantity))}}function R(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr",13),o.NdJ("click",function(){const e=o.CHM(t),n=e.$implicit,i=e.index;return o.oxw().onEditComposite(n,i)}),o.TgZ(1,"td"),o.TgZ(2,"i",14),o.NdJ("click",function(){const e=o.CHM(t).index;return o.oxw().composites.splice(e,1)}),o.qZA(),o.qZA(),o.TgZ(3,"td"),o._uU(4),o.qZA(),o.TgZ(5,"td"),o._uU(6),o.qZA(),o.TgZ(7,"td",15),o._uU(8),o.qZA(),o.TgZ(9,"td"),o._uU(10),o.qZA(),o.YNc(11,Y,3,3,"td",16),o.YNc(12,H,3,3,"td",16),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.xp6(4),o.Oqu(null==t||null==t.getVariant?null:t.getVariant.Variant.getName),o.xp6(2),o.Oqu(null==t||null==t.getVariant?null:t.getVariant.Variant.getCode),o.xp6(2),o.Oqu(null==t?null:t.getQuantity),o.xp6(2),o.Oqu(null==t||null==t.getVariant?null:t.getVariant.Variant.getUOMName),o.xp6(1),o.Q6J("ngIf",n.variantLoad.HasRoleCost),o.xp6(1),o.Q6J("ngIf",n.variantLoad.HasRoleCost)}}function $(t,e){if(1&t&&(o.TgZ(0,"tfoot"),o.TgZ(1,"tr"),o.TgZ(2,"td",17),o._uU(3,"Total"),o.qZA(),o.TgZ(4,"td",15),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(5),o.hij(" ",o.lcZ(6,1,t.totalCompositeCost),"")}}let F=(()=>{class t{constructor(t,e){this.dialog=t,this.variantService=e,this.destroy$=new s.xQ,this.composites=[]}ngOnInit(){this.subscribeVariantLoad(),this.subscribeComposites()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}subscribeVariantLoad(){this.variantService.getVariantLoad$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantLoad=t})}subscribeComposites(){this.variantService.getComposites$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.composites=t,this.calculateComposite()})}onAddComposite(){this.dialog.open(k,{data:new w.L}).afterClosed().pipe((0,c.R)(this.destroy$)).subscribe(t=>{t&&(this.addNewComposite(t),this.calculateComposite())})}addNewComposite(t){let e=this.composites.findIndex(e=>e.getVariant.Variant.getID===t.getVariant.Variant.getID);-1!==e?this.composites[e]=t:this.composites.push(t),this.variantService.updateComposites(this.composites)}calculateComposite(){this.totalCompositeCost=this.variantService.calculateCompositeCost(this.composites)}onEditComposite(t,e){this.dialog.open(k,{data:t}).afterClosed().pipe((0,c.R)(this.destroy$)).subscribe(t=>{t&&(this.composites[e]=t,this.variantService.updateComposites(this.composites),this.calculateComposite())})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(N.uw),o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-component"]],decls:19,vars:4,consts:[[1,"table","table-bordered","custom-table"],[1,"table-secondary"],["width","15px",1,"border-right"],["type","button","title","Add Component",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],[1,"border-right"],["width","200px",1,"border-right"],["width","65px",1,"border-right","text-right"],["width","65px",1,"border-right"],["class","border-right text-right","width","100px",4,"ngIf"],[3,"click",4,"ngFor","ngForOf"],[4,"ngIf"],["width","100px",1,"border-right","text-right"],[3,"click"],[1,"fa","fa-times","text-danger",2,"cursor","pointer",3,"click"],[1,"text-right"],["class","text-right",4,"ngIf"],["colspan","6"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead"),o.TgZ(2,"tr",1),o.TgZ(3,"th",2),o.TgZ(4,"button",3),o.NdJ("click",function(){return e.onAddComposite()}),o._UZ(5,"i",4),o.qZA(),o.qZA(),o.TgZ(6,"th",5),o._uU(7,"Name"),o.qZA(),o.TgZ(8,"th",6),o._uU(9,"Code"),o.qZA(),o.TgZ(10,"th",7),o._uU(11,"Qty"),o.qZA(),o.TgZ(12,"th",8),o._uU(13,"Uom"),o.qZA(),o.YNc(14,L,2,0,"th",9),o.YNc(15,V,2,0,"th",9),o.qZA(),o.qZA(),o.TgZ(16,"tbody"),o.YNc(17,R,13,6,"tr",10),o.qZA(),o.YNc(18,$,7,3,"tfoot",11),o.qZA()),2&t&&(o.xp6(14),o.Q6J("ngIf",e.variantLoad.HasRoleCost),o.xp6(1),o.Q6J("ngIf",e.variantLoad.HasRoleCost),o.xp6(2),o.Q6J("ngForOf",e.composites),o.xp6(1),o.Q6J("ngIf",e.variantLoad.HasRoleCost))},directives:[i.O5,i.sg],pipes:[i.JJ],styles:[""]}),t})();var E=n(70338);function j(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",14),o.TgZ(1,"input",19),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().outletPrice.setExtraCost=e}),o.qZA(),o.TgZ(2,"label",20),o._uU(3,"Extra Cost"),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngModel",t.outletPrice.getExtraCost)("disabled",!t.variantLoad.HasRoleCost)}}const B=function(t){return{selected:t}};let G=(()=>{class t{constructor(t,e){this.data=t,this.dialogRef=e,this.variantLoad=t.variantLoad,this.outletPrice=Object.assign(new E.t,t.outletPrice)}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new D.O,this.modalConfig.title="Add New Outlet Price?",this.modalConfig.hideMoreButton=!0,this.modalConfig.customWidth="500px"}onOk(){this.dialogRef.close(this.outletPrice)}onClose(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(N.WI),o.Y36(N.so))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-modal-outlet-price"]],decls:33,vars:16,consts:[[3,"config","onOk","onCancel"],[1,"container-fluid"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group","flexRow",3,"ngClass"],[1,"form-label-group",3,"ngClass"],["id","typeID","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"productform",3,"items","ngModel","ngModelChange"],["for","typeID"],["for","selectedOutlet"],[1,"col-sm-8"],["class","form-label-group flexRow",4,"ngIf"],[1,"col-sm-4"],[1,"form-label-group"],["id","typeID","bindLabel","Symbol","bindValue","ID",1,"productform",3,"items","ngModel","ngModelChange"],[1,"form-label-group","flexRow"],["type","text","id","outletPrice","placeholder","Price","autoNum","",1,"form-control","with-currency","mr-3",3,"ngModel","ngModelChange"],["for","outletPrice"],["type","text","id","outletDisc","placeholder","Disc%","autoNum","",1,"form-control","percentage-input",3,"ngModel","ngModelChange"],["for","outletDisc"],["type","text","id","outletCost","placeholder","Extra Cost","autoNum","",1,"form-control","with-currency","mr-3",3,"ngModel","disabled","ngModelChange"],["for","outletCost"]],template:function(t,e){1&t&&(o.TgZ(0,"modal-material",0),o.NdJ("onOk",function(){return e.onOk()})("onCancel",function(){return e.onClose()}),o.TgZ(1,"content"),o.TgZ(2,"div",1),o.TgZ(3,"div",2),o.TgZ(4,"div",3),o.TgZ(5,"div",4),o.TgZ(6,"div",5),o.TgZ(7,"ng-select",6),o.NdJ("ngModelChange",function(t){return e.outletPrice.setEntityID=t}),o.qZA(),o.TgZ(8,"label",7),o._uU(9,"Type"),o.qZA(),o.qZA(),o.TgZ(10,"label",8),o._uU(11,"Choose Outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(12,"div",2),o.TgZ(13,"div",9),o.YNc(14,j,4,2,"div",10),o.qZA(),o.TgZ(15,"div",11),o.TgZ(16,"div",12),o.TgZ(17,"ng-select",13),o.NdJ("ngModelChange",function(t){return e.outletPrice.setCostCurrencyID=t}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(18,"div",2),o.TgZ(19,"div",9),o.TgZ(20,"div",14),o.TgZ(21,"input",15),o.NdJ("ngModelChange",function(t){return e.outletPrice.setUnitPrice=t}),o.qZA(),o.TgZ(22,"label",16),o._uU(23,"Price"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(24,"div",11),o.TgZ(25,"div",12),o.TgZ(26,"ng-select",13),o.NdJ("ngModelChange",function(t){return e.outletPrice.setPriceCurrencyID=t}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(27,"div",2),o.TgZ(28,"div",9),o.TgZ(29,"div",12),o.TgZ(30,"input",17),o.NdJ("ngModelChange",function(t){return e.outletPrice.setPriceDiscount=t}),o.qZA(),o.TgZ(31,"label",18),o._uU(32,"Disc%"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("config",e.modalConfig),o.xp6(5),o.Q6J("ngClass",o.VKq(12,B,null!==e.outletPrice.getEntityID)),o.xp6(1),o.Q6J("ngClass",o.VKq(14,B,null!==e.outletPrice.getEntityID)),o.xp6(1),o.Q6J("items",e.variantLoad.Entities)("ngModel",e.outletPrice.getEntityID),o.xp6(7),o.Q6J("ngIf",e.variantLoad.HasRoleCost),o.xp6(3),o.Q6J("items",e.variantLoad.Currencies)("ngModel",e.outletPrice.getCostCurrencyID),o.xp6(4),o.Q6J("ngModel",e.outletPrice.getUnitPrice),o.xp6(5),o.Q6J("items",e.variantLoad.Currencies)("ngModel",e.outletPrice.getPriceCurrencyID),o.xp6(4),o.Q6J("ngModel",e.outletPrice.getPriceDiscount))},directives:[Q.M,i.mk,A.w9,f.JJ,f.On,i.O5,f.Fj,m.b],styles:["ng-dropdown-panel.currency-select[_ngcontent-%COMP%] {\n z-index: 1100;\n}"]}),t})();function X(t,e){if(1&t&&(o.TgZ(0,"td"),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw();o.xp6(1),o.Oqu(e.getCurrencySymbolByID(t.CostCurrencyID)+" "+o.lcZ(2,1,t.ExtraCost))}}function z(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr",10),o.NdJ("click",function(){const e=o.CHM(t),n=e.$implicit,i=e.index;return o.oxw().onUpdateOutletPrice(n,i)}),o.TgZ(1,"td"),o.TgZ(2,"i",11),o.NdJ("click",function(){const e=o.CHM(t).index;return o.oxw().outletPrices.splice(e,1)}),o.qZA(),o.qZA(),o.TgZ(3,"td"),o._uU(4),o.qZA(),o.YNc(5,X,3,3,"td",12),o.TgZ(6,"td"),o._uU(7),o.ALo(8,"number"),o.qZA(),o.TgZ(9,"td"),o._uU(10),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.xp6(4),o.Oqu(n.getEntityNameByID(t.EntityID)),o.xp6(1),o.Q6J("ngIf",n.variantLoad.HasRoleCost),o.xp6(2),o.Oqu(n.getCurrencySymbolByID(t.PriceCurrencyID)+" "+o.lcZ(8,4,t.UnitPrice)),o.xp6(3),o.Oqu(t.PriceDiscount+"%")}}let K=(()=>{class t{constructor(t,e){this.dialog=t,this.variantService=e,this.destroy$=new s.xQ,this.outletPrices=[]}ngOnInit(){this.subscribeVariantLoad(),this.subscribeOutletPrices()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}subscribeVariantLoad(){this.variantService.getVariantLoad$().subscribe(t=>{this.variantLoad=t})}subscribeOutletPrices(){this.variantService.getOutletPrices$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.outletPrices=t})}onAddOutletPrice(){this.dialog.open(G,{data:{variantLoad:this.variantLoad,outletPrice:new E.t}}).afterClosed().pipe((0,c.R)(this.destroy$)).subscribe(t=>{t&&(this.outletPrices.push(t),this.variantService.updateOutletPrices(this.outletPrices))})}onUpdateOutletPrice(t,e){this.dialog.open(G,{data:{variantLoad:this.variantLoad,outletPrice:t}}).afterClosed().pipe((0,c.R)(this.destroy$)).subscribe(t=>{t&&(this.outletPrices[e]=t,this.variantService.updateOutletPrices(this.outletPrices))})}getEntityNameByID(t){let e,n="";return e=this.variantLoad.Entities.find(e=>e.getID===t),e&&(n=e.getName),n}getCurrencySymbolByID(t){let e,n="";return e=this.variantLoad.Currencies.find(e=>e.getID===t),e&&(n=e.getSymbol),n}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(N.uw),o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-outlet-price"]],decls:16,vars:1,consts:[[1,"table","table-bordered","custom-table"],[1,"table-secondary"],["width","15px",1,"border-right"],["type","button","title","Add Outlet Price",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],[1,"border-right"],["width","150px","ng-if","ctrl.Initial.HasRoleCost",1,"border-right"],["width","150px",1,"border-right"],["width","50px",1,"border-right"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],[1,"fa","fa-times","text-danger",2,"cursor","pointer",3,"click"],[4,"ngIf"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead"),o.TgZ(2,"tr",1),o.TgZ(3,"th",2),o.TgZ(4,"button",3),o.NdJ("click",function(){return e.onAddOutletPrice()}),o._UZ(5,"i",4),o.qZA(),o.qZA(),o.TgZ(6,"th",5),o._uU(7,"Outlet"),o.qZA(),o.TgZ(8,"th",6),o._uU(9,"Extra Cost"),o.qZA(),o.TgZ(10,"th",7),o._uU(11,"Price"),o.qZA(),o.TgZ(12,"th",8),o._uU(13,"Disc."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(14,"tbody"),o.YNc(15,z,11,6,"tr",9),o.qZA(),o.qZA()),2&t&&(o.xp6(15),o.Q6J("ngForOf",e.outletPrices))},directives:[i.sg,i.O5],pipes:[i.JJ],styles:[""]}),t})();function W(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.TgZ(3,"td",7),o._uU(4),o.qZA(),o.TgZ(5,"td"),o.TgZ(6,"input",8),o.NdJ("ngModelChange",function(e){const n=o.CHM(t).$implicit,i=o.oxw();return n.setUnitPrice=e,i.onChangePrice()}),o.qZA(),o.qZA(),o.TgZ(7,"td"),o.TgZ(8,"input",8),o.NdJ("ngModelChange",function(e){const n=o.CHM(t).$implicit,i=o.oxw();return n.setPriceDiscount=e,i.onChangeDiscount()}),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit;o.xp6(2),o.Oqu(t.getName),o.xp6(2),o.Oqu(t.getMinimumQuantity),o.xp6(2),o.Q6J("ngModel",t.getUnitPrice),o.xp6(2),o.Q6J("ngModel",t.getPriceDiscount)}}let tt=(()=>{class t{constructor(t){this.variantService=t,this.destroy$=new s.xQ}ngOnInit(){this.subscribePricebooks()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}subscribePricebooks(){this.variantService.getPricebooks$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.pricebooks=t})}onChangePrice(){this.variantService.updatePricebooks(this.pricebooks)}onChangeDiscount(){this.variantService.updatePricebooks(this.pricebooks)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-pricebook"]],decls:13,vars:1,consts:[[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],["width","120px",1,"border-right"],["width","150px",1,"border-right"],["width","100px",1,"border-right"],[4,"ngFor","ngForOf"],[1,"text-right"],["type","text","autoNum","",1,"form-control","text-right",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead"),o.TgZ(2,"tr",1),o.TgZ(3,"th",2),o._uU(4,"Name"),o.qZA(),o.TgZ(5,"th",3),o._uU(6,"Minimum Quantity"),o.qZA(),o.TgZ(7,"th",4),o._uU(8,"Price"),o.qZA(),o.TgZ(9,"th",5),o._uU(10,"Price Discount %"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(11,"tbody"),o.YNc(12,W,9,4,"tr",6),o.qZA(),o.qZA()),2&t&&(o.xp6(12),o.Q6J("ngForOf",e.pricebooks))},directives:[i.sg,f.Fj,m.b,f.JJ,f.On],styles:[""]}),t})();function et(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.TgZ(3,"td"),o.TgZ(4,"input",18),o.NdJ("ngModelChange",function(e){return o.CHM(t).$implicit.Amount=e})("ngModelChange",function(){return o.CHM(t),o.oxw().onChangeCommision()}),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit;o.xp6(2),o.Oqu(t.getName),o.xp6(2),o.Q6J("ngModel",t.Amount)}}let nt=(()=>{class t{constructor(t){this.variantService=t,this.destroy$=new s.xQ}ngOnInit(){this.subscribeVariant(),this.subscribeSalesGroup()}subscribeSalesGroup(){this.variantService.getSalesGroup$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.salesGroup=t})}subscribeVariant(){this.variantService.getVariant$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variant=t})}calculateCommission(t){t>100&&(this.commisionPercentage=100),t<-100&&(this.commisionPercentage=-100),this.variant.setSalesCommission=this.commisionPercentage/100*this.variant.getUnitPrice,this.variantService.updateVariant(this.variant)}onChangeCommision(){this.variantService.updateSalesGroup(this.salesGroup)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-commision"]],decls:28,vars:3,consts:[[1,"row","bg-white"],[1,"col-sm-6"],[1,"form-label-group"],["type","text","id","inputCommission","placeholder","Commission","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCommission"],[1,"col-sm-6","bg-white"],[1,"row"],[1,"col-sm-11"],["type","text","id","inputPercentage","placeholder","Commission (%) Calculator","max","100",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPercentage"],[1,"col-sm-1","pl-0"],[1,"mt-10"],[1,"col-sm-12","bg-white"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],[1,"border-right",2,"width","120px"],[4,"ngFor","ngForOf"],["type","text","autoNum","",1,"form-control","text-right",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"input",3),o.NdJ("ngModelChange",function(t){return e.variant.setSalesCommission=t}),o.qZA(),o.TgZ(4,"label",4),o._uU(5,"Commission"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(6,"div",5),o.TgZ(7,"div",6),o.TgZ(8,"div",7),o.TgZ(9,"div",2),o.TgZ(10,"input",8),o.NdJ("ngModelChange",function(t){return e.commisionPercentage=t})("ngModelChange",function(t){return e.calculateCommission(t)}),o.qZA(),o.TgZ(11,"label",9),o._uU(12,"Commission (%) Calculator"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"div",10),o.TgZ(14,"label",11),o._uU(15,"%"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"div",6),o.TgZ(17,"div",12),o.TgZ(18,"div",2),o.TgZ(19,"table",13),o.TgZ(20,"thead"),o.TgZ(21,"tr",14),o.TgZ(22,"th",15),o._uU(23,"Sales Group"),o.qZA(),o.TgZ(24,"th",16),o._uU(25,"Commission"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(26,"tbody"),o.YNc(27,et,5,2,"tr",17),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",null==e.variant?null:e.variant.getSalesCommission),o.xp6(7),o.Q6J("ngModel",e.commisionPercentage),o.xp6(17),o.Q6J("ngForOf",e.salesGroup))},directives:[f.Fj,m.b,f.JJ,f.On,i.sg],styles:[""]}),t})(),it=(()=>{class t{constructor(t){this.variantService=t,this.destroy$=new s.xQ}ngOnInit(){this.subscribeVariant()}subscribeVariant(){this.variantService.getVariant$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variant=t})}onDescriptionChange(t){this.variant.setDescription=t,setTimeout(()=>{this.variantService.updateVariant(this.variant)},1e3)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-description"]],decls:4,vars:1,consts:[[1,"form-label-group"],["id","inputDescription","placeholder","Description",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDescription"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"textarea",1),o.NdJ("ngModelChange",function(t){return e.onDescriptionChange(t)}),o.qZA(),o.TgZ(2,"label",2),o._uU(3,"Description"),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngModel",null==e.variant?null:e.variant.getDescription))},directives:[f.Fj,f.JJ,f.On],styles:[""]}),t})();var ot=n(21311),rt=n(21061);const at=function(t){return{selected:t}};let lt=(()=>{class t{constructor(t){this.variantService=t,this.paymentType=ot._,this.destroy$=new s.xQ}ngOnInit(){this.subscribeVariant(),this.subscribeVariantLoad()}subscribeVariantLoad(){this.variantService.getVariantLoad$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantLoad=t})}subscribeVariant(){this.variantService.getVariant$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variant=t})}onChangePaymentType(t){this.variant.setPaymentTypeID=t,this.updateVariant()}onChangeCostCurrency(t){this.variant.setCostCurrencyID=t,this.updateVariant()}onChangePriceCurrency(t){this.variant.setPriceCurrencyID=t,this.updateVariant()}onChangeUnitQuantity(t){this.variant.setUnitQuantity=t,this.updateVariant()}onChangePackSize(t){this.variant.setPackSize=t,this.updateVariant()}onChangeProductIndex(t){this.variant.setProductIndex=t,this.updateVariant()}onChangeUom(t){this.variant.setUOMQ=t,this.updateVariant()}onChangeMeasurement(t){this.variant.setMeasurementID=t,this.updateVariant()}updateVariant(){this.variantService.updateVariant(this.variant)}isNotEmpty(t){let e=!1;return rt.gT.IsNotEmpty(t)&&(e=!0),e}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-advanced"]],inputs:{variantLoad:"variantLoad",variant:"variant"},decls:58,vars:29,consts:[[1,"row"],[1,"col-sm-4","bg-white"],[1,"form-label-group","radio","border","rounded"],["aria-label","Select an option",3,"ngModel","ngModelChange"],[3,"value"],[1,"pl-3","mt-4",3,"value"],[1,"form-label-group","flexRow",3,"ngClass"],["id","inputCostCurrency","bindLabel","Symbol","bindValue","ID",1,"productform",3,"items","ngModel","ngModelChange"],["for","inputCostCurrency"],["id","inputPriceCurrency","bindLabel","Symbol","bindValue","ID",1,"productform",3,"items","ngModel","ngModelChange"],["for","inputPriceCurrency"],[1,"col-sm-6","bg-white"],[1,"col-sm-4"],[1,"col-sm-8"],[1,"form-label-group"],["type","text","id","inputContent","placeholder","Content","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputContent"],[1,"col-sm-4","pl-0"],[1,"mt-10"],["type","text","id","inputPackSize","placeholder","Pack Size",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPackSize"],["type","text","id","inputIndex","placeholder","Index",1,"form-control",3,"ngModel","ngModelChange"],["for","inputIndex"],[1,"col-sm-6"],[1,"form-label-group",3,"ngClass"],["id","CategoryID","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","items","ngModel","ngModelChange"],["for","inputUOMSubQuantity"],["id","inputMeasurement","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","items","ngModel","ngModelChange"],["for","inputMeasurement"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"label"),o._uU(4,"Payment Type"),o.qZA(),o.TgZ(5,"mat-radio-group",3),o.NdJ("ngModelChange",function(t){return e.onChangePaymentType(t)}),o.TgZ(6,"mat-radio-button",4),o._uU(7,"Cash And Point"),o.qZA(),o._uU(8,"\xa0 "),o.TgZ(9,"mat-radio-button",4),o._uU(10,"Cash"),o.qZA(),o.TgZ(11,"mat-radio-button",5),o._uU(12,"Point"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"div",1),o.TgZ(14,"div",6),o.TgZ(15,"ng-select",7),o.NdJ("ngModelChange",function(t){return e.onChangeCostCurrency(t)}),o.qZA(),o.TgZ(16,"label",8),o._uU(17,"Cost Currency"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(18,"div",1),o.TgZ(19,"div",6),o.TgZ(20,"ng-select",9),o.NdJ("ngModelChange",function(t){return e.onChangePriceCurrency(t)}),o.qZA(),o.TgZ(21,"label",10),o._uU(22,"Price Currency"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(23,"div",0),o.TgZ(24,"div",11),o.TgZ(25,"div",0),o.TgZ(26,"div",12),o.TgZ(27,"div",0),o.TgZ(28,"div",13),o.TgZ(29,"div",14),o.TgZ(30,"input",15),o.NdJ("ngModelChange",function(t){return e.onChangeUnitQuantity(t)}),o.qZA(),o.TgZ(31,"label",16),o._uU(32,"Content"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(33,"div",17),o.TgZ(34,"label",18),o._uU(35,"/ unit"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(36,"div",1),o.TgZ(37,"div",14),o.TgZ(38,"input",19),o.NdJ("ngModelChange",function(t){return e.onChangePackSize(t)}),o.qZA(),o.TgZ(39,"label",20),o._uU(40,"Pack Size"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(41,"div",1),o.TgZ(42,"div",14),o.TgZ(43,"input",21),o.NdJ("ngModelChange",function(t){return e.onChangeProductIndex(t)}),o.qZA(),o.TgZ(44,"label",22),o._uU(45,"Index"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(46,"div",23),o.TgZ(47,"div",0),o.TgZ(48,"div",11),o.TgZ(49,"div",24),o.TgZ(50,"ng-select",25),o.NdJ("ngModelChange",function(t){return e.onChangeUom(t)}),o.qZA(),o.TgZ(51,"label",26),o._uU(52,"UOM Sub Quantity"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(53,"div",11),o.TgZ(54,"div",24),o.TgZ(55,"ng-select",27),o.NdJ("ngModelChange",function(t){return e.onChangeMeasurement(t)}),o.qZA(),o.TgZ(56,"label",28),o._uU(57,"Measurements"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("ngModel",e.variant.getPaymentTypeID),o.xp6(1),o.Q6J("value",e.paymentType.CashAndPoint),o.xp6(3),o.Q6J("value",e.paymentType.Cash),o.xp6(2),o.Q6J("value",e.paymentType.Point),o.xp6(3),o.Q6J("ngClass",o.VKq(21,at,e.isNotEmpty(e.variant.getCostCurrencyID))),o.xp6(1),o.Q6J("items",e.variantLoad.Currencies)("ngModel",null==e.variant?null:e.variant.getCostCurrencyID),o.xp6(4),o.Q6J("ngClass",o.VKq(23,at,e.isNotEmpty(e.variant.getPriceCurrencyID))),o.xp6(1),o.Q6J("items",e.variantLoad.Currencies)("ngModel",null==e.variant?null:e.variant.getPriceCurrencyID),o.xp6(10),o.Q6J("ngModel",e.variant.getUnitQuantity),o.xp6(8),o.Q6J("ngModel",e.variant.getPackSize),o.xp6(5),o.Q6J("ngModel",e.variant.getProductIndex),o.xp6(6),o.Q6J("ngClass",o.VKq(25,at,e.isNotEmpty(e.variant.getUOMQ))),o.xp6(1),o.Q6J("clearable",!0)("items",e.variantLoad.UOMs)("ngModel",null==e.variant?null:e.variant.getUOMQ),o.xp6(4),o.Q6J("ngClass",o.VKq(27,at,e.isNotEmpty(e.variant.getMeasurementID))),o.xp6(1),o.Q6J("clearable",!0)("items",e.variantLoad.Measurements)("ngModel",null==e.variant?null:e.variant.getMeasurementID))},directives:[T.VQ,f.JJ,f.On,T.U0,i.mk,A.w9,f.Fj,m.b],styles:[""]}),t})(),st=(()=>{class t{constructor(t){this.variantService=t,this.destroy$=new s.xQ,this.variantParent={ParentID:rt.gT.GuidEmpty,Ratio:null}}ngOnInit(){this.getVariant(),this.getVariantParent()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getVariant(){this.variantService.getVariant$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variant=t})}getVariantParent(){this.variantService.getVariantWithSameID().subscribe(t=>{this.variants=t})}onSelectParent(t){this.variantParent.ParentID=t,this.variantService.updateVariantParent(this.variantParent)}onChangeRatio(t){this.variantParent.Ratio=t,setTimeout(()=>{this.variantService.updateVariantParent(this.variantParent)},500)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-multi-UOM"]],decls:23,vars:4,consts:[[1,"card"],[1,"card-body"],[1,"row"],[1,"float-none","col-sm-1"],[1,"col-sm-4","pl-2"],[1,"form-label-group","flexRow"],["id","inputType","placeholder","Parent","bindLabel","Name","bindValue","ID",1,"productform",3,"items","ngModel","ngModelChange"],[1,"col-sm-auto","ml-0",2,"width","40px"],[1,"text-left"],[1,"col-sm-3"],[1,"form-label-group"],["type","text","id","inputRatio","placeholder","Ratio","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputRatio"],[1,"col-sm-auto",2,"width","321px"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o._UZ(4,"br"),o.TgZ(5,"h3"),o._uU(6,"1 (one)"),o.qZA(),o.qZA(),o.TgZ(7,"div",4),o.TgZ(8,"div",5),o.TgZ(9,"ng-select",6),o.NdJ("ngModelChange",function(t){return e.onSelectParent(t)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(10,"div",7),o._UZ(11,"br"),o.TgZ(12,"h3",8),o._uU(13," = "),o.qZA(),o.qZA(),o.TgZ(14,"div",9),o.TgZ(15,"div",10),o.TgZ(16,"input",11),o.NdJ("ngModelChange",function(t){return e.onChangeRatio(t)}),o.qZA(),o.TgZ(17,"label",12),o._uU(18,"Ratio"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"div",13),o._UZ(20,"br"),o.TgZ(21,"h3",8),o._uU(22),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(9),o.Q6J("items",e.variants)("ngModel",null==e.variant?null:e.variant.getID),o.xp6(7),o.Q6J("ngModel",e.variantParent.Ratio),o.xp6(6),o.Oqu(e.variant.getModel))},directives:[A.w9,f.JJ,f.On,f.Fj,m.b],styles:[""]}),t})();function ct(t,e){1&t&&(o.TgZ(0,"li",3),o.TgZ(1,"a",28),o._uU(2,"Component"),o.qZA(),o.qZA())}function ut(t,e){1&t&&(o.TgZ(0,"a",29),o._uU(1,"MultiUOM"),o.qZA())}let dt=(()=>{class t{constructor(){this.variantTypeID=u.J}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-form-nav-tabs"]],inputs:{variant:"variant"},decls:97,vars:2,consts:[[1,"row"],[1,"col-sm-12"],["id","myTab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","inventory-tab","data-toggle","tab","href","#inventory","role","tab","aria-controls","inventory","aria-selected","true",1,"nav-link","active"],["class","nav-item",4,"ngIf"],["id","pricing-tab","data-toggle","tab","href","#outlet-price","role","tab","aria-controls","pricing","aria-selected","false",1,"nav-link"],["id","pricebook-tab","data-toggle","tab","href","#pricebook","role","tab","aria-controls","pricebook","aria-selected","false",1,"nav-link"],["id","commission-tab","data-toggle","tab","href","#commission","role","tab","aria-controls","commission","aria-selected","false",1,"nav-link"],["id","description-tab","data-toggle","tab","href","#description","role","tab","aria-controls","description","aria-selected","false",1,"nav-link"],["id","advanced-tab","data-toggle","tab","href","#advanced","role","tab","aria-controls","advanced","aria-selected","false",1,"nav-link"],["class","nav-link","id","advanced-tab","data-toggle","tab","href","#multi-UOM","role","tab","aria-controls","multiuom","aria-selected","false",4,"ngIf"],["id","myTabContent",1,"tab-content"],["id","inventory","role","tabpanel",1,"tab-pane","fade","show","active","mt-0","pt-0"],[1,"card",2,"border-top","none"],[1,"card-body"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"col-sm-12","p-0"],[1,"form-group","row"],[1,"col-sm-12","bg-white"],["id","component","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","outlet-price","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","pricebook","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","commission","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","description","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","advanced","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","multi-UOM","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","component-tab","data-toggle","tab","href","#component","role","tab","aria-controls","component","aria-selected","false",1,"nav-link"],["id","advanced-tab","data-toggle","tab","href","#multi-UOM","role","tab","aria-controls","multiuom","aria-selected","false",1,"nav-link"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"ul",2),o.TgZ(3,"li",3),o.TgZ(4,"a",4),o._uU(5,"Inventory"),o.qZA(),o.qZA(),o.YNc(6,ct,3,0,"li",5),o.TgZ(7,"li",3),o.TgZ(8,"a",6),o._uU(9,"Outlet Price"),o.qZA(),o.qZA(),o.TgZ(10,"li",3),o.TgZ(11,"a",7),o._uU(12,"Pricebook"),o.qZA(),o.qZA(),o.TgZ(13,"li",3),o.TgZ(14,"a",8),o._uU(15,"Commission"),o.qZA(),o.qZA(),o.TgZ(16,"li",3),o.TgZ(17,"a",9),o._uU(18,"Description"),o.qZA(),o.qZA(),o.TgZ(19,"li",3),o.TgZ(20,"a",10),o._uU(21,"Advanced"),o.qZA(),o.qZA(),o.TgZ(22,"li",3),o.YNc(23,ut,2,0,"a",11),o.qZA(),o.qZA(),o.TgZ(24,"div",12),o.TgZ(25,"div",13),o.TgZ(26,"div",14),o.TgZ(27,"div",15),o.TgZ(28,"div",16),o.TgZ(29,"div",17),o.TgZ(30,"div",18),o.TgZ(31,"div",19),o.TgZ(32,"div",20),o._UZ(33,"POS-inventory"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(34,"div",21),o.TgZ(35,"div",14),o.TgZ(36,"div",15),o.TgZ(37,"div",16),o.TgZ(38,"div",17),o.TgZ(39,"div",18),o.TgZ(40,"div",19),o.TgZ(41,"div",20),o._UZ(42,"POS-component"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(43,"div",22),o.TgZ(44,"div",14),o.TgZ(45,"div",15),o.TgZ(46,"div",16),o.TgZ(47,"div",17),o.TgZ(48,"div",18),o.TgZ(49,"div",19),o.TgZ(50,"div",20),o._UZ(51,"POS-outlet-price"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(52,"div",23),o.TgZ(53,"div",14),o.TgZ(54,"div",15),o.TgZ(55,"div",16),o.TgZ(56,"div",17),o.TgZ(57,"div",18),o.TgZ(58,"div",19),o.TgZ(59,"div",20),o._UZ(60,"POS-pricebook"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(61,"div",24),o.TgZ(62,"div",14),o.TgZ(63,"div",15),o.TgZ(64,"div",16),o.TgZ(65,"div",17),o.TgZ(66,"div",18),o.TgZ(67,"div",19),o.TgZ(68,"div",20),o._UZ(69,"POS-commision"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(70,"div",25),o.TgZ(71,"div",14),o.TgZ(72,"div",15),o.TgZ(73,"div",16),o.TgZ(74,"div",17),o.TgZ(75,"div",18),o.TgZ(76,"div",19),o.TgZ(77,"div",20),o._UZ(78,"POS-description"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(79,"div",26),o.TgZ(80,"div",14),o.TgZ(81,"div",15),o.TgZ(82,"div",16),o.TgZ(83,"div",17),o.TgZ(84,"div",18),o.TgZ(85,"div",19),o.TgZ(86,"div",20),o._UZ(87,"POS-advanced"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(88,"div",27),o.TgZ(89,"div",14),o.TgZ(90,"div",15),o.TgZ(91,"div",16),o.TgZ(92,"div",17),o.TgZ(93,"div",18),o.TgZ(94,"div",19),o.TgZ(95,"div",20),o._UZ(96,"POS-multi-UOM"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(6),o.Q6J("ngIf",e.variant.getTypeID==e.variantTypeID.Standard||e.variant.getTypeID==e.variantTypeID.NonInventory||e.variant.getTypeID==e.variantTypeID.Composite||e.variant.getTypeID==e.variantTypeID.Manufactured||e.variant.getTypeID==e.variantTypeID.MultipleUOM||9==e.variant.getTypeID),o.xp6(17),o.Q6J("ngIf",e.variant.getTypeID==e.variantTypeID.MultipleUOM))},directives:[i.O5,S,F,K,tt,nt,it,lt,st],styles:[""]}),t})();function gt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"div",36),o.TgZ(2,"div",12),o.TgZ(3,"input",45),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().variantPoint.Point=e}),o.qZA(),o.TgZ(4,"label",46),o._uU(5,"Point"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",null==t.variantPoint?null:t.variantPoint.Point)}}function Zt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"div",9),o.TgZ(2,"div",12),o.TgZ(3,"input",47),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().variantPoint.ExpiredDay=e}),o.qZA(),o.TgZ(4,"label",48),o._uU(5,"Day(s) +"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(6,"div",9),o.TgZ(7,"div",12),o.TgZ(8,"input",49),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().variantPoint.ExpiredMonth=e}),o.qZA(),o.TgZ(9,"label",50),o._uU(10,"Month(s)"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",null==t.variantPoint?null:t.variantPoint.ExpiredDay),o.xp6(5),o.Q6J("ngModel",null==t.variantPoint?null:t.variantPoint.ExpiredMonth)}}const pt=function(){return["/menu/Products/Catalog/Variants"]},ht=function(t){return{selected:t}},vt=function(t){return{"bg-white":t}};let ft=(()=>{class t extends l.K{constructor(t,e,n,i,o,r){super(t,i,o),this.httpService=t,this.pageTitle=e,this.router=n,this.toaster=i,this.route=o,this.variantService=r,this.destroy$=new s.xQ}ngOnInit(){this.variantService.initVariant(),this.getInitVariantLoad(),this.initVariantPoint(),this.subscribeVariantParent(),this.subscribeVariant(),this.subscribeEntites(),this.subscribeVariantLoad(),this.subscribeComposites(),this.subscribeOutletPrice(),this.subscribePricebooks(),this.subscribeSalesGroup(),this.subscribeQueryParams()}subscribeQueryParams(){this.route.queryParams.pipe((0,c.R)(this.destroy$)).subscribe(t=>{let e=t.ID;e&&this.getVariantFormById(e)})}getVariantFormById(t){this.variantService.getVariantFormById(t).pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantService.updateVariant(t.Variant),this.variantService.updateEntities(t.OutletStocks),this.variantService.updatePricebooks(t.Pricebooks),this.variantService.updateComposites(t.Composites),this.variantService.updateOutletPrices(t.OutletPrices),this.variantService.updateSalesGroup(t.Commission)})}initVariantPoint(){this.variantPoint={ExpiredDay:null,ExpiredMonth:null,Point:null}}getInitVariantLoad(){this.variantService.getInitVariantLoad().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantLoad=t})}subscribeVariantParent(){this.variantService.getVariantParent$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantParent=t})}subscribeVariant(){this.variantService.getVariant$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variant=t,this.productName=t.getName})}subscribeEntites(){this.variantService.getEntities$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.entities=t})}subscribeSalesGroup(){this.variantService.getSalesGroup$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.salesGroups=t})}subscribePricebooks(){this.variantService.getPricebooks$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.pricebooks=t})}subscribeOutletPrice(){this.variantService.getOutletPrices$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.outletPrices=t})}subscribeComposites(){this.variantService.getComposites$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.composites=t})}subscribeVariantLoad(){this.variantService.getVariantLoad$().pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantLoad=t})}onSelectProduct(t){let e=JSON.parse(t);this.variant.setProductID=e.Key,this.productName=e.Value,this.updateDisplayName()}updateDisplayName(){this.variant.setName=JSON.parse(JSON.stringify(this.productName?this.productName:"")),this.variant.getModel&&(this.variant.setName=`${this.productName} (${this.variant.getModel})`)}onSubmit(){if(!this.checkUnlimitedPoint())return;let t=this.generateVariantSubmitData();this.variantService.submitVariant(t).pipe((0,c.R)(this.destroy$)).subscribe(()=>{this.router.navigate(["menu/Products/Catalog/Variants"])})}checkUnlimitedPoint(){let t=!0;return this.variant.getTypeID!=u.J.PrepaidPoint&&this.variant.getTypeID!=u.J.TreatmentPackage||0!=this.variantPoint.Point&&this.variantPoint.Point||confirm("Warning are you sure you want to submit 0 (unlimited) point for this product? Please check again if it's an accident")||(t=!1),t}generateVariantSubmitData(){let t=this.variantService.generateOutletStock(this.entities),e=this.variantService.calculateCompositeCost(this.composites);return{Commision:this.salesGroups,Composites:this.composites,OutletPrices:this.outletPrices,OutletStocks:t,Pricebooks:this.pricebooks,QueryString:null,TotalCompositeCost:e,Variant:this.variant,VariantParent:this.variantParent,VariantPoint:this.variantPoint}}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d.O),o.Y36(g.Dx),o.Y36(r.F0),o.Y36(Z._W),o.Y36(r.gz),o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-Form"]],features:[o.qOj],decls:121,vars:40,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["role","button",1,"btn","btn-outline-secondary","mr-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","bg-light-gray"],[1,"row"],[1,"col-md-8","mt-5"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-6"],["inputID","Product","placeholder","Selected Product","requestUrl","/API/AC/GetProductSuggestionByCodeNName",1,"w-100",3,"inputTextValue","optionSelected","ngModel"],[1,"col-sm-3"],[1,"form-label-group"],["type","text","id","inputVariant","placeholder","Variant","name","variant",1,"form-control",3,"ngModel","ngModelChange"],["for","inputVariant"],["type","text","id","inputCode","name","code","placeholder","Code",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCode"],["type","text","id","inputName","placeholder","Display Name","name","name",1,"form-control",3,"ngModel","ngModelChange"],["for","inputName"],["type","text","id","inputWeight","placeholder","Weight (gr)","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputWeight"],[1,"form-label-group",3,"ngClass"],["id","CategoryID","bindLabel","Name","bindValue","ID",1,"productform",3,"items","ngModel","ngModelChange"],["for","CategoryID"],["ng-if","ctrl.Initial.HasRoleCost",1,"col-sm-6"],[1,"col"],["type","text","id","inputCost","placeholder","Cost","autoNum","",1,"form-control","with-currency",3,"ngClass","ngModel","disabled","ngModelChange"],["for","inputCost"],[1,"pl-0","col-auto",2,"width","75px"],["type","text","id","inputDiscCost","placeholder","Disc %","maxlength","5","autoNum","",1,"form-control","percentage-input",3,"ngModel","ngModelChange"],["for","inputDiscCost"],["type","text","id","inputPrice","placeholder","Price","autoNum","",1,"form-control","with-currency",3,"ngModel","ngModelChange"],["for","inputPrice"],["type","text","id","inputDiscPrice","placeholder","Disc %","autoNum","",1,"form-control","percentage-input",3,"ngModel","ngModelChange"],["for","inputDiscPrice"],[1,"col-sm-4","mt-5"],[1,"col-sm-12"],["id","typeID","bindLabel","Value","bindValue","Key",1,"productform",3,"items","ngModel","ngModelChange"],["for","typeID"],["class","row",4,"ngIf"],[1,"form-label-group","radio","border","rounded"],["aria-label","Select an option",3,"ngModel","ngModelChange"],[3,"value"],[1,"pl-3","mt-4",3,"value"],[3,"variant"],["type","text","id","inputPoint","placeholder","Point","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPoint"],["type","text","id","inputDays","placeholder","Day(s) +","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDays"],["type","text","id","inputMonth","placeholder","Month(s)","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputMonth"]],template:function(t,e){1&t&&(o.TgZ(0,"mainpanel-cmp",0),o.TgZ(1,"actions"),o.TgZ(2,"a",1),o._uU(3,"Cancel"),o.qZA(),o.TgZ(4,"button",2),o.NdJ("click",function(){return e.onSubmit()}),o._uU(5,"Submit"),o.qZA(),o.qZA(),o.TgZ(6,"content"),o.TgZ(7,"div",3),o.TgZ(8,"div",4),o.TgZ(9,"div",5),o.TgZ(10,"div",6),o.TgZ(11,"div",7),o.TgZ(12,"h3"),o._uU(13,"General"),o.qZA(),o.qZA(),o.TgZ(14,"div",8),o.TgZ(15,"div",4),o.TgZ(16,"div",9),o.TgZ(17,"autocompleteV2",10),o.NdJ("optionSelected",function(t){return e.onSelectProduct(t)})("ngModel",function(t){return e.variant.setProductID=t}),o.qZA(),o.qZA(),o.TgZ(18,"div",11),o.TgZ(19,"div",12),o.TgZ(20,"input",13),o.NdJ("ngModelChange",function(t){return e.variant.setModel=t,e.updateDisplayName()}),o.qZA(),o.TgZ(21,"label",14),o._uU(22,"Variant"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(23,"div",11),o.TgZ(24,"div",12),o.TgZ(25,"input",15),o.NdJ("ngModelChange",function(t){return e.variant.setCode=t,e.updateDisplayName()}),o.qZA(),o.TgZ(26,"label",16),o._uU(27,"Code"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(28,"div",4),o.TgZ(29,"div",9),o.TgZ(30,"div",12),o.TgZ(31,"input",17),o.NdJ("ngModelChange",function(t){return e.variant.setName=t}),o.qZA(),o.TgZ(32,"label",18),o._uU(33,"Display Name"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(34,"div",11),o.TgZ(35,"div",12),o.TgZ(36,"input",19),o.NdJ("ngModelChange",function(t){return e.variant.setWeight=t}),o.qZA(),o.TgZ(37,"label",20),o._uU(38,"Weight (gr)"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"div",11),o.TgZ(40,"div",21),o.TgZ(41,"ng-select",22),o.NdJ("ngModelChange",function(t){return e.variant.setUOM=t}),o.qZA(),o.TgZ(42,"label",23),o._uU(43,"UOM"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(44,"div",6),o.TgZ(45,"div",7),o.TgZ(46,"h3"),o._uU(47,"Pricing and Discount"),o.qZA(),o.qZA(),o.TgZ(48,"div",8),o.TgZ(49,"div",4),o.TgZ(50,"div",24),o.TgZ(51,"div",4),o.TgZ(52,"div",25),o.TgZ(53,"div",12),o.TgZ(54,"input",26),o.NdJ("ngModelChange",function(t){return e.variant.setUnitCost=t}),o.qZA(),o.TgZ(55,"label",27),o._uU(56,"Buying Cost"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(57,"div",28),o.TgZ(58,"div",12),o.TgZ(59,"input",29),o.NdJ("ngModelChange",function(t){return e.variant.setOrderPriceDiscount=t}),o.qZA(),o.TgZ(60,"label",30),o._uU(61,"Disc %"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(62,"div",9),o.TgZ(63,"div",4),o.TgZ(64,"div",25),o.TgZ(65,"div",12),o.TgZ(66,"input",31),o.NdJ("ngModelChange",function(t){return e.variant.setUnitPrice=t}),o.qZA(),o.TgZ(67,"label",32),o._uU(68,"Selling Price"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(69,"div",28),o.TgZ(70,"div",12),o.TgZ(71,"input",33),o.NdJ("ngModelChange",function(t){return e.variant.setPriceDiscount=t}),o.qZA(),o.TgZ(72,"label",34),o._uU(73,"Disc %"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(74,"div",35),o.TgZ(75,"div",4),o.TgZ(76,"div",36),o.TgZ(77,"div",6),o.TgZ(78,"div",7),o.TgZ(79,"h3"),o._uU(80,"Properties"),o.qZA(),o.qZA(),o.TgZ(81,"div",8),o.TgZ(82,"div",4),o.TgZ(83,"div",36),o.TgZ(84,"div",21),o.TgZ(85,"ng-select",37),o.NdJ("ngModelChange",function(t){return e.variant.setTypeID=t}),o.qZA(),o.TgZ(86,"label",38),o._uU(87,"Type"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(88,gt,6,1,"div",39),o.YNc(89,Zt,11,2,"div",39),o.TgZ(90,"div",4),o.TgZ(91,"div",36),o.TgZ(92,"div",40),o.TgZ(93,"label"),o._uU(94,"Taxable"),o.qZA(),o.TgZ(95,"mat-radio-group",41),o.NdJ("ngModelChange",function(t){return e.variant.setTaxable=t}),o.TgZ(96,"mat-radio-button",42),o._uU(97,"No"),o.qZA(),o.TgZ(98,"mat-radio-button",43),o._uU(99,"Yes"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(100,"div",4),o.TgZ(101,"div",36),o.TgZ(102,"div",40),o.TgZ(103,"label"),o._uU(104,"Loyalty Point Enabled"),o.qZA(),o.TgZ(105,"mat-radio-group",41),o.NdJ("ngModelChange",function(t){return e.variant.setLoyaltyPoint=t}),o.TgZ(106,"mat-radio-button",42),o._uU(107,"No"),o.qZA(),o.TgZ(108,"mat-radio-button",43),o._uU(109,"Yes"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(110,"div",4),o.TgZ(111,"div",36),o.TgZ(112,"div",40),o.TgZ(113,"label"),o._uU(114,"Discontinued"),o.qZA(),o.TgZ(115,"mat-radio-group",41),o.NdJ("ngModelChange",function(t){return e.variant.setDiscontinued=t}),o.TgZ(116,"mat-radio-button",42),o._uU(117,"No"),o.qZA(),o.TgZ(118,"mat-radio-button",43),o._uU(119,"Yes"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o._UZ(120,"POS-form-nav-tabs",44),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",e.pageData),o.xp6(2),o.Q6J("routerLink",o.DdM(33,pt)),o.xp6(15),o.Q6J("inputTextValue",e.productName),o.xp6(3),o.Q6J("ngModel",null==e.variant?null:e.variant.getModel),o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getCode),o.xp6(6),o.Q6J("ngModel",null==e.variant?null:e.variant.getName),o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getWeight),o.xp6(4),o.Q6J("ngClass",o.VKq(34,ht,null!=(null==e.variant?null:e.variant.getUOM))),o.xp6(1),o.Q6J("items",e.variantLoad.UOMs)("ngModel",null==e.variant?null:e.variant.getUOM),o.xp6(13),o.Q6J("ngClass",o.VKq(36,vt,!e.variantLoad.HasRoleCost))("ngModel",null==e.variant?null:e.variant.getUnitCost)("disabled",!e.variantLoad.HasRoleCost),o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getOrderPriceDiscount),o.xp6(7),o.Q6J("ngModel",null==e.variant?null:e.variant.getUnitPrice),o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getPriceDiscount),o.xp6(13),o.Q6J("ngClass",o.VKq(38,ht,null!==(null==e.variant?null:e.variant.getTypeID))),o.xp6(1),o.Q6J("items",null==e.variantLoad?null:e.variantLoad.Types)("ngModel",null==e.variant?null:e.variant.getTypeID),o.xp6(3),o.Q6J("ngIf",10==(null==e.variant?null:e.variant.getTypeID)||8==(null==e.variant?null:e.variant.getTypeID)),o.xp6(1),o.Q6J("ngIf",10==(null==e.variant?null:e.variant.getTypeID)||8==(null==e.variant?null:e.variant.getTypeID)),o.xp6(6),o.Q6J("ngModel",null==e.variant?null:e.variant.getTaxable),o.xp6(1),o.Q6J("value",!1),o.xp6(2),o.Q6J("value",!0),o.xp6(7),o.Q6J("ngModel",null==e.variant?null:e.variant.getLoyaltyPoint),o.xp6(1),o.Q6J("value",!1),o.xp6(2),o.Q6J("value",!0),o.xp6(7),o.Q6J("ngModel",null==e.variant?null:e.variant.getDiscontinued),o.xp6(1),o.Q6J("value",!1),o.xp6(2),o.Q6J("value",!0),o.xp6(2),o.Q6J("variant",e.variant))},directives:[h.p,r.yS,v.J,f.JJ,f.On,f.Fj,m.b,i.mk,A.w9,f.nD,i.O5,T.VQ,T.U0,dt],styles:[""]}),t})();var mt=n(5977),At=n(3338),Tt=n(43731);function qt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",15),o.NdJ("click",function(){return o.CHM(t),o.oxw().removeData()}),o._UZ(1,"i",16),o._uU(2," Delete "),o.qZA()}}function bt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",17),o.NdJ("click",function(){return o.CHM(t),o.oxw().onUpdateLog()}),o._UZ(1,"i",18),o._uU(2," Update Log "),o.qZA()}}function yt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",19),o.NdJ("click",function(){return o.CHM(t),o.oxw().exportCSV("/API/ProductExport/VariantExport","Variant.csv")}),o._UZ(1,"i",20),o._uU(2," Export "),o.qZA()}}function xt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",21),o.NdJ("click",function(){return o.CHM(t),o.oxw().onAddVariant()}),o._uU(1," Add Variant "),o.qZA()}}function It(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",31),o.TgZ(1,"input",32),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).checkboxState=e})("ngModelChange",function(){o.CHM(t);const e=o.oxw(2);return e.onCheckboxStateChange(),e.itemSelected=!!e.checkboxState}),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngModel",t.checkboxState)}}function Mt(t,e){1&t&&(o.TgZ(0,"th"),o._uU(1,"Description"),o.qZA())}function Ct(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"Buying Cost "),o.qZA())}function Ut(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"Last Buy Cost "),o.qZA())}function Pt(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"Selling Price"),o.qZA())}function _t(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"%"),o.qZA())}function Jt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",31),o.TgZ(1,"input",32),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().$implicit.selected=e})("ngModelChange",function(){return o.CHM(t),o.oxw(3).onSelectItem()}),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngModel",t.selected)}}function Ot(t,e){if(1&t&&(o.TgZ(0,"td"),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(t.Description)}}function St(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.UnitCost))}}function wt(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.OrderPrice))}}function Nt(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.UnitPrice))}}function Dt(t,e){if(1&t&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",0!=t.PriceDiscount?t.PriceDiscount:"","")}}const Qt=function(t){return{ID:t}},kt=function(t){return{strike:t}};function Lt(t,e){if(1&t&&(o.TgZ(0,"tr"),o.YNc(1,Jt,2,1,"td",25),o.TgZ(2,"td"),o.TgZ(3,"a",34),o.TgZ(4,"span",35),o._uU(5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(6,"td"),o._uU(7),o.qZA(),o.TgZ(8,"td"),o._uU(9),o.qZA(),o.YNc(10,Ot,2,1,"td",27),o.YNc(11,St,3,3,"td",36),o.YNc(12,wt,3,3,"td",36),o.YNc(13,Nt,3,3,"td",36),o.YNc(14,Dt,2,1,"td",37),o.TgZ(15,"td",38),o._uU(16),o.ALo(17,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngIf",null==n.Model||null==n.Model.Roles?null:n.Model.Roles.HasProductDelete),o.xp6(2),o.Q6J("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",o.VKq(15,Qt,t.ID)),o.xp6(1),o.Q6J("ngClass",o.VKq(17,kt,null==t?null:t.Discontinued)),o.xp6(1),o.Oqu(t.Name),o.xp6(2),o.hij(" ",t.TypeLabel," "),o.xp6(2),o.Oqu(t.Code),o.xp6(1),o.Q6J("ngIf",n.GridModel.Description),o.xp6(1),o.Q6J("ngIf",null==n.Model||null==n.Model.Roles?null:n.Model.Roles.HasCostRole),o.xp6(1),o.Q6J("ngIf",null==n.Model||null==n.Model.Roles?null:n.Model.Roles.HasCostRole),o.xp6(1),o.Q6J("ngIf",null==n.Model||null==n.Model.Roles?null:n.Model.Roles.HasPriceRole),o.xp6(1),o.Q6J("ngIf",null==n.Model||null==n.Model.Roles?null:n.Model.Roles.IsDiscountRole),o.xp6(2),o.Oqu(o.lcZ(17,13,t.UnitsInStock))}}function Vt(t,e){if(1&t&&(o.TgZ(0,"table",22),o.TgZ(1,"thead",23),o.TgZ(2,"tr",24),o.YNc(3,It,2,1,"th",25),o.TgZ(4,"th"),o._uU(5,"Name"),o.qZA(),o.TgZ(6,"th",26),o._uU(7,"Type"),o.qZA(),o.TgZ(8,"th",26),o._uU(9,"Code"),o.qZA(),o.YNc(10,Mt,2,0,"th",27),o.YNc(11,Ct,2,0,"th",28),o.YNc(12,Ut,2,0,"th",28),o.YNc(13,Pt,2,0,"th",28),o.YNc(14,_t,2,0,"th",28),o.TgZ(15,"th",29),o._uU(16,"Inventory"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(17,"tbody"),o.YNc(18,Lt,18,19,"tr",30),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngIf",null==t.Model||null==t.Model.Roles?null:t.Model.Roles.HasProductDelete),o.xp6(7),o.Q6J("ngIf",t.GridModel.Description),o.xp6(1),o.Q6J("ngIf",null==t.Model||null==t.Model.Roles?null:t.Model.Roles.HasCostRole),o.xp6(1),o.Q6J("ngIf",null==t.Model||null==t.Model.Roles?null:t.Model.Roles.HasCostRole),o.xp6(1),o.Q6J("ngIf",null==t.Model||null==t.Model.Roles?null:t.Model.Roles.HasPriceRole),o.xp6(1),o.Q6J("ngIf",null==t.Model||null==t.Model.Roles?null:t.Model.Roles.IsDiscountRole),o.xp6(4),o.Q6J("ngForOf",t.GridModel.Data)}}function Yt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",40),o.TgZ(1,"mat-paginator",41),o.NdJ("page",function(e){return o.CHM(t),o.oxw().changePage(e)}),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("length",t.Pagination.ListTotal)("pageSize",t.Pagination.PageSize)("pageIndex",0==t.Model.Filter.PageNumber?0:t.Model.Filter.PageNumber-1)}}let Ht=(()=>{class t extends mt.${constructor(t,e,n,i,o){super(t,e),this.httpService=t,this.csvConverter=e,this.pageTitle=n,this.toaster=i,this.router=o,this.loaderAPI="ProductLoader/VariantList",this.listApi="Product/GetVariantList",this.deleteUrl="/API/Product/DeleteVariantList"}onAddVariant(){this.router.navigate(["/menu/Products/Catalog/Variants/Form"])}onUpdateLog(){this.router.navigate(["/menu/Products/Add-Ons/Variant_History"])}onSelectItem(){this.itemSelected=!1,(this.GridModel.Data?this.GridModel.Data:[]).forEach(t=>{t.selected&&(this.itemSelected=!0)})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d.O),o.Y36(At.O),o.Y36(g.Dx),o.Y36(Z._W),o.Y36(r.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-List"]],features:[o.qOj],decls:34,vars:17,consts:[[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary mr-6","role","button","confirm-message","Are you sure you want to delete this record?",3,"click",4,"ngIf"],["class","btn btn-outline-secondary mr-6","role","button",3,"click",4,"ngIf"],["class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["class","btn btn-success","role","button","title","Add Variant",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","Discontinued",3,"model","options","modelChange"],["name","Description",3,"model","options","modelChange"],[1,"container-fluid","mt-5"],[1,"d-none","d-sm-block"],["id","tableGrid","class","table border-bottom",4,"ngIf"],["class","d-sm-block mt-2",4,"ngIf"],["role","button","confirm-message","Are you sure you want to delete this record?",1,"btn","btn-outline-secondary","mr-6",3,"click"],[1,"fa","fa-trash"],["role","button",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fa","fa-list-ul"],[1,"btn","btn-outline-secondary","mr-6",3,"click"],[1,"fa","fa-upload"],["role","button","title","Add Variant",1,"btn","btn-success",3,"click"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],[4,"ngIf"],["class","text-right","style","width: 100px;",4,"ngIf"],[2,"width","85px"],[4,"ngFor","ngForOf"],[2,"width","14px"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-right",2,"width","100px"],[3,"routerLink","queryParams"],[3,"ngClass"],["class","text-right",4,"ngIf"],["class","text-right","style","color: red;",4,"ngIf"],[1,"text-right"],[1,"text-right",2,"color","red"],[1,"d-sm-block","mt-2"],[3,"length","pageSize","pageIndex","page"]],template:function(t,e){1&t&&(o.TgZ(0,"mainpanel-cmp",0),o.NdJ("textChange",function(t){return(null==e.Model?null:e.Model.Filter).Text=t})("onSubmit",function(){return e.getList()}),o.TgZ(1,"actions"),o.YNc(2,qt,3,0,"a",1),o.YNc(3,bt,3,0,"a",2),o.YNc(4,yt,3,0,"a",3),o.YNc(5,xt,2,0,"a",4),o.qZA(),o.TgZ(6,"filters"),o.TgZ(7,"div",5),o.TgZ(8,"div",6),o.TgZ(9,"div"),o.TgZ(10,"h6"),o._uU(11,"Category"),o.qZA(),o.TgZ(12,"ng-select",7),o.NdJ("ngModelChange",function(t){return e.Model.Filter.CategoryID=t}),o.qZA(),o.qZA(),o.TgZ(13,"div"),o.TgZ(14,"h6"),o._uU(15,"Supplier"),o.qZA(),o.TgZ(16,"autocompleteV2",8),o.NdJ("ngModelChange",function(t){return e.Model.Filter.SupplierID=t}),o.qZA(),o.qZA(),o.TgZ(17,"div"),o.TgZ(18,"h6"),o._uU(19,"Type"),o.qZA(),o.TgZ(20,"ng-select",7),o.NdJ("ngModelChange",function(t){return e.Model.Filter.TypeID=t}),o.qZA(),o.qZA(),o.TgZ(21,"div"),o.TgZ(22,"h6"),o._uU(23,"Discontinued"),o.qZA(),o.TgZ(24,"radio-options",9),o.NdJ("modelChange",function(t){return e.Model.Filter.Discontinued=t}),o.qZA(),o.qZA(),o.TgZ(25,"div"),o.TgZ(26,"h6"),o._uU(27,"Description"),o.qZA(),o.TgZ(28,"radio-options",10),o.NdJ("modelChange",function(t){return e.Model.Filter.Description=t}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(29,"content"),o.TgZ(30,"div",11),o.TgZ(31,"div",12),o.YNc(32,Vt,19,7,"table",13),o.qZA(),o.YNc(33,Yt,2,3,"div",14),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("pageData",e.pageData)("text",null==e.Model?null:e.Model.Filter.Text),o.xp6(2),o.Q6J("ngIf",e.itemSelected&&e.Model.Roles.HasProductDelete),o.xp6(1),o.Q6J("ngIf",e.Model.Roles.HasProductEditor),o.xp6(1),o.Q6J("ngIf",e.Model.Roles.HasExport),o.xp6(1),o.Q6J("ngIf",e.Model.Roles.HasProductCreate),o.xp6(7),o.Q6J("items",null==e.Model.Options?null:e.Model.Options.Categories)("ngModel",e.Model.Filter.CategoryID),o.xp6(4),o.Q6J("ngModel",e.Model.Filter.SupplierID),o.xp6(4),o.Q6J("items",null==e.Model.Options?null:e.Model.Options.Types)("ngModel",e.Model.Filter.TypeID),o.xp6(4),o.Q6J("model",e.Model.Filter.Discontinued)("options",e.YesNoOptions),o.xp6(4),o.Q6J("model",e.Model.Filter.Description)("options",e.YesNoOptions),o.xp6(4),o.Q6J("ngIf",e.GridModel),o.xp6(1),o.Q6J("ngIf",e.Model.Filter))},directives:[h.p,i.O5,A.w9,f.JJ,f.On,v.J,i.sg,f.Wl,r.yS,i.mk,Tt.NW],pipes:[i.JJ],styles:[""]}),t})();var Rt=n(39677),$t=n(74937),Ft=n(33013),Et=n(19309);let jt=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,$t.Cl,Et.T],Ft.m8,$t.Cl]}),t})();function Bt(t,e){1&t&&(o.TgZ(0,"div",1),o.TgZ(1,"div",2),o.TgZ(2,"p"),o._uU(3," This variant type does not have an inventory "),o.qZA(),o.qZA(),o.qZA())}function Gt(t,e){1&t&&(o.TgZ(0,"span"),o.TgZ(1,"small",24),o._uU(2,"by :"),o.qZA(),o.TgZ(3,"label",14),o._UZ(4,"input",25),o.TgZ(5,"small",24),o._uU(6,"Outlet"),o.qZA(),o.qZA(),o.TgZ(7,"label",14),o._UZ(8,"input",26),o.TgZ(9,"small",24),o._uU(10,"Group"),o.qZA(),o.qZA(),o.qZA())}function Xt(t,e){if(1&t&&(o.TgZ(0,"a",29),o._uU(1,"Log"),o.qZA()),2&t){const t=o.oxw(3);o.MGl("href","/A/Products/Catalog/Variants/Log?ID=",t.variant.getID,"",o.LSH)}}function zt(t,e){if(1&t&&(o.TgZ(0,"div",27),o.YNc(1,Xt,2,1,"a",28),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",t.variantParent&&(null==t.variantParent?null:t.variantParent.Ratio)>0||(null==t.role?null:t.role.IsMultipleOUM)||(null==t.role?null:t.role.IsSerialNumber)||1==(null==t.variant?null:t.variant.getTypeID)||6==(null==t.variant?null:t.variant.getTypeID)||5==(null==t.variant?null:t.variant.getTypeID))}}function Kt(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1,"Buffer"),o.qZA())}function Wt(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1,"Threshold"),o.qZA())}function te(t,e){1&t&&(o.TgZ(0,"th"),o._uU(1,"Serial"),o.qZA())}function ee(t,e){1&t&&o._UZ(0,"th")}function ne(t,e){if(1&t&&(o.TgZ(0,"li",38),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",t," ")}}function ie(t,e){if(1&t&&(o.TgZ(0,"td"),o.TgZ(1,"ul",36),o.YNc(2,ne,2,1,"li",37),o.qZA(),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(2),o.Q6J("ngForIn",t.SerialNumber)}}function oe(t,e){if(1&t&&(o.TgZ(0,"td"),o.TgZ(1,"a",39),o._UZ(2,"i",40),o.qZA(),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw(2);o.xp6(1),o.hYB("href","/A/Products/Catalog/Variants/Serial_Form?VariantID=",e.variant.getID,"&EntityID=",t.getEntityID,"",o.LSH)}}function re(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td",32),o._uU(2),o.qZA(),o.TgZ(3,"td",33),o._uU(4),o.ALo(5,"number"),o.qZA(),o.TgZ(6,"td",34),o._uU(7),o.ALo(8,"number"),o.qZA(),o.TgZ(9,"td",35),o._uU(10),o.ALo(11,"number"),o.qZA(),o.YNc(12,ie,3,1,"td",8),o.YNc(13,oe,3,2,"td",8),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(2),o.Oqu(null==t?null:t.getName),o.xp6(1),o.Q6J("ngClass",(null==t?null:t.getMinStock)>=(null==t?null:t.getUnitsInStock)&&0!=t.MinStock?"date-warning":""),o.xp6(1),o.hij(" ",o.lcZ(5,8,null==t?null:t.getUnitsInStock)," "),o.xp6(3),o.hij(" ",o.lcZ(8,10,null==t?null:t.getAvailable)," "),o.xp6(2),o.Q6J("ngClass",t.getMinStock>=t.getUnitsInStock&&0!=t.MinStock?"date-warning":""),o.xp6(1),o.hij(" ",o.lcZ(11,12,t.getMaxStock),""),o.xp6(2),o.Q6J("ngIf",null==n.role?null:n.role.IsSerialNumber),o.xp6(1),o.Q6J("ngIf",null==n.role?null:n.role.IsSerialNumber)}}function ae(t,e){if(1&t&&(o.TgZ(0,"td",22),o._uU(1),o.ALo(2,"number"),o.ALo(3,"sum"),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.hij(" ",o.lcZ(2,1,o.xi3(3,3,t.entityStock,"Available"))," ")}}function le(t,e){if(1&t&&(o.TgZ(0,"td",22),o._uU(1),o.ALo(2,"number"),o.ALo(3,"sum"),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.hij(" ",o.lcZ(2,1,o.xi3(3,3,t.entityStock,"MinStock"))," ")}}function se(t,e){if(1&t&&(o.TgZ(0,"td",22),o._uU(1),o.ALo(2,"number"),o.ALo(3,"sum"),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.hij(" ",o.lcZ(2,1,o.xi3(3,3,t.entityStock,"MaxStock"))," ")}}function ce(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",1),o.TgZ(1,"div",2),o.TgZ(2,"div",3),o.TgZ(3,"div",4),o.TgZ(4,"div",5),o.TgZ(5,"div",6),o.TgZ(6,"div",7),o.TgZ(7,"div"),o.TgZ(8,"h3"),o.YNc(9,Gt,11,0,"span",8),o.qZA(),o.qZA(),o.qZA(),o.TgZ(10,"table",9),o.TgZ(11,"thead",10),o.TgZ(12,"tr",11),o.TgZ(13,"th"),o._uU(14," Outlet "),o.YNc(15,zt,2,1,"div",12),o.qZA(),o.TgZ(16,"th",13),o.NdJ("click",function(){o.CHM(t);const e=o.oxw();return e.inventorySortDirection=!e.inventorySortDirection}),o._uU(17," On Hand "),o.TgZ(18,"span",14),o._UZ(19,"i",15),o.qZA(),o.qZA(),o.TgZ(20,"th",16),o._uU(21,"Allocated"),o.qZA(),o.TgZ(22,"th",17),o._uU(23,"Available "),o.qZA(),o.YNc(24,Kt,2,0,"th",18),o.ALo(25,"sum"),o.YNc(26,Wt,2,0,"th",19),o.ALo(27,"sum"),o.YNc(28,te,2,0,"th",8),o.YNc(29,ee,1,0,"th",8),o.qZA(),o.qZA(),o.TgZ(30,"tbody"),o.YNc(31,re,14,14,"tr",20),o.ALo(32,"sortBy"),o.qZA(),o.TgZ(33,"tfoot"),o.TgZ(34,"tr"),o._UZ(35,"td",21),o.TgZ(36,"td",22),o._uU(37),o.ALo(38,"number"),o.ALo(39,"sum"),o.qZA(),o.TgZ(40,"td",22),o._uU(41),o.ALo(42,"number"),o.ALo(43,"sum"),o.qZA(),o.YNc(44,ae,4,6,"td",23),o.ALo(45,"sum"),o.YNc(46,le,4,6,"td",23),o.ALo(47,"sum"),o.YNc(48,se,4,6,"td",23),o.ALo(49,"sum"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(9),o.Q6J("ngIf",(null==t.role?null:t.role.HasOutletGroup)&&(null==t.role?null:t.role.OutletGroup)),o.xp6(6),o.Q6J("ngIf",(null==t.role?null:t.role.IsInventoryRole)&&(null==t.role?null:t.role.LogRestriction)),o.xp6(9),o.Q6J("ngIf",0!=o.xi3(25,12,t.entityStock,"MinStock")),o.xp6(2),o.Q6J("ngIf",0!=o.xi3(27,15,t.entityStock,"MaxStock")),o.xp6(2),o.Q6J("ngIf",null==t.role?null:t.role.IsSerialNumber),o.xp6(1),o.Q6J("ngIf",null==t.role?null:t.role.IsSerialNumber),o.xp6(2),o.Q6J("ngForOf",o.Dn7(32,18,t.entityStock,t.inventorySortDirection?"desc":"","UnitsInStock")),o.xp6(6),o.hij(" ",o.lcZ(38,22,o.xi3(39,24,t.entityStock,"UnitsInStock"))," "),o.xp6(4),o.hij(" ",o.lcZ(42,27,o.xi3(43,29,t.entityStock,"Allocated"))," "),o.xp6(3),o.Q6J("ngIf",0!==o.xi3(45,32,t.entityStock,"Available")),o.xp6(2),o.Q6J("ngIf",0!==o.xi3(47,35,t.entityStock,"MinStock")),o.xp6(2),o.Q6J("ngIf",0!==o.xi3(49,38,t.entityStock,"MaxStock"))}}let ue=(()=>{class t{constructor(){this.inventorySortDirection=!0}ngOnChanges(){this.variantInfoModel&&(this.variantParent=this.variantInfoModel.VariantParent,this.variant=this.variantInfoModel.Variant,this.role=this.variantInfoModel.Roles,this.entityStock=this.variantInfoModel.EntityStockOutlet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-inventory"]],inputs:{variantInfoModel:"variantInfoModel"},features:[o.TTD],decls:2,vars:2,consts:[["class","card","style","border-top:none",4,"ngIf"],[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],[1,"content"],[1,"d-flex","justify-content-between"],[4,"ngIf"],["ng-show","ShowBy",1,"table","custom-table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],["class","btn-group bg-white ml-5",4,"ngIf"],["title","How many you have in your warehouse right now",1,"text-right","border-right",2,"width","100px",3,"click"],[2,"cursor","pointer"],[1,"fas","fa-sort"],["title","How many have been Allocated, but not shipped out yet",1,"text-right",2,"width","100px"],["title","How many can be purchased by customers",1,"text-right",2,"width","100px"],["class","text-right","title","Minimum Inventory for this outlet before it gets re-alerted","style","width:70px",4,"ngIf"],["class","text-right","title","Maximum Inventory that this outlet should have","style","width:70px",4,"ngIf"],[4,"ngFor","ngForOf"],["colspan","1"],[1,"text-right","border-right"],["class","text-right border-right",4,"ngIf"],[1,"text-muted","h6"],["type","radio","value","true"],["type","radio","value","false"],[1,"btn-group","bg-white","ml-5"],["class","btn btn-outline-secondary btn-sm ","style","font-size: 10px !important;",3,"href",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",2,"font-size","10px !important",3,"href"],["title","Minimum Inventory for this outlet before it gets re-alerted",1,"text-right",2,"width","70px"],["title","Maximum Inventory that this outlet should have",1,"text-right",2,"width","70px"],[2,"vertical-align","middle"],[1,"text-right","border-right",2,"vertical-align","middle",3,"ngClass"],[1,"text-right","border-bottom"],[1,"text-right",3,"ngClass"],[1,"list-inline"],["class","float-left mr-7",4,"ngFor","ngForIn"],[1,"float-left","mr-7"],[3,"href"],["aria-hidden","true",1,"fa","fa-barcode","fa-lg"]],template:function(t,e){1&t&&(o.YNc(0,Bt,4,0,"div",0),o.YNc(1,ce,50,41,"div",0)),2&t&&(o.Q6J("ngIf",!(e.variantParent&&(null==e.variantParent?null:e.variantParent.Ratio)>0||null!=e.role&&e.role.IsMultipleOUM||null!=e.role&&e.role.IsSerialNumber||1==(null==e.variant?null:e.variant.getTypeID)||6==(null==e.variant?null:e.variant.getTypeID)||5==(null==e.variant?null:e.variant.getTypeID))),o.xp6(1),o.Q6J("ngIf",e.variantParent&&(null==e.variantParent?null:e.variantParent.Ratio)>0||(null==e.role?null:e.role.IsMultipleOUM)||(null==e.role?null:e.role.IsSerialNumber)||1==(null==e.variant?null:e.variant.getTypeID)||6==(null==e.variant?null:e.variant.getTypeID)||5==(null==e.variant?null:e.variant.getTypeID)))},directives:[i.O5,i.sg,i.mk],pipes:[q.qU,q.W7,i.JJ],styles:[""]}),t})();function de(t,e){1&t&&(o.TgZ(0,"th",11),o._uU(1,"Unit Cost"),o.qZA())}function ge(t,e){1&t&&(o.TgZ(0,"th",11),o._uU(1,"Total Cost"),o.qZA())}function Ze(t,e){1&t&&o._UZ(0,"i",16)}function pe(t,e){if(1&t&&(o.TgZ(0,"td"),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw();o.xp6(1),o.hij(" ",e.findCurrencySymbolById(null==t?null:t.PriceCurrencyID)+" "+o.lcZ(2,1,null==t?null:t.TotalCost)," ")}}function he(t,e){if(1&t&&(o.TgZ(0,"td"),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit,e=o.oxw();o.xp6(1),o.hij(" ",e.findCurrencySymbolById(null==t?null:t.PriceCurrencyID)+" "+o.lcZ(2,1,null==t?null:t.TotalCost)," ")}}function ve(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o.TgZ(2,"div",12),o.TgZ(3,"a",13),o._uU(4),o.qZA(),o.YNc(5,Ze,1,0,"i",14),o.qZA(),o.qZA(),o.TgZ(6,"td"),o._uU(7),o.qZA(),o.TgZ(8,"td"),o._uU(9),o.qZA(),o.TgZ(10,"td"),o._uU(11),o.qZA(),o.YNc(12,pe,3,3,"td",15),o.YNc(13,he,3,3,"td",15),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(3),o.MGl("href","/A/Products/Catalog/Variants/Info?ID=",null==t?null:t.ID,"",o.LSH),o.xp6(1),o.Oqu(null==t?null:t.Name),o.xp6(1),o.Q6J("ngIf",null==t?null:t.HasComponent),o.xp6(2),o.Oqu(null==t?null:t.Code),o.xp6(2),o.Oqu(null==t?null:t.Quantity),o.xp6(2),o.Oqu(null==t?null:t.UomName),o.xp6(1),o.Q6J("ngIf",null==n.role?null:n.role.RoleCost),o.xp6(1),o.Q6J("ngIf",null==n.role?null:n.role.RoleCost)}}let fe=(()=>{class t{constructor(){}findCurrencySymbolById(t){let e;return this.currencies.forEach(n=>{n.getID===t&&(e=n.getSymbol)}),e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-component"]],inputs:{composites:"composites",role:"role",currencies:"currencies"},decls:19,vars:3,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],[1,"border-right",2,"width","120px"],[1,"border-right",2,"width","70px"],["class","border-right number cost","style","width:120px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"border-right","number","cost",2,"width","120px"],[1,"d-flex","justify-content-between"],[3,"href"],["class","fas fa-code-branch","title","This component has a component",4,"ngIf"],[4,"ngIf"],["title","This component has a component",1,"fas","fa-code-branch"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"table",4),o.TgZ(5,"thead"),o.TgZ(6,"tr",5),o.TgZ(7,"th",6),o._uU(8,"Variant"),o.qZA(),o.TgZ(9,"th",7),o._uU(10,"Code"),o.qZA(),o.TgZ(11,"th",8),o._uU(12,"Qty"),o.qZA(),o.TgZ(13,"th",8),o._uU(14,"Uom"),o.qZA(),o.YNc(15,de,2,0,"th",9),o.YNc(16,ge,2,0,"th",9),o.qZA(),o.qZA(),o.TgZ(17,"tbody"),o.YNc(18,ve,14,8,"tr",10),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(15),o.Q6J("ngIf",null==e.role?null:e.role.RoleCost),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.RoleCost),o.xp6(2),o.Q6J("ngForOf",e.composites))},directives:[i.O5,i.sg],pipes:[i.JJ],styles:[""]}),t})();function me(t,e){1&t&&(o.TgZ(0,"th",9),o._uU(1,"Extra Cost"),o.qZA())}function Ae(t,e){1&t&&(o.TgZ(0,"th",12),o._uU(1,"Disc."),o.qZA())}function Te(t,e){if(1&t&&(o.TgZ(0,"td"),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",(null==t?null:t.getPriceCurrency)+" "+o.lcZ(2,1,t.getExtraCost)," ")}}function qe(t,e){if(1&t&&(o.TgZ(0,"td"),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(t.getPriceDiscount+"%")}}function be(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.YNc(3,Te,3,3,"td",13),o.TgZ(4,"td"),o._uU(5),o.ALo(6,"number"),o.qZA(),o.YNc(7,qe,2,1,"td",13),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(2),o.Oqu(null==t?null:t.getEntityName),o.xp6(1),o.Q6J("ngIf",null==n.role?null:n.role.OutLetPriceVisible),o.xp6(2),o.hij(" ",(null==t?null:t.getPriceCurrency)+" "+o.lcZ(6,4,t.getUnitPrice)," "),o.xp6(2),o.Q6J("ngIf",!(null!=n.role&&n.role.OutLetPriceVisible))}}let ye=(()=>{class t{constructor(){}ngOnChanges(){this.variantInfoModel&&(this.role=this.variantInfoModel.Roles,this.outletPrices=this.variantInfoModel.OutletPrice,this.currencies=this.variantInfoModel.Currencies)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-outlet-price"]],inputs:{variantInfoModel:"variantInfoModel"},features:[o.TTD],decls:16,vars:3,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],["class","border-right","width","100px",4,"ngIf"],["width","100px",1,"border-right"],["class","border-right","width","50px",4,"ngIf"],[4,"ngFor","ngForOf"],["width","50px",1,"border-right"],[4,"ngIf"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o.TgZ(5,"table",5),o.TgZ(6,"thead"),o.TgZ(7,"tr",6),o.TgZ(8,"th",7),o._uU(9,"Outlet"),o.qZA(),o.YNc(10,me,2,0,"th",8),o.TgZ(11,"th",9),o._uU(12,"Price"),o.qZA(),o.YNc(13,Ae,2,0,"th",10),o.qZA(),o.qZA(),o.TgZ(14,"tbody"),o.YNc(15,be,8,6,"tr",11),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(10),o.Q6J("ngIf",null==e.role?null:e.role.OutLetPriceVisible),o.xp6(3),o.Q6J("ngIf",!(null!=e.role&&e.role.OutLetPriceVisible)),o.xp6(2),o.Q6J("ngForOf",e.outletPrices))},directives:[i.O5,i.sg],pipes:[i.JJ],styles:[""]}),t})();function xe(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.TgZ(3,"td"),o._uU(4),o.qZA(),o.TgZ(5,"td"),o._uU(6),o.ALo(7,"number"),o.qZA(),o.TgZ(8,"td"),o._uU(9),o.ALo(10,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(t.Name),o.xp6(2),o.Oqu(t.MinimumQuantity),o.xp6(2),o.Oqu("Rp "+o.lcZ(7,4,t.UnitPrice)),o.xp6(3),o.Oqu(o.lcZ(10,6,t.PriceDiscount)+"%")}}let Ie=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-pricebook"]],inputs:{pricebooks:"pricebooks"},decls:18,vars:1,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],["width","120px",1,"border-right"],["width","100px",1,"border-right"],["width","50px",1,"border-right"],[4,"ngFor","ngForOf"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o.TgZ(5,"table",5),o.TgZ(6,"thead"),o.TgZ(7,"tr",6),o.TgZ(8,"th",7),o._uU(9,"Name"),o.qZA(),o.TgZ(10,"th",8),o._uU(11,"Minimum Quantity"),o.qZA(),o.TgZ(12,"th",9),o._uU(13,"Unit Price"),o.qZA(),o.TgZ(14,"th",10),o._uU(15,"Unit Disc."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"tbody"),o.YNc(17,xe,11,8,"tr",11),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(17),o.Q6J("ngForOf",e.pricebooks))},directives:[i.sg],pipes:[i.JJ],styles:[""]}),t})();function Me(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.TgZ(3,"td"),o._uU(4),o.ALo(5,"number"),o.qZA(),o.TgZ(6,"td"),o._uU(7),o.ALo(8,"number"),o.qZA(),o.TgZ(9,"td",14),o._uU(10),o.ALo(11,"number"),o.qZA(),o.TgZ(12,"td",14),o._uU(13),o.ALo(14,"number"),o.qZA(),o.TgZ(15,"td"),o._uU(16),o.ALo(17,"number"),o.qZA(),o.TgZ(18,"td"),o._uU(19),o.ALo(20,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(t.PromotionName),o.xp6(2),o.Oqu(t.MinimumQty>0?o.lcZ(5,7,t.MinimumQty):"-"),o.xp6(3),o.Oqu(t.MinimumAmount>0?"Rp "+o.lcZ(8,9,t.MinimumAmount):"-"),o.xp6(3),o.Oqu("Rp "+o.lcZ(11,11,t.UnitCost)),o.xp6(3),o.Oqu(o.lcZ(14,13,t.CostDiscount)+"%"),o.xp6(3),o.Oqu("Rp "+o.lcZ(17,15,t.UnitPrice)),o.xp6(3),o.Oqu(o.lcZ(20,17,t.Discount)+"%")}}let Ce=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-promotion"]],inputs:{promotions:"promotions"},decls:24,vars:1,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],["width","120px",1,"border-right"],["width","100px","ng-if","ctrl.Model.Roles.RoleCost",1,"border-right"],["width","50px","ng-if","ctrl.Model.Roles.RoleCost",1,"border-right"],["width","100px",1,"border-right"],["width","50px",1,"border-right"],[4,"ngFor","ngForOf"],["ng-if","ctrl.Model.Roles.RoleCost"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o.TgZ(5,"table",5),o.TgZ(6,"thead"),o.TgZ(7,"tr",6),o.TgZ(8,"th",7),o._uU(9,"Name"),o.qZA(),o.TgZ(10,"th",8),o._uU(11,"Minimum Quantity"),o.qZA(),o.TgZ(12,"th",8),o._uU(13,"Minimum Amount"),o.qZA(),o.TgZ(14,"th",9),o._uU(15,"Cost"),o.qZA(),o.TgZ(16,"th",10),o._uU(17,"Cost Disc."),o.qZA(),o.TgZ(18,"th",11),o._uU(19,"Unit Price"),o.qZA(),o.TgZ(20,"th",12),o._uU(21,"Unit Disc."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(22,"tbody"),o.YNc(23,Me,21,19,"tr",13),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(23),o.Q6J("ngForOf",e.promotions))},directives:[i.sg],pipes:[i.JJ],styles:[""]}),t})();function Ue(t,e){if(1&t&&(o.TgZ(0,"div",5),o.TgZ(1,"div",6),o._UZ(2,"input",7),o.ALo(3,"number"),o.TgZ(4,"label",8),o._uU(5,"Commission"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",o.lcZ(3,1,null==t.variant?null:t.variant.getSalesCommission))}}function Pe(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.TgZ(3,"td",15),o._uU(4),o.ALo(5,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(t.getName),o.xp6(2),o.Oqu(o.lcZ(5,2,t.getAmount))}}function _e(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"table",10),o.TgZ(2,"thead"),o.TgZ(3,"tr",11),o.TgZ(4,"th",12),o._uU(5,"Name"),o.qZA(),o.TgZ(6,"th",13),o._uU(7,"Comission"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"tbody"),o.YNc(9,Pe,6,4,"tr",14),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(9),o.Q6J("ngForOf",t.commisions)}}let Je=(()=>{class t{constructor(){}ngOnChanges(){this.variantInfoModel&&(this.commisions=this.variantInfoModel.Commission,this.variant=this.variantInfoModel.Variant)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-commision"]],inputs:{variantInfoModel:"variantInfoModel"},features:[o.TTD],decls:7,vars:2,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],["class","col-sm-4",4,"ngIf"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-4"],[1,"form-label-group"],["type","text","id","commision","placeholder","Commission","name","Commission","readonly","",1,"form-control",3,"ngModel"],["for","commision"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],[1,"border-right","text-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"text-right"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",0),o.TgZ(2,"div",1),o.TgZ(3,"div",2),o.YNc(4,Ue,6,3,"div",3),o.qZA(),o.TgZ(5,"div",2),o.YNc(6,_e,10,1,"div",4),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngIf",0!==(null==e.variant?null:e.variant.getSalesCommission)),o.xp6(2),o.Q6J("ngIf",0!==(null==e.commisions?null:e.commisions.length)))},directives:[i.O5,f.Fj,f.JJ,f.On,i.sg],pipes:[i.JJ],styles:[""]}),t})();function Oe(t,e){if(1&t&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o._UZ(2,"input",12),o.TgZ(3,"label",13),o._uU(4,"UOM Sub Quantity"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",null==t.categoryMeasurement?null:t.categoryMeasurement.UOMQ)}}function Se(t,e){if(1&t&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o._UZ(2,"input",14),o.TgZ(3,"label",15),o._uU(4,"Measurements"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",null==t.categoryMeasurement?null:t.categoryMeasurement.Measurement)}}function we(t,e){if(1&t&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o._UZ(2,"input",16),o.TgZ(3,"label",17),o._uU(4,"Sell Price Type"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",null==t.variant?null:t.variant.getSellPriceTypeString)}}let Ne=(()=>{class t{constructor(){}ngOnChanges(){this.variantInfoModel&&(this.variant=this.variantInfoModel.Variant,this.categoryMeasurement=this.variantInfoModel.CategoryMeasurement)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-advanced"]],inputs:{variantInfoModel:"variantInfoModel"},features:[o.TTD],decls:22,vars:6,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-4"],[1,"form-label-group"],["type","text","id","unitQty","placeholder","Content","name","Content","readonly","",1,"form-control",3,"ngModel"],["for","unitQty"],["type","text","id","index","placeholder","Index","name","Index","readonly","",1,"form-control",3,"ngModel"],["for","index"],["type","text","id","size","placeholder","Pack Size","name","Pack Size","readonly","",1,"form-control",3,"ngModel"],["for","size"],["class","col-sm-4",4,"ngIf"],["type","text","id","uomSub","placeholder","UOM Sub Quantity","name","UOM Sub Quantity","readonly","",1,"form-control",3,"ngModel"],["for","uomSub"],["type","text","id","measurement","placeholder","Measurements","name","Measurements","readonly","",1,"form-control",3,"ngModel"],["for","measurement"],["type","text","id","sellPrice","placeholder","Sell Price Type","name","Sell Price Type","readonly","",1,"form-control",3,"ngModel"],["for","sellPrice"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o._UZ(5,"input",5),o.TgZ(6,"label",6),o._uU(7,"Content"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",3),o.TgZ(9,"div",4),o._UZ(10,"input",7),o.TgZ(11,"label",8),o._uU(12,"Index"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"div",3),o.TgZ(14,"div",4),o._UZ(15,"input",9),o.TgZ(16,"label",10),o._uU(17,"Pack Size"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(18,"div",2),o.YNc(19,Oe,5,1,"div",11),o.YNc(20,Se,5,1,"div",11),o.YNc(21,we,5,1,"div",11),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getUnitQuantity),o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getProductIndex),o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getPackSize),o.xp6(4),o.Q6J("ngIf",null==e.categoryMeasurement?null:e.categoryMeasurement.UOMQ),o.xp6(1),o.Q6J("ngIf",null==e.categoryMeasurement?null:e.categoryMeasurement.Measurement),o.xp6(1),o.Q6J("ngIf",2==(null==e.variant?null:e.variant.getTypeID)))},directives:[f.Fj,f.JJ,f.On,i.O5],styles:[""]}),t})(),De=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-description"]],inputs:{variant:"variant"},decls:8,vars:1,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],["type","text","id","desc","placeholder","Description","name","Description","readonly","",1,"form-control",3,"value"],["for","desc"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o._UZ(5,"input",5),o.TgZ(6,"label",6),o._uU(7,"Description"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("value",null==e.variant?null:e.variant.getDescription))},styles:[""]}),t})();function Qe(t,e){if(1&t&&(o.TgZ(0,"tr",9),o.TgZ(1,"td"),o.TgZ(2,"a",10),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"td",11),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.MGl("href","/A/Products/Catalog/Variants/Info?ID=",null==t?null:t.getID,"",o.LSH),o.xp6(1),o.Oqu(null==t?null:t.getName),o.xp6(2),o.Oqu(o.lcZ(6,3,null==t?null:t.getQuantity))}}let ke=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-dependency-of"]],inputs:{dependencyOf:"dependencyOf"},decls:13,vars:1,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],[1,"border-right","text-right",2,"width","80px"],["ng-repeat","item in ctrl.Model.DependencyOf",4,"ngFor","ngForOf"],["ng-repeat","item in ctrl.Model.DependencyOf"],[3,"href"],[1,"text-right"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"table",4),o.TgZ(5,"thead"),o.TgZ(6,"tr",5),o.TgZ(7,"th",6),o._uU(8,"Variant"),o.qZA(),o.TgZ(9,"th",7),o._uU(10,"Quantity"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(11,"tbody"),o.YNc(12,Qe,7,5,"tr",8),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(12),o.Q6J("ngForOf",e.dependencyOf))},directives:[i.sg],pipes:[i.JJ],styles:[""]}),t})(),Le=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-purchase"]],inputs:{variant:"variant"},decls:8,vars:1,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-4"],[1,"form-label-group"],["type","text","id","expense","placeholder","Unit Expense","name","Unit Expense","readonly","",1,"form-control",3,"ngModel"],["for","expense"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o._UZ(5,"input",5),o.TgZ(6,"label",6),o._uU(7,"Unit Expense"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("ngModel",null==e.variant?null:e.variant.getUnitExpense))},directives:[f.Fj,f.JJ,f.On],styles:[""]}),t})(),Ve=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-multiuom"]],inputs:{variantParent:"variantParent",variant:"variant"},decls:26,vars:3,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"col-sm-12"],[1,"row"],[1,"float-none","col-sm-2"],[1,"col-sm-4","pl-1"],[1,"form-label-group"],["type","text","id","parent","placeholder","Parent","name","Parent","readonly","",1,"form-control",3,"ngModel"],["for","parent"],[1,"col-sm-auto","ml-0",2,"width","40px"],[1,"text-left"],[1,"col-sm-3"],["type","text","id","ratio","placeholder","Ratio","name","Ratio","readonly","",1,"form-control",3,"ngModel"],["for","ratio"],[1,"col-sm-auto"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o._UZ(5,"br"),o.TgZ(6,"h3"),o._uU(7,"1 (one)"),o.qZA(),o.qZA(),o.TgZ(8,"div",5),o.TgZ(9,"div",6),o._UZ(10,"input",7),o.TgZ(11,"label",8),o._uU(12,"Parent"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"div",9),o._UZ(14,"br"),o.TgZ(15,"h3",10),o._uU(16," = "),o.qZA(),o.qZA(),o.TgZ(17,"div",11),o.TgZ(18,"div",6),o._UZ(19,"input",12),o.TgZ(20,"label",13),o._uU(21,"Ratio"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(22,"div",14),o._UZ(23,"br"),o.TgZ(24,"h3",10),o._uU(25),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(10),o.Q6J("ngModel",null==e.variantParent?null:e.variantParent.ParentName),o.xp6(9),o.Q6J("ngModel",null==e.variantParent?null:e.variantParent.Ratio),o.xp6(6),o.Oqu(null==e.variant?null:e.variant.getModel))},directives:[f.Fj,f.JJ,f.On],styles:[""]}),t})();function Ye(t,e){if(1&t&&(o.TgZ(0,"tr",12),o.TgZ(1,"td"),o._uU(2),o.qZA(),o.TgZ(3,"td",13),o._uU(4),o.ALo(5,"number"),o.qZA(),o.TgZ(6,"td",13),o._uU(7),o.ALo(8,"number"),o.qZA(),o.TgZ(9,"td",13),o._uU(10),o.ALo(11,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(t.getOutlet),o.xp6(2),o.Oqu(o.lcZ(5,4,t.getOnHand)),o.xp6(3),o.Oqu(o.lcZ(8,6,t.getAllocated)),o.xp6(3),o.Oqu(o.lcZ(11,8,t.getAvailable))}}let He=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-composite-inventory"]],inputs:{compositeInventories:"compositeInventories"},decls:19,vars:1,consts:[[1,"card",2,"border-top","none"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-right"],["ng-click","compositeSortDirec = !compositeSortDirec",1,"border-right","text-right",2,"width","100px"],[2,"cursor","pointer"],[1,"fas","fa-sort"],[1,"border-right","text-right",2,"width","100px"],["ng-repeat","item in ctrl.Model.CompositeInventory | orderBy : 'OnHand' : !compositeSortDirec",4,"ngFor","ngForOf"],["ng-repeat","item in ctrl.Model.CompositeInventory | orderBy : 'OnHand' : !compositeSortDirec"],[1,"text-right"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"table",4),o.TgZ(5,"thead"),o.TgZ(6,"tr",5),o.TgZ(7,"th",6),o._uU(8,"Outlet"),o.qZA(),o.TgZ(9,"th",7),o._uU(10," On Hand "),o.TgZ(11,"span",8),o._UZ(12,"i",9),o.qZA(),o.qZA(),o.TgZ(13,"th",10),o._uU(14," Allocated "),o.qZA(),o.TgZ(15,"th",10),o._uU(16," Available "),o.qZA(),o.qZA(),o.qZA(),o.TgZ(17,"tbody"),o.YNc(18,Ye,12,10,"tr",11),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(18),o.Q6J("ngForOf",e.compositeInventories))},directives:[i.sg],pipes:[i.JJ],styles:[""]}),t})();function Re(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",24),o._uU(2,"Component"),o.qZA(),o.qZA())}function $e(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",25),o._uU(2,"Outlet Price"),o.qZA(),o.qZA())}function Fe(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",26),o._uU(2,"Pricebook"),o.qZA(),o.qZA())}function Ee(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",27),o._uU(2,"Promotion"),o.qZA(),o.qZA())}function je(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",28),o._uU(2,"Purchase"),o.qZA(),o.qZA())}function Be(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",29),o._uU(2,"Description"),o.qZA(),o.qZA())}function Ge(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",30),o._uU(2,"Commission"),o.qZA(),o.qZA())}function Xe(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",31),o._uU(2,"MultiUOM"),o.qZA(),o.qZA())}function ze(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",32),o._uU(2,"Composite Inventory"),o.qZA(),o.qZA())}function Ke(t,e){1&t&&(o.TgZ(0,"li",1),o.TgZ(1,"a",33),o._uU(2,"Dependency Of"),o.qZA(),o.qZA())}function We(t,e){1&t&&(o.TgZ(0,"div",34),o._UZ(1,"POS-info-purchase"),o.qZA())}function tn(t,e){if(1&t&&(o.TgZ(0,"div",35),o._UZ(1,"POS-info-multiuom",36),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("variant",t.variant)("variantParent",t.variantParent)}}function en(t,e){if(1&t&&(o.TgZ(0,"div",37),o._UZ(1,"POS-info-composite-inventory",38),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("compositeInventories",t.compositeInventories)}}let nn=(()=>{class t{constructor(){this.outletPrices=[],this.pricebooks=[],this.commisions=[],this.promotions=[],this.compositeInventories=[],this.dependencyOf=[],this.composites=[],this.variantType=u.J}ngOnChanges(){this.variantInfoModel&&(this.outletPrices=this.variantInfoModel.OutletPrice,this.commisions=this.variantInfoModel.Commission,this.pricebooks=this.variantInfoModel.Pricebook,this.promotions=this.variantInfoModel.Promotion,this.compositeInventories=this.variantInfoModel.CompositeInventory,this.dependencyOf=this.variantInfoModel.DependencyOf,this.composites=this.variantInfoModel.Composites,this.variant=this.variantInfoModel.Variant,this.variantParent=this.variantInfoModel.VariantParent,this.role=this.variantInfoModel.Roles,this.currencies=this.variantInfoModel.Currencies)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-info-nav-tab"]],inputs:{variantInfoModel:"variantInfoModel"},features:[o.TTD],decls:39,vars:24,consts:[["id","myTab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","inventory-tab","data-toggle","tab","href","#inventory","role","tab","aria-controls","inventory","aria-selected","false",1,"nav-link","active"],["class","nav-item",4,"ngIf"],["id","advance-tab","data-toggle","tab","href","#advance","role","tab","aria-controls","advance","aria-selected","false",1,"nav-link"],["id","myTabContent",1,"tab-content"],["id","inventory","role","tabpanel",1,"tab-pane","fade","show","active","mt-0","pt-0"],[3,"variantInfoModel"],["id","component","role","tabpanel","ng-if","ctrl.Model.Composites.length > 0",1,"tab-pane","fade","mt-0","pt-0"],[3,"composites","role","currencies"],["id","price","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","pricebook","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"pricebooks"],["id","promotion","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"promotions"],["class","tab-pane fade mt-0 pt-0","id","purchase","role","tabpanel",4,"ngIf"],["id","commission","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","advance","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","description","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"variant"],["class","tab-pane fade mt-0 pt-0","id","multiuom","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","composite-inventory","role","tabpanel",4,"ngIf"],["id","dependency-of","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"dependencyOf"],["id","component-tab","data-toggle","tab","href","#component","role","tab","aria-controls","component","aria-selected","false",1,"nav-link"],["id","price-tab","data-toggle","tab","href","#price","role","tab","aria-controls","price","aria-selected","false",1,"nav-link"],["id","pricebook-tab","data-toggle","tab","href","#pricebook","role","tab","aria-controls","pricebook","aria-selected","false",1,"nav-link"],["id","promotion-tab","data-toggle","tab","href","#promotion","role","tab","aria-controls","promotion","aria-selected","false",1,"nav-link"],["id","purchase-tab","data-toggle","tab","href","#purchase","role","tab","aria-controls","purchase","aria-selected","false",1,"nav-link"],["id","description-tab","data-toggle","tab","href","#description","role","tab","aria-controls","description","aria-selected","true",1,"nav-link"],["id","commission-tab","data-toggle","tab","href","#commission","role","tab","aria-controls","commission","aria-selected","false",1,"nav-link"],["id","multiuom-tab","data-toggle","tab","href","#multiuom","role","tab","aria-controls","multiuom","aria-selected","false",1,"nav-link"],["id","composite-inventory-tab","data-toggle","tab","href","#composite-inventory","role","tab","aria-controls","composite-inventory","aria-selected","false",1,"nav-link"],["id","dependency-of-tab","data-toggle","tab","href","#dependency-of","role","tab","aria-controls","dependency-of","aria-selected","false",1,"nav-link"],["id","purchase","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","multiuom","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"variant","variantParent"],["id","composite-inventory","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"compositeInventories"]],template:function(t,e){1&t&&(o.TgZ(0,"ul",0),o.TgZ(1,"li",1),o.TgZ(2,"a",2),o._uU(3,"Inventory"),o.qZA(),o.qZA(),o.YNc(4,Re,3,0,"li",3),o.YNc(5,$e,3,0,"li",3),o.YNc(6,Fe,3,0,"li",3),o.YNc(7,Ee,3,0,"li",3),o.YNc(8,je,3,0,"li",3),o.TgZ(9,"li",1),o.TgZ(10,"a",4),o._uU(11,"Advanced"),o.qZA(),o.qZA(),o.YNc(12,Be,3,0,"li",3),o.YNc(13,Ge,3,0,"li",3),o.YNc(14,Xe,3,0,"li",3),o.YNc(15,ze,3,0,"li",3),o.YNc(16,Ke,3,0,"li",3),o.qZA(),o.TgZ(17,"div",5),o.TgZ(18,"div",6),o._UZ(19,"POS-info-inventory",7),o.qZA(),o.TgZ(20,"div",8),o._UZ(21,"POS-info-component",9),o.qZA(),o.TgZ(22,"div",10),o._UZ(23,"POS-info-outlet-price",7),o.qZA(),o.TgZ(24,"div",11),o._UZ(25,"POS-info-pricebook",12),o.qZA(),o.TgZ(26,"div",13),o._UZ(27,"POS-info-promotion",14),o.qZA(),o.YNc(28,We,2,0,"div",15),o.TgZ(29,"div",16),o._UZ(30,"POS-info-commision",7),o.qZA(),o.TgZ(31,"div",17),o._UZ(32,"POS-info-advanced",7),o.qZA(),o.TgZ(33,"div",18),o._UZ(34,"POS-info-description",19),o.qZA(),o.YNc(35,tn,2,2,"div",20),o.YNc(36,en,2,1,"div",21),o.TgZ(37,"div",22),o._UZ(38,"POS-info-dependency-of",23),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngIf",(null==e.composites?null:e.composites.length)>0),o.xp6(1),o.Q6J("ngIf",e.outletPrices.length>0),o.xp6(1),o.Q6J("ngIf",0!==e.pricebooks.length),o.xp6(1),o.Q6J("ngIf",0!==e.promotions.length),o.xp6(1),o.Q6J("ngIf",0!==(null==e.variant?null:e.variant.getUnitExpense)),o.xp6(4),o.Q6J("ngIf",null==e.variant?null:e.variant.getDescription),o.xp6(1),o.Q6J("ngIf",0!=(null==e.variant?null:e.variant.getSalesCommission)||0!==(null==e.commisions?null:e.commisions.length)),o.xp6(1),o.Q6J("ngIf",(null==e.variant?null:e.variant.getTypeID)==e.variantType.MultipleUOM),o.xp6(1),o.Q6J("ngIf",(null==e.variant?null:e.variant.getTypeID)===e.variantType.Composite),o.xp6(1),o.Q6J("ngIf",0!==e.dependencyOf.length),o.xp6(3),o.Q6J("variantInfoModel",e.variantInfoModel),o.xp6(2),o.Q6J("composites",e.composites)("role",e.role)("currencies",e.currencies),o.xp6(2),o.Q6J("variantInfoModel",e.variantInfoModel),o.xp6(2),o.Q6J("pricebooks",e.pricebooks),o.xp6(2),o.Q6J("promotions",e.promotions),o.xp6(1),o.Q6J("ngIf",(null==e.role?null:e.role.ExpenseRole)&&0!==(null==e.variant?null:e.variant.getUnitExpense)),o.xp6(2),o.Q6J("variantInfoModel",e.variantInfoModel),o.xp6(2),o.Q6J("variantInfoModel",e.variantInfoModel),o.xp6(2),o.Q6J("variant",e.variant),o.xp6(1),o.Q6J("ngIf",(null==e.role?null:e.role.IsMultipleOUM)&&e.variantParent.ParentName&&(null==e.variantParent?null:e.variantParent.Ratio)>0),o.xp6(1),o.Q6J("ngIf",(null==e.variant?null:e.variant.getTypeID)===e.variantType.Composite),o.xp6(2),o.Q6J("dependencyOf",e.dependencyOf))},directives:[i.O5,ue,fe,ye,Ie,Ce,Je,Ne,De,ke,Le,Ve,He],styles:["input[readonly][_ngcontent-%COMP%] {\n background-color: white;\n}"]}),t})();function on(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",10),o.NdJ("click",function(){return o.CHM(t),o.oxw().getSalesHistory()}),o._uU(1,"View"),o.qZA()}}const rn=function(){return["Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},an=function(t){return{VariantID:t}};function ln(t,e){if(1&t&&(o.TgZ(0,"a",11),o._uU(1,"more"),o.qZA()),2&t){const t=o.oxw();o.Q6J("routerLink",o.DdM(2,rn))("queryParams",o.VKq(3,an,null==t.variant?null:t.variant.getID))}}function sn(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"Price"),o.qZA())}function cn(t,e){1&t&&(o.TgZ(0,"th",19),o._uU(1,"%"),o.qZA())}function un(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"Net"),o.qZA())}function dn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",o.lcZ(2,1,t.Total),"")}}function gn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",o.lcZ(2,1,t.Discount),"")}}function Zn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",o.lcZ(2,1,t.TotalAfterDiscount),"")}}function pn(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.ALo(3,"date"),o.qZA(),o.TgZ(4,"td"),o.TgZ(5,"a",20),o._uU(6),o.qZA(),o.qZA(),o.TgZ(7,"td"),o._uU(8),o.ALo(9,"number"),o.qZA(),o.YNc(10,dn,3,3,"td",15),o.YNc(11,gn,3,3,"td",15),o.YNc(12,Zn,3,3,"td",15),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(2),o.Oqu(o.xi3(3,7,t.Date,"dd/MM/yy")),o.xp6(3),o.MGl("href","/A/Orders/Orders/Customer_Invoice/Info?ID=",t.InvoiceID,"",o.LSH),o.xp6(1),o.Oqu(t.Number),o.xp6(2),o.Oqu(o.lcZ(9,10,t.Quantity)),o.xp6(2),o.Q6J("ngIf",!(null!=n.role&&n.role.UnitPriceRestriction)),o.xp6(1),o.Q6J("ngIf",!(null!=n.role&&n.role.UnitPriceRestriction)&&(null==n.salesHistory?null:n.salesHistory.DiscountCount)>0),o.xp6(1),o.Q6J("ngIf",!(null!=n.role&&n.role.UnitPriceRestriction)&&(null==n.salesHistory?null:n.salesHistory.DiscountCount)>0)}}function hn(t,e){if(1&t&&(o.TgZ(0,"div",12),o.TgZ(1,"table",13),o.TgZ(2,"thead"),o.TgZ(3,"tr",14),o.TgZ(4,"th"),o._uU(5,"Date"),o.qZA(),o.TgZ(6,"th"),o._uU(7,"Invoice"),o.qZA(),o.TgZ(8,"th"),o._uU(9,"Qty"),o.qZA(),o.YNc(10,sn,2,0,"th",15),o.YNc(11,cn,2,0,"th",16),o.YNc(12,un,2,0,"th",15),o.qZA(),o.qZA(),o.TgZ(13,"tbody"),o.YNc(14,pn,13,12,"tr",17),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(10),o.Q6J("ngIf",!(null!=t.role&&t.role.UnitPriceRestriction)),o.xp6(1),o.Q6J("ngIf",!(null!=t.role&&t.role.UnitPriceRestriction)&&(null==t.salesHistory?null:t.salesHistory.DiscountCount)>0),o.xp6(1),o.Q6J("ngIf",!(null!=t.role&&t.role.UnitPriceRestriction)&&(null==t.salesHistory?null:t.salesHistory.DiscountCount)>0),o.xp6(2),o.Q6J("ngForOf",null==t.salesHistory?null:t.salesHistory.Data)}}let vn=(()=>{class t{constructor(t){this.variantService=t,this.destroy$=new s.xQ,this.salesHistoryRequested=!1}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getSalesHistory(){this.variantService.getSalesHistory(this.variant).pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.salesHistoryRequested=!0,this.salesHistory=t})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-sales-history"]],inputs:{variant:"variant",role:"role"},decls:13,vars:3,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm","target","_blank",3,"routerLink","queryParams",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"content"],[1,"table","mt-5"],[1,"table-secondary"],["class","text-right",4,"ngIf"],["style","width: 45px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right",2,"width","45px"],["target","_blank",3,"href"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div"),o.TgZ(3,"h3"),o._uU(4,"Sales History"),o.qZA(),o.qZA(),o.TgZ(5,"div",2),o.YNc(6,on,2,0,"a",3),o.YNc(7,ln,2,5,"a",4),o.qZA(),o.qZA(),o.TgZ(8,"div",5),o.TgZ(9,"div",6),o.TgZ(10,"div",7),o.TgZ(11,"div",8),o.YNc(12,hn,15,4,"div",9),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(6),o.Q6J("ngIf",!e.salesHistoryRequested),o.xp6(1),o.Q6J("ngIf",e.salesHistoryRequested),o.xp6(5),o.Q6J("ngIf",(null==e.salesHistory?null:e.salesHistory.Data.length)>0))},directives:[i.O5,r.yS,i.sg],pipes:[i.uU,i.JJ],styles:[""]}),t})();function fn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",10),o.NdJ("click",function(){return o.CHM(t),o.oxw().getPurchaseHistory()}),o._uU(1,"View"),o.qZA()}}function mn(t,e){if(1&t&&(o.TgZ(0,"a",11),o._uU(1,"more"),o.qZA()),2&t){const t=o.oxw();o.MGl("href","/A/POS/#/menu/Reports/Purchases_Report/Product_Purchase_History;VariantID=",null==t.variant?null:t.variant.getID,"",o.LSH)}}function An(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"Price"),o.qZA())}function Tn(t,e){1&t&&(o.TgZ(0,"th",19),o._uU(1,"%"),o.qZA())}function qn(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"Net"),o.qZA())}function bn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.UnitPrice*t.Quantity))}}function yn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.Discount))}}function xn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.Total))}}function In(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.ALo(3,"date"),o.qZA(),o.TgZ(4,"td"),o.TgZ(5,"a",20),o._uU(6),o.qZA(),o.qZA(),o._UZ(7,"td",21),o.YNc(8,bn,3,3,"td",15),o.YNc(9,yn,3,3,"td",15),o.YNc(10,xn,3,3,"td",15),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(2),o.Oqu(o.xi3(3,6,t.Date,"dd/MM/yy")),o.xp6(3),o.MGl("href","/A/Orders/Orders/Supplier_Bill/Info?ID=",t.ID,"",o.LSH),o.xp6(1),o.Oqu(t.Number),o.xp6(2),o.Q6J("ngIf",null==n.role?null:n.role.RoleCost),o.xp6(1),o.Q6J("ngIf",(null==n.role?null:n.role.RoleCost)&&(null==n.purchaseHistory?null:n.purchaseHistory.DiscountCount)>0),o.xp6(1),o.Q6J("ngIf",(null==n.role?null:n.role.RoleCost)&&(null==n.purchaseHistory?null:n.purchaseHistory.DiscountCount)>0)}}function Mn(t,e){if(1&t&&(o.TgZ(0,"div",12),o.TgZ(1,"table",13),o.TgZ(2,"thead"),o.TgZ(3,"tr",14),o.TgZ(4,"th"),o._uU(5,"Date"),o.qZA(),o.TgZ(6,"th"),o._uU(7,"Invoice"),o.qZA(),o.TgZ(8,"th"),o._uU(9,"Qty"),o.qZA(),o.YNc(10,An,2,0,"th",15),o.YNc(11,Tn,2,0,"th",16),o.YNc(12,qn,2,0,"th",15),o.qZA(),o.qZA(),o.TgZ(13,"tbody"),o.YNc(14,In,11,9,"tr",17),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(10),o.Q6J("ngIf",null==t.role?null:t.role.RoleCost),o.xp6(1),o.Q6J("ngIf",(null==t.role?null:t.role.RoleCost)&&(null==t.purchaseHistory?null:t.purchaseHistory.DiscountCount)>0),o.xp6(1),o.Q6J("ngIf",(null==t.role?null:t.role.RoleCost)&&(null==t.purchaseHistory?null:t.purchaseHistory.DiscountCount)>0),o.xp6(2),o.Q6J("ngForOf",null==t.purchaseHistory?null:t.purchaseHistory.Data)}}let Cn=(()=>{class t{constructor(t){this.variantService=t,this.purchaseHistoryRequested=!1,this.destroy$=new s.xQ}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getPurchaseHistory(){this.variantService.getPurchaseHistory(this.variant).pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.purchaseHistory=t,this.purchaseHistoryRequested=!0})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-purchase-history"]],inputs:{variant:"variant",role:"role"},decls:13,vars:3,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["target","_blank","class","btn btn-outline-secondary btn-sm",3,"href",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"href"],[1,"content"],[1,"table","mt-5"],[1,"table-secondary"],["class","text-right",4,"ngIf"],["style","width: 45px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right",2,"width","45px"],["target","_blank",3,"href"],["ng-bind","item.Quantity | number"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div"),o.TgZ(3,"h3"),o._uU(4,"Purchase History"),o.qZA(),o.qZA(),o.TgZ(5,"div",2),o.YNc(6,fn,2,0,"a",3),o.YNc(7,mn,2,1,"a",4),o.qZA(),o.qZA(),o.TgZ(8,"div",5),o.TgZ(9,"div",6),o.TgZ(10,"div",7),o.TgZ(11,"div",8),o.YNc(12,Mn,15,4,"div",9),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(6),o.Q6J("ngIf",!e.purchaseHistoryRequested),o.xp6(1),o.Q6J("ngIf",(null==e.purchaseHistory?null:e.purchaseHistory.Data.length)>0&&e.purchaseHistoryRequested),o.xp6(5),o.Q6J("ngIf",(null==e.purchaseHistory?null:e.purchaseHistory.Data.length)>0))},directives:[i.O5,i.sg],pipes:[i.uU,i.JJ],styles:[""]}),t})();function Un(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",10),o.NdJ("click",function(){return o.CHM(t),o.oxw().getParkedHistory()}),o._uU(1,"View"),o.qZA()}}function Pn(t,e){if(1&t&&(o.TgZ(0,"a",11),o._uU(1,"more"),o.qZA()),2&t){const t=o.oxw();o.MGl("href","/A/Orders/Order/Parked_Order?VariantID=",null==t.variant?null:t.variant.getID,"",o.LSH)}}function _n(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"Price"),o.qZA())}function Jn(t,e){1&t&&(o.TgZ(0,"th",19),o._uU(1,"%"),o.qZA())}function On(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"Net"),o.qZA())}function Sn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.Total))}}function wn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.Discount))}}function Nn(t,e){if(1&t&&(o.TgZ(0,"td",18),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.TotalAfterDiscount))}}function Dn(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._uU(2),o.ALo(3,"date"),o.qZA(),o.TgZ(4,"td"),o.TgZ(5,"a",20),o._uU(6),o.qZA(),o.qZA(),o.TgZ(7,"td"),o._uU(8),o.ALo(9,"number"),o.qZA(),o.YNc(10,Sn,3,3,"td",15),o.YNc(11,wn,3,3,"td",15),o.YNc(12,Nn,3,3,"td",15),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(2),o.Oqu(o.xi3(3,7,t.Date,"dd/MM/yy")),o.xp6(3),o.MGl("href","/A/Orders/Order/Sales_Order/Info?ID=",t.ID,"",o.LSH),o.xp6(1),o.Oqu(t.Number),o.xp6(2),o.Oqu(o.lcZ(9,10,t.Quantity)),o.xp6(2),o.Q6J("ngIf",!(null!=n.role&&n.role.UnitPriceRestriction)),o.xp6(1),o.Q6J("ngIf",!(null!=n.role&&n.role.UnitPriceRestriction)&&(null==n.parkedHistory?null:n.parkedHistory.DiscountCount)>0),o.xp6(1),o.Q6J("ngIf",!(null!=n.role&&n.role.UnitPriceRestriction)&&(null==n.parkedHistory?null:n.parkedHistory.DiscountCount)>0)}}function Qn(t,e){if(1&t&&(o.TgZ(0,"div",12),o.TgZ(1,"table",13),o.TgZ(2,"thead"),o.TgZ(3,"tr",14),o.TgZ(4,"th"),o._uU(5,"Date"),o.qZA(),o.TgZ(6,"th"),o._uU(7,"Sales order"),o.qZA(),o.TgZ(8,"th"),o._uU(9,"Qty"),o.qZA(),o.YNc(10,_n,2,0,"th",15),o.YNc(11,Jn,2,0,"th",16),o.YNc(12,On,2,0,"th",15),o.qZA(),o.qZA(),o.TgZ(13,"tbody"),o.YNc(14,Dn,13,12,"tr",17),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(10),o.Q6J("ngIf",!(null!=t.role&&t.role.UnitPriceRestriction)),o.xp6(1),o.Q6J("ngIf",!(null!=t.role&&t.role.UnitPriceRestriction)&&(null==t.parkedHistory?null:t.parkedHistory.DiscountCount)>0),o.xp6(1),o.Q6J("ngIf",!(null!=t.role&&t.role.UnitPriceRestriction)&&(null==t.parkedHistory?null:t.parkedHistory.DiscountCount)>0),o.xp6(2),o.Q6J("ngForOf",null==t.parkedHistory?null:t.parkedHistory.Data)}}let kn=(()=>{class t{constructor(t){this.variantService=t,this.parkHistoryRequested=!1,this.destroy$=new s.xQ}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}getParkedHistory(){this.variantService.getParkedHistory(this.variant).pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.parkedHistory=t,this.parkHistoryRequested=!0})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-parked-history"]],inputs:{variant:"variant",role:"role"},decls:13,vars:3,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm","target","_blank",3,"href",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-label-group"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"href"],[1,"content"],[1,"table","mt-5"],[1,"table-secondary"],["class","text-right",4,"ngIf"],["style","width: 45px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right",2,"width","45px"],["target","_blank",3,"href"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div"),o.TgZ(3,"h3"),o._uU(4,"Parked Order History"),o.qZA(),o.qZA(),o.TgZ(5,"div",2),o.YNc(6,Un,2,0,"a",3),o.YNc(7,Pn,2,1,"a",4),o.qZA(),o.qZA(),o.TgZ(8,"div",5),o.TgZ(9,"div",6),o.TgZ(10,"div",7),o.TgZ(11,"div",8),o.YNc(12,Qn,15,4,"div",9),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(6),o.Q6J("ngIf",!e.parkHistoryRequested),o.xp6(1),o.Q6J("ngIf",(null==e.parkedHistory?null:e.parkedHistory.Data.length)>0&&e.parkHistoryRequested),o.xp6(5),o.Q6J("ngIf",(null==e.parkedHistory?null:e.parkedHistory.Data.length)>0))},directives:[i.O5,i.sg],pipes:[i.uU,i.JJ],styles:[""]}),t})();const Ln=function(){return["/menu/Products/Catalog/Variants/Inventory_Cost_History"]},Vn=function(t){return{VariantID:t}};function Yn(t,e){if(1&t&&(o.TgZ(0,"a",51),o._UZ(1,"i",52),o._uU(2,"\xa0\xa0Inventory Cost"),o.qZA()),2&t){const t=o.oxw(2);o.Q6J("routerLink",o.DdM(2,Ln))("queryParams",o.VKq(3,Vn,null==t.variant?null:t.variant.getID))}}function Hn(t,e){if(1&t&&(o.TgZ(0,"div",50),o.YNc(1,Yn,3,5,"a",5),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",null==t.role?null:t.role.HasProductEditor)}}const Rn=function(){return["/menu/Products/Add-Ons/Variant_History"]};function $n(t,e){if(1&t&&(o.TgZ(0,"a",53),o._UZ(1,"i",54),o._uU(2,"\xa0\xa0Update History "),o.qZA()),2&t){const t=o.oxw();o.Q6J("routerLink",o.DdM(2,Rn))("queryParams",o.VKq(3,Vn,null==t.variant?null:t.variant.getID))}}function Fn(t,e){if(1&t&&(o.TgZ(0,"a",55),o._UZ(1,"i",56),o._uU(2,"\xa0\xa0Print Barcode"),o.qZA()),2&t){const t=o.oxw();o.Q6J("href","https://barcode.dealpos.app/pages?ID="+(null==t.variant?null:t.variant.getID),o.LSH)}}const En=function(){return["/menu/Products/Catalog/Variants/Form"]},jn=function(t){return{ID:t}};function Bn(t,e){if(1&t&&(o.TgZ(0,"a",51),o._UZ(1,"i",57),o._uU(2,"\xa0\xa0Edit"),o.qZA()),2&t){const t=o.oxw();o.Q6J("routerLink",o.DdM(2,En))("queryParams",o.VKq(3,jn,null==t.variant?null:t.variant.getID))}}function Gn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"a",58),o.NdJ("click",function(){return o.CHM(t),o.oxw().deleteVariantInfo()}),o._UZ(1,"i",59),o._uU(2,"\xa0\xa0Delete"),o.qZA()}}function Xn(t,e){if(1&t&&(o.TgZ(0,"div",60),o._UZ(1,"img",61),o.qZA()),2&t){const t=o.oxw();o.s9C("href",null==t.variant?null:t.variant.getImage),o.xp6(1),o.s9C("src",null==t.variant?null:t.variant.getImage,o.LSH),o.s9C("alt",null==t.variant?null:t.variant.getImage)}}function zn(t,e){1&t&&(o.TgZ(0,"div",62),o._UZ(1,"i",63),o.qZA())}function Kn(t,e){if(1&t&&(o.TgZ(0,"p",17),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.hij(" ",null==t.UOM?null:t.UOM.getName,"")}}function Wn(t,e){1&t&&(o.TgZ(0,"p",64),o._uU(1,"Point(s)"),o.qZA())}function ti(t,e){1&t&&(o.TgZ(0,"p",64),o._uU(1,"Expiration"),o.qZA())}function ei(t,e){if(1&t&&(o.TgZ(0,"p",65),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.AsE("",null==t.variantPoint?null:t.variantPoint.ExpiredDay," Days + ",null==t.variantPoint?null:t.variantPoint.ExpiredMonth," Month(s)")}}function ni(t,e){if(1&t&&(o.TgZ(0,"div",28),o.TgZ(1,"div",29),o._UZ(2,"input",66),o.ALo(3,"number"),o.TgZ(4,"label",67),o._uU(5,"Buying Cost"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.Q6J("ngClass",t.variant.getOrderPriceDiscount>0?"col-sm-3":""),o.xp6(2),o.Q6J("ngModel",o.lcZ(3,2,null==t.variant?null:t.variant.getUnitCost))}}function ii(t,e){if(1&t&&(o.TgZ(0,"div",68),o.TgZ(1,"div",29),o._UZ(2,"input",69),o.TgZ(3,"label",70),o._uU(4,"Disc"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",(null==t.variant?null:t.variant.getOrderPriceDiscount)+"%")}}function oi(t,e){if(1&t&&(o.TgZ(0,"div",68),o.TgZ(1,"div",29),o._UZ(2,"input",71),o.TgZ(3,"label",72),o._uU(4,"Disc"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",(null==t.variant?null:t.variant.getPriceDiscount)+"%")}}function ri(t,e){if(1&t&&(o.TgZ(0,"div",33),o.TgZ(1,"div",29),o._UZ(2,"input",73),o.ALo(3,"number"),o.TgZ(4,"label",74),o._uU(5,"Last Buy Cost"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngModel",o.lcZ(3,1,null==t.variant?null:t.variant.getOrderPrice))}}function ai(t,e){if(1&t&&(o.TgZ(0,"div",38),o._UZ(1,"POS-sales-history",75),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("variant",t.variant)}}function li(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"div",76),o._UZ(2,"POS-purchase-history",77),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("variant",t.variant)("role",t.role)}}function si(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"div",76),o._UZ(2,"POS-parked-history",77),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("variant",t.variant)("role",t.role)}}const ci=[{path:"",component:a,children:[{path:"",component:Ht},{path:"Form",component:ft},{path:"Info",component:(()=>{class t extends l.K{constructor(t,e,n,i){super(e),this.variantService=t,this.httpService=e,this.route=n,this.router=i,this.apiBaseUrl="/A/Products/Catalog/Variants/Info",this.destroy$=new s.xQ}ngOnInit(){this.subscribeQueryParams()}subscribeQueryParams(){this.route.queryParams.pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.getVariantInfoById(t.ID)})}getVariantInfoById(t){this.variantService.getVariantInfoById(t).pipe((0,c.R)(this.destroy$)).subscribe(t=>{this.variantInfoModel=t,this.variant=t.Variant,this.product=t.product,this.UOM=t.UOM,this.variantPoint=t.VariantPoint,this.role=t.Roles,this.variantParent=t.VariantParent,this.setTitle()})}setTitle(){this.pageData.Header=this.variant.getName}deleteVariantInfo(){confirm("Are you sure you want to delete this record?")&&this.variantService.deleteVariantInfo(this.variant.getID).pipe((0,c.R)(this.destroy$)).subscribe(()=>{this.router.navigate(["/menu/Products/Catalog/Variants"]),console.log("DELETE SUCCESS")})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p.o),o.Y36(d.O),o.Y36(r.gz),o.Y36(r.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-Info"]],features:[o.qOj],decls:95,vars:41,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn-group",4,"ngIf"],["class","btn btn-outline-secondary ml-5","role","button","title","Variant Update History",3,"routerLink","queryParams",4,"ngIf"],[1,"btn-group","ml-5"],["target","_blank","class","btn btn-outline-secondary","role","button",3,"href",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"row","m-5"],[1,"col-sm-8"],[1,"row"],[1,"col-sm-3"],[1,"card","text-center"],[1,"card-body"],["class","my-lg-7","data-fancybox","gallery",3,"href",4,"ngIf"],["class","my-lg-7",4,"ngIf"],[1,"h4","text-primary","font-weight-bold","d-block"],["target","_blank",3,"href"],[1,"mb-1"],[1,"mb-1",3,"placeholder"],["class","mb-1",4,"ngIf"],["class","mb-0",4,"ngIf"],[1,"mb-0",2,"color","#9da2a6","font-size","14px"],["style","color:#9da2a6; font-size:14px;",4,"ngIf"],[1,"col-sm-9"],[1,"card"],[1,"card-header"],["class","col",3,"ngClass",4,"ngIf"],["class","col-2 pl-0",4,"ngIf"],[1,"col",3,"ngClass"],[1,"form-label-group"],["type","text","id","sellPrice","placeholder","Selling Price","name","Selling Price","readonly","",1,"form-control",3,"ngModel"],["for","sellPrice"],["class","col-sm-4",4,"ngIf"],[1,"col-sm-4"],["type","text","id","weight","placeholder","Weight (gr)","name","Weight (gr)","readonly","",1,"form-control",3,"ngModel"],["for","weight"],["type","text","id","type","placeholder","Payment Type","name","Payment Type","readonly","",1,"form-control",3,"ngModel"],["for","type"],[1,"col-sm-12"],[3,"variantInfoModel"],["type","text","id","typeString","placeholder","Type","name","Type","readonly","",1,"form-control",3,"ngModel"],["for","typeString"],["type","text","id","taxable","placeholder","Taxable","name","Taxable","readonly","",1,"form-control",3,"ngModel"],["for","taxable"],["type","text","id","point","placeholder","Loyalty Point Enabled","name","Loyalty Point Enabled","readonly","",1,"form-control",3,"ngModel"],["for","point"],["type","text","id","discountinued","placeholder","Discontinued","name","Discontinued","readonly","",1,"form-control",3,"ngModel"],["for","discountinued"],["class","col-sm-12",4,"ngIf"],["class","row",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fas","fa-history"],["role","button","title","Variant Update History",1,"btn","btn-outline-secondary","ml-5",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-history"],["target","_blank","role","button",1,"btn","btn-outline-secondary",3,"href"],["aria-hidden","true",1,"fas","fa-barcode"],["aria-hidden","true",1,"fas","fa-edit"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],["data-fancybox","gallery",1,"my-lg-7",3,"href"],[3,"src","alt"],[1,"my-lg-7"],[1,"fa","fa-cube","fa-i-block",2,"font-size","60px"],[1,"mb-0"],[2,"color","#9da2a6","font-size","14px"],["type","text","id","inputVariant","placeholder","Buying Cost","name","Buying Cost","readonly","",1,"form-control",3,"ngModel"],["for","inputVariant"],[1,"col-2","pl-0"],["type","text","id","disc","placeholder","Disc","name","Disc","readonly","",1,"form-control",3,"ngModel"],["for","disc"],["type","text","id","priceDisc","placeholder","Disc","name","Disc","readonly","",1,"form-control","text-danger",3,"ngModel"],["for","priceDisc"],["type","text","id","orderPrice","placeholder","Last Buy Cost","name","Last Buy Cost","readonly","",1,"form-control",3,"ngModel"],["for","orderPrice"],[3,"variant"],[1,"col-12"],[3,"variant","role"]],template:function(t,e){1&t&&(o.TgZ(0,"mainpanel-cmp",0),o.TgZ(1,"actions"),o.YNc(2,Hn,2,1,"div",1),o.YNc(3,$n,3,5,"a",2),o.TgZ(4,"div",3),o.YNc(5,Fn,3,1,"a",4),o.qZA(),o.TgZ(6,"div",3),o.YNc(7,Bn,3,5,"a",5),o.YNc(8,Gn,3,0,"a",6),o.qZA(),o.qZA(),o.TgZ(9,"content"),o.TgZ(10,"div",7),o.TgZ(11,"div",8),o.TgZ(12,"div",9),o.TgZ(13,"div",10),o.TgZ(14,"div",11),o.TgZ(15,"div",12),o.YNc(16,Xn,2,3,"div",13),o.YNc(17,zn,2,0,"div",14),o.TgZ(18,"p",15),o.TgZ(19,"a",16),o._uU(20),o.qZA(),o.qZA(),o.TgZ(21,"p",17),o._uU(22),o.qZA(),o.TgZ(23,"p",18),o._uU(24),o.qZA(),o.YNc(25,Kn,2,1,"p",19),o.YNc(26,Wn,2,0,"p",20),o.TgZ(27,"p",21),o._uU(28),o.qZA(),o.YNc(29,ti,2,0,"p",20),o.YNc(30,ei,2,2,"p",22),o.qZA(),o.qZA(),o.qZA(),o.TgZ(31,"div",23),o.TgZ(32,"div",24),o.TgZ(33,"div",25),o.TgZ(34,"h3"),o._uU(35,"Pricing"),o.qZA(),o.qZA(),o.TgZ(36,"div",12),o.TgZ(37,"div",9),o.YNc(38,ni,6,4,"div",26),o.YNc(39,ii,5,1,"div",27),o.TgZ(40,"div",28),o.TgZ(41,"div",29),o._UZ(42,"input",30),o.ALo(43,"number"),o.TgZ(44,"label",31),o._uU(45,"Selling Price"),o.qZA(),o.qZA(),o.qZA(),o.YNc(46,oi,5,1,"div",27),o.qZA(),o.TgZ(47,"div",9),o.YNc(48,ri,6,3,"div",32),o.TgZ(49,"div",33),o.TgZ(50,"div",29),o._UZ(51,"input",34),o.ALo(52,"number"),o.TgZ(53,"label",35),o._uU(54,"Weight (gr)"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(55,"div",33),o.TgZ(56,"div",29),o._UZ(57,"input",36),o.TgZ(58,"label",37),o._uU(59,"Payment Type"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(60,"div",9),o.TgZ(61,"div",38),o._UZ(62,"POS-info-nav-tab",39),o.qZA(),o.qZA(),o.qZA(),o.TgZ(63,"div",33),o.TgZ(64,"div",9),o.TgZ(65,"div",38),o.TgZ(66,"div",24),o.TgZ(67,"div",25),o.TgZ(68,"h3"),o._uU(69,"Properties"),o.qZA(),o.qZA(),o.TgZ(70,"div",12),o.TgZ(71,"div",9),o.TgZ(72,"div",38),o.TgZ(73,"div",29),o._UZ(74,"input",40),o.TgZ(75,"label",41),o._uU(76,"Type"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(77,"div",38),o.TgZ(78,"div",29),o._UZ(79,"input",42),o.TgZ(80,"label",43),o._uU(81,"Taxable"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(82,"div",38),o.TgZ(83,"div",29),o._UZ(84,"input",44),o.TgZ(85,"label",45),o._uU(86,"Loyalty Point Enabled"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(87,"div",38),o.TgZ(88,"div",29),o._UZ(89,"input",46),o.TgZ(90,"label",47),o._uU(91,"Discontinued"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(92,ai,2,1,"div",48),o.qZA(),o.YNc(93,li,3,2,"div",49),o.YNc(94,si,3,2,"div",49),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",e.pageData),o.xp6(2),o.Q6J("ngIf",null==e.role?null:e.role.IsFIFO),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.HasProductEditor),o.xp6(2),o.Q6J("ngIf",null==e.role?null:e.role.isBarcodePrinting),o.xp6(2),o.Q6J("ngIf",null==e.role?null:e.role.HasProductEditor),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.HasProductDelete),o.xp6(8),o.Q6J("ngIf",null==e.variant?null:e.variant.getImage),o.xp6(1),o.Q6J("ngIf",!(null!=e.variant&&e.variant.getImage)),o.xp6(2),o.MGl("href","/A/Products/Catalog/Products/Info?ID= ",null==e.variant?null:e.variant.getProductID,"",o.LSH),o.xp6(1),o.Oqu(null==e.product?null:e.product.getName),o.xp6(2),o.hij(" ",null==e.variant?null:e.variant.getModel," "),o.xp6(1),o.s9C("placeholder",e.AutoGenerateCode?"Leave Blank for Auto Generate":""),o.xp6(1),o.hij(" ",null==e.variant?null:e.variant.getCode," "),o.xp6(1),o.Q6J("ngIf",null==e.UOM?null:e.UOM.getName),o.xp6(1),o.Q6J("ngIf",null==e.UOM?null:e.UOM.getName),o.xp6(2),o.Oqu(null==e.variantPoint?null:e.variantPoint.Point),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.IsUsingPoint),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.IsUsingPoint),o.xp6(8),o.Q6J("ngIf",null==e.role?null:e.role.RoleCost),o.xp6(1),o.Q6J("ngIf",(null==e.role?null:e.role.RoleCost)&&(null==e.variant?null:e.variant.getOrderPriceDiscount)),o.xp6(1),o.Q6J("ngClass",(null==e.variant?null:e.variant.getOrderPriceDiscount)>0?"col-sm-3":"")("ngClass",null!=e.role&&e.role.RoleCost?"pl-0":""),o.xp6(2),o.Q6J("ngModel",o.lcZ(43,37,null==e.variant?null:e.variant.getUnitPrice)),o.xp6(4),o.Q6J("ngIf",null==e.variant?null:e.variant.getPriceDiscount),o.xp6(2),o.Q6J("ngIf",null==e.role?null:e.role.OutLetPriceVisible),o.xp6(3),o.Q6J("ngModel",o.lcZ(52,39,null==e.variant?null:e.variant.getWeight)),o.xp6(6),o.Q6J("ngModel",null==e.variant?null:e.variant.getPaymentTypeString),o.xp6(5),o.Q6J("variantInfoModel",e.variantInfoModel),o.xp6(12),o.Q6J("ngModel",null==e.variant?null:e.variant.getPaymentTypeString),o.xp6(5),o.Q6J("ngModel",null!=e.variant&&e.variant.getTaxable?"Yes":"No"),o.xp6(5),o.Q6J("ngModel",null!=e.variant&&e.variant.getLoyaltyPoint?"Yes":"No"),o.xp6(5),o.Q6J("ngModel",null!=e.variant&&e.variant.getDiscontinued?"Yes":"No"),o.xp6(3),o.Q6J("ngIf",null==e.role?null:e.role.IsSalesRoleHistory),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.IsPurchaseRoleHistory),o.xp6(1),o.Q6J("ngIf",null==e.role?null:e.role.IsSalesRoleHistory))},directives:[h.p,i.O5,i.mk,f.Fj,f.JJ,f.On,nn,r.yS,vn,Cn,kn],pipes:[i.JJ],styles:["input[readonly][_ngcontent-%COMP%] {\n background-color: white;\n}"]}),t})()},{path:"**",redirectTo:"",pathMatch:"full"}]}];let ui=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,r.Bz.forChild(ci),h.R,q.dr,f.u5,f.UX,Tt.TU,A.A0,T.Fk,Rt.X,Q.d,jt,v.Q]]}),t})()}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkinv_web_app=self.webpackChunkinv_web_app||[]).push([[126],{13586:(t,e,i)=>{"use strict";i.d(e,{h:()=>s});var s=(()=>(function(t){t[t.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",t[t.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",t[t.CLASS_TO_CLASS=2]="CLASS_TO_CLASS"}(s||(s={})),s))()},50006:(t,e,i)=>{"use strict";i.d(e,{d8:()=>c});var s=i(83475),r=i(13586);class n{constructor(t,e){this.transformationType=t,this.options=e,this.recursionStack=new Set}transform(t,e,i,n,o,a=0){if(Array.isArray(e)||e instanceof Set){const s=n&&this.transformationType===r.h.PLAIN_TO_CLASS?function(t){const e=new t;return e instanceof Set||"push"in e?e:[]}(n):[];return e.forEach((e,n)=>{const o=t?t[n]:void 0;if(this.options.enableCircularCheck&&this.isCircular(e))this.transformationType===r.h.CLASS_TO_CLASS&&(s instanceof Set?s.add(e):s.push(e));else{let t;if("function"!=typeof i&&i&&i.options&&i.options.discriminator&&i.options.discriminator.property&&i.options.discriminator.subTypes){if(this.transformationType===r.h.PLAIN_TO_CLASS){t=i.options.discriminator.subTypes.find(t=>t.name===e[i.options.discriminator.property]);const r=i.typeFunction({newObject:s,object:e,property:void 0});t=void 0===t?r:t.value,i.options.keepDiscriminatorProperty||delete e[i.options.discriminator.property]}this.transformationType===r.h.CLASS_TO_CLASS&&(t=e.constructor),this.transformationType===r.h.CLASS_TO_PLAIN&&(e[i.options.discriminator.property]=i.options.discriminator.subTypes.find(t=>t.value===e.constructor).name)}else t=i;const n=this.transform(o,e,t,void 0,e instanceof Map,a+1);s instanceof Set?s.add(n):s.push(n)}}),s}if(i!==String||o){if(i!==Number||o){if(i!==Boolean||o){if((i===Date||e instanceof Date)&&!o)return e instanceof Date?new Date(e.valueOf()):null==e?e:new Date(e);if(("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0).Buffer&&(i===Buffer||e instanceof Buffer)&&!o)return null==e?e:Buffer.from(e);if(null===(c=e)||"object"!=typeof c||"function"!=typeof c.then||o){if(o||null===e||"object"!=typeof e||"function"!=typeof e.then){if("object"==typeof e&&null!==e){i||e.constructor===Object||(i=e.constructor),!i&&t&&(i=t.constructor),this.options.enableCircularCheck&&this.recursionStack.add(e);const n=this.getKeys(i,e,o);let c=t||{};t||this.transformationType!==r.h.PLAIN_TO_CLASS&&this.transformationType!==r.h.CLASS_TO_CLASS||(c=o?new Map:i?new i:{});for(const h of n){if("__proto__"===h||"constructor"===h)continue;const n=h;let u,l=h,d=h;if(!this.options.ignoreDecorators&&i)if(this.transformationType===r.h.PLAIN_TO_CLASS){const t=s.m.findExposeMetadataByCustomName(i,h);t&&(d=t.propertyName,l=t.propertyName)}else if(this.transformationType===r.h.CLASS_TO_PLAIN||this.transformationType===r.h.CLASS_TO_CLASS){const t=s.m.findExposeMetadata(i,h);t&&t.options&&t.options.name&&(l=t.options.name)}u=e instanceof Map?e.get(n):e[n]instanceof Function?e[n]():e[n];let p,f=u instanceof Map;if(i&&o)p=i;else if(i){const t=s.m.findTypeMetadata(i,d);if(t){const i={newObject:c,object:e,property:d},s=t.typeFunction?t.typeFunction(i):t.reflectedType;t.options&&t.options.discriminator&&t.options.discriminator.property&&t.options.discriminator.subTypes?e[n]instanceof Array?p=t:(this.transformationType===r.h.PLAIN_TO_CLASS&&(p=t.options.discriminator.subTypes.find(e=>{if(u&&u instanceof Object&&t.options.discriminator.property in u)return e.name===u[t.options.discriminator.property]}),p=void 0===p?s:p.value,t.options.keepDiscriminatorProperty||u&&u instanceof Object&&t.options.discriminator.property in u&&delete u[t.options.discriminator.property]),this.transformationType===r.h.CLASS_TO_CLASS&&(p=u.constructor),this.transformationType===r.h.CLASS_TO_PLAIN&&(u[t.options.discriminator.property]=t.options.discriminator.subTypes.find(t=>t.value===u.constructor).name)):p=s,f=f||t.reflectedType===Map}else if(this.options.targetMaps)this.options.targetMaps.filter(t=>t.target===i&&!!t.properties[d]).forEach(t=>p=t.properties[d]);else if(this.options.enableImplicitConversion&&this.transformationType===r.h.PLAIN_TO_CLASS){const t=Reflect.getMetadata("design:type",i.prototype,d);t&&(p=t)}}const y=Array.isArray(e[n])?this.getReflectedType(i,d):void 0,m=t?t[n]:void 0;if(c.constructor.prototype){const t=Object.getOwnPropertyDescriptor(c.constructor.prototype,l);if((this.transformationType===r.h.PLAIN_TO_CLASS||this.transformationType===r.h.CLASS_TO_CLASS)&&(t&&!t.set||c[l]instanceof Function))continue}if(this.options.enableCircularCheck&&this.isCircular(u)){if(this.transformationType===r.h.CLASS_TO_CLASS){let t=u;t=this.applyCustomTransformations(t,i,h,e,this.transformationType),(void 0!==t||this.options.exposeUnsetFields)&&(c instanceof Map?c.set(l,t):c[l]=t)}}else{const t=this.transformationType===r.h.PLAIN_TO_CLASS?l:h;let s;this.transformationType===r.h.CLASS_TO_PLAIN?(s=e[t],s=this.applyCustomTransformations(s,i,t,e,this.transformationType),s=e[t]===s?u:s,s=this.transform(m,s,p,y,f,a+1)):void 0===u&&this.options.exposeDefaultValues?s=c[l]:(s=this.transform(m,u,p,y,f,a+1),s=this.applyCustomTransformations(s,i,t,e,this.transformationType)),(void 0!==s||this.options.exposeUnsetFields)&&(c instanceof Map?c.set(l,s):c[l]=s)}}return this.options.enableCircularCheck&&this.recursionStack.delete(e),c}return e}return e}return new Promise((t,s)=>{e.then(e=>t(this.transform(void 0,e,i,void 0,void 0,a+1)),s)})}return null==e?e:Boolean(e)}return null==e?e:Number(e)}return null==e?e:String(e);var c}applyCustomTransformations(t,e,i,r,n){let o=s.m.findTransformMetadatas(e,i,this.transformationType);return void 0!==this.options.version&&(o=o.filter(t=>!t.options||this.checkVersion(t.options.since,t.options.until))),o=o.filter(this.options.groups&&this.options.groups.length?t=>!t.options||this.checkGroups(t.options.groups):t=>!t.options||!t.options.groups||!t.options.groups.length),o.forEach(e=>{t=e.transformFn({value:t,key:i,obj:r,type:n,options:this.options})}),t}isCircular(t){return this.recursionStack.has(t)}getReflectedType(t,e){if(!t)return;const i=s.m.findTypeMetadata(t,e);return i?i.reflectedType:void 0}getKeys(t,e,i){let n=s.m.getStrategy(t);"none"===n&&(n=this.options.strategy||"exposeAll");let o=[];if(("exposeAll"===n||i)&&(o=e instanceof Map?Array.from(e.keys()):Object.keys(e)),i)return o;if(!this.options.ignoreDecorators&&t){let e=s.m.getExposedProperties(t,this.transformationType);this.transformationType===r.h.PLAIN_TO_CLASS&&(e=e.map(e=>{const i=s.m.findExposeMetadata(t,e);return i&&i.options&&i.options.name?i.options.name:e})),o=this.options.excludeExtraneousValues?e:o.concat(e);const i=s.m.getExcludedProperties(t,this.transformationType);i.length>0&&(o=o.filter(t=>!i.includes(t))),void 0!==this.options.version&&(o=o.filter(e=>{const i=s.m.findExposeMetadata(t,e);return!i||!i.options||this.checkVersion(i.options.since,i.options.until)})),o=o.filter(this.options.groups&&this.options.groups.length?e=>{const i=s.m.findExposeMetadata(t,e);return!i||!i.options||this.checkGroups(i.options.groups)}:e=>{const i=s.m.findExposeMetadata(t,e);return!(i&&i.options&&i.options.groups&&i.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(o=o.filter(t=>this.options.excludePrefixes.every(e=>t.substr(0,e.length)!==e))),o=o.filter((t,e,i)=>i.indexOf(t)===e),o}checkVersion(t,e){let i=!0;return i&&t&&(i=this.options.version>=t),i&&e&&(i=this.options.version<e),i}checkGroups(t){return!t||this.options.groups.some(e=>t.includes(e))}}const o={enableCircularCheck:!1,enableImplicitConversion:!1,excludeExtraneousValues:!1,excludePrefixes:void 0,exposeDefaultValues:!1,exposeUnsetFields:!0,groups:void 0,ignoreDecorators:!1,strategy:void 0,targetMaps:void 0,version:void 0},a=new class{classToPlain(t,e){return new n(r.h.CLASS_TO_PLAIN,{...o,...e}).transform(void 0,t,void 0,void 0,void 0,void 0)}classToPlainFromExist(t,e,i){return new n(r.h.CLASS_TO_PLAIN,{...o,...i}).transform(e,t,void 0,void 0,void 0,void 0)}plainToClass(t,e,i){return new n(r.h.PLAIN_TO_CLASS,{...o,...i}).transform(void 0,e,t,void 0,void 0,void 0)}plainToClassFromExist(t,e,i){return new n(r.h.PLAIN_TO_CLASS,{...o,...i}).transform(t,e,void 0,void 0,void 0,void 0)}classToClass(t,e){return new n(r.h.CLASS_TO_CLASS,{...o,...e}).transform(void 0,t,void 0,void 0,void 0,void 0)}classToClassFromExist(t,e,i){return new n(r.h.CLASS_TO_CLASS,{...o,...i}).transform(e,t,void 0,void 0,void 0,void 0)}serialize(t,e){return JSON.stringify(this.classToPlain(t,e))}deserialize(t,e,i){const s=JSON.parse(e);return this.plainToClass(t,s,i)}deserializeArray(t,e,i){const s=JSON.parse(e);return this.plainToClass(t,s,i)}};function c(t,e,i){return a.plainToClass(t,e,i)}},83475:(t,e,i)=>{"use strict";i.d(e,{m:()=>r});var s=i(13586);const r=new class{constructor(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}addTypeMetadata(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)}addTransformMetadata(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)}addExposeMetadata(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)}addExcludeMetadata(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)}findTransformMetadatas(t,e,i){return this.findMetadatas(this._transformMetadatas,t,e).filter(t=>!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?i===s.h.CLASS_TO_CLASS||i===s.h.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||i===s.h.CLASS_TO_PLAIN))}findExcludeMetadata(t,e){return this.findMetadata(this._excludeMetadatas,t,e)}findExposeMetadata(t,e){return this.findMetadata(this._exposeMetadatas,t,e)}findExposeMetadataByCustomName(t,e){return this.getExposedMetadatas(t).find(t=>t.options&&t.options.name===e)}findTypeMetadata(t,e){return this.findMetadata(this._typeMetadatas,t,e)}getStrategy(t){const e=this._excludeMetadatas.get(t),i=e&&e.get(void 0),s=this._exposeMetadatas.get(t),r=s&&s.get(void 0);return i&&r||!i&&!r?"none":i?"excludeAll":"exposeAll"}getExposedMetadatas(t){return this.getMetadata(this._exposeMetadatas,t)}getExcludedMetadatas(t){return this.getMetadata(this._excludeMetadatas,t)}getExposedProperties(t,e){return this.getExposedMetadatas(t).filter(t=>!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===s.h.CLASS_TO_CLASS||e===s.h.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===s.h.CLASS_TO_PLAIN)).map(t=>t.propertyName)}getExcludedProperties(t,e){return this.getExcludedMetadatas(t).filter(t=>!t.options||!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===s.h.CLASS_TO_CLASS||e===s.h.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===s.h.CLASS_TO_PLAIN)).map(t=>t.propertyName)}clear(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()}getMetadata(t,e){const i=t.get(e);let s;i&&(s=Array.from(i.values()).filter(t=>void 0!==t.propertyName));const r=[];for(const n of this.getAncestors(e)){const e=t.get(n);if(e){const t=Array.from(e.values()).filter(t=>void 0!==t.propertyName);r.push(...t)}}return r.concat(s||[])}findMetadata(t,e,i){const s=t.get(e);if(s){const t=s.get(i);if(t)return t}for(const r of this.getAncestors(e)){const e=t.get(r);if(e){const t=e.get(i);if(t)return t}}}findMetadatas(t,e,i){const s=t.get(e);let r;s&&(r=s.get(i));const n=[];for(const o of this.getAncestors(e)){const e=t.get(o);e&&e.has(i)&&n.push(...e.get(i))}return n.slice().reverse().concat((r||[]).slice().reverse())}getAncestors(t){if(!t)return[];if(!this._ancestorsMap.has(t)){const e=[];for(let i=Object.getPrototypeOf(t.prototype.constructor);void 0!==i.prototype;i=Object.getPrototypeOf(i.prototype.constructor))e.push(i);this._ancestorsMap.set(t,e)}return this._ancestorsMap.get(t)}}},36820:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s});class s{constructor(t=!1,e=!1,i=!1){this.configUsingLocal=t,this.productUsingLocal=e,this.orderUsingLocal=i}get usingLocal(){return this.configUsingLocal||this.productUsingLocal||this.orderUsingLocal}}},36470:(t,e,i)=>{"use strict";i.d(e,{$:()=>s});var s=(()=>(function(t){t[t.DealPOS=1]="DealPOS",t[t.Tada=2]="Tada"}(s||(s={})),s))()},89753:(t,e,i)=>{"use strict";i.d(e,{q:()=>s});var s=(()=>(function(t){t[t.Park=1]="Park",t[t.Payment=3]="Payment",t[t.Bill=2]="Bill"}(s||(s={})),s))()},21311:(t,e,i)=>{"use strict";i.d(e,{_:()=>s});var s=(()=>(function(t){t[t.CashAndPoint=0]="CashAndPoint",t[t.Cash=1]="Cash",t[t.Point=2]="Point"}(s||(s={})),s))()},20143:(t,e,i)=>{"use strict";i.d(e,{J:()=>s});var s=(()=>(function(t){t[t.Any=0]="Any",t[t.Standard=1]="Standard",t[t.NonInventory=2]="NonInventory",t[t.Composite=3]="Composite",t[t.Serialized=4]="Serialized",t[t.Manufactured=5]="Manufactured",t[t.Complementary=6]="Complementary",t[t.MultipleUOM=7]="MultipleUOM",t[t.PrepaidPoint=8]="PrepaidPoint",t[t.TreatmentPackage=10]="TreatmentPackage"}(s||(s={})),s))()},92978:(t,e,i)=>{"use strict";i.d(e,{a:()=>r});var s=i(89753);class r{constructor(){this.DeliveryEntityID="",this.Type=s.q.Payment,this.Retry=!1,this.Retur=!1}}},74715:(t,e,i)=>{"use strict";i.d(e,{m:()=>r});var s=i(21061);class r{constructor(){this.ID=s.gT.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0}}},72244:(t,e,i)=>{"use strict";i.d(e,{Q:()=>s});class s{constructor(){this.Recipient="",this.Phone="",this.Street="",this.City=""}}},46937:(t,e,i)=>{"use strict";i.d(e,{N:()=>n});var s=i(20143),r=i(21061);class n{constructor(){this.SamePark=!1,this.Serial=[],this.EntityID=r.gT.GuidEmpty,this.ID=r.gT.GuidEmpty,this.Note="",this.SplitQuantity=0,this.SalesOrderItemCommission=[],this.Quantity=1}get Total(){return this.GrossTotal-this.DiscountPercentAmount-this.DiscountAmount}get GrossTotal(){return this.Price*(this.Quantity*this.UnitQuantity)||0}get DiscountPercentAmount(){return this.Discount?this.GrossTotal*this.Discount/100:0}patchByVariant(t,e,i){this.PriceTypeID=t.PriceTypeID,this.PriceNote=t.PriceNote,this.Variant=t,this.VariantID=t.ID,e&&(this.Note=t.Description),i&&null!=t.PriceNote&&(this.Note=r.gT.IsNotEmpty(this.Note)?this.Note+t.PriceNote:t.PriceNote),this.UnitQuantity=1,t.UnitQuantity>1&&(this.UnitQuantityPrice=this.Variant.UnitPrice/this.Variant.UnitQuantity),this.Price=t.UnitPrice,this.Cost=t.UnitCost,this.Expense=t.UnitCost,this.Discount=t.PriceDiscount,this.UnitPriceOriginal=t.UnitPriceOriginal,this.DiscountAmount=0,this.Taxable=t.Taxable,this.InventoryTypeID=t.TypeID,this.LoyaltyPoint=t.LoyaltyPoint,this.SalesOrderItemCommission=[],this.SalesOrderItemCommission.push({SalesID:null}),t.TypeID==s.J.NonInventory&&t.Config&&(this.Cost=this.Total/this.Quantity),this.generateSerial(t)}generateSerial(t){t.TypeID==s.J.Serialized&&this.Note&&(this.Serial=this.Note.replace("[","").replace("]","").split(","))}pricebookUpdate(t,e,i){if(this.PriceBookID&&e){let t=this.getSelectedPricebook(this.PriceBookID);r.gT.IsNotEmpty(this.Note)&&this.Note.replace(t.Name,"")}this.PriceBookID=t;let s=this.getSelectedPricebook(t);s?(this.Price=s.UnitPrice,this.Discount=s.PriceDiscount,this.Cost=s.UnitCost,this.PriceTypeID=2,i&&(this.Note=s.Name)):(this.Price=this.Variant.UnitPrice,this.Discount=this.Variant.PriceDiscount,this.Cost=this.Variant.UnitCost,this.PriceTypeID=0,this.Note=this.Variant.Description)}getPricebookByQuantity(){let t=0,e=null;return this.Variant.PriceBook&&this.Variant.PriceBook.length>0&&this.Variant.PriceBook.filter(t=>t.MinimumQuantity<=this.Quantity).forEach(i=>{t<=i.MinimumQuantity&&i.MinimumQuantity>0&&(e=i.ID,t=i.MinimumQuantity)}),e}updatePriceStatus(t){if(this.Price!=this.Variant.UnitPrice){let e=this.getSelectedPricebook(t);e&&e.UnitPrice==this.Price?(this.PriceTypeID=2,this.PriceNote=e.Name):this.PriceTypeID=1}}getSelectedPricebook(t){if(this.Variant.PriceBook){let e=this.Variant.PriceBook.filter(e=>e.ID==t);if(e.length)return e[0]}return null}updateSerial(t=!1){this.Serial.length&&(this.Note=`[${this.Serial.toString()}]`),this.Quantity=t?-1*this.Serial.length:this.Serial.length}validateitem(){return!0}isSerialType(){let t=!1;return this.InventoryTypeID===s.J.Serialized&&(t=!0),t}}},35592:(t,e,i)=>{"use strict";i.d(e,{t:()=>r});var s=i(46937);class r extends s.N{constructor(){super(),this.PromotionGift=!1}}},40573:(t,e,i)=>{"use strict";i.d(e,{j:()=>s});class s{constructor(t,e,i,s){this.Amount=0,this.MethodID=t||0,this.Amount=e||0,this.PaidAmount=i||0,this.Date=s instanceof Date?s.toDateString():s}}},32726:(t,e,i)=>{"use strict";i.d(e,{D:()=>o});var s=i(21061),r=(()=>(function(t){t[t.Unsent=1]="Unsent",t[t.Partial=2]="Partial",t[t.Sent=3]="Sent"}(r||(r={})),r))(),n=i(36470);class o{constructor(){this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.PurchaseOrderNumber="",this.ParkLabel="",this.AuthorizationKey="",this.CouponType=n.$.DealPOS,this.AuthorizationNote="",this.Att="",this.ID=s.gT.GuidEmpty,this.EntityID=s.gT.GuidEmpty,this.RegisterID=s.gT.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=s.gT.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=r.Unsent,this.PointUsed=0,this.Deposit=0,this.DepositPaymentMethodID=0,this.NumberOfPerson=0,this.Date=(new Date).toJSON(),this.Att=""}}},26698:(t,e,i)=>{"use strict";i.d(e,{m:()=>y});var s=i(64762),r=i(74715),n=i(32726),o=i(40573),a=i(72244),c=i(92978),h=i(35592),u=i(46937),l=i(21311),d=i(20143),p=i(83475);function f(t,e={}){return function(i,s){const r=Reflect.getMetadata("design:type",i,s);p.m.addTypeMetadata({target:i.constructor,propertyName:s,reflectedType:r,typeFunction:t,options:e})}}class y{constructor(){this.Order=new n.D,this.Invoice=new r.m,this.Shipping=new a.Q,this.Action=new c.a,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get cartQuantity(){let t=0;for(let e of this.CartItems)t+=e.Quantity;return t}emptyCart(){this.Items=[]}isCartEmpty(){return 0==this.Items.length}get TotalPaidAmount(){let t=0;return this.Payments.forEach(e=>{t+=e.PaidAmount}),t}get RedeemableAmount(){let t=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=l._.Cash);return this.GetAmountByCart(t)}get TotalQuantity(){let t=0;return this.CartItems.forEach(e=>{e.PromotionGift||(t+=e.Quantity)}),t}get CashOnlyAmount(){let t=this.CartItems.filter(t=>t.Variant.PaymentTypeID==l._.Cash);return this.GetAmountByCart(t)}get PointOnlyAmount(){let t=this.CartItems.filter(t=>t.Variant.PaymentTypeID==l._.Point);return this.GetAmountByCart(t)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==d.J.TreatmentPackage)}GetAmountByCart(t){let e=0;return t.forEach(t=>{e+=t.Total}),e=e*(100-this.Order.Discount)/100,e=e*(100-this.Order.Discount2)/100,e}addToCart(t,e=!1,i=!1,s="",r=!1,n=!1){this.Items||(this.Items=[]);let o=1,a=this.Items.find(e=>e.VariantID==t.VariantID);e||!a?(this.Items.push(t),o=t.Quantity):(a.Quantity++,t=a);let c=t.Variant.Serial;t.Variant.TypeID==d.J.Serialized&&c&&(t.Note&&(t.Serial=t.Note.replace("[","").replace("]","").split(",")),-1==t.Serial.indexOf(c)&&(t.Serial.push(c),t.updateSerial())),i&&(s||(s=t.getPricebookByQuantity()),t.pricebookUpdate(s,r),t.updatePriceStatus(s)),t.Variant.Component&&t.Variant.Component.forEach(t=>{n||(t.UnitPrice=0);let e=new u.N;e.patchByVariant(t),e.Quantity=t.Quantity*o,this.addToCart(e,!1)})}}(0,s.gn)([f(()=>n.D)],y.prototype,"Order",void 0),(0,s.gn)([f(()=>r.m)],y.prototype,"Invoice",void 0),(0,s.gn)([f(()=>a.Q)],y.prototype,"Shipping",void 0),(0,s.gn)([f(()=>c.a)],y.prototype,"Action",void 0),(0,s.gn)([f(()=>o.j)],y.prototype,"Payments",void 0),(0,s.gn)([f(()=>u.N)],y.prototype,"Items",void 0),(0,s.gn)([f(()=>h.t)],y.prototype,"CartItems",void 0)},81126:(t,e,i)=>{"use strict";i.d(e,{T:()=>l});var s=i(36820),r=i(26698),n=i(21061),o=i(50006),a=i(33018),c=i(65107),h=i(31772);const u="POSDatabase";let l=(()=>{class t{constructor(t,e){this.httpService=t,this.db=e,this.products=[],this.variants=[]}get hasConnection(){return navigator.onLine}sync(){return this.syncProducts().then(()=>this.syncOutletPrice().then(()=>this.syncOutlet()))}getObjectByKey(t){return new Promise((e,i)=>{this.db.getAll(t).subscribe(t=>{t.length?e(t[0]):i("No Data")},t=>{i(t)})})}getListByKey(t){return new Promise((e,i)=>{this.db.getByKey(u,t).subscribe(t=>{e(t)},t=>{i(t)})})}saveObject(t,e){return new Promise((i,s)=>{this.db.clear(t).subscribe(()=>this.db.add(t,e).subscribe(()=>{i(e)},t=>{s(t)}))})}saveList(t,e){return new Promise(i=>{this.db.update(u,t,e).subscribe(()=>{i("Success!")})})}isLocal(){return this.getConfig().then(t=>t.productUsingLocal||t.configUsingLocal||t.orderUsingLocal)}isOnline(){return this.hasConnection}checkQueryRealtime(){return this.getConfig().then(t=>null==t||!t.productUsingLocal&&this.hasConnection)}checkConfigRealtime(){return this.getConfig().then(t=>!t.configUsingLocal&&this.hasConnection)}checkPushRealtime(){return this.getConfig().then(t=>null==t||!t.orderUsingLocal&&this.hasConnection)}getConfig(){return new Promise(t=>{null!=this.Config?t(this.Config):this.getListByKey(n.k0.OfflineQueryMode).then(e=>{this.Config=e,t(this.Config)},()=>{this.Config=new s.Z,t(this.Config)})})}saveConfig(t){return this.Config=t,this.saveList(t,n.k0.OfflineQueryMode)}getPOSStorage(){return this.db.getByKey(u,n.k0.POSStorage)}setPOSStorage(t){return this.db.update(u,t,n.k0.POSStorage)}syncOutletPrice(){return new Promise((t,e)=>{this.httpService.post(n.Wz.SynOutletPrice).subscribe(i=>{this.db.update(u,i,n.k0.OutletPrices).subscribe(()=>{t()},t=>e(t))})})}getOutletPrice(){return new Promise(t=>{null!=this.outletPrices?t(this.outletPrices):this.db.getByKey(u,n.k0.OutletPrices).subscribe(e=>{this.outletPrices=e,t(this.outletPrices)})})}getOutletByEntityId(t){return new Promise(e=>{this.getOutlet().then(i=>{console.log(i);const s=i.find(e=>e.EntityID==t);e(s)})})}getOutletByRegisterId(t){return new Promise(e=>{this.getOutlet().then(i=>{console.log(i);const s=i.find(e=>e.RegisterID==t);e(s)})})}syncOutlet(){return new Promise((t,e)=>{this.httpService.post(n.Wz.SynOutlet).subscribe(i=>{this.outlet=i,this.db.update(u,i,n.k0.Outlet).subscribe(()=>t(),t=>e(t))})})}getOutlet(){return new Promise((t,e)=>{null!=this.outlet?t(this.outlet):this.db.getByKey(u,n.k0.Outlet).subscribe(e=>{this.outlet=e,t(this.outlet)},t=>e(t))})}saveOutlet(t){return this.saveList(n.k0.Outlet,t)}getOfflineOrders(){return new Promise(t=>{this.getListByKey(n.k0.Orders).then(e=>{this.offlineOrders=e,t(this.offlineOrders)})})}saveOfflineOrder(t){return new Promise(e=>{this.getOfflineOrders().then(i=>{this.offlineOrders=null==i?[]:i,this.offlineOrders.push(t),this.saveList(this.offlineOrders,n.k0.Orders).then(()=>e())})})}deleteLastOrder(){return new Promise(t=>{this.getOfflineOrders().then(e=>{e.splice(e.length-1,1),this.offlineOrders=e,this.saveOrdersList(e).then(()=>{t()})})})}saveOrdersList(t){return this.saveList(t,n.k0.Orders)}syncOrders(){return new Promise((t,e)=>{this.getOfflineOrders().then(i=>{null==i||i.length<1?t("List is Empty"):this.syncOrderProcess(i).then(()=>{t("Offline Orders uploaded successfully!")}).catch(t=>{e(t)})})})}syncOrdersFail(t){const e=(0,o.d8)(r.m,t);return e.Action.Retry=!0,e.Message="Failed to send to server",this.saveFailedOrder(e).then(()=>this.removeOrder(t))}saveFailedOrder(t){return new Promise(e=>{this.getFailedOrders().then(i=>{i.push(t),this.saveList(i,n.k0.FailedOrders).then(()=>e())})})}syncOrder(t){return null!=t.CartItems&&delete t.CartItems,this.httpService.post("/API/POS/SubmitOrder",t)}syncOrderProcess(t){return new Promise((e,i)=>{this.syncOrder(t[0]).subscribe(s=>{s.Success?(this.removeOrder(t[0]),0==t.length?e():this.syncOrderProcess(t).then(()=>e()).catch(t=>{i(t)})):this.syncOrdersFail(t[0]).then(()=>{0==t.length?i("Failed to Upload!"):this.syncOrderProcess(t).then(()=>e()).catch(t=>{i(t)})})},()=>{this.syncOrdersFail(t[0]).then(()=>{0==t.length?i("Failed to Upload!"):this.syncOrderProcess(t).then(()=>e()).catch(t=>{i(t)})})})})}removeOrder(t){return new Promise((e,i)=>{const s=this.offlineOrders.indexOf(t);this.offlineOrders.splice(s,1),this.saveList(this.offlineOrders,n.k0.Orders).then(()=>e()).catch(()=>i())})}getFailedOrders(){return new Promise(t=>{this.getListByKey(n.k0.FailedOrders).then(e=>{t(e)})})}syncFailedOrder(t){return new Promise((e,i)=>{this.syncOrder(t).subscribe(()=>{this.removeFailedOrder(t).then(()=>e("Upload Successful!"))},t=>{console.log(t),i("Failed to upload!")})})}saveFailedOrdersList(t){return this.saveList(t,n.k0.FailedOrders)}removeFailedOrder(t){return new Promise(e=>{this.getListByKey(n.k0.FailedOrders).then(i=>{for(let s=0;s<i.length;s++)if(i[s].Order.Number==t.Order.Number){i.splice(s,1),this.saveFailedOrdersList(i).then(()=>e());break}})})}getProducts(){return new Promise((t,e)=>{this.products.length>0?t(this.products):this.db.getByKey(u,n.k0.Products).subscribe(i=>{i?(this.products=i,t(this.products)):e(n.g7.failGetLocalVariant)},t=>{console.log(t)})})}GetVariants(){return new Promise((t,e)=>{this.variants.length>0?t(this.variants):this.getProducts().then(e=>{this.variants=e,t(this.variants)}).catch(t=>{e(t)})})}transformToVariantCompact(t,e){if(null!=t&&null!=e){const i={};return i.CategoryID=t.CategoryID,i.Code=e.Code,i.CategoryName=t.Category,i.Created=null!=t.Created?t.Created:t.Released,i.Discontinued=t.Discontinued,i.ID=e.ID,i.ImageUrl=t.ImageUrl,i.Model=e.Model,i.Name=t.Name,"Default"!=e.Model&&(i.Name+=" ("+e.Model+")"),i.ProductID=e.ProductID,i.ThumbnailUrl=t.ThumbnailUrl,i.UnitCost=e.UnitCost,i.UnitPrice=e.UnitPrice,i.UnitPriceOriginal=e.UnitPrice,i.UnitQuantity=e.Inventory,i.PriceDiscount=0,i}return null}getVariantById(t,e){return new Promise((i,s)=>{this.getProducts().then(r=>{let o=r.find(e=>e.ID==t);o?this.getOutletPrice().then(()=>{o=this.GenerateEntityProperties(o,e),i(o)}):s(n.g7.failGetLocalVariant)}).catch(t=>{s(t)})})}getVariantByCode(t){return new Promise((e,i)=>{let s;this.getProducts().then(r=>{s=r.find(e=>e.Code==t),s?e(s):i("Variant Not Found!")}).catch(t=>{i(t)})})}GenerateEntityProperties(t,e){if(e){const i=this.outletPrices.find(i=>i.VariantID==t.ID&&i.EntityID==e);null!=i&&(t.UnitCost=i.UnitCost,t.UnitPrice=i.UnitPrice,t.PriceDiscount=i.PriceDiscount)}return t}syncProducts(){return new Promise(t=>{this.httpService.post("/API/POSSync/Products",{}).subscribe(e=>{this.products=e,this.saveSyncTime(),this.db.update(u,this.products,n.k0.Products).subscribe(()=>{t()})})})}assignNameToOrderItems(t){return new Promise(e=>{this.getProducts().then(i=>{t.forEach(t=>{t.Items.forEach(t=>{const e=i.find(e=>e.ID==t.VariantID);t.Variant=e.Variant})}),e(t)})})}saveSyncTime(){const t=new Date;this.db.update(u,t,"SyncTime")}getSyncTime(){return this.db.getByKey(u,"SyncTime")}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(c.O),a.LFG(h.ys))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},64762:(t,e,i)=>{"use strict";function s(t,e,i,s){var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o}function r(t,e){return function(i,s){e(i,s,t)}}function n(t,e,i,s){return new(i||(i=Promise))(function(r,n){function o(t){try{c(s.next(t))}catch(e){n(e)}}function a(t){try{c(s.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,a)}c((s=s.apply(t,e||[])).next())})}i.d(e,{gn:()=>s,fM:()=>r,mG:()=>n})}}]);