dealpos 26.16.2 → 26.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/browser/{chunk-2MJBCN32.js → chunk-25NQNUBD.js} +1 -1
  2. package/browser/{chunk-JULETYYZ.js → chunk-2N7NCJ5W.js} +2 -2
  3. package/browser/{chunk-VGE5PHZ2.js → chunk-2VBQDBYK.js} +1 -1
  4. package/browser/{chunk-3JWZ5DCP.js → chunk-34UMB3PX.js} +1 -1
  5. package/browser/{chunk-YXDFR7LR.js → chunk-352H4BTA.js} +1 -1
  6. package/browser/{chunk-PBROZQDU.js → chunk-3D4F2EUO.js} +2 -2
  7. package/browser/{chunk-UTAUNWNJ.js → chunk-3O3R3DWC.js} +1 -1
  8. package/browser/{chunk-CEKNIJ32.js → chunk-3QPBFRIY.js} +1 -1
  9. package/browser/{chunk-HMWG7KQV.js → chunk-42XFMLQP.js} +1 -1
  10. package/browser/{chunk-CJKLMMTM.js → chunk-4NL6TSCW.js} +1 -1
  11. package/browser/{chunk-XS7VRFB2.js → chunk-4TPX26IR.js} +1 -1
  12. package/browser/{chunk-33UHS6NC.js → chunk-4WJZAJHA.js} +1 -1
  13. package/browser/{chunk-A4YZQAMR.js → chunk-56OP3DND.js} +1 -1
  14. package/browser/{chunk-3IVVIJCD.js → chunk-5G7LKWQF.js} +1 -1
  15. package/browser/{chunk-P34UHXET.js → chunk-7ASRZ7ZO.js} +1 -1
  16. package/browser/{chunk-UORHM35V.js → chunk-7LOPZDAO.js} +1 -1
  17. package/browser/{chunk-FCOOCXGL.js → chunk-7R2RR2T4.js} +1 -1
  18. package/browser/{chunk-OHT4K7PJ.js → chunk-7T4OFODP.js} +1 -1
  19. package/browser/{chunk-MYCG7QBW.js → chunk-BII4H7N4.js} +1 -1
  20. package/browser/{chunk-G7TZ7MPH.js → chunk-BKSDYLGK.js} +1 -1
  21. package/browser/{chunk-JWOMTKKN.js → chunk-BZLH7CZK.js} +1 -1
  22. package/browser/{chunk-LNIPP7G5.js → chunk-CSSMY66Y.js} +1 -1
  23. package/browser/{chunk-7QMS4EYT.js → chunk-D2PKWZCG.js} +1 -1
  24. package/browser/{chunk-KKBTLY3V.js → chunk-D7F6PKUQ.js} +1 -1
  25. package/browser/{chunk-RZSUC7LK.js → chunk-DAGLOPEE.js} +1 -1
  26. package/browser/{chunk-NIMYS7D6.js → chunk-DCXIY6JD.js} +1 -1
  27. package/browser/{chunk-VMQ6TDTL.js → chunk-DMEGHWT6.js} +1 -1
  28. package/browser/{chunk-ASBDO6VT.js → chunk-E5CMVNLT.js} +1 -1
  29. package/browser/{chunk-OMABJK6U.js → chunk-E7L3QW3K.js} +1 -1
  30. package/browser/chunk-EBLMAZB7.js +1 -0
  31. package/browser/{chunk-WIODXTKB.js → chunk-EYB6MVXL.js} +1 -1
  32. package/browser/{chunk-YFB4XBRI.js → chunk-FJYFJMZS.js} +1 -1
  33. package/browser/{chunk-SVJH676J.js → chunk-FMFZK4T6.js} +2 -2
  34. package/browser/{chunk-5J47EXUG.js → chunk-FTXU3TMC.js} +1 -1
  35. package/browser/{chunk-6JN6533M.js → chunk-G5KTRQQM.js} +1 -1
  36. package/browser/{chunk-JTX2BVI6.js → chunk-G6YWMVCB.js} +1 -1
  37. package/browser/{chunk-EG6JNBK2.js → chunk-GDXY3TXN.js} +1 -1
  38. package/browser/{chunk-WQXI4QPG.js → chunk-GHQZUHK6.js} +1 -1
  39. package/browser/{chunk-LO2STX72.js → chunk-GTIDVSNG.js} +1 -1
  40. package/browser/{chunk-EE5NZHGE.js → chunk-GW7X2LYO.js} +9 -9
  41. package/browser/{chunk-VH3BBWAO.js → chunk-HDKZDV6E.js} +1 -1
  42. package/browser/{chunk-QIK3DEGR.js → chunk-HNUONWWK.js} +1 -1
  43. package/browser/{chunk-J6XBDCNV.js → chunk-I43H6ZQY.js} +1 -1
  44. package/browser/chunk-IA6OGZDY.js +1 -0
  45. package/browser/{chunk-GM52HZXS.js → chunk-IID2TNXE.js} +2 -2
  46. package/browser/{chunk-M6PMDWRR.js → chunk-IIHD2FGO.js} +1 -1
  47. package/browser/{chunk-BIXJATEJ.js → chunk-IUL5INAD.js} +1 -1
  48. package/browser/{chunk-4DCCSX5X.js → chunk-JEFTJVVX.js} +5 -5
  49. package/browser/{chunk-BLYNIVNG.js → chunk-JGU3BOOV.js} +1 -1
  50. package/browser/{chunk-AGLT3IGD.js → chunk-JKID644O.js} +1 -1
  51. package/browser/{chunk-YAH623GO.js → chunk-JOUF5NH2.js} +1 -1
  52. package/browser/chunk-JQYI7EGR.js +149 -0
  53. package/browser/{chunk-YOFZWYR5.js → chunk-JYXZWDAW.js} +1 -1
  54. package/browser/{chunk-GONJIIK6.js → chunk-KHAGXPAB.js} +1 -1
  55. package/browser/{chunk-WAKNZCVV.js → chunk-KJTBA2T3.js} +1 -1
  56. package/browser/{chunk-5TTEYXK4.js → chunk-KMAOCAGI.js} +1 -1
  57. package/browser/{chunk-SN6JYVJK.js → chunk-KN2HABUR.js} +1 -1
  58. package/browser/{chunk-KX67XBOO.js → chunk-KYPVGWZQ.js} +1 -1
  59. package/browser/{chunk-UG7IIQ3F.js → chunk-L5FFKPZN.js} +1 -1
  60. package/browser/{chunk-JWUHX2ET.js → chunk-LOWV2TDC.js} +1 -1
  61. package/browser/chunk-MKGT7VST.js +8 -0
  62. package/browser/{chunk-VNS2RE77.js → chunk-MTFFU57N.js} +1 -1
  63. package/browser/chunk-N2THZDCC.js +24 -0
  64. package/browser/{chunk-N2U4JN63.js → chunk-NIRGCMAN.js} +1 -1
  65. package/browser/{chunk-Q5ULM24Y.js → chunk-NQ6MZK4N.js} +9 -9
  66. package/browser/{chunk-EEI6XL37.js → chunk-NUSPP7QH.js} +1 -1
  67. package/browser/chunk-OBML4UDA.js +1 -0
  68. package/browser/{chunk-AOXPJUGG.js → chunk-OLZLLC4Q.js} +1 -1
  69. package/browser/{chunk-Y73PNVZY.js → chunk-OMSQG7SU.js} +1 -1
  70. package/browser/{chunk-QKWUCGPM.js → chunk-OX6BN4GM.js} +1 -1
  71. package/browser/{chunk-A7UZVVOG.js → chunk-P2UYIJGY.js} +1 -1
  72. package/browser/{chunk-SFKUAKOZ.js → chunk-P7GPT7CD.js} +1 -1
  73. package/browser/{chunk-5GZZLIPG.js → chunk-PJQBZOL5.js} +2 -2
  74. package/browser/{chunk-A5FQDC3G.js → chunk-PPXWVUW3.js} +1 -1
  75. package/browser/{chunk-4JTVVQ7W.js → chunk-PXJIA5Y6.js} +1 -1
  76. package/browser/{chunk-U5P34LSK.js → chunk-Q3TEEWSE.js} +1 -1
  77. package/browser/chunk-QJPLYIVC.js +1 -0
  78. package/browser/{chunk-SEQNPQ3W.js → chunk-QMRPYPIV.js} +1 -1
  79. package/browser/chunk-REVTZEUC.js +1 -0
  80. package/browser/{chunk-7EHCEG4Q.js → chunk-RHZ5C2ZA.js} +1 -1
  81. package/browser/{chunk-C5R7HYP7.js → chunk-RM4WI3W6.js} +1 -1
  82. package/browser/chunk-SARSMSAS.js +1 -0
  83. package/browser/{chunk-VAEMQKMB.js → chunk-SCOAV4JI.js} +1 -1
  84. package/browser/{chunk-ULKU53FA.js → chunk-SEAX26AJ.js} +1 -1
  85. package/browser/{chunk-WIHZOM3C.js → chunk-SNJ3EUQG.js} +1 -1
  86. package/browser/{chunk-FXRJXVWH.js → chunk-SXW54YFJ.js} +1 -1
  87. package/browser/{chunk-RQDOP7TE.js → chunk-T5F5WJYJ.js} +1 -1
  88. package/browser/chunk-TARUVFR2.js +28 -0
  89. package/browser/{chunk-BONQYLII.js → chunk-THE2FGQN.js} +1 -1
  90. package/browser/{chunk-GO5NVTB3.js → chunk-TLH3U666.js} +1 -1
  91. package/browser/{chunk-NGRABHNJ.js → chunk-TM7UPTC4.js} +1 -1
  92. package/browser/{chunk-2G55SXYE.js → chunk-TMD3KO7H.js} +1 -1
  93. package/browser/{chunk-U7UMKOBQ.js → chunk-TZST5MN5.js} +1 -1
  94. package/browser/{chunk-K26ZQQJE.js → chunk-UMR6OPYF.js} +3 -3
  95. package/browser/{chunk-F4L5BXVH.js → chunk-URMCV7OE.js} +2 -2
  96. package/browser/{chunk-QFE73YCL.js → chunk-UWC2SR7K.js} +1 -1
  97. package/browser/{chunk-EZCVGBAR.js → chunk-V2YSXEB7.js} +1 -1
  98. package/browser/{chunk-UKRO3R7X.js → chunk-VKRXGENT.js} +1 -1
  99. package/browser/{chunk-CFFRGANU.js → chunk-WRJSXBJX.js} +1 -1
  100. package/browser/{chunk-6VQSXZFA.js → chunk-WYP6VY24.js} +1 -1
  101. package/browser/{chunk-Y2ST6F4K.js → chunk-X2RJO7YT.js} +1 -1
  102. package/browser/{chunk-GQV5W3GF.js → chunk-X4E423GD.js} +1 -1
  103. package/browser/{chunk-E6X2UHSN.js → chunk-XGLEB7OQ.js} +1 -1
  104. package/browser/{chunk-OX2RZSIO.js → chunk-XSUEXDB6.js} +1 -1
  105. package/browser/{chunk-EX7UWTNP.js → chunk-XZL7GPJ2.js} +1 -1
  106. package/browser/{chunk-4DD3WNHI.js → chunk-Y3KETVJC.js} +1 -1
  107. package/browser/{chunk-SLAM367X.js → chunk-YMGJRUQM.js} +1 -1
  108. package/browser/{chunk-BF7YNPJY.js → chunk-YTIKKBJ5.js} +2 -2
  109. package/browser/{chunk-J6U233NF.js → chunk-YWV3QIJT.js} +1 -1
  110. package/browser/{chunk-LRM4CXVP.js → chunk-YYQ2V6XI.js} +1 -1
  111. package/browser/index.html +2 -2
  112. package/browser/{main-ORTGLHFM.js → main-53OLOAMI.js} +2 -2
  113. package/package.json +1 -1
  114. package/browser/chunk-676URQU4.js +0 -1
  115. package/browser/chunk-73SF2ZFB.js +0 -1
  116. package/browser/chunk-BCH2MDJT.js +0 -8
  117. package/browser/chunk-EFK3TBWO.js +0 -24
  118. package/browser/chunk-GMZLKLDI.js +0 -1
  119. package/browser/chunk-INHXSO5N.js +0 -28
  120. package/browser/chunk-LJQLHNQX.js +0 -1
  121. package/browser/chunk-LZNSQRCR.js +0 -149
  122. package/browser/chunk-SKE7KFMP.js +0 -1
  123. package/browser/chunk-U5IOZ6AH.js +0 -1
  124. package/browser/chunk-VTTJI22B.js +0 -1
  125. package/browser/chunk-Y3IS2EF5.js +0 -1
