dealpos 26.35.3 → 26.35.5
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/browser/{chunk-R26AE4FL.js → chunk-2ML5X2VI.js} +1 -1
- package/browser/{chunk-GAE52OL4.js → chunk-2RWEHZFL.js} +1 -1
- package/browser/{chunk-KUFSVV3T.js → chunk-2U25X364.js} +1 -1
- package/browser/{chunk-OLHALLYB.js → chunk-2WZB5OZE.js} +1 -1
- package/browser/{chunk-5NU6DFH2.js → chunk-2XPNV6PV.js} +1 -1
- package/browser/{chunk-BQBLAD37.js → chunk-2ZBSNINZ.js} +1 -1
- package/browser/{chunk-Y3FPIHNW.js → chunk-43ISFENU.js} +1 -1
- package/browser/{chunk-FW62HN5M.js → chunk-46HB2VGC.js} +1 -1
- package/browser/{chunk-BEZASX5E.js → chunk-4UBBOU7F.js} +1 -1
- package/browser/{chunk-WAU2MQXX.js → chunk-4Y7DOHHK.js} +1 -1
- package/browser/{chunk-DOPYLGQR.js → chunk-4ZEALD3K.js} +1 -1
- package/browser/{chunk-D5RGQLLG.js → chunk-523SUMY2.js} +1 -1
- package/browser/{chunk-LB32TCGS.js → chunk-574G3EVP.js} +1 -1
- package/browser/{chunk-RJNQ3H2C.js → chunk-57VMVMBM.js} +1 -1
- package/browser/{chunk-PPVPTLLB.js → chunk-5JZIJM52.js} +1 -1
- package/browser/{chunk-S2E7QHOH.js → chunk-5LAM5TZ3.js} +1 -1
- package/browser/{chunk-L2IQVOWE.js → chunk-5R744NOM.js} +1 -1
- package/browser/{chunk-EBMCUBCM.js → chunk-5VUX3LRN.js} +2 -2
- package/browser/{chunk-3UHL5JB7.js → chunk-6BOWQ2ZQ.js} +1 -1
- package/browser/{chunk-D7RKYQ2R.js → chunk-6DLQQQ2V.js} +1 -1
- package/browser/{chunk-XPARMNQO.js → chunk-6RXPSBHY.js} +1 -1
- package/browser/{chunk-BVQK3YKY.js → chunk-7EXKARVA.js} +1 -1
- package/browser/{chunk-HX4SDVTD.js → chunk-7MJ6KSTO.js} +1 -1
- package/browser/{chunk-DA3PRKG6.js → chunk-7YV2OZOZ.js} +1 -1
- package/browser/{chunk-5WXA3IHU.js → chunk-A3OEVQAY.js} +1 -1
- package/browser/{chunk-XKPGFOVB.js → chunk-AFQ3TG3F.js} +1 -1
- package/browser/{chunk-652FHGZU.js → chunk-ANKE3B7T.js} +1 -1
- package/browser/{chunk-G2VVHVP5.js → chunk-B6MDX5DU.js} +1 -1
- package/browser/{chunk-HLUICT6R.js → chunk-BN2MX2SK.js} +1 -1
- package/browser/{chunk-SKZSFQ5H.js → chunk-BS4NR7OX.js} +1 -1
- package/browser/{chunk-DUXIGGLW.js → chunk-CE2P6ZZV.js} +1 -1
- package/browser/{chunk-CWSDLX3R.js → chunk-CGCESQL7.js} +1 -1
- package/browser/{chunk-IMV56ZMB.js → chunk-CP7V7QAM.js} +1 -1
- package/browser/{chunk-EUEXC26T.js → chunk-CWCGQQML.js} +1 -1
- package/browser/{chunk-FMOKJC4X.js → chunk-CZVVS4RT.js} +1 -1
- package/browser/{chunk-MV2U4RVH.js → chunk-DFFSIQXW.js} +2 -2
- package/browser/{chunk-P6OVYB4Q.js → chunk-DOZP6RFG.js} +1 -1
- package/browser/{chunk-ISNJ3575.js → chunk-DQFU6UHR.js} +1 -1
- package/browser/{chunk-ANBKVO46.js → chunk-DTKUT3T2.js} +1 -1
- package/browser/{chunk-FF7RGMNA.js → chunk-FQVSQLG2.js} +1 -1
- package/browser/{chunk-ADPGZV3S.js → chunk-FRNFWM2F.js} +1 -1
- package/browser/{chunk-GLY53GLW.js → chunk-FT3AILUD.js} +1 -1
- package/browser/{chunk-GEGGQVFW.js → chunk-GCQSV22D.js} +1 -1
- package/browser/{chunk-772RZFFU.js → chunk-GLANON2S.js} +1 -1
- package/browser/{chunk-RKL4QDU6.js → chunk-GN6HGO5Z.js} +1 -1
- package/browser/{chunk-YKGHKOWD.js → chunk-GOISLVCO.js} +1 -1
- package/browser/{chunk-DANHTCJR.js → chunk-GTH62VKB.js} +1 -1
- package/browser/{chunk-M64N2YWY.js → chunk-GXUAFPXA.js} +1 -1
- package/browser/{chunk-JWB5NCZB.js → chunk-H57DHJ7O.js} +1 -1
- package/browser/{chunk-VSRR566V.js → chunk-H7KE4AKI.js} +1 -1
- package/browser/{chunk-HJUEAI4K.js → chunk-HBQTA2PB.js} +1 -1
- package/browser/{chunk-3KPWYDCB.js → chunk-IDQPWPAK.js} +1 -1
- package/browser/{chunk-NW5BSXKX.js → chunk-IMJFRZCA.js} +1 -1
- package/browser/{chunk-KMAYEIHN.js → chunk-INWYX627.js} +1 -1
- package/browser/{chunk-MPLWDHSA.js → chunk-IOEGPRWF.js} +1 -1
- package/browser/{chunk-CYL7FJI3.js → chunk-ITP46IPU.js} +1 -1
- package/browser/{chunk-LKNZ4YVY.js → chunk-J367OW5L.js} +1 -1
- package/browser/{chunk-VCETBTWY.js → chunk-J3YMM5BC.js} +2 -2
- package/browser/{chunk-LYFEIS26.js → chunk-J7XRHE2I.js} +1 -1
- package/browser/{chunk-B6JM5GWO.js → chunk-JAAP2L6H.js} +1 -1
- package/browser/{chunk-37PEIIPQ.js → chunk-KAUO4Z5E.js} +1 -1
- package/browser/{chunk-XQKW6SOF.js → chunk-KV6W4UUD.js} +1 -1
- package/browser/{chunk-GGUUUDTS.js → chunk-KVBJ62JS.js} +1 -1
- package/browser/{chunk-7OI5RMRQ.js → chunk-KWAWJ5U5.js} +1 -1
- package/browser/{chunk-KEFQ5WEV.js → chunk-LAMBBA6N.js} +1 -1
- package/browser/{chunk-FV5YNSIF.js → chunk-LZH7WM3V.js} +1 -1
- package/browser/{chunk-Z43IOKNM.js → chunk-MKDOBOQF.js} +1 -1
- package/browser/{chunk-FZWP3AJF.js → chunk-NIIAACMZ.js} +1 -1
- package/browser/{chunk-KJB4REXC.js → chunk-NTXMZ2GI.js} +1 -1
- package/browser/{chunk-NJJJ7TDR.js → chunk-NVUSFU2I.js} +1 -1
- package/browser/{chunk-DL3P5S7F.js → chunk-O3GCE6XU.js} +1 -1
- package/browser/{chunk-BATY44C7.js → chunk-OCZLWVPD.js} +1 -1
- package/browser/{chunk-QX7VNW3M.js → chunk-OD7KPLTC.js} +1 -1
- package/browser/{chunk-K6SH6T2R.js → chunk-OEGRE6LB.js} +2 -2
- package/browser/{chunk-UBZKNPO2.js → chunk-OEMW4XCM.js} +1 -1
- package/browser/{chunk-YHPFTHIM.js → chunk-OI4C5KX3.js} +1 -1
- package/browser/{chunk-SF4MAEVI.js → chunk-OTE76XQA.js} +1 -1
- package/browser/{chunk-J7WBI3MO.js → chunk-OXFU36XG.js} +1 -1
- package/browser/{chunk-BZXVEH3H.js → chunk-PBG7Z3DO.js} +1 -1
- package/browser/{chunk-5QOWA5DY.js → chunk-PBXS2AJ5.js} +1 -1
- package/browser/{chunk-F4HIFXDQ.js → chunk-PCKUGRGD.js} +1 -1
- package/browser/{chunk-NHLOY5HM.js → chunk-POCLRFEU.js} +1 -1
- package/browser/{chunk-MHVWXRKI.js → chunk-QIS3NHZ3.js} +1 -1
- package/browser/{chunk-F6G2RFJI.js → chunk-QQ6PNGAO.js} +1 -1
- package/browser/{chunk-JGIYPPLH.js → chunk-QVUQDQKV.js} +1 -1
- package/browser/{chunk-J7YDT2UT.js → chunk-R5ISAC5Y.js} +1 -1
- package/browser/{chunk-JLOSS3ZV.js → chunk-RLM365FR.js} +1 -1
- package/browser/{chunk-HJUPLNRN.js → chunk-RXC57NHJ.js} +1 -1
- package/browser/{chunk-GIRXDE2Y.js → chunk-SO7JVY4O.js} +2 -2
- package/browser/{chunk-RMJAYVCG.js → chunk-T5DNNGBY.js} +1 -1
- package/browser/{chunk-Q5YQB5U2.js → chunk-T5SQEVJ2.js} +1 -1
- package/browser/{chunk-6HLUJ5XL.js → chunk-TCZEDKTY.js} +2 -2
- package/browser/{chunk-TOX3AIH3.js → chunk-TFFYRZMM.js} +1 -1
- package/browser/{chunk-OGQZQOPB.js → chunk-TM7Z6C6B.js} +1 -1
- package/browser/{chunk-BWKHV2TW.js → chunk-TPDW3AZI.js} +1 -1
- package/browser/{chunk-YSHDMJVG.js → chunk-UKGGWEMJ.js} +2 -2
- package/browser/{chunk-IGOAJOSO.js → chunk-UR72GCEK.js} +1 -1
- package/browser/{chunk-BHKKEP6W.js → chunk-UZ4O4CJ2.js} +2 -2
- package/browser/{chunk-6B3KCZS5.js → chunk-VG47CORU.js} +1 -1
- package/browser/{chunk-IZEHIC4A.js → chunk-VMRXDZVD.js} +1 -1
- package/browser/{chunk-HNQOD5PN.js → chunk-VMXMOHJC.js} +1 -1
- package/browser/{chunk-PYZZCJ45.js → chunk-WA3IGWHP.js} +1 -1
- package/browser/{chunk-2VDA5E4T.js → chunk-WC7FO2ZL.js} +1 -1
- package/browser/{chunk-JR76DZCG.js → chunk-WEA46SRA.js} +1 -1
- package/browser/{chunk-JRPNIZTA.js → chunk-WEYBPKML.js} +1 -1
- package/browser/{chunk-YVAYU5JZ.js → chunk-WSUCKM5I.js} +1 -1
- package/browser/{chunk-FY6HV2DI.js → chunk-WYDZURD3.js} +1 -1
- package/browser/{chunk-DFHH2RAJ.js → chunk-X33OZNUN.js} +1 -1
- package/browser/{chunk-NIZTJQTF.js → chunk-X3ABJU3C.js} +1 -1
- package/browser/{chunk-LAKIWAKM.js → chunk-YL5WFH7U.js} +1 -1
- package/browser/{chunk-JZR2426U.js → chunk-ZZIYKFC7.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-M4CUGUEO.js → main-EHOV42MD.js} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-Z4JMRDJD.js";import{a as h}from"./chunk-EVOMMNG4.js";import{a as c}from"./chunk-KXQJYBG5.js";import{a as m}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-Z4JMRDJD.js";import{a as h}from"./chunk-EVOMMNG4.js";import{a as c}from"./chunk-KXQJYBG5.js";import{a as m}from"./chunk-KAUO4Z5E.js";import{n as u,q as d}from"./chunk-ETYXTCKV.js";import{ja as l,na as o}from"./chunk-DUSKF5IQ.js";import{j as p}from"./chunk-NF7PG5F2.js";var b=class n{toastr=o(u);httpService=o(d);copyToClipBoard=o(g);createCustomerFromNewNumberAndSendReceipt(e,r,t,i,a){t==0?this.httpService.post(h.CreateCustomerInvoice,{InvoiceID:i.ObjectID,Mobile:e}).subscribe(s=>p(this,null,function*(){this.toastr.success(s.Message,c.Success),yield this.sendReceiptToWhatsapp(e,i,r,a)})):this.toastr.info("WABA is not supported yet",c.Info)}createWhatsappReceipt(e,r,t){let i=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],a=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:y,InvoiceNumber:f}=e,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:i(y),Brand:a,Currency:r,Number:f,ReceiptLink:w},t)}convertWhatsappTemplateMessage(e,r){let t=r||m?.whatsappTemplateMessage,i=["Brand","Number","Currency","Amount","ReceiptLink"],a=t;return i.forEach(s=>a=a.replace(`{${s}}`,e[s])),a}redirectToWhatsapp(e,r){let t=e;t=t[0]==="0"?`62${t.slice(1)}`:t;let i=`whatsapp://send?phone=${t}&text=${encodeURIComponent(r)}`;window.location.href=i,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let e=!1;window.onblur=function(){e=!0},setTimeout(()=>{e||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
|
|
2
2
|
`,"WhatsApp not installed")},2e3)}copyToClipboard(e){return new Promise((r,t)=>this.copyToClipBoard.copy(e).then(()=>{this.toastr.info("Message copied to clipboard. If WhatsApp doesn't show the message, please paste it manually.","Receipt Ready",{timeOut:8e3}),r("Copied to clipboard")}).catch(i=>{console.log(i),this.toastr.warning("Could not copy message to clipboard","Clipboard Error",{timeOut:8e3}),t(i)}))}sendReceiptToWhatsapp(e,r,t,i){return p(this,null,function*(){try{let a=this.createWhatsappReceipt(r,t,i);try{yield this.copyToClipboard(a)}finally{this.redirectToWhatsapp(e,a)}}catch(a){console.warn(a),this.toastr.error("Failed to send receipt")}})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=l({token:n,factory:n.\u0275fac})};export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-CEUTLASG.js";import{d as S}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-CEUTLASG.js";import{d as S}from"./chunk-J7XRHE2I.js";import{a as I,b as F}from"./chunk-LCBHD53Y.js";import{c as D}from"./chunk-KXQJYBG5.js";import{G as x,c as R,e as m,h as T,m as b,t as M}from"./chunk-4XQKDYF2.js";import{Db as d,Eb as n,Fb as i,Gb as c,Sb as h,Ua as r,db as v,hc as o,ic as C,id as y,na as f,vd as _,wb as u,yb as p,yc as g}from"./chunk-DUSKF5IQ.js";var E=class{};var k=t=>({"is-invalid":t});function W(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Host URL is required."),i()())}function U(t,l){t&1&&(n(0,"span",9),o(1,"Enter the port or device URL used by your middleware."),i())}function O(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Buffer Time must be at least 100 ms."),i()())}function P(t,l){t&1&&(n(0,"span",9),o(1,"Enter the buffer time in milliseconds for your RFID device."),i())}var N=class t{dialogRef=f(I);data=f(F);config=new S;urlCtrl=new b(this.data?.url,[m.required]);bufferTimeCtrl=new b(this.data?.bufferTime??100,[m.required,m.min(100)]);isConnected=this.data?.isConnected;constructor(){this.initModalConfig()}initModalConfig(){this.config.title="Connect RFID",this.config.customWidth="450px",this.config.hideCancel=!0,this.config.okText=this.isConnected?"Disconnect":"Connect Now"}onClose(){this.dialogRef.close()}onConnect(){this.isConnected?this.dialogRef.close({disconnect:!0}):this.urlCtrl.valid&&this.bufferTimeCtrl.valid&&this.dialogRef.close({url:this.urlCtrl.value,bufferTime:this.bufferTimeCtrl.value})}get modalContentWording(){let l="RFID Connected",a="Your RFID device is successfully connected.",e="RFID Not Connected",s="Please connect your RFID device to process items",A=this.isConnected?l:e,L=this.isConnected?a:s;return{title:A,description:L}}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=v({type:t,selectors:[["app-modal-connect-rfid"]],decls:20,vars:15,consts:[[3,"onCancel","onClose","onOk","config","dynamicValidated"],[1,"d-flex","flex-column",2,"row-gap","1.5rem"],[1,"text-center","d-flex","flex-column","align-items-center",2,"row-gap","0.8rem"],[1,"fa-solid","fa-wifi","fa-3x","d-flex","align-items-center","justify-content-center","bg-light",2,"border-radius","50%","width","80px","height","80px",3,"ngClass"],[1,"fw-normal"],[1,"card","d-flex","justify-content-center","p-8","bg-light-gray",2,"border-radius","12px","margin","0"],["for","floatingInput",1,"fw-semibold","mb-2"],["id","floatingInput","placeholder","Host URL","type","text",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"],[1,"invalid-feedback","mt-4"],[1,"text-muted","mt-2"],["for","floatingInput",1,"fw-semibold","mb-2","mt-4"],["id","floatingInput","placeholder","Buffer Time (ms)","type","text","autoNum","",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"]],template:function(a,e){a&1&&(n(0,"modal-material",0),h("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()})("onOk",function(){return e.onConnect()}),n(1,"content")(2,"div",1)(3,"div",2),c(4,"i",3),n(5,"h2"),o(6),i(),n(7,"span",4),o(8),i()(),n(9,"div",5)(10,"label",6),o(11,"Port / URL"),i(),c(12,"input",7),u(13,W,3,0,"div",8)(14,U,2,0,"span",9),n(15,"label",10),o(16,"Buffer Time"),i(),c(17,"input",11),u(18,O,3,0,"div",8)(19,P,2,0,"span",9),i()()()()),a&2&&(d("config",e.config)("dynamicValidated",e.urlCtrl.valid),r(4),d("ngClass",e.isConnected?"text-success":"text-danger"),r(2),C(e.modalContentWording.title),r(2),C(e.modalContentWording.description),r(4),d("ngClass",g(11,k,e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)))("formControl",e.urlCtrl),r(),p(e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)?13:14),r(4),d("ngClass",g(13,k,e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)))("formControl",e.bufferTimeCtrl),r(),p(e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)?18:19))},dependencies:[_,y,x,R,T,M,D,w],encapsulation:2})};export{E as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./chunk-
|
|
1
|
+
import{c as u}from"./chunk-MKDOBOQF.js";import{b as s}from"./chunk-NGHVR4SE.js";import{Pd as a,na as e}from"./chunk-DUSKF5IQ.js";var g=(t,c)=>{let r=e(a),i=e(u);if(i.isTokenExpired())return i.returnUrl=c.url,r.navigate(["/"]),!1;let d=e(s),o=t.data?.roles;if(o){let n=t.data?.unauthorizedRedirect;if(!o.some(l=>d.isUserHasRole(l)))return n?r.navigate([n]):r.navigate(["menu/Unauthorized/Main/Unauthorized"]),!1}return!0};export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-NQX7EX5A.js";import{a as se}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-NQX7EX5A.js";import{a as se}from"./chunk-J367OW5L.js";import{a as ae,c as re,e as oe,f as le,g as de}from"./chunk-YKOGSGA3.js";import{b as te}from"./chunk-6XNSSWFM.js";import{a as ie}from"./chunk-CEUTLASG.js";import{g as ee}from"./chunk-DXN47M53.js";import{N as ne}from"./chunk-LYWYOHRE.js";import{d as k}from"./chunk-QHP5XZP6.js";import{a as Z}from"./chunk-KXQJYBG5.js";import{F as Y,c as J,h as U,p as X}from"./chunk-4XQKDYF2.js";import{a as q}from"./chunk-PPTZHIIZ.js";import{n as z}from"./chunk-ETYXTCKV.js";import{$a as I,Ab as w,Ba as f,Bb as M,Cb as V,Da as v,Db as S,Eb as r,Fb as d,Fc as T,Gb as b,Gc as $,Hc as A,Pb as C,Sb as h,Tc as y,Ua as l,Ub as s,X as R,Xc as P,cc as g,da as Q,db as H,eb as L,hc as p,ic as W,jc as x,ka as B,mc as E,nc as D,oc as N,od as j,qd as K,r as F,ra as m,sa as c,vd as G,wb as u,yb as _}from"./chunk-DUSKF5IQ.js";function ue(n,t){n&1&&(r(0,"div",3)(1,"div",6),p(2,"Edit Serial is disabled during EDIT MODE"),d(),r(3,"div"),p(4," If you make a mistake, please delete the item and then add again "),d()())}function _e(n,t){if(n&1){let e=C();r(0,"mat-chip-row",17),h("removed",function(){let a=m(e).$implicit,o=s(3);return c(o.onRemoveSerialChip(a))}),p(1),r(2,"button",18),b(3,"i",19),d()()}if(n&2){let e=t.$implicit;l(),x(" ",e," ")}}function he(n,t){if(n&1){let e=C();r(0,"div",8)(1,"div",10)(2,"mat-form-field",11),h("keyup.enter",function(a){return a.stopPropagation()}),r(3,"mat-chip-grid",null,0),M(5,_e,4,1,"mat-chip-row",null,w),r(7,"input",12,1),h("matChipInputTokenEnd",function(a){m(e);let o=g(8),pe=s(2);return c(pe.addSerial(a,o))}),d()()()(),r(9,"div",13)(10,"button",14),h("click",function(){m(e);let a=g(8),o=s(2);return c(o.submitSerial(a))}),b(11,"i",15),r(12,"strong",16),p(13,"ADD"),d()()()()}if(n&2){let e=g(4),i=s(2);l(5),V(i.serialsValue()),l(2),S("placeholder",i.isBatchNumber()?"E.g. Batch1 Batch2":"E.g. Serial1 Serial2")("matChipInputFor",e)("matChipInputSeparatorKeyCodes",i.separatorKeysCodes)}}function Ce(n,t){if(n&1){let e=C();r(0,"ng-select",20),T(1,"async"),N("ngModelChange",function(a){m(e);let o=s(2);return D(o.serialsValue,a)||(o.serialsValue=a),c(a)}),h("remove",function(a){m(e);let o=s(2);return c(o.onRemoveSerialFromOption(a.value))})("change",function(a){m(e);let o=s(2);return c(o.onSelectSerial(a))}),d()}if(n&2){let e=s(2);S("items",$(1,3,e.serials$)),E("ngModel",e.serialsValue),S("multiple",!0)}}function fe(n,t){if(n&1&&(r(0,"div",4)(1,"div",7),u(2,he,14,3,"div",8)(3,Ce,2,5,"ng-select",9),d()()),n&2){let e=s();l(2),_(e.isReturn()?2:3)}}function Se(n,t){n&1&&b(0,"th",23)}function be(n,t){n&1&&(r(0,"th",25),p(1,"Expiry Date"),d())}function ge(n,t){if(n&1){let e=C();r(0,"td",27)(1,"i",29),h("click",function(){m(e);let a=s().$index,o=s(2);return c(o.onRemoveSerial(a))}),d()()}}function xe(n,t){if(n&1&&(r(0,"td"),p(1),T(2,"date"),d()),n&2){let e=s().$implicit;l(),x(" ",e.ExpiryDate?A(2,1,e.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function ye(n,t){if(n&1){let e=C();r(0,"tr"),u(1,ge,2,0,"td",27),r(2,"td"),p(3),d(),u(4,xe,3,4,"td"),r(5,"td")(6,"input",28),N("ngModelChange",function(a){let o=m(e).$implicit;return D(o.Quantity,a)||(o.Quantity=a),c(a)}),h("change",function(){m(e);let a=s(2);return c(a.onChangeQty())}),d()()()}if(n&2){let e=t.$implicit,i=s(2);l(),_(i.disabled()?-1:1),l(2),W(e.Number),l(),_(i.showExpiryDate()?4:-1),l(2),E("ngModel",e.Quantity),S("disabled",i.disabled()||!i.isBatchNumber())("decimalPlaces",0)}}function ve(n,t){if(n&1&&(r(0,"div",5)(1,"div",7)(2,"table",21)(3,"thead",22)(4,"tr"),u(5,Se,1,0,"th",23),r(6,"th",24),p(7),d(),u(8,be,2,0,"th",25),r(9,"th",26),p(10,"Quantity"),d()()(),r(11,"tbody"),M(12,ye,7,6,"tr",null,w),d()()()()),n&2){let e=s();l(5),_(e.disabled()?-1:5),l(2),x(" ",e.isBatchNumber()?"Batch":"Serial"," Number "),l(),_(e.showExpiryDate()?8:-1),l(4),V(e.selectedSerial())}}var me=class n{constructor(t,e){this.productService=t;this.toastr=e;v(()=>{this.serialsValue.set(this.serials())}),v(()=>{let i=this.cartItem();i&&(this.initSelectedSerial(),i.Quantity<0?this.isReturn.set(!0):this.getSerialVariant())})}productService;toastr;separatorKeysCodes=[13,188];isReturn=f(!1);disabled=y(!1);cartItem=P(null);isBatchNumber=y(!1);entityId=y("");serials=P([]);serialsValue=f([]);selectedSerial=f([]);showExpiryDate=f(!1);serials$;ngOnDestroy(){this.serials.set([])}initSelectedSerial(){let t=this.cartItem().Serial;t&&t.length>0&&(this.selectedSerial.set(t),this.checkShowExpiryDate())}getSerialVariant(){let t=this.cartItem().VariantID,e;this.serials$=this.productService.getVariantSerial(this.entityId(),t).pipe(F(i=>i.map(a=>(e=new O,e.Number=a.Number,e.Quantity=a.Quantity?a.Quantity:1,e.ExpiryDate=a.ExpiryDate,e))),Q(()=>{this.isReturn()||this.serialsValue.set(this.generateSerialCode(this.selectedSerial()))}),R())}generateSerialCode(t=[]){return t.map(e=>e.Number)}onSelectSerial(t){let e=t.filter(i=>this.selectedSerial().findIndex(a=>a.Number==i.Number)==-1);e.length>0&&(e[0].Quantity=1,this.selectedSerial.set([...this.selectedSerial(),...e]),this.updateCartItem())}onRemoveSerial(t){this.selectedSerial.set(this.selectedSerial().filter((e,i)=>i!==t)),this.serialsValue.set(this.generateSerialCode(this.selectedSerial())),this.updateCartItem()}onRemoveSerialChip(t){this.serialsValue.update(e=>e.filter(i=>i!==t)),this.serials.set(this.serialsValue())}onRemoveSerialFromOption(t){this.selectedSerial.set(this.selectedSerial().filter(e=>e.Number!==t.Number)),this.serialsValue.set(this.generateSerialCode(this.selectedSerial()))}onChangeQty(){this.updateCartItem()}submitSerial(t){t.value.trim()&&(this.serialsValue.update(i=>[...i,t.value.trim()]),t.value="");let e=this.generateSerialData();this.selectedSerial.update(i=>[...i,...e]),this.serialsValue.set([]),this.updateCartItem()}generateSerialData(){return this.serialsValue().filter(e=>this.selectedSerial().findIndex(i=>i.Number==e)==-1).map(e=>{let i=new O;return i.Number=e,i.Quantity=this.isReturn()?-1:1,i.ExpiryDate="",i})}addSerial(t,e){let i=(t.value||"").trim();if(i)if(this.serialsValue().find(a=>a==i)){e.value="",this.toastr.info("Serial already exists",Z.Info);return}else this.serialsValue.update(a=>[...a,i]),this.serials.set(this.serialsValue());t.chipInput.clear()}updateCartItem(){let t=this.calculateSerialQty();this.checkShowExpiryDate(),this.cartItem.update(e=>(e.Serial=this.selectedSerial(),e.Quantity=t,e))}calculateSerialQty(){let t=0;return this.selectedSerial().forEach(e=>{t+=e.Quantity}),t}checkShowExpiryDate(){let t=0;this.selectedSerial().forEach(e=>{q.IsNotEmpty(e.ExpiryDate)&&(t+=1)}),this.showExpiryDate.set(t>0)}static \u0275fac=function(e){return new(e||n)(I(se),I(z))};static \u0275cmp=H({type:n,selectors:[["app-item-serial"]],inputs:{disabled:[1,"disabled"],cartItem:[1,"cartItem"],isBatchNumber:[1,"isBatchNumber"],entityId:[1,"entityId"],serials:[1,"serials"]},outputs:{cartItem:"cartItemChange",serials:"serialsChange"},standalone:!1,decls:4,vars:3,consts:[["chipGrid",""],["inputChip",""],[1,"my-8"],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"row"],[1,"row","mt-8"],[1,"fw-bold"],[1,"col-12"],[1,"input-group"],["bindLabel","Number","appendTo","body","bindValue","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"items","ngModel","multiple"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"matChipInputTokenEnd","placeholder","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["bindLabel","Number","appendTo","body","bindValue","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","remove","change","items","ngModel","multiple"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end",2,"width","40px"],[1,"border-end"],[1,"border-end",2,"width","100px"],[1,"border-end","text-end",2,"width","60px"],[1,"text-center"],["type","text","placeholder","Serial Quantity","autoNum","",1,"form-control","text-end",3,"ngModelChange","change","ngModel","disabled","decimalPlaces"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,i){e&1&&(r(0,"div",2),u(1,ue,5,0,"div",3),u(2,fe,4,1,"div",4),u(3,ve,14,3,"div",5),d()),e&2&&(l(),_(i.disabled()?1:-1),l(),_(i.disabled()?-1:2),l(),_(i.selectedSerial().length>0?3:-1))},dependencies:()=>[k,J,U,X,ie,oe,le,ae,re,ee,j,K],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"],changeDetection:0})},ce=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=L({type:n});static \u0275inj=B({imports:[G,ne,k,Y,de,te]})};export{me as a,ce as b};
|