@posx/core 5.5.331 → 5.5.333

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -316,7 +316,7 @@ interface IAppCoreModel {
316
316
  * the date when the object is deleted
317
317
  * @ignore
318
318
  */
319
- deleted_at: Date;
319
+ deleted_at: Date | null;
320
320
  /**
321
321
  * timestamp in milliseconds
322
322
  * @ignore
@@ -3141,6 +3141,8 @@ interface IConfig {
3141
3141
  kds: IKdsConfig;
3142
3142
  /** Customer display system setting */
3143
3143
  cds: ICustomerDisplaySystemConfig;
3144
+ /** Order display setting */
3145
+ ods: IOrderDisplaySystemConfig;
3144
3146
  /** Kiosk system setting */
3145
3147
  kiosk: IKioskSystemConfig;
3146
3148
  /** Online order setting */
@@ -3247,6 +3249,7 @@ declare class Config implements IConfig {
3247
3249
  kds: KdsConfig;
3248
3250
  label: LabelConfig;
3249
3251
  order: OrderConfig;
3252
+ ods: OrderDisplaySystemConfig;
3250
3253
  payment: PaymentConfig;
3251
3254
  user: UserConfig;
3252
3255
  tax: TaxConfig;
@@ -3553,6 +3556,8 @@ interface IOrderConfig {
3553
3556
  hide_categories_when_ordering: boolean;
3554
3557
  /** Flag to end shift with open tables */
3555
3558
  end_shift_with_open_tables: boolean;
3559
+ /** Date time format for humanized dates */
3560
+ datetime_format: string;
3556
3561
  }
3557
3562
  declare class OrderConfig implements IOrderConfig {
3558
3563
  separation_line: boolean;
@@ -3564,6 +3569,15 @@ declare class OrderConfig implements IOrderConfig {
3564
3569
  hide_combo_item_on_interactive_view: boolean;
3565
3570
  hide_categories_when_ordering: boolean;
3566
3571
  end_shift_with_open_tables: boolean;
3572
+ datetime_format: string;
3573
+ constructor();
3574
+ }
3575
+ interface IOrderDisplaySystemConfig {
3576
+ /** Language for order display */
3577
+ language: string;
3578
+ }
3579
+ declare class OrderDisplaySystemConfig implements IOrderDisplaySystemConfig {
3580
+ language: string;
3567
3581
  constructor();
3568
3582
  }
3569
3583
  interface IPaymentConfig {
@@ -4180,6 +4194,7 @@ declare class TemplateData implements ITemplateData {
4180
4194
  normalized_printed_at: string;
4181
4195
  meta: Record<string, any>;
4182
4196
  is_cancel: boolean;
4197
+ constructor();
4183
4198
  }
4184
4199
  type IRenderPrintTemplateOptions = {
4185
4200
  printer_name: string;
@@ -5616,7 +5631,7 @@ declare const filterByParams: (params: {
5616
5631
  }) => (values: any) => boolean;
5617
5632
  //#endregion
5618
5633
  //#region src/utils/misc.utils.d.ts
5619
- declare function humanizedData(date: Date): string;
5634
+ declare function humanizedData(date: Date, format?: string): string;
5620
5635
  declare function normalizedDate(date: Date): string;
5621
5636
  //#endregion
5622
5637
  //#region src/types/ods.type.d.ts
@@ -5820,5 +5835,5 @@ type IMerchant = {
5820
5835
  meta: Record<string, string>;
5821
5836
  };
5822
5837
  //#endregion
5823
- export { Address, AppBaseModel, AppConfig, AppCoreModel, AppCoreService, AppExtraModel, AppLocalService, AppMiscService, AppRemoteService, AppReport, AppReportService, Applying, AssetTags, AssetType, Between, BreakPeriod, Cache, CalcFlow, CalcType, CancelInvoiceOptions, CardPaymentCode, CashDrawerConfig, Category, CategorySalesSummary, CategoryService, CategoryType, Charge, ChargeConfig, CheckInvoiceOptions, Codepages, ComboGroup, ComboGroupItem, Condition, Config, ConfigService, CoreCategory, CoreItem, Coupon, CouponItemized, CouponUsage, CreateInvoiceOptions, CurrencyConfig, CustomResponse, Customer, CustomerDisplaySystemConfig, DayOfWeek, DeployChannel, Device, DeviceEtc, DeviceType, DirectPayInvoiceOptions, DiscountType, DrawerSummary, ElectronSocket, Employee, EmployeeRole, EmployeeRoleService, EmployeeService, ErrorMsgs, EscPosCompatibility, EscPosPrinter, FileUploadRequest, GTOConfig, GeneralConfig, GetManyResult, Holiday, IAddress, IAppBase, IAppBaseModel, IAppConfig, IAppCore, IAppCoreModel, IAppCoreService, IAppExtra, IAppExtraModel, IAppLocalService, IAppMiscService, IAppModelSequence, IAppRemoteService, IAppReport, IAppReportService, IApplying, ICache, ICashDrawerConfig, ICategory, ICategoryService, IChangePaymentMethodOption, ICharge, IChargeConfig, IComboGroup, IComboGroupItem, IConfig, IConfigService, ICoreCategory, ICoreItem, ICoupon, ICouponItemized, ICouponUsage, ICredit, ICurrencyConfig, ICustomer, ICustomerDisplaySystemConfig, IDevice, IDiscount, IDrawerSummary, IEmployee, IEmployeeRole, IEmployeeRoleService, IEmployeeService, IEscPosPrinter, IEtc, IExportRow, IFileUploadRequest, IFileUploadResponse, IFontSize, IGeneralConfig, IGtoConfig, IInventoryConfig, IInvoice, IInvoiceActivity, IInvoiceBaseService, IInvoiceCharge, IInvoiceCoreLine, IInvoiceDiscount, IInvoiceLine, IInvoiceOperationService, IInvoiceService, IItem, IItemService, IKdsConfig, IKioskSystemConfig, IKitchenConfig, ILabelConfig, ILineOperationService, ILoyaltyProgram, ILoyaltyProgramSummary, IMarketing, IMenu, IMenuService, IMerchant, IMerchantAsset, INode, INodePrinter, INote, INoteEntity, INoteGroup, INoteGroupEntity, INoteGroupService, INoteService, IOnlineOrderConfig, IOrderConfig, IOrderDisplay, IOrderDisplayService, IPaxConfig, IPayment, IPaymentConfig, IPaymentMethod, IPaymentMethodHistory, IPaymentMethodService, IPaymentService, IPaymentSummary, IPoint, IPrice, IPrintBarcode, IPrintCommand, IPrintCommandLine, IPrintImage, IPrintJob, IPrintJobService, IPrintQrcode, IPrintTable, IPrintTableRowItem, IPrintTemplate, IPrintTemplateCore, IPrintTemplateService, IPrintText, IPrinter, IPrinterService, IProductBase, IProductService, IPushData, IReceiptConfig, IRenderPrintTemplateOptions, IReport, IReportCategory, IReportConfig, IReportData, IReportRequest, IRoundingConfig, ISalesSummary, ISection, ISectionItem, ISectionItemService, ISectionService, IServiceOptions, IShift, IShiftService, IStandardPaymentMethod, IStorage, ISubcategory, ISubcategoryService, ITaxConfig, ITemplateData, ITill, ITillConfig, ITillService, IUser, IUserConfig, IVisibility, In, Include, InventoryConfig, Invoice, InvoiceAction, InvoiceActivity, InvoiceBaseService, InvoiceCharge, InvoiceCoreLine, InvoiceDiscount, InvoiceLine, InvoiceOperationService, InvoiceService, InvoiceStatus, InvoiceType, Item, ItemSalesSummary, ItemService, KdsConfig, KioskSystemConfig, KitchenConfig, LabelConfig, LineOperationService, LineOptions, LoyaltyProgram, LoyaltyProgramSummary, MarketingConfig, Menu, MenuService, Merchant, MessageType, ModelPrefix, ModelType, ModifierSalesSummary, Node, NodePrinter, Not, Note, NoteEntity, NoteGroup, NoteGroupEntity, OnlineOrderConfig, OpenHours, OrderConfig, OrderDisplay, OrderDisplayService, OrderDisplayStatus, OrderFlow, PaxConfig, PayInvoiceOptions, Payment, PaymentConfig, PaymentMethod, PaymentMethodHistory, PaymentMethodService, PaymentService, PaymentStatus, PaymentSummary, PaynowMethod, Price, PrintAlign, PrintBarcode, PrintCommand, PrintImage, PrintJob, PrintJobService, PrintJobStatus, PrintQrcode, PrintSize, PrintStyle, PrintTemplate, PrintTemplateCore, PrintTemplateService, PrintType, Printer, PrinterConnections, PrinterProtocols, PrinterService, PrinterStatus, PrinterType, ProductBase, ProductPartialAssets, ProductPartialConfig, ProductService, ProductType, PushData, Raw, Receipt, RenderPrintTemplateOptions, Report, ReportCategory, ReportConfig, ReportData, ReportType, RoundingConfig, SalesSummary, Schedule, Section, SectionItem, SectionItemService, SectionItemStatus, SectionService, ServiceFactory, ServiceMode, ServiceOptions, Shift, ShiftService, ShiftStatus, SpecialDay, StandardPaymentMethod, StockChange, Storage, StorageService, Subcategory, SwitchInvoiceOptions, System, SystemError, TCategorySalesSummary, TDynamicOrderQR, TItemCoreSalesSummary, TItemSalesSummary, TModifierSalesSummary, TStockChange, TStockChangeItem, TStorageService, TaxConfig, TaxMethod, TemplateData, Till, TillConfig, TillService, TillType, UomType, UpdateGeneralConfigOptions, UpdateInvoiceOptions, User, UserConfig, Visibility, VoidInvoiceOptions, createCSVExport, dbSchemas, filterByParams, humanizedData, importFromCSV, normalizedDate, transformer };
5838
+ export { Address, AppBaseModel, AppConfig, AppCoreModel, AppCoreService, AppExtraModel, AppLocalService, AppMiscService, AppRemoteService, AppReport, AppReportService, Applying, AssetTags, AssetType, Between, BreakPeriod, Cache, CalcFlow, CalcType, CancelInvoiceOptions, CardPaymentCode, CashDrawerConfig, Category, CategorySalesSummary, CategoryService, CategoryType, Charge, ChargeConfig, CheckInvoiceOptions, Codepages, ComboGroup, ComboGroupItem, Condition, Config, ConfigService, CoreCategory, CoreItem, Coupon, CouponItemized, CouponUsage, CreateInvoiceOptions, CurrencyConfig, CustomResponse, Customer, CustomerDisplaySystemConfig, DayOfWeek, DeployChannel, Device, DeviceEtc, DeviceType, DirectPayInvoiceOptions, DiscountType, DrawerSummary, ElectronSocket, Employee, EmployeeRole, EmployeeRoleService, EmployeeService, ErrorMsgs, EscPosCompatibility, EscPosPrinter, FileUploadRequest, GTOConfig, GeneralConfig, GetManyResult, Holiday, IAddress, IAppBase, IAppBaseModel, IAppConfig, IAppCore, IAppCoreModel, IAppCoreService, IAppExtra, IAppExtraModel, IAppLocalService, IAppMiscService, IAppModelSequence, IAppRemoteService, IAppReport, IAppReportService, IApplying, ICache, ICashDrawerConfig, ICategory, ICategoryService, IChangePaymentMethodOption, ICharge, IChargeConfig, IComboGroup, IComboGroupItem, IConfig, IConfigService, ICoreCategory, ICoreItem, ICoupon, ICouponItemized, ICouponUsage, ICredit, ICurrencyConfig, ICustomer, ICustomerDisplaySystemConfig, IDevice, IDiscount, IDrawerSummary, IEmployee, IEmployeeRole, IEmployeeRoleService, IEmployeeService, IEscPosPrinter, IEtc, IExportRow, IFileUploadRequest, IFileUploadResponse, IFontSize, IGeneralConfig, IGtoConfig, IInventoryConfig, IInvoice, IInvoiceActivity, IInvoiceBaseService, IInvoiceCharge, IInvoiceCoreLine, IInvoiceDiscount, IInvoiceLine, IInvoiceOperationService, IInvoiceService, IItem, IItemService, IKdsConfig, IKioskSystemConfig, IKitchenConfig, ILabelConfig, ILineOperationService, ILoyaltyProgram, ILoyaltyProgramSummary, IMarketing, IMenu, IMenuService, IMerchant, IMerchantAsset, INode, INodePrinter, INote, INoteEntity, INoteGroup, INoteGroupEntity, INoteGroupService, INoteService, IOnlineOrderConfig, IOrderConfig, IOrderDisplay, IOrderDisplayService, IOrderDisplaySystemConfig, IPaxConfig, IPayment, IPaymentConfig, IPaymentMethod, IPaymentMethodHistory, IPaymentMethodService, IPaymentService, IPaymentSummary, IPoint, IPrice, IPrintBarcode, IPrintCommand, IPrintCommandLine, IPrintImage, IPrintJob, IPrintJobService, IPrintQrcode, IPrintTable, IPrintTableRowItem, IPrintTemplate, IPrintTemplateCore, IPrintTemplateService, IPrintText, IPrinter, IPrinterService, IProductBase, IProductService, IPushData, IReceiptConfig, IRenderPrintTemplateOptions, IReport, IReportCategory, IReportConfig, IReportData, IReportRequest, IRoundingConfig, ISalesSummary, ISection, ISectionItem, ISectionItemService, ISectionService, IServiceOptions, IShift, IShiftService, IStandardPaymentMethod, IStorage, ISubcategory, ISubcategoryService, ITaxConfig, ITemplateData, ITill, ITillConfig, ITillService, IUser, IUserConfig, IVisibility, In, Include, InventoryConfig, Invoice, InvoiceAction, InvoiceActivity, InvoiceBaseService, InvoiceCharge, InvoiceCoreLine, InvoiceDiscount, InvoiceLine, InvoiceOperationService, InvoiceService, InvoiceStatus, InvoiceType, Item, ItemSalesSummary, ItemService, KdsConfig, KioskSystemConfig, KitchenConfig, LabelConfig, LineOperationService, LineOptions, LoyaltyProgram, LoyaltyProgramSummary, MarketingConfig, Menu, MenuService, Merchant, MessageType, ModelPrefix, ModelType, ModifierSalesSummary, Node, NodePrinter, Not, Note, NoteEntity, NoteGroup, NoteGroupEntity, OnlineOrderConfig, OpenHours, OrderConfig, OrderDisplay, OrderDisplayService, OrderDisplayStatus, OrderDisplaySystemConfig, OrderFlow, PaxConfig, PayInvoiceOptions, Payment, PaymentConfig, PaymentMethod, PaymentMethodHistory, PaymentMethodService, PaymentService, PaymentStatus, PaymentSummary, PaynowMethod, Price, PrintAlign, PrintBarcode, PrintCommand, PrintImage, PrintJob, PrintJobService, PrintJobStatus, PrintQrcode, PrintSize, PrintStyle, PrintTemplate, PrintTemplateCore, PrintTemplateService, PrintType, Printer, PrinterConnections, PrinterProtocols, PrinterService, PrinterStatus, PrinterType, ProductBase, ProductPartialAssets, ProductPartialConfig, ProductService, ProductType, PushData, Raw, Receipt, RenderPrintTemplateOptions, Report, ReportCategory, ReportConfig, ReportData, ReportType, RoundingConfig, SalesSummary, Schedule, Section, SectionItem, SectionItemService, SectionItemStatus, SectionService, ServiceFactory, ServiceMode, ServiceOptions, Shift, ShiftService, ShiftStatus, SpecialDay, StandardPaymentMethod, StockChange, Storage, StorageService, Subcategory, SwitchInvoiceOptions, System, SystemError, TCategorySalesSummary, TDynamicOrderQR, TItemCoreSalesSummary, TItemSalesSummary, TModifierSalesSummary, TStockChange, TStockChangeItem, TStorageService, TaxConfig, TaxMethod, TemplateData, Till, TillConfig, TillService, TillType, UomType, UpdateGeneralConfigOptions, UpdateInvoiceOptions, User, UserConfig, Visibility, VoidInvoiceOptions, createCSVExport, dbSchemas, filterByParams, humanizedData, importFromCSV, normalizedDate, transformer };
5824
5839
  //# sourceMappingURL=index.d.ts.map
package/build/index.js CHANGED
@@ -1266,21 +1266,8 @@ var PrintCommand = class {
1266
1266
 
1267
1267
  //#endregion
1268
1268
  //#region src/utils/misc.utils.ts
1269
- function humanizedData(date) {
1270
- return `${date.getFullYear()}-${[
1271
- "Jan",
1272
- "Feb",
1273
- "Mar",
1274
- "Apr",
1275
- "May",
1276
- "Jun",
1277
- "Jul",
1278
- "Aug",
1279
- "Sep",
1280
- "Oct",
1281
- "Nov",
1282
- "Dec"
1283
- ][date.getMonth()]}-${date.getDate().toString().padStart(2, "0")} ${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}`;
1269
+ function humanizedData(date, format) {
1270
+ return dayjs(date).format(format || "YYYY-MMM-DD HH:mm:ss");
1284
1271
  }
1285
1272
  function normalizedDate(date) {
1286
1273
  return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")} ${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}`;
@@ -1458,9 +1445,10 @@ var TemplateData = class {
1458
1445
  _defineProperty(this, "section_item", {});
1459
1446
  _defineProperty(this, "printer_name", "");
1460
1447
  _defineProperty(this, "printed_at", /* @__PURE__ */ new Date());
1461
- _defineProperty(this, "normalized_printed_at", humanizedData(this.printed_at));
1448
+ _defineProperty(this, "normalized_printed_at", "");
1462
1449
  _defineProperty(this, "meta", {});
1463
1450
  _defineProperty(this, "is_cancel", false);
1451
+ this.normalized_printed_at = humanizedData(this.printed_at);
1464
1452
  }
1465
1453
  };
1466
1454
  var RenderPrintTemplateOptions = class {
@@ -1933,6 +1921,7 @@ var Config = class {
1933
1921
  _defineProperty(this, "kds", new KdsConfig());
1934
1922
  _defineProperty(this, "label", new LabelConfig());
1935
1923
  _defineProperty(this, "order", new OrderConfig());
1924
+ _defineProperty(this, "ods", new OrderDisplaySystemConfig());
1936
1925
  _defineProperty(this, "payment", new PaymentConfig());
1937
1926
  _defineProperty(this, "user", new UserConfig());
1938
1927
  _defineProperty(this, "tax", new TaxConfig());
@@ -2062,6 +2051,12 @@ var OrderConfig = class {
2062
2051
  _defineProperty(this, "hide_combo_item_on_interactive_view", false);
2063
2052
  _defineProperty(this, "hide_categories_when_ordering", false);
2064
2053
  _defineProperty(this, "end_shift_with_open_tables", false);
2054
+ _defineProperty(this, "datetime_format", "YYYY-MMM-DD HH:mm:ss");
2055
+ }
2056
+ };
2057
+ var OrderDisplaySystemConfig = class {
2058
+ constructor() {
2059
+ _defineProperty(this, "language", "en");
2065
2060
  }
2066
2061
  };
2067
2062
  var PaymentConfig = class {
@@ -3463,7 +3458,8 @@ var InvoiceOperationService = class extends LineOperationService {
3463
3458
  this.addEmployeeToInvoice(invoice, employee);
3464
3459
  invoice.created_at = /* @__PURE__ */ new Date();
3465
3460
  invoice.created_at_timestamp = invoice.created_at.getTime();
3466
- invoice.humanized_created_at = humanizedData(invoice.created_at);
3461
+ const datetimeFormat = (await this.configService.getDefaultOne()).config?.order?.datetime_format;
3462
+ invoice.humanized_created_at = humanizedData(invoice.created_at, datetimeFormat);
3467
3463
  sectionItem.invoice_created_at = /* @__PURE__ */ new Date();
3468
3464
  const kitchenPrintJobs = await this.createKitchenPrintJobs(invoice);
3469
3465
  const labelPrintJobs = await this.createLabelPrintJobs(invoice);
@@ -3662,7 +3658,8 @@ var InvoiceOperationService = class extends LineOperationService {
3662
3658
  sectionItem.status = SectionItemStatus.CLOSED;
3663
3659
  this.addEmployeeToInvoice(invoice, employee);
3664
3660
  invoice.paid_at = /* @__PURE__ */ new Date();
3665
- invoice.humanized_paid_at = humanizedData(invoice.paid_at);
3661
+ const datetimeFormat = (await this.configService.getDefaultOne()).config?.order?.datetime_format;
3662
+ invoice.humanized_paid_at = humanizedData(invoice.paid_at, datetimeFormat);
3666
3663
  invoice.payment_has_cash = invoice.payments?.some((payment) => payment.payment_method?.is_cash === true);
3667
3664
  const stockChanges = await this.getStockChangeList(invoice, false);
3668
3665
  const labelPrintJobs = await this.createLabelPrintJobs(invoice);
@@ -3715,10 +3712,11 @@ var InvoiceOperationService = class extends LineOperationService {
3715
3712
  invoice.status = InvoiceStatus.Paid;
3716
3713
  if (employee != null) this.addEmployeeToInvoice(invoice, employee);
3717
3714
  invoice.paid_at = /* @__PURE__ */ new Date();
3718
- invoice.humanized_paid_at = humanizedData(invoice.paid_at);
3715
+ const datetimeFormat = (await this.configService.getDefaultOne()).config?.order?.datetime_format;
3716
+ invoice.humanized_paid_at = humanizedData(invoice.paid_at, datetimeFormat);
3719
3717
  invoice.created_at = /* @__PURE__ */ new Date();
3720
3718
  invoice.created_at_timestamp = invoice.created_at.getTime();
3721
- invoice.humanized_created_at = humanizedData(invoice.created_at);
3719
+ invoice.humanized_created_at = humanizedData(invoice.created_at, datetimeFormat);
3722
3720
  if (!invoice.ref_id) invoice.ref_id = await this.getRefId();
3723
3721
  if (!invoice.call_num) invoice.call_num = invoice.ref_id.slice(-3);
3724
3722
  invoice.payment_has_cash = invoice.payments?.some((payment) => payment.payment_method?.is_cash === true);
@@ -3763,7 +3761,8 @@ var InvoiceOperationService = class extends LineOperationService {
3763
3761
  const originalStatus = invoice.status;
3764
3762
  invoice.status = InvoiceStatus.Void;
3765
3763
  invoice.voided_at = /* @__PURE__ */ new Date();
3766
- invoice.humanized_voided_at = humanizedData(invoice.voided_at);
3764
+ const datetimeFormat = (await this.configService.getDefaultOne()).config?.order?.datetime_format;
3765
+ invoice.humanized_voided_at = humanizedData(invoice.voided_at, datetimeFormat);
3767
3766
  if (till) till.deleted_at = /* @__PURE__ */ new Date();
3768
3767
  this.addEmployeeToInvoice(invoice, employee);
3769
3768
  const config = (await this.configService.getDefaultOne()).config;
@@ -4909,12 +4908,12 @@ var AppReportService = class extends AppRemoteService {
4909
4908
  if (!printer) throw new SystemError("No default receipt printer found");
4910
4909
  const template = await this.printTemplateService.getOneByParams({ report_code_name: request.report_code_name });
4911
4910
  if (!template) throw new SystemError("No print template found");
4912
- const reportData = await this.getReportData(request);
4913
4911
  const appConfig = await this.configService.getDefaultOne();
4912
+ const reportData = await this.getReportData(request, appConfig.config?.order?.datetime_format);
4914
4913
  const printJob = new PrintJob(printer, await this.printTemplateService.renderReportPrintTemplate(reportData, appConfig.config, template), false, request.copies);
4915
4914
  await this.printJobService.addOne(printJob);
4916
4915
  }
4917
- async getReportData(request) {
4916
+ async getReportData(request, datetimeFormat) {
4918
4917
  const reportData = new ReportData();
4919
4918
  if (request.shift_uid) {
4920
4919
  await this.db.table("shifts").where("uid").equals(request.shift_uid).and((shift) => shift.deleted_at == null || shift.deleted_at == void 0).first();
@@ -4932,9 +4931,9 @@ var AppReportService = class extends AppRemoteService {
4932
4931
  }
4933
4932
  reportData.start_datetime = new Date(request.start_datetime).toISOString();
4934
4933
  reportData.end_datetime = new Date(request.end_datetime).toISOString();
4935
- reportData.humanized_start_datetime = humanizedData(new Date(request.start_datetime));
4936
- reportData.humanized_end_datetime = humanizedData(new Date(request.end_datetime));
4937
- reportData.humanized_printed_datetime = humanizedData(/* @__PURE__ */ new Date());
4934
+ reportData.humanized_start_datetime = humanizedData(new Date(request.start_datetime), datetimeFormat);
4935
+ reportData.humanized_end_datetime = humanizedData(new Date(request.end_datetime), datetimeFormat);
4936
+ reportData.humanized_printed_datetime = humanizedData(/* @__PURE__ */ new Date(), datetimeFormat);
4938
4937
  const query = new QueryBuilder().addParam("paid_at", "GreaterThanOrEqualTo", new Date(request.start_datetime).toISOString()).addParam("paid_at", "LessThanOrEqualTo", new Date(request.end_datetime).toISOString()).addParam("deleted_at", "IsNull", true).includeTotal(true);
4939
4938
  const invoices = (await this.invoiceService.autoQuery(query)).results || [];
4940
4939
  return this.processReportInvoicesData(reportData, invoices);
@@ -5272,6 +5271,7 @@ var PrintTemplateService = class extends AppRemoteService {
5272
5271
  const templateData = new TemplateData();
5273
5272
  templateData.invoice = invoice;
5274
5273
  templateData.config = config;
5274
+ templateData.normalized_printed_at = humanizedData(templateData.printed_at, config?.order?.datetime_format);
5275
5275
  templateData.printer_name = options.printer_name;
5276
5276
  if (options.is_cancel) templateData.is_cancel = options.is_cancel;
5277
5277
  printCommand.items.push(...await this.renderPrintCommand(template.header, templateData));
@@ -5284,6 +5284,7 @@ var PrintTemplateService = class extends AppRemoteService {
5284
5284
  const templateData = new TemplateData();
5285
5285
  templateData.report_data = reportData;
5286
5286
  templateData.config = config;
5287
+ templateData.normalized_printed_at = humanizedData(templateData.printed_at, config?.order?.datetime_format);
5287
5288
  printCommand.codepage = template.codepage || Codepages.SimplifiedChinese;
5288
5289
  printCommand.items.push(...await this.renderPrintCommand(template.header, templateData));
5289
5290
  printCommand.items.push(...await this.renderPrintCommand(template.body, templateData));
@@ -5941,5 +5942,5 @@ var Menu = class extends AppBaseModel {
5941
5942
  };
5942
5943
 
5943
5944
  //#endregion
5944
- export { Address, AppBaseModel, AppConfig, AppCoreModel, AppCoreService, AppExtraModel, AppLocalService, AppMiscService, AppRemoteService, AppReport, AppReportService, Applying, AssetTags, AssetType, Between, Cache, CalcFlow, CalcType, CardPaymentCode, CashDrawerConfig, Category, CategorySalesSummary, CategoryService, CategoryType, Charge, ChargeConfig, Codepages, ComboGroup, ComboGroupItem, Condition, Config, ConfigService, CoreCategory, CoreItem, Coupon, CouponItemized, CouponUsage, CurrencyConfig, Customer, CustomerDisplaySystemConfig, DeployChannel, Device, DeviceType, DiscountType, DrawerSummary, ElectronSocket, Employee, EmployeeRole, EmployeeRoleService, EmployeeService, ErrorMsgs, EscPosCompatibility, EscPosPrinter, FileUploadRequest, GTOConfig, GeneralConfig, In, Include, InventoryConfig, Invoice, InvoiceAction, InvoiceActivity, InvoiceBaseService, InvoiceCharge, InvoiceCoreLine, InvoiceDiscount, InvoiceLine, InvoiceOperationService, InvoiceService, InvoiceStatus, InvoiceType, Item, ItemSalesSummary, ItemService, KdsConfig, KioskSystemConfig, KitchenConfig, LabelConfig, LineOperationService, LoyaltyProgram, LoyaltyProgramSummary, MarketingConfig, Menu, MenuService, Merchant, MessageType, ModelPrefix, ModelType, ModifierSalesSummary, Node, NodePrinter, Not, Note, NoteEntity, NoteGroup, NoteGroupEntity, OnlineOrderConfig, OrderConfig, OrderDisplay, OrderDisplayService, OrderDisplayStatus, OrderFlow, PaxConfig, Payment, PaymentConfig, PaymentMethod, PaymentMethodHistory, PaymentMethodService, PaymentService, PaymentStatus, PaymentSummary, PaynowMethod, Price, PrintAlign, PrintBarcode, PrintCommand, PrintImage, PrintJob, PrintJobService, PrintJobStatus, PrintQrcode, PrintSize, PrintStyle, PrintTemplate, PrintTemplateCore, PrintTemplateService, PrintType, Printer, PrinterConnections, PrinterProtocols, PrinterService, PrinterStatus, PrinterType, ProductBase, ProductService, ProductType, PushData, Raw, Receipt, RenderPrintTemplateOptions, Report, ReportCategory, ReportConfig, ReportData, ReportType, RoundingConfig, SalesSummary, Section, SectionItem, SectionItemService, SectionItemStatus, SectionService, ServiceFactory, ServiceMode, ServiceOptions, Shift, ShiftService, ShiftStatus, StandardPaymentMethod, StockChange, Storage, StorageService, Subcategory, System, SystemError, TaxConfig, TaxMethod, TemplateData, Till, TillConfig, TillService, TillType, UomType, User, UserConfig, Visibility, createCSVExport, dbSchemas, filterByParams, humanizedData, importFromCSV, normalizedDate, transformer };
5945
+ export { Address, AppBaseModel, AppConfig, AppCoreModel, AppCoreService, AppExtraModel, AppLocalService, AppMiscService, AppRemoteService, AppReport, AppReportService, Applying, AssetTags, AssetType, Between, Cache, CalcFlow, CalcType, CardPaymentCode, CashDrawerConfig, Category, CategorySalesSummary, CategoryService, CategoryType, Charge, ChargeConfig, Codepages, ComboGroup, ComboGroupItem, Condition, Config, ConfigService, CoreCategory, CoreItem, Coupon, CouponItemized, CouponUsage, CurrencyConfig, Customer, CustomerDisplaySystemConfig, DeployChannel, Device, DeviceType, DiscountType, DrawerSummary, ElectronSocket, Employee, EmployeeRole, EmployeeRoleService, EmployeeService, ErrorMsgs, EscPosCompatibility, EscPosPrinter, FileUploadRequest, GTOConfig, GeneralConfig, In, Include, InventoryConfig, Invoice, InvoiceAction, InvoiceActivity, InvoiceBaseService, InvoiceCharge, InvoiceCoreLine, InvoiceDiscount, InvoiceLine, InvoiceOperationService, InvoiceService, InvoiceStatus, InvoiceType, Item, ItemSalesSummary, ItemService, KdsConfig, KioskSystemConfig, KitchenConfig, LabelConfig, LineOperationService, LoyaltyProgram, LoyaltyProgramSummary, MarketingConfig, Menu, MenuService, Merchant, MessageType, ModelPrefix, ModelType, ModifierSalesSummary, Node, NodePrinter, Not, Note, NoteEntity, NoteGroup, NoteGroupEntity, OnlineOrderConfig, OrderConfig, OrderDisplay, OrderDisplayService, OrderDisplayStatus, OrderDisplaySystemConfig, OrderFlow, PaxConfig, Payment, PaymentConfig, PaymentMethod, PaymentMethodHistory, PaymentMethodService, PaymentService, PaymentStatus, PaymentSummary, PaynowMethod, Price, PrintAlign, PrintBarcode, PrintCommand, PrintImage, PrintJob, PrintJobService, PrintJobStatus, PrintQrcode, PrintSize, PrintStyle, PrintTemplate, PrintTemplateCore, PrintTemplateService, PrintType, Printer, PrinterConnections, PrinterProtocols, PrinterService, PrinterStatus, PrinterType, ProductBase, ProductService, ProductType, PushData, Raw, Receipt, RenderPrintTemplateOptions, Report, ReportCategory, ReportConfig, ReportData, ReportType, RoundingConfig, SalesSummary, Section, SectionItem, SectionItemService, SectionItemStatus, SectionService, ServiceFactory, ServiceMode, ServiceOptions, Shift, ShiftService, ShiftStatus, StandardPaymentMethod, StockChange, Storage, StorageService, Subcategory, System, SystemError, TaxConfig, TaxMethod, TemplateData, Till, TillConfig, TillService, TillType, UomType, User, UserConfig, Visibility, createCSVExport, dbSchemas, filterByParams, humanizedData, importFromCSV, normalizedDate, transformer };
5945
5946
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.331",
3
+ "version": "5.5.333",
4
4
  "description": "POSX core libraries",
5
5
  "main": "./build/index.js",
6
6
  "author": "Steven Lee",
@@ -19,7 +19,7 @@
19
19
  "buffer": "6.0.3",
20
20
  "crypto-browserify": "3.12.0",
21
21
  "crypto-js": "4.2.0",
22
- "dayjs": "1.11.10",
22
+ "dayjs": "^1.11.10",
23
23
  "dexie": "3.2.4",
24
24
  "esc-pos-encoder-ionic": "1.1.3",
25
25
  "handlebars": "4.7.8",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.331",
3
+ "version": "5.5.333",
4
4
  "description": "POSX core libraries",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -92,7 +92,7 @@
92
92
  "buffer": "6.0.3",
93
93
  "crypto-browserify": "3.12.0",
94
94
  "crypto-js": "4.2.0",
95
- "dayjs": "1.11.10",
95
+ "dayjs": "^1.11.10",
96
96
  "dexie": "3.2.4",
97
97
  "esc-pos-encoder-ionic": "1.1.3",
98
98
  "handlebars": "4.7.8",