@posx/core 5.5.363 → 5.5.365
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 +11 -9
- package/build/index.js +7 -9
- package/package.json +1 -1
- package/package.publish.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -2725,15 +2725,15 @@ interface IInvoiceCoreLine {
|
|
|
2725
2725
|
unit_of_measure: UomType;
|
|
2726
2726
|
/** Quantity if it is quantity, e.g. 5*/
|
|
2727
2727
|
quantity: number;
|
|
2728
|
-
/**
|
|
2729
|
-
/**
|
|
2728
|
+
/** Whether it is sent to server, e.g. send = 3, it means 2 items are not sent to server*/
|
|
2729
|
+
/** item A, qty = 5 sent 3 => kitchen slip will show quantity 2 on item A */
|
|
2730
2730
|
sent: number;
|
|
2731
|
-
/** UI标志,用于Order List区分已下单/未下单,应与 sent > 0 同步 */
|
|
2732
|
-
is_sent: boolean;
|
|
2733
2731
|
/** Whether cancel slip is printed */
|
|
2734
2732
|
is_cancel_printed: boolean;
|
|
2735
2733
|
/** Whether it is selected */
|
|
2736
2734
|
selected: boolean;
|
|
2735
|
+
/** Sales user uid for this line item */
|
|
2736
|
+
sales_user_uid: string;
|
|
2737
2737
|
}
|
|
2738
2738
|
/**
|
|
2739
2739
|
* Represents a line item on an invoice.
|
|
@@ -2863,7 +2863,7 @@ interface IInvoice extends IAppCoreModel {
|
|
|
2863
2863
|
customer_id: number;
|
|
2864
2864
|
/** Remark */
|
|
2865
2865
|
remark: string;
|
|
2866
|
-
/** Sales User
|
|
2866
|
+
/** Sales User UID */
|
|
2867
2867
|
sales_user_uid: string;
|
|
2868
2868
|
/** Status */
|
|
2869
2869
|
status: InvoiceStatus;
|
|
@@ -2944,9 +2944,9 @@ declare class InvoiceCoreLine implements IInvoiceCoreLine {
|
|
|
2944
2944
|
unit_of_measure: UomType;
|
|
2945
2945
|
quantity: number;
|
|
2946
2946
|
sent: number;
|
|
2947
|
-
is_sent: boolean;
|
|
2948
2947
|
is_cancel_printed: boolean;
|
|
2949
2948
|
selected: boolean;
|
|
2949
|
+
sales_user_uid: string;
|
|
2950
2950
|
constructor();
|
|
2951
2951
|
}
|
|
2952
2952
|
declare class InvoiceLine extends AppCoreModel implements IInvoiceLine {
|
|
@@ -2974,9 +2974,9 @@ declare class InvoiceLine extends AppCoreModel implements IInvoiceLine {
|
|
|
2974
2974
|
modifiers: any[];
|
|
2975
2975
|
duplicated_from_uid: string;
|
|
2976
2976
|
sent: number;
|
|
2977
|
-
is_sent: boolean;
|
|
2978
2977
|
is_cancel_printed: boolean;
|
|
2979
2978
|
selected: boolean;
|
|
2979
|
+
sales_user_uid: string;
|
|
2980
2980
|
meta: {};
|
|
2981
2981
|
constructor();
|
|
2982
2982
|
}
|
|
@@ -4281,6 +4281,8 @@ interface IEmployee extends IAppCoreModel {
|
|
|
4281
4281
|
role_uid: string;
|
|
4282
4282
|
/** language preference */
|
|
4283
4283
|
language: string;
|
|
4284
|
+
/** Whether employee can login to the system */
|
|
4285
|
+
can_login: boolean;
|
|
4284
4286
|
}
|
|
4285
4287
|
declare class Employee extends AppCoreModel implements IEmployee {
|
|
4286
4288
|
user_uid: string;
|
|
@@ -4290,6 +4292,7 @@ declare class Employee extends AppCoreModel implements IEmployee {
|
|
|
4290
4292
|
uid: string;
|
|
4291
4293
|
role_uid: string;
|
|
4292
4294
|
language: string;
|
|
4295
|
+
can_login: boolean;
|
|
4293
4296
|
constructor();
|
|
4294
4297
|
}
|
|
4295
4298
|
//#endregion
|
|
@@ -5097,7 +5100,6 @@ type LineOptions = {
|
|
|
5097
5100
|
quantity?: number;
|
|
5098
5101
|
price?: number;
|
|
5099
5102
|
remark?: string;
|
|
5100
|
-
is_sent?: boolean;
|
|
5101
5103
|
};
|
|
5102
5104
|
declare class InvoiceBaseService extends AppRemoteService<IInvoice> implements IInvoiceBaseService {
|
|
5103
5105
|
readonly http: AxiosInstance;
|
|
@@ -5386,7 +5388,7 @@ declare class LineOperationService extends InvoiceBaseService implements ILineOp
|
|
|
5386
5388
|
addModifierQuantity(modifiers: IInvoiceCoreLine[], modifier: IInvoiceCoreLine, quantity?: number): IInvoiceCoreLine[];
|
|
5387
5389
|
changeModifierPrice(modifier: IInvoiceCoreLine, price: number): IInvoiceCoreLine;
|
|
5388
5390
|
overwriteNoteToLine(line: IInvoiceLine, note: string): IInvoiceLine;
|
|
5389
|
-
findOrCreateLine(invoice: IInvoice, item: IItem, quantity: number, price?: number, modifiers?: IInvoiceCoreLine[], remark?: string, createNewLine?: boolean, comboLineUid?: string, comboGroupUid?: string
|
|
5391
|
+
findOrCreateLine(invoice: IInvoice, item: IItem, quantity: number, price?: number, modifiers?: IInvoiceCoreLine[], remark?: string, createNewLine?: boolean, comboLineUid?: string, comboGroupUid?: string): IInvoiceLine;
|
|
5390
5392
|
private createInvoiceLine;
|
|
5391
5393
|
protected compareModifiers(target: IInvoiceCoreLine[], source: IInvoiceCoreLine[]): boolean;
|
|
5392
5394
|
/**
|
package/build/index.js
CHANGED
|
@@ -1715,9 +1715,9 @@ var InvoiceCoreLine = class {
|
|
|
1715
1715
|
_defineProperty(this, "unit_of_measure", UomType.quantity);
|
|
1716
1716
|
_defineProperty(this, "quantity", 0);
|
|
1717
1717
|
_defineProperty(this, "sent", 0);
|
|
1718
|
-
_defineProperty(this, "is_sent", false);
|
|
1719
1718
|
_defineProperty(this, "is_cancel_printed", false);
|
|
1720
1719
|
_defineProperty(this, "selected", false);
|
|
1720
|
+
_defineProperty(this, "sales_user_uid", "");
|
|
1721
1721
|
}
|
|
1722
1722
|
};
|
|
1723
1723
|
var InvoiceLine = class extends AppCoreModel {
|
|
@@ -1747,9 +1747,9 @@ var InvoiceLine = class extends AppCoreModel {
|
|
|
1747
1747
|
_defineProperty(this, "modifiers", []);
|
|
1748
1748
|
_defineProperty(this, "duplicated_from_uid", "");
|
|
1749
1749
|
_defineProperty(this, "sent", 0);
|
|
1750
|
-
_defineProperty(this, "is_sent", false);
|
|
1751
1750
|
_defineProperty(this, "is_cancel_printed", false);
|
|
1752
1751
|
_defineProperty(this, "selected", false);
|
|
1752
|
+
_defineProperty(this, "sales_user_uid", "");
|
|
1753
1753
|
_defineProperty(this, "meta", {});
|
|
1754
1754
|
}
|
|
1755
1755
|
};
|
|
@@ -1843,6 +1843,7 @@ var Employee = class extends AppCoreModel {
|
|
|
1843
1843
|
_defineProperty(this, "uid", ModelPrefix.Employee + nanoid());
|
|
1844
1844
|
_defineProperty(this, "role_uid", "");
|
|
1845
1845
|
_defineProperty(this, "language", "en");
|
|
1846
|
+
_defineProperty(this, "can_login", true);
|
|
1846
1847
|
}
|
|
1847
1848
|
};
|
|
1848
1849
|
|
|
@@ -3624,7 +3625,7 @@ var LineOperationService = class extends InvoiceBaseService {
|
|
|
3624
3625
|
...lineOptions
|
|
3625
3626
|
};
|
|
3626
3627
|
if (invoice.lines == null) invoice.lines = [];
|
|
3627
|
-
const line = this.findOrCreateLine(invoice, item, options.quantity, options.price, modifiers, options.remark, createNewLine, comboLineUid, comboGroupUid
|
|
3628
|
+
const line = this.findOrCreateLine(invoice, item, options.quantity, options.price, modifiers, options.remark, createNewLine, comboLineUid, comboGroupUid);
|
|
3628
3629
|
if (item.type == ProductType.Combo) line.is_combo = true;
|
|
3629
3630
|
if (line.uid) {
|
|
3630
3631
|
line.quantity += options.quantity;
|
|
@@ -3745,7 +3746,7 @@ var LineOperationService = class extends InvoiceBaseService {
|
|
|
3745
3746
|
line.remark = note;
|
|
3746
3747
|
return line;
|
|
3747
3748
|
}
|
|
3748
|
-
findOrCreateLine(invoice, item, quantity, price = 0, modifiers = [], remark = "", createNewLine = false, comboLineUid, comboGroupUid
|
|
3749
|
+
findOrCreateLine(invoice, item, quantity, price = 0, modifiers = [], remark = "", createNewLine = false, comboLineUid, comboGroupUid) {
|
|
3749
3750
|
price = price ?? item.price;
|
|
3750
3751
|
if (!invoice.lines || invoice.lines.length <= 0 || createNewLine) return this.createInvoiceLine(item, quantity, price, modifiers, remark);
|
|
3751
3752
|
else {
|
|
@@ -3754,7 +3755,7 @@ var LineOperationService = class extends InvoiceBaseService {
|
|
|
3754
3755
|
else {
|
|
3755
3756
|
if (comboLineUid && comboGroupUid) {
|
|
3756
3757
|
for (const line of lines.filter((l) => l.is_combo_item)) if (this.compareModifiers(line.modifiers, modifiers) && line.remark === remark && line.price === price && line.combo_line_uid === comboLineUid && line.combo_group_uid === comboGroupUid) return line;
|
|
3757
|
-
} else for (const line of lines) if (this.compareModifiers(line.modifiers, modifiers) && line.remark === remark && line.price === price && !line.is_take_out
|
|
3758
|
+
} else for (const line of lines) if (this.compareModifiers(line.modifiers, modifiers) && line.remark === remark && line.price === price && !line.is_take_out) return line;
|
|
3758
3759
|
return this.createInvoiceLine(item, quantity, price, modifiers, remark);
|
|
3759
3760
|
}
|
|
3760
3761
|
}
|
|
@@ -4589,10 +4590,7 @@ var InvoiceOperationService = class extends LineOperationService {
|
|
|
4589
4590
|
});
|
|
4590
4591
|
}
|
|
4591
4592
|
async preprocessInvoice(invoice) {
|
|
4592
|
-
if (invoice.lines) for (const line of invoice.lines)
|
|
4593
|
-
line.sent = line.quantity;
|
|
4594
|
-
line.is_sent = true;
|
|
4595
|
-
}
|
|
4593
|
+
if (invoice.lines) for (const line of invoice.lines) line.sent = line.quantity;
|
|
4596
4594
|
return invoice;
|
|
4597
4595
|
}
|
|
4598
4596
|
/**
|
package/package.json
CHANGED