dealpos 12.4.5 → 12.4.6
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/{3962.03084e9c8811f0fa.js → 3962.29127ceb44c87bf8.js} +1 -1
- package/POS/4192.cdbf77b3dc686ea4.js +1 -0
- package/POS/50.b550e9cd80f2e843.js +1 -0
- package/POS/{common.b15db15907d9faf0.js → common.9b86f440792cf2a6.js} +1 -1
- package/POS/index.html +2 -2
- package/POS/{main.881fafd5c6462758.js → main.3d795b6350172fbf.js} +1 -1
- package/POS/{runtime.13d094922f8a5081.js → runtime.a8a6f843044b4f97.js} +1 -1
- package/package.json +1 -1
- package/POS/4192.9251bb763e10fbdf.js +0 -1
- package/POS/50.9be1e952935412ca.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[3962],{27874:(R,S,h)=>{h.d(S,{O:()=>G});var o=h(81180),D=h(65592),l=h(22096),v=h(2459),c=h(69862),E=h(16321),e=h(70093),t=h(79360),r=h(54829),a=h(82306),g=h(8251),I=h(27103);const O=(0,a.d)(P=>function(L=null){P(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=L});function C(P,T){const{first:L,each:n,with:d=M,scheduler:u=T??E.z,meta:i=null}=(0,e.q)(P)?{first:P}:"number"==typeof P?{each:P}:P;if(null==L&&null==n)throw new TypeError("No timeout provided.");return(0,t.e)((y,p)=>{let m,s,_=null,f=0;const x=w=>{s=(0,I.f)(p,u,()=>{try{m.unsubscribe(),(0,r.Xf)(d({meta:i,lastValue:_,seen:f})).subscribe(p)}catch(Z){p.error(Z)}},w)};m=y.subscribe((0,g.x)(p,w=>{s?.unsubscribe(),f++,p.next(_=w),n>0&&x(n)},void 0,void 0,()=>{s?.closed||s?.unsubscribe(),_=null})),!f&&x(null!=L?"number"==typeof L?L:+L-u.now():n)})}function M(P){throw new O(P)}var b=h(26306),k=h(70108),A=h(65879),B=h(58763),K=h(64190);let G=(()=>{var P;class T{constructor(n,d,u){(0,o.Z)(this,"http",void 0),(0,o.Z)(this,"toastr",void 0),(0,o.Z)(this,"router",void 0),(0,o.Z)(this,"port",window.location.href?.split("localhost:")[1].split("/")[0]),(0,o.Z)(this,"hostURL",i=>k.N.production?i:`https://localhost:${this.port}${i}`),this.http=n,this.toastr=d,this.router=u}PostToUrlEncode(n,d,u=1e5){let i=new c.WM;return i=i.set("Content-Type","application/x-www-form-urlencoded"),new D.y(y=>{this.http.post(this.hostURL(n),d,{headers:i}).pipe(C(u)).subscribe(p=>{y.next(p),y.complete()})})}GetText(n=1e5){let d=localStorage.getItem("Token");const i={responseType:"text",headers:new c.WM({Authorization:"Bearer "+d})};return new D.y(y=>{this.http.get(this.hostURL("/API/Token/GetZendeskJWT"),i).pipe(C(n)).subscribe(p=>{y.next(p),y.complete()})})}POSText(n,d,u=1e5){let i=localStorage.getItem("Token");const p={responseType:"text",headers:new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+i})};return new D.y(m=>{this.http.post(this.hostURL(n),d,p).pipe(C(u)).subscribe(s=>{m.next(s),m.complete()})})}get(n){let d=localStorage.getItem("Token"),u=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});d&&(u=u.append("Authorization","Bearer "+d));let i={headers:u};return this.http.get(this.hostURL(n),i).pipe((0,b.K)(y=>{let p=this.errorMessageHandling(y);this.toastr.error(""!=p.Message?p.Message:"An unknown error has occured!",p.header);let m=(0,l.of)("error",y);return 402==y.status&&(m=(0,v.D)(this.router.navigate(["/menu/Profile/Main/My_Subscription"]))),m}))}post(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y));let m={headers:p};this.http.post(this.hostURL(n),d,m).pipe(C(u)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header,{enableHtml:!0})}i.error(s)}}})})}postFile(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y)),this.http.post(this.hostURL(n),d,{headers:p,observe:"response",responseType:"blob"}).pipe(C(u)).subscribe({next:m=>{i.next({title:m.headers.get("Content-Disposition"),file:m.body}),i.complete()},error:m=>{if(200==m.status)i.next(m.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(m)){let _=this.errorMessageHandling(m);this.toastr.error(""!=_.Message?_.Message:"An unknown error has occured!",_.header,{enableHtml:!0})}i.error(m)}}})})}put(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y));let m={headers:p};this.http.put(this.hostURL(n),d,m).pipe(C(u)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(s)}}})})}delete(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y));let m={headers:p,body:d};this.http.delete(this.hostURL(n),m).pipe(C(u)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(s)}}})})}unauthorizedErrorHandling(n){let d=!1;return(401==n.status||403==n.status)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",d=!0),d}errorMessageHandling(n){let d="API Error",u="Exception Message";return n.error?(d="API Error - "+n.status,451==n.status&&(d="Error"),n.error&&(u=n.error.Message)):n.Message&&(d="API Error - "+n.name,u=n.Message),{header:d,Message:u}}postFormDataWithoutBearer(n,d){return new D.y(u=>{this.http.post(this.hostURL(n),d).pipe(C(1e5)).subscribe({next:i=>{u.next(i),u.complete()},error:i=>{200==i.status&&(u.next(i.error.text),u.complete()),u.error(i)}})})}postFormData(n,d,u=!0){return new D.y(i=>{let y=localStorage.getItem("Token"),m={headers:new c.WM({Authorization:"Bearer "+y})};this.http.post(this.hostURL(n),d,m).pipe(C(1e5)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)&&u){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(s)}}})})}}return P=T,(0,o.Z)(T,"\u0275fac",function(n){return new(n||P)(A.LFG(c.eN),A.LFG(B._W),A.LFG(K.F0))}),(0,o.Z)(T,"\u0275prov",A.Yz7({token:P,factory:P.\u0275fac,providedIn:"root"})),T})()},82430:(R,S,h)=>{h.d(S,{N:()=>c});var o=h(81180),D=h(96354),l=h(86864),v=h(65879);let c=(()=>{var E;class e{constructor(){(0,o.Z)(this,"_roles",void 0),(0,o.Z)(this,"_product",void 0),(0,o.Z)(this,"_contact",void 0),(0,o.Z)(this,"_promotion",void 0),(0,o.Z)(this,"_accounting",void 0),(0,o.Z)(this,"_users",void 0),(0,o.Z)(this,"_outlets",void 0),(0,o.Z)(this,"_setup",void 0),(0,o.Z)(this,"_service",void 0),(0,o.Z)(this,"_profile",void 0),(0,o.Z)(this,"_customerDisplay",void 0),(0,o.Z)(this,"_orderDisplay",void 0),(0,o.Z)(this,"_global",void 0),(0,o.Z)(this,"_apps",void 0),(0,o.Z)(this,"_fulfillment",void 0),(0,o.Z)(this,"_manufacture",void 0),(0,o.Z)(this,"_inventory",void 0),(0,o.Z)(this,"_sell",void 0),(0,o.Z)(this,"_report",void 0),(0,o.Z)(this,"_buy",void 0),(0,o.Z)(this,"_adjustment",void 0),(0,o.Z)(this,"_debt",void 0),(0,o.Z)(this,"_payment",void 0),(0,o.Z)(this,"_prepaidPackage",void 0),(0,o.Z)(this,"_order",void 0),(0,o.Z)(this,"_logistic",void 0),(0,o.Z)(this,"_estimate",void 0),(0,o.Z)(this,"_shift",void 0),this.parseJWTRoles()}parseJWTRoles(){const r=localStorage.getItem("Token");if(l.gT.IsNotEmpty(r)){var a=l.gT.parseJwt(r);this._roles=a["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]}}isInRole(r,a){const g={};return a.forEach((I,O)=>g[r[O]]="string"==typeof I?this._roles.includes(I):I(this._roles)),g}isUserHasRole(r){return this._roles.includes(r)}get product(){return l.gT.IsEmpty(this._product)&&(this._product=this.setBulkRole("product")),this._product}get contact(){return l.gT.IsEmpty(this._contact)&&(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return l.gT.IsEmpty(this._promotion)&&(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return l.gT.IsEmpty(this._accounting)&&(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return l.gT.IsEmpty(this._users)&&(this._users=this.setBulkRole("users")),this._users}get outlets(){return l.gT.IsEmpty(this._outlets)&&(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return l.gT.IsEmpty(this._setup)&&(this._setup=this.setBulkRole("setup")),this._setup}get service(){return l.gT.IsEmpty(this._service)&&(this._service=this.setBulkRole("service")),this._service}get profile(){return l.gT.IsEmpty(this._profile)&&(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return l.gT.IsEmpty(this._customerDisplay)&&(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return l.gT.IsEmpty(this._orderDisplay)&&(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return l.gT.IsEmpty(this._global)&&(this._global=this.setBulkRole("global")),this._global}get apps(){return l.gT.IsEmpty(this._apps)&&(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return l.gT.IsEmpty(this._fulfillment)&&(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return l.gT.IsEmpty(this._manufacture)&&(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return l.gT.IsEmpty(this._inventory)&&(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return l.gT.IsEmpty(this._sell)&&(this._sell=this.setBulkRole("sell")),this._sell}get report(){return l.gT.IsEmpty(this._report)&&(this._report=this.setBulkRole("report")),this._report}get buy(){return l.gT.IsEmpty(this._buy)&&(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return l.gT.IsEmpty(this._adjustment)&&(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return l.gT.IsEmpty(this._debt)&&(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return l.gT.IsEmpty(this._payment)&&(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return l.gT.IsEmpty(this._prepaidPackage)&&(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return l.gT.IsEmpty(this._order)&&(this._order=this.setBulkRole("orders")),this._order}get logistic(){return l.gT.IsEmpty(this._logistic)&&(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return l.gT.IsEmpty(this._estimate)&&(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return l.gT.IsEmpty(this._shift)&&(this._shift=this.setBulkRole("shift")),this._shift}setBulkRole(r){const a={};for(const g in D.G[r])a[g]=this.isUserHasRole(D.G[r][g]);return a}get isSystemUser(){const r=localStorage.getItem("Token");return"System"==l.gT.parseJwt(r).Type}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null}}return E=e,(0,o.Z)(e,"\u0275fac",function(r){return new(r||E)}),(0,o.Z)(e,"\u0275prov",v.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"})),e})()},86864:(R,S,h)=>{h.d(S,{FI:()=>l,gT:()=>D});var o=h(81180);let D=(()=>{class c{static StringFormat(e,...t){for(let r=0;r<t.length;r++)e=e.replace(`{${r}}`,t[r]);return e}static IsNotEmpty(e){return""!=e&&!c.containsOnlySpaces(e)&&e!=c.GuidEmpty&&null!=e&&null!=e}static IsEmpty(e){return!(""!=e&&!c.containsOnlySpaces(e)&&null!=e&&null!=e&&e!=c.GuidEmpty)}static containsOnlySpaces(e){return/^\s*$/.test(e)}static FilterByID(e,t){try{const r=e.filter(a=>a.ID==t);if(r.length>0)return r[0]}catch{}return null}static GenerateYears(e,t,r){let a=-1;(null==t||null==t)&&(t=11),(null==r||null==r||!r)&&(a=1);const g=[];for(let I=0;I<t;I++)g.push(e+I*a);return g}static DateOnly(e){return e?new Date(new Date(e).toDateString()):new Date((new Date).toDateString())}static differentInDays(e,t){let r=t.getTime()-e.getTime();return Math.floor(r/864e5)}static minutesDiff(e,t){let r=(t.getTime()-e.getTime())/6e4;return Math.ceil(r)}static hoursDiff(e,t){let a=(t.getTime()-e.getTime())/36e5;return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var a=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==r?a:3&a|8).toString(16)})}static parseJwt(e){var r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(r).split("").map(function(g){return"%"+("00"+g.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(e){const t=e.which?e.which:e.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(e){let t,r="",a=Math.abs(e);return a>999&&a<1e6?(r="K",t=(a/1e3).toFixed(0)):a>=1e6?(r="M",t=(a/1e6).toFixed(0)):a<900&&(t=a.toString()),e<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+r}static isToDay(e){if(e){const t=new Date;return t.setHours(0,0,0,0),t.getTime()==e.getTime()}}static compare(e,t,r){return(e<t?-1:1)*(r?1:-1)}static generateSerialasNote(e=[]){let t;return e&&e.length>0&&(t=`[${e.map((a,g)=>`${g>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(e,t){const r=new Date(e.getTime()),a=[];for(;r<=t;)a.push(new Date(r)),r.setDate(r.getDate()+1);return a}static getDaysBefore(e,t){return new Date(e.setDate((new Date).getDate()-t))}static getRangeDate(e,t){const r=new Date;return r.setMonth(e),r.setFullYear(t),{firstDay:new Date(r.getFullYear(),r.getMonth()-1,1),lastDay:new Date(r.getFullYear(),r.getMonth(),0)}}static setDateTime(e,t){let r=new Date;t&&(r=new Date(t));let a=e.split(":");return r.setHours(parseInt(a[0])),r.setMinutes(parseInt(a[1])),r}static checkJSApiSupported(e){let t;return t=e in window,t}static cloneObject(e){let t;return t=this.checkJSApiSupported("structuredClone")?structuredClone(e):JSON.parse(JSON.stringify(e)),t}}return(0,o.Z)(c,"GuidEmpty","00000000-0000-0000-0000-000000000000"),(0,o.Z)(c,"DecimalMinValue","-7.922816251426434e+28"),(0,o.Z)(c,"InputLockTimeSpan",500),(0,o.Z)(c,"MinDate","0001-01-01T00:00:00"),(0,o.Z)(c,"MinTime","00:00:00"),(0,o.Z)(c,"tinyMceApiKey","zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa"),(0,o.Z)(c,"Months",[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]),c})();function l(c){return new Promise((E,e)=>{let t=new Image;t.src=c,t.decode().then(()=>{E({img:c,height:t.height,width:t.width})}).catch(()=>{e(new Error(`Image load error for ${c}`))})})}},96354:(R,S,h)=>{h.d(S,{G:()=>o});const o={dashboard:{WeeklySales:"Chart"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Delete:"ShiftD"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Date:"DateE",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Reprint:"OrdRpr",NoteEditor:"OrdNe",Invoice:"Ordlr"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE",PaymentDate:"PayDE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",DateEditor:"BuyDE",ShippingRestriction:"BuySh",Approval:"PurA"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferDateEditor:"DelDE",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[3962],{27874:(R,S,h)=>{h.d(S,{O:()=>G});var o=h(81180),D=h(65592),l=h(22096),v=h(2459),c=h(69862),E=h(16321),e=h(70093),t=h(79360),r=h(54829),a=h(82306),g=h(8251),I=h(27103);const O=(0,a.d)(P=>function(L=null){P(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=L});function C(P,T){const{first:L,each:n,with:d=M,scheduler:u=T??E.z,meta:i=null}=(0,e.q)(P)?{first:P}:"number"==typeof P?{each:P}:P;if(null==L&&null==n)throw new TypeError("No timeout provided.");return(0,t.e)((y,p)=>{let m,s,_=null,f=0;const x=w=>{s=(0,I.f)(p,u,()=>{try{m.unsubscribe(),(0,r.Xf)(d({meta:i,lastValue:_,seen:f})).subscribe(p)}catch(Z){p.error(Z)}},w)};m=y.subscribe((0,g.x)(p,w=>{s?.unsubscribe(),f++,p.next(_=w),n>0&&x(n)},void 0,void 0,()=>{s?.closed||s?.unsubscribe(),_=null})),!f&&x(null!=L?"number"==typeof L?L:+L-u.now():n)})}function M(P){throw new O(P)}var b=h(26306),k=h(70108),A=h(65879),B=h(58763),K=h(64190);let G=(()=>{var P;class T{constructor(n,d,u){(0,o.Z)(this,"http",void 0),(0,o.Z)(this,"toastr",void 0),(0,o.Z)(this,"router",void 0),(0,o.Z)(this,"port",window.location.href.split("localhost:")[1]?.split("/")[0]),(0,o.Z)(this,"hostURL",i=>k.N.production?i:`https://localhost:${this.port}${i}`),this.http=n,this.toastr=d,this.router=u}PostToUrlEncode(n,d,u=1e5){let i=new c.WM;return i=i.set("Content-Type","application/x-www-form-urlencoded"),new D.y(y=>{this.http.post(this.hostURL(n),d,{headers:i}).pipe(C(u)).subscribe(p=>{y.next(p),y.complete()})})}GetText(n=1e5){let d=localStorage.getItem("Token");const i={responseType:"text",headers:new c.WM({Authorization:"Bearer "+d})};return new D.y(y=>{this.http.get(this.hostURL("/API/Token/GetZendeskJWT"),i).pipe(C(n)).subscribe(p=>{y.next(p),y.complete()})})}POSText(n,d,u=1e5){let i=localStorage.getItem("Token");const p={responseType:"text",headers:new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+i})};return new D.y(m=>{this.http.post(this.hostURL(n),d,p).pipe(C(u)).subscribe(s=>{m.next(s),m.complete()})})}get(n){let d=localStorage.getItem("Token"),u=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});d&&(u=u.append("Authorization","Bearer "+d));let i={headers:u};return this.http.get(this.hostURL(n),i).pipe((0,b.K)(y=>{let p=this.errorMessageHandling(y);this.toastr.error(""!=p.Message?p.Message:"An unknown error has occured!",p.header);let m=(0,l.of)("error",y);return 402==y.status&&(m=(0,v.D)(this.router.navigate(["/menu/Profile/Main/My_Subscription"]))),m}))}post(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y));let m={headers:p};this.http.post(this.hostURL(n),d,m).pipe(C(u)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header,{enableHtml:!0})}i.error(s)}}})})}postFile(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y)),this.http.post(this.hostURL(n),d,{headers:p,observe:"response",responseType:"blob"}).pipe(C(u)).subscribe({next:m=>{i.next({title:m.headers.get("Content-Disposition"),file:m.body}),i.complete()},error:m=>{if(200==m.status)i.next(m.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(m)){let _=this.errorMessageHandling(m);this.toastr.error(""!=_.Message?_.Message:"An unknown error has occured!",_.header,{enableHtml:!0})}i.error(m)}}})})}put(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y));let m={headers:p};this.http.put(this.hostURL(n),d,m).pipe(C(u)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(s)}}})})}delete(n,d,u=1e5){return new D.y(i=>{let y=localStorage.getItem("Token"),p=new c.WM({"Content-Type":"application/json","Cache-Control":"no-cache"});y&&(p=p.append("Authorization","Bearer "+y));let m={headers:p,body:d};this.http.delete(this.hostURL(n),m).pipe(C(u)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(s)}}})})}unauthorizedErrorHandling(n){let d=!1;return(401==n.status||403==n.status)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",d=!0),d}errorMessageHandling(n){let d="API Error",u="Exception Message";return n.error?(d="API Error - "+n.status,451==n.status&&(d="Error"),n.error&&(u=n.error.Message)):n.Message&&(d="API Error - "+n.name,u=n.Message),{header:d,Message:u}}postFormDataWithoutBearer(n,d){return new D.y(u=>{this.http.post(this.hostURL(n),d).pipe(C(1e5)).subscribe({next:i=>{u.next(i),u.complete()},error:i=>{200==i.status&&(u.next(i.error.text),u.complete()),u.error(i)}})})}postFormData(n,d,u=!0){return new D.y(i=>{let y=localStorage.getItem("Token"),m={headers:new c.WM({Authorization:"Bearer "+y})};this.http.post(this.hostURL(n),d,m).pipe(C(1e5)).subscribe({next:s=>{i.next(s),i.complete()},error:s=>{if(200==s.status)i.next(s.error.text),i.complete();else{if(!this.unauthorizedErrorHandling(s)&&u){let f=this.errorMessageHandling(s);this.toastr.error(""!=f.Message?f.Message:"An unknown error has occured!",f.header)}i.error(s)}}})})}}return P=T,(0,o.Z)(T,"\u0275fac",function(n){return new(n||P)(A.LFG(c.eN),A.LFG(B._W),A.LFG(K.F0))}),(0,o.Z)(T,"\u0275prov",A.Yz7({token:P,factory:P.\u0275fac,providedIn:"root"})),T})()},82430:(R,S,h)=>{h.d(S,{N:()=>c});var o=h(81180),D=h(96354),l=h(86864),v=h(65879);let c=(()=>{var E;class e{constructor(){(0,o.Z)(this,"_roles",void 0),(0,o.Z)(this,"_product",void 0),(0,o.Z)(this,"_contact",void 0),(0,o.Z)(this,"_promotion",void 0),(0,o.Z)(this,"_accounting",void 0),(0,o.Z)(this,"_users",void 0),(0,o.Z)(this,"_outlets",void 0),(0,o.Z)(this,"_setup",void 0),(0,o.Z)(this,"_service",void 0),(0,o.Z)(this,"_profile",void 0),(0,o.Z)(this,"_customerDisplay",void 0),(0,o.Z)(this,"_orderDisplay",void 0),(0,o.Z)(this,"_global",void 0),(0,o.Z)(this,"_apps",void 0),(0,o.Z)(this,"_fulfillment",void 0),(0,o.Z)(this,"_manufacture",void 0),(0,o.Z)(this,"_inventory",void 0),(0,o.Z)(this,"_sell",void 0),(0,o.Z)(this,"_report",void 0),(0,o.Z)(this,"_buy",void 0),(0,o.Z)(this,"_adjustment",void 0),(0,o.Z)(this,"_debt",void 0),(0,o.Z)(this,"_payment",void 0),(0,o.Z)(this,"_prepaidPackage",void 0),(0,o.Z)(this,"_order",void 0),(0,o.Z)(this,"_logistic",void 0),(0,o.Z)(this,"_estimate",void 0),(0,o.Z)(this,"_shift",void 0),this.parseJWTRoles()}parseJWTRoles(){const r=localStorage.getItem("Token");if(l.gT.IsNotEmpty(r)){var a=l.gT.parseJwt(r);this._roles=a["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]}}isInRole(r,a){const g={};return a.forEach((I,O)=>g[r[O]]="string"==typeof I?this._roles.includes(I):I(this._roles)),g}isUserHasRole(r){return this._roles.includes(r)}get product(){return l.gT.IsEmpty(this._product)&&(this._product=this.setBulkRole("product")),this._product}get contact(){return l.gT.IsEmpty(this._contact)&&(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return l.gT.IsEmpty(this._promotion)&&(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return l.gT.IsEmpty(this._accounting)&&(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return l.gT.IsEmpty(this._users)&&(this._users=this.setBulkRole("users")),this._users}get outlets(){return l.gT.IsEmpty(this._outlets)&&(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return l.gT.IsEmpty(this._setup)&&(this._setup=this.setBulkRole("setup")),this._setup}get service(){return l.gT.IsEmpty(this._service)&&(this._service=this.setBulkRole("service")),this._service}get profile(){return l.gT.IsEmpty(this._profile)&&(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return l.gT.IsEmpty(this._customerDisplay)&&(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return l.gT.IsEmpty(this._orderDisplay)&&(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return l.gT.IsEmpty(this._global)&&(this._global=this.setBulkRole("global")),this._global}get apps(){return l.gT.IsEmpty(this._apps)&&(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return l.gT.IsEmpty(this._fulfillment)&&(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return l.gT.IsEmpty(this._manufacture)&&(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return l.gT.IsEmpty(this._inventory)&&(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return l.gT.IsEmpty(this._sell)&&(this._sell=this.setBulkRole("sell")),this._sell}get report(){return l.gT.IsEmpty(this._report)&&(this._report=this.setBulkRole("report")),this._report}get buy(){return l.gT.IsEmpty(this._buy)&&(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return l.gT.IsEmpty(this._adjustment)&&(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return l.gT.IsEmpty(this._debt)&&(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return l.gT.IsEmpty(this._payment)&&(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return l.gT.IsEmpty(this._prepaidPackage)&&(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return l.gT.IsEmpty(this._order)&&(this._order=this.setBulkRole("orders")),this._order}get logistic(){return l.gT.IsEmpty(this._logistic)&&(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return l.gT.IsEmpty(this._estimate)&&(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return l.gT.IsEmpty(this._shift)&&(this._shift=this.setBulkRole("shift")),this._shift}setBulkRole(r){const a={};for(const g in D.G[r])a[g]=this.isUserHasRole(D.G[r][g]);return a}get isSystemUser(){const r=localStorage.getItem("Token");return"System"==l.gT.parseJwt(r).Type}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null}}return E=e,(0,o.Z)(e,"\u0275fac",function(r){return new(r||E)}),(0,o.Z)(e,"\u0275prov",v.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"})),e})()},86864:(R,S,h)=>{h.d(S,{FI:()=>l,gT:()=>D});var o=h(81180);let D=(()=>{class c{static StringFormat(e,...t){for(let r=0;r<t.length;r++)e=e.replace(`{${r}}`,t[r]);return e}static IsNotEmpty(e){return""!=e&&!c.containsOnlySpaces(e)&&e!=c.GuidEmpty&&null!=e&&null!=e}static IsEmpty(e){return!(""!=e&&!c.containsOnlySpaces(e)&&null!=e&&null!=e&&e!=c.GuidEmpty)}static containsOnlySpaces(e){return/^\s*$/.test(e)}static FilterByID(e,t){try{const r=e.filter(a=>a.ID==t);if(r.length>0)return r[0]}catch{}return null}static GenerateYears(e,t,r){let a=-1;(null==t||null==t)&&(t=11),(null==r||null==r||!r)&&(a=1);const g=[];for(let I=0;I<t;I++)g.push(e+I*a);return g}static DateOnly(e){return e?new Date(new Date(e).toDateString()):new Date((new Date).toDateString())}static differentInDays(e,t){let r=t.getTime()-e.getTime();return Math.floor(r/864e5)}static minutesDiff(e,t){let r=(t.getTime()-e.getTime())/6e4;return Math.ceil(r)}static hoursDiff(e,t){let a=(t.getTime()-e.getTime())/36e5;return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var a=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==r?a:3&a|8).toString(16)})}static parseJwt(e){var r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(r).split("").map(function(g){return"%"+("00"+g.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(e){const t=e.which?e.which:e.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(e){let t,r="",a=Math.abs(e);return a>999&&a<1e6?(r="K",t=(a/1e3).toFixed(0)):a>=1e6?(r="M",t=(a/1e6).toFixed(0)):a<900&&(t=a.toString()),e<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+r}static isToDay(e){if(e){const t=new Date;return t.setHours(0,0,0,0),t.getTime()==e.getTime()}}static compare(e,t,r){return(e<t?-1:1)*(r?1:-1)}static generateSerialasNote(e=[]){let t;return e&&e.length>0&&(t=`[${e.map((a,g)=>`${g>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(e,t){const r=new Date(e.getTime()),a=[];for(;r<=t;)a.push(new Date(r)),r.setDate(r.getDate()+1);return a}static getDaysBefore(e,t){return new Date(e.setDate((new Date).getDate()-t))}static getRangeDate(e,t){const r=new Date;return r.setMonth(e),r.setFullYear(t),{firstDay:new Date(r.getFullYear(),r.getMonth()-1,1),lastDay:new Date(r.getFullYear(),r.getMonth(),0)}}static setDateTime(e,t){let r=new Date;t&&(r=new Date(t));let a=e.split(":");return r.setHours(parseInt(a[0])),r.setMinutes(parseInt(a[1])),r}static checkJSApiSupported(e){let t;return t=e in window,t}static cloneObject(e){let t;return t=this.checkJSApiSupported("structuredClone")?structuredClone(e):JSON.parse(JSON.stringify(e)),t}}return(0,o.Z)(c,"GuidEmpty","00000000-0000-0000-0000-000000000000"),(0,o.Z)(c,"DecimalMinValue","-7.922816251426434e+28"),(0,o.Z)(c,"InputLockTimeSpan",500),(0,o.Z)(c,"MinDate","0001-01-01T00:00:00"),(0,o.Z)(c,"MinTime","00:00:00"),(0,o.Z)(c,"tinyMceApiKey","zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa"),(0,o.Z)(c,"Months",[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]),c})();function l(c){return new Promise((E,e)=>{let t=new Image;t.src=c,t.decode().then(()=>{E({img:c,height:t.height,width:t.width})}).catch(()=>{e(new Error(`Image load error for ${c}`))})})}},96354:(R,S,h)=>{h.d(S,{G:()=>o});const o={dashboard:{WeeklySales:"Chart"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Delete:"ShiftD"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Date:"DateE",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Reprint:"OrdRpr",NoteEditor:"OrdNe",Invoice:"Ordlr"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE",PaymentDate:"PayDE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",DateEditor:"BuyDE",ShippingRestriction:"BuySh",Approval:"PurA"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferDateEditor:"DelDE",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"}}}}]);
|