mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: advanced payments
This commit is contained in:
@@ -102,17 +102,6 @@ function PaymentReceiveForm({
|
||||
) => {
|
||||
setSubmitting(true);
|
||||
|
||||
// Calculates the total payment amount of entries.
|
||||
const totalPaymentAmount = sumBy(values.entries, 'payment_amount');
|
||||
|
||||
if (totalPaymentAmount <= 0) {
|
||||
AppToaster.show({
|
||||
message: intl.get('you_cannot_make_payment_with_zero_total_amount'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
setSubmitting(false);
|
||||
return;
|
||||
}
|
||||
// Transformes the form values to request body.
|
||||
const form = transformFormToRequest(values);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ export default function PaymentReceiveHeaderFields() {
|
||||
</FastField>
|
||||
|
||||
{/* ------------ Full amount ------------ */}
|
||||
<Field name={'full_amount'}>
|
||||
<Field name={'amount'}>
|
||||
{({
|
||||
form: {
|
||||
setFieldValue,
|
||||
@@ -146,7 +146,7 @@ export default function PaymentReceiveHeaderFields() {
|
||||
<MoneyInputGroup
|
||||
value={value}
|
||||
onChange={(value) => {
|
||||
setFieldValue('full_amount', value);
|
||||
setFieldValue('amount', value);
|
||||
}}
|
||||
onBlurValue={onFullAmountBlur}
|
||||
/>
|
||||
|
||||
@@ -42,7 +42,7 @@ export const defaultPaymentReceive = {
|
||||
// Holds the payment number that entered manually only.
|
||||
payment_receive_no_manually: '',
|
||||
statement: '',
|
||||
full_amount: '',
|
||||
amount: '',
|
||||
currency_code: '',
|
||||
branch_id: '',
|
||||
exchange_rate: 1,
|
||||
|
||||
Reference in New Issue
Block a user