mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
fix: payment receive & made in edit mode.
This commit is contained in:
@@ -24,6 +24,7 @@ export const defaultPaymentMade = {
|
|||||||
reference: '',
|
reference: '',
|
||||||
payment_number: '',
|
payment_number: '',
|
||||||
// statement: '',
|
// statement: '',
|
||||||
|
currency_code: '',
|
||||||
entries: [],
|
entries: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export const defaultPaymentReceiveEntry = {
|
|||||||
due_amount: '',
|
due_amount: '',
|
||||||
date: '',
|
date: '',
|
||||||
amount: '',
|
amount: '',
|
||||||
|
currency_code: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Form initial values.
|
// Form initial values.
|
||||||
@@ -22,11 +23,12 @@ export const defaultPaymentReceive = {
|
|||||||
payment_receive_no: '',
|
payment_receive_no: '',
|
||||||
statement: '',
|
statement: '',
|
||||||
full_amount: '',
|
full_amount: '',
|
||||||
|
currency_code: '',
|
||||||
entries: [],
|
entries: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export const transformToEditForm = (paymentReceive, paymentReceiveEntries) => ({
|
export const transformToEditForm = (paymentReceive, paymentReceiveEntries) => ({
|
||||||
...transformToForm(paymentReceive, defaultPaymentReceive),
|
...transformToForm(paymentReceive, defaultPaymentReceive),
|
||||||
@@ -50,7 +52,7 @@ export const transformInvoicesNewPageEntries = (invoices) => [
|
|||||||
due_amount: invoice.due_amount,
|
due_amount: invoice.due_amount,
|
||||||
date: invoice.invoice_date,
|
date: invoice.invoice_date,
|
||||||
amount: invoice.balance,
|
amount: invoice.balance,
|
||||||
currency_code:invoice.currency_code,
|
currency_code: invoice.currency_code,
|
||||||
payment_amount: '',
|
payment_amount: '',
|
||||||
invoice_no: invoice.invoice_no,
|
invoice_no: invoice.invoice_no,
|
||||||
total_payment_amount: invoice.payment_amount,
|
total_payment_amount: invoice.payment_amount,
|
||||||
@@ -84,16 +86,16 @@ export const fullAmountPaymentEntries = (entries) => {
|
|||||||
...item,
|
...item,
|
||||||
payment_amount: item.due_amount,
|
payment_amount: item.due_amount,
|
||||||
}));
|
}));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syncs payment receive number settings with form.
|
* Syncs payment receive number settings with form.
|
||||||
*/
|
*/
|
||||||
export const useObservePaymentNoSettings = (prefix, nextNumber) => {
|
export const useObservePaymentNoSettings = (prefix, nextNumber) => {
|
||||||
const { setFieldValue } = useFormikContext();
|
const { setFieldValue } = useFormikContext();
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const invoiceNo = transactionNumber(prefix, nextNumber);
|
const invoiceNo = transactionNumber(prefix, nextNumber);
|
||||||
setFieldValue('payment_receive_no', invoiceNo);
|
setFieldValue('payment_receive_no', invoiceNo);
|
||||||
}, [setFieldValue, prefix, nextNumber]);
|
}, [setFieldValue, prefix, nextNumber]);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user