dealpos 10.9.0 → 10.9.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.
- package/POS/1014.113be8a272df504da947.js +1 -0
- package/POS/1126.56b2edd9e20fa17f3fd0.js +1 -0
- package/POS/{394.f27a152a0aec9d068500.js → 1394.7a8481fd78926f5370eb.js} +1 -1
- package/POS/147.441b811b24f04c7686e6.js +1 -0
- package/POS/1482.e05a2ea7311cb569cc1b.js +1 -0
- package/POS/1494.19e397a7ef2c9da7d825.js +1 -0
- package/POS/1732.a70619832126f7ffe89d.js +1 -0
- package/POS/1829.01199a7e70931e867d00.js +1 -0
- package/POS/24.8bf4f3615861f8552a28.js +1 -0
- package/POS/2542.df9f55732b4f6b62356a.js +1 -0
- package/POS/2700.9909f945a4fd5c76f5a0.js +1 -0
- package/POS/2802.825b6cc1b72adc6583bf.js +1 -0
- package/POS/2837.6f0368c66492d160169f.js +1 -0
- package/POS/2942.d1a71f72fadc03e26bd5.js +1 -0
- package/POS/3013.d1000fdcd2c8e86cfc38.js +1 -0
- package/POS/3098.0882365f0b9927425e47.js +1 -0
- package/POS/3165.6ed8a2967aad894c29f1.js +1 -0
- package/POS/3183.938a82c6494ffd7ff9db.js +1 -0
- package/POS/3403.573fc8b1059c51d000fa.js +1 -0
- package/POS/3461.b902416584e28e645611.js +1 -0
- package/POS/3583.b8866410ffbcca71d5da.js +1 -0
- package/POS/3588.a53f0d3c0d2f67e45bc9.js +1 -0
- package/POS/4140.3fd425f8ff4a24a9faae.js +1 -0
- package/POS/4333.4ac437f80a3ed82832a9.js +1 -0
- package/POS/4387.80383c36ff3481575359.js +1 -0
- package/POS/5451.3ff61c38f98da864327e.js +1 -0
- package/POS/549.22fb95a7a347b8d94dc9.js +1 -0
- package/POS/5589.4bab77b71cd88d11121e.js +1 -0
- package/POS/5937.048d476c29be917c5742.js +1 -0
- package/POS/5939.aadb569bb1c4d25f8456.js +1 -0
- package/POS/5968.27bc23a41f6375be64a3.js +1 -0
- package/POS/6263.60762b9478f4178df53f.js +1 -0
- package/POS/6333.b8b9bc6eda16720290be.js +1 -0
- package/POS/6405.0e12d63346c550f2c6ef.js +1 -0
- package/POS/6736.57e557c2d865bb4fa7b8.js +1 -0
- package/POS/6756.1ef505a052d683792a11.js +1 -0
- package/POS/6832.8e888b45f02335b8ef46.js +1 -0
- package/POS/7376.7e5a3dc7f51bb12c530a.js +1 -0
- package/POS/{783.8844c784e529f7c6ba70.js → 783.9b5fa16feee0fe754b40.js} +0 -0
- package/POS/8138.cd9039976880aabaf79d.js +1 -0
- package/POS/8146.781f625377ffdc0b5537.js +1 -0
- package/POS/8255.51b32bde0a978138fd10.js +1 -0
- package/POS/8598.682705194f79edfab710.js +1 -0
- package/POS/8834.5b4eaf744208fc866c4d.js +1 -0
- package/POS/8936.1d0c5bf58ae2c2276a69.js +1 -0
- package/POS/9272.2a41cf7aaeb8e33673b8.js +1 -0
- package/POS/9309.c93205c130ffed859a94.js +1 -0
- package/POS/9365.aa6e68e6916a8ab0b362.js +1 -0
- package/POS/{189.11cf36e9fe7b7e152685.js → 970.4fa08d0f71c3db4573c6.js} +1 -1
- package/POS/common.42c260ab5de815840298.js +1 -0
- package/POS/{main.8f56fccdeb2343c185e8.js → main.2eb0b94c2a77c36034f7.js} +1 -1
- package/POS/polyfills.ca3b5d0ddf11c8d722af.js +1 -0
- package/POS/pos-index.html +2 -2
- package/POS/runtime.da6e9b92ea27dfb1af2d.js +1 -0
- package/Scripts/Angular/Controller/Orders/InvoiceInfo.js +2 -1
- package/Scripts/Angular/Controller/Sell.js +8 -8
- package/Scripts/Angular/Controller/StockTake/CSV.js +11 -1
- package/package.json +1 -1
- package/POS/126.e168a76214d299d5c1d6.js +0 -1
- package/POS/13.79c792cef14a2db4b58d.js +0 -1
- package/POS/140.a0940b3996c8e0c81b64.js +0 -1
- package/POS/146.43bdf986964bca56882a.js +0 -1
- package/POS/147.f15bd4ce4eab738a60a6.js +0 -1
- package/POS/183.f37280a6c6587a22ee88.js +0 -1
- package/POS/223.cb9cad29a5e3bdee1efd.js +0 -1
- package/POS/255.219ba194b03cc577fec6.js +0 -1
- package/POS/264.76071496191c950a2267.js +0 -1
- package/POS/272.03d12b9d5736bdbfcf2b.js +0 -1
- package/POS/307.5eec3c72072388bd2da4.js +0 -1
- package/POS/309.c218f089eee6ddc8accc.js +0 -1
- package/POS/333.21cb2bf8dd9ca0d5479f.js +0 -1
- package/POS/351.b223fa63741f59c98a5e.js +0 -1
- package/POS/389.d04ae4edf7fb5efb3460.js +0 -1
- package/POS/424.85d54e5566962ad7fac8.js +0 -1
- package/POS/433.772bcc41ba55b6717ac7.js +0 -1
- package/POS/486.95c31ccd22515211b214.js +0 -1
- package/POS/494.76b943899bd1524095eb.js +0 -1
- package/POS/526.3a0096410238586697e7.js +0 -1
- package/POS/542.18c851b4407829fc47e4.js +0 -1
- package/POS/588.6c2f853ace825f76ac28.js +0 -1
- package/POS/598.d8666ba4e169ef0ecef8.js +0 -1
- package/POS/611.5551199098be8d3b08e2.js +0 -1
- package/POS/613.d5616f7f63c2cf8b59c6.js +0 -1
- package/POS/691.5cae7eff1819291e4cc0.js +0 -1
- package/POS/732.cb9f22bf18ae53cf84fd.js +0 -1
- package/POS/736.6baf7abe3477e5144e58.js +0 -1
- package/POS/772.5dfc310968db70f1e4a7.js +0 -1
- package/POS/802.952aaf43b8fcad3ab6a6.js +0 -1
- package/POS/814.c09b74b10e4fe2623cd5.js +0 -1
- package/POS/832.1ce2f49a414b02e21f22.js +0 -1
- package/POS/922.ee04d53958495c47bf4d.js +0 -1
- package/POS/964.520eaf89cece3a47e3a5.js +0 -1
- package/POS/968.fb3fa9d550179a85b9c0.js +0 -1
- package/POS/999.7e6f5d6d7ab6ccd01008.js +0 -1
- package/POS/common.1e48eff19e73e584d424.js +0 -1
- package/POS/polyfills.3a95701991eb72189d98.js +0 -1
- package/POS/runtime.5bbeec8ed746864db210.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkinv_web_app=self.webpackChunkinv_web_app||[]).push([[1014],{61314:(t,e,n)=>{"use strict";n.d(e,{K:()=>O,W:()=>P});var i=n(83461),o=n(37716),c=n(33935),r=n(79765),s=n(46782),l=n(38583),a=n(54585),g=n(64065),d=n(3298),p=n(74937);function u(t,e){1&t&&(o.TgZ(0,"th",17),o._uU(1," Price"),o.qZA())}function h(t,e){1&t&&(o.TgZ(0,"th",17),o._uU(1,"Cost"),o.qZA())}function m(t,e){1&t&&(o.TgZ(0,"th",18),o._uU(1,"%"),o.qZA())}function f(t,e){1&t&&(o.TgZ(0,"th",19),o._uU(1,"Total"),o.qZA())}function x(t,e){if(1&t&&(o.TgZ(0,"small"),o._uU(1),o.qZA()),2&t){const t=o.oxw().index;o.xp6(1),o.hij("",t+1,".")}}function Z(t,e){if(1&t&&(o.TgZ(0,"td",8),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.Price)," ")}}function C(t,e){if(1&t&&(o.TgZ(0,"td",8),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.Cost)," ")}}function v(t,e){if(1&t&&(o.TgZ(0,"td",29),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",0==t.Discount?"":"-"+o.lcZ(2,1,t.Discount)," ")}}function b(t,e){if(1&t&&(o.TgZ(0,"td",8),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.Price*t.Quantity*((100-t.Discount)/100))," ")}}function M(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr",20),o.NdJ("click",function(){const e=o.CHM(t),n=e.$implicit,i=e.index;return o.oxw().onSelect({item:n,index:i})})("contextmenu",function(e){const n=o.CHM(t),i=n.$implicit,c=n.index;return o.oxw().onContextMenu(e,i,c)}),o.TgZ(1,"td",21),o.TgZ(2,"i",22),o.NdJ("click",function(){const e=o.CHM(t),n=e.$implicit,i=e.index;return o.oxw().onRemove({item:n,index:i})}),o.qZA(),o.qZA(),o.TgZ(3,"td"),o.YNc(4,x,2,1,"small",23),o.qZA(),o.TgZ(5,"td",24),o.TgZ(6,"span",25),o._uU(7),o._UZ(8,"br"),o.qZA(),o._UZ(9,"span",26),o.qZA(),o.TgZ(10,"td"),o._uU(11),o.qZA(),o.TgZ(12,"td",8),o._uU(13),o.ALo(14,"number"),o.qZA(),o.TgZ(15,"td"),o.TgZ(16,"small"),o._uU(17),o.qZA(),o.qZA(),o.YNc(18,Z,3,3,"td",27),o.YNc(19,C,3,3,"td",27),o.YNc(20,v,3,3,"td",28),o.YNc(21,b,3,3,"td",27),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.xp6(4),o.Q6J("ngIf",n.appConfig.ModuleSell.Grid.RowNumberVisible),o.xp6(3),o.hij(" ",t.Variant.Name," "),o.xp6(2),o.Q6J("innerHTML",t.Note,o.oJD),o.xp6(2),o.Oqu(t.Variant.Code),o.xp6(2),o.hij(" ",o.lcZ(14,10,t.Quantity)," "),o.xp6(4),o.Oqu(null!=t.Variant.UOM?t.Variant.UOMName:""),o.xp6(1),o.Q6J("ngIf",!n.role.PriceVisibleRestriction&&n.appConfig.ModuleDelivery.OutletDelivery.PriceVisible&&2!=n.pageState),o.xp6(1),o.Q6J("ngIf",n.role.Cost&&2==n.pageState),o.xp6(1),o.Q6J("ngIf",n.role.Discount&&2!=n.pageState),o.xp6(1),o.Q6J("ngIf",!n.role.PriceVisibleRestriction&&n.appConfig.ModuleDelivery.OutletDelivery.PriceVisible)}}function _(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",30),o.NdJ("click",function(){const e=o.CHM(t).item;return o.oxw().onReverse(e,!0)}),o._uU(1,"Return"),o.qZA(),o.TgZ(2,"button",30),o.NdJ("click",function(){const e=o.CHM(t).item;return o.oxw().onReverse(e,!1)}),o._uU(3,"Purchase"),o.qZA()}}let O=(()=>{class t{constructor(t,e){this.loadService=t,this.cartItemService=e,this.contextMenuPosition={x:"0px",y:"0px"},this.cartItems=[],this.destroy$=new r.xQ,this.onSelectItem=new o.vpe,this.onReturnItem=new o.vpe,this.onPurchaseItem=new o.vpe,this.onRemoveItem=new o.vpe,this.onDragItem=new o.vpe,this.cartItemsChange=new o.vpe}onContextMenu(t,e,n){t.preventDefault(),this.contextMenuPosition.x=t.clientX+"px",this.contextMenuPosition.y=t.clientY+"px",e.Index=n,this.contextMenu.menuData={item:e},this.contextMenu.openMenu()}drop(t){(0,i.bA)(this.cartItems,t.previousIndex,t.currentIndex),this.cartItemService.updateCartItem(this.cartItems),this.onDragItem.emit(this.cartItems),this.cartItemsChange.emit(this.cartItems)}ngOnInit(){this.initAppConfig(),this.initRole()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initAppConfig(){this.appConfig=this.loadService.data.AppConfigJSON,this.pageState=this.loadService.pageState}initRole(){this.loadService.role$.pipe((0,s.R)(this.destroy$)).subscribe(t=>{this.role=t})}onRemove(t){this.onRemoveItem.emit(t)}onSelect(t){this.onSelectItem.emit(t)}onReverse(t,e){e?(t.Quantity>0&&(t.Quantity=-1*t.Quantity),this.onReturnItem.emit(t)):(t.Quantity<0&&(t.Quantity=-1*t.Quantity),this.onPurchaseItem.emit(t))}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(g.O),o.Y36(d.N))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-cart-display"]],viewQuery:function(t,e){if(1&t&&o.Gf(c.p6,7),2&t){let t;o.iGM(t=o.CRH())&&(e.contextMenu=t.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem",onDragItem:"onDragItem"},decls:25,vars:10,consts:[[1,"cashier"],[1,"row","no-gutters","cart-table","border-bottom"],["cdkScrollable","",1,"col"],[1,"table"],[2,"width","18px"],[2,"width","36px"],[1,"text-left",2,"width","250px"],[1,"text-right",2,"width","50px"],[1,"text-right"],["style","width: 70px","class","text-right",4,"ngIf"],["style","width: 20px","class","text-right",4,"ngIf"],["style","width: 85px","class","text-right",4,"ngIf"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"click","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["contextMenu","matMenu"],["matMenuContent",""],[1,"text-right",2,"width","70px"],[1,"text-right",2,"width","20px"],[1,"text-right",2,"width","85px"],["cdkDrag","",1,"item",3,"click","contextmenu"],[1,"cursor"],["aria-hidden","true","title","Click to Remove","alt","",1,"fa","fa-times","text-danger",3,"click"],[4,"ngIf"],[1,"text-left"],[1,"d-block"],[3,"innerHTML"],["class","text-right",4,"ngIf"],["class","text-right text-danger disc",4,"ngIf"],[1,"text-right","text-danger","disc"],["mat-menu-item","",3,"click"]],template:function(t,e){if(1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"table",3),o.TgZ(4,"thead"),o.TgZ(5,"tr"),o._UZ(6,"th",4),o._UZ(7,"th",5),o.TgZ(8,"th",6),o._uU(9,"Item"),o.qZA(),o.TgZ(10,"th"),o._uU(11,"Code"),o.qZA(),o.TgZ(12,"th",7),o._uU(13,"Qty"),o.qZA(),o._UZ(14,"th",8),o.YNc(15,u,2,0,"th",9),o.YNc(16,h,2,0,"th",9),o.YNc(17,m,2,0,"th",10),o.YNc(18,f,2,0,"th",11),o.qZA(),o.qZA(),o.TgZ(19,"tbody",12),o.NdJ("cdkDropListDropped",function(t){return e.drop(t)}),o.YNc(20,M,22,12,"tr",13),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o._UZ(21,"div",14),o.TgZ(22,"mat-menu",null,15),o.YNc(24,_,4,0,"ng-template",16),o.qZA(),o.qZA()),2&t){const t=o.MAs(23);o.xp6(15),o.Q6J("ngIf",!e.role.PriceVisibleRestriction&&e.appConfig.ModuleDelivery.OutletDelivery.PriceVisible&&2!=e.pageState),o.xp6(1),o.Q6J("ngIf",e.role.Cost&&2==e.pageState),o.xp6(1),o.Q6J("ngIf",e.role.Discount&&2!=e.pageState),o.xp6(1),o.Q6J("ngIf",!e.role.PriceVisibleRestriction&&e.appConfig.ModuleDelivery.OutletDelivery.PriceVisible),o.xp6(2),o.Q6J("ngForOf",e.cartItems),o.xp6(1),o.Udp("left",e.contextMenuPosition.x)("top",e.contextMenuPosition.y),o.Q6J("matMenuTriggerFor",t)}},directives:[p.PQ,l.O5,i.Wj,l.sg,c.p6,c.VK,c.KA,i.Zt,c.OP],pipes:[l.JJ],styles:["div.row.cart-table[_ngcontent-%COMP%] {\n border-left: solid 1px #CFCFCF;\n}\ndiv.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] {\n overflow: auto;\n height: 250px;\n}\ndiv.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] {\n background: #FBFBF7;\n border-left: none;\n}\ndiv.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n padding: 9px 5px !important;\n}\ndiv.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n padding: 10px 5px;\n border-bottom: 1px solid #CFCFCF;\n}\ndiv.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\n padding-right: 0;\n}\n.cdk-drag-preview[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\n}\n.cdk-drag-placeholder[_ngcontent-%COMP%] {\n opacity: 0;\n}\n.cdk-drag-animating[_ngcontent-%COMP%] {\n transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\n}\n.item[_ngcontent-%COMP%]:last-child {\n border: none;\n}\n.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder) {\n transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\n}\n.cashier[_ngcontent-%COMP%] {\n max-width: 37rem;\n min-width: 33rem;\n}"]}),t})(),P=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[l.ez,c.Tx,a.dr,i._t]]}),t})()},14422:(t,e,n)=>{"use strict";n.d(e,{h:()=>a});var i=n(51197),o=n(37716),c=n(22238),r=n(49344),s=n(65107),l=n(10646);let a=(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.toastService=e,this.httpService=n,this.flag=!1,this.csvResult=[]}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new i.O,this.modalConfig.title="Upload",this.modalConfig.hideMoreButton=!0,this.modalConfig.customWidth="284px"}onSelectFile(t){const e=t.files;if(e&&e.length){var n=t.files[0].name.split(".").pop().toLowerCase();if(["csv"].indexOf(n)>-1){const t=e[0],n=new FileReader;n.onload=t=>{this.onFileLoad(t)},n.readAsText(t,"UTF-8")}else this.toastService.error("Invalid File Type","Failed")}}onFileLoad(t){let e=t.target.result,n=!1,i=[],o=[],c=0;for(const s of e.split(/[\r\n]+/))if(n){let t={};for(let e=0;e<c;e++)t[o[e]]=s.split(",")[e];i.push(t)}else{for(let t=0;t<s.split(",").length;t++)c=s.split(",").length,o.push(s.split(",")[t].replace(/ /g,""));n=!0}let r=i.filter(t=>""!=t.Code);this.csvResult=r,this.flag=!0}onOk(){this.httpService.post("/API/Delivery/UploadCsv",JSON.stringify(this.csvResult)).subscribe(t=>{this.dialogRef.close(t)})}onClose(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(c.so),o.Y36(r._W),o.Y36(s.O))},t.\u0275cmp=o.Xpm({type:t,selectors:[["POS-modal-upload"]],decls:14,vars:1,consts:[[3,"config","onOk","onCancel","onClose"],[1,"modal-dialog"],[1,"modal-content","border-0"],["href","//res.cloudinary.com/pos/raw/upload/POS/CSV/ItemTransfer_Dealpos.csv",1,"noteBox"],[1,"d-flex","justify-content-between"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"]],template:function(t,e){1&t&&(o.TgZ(0,"modal-material",0),o.NdJ("onOk",function(){return e.onOk()})("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),o.TgZ(1,"content",1),o.TgZ(2,"div",2),o.TgZ(3,"div"),o.TgZ(4,"a",3),o._uU(5,"Download Sample File"),o.qZA(),o.qZA(),o.TgZ(6,"div",4),o.TgZ(7,"table"),o.TgZ(8,"tbody"),o.TgZ(9,"tr"),o.TgZ(10,"th"),o._uU(11," CSV: "),o.qZA(),o.TgZ(12,"td"),o.TgZ(13,"input",5),o.NdJ("change",function(t){return e.onSelectFile(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&o.Q6J("config",e.modalConfig)},directives:[l.M],styles:[""]}),t})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkinv_web_app=self.webpackChunkinv_web_app||[]).push([[1126],{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 o{constructor(t,e){this.transformationType=t,this.options=e,this.recursionStack=new Set}transform(t,e,i,o,n,a=0){if(Array.isArray(e)||e instanceof Set){const s=o&&this.transformationType===r.h.PLAIN_TO_CLASS?function(t){const e=new t;return e instanceof Set||"push"in e?e:[]}(o):[];return e.forEach((e,o)=>{const n=t?t[o]: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 o=this.transform(n,e,t,void 0,e instanceof Map,a+1);s instanceof Set?s.add(o):s.push(o)}}),s}if(i!==String||n){if(i!==Number||n){if(i!==Boolean||n){if((i===Date||e instanceof Date)&&!n)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)&&!n)return null==e?e:Buffer.from(e);if(null===(c=e)||"object"!=typeof c||"function"!=typeof c.then||n){if(n||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 o=this.getKeys(i,e,n);let c=t||{};t||this.transformationType!==r.h.PLAIN_TO_CLASS&&this.transformationType!==r.h.CLASS_TO_CLASS||(c=n?new Map:i?new i:{});for(const h of o){if("__proto__"===h||"constructor"===h)continue;const o=h;let u,l=h,p=h;if(!this.options.ignoreDecorators&&i)if(this.transformationType===r.h.PLAIN_TO_CLASS){const t=s.m.findExposeMetadataByCustomName(i,h);t&&(p=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(o):e[o]instanceof Function?e[o]():e[o];let d,f=u instanceof Map;if(i&&n)d=i;else if(i){const t=s.m.findTypeMetadata(i,p);if(t){const i={newObject:c,object:e,property:p},s=t.typeFunction?t.typeFunction(i):t.reflectedType;t.options&&t.options.discriminator&&t.options.discriminator.property&&t.options.discriminator.subTypes?e[o]instanceof Array?d=t:(this.transformationType===r.h.PLAIN_TO_CLASS&&(d=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]}),d=void 0===d?s:d.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&&(d=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)):d=s,f=f||t.reflectedType===Map}else if(this.options.targetMaps)this.options.targetMaps.filter(t=>t.target===i&&!!t.properties[p]).forEach(t=>d=t.properties[p]);else if(this.options.enableImplicitConversion&&this.transformationType===r.h.PLAIN_TO_CLASS){const t=Reflect.getMetadata("design:type",i.prototype,p);t&&(d=t)}}const y=Array.isArray(e[o])?this.getReflectedType(i,p):void 0,m=t?t[o]: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,d,y,f,a+1)):void 0===u&&this.options.exposeDefaultValues?s=c[l]:(s=this.transform(m,u,d,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,o){let n=s.m.findTransformMetadatas(e,i,this.transformationType);return void 0!==this.options.version&&(n=n.filter(t=>!t.options||this.checkVersion(t.options.since,t.options.until))),n=n.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),n.forEach(e=>{t=e.transformFn({value:t,key:i,obj:r,type:o,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 o=s.m.getStrategy(t);"none"===o&&(o=this.options.strategy||"exposeAll");let n=[];if(("exposeAll"===o||i)&&(n=e instanceof Map?Array.from(e.keys()):Object.keys(e)),i)return n;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})),n=this.options.excludeExtraneousValues?e:n.concat(e);const i=s.m.getExcludedProperties(t,this.transformationType);i.length>0&&(n=n.filter(t=>!i.includes(t))),void 0!==this.options.version&&(n=n.filter(e=>{const i=s.m.findExposeMetadata(t,e);return!i||!i.options||this.checkVersion(i.options.since,i.options.until)})),n=n.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&&(n=n.filter(t=>this.options.excludePrefixes.every(e=>t.substr(0,e.length)!==e))),n=n.filter((t,e,i)=>i.indexOf(t)===e),n}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 n={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 o(r.h.CLASS_TO_PLAIN,{...n,...e}).transform(void 0,t,void 0,void 0,void 0,void 0)}classToPlainFromExist(t,e,i){return new o(r.h.CLASS_TO_PLAIN,{...n,...i}).transform(e,t,void 0,void 0,void 0,void 0)}plainToClass(t,e,i){return new o(r.h.PLAIN_TO_CLASS,{...n,...i}).transform(void 0,e,t,void 0,void 0,void 0)}plainToClassFromExist(t,e,i){return new o(r.h.PLAIN_TO_CLASS,{...n,...i}).transform(t,e,void 0,void 0,void 0,void 0)}classToClass(t,e){return new o(r.h.CLASS_TO_CLASS,{...n,...e}).transform(void 0,t,void 0,void 0,void 0,void 0)}classToClassFromExist(t,e,i){return new o(r.h.CLASS_TO_CLASS,{...n,...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 o of this.getAncestors(e)){const e=t.get(o);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 o=[];for(const n of this.getAncestors(e)){const e=t.get(n);e&&e.has(i)&&o.push(...e.get(i))}return o.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))()},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:()=>o});var s=i(20143),r=i(21061);class o{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){const t=this.getSelectedPricebook(this.PriceBookID);r.gT.IsNotEmpty(this.Note)&&this.Note.replace(t.Name,"")}this.PriceBookID=t;const 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){const 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){const 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}checkMatchSerialWithQuantity(){let t=!0;if(this.isSerialType()){let e=this.Quantity,i=this.Serial.length;e<0&&(i=-i),e!==i&&(t=!1)}return t}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:()=>n});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))(),o=i(36470);class n{constructor(){this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.PurchaseOrderNumber="",this.ParkLabel="",this.AuthorizationKey="",this.CouponType=o.$.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=""}}},92466:(t,e,i)=>{"use strict";i.d(e,{m:()=>m});var s=i(64762),r=i(74715),o=i(32726),n=i(40573),a=i(72244),c=i(89753);class h{constructor(){this.DeliveryEntityID="",this.Type=c.q.Payment,this.Retur=!1}}var u=i(35592),l=i(46937),p=i(21311),d=i(20143),f=i(83475);function y(t,e={}){return function(i,s){const r=Reflect.getMetadata("design:type",i,s);f.m.addTypeMetadata({target:i.constructor,propertyName:s,reflectedType:r,typeFunction:t,options:e})}}class m{constructor(){this.Order=new o.D,this.Invoice=new r.m,this.Shipping=new a.Q,this.Action=new h,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!=p._.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==p._.Cash);return this.GetAmountByCart(t)}get PointOnlyAmount(){let t=this.CartItems.filter(t=>t.Variant.PaymentTypeID==p._.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}}(0,s.gn)([y(()=>o.D)],m.prototype,"Order",void 0),(0,s.gn)([y(()=>r.m)],m.prototype,"Invoice",void 0),(0,s.gn)([y(()=>a.Q)],m.prototype,"Shipping",void 0),(0,s.gn)([y(()=>h)],m.prototype,"Action",void 0),(0,s.gn)([y(()=>n.j)],m.prototype,"Payments",void 0),(0,s.gn)([y(()=>l.N)],m.prototype,"Items",void 0),(0,s.gn)([y(()=>u.t)],m.prototype,"CartItems",void 0)},81126:(t,e,i)=>{"use strict";i.d(e,{T:()=>p});var s=i(36820),r=i(92466),o=i(21061),n=i(50006),a=i(37716),c=i(65107),h=i(31772),u=i(49344);const l="POSDatabase";let p=(()=>{class t{constructor(t,e,i){this.httpService=t,this.db=e,this.toastrService=i,this.variants=[],this.offlineOrders=[],this.outletPrices=[],this.outlets=[]}get hasConnection(){return navigator.onLine}getListByKey(t){return new Promise((e,i)=>{this.db.getByKey(l,t).subscribe(t=>{e(t)},t=>{i(t)})})}saveList(t,e){return new Promise((i,s)=>{this.db.update(l,t,e).subscribe(()=>{i("Success!")},t=>{s(t)})})}isProductFromServer(){return this.getConfig().then(t=>null==t||!t.productUsingLocal&&this.hasConnection)}isConfigFromServer(){return this.getConfig().then(t=>!t.configUsingLocal&&this.hasConnection)}isStoreOrderInServer(){return this.getConfig().then(t=>null==t||!t.orderUsingLocal&&this.hasConnection)}getConfig(){return new Promise(t=>{null!=this.config?t(this.config):this.getListByKey(o.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,o.k0.OfflineQueryMode)}getPOSStorage(){return this.db.getByKey(l,o.k0.POSStorage)}setPOSStorage(t){return this.db.update(l,t,o.k0.POSStorage)}saveOfflineOrder(t){return 0==t.Items.length&&alert("Invalid Data Model Saved!"),new Promise((e,i)=>{this.getOfflineOrders().then(()=>{this.offlineOrders.push(t),this.saveList(this.offlineOrders,o.k0.Orders).then(()=>e()).catch(t=>{i(t)})})})}getOfflineOrders(){return new Promise(t=>{this.getListByKey(o.k0.Orders).then(e=>{this.offlineOrders=e||[],t(this.offlineOrders)})})}uploadOrders(){return new Promise((t,e)=>{this.getOfflineOrders().then(i=>{i.length<1?t("List is Empty"):this.uploadOrderProcess(i).then(()=>{t("Successfully sync offline orders!")}).catch(t=>{e(t)})})})}uploadOrderProcess(t=[]){let e;return new Promise((i,s)=>{t.forEach(t=>{e=this.createOrderForSubmission(t),this.httpService.post("/API/POS/SubmitOrder",e).toPromise().then(e=>{e.Success?(this.removeOrder(t),i()):this.syncOrdersFail(t).then(()=>i()).catch(t=>s(t))}).catch(e=>{this.syncOrdersFail(t).then(()=>i()).catch(t=>s(t)),console.error(e)})})})}createOrderForSubmission(t){let e=Object.assign({},t);return delete e.CartItems,delete e.Message,e}removeOrder(t){return new Promise((e,i)=>{const s=this.offlineOrders.indexOf(t);this.offlineOrders.splice(s,1),this.saveList(this.offlineOrders,o.k0.Orders).then(()=>e()).catch(()=>i())})}syncOrdersFail(t){const e=(0,n.d8)(r.m,t);return e.Message="Failed send to server",new Promise(t=>{this.getFailedOrders().then(i=>{i.push(e),this.saveList(i,o.k0.FailedOrders).then(()=>{t(),this.removeOrder(e)})})})}uploadFailedOrder(t){let e;return new Promise((i,s)=>{e=this.createOrderForSubmission(t),this.httpService.post("/API/POS/SubmitOrder",e).toPromise().then(()=>{this.removeFailedOrder(t).then(()=>i("Upload Successfully!"))},t=>{console.log(t),s("Failed to upload!")})})}getFailedOrders(){return new Promise(t=>{this.getListByKey(o.k0.FailedOrders).then(e=>{t(e||[])})})}removeFailedOrder(t){return new Promise(e=>{this.getListByKey(o.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.saveList(i,o.k0.FailedOrders).then(()=>e());break}})})}syncProducts(){return new Promise((t,e)=>{this.httpService.post("/API/POSSync/Products",{}).subscribe(i=>{this.variants=i,this.saveSyncTime(),this.saveList(i,o.k0.Products).then(()=>{t()}).catch(t=>{e(t)})})})}getVariants(){return new Promise((t,e)=>{0!=this.variants.length?t(this.variants):this.getListByKey(o.k0.Products).then(i=>{i?(this.variants=i,t(this.variants)):(this.toastrService.error(o.g7.failGetLocalVariant,"Error"),e(o.g7.failGetLocalVariant))}).catch(t=>{console.log(t),e(t)})})}getVariantById(t,e){return new Promise((i,s)=>{this.getVariants().then(r=>{let n=r.find(e=>e.ID==t);n?this.getOutletPrice().then(()=>{n=this.generateVariantPrice(n,e),i(n)}):(this.toastrService.error(o.g7.failGetLocalVariant,"Error"),s(o.g7.failGetLocalVariant))}).catch(t=>{s(t)})})}getVariantByCode(t,e){return new Promise((i,s)=>{let r;this.getVariants().then(n=>{r=n.find(e=>e.Code==t),r?this.getOutletPrice().then(()=>{r=this.generateVariantPrice(r,e),i(r)}):(this.toastrService.error(o.g7.failGetLocalVariant,"Error"),s(o.g7.failGetLocalVariant))}).catch(t=>{s(t)})})}generateVariantPrice(t,e){if(e){const i=this.outletPrices.find(i=>i.VariantID==t.ID&&i.EntityID==e);null!=i&&(t.UnitPrice=i.UnitPrice,t.PriceDiscount=i.PriceDiscount)}return t}syncOutletPrice(){return new Promise((t,e)=>{this.httpService.post(o.Wz.SynOutletPrice).subscribe(i=>{this.saveList(i,o.k0.OutletPrices).then(()=>{t()}).catch(t=>{e(t)})})})}getOutletPrice(){return new Promise((t,e)=>{0!=this.outletPrices.length?t(this.outletPrices):this.db.getByKey(l,o.k0.OutletPrices).subscribe(i=>{i?(this.outletPrices=i,t(this.outletPrices)):(this.toastrService.error(o.g7.failGetLocalOutletInfo,"Error"),e(o.g7.failGetLocalOutletInfo))},t=>{e(t)})})}syncOutlets(){return new Promise((t,e)=>{this.httpService.post(o.Wz.SynOutlet).subscribe(i=>{this.outlets=i,this.saveList(i,o.k0.Outlet).then(()=>{t()}).catch(t=>{e(t)})})})}getOutletByRegisterId(t){return new Promise(e=>{this.getOutlets().then(i=>{const s=i.find(e=>e.RegisterID==t);s.Promotion=s.Promotion?s.Promotion:[],e(s)})})}getOutlets(){return new Promise((t,e)=>{0!=this.outlets.length?t(this.outlets):this.db.getByKey(l,o.k0.Outlet).subscribe(i=>{i?(this.outlets=i,t(this.outlets)):(this.toastrService.error(o.g7.failGetLocalOutletInfo,"Error"),e(o.g7.failGetLocalOutletInfo))},t=>{this.toastrService.error(o.g7.failGetLocalOutletInfo,"Error"),e(t)})})}saveSyncTime(){const t=new Date;this.db.update(l,t,"SyncTime")}getSyncTime(){return this.db.getByKey(l,"SyncTime")}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(c.O),a.LFG(h.ys),a.LFG(u._W))},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,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n}function r(t,e){return function(i,s){e(i,s,t)}}function o(t,e,i,s){return new(i||(i=Promise))(function(r,o){function n(t){try{c(s.next(t))}catch(e){o(e)}}function a(t){try{c(s.throw(t))}catch(e){o(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(n,a)}c((s=s.apply(t,e||[])).next())})}i.d(e,{gn:()=>s,fM:()=>r,mG:()=>o})}}]);
|