@tec.pet/tecpet-sdk 0.0.224 → 0.0.225
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.
|
@@ -8,7 +8,7 @@ export declare class InvoiceService {
|
|
|
8
8
|
constructor(api: HttpClient);
|
|
9
9
|
editExternId(invoiceId: string, body: PaEditInvoiceExternIdRequest, shopId: number): Promise<PaEditInvoiceExternIdResponse>;
|
|
10
10
|
registerPdvPayment(invoiceId: string, fiscalInvoiceId: string): Promise<PaRegisterInvoicePdvPaymentResponse>;
|
|
11
|
-
registerPdvPartialPayment(invoiceId: string, fiscalInvoiceIds: string[], amount: number, externalPaymentId?: string): Promise<PaRegisterInvoicePdvPaymentResponse>;
|
|
11
|
+
registerPdvPartialPayment(invoiceId: string, fiscalInvoiceIds: string[], amount: number, externalPaymentId?: string, paidAt?: string): Promise<PaRegisterInvoicePdvPaymentResponse>;
|
|
12
12
|
registerReceivablePayment(invoiceId: string, fiscalInvoiceId: string, body: PaRegisterInvoiceReceivablePaymentRequest): Promise<PaRegisterInvoiceReceivablePaymentResponse>;
|
|
13
13
|
reverseReceivablePayment(externalId: string, body: PaReverseInvoiceReceivablePaymentRequest): Promise<PaReverseInvoiceReceivablePaymentResponse>;
|
|
14
14
|
}
|
|
@@ -12,8 +12,14 @@ class InvoiceService {
|
|
|
12
12
|
async registerPdvPayment(invoiceId, fiscalInvoiceId) {
|
|
13
13
|
return await this.api.post(`/invoice/${invoiceId}/pdvPay/${fiscalInvoiceId}`, {});
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// paidAt: when the sale was paid in the ERP (ISO 8601 with offset). Without it the server dates the payment now.
|
|
16
|
+
async registerPdvPartialPayment(invoiceId, fiscalInvoiceIds, amount, externalPaymentId, paidAt) {
|
|
17
|
+
const body = {
|
|
18
|
+
fiscalInvoiceIds,
|
|
19
|
+
amount,
|
|
20
|
+
...(externalPaymentId ? { externalPaymentId } : {}),
|
|
21
|
+
...(paidAt ? { paidAt } : {}),
|
|
22
|
+
};
|
|
17
23
|
return await this.api.post(`/invoice/${invoiceId}/pdvPayPartial`, body);
|
|
18
24
|
}
|
|
19
25
|
async registerReceivablePayment(invoiceId, fiscalInvoiceId, body) {
|