mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix: convert sale estimate to invoice.
This commit is contained in:
@@ -7,7 +7,6 @@ import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
||||
import SaleEstimateService from 'services/Sales/SalesEstimate';
|
||||
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
||||
import { ServiceError } from "exceptions";
|
||||
import { Request } from 'express-validator/src/base';
|
||||
|
||||
@Service()
|
||||
export default class SalesEstimatesController extends BaseController {
|
||||
|
||||
@@ -400,6 +400,20 @@ export default class SaleInvoicesController extends BaseController {
|
||||
],
|
||||
});
|
||||
}
|
||||
if (error.errorType === 'SALE_ESTIMATE_NOT_FOUND') {
|
||||
return res.boom.badRequest(null, {
|
||||
errors: [
|
||||
{ type: 'FROM_SALE_ESTIMATE_NOT_FOUND', code: 1200 },
|
||||
],
|
||||
});
|
||||
}
|
||||
if (error.errorType === 'SALE_ESTIMATE_CONVERTED_TO_INVOICE') {
|
||||
return res.boom.badRequest(null, {
|
||||
errors: [
|
||||
{ type: 'SALE_ESTIMATE_IS_ALREADY_CONVERTED_TO_INVOICE', code: 1300 },
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
next(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user