dealpos 26.29.0 → 26.29.2
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-BYYKQ7BF.js → chunk-23G4CQ4S.js} +1 -1
- package/browser/{chunk-UOEXD6RH.js → chunk-2EVYKVUT.js} +1 -1
- package/browser/{chunk-WO5G5QTK.js → chunk-2OQPRQAF.js} +1 -1
- package/browser/{chunk-CLRYNCZU.js → chunk-3LUCZIFK.js} +1 -1
- package/browser/{chunk-CHD34TKF.js → chunk-3RNFVRR4.js} +1 -1
- package/browser/{chunk-OI5A5FPF.js → chunk-4EEMSRFZ.js} +1 -1
- package/browser/{chunk-ZR4DCP36.js → chunk-4LLGXBQM.js} +1 -1
- package/browser/{chunk-JKNNCECG.js → chunk-4MFN6GSJ.js} +1 -1
- package/browser/{chunk-7HMV3SZT.js → chunk-4TSFDXIQ.js} +1 -1
- package/browser/{chunk-F5KWDSBM.js → chunk-5MKVQFXP.js} +1 -1
- package/browser/{chunk-EF4OCM2Q.js → chunk-5SUCEZKZ.js} +2 -2
- package/browser/{chunk-PLIVBQ3I.js → chunk-6BIYZUYK.js} +1 -1
- package/browser/{chunk-KGAHOWYY.js → chunk-7VP7BETO.js} +2 -2
- package/browser/{chunk-V77V33IW.js → chunk-A2D4ZWEL.js} +1 -1
- package/browser/{chunk-ZEL6LDFP.js → chunk-A3TCEOIL.js} +1 -1
- package/browser/{chunk-JCAJMPTM.js → chunk-ADHRI2ZG.js} +1 -1
- package/browser/{chunk-AICFSS27.js → chunk-AEKYGTST.js} +1 -1
- package/browser/{chunk-GU6QOUOS.js → chunk-AILQAY4R.js} +1 -1
- package/browser/{chunk-IJNWXA2P.js → chunk-AZDEVCKO.js} +1 -1
- package/browser/{chunk-MEKFJMMV.js → chunk-BLR56WTI.js} +1 -1
- package/browser/{chunk-4UP5LZ4G.js → chunk-C6OS7OH3.js} +2 -2
- package/browser/{chunk-K53SA3EB.js → chunk-CDMOG6NO.js} +1 -1
- package/browser/{chunk-NNI3OY54.js → chunk-CM2W4OGX.js} +1 -1
- package/browser/{chunk-MG2UEXKO.js → chunk-CNLLDX33.js} +1 -1
- package/browser/{chunk-KAP7DOGI.js → chunk-DBROGHP5.js} +1 -1
- package/browser/{chunk-7JHW2G3R.js → chunk-DKU772CO.js} +3 -3
- package/browser/{chunk-LKYPWMW6.js → chunk-DKXEKVNL.js} +1 -1
- package/browser/{chunk-O3DPQKXE.js → chunk-DVO26XPI.js} +1 -1
- package/browser/{chunk-XSJ7O6AL.js → chunk-DXTSUCRV.js} +1 -1
- package/browser/{chunk-ER5SSJRT.js → chunk-DZ3JSWN4.js} +1 -1
- package/browser/{chunk-OCAK2BKX.js → chunk-E2C2JWUR.js} +1 -1
- package/browser/{chunk-X62QOPNE.js → chunk-E5HCPAGT.js} +1 -1
- package/browser/{chunk-KPJCBC76.js → chunk-EYNEGQWW.js} +1 -1
- package/browser/{chunk-SKU7SZ24.js → chunk-F4BGBE5F.js} +1 -1
- package/browser/{chunk-HFZTYHMU.js → chunk-FD5DZ33A.js} +1 -1
- package/browser/{chunk-MGUT5T7F.js → chunk-FI4ADJ7Y.js} +1 -1
- package/browser/{chunk-X2VG2CB2.js → chunk-FY3XQZM2.js} +1 -1
- package/browser/chunk-H3D4WR27.js +1 -0
- package/browser/{chunk-7LMWGFXC.js → chunk-H5DKJDHK.js} +1 -1
- package/browser/{chunk-X5IY5TJL.js → chunk-HDG6JFA7.js} +1 -1
- package/browser/{chunk-WR42O22B.js → chunk-HO7UAM4U.js} +1 -1
- package/browser/{chunk-6LQCSV6L.js → chunk-HTDYDLGC.js} +2 -2
- package/browser/{chunk-YEZBXNUW.js → chunk-IPKD2YEV.js} +1 -1
- package/browser/{chunk-HEB7VZBF.js → chunk-IZNNDLYJ.js} +1 -1
- package/browser/{chunk-JRP2MAJ5.js → chunk-J4CDE4OB.js} +1 -1
- package/browser/{chunk-RZTYJNVQ.js → chunk-JBLCOCWI.js} +1 -1
- package/browser/{chunk-RETX74MU.js → chunk-JDTA6VVS.js} +1 -1
- package/browser/{chunk-CCEBO27U.js → chunk-K6I3CJMZ.js} +1 -1
- package/browser/{chunk-WC3R4D5I.js → chunk-KLAUS4QD.js} +1 -1
- package/browser/{chunk-5VT4ND6E.js → chunk-KM4ASOAJ.js} +1 -1
- package/browser/{chunk-6WAQEEKN.js → chunk-KT23O5RI.js} +1 -1
- package/browser/{chunk-MT5X55RJ.js → chunk-KZ7JAEYC.js} +1 -1
- package/browser/{chunk-XQUJF64B.js → chunk-LRZNBFRR.js} +1 -1
- package/browser/{chunk-PLVE3NEM.js → chunk-LT46RQOD.js} +1 -1
- package/browser/{chunk-DSQTKX2P.js → chunk-LYSCU4VY.js} +9 -9
- package/browser/{chunk-OGETAMTF.js → chunk-MCHMU65O.js} +1 -1
- package/browser/{chunk-FP7J4J25.js → chunk-MGG6P7ZA.js} +1 -1
- package/browser/{chunk-AD6JYWKL.js → chunk-MH5R4QUS.js} +1 -1
- package/browser/{chunk-RUIK63CG.js → chunk-MLSXLYHC.js} +1 -1
- package/browser/{chunk-7O6BIGLD.js → chunk-MSHOFBI6.js} +1 -1
- package/browser/{chunk-JL3MXOMA.js → chunk-MSU6IA4E.js} +1 -1
- package/browser/{chunk-QP2RMM3P.js → chunk-N377QT4B.js} +1 -1
- package/browser/{chunk-QVTG7DFS.js → chunk-N6XTKEYC.js} +1 -1
- package/browser/{chunk-TPRBNEOO.js → chunk-NKKAUCIR.js} +1 -1
- package/browser/{chunk-57VOJINA.js → chunk-NPZA63IX.js} +1 -1
- package/browser/{chunk-QJMWJFIO.js → chunk-NWREVTKW.js} +1 -1
- package/browser/{chunk-KKLYL5AR.js → chunk-O2LNYZN3.js} +1 -1
- package/browser/{chunk-PGKQKX5L.js → chunk-OEAMQ7FV.js} +1 -1
- package/browser/{chunk-7ZS2RHZX.js → chunk-P4QH3MVJ.js} +1 -1
- package/browser/{chunk-5XD7BTSW.js → chunk-PAM7CZIW.js} +1 -1
- package/browser/{chunk-SNVC7JJN.js → chunk-PFYWJTG4.js} +1 -1
- package/browser/{chunk-UDBEADSH.js → chunk-PH237GPH.js} +1 -1
- package/browser/{chunk-4JIY32J6.js → chunk-PNU45TI5.js} +1 -1
- package/browser/{chunk-NEYMT47R.js → chunk-POPTNOXV.js} +1 -1
- package/browser/{chunk-FKFEEUUB.js → chunk-PVTBU2DG.js} +1 -1
- package/browser/{chunk-PXGRIARW.js → chunk-Q3HNCCYY.js} +1 -1
- package/browser/{chunk-JIKGFLI2.js → chunk-QFOKSRM2.js} +1 -1
- package/browser/{chunk-W4MMVJP2.js → chunk-QKU2DV3E.js} +1 -1
- package/browser/{chunk-VBVTZAUJ.js → chunk-QNZPOT7X.js} +1 -1
- package/browser/{chunk-M6UA5XCH.js → chunk-QOEUUHI6.js} +1 -1
- package/browser/{chunk-2JSCPTVV.js → chunk-QVPRUUOY.js} +1 -1
- package/browser/{chunk-VAWIHXUK.js → chunk-R4M6V4LG.js} +1 -1
- package/browser/{chunk-WRQEPURO.js → chunk-RB6PG44M.js} +1 -1
- package/browser/{chunk-AASERCK5.js → chunk-RJXJJN3P.js} +1 -1
- package/browser/{chunk-WABT6X6A.js → chunk-S4263DWI.js} +1 -1
- package/browser/{chunk-AY6A5FHB.js → chunk-SLRSIKY4.js} +1 -1
- package/browser/{chunk-2XUIPQWV.js → chunk-SRBRN6I6.js} +1 -1
- package/browser/{chunk-EAVORB6E.js → chunk-T66PW3DE.js} +1 -1
- package/browser/{chunk-LGIEY5YR.js → chunk-TDFVWBPV.js} +1 -1
- package/browser/{chunk-5B7N3GIB.js → chunk-TSY3QHHI.js} +1 -1
- package/browser/{chunk-C5VTERF7.js → chunk-U2BWKCOY.js} +1 -1
- package/browser/{chunk-TKT6G6W2.js → chunk-UJTFRKD6.js} +1 -1
- package/browser/{chunk-WYTYJT5P.js → chunk-V2KRNWEI.js} +1 -1
- package/browser/{chunk-K6QQQL7U.js → chunk-V6I4U3FF.js} +1 -1
- package/browser/{chunk-GGG2SHFO.js → chunk-VNY4S6S5.js} +1 -1
- package/browser/{chunk-4X4MZNNS.js → chunk-W6JC5Y5Z.js} +1 -1
- package/browser/{chunk-PF36SSBX.js → chunk-WNL7MHHR.js} +1 -1
- package/browser/{chunk-35T6VKZX.js → chunk-WRVFMNFB.js} +1 -1
- package/browser/{chunk-BMFORBRX.js → chunk-X5ETGJED.js} +1 -1
- package/browser/{chunk-XBLU5MYD.js → chunk-XBKQ3RG2.js} +1 -1
- package/browser/{chunk-XT4ZLC6I.js → chunk-XDRISSKA.js} +1 -1
- package/browser/{chunk-ZXO3HWW6.js → chunk-XQBUTQIT.js} +1 -1
- package/browser/{chunk-FFHXQQWH.js → chunk-XWIVP66I.js} +1 -1
- package/browser/{chunk-WKEIUQAT.js → chunk-Y4KEFYRC.js} +1 -1
- package/browser/{chunk-RK2C2B7P.js → chunk-YMZVULF2.js} +1 -1
- package/browser/{chunk-OWZDK2ST.js → chunk-YPRM4YPL.js} +1 -1
- package/browser/{chunk-HKYNE2QZ.js → chunk-Z4XMB4JK.js} +1 -1
- package/browser/{chunk-2HPAGJPF.js → chunk-ZPXUDL2F.js} +1 -1
- package/browser/{chunk-GRBOY2KP.js → chunk-ZTJJC7LM.js} +1 -1
- package/browser/chunk-ZXAFHS2K.js +4 -0
- package/browser/index.html +2 -2
- package/browser/{main-M5DVCFHS.js → main-MTL5GQGW.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-77RTMMBH.js +0 -1
- package/browser/chunk-UAEJZVD6.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as ze,o as tt,q as it,r as nt}from"./chunk-5NWJYNJO.js";import{a as Ke,b as qe}from"./chunk-V25UXFNL.js";import{a as ot,b as rt}from"./chunk-
|
|
1
|
+
import{k as ze,o as tt,q as it,r as nt}from"./chunk-5NWJYNJO.js";import{a as Ke,b as qe}from"./chunk-V25UXFNL.js";import{a as ot,b as rt}from"./chunk-S4263DWI.js";import{a as Ye,b as Je,e as Qe,f as Xe,g as Ze,h as et}from"./chunk-R2YNXAPB.js";import{a as X}from"./chunk-SY5NNN4M.js";import{a as ae,b as Ge,c as We}from"./chunk-3UB7PEG5.js";import{F as je,a as Le,c as Ue,h as He,l as $e,s as Be}from"./chunk-POUQHZWU.js";import{a as v}from"./chunk-PTRS3UA6.js";import{n as E,q as Q}from"./chunk-D3E5UKKJ.js";import{$b as Me,Aa as V,Ab as h,Bb as s,C as ne,Cb as d,Db as M,G as r,H as ue,I as oe,Jb as K,K as me,Ka as ye,L as D,Ma as be,Mb as w,O as fe,Pb as y,Pc as R,Qc as Y,Ra as l,Rb as p,Rc as Ae,Sb as xe,Tb as q,Ya as A,Zb as Te,_ as u,_b as Ie,aa as F,ab as N,ac as ke,bb as ve,bc as Ee,c as ce,ca as I,d as $,dc as S,e as P,ec as x,fc as k,fd as Ne,ga as ge,gb as Ce,gc as Pe,ha as B,i as de,ia as he,k as ie,ka as j,kd as J,l as _,la as G,m as a,pa as C,pb as Oe,qa as O,qc as De,r as g,s as pe,sd as Re,tb as m,tc as Fe,vb as f,vc as z,wa as b,wc as re,xb as _e,yb as Se,yc as Ve,za as W,zb as we}from"./chunk-M3O2GJ3M.js";import{a as U,b as H}from"./chunk-KMHZKFQS.js";var L=class{static emptyDate="Please fill invoice date";static emptyNumber="Please fill invoice number";static emptyOrderNumber="Number is Required";static failGetMenu="Fail to get pos menu";static failToGetRetur="Fail to get retur";static failGetLocalPosStorage="Fail to get setting and option from local storage, Please re-cache your data while online!";static failGetVariant='"Error getting variant with {0} {1}" - {2}';static failGetLocalVariant="Fail to get variant from local storage, Please re-cache your data while online!";static emptyBarcodeFormat='No product with barcode "{0}"';static emptyCustomerFormat='No customer with code "{0}"';static failGetSalesOrder="Fail to get sales order";static failBin="Fail to bin transaction";static failGetCustomer="Fail to get customer's data";static failCreateCustomer="Fail to create customer";static noRoleContact="You have no right to create new customer";static submitLocally="Connection unavailable ~ offline! Order stored locally";static offlineMode="There is no internet connection, it is now in offline mode";static OfflineOrderNotSupport="Offline order is not Supported!";static failOrderConnectionTimeOut="Connection timeout! Please try uploading your order again!";static failDeletePark="Fail to delete park";static emptyAccessRegister="You do not have access to any Register";static failGenerateNewNumber="Fail to generate new number";static emptyPayment="There is no active payment method.";static failOpenRegister="Fail to open register";static failGetLocalOutletInfo="Fail to get outlet information from local storage, Please re-cache your data while online!";static failTrySubmit=`[Error submitting order]
|
|
2
2
|
{0}`;static failTryCreateCustomer=`"[Error creating customer]
|
|
3
3
|
"{0}`;static createCustomerOffline="Create customer is not supported when the connection offline";static emptyCustomer="Please select customer!";static emptySalesPerson="Please select sales person!";static emptySalesType="Please select sales type!";static failCreateNewVariant="Fail to create new variant";static requiredDefaultCategory="[WARNING] - POS / Quick Create Product requires Default Category";static emptyVariant="Item is undefined, please re-type";static emptyPOItem="You must have at least one item";static emptyEntity="Please select entity before proceeding..";static failGetRetrieve="Fail to get retrieve";static failTryPark=`[Error submitting park]
|
|
4
4
|
{0}`;static failTryGetPark=`[Error during get park]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Je}from"./chunk-ULFJRUXF.js";import{b as Ye,c as Xe,d as Ze,e as et,f as tt}from"./chunk-EVGJA2D3.js";import{a as Qe}from"./chunk-BYGN2PS2.js";import{b as He,c as ze,e as Le,f as We}from"./chunk-U6J62ETY.js";import"./chunk-JCUDUZIE.js";import{a as Ke}from"./chunk-P3KIIKY4.js";import{b as qe}from"./chunk-RJIB64GS.js";import"./chunk-22VMH5K4.js";import"./chunk-MPGXQK5L.js";import{a as Ge,e as Be,f as $e,g as je}from"./chunk-F26TML5Q.js";import"./chunk-NZVPCH3E.js";import"./chunk-WEKBMFML.js";import"./chunk-CZI7HUE6.js";import"./chunk-X2JFFZ5E.js";import{d as ke,e as Ae,g as Oe,h as Re}from"./chunk-MGUT5T7F.js";import"./chunk-FSAQ7W4Y.js";import"./chunk-DA33S43F.js";import"./chunk-BSOZMEUZ.js";import{b as Ue}from"./chunk-KLLRDRG7.js";import"./chunk-GFPR5PLO.js";import"./chunk-7K5H76G7.js";import"./chunk-BXQZZ4SS.js";import"./chunk-J7XZRRKK.js";import"./chunk-FOEAOA4G.js";import"./chunk-DZAEKVKZ.js";import"./chunk-WYKVRUIW.js";import"./chunk-LVIGLDQ4.js";import"./chunk-BC7YQBUB.js";import"./chunk-PLVE3NEM.js";import{a as Ve}from"./chunk-K6QQQL7U.js";import"./chunk-5E52ZWKI.js";import{a as Ee,b as Ne}from"./chunk-JFJGBJM3.js";import"./chunk-BYYKQ7BF.js";import"./chunk-Q6MS4QZ6.js";import"./chunk-GMF3SGSZ.js";import"./chunk-5NWJYNJO.js";import"./chunk-36TOKQZQ.js";import"./chunk-XS4UTUMZ.js";import"./chunk-D3PKFTVO.js";import{a as Pe}from"./chunk-V25UXFNL.js";import"./chunk-YNQPX5G6.js";import"./chunk-VAJAIBT3.js";import"./chunk-WABT6X6A.js";import{a as De,b as Me,c as Fe}from"./chunk-R2YNXAPB.js";import"./chunk-MMKYHF6F.js";import"./chunk-LJWHBKHI.js";import"./chunk-SY5NNN4M.js";import"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import"./chunk-RXZDFS3M.js";import{a as E,b as we,c as ye}from"./chunk-3UB7PEG5.js";import"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import"./chunk-WIUSOID5.js";import{va as Ie}from"./chunk-K7ICHNI3.js";import{E as ve,h as xe,o as Se}from"./chunk-POUQHZWU.js";import"./chunk-5VT4ND6E.js";import"./chunk-OWZDK2ST.js";import"./chunk-MNXZMQRB.js";import{b as Te}from"./chunk-77RTMMBH.js";import"./chunk-PTRS3UA6.js";import{a as he}from"./chunk-2HPAGJPF.js";import{n as B,q as be}from"./chunk-D3E5UKKJ.js";import{$b as T,Ab as _,Bb as a,C as Y,Cb as l,Cc as w,Cd as Ce,Db as x,Dc as F,Ec as ce,G as X,Hb as H,Ib as z,Ic as me,Jb as ne,Kd as ge,Lc as q,Mb as v,Pb as h,Qc as V,Ra as c,Rb as p,Ub as oe,Uc as de,Wb as re,Xb as ae,Ya as S,_ as Z,ab as y,ac as L,bc as le,ca as ee,ec as s,fb as te,fc as D,gb as b,gc as f,hc as se,jc as O,kc as R,kd as _e,la as A,lc as U,m as J,nd as ue,pa as C,pd as fe,qa as g,sd as G,tb as m,uc as W,vb as d,xb as ie,xc as pe,yb as I,za as M,zb as P}from"./chunk-M3O2GJ3M.js";import{a as k,b as Q}from"./chunk-KMHZKFQS.js";var lt=["cellTemplate"],st=()=>({"min-width":"100%"}),pt=()=>["New","Update","Error"],ct=(t,i,e)=>({$implicit:t,col:i,rowNode:e}),ot=(t,i)=>i.field,mt=(t,i)=>i.value;function dt(t,i){if(t&1){let e=v();a(0,"div",9)(1,"p-checkbox",10),U("ngModelChange",function(r){C(e);let o=p(4);return R(o.selectedFilters,r)||(o.selectedFilters=r),g(r)}),l(),a(2,"label"),s(3),l()()}if(t&2){let e=i.$implicit,n=p(4);c(),O("ngModel",n.selectedFilters),_("value",e.value),c(2),D(e.label)}}function _t(t,i){if(t&1){let e=v();a(0,"i",5),h("click",function(r){C(e);let o=T(2);return g(o.toggle(r))}),l(),a(1,"p-popover",null,0)(3,"div",6)(4,"div",7)(5,"p-checkbox",8),h("ngModelChange",function(r){C(e);let o=p(3);return g(o.toggleSelectAll(r))}),l(),a(6,"label"),s(7,"All"),l()(),I(8,dt,4,3,"div",9,mt),l()()}if(t&2){let e=p(3);c(5),_("ngModel",e.isAllSelected()),c(3),P(e.filterOptions())}}function ut(t,i){if(t&1&&(a(0,"th"),s(1),m(2,_t,10,1),l()),t&2){let e=i.$implicit,n=p(2);L("width",e.width),c(),f(" ",e.header," "),c(),d(e.isFilterable&&n.filterOptions().length>0?2:-1)}}function ft(t,i){if(t&1&&(a(0,"tr"),I(1,ut,3,4,"th",4,ot),l()),t&2){let e=p();c(),P(e.columns())}}function Ct(t,i){t&1&&x(0,"i",15)}function gt(t,i){t&1&&x(0,"i",16)}function ht(t,i){t&1&&x(0,"i",17)}function xt(t,i){if(t&1&&(x(0,"p-treeTableToggler",14),m(1,Ct,1,0,"i",15)(2,gt,1,0,"i",16)(3,ht,1,0,"i",17)),t&2){let e,n=p(2),r=n.$implicit,o=n.rowData;_("rowNode",r),c(),d((e=o.Type)===0?1:e===1?2:e===2?3:-1)}}function St(t,i){t&1&&ne(0)}function vt(t,i){if(t&1&&(a(0,"td"),m(1,xt,4,2),b(2,St,1,0,"ng-container",13),l()),t&2){let e=i.$implicit,n=i.$index,r=p(),o=r.$implicit,u=r.rowData,N=p();L("width",e.width),le("bg-gradient-success",e.field==="action"&&u.Action==="New")("bg-gradient-warning",e.field==="action"&&u.Action==="Update")("bg-gradient-danger",e.field==="action"&&u.Action==="Error")("text-white",e.field==="action"&&W(13,pt).includes(u.Action)),c(),d(n===0?1:-1),c(),_("ngTemplateOutlet",N.cellTemplate)("ngTemplateOutletContext",pe(14,ct,u,e,o))}}function bt(t,i){if(t&1&&(a(0,"tr",11),I(1,vt,3,18,"td",12,ot),l()),t&2){let e=i.$implicit,n=p();_("ttRow",e),c(),P(n.columns())}}var $=class t{nodes=V.required();columns=V.required();filterOptions=V([]);filterField=V("");selectedFilters=de([]);cellTemplate;isAllSelected=q(()=>{let i=this.filterOptions(),e=this.selectedFilters();return i.length>0&&e.length===i.length});ngOnInit(){let i=this.filterOptions(),e=this.selectedFilters();if(i.length>0&&e.length===0){let n=i.map(r=>r.value);this.selectedFilters.set(n)}}filteredNodes=q(()=>{let i=this.nodes(),e=this.selectedFilters(),n=this.filterField();return!e||e.length===0?[]:this.filterRecursive(i,e,n)});toggleSelectAll(i){let e=this.filterOptions();i?this.selectedFilters.set(e.map(n=>n.value)):this.selectedFilters.set([])}filterRecursive(i,e,n){if(!i||!e||e.length===0)return i;let r=[];for(let o of i){let u=o.data?.[n],N=e.includes(u),K=o.children&&o.children.length>0?this.filterRecursive(o.children,e,n):[];N?r.push(Q(k({},o),{children:K})):r.push(...K)}return r}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["POS-generic-tree-table"]],contentQueries:function(e,n,r){if(e&1&&oe(r,lt,5),e&2){let o;re(o=ae())&&(n.cellTemplate=o.first)}},inputs:{nodes:[1,"nodes"],columns:[1,"columns"],filterOptions:[1,"filterOptions"],filterField:[1,"filterField"],selectedFilters:[1,"selectedFilters"]},outputs:{selectedFilters:"selectedFiltersChange"},decls:3,vars:4,consts:[["op",""],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],[3,"width"],[1,"fa","fa-filter","pointer","ms-2",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","gap-2"],["binary","true",3,"ngModelChange","ngModel"],[1,"mt-3","d-flex","align-items-center","gap-2"],[3,"ngModelChange","ngModel","value"],[3,"ttRow"],[3,"width","bg-gradient-success","bg-gradient-warning","bg-gradient-danger","text-white"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"rowNode"],["matTooltipPosition","above","matTooltip","Category",1,"fa-regular","fa-folder"],["matTooltipPosition","above","matTooltip","Product",1,"fa-regular","fa-tag"],["matTooltipPosition","above","matTooltip","Variant",1,"fa-regular","fa-layer-group"]],template:function(e,n){e&1&&(a(0,"p-treeTable",1),b(1,ft,3,0,"ng-template",2)(2,bt,3,1,"ng-template",3),l()),e&2&&_("value",n.filteredNodes())("scrollable",!0)("tableStyle",W(3,st))},dependencies:[G,_e,je,Ge,Ie,$e,Be,Ne,Ee,Ae,ke,Ue,ve,xe,Se,Pe],encapsulation:2})};function wt(t,i){if(t&1&&(a(0,"div",2)(1,"div",3)(2,"h3"),s(3,"New"),l()(),a(4,"div",4)(5,"div",5)(6,"div",6)(7,"span",7),s(8),w(9,"number"),l(),a(10,"div",8),s(11,"Outlet"),l()(),a(12,"div",9)(13,"span",7),s(14),w(15,"number"),l(),a(16,"div",8),s(17,"Variant"),l()(),a(18,"div",9)(19,"span",7),s(20),w(21,"number"),l(),a(22,"div",8),s(23,"Serial"),l()()()()()),t&2){let e=p();c(8),D(F(9,3,e.summary.OutletCount)),c(6),D(F(15,5,e.summary.VariantCount)),c(6),D(F(21,7,e.summary.SerialCount))}}var j=class t{constructor(i,e){this.dialogRef=i;this.data=e;this.configModal=new we,this.configModal.title="Preview Summary",this.configModal.customWidth="600px",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.hideScrollbar=!0,this.summary=e.summary}configModal;summary={OutletCount:0,VariantCount:0,SerialCount:0};toaster=A(B);close(){this.dialogRef.close()}confirm(){if(!this.data.canProceed){this.toaster.error(`There are ${this.summary.SerialCount} rows with error status, please check!`,E.Error),this.dialogRef.close("error");return}this.dialogRef.close("confirm")}static \u0275fac=function(e){return new(e||t)(S(De),S(Me))};static \u0275cmp=y({type:t,selectors:[["pos-dialog-summary-import-serial"]],decls:7,vars:5,consts:[[3,"onOk","onCancel","onClose","config"],[1,"mt-2","ms-2"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"d-flex"],[1,"flex-grow-1",2,"height","85px"],[2,"font-size","30px"],[2,"font-size","16px"],[1,"flex-grow-1","ps-10",2,"height","85px"]],template:function(e,n){e&1&&(a(0,"modal-material",0),h("onOk",function(){return n.confirm()})("onCancel",function(){return n.close()})("onClose",function(){return n.close()}),a(1,"header")(2,"div",1),s(3),w(4,"number"),l()(),a(5,"content"),m(6,wt,24,9,"div",2),l()()),e&2&&(_("config",n.configModal),c(3),f(" (",F(4,3,n.summary.SerialCount)," rows ready for import) "),c(3),d(n.summary?6:-1))},dependencies:[ye,G,fe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};function yt(t,i){if(t&1){let e=v();a(0,"button",26),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.onPreview(r))}),s(1," Next "),l()}}function It(t,i){if(t&1){let e=v();a(0,"button",27),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.onBack(r))}),s(1," Back "),l(),a(2,"button",28),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.upload(r))}),s(3," Next "),l()}if(t&2){let e=p(2);c(2),_("disabled",!e.canProceedPreview)}}function Pt(t,i){if(t&1){let e=v();a(0,"button",27),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.newUpload(r))}),s(1," New "),l()}}function Dt(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function Mt(t,i){t&1&&(x(0,"i",29),s(1,"Upload "))}function Ft(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function Vt(t,i){if(t&1){let e=v();a(0,"POS-uppy",30),h("fileUploaded",function(r){C(e);let o=p(2);return g(o.onUploadCsv(r))}),a(1,"div",31),x(2,"i",32),a(3,"span"),s(4,"Download "),a(5,"a",33),s(6,".csv"),l(),s(7," template"),l()()()}if(t&2){let e=p(2);_("dashboardPropsConfiguration",e.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Et(t,i){if(t&1){let e=v();a(0,"POS-uppy",34),h("fileUploaded",function(r){C(e);let o=p(2);return g(o.onUploadCsv(r))}),l()}if(t&2){let e=p(2);_("sampleUrl",e.sampleImportFileUrl)("dashboardPropsConfiguration",e.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Nt(t,i){t&1&&(x(0,"i",35),s(1,"Preview "))}function kt(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function At(t,i){if(t&1&&s(0),t&2){let e=p().$implicit;f(" ",e.Name||""," ")}}function Ot(t,i){if(t&1&&s(0),t&2){let e=p().$implicit;f(" ",e.VariantCode||""," ")}}function Rt(t,i){if(t&1&&(s(0),w(1,"date")),t&2){let e=p(2).$implicit;f(" ",ce(1,1,e.Expiry,"dd MMM yyyy")," ")}}function Ut(t,i){if(t&1&&m(0,Rt,2,4),t&2){let e=p().$implicit;d(e.Expiry&&e.Expiry!=="0001-01-01T00:00:00"?0:-1)}}function Gt(t,i){if(t&1&&(a(0,"div",36),s(1),l()),t&2){let e=p().$implicit;c(),f(" ",e.Action," ")}}function Bt(t,i){if(t&1&&(a(0,"div"),s(1),l()),t&2){let e=i.$implicit;c(),se("",e.Issue," ",e.Solution)}}function $t(t,i){if(t&1&&I(0,Bt,2,2,"div",null,ie),t&2){let e=p(2).$implicit;P(e.Issues)}}function jt(t,i){if(t&1&&m(0,$t,2,0),t&2){let e=p().$implicit;d(e.Issues!=null&&e.Issues.length?0:-1)}}function Ht(t,i){if(t&1&&(m(0,At,1,1),m(1,Ot,1,1),m(2,Ut,1,1),m(3,Gt,2,1,"div",36),m(4,jt,1,1)),t&2){let e=i.col;d(e.field==="name"?0:-1),c(),d(e.field==="code"?1:-1),c(),d(e.field==="exp"?2:-1),c(),d(e.field==="action"?3:-1),c(),d(e.field==="issue"?4:-1)}}function zt(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function Lt(t,i){t&1&&(x(0,"i",37),s(1,"Finish "))}function Wt(t,i){if(t&1){let e=v();a(0,"mainpanel-cmp",2),H(1,3),m(2,yt,2,0,"button",4),m(3,It,4,1),m(4,Pt,2,0,"button",5),z(),H(5,6),a(6,"mat-stepper",7,0),h("selectionChange",function(r){C(e);let o=p();return g(o.selectionChange(r))}),b(8,Dt,1,1,"ng-template",8),a(9,"mat-step",9)(10,"div",10)(11,"form",11),b(12,Mt,2,0,"ng-template",12)(13,Ft,1,1,"ng-template",13),m(14,Vt,8,2,"POS-uppy",14),m(15,Et,1,3,"POS-uppy",15),l(),a(16,"div",16),s(17," Users must fill the code column to import product. Please refer this "),a(18,"a",17),s(19,"article"),l(),s(20," for more information "),l()()(),a(21,"mat-step",18),b(22,Nt,2,0,"ng-template",12)(23,kt,1,1,"ng-template",13),a(24,"POS-generic-tree-table",19),U("selectedFiltersChange",function(r){C(e);let o=p();return R(o.activeFilters,r)||(o.activeFilters=r),g(r)}),b(25,Ht,5,5,"ng-template",null,1,me),l()(),a(27,"mat-step",20),b(28,zt,1,1,"ng-template",13)(29,Lt,2,0,"ng-template",12),a(30,"div",10),x(31,"i",21),a(32,"h1",22),s(33,"Upload Complete!"),l(),a(34,"div",23)(35,"mat-accordion")(36,"mat-expansion-panel",24)(37,"mat-expansion-panel-header")(38,"mat-panel-title")(39,"span",25),s(40,"Row Processed"),l()(),a(41,"mat-panel-description"),s(42),l()()()()()()()(),z(),l()}if(t&2){let e=p();_("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),d(e.state=="upload"&&e.fileImport?2:-1),c(),d(e.state=="preview"?3:-1),c(),d(e.state=="finish"?4:-1),c(2),_("linear",!0),c(3),_("editable",!e.uploaded)("completed",!1),c(5),d(e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading?14:-1),c(),d(e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error?15:-1),c(6),_("editable",!e.uploaded)("completed",!1),c(3),_("nodes",e.treeData())("columns",e.columns)("filterOptions",e.statusFilters),O("selectedFilters",e.activeFilters),c(18),f(" ",e.totalRowsImported," rows ")}}var rt=class t extends Qe{constructor(e,n,r,o,u,N){super(e,n,"catalog/ProductLoader/ProductImportLoader",r);this.activatedRoute=r;this.importService=o;this.toastr=u;this.matDialog=N}pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];sampleImportFileUrl=he.files.csv.product_import;state="upload";fileImport;role=A(Te);dashboardPropsConfiguration={width:580};cacheKey="";canProceedPreview=!1;importedTreeData=[];summary=["Category","Product","Variant"];summaryProducts={};uploaded=!1;importedData;totalRowsImported=0;productPanelState=M(!1);outletPrice={data:[]};confirmData;newAdditionalData;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;confirmMessage="";uploadState=M(0);uploadStateEnum=Ke;treeData=M([]);columns=[{field:"name",header:"Name",width:"250px"},{field:"code",header:"Code",width:"120px"},{field:"exp",header:"Exp.Date",width:"auto"},{field:"action",header:"Status",width:"auto",isFilterable:!0},{field:"issue",header:"Message",width:"auto"}];statusFilters=[];activeFilters=M([]);hasCostAccess=!0;collectUniqueActions(e){let n=new Set;function r(o){for(let u of o)u.data&&u.data.Action&&n.add(u.data.Action),u.children&&u.children.length>0&&r(u.children)}return r(e),n}generateStatusFilters(e){let n=this.collectUniqueActions(e);return Array.from(n).sort().map(o=>({label:o,value:o}))}onImport(){this.alertConfirmInventory()&&this.importService.import({Categories:this.importHttpResponse}).pipe().subscribe(n=>{this.isPreviewState=!1,this.importHttpResponse=[],this.isSuccessState=!0,this.msgSuccessImport=n.Message})}onPreview(e){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let n=JSON.stringify(this.formData),r=this.importService.generateFormData(this.fileImport,n);this.importService.previewImport("/api/catalog/serial/ImportV2Preview",r).pipe(X(o=>(o instanceof Ce&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",o)),J(()=>o)))).subscribe({next:o=>{e.selected.completed=!0,e.next(),this.cacheKey=o.CacheKey,this.canProceedPreview=o.CanProceed,this.importedTreeData=o.DataRow,this.summaryProducts=o.Summary,this.treeData.update(()=>o.DataRow),this.statusFilters=this.generateStatusFilters(o.DataRow),this.activeFilters.set(this.statusFilters.map(u=>u.value)),this.initIsDisabledImport(),this.uploadState.set(2)},error:o=>{console.log("error",o)}})}initIsDisabledImport(){let e=JSON.stringify(this.importHttpResponse).toLowerCase().includes('"statusid":2');this.isDisabledImportBtn=e}alertConfirmInventory(){return!(this.formData.InventoryUpdate&&!confirm("Update Inventory is YES. This is will replace current inventory. Do you want to proceed?"))}onImportFileChange(e){this.fileImport=e,this.isPreviewState=!1}onNewImport(){this.isSuccessState=!1}onUploadCsv(e){this.fileImport=e}selectionChange(e){let n=e.selectedStep.label;this.state=n}upload(e){if(!this.summaryProducts||!this.canProceedPreview){this.toastr.error("No data to import. Please check your file and try again.",E.Error);return}this.matDialog.open(j,{data:{summary:this.summaryProducts,canProceed:this.canProceedPreview}}).afterClosed().pipe(ee(n=>{n==="error"&&(this.pickAll=[],this.filterTreeCondition=["Error"])}),Y(n=>n==="confirm"),Z(()=>this.httpService.post("/api/catalog/serial/ImportV2Confirm",{CacheKey:this.cacheKey}))).subscribe(n=>{e.selected.completed=!0,this.toastr.success(`Success import ${n.Rows} rows.`,E.Success),e.next(),this.totalRowsImported=n.Rows,this.uploaded=!0,this.newAdditionalData=k({},n),this.confirmData=n})}onBack(e){e.selected.completed=!1,this.state=e.selected.label,this.fileImport=null,e.previous(),this.uploadState.set(1)}newUpload(e){e.reset(),this.uploaded=!1,this.state="upload",this.fileImport=null,this.cacheKey="",this.canProceedPreview=!1,this.importedTreeData=[],this.summaryProducts={},this.uploadState.set(0)}filterTree(){}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(n){return new(n||t)(S(Ve),S(be),S(ge),S(Je),S(B),S(Fe))};static \u0275cmp=y({type:t,selectors:[["POS-import-serial-v2"]],features:[te],decls:1,vars:1,consts:[["stepper",""],["cellTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-success","ms-3"],[1,"btn","btn-outline-secondary"],["ngProjectAs","content",5,["content"]],["orientation","horizontal",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","upload","state","upload",2,"margin-top","50px",3,"editable","completed"],[1,"d-flex","flex-column","align-items-center"],[1,"d-flex","justify-content-center"],["matStepLabel",""],["matStepperIcon","done"],[3,"dashboardPropsConfiguration","subtitle"],[3,"sampleUrl","dashboardPropsConfiguration","subtitle"],[1,"text-body-secondary","fst-italic","h6","mt-5","ms-2",2,"width","580px","z-index","99"],["href","//support.dealpos.com/en/articles/4773747-import-product-list-using-excel-csv-file","target","_blank"],["label","preview","state","preview",3,"editable","completed"],["filterField","Action",3,"selectedFiltersChange","nodes","columns","filterOptions","selectedFilters"],["label","finish","state","finish"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"mt-5",2,"min-width","550px"],["hideToggle","","disabled",""],[1,"fw-bold"],[1,"btn","btn-success","ms-3",3,"click"],[1,"btn","btn-outline-secondary",3,"click"],[1,"btn","btn-success","ms-3",3,"click","disabled"],[1,"fa-solid","fa-upload","me-3"],[3,"fileUploaded","dashboardPropsConfiguration","subtitle"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-download","text-primary"],["href","https://cdn.dealpos.xyz/web-import-template/Sample_Serial.csv",1,"link"],[3,"fileUploaded","sampleUrl","dashboardPropsConfiguration","subtitle"],[1,"fa-regular","fa-file","me-3"],[1,"text-black"],[1,"fa-solid","fa-check","me-3"]],template:function(n,r){n&1&&m(0,Wt,43,18,"mainpanel-cmp",2),n&2&&d(r.formData&&r.data?0:-1)},dependencies:[Re,Oe,We,qe,Le,tt,Ye,Xe,et,Ze,$,ze,He,ue],styles:["[_nghost-%COMP%] .mat-horizontal-stepper-header-container{width:40%;margin:0 auto}"]})};export{rt as ImportSerialV2Component};
|
|
1
|
+
import{a as Je}from"./chunk-ULFJRUXF.js";import{b as Ye,c as Xe,d as Ze,e as et,f as tt}from"./chunk-EVGJA2D3.js";import{a as Qe}from"./chunk-BYGN2PS2.js";import{b as He,c as ze,e as Le,f as We}from"./chunk-U6J62ETY.js";import"./chunk-JCUDUZIE.js";import{a as Ke}from"./chunk-P3KIIKY4.js";import{b as qe}from"./chunk-RJIB64GS.js";import"./chunk-22VMH5K4.js";import"./chunk-MPGXQK5L.js";import{a as Ge,e as Be,f as $e,g as je}from"./chunk-F26TML5Q.js";import"./chunk-NZVPCH3E.js";import"./chunk-WEKBMFML.js";import"./chunk-CZI7HUE6.js";import"./chunk-X2JFFZ5E.js";import{d as ke,e as Ae,g as Oe,h as Re}from"./chunk-FI4ADJ7Y.js";import"./chunk-FSAQ7W4Y.js";import"./chunk-DA33S43F.js";import"./chunk-BSOZMEUZ.js";import{b as Ue}from"./chunk-KLLRDRG7.js";import"./chunk-GFPR5PLO.js";import"./chunk-7K5H76G7.js";import"./chunk-BXQZZ4SS.js";import"./chunk-J7XZRRKK.js";import"./chunk-FOEAOA4G.js";import"./chunk-DZAEKVKZ.js";import"./chunk-WYKVRUIW.js";import"./chunk-LVIGLDQ4.js";import"./chunk-BC7YQBUB.js";import"./chunk-LT46RQOD.js";import{a as Ve}from"./chunk-V6I4U3FF.js";import"./chunk-5E52ZWKI.js";import{a as Ee,b as Ne}from"./chunk-JFJGBJM3.js";import"./chunk-23G4CQ4S.js";import"./chunk-Q6MS4QZ6.js";import"./chunk-GMF3SGSZ.js";import"./chunk-5NWJYNJO.js";import"./chunk-36TOKQZQ.js";import"./chunk-XS4UTUMZ.js";import"./chunk-D3PKFTVO.js";import{a as Pe}from"./chunk-V25UXFNL.js";import"./chunk-YNQPX5G6.js";import"./chunk-VAJAIBT3.js";import"./chunk-S4263DWI.js";import{a as De,b as Me,c as Fe}from"./chunk-R2YNXAPB.js";import"./chunk-MMKYHF6F.js";import"./chunk-LJWHBKHI.js";import"./chunk-SY5NNN4M.js";import"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import"./chunk-RXZDFS3M.js";import{a as E,b as we,c as ye}from"./chunk-3UB7PEG5.js";import"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import"./chunk-WIUSOID5.js";import{va as Ie}from"./chunk-K7ICHNI3.js";import{E as ve,h as xe,o as Se}from"./chunk-POUQHZWU.js";import"./chunk-KM4ASOAJ.js";import"./chunk-YPRM4YPL.js";import"./chunk-MNXZMQRB.js";import{b as Te}from"./chunk-H3D4WR27.js";import"./chunk-PTRS3UA6.js";import{a as he}from"./chunk-ZPXUDL2F.js";import{n as B,q as be}from"./chunk-D3E5UKKJ.js";import{$b as T,Ab as _,Bb as a,C as Y,Cb as l,Cc as w,Cd as Ce,Db as x,Dc as F,Ec as ce,G as X,Hb as H,Ib as z,Ic as me,Jb as ne,Kd as ge,Lc as q,Mb as v,Pb as h,Qc as V,Ra as c,Rb as p,Ub as oe,Uc as de,Wb as re,Xb as ae,Ya as S,_ as Z,ab as y,ac as L,bc as le,ca as ee,ec as s,fb as te,fc as D,gb as b,gc as f,hc as se,jc as O,kc as R,kd as _e,la as A,lc as U,m as J,nd as ue,pa as C,pd as fe,qa as g,sd as G,tb as m,uc as W,vb as d,xb as ie,xc as pe,yb as I,za as M,zb as P}from"./chunk-M3O2GJ3M.js";import{a as k,b as Q}from"./chunk-KMHZKFQS.js";var lt=["cellTemplate"],st=()=>({"min-width":"100%"}),pt=()=>["New","Update","Error"],ct=(t,i,e)=>({$implicit:t,col:i,rowNode:e}),ot=(t,i)=>i.field,mt=(t,i)=>i.value;function dt(t,i){if(t&1){let e=v();a(0,"div",9)(1,"p-checkbox",10),U("ngModelChange",function(r){C(e);let o=p(4);return R(o.selectedFilters,r)||(o.selectedFilters=r),g(r)}),l(),a(2,"label"),s(3),l()()}if(t&2){let e=i.$implicit,n=p(4);c(),O("ngModel",n.selectedFilters),_("value",e.value),c(2),D(e.label)}}function _t(t,i){if(t&1){let e=v();a(0,"i",5),h("click",function(r){C(e);let o=T(2);return g(o.toggle(r))}),l(),a(1,"p-popover",null,0)(3,"div",6)(4,"div",7)(5,"p-checkbox",8),h("ngModelChange",function(r){C(e);let o=p(3);return g(o.toggleSelectAll(r))}),l(),a(6,"label"),s(7,"All"),l()(),I(8,dt,4,3,"div",9,mt),l()()}if(t&2){let e=p(3);c(5),_("ngModel",e.isAllSelected()),c(3),P(e.filterOptions())}}function ut(t,i){if(t&1&&(a(0,"th"),s(1),m(2,_t,10,1),l()),t&2){let e=i.$implicit,n=p(2);L("width",e.width),c(),f(" ",e.header," "),c(),d(e.isFilterable&&n.filterOptions().length>0?2:-1)}}function ft(t,i){if(t&1&&(a(0,"tr"),I(1,ut,3,4,"th",4,ot),l()),t&2){let e=p();c(),P(e.columns())}}function Ct(t,i){t&1&&x(0,"i",15)}function gt(t,i){t&1&&x(0,"i",16)}function ht(t,i){t&1&&x(0,"i",17)}function xt(t,i){if(t&1&&(x(0,"p-treeTableToggler",14),m(1,Ct,1,0,"i",15)(2,gt,1,0,"i",16)(3,ht,1,0,"i",17)),t&2){let e,n=p(2),r=n.$implicit,o=n.rowData;_("rowNode",r),c(),d((e=o.Type)===0?1:e===1?2:e===2?3:-1)}}function St(t,i){t&1&&ne(0)}function vt(t,i){if(t&1&&(a(0,"td"),m(1,xt,4,2),b(2,St,1,0,"ng-container",13),l()),t&2){let e=i.$implicit,n=i.$index,r=p(),o=r.$implicit,u=r.rowData,N=p();L("width",e.width),le("bg-gradient-success",e.field==="action"&&u.Action==="New")("bg-gradient-warning",e.field==="action"&&u.Action==="Update")("bg-gradient-danger",e.field==="action"&&u.Action==="Error")("text-white",e.field==="action"&&W(13,pt).includes(u.Action)),c(),d(n===0?1:-1),c(),_("ngTemplateOutlet",N.cellTemplate)("ngTemplateOutletContext",pe(14,ct,u,e,o))}}function bt(t,i){if(t&1&&(a(0,"tr",11),I(1,vt,3,18,"td",12,ot),l()),t&2){let e=i.$implicit,n=p();_("ttRow",e),c(),P(n.columns())}}var $=class t{nodes=V.required();columns=V.required();filterOptions=V([]);filterField=V("");selectedFilters=de([]);cellTemplate;isAllSelected=q(()=>{let i=this.filterOptions(),e=this.selectedFilters();return i.length>0&&e.length===i.length});ngOnInit(){let i=this.filterOptions(),e=this.selectedFilters();if(i.length>0&&e.length===0){let n=i.map(r=>r.value);this.selectedFilters.set(n)}}filteredNodes=q(()=>{let i=this.nodes(),e=this.selectedFilters(),n=this.filterField();return!e||e.length===0?[]:this.filterRecursive(i,e,n)});toggleSelectAll(i){let e=this.filterOptions();i?this.selectedFilters.set(e.map(n=>n.value)):this.selectedFilters.set([])}filterRecursive(i,e,n){if(!i||!e||e.length===0)return i;let r=[];for(let o of i){let u=o.data?.[n],N=e.includes(u),K=o.children&&o.children.length>0?this.filterRecursive(o.children,e,n):[];N?r.push(Q(k({},o),{children:K})):r.push(...K)}return r}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["POS-generic-tree-table"]],contentQueries:function(e,n,r){if(e&1&&oe(r,lt,5),e&2){let o;re(o=ae())&&(n.cellTemplate=o.first)}},inputs:{nodes:[1,"nodes"],columns:[1,"columns"],filterOptions:[1,"filterOptions"],filterField:[1,"filterField"],selectedFilters:[1,"selectedFilters"]},outputs:{selectedFilters:"selectedFiltersChange"},decls:3,vars:4,consts:[["op",""],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],[3,"width"],[1,"fa","fa-filter","pointer","ms-2",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","gap-2"],["binary","true",3,"ngModelChange","ngModel"],[1,"mt-3","d-flex","align-items-center","gap-2"],[3,"ngModelChange","ngModel","value"],[3,"ttRow"],[3,"width","bg-gradient-success","bg-gradient-warning","bg-gradient-danger","text-white"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"rowNode"],["matTooltipPosition","above","matTooltip","Category",1,"fa-regular","fa-folder"],["matTooltipPosition","above","matTooltip","Product",1,"fa-regular","fa-tag"],["matTooltipPosition","above","matTooltip","Variant",1,"fa-regular","fa-layer-group"]],template:function(e,n){e&1&&(a(0,"p-treeTable",1),b(1,ft,3,0,"ng-template",2)(2,bt,3,1,"ng-template",3),l()),e&2&&_("value",n.filteredNodes())("scrollable",!0)("tableStyle",W(3,st))},dependencies:[G,_e,je,Ge,Ie,$e,Be,Ne,Ee,Ae,ke,Ue,ve,xe,Se,Pe],encapsulation:2})};function wt(t,i){if(t&1&&(a(0,"div",2)(1,"div",3)(2,"h3"),s(3,"New"),l()(),a(4,"div",4)(5,"div",5)(6,"div",6)(7,"span",7),s(8),w(9,"number"),l(),a(10,"div",8),s(11,"Outlet"),l()(),a(12,"div",9)(13,"span",7),s(14),w(15,"number"),l(),a(16,"div",8),s(17,"Variant"),l()(),a(18,"div",9)(19,"span",7),s(20),w(21,"number"),l(),a(22,"div",8),s(23,"Serial"),l()()()()()),t&2){let e=p();c(8),D(F(9,3,e.summary.OutletCount)),c(6),D(F(15,5,e.summary.VariantCount)),c(6),D(F(21,7,e.summary.SerialCount))}}var j=class t{constructor(i,e){this.dialogRef=i;this.data=e;this.configModal=new we,this.configModal.title="Preview Summary",this.configModal.customWidth="600px",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.hideScrollbar=!0,this.summary=e.summary}configModal;summary={OutletCount:0,VariantCount:0,SerialCount:0};toaster=A(B);close(){this.dialogRef.close()}confirm(){if(!this.data.canProceed){this.toaster.error(`There are ${this.summary.SerialCount} rows with error status, please check!`,E.Error),this.dialogRef.close("error");return}this.dialogRef.close("confirm")}static \u0275fac=function(e){return new(e||t)(S(De),S(Me))};static \u0275cmp=y({type:t,selectors:[["pos-dialog-summary-import-serial"]],decls:7,vars:5,consts:[[3,"onOk","onCancel","onClose","config"],[1,"mt-2","ms-2"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"d-flex"],[1,"flex-grow-1",2,"height","85px"],[2,"font-size","30px"],[2,"font-size","16px"],[1,"flex-grow-1","ps-10",2,"height","85px"]],template:function(e,n){e&1&&(a(0,"modal-material",0),h("onOk",function(){return n.confirm()})("onCancel",function(){return n.close()})("onClose",function(){return n.close()}),a(1,"header")(2,"div",1),s(3),w(4,"number"),l()(),a(5,"content"),m(6,wt,24,9,"div",2),l()()),e&2&&(_("config",n.configModal),c(3),f(" (",F(4,3,n.summary.SerialCount)," rows ready for import) "),c(3),d(n.summary?6:-1))},dependencies:[ye,G,fe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};function yt(t,i){if(t&1){let e=v();a(0,"button",26),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.onPreview(r))}),s(1," Next "),l()}}function It(t,i){if(t&1){let e=v();a(0,"button",27),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.onBack(r))}),s(1," Back "),l(),a(2,"button",28),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.upload(r))}),s(3," Next "),l()}if(t&2){let e=p(2);c(2),_("disabled",!e.canProceedPreview)}}function Pt(t,i){if(t&1){let e=v();a(0,"button",27),h("click",function(){C(e),p();let r=T(7),o=p();return g(o.newUpload(r))}),s(1," New "),l()}}function Dt(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function Mt(t,i){t&1&&(x(0,"i",29),s(1,"Upload "))}function Ft(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function Vt(t,i){if(t&1){let e=v();a(0,"POS-uppy",30),h("fileUploaded",function(r){C(e);let o=p(2);return g(o.onUploadCsv(r))}),a(1,"div",31),x(2,"i",32),a(3,"span"),s(4,"Download "),a(5,"a",33),s(6,".csv"),l(),s(7," template"),l()()()}if(t&2){let e=p(2);_("dashboardPropsConfiguration",e.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Et(t,i){if(t&1){let e=v();a(0,"POS-uppy",34),h("fileUploaded",function(r){C(e);let o=p(2);return g(o.onUploadCsv(r))}),l()}if(t&2){let e=p(2);_("sampleUrl",e.sampleImportFileUrl)("dashboardPropsConfiguration",e.dashboardPropsConfiguration)("subtitle","Accepted file formats: .csv & max file size: 1 MB")}}function Nt(t,i){t&1&&(x(0,"i",35),s(1,"Preview "))}function kt(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function At(t,i){if(t&1&&s(0),t&2){let e=p().$implicit;f(" ",e.Name||""," ")}}function Ot(t,i){if(t&1&&s(0),t&2){let e=p().$implicit;f(" ",e.VariantCode||""," ")}}function Rt(t,i){if(t&1&&(s(0),w(1,"date")),t&2){let e=p(2).$implicit;f(" ",ce(1,1,e.Expiry,"dd MMM yyyy")," ")}}function Ut(t,i){if(t&1&&m(0,Rt,2,4),t&2){let e=p().$implicit;d(e.Expiry&&e.Expiry!=="0001-01-01T00:00:00"?0:-1)}}function Gt(t,i){if(t&1&&(a(0,"div",36),s(1),l()),t&2){let e=p().$implicit;c(),f(" ",e.Action," ")}}function Bt(t,i){if(t&1&&(a(0,"div"),s(1),l()),t&2){let e=i.$implicit;c(),se("",e.Issue," ",e.Solution)}}function $t(t,i){if(t&1&&I(0,Bt,2,2,"div",null,ie),t&2){let e=p(2).$implicit;P(e.Issues)}}function jt(t,i){if(t&1&&m(0,$t,2,0),t&2){let e=p().$implicit;d(e.Issues!=null&&e.Issues.length?0:-1)}}function Ht(t,i){if(t&1&&(m(0,At,1,1),m(1,Ot,1,1),m(2,Ut,1,1),m(3,Gt,2,1,"div",36),m(4,jt,1,1)),t&2){let e=i.col;d(e.field==="name"?0:-1),c(),d(e.field==="code"?1:-1),c(),d(e.field==="exp"?2:-1),c(),d(e.field==="action"?3:-1),c(),d(e.field==="issue"?4:-1)}}function zt(t,i){if(t&1&&s(0),t&2){let e=i.index;f("",e+1," ")}}function Lt(t,i){t&1&&(x(0,"i",37),s(1,"Finish "))}function Wt(t,i){if(t&1){let e=v();a(0,"mainpanel-cmp",2),H(1,3),m(2,yt,2,0,"button",4),m(3,It,4,1),m(4,Pt,2,0,"button",5),z(),H(5,6),a(6,"mat-stepper",7,0),h("selectionChange",function(r){C(e);let o=p();return g(o.selectionChange(r))}),b(8,Dt,1,1,"ng-template",8),a(9,"mat-step",9)(10,"div",10)(11,"form",11),b(12,Mt,2,0,"ng-template",12)(13,Ft,1,1,"ng-template",13),m(14,Vt,8,2,"POS-uppy",14),m(15,Et,1,3,"POS-uppy",15),l(),a(16,"div",16),s(17," Users must fill the code column to import product. Please refer this "),a(18,"a",17),s(19,"article"),l(),s(20," for more information "),l()()(),a(21,"mat-step",18),b(22,Nt,2,0,"ng-template",12)(23,kt,1,1,"ng-template",13),a(24,"POS-generic-tree-table",19),U("selectedFiltersChange",function(r){C(e);let o=p();return R(o.activeFilters,r)||(o.activeFilters=r),g(r)}),b(25,Ht,5,5,"ng-template",null,1,me),l()(),a(27,"mat-step",20),b(28,zt,1,1,"ng-template",13)(29,Lt,2,0,"ng-template",12),a(30,"div",10),x(31,"i",21),a(32,"h1",22),s(33,"Upload Complete!"),l(),a(34,"div",23)(35,"mat-accordion")(36,"mat-expansion-panel",24)(37,"mat-expansion-panel-header")(38,"mat-panel-title")(39,"span",25),s(40,"Row Processed"),l()(),a(41,"mat-panel-description"),s(42),l()()()()()()()(),z(),l()}if(t&2){let e=p();_("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),d(e.state=="upload"&&e.fileImport?2:-1),c(),d(e.state=="preview"?3:-1),c(),d(e.state=="finish"?4:-1),c(2),_("linear",!0),c(3),_("editable",!e.uploaded)("completed",!1),c(5),d(e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading?14:-1),c(),d(e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error?15:-1),c(6),_("editable",!e.uploaded)("completed",!1),c(3),_("nodes",e.treeData())("columns",e.columns)("filterOptions",e.statusFilters),O("selectedFilters",e.activeFilters),c(18),f(" ",e.totalRowsImported," rows ")}}var rt=class t extends Qe{constructor(e,n,r,o,u,N){super(e,n,"catalog/ProductLoader/ProductImportLoader",r);this.activatedRoute=r;this.importService=o;this.toastr=u;this.matDialog=N}pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];sampleImportFileUrl=he.files.csv.product_import;state="upload";fileImport;role=A(Te);dashboardPropsConfiguration={width:580};cacheKey="";canProceedPreview=!1;importedTreeData=[];summary=["Category","Product","Variant"];summaryProducts={};uploaded=!1;importedData;totalRowsImported=0;productPanelState=M(!1);outletPrice={data:[]};confirmData;newAdditionalData;importHttpResponse=[];isPreviewState=!1;isSuccessState=!1;msgSuccessImport;isDisabledImportBtn=!1;confirmMessage="";uploadState=M(0);uploadStateEnum=Ke;treeData=M([]);columns=[{field:"name",header:"Name",width:"250px"},{field:"code",header:"Code",width:"120px"},{field:"exp",header:"Exp.Date",width:"auto"},{field:"action",header:"Status",width:"auto",isFilterable:!0},{field:"issue",header:"Message",width:"auto"}];statusFilters=[];activeFilters=M([]);hasCostAccess=!0;collectUniqueActions(e){let n=new Set;function r(o){for(let u of o)u.data&&u.data.Action&&n.add(u.data.Action),u.children&&u.children.length>0&&r(u.children)}return r(e),n}generateStatusFilters(e){let n=this.collectUniqueActions(e);return Array.from(n).sort().map(o=>({label:o,value:o}))}onImport(){this.alertConfirmInventory()&&this.importService.import({Categories:this.importHttpResponse}).pipe().subscribe(n=>{this.isPreviewState=!1,this.importHttpResponse=[],this.isSuccessState=!0,this.msgSuccessImport=n.Message})}onPreview(e){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let n=JSON.stringify(this.formData),r=this.importService.generateFormData(this.fileImport,n);this.importService.previewImport("/api/catalog/serial/ImportV2Preview",r).pipe(X(o=>(o instanceof Ce&&(this.uploadState.set(3),this.state="upload",console.error("Error during import preview:",o)),J(()=>o)))).subscribe({next:o=>{e.selected.completed=!0,e.next(),this.cacheKey=o.CacheKey,this.canProceedPreview=o.CanProceed,this.importedTreeData=o.DataRow,this.summaryProducts=o.Summary,this.treeData.update(()=>o.DataRow),this.statusFilters=this.generateStatusFilters(o.DataRow),this.activeFilters.set(this.statusFilters.map(u=>u.value)),this.initIsDisabledImport(),this.uploadState.set(2)},error:o=>{console.log("error",o)}})}initIsDisabledImport(){let e=JSON.stringify(this.importHttpResponse).toLowerCase().includes('"statusid":2');this.isDisabledImportBtn=e}alertConfirmInventory(){return!(this.formData.InventoryUpdate&&!confirm("Update Inventory is YES. This is will replace current inventory. Do you want to proceed?"))}onImportFileChange(e){this.fileImport=e,this.isPreviewState=!1}onNewImport(){this.isSuccessState=!1}onUploadCsv(e){this.fileImport=e}selectionChange(e){let n=e.selectedStep.label;this.state=n}upload(e){if(!this.summaryProducts||!this.canProceedPreview){this.toastr.error("No data to import. Please check your file and try again.",E.Error);return}this.matDialog.open(j,{data:{summary:this.summaryProducts,canProceed:this.canProceedPreview}}).afterClosed().pipe(ee(n=>{n==="error"&&(this.pickAll=[],this.filterTreeCondition=["Error"])}),Y(n=>n==="confirm"),Z(()=>this.httpService.post("/api/catalog/serial/ImportV2Confirm",{CacheKey:this.cacheKey}))).subscribe(n=>{e.selected.completed=!0,this.toastr.success(`Success import ${n.Rows} rows.`,E.Success),e.next(),this.totalRowsImported=n.Rows,this.uploaded=!0,this.newAdditionalData=k({},n),this.confirmData=n})}onBack(e){e.selected.completed=!1,this.state=e.selected.label,this.fileImport=null,e.previous(),this.uploadState.set(1)}newUpload(e){e.reset(),this.uploaded=!1,this.state="upload",this.fileImport=null,this.cacheKey="",this.canProceedPreview=!1,this.importedTreeData=[],this.summaryProducts={},this.uploadState.set(0)}filterTree(){}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(n){return new(n||t)(S(Ve),S(be),S(ge),S(Je),S(B),S(Fe))};static \u0275cmp=y({type:t,selectors:[["POS-import-serial-v2"]],features:[te],decls:1,vars:1,consts:[["stepper",""],["cellTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-success","ms-3"],[1,"btn","btn-outline-secondary"],["ngProjectAs","content",5,["content"]],["orientation","horizontal",3,"selectionChange","linear"],["matStepperIcon","edit"],["label","upload","state","upload",2,"margin-top","50px",3,"editable","completed"],[1,"d-flex","flex-column","align-items-center"],[1,"d-flex","justify-content-center"],["matStepLabel",""],["matStepperIcon","done"],[3,"dashboardPropsConfiguration","subtitle"],[3,"sampleUrl","dashboardPropsConfiguration","subtitle"],[1,"text-body-secondary","fst-italic","h6","mt-5","ms-2",2,"width","580px","z-index","99"],["href","//support.dealpos.com/en/articles/4773747-import-product-list-using-excel-csv-file","target","_blank"],["label","preview","state","preview",3,"editable","completed"],["filterField","Action",3,"selectedFiltersChange","nodes","columns","filterOptions","selectedFilters"],["label","finish","state","finish"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"mt-5",2,"min-width","550px"],["hideToggle","","disabled",""],[1,"fw-bold"],[1,"btn","btn-success","ms-3",3,"click"],[1,"btn","btn-outline-secondary",3,"click"],[1,"btn","btn-success","ms-3",3,"click","disabled"],[1,"fa-solid","fa-upload","me-3"],[3,"fileUploaded","dashboardPropsConfiguration","subtitle"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-download","text-primary"],["href","https://cdn.dealpos.xyz/web-import-template/Sample_Serial.csv",1,"link"],[3,"fileUploaded","sampleUrl","dashboardPropsConfiguration","subtitle"],[1,"fa-regular","fa-file","me-3"],[1,"text-black"],[1,"fa-solid","fa-check","me-3"]],template:function(n,r){n&1&&m(0,Wt,43,18,"mainpanel-cmp",2),n&2&&d(r.formData&&r.data?0:-1)},dependencies:[Re,Oe,We,qe,Le,tt,Ye,Xe,et,Ze,$,ze,He,ue],styles:["[_nghost-%COMP%] .mat-horizontal-stepper-header-container{width:40%;margin:0 auto}"]})};export{rt as ImportSerialV2Component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as zt}from"./chunk-5774FBXG.js";import{a as Ft,d as Rt,e as Kt,f as $t,g as Ht}from"./chunk-F26TML5Q.js";import{d as Ot}from"./chunk-CZI7HUE6.js";import{a as At,b as Ze}from"./chunk-DA33S43F.js";import{a as Bt,b as je}from"./chunk-KLLRDRG7.js";import{b as Vt}from"./chunk-J7XZRRKK.js";import{h as Pt}from"./chunk-5OLVUC6J.js";import{b as Ue,c as qe,f as Qe}from"./chunk-GMF3SGSZ.js";import{b as Nt}from"./chunk-V25UXFNL.js";import{a as P}from"./chunk-3UB7PEG5.js";import{b as Dt,c as St,d as $e,e as kt,i as He,j as ze}from"./chunk-WIUSOID5.js";import{D as Ct,E as Be,Ea as Lt,H as vt,L as Tt,O as Mt,X as Fe,_ as V,b as bt,d as Oe,ea as Re,fa as Ke,h as Ve,la as wt,n as It,q as Ae,s as yt,sa as Et,va as fe,wa as ne,x as ee,y as te}from"./chunk-K7ICHNI3.js";import{E as gt,c as ut,h as _t,o as ht}from"./chunk-POUQHZWU.js";import{b as xt}from"./chunk-
|
|
1
|
+
import{a as zt}from"./chunk-5774FBXG.js";import{a as Ft,d as Rt,e as Kt,f as $t,g as Ht}from"./chunk-F26TML5Q.js";import{d as Ot}from"./chunk-CZI7HUE6.js";import{a as At,b as Ze}from"./chunk-DA33S43F.js";import{a as Bt,b as je}from"./chunk-KLLRDRG7.js";import{b as Vt}from"./chunk-J7XZRRKK.js";import{h as Pt}from"./chunk-5OLVUC6J.js";import{b as Ue,c as qe,f as Qe}from"./chunk-GMF3SGSZ.js";import{b as Nt}from"./chunk-V25UXFNL.js";import{a as P}from"./chunk-3UB7PEG5.js";import{b as Dt,c as St,d as $e,e as kt,i as He,j as ze}from"./chunk-WIUSOID5.js";import{D as Ct,E as Be,Ea as Lt,H as vt,L as Tt,O as Mt,X as Fe,_ as V,b as bt,d as Oe,ea as Re,fa as Ke,h as Ve,la as wt,n as It,q as Ae,s as yt,sa as Et,va as fe,wa as ne,x as ee,y as te}from"./chunk-K7ICHNI3.js";import{E as gt,c as ut,h as _t,o as ht}from"./chunk-POUQHZWU.js";import{b as xt}from"./chunk-H3D4WR27.js";import{a as mt}from"./chunk-PTRS3UA6.js";import{n as pt,q as ft}from"./chunk-D3E5UKKJ.js";import{$b as N,Aa as se,Ab as l,Bb as m,Ca as tt,Cb as p,Da as A,Db as g,Hb as j,Ib as G,Ic as B,Jb as W,Ka as Te,Lc as ke,Ma as nt,Mb as k,Md as dt,Nd as ct,Pb as C,Pd as Pe,Qc as $,Ra as c,Rb as a,Ua as U,Ub as le,Uc as he,Vb as X,Wb as M,Xa as q,Xb as w,Xc as rt,Ya as y,Zc as H,_c as z,ab as Q,bb as ae,bc as it,cb as Z,cc as de,dc as h,ec as O,fb as Me,fc as ot,fd as st,ga as Je,gb as b,gc as R,ha as et,hd as at,ia as re,id as lt,ja as ye,jc as ce,jd as Ne,kc as me,kd as ge,la as T,lc as pe,ob as we,pa as u,pb as E,qa as _,ra as Ce,sb as De,sd as Y,tb as L,tc as Se,td as J,uc as ue,vb as S,vc as _e,wa as x,wc as K,xa as ve,yb as Ee,za as D,zb as Le}from"./chunk-M3O2GJ3M.js";import{a as F,b as oe}from"./chunk-KMHZKFQS.js";var Ut=`
|
|
2
2
|
.p-contextmenu {
|
|
3
3
|
background: dt('contextmenu.background');
|
|
4
4
|
color: dt('contextmenu.color');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ne,b as ae}from"./chunk-7DDSY4T5.js";import"./chunk-AKURDWYM.js";import"./chunk-XUQBRL5R.js";import"./chunk-P5YW6ELU.js";import"./chunk-UVAFCFHT.js";import{a as ie}from"./chunk-IEFU4ZWW.js";import{p as te}from"./chunk-VQQIQFUB.js";import"./chunk-HKSUQNKJ.js";import"./chunk-DLBX5RSU.js";import"./chunk-YHKX3K56.js";import"./chunk-O3LZKJY2.js";import"./chunk-WLNLF7ZT.js";import"./chunk-MPGXQK5L.js";import"./chunk-IDHUYY2U.js";import"./chunk-A75ZS57D.js";import"./chunk-HSGXXXIK.js";import{a as ee}from"./chunk-75C5S3PQ.js";import"./chunk-IA2WDKQU.js";import{a as Q}from"./chunk-
|
|
1
|
+
import{a as ne,b as ae}from"./chunk-7DDSY4T5.js";import"./chunk-AKURDWYM.js";import"./chunk-XUQBRL5R.js";import"./chunk-P5YW6ELU.js";import"./chunk-UVAFCFHT.js";import{a as ie}from"./chunk-IEFU4ZWW.js";import{p as te}from"./chunk-VQQIQFUB.js";import"./chunk-HKSUQNKJ.js";import"./chunk-DLBX5RSU.js";import"./chunk-YHKX3K56.js";import"./chunk-O3LZKJY2.js";import"./chunk-WLNLF7ZT.js";import"./chunk-MPGXQK5L.js";import"./chunk-IDHUYY2U.js";import"./chunk-A75ZS57D.js";import"./chunk-HSGXXXIK.js";import{a as ee}from"./chunk-75C5S3PQ.js";import"./chunk-IA2WDKQU.js";import{a as Q}from"./chunk-DBROGHP5.js";import"./chunk-7GHVZIGG.js";import"./chunk-MH5R4QUS.js";import"./chunk-6KJTU3AF.js";import"./chunk-TQ2YP2CL.js";import{a as K,g as Z,h as $}from"./chunk-FI4ADJ7Y.js";import"./chunk-FSAQ7W4Y.js";import"./chunk-DA33S43F.js";import"./chunk-BSOZMEUZ.js";import"./chunk-KLLRDRG7.js";import"./chunk-GFPR5PLO.js";import"./chunk-7K5H76G7.js";import"./chunk-BXQZZ4SS.js";import"./chunk-J7XZRRKK.js";import"./chunk-FOEAOA4G.js";import"./chunk-DZAEKVKZ.js";import"./chunk-5OLVUC6J.js";import"./chunk-LT46RQOD.js";import{a as Y}from"./chunk-V6I4U3FF.js";import"./chunk-5E52ZWKI.js";import"./chunk-JFJGBJM3.js";import"./chunk-23G4CQ4S.js";import"./chunk-Q6MS4QZ6.js";import"./chunk-GMF3SGSZ.js";import"./chunk-5NWJYNJO.js";import"./chunk-36TOKQZQ.js";import"./chunk-XS4UTUMZ.js";import"./chunk-D3PKFTVO.js";import"./chunk-V25UXFNL.js";import"./chunk-YNQPX5G6.js";import"./chunk-VAJAIBT3.js";import"./chunk-ETHMD4GO.js";import"./chunk-DCS4THVW.js";import{d as X}from"./chunk-RBBEZN3D.js";import"./chunk-S4263DWI.js";import"./chunk-R2YNXAPB.js";import"./chunk-MMKYHF6F.js";import"./chunk-LJWHBKHI.js";import{a as k}from"./chunk-SY5NNN4M.js";import"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import"./chunk-RXZDFS3M.js";import{a as J}from"./chunk-3UB7PEG5.js";import"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import"./chunk-WIUSOID5.js";import"./chunk-K7ICHNI3.js";import{E as q,h as G,o as U}from"./chunk-POUQHZWU.js";import"./chunk-KM4ASOAJ.js";import"./chunk-YPRM4YPL.js";import"./chunk-MNXZMQRB.js";import"./chunk-H3D4WR27.js";import"./chunk-PTRS3UA6.js";import"./chunk-ZPXUDL2F.js";import{n as H,q as z}from"./chunk-D3E5UKKJ.js";import{Ab as l,Bb as a,Cb as r,Cc as w,Db as T,Dc as F,Ic as N,Mb as b,Pb as v,Ra as c,Rb as p,W as I,Ya as D,ab as O,ca as B,e as x,ec as u,fb as E,gb as M,jc as C,kc as g,la as P,lc as _,ld as j,pa as m,qa as s,sd as R,tb as S,vb as y,wb as L,yb as W,za as A,zb as V}from"./chunk-M3O2GJ3M.js";import"./chunk-KMHZKFQS.js";function oe(o,d){if(o&1){let t=b();a(0,"button",6),v("click",function(){m(t);let e=p();return s(e.onPrint())}),T(1,"i",7),a(2,"span"),u(3,"Print"),r()()}}function le(o,d){if(o&1){let t=b();a(0,"div",8)(1,"h6"),u(2,"Outlet"),r(),a(3,"outlet-selector",9),v("ngModelChange",function(e){m(t);let n=p();return s(n.onEntityIDChange(e))}),r(),a(4,"h6"),u(5,"Sales Order Tag"),r(),a(6,"ng-select",10),_("ngModelChange",function(e){m(t);let n=p();return g(n.pageData().Filter.SalesOrderTagID,e)||(n.pageData().Filter.SalesOrderTagID=e),s(e)}),r(),a(7,"h6"),u(8,"From"),r(),a(9,"div",11)(10,"div",12)(11,"datepicker",13),_("dateChange",function(e){m(t);let n=p();return g(n.pageData().Filter.From,e)||(n.pageData().Filter.From=e),s(e)}),r()(),a(12,"div",12)(13,"app-timepicker",14),_("timeChange",function(e){m(t);let n=p();return g(n.pageData().Filter.StartTime,e)||(n.pageData().Filter.StartTime=e),s(e)}),r()()(),a(14,"h6"),u(15,"To"),r(),a(16,"div",11)(17,"div",12)(18,"datepicker",15),_("dateChange",function(e){m(t);let n=p();return g(n.pageData().Filter.To,e)||(n.pageData().Filter.To=e),s(e)}),r()(),a(19,"div",12)(20,"app-timepicker",14),_("timeChange",function(e){m(t);let n=p();return g(n.pageData().Filter.EndTime,e)||(n.pageData().Filter.EndTime=e),s(e)}),r()()()()}if(o&2){let t,i=p();c(3),l("accessType",2)("ngModel",i.pageData().Filter.EntityID),c(3),l("items",(t=i.pageData())==null||t.Options==null?null:t.Options.SalesOrderTags),C("ngModel",i.pageData().Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),C("date",i.pageData().Filter.From),l("hidelClearBtn",!0),c(2),C("time",i.pageData().Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),C("date",i.pageData().Filter.To),c(2),C("time",i.pageData().Filter.EndTime),l("fullWidth",!0)}}function pe(o,d){o&1&&(a(0,"div",19),u(1,"\xA0"),r())}function me(o,d){if(o&1&&(T(0,"pos-receipt-a4",16),a(1,"div",17),T(2,"div",18),r(),S(3,pe,2,0,"div",19)),o&2){let t=d.$implicit,i=d.$index,e=p(),n=p();l("data",t)("printTemplate",n.printTemplates==null?null:n.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),y(i!==(e.Data==null?null:e.Data.length)-1?3:-1)}}function se(o,d){o&1&&W(0,me,4,7,null,null,L),o&2&&V(d.Data)}var re=class o extends Q{constructor(t,i,e){super(t,i,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=i;this.initPrintListener()}dialogFilter=P(K);receipts$;printTemplates;invoiceIds=A([]);validatedSubject=new x(!1);preInitList(){this.pageData().Filter.From=new Date,this.pageData().Filter.To=new Date,this.pageData().Filter.StartTime="00:00",this.pageData().Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(k.GetBulkPrintA4,this.pageData().Filter).pipe(B(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",J.Info):this.generatePrintTemplate(t.PrintTemplates),this.invoiceIds.set(t.Data.map(i=>i?.Invoice?.ID))}),I(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(i=>[i.ID,i]))}getOpenDialogOptions(){return{validated$:this.validatedSubject.asObservable()}}onEntityIDChange(t){this.pageData().Filter.EntityID=t,this.validatedSubject.next(!!t)}onNewPrint(){this.dialogFilter.openDialog({validated$:this.validatedSubject.asObservable()})}onPrint(){window.setTimeout(function(){window.print()},500)}initPrintListener(){window.addEventListener("afterprint",this.handleAfterPrint)}handleAfterPrint=()=>{this.invoiceIds()?.length>0&&this.httpService.post(k.UpdateLastPrintByListID,{ListID:this.invoiceIds()}).subscribe()};ngOnDestroy(){window.removeEventListener("afterprint",this.handleAfterPrint)}static \u0275fac=function(i){return new(i||o)(D(Y),D(z),D(H))};static \u0275cmp=O({type:o,selectors:[["bulk-invoice-A4"]],features:[E],decls:13,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","hideSearchBox","text","filter","isFilterOnDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],["customContainerClass","pos-bulk-invoice",3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(i,e){if(i&1){let n=b();a(0,"mainpanel-cmp",1),_("textChange",function(f){return m(n),g(e.pageData().Filter.Number,f)||(e.pageData().Filter.Number=f),s(f)}),v("onSubmit",function(){return e.onFilter()}),_("filterChange",function(f){return m(n),g(e.pageData().Filter,f)||(e.pageData().Filter=f),s(f)}),a(1,"actions"),S(2,oe,4,0,"button",2),w(3,"async"),a(4,"button",3),v("click",function(){return e.onNewPrint()}),u(5,"New"),r()(),a(6,"div",4),M(7,le,21,14,"ng-template",null,0,N),r(),a(9,"content")(10,"div",5),S(11,se,2,0),w(12,"async"),r()()()}if(i&2){let n,h;l("pageData",e.menuData())("hideSearchBox",!0),C("text",e.pageData().Filter.Number)("filter",e.pageData().Filter),l("isFilterOnDropdown",!1),c(2),y(((n=F(3,7,e.receipts$))==null||n.Data==null?null:n.Data.length)>0?2:-1),c(9),y((h=F(12,9,e.printTemplates&&e.receipts$))?11:-1,h)}},dependencies:[R,ae,ne,$,Z,ee,X,te,q,G,U,ie,j],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"],changeDetection:0})};export{re as BulkInvoiceA4Component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-5YIVDPX6.js";import{a as d}from"./chunk-SY5NNN4M.js";import{a as c}from"./chunk-3UB7PEG5.js";import{a as m}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-5YIVDPX6.js";import{a as d}from"./chunk-SY5NNN4M.js";import{a as c}from"./chunk-3UB7PEG5.js";import{a as m}from"./chunk-ZPXUDL2F.js";import{n as h,q as u}from"./chunk-D3E5UKKJ.js";import{ha as l,la as o}from"./chunk-M3O2GJ3M.js";import{j as p}from"./chunk-KMHZKFQS.js";var b=class n{toastr=o(h);httpService=o(u);copyToClipBoard=o(g);createCustomerFromNewNumberAndSendReceipt(e,r,t,i,a){t==0?this.httpService.post(d.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{b as le}from"./chunk-JCUDUZIE.js";import{a as se}from"./chunk-NQX7EX5A.js";import{a as oe}from"./chunk-7LMWGFXC.js";import{a as te,c as ie,e as ae,f as ne,g as re}from"./chunk-6ZKW6NGS.js";import{p as ee}from"./chunk-VQQIQFUB.js";import{b as U}from"./chunk-WLNLF7ZT.js";import{c as Z}from"./chunk-TQ2YP2CL.js";import{a as Y}from"./chunk-KR74ZZ6U.js";import{g as J}from"./chunk-5NWJYNJO.js";import{d as X}from"./chunk-RBBEZN3D.js";import{a as z}from"./chunk-3UB7PEG5.js";import{E as q,c as K,h as G,o as j}from"./chunk-POUQHZWU.js";import{a as N}from"./chunk-PTRS3UA6.js";import{n as $}from"./chunk-D3E5UKKJ.js";import{$b as v,Aa as B,Ab as f,Bb as o,Cb as l,Cc as R,Db as g,Dc as A,Mb as b,Pb as u,Pc as S,Qc as C,Ra as s,Rb as d,Uc as W,W as F,Ya as T,ab as P,ca as O,ec as p,fc as k,gc as V,jc as x,kc as y,lc as D,ld as H,pa as m,qa as c,r as Q,sd as L,tb as _,vb as h,xb as w,yb as M,zb as E}from"./chunk-M3O2GJ3M.js";function ce(r,a){r&1&&(o(0,"div",2)(1,"div",5),p(2,"Edit Serial is disabled during EDIT MODE"),l(),o(3,"div"),p(4,"If you make a mistake, please delete the item and then add again"),l()())}function pe(r,a){if(r&1){let e=b();o(0,"mat-chip-row",16),u("removed",function(){let i=m(e).$implicit,n=d(3);return c(n.onRemoveSerialChip(i))}),p(1),o(2,"button",17),g(3,"i",18),l()()}if(r&2){let e=a.$implicit;s(),V(" ",e," ")}}function ue(r,a){if(r&1){let e=b();o(0,"div",7)(1,"div",9)(2,"mat-form-field",10),u("keyup.enter",function(i){return i.stopPropagation()}),o(3,"mat-chip-grid",null,0),M(5,pe,4,1,"mat-chip-row",null,w),o(7,"input",11,1),u("matChipInputTokenEnd",function(i){m(e);let n=v(8),I=d(2);return c(I.addSerial(i,n))}),l()()()(),o(9,"div",12)(10,"button",13),u("click",function(){m(e);let i=v(8),n=d(2);return c(n.submitSerial(i))}),g(11,"i",14),o(12,"strong",15),p(13,"ADD"),l()()()()}if(r&2){let e=v(4),t=d(2);s(5),E(t.serials()),s(2),f("placeholder",t.isBatchNumber()?"E.g. Batch1, Batch2":"E.g. Serial1, Serial2")("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes)}}function _e(r,a){if(r&1){let e=b();o(0,"div",8)(1,"ng-select",19),R(2,"async"),D("ngModelChange",function(i){m(e);let n=d(2);return y(n.serials,i)||(n.serials=i),c(i)}),u("remove",function(i){m(e);let n=d(2);return c(n.onRemoveSerialFromOption(i.value))})("change",function(i){m(e);let n=d(2);return c(n.onSelectSerial(i))}),l()()}if(r&2){let e=d(2);s(),f("items",A(2,4,e.variantSerials$))("placeholder",e.isBatchNumber()?"Select Batch Number":"Select Serial"),x("ngModel",e.serials),f("multiple",!0)}}function he(r,a){if(r&1&&(o(0,"div",3)(1,"div",6),_(2,ue,14,3,"div",7)(3,_e,3,6,"div",8),l()()),r&2){let e=d();s(2),h(e.isReturn?3:2)}}function Ce(r,a){r&1&&g(0,"th",23)}function fe(r,a){if(r&1){let e=b();o(0,"td",27)(1,"i",30),u("click",function(){m(e);let i=d(),n=i.$implicit,I=i.$index,me=d(2);return c(me.onRemoveSerial(I,n.Number))}),l()()}}function be(r,a){if(r&1){let e=b();o(0,"tr"),_(1,fe,2,0,"td",27),o(2,"td"),p(3),l(),o(4,"td")(5,"datepicker",28),D("dateChange",function(i){let n=m(e).$implicit;return y(n.ExpiryDate,i)||(n.ExpiryDate=i),c(i)}),l()(),o(6,"td")(7,"input",29),D("ngModelChange",function(i){let n=m(e).$implicit;return y(n.Quantity,i)||(n.Quantity=i),c(i)}),u("change",function(){m(e);let i=d(2);return c(i.serialQtyChange())}),l()()()}if(r&2){let e,t,i=a.$implicit,n=d(2);s(),h(n.disabledEditQty()?-1:1),s(2),k(i.Number),s(2),x("date",i.ExpiryDate),f("disabled",n.disabledEditQty()&&n.constants.IsNotEmpty((e=n.variant())==null?null:e.ID)),s(2),x("ngModel",i.Quantity),f("disabled",n.disabledEditQty()&&n.constants.IsNotEmpty((t=n.variant())==null?null:t.ID)||!n.isBatchNumber())("decimalPlaces",0)}}function Se(r,a){if(r&1&&(o(0,"div",4)(1,"div",6)(2,"div",20)(3,"table",21)(4,"thead",22)(5,"tr"),_(6,Ce,1,0,"th",23),o(7,"th",24),p(8),l(),o(9,"th",25),p(10,"Expiry Date"),l(),o(11,"th",26),p(12,"Quantity"),l()()(),o(13,"tbody"),M(14,be,8,7,"tr",null,w),l()()()()()),r&2){let e=d();s(6),h(e.disabledEditQty()?-1:6),s(2),V(" ",e.isBatchNumber()?"Batch":"Serial"," Number "),s(6),E(e.serialData)}}var de=class r{constructor(a,e){this.productService=a;this.toastr=e;B(()=>{let t=this.variant();t&&(this.initSerial(t),t.Quantity<0&&(this.isReturn=!0,this.initVariantSerial(t)))})}disabledAddSerial=C(!1);disabledEditQty=C(!1);outletID=C("");serials=W([]);isBatchNumber=C(!1);isFocusOnSerialInput=C(!1);isFocusOnSerialInputChange=S();constants=N;separatorKeysCodes=[13,188];variant=C(null);serialsChange=S();variantChange=S();onSerialDataChange=S();isReturn=!1;serialData=[];variantSerials$;initSerial(a){N.IsEmpty(a.Serial)&&(a.Serial=[]),a.Serial&&(this.serialData=a.Serial)}initVariantSerial(a){let e=a.VariantID,t;this.variantSerials$=this.productService.getVariantSerial(this.outletID(),e).pipe(Q(i=>i.map(n=>(t=new se,t.Number=n.Number,t.Quantity=n.Quantity,t))),O(()=>{this.serials.set(this.serialData.map(i=>i.Number))}),F(1))}onFocusAddSerial(){this.isFocusOnSerialInputChange.emit(!0)}onBlurAddSerial(){this.isFocusOnSerialInputChange.emit(!1)}serialQtyChange(){this.variant().Serial=this.serialData,this.updateItemQty(),this.updateVariant(),this.onSerialDataChange.emit(this.serialData)}onRemoveSerial(a,e){this.serialData.splice(a,1),this.updateItemQty(),this.updateVariant()}onRemoveSerialChip(a){this.serials.update(e=>e.filter(t=>t!==a)),this.serialsChange.emit(this.serials()),this.variant().Quantity--}updateVariant(){this.variant().Serial=this.serialData,this.onSerialDataChange.emit(this.serialData),this.variantChange.emit(this.variant())}updateItemQty(){let a=this.calculateSerialQty(this.serialData);this.variant().Quantity=a==0?1:a}calculateSerialQty(a){let e=0;return a.forEach(t=>{e+=t.Quantity}),e}onSelectSerial(a){let e=a.filter(t=>this.serialData.findIndex(i=>i.Number==t.Number)==-1);e.length>0&&(e[0].Quantity=this.isReturn?-1:1,this.serialData=[...this.serialData,...e],this.updateItemQty(),this.updateVariant())}onRemoveSerialFromOption(a){this.serialData=this.serialData.filter(e=>e.Number!=a.Number),this.updateItemQty(),this.updateVariant()}submitSerial(a){a.value.trim()&&(this.serials.update(t=>[...t,a.value.trim()]),a.value="");let e=this.generateSerialData();this.serialData=[...this.serialData,...e],this.updateItemQty(),this.updateVariant(),this.serials.set([]),this.serialsChange.emit(this.serials())}generateSerialData(){let a=this.serials().filter(e=>this.serialData.findIndex(t=>t.Number==e)==-1).map(e=>({Number:e,Quantity:this.isReturn?-1:1,ExpiryDate:null}));return this.onSerialDataChange.emit(a),a}addSerial(a,e){let t=(a.value||"").trim();if(t)if(this.serials().find(i=>i==t)){e.value="",this.toastr.info("Serial already exists",z.Info);return}else this.serials.update(i=>[...i,t]),this.serialsChange.emit(this.serials()),this.variant().Quantity=this.serials().length+this.variant().Serial.length,this.updateVariant();a.chipInput.clear()}static \u0275fac=function(e){return new(e||r)(T(oe),T($))};static \u0275cmp=P({type:r,selectors:[["POS-tab-serial"]],inputs:{disabledAddSerial:[1,"disabledAddSerial"],disabledEditQty:[1,"disabledEditQty"],outletID:[1,"outletID"],serials:[1,"serials"],isBatchNumber:[1,"isBatchNumber"],isFocusOnSerialInput:[1,"isFocusOnSerialInput"],variant:[1,"variant"]},outputs:{serials:"serialsChange",isFocusOnSerialInputChange:"isFocusOnSerialInputChange",serialsChange:"serialsChange",variantChange:"variantChange",onSerialDataChange:"onSerialDataChange"},decls:3,vars:3,consts:[["chipGrid",""],["inputChip",""],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"row","mt-8"],[1,"row","mb-6"],[1,"fw-bold"],[1,"col-12"],[1,"input-group"],[1,"mb-6"],[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",3,"ngModelChange","remove","change","items","placeholder","ngModel","multiple"],[1,"table-responsive"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end",2,"width","40px"],[1,"border-end"],[1,"border-end",2,"width","150px"],[1,"border-end","text-end",2,"width","60px"],[1,"text-center"],["appearance","fill","width","150px","name","orderDate",3,"dateChange","date","disabled"],["type","text","placeholder","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,t){if(e&1&&(_(0,ce,5,0,"div",2),_(1,he,4,1,"div",3),_(2,Se,16,2,"div",4)),e&2){let i;h(t.disabledEditQty()&&t.constants.IsNotEmpty((i=t.variant())==null?null:i.ID)?0:-1),s(),h(t.disabledAddSerial()?-1:1),s(),h((t.serialData==null?null:t.serialData.length)>0?2:-1)}},dependencies:[L,q,K,G,j,Y,X,ee,Z,re,ae,ne,te,ie,U,J,le,H],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} .mat-mdc-form-field.datepicker{width:150px} .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .mat-mdc-text-field-wrapper[_ngcontent-%COMP%] .mat-mdc-form-field-input-control[_ngcontent-%COMP%]{height:20px!important}"],changeDetection:0})};export{de as a};
|
|
1
|
+
import{b as le}from"./chunk-JCUDUZIE.js";import{a as se}from"./chunk-NQX7EX5A.js";import{a as oe}from"./chunk-H5DKJDHK.js";import{a as te,c as ie,e as ae,f as ne,g as re}from"./chunk-6ZKW6NGS.js";import{p as ee}from"./chunk-VQQIQFUB.js";import{b as U}from"./chunk-WLNLF7ZT.js";import{c as Z}from"./chunk-TQ2YP2CL.js";import{a as Y}from"./chunk-KR74ZZ6U.js";import{g as J}from"./chunk-5NWJYNJO.js";import{d as X}from"./chunk-RBBEZN3D.js";import{a as z}from"./chunk-3UB7PEG5.js";import{E as q,c as K,h as G,o as j}from"./chunk-POUQHZWU.js";import{a as N}from"./chunk-PTRS3UA6.js";import{n as $}from"./chunk-D3E5UKKJ.js";import{$b as v,Aa as B,Ab as f,Bb as o,Cb as l,Cc as R,Db as g,Dc as A,Mb as b,Pb as u,Pc as S,Qc as C,Ra as s,Rb as d,Uc as W,W as F,Ya as T,ab as P,ca as O,ec as p,fc as k,gc as V,jc as x,kc as y,lc as D,ld as H,pa as m,qa as c,r as Q,sd as L,tb as _,vb as h,xb as w,yb as M,zb as E}from"./chunk-M3O2GJ3M.js";function ce(r,a){r&1&&(o(0,"div",2)(1,"div",5),p(2,"Edit Serial is disabled during EDIT MODE"),l(),o(3,"div"),p(4,"If you make a mistake, please delete the item and then add again"),l()())}function pe(r,a){if(r&1){let e=b();o(0,"mat-chip-row",16),u("removed",function(){let i=m(e).$implicit,n=d(3);return c(n.onRemoveSerialChip(i))}),p(1),o(2,"button",17),g(3,"i",18),l()()}if(r&2){let e=a.$implicit;s(),V(" ",e," ")}}function ue(r,a){if(r&1){let e=b();o(0,"div",7)(1,"div",9)(2,"mat-form-field",10),u("keyup.enter",function(i){return i.stopPropagation()}),o(3,"mat-chip-grid",null,0),M(5,pe,4,1,"mat-chip-row",null,w),o(7,"input",11,1),u("matChipInputTokenEnd",function(i){m(e);let n=v(8),I=d(2);return c(I.addSerial(i,n))}),l()()()(),o(9,"div",12)(10,"button",13),u("click",function(){m(e);let i=v(8),n=d(2);return c(n.submitSerial(i))}),g(11,"i",14),o(12,"strong",15),p(13,"ADD"),l()()()()}if(r&2){let e=v(4),t=d(2);s(5),E(t.serials()),s(2),f("placeholder",t.isBatchNumber()?"E.g. Batch1, Batch2":"E.g. Serial1, Serial2")("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes)}}function _e(r,a){if(r&1){let e=b();o(0,"div",8)(1,"ng-select",19),R(2,"async"),D("ngModelChange",function(i){m(e);let n=d(2);return y(n.serials,i)||(n.serials=i),c(i)}),u("remove",function(i){m(e);let n=d(2);return c(n.onRemoveSerialFromOption(i.value))})("change",function(i){m(e);let n=d(2);return c(n.onSelectSerial(i))}),l()()}if(r&2){let e=d(2);s(),f("items",A(2,4,e.variantSerials$))("placeholder",e.isBatchNumber()?"Select Batch Number":"Select Serial"),x("ngModel",e.serials),f("multiple",!0)}}function he(r,a){if(r&1&&(o(0,"div",3)(1,"div",6),_(2,ue,14,3,"div",7)(3,_e,3,6,"div",8),l()()),r&2){let e=d();s(2),h(e.isReturn?3:2)}}function Ce(r,a){r&1&&g(0,"th",23)}function fe(r,a){if(r&1){let e=b();o(0,"td",27)(1,"i",30),u("click",function(){m(e);let i=d(),n=i.$implicit,I=i.$index,me=d(2);return c(me.onRemoveSerial(I,n.Number))}),l()()}}function be(r,a){if(r&1){let e=b();o(0,"tr"),_(1,fe,2,0,"td",27),o(2,"td"),p(3),l(),o(4,"td")(5,"datepicker",28),D("dateChange",function(i){let n=m(e).$implicit;return y(n.ExpiryDate,i)||(n.ExpiryDate=i),c(i)}),l()(),o(6,"td")(7,"input",29),D("ngModelChange",function(i){let n=m(e).$implicit;return y(n.Quantity,i)||(n.Quantity=i),c(i)}),u("change",function(){m(e);let i=d(2);return c(i.serialQtyChange())}),l()()()}if(r&2){let e,t,i=a.$implicit,n=d(2);s(),h(n.disabledEditQty()?-1:1),s(2),k(i.Number),s(2),x("date",i.ExpiryDate),f("disabled",n.disabledEditQty()&&n.constants.IsNotEmpty((e=n.variant())==null?null:e.ID)),s(2),x("ngModel",i.Quantity),f("disabled",n.disabledEditQty()&&n.constants.IsNotEmpty((t=n.variant())==null?null:t.ID)||!n.isBatchNumber())("decimalPlaces",0)}}function Se(r,a){if(r&1&&(o(0,"div",4)(1,"div",6)(2,"div",20)(3,"table",21)(4,"thead",22)(5,"tr"),_(6,Ce,1,0,"th",23),o(7,"th",24),p(8),l(),o(9,"th",25),p(10,"Expiry Date"),l(),o(11,"th",26),p(12,"Quantity"),l()()(),o(13,"tbody"),M(14,be,8,7,"tr",null,w),l()()()()()),r&2){let e=d();s(6),h(e.disabledEditQty()?-1:6),s(2),V(" ",e.isBatchNumber()?"Batch":"Serial"," Number "),s(6),E(e.serialData)}}var de=class r{constructor(a,e){this.productService=a;this.toastr=e;B(()=>{let t=this.variant();t&&(this.initSerial(t),t.Quantity<0&&(this.isReturn=!0,this.initVariantSerial(t)))})}disabledAddSerial=C(!1);disabledEditQty=C(!1);outletID=C("");serials=W([]);isBatchNumber=C(!1);isFocusOnSerialInput=C(!1);isFocusOnSerialInputChange=S();constants=N;separatorKeysCodes=[13,188];variant=C(null);serialsChange=S();variantChange=S();onSerialDataChange=S();isReturn=!1;serialData=[];variantSerials$;initSerial(a){N.IsEmpty(a.Serial)&&(a.Serial=[]),a.Serial&&(this.serialData=a.Serial)}initVariantSerial(a){let e=a.VariantID,t;this.variantSerials$=this.productService.getVariantSerial(this.outletID(),e).pipe(Q(i=>i.map(n=>(t=new se,t.Number=n.Number,t.Quantity=n.Quantity,t))),O(()=>{this.serials.set(this.serialData.map(i=>i.Number))}),F(1))}onFocusAddSerial(){this.isFocusOnSerialInputChange.emit(!0)}onBlurAddSerial(){this.isFocusOnSerialInputChange.emit(!1)}serialQtyChange(){this.variant().Serial=this.serialData,this.updateItemQty(),this.updateVariant(),this.onSerialDataChange.emit(this.serialData)}onRemoveSerial(a,e){this.serialData.splice(a,1),this.updateItemQty(),this.updateVariant()}onRemoveSerialChip(a){this.serials.update(e=>e.filter(t=>t!==a)),this.serialsChange.emit(this.serials()),this.variant().Quantity--}updateVariant(){this.variant().Serial=this.serialData,this.onSerialDataChange.emit(this.serialData),this.variantChange.emit(this.variant())}updateItemQty(){let a=this.calculateSerialQty(this.serialData);this.variant().Quantity=a==0?1:a}calculateSerialQty(a){let e=0;return a.forEach(t=>{e+=t.Quantity}),e}onSelectSerial(a){let e=a.filter(t=>this.serialData.findIndex(i=>i.Number==t.Number)==-1);e.length>0&&(e[0].Quantity=this.isReturn?-1:1,this.serialData=[...this.serialData,...e],this.updateItemQty(),this.updateVariant())}onRemoveSerialFromOption(a){this.serialData=this.serialData.filter(e=>e.Number!=a.Number),this.updateItemQty(),this.updateVariant()}submitSerial(a){a.value.trim()&&(this.serials.update(t=>[...t,a.value.trim()]),a.value="");let e=this.generateSerialData();this.serialData=[...this.serialData,...e],this.updateItemQty(),this.updateVariant(),this.serials.set([]),this.serialsChange.emit(this.serials())}generateSerialData(){let a=this.serials().filter(e=>this.serialData.findIndex(t=>t.Number==e)==-1).map(e=>({Number:e,Quantity:this.isReturn?-1:1,ExpiryDate:null}));return this.onSerialDataChange.emit(a),a}addSerial(a,e){let t=(a.value||"").trim();if(t)if(this.serials().find(i=>i==t)){e.value="",this.toastr.info("Serial already exists",z.Info);return}else this.serials.update(i=>[...i,t]),this.serialsChange.emit(this.serials()),this.variant().Quantity=this.serials().length+this.variant().Serial.length,this.updateVariant();a.chipInput.clear()}static \u0275fac=function(e){return new(e||r)(T(oe),T($))};static \u0275cmp=P({type:r,selectors:[["POS-tab-serial"]],inputs:{disabledAddSerial:[1,"disabledAddSerial"],disabledEditQty:[1,"disabledEditQty"],outletID:[1,"outletID"],serials:[1,"serials"],isBatchNumber:[1,"isBatchNumber"],isFocusOnSerialInput:[1,"isFocusOnSerialInput"],variant:[1,"variant"]},outputs:{serials:"serialsChange",isFocusOnSerialInputChange:"isFocusOnSerialInputChange",serialsChange:"serialsChange",variantChange:"variantChange",onSerialDataChange:"onSerialDataChange"},decls:3,vars:3,consts:[["chipGrid",""],["inputChip",""],[1,"alert","alert-warning","text-center","my-5","py-3"],[1,"row","mt-8"],[1,"row","mb-6"],[1,"fw-bold"],[1,"col-12"],[1,"input-group"],[1,"mb-6"],[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",3,"ngModelChange","remove","change","items","placeholder","ngModel","multiple"],[1,"table-responsive"],[1,"table","table-bordered"],[1,"thead-light"],[1,"border-end",2,"width","40px"],[1,"border-end"],[1,"border-end",2,"width","150px"],[1,"border-end","text-end",2,"width","60px"],[1,"text-center"],["appearance","fill","width","150px","name","orderDate",3,"dateChange","date","disabled"],["type","text","placeholder","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,t){if(e&1&&(_(0,ce,5,0,"div",2),_(1,he,4,1,"div",3),_(2,Se,16,2,"div",4)),e&2){let i;h(t.disabledEditQty()&&t.constants.IsNotEmpty((i=t.variant())==null?null:i.ID)?0:-1),s(),h(t.disabledAddSerial()?-1:1),s(),h((t.serialData==null?null:t.serialData.length)>0?2:-1)}},dependencies:[L,q,K,G,j,Y,X,ee,Z,re,ae,ne,te,ie,U,J,le,H],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} .mat-mdc-form-field.datepicker{width:150px} .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .mat-mdc-text-field-wrapper[_ngcontent-%COMP%] .mat-mdc-form-field-input-control[_ngcontent-%COMP%]{height:20px!important}"],changeDetection:0})};export{de as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-H3D4WR27.js";import{e as o,ha as r,ka as l}from"./chunk-M3O2GJ3M.js";var t=class{constructor(e){this.roleService=e;e&&this.setRole()}_Retrieve;_DateEditor;_NumberEditor;_PriceVisible;_UnitPriceEditor;_PricebookSelector;_Cost;_Return;_Discount;_SalesPerson;_PriceMinimum;_Payment;_CreditSalesLock;_CustomerInputLock;_PaymentCodeLock;_Shipping;_Tax;_DeleteItem;_BundlingPrice;_EmailRestriction;_ParkedDeletionAuthorized;_SellEditor;_ContactCreate;_PrepaidPackageCreate;_Order;_Reprint;_Contacts;_ContactsCreate;_InventoryView;_DebtView;_ClearCart;_SellDelete;_DeliveryEditor;_CouponInputLock;_Park;_Commission;setRole(){this._Retrieve=this.roleService.sell.RetrieveR,this._DateEditor=this.roleService.global.Date,this._NumberEditor=this.roleService.sell.Number,this._PriceVisible=this.roleService.sell.PriceVisible,this._SalesPerson=this.roleService.sell.SalesPerson,this._UnitPriceEditor=this.roleService.sell.UnitPriceEditor,this._PricebookSelector=this.roleService.sell.PricebookSelector,this._Cost=this.roleService.product.Cost,this._Return=this.roleService.sell.Return,this._Discount=this.roleService.sell.Discount,this._PriceMinimum=this.roleService.sell.PriceMinimum,this._Payment=this.roleService.sell.Payment,this._CreditSalesLock=this.roleService.sell.CreditSalesLock,this._CustomerInputLock=this.roleService.sell.CustomerInputLock,this._PaymentCodeLock=this.roleService.sell.PaymentCodeLock,this._Shipping=this.roleService.sell.Shipping,this._Tax=this.roleService.sell.Tax,this._DeleteItem=this.roleService.sell.DeleteItem,this._BundlingPrice=this.roleService.sell.BundlingPrice,this._EmailRestriction=this.roleService.sell.Email,this._SellEditor=this.roleService.sell.Edit,this._ContactCreate=this.roleService.contact.Create,this._PrepaidPackageCreate=this.roleService.prepaidPackage.Create,this._Order=this.roleService.order.View,this._Contacts=this.roleService.contact.View,this._ContactsCreate=this.roleService.contact.Create,this._InventoryView=this.roleService.inventory.View,this._DebtView=this.roleService.debt.View,this._ClearCart=this.roleService.sell.DeleteItem,this._SellDelete=this.roleService.sell.Delete,this._DeliveryEditor=this.roleService.logistic.Edit,this._Reprint=this.roleService.order.Print,this._CouponInputLock=this.roleService.sell.CouponInputLock,this._Park=this.roleService.sell.Park,this._Commission=this.roleService.product.CommissionView}get Park(){return this._Park}get CouponInputLock(){return this._CouponInputLock}set CouponInputLock(e){this._CouponInputLock=e}get Retrieve(){return this._Retrieve}get DateEditor(){return this._DateEditor}set DateEditor(e){this._DateEditor=e}get NumberEditor(){return this._NumberEditor}set NumberEditor(e){this._NumberEditor=e}get PriceVisible(){return this._PriceVisible}get UnitPriceEditor(){return this._UnitPriceEditor}set UnitPriceEditor(e){this._UnitPriceEditor=e}get PricebookSelector(){return this._PricebookSelector}set PricebookSelector(e){this._PricebookSelector=e}get Cost(){return this._Cost}get Return(){return this._Return}set Return(e){this._Return=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get SalesPerson(){return this._SalesPerson}get PriceMinimum(){return this._PriceMinimum}get Payment(){return this._Payment}get CreditSalesLock(){return this._CreditSalesLock}get CustomerInputLock(){return this._CustomerInputLock}get PaymentCodeLock(){return this._PaymentCodeLock}get Shipping(){return this._Shipping}get Tax(){return this._Tax}set Tax(e){this._Tax=e}get DeleteItem(){return this._DeleteItem}set DeleteItem(e){this._DeleteItem=e}get BundlingPrice(){return this._BundlingPrice}get Email(){return this._EmailRestriction}get ParkedDeletionAuthorized(){return this._ParkedDeletionAuthorized}set ParkedDeletionAuthorized(e){this._ParkedDeletionAuthorized=e}get SellEditor(){return this._SellEditor}get PrepaidPackageCreate(){return this._PrepaidPackageCreate}get Order(){return this._Order}get Reprint(){return this._Reprint}get Contacts(){return this._Contacts}get ContactsCreate(){return this._ContactsCreate}get InventoryView(){return this._InventoryView}get DebtView(){return this._DebtView}get ClearCartRestriction(){return this._ClearCart}get SellDelete(){return this._SellDelete}get DeliveryEditor(){return this._DeliveryEditor}get Commission(){return this._Commission}};var n=class i{constructor(e){this.roleService=e;this.pushNewValue(new t(e))}_Data=new o(new t(null));get Data(){return this._Data.value}Data$=this._Data.asObservable();pushNewValue(e){this._Data.next(e)}static \u0275fac=function(s){return new(s||i)(l(a))};static \u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})};export{t as a,n as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A,b as I}from"./chunk-V25UXFNL.js";import{G as N,N as q}from"./chunk-VAJAIBT3.js";import{b as w}from"./chunk-
|
|
1
|
+
import{a as A,b as I}from"./chunk-V25UXFNL.js";import{G as N,N as q}from"./chunk-VAJAIBT3.js";import{b as w}from"./chunk-H3D4WR27.js";import{Ab as M,Bb as n,Cb as l,Cc as C,Db as y,Ec as g,Mb as b,Nd as F,Pb as T,Pc as E,Pd as S,Qc as s,Ra as m,Rb as f,ab as D,dc as L,ec as a,fc as _,gc as h,la as x,pa as v,qa as k,tb as p,vb as u,vc as P}from"./chunk-M3O2GJ3M.js";var H=e=>({"cursor-pointer":e});function R(e,d){e&1&&(n(0,"span"),a(1,"/"),l())}function V(e,d){e&1&&(n(0,"span"),a(1,"/"),l())}function B(e,d){if(e&1&&(n(0,"div",4)(1,"span",5),a(2,"Modified:"),l(),n(3,"span"),a(4),C(5,"IsMinDate"),l(),p(6,V,2,0,"span"),n(7,"span"),a(8),l()()),e&2){let t,r,c,o=f(2);m(4),_(g(5,3,(t=o.modified())==null?null:t.Date,"dd MMM yyyy HH:mm:ss")),m(2),u((r=o.modified())!=null&&r.User?6:-1),m(2),_((c=o.modified())==null?null:c.User)}}function j(e,d){if(e&1){let t=b();n(0,"div",1),T("click",function(){v(t);let c=f();return k(c.onClick())}),n(1,"div",2),y(2,"i",3),n(3,"div",4)(4,"span",5),a(5,"Created:"),l(),n(6,"span"),a(7),C(8,"IsMinDate"),l(),p(9,R,2,0,"span"),n(10,"span"),a(11),l()()(),p(12,B,9,6,"div",4),l()}if(e&2){let t,r,c,o,i=f();L(P(12,H,i.hasClick()||i.redirectLink())),M("matTooltip",i.tooltipDesc())("routerLink",i.redirectLink())("queryParams",i.queryParamsLink()),m(7),h(" ",g(8,9,(t=i.created())==null?null:t.Date,"dd MMM yyyy HH:mm:ss")),m(2),u((r=i.created())!=null&&r.User?9:-1),m(2),_((c=i.created())==null?null:c.User),m(),u((o=i.modified())!=null&&o.Date&&i.isNotMinimumDateTime((o=i.modified())==null?null:o.Date)||(o=i.modified())!=null&&o.User?12:-1)}}var U=class e{role=x(w);created=s(null);modified=s(null);tooltipDesc=s("");redirectLink=s(null);queryParamsLink=s(null);hasClick=s(!1);onClickEvent=E();isNotMinimumDateTime(d){let t=new Date("0001-01-01T00:00:00");return new Date(d).getTime()!==t.getTime()}onClick(){this.hasClick()&&this.onClickEvent.emit()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=D({type:e,selectors:[["pos-footer-alert"]],inputs:{created:[1,"created"],modified:[1,"modified"],tooltipDesc:[1,"tooltipDesc"],redirectLink:[1,"redirectLink"],queryParamsLink:[1,"queryParamsLink"],hasClick:[1,"hasClick"]},outputs:{onClickEvent:"onClickEvent"},decls:1,vars:1,consts:[["matTooltipPosition","above",1,"alert","alert-warning","d-flex","flex-column","flex-sm-row","align-items-sm-center","gap-3",3,"class","matTooltip","routerLink","queryParams"],["matTooltipPosition","above",1,"alert","alert-warning","d-flex","flex-column","flex-sm-row","align-items-sm-center","gap-3",3,"click","matTooltip","routerLink","queryParams"],[1,"d-flex","align-items-center","gap-2"],["aria-hidden","true",1,"fa-regular","fa-file"],[1,"d-flex","gap-2"],[1,"fw-bold"]],template:function(t,r){t&1&&p(0,j,13,14,"div",0),t&2&&u(r.role.users.LogRestriction?-1:0)},dependencies:[q,S,F,I,A,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{U as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-KM4ASOAJ.js";import{ha as r,la as s}from"./chunk-M3O2GJ3M.js";var i=class{to;from;constructor(){this.to=new Date,this.from=new Date}};var n=class o{cookiesService=s(c);_cookiesName="PaymentDate";dateFilter={from:new Date,to:new Date};set(e){this.saveFilterToCookie(e),this.dateFilter=e}initFilterDate(e){let t;if(this.checkCookieExists())t=this.get();else{let a=e.From||new Date,m=e.To||new Date;t={from:a,to:m}}return e.From=t.from,e.To=t.to,e}get(){return this.checkCookieExists()?this.dateFilter=JSON.parse(this.cookiesService.get(this._cookiesName)):this.dateFilter=new i,this.dateFilter}checkCookieExists(){return this.cookiesService.check(this._cookiesName)}saveFilterToCookie(e){this.cookiesService.set(this._cookiesName,JSON.stringify(e),this.getExpiredDate(),"/")}clear(){this.cookiesService.delete(this._cookiesName,"/"),this.dateFilter=new i}getExpiredDate(){let e=new Date,a=1*60*60*1e3;return e.setTime(e.getTime()+a),e}static \u0275fac=function(t){return new(t||o)};static \u0275prov=r({token:o,factory:o.\u0275fac,providedIn:"root"})};export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-E5SZ26J6.js";import"./chunk-ES6YUR3X.js";import{b as re}from"./chunk-7DDSY4T5.js";import"./chunk-AKURDWYM.js";import"./chunk-XUQBRL5R.js";import"./chunk-P5YW6ELU.js";import"./chunk-UVAFCFHT.js";import{a as ae}from"./chunk-IEFU4ZWW.js";import{p as ne}from"./chunk-VQQIQFUB.js";import"./chunk-HKSUQNKJ.js";import"./chunk-DLBX5RSU.js";import"./chunk-YHKX3K56.js";import"./chunk-O3LZKJY2.js";import"./chunk-WLNLF7ZT.js";import"./chunk-MPGXQK5L.js";import{d as te}from"./chunk-Q2COUO3I.js";import"./chunk-IDHUYY2U.js";import"./chunk-A75ZS57D.js";import"./chunk-HSGXXXIK.js";import{a as ie}from"./chunk-75C5S3PQ.js";import"./chunk-IA2WDKQU.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as oe}from"./chunk-E5SZ26J6.js";import"./chunk-ES6YUR3X.js";import{b as re}from"./chunk-7DDSY4T5.js";import"./chunk-AKURDWYM.js";import"./chunk-XUQBRL5R.js";import"./chunk-P5YW6ELU.js";import"./chunk-UVAFCFHT.js";import{a as ae}from"./chunk-IEFU4ZWW.js";import{p as ne}from"./chunk-VQQIQFUB.js";import"./chunk-HKSUQNKJ.js";import"./chunk-DLBX5RSU.js";import"./chunk-YHKX3K56.js";import"./chunk-O3LZKJY2.js";import"./chunk-WLNLF7ZT.js";import"./chunk-MPGXQK5L.js";import{d as te}from"./chunk-Q2COUO3I.js";import"./chunk-IDHUYY2U.js";import"./chunk-A75ZS57D.js";import"./chunk-HSGXXXIK.js";import{a as ie}from"./chunk-75C5S3PQ.js";import"./chunk-IA2WDKQU.js";import{a as X}from"./chunk-DBROGHP5.js";import"./chunk-7GHVZIGG.js";import"./chunk-MH5R4QUS.js";import"./chunk-6KJTU3AF.js";import"./chunk-TQ2YP2CL.js";import{a as Q,g as $,h as ee}from"./chunk-FI4ADJ7Y.js";import"./chunk-FSAQ7W4Y.js";import"./chunk-DA33S43F.js";import"./chunk-BSOZMEUZ.js";import"./chunk-KLLRDRG7.js";import"./chunk-GFPR5PLO.js";import"./chunk-7K5H76G7.js";import"./chunk-BXQZZ4SS.js";import"./chunk-J7XZRRKK.js";import"./chunk-FOEAOA4G.js";import"./chunk-DZAEKVKZ.js";import"./chunk-5OLVUC6J.js";import"./chunk-WYKVRUIW.js";import"./chunk-LVIGLDQ4.js";import"./chunk-LT46RQOD.js";import{a as Z}from"./chunk-V6I4U3FF.js";import"./chunk-5E52ZWKI.js";import"./chunk-JFJGBJM3.js";import"./chunk-23G4CQ4S.js";import"./chunk-Q6MS4QZ6.js";import"./chunk-GMF3SGSZ.js";import"./chunk-5NWJYNJO.js";import"./chunk-36TOKQZQ.js";import"./chunk-XS4UTUMZ.js";import"./chunk-D3PKFTVO.js";import{a as z,b as K}from"./chunk-V25UXFNL.js";import"./chunk-YNQPX5G6.js";import"./chunk-VAJAIBT3.js";import"./chunk-ETHMD4GO.js";import"./chunk-DCS4THVW.js";import{d as Y}from"./chunk-RBBEZN3D.js";import"./chunk-S4263DWI.js";import"./chunk-R2YNXAPB.js";import"./chunk-MMKYHF6F.js";import"./chunk-LJWHBKHI.js";import{a as b}from"./chunk-SY5NNN4M.js";import"./chunk-KYGIDMGO.js";import"./chunk-R2UNPOYE.js";import"./chunk-RXZDFS3M.js";import{a as q}from"./chunk-3UB7PEG5.js";import"./chunk-DVI52XSU.js";import"./chunk-6HNYSYBG.js";import"./chunk-WIUSOID5.js";import"./chunk-K7ICHNI3.js";import{E as G,h as j,o as U}from"./chunk-POUQHZWU.js";import"./chunk-KM4ASOAJ.js";import"./chunk-YPRM4YPL.js";import"./chunk-MNXZMQRB.js";import"./chunk-H3D4WR27.js";import"./chunk-PTRS3UA6.js";import"./chunk-ZPXUDL2F.js";import{n as H,q as J}from"./chunk-D3E5UKKJ.js";import{Ab as l,Bb as a,Cb as r,Cc as P,Db as D,Dc as F,Ic as N,Mb as y,Pb as T,Ra as s,Rb as c,W as v,Ya as h,ab as E,ca as B,ec as f,fb as W,gb as I,jc as u,kc as d,la as x,lc as g,ld as R,pa as p,qa as m,sd as A,tb as w,vb as k,wb as M,yb as L,za as O,zb as V}from"./chunk-M3O2GJ3M.js";import"./chunk-KMHZKFQS.js";function pe(o,S){if(o&1){let n=y();a(0,"button",5),T("click",function(){p(n);let e=c();return m(e.onPrint())}),D(1,"i",6),a(2,"span"),f(3,"Print"),r()()}}function me(o,S){if(o&1){let n=y();a(0,"div",7)(1,"h6"),f(2,"Outlet"),r(),a(3,"outlet-selector",8),g("ngModelChange",function(e){p(n);let i=c();return d(i.pageData().Filter.EntityID,e)||(i.pageData().Filter.EntityID=e),m(e)}),r(),a(4,"h6"),f(5,"Sales Order Tag"),r(),a(6,"ng-select",9),g("ngModelChange",function(e){p(n);let i=c();return d(i.pageData().Filter.SalesOrderTagID,e)||(i.pageData().Filter.SalesOrderTagID=e),m(e)}),r(),a(7,"h6"),f(8,"Print Mode"),r(),a(9,"div",10)(10,"radio-options",11),g("modelChange",function(e){p(n);let i=c();return d(i.pageData().Filter.OptionID,e)||(i.pageData().Filter.OptionID=e),m(e)}),r()(),a(11,"h6"),f(12," From "),D(13,"i",12),r(),a(14,"div",10)(15,"div",13)(16,"datepicker",14),g("dateChange",function(e){p(n);let i=c();return d(i.pageData().Filter.From,e)||(i.pageData().Filter.From=e),m(e)}),r()(),a(17,"div",13)(18,"app-timepicker",15),g("timeChange",function(e){p(n);let i=c();return d(i.pageData().Filter.StartTime,e)||(i.pageData().Filter.StartTime=e),m(e)}),r()()(),a(19,"h6"),f(20,"To"),r(),a(21,"div",10)(22,"div",13)(23,"datepicker",16),g("dateChange",function(e){p(n);let i=c();return d(i.pageData().Filter.To,e)||(i.pageData().Filter.To=e),m(e)}),r()(),a(24,"div",13)(25,"app-timepicker",15),g("timeChange",function(e){p(n);let i=c();return d(i.pageData().Filter.EndTime,e)||(i.pageData().Filter.EndTime=e),m(e)}),r()()()()}if(o&2){let n,t,e=c();s(3),l("accessType",2),u("ngModel",e.pageData().Filter.EntityID),s(3),l("items",(n=e.pageData())==null||n.Options==null?null:n.Options.SalesOrderTags),u("ngModel",e.pageData().Filter.SalesOrderTagID),s(4),u("model",e.pageData().Filter.OptionID),l("options",(t=e.pageData())==null||t.Options==null?null:t.Options.Print),s(6),l("isFloatingLabel",!1),u("date",e.pageData().Filter.From),l("hidelClearBtn",!0),s(2),u("time",e.pageData().Filter.StartTime),l("fullWidth",!0),s(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),u("date",e.pageData().Filter.To),s(2),u("time",e.pageData().Filter.EndTime),l("fullWidth",!0)}}function se(o,S){if(o&1&&(a(0,"div",17),D(1,"app-packing-slip-v2",18),r()),o&2){let n=S.$implicit,t=c();s(),l("receipt",n)("template",t==null?null:t.Template)("config",t==null?null:t.AppConfigJSON)("css",t==null?null:t.StylesSheet)}}function ce(o,S){o&1&&L(0,se,2,4,"div",17,M),o&2&&V(S.Data)}var le=class o extends X{constructor(n,t,e){super(n,t,"print/BulkOrderPackingSlipLoader","print/BulkOrderPackingSlipLoader",e,void 0,!0,"get","get");this.httpService=t;this.initPrintListener()}dialogFilter=x(Q);receipts$;printTemplates;invoiceIds=O([]);preInitList(){this.pageData().Filter.From=new Date,this.pageData().Filter.To=new Date,this.pageData().Filter.StartTime="00:00",this.pageData().Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(b.GetBulkPrintPackingSlip,this.pageData().Filter).pipe(B(n=>{n?.Data?.length==0?this.toastrService?.info("There are no transaction",q.Info):this.generatePrintTemplate(n.PrintTemplates),this.invoiceIds.set(n.Data.map(t=>t?.Invoice?.ID))}),v(1))}generatePrintTemplate(n=[]){this.printTemplates=new Map(n.map(t=>[t.ID,t]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}initPrintListener(){window.addEventListener("afterprint",this.handleAfterPrint)}handleAfterPrint=()=>{this.invoiceIds()?.length>0&&this.httpService.post(b.UpdateLastPrintByListID,{ListID:this.invoiceIds()}).subscribe()};ngOnDestroy(){window.removeEventListener("afterprint",this.handleAfterPrint)}static \u0275fac=function(t){return new(t||o)(h(Z),h(J),h(H))};static \u0275cmp=E({type:o,selectors:[["POS-bulk-packing-slip"]],features:[W],decls:11,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","hideSearchBox","text","filter","isFilterOnDropdown"],[1,"btn","btn-outline-secondary","me-3"],["filters",""],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Label","bindValue","Value","placeholder","Choose Sales Order Tag","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[3,"modelChange","model","options"],["matTooltip","Invoice or Outbound Date Range based on Print Mode selection","matTooltipPosition","above",1,"fa","fa-circle-info",2,"cursor","pointer"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[1,"mb-6"],[3,"receipt","template","config","css"]],template:function(t,e){if(t&1){let i=y();a(0,"mainpanel-cmp",1),g("textChange",function(_){return p(i),d(e.pageData().Filter.Number,_)||(e.pageData().Filter.Number=_),m(_)}),T("onSubmit",function(){return e.onFilter()}),g("filterChange",function(_){return p(i),d(e.pageData().Filter,_)||(e.pageData().Filter=_),m(_)}),a(1,"actions"),w(2,pe,4,0,"button",2),P(3,"async"),r(),a(4,"div",3),I(5,me,26,16,"ng-template",null,0,N),r(),a(7,"content")(8,"div",4),w(9,ce,2,0),P(10,"async"),r()()()}if(t&2){let i,C;l("pageData",e.menuData())("hideSearchBox",!0),u("text",e.pageData().Filter.Number)("filter",e.pageData().Filter),l("isFilterOnDropdown",!1),s(2),k(((i=F(3,7,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),s(7),k((C=F(10,9,e.printTemplates&&e.receipts$))?9:-1,C)}},dependencies:[A,re,ee,$,ie,Y,ne,G,j,U,ae,te,oe,K,z,R],encapsulation:2})};export{le as BulkPackingSlipComponent};
|