@@ -1 +1 @@
1
- import{b as rt}from"./chunk-CSFBLJDG.js";import{a as ot}from"./chunk-NQX7EX5A.js";import{a as nt}from"./chunk-SLAM367X.js";import{a as Z,c as tt,e as et,f as it,g as at}from"./chunk-ZOY3GIWS.js";import{d as Y}from"./chunk-3XXHI4EL.js";import{b as z}from"./chunk-IGAEFS7B.js";import{c as X}from"./chunk-GQLZJQI6.js";import{a as U}from"./chunk-7TPO6NBM.js";import{g as q}from"./chunk-UUAZGIAN.js";import{d as J}from"./chunk-Q7OVBNEW.js";import{a as j}from"./chunk-M5BHFFPW.js";import{E as G,c as L,h as $,o as K}from"./chunk-QMS2MBIA.js";import{a as N}from"./chunk-3DEA4WWC.js";import{n as H}from"./chunk-3GXUD7K4.js";import{Bb as _,Ca as b,Db as h,Fb as D,Gb as I,Hb as E,Ib as C,Jb as r,Kb as l,Kc as k,Lb as S,Lc as R,Ub as f,Xb as u,Yc as V,Z as F,Za as s,Zb as d,eb as T,ga as O,hc as g,ib as B,mc as p,nc as P,oc as M,rc as v,sc as x,sd as A,tc as y,u as Q,va as m,wa as c,zd as W}from"./chunk-NGFIIVK5.js";function dt(n,i){n&1&&(r(0,"div",2)(1,"div",5),p(2,"Edit Serial is disabled during EDIT MODE"),l(),r(3,"div"),p(4,"If you make a mistake, please delete the item and then add again"),l()())}function mt(n,i){if(n&1){let t=f();r(0,"mat-chip-row",16),u("removed",function(){let a=m(t).$implicit,o=d(3);return c(o.onRemoveSerialChip(a))}),p(1),r(2,"button",17),S(3,"i",18),l()()}if(n&2){let t=i.$implicit;s(),M(" ",t," ")}}function ct(n,i){if(n&1){let t=f();r(0,"div",7)(1,"div",9)(2,"mat-form-field",10),u("keyup.enter",function(a){return a.stopPropagation()}),r(3,"mat-chip-grid",null,0),I(5,mt,4,1,"mat-chip-row",null,D),r(7,"input",11,1),u("matChipInputTokenEnd",function(a){m(t);let o=g(8),w=d(2);return c(w.addSerial(a,o))}),l()()()(),r(9,"div",12)(10,"button",13),u("click",function(){m(t);let a=g(8),o=d(2);return c(o.submitSerial(a))}),S(11,"i",14),r(12,"strong",15),p(13,"ADD"),l()()()()}if(n&2){let t=g(4),e=d(2);s(5),E(e.serials),s(2),C("placeholder",e.isBatchNumber()?"E.g. Batch1, Batch2":"E.g. Serial1, Serial2")("matChipInputFor",t)("matChipInputSeparatorKeyCodes",e.separatorKeysCodes)}}function pt(n,i){if(n&1){let t=f();r(0,"div",8)(1,"ng-select",19),k(2,"async"),y("ngModelChange",function(a){m(t);let o=d(2);return x(o.serials,a)||(o.serials=a),c(a)}),u("remove",function(a){m(t);let o=d(2);return c(o.onRemoveSerialFromOption(a.value))})("change",function(a){m(t);let o=d(2);return c(o.onSelectSerial(a))}),l()()}if(n&2){let t=d(2);s(),C("items",R(2,4,t.variantSerials$))("placeholder",t.isBatchNumber()?"Select Batch Number":"Select Serial"),v("ngModel",t.serials),C("multiple",!0)}}function ut(n,i){if(n&1&&(r(0,"div",3)(1,"div",6),_(2,ct,14,3,"div",7)(3,pt,3,6,"div",8),l()()),n&2){let t=d();s(2),h(t.isReturn?3:2)}}function _t(n,i){n&1&&S(0,"th",23)}function ht(n,i){if(n&1){let t=f();r(0,"td",27)(1,"i",30),u("click",function(){m(t);let a=d(),o=a.$implicit,w=a.$index,st=d(2);return c(st.onRemoveSerial(w,o.Number))}),l()()}}function Ct(n,i){if(n&1){let t=f();r(0,"tr"),_(1,ht,2,0,"td",27),r(2,"td"),p(3),l(),r(4,"td")(5,"datepicker",28),y("dateChange",function(a){let o=m(t).$implicit;return x(o.ExpiryDate,a)||(o.ExpiryDate=a),c(a)}),l()(),r(6,"td")(7,"input",29),y("ngModelChange",function(a){let o=m(t).$implicit;return x(o.Quantity,a)||(o.Quantity=a),c(a)}),u("change",function(){m(t);let a=d(2);return c(a.serialQtyChange())}),l()()()}if(n&2){let t=i.$implicit,e=d(2);s(),h(e.disabledEditQty?-1:1),s(2),P(t.Number),s(2),v("date",t.ExpiryDate),C("disabled",e.disabledEditQty&&e.constants.IsNotEmpty(e.variant.ID)),s(2),v("ngModel",t.Quantity),C("disabled",e.disabledEditQty&&e.constants.IsNotEmpty(e.variant.ID)||!e.isBatchNumber())("decimalPlaces",0)}}function ft(n,i){if(n&1&&(r(0,"div",4)(1,"div",6)(2,"div",20)(3,"table",21)(4,"thead",22)(5,"tr"),_(6,_t,1,0,"th",23),r(7,"th",24),p(8),l(),r(9,"th",25),p(10,"Expiry Date"),l(),r(11,"th",26),p(12,"Quantity"),l()()(),r(13,"tbody"),I(14,Ct,8,7,"tr",null,D),l()()()()()),n&2){let t=d();s(6),h(t.disabledEditQty?-1:6),s(2),M(" ",t.isBatchNumber()?"Batch":"Serial"," Number "),s(6),E(t.serialData)}}var lt=class n{constructor(i,t){this.productService=i;this.toastr=t}disabledAddSerial=V(!1);disabledEditQty=!1;outletID;serials=[];isBatchNumber=V(!1);isFocusOnSerialInput=!1;isFocusOnSerialInputChange=new b;constants=N;separatorKeysCodes=[13,188];_variant;set variant(i){this._variant=i,this.initSerial(),i&&i.Quantity<0&&(this.isReturn=!0,this.initVariantSerial())}get variant(){return this._variant}serialsChange=new b;variantChange=new b;onSerialDataChange=new b;isReturn=!1;serialData=[];variantSerials$;initSerial(){N.IsEmpty(this.variant.Serial)&&(this.variant.Serial=[]),this.variant.Serial&&(this.serialData=this.variant.Serial)}initVariantSerial(){let i=this.variant.VariantID,t;this.variantSerials$=this.productService.getVariantSerial(this.outletID,i).pipe(Q(e=>e.map(a=>(t=new ot,t.Number=a.Number,t.Quantity=a.Quantity,t))),O(()=>{this.serials=this.serialData.map(e=>e.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(i,t){this.serialData.splice(i,1),this.updateItemQty(),this.updateVariant()}onRemoveSerialChip(i){this.serials=this.serials.filter(t=>t!==i),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 i=this.calculateSerialQty(this.serialData);this.variant.Quantity=i==0?1:i}calculateSerialQty(i){let t=0;return i.forEach(e=>{t+=e.Quantity}),t}onSelectSerial(i){let t=i.filter(e=>this.serialData.findIndex(a=>a.Number==e.Number)==-1);t.length>0&&(t[0].Quantity=this.isReturn?-1:1,this.serialData=[...this.serialData,...t],this.updateItemQty(),this.updateVariant())}onRemoveSerialFromOption(i){this.serialData=this.serialData.filter(t=>t.Number!=i.Number),this.updateItemQty(),this.updateVariant()}submitSerial(i){i.value.trim()&&(this.serials.push(i.value.trim()),i.value="");let t=this.generateSerialData();this.serialData=[...this.serialData,...t],this.updateItemQty(),this.updateVariant(),this.serials=[],this.serialsChange.emit(this.serials)}generateSerialData(){let i=this.serials.filter(t=>this.serialData.findIndex(e=>e.Number==t)==-1).map(t=>({Number:t,Quantity:this.isReturn?-1:1,ExpiryDate:null}));return this.onSerialDataChange.emit(i),i}addSerial(i,t){let e=(i.value||"").trim();if(e)if(this.serials.find(a=>a==e)){t.value="",this.toastr.info("Serial already exists",j.Info);return}else this.serials.push(e),this.serialsChange.emit(this.serials),this.variant.Quantity=this.serials.length+this.variant.Serial.length,this.updateVariant();i.chipInput.clear()}static \u0275fac=function(t){return new(t||n)(T(nt),T(H))};static \u0275cmp=B({type:n,selectors:[["POS-tab-serial"]],inputs:{disabledAddSerial:[1,"disabledAddSerial"],disabledEditQty:"disabledEditQty",outletID:"outletID",serials:"serials",isBatchNumber:[1,"isBatchNumber"],isFocusOnSerialInput:"isFocusOnSerialInput",variant:"variant"},outputs:{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(t,e){t&1&&(_(0,dt,5,0,"div",2),_(1,ut,4,1,"div",3),_(2,ft,16,2,"div",4)),t&2&&(h(e.disabledEditQty&&e.constants.IsNotEmpty(e.variant.ID)?0:-1),s(),h(e.disabledAddSerial()?-1:1),s(),h((e.serialData==null?null:e.serialData.length)>0?2:-1))},dependencies:[W,G,L,$,K,U,J,Y,X,at,et,it,Z,tt,z,q,rt,A],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}"]})};export{lt as a};
1
+ import{b as rt}from"./chunk-CSFBLJDG.js";import{a as ot}from"./chunk-NQX7EX5A.js";import{a as nt}from"./chunk-YMGJRUQM.js";import{a as Z,c as tt,e as et,f as it,g as at}from"./chunk-ZOY3GIWS.js";import{d as Y}from"./chunk-3XXHI4EL.js";import{b as z}from"./chunk-IGAEFS7B.js";import{c as X}from"./chunk-GQLZJQI6.js";import{a as U}from"./chunk-7TPO6NBM.js";import{g as q}from"./chunk-UUAZGIAN.js";import{d as J}from"./chunk-Q7OVBNEW.js";import{a as j}from"./chunk-M5BHFFPW.js";import{E as G,c as L,h as $,o as K}from"./chunk-QMS2MBIA.js";import{a as N}from"./chunk-3DEA4WWC.js";import{n as H}from"./chunk-3GXUD7K4.js";import{Bb as _,Ca as b,Db as h,Fb as D,Gb as I,Hb as E,Ib as C,Jb as r,Kb as l,Kc as k,Lb as S,Lc as R,Ub as f,Xb as u,Yc as V,Z as F,Za as s,Zb as d,eb as T,ga as O,hc as g,ib as B,mc as p,nc as P,oc as M,rc as v,sc as x,sd as A,tc as y,u as Q,va as m,wa as c,zd as W}from"./chunk-NGFIIVK5.js";function dt(n,i){n&1&&(r(0,"div",2)(1,"div",5),p(2,"Edit Serial is disabled during EDIT MODE"),l(),r(3,"div"),p(4,"If you make a mistake, please delete the item and then add again"),l()())}function mt(n,i){if(n&1){let t=f();r(0,"mat-chip-row",16),u("removed",function(){let a=m(t).$implicit,o=d(3);return c(o.onRemoveSerialChip(a))}),p(1),r(2,"button",17),S(3,"i",18),l()()}if(n&2){let t=i.$implicit;s(),M(" ",t," ")}}function ct(n,i){if(n&1){let t=f();r(0,"div",7)(1,"div",9)(2,"mat-form-field",10),u("keyup.enter",function(a){return a.stopPropagation()}),r(3,"mat-chip-grid",null,0),I(5,mt,4,1,"mat-chip-row",null,D),r(7,"input",11,1),u("matChipInputTokenEnd",function(a){m(t);let o=g(8),w=d(2);return c(w.addSerial(a,o))}),l()()()(),r(9,"div",12)(10,"button",13),u("click",function(){m(t);let a=g(8),o=d(2);return c(o.submitSerial(a))}),S(11,"i",14),r(12,"strong",15),p(13,"ADD"),l()()()()}if(n&2){let t=g(4),e=d(2);s(5),E(e.serials),s(2),C("placeholder",e.isBatchNumber()?"E.g. Batch1, Batch2":"E.g. Serial1, Serial2")("matChipInputFor",t)("matChipInputSeparatorKeyCodes",e.separatorKeysCodes)}}function pt(n,i){if(n&1){let t=f();r(0,"div",8)(1,"ng-select",19),k(2,"async"),y("ngModelChange",function(a){m(t);let o=d(2);return x(o.serials,a)||(o.serials=a),c(a)}),u("remove",function(a){m(t);let o=d(2);return c(o.onRemoveSerialFromOption(a.value))})("change",function(a){m(t);let o=d(2);return c(o.onSelectSerial(a))}),l()()}if(n&2){let t=d(2);s(),C("items",R(2,4,t.variantSerials$))("placeholder",t.isBatchNumber()?"Select Batch Number":"Select Serial"),v("ngModel",t.serials),C("multiple",!0)}}function ut(n,i){if(n&1&&(r(0,"div",3)(1,"div",6),_(2,ct,14,3,"div",7)(3,pt,3,6,"div",8),l()()),n&2){let t=d();s(2),h(t.isReturn?3:2)}}function _t(n,i){n&1&&S(0,"th",23)}function ht(n,i){if(n&1){let t=f();r(0,"td",27)(1,"i",30),u("click",function(){m(t);let a=d(),o=a.$implicit,w=a.$index,st=d(2);return c(st.onRemoveSerial(w,o.Number))}),l()()}}function Ct(n,i){if(n&1){let t=f();r(0,"tr"),_(1,ht,2,0,"td",27),r(2,"td"),p(3),l(),r(4,"td")(5,"datepicker",28),y("dateChange",function(a){let o=m(t).$implicit;return x(o.ExpiryDate,a)||(o.ExpiryDate=a),c(a)}),l()(),r(6,"td")(7,"input",29),y("ngModelChange",function(a){let o=m(t).$implicit;return x(o.Quantity,a)||(o.Quantity=a),c(a)}),u("change",function(){m(t);let a=d(2);return c(a.serialQtyChange())}),l()()()}if(n&2){let t=i.$implicit,e=d(2);s(),h(e.disabledEditQty?-1:1),s(2),P(t.Number),s(2),v("date",t.ExpiryDate),C("disabled",e.disabledEditQty&&e.constants.IsNotEmpty(e.variant.ID)),s(2),v("ngModel",t.Quantity),C("disabled",e.disabledEditQty&&e.constants.IsNotEmpty(e.variant.ID)||!e.isBatchNumber())("decimalPlaces",0)}}function ft(n,i){if(n&1&&(r(0,"div",4)(1,"div",6)(2,"div",20)(3,"table",21)(4,"thead",22)(5,"tr"),_(6,_t,1,0,"th",23),r(7,"th",24),p(8),l(),r(9,"th",25),p(10,"Expiry Date"),l(),r(11,"th",26),p(12,"Quantity"),l()()(),r(13,"tbody"),I(14,Ct,8,7,"tr",null,D),l()()()()()),n&2){let t=d();s(6),h(t.disabledEditQty?-1:6),s(2),M(" ",t.isBatchNumber()?"Batch":"Serial"," Number "),s(6),E(t.serialData)}}var lt=class n{constructor(i,t){this.productService=i;this.toastr=t}disabledAddSerial=V(!1);disabledEditQty=!1;outletID;serials=[];isBatchNumber=V(!1);isFocusOnSerialInput=!1;isFocusOnSerialInputChange=new b;constants=N;separatorKeysCodes=[13,188];_variant;set variant(i){this._variant=i,this.initSerial(),i&&i.Quantity<0&&(this.isReturn=!0,this.initVariantSerial())}get variant(){return this._variant}serialsChange=new b;variantChange=new b;onSerialDataChange=new b;isReturn=!1;serialData=[];variantSerials$;initSerial(){N.IsEmpty(this.variant.Serial)&&(this.variant.Serial=[]),this.variant.Serial&&(this.serialData=this.variant.Serial)}initVariantSerial(){let i=this.variant.VariantID,t;this.variantSerials$=this.productService.getVariantSerial(this.outletID,i).pipe(Q(e=>e.map(a=>(t=new ot,t.Number=a.Number,t.Quantity=a.Quantity,t))),O(()=>{this.serials=this.serialData.map(e=>e.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(i,t){this.serialData.splice(i,1),this.updateItemQty(),this.updateVariant()}onRemoveSerialChip(i){this.serials=this.serials.filter(t=>t!==i),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 i=this.calculateSerialQty(this.serialData);this.variant.Quantity=i==0?1:i}calculateSerialQty(i){let t=0;return i.forEach(e=>{t+=e.Quantity}),t}onSelectSerial(i){let t=i.filter(e=>this.serialData.findIndex(a=>a.Number==e.Number)==-1);t.length>0&&(t[0].Quantity=this.isReturn?-1:1,this.serialData=[...this.serialData,...t],this.updateItemQty(),this.updateVariant())}onRemoveSerialFromOption(i){this.serialData=this.serialData.filter(t=>t.Number!=i.Number),this.updateItemQty(),this.updateVariant()}submitSerial(i){i.value.trim()&&(this.serials.push(i.value.trim()),i.value="");let t=this.generateSerialData();this.serialData=[...this.serialData,...t],this.updateItemQty(),this.updateVariant(),this.serials=[],this.serialsChange.emit(this.serials)}generateSerialData(){let i=this.serials.filter(t=>this.serialData.findIndex(e=>e.Number==t)==-1).map(t=>({Number:t,Quantity:this.isReturn?-1:1,ExpiryDate:null}));return this.onSerialDataChange.emit(i),i}addSerial(i,t){let e=(i.value||"").trim();if(e)if(this.serials.find(a=>a==e)){t.value="",this.toastr.info("Serial already exists",j.Info);return}else this.serials.push(e),this.serialsChange.emit(this.serials),this.variant.Quantity=this.serials.length+this.variant.Serial.length,this.updateVariant();i.chipInput.clear()}static \u0275fac=function(t){return new(t||n)(T(nt),T(H))};static \u0275cmp=B({type:n,selectors:[["POS-tab-serial"]],inputs:{disabledAddSerial:[1,"disabledAddSerial"],disabledEditQty:"disabledEditQty",outletID:"outletID",serials:"serials",isBatchNumber:[1,"isBatchNumber"],isFocusOnSerialInput:"isFocusOnSerialInput",variant:"variant"},outputs:{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(t,e){t&1&&(_(0,dt,5,0,"div",2),_(1,ut,4,1,"div",3),_(2,ft,16,2,"div",4)),t&2&&(h(e.disabledEditQty&&e.constants.IsNotEmpty(e.variant.ID)?0:-1),s(),h(e.disabledAddSerial()?-1:1),s(),h((e.serialData==null?null:e.serialData.length)>0?2:-1))},dependencies:[W,G,L,$,K,U,J,Y,X,at,et,it,Z,tt,z,q,rt,A],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}"]})};export{lt as a};