seperate sequences (invoices - stock Moves)
This commit is contained in:
@@ -571,8 +571,25 @@ public class StockMoveInvoiceServiceImpl implements StockMoveInvoiceService {
|
||||
AccountConfigService accountConfigService = Beans.get(AccountConfigService.class);
|
||||
|
||||
AccountConfig accountConfig = accountConfigService.getAccountConfig(invoice.getCompany());
|
||||
switch (invoice.getOperationTypeSelect()) {
|
||||
case InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE:
|
||||
return accountConfigService.getSuppInvSequence(accountConfig);
|
||||
|
||||
case InvoiceRepository.OPERATION_TYPE_SUPPLIER_REFUND:
|
||||
return accountConfigService.getSuppRefSequence(accountConfig);
|
||||
|
||||
case InvoiceRepository.OPERATION_TYPE_CLIENT_SALE:
|
||||
return accountConfigService.getCustInvSequence(accountConfig);
|
||||
|
||||
case InvoiceRepository.OPERATION_TYPE_CLIENT_REFUND:
|
||||
return accountConfigService.getCustRefSequence(accountConfig);
|
||||
|
||||
default:
|
||||
throw new AxelorException(
|
||||
invoice,
|
||||
TraceBackRepository.CATEGORY_MISSING_FIELD,
|
||||
I18n.get("Invoice type missing %s"),
|
||||
invoice.getInvoiceId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user