dealpos 11.9.5 → 11.9.7

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 (87) hide show
  1. package/POS/1161.f7be7565ac22e93a.js +1 -0
  2. package/POS/1930.283a246afc2d2ae9.js +1 -0
  3. package/POS/{2141.e80daa21c35ec72f.js → 2141.ac703ad601b482b2.js} +1 -1
  4. package/POS/2270.944d4ae31e2cb7b9.js +1 -0
  5. package/POS/2312.3561312ac667d538.js +1 -0
  6. package/POS/2489.4035c1cd3c1b8a3f.js +1 -0
  7. package/POS/2545.8f30ca61b4a67fe0.js +1 -0
  8. package/POS/2668.daaf228252cfee26.js +1 -0
  9. package/POS/273.7a88c65cefc27e7b.js +1 -0
  10. package/POS/2884.3b0478ec1df13eaa.js +1 -0
  11. package/POS/3208.0ae5272cdaac17a7.js +1 -0
  12. package/POS/3337.adf49102db66cab9.js +1 -0
  13. package/POS/{3353.8cd9af24e0c9ab3a.js → 3353.4389c5593210d5ed.js} +1 -1
  14. package/POS/343.4a7e2e0ac72d2b22.js +1 -0
  15. package/POS/3515.ce044753db354a50.js +1 -0
  16. package/POS/3571.db05d6bb75569c00.js +1 -0
  17. package/POS/3894.3e5ae9e0c998a840.js +1 -0
  18. package/POS/{4020.bfd8a691f4632812.js → 4020.7f9ecc8eb53b1c9b.js} +1 -1
  19. package/POS/456.ff80bf85a23e8801.js +1 -0
  20. package/POS/4825.b59c860bf298a87e.js +1 -0
  21. package/POS/5378.bc77459aeeff6d1a.js +1 -0
  22. package/POS/5418.93acba82a0d75c4b.js +1 -0
  23. package/POS/6268.bb6b6fafe40a636e.js +1 -0
  24. package/POS/{6840.049ebe75d7eb4b0c.js → 6840.6d28179d51a8dd73.js} +1 -1
  25. package/POS/6972.2ea427003b42e2f2.js +1 -0
  26. package/POS/{7193.0aaf8e5c5eca7cab.js → 7193.e5f177b58d8264c8.js} +1 -1
  27. package/POS/7266.6612b60f9dfaf483.js +1 -0
  28. package/POS/7298.fcdc9f51d293d1a3.js +1 -0
  29. package/POS/{7349.489f5589c9c09412.js → 7349.b3319c26b4aa92f1.js} +1 -1
  30. package/POS/7998.8e629b3aac49537d.js +1 -0
  31. package/POS/8094.99b9cf61ee025ca1.js +1 -0
  32. package/POS/8105.be0571598283e676.js +1 -0
  33. package/POS/{8126.0c1aa0652b9a646b.js → 8126.d91530af4e0a2670.js} +1 -1
  34. package/POS/8131.3b210db782732726.js +1 -0
  35. package/POS/8252.76f5db147dc9f908.js +1 -0
  36. package/POS/8392.39b0bc32186a5c24.js +1 -0
  37. package/POS/8589.1a8e03bbc25e486c.js +1 -0
  38. package/POS/8713.7151422b010120a9.js +1 -0
  39. package/POS/9156.adae03448d1baa49.js +1 -0
  40. package/POS/{9207.e4622a91f6059e43.js → 9207.eeadbdf6639cbf49.js} +1 -1
  41. package/POS/9564.f8845e376e9cbece.js +1 -0
  42. package/POS/common.f4e106069291c22f.js +1 -0
  43. package/POS/index.html +2 -2
  44. package/POS/main.81cf691db3366ffc.js +1 -0
  45. package/POS/runtime.0c2e3e87b0e5f07c.js +1 -0
  46. package/POS/{styles.972eb9a56335228b.css → styles.e0756aa7ac33408d.css} +1 -1
  47. package/package.json +1 -1
  48. package/POS/1078.a6a4e13837d39179.js +0 -1
  49. package/POS/1161.e27b0f001b630f83.js +0 -1
  50. package/POS/15.3f270f5759185f55.js +0 -1
  51. package/POS/1930.e9b016102ad85c78.js +0 -1
  52. package/POS/2270.6bb2c78ed593382d.js +0 -1
  53. package/POS/2462.af8761bdef59b313.js +0 -1
  54. package/POS/2489.38c045d44ef44a61.js +0 -1
  55. package/POS/2545.349f928367c400ee.js +0 -1
  56. package/POS/2668.d61cca66aebee7c0.js +0 -1
  57. package/POS/273.69bc616baef1b9fe.js +0 -1
  58. package/POS/3208.7b3c9a94ef2cc2ab.js +0 -1
  59. package/POS/3337.6713f36b34d9a15e.js +0 -1
  60. package/POS/343.f482b8b6c7e819f7.js +0 -1
  61. package/POS/3515.2d5c1cf15ddeb79d.js +0 -1
  62. package/POS/3571.3c501c5bd575ee26.js +0 -1
  63. package/POS/4177.66dde2ae420ee384.js +0 -1
  64. package/POS/5222.b65c724c448e3884.js +0 -1
  65. package/POS/5378.ad064e2ac0550c7e.js +0 -1
  66. package/POS/5418.0a7306a3a632f483.js +0 -1
  67. package/POS/5563.ce8c5faf0d186acb.js +0 -1
  68. package/POS/6230.cc248ba62d0f669e.js +0 -1
  69. package/POS/6268.d7c521313930735c.js +0 -1
  70. package/POS/6290.bfc45ddd24d7e50b.js +0 -1
  71. package/POS/6972.c9249dba3ef3b692.js +0 -1
  72. package/POS/7298.121d00ba592da429.js +0 -1
  73. package/POS/7998.d50c6bc860460d82.js +0 -1
  74. package/POS/805.f9175cf113ce3b49.js +0 -1
  75. package/POS/8094.adf02b25e30820a0.js +0 -1
  76. package/POS/8105.f3f55931643a490f.js +0 -1
  77. package/POS/8131.9518daf1e4493281.js +0 -1
  78. package/POS/8392.7859a0bb7c6083a6.js +0 -1
  79. package/POS/8589.899794c5c31c027b.js +0 -1
  80. package/POS/9564.9089fdc7e97ba170.js +0 -1
  81. package/POS/9612.eb8a065a80bfc5f4.js +0 -1
  82. package/POS/9826.24ae27a522e224f5.js +0 -1
  83. package/POS/common.d7beb9639dfb34f8.js +0 -1
  84. package/POS/main.a8cfabd9725e840c.js +0 -1
  85. package/POS/runtime.cd70befdd737b221.js +0 -1
  86. package/firebase-messaging-sw.js +0 -14
  87. package/xml/FChart/line.xml +0 -4
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[1161],{51161:(P,c,s)=>{s.d(c,{N:()=>m});var u=s(37407),i=s(67327),p=s(94650);let m=(()=>{class l{constructor(){this.parseJWTRoles()}parseJWTRoles(){const e=localStorage.getItem("Token");if(i.gT.IsNotEmpty(e)){var n=i.gT.parseJwt(e);this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]}}isInRole(e,n){const t={};return n.forEach((r,a)=>t[e[a]]="string"==typeof r?this._roles.includes(r):r(this._roles)),t}isUserHasRole(e){return this._roles.includes(e)}get product(){return i.gT.IsEmpty(this._product)&&(this._product=this.setBulkRole("product")),this._product}get contact(){return i.gT.IsEmpty(this._contact)&&(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return i.gT.IsEmpty(this._promotion)&&(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return i.gT.IsEmpty(this._accounting)&&(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return i.gT.IsEmpty(this._users)&&(this._users=this.setBulkRole("users")),this._users}get outlets(){return i.gT.IsEmpty(this._outlets)&&(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return i.gT.IsEmpty(this._setup)&&(this._setup=this.setBulkRole("setup")),this._setup}get service(){return i.gT.IsEmpty(this._service)&&(this._service=this.setBulkRole("service")),this._service}get profile(){return i.gT.IsEmpty(this._profile)&&(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return i.gT.IsEmpty(this._customerDisplay)&&(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return i.gT.IsEmpty(this._orderDisplay)&&(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return i.gT.IsEmpty(this._global)&&(this._global=this.setBulkRole("global")),this._global}get apps(){return i.gT.IsEmpty(this._apps)&&(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return i.gT.IsEmpty(this._fulfillment)&&(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return i.gT.IsEmpty(this._manufacture)&&(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return i.gT.IsEmpty(this._inventory)&&(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return i.gT.IsEmpty(this._sell)&&(this._sell=this.setBulkRole("sell")),this._sell}get report(){return i.gT.IsEmpty(this._report)&&(this._report=this.setBulkRole("report")),this._report}get buy(){return i.gT.IsEmpty(this._buy)&&(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return i.gT.IsEmpty(this._adjustment)&&(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return i.gT.IsEmpty(this._debt)&&(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return i.gT.IsEmpty(this._payment)&&(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return i.gT.IsEmpty(this._prepaidPackage)&&(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return i.gT.IsEmpty(this._order)&&(this._order=this.setBulkRole("orders")),this._order}get logistic(){return i.gT.IsEmpty(this._logistic)&&(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return i.gT.IsEmpty(this._estimate)&&(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return i.gT.IsEmpty(this._shift)&&(this._shift=this.setBulkRole("shift")),this._shift}setBulkRole(e){const n={};for(const t in u.G[e])n[t]=this.isUserHasRole(u.G[e][t]);return n}get isSystemUser(){const e=localStorage.getItem("Token");return"System"==i.gT.parseJwt(e).Type}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null}}return l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=p.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"}),l})()},67327:(P,c,s)=>{s.d(c,{FI:()=>i,Wz:()=>l,g7:()=>m,gT:()=>u});let u=(()=>{class e{static StringFormat(t,...r){for(let a=0;a<r.length;a++)t=t.replace(`{${a}}`,r[a]);return t}static IsNotEmpty(t){return""!=t&&t!=e.GuidEmpty&&null!=t&&null!=t}static IsEmpty(t){return""==t||null==t||null==t||t==e.GuidEmpty}static FilterByID(t,r){try{const a=t.filter(o=>o.ID==r);if(a.length>0)return a[0]}catch{}return null}static GenerateYears(t,r,a){let o=-1;(null==r||null==r)&&(r=11),(null==a||null==a||!a)&&(o=1);const d=[];for(let y=0;y<r;y++)d.push(t+y*o);return d}static DateOnly(t){return t?new Date(new Date(t).toDateString()):new Date((new Date).toDateString())}static calculateNumberBetweenDate(t,r){let a=r.getTime()-t.getTime();return Math.floor(a/864e5)}static Guid_NewGuid(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==a?o:3&o|8).toString(16)})}static parseJwt(t){var a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(a).split("").map(function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(o)}static numberOnly(t){const r=t.which?t.which:t.keyCode;return!(r>31&&(r<48||r>57))}static formatNumber(t){let r,a="",o=Math.abs(t);return o>999&&o<1e6?(a="K",r=(o/1e3).toFixed(0)):o>=1e6?(a="M",r=(o/1e6).toFixed(0)):o<900&&(r=o.toString()),t<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+a}static isToDay(t){if(t){const r=new Date;return r.setHours(0,0,0,0),r.getTime()==t.getTime()}}static compare(t,r,a){return(t<r?-1:1)*(a?1:-1)}}return e.GuidEmpty="00000000-0000-0000-0000-000000000000",e.DecimalMinValue="-7.922816251426434e+28",e.InputLockTimeSpan=500,e.MinDate="0001-01-01T00:00:00",e.MinTime="00:00:00",e.tinyMceApiKey="zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa",e.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}],e})();function i(e){return new Promise((n,t)=>{let r=new Image;r.src=e,r.decode().then(()=>{n({img:e,height:r.height,width:r.width})}).catch(()=>{t(new Error(`Image load error for ${e}`))})})}let m=(()=>{class e{}return e.emptyDate="Please fill invoice date",e.emptyNumber="Please fill invoice number",e.failGetMenu="Fail to get pos menu",e.failToGetRetur="Fail to get retur",e.failGetLocalPosStorage="Fail to get setting and option from local storage, Please re-cache your data while online!",e.failGetVariant='"Error getting variant with {0} {1}" - {2}',e.failGetLocalVariant="Fail to get variant from local storage, Please re-cache your data while online!",e.emptyBarcodeFormat='No product with barcode "{0}"',e.emptyCustomerFormat='No customer with code "{0}"',e.failGetSalesOrder="Fail to get sales order",e.failBin="Fail to bin transaction",e.failGetCustomer="Fail to get customer's data",e.failCreateCustomer="Fail to create customer",e.noRoleContact="You have no right to create new customer",e.submitLocally="Connection unavailable ~ offline! Order stored locally",e.OfflineOrderNotSupport="Offline order is not Supported!",e.failOrderConnectionTimeOut="Connection timeout! Please try uploading your order again!",e.failDeletePark="Fail to delete park",e.emptyAccessRegister="You do not have access to any Register",e.failGenerateNewNumber="Fail to generate new number",e.emptyPayment="There is no active payment method.",e.failOpenRegister="Fail to open register",e.failGetLocalOutletInfo="Fail to get outlet information from local storage, Please re-cache your data while online!",e.failTrySubmit="[Error submitting order] \n{0}",e.failTryCreateCustomer='"[Error creating customer] \n"{0}',e.createCustomerOffline="Create customer is not supported when the connection offline",e.emptyCustomer="Please select customer!",e.emptySalesPerson="Please select sales person!",e.emptySalesType="Please select sales type!",e.failCreateNewVariant="Fail to create new variant",e.requiredDefaultCategory="[WARNING] - POS / Quick Create Product requires Default Category",e.emptyVariant="Item is undefined, please re-type",e.emptyPOItem="You must have at least one item",e.emptyEntity="Please select entity before proceeding..",e.failGetRetrieve="Fail to get retrieve",e.failTryPark="[Error submitting park] \n{0}",e.failTryGetPark="[Error during get park] \n{0}",e.failTryGetOutStanding="[Error during get outstanding] \n{0}",e.failTryGetParkSelect="[Error during get available park select] \n{0}",e.failGetSerial="Fail to get variant serial",e.successSendOrder="Orders synchronized to server. Upload Transaction Complete!",e.successSyncProduct="Products synchronized to Local Storage",e.failGetPark="Fail to get park",e.failMergePark="Fail to merge park",e.failGetOutStanding="Fail to get outstanding",e.failGetParkSelect="Fail to get available park select",e.confirmationDeleteOrder="Are you sure want to delete this order?",e.confirmationCloseRegister="The Register is still occupied under '{0}'. Do you want to end his / her session?",e.closeActiveRegister="You already have an active register with name '{0}'. Do you want to end your session?",e.successSendEmail="Email is sent successfully to '{0}'",e.wrongOfflineAction="This action is not supported when the connection offline",e.emptyCustomerCredit="Credit Payment requires customer specified!",e.debtLimit="Your debt is over limit!",e.emptyCustomerDeposit="Deposit Payment requires customer specified!",e.creditLock="You have no right to give credit!",e.failToSyncProduct="Fail sync product to local storage!",e.failToSyncOrder="Fail sync Order to local storage!",e.emptyDeliveryOutlet="There is no outlet in delivery module.",e.wrongAuthorizationCode="Wrong Authorize Code!",e.priceMinimumRestriction="You have no right to sell this item lower than {0}",e.clearBrowsingData="A new version of our POS is available, please clear your browsing data to apply changes!",e.offlineModeNotification="WARNING! Your point of sale configuration is set to LOCAL, orders are not synchronized automatically.",e.failServerConnection="Something happen to the server, switch query to local mode to continue work!",e.taxEmpty="Tax options is empty, go to setup and add tax!",e.clearCommission="Are you sure to leave this page without saving?",e.voidConfirm="This will replace current order's item(s) with blank order.",e.notSellAble="This item is not for sell",e.partialLoyaltyPointUnable="You only can fully pay with loyalty point, otherwise please remove the loyalty point and use other available payment options",e.DiffDate="Client date is not equal with Server Date",e.pointOnly="{0} need paid by point only",e.cashOnly="{0} cannot paid by point",e.ovoConfig="WARNING! Your ovo configuration is not set",e.failGenerateQR="Failed to generate qr code",e.failPaymentOvo="Failed to pay with ovo, Try again",e.emptyPhone="Please Fill Phone",e.maxInventory="Your Bought Qty will exceed the Max Inventory",e.payNowOnly="You have no access to sell with Later Payment",e})(),l=(()=>{class e{}return e.GetPOSStorage="/API/POS/LoadPOS",e.GenerateNumber="/API/POS/GenerateNumber",e.RefreshToken="/API/Authentication/RefreshToken",e.RemovePark="/API/POS/RemovePark",e.VoidPark="/API/POS/VoidPark",e.ReturInvoice="/API/POS/ReturInvoice",e.BuyReturInvoice="/API/Buy/GetSupplierInvoiceRetur",e.GetSalesOrderJSONByID="/API/POS/GetSalesOrderJSONByID",e.GetPOSDataByID="/API/POS/GetPOSDataByID",e.MergePark="/API/POS/MergePark",e.GetPark="/API/POS/GetParkByEntityID",e.GetOutStanding="/API/POS/GetOutStandingByEntityID",e.GetVacant="/API/POS/GetParkInfoByEntityID",e.RecordOpeningCash="/API/POS/RecordOpeningCash",e.OpenRegister="/API/POS/LoadRegister",e.GetRegisterInfo="/API/POS/GetRegisterInfo",e.BackdateNumber="/API/POS/GenerateBackdateNumber",e.GetVariantByID="/API/catalog/variant/GetVariantByID",e.GetVariantFormModelByID="/API/catalog/variant/GetVariantFormModelById",e.GetVariantByCode="/API/catalog/variant/GetVariantByCode",e.GetVariantSerial="/API/catalog/variant/GetVariantSerial",e.UpdateProductImage="/API/catalog/product/UpdateProductImageUrl",e.GetVariantWithSameProductID="/API/catalog/variant/GetVariantWithSameProductID",e.GetVariantInfoModelById="/API/catalog/variant/GetVariantInfoModelById",e.GetSalesHistory="/Api/catalog/product/GetSalesHistory",e.GetPurchaseHistory="/API/catalog/product/GetPurchaseHistory",e.GetParkedHistory="/API/catalog/product/GetParkOrder",e.CreateVariant="/API/catalog/variant/CreateVariant",e.SendInvoiceEmail="/API/Transaction/SendEmail",e.GetCustomerPrivilegeByID="/API/Contact/GetPrivilegeByID",e.GetCustomerByCode="/API/Contact/GetByCode",e.GetCustomerCode="/API/Contact/GetCode",e.GetCustomerEmailByID="/API/Contact/GetEmailByID",e.GetPriceBookByVariantID="/API/catalog/variant/GetPriceBookByVariantID",e.GetPackageID="/API/POS/GetPackageID",e.Authorize="/API/AuthorizationKey/AuthorizeByType",e.Invoice="/api/Invoice/InvoiceInfo",e.OrdersLoader="/API/OrdersLoader/CustomerInvoice",e.Orders="/api/Invoice/CustomerInvoice",e.PaymentReceivedLoader="/API/PaymentLoader/DailyPaymentLoader",e.PaymentReceived="/API/Payment/DailyPaymentReceived",e.CheckOutUrl="/API/POS/SubmitOrder",e.CheckOutUrlBuy="/API/Buy/SubmitOrder",e.Scanner="/API/AdjustmentLoader/StockTakeByCSV",e.AdjustmentLoader="/API/AdjustmentLoader/GetInventoryAdjustmentList",e.Adjustment="/API/Adjustment/GetInventoryAdjustmentList",e.AdjustmentStorage="/API/Adjustment/GetStorage",e.GetNumberAdjustment="/API/Adjustment/GenerateNumber",e.GetAccountReceivableLoader="/API/DebtLoader/AccountsReceiveableSummary",e.GetAccountReceivableDetailLoader="/API/DebtLoader/AccountsReceiveableDetails",e.GetAccountReceivableSummary="/API/Debt/AccountsReceiveableSummary",e.getAccountreceivableDetail="/API/Debt/AccountsReceiveableDetails",e.ProductLibrarySuggestion="/API/AC/GetVariantSuggestionByCodeNName",e.VoidInvoiceLoader="/API/OrdersLoader/VoidInvoiceLoader",e.VoidInvoice="/api/Invoice/VoidInvoiceList",e.WaitingPatientList="/API/Treatment/WaitingPatientList",e.CheckOutTreatmentByListID="/API/Treatment/CheckOutByListID",e.TreatmentRegisterLoader="/API/TreatmentLoader/Registration",e.TreatmentRegisterOutletInfo="/API/Treatment/RegistrationGetOutletInfo",e.TreatmentCustomerInfo="/API/Treatment/RegistrationGetCustomerInfo",e.SubmitTreatementRegistration="/API/Treatment/RegistrationSubmit",e.SalesOrderMini="/API/Print/SalesOrderMini",e.ProductLoader="/API/catalog/ProductLoader/ProductList",e.ProductList="/API/catalog/product/GetProductList",e.DeleteProductList="/API/catalog/product/DeleteProductList",e.DeleteVariantInfo="/API/catalog/variant/DeleteVariantInfo",e.ProductForm="/API/catalog/ProductLoader/ProductForm",e.SubmitProduct="/API/catalog/product/SubmitProduct",e.ProductInfo="/API/catalog/ProductLoader/ProductInfoInitial",e.CreateCategory="/API/catalog/category/CreateProductCategory",e.CreateBrand="/API/catalog/product/CreateBrand",e.CreateTag="/API/catalog/product/CreateTags",e.CreateUOM="/API/catalog/product/CreateProductUOM",e.VariantInfo="/API/catalog/variant/GetVariantInfoModelById",e.VariantFormData="/API/catalog/variant/GetVariantFormInitialData",e.VariantForm="/API/catalog/variant/GetVariantFormModelById",e.SubmitVariant="/API/catalog/variant/SubmitVariant",e.CreateContact="/API/Contact/Create",e.Closure="/API/POS/Closure",e.SyncProducts="/API/POSSync/Products",e.SyncCustomer="/API/POSSync/Customers",e.SynOutletPrice="/API/POSSync/OutletPrices",e.SynOutlet="/API/POSSync/Outlets",e.SyncPark="/API/POSSync/Parks",e.GetRewardByPromotionID="/API/POS/GetRewardByPromotionID",e.GenerateGopayQrCode="/API/POS/GenerateGoPayQrCode",e.GenerateEmpatKaliQrCode="/API/POS/GenerateEmpatKaliQrCode",e.VerifyPayment="/API/PaymentNotification/VerifyPayment",e.PayWithOvo="/API/POS/PayWithOvo",e.InvoiceA4="/API/Print/Invoice",e.UploadCsv="/API/POS/UploadCsv",e.UploadCsvBuy="/API/Buy/UploadCsv",e.GenerateCommission="/API/Transaction/GetCommission",e.InvoiceInfo="/api/Invoice/InvoiceInfo",e.GenerateLink="/API/PayNow/GenerateLink",e.LoadFormBuy="/API/Buy2/Load",e.BuyGetOutletInfo="/API/Buy2/GetOutletInfo",e.BuyGenerateNumber="/API/Buy/GenerateNumber",e.BuyGetDataByID="/API/Buy2/GetDataByID",e.GetQuickKey="/API/catalog/product/GetQuickKey",e.GetPrintTemplateID="/API/Buy/GetPrintTemplateID",e.GetVariantStockByID="/API/catalog/variant/GetInventoryByVariantID",e.GetSupplierInvoice="/API/Buy/GetSupplierInvoiceRetur",e.GetSupplierDTO="/API/Contact/GetSupplierDTO",e.LoadFormDelivery="/API/TransferOrderLoader/LoadForm",e.DeliveryGenerateNumber="/API/TransferOrder/GenerateNumber",e.UpdateCourierList="/API/TransferOrder/UpdateCourierList",e.SubmitOutletDelivery="/API/TransferOrder/SubmitOrder",e.ClearOutlet="/API/TransferOrder/ClearOutlet",e.PaymentListSorting="/API/Setup/SortPaymentMethod",e.TaxListSorting="/API/Setup/SortTax",e.LoadFormEstimate="/API/Estimate/LoadForm",e.EstimateGenerateNumber="/API/Estimate/GenerateNumber",e.SubmitEstimate="/API/Estimate/SubmitOrder",e.LoadFormAdjustment="/API/Adjustment/LoadForm",e.AdjustmentGenerateNumber="/API/Adjustment/GenerateNumber",e.SubmitAdjustment="/API/Adjustment/SubmitOrder",e.ForecastData="Inventory/Daystozero",e.ForecastLoader="InventoryLoader/Daystozero",e})()},37407:(P,c,s)=>{s.d(c,{G:()=>u});const u={dashboard:{WeeklySales:"Chart"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Delete:"ShiftD"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetailRestriction:"ContactDetailRestriction",ContactImageEditor:"ContactImageEditor"},sell:{Create:"Sell",PricebookSelector:"PricebookSelector",Edit:"SellEditor",Delete:"SellDelete",Date:"DateEditor",Number:"NumberEditor",SalesPerson:"SalesmanEditor",Return:"Return",Discount:"Discount",UnitPriceEditor:"UnitPriceEditor",Commission:"Commission",TaxRestriction:"TaxRestriction",CustomerInputLock:"CustomerInputLock",PaymentRestriction:"PaymentRestriction",PriceVisibleRestriction:"PriceVisibleRestriction",PriceMinimum:"PriceMinimum",EmailRestriction:"EmailRestriction",DeleteItemRestriction:"DeleteItemRestriction",ShippingRestriction:"ShippingRestriction",PaymentCodeLock:"PaymentCodeLock",EraseVoidOrd:"EraseVoidOrd",RestoreVoidOrd:"RestoreVoidOrd",RetrieveRestriction:"RetrieveRestriction",BundlingPrice:"BundlingPrice",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CreditSalesLock"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",ReprintRestriction:"OrdRpr",NoteEditor:"OrdNe",InvoiceRestricted:"Ordlr"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrintingRestriction:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE",PaymentDate:"PayDE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",DateEditor:"BuyDE",ShippingRestriction:"BuyShippingRestriction",Approval:"PurA"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferDateEditor:"DelDE",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UserGroupsRestriction",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[1930],{10735:(lt,P,l)=>{l.r(P),l.d(P,{BuyModule:()=>An});var d=l(36895),p=l(24006),f=l(63165),S=l(30273),v=l(24537),C=l(22863),s=l(67327),O=l(77579),y=l(39300),m=l(82722),I=l(24351),D=l(93414),g=l(86751),x=l(94601),q=l(54840),_=l(65412),R=l(50494),F=l(45701),b=(()=>{return(o=b||(b={}))[o.NEW=0]="NEW",o[o.UPDATE=1]="UPDATE",o[o.COMPLETE=2]="COMPLETE",o[o.RETUR=3]="RETUR",b;var o})(),K=l(98818),w=l(42046),t=l(94650),T=l(23945),M=l(50826),Ot=l(25873),$=l(60769),j=l(50),L=l(97185),Y=l(89156);let N=(()=>{class o{constructor(){}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var ct=l(18505);let st=(()=>{class o{constructor(e){this.httpService=e}getOutletInfo(e){return this.httpService.post(s.Wz.BuyGetOutletInfo,{EntityID:e}).pipe((0,ct.b)(i=>{this.outletInfo=i}))}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(Y.O))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Z=l(36806),U=l(88796),W=l(58393),Dt=l(29080),V=l(83902),dt=l(41658),A=l(10266),z=l(54825);const Tt=["quantity"],It=["price"],Pt=["discount"],ut=function(o){return{selected:o}};function St(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onTabChange(i.modalItemState.INVENTORY))}),t._uU(1," Product "),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,ut,e.modalItemState.INVENTORY==e.currentStateTab))}}function wt(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",11)(2,"div",13)(3,"autocompleteV2",14,15),t.NdJ("onInputEnter",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onScanProductCode(i))})("onSelect",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onAddItem(i))}),t.qZA()()(),t.BQk()}if(2&o){const e=t.oxw(2);t.xp6(3),t.Q6J("localStorage","products")("inputTextValue",null==e.cartItem||null==e.cartItem.Variant?null:e.cartItem.Variant.Name)("clearOnSelect",!1)}}function Nt(o,r){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw(3);t.xp6(1),t.hij("(",null==e.cartItem.Variant?null:e.cartItem.Variant.UOMName,")")}}function Zt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",26)(1,"strong")(2,"span"),t._uU(3),t.qZA()(),t.TgZ(4,"input",27),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.cartItem.UnitQuantity=i)}),t.qZA()()}if(2&o){const e=t.oxw(3);t.xp6(3),t.Oqu(e.unitQtyLabel),t.xp6(1),t.Q6J("preventNegative",!0)("ngModel",e.cartItem.UnitQuantity)}}function At(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",28)(1,"strong"),t._uU(2,"Price"),t.qZA(),t.TgZ(3,"input",29,30),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.cartItem.UnitPrice=i)}),t.qZA()()}if(2&o){const e=t.oxw(3);t.xp6(3),t.Q6J("simpleKeyboard",e.keyboard)("ngModel",e.cartItem.UnitPrice)}}function kt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",31)(1,"strong"),t._uU(2,"Fulfillment From"),t.qZA(),t.TgZ(3,"ng-select",32),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.onDeliveryEntityChange(i))})("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.cartItem.EntityID=i)}),t.qZA()()}if(2&o){const e=t.oxw(3);t.xp6(3),t.Q6J("items",e.entities)("ngModel",e.cartItem.EntityID)}}function Jt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",16)(1,"div",17)(2,"strong"),t._uU(3," Qty "),t.YNc(4,Nt,2,1,"span",8),t.qZA(),t.TgZ(5,"input",18,19),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.cartItem.Quantity=i)}),t.qZA()(),t.YNc(7,Zt,5,3,"div",20),t.YNc(8,At,5,2,"div",21),t.TgZ(9,"div",22)(10,"strong"),t._uU(11,"Discount %"),t.qZA(),t.TgZ(12,"input",23,24),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.cartItem.Discount=i)}),t.qZA()(),t.YNc(14,kt,4,2,"div",25),t.qZA()}if(2&o){const e=t.oxw(2);t.xp6(4),t.Q6J("ngIf",null==e.cartItem.Variant?null:e.cartItem.Variant.UOM),t.xp6(1),t.Q6J("disabled",e.isRetur)("simpleKeyboard",e.keyboard)("preventNegative",!e.isRetur)("ngModel",e.cartItem.Quantity),t.xp6(2),t.Q6J("ngIf",e.unitQtyLabel),t.xp6(1),t.Q6J("ngIf",e.roleCost),t.xp6(4),t.Q6J("simpleKeyboard",e.keyboard)("ngModel",e.cartItem.Discount)("readonly",!e.role.Discount),t.xp6(2),t.Q6J("ngIf",e.splitDeliveryOutletEnabled&&1==(null==e.buyData||null==e.buyData.Order?null:e.buyData.Order.DeliveryStateID))}}function Ft(o,r){1&o&&(t.TgZ(0,"label",38),t._uU(1,"Note:"),t.qZA())}function Ut(o,r){1&o&&(t.TgZ(0,"label",38),t._uU(1,"Serial:"),t.qZA())}function Et(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",39)(1,"a",40),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.serialSelectMode=!0)}),t._UZ(2,"i",41),t._uU(3," Back "),t.qZA()()}}function Qt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",11)(1,"div",33),t.YNc(2,Ft,2,0,"label",34),t.YNc(3,Ut,2,0,"label",34),t.YNc(4,Et,4,0,"div",35),t.qZA(),t.TgZ(5,"div",36)(6,"POS-tinymce-editor",37),t.NdJ("valueChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.cartItem.Note=i)}),t.qZA()()()}if(2&o){const e=t.oxw(2);t.xp6(2),t.Q6J("ngIf",!e.isSerial()),t.xp6(1),t.Q6J("ngIf",e.isSerial()),t.xp6(1),t.Q6J("ngIf",e.isSerial()),t.xp6(2),t.Q6J("value",e.cartItem.Note)}}function qt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"p-chips",47),t.NdJ("onFocus",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.onFocusAddSerial())})("onBlur",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.onBlurAddSerial())})("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.addSerial(i))}),t.qZA()}if(2&o){const e=t.oxw(3);t.Q6J("placeholder","E.g. Serial1 Serial2")("allowDuplicate",!1)("ngModel",e.cartItem.Serial)}}function Rt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"ng-select",48),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.cartItem.Serial=i)}),t.qZA()}if(2&o){const e=t.oxw(3);t.Q6J("items",e.serialOptions)("multiple",!0)("ngModel",e.cartItem.Serial)}}function Lt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",13)(1,"strong"),t._uU(2,"Serial:"),t.qZA(),t.TgZ(3,"div",42),t.YNc(4,qt,1,3,"p-chips",43),t.YNc(5,Rt,1,3,"ng-select",44),t.TgZ(6,"a",45),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.serialSelectMode=!1)}),t._UZ(7,"i",46),t.qZA()()()}if(2&o){const e=t.oxw(2);t.xp6(4),t.Q6J("ngIf",e.cartItem.Quantity>=0||!e.cartItem.Quantity),t.xp6(1),t.Q6J("ngIf",e.cartItem.Quantity<0)}}function Yt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"ng-select",48),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.cartItem.Serial=i)}),t.qZA()}if(2&o){const e=t.oxw(3);t.Q6J("items",e.serialOptions)("multiple",!0)("ngModel",e.cartItem.Serial)}}function Vt(o,r){if(1&o&&(t.TgZ(0,"div",13),t.YNc(1,Yt,1,3,"ng-select",44),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.cartItem.Quantity)}}function Ht(o,r){if(1&o&&(t.ynx(0),t.TgZ(1,"div",7),t.YNc(2,wt,5,3,"ng-container",8),t.YNc(3,Jt,15,11,"div",9),t.YNc(4,Qt,7,4,"div",10),t.TgZ(5,"div",11),t.YNc(6,Lt,8,2,"div",12),t.YNc(7,Vt,2,1,"div",12),t.qZA()(),t.BQk()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","create"==e.statusModal),t.xp6(1),t.Q6J("ngIf",e.cartItem),t.xp6(1),t.Q6J("ngIf",!e.serialSelectMode),t.xp6(2),t.Q6J("ngIf",e.serialSelectMode&&e.constants.IsEmpty(e.cartItem.ID)),t.xp6(1),t.Q6J("ngIf",e.serialSelectMode&&e.constants.IsNotEmpty(e.cartItem.ID))}}function Bt(o,r){1&o&&(t.ynx(0),t._UZ(1,"i",68),t.TgZ(2,"h6"),t._uU(3,"No Image"),t.qZA(),t.BQk())}function Gt(o,r){if(1&o&&t._UZ(0,"img",69),2&o){const e=t.oxw(2);t.Q6J("src",e.cartItem.Variant.ThumbnailUrl,t.LSH)}}function Kt(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"button",70),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.setQuantityToMax())}),t._uU(1," Place Order "),t.qZA()}}const $t=function(){return["/menu/Products/Catalog/Variants/Info"]},jt=function(o){return{ID:o}},Wt=function(o){return{"table-light":o}};function zt(o,r){if(1&o&&(t.TgZ(0,"div",49)(1,"div",50)(2,"a",51),t.YNc(3,Bt,4,0,"ng-container",4),t.YNc(4,Gt,1,1,"ng-template",null,52,t.W1O),t.qZA()(),t.TgZ(6,"div",53)(7,"table",54)(8,"tbody")(9,"tr")(10,"th",55),t._UZ(11,"i",56),t._uU(12,"Inventory"),t.qZA(),t.TgZ(13,"th",55),t._UZ(14,"i",57),t._uU(15),t.qZA(),t.TgZ(16,"th",55),t._UZ(17,"i",58),t._uU(18," Diff"),t.qZA(),t.TgZ(19,"th",55),t._UZ(20,"i",59),t._uU(21," Action"),t.qZA()(),t.TgZ(22,"tr")(23,"th",60),t._uU(24," On Hand "),t.qZA(),t.TgZ(25,"td",61),t._uU(26),t.ALo(27,"number"),t.qZA(),t._UZ(28,"td",62)(29,"td",63),t.qZA(),t.TgZ(30,"tr")(31,"th",60),t._uU(32," Allocated "),t.qZA(),t.TgZ(33,"td",61),t._uU(34),t.ALo(35,"number"),t.qZA()(),t.TgZ(36,"tr")(37,"th",60),t._uU(38,"Available"),t.qZA(),t.TgZ(39,"td",61),t._uU(40),t.ALo(41,"number"),t.qZA()(),t.TgZ(42,"tr")(43,"th",60),t._uU(44,"ROP"),t.qZA(),t.TgZ(45,"td",61),t._uU(46),t.ALo(47,"number"),t.qZA(),t.TgZ(48,"td",64),t._uU(49),t.ALo(50,"number"),t.qZA()(),t.TgZ(51,"tr")(52,"th",60),t._uU(53,"Max"),t.qZA(),t.TgZ(54,"td",61),t._uU(55),t.ALo(56,"number"),t.qZA(),t.TgZ(57,"td",65),t._uU(58),t.ALo(59,"number"),t.qZA(),t.TgZ(60,"td",66),t.YNc(61,Kt,2,0,"button",67),t.qZA()()()()()()),2&o){const e=t.MAs(5),n=t.oxw();t.xp6(2),t.Q6J("routerLink",t.DdM(30,$t))("queryParams",t.VKq(31,jt,null==n.cartItem||null==n.cartItem.Variant?null:n.cartItem.Variant.ID)),t.xp6(1),t.Q6J("ngIf",null==(null==n.cartItem||null==n.cartItem.Variant?null:n.cartItem.Variant.ThumbnailUrl))("ngIfElse",e),t.xp6(12),t.Oqu(n.outletName),t.xp6(11),t.hij(" ",t.lcZ(27,16,n.onHand)," "),t.xp6(8),t.hij(" ",t.lcZ(35,18,n.allocated)," "),t.xp6(6),t.hij(" ",t.lcZ(41,20,n.onHand-n.allocated)," "),t.xp6(6),t.hij(" ",t.lcZ(47,22,n.rop)," "),t.xp6(3),t.AsE(" ",n.ropDiff>=0?"+":"","",t.lcZ(50,24,n.ropDiff),""),t.xp6(6),t.hij(" ",t.lcZ(56,26,n.max)," "),t.xp6(3),t.AsE(" ",n.maxDiff>=0?"+":"","",t.lcZ(59,28,n.maxDiff),""),t.xp6(2),t.Q6J("ngClass",t.VKq(33,Wt,n.cartItem.isMaxInventory)),t.xp6(1),t.Q6J("ngIf",!n.cartItem.isMaxInventory)}}let pt=(()=>{class o extends class vt{constructor(){this.modalItemState=K.Y,this.initModalConfig(),this.cartItem=new F.k,this.maxDiff=0,this.ropDiff=0,this.hasInventoryView=!1}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.customWidth="685px"}}{constructor(e,n,i,a,c,u,h,E,Q,at,rt){super(),this.data=e,this.dialogRef=n,this.firstLoadService=i,this.buyDataService=a,this.numpadService=c,this.cartItemService=u,this.backendService=h,this.toastrService=E,this.httpService=Q,this.buyStateService=at,this.outletService=rt,this.isFocusSerialInput=!1,this.constants=s.gT,this.destroy$=new O.x,this.isRetur=i.role.Return,this.roleCost=i.role.Cost,this.hasInventoryView=i.role.InventoryView,this.currentStateTab=K.Y.INPUT,this.outletName=this.outletService.outletInfo.EntityName}ngOnInit(){this.initData(),this.subscribeBuyData(),this.initOutletName()}ngAfterViewInit(){setTimeout(()=>{this.initFieldFocus()},200)}subscribeBuyData(){this.buyDataService.Data$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.buyData=e})}initOutletName(){let n=this.firstLoadService.Data.Entities.find(i=>i.ID==this.data.entityID);this.outletName=n.Name}initFieldFocus(){switch(this.data&&this.data.focus){case"Price":this._priceElement.nativeElement.focus();break;case"Discount":this._discountElement.nativeElement.focus();break;case"Quantity":this._quantityElement.nativeElement.focus()}}initData(){this.initStatusModal(),this.mapAppConfigJson(this.firstLoadService.Data.AppConfigJSON),this.cartItem=(0,R.d8)(F.k,this.data.cartItem),this.entities=this.firstLoadService.Data.Entities,this.updateHeaderTitle(this.cartItem.Variant?this.cartItem.Variant.Name:"Adding new items to order"),this.serialSelectMode=this.isSerial(),this.role=this.firstLoadService.role,this.numpadVisible&&(this.keyboard=this.numpadService.keyboard),this.getSerialItem()}getSerialItem(){if(this.cartItem.isSerialType()){const e=this.buyStateService.state;this.serialOptions=[],e==b.RETUR?this.setSerialSelectOption():this.httpService.post(s.Wz.GetVariantSerial,{entityID:this.data.entityID,variantID:this.cartItem.VariantID}).subscribe(i=>{this.serialOptions=[...this.serialOptions,...i.map(a=>({Value:a.Serial,Label:a.Serial}))]})}}initConfigQty(){this.quantityToOneInDialog?this.cartItem.Quantity=1:(this.cartItem.Quantity=null,this._quantityElement.nativeElement.focus())}initStatusModal(){this.statusModal=null!=this.data.index?"update":"create"}updateHeaderTitle(e){this.modalConfig.title=e}onAddItem(e){this.backendService.getVariantById(e,this.data.entityID).pipe((0,m.R)(this.destroy$)).subscribe(n=>{this.createNewCartItem(n),this.initConfigQty()})}onScanProductCode(e){this.backendService.getVarianByCode(e,this.data.entityID).pipe((0,m.R)(this.destroy$)).subscribe(n=>{this.createNewCartItem(n)})}createNewCartItem(e){let n=new F.k(e);this.cartItem=n,this.serialSelectMode=this.isSerial(),this.queryInventoryOnOpen=!1,this.updateHeaderTitle(this.cartItem.Variant.Name),this.getSerialItem()}onDeliveryEntityChange(e){let n=this.entities.find(i=>i.ID==e);n&&(this.cartItem.EntityName=n.Name)}checkItemIsUndefined(){let n=!1;return s.gT.IsEmpty(this.cartItem.VariantID)&&(n=!0,this.toastrService.error("Item is not selected properly, please re-select item.","Error")),n}onOk(e){if(!this.isFocusSerialInput){if(!this.validateConfigDefaultQuantity(e))return;if(!this.cartItem.checkMatchSerialWithQuantity())return void this.toastrService.warning("Serial must be equal with the quantity","Warning!");if(this.checkItemIsUndefined())return;this.checkWarningMaxInventory(),this.cartItem.setSerialToNote(),"create"===this.statusModal?this.cartItemService.addItemToCart(this.cartItem,!0):this.cartItemService.updateCartItem(this.cartItem,this.data.index),this.dialogRef.close()}}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}validateConfigDefaultQuantity(e){return!("Enter"==e&&!this.quantityToOneInDialog)||this.cartItem.Quantity>0}checkWarningMaxInventory(){this.cartItem.Quantity>this.max&&this.toastrService.warning(s.g7.maxInventory,"Warning!")}isSerial(){return null!=this.cartItem.Variant&&4==this.cartItem.Variant.TypeID}mapAppConfigJson(e){this.numpadVisible=e.ModuleSell.NumPadVisible,this.pricebookCopyDesc=e.ModuleSell.Pricebook.PricebookVisible,this.calculatorEnabled=e.ModuleSell.ProductDialog.CalculatorEnabled,this.quantityToOneInDialog=e.ModuleSell.ProductDialog.QuantityToOneInDialog,this.unitQtyLabel=e.ModuleSell.ProductDialog.UnitQtyLabel,this.splitDeliveryOutletEnabled=e.ModuleSell.ProductDialog.SplitDeliveryOutletEnabled}onFocusAddSerial(){this.isFocusSerialInput=!0}onBlurAddSerial(){this.isFocusSerialInput=!1}addSerial(e){this.cartItem.Serial=e,this.cartItem.Quantity=e.length,this.setSerialSelectOption()}setSerialSelectOption(){this.cartItem.Serial&&this.cartItem.SerialSource&&(this.serialOptions=this.cartItem.SerialSource.map(e=>({Value:e,Label:e})))}onTabChange(e){this.currentStateTab=e,e==K.Y.INVENTORY&&!this.queryInventoryOnOpen&&this.getStockById()}getStockById(){this.backendService.getItemStock(this.cartItem.VariantID,this.data.entityID).pipe((0,m.R)(this.destroy$)).subscribe(n=>{if(n){this.queryInventoryOnOpen=!0,this.onHand=n.OnHand,this.allocated=n.Allocated,this.rop=n.ROP,this.max=n.Max;let i=this.onHand-this.allocated;this.maxDiff=this.max-i,this.ropDiff=this.rop-i}})}setQuantityToMax(){let e=this.onHand-this.allocated;this.max>=e?(this.cartItem.Quantity=this.max-e,this.cartItem.isMaxInventory=!0,this.onOk("Ok"),this.toastrService.success("Qty adjusted to Max Inventory","Success")):this.toastrService.warning("Your Inventory Available is more than Max Inventory","Warning")}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(_.WI),t.Y36(_.so),t.Y36(T.O),t.Y36(M.q),t.Y36(Ot.u),t.Y36($.R),t.Y36(j.M),t.Y36(L._W),t.Y36(Y.O),t.Y36(N),t.Y36(st))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-modal-item"]],viewQuery:function(e,n){if(1&e&&(t.Gf(Tt,5),t.Gf(It,5),t.Gf(Pt,5)),2&e){let i;t.iGM(i=t.CRH())&&(n._quantityElement=i.first),t.iGM(i=t.CRH())&&(n._priceElement=i.first),t.iGM(i=t.CRH())&&(n._discountElement=i.first)}},features:[t.qOj],decls:10,vars:7,consts:[[3,"config","onOk","onCancel","onClose"],[1,"row","border-bottom"],["data-cy","input_sell",1,"btn","btn-link",3,"ngClass","click"],["class","btn btn-link","data-cy","product",3,"ngClass","click",4,"ngIf"],[4,"ngIf","ngIfElse"],["INVENTORY",""],["data-cy","product",1,"btn","btn-link",3,"ngClass","click"],[1,"mt-8",2,"min-width","650px"],[4,"ngIf"],["class","row mt-8",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],["class","col",4,"ngIf"],[1,"col"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Input product name / code",1,"form-control",3,"localStorage","inputTextValue","clearOnSelect","onInputEnter","onSelect"],["variant",""],[1,"row","mt-8"],[1,"col-auto","mb-4","pe-0",2,"width","82px"],["id","txtCartQuantity","keyboardType","number","type","text","autoNum","",1,"form-control","input-numpad",3,"disabled","simpleKeyboard","preventNegative","ngModel","ngModelChange"],["quantity",""],["class","col-auto pe-0","style","width: 82px",4,"ngIf"],["class","col-auto pe-0","style","width: 112px",4,"ngIf"],[1,"col-auto","pe-0",2,"width","90px"],["id","inputDiscount","keyboardType","number","type","text","autoNum","","percentage","",1,"form-control",3,"simpleKeyboard","ngModel","readonly","ngModelChange"],["discount",""],["class","col-auto pe-0","style","width: 220px",4,"ngIf"],[1,"col-auto","pe-0",2,"width","82px"],["type","text","autoNum","",1,"form-control","input-numpad",3,"preventNegative","ngModel","ngModelChange"],[1,"col-auto","pe-0",2,"width","112px"],["id","inputPrice","keyboardType","number","type","text","autoNum","",1,"form-control",3,"simpleKeyboard","ngModel","ngModelChange"],["price",""],[1,"col-auto","pe-0",2,"width","220px"],["bindLabel","Name","bindValue","ID","placeholder","Delivery Outlet","appendTo","body",2,"width","200px",3,"items","ngModel","ngModelChange"],[1,"col-sm-12","d-flex","justify-content-between"],["class","fw-bold d-block",4,"ngIf"],["class","mx-3",4,"ngIf"],[1,"col","tinymce"],["height","210px",3,"value","valueChange"],[1,"fw-bold","d-block"],[1,"mx-3"],[1,"keyboard-serial","ms-auto",2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-arrow-rotate-left","me-2"],[1,"d-flex"],[3,"placeholder","allowDuplicate","ngModel","onFocus","onBlur","ngModelChange",4,"ngIf"],["style","width: 490px;","bindLabel","Label","bindValue","Value","appendTo","body","placeholder","Insert Serial",3,"items","multiple","ngModel","ngModelChange",4,"ngIf"],[1,"keyboard-serial","ms-auto",3,"click"],[1,"fa-solid","fa-keyboard","fa-2x","ps-5"],[3,"placeholder","allowDuplicate","ngModel","onFocus","onBlur","ngModelChange"],["bindLabel","Label","bindValue","Value","appendTo","body","placeholder","Insert Serial",2,"width","490px",3,"items","multiple","ngModel","ngModelChange"],[1,"row","mt-6"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-muted"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],["SHOW_IMAGE",""],[1,"col-sm-8"],[1,"table","table-bordered","text-center","inventory-table","w-auto"],[1,"bg-light-orange"],["aria-hidden","true",1,"fa-box-archive","fa-solid","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-house","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-plus-minus","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-sliders","fa-1x","me-2"],[1,"table-light","text-start"],[1,"text-end"],["rowspan","3",1,"table-light"],["rowspan","4",1,"table-light"],[1,"text-danger"],[1,"text-success"],[3,"ngClass"],["style","font-size: 12px;","type","button","class","btn btn-success btn-sm me-2","matTooltipPosition","above","matTooltip","Adjust Bought Qty to max Inventory",3,"click",4,"ngIf"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],["type","button","matTooltipPosition","above","matTooltip","Adjust Bought Qty to max Inventory",1,"btn","btn-success","btn-sm","me-2",2,"font-size","12px",3,"click"]],template:function(e,n){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(a){return n.onOk(a)})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div")(4,"a",2),t.NdJ("click",function(){return n.onTabChange(n.modalItemState.INPUT)}),t._uU(5," Cart "),t.qZA(),t.YNc(6,St,2,3,"a",3),t.qZA()(),t.YNc(7,Ht,8,5,"ng-container",4),t.YNc(8,zt,62,35,"ng-template",null,5,t.W1O),t.qZA()()),2&e){const i=t.MAs(9);t.Q6J("config",n.modalConfig),t.xp6(4),t.Q6J("ngClass",t.VKq(5,ut,n.modalItemState.INPUT==n.currentStateTab)),t.xp6(2),t.Q6J("ngIf",(null==n.cartItem||null==n.cartItem.Variant?null:n.cartItem.Variant.Name)&&n.hasInventoryView),t.xp6(1),t.Q6J("ngIf",n.currentStateTab==n.modalItemState.INPUT)("ngIfElse",i)}},dependencies:[d.mk,d.O5,p.Fj,p.JJ,p.On,Z.yS,f.M,U.w9,W.J,Dt.V,V.b,dt.cL,A.gM,z.V,d.JJ],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}"]}),o})();var gt=l(47634),mt=l(12422);function Xt(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",8)(2,"div",9)(3,"label",10),t._uU(4,"Discount %"),t.qZA(),t.TgZ(5,"div",11)(6,"input",12),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.data.discount=i)}),t.qZA(),t.TgZ(7,"span",13),t._uU(8,"%"),t.qZA()()(),t.TgZ(9,"div",14)(10,"label",15),t._uU(11),t.qZA(),t.TgZ(12,"input",16),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.data.discountAmount=i)}),t.qZA()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(6),t.Q6J("ngModel",e.data.discount),t.xp6(5),t.hij("Discount ",e.data.currencySymbol,""),t.xp6(1),t.Q6J("ngModel",e.data.discountAmount)}}function te(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",8)(1,"div",17)(2,"input",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.disc[0]=i)})("keyup",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.discountCalculator())}),t.qZA(),t.TgZ(3,"span"),t._uU(4,"%+"),t.qZA(),t.TgZ(5,"input",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.disc[1]=i)})("keyup",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.discountCalculator())}),t.qZA(),t.TgZ(6,"span"),t._uU(7,"%+"),t.qZA(),t.TgZ(8,"input",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.disc[2]=i)})("keyup",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.discountCalculator())}),t.qZA(),t.TgZ(9,"span"),t._uU(10,"%"),t.qZA()()()}if(2&o){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.disc[0]),t.xp6(3),t.Q6J("ngModel",e.disc[1]),t.xp6(3),t.Q6J("ngModel",e.disc[2])}}const _t=function(o){return{selected:o}};let ee=(()=>{class o{constructor(e,n){this.dialogRef=e,this.data=n,this.disc=[],this.tabState=mt.S,this.config=new w.O,this.config.title="Discount from Supplier",this.config.customWidth="350px",this.initTab()}initTab(){this.currentTabState=mt.S.DISCOUNT}discountCalculator(){let e=100;this.disc.forEach(n=>e=e*(100-n)/100),this.data.discount=100-e}onOk(){this.dialogRef.close(this.data)}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(_.so),t.Y36(_.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-modal-discount"]],decls:12,vars:9,consts:[[3,"config","onCancel","onClose","onOk"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"col-12"],["data-cy","discount",1,"btn","btn-link-tab",3,"ngClass","click"],["data-cy","calculator",1,"btn","btn-link-tab",3,"ngClass","click"],[4,"ngIf","ngIfElse"],["CALCULATOR",""],[1,"row","mt-8"],[1,"col-sm-6","ps-12"],[1,"fw-bold","d-block"],[1,"input-group","mb-3"],["type","text","autoNum","","percentage","",1,"form-control",3,"ngModel","ngModelChange"],[1,"input-group-text"],[1,"col-sm-6","pe-12"],[1,"fw-bold"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","d-flex","align-items-center","justify-content-center"],["type","text","autoNum","","percentage","",1,"form-control",2,"width","70px","display","inline",3,"ngModel","ngModelChange","keyup"]],template:function(e,n){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()})("onOk",function(){return n.onOk()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"a",4),t.NdJ("click",function(){return n.currentTabState=n.tabState.DISCOUNT}),t._uU(6," Discount "),t.qZA(),t.TgZ(7,"a",5),t.NdJ("click",function(){return n.currentTabState=n.tabState.CALCULATOR}),t._uU(8," Calculator "),t.qZA()()(),t.YNc(9,Xt,13,3,"ng-container",6),t.YNc(10,te,11,3,"ng-template",null,7,t.W1O),t.qZA()()()),2&e){const i=t.MAs(11);t.Q6J("config",n.config),t.xp6(5),t.Q6J("ngClass",t.VKq(5,_t,n.tabState.DISCOUNT==n.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(7,_t,n.tabState.CALCULATOR==n.currentTabState)),t.xp6(2),t.Q6J("ngIf",n.tabState.DISCOUNT==n.currentTabState)("ngIfElse",i)}},dependencies:[d.mk,d.O5,p.Fj,p.JJ,p.On,f.M,V.b]}),o})();var ht=l(47134),X=l(11156),ne=l(72480),tt=l(61135),oe=l(95521);let k=(()=>{class o{constructor(e,n,i,a,c){this.firstLoadService=e,this.buyDataService=n,this.decimalPipe=i,this.POSMATH=a,this.router=c,this._Data=new tt.X(null),this.currentTax=new ne.z,this.currencySymbol="Rp",this.Data$=this._Data.asObservable().pipe((0,y.h)(u=>null!==u)),this.buyData=new D.F,this.firstLoadService.Data$.subscribe(u=>{this.router.url.includes("Buy")&&(this.appConfigJson=u.AppConfigJSON,this.buyDataService.Data$.subscribe(h=>{this.buyData=h,s.gT.IsNotEmpty(h.Order.Number)&&this.pushNewValue(this.grandTotal)}))})}get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}get grandTotal(){const e=this.POSMATH.Round(this.totalAfterTax,this.appConfigJson.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJson.ApplicationMath.RoundingDigit.RoundAlgorithm);return isNaN(e)?0:e}get grossTotal(){return this.sum(this.buyData.Items,"Total")}get totalAfterTax(){let e=this.taxAmount;return this.currentTax.CalculationTypeID==X.E.Include&&(e=0),this.totalAfterDiscount+e}get grossTotalTaxable(){const e=this.buyData.Items.filter(i=>i.Taxable);let n=this.sum(e,"Total");if(0!==e.length)if(1===this.appConfigJson.ModuleSell.BaseTaxCalculation)n=n*(100-this.buyData.Order.Discount)/100,n-=this.buyData.Order.DiscountAmount;else{for(const i of e)i.TotalWithoutDiscount=i.Quantity*i.UnitPrice*i.UnitQuantity;n=this.sum(e,"TotalWithoutDiscount")}return n}get TotalBeforeTax(){let n=0;return n=this.currentTax.CalculationTypeID===X.E.Include?this.totalAfterDiscount-this.taxAmount:this.totalAfterDiscount,n}get discount1Amount(){return this.grossTotal*this.buyData.Order.Discount/100}get totalAfterDiscount(){return this.grossTotal-this.discountTotal}get discountTotal(){return this.discount1Amount+Number(this.buyData.Order.DiscountAmount)}get taxAmount(){if(null!=this.currentTax){let e=0;const a=this.grossTotalTaxable;return e=this.currentTax.CalculationTypeID==X.E.Include?this.currentTax.Rate/(100+this.currentTax.Rate)*a:this.currentTax.Rate/100*a,e=this.POSMATH.Round(e,this.appConfigJson.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,this.appConfigJson.ApplicationMath.RoundingTaxDigit.RoundAlgorithm),e}return 0}sum(e,n){let i=e.reduce((a,c)=>a+c[n],0);return i=this.decimalPipe.transform(i,"1.0-4"),i=parseFloat(i.split(",").join("")),i}generateCashSuggestion(){const i=this.firstLoadService.Data.Payments.filter(c=>1==c.TypeID),a=[];return i.length>0&&(a.push(this.grandTotal),[1e4,2e4,5e4,1e5].forEach(c=>{let u=this.grandTotal/c;u=Math.ceil(u);const h=u*c;0!=h&&-1===a.indexOf(h)&&a.length<3&&a.push(h)})),a}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(T.O),t.LFG(M.q),t.LFG(d.JJ),t.LFG(oe.l),t.LFG(Z.F0))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const H=function(o){return{selected:o}};function ie(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",10)(1,"label",11)(2,"input",12),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Order.TypeID=i)}),t.qZA(),t._uU(3),t.qZA()()}if(2&o){const e=r.$implicit,n=r.index,i=t.oxw(2);t.xp6(1),t.s9C("for","potype-"+n),t.Q6J("ngClass",t.VKq(6,H,i.buyData.Order.TypeID==e.ID)),t.xp6(1),t.s9C("id","potype-"+n),t.Q6J("ngModel",i.buyData.Order.TypeID)("value",e.ID),t.xp6(1),t.hij(" ",e.Name," ")}}function ae(o,r){if(1&o&&(t.ynx(0),t.TgZ(1,"div",8),t.YNc(2,ie,4,8,"div",9),t.qZA(),t.BQk()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("ngForOf",e.poTypes)}}function re(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",13)(2,"POS-tinymce-editor",14),t.NdJ("valueChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.buyData.Order.Note=i)}),t.qZA()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(2),t.Q6J("value",e.buyData.Order.Note)}}function le(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",25)(1,"span",26),t._uU(2,"@"),t.qZA(),t.TgZ(3,"input",27),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Order.CurrencyRate=i)}),t.qZA()()}if(2&o){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.buyData.Order.CurrencyRate)}}const ce=function(o,r){return{"col-sm-3":o,"col-sm-7":r}},se=function(o){return{"w-100":o}};function de(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",15)(2,"div",16)(3,"div",17),t._uU(4," Currency : "),t.qZA(),t.TgZ(5,"div",18)(6,"ng-select",19),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.buyData.Order.CurrencyID=i)})("change",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.updateCurrencySymbol(i))}),t.qZA()(),t.YNc(7,le,4,1,"div",20),t.qZA()(),t.TgZ(8,"div",21)(9,"div",22),t._uU(10," Term : "),t.qZA(),t.TgZ(11,"div",23)(12,"ng-select",24),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.buyData.Order.Note=i)}),t.qZA()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(5),t.Q6J("ngClass",t.WLB(9,ce,e.buyData.Order.CurrencyID!=e.defaultCurrencyID,e.buyData.Order.CurrencyID==e.defaultCurrencyID)),t.xp6(1),t.Q6J("ngClass",t.VKq(12,se,e.buyData.Order.CurrencyID==e.defaultCurrencyID))("items",e.currencies)("ngModel",e.buyData.Order.CurrencyID)("clearable",!1),t.xp6(1),t.Q6J("ngIf",e.buyData.Order.CurrencyID!=e.defaultCurrencyID),t.xp6(5),t.Q6J("items",e.predefinedNotes)("ngModel",e.buyData.Order.Note)("clearable",!1)}}let ue=(()=>{class o{constructor(e,n,i,a,c){this.firstLoadService=e,this.dialogRef=n,this.buyDataService=i,this.invoiceCalculatorService=a,this.toastrService=c,this.buyData=new D.F,this.modalTabState=ht.e,this.modalConfig=new w.O,this.currentTabState=ht.e.NOTE,this.modalConfig.title="Purchase order Note",this.poTypes=e.Data.SupplierPOTypes,this.currencies=e.Data.Currencies,this.predefinedNotes=e.Data.PredefinedNotes,this.defaultCurrencyID=e.Data.AppConfigJSON.CoreDefaults.CurrencyID,this.buyData=this.buyDataService.Data}updateCurrencySymbol(e){this.invoiceCalculatorService.currencySymbol=e.Symbol}onSelectNote(e){let n=this.predefinedNotes.find(i=>i.ID==e);this.buyData.Order.Note=n.Label}onOk(e){if("Enter"!==e){let n=this.buyData.Order.Note;if(n&&n.length>500)return void this.toastrService.warning("Maximum 500 characters allowed","Warning");this.buyDataService.pushNewValue(this.buyData),this.dialogRef.close()}}onTabChange(e){this.currentTabState=e}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(T.O),t.Y36(_.so),t.Y36(M.q),t.Y36(k),t.Y36(L._W))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-modal-note"]],decls:15,vars:13,consts:[[3,"config","onCancel","onOk"],[1,"container-fluid"],[1,"row","border-bottom"],["data-cy","note",1,"btn","btn-link",3,"ngClass","click"],["data-cy","type",1,"btn","btn-link",3,"ngClass","click"],["data-cy","other",1,"btn","btn-link",3,"ngClass","click"],[1,"row","mt-8"],[4,"ngIf"],[1,"col-12"],["class","rad-btn",4,"ngFor","ngForOf"],[1,"rad-btn"],[3,"for","ngClass"],["type","radio",3,"ngModel","value","id","ngModelChange"],[1,"col-12","tinymce"],[3,"value","valueChange"],[1,"col-7","pe-0"],[1,"row"],[1,"col-sm-3","d-flex","align-items-center"],[1,"ps-0",3,"ngClass"],["bindLabel","Name","bindValue","ID","placeholder","Outlet","appendTo","body",2,"width","80px",3,"ngClass","items","ngModel","clearable","ngModelChange","change"],["class","col-sm-4 d-flex",4,"ngIf"],[1,"col-5","d-flex","align-items-center","ps-0"],[1,"col-sm-2"],[1,"col-sm-10"],["bindLabel","Label","bindValue","Description","placeholder","Term","appendTo","body",1,"w-100",3,"items","ngModel","clearable","ngModelChange"],[1,"col-sm-4","d-flex"],[1,"pt-4"],["type","text","autoNum","",1,"border","border-light",2,"width","100px",3,"ngModel","ngModelChange"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.dialogRef.close()})("onOk",function(a){return n.onOk(a)}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div")(5,"a",3),t.NdJ("click",function(){return n.onTabChange(n.modalTabState.NOTE)}),t._uU(6," Note "),t.qZA(),t.TgZ(7,"a",4),t.NdJ("click",function(){return n.onTabChange(n.modalTabState.TYPE)}),t._uU(8," Tag "),t.qZA(),t.TgZ(9,"a",5),t.NdJ("click",function(){return n.onTabChange(n.modalTabState.OTHER)}),t._uU(10," Other "),t.qZA()()(),t.TgZ(11,"div",6),t.YNc(12,ae,3,1,"ng-container",7),t.YNc(13,re,3,1,"ng-container",7),t.YNc(14,de,13,14,"ng-container",7),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(5),t.Q6J("ngClass",t.VKq(7,H,n.modalTabState.NOTE==n.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(9,H,n.modalTabState.TYPE==n.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(11,H,n.modalTabState.OTHER==n.currentTabState)),t.xp6(3),t.Q6J("ngIf",n.modalTabState.TYPE==n.currentTabState),t.xp6(1),t.Q6J("ngIf",n.modalTabState.NOTE==n.currentTabState),t.xp6(1),t.Q6J("ngIf",n.modalTabState.OTHER==n.currentTabState))},dependencies:[d.mk,d.sg,d.O5,p.Fj,p._,p.JJ,p.On,f.M,U.w9,V.b,z.V],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}content[_ngcontent-%COMP%] > div.container-fluid[_ngcontent-%COMP%]{min-height:200px}.tinymce[_ngcontent-%COMP%] a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{z-index:2;position:absolute;right:15px;bottom:19px}.tinymce[_ngcontent-%COMP%] editor[_ngcontent-%COMP%]{height:max-content;z-index:1}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link[_ngcontent-%COMP%]{color:inherit}.ng-select-width[_ngcontent-%COMP%]{width:180px!important}"]}),o})();var bt=l(29411),pe=l(10805),et=l(90811),ft=l(70585),ge=l(35593);function me(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",12)(1,"div")(2,"h5"),t._uU(3,"Deduct inventory from outlet"),t.qZA()(),t.TgZ(4,"div",3)(5,"ng-select",13),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.deliveryEntityID=i)}),t.qZA()()()}if(2&o){const e=t.oxw();t.xp6(1),t.ekj("col-6",e.shippingFormVisible)("col-auto",!e.shippingFormVisible),t.xp6(4),t.Q6J("ngModel",e.deliveryEntityID)("items",e.entities)("disabled",!e.isDelivery&&e.currentStateTransaction==e.buyState.UPDATE&&(e.currentDeliveryState==e.deliveryState.Sent||e.currentDeliveryState==e.deliveryState.Partial))}}function _e(o,r){1&o&&(t.ynx(0),t.TgZ(1,"h5",14),t._uU(2,"Unfulfilled order, product inventory is allocated "),t.qZA(),t.BQk())}const he=function(){return{standalone:!0}};function be(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",15)(2,"div",16)(3,"div",17)(4,"label",18),t._uU(5),t.qZA(),t.TgZ(6,"div")(7,"datepicker",19),t.NdJ("dateChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.buyData.Invoice.DateCustom=i)}),t.qZA()()(),t.TgZ(8,"div")(9,"label",20),t._uU(10,"Time"),t.qZA(),t.TgZ(11,"div")(12,"p-calendar",21,22),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.buyData.Invoice.TimeCustom=i)}),t.TgZ(14,"p-footer")(15,"button",23),t.NdJ("click",function(){t.CHM(e);const i=t.MAs(13);return t.KtG(i.hideOverlay())}),t.qZA()()()()()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(5),t.Oqu(e.shippingDateLabel),t.xp6(2),t.Q6J("date",e.buyData.Invoice.DateCustom),t.xp6(1),t.Udp("margin-top","-20px"),t.xp6(4),t.Q6J("ngModel",e.buyData.Invoice.TimeCustom)("timeOnly",!0)("ngModelOptions",t.DdM(7,he))}}let fe=(()=>{class o{constructor(e,n,i,a,c,u){this.dialogRef=e,this.firstLoadService=n,this.buyDataService=i,this.datePipe=a,this.buyStateService=c,this.locale=u,this.modalConfig=new w.O,this.isDelivery=!1,this.shippingDateLabel="Fulfillment Date",this.buyData=new D.F,this.deliveryState=bt.c,this.buyState=b,this.entities=n.Data.Entities,this.buyData=i.Data,this.deliveryEntityID=this.buyData.Action.DeliveryEntityID,this.appConfig=n.Data.AppConfigJSON,this.currentStateTransaction=c.state,this.initStartTime()}ngOnInit(){this.initModal(),this.initShipingFormVisible(),this.initDefaultOrderDelivery(),this.checkRecepientIsBuyer()}initModal(){this.modalConfig.title="Order Fullfillment",this.modalConfig.customWidth="590px"}checkRecepientIsBuyer(){this.isRecipientAsBuyer=!!s.gT.IsNotEmpty(this.buyData.Shipping.Name)}initStartTime(){this.datePipe=new d.uU(this.locale);var e=new Date;this.startTime=e.getHours()+":"+e.getMinutes()}initShipingFormVisible(){this.shippingFormVisible=this.firstLoadService.Data.AppConfigJSON.ModuleSell.Shipping.DeliveryAddressAlwaysVisible}initDefaultOrderDelivery(){this.currentDeliveryState=this.buyData.Order.DeliveryStateID,this.isDelivery=!!s.gT.IsEmpty(this.deliveryEntityID)}onChangeTypeDelivery(){this.deliveryEntityID=this.isDelivery?s.gT.GuidEmpty:this.buyData.Order.EntityID}onOk(){s.gT.IsNotEmpty(this.buyData.Invoice.DateCustom)&&this.setCustomDateField(),this.clearShippingData(),this.buyData.Action.DeliveryEntityID=this.deliveryEntityID,this.buyDataService.pushNewValue(this.buyData),this.dialogRef.close()}clearShippingData(){if(!this.isRecipientAsBuyer)for(const e of Object.getOwnPropertyNames(this.buyData.Shipping))this.buyData.Shipping[e]=""}setCustomDateField(){this.buyData.Invoice.DateCustom=this.buyData.Invoice.DateCustom?this.buyData.Invoice.DateCustom:new Date;let e=this.buyData.Invoice.TimeCustom?this.datePipe.transform(this.buyData.Invoice.TimeCustom,"HH:mm"):"00:00";if(this.isDelivery||this.shippingFormVisible){let n=this.datePipe.transform(this.buyData.Invoice.DateCustom,"d MMM y");this.buyData.Invoice.CustomDateField=`${n} ${e}`}}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(_.so),t.Y36(T.O),t.Y36(M.q),t.Y36(d.uU),t.Y36(N),t.Y36(t.soG))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-modal-fulfillment"]],decls:21,vars:9,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container"],[1,"row","align-items-start","py-2","my-2"],[1,"col"],["name","fontStyle","aria-label","Font Style",3,"ngModel","ngModelChange","change"],["data-cy","Now",3,"value","disabled"],[1,"p-5","me-2"],[1,"text-muted","tabDesc"],["data-cy","Later",3,"value","disabled"],[1,"p-5"],["class","row align-items-center mt-5",4,"ngIf"],[4,"ngIf"],[1,"row","align-items-center","mt-5"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Outlet","data-cy","DeductInventory",1,"tall","auto-grow",2,"width","250px",3,"ngModel","items","disabled","ngModelChange"],[1,"bg-gradient-warning","text-center","py-7","rounded-3","border","mb-7"],[1,"row","mt-8"],[1,"col-md-6","d-flex","align-items-center"],[1,"w-75"],["for","shippingDate",1,"text-muted","mb-0"],["appearance","outline","width","85","id","shippingDate",3,"date","dateChange"],["for","shippingTime",1,"text-muted","mb-0"],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModel","timeOnly","ngModelOptions","ngModelChange"],["myCalendar",""],["pButton","","type","button","label","Close",3,"click"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"mat-button-toggle-group",4),t.NdJ("ngModelChange",function(a){return n.isDelivery=a})("change",function(){return n.onChangeTypeDelivery()}),t.TgZ(6,"mat-button-toggle",5)(7,"h3",6),t._uU(8," Now "),t.TgZ(9,"small",7)(10,"em"),t._uU(11,"(in store purchase)"),t.qZA()()()(),t.TgZ(12,"mat-button-toggle",8)(13,"h3",9),t._uU(14," Later "),t.TgZ(15,"small",7)(16,"em"),t._uU(17,"(shipped to customer address)"),t.qZA()()()()()()(),t.YNc(18,me,6,7,"div",10),t.YNc(19,_e,3,0,"ng-container",11),t.YNc(20,be,16,8,"ng-container",11),t.qZA()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(5),t.Q6J("ngModel",n.isDelivery),t.xp6(1),t.Q6J("value",!1)("disabled",n.isDelivery&&n.currentStateTransaction==n.buyState.UPDATE&&(n.currentDeliveryState==n.deliveryState.Sent||n.currentDeliveryState==n.deliveryState.Partial)),t.xp6(6),t.Q6J("value",!0)("disabled",!n.isDelivery&&n.currentStateTransaction==n.buyState.UPDATE&&(n.currentDeliveryState==n.deliveryState.Sent||n.currentDeliveryState==n.deliveryState.Partial)),t.xp6(6),t.Q6J("ngIf",!n.isDelivery),t.xp6(1),t.Q6J("ngIf",n.isDelivery),t.xp6(1),t.Q6J("ngIf",n.isDelivery||n.shippingFormVisible))},dependencies:[d.O5,p.JJ,p.On,f.M,v.QB,U.w9,pe.$_,et.A9,et.Yi,ft.f,ge.Hq],styles:[".container[_ngcontent-%COMP%]{min-height:200px}.mat-button-toggle-checked[_ngcontent-%COMP%]{background-color:#dfeffc;color:#0976b4} p-calendar span.p-calendar.p-calendar-timeonly.custom-height{height:44px;margin-top:3px;width:55px}.form-check-input[_ngcontent-%COMP%]{clear:left}.form-switch.form-switch-lg[_ngcontent-%COMP%]{margin-bottom:.8rem}.form-switch.form-switch-lg[_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%]{height:1.5rem;width:2.75rem;border-radius:3rem}.form-check-input[_ngcontent-%COMP%]:focus{border-color:#89b03e!important}.form-check-input[_ngcontent-%COMP%]:checked{border-color:#89b03e!important;background-color:#89b03e!important}.tabDesc[_ngcontent-%COMP%]{font-size:80%;font-weight:400}"]}),o})();var nt=l(55706),Ct=l(23389),B=(()=>{return(o=B||(B={}))[o.NOW=0]="NOW",o[o.LATER=1]="LATER",B;var o})();let ot=(()=>{class o{constructor(e,n,i,a){this.backendService=e,this.toastrService=n,this.buyDataService=i,this.httpService=a,this._Data=new tt.X(null),this.Data$=this._Data.asObservable()}get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}createNewSupplier(e){this.backendService.createNewContact(e,"supplier").subscribe(n=>{this.setSupplierData(n.ID),this.supplier=e,this.buyDataService.Data.ContactName=e.Name,this.toastrService.success("Succes create new Supplier","Success")})}setSupplierData(e){this.httpService.post(s.Wz.GetSupplierDTO,{id:e}).subscribe(n=>{this.buyDataService.Data.Order.SupplierID=e,this.pushNewValue(n)})}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(j.M),t.LFG(L._W),t.LFG(M.q),t.LFG(Y.O))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})(),yt=(()=>{class o{constructor(e,n,i){this.backendService=e,this.buyDataService=n,this.datePipe=i,this._Data=new tt.X(null),this.Data$=this._Data.asObservable().pipe((0,y.h)(a=>null!==a))}get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}submitOrder(e,n,i=!1){let a=(0,R.yE)(D.F,e);return a.Order.Date=this.datePipe.transform(a.Order.Date,"dd MMM yyyy"),null===a.Action.DeliveryEntityID&&(a.Action.DeliveryEntityID=1==n.ModuleBuy.Shipping.BuyShippingDefault?s.gT.GuidEmpty:a.Order.EntityID),i&&delete a.Payment,a=this.setDeliveryStateID(a),a.Items=this.removeVariantObject(a.Items),this.backendService.submitTransaction(a,s.Wz.CheckOutUrlBuy).pipe((0,ct.b)(c=>{this.buyDataService.Data.Invoice.ID=c.InvoiceID,this.buyDataService.Data.Order.ID=c.OrderID,this.pushNewValue(c)}))}removeVariantObject(e){return e.map(n=>(delete n.Variant,n))}setDeliveryStateID(e){return e.Order.DeliveryStateID=bt.c.Unsent,e}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(j.M),t.LFG(M.q),t.LFG(d.uU))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var it=l(93669);const xt=function(o){return{selected:o}};function Ce(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",6)(1,"div")(2,"a",7),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onNowClick())}),t._uU(3," Now "),t.qZA(),t.TgZ(4,"a",7),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onLaterClick())}),t._uU(5," Later "),t.TgZ(6,"span",8),t._uU(7,"Take Credit"),t.qZA()()()()}if(2&o){const e=t.oxw();t.xp6(2),t.Q6J("ngClass",t.VKq(2,xt,e.isPayNow)),t.xp6(2),t.Q6J("ngClass",t.VKq(4,xt,!e.isPayNow))}}function ye(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"input",20),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Payment.Amount=i)})("ngModelChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onUpdateCashPayment(i))}),t.qZA(),t.BQk()}if(2&o){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",!e.role.Cost)("ngModel",e.buyData.Payment.Amount)}}function xe(o,r){1&o&&t._UZ(0,"input",21)}function Me(o,r){if(1&o&&(t.TgZ(0,"div",22),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.Q6J("ngClass",e.buyData.Payment.Amount>e.invoiceCalculatorService.Data?"success":"danger"),t.xp6(1),t.AsE(" ",e.currencySymbol," ",t.lcZ(2,3,e.buyData.Payment.Amount-e.invoiceCalculatorService.Data)," ")}}function ve(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",26)(1,"a",27),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.onSelectPayment(a))}),t.TgZ(2,"span",28),t._UZ(3,"img",29),t.qZA(),t.TgZ(4,"span",30),t._uU(5),t.ALo(6,"limitTo"),t.qZA()()()}if(2&o){const e=r.$implicit,n=t.oxw(3);t.xp6(1),t.Q6J("ngClass",n.buyData.Payment.MethodID===e.ID?"active":""),t.xp6(1),t.Q6J("hidden",null==e.ImageUrl),t.xp6(1),t.Q6J("src",e.ImageUrl,t.LSH),t.xp6(1),t.s9C("matTooltip",e.Name),t.Q6J("hidden",null!=e.ImageUrl),t.xp6(1),t.hij(" ",t.xi3(6,6,e.Name,20)," ")}}function Oe(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",31)(1,"div",32)(2,"input",33),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.buyData.Payment.Note=i)}),t.qZA(),t.TgZ(3,"input",34),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.buyData.Payment.Code=i)}),t.qZA()()()}if(2&o){const e=t.oxw(3);t.xp6(2),t.Q6J("ngModel",e.buyData.Payment.Note),t.xp6(1),t.Q6J("ngModel",e.buyData.Payment.Code)}}function De(o,r){if(1&o&&(t.TgZ(0,"div",9)(1,"div",10),t._UZ(2,"i",23),t._uU(3," Card "),t.qZA(),t.TgZ(4,"div",12)(5,"div",13),t.YNc(6,ve,7,9,"div",24),t.qZA(),t.YNc(7,Oe,4,2,"div",25),t.qZA()()),2&o){const e=t.oxw(2);t.xp6(6),t.Q6J("ngForOf",e.paymentListCard),t.xp6(1),t.Q6J("ngIf",e.getPaymentCardById(e.buyData.Payment.MethodID))}}function Te(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",26)(1,"a",37),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.onSelectPayment(a))}),t._uU(2),t.ALo(3,"limitTo"),t.qZA()()}if(2&o){const e=r.$implicit,n=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.Name),t.Q6J("ngClass",n.buyData.Payment.MethodID===e.ID?"active":""),t.xp6(1),t.hij(" ",t.xi3(3,3,e.Name,20)," ")}}function Ie(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",31)(1,"div",32)(2,"input",33),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.buyData.Payment.Note=i)}),t.qZA(),t.TgZ(3,"input",34),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw(3);return t.KtG(a.buyData.Payment.Code=i)}),t.qZA()()()}if(2&o){const e=t.oxw(3);t.xp6(2),t.Q6J("ngModel",e.buyData.Payment.Note),t.xp6(1),t.Q6J("ngModel",e.buyData.Payment.Code)}}function Pe(o,r){if(1&o&&(t.TgZ(0,"div",35)(1,"div",10),t._uU(2," Others "),t.qZA(),t.TgZ(3,"div",12)(4,"div",13),t.YNc(5,Te,4,6,"div",36),t.qZA(),t.YNc(6,Ie,4,2,"div",25),t.qZA()()),2&o){const e=t.oxw(2);t.xp6(5),t.Q6J("ngForOf",e.paymentListOther),t.xp6(1),t.Q6J("ngIf",e.getPaymentOtherById(e.buyData.Payment.MethodID))}}function Se(o,r){if(1&o&&(t.TgZ(0,"div")(1,"div",9)(2,"div",10),t._UZ(3,"i",11),t._uU(4," Cash "),t.qZA(),t.TgZ(5,"div",12)(6,"div",13)(7,"div",14),t.YNc(8,ye,2,2,"ng-container",15),t.YNc(9,xe,1,0,"ng-template",null,16,t.W1O),t.YNc(11,Me,3,5,"div",17),t.qZA()()()(),t.YNc(12,De,8,2,"div",18),t.YNc(13,Pe,7,2,"div",19),t.qZA()),2&o){const e=t.MAs(10),n=t.oxw();t.xp6(8),t.Q6J("ngIf",n.role.Cost)("ngIfElse",e),t.xp6(3),t.Q6J("ngIf",(null==n.buyData.Payment?null:n.buyData.Payment.Amount)!=n.invoiceCalculatorService.Data&&n.role.Cost),t.xp6(1),t.Q6J("ngIf",n.paymentListCard.length>0),t.xp6(1),t.Q6J("ngIf",n.paymentListOther.length>0)}}function we(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div",38)(1,"div",39)(2,"strong",40),t._uU(3,"Due"),t.qZA(),t.TgZ(4,"datepicker",41),t.NdJ("dateChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.payLaterDueDate=i)})("dateChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.dueDateChange())}),t.qZA()(),t.TgZ(5,"div",42)(6,"strong",40),t._uU(7,"Days Due"),t.qZA(),t.TgZ(8,"div",12)(9,"input",43),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.payLaterDueDays=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.dueDayChange())}),t.qZA()()()()}if(2&o){const e=t.oxw();t.xp6(4),t.Q6J("displayToggle",!1)("date",e.payLaterDueDate),t.xp6(5),t.Q6J("ngModel",e.payLaterDueDays)}}let Ne=(()=>{class o{constructor(e,n,i,a,c,u,h,E,Q){this.data=e,this.dialogRef=n,this.firstLoadService=i,this.buyDataService=a,this.invoiceCalculatorService=c,this.supplierService=u,this.datePipe=h,this.submitOrderService=E,this.buyStateService=Q,this.paymentLaterSwitchEnabled=!0,this.isPayNow=!0,this.cashPaymentValue=null,this.role=i.role,this.buyData=a.Data,this.destroy$=new O.x}ngOnInit(){this.initModalConfig(),this.initDefaultTabPayment(),this.initData()}initModalConfig(){this.currencySymbol=this.invoiceCalculatorService.currencySymbol,this.modalConfig=new w.O,this.modalConfig.title="Amount to Pay:",this.modalConfig.disableKeyup=!0,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0}initDefaultTabPayment(){this.firstLoadService.Data.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultOption==B.LATER&&(this.isPayNow=!1)}initData(){this.payments=this.firstLoadService.Data.Payments,this.paymentSuggestion=this.invoiceCalculatorService.generateCashSuggestion(),this.paymentListCash=this.getPaymentListById(nt.Q.cash),this.paymentListCard=this.getPaymentListById(nt.Q.card),this.paymentListOther=this.getPaymentListById(nt.Q.other),this.initPaylaterDue(),this.initPayment()}initPayment(){const e=this.buyStateService.state;this.defaultCashPaymentMethodID=this.payments[0].ID,e!=b.UPDATE?(this.buyData.Payment=new Ct.j,this.buyData.Payment.MethodID=this.defaultCashPaymentMethodID,this.buyData.Payment.PaidAmount=this.invoiceCalculatorService.Data,this.buyData.Payment.Amount=this.invoiceCalculatorService.Data,this.setPaymentDate()):s.gT.IsEmpty(this.buyData.Payment)?(this.buyData.Payment=new Ct.j,this.setPaymentDate(),this.isPayNow=!1):(this.buyData.Payment.PaidAmount=this.invoiceCalculatorService.Data,this.buyData.Payment.Amount=this.invoiceCalculatorService.Data)}setPaymentDate(){this.buyData.Payment.Date=this.datePipe.transform(this.buyData.Order.Date,"dd MMM yyyy")}initPaylaterDue(){this.supplierService.Data$.subscribe(e=>{if(this.buyStateService.state==b.UPDATE){const i=new Date(this.buyData.Invoice.Date),a=new Date(this.buyData.Invoice.Due),c=Math.abs(a-i),u=Math.ceil(c/864e5);this.payLaterDueDays=u}else this.payLaterDueDays=e?0==e.DaysDue?this.firstLoadService.Data.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultDueDays:e.DaysDue:this.firstLoadService.Data.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultDueDays;const n=new Date;n.setDate(n.getDate()+this.payLaterDueDays),n.setHours(0,0,0,0),this.payLaterDueDate=n})}onUpdateCashPayment(e){this.buyData.Payment.Amount=e,this.buyData.Payment.PaidAmount=e,this.buyData.Payment.MethodID=this.payments[0].ID}onSelectPayment(e){this.buyData.Payment.Amount=this.invoiceCalculatorService.Data,this.buyData.Payment.PaidAmount=this.invoiceCalculatorService.Data,this.buyData.Payment.MethodID=e.ID}onNowClick(){this.isPayNow=!0,this.buyData.Invoice.Due=null,this.initPayment(),this.buyData.Payment.MethodID=this.defaultCashPaymentMethodID}onLaterClick(){this.isPayNow=!1,this.buyData.Invoice.Due=this.datePipe.transform(this.payLaterDueDate,"dd MMM yyyy"),delete this.buyData.Payment}dueDayChange(){const e=new Date(this.buyData.Order.Date);e.setDate(e.getDate()+this.payLaterDueDays),e.setHours(0,0,0,0),this.payLaterDueDate=e,this.buyData.Invoice.Due=e.toJSON()}dueDateChange(){const e=new Date(this.buyData.Order.Date);let n=this.payLaterDueDate?this.payLaterDueDate:new Date;e.setHours(0,0,0,0),this.payLaterDueDays=s.gT.calculateNumberBetweenDate(e,n),this.buyData.Invoice.Due=n.toJSON()}onOk(){let e=this.firstLoadService.Data.AppConfigJSON,n=!1;this.isPayNow||(n=!0,this.buyData.Invoice.Due=this.datePipe.transform(this.payLaterDueDate,"dd MMM yyyy")),this.submitOrderService.submitOrder(this.buyData,e,n).pipe((0,m.R)(this.destroy$)).subscribe(i=>{this.dialogRef.close(i)})}getPaymentCardById(e){return this.paymentListCard.find(n=>n.ID==e)}getPaymentOtherById(e){return this.paymentListOther.find(n=>n.ID==e)}getPaymentListById(e){return this.firstLoadService.Data.Payments.filter(i=>i.TypeID==e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(_.WI),t.Y36(_.so),t.Y36(T.O),t.Y36(M.q),t.Y36(k),t.Y36(ot),t.Y36(d.uU),t.Y36(yt),t.Y36(N))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-modal-payment"]],decls:10,vars:7,consts:[[3,"config","onOk","onCancel","onClose"],[1,"mt-1","ms-2"],[1,"container","w-100","h-100"],["class","row border-bottom",4,"ngIf"],[4,"ngIf"],["class"," py-4",4,"ngIf"],[1,"row","border-bottom"],[1,"btn","btn-link",3,"ngClass","click"],[1,"fst-italic",2,"font-size","10px"],[1,"row","border-bottom","py-5"],[1,"col-3","h5","pt-5"],[1,"fa-solid","fa-money-bill-wave"],[1,"col-9"],[1,"row"],[1,"col","pe-0","me-10"],[4,"ngIf","ngIfElse"],["NotShowCost",""],["class","change",3,"ngClass",4,"ngIf"],["class","row border-bottom py-5",4,"ngIf"],["class","row py-5",4,"ngIf"],["id","cashInput","type","text","keyboardType","number","placeholder","Custom Cash Amount","autoNum","",1,"form-control","form-control-lg","py-3","mb-3","px-6",3,"disabled","ngModel","ngModelChange"],["readonly","","type","text","placeholder","Custom Cash Amount","value","Rp -",1,"form-control","form-control-lg","py-10","mb-3","px-6"],[1,"change",3,"ngClass"],[1,"fa-regular","fa-credit-card"],["class","col-auto pe-0",4,"ngFor","ngForOf"],["class","position-relative row",4,"ngIf"],[1,"col-auto","pe-0"],[1,"btn","btn-outline-info","mb-3","px-6",3,"ngClass","click"],[3,"hidden"],[2,"width","40px",3,"src"],["matTooltipPosition","above",3,"hidden","matTooltip"],[1,"position-relative","row"],[1,"paymentNote","col","row","g-0","pt-2","ms-6"],["type","text","placeholder","Payment Note",1,"form-control","w-50","border-end-0","py-6","col-6",3,"ngModel","ngModelChange"],["type","text","placeholder","Payment Code",1,"form-control","w-50","border-start-0","py-6","paymentCode","col-6",3,"ngModel","ngModelChange"],[1,"row","py-5"],["class","col-auto pe-0 ",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"btn","btn-outline-info","mb-3","px-6",3,"ngClass","matTooltip","click"],[1,"py-4"],[1,"row","d-flex","align-items-center","g-0","later-payment"],[1,"col-3"],["appearance","legacy","readOnly","true","name","orderDate",1,"col-9",3,"displayToggle","date","dateChange"],[1,"row","d-flex","align-items-center","g-0","later-payment","mt-10"],["type","text","autofocus","","autoNum","",1,"py-8","ps-5","form-control",3,"ngModel","ngModelChange"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),t.TgZ(1,"header")(2,"div",1),t._uU(3),t.ALo(4,"number"),t.qZA()(),t.TgZ(5,"content")(6,"div",2),t.YNc(7,Ce,8,6,"div",3),t.qZA(),t.YNc(8,Se,14,5,"div",4),t.YNc(9,we,10,3,"div",5),t.qZA()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(3),t.hij(" ",n.role.PriceVisibleRestriction?"-":n.currencySymbol+" "+t.lcZ(4,5,n.invoiceCalculatorService.Data)," "),t.xp6(4),t.Q6J("ngIf",n.paymentLaterSwitchEnabled),t.xp6(1),t.Q6J("ngIf",n.isPayNow),t.xp6(1),t.Q6J("ngIf",!n.isPayNow))},dependencies:[d.mk,d.sg,d.O5,p.Fj,p.JJ,p.On,f.M,v.QB,V.b,A.gM,d.JJ,it.OI],styles:['.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.change[_ngcontent-%COMP%]{position:absolute;top:62px;height:40px;background:#89b03e;color:#fff;right:25px;padding:0 10px;line-height:40px;font-size:16px}.change[_ngcontent-%COMP%]:before{content:"\\a";border-style:solid;border-width:40px 24px 0 0;border-color:transparent #89b03e transparent transparent;position:absolute;left:-24px}.change.danger[_ngcontent-%COMP%]{background:#c9302c}.change.danger[_ngcontent-%COMP%]:before{border-color:transparent #c9302c transparent transparent}.paymentNote[_ngcontent-%COMP%]:before{z-index:10;content:"";position:absolute;top:4px;left:calc(50% - 10px);height:90%;width:10px;background-color:inherit;border-right:1px solid lightgray;transform:skew(-10deg)}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519} .later-payment.date-picker .mat-form-field{font-size:4px}.ng-select.ng-select-width[_ngcontent-%COMP%] .ng-select-container{width:160px;max-width:160px}input[type=text][_ngcontent-%COMP%]:disabled{background:#dadada}.later-payment[_ngcontent-%COMP%] strong{font-size:20px}.later-payment[_ngcontent-%COMP%] input{font-size:20px}.later-payment[_ngcontent-%COMP%] .mat-form-field{width:100%;font-size:20px;border:1px solid #c8d3df;padding-left:10px}.later-payment[_ngcontent-%COMP%] .mat-form-field .mat-icon-button, .later-payment[_ngcontent-%COMP%] .mat-form-field .mat-button-wrapper, .later-payment[_ngcontent-%COMP%] .mat-form-field .mat-form-field-suffix{outline:none!important}']}),o})(),Ze=(()=>{class o{constructor(e,n,i,a,c,u){this.data=e,this.dialogRef=n,this.buyDataService=i,this.buyStateService=a,this.firstLoadService=c,this.calculatorService=u}ngOnInit(){this.modalConfig=new w.O,this.modalConfig.title="Return",this.modalConfig.customWidth="284px",this.currentOrderNumber=this.buyDataService.Data.Order.Number}onOk(){this.buyDataService.returTransaction(this.returNumber,this.data.entityID).subscribe(e=>{e.Order.Date=new Date,this.buyStateService.state=b.RETUR,e.Order.Note=`Return #${this.returNumber}`;let n=(0,R.yE)(D.F,e);n.Order.ID=s.gT.GuidEmpty,n.generateCartItems(this.buyDataService),n.ContactName=n.ContactName,this.setTaxCalculator(n),n.Order.Number=this.currentOrderNumber,this.buyDataService.pushNewValue(n),this.dialogRef.close()})}setTaxCalculator(e){const i=this.firstLoadService.Data.Taxes.find(a=>a.ID==e.Order.TaxTypeID);this.calculatorService.currentTax=i}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(_.WI),t.Y36(_.so),t.Y36(M.q),t.Y36(N),t.Y36(T.O),t.Y36(k))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-modal-retur"]],decls:6,vars:2,consts:[[3,"config","onOk","onCancel","onClose"],[1,"form-floating-outline"],["type","text","data-cy","ReturnNumber","id","ReturNumber","name","ReturNumber",1,"form-control",3,"ngModel","ngModelChange"],["for","ReturNumber"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onOk()})("onCancel",function(){return n.dialogRef.close()})("onClose",function(){return n.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"input",2),t.NdJ("ngModelChange",function(a){return n.returNumber=a}),t.qZA(),t.TgZ(4,"label",3),t._uU(5,"Input Supplier Bill #"),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(3),t.Q6J("ngModel",n.returNumber))},dependencies:[p.Fj,p.JJ,p.On,f.M]}),o})();var Ae=l(69753),ke=l(26128),Je=l(241),Mt=l(42011);function Fe(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"div"),t._UZ(1,"i",12),t.TgZ(2,"input",13),t.NdJ("ngModelChange",function(i){t.CHM(e);const a=t.oxw();return t.KtG(a.onPurchaseNumberChange(i))}),t.qZA()()}if(2&o){const e=t.oxw();t.Gre("col-auto me-5 ",e.purchaseOrderNumberEnabled?"small":"",""),t.xp6(2),t.Q6J("disabled",!e.roles.NumberEditor)("ngModel",e.purchaseNumber)}}function Ue(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"a",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onOpenModalSupplier())}),t._UZ(2,"i",15),t.qZA(),t.BQk()}}const Ee=function(o){return{"bg-gradient-warnings":o}};let Qe=(()=>{class o{constructor(e,n){this._firtstLoadService=e,this._supplierService=n,this.openOutletModal=new t.vpe,this.dateChange=new t.vpe,this.attentionChange=new t.vpe,this.billNumberChange=new t.vpe,this.purchaseNumberChange=new t.vpe,this.scanSupplier=new t.vpe,this.selectSupplier=new t.vpe,this.openModalSupplier=new t.vpe,this.onClearAutoComplete=new t.vpe,this.date=new Date,this.isNotToday=!1,this.appConfig=this._firtstLoadService.Data.AppConfigJSON,this.purchaseOrderNumberEnabled=this.appConfig.ModuleBuy.Numbering.PurchaseOrderNumberEnabled,this.destroy$=new O.x,this.subscribeToObservable()}ngOnChanges(e){e.date&&this.date&&(this.date=new Date(this.date))}subscribeToObservable(){this._firtstLoadService.role$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.roles=e})}onOpenOutletModal(){this.openOutletModal.emit()}onBillNumberChange(e){this.billNumberChange.emit(e)}onAttentionChange(e){this.attentionChange.emit(e)}onSelectDate(e){this.checkIsNotToday(e),this.dateChange.emit(e)}onSelectSupplier(e){this.selectSupplier.emit(e)}onScanSupplier(e){this.scanSupplier.emit(e)}onOpenModalSupplier(){this.openModalSupplier.emit()}onPurchaseNumberChange(e){this.purchaseNumberChange.emit(e)}checkIsNotToday(e){if(e){const n=new Date;n.setHours(0,0,0,0),this.isNotToday=n.getTime()!=e.getTime()}}onInputSupplier(e){this._supplierService.inputTextName=e,null!==e&&0==e.length&&this.onClearAutoComplete.emit()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(T.O),t.Y36(ot))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-toolbar"]],inputs:{outletName:"outletName",billNumber:"billNumber",purchaseNumber:"purchaseNumber",attention:"attention",date:"date",supplierName:"supplierName"},outputs:{openOutletModal:"onOpenOutletModal",dateChange:"dateChange",attentionChange:"attentionChange",billNumberChange:"billNumberChange",purchaseNumberChange:"purchaseNumberChange",scanSupplier:"onScanSupplier",selectSupplier:"onSelectSupplier",openModalSupplier:"onOpenModalSupplier",onClearAutoComplete:"onClearAutoComplete"},features:[t.TTD],decls:18,vars:30,consts:[[1,"row","border-bottom","g-0","py-4"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["readonly","",1,"outlet","cursor",3,"value","click"],["appearance","legacy","name","orderDate",3,"ngClass","disabled","date","dateChange"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Puchase order number",1,"fa","fa-hashtag"],["type","text","required","","placeholder","Supplier Bill Number",1,"number",3,"disabled","ngModel","ngModelChange"],[3,"class",4,"ngIf"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Supplier",1,"fa","fa-user"],["placeholder","Supplier","inputID","ContactID","requestUrl","/API/AC/GetSupplierSuggestion","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",3,"inputTextValue","onSelect","onInputEnter","onInputChange"],[4,"ngIf"],["aria-hidden","true","matTooltipPosition","above","matTooltip","ATT",1,"fa","fa-id-badge"],["type","text","placeholder","Attention",2,"width","140px",3,"ngModel","ngModelChange"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Order number",1,"fa-regular","fa-file-lines"],["type","text","required","","placeholder","Purchase Order Number",1,"number",3,"disabled","ngModel","ngModelChange"],["id","btnSupplier","matTooltipPosition","above","matTooltip","New Supplier Form",1,"pointer","ms-1",3,"click"],["aria-hidden","true",1,"fa-solid","fa-circle-plus"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div"),t._UZ(2,"i",1),t.TgZ(3,"input",2),t.NdJ("click",function(){return n.onOpenOutletModal()}),t.ALo(4,"limitTo"),t.qZA()(),t.TgZ(5,"div")(6,"datepicker",3),t.NdJ("dateChange",function(a){return n.onSelectDate(a)}),t.qZA()(),t.TgZ(7,"div"),t._UZ(8,"i",4),t.TgZ(9,"input",5),t.NdJ("ngModelChange",function(a){return n.onBillNumberChange(a)}),t.qZA()(),t.YNc(10,Fe,3,5,"div",6),t.TgZ(11,"div"),t._UZ(12,"i",7),t.TgZ(13,"autocompleteV2",8),t.NdJ("onSelect",function(a){return n.onSelectSupplier(a)})("onInputEnter",function(a){return n.onScanSupplier(a)})("onInputChange",function(a){return n.onInputSupplier(a)}),t.qZA(),t.YNc(14,Ue,3,0,"ng-container",9),t.qZA(),t.TgZ(15,"div"),t._UZ(16,"i",10),t.TgZ(17,"input",11),t.NdJ("ngModelChange",function(a){return n.onAttentionChange(a)}),t.qZA()()()),2&e&&(t.xp6(1),t.Gre("col-auto me-5 ",n.purchaseOrderNumberEnabled?"small":"",""),t.xp6(2),t.Q6J("value",t.xi3(4,25,n.outletName?n.outletName:"Choose outlet",20)),t.xp6(2),t.Gre("col-auto me-5 date ms-12 ",n.purchaseOrderNumberEnabled?"small":"",""),t.xp6(1),t.Q6J("ngClass",t.VKq(28,Ee,n.isNotToday))("disabled",!(null!=n.roles&&n.roles.BuyDateEditor))("date",n.date),t.xp6(1),t.Gre("col-auto me-5 ",n.purchaseOrderNumberEnabled?"small":"",""),t.xp6(2),t.Q6J("disabled",!n.roles.NumberEditor)("ngModel",n.billNumber),t.xp6(1),t.Q6J("ngIf",n.purchaseOrderNumberEnabled),t.xp6(1),t.Gre("col-auto me-5 supplier ",n.purchaseOrderNumberEnabled?"small":"",""),t.xp6(2),t.Q6J("inputTextValue",n.supplierName?n.supplierName:""),t.xp6(1),t.Q6J("ngIf",n.roles.ContactsCreate),t.xp6(1),t.Gre("col-auto ",n.purchaseOrderNumberEnabled?"small":"",""),t.xp6(2),t.Q6J("ngModel",n.attention))},dependencies:[d.mk,d.O5,p.Fj,p.JJ,p.Q7,p.On,v.QB,W.J,A.gM,it.OI],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:-moz-fit-content;height:fit-content}.col-auto.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important;background:white}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-form-field-wrapper{padding-bottom:0}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-flex{width:117px;height:36px;border:1px solid rgb(221,221,221)}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-infix{border:none!important;top:5px}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-infix input{font-size:14px;color:#000;padding-left:5px}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-suffix{left:-128px;top:2px}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-suffix .mat-button-wrapper{color:#000}.col-auto.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-underline{display:none}.col-auto.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px,#f9e79f 30px)}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#ffffff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:150px}.col-auto.supplier[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}"]}),o})();function qe(o,r){if(1&o&&(t.ynx(0),t.TgZ(1,"tr")(2,"th",30),t._uU(3,"Amount"),t.qZA(),t._UZ(4,"td",31),t.ALo(5,"number"),t.qZA(),t.BQk()),2&o){const e=t.oxw();t.xp6(4),t.Q6J("innerHtml",t.lcZ(5,1,e.grossTotal),t.oJD)}}function Re(o,r){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",null==e.buyData?null:e.buyData.Order.Discount,"%) ")}}function Le(o,r){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij(" (",t.xi3(2,1,null==e.buyData?null:e.buyData.Order.Discount,"1.0-3"),"%)")}}function Ye(o,r){if(1&o&&(t.TgZ(0,"tr",32)(1,"th",33),t._uU(2),t.YNc(3,Re,2,1,"span",11),t.YNc(4,Le,3,4,"span",11),t.qZA(),t._UZ(5,"td",34),t.ALo(6,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(2),t.hij(" ",null!=e.appConfig&&null!=e.appConfig.CorePrint&&null!=e.appConfig.CorePrint.Alias&&e.appConfig.CorePrint.Alias.Discount1?null==e.appConfig||null==e.appConfig.CorePrint||null==e.appConfig.CorePrint.Alias?null:e.appConfig.CorePrint.Alias.Discount1:"Discount"," "),t.xp6(2),t.Q6J("ngIf",!(null!=e.appConfig&&null!=e.appConfig.PrintConfigInvoice&&e.appConfig.PrintConfigInvoice.Footer.DiscountIgnoredDecimal)),t.xp6(1),t.Q6J("innerHtml",t.lcZ(6,3,-1*e.calculatorService.discount1Amount),t.oJD)}}function Ve(o,r){if(1&o&&(t.TgZ(0,"tr"),t._UZ(1,"th",35)(2,"td",34),t.ALo(3,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("innerHtml","Discount "+(null==e.calculatorService?null:e.calculatorService.currencySymbol),t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,2,-1*(null==e.buyData?null:e.buyData.Order.DiscountAmount)),t.oJD)}}function He(o,r){if(1&o&&(t.TgZ(0,"tr"),t._UZ(1,"th",35)(2,"td",36),t.ALo(3,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("innerHtml",null==e.calculatorService||null==e.calculatorService.currentTax?null:e.calculatorService.currentTax.Label,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,2,e.taxAmount),t.oJD)}}function Be(o,r){if(1&o&&(t.TgZ(0,"div",37)(1,"strong",38),t._uU(2,"Fulfillment From: "),t.qZA(),t.TgZ(3,"span",39),t._uU(4),t.qZA()()),2&o){const e=t.oxw();t.xp6(4),t.Oqu(e.getOutletName())}}function Ge(o,r){if(1&o&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.hij(" ",t.lcZ(2,1,e.grandTotal)," ")}}function Ke(o,r){1&o&&t._uU(0," - ")}const $e=function(o){return{"bg-gradient-warning":o}};let je=(()=>{class o{constructor(e,n,i,a){this.firstLoadService=e,this.calculatorService=n,this.buyDataService=i,this.buyStateService=a,this.taxIdChange=new t.vpe,this.openDiscountModal=new t.vpe,this.openModalFulfillment=new t.vpe,this.openModalNote=new t.vpe,this.openModalVoid=new t.vpe,this.openModalPayment=new t.vpe,this.destroy$=new O.x,this.buyStorage=this.firstLoadService.Data,this.taxes=this.buyStorage.Taxes,this.appConfig=this.buyStorage.AppConfigJSON}ngOnInit(){this.subscribeToObservable()}subscribeToObservable(){this.buyDataService.Data$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.buyData=e,this.initTaxId(),this.initWarningFulfillment()}),this.calculatorService.Data$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.grandTotal=e,this.grossTotal=this.calculatorService.grossTotal,this.taxAmount=this.calculatorService.taxAmount}),this.firstLoadService.role$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.userRole=e})}initWarningFulfillment(){let e=this.buyData.Action.DeliveryEntityID;this.warningFulfillment=!1,this.warningFulfillment=!!s.gT.IsEmpty(e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}initTaxId(){let e;e=s.gT.IsEmpty(this.buyData.Order.TaxTypeID)?this.taxes[0]:this.taxes.find(n=>n.ID==this.buyData.Order.TaxTypeID),this.taxId=e.ID,this.calculatorService.currentTax=e}onSelectTax(e){this.calculatorService.currentTax=e,this.taxIdChange.emit(e.ID)}onOpenDiscountModal(){this.openDiscountModal.emit()}onOpenModalFulfillment(){this.openModalFulfillment.emit()}onOpenModalNote(){this.openModalNote.emit()}onOpenModalVoid(){this.openModalVoid.emit()}onOpenModalPayment(){this.openModalPayment.emit()}isFulfillmentVisible(){let e=this.buyData.Order.EntityID,n=this.buyData.Action.DeliveryEntityID;return!s.gT.IsEmpty(n)&&e!=n}getOutletName(){let i,e=this.buyData.Action.DeliveryEntityID,n=this.firstLoadService.Data.Entities;if(!s.gT.IsEmpty(e)){let a=n.find(c=>c.ID==e);i=a?a.Name:null}return i}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(T.O),t.Y36(k),t.Y36(M.q),t.Y36(N))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-cart-action"]],inputs:{taxId:"taxId",outletName:"outletName"},outputs:{taxIdChange:"taxIdChange",openDiscountModal:"onOpenDiscountModal",openModalFulfillment:"onOpenFulfillmentModal",openModalNote:"onOpenNoteModal",openModalVoid:"onOpenVoidModal",openModalPayment:"onOpenPaymentModal"},decls:47,vars:13,consts:[[1,"row","g-0","cart-footer","justify-content-between"],[1,"col-auto","align-self-center","mobile-view"],[1,"row","g-0"],[1,"col-auto","mx-5","d-flex","flex-row"],["aria-hidden","true",1,"fa","fa-tags","d-flex","align-items-center","me-2"],["bindLabel","Label","bindValue","ID","placeholder","Tax",2,"width","125px",3,"items","ngModel","clearable","change"],[1,"col-auto"],[1,"btn","btn-gray","fw-normal","disc",3,"click"],["aria-hidden","true",1,"fa","fa-tags","pe-2"],[1,"col-auto","summary","mobile-view"],[1,"table"],[4,"ngIf"],["context-menu","ctrl.MenuDiscount",4,"ngIf"],[1,"row","g-0","action-buttons","d-flex","justify-content-between"],[1,"col-auto","mobile-view"],[1,"position-relative"],["class","position-absolute text-center cashier-note-arrow arrow-box-right px-2 py-4",4,"ngIf"],["data-cy","Fulfillment",1,"btn","btn-gray","mobile-view",3,"ngClass","click"],[1,"fa","fa-truck","pe-2"],[1,"col-auto","mobile-view","ms-3"],[1,"btn","btn-gray","w-100",3,"click"],[1,"fa-regular","fa-note-sticky","pe-2"],[1,"btn","btn-gray","mobile-view",3,"click"],[1,"fa-regular","fa-rectangle-xmark","pe-2"],["data-cy","PaySales",1,"ms-auto","btn","btn-success","pay","mobile-view",3,"click"],[1,"d-flex"],[1,"ms-auto"],[4,"ngIf","ngIfElse"],["NotShowGrandTotal",""],[1,"position-absolute","fst-italic","right-bottom"],[1,"table-light","border-top-0"],[1,"text-end","border-top-0",2,"width","100px",3,"innerHtml"],["context-menu","ctrl.MenuDiscount"],[1,"table-light"],[1,"text-danger","text-end","text-danger",3,"innerHtml"],[1,"table-light",3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"position-absolute","text-center","cashier-note-arrow","arrow-box-right","px-2","py-4"],[1,"fst-italic"],[1,"text-uppercase","d-block","mt-2"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t._UZ(4,"i",4),t.TgZ(5,"ng-select",5),t.NdJ("change",function(a){return n.onSelectTax(a)}),t.qZA()(),t.TgZ(6,"div",6)(7,"a",7),t.NdJ("click",function(){return n.onOpenDiscountModal()}),t._UZ(8,"i",8),t.TgZ(9,"span"),t._uU(10,"Discount"),t.qZA()()()()(),t.TgZ(11,"div",9)(12,"table",10)(13,"tbody"),t.YNc(14,qe,6,3,"ng-container",11),t.YNc(15,Ye,7,5,"tr",12),t.YNc(16,Ve,4,4,"tr",11),t.YNc(17,He,4,4,"tr",11),t.qZA()()()(),t.TgZ(18,"div",13)(19,"div",14)(20,"div",15),t.YNc(21,Be,5,1,"div",16),t.TgZ(22,"a",17),t.NdJ("click",function(){return n.onOpenModalFulfillment()}),t._UZ(23,"i",18),t.TgZ(24,"span"),t._uU(25,"Fulfillment"),t.qZA()()()(),t.TgZ(26,"div",19)(27,"a",20),t.NdJ("click",function(){return n.onOpenModalNote()}),t._UZ(28,"i",21),t.TgZ(29,"span"),t._uU(30,"Note"),t.qZA()()(),t.TgZ(31,"div",19)(32,"a",22),t.NdJ("click",function(){return n.onOpenModalVoid()}),t._UZ(33,"i",23),t.TgZ(34,"span"),t._uU(35,"Void"),t.qZA()()(),t.TgZ(36,"div",19)(37,"a",24),t.NdJ("click",function(){return n.onOpenModalPayment()}),t.TgZ(38,"div",25)(39,"strong"),t._uU(40,"Pay:"),t.qZA(),t.TgZ(41,"span",26),t.YNc(42,Ge,3,3,"ng-container",27),t.YNc(43,Ke,1,0,"ng-template",null,28,t.W1O),t.qZA()(),t.TgZ(45,"small",29),t._uU(46,"(F8)"),t.qZA()()()()),2&e){const i=t.MAs(44);t.xp6(5),t.Q6J("items",n.taxes)("ngModel",n.taxId)("clearable",!1),t.xp6(9),t.Q6J("ngIf",n.userRole.Cost),t.xp6(1),t.Q6J("ngIf",0!=(null==n.buyData?null:n.buyData.Order.Discount)&&n.userRole.Cost),t.xp6(1),t.Q6J("ngIf",0!=(null==n.buyData?null:n.buyData.Order.DiscountAmount)&&n.userRole.Cost),t.xp6(1),t.Q6J("ngIf",(null==n.calculatorService||null==n.calculatorService.currentTax?null:n.calculatorService.currentTax.Rate)&&n.userRole.Cost),t.xp6(4),t.Q6J("ngIf",n.isFulfillmentVisible()),t.xp6(1),t.Q6J("ngClass",t.VKq(11,$e,n.warningFulfillment)),t.xp6(20),t.Q6J("ngIf",n.userRole.Cost)("ngIfElse",i)}},dependencies:[d.mk,d.O5,p.JJ,p.On,U.w9,d.JJ],styles:['div.row.cart-footer[_ngcontent-%COMP%]{border-top:solid 1px #cfcfcf;min-height:85px}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;border-left:solid 1px #cfcfcf;border-bottom:solid 1px #cfcfcf;line-height:16px!important}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px 8px}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px 5px}div.row.cart-footer[_ngcontent-%COMP%] .disc[_ngcontent-%COMP%]{padding-top:7px;padding-bottom:6px}div.row.action-buttons[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{font-size:1.125rem;padding:15px 16px}div.row.action-buttons[_ngcontent-%COMP%] .btn-success[_ngcontent-%COMP%]{width:195px}div.row.action-buttons[_ngcontent-%COMP%] .right-bottom[_ngcontent-%COMP%]{font-size:.625rem;right:4px}.cashier-note-arrow[_ngcontent-%COMP%]{min-width:130px;max-width:180px;min-height:55px;background-color:#ffffe1!important;right:110%;top:0%;z-index:1;border:1px solid #bbbbbb!important}.cashier-note-arrow[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-family:Roboto Slab,serif}.cashier-note-arrow[_ngcontent-%COMP%]:after{border-left-color:#ffffe1!important}@media (max-width: 575.98px){.mobile-view[_ngcontent-%COMP%]{width:100%!important;margin-top:5px}}@media (max-width: 1200px){.pay[_ngcontent-%COMP%]{width:100px!important;font-size:200px}}.cart-footer[_ngcontent-%COMP%], .action-buttons[_ngcontent-%COMP%]{width:100%}.arrow-box-right[_ngcontent-%COMP%]:before{border-width:6px!important;margin-top:-6px!important}.arrow-box-right[_ngcontent-%COMP%]:after, .arrow-box-right[_ngcontent-%COMP%]:before{left:100%;top:50%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-right[_ngcontent-%COMP%]:after{border-color:#0000;border-left-color:#fff;border-width:5px;margin-top:-5px}.arrow-box-right[_ngcontent-%COMP%]:before{border-color:#c2e1f500;border-left-color:#bbb;border-width:8px;margin-top:-8px}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}']}),o})();var G=l(41206),J=l(28255),We=l(54968),ze=l(78372),Xe=l(67376);const tn=["cartContainer"];function en(o,r){1&o&&t._UZ(0,"th",18)}function nn(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"td",26),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onSelect({item:a,index:c}))}),t.TgZ(1,"small"),t._uU(2),t.qZA()()}if(2&o){const e=t.oxw().index;t.xp6(2),t.hij("",e+1,".")}}function on(o,r){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij("x",t.lcZ(2,1,e.UnitQuantity),"")}}function an(o,r){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij("@",t.lcZ(2,1,e.VariantUnitQuantity),"")}}function rn(o,r){if(1&o&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.UnitPrice)," ")}}function ln(o,r){1&o&&t._uU(0," - ")}function cn(o,r){if(1&o&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Total)," ")}}function sn(o,r){1&o&&t._uU(0," - ")}function dn(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"tr",19),t.NdJ("contextmenu",function(i){const a=t.CHM(e),c=a.$implicit,u=a.index,h=t.oxw();return t.KtG(h.onContextMenu(i,c,u))}),t.TgZ(1,"td",20)(2,"i",21),t.NdJ("click",function(){const i=t.CHM(e),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onRemove({item:a,index:c}))}),t.qZA()(),t.YNc(3,nn,3,1,"td",22),t.TgZ(4,"td",23),t.NdJ("click",function(){const i=t.CHM(e),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onSelect({item:a,index:c}))}),t.TgZ(5,"span",24),t._uU(6),t._UZ(7,"br"),t.qZA(),t._UZ(8,"span",25),t.qZA(),t.TgZ(9,"td",26),t.NdJ("click",function(){const i=t.CHM(e),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onSelect({item:a,index:c}))}),t._uU(10),t.qZA(),t.TgZ(11,"td",27),t.NdJ("click",function(){const i=t.CHM(e),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onSelect({item:a,index:c,focus:"Quantity"}))}),t.TgZ(12,"span"),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,on,3,3,"span",28),t.YNc(16,an,3,3,"span",28),t.qZA(),t.TgZ(17,"td",27),t.NdJ("click",function(){const i=t.CHM(e),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onSelect({item:a,index:c,focus:"Price"}))}),t.YNc(18,rn,3,3,"ng-container",29),t.YNc(19,ln,1,0,"ng-template",null,30,t.W1O),t.qZA(),t.TgZ(21,"td",31),t.NdJ("click",function(){const i=t.CHM(e),a=i.$implicit,c=i.index,u=t.oxw();return t.KtG(u.onSelect({item:a,index:c,focus:"Discount"}))}),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"td",32),t.YNc(25,cn,3,3,"ng-container",29),t.YNc(26,sn,1,0,"ng-template",null,33,t.W1O),t.qZA()()}if(2&o){const e=r.$implicit,n=t.MAs(20),i=t.MAs(27),a=t.oxw();t.Q6J("cdkDragDisabled","small"==a.screenSize),t.xp6(3),t.Q6J("ngIf",a.appConfig.ModuleSell.Grid.RowNumberVisible),t.xp6(3),t.hij(" ",null==e||null==e.Variant?null:e.Variant.Name," "),t.xp6(2),t.Q6J("innerHTML",e.Note,t.oJD),t.xp6(2),t.Oqu(null==e||null==e.Variant?null:e.Variant.Code),t.xp6(3),t.Oqu(t.xi3(14,13,e.Quantity,"1.0-4")),t.xp6(2),t.Q6J("ngIf",e.UnitQuantity>1),t.xp6(1),t.Q6J("ngIf",e.VariantUnitQuantity>1),t.xp6(2),t.Q6J("ngIf",a.userRole.Cost)("ngIfElse",n),t.xp6(4),t.hij(" ",0==e.Discount?"":"-"+t.lcZ(23,16,e.Discount)," "),t.xp6(3),t.Q6J("ngIf",a.userRole.Cost)("ngIfElse",i)}}function un(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"button",35),t.NdJ("click",function(){t.CHM(e);const i=t.oxw().item,a=t.oxw();return t.KtG(a.onReverse(i,!0))}),t._uU(1,"Return"),t.qZA()}}function pn(o,r){if(1&o){const e=t.EpF();t.YNc(0,un,2,0,"button",34),t.TgZ(1,"button",35),t.NdJ("click",function(){const a=t.CHM(e).item,c=t.oxw();return t.KtG(c.onReverse(a,!1))}),t._uU(2,"Purchase"),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("ngIf",e.userRole.Return)}}let gn=(()=>{class o{constructor(e,n){this.firtLoadService=e,this.cartItemService=n,this.smallBreakpoints=768,this.contextMenuPosition={x:"0px",y:"0px"},this.destroy$=new O.x,this.cartItemsChange=new t.vpe,this.onSelectItem=new t.vpe,this.onRemoveItem=new t.vpe,this.appConfig=e.Data.AppConfigJSON,this.cartItemService.notifyNewItem$.pipe((0,y.h)(i=>s.gT.IsNotEmpty(i))).subscribe({next:i=>{setTimeout(()=>{this.cartContainer.nativeElement.scrollTop=this.cartContainer.nativeElement.scrollHeight},1)}})}getCurrentBreakpoints(e){return e<=this.smallBreakpoints?"small":"large"}subscribeWindowSizeChanges(){(0,We.R)(window,"resize").pipe((0,ze.b)(500),(0,m.R)(this.destroy$)).subscribe(e=>this.screenSize=this.getCurrentBreakpoints(e.target.innerWidth))}ngOnInit(){this.firtLoadService.role$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.userRole=e}),this.screenSize=this.getCurrentBreakpoints(window.innerWidth),this.subscribeWindowSizeChanges()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}onSelect(e){this.onSelectItem.emit(e)}onRemove(e){this.onRemoveItem.emit(e)}onContextMenu(e,n,i){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",n.Index=i,this.contextMenu.menuData={item:n},this.contextMenu.openMenu()}onReverse(e,n){n?e.Quantity>0&&(e.Quantity=-1*e.Quantity):e.Quantity<0&&(e.Quantity=-1*e.Quantity),this.cartItemService.updateCartItem(e,e.Index)}onDrop(e){(0,G.bA)(this.cartItems,e.previousIndex,e.currentIndex),this.cartItemsChange.emit(this.cartItems)}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(T.O),t.Y36($.R))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-card-display"]],viewQuery:function(e,n){if(1&e&&(t.Gf(tn,5),t.Gf(J.p6,7)),2&e){let i;t.iGM(i=t.CRH())&&(n.cartContainer=i.first),t.iGM(i=t.CRH())&&(n.contextMenu=i.first)}},inputs:{cartItems:"cartItems"},outputs:{cartItemsChange:"cartItemsChange",onSelectItem:"onSelectItem",onReturnItem:"onReturnItem",onPurchaseItem:"onPurchaseItem",onRemoveItem:"onRemoveItem"},decls:27,vars:7,consts:[[1,"cashier"],[1,"row","g-0","cart-table","border-bottom"],["cdkScrollable","",1,"col"],["cartContainer",""],[1,"table"],[1,"border-start-0"],[2,"width","18px"],["style","width: 36px",4,"ngIf"],[1,"text-start",2,"width","250px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","70px"],[1,"disc","text-end",2,"width","20px"],[1,"text-end",2,"width","85px"],["cdkDropList","",1,"itemList",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"cdkDragDisabled","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["contextMenu","matMenu"],["matMenuContent",""],[2,"width","36px"],["cdkDrag","",1,"item",3,"cdkDragDisabled","contextmenu"],[1,"cursor"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"click"],[3,"click",4,"ngIf"],[1,"text-start",3,"click"],[1,"d-block"],[3,"innerHTML"],[3,"click"],[1,"text-end",3,"click"],[4,"ngIf"],[4,"ngIf","ngIfElse"],["NotShowPrice",""],[1,"text-end","text-danger","disc",3,"click"],[1,"text-end"],["NotShowTotal",""],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2,3)(4,"table",4)(5,"thead")(6,"tr",5),t._UZ(7,"th",6),t.YNc(8,en,1,0,"th",7),t.TgZ(9,"th",8),t._uU(10,"Item"),t.qZA(),t.TgZ(11,"th"),t._uU(12,"Code"),t.qZA(),t.TgZ(13,"th",9),t._uU(14,"Qty"),t.qZA(),t.TgZ(15,"th",10),t._uU(16,"Price"),t.qZA(),t.TgZ(17,"th",11),t._uU(18,"%"),t.qZA(),t.TgZ(19,"th",12),t._uU(20,"Total"),t.qZA()()(),t.TgZ(21,"tbody",13),t.NdJ("cdkDropListDropped",function(a){return n.onDrop(a)}),t.YNc(22,dn,28,18,"tr",14),t.qZA()()()(),t._UZ(23,"div",15),t.TgZ(24,"mat-menu",null,16),t.YNc(26,pn,3,1,"ng-template",17),t.qZA()()),2&e){const i=t.MAs(25);t.xp6(8),t.Q6J("ngIf",n.appConfig.ModuleSell.Grid.RowNumberVisible),t.xp6(14),t.Q6J("ngForOf",n.cartItems),t.xp6(1),t.Udp("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),t.Q6J("matMenuTriggerFor",i)}},dependencies:[d.sg,d.O5,Xe.PQ,J.VK,J.OP,J.p6,J.KA,G.Wj,G.Zt,A.gM,d.JJ],styles:[".cashier[_ngcontent-%COMP%]{width:100%;max-width:37rem;min-width:33rem}div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#FBFBF7}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:9px 5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #CFCFCF}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0}.cdk-drag-preview[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.itemList.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]}),o})();function mn(o,r){if(1&o&&(t.TgZ(0,"tr")(1,"td",30),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"td",31),t._uU(5),t.qZA(),t.TgZ(6,"td",30),t._uU(7),t.ALo(8,"number"),t.qZA()()),2&o){const e=t.oxw(2);t.xp6(2),t.Oqu("Discount ("+t.lcZ(3,3,e.buyData.Order.Discount)+"%):"),t.xp6(3),t.Oqu(e.invoiceCalculator.currencySymbol),t.xp6(2),t.Oqu(t.lcZ(8,5,e.invoiceCalculator.discount1Amount))}}function _n(o,r){if(1&o&&(t.TgZ(0,"tr")(1,"td",30),t._uU(2,"Discount:"),t.qZA(),t.TgZ(3,"td",31),t._uU(4),t.qZA(),t.TgZ(5,"td",30),t._uU(6),t.ALo(7,"number"),t.qZA()()),2&o){const e=t.oxw(2);t.xp6(4),t.Oqu(e.invoiceCalculator.currencySymbol),t.xp6(2),t.Oqu(t.lcZ(7,2,e.buyData.Order.DiscountAmount))}}function hn(o,r){if(1&o&&(t.TgZ(0,"tr")(1,"td",30),t._uU(2),t.qZA(),t.TgZ(3,"td",31),t._uU(4),t.qZA(),t.TgZ(5,"td",30),t._uU(6),t.ALo(7,"number"),t.qZA()()),2&o){const e=t.oxw(2);t.xp6(2),t.Oqu("Tax ("+(null==e.invoiceCalculator.currentTax?null:e.invoiceCalculator.currentTax.Rate)+"%):"),t.xp6(2),t.Oqu(e.invoiceCalculator.currencySymbol),t.xp6(2),t.Oqu(t.lcZ(7,3,null==e.invoiceCalculator?null:e.invoiceCalculator.taxAmount))}}function bn(o,r){if(1&o&&(t.TgZ(0,"div",28)(1,"table",29)(2,"tbody")(3,"tr")(4,"td",30),t._uU(5,"Amount:"),t.qZA(),t.TgZ(6,"td",31),t._uU(7),t.qZA(),t.TgZ(8,"td",30),t._uU(9),t.ALo(10,"number"),t.qZA()(),t.YNc(11,mn,9,7,"tr",32),t.YNc(12,_n,8,4,"tr",32),t.YNc(13,hn,8,5,"tr",32),t.TgZ(14,"tr")(15,"td",30),t._uU(16,"Total Amount:"),t.qZA(),t.TgZ(17,"td",31),t._uU(18),t.qZA(),t.TgZ(19,"td",33),t._uU(20),t.ALo(21,"number"),t.ALo(22,"async"),t.qZA()()()()()),2&o){const e=t.oxw();t.xp6(7),t.Oqu(e.invoiceCalculator.currencySymbol),t.xp6(2),t.Oqu(t.lcZ(10,7,e.invoiceCalculator.grossTotal)),t.xp6(2),t.Q6J("ngIf",e.cartItems.length>0&&e.buyData.Order.Discount>0),t.xp6(1),t.Q6J("ngIf",e.cartItems.length>0&&e.buyData.Order.DiscountAmount>0),t.xp6(1),t.Q6J("ngIf",e.cartItems.length>0&&0!=(null==e.invoiceCalculator.currentTax?null:e.invoiceCalculator.currentTax.Rate)),t.xp6(5),t.Oqu(e.invoiceCalculator.currencySymbol),t.xp6(2),t.Oqu(t.lcZ(21,9,t.lcZ(22,11,e.invoiceCalculator.Data$)))}}const fn=function(o){return{"date-warning":o}},Cn=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},yn=function(o){return{ID:o}};let xn=(()=>{class o{constructor(e,n,i){this.invoiceCalculator=e,this.buyDataService=n,this.submitOrderService=i,this.onCreateNewTransaction=new t.vpe,this.buyData=this.buyDataService.Data,this.cartItems=this.buyData.Items,this.subscribeToObservable()}ngOnInit(){this.iniPrintLink(),this.initIsOrderNow()}initIsOrderNow(){this.isOrderNow=!0;let e=new Date(this.buyData.Order.Date);e.setHours(0,0,0,0);let n=new Date;n.setHours(0,0,0,0),n.getMilliseconds()!==e.getMilliseconds()&&(this.isOrderNow=!1)}subscribeToObservable(){this.submitOrderService.Data$.subscribe(e=>{this.completeData=e})}iniPrintLink(){let n=this.buyData.Invoice.ID,a=this.findEntityById(this.buyData.Order.EntityID).PrintTemplateID.toString(),u=s.gT.StringFormat("{0}?ID={1}&Template={2}","/print/SupplierInvoice",n,a);this.printLink=u}findEntityById(e){return this.entities.find(i=>i.ID==e)}createNewTransaction(){this.onCreateNewTransaction.emit()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(k),t.Y36(M.q),t.Y36(yt))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-complete"]],inputs:{entities:"entities",roleCost:"roleCost"},outputs:{onCreateNewTransaction:"onCreateNewTransaction"},decls:38,vars:12,consts:[[1,"buy-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-header",3,"ngClass"],[1,"d-flex","justify-content-between"],[1,"fa-solid","fa-check","me-1"],[1,"fst-italic"],[1,"card-body"],[1,"container"],[1,"row","mt-9","justify-content-center","g-0","mb-9"],[1,"col-9","text-center"],["type","button",1,"btn","btn-success","btn-lg","w-100","fs-2",3,"click"],[1,"card-footer","bg-light-gray"],[1,"row","justify-content-between","py-5"],[1,"col-auto"],["target","_blank",1,"btn","btn-light-gray",3,"href"],[1,"fa-solid","fa-print","me-2"],[1,"col-md-4"],[1,"card-header","bg-light-gray"],[1,"text-dark"],["target","_blank",1,"text-dark","fst-italic",3,"routerLink","queryParams"],[1,"row","p-5"],[1,"col-8"],[1,"col-4","text-end"],[1,"card-footer","pe-2","bg-white"],["class","ms-auto",4,"ngIf"],[1,"ms-auto"],[1,"table","table-borderless","mb-0","table-sm"],[1,"text-end"],[1,"text-start"],[4,"ngIf"],[1,"text-end",2,"font-size","1rem"]],template:function(e,n){1&e&&(t.TgZ(0,"section",0)(1,"div")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"h2"),t._UZ(9,"i",7),t._uU(10," Purchase Complete "),t.TgZ(11,"small",8),t._uU(12),t.qZA()()()(),t.TgZ(13,"div",9)(14,"div",10)(15,"div",11)(16,"div",12)(17,"button",13),t.NdJ("click",function(){return n.createNewTransaction()}),t._uU(18," New Purchase (F8) "),t.qZA()()()()(),t.TgZ(19,"div",14)(20,"div",15)(21,"div",16)(22,"a",17),t._UZ(23,"i",18),t._uU(24,"Print Receipt "),t.qZA()()()()()(),t.TgZ(25,"div",19)(26,"div",4)(27,"div",20)(28,"h3",21)(29,"a",22),t._uU(30),t.qZA()()(),t.TgZ(31,"div",23)(32,"div",24),t._uU(33,"--------"),t.qZA(),t.TgZ(34,"div",25),t._uU(35,"$$$"),t.qZA()(),t.TgZ(36,"div",26),t.YNc(37,bn,23,13,"div",27),t.qZA()()()()()()()),2&e&&(t.xp6(6),t.Q6J("ngClass",t.VKq(7,fn,!n.isOrderNow||n.completeData.PaymentStateID<3)),t.xp6(6),t.hij(" (",n.completeData.PaymentStateLabel,") "),t.xp6(10),t.Q6J("href",n.printLink,t.LSH),t.xp6(7),t.Q6J("routerLink",t.DdM(9,Cn))("queryParams",t.VKq(10,yn,n.buyData.Invoice.ID)),t.xp6(1),t.hij(" Supplier Bill #",n.completeData.InvoiceNumber," "),t.xp6(7),t.Q6J("ngIf",n.roleCost))},dependencies:[d.mk,d.O5,Z.yS,d.Ov,d.JJ],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.buy-complete[_ngcontent-%COMP%]{display:none}}.buy-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.buy-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.buy-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]}),o})();function Mn(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"a",2),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.retur())}),t._UZ(1,"i",3),t.qZA()}}function vn(o,r){if(1&o&&(t.ynx(0),t.YNc(1,Mn,2,0,"a",1),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.isComplete)}}let On=(()=>{class o{constructor(){this.onRetur=new t.vpe,this.isComplete=!1}ngOnInit(){}retur(){this.onRetur.emit()}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-header"]],inputs:{returnRole:"returnRole",isComplete:"isComplete"},outputs:{onRetur:"onRetur"},decls:1,vars:1,consts:[[4,"ngIf"],["matTooltipPosition","above","matTooltip","Return","data-cy","Return","class","header cursor-pointer",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Return","data-cy","Return",1,"header","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa","fa-retur"]],template:function(e,n){1&e&&t.YNc(0,vn,2,1,"ng-container",0),2&e&&t.Q6J("ngIf",n.returnRole)},dependencies:[d.O5,A.gM],styles:[".fa-retur[_ngcontent-%COMP%]{background-position-y:center;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/return.svg);height:26px;width:26px;background-size:26px;background-repeat:no-repeat}"]}),o})();function Dn(o,r){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"POS-toolbar",7),t.NdJ("dateChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Order.Date=i)})("purchaseNumberChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Invoice.Number=i)})("billNumberChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Order.Number=i)})("attentionChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.buyData.Order.Att=i)})("onOpenModalSupplier",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenModalSupplier())})("onOpenOutletModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openOutletModal())})("onSelectSupplier",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onSelectSupplier(i))})("onClearAutoComplete",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onSupplierClear())}),t.qZA(),t.TgZ(2,"div",8)(3,"div",9),t._UZ(4,"pos-quick-key",10),t.qZA(),t.TgZ(5,"div",11)(6,"POS-cart-header",12),t.NdJ("onScanCode",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onScanBarcode(i))})("onAddItem",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.addItem(i))})("onCreateItem",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.createNewItem())})("onOpenUploadModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenUploadModal())}),t.qZA(),t.TgZ(7,"POS-card-display",13),t.NdJ("cartItemsChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onCartItemChanges(i))})("onRemoveItem",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.removeItem(i))})("onSelectItem",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.selectItem(i))}),t.qZA(),t.TgZ(8,"POS-cart-action",14),t.NdJ("taxIdChange",function(i){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onTaxChange(i))})("onOpenDiscountModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenDiscountModal())})("onOpenFulfillmentModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenFulfillmentModal())})("onOpenNoteModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenNoteModal())})("onOpenPaymentModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.submit())})("onOpenVoidModal",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenVoidModal())}),t.qZA()()(),t.TgZ(9,"ul",15)(10,"li",16),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onReturnAll())}),t._uU(11," RETURN ALL "),t.qZA()(),t.BQk()}if(2&o){const e=t.oxw(2);t.xp6(1),t.Q6J("date",e.buyData.Order.Date)("purchaseNumber",e.buyData.Invoice.Number)("billNumber",e.buyData.Order.Number)("attention",e.buyData.Order.Att)("outletName",e.outletName)("supplierName",e.supplierName),t.xp6(3),t.Q6J("quickKeyId",e.quickeyID),t.xp6(2),t.Q6J("isUpload",!0)("cartItems",e.cartItems),t.xp6(1),t.Q6J("cartItems",e.cartItems)}}function Tn(o,r){if(1&o){const e=t.EpF();t.TgZ(0,"POS-complete",17),t.NdJ("onCreateNewTransaction",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.newForm())}),t.qZA()}if(2&o){const e=t.oxw(2);t.Q6J("roleCost",e.roles.Cost)("entities",e.entities)}}function In(o,r){if(1&o&&(t.TgZ(0,"div",3),t.YNc(1,Dn,12,10,"ng-container",4),t.YNc(2,Tn,1,2,"ng-template",null,5,t.W1O),t._UZ(4,"div",6),t.qZA()),2&o){const e=t.MAs(3),n=t.oxw();t.xp6(1),t.Q6J("ngIf",!n.isComplete)("ngIfElse",e)}}const Pn=[{path:"Entry/Order",component:(()=>{class o extends C.M{constructor(e,n,i,a,c,u,h,E,Q,at,rt,kn){super(e),this._firstLoadService=n,this._activatedRoute=i,this._quickeyService=a,this._cartItemsService=c,this._buyDataService=u,this._toastr=h,this._dialog=E,this._supplierService=Q,this._calculatorService=at,this.buyStateService=rt,this._outletService=kn,this.buyData=new D.F,this.BuyState=b,this.destroy$=new O.x,this.subscribeToObservableChanges()}ngOnInit(){this.initLoadForm()}subscribeToObservableChanges(){this._quickeyService.onSelectQuickeyItem$.pipe((0,y.h)(e=>s.gT.IsNotEmpty(e.id)),(0,m.R)(this.destroy$)).subscribe(e=>{this._cartItemsService.addCartItemById(e.id,e.entityID)}),this._buyDataService.Data$.pipe((0,m.R)(this.destroy$)).subscribe(e=>{this.buyData=e,this.supplierName=e.ContactName,this.cartItems=this.buyData.Items,this.setFocusToAutoComplete()})}initLoadForm(){let e=this._activatedRoute.snapshot.queryParams;this.menuData$.pipe((0,I.b)(()=>this._firstLoadService.getLoadData(s.Wz.LoadFormBuy).pipe((0,m.R)(this.destroy$)))).subscribe(n=>{if(this.fillData(n),s.gT.IsEmpty(e.ID)){if("low"==this._cartItemsService.inventoryState)return void this.onCreateFromOutletLowInventory();1==this.entities.length?(this.onSelectOutlet(this.entities[0]),this._outletService.selectedOutletRegister=this.entities[0]):(this._outletService.selectedOutletRegister=null,this.openOutletModal()),this.buyStateService.state=b.NEW}else this.buyStateService.state=b.UPDATE,this.onEditTransaction(e.ID);this.setFocusToAutoComplete()})}onCreateFromOutletLowInventory(){const e=this.entities.filter(n=>n.ID=this._cartItemsService.entityID);this._outletService.selectedOutletRegister=e[0],this.onSelectOutlet(e[0]),this.itemInventoryLow()}itemInventoryLow(){this._cartItemsService.cartItems=this._cartItemsService.cartItems.map(e=>{e.Variant=new Ae.O;const n=(0,R.yE)(F.k,e);return n.Quantity=e.Max-e.Inventory,n.Discount=0,n.Variant.Name=e.Product,n.Variant.Code=e.Code,n.UnitQuantity=e.UnitQuantity,n.UnitPrice=e.UnitPrice,n.UnitCost=e.UnitCost,n.Discount=0,n.DiscountAmount=0,n.VariantID=e.ID,n}),this.buyData.Items=this._cartItemsService.cartItems,this.cartItems=this._cartItemsService.cartItems}fillData(e){this.roles=this._firstLoadService.role,this.entities=e.Entities,this.buyStorage=e}onEditTransaction(e){this._buyDataService.onEditTransaction(e).subscribe(n=>{this.menuData.H=`Editing Purchase Order #${n.Order.Number}`;let i=this.entities.find(c=>c.ID==n.Order.EntityID);if(!i)return void this._toastr.warning("Buy Config is Disabled, Please enable the Buy Config for this Outlet","Warning");this.outletName=i.Name,this.outletID=n.Order.EntityID,this.supplierName=n.ContactName;let a=this.buyStorage.Taxes.find(c=>c.ID==n.Order.TaxTypeID);this._calculatorService.currentTax=a,this._outletService.getOutletInfo(n.Order.EntityID).subscribe(c=>{this.initQuickKey(c.QuickKeyPack)}),this.cartItems=n.Items,this._buyDataService.pushNewValue(n)})}openOutletModal(){let e=this.buyStorage.Entities.filter(n=>0==n.Suspended);this._dialog.open(g.X,{data:{Entities:e,SelectedRegister:this._outletService.selectedOutletRegister}}).afterClosed().pipe((0,m.R)(this.destroy$),(0,y.h)(n=>s.gT.IsNotEmpty(n))).subscribe(n=>{this._outletService.selectedOutletRegister=n.outlet,this.onSelectOutlet(n.outlet)})}onSelectOutlet(e){this.outletID=e.ID,this.outletName=e.Name,this._outletService.getOutletInfo(this.outletID).pipe((0,m.R)(this.destroy$)).subscribe(n=>{this._buyDataService.initTransaction(n,this.buyStorage,this._cartItemsService.inventoryState,this._cartItemsService.cartItems),this.initQuickKey(n.QuickKeyPack),this.setFocusToAutoComplete()})}initQuickKey(e){this.quickeyID=e.ID,this._quickeyService.Data=e,this._quickeyService.EntityID=this.outletID}removeItem(e){this._cartItemsService.deleteCartItem(e.item)}selectItem(e){this._dialog.open(pt,{data:{cartItem:e.item,entityID:this.outletID,index:e.index,focus:e.focus}})}onScanBarcode(e){this._cartItemsService.addCartItemByCode(e,this.outletID)}onOpenUploadModal(){this._dialog.open(x.h,{data:{sampleUrl:"//res.cloudinary.com/pos/raw/upload/POS/CSV/SupplierPO_DealPOS.csv",API:"/API/Buy/UploadCsv"}}).afterClosed().pipe((0,m.R)(this.destroy$),(0,y.h)(e=>void 0!==e)).subscribe(e=>{this.generateItemUpload(e)})}generateItemUpload(e){e.forEach(n=>{n.UnitPrice=n.Cost,n.ID=s.gT.GuidEmpty,n=this._buyDataService.generateCartItem(n),this._cartItemsService.addItemToCart(n,!0)})}addItem(e){this._cartItemsService.addCartItemById(e,this.outletID)}createNewItem(){this._dialog.open(pt,{data:{cartItem:new F.k,entityID:this.outletID}})}submit(){let e=this.buyStorage.AppConfigJSON.ModuleBuy.Header.SupplierRequired;if(this.validatedSupplierID()){if(s.gT.IsEmpty(this.buyData.Order.SupplierID)&&e)return void this._toastr.warning("Please Select Supplier","Warning!");if(0==this.cartItems.length)return void this._toastr.warning(s.g7.emptyPOItem,"Warning!");this.onOpenPaymentModal()}}validatedSupplierID(){if(s.gT.IsEmpty(this.buyData.Order.SupplierID)){let n=this._supplierService.inputTextName;if(s.gT.IsNotEmpty(n))return this._toastr.warning("Supplier is not Saved","Warning"),this.onOpenModalSupplier(n),!1}return!0}newForm(){this._supplierService.inputTextName=null,this.buyStateService.state=b.NEW,this.isComplete=!1,this._buyDataService.createNewTransaction(this.outletID,this.buyStorage,this._outletService.outletInfo)}onOpenModalSupplier(e){this._dialog.open(q.Az,{data:{options:this.buyStorage.SupplierOptions,config:this.buyStorage.AppConfigJSON.ModuleContact,type:"supplier",title:"New Supplier Form",inputTextName:e}}).afterClosed().pipe((0,m.R)(this.destroy$)).subscribe(n=>{n&&(this.supplierName=n.supplier.Name,this._supplierService.createNewSupplier(n.supplier),this.setFocusToAutoComplete())})}onSelectSupplier(e){this._supplierService.setSupplierData(e),this.setFocusToAutoComplete()}onOpenDiscountModal(){this._dialog.open(ee,{data:{discount:this.buyData.Order.Discount,discountAmount:this.buyData.Order.DiscountAmount}}).afterClosed().pipe((0,y.h)(e=>null!=e)).subscribe(e=>{this.buyData.Order.Discount=e.discount,this.buyData.Order.DiscountAmount=e.discountAmount,this._buyDataService.pushNewValue(this.buyData)})}onOpenNoteModal(){this._dialog.open(ue,{width:"45%"})}onOpenVoidModal(){this._dialog.open(gt.s).afterClosed().pipe((0,y.h)(e=>1==e)).subscribe(()=>{this._buyDataService.clearTransaction()})}onOpenPaymentModal(){this._dialog.open(Ne).afterClosed().pipe((0,y.h)(e=>null!=e)).subscribe(()=>{this.buyStateService.state=b.COMPLETE,this.isComplete=!0})}onOpenFulfillmentModal(){this._dialog.open(fe)}onTaxChange(e){this.buyData.Order.TaxTypeID=e,this._buyDataService.pushNewValue(this.buyData)}onSupplierClear(){this.buyData.Order.SupplierID=s.gT.GuidEmpty,this._buyDataService.pushNewValue(this.buyData)}onRetur(){this._dialog.open(Ze,{data:{entityID:this.outletID}})}onCartItemChanges(e){this.buyData.Items=e,this.cartItems=e}setFocusToAutoComplete(){let e=document.getElementById("product");e&&e.focus()}onReturnAll(){0!=this.cartItems.length?confirm("Are you sure you want to return all items quantity?")&&(this.buyData.Items=this.buyData.Items.map(n=>(n.Quantity=-1*n.Quantity,n)),this._buyDataService.pushNewValue(this.buyData)):this._toastr.warning(s.g7.emptyPOItem,"Warning!")}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(Y.O),t.Y36(T.O),t.Y36(Z.gz),t.Y36(ke.w),t.Y36($.R),t.Y36(M.q),t.Y36(L._W),t.Y36(_.uw),t.Y36(ot),t.Y36(k),t.Y36(N),t.Y36(st))},o.\u0275cmp=t.Xpm({type:o,selectors:[["POS-buy"]],features:[t.qOj],decls:5,vars:6,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],[3,"isComplete","returnRole","onRetur"],["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[4,"ngIf","ngIfElse"],["COMPLETE",""],[1,"simple-keyboard"],[3,"date","purchaseNumber","billNumber","attention","outletName","supplierName","dateChange","purchaseNumberChange","billNumberChange","attentionChange","onOpenModalSupplier","onOpenOutletModal","onSelectSupplier","onClearAutoComplete"],[1,"row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[3,"quickKeyId"],[1,"col-auto","cart"],[3,"isUpload","cartItems","onScanCode","onAddItem","onCreateItem","onOpenUploadModal"],[3,"cartItems","cartItemsChange","onRemoveItem","onSelectItem"],[3,"taxIdChange","onOpenDiscountModal","onOpenFulfillmentModal","onOpenNoteModal","onOpenPaymentModal","onOpenVoidModal"],[1,"returnAll"],["id","btnPark",3,"click"],[3,"roleCost","entities","onCreateNewTransaction"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel-cmp",0)(1,"actions")(2,"POS-header",1),t.NdJ("onRetur",function(){return n.onRetur()}),t.qZA()(),t.TgZ(3,"content"),t.YNc(4,In,5,2,"div",2),t.qZA()()),2&e&&(t.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",n.menuData),t.xp6(2),t.Q6J("isComplete",n.isComplete)("returnRole",null==n.roles?null:n.roles.Return),t.xp6(2),t.Q6J("ngIf",n.buyStorage))},dependencies:[d.O5,S.p,Je.w,Mt.H,Qe,je,gn,xn,On],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}@media print{.cashier[_ngcontent-%COMP%], pos-quick-key[_ngcontent-%COMP%], pos-header[_ngcontent-%COMP%], pos-toolbar[_ngcontent-%COMP%]{display:none}}div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.quickKey[_ngcontent-%COMP%]{width:420px;margin-right:10px}div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.cart[_ngcontent-%COMP%]{width:570px}.returnAll[_ngcontent-%COMP%]{position:fixed;top:55%;transform:translateY(-50%);right:0}.returnAll.fullscreen-button-right[_ngcontent-%COMP%]{right:0}.returnAll[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{width:68px;height:64px;cursor:pointer;outline:none;text-align:center;font-weight:700;font-family:Roboto Slab,serif;text-transform:uppercase;list-style:none;background-color:#89b03e;color:#fff;padding-top:14px;display:block}.returnAll[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(odd){border:1px solid #51632e}.returnAll[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(even){color:#545454;text-shadow:0 1px 0 white;background-color:#f4f4f4;font-weight:700;border-left:1px solid #a6a6a6;border-right:1px solid #a6a6a6}.simple-keyboard[_ngcontent-%COMP%]{width:20vw;position:absolute;left:77%;top:30%;z-index:1200} .hg-theme-default .hg-button{height:70px!important;font-size:16px!important}"]}),o})()},{path:"**",redirectTo:"Entry/Order",pathMatch:"full"}];let Sn=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[d.ez,Z.Bz.forChild(Pn),Z.Bz]}),o})();var wn=l(88441),Nn=l(12386),Zn=l(65131);let An=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[d.ez,p.u5,Sn,p.UX,f.d,S.R,v.ZU,U.A0,it.dr,W.Q,wn.S,Mt.D,q.vH,Nn.S,Zn.X,dt.Gg,et.vV,J.Tx,ft._8,G._t,g.U,gt.G,x.E,A.AV,z.O]}),o})()},22863:(lt,P,l)=>{l.d(P,{M:()=>S});var d=l(11481),p=l(18505),f=l(34782);class S{constructor(C){this.httpService=C,this.menuData={T:null,N:null,H:null},this.menuData$=C.get("/api/Menu/"+this.GetRequestPayload()).pipe((0,p.b)(s=>{this.menuData=s,new d.Dx(document).setTitle(this.menuData.T)}),(0,f.d)())}GetRequestPayload(){let C=window.location.href;return C=C.split("menu/")[1],C=C.split(";")[0],C}}},29099:(lt,P,l)=>{l.d(P,{q:()=>m});var d=l(61135),p=l(56451),f=l(54968),S=l(39841),v=l(54004),C=l(68675);class s{constructor(D=!1,g=!1,x=!1){this.configUsingLocal=D,this.productUsingLocal=g,this.orderUsingLocal=x}get usingLocal(){return this.configUsingLocal||this.productUsingLocal||this.orderUsingLocal}}var O=l(94650),y=l(13337);let m=(()=>{class I{constructor(g){this.localDataService=g,this.localConfig=new s,this._offlineConfigSubject=new d.X(this.localConfig),this.offlineConfig$=this._offlineConfigSubject.asObservable(),this.online$=(0,p.T)((0,f.R)(window,"offline").pipe((0,v.U)(()=>!1)),(0,f.R)(window,"online").pipe((0,v.U)(()=>!0))).pipe((0,C.O)(navigator.onLine)),this.initLocalDataConfig()}get isOnline(){return navigator.onLine}initLocalDataConfig(){this.localDataService.getOfflineConfig().subscribe(g=>{if(null!=g){const x=new s(g.configUsingLocal,g.productUsingLocal,g.orderUsingLocal);this.pushNewValue(x),this.localConfig=x}else g=new s,this.updateOfflineConfigDB(g)})}getOnlineStatus$(){return(0,S.a)([this.offlineConfig$.pipe((0,v.U)(g=>g.usingLocal)),this.online$]).pipe((0,v.U)(g=>{let _;return _=!0!==g[0]&&g[1]&&this.isOnline,_}))}pushNewValue(g){this._offlineConfigSubject.next(g)}updateOfflineConfigDB(g){this.localDataService.updateOfflineConfig(g).subscribe({next:()=>{this.pushNewValue(g)},error:x=>{console.error(x)}})}}return I.\u0275fac=function(g){return new(g||I)(O.LFG(y.T))},I.\u0275prov=O.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"}),I})()}}]);