@zeniai/client-epic-state 5.3.6-beta0KB → 5.3.6-beta1KB
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/lib/esm/view/transactionDetail/createTransaction/createTransactionPayload.js +5 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionPayload.d.ts +5 -2
- package/lib/view/transactionDetail/createTransaction/createTransactionPayload.js +5 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionState.d.ts +1 -1
- package/package.json +1 -1
|
@@ -128,6 +128,9 @@ export const prepareCreateTransactionPayload = (state, localData) => {
|
|
|
128
128
|
if (transactionType === 'journal_entry') {
|
|
129
129
|
return {
|
|
130
130
|
...base,
|
|
131
|
+
...(localData.documentNumber != null && {
|
|
132
|
+
document_id: localData.documentNumber,
|
|
133
|
+
}),
|
|
131
134
|
lines,
|
|
132
135
|
};
|
|
133
136
|
}
|
|
@@ -141,6 +144,8 @@ export const prepareCreateTransactionPayload = (state, localData) => {
|
|
|
141
144
|
if (transactionType === 'check') {
|
|
142
145
|
return {
|
|
143
146
|
...purchaseBase,
|
|
147
|
+
// The form has no payment method field for a check; qbo_purchase.py still requires it.
|
|
148
|
+
payment_type: 'check',
|
|
144
149
|
document_number: localData.documentNumber,
|
|
145
150
|
print_status: localData.printStatus,
|
|
146
151
|
remit_to_address: toRemitToAddressPayload(localData.remitToAddress),
|
|
@@ -12,8 +12,9 @@ import { CreateTransactionLocalData } from './createTransactionState';
|
|
|
12
12
|
* 1. `line_detail_type` is snake_case. The PascalCase strings in the backend are Python
|
|
13
13
|
* constant NAMES; ZENI_LINE_DETAIL_TYPE_TO_QBO_LINE_DETAIL_TYPE_MAP converts them for the
|
|
14
14
|
* body the backend sends on to QuickBooks, never for ours.
|
|
15
|
-
* 2.
|
|
16
|
-
* `document_number
|
|
15
|
+
* 2. The QBO Purchases (check, credit_card_credit) send their reference number as
|
|
16
|
+
* `document_number`; a journal entry sends its entry name as `document_id`. Both land on
|
|
17
|
+
* QBO's DocNumber, but QBOJournalEntry reads only `document_id`.
|
|
17
18
|
*/
|
|
18
19
|
export interface CreateTransactionAccountPayload {
|
|
19
20
|
qbo_id: ID;
|
|
@@ -51,6 +52,8 @@ export interface CreateTransactionRemitToAddressPayload {
|
|
|
51
52
|
export interface CreateTransactionRequest extends Record<string, unknown> {
|
|
52
53
|
transaction_date: string;
|
|
53
54
|
transaction_type: string;
|
|
55
|
+
/** journal_entry entry name (QBO DocNumber). */
|
|
56
|
+
document_id?: string;
|
|
54
57
|
/** check / credit_card_credit reference number (QBO Purchase). */
|
|
55
58
|
document_number?: string;
|
|
56
59
|
from_account_id?: ID;
|
|
@@ -132,6 +132,9 @@ const prepareCreateTransactionPayload = (state, localData) => {
|
|
|
132
132
|
if (transactionType === 'journal_entry') {
|
|
133
133
|
return {
|
|
134
134
|
...base,
|
|
135
|
+
...(localData.documentNumber != null && {
|
|
136
|
+
document_id: localData.documentNumber,
|
|
137
|
+
}),
|
|
135
138
|
lines,
|
|
136
139
|
};
|
|
137
140
|
}
|
|
@@ -145,6 +148,8 @@ const prepareCreateTransactionPayload = (state, localData) => {
|
|
|
145
148
|
if (transactionType === 'check') {
|
|
146
149
|
return {
|
|
147
150
|
...purchaseBase,
|
|
151
|
+
// The form has no payment method field for a check; qbo_purchase.py still requires it.
|
|
152
|
+
payment_type: 'check',
|
|
148
153
|
document_number: localData.documentNumber,
|
|
149
154
|
print_status: localData.printStatus,
|
|
150
155
|
remit_to_address: toRemitToAddressPayload(localData.remitToAddress),
|
|
@@ -54,7 +54,7 @@ export interface CreateTransactionLocalData {
|
|
|
54
54
|
/** Empty for transfer, which has no lines at all. */
|
|
55
55
|
lines: CreateTransactionLineLocalData[];
|
|
56
56
|
transactionType: CreatableTransactionType;
|
|
57
|
-
/** check / credit_card_credit reference number. */
|
|
57
|
+
/** check / credit_card_credit reference number, or the journal_entry entry name. */
|
|
58
58
|
documentNumber?: string;
|
|
59
59
|
/** transfer */
|
|
60
60
|
fromAccountId?: ID;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.3.6-
|
|
3
|
+
"version": "5.3.6-beta1KB",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|