mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat( S&P ): Add currency code in conversion to invoice & credit.
This commit is contained in:
@@ -200,3 +200,14 @@ export const useSetPrimaryBranchToForm = () => {
|
||||
}
|
||||
}, [isBranchesSuccess, setFieldValue, branches]);
|
||||
};
|
||||
|
||||
export const useSetForeignCurrencyToEditForm = () => {
|
||||
const { values } = useFormikContext();
|
||||
const { isNewMode, setSelectCustomer } = useInvoiceFormContext();
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!isNewMode) {
|
||||
setSelectCustomer({ currency_code: values.currency_code });
|
||||
}
|
||||
}, [isNewMode, setSelectCustomer, values]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user