seperate sequences (invoices - stock Moves)

This commit is contained in:
2023-01-18 08:24:36 +01:00
parent 039a38f0f7
commit 11e5cad88f
12 changed files with 207 additions and 23 deletions

View File

@@ -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());
}
}
}