mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat(sales): currency code associated from invoice customer.
feat(purchases): currency code associated from vendor customer.
This commit is contained in:
@@ -91,6 +91,7 @@ export default class PaymentReceivesController extends BaseController {
|
||||
*/
|
||||
get paymentReceiveSchema(): ValidationChain[] {
|
||||
return [
|
||||
check('customer_id').exists().isNumeric().toInt(),
|
||||
check('payment_date').exists(),
|
||||
check('reference_no').optional(),
|
||||
check('deposit_account_id').exists().isNumeric().toInt(),
|
||||
@@ -132,7 +133,6 @@ export default class PaymentReceivesController extends BaseController {
|
||||
*/
|
||||
get newPaymentReceiveValidation() {
|
||||
return [
|
||||
check('customer_id').exists().isNumeric().toInt(),
|
||||
...this.paymentReceiveSchema,
|
||||
];
|
||||
}
|
||||
@@ -449,6 +449,11 @@ export default class PaymentReceivesController extends BaseController {
|
||||
errors: [{ type: 'PAYMENT_RECEIVE_NO_IS_REQUIRED', code: 1100 }],
|
||||
});
|
||||
}
|
||||
if (error.errorType === 'PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE') {
|
||||
return res.boom.badRequest(null, {
|
||||
errors: [{ type: 'PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE', code: 1200 }],
|
||||
});
|
||||
}
|
||||
}
|
||||
next(error);
|
||||
}
|
||||
|
||||
@@ -301,6 +301,7 @@ export default class SaleInvoicesController extends BaseController {
|
||||
filterMeta,
|
||||
pagination,
|
||||
} = await this.saleInvoiceService.salesInvoicesList(tenantId, filter);
|
||||
|
||||
return res.status(200).send({
|
||||
sales_invoices: salesInvoices,
|
||||
pagination: this.transfromToResponse(pagination),
|
||||
|
||||
Reference in New Issue
Block a user