Edit = set Default Purchase Journal for Supplier
This commit is contained in:
@@ -1067,17 +1067,16 @@ public class InvoiceController {
|
||||
Invoice invoice = request.getContext().asType(Invoice.class);
|
||||
Company company = invoice.getCompany();
|
||||
Partner partner = invoice.getPartner();
|
||||
PartnerCategory partnerCategory = partner.getPartnerCategory();
|
||||
Journal journal = null ;
|
||||
Integer operationTypeSelect = invoice.getOperationTypeSelect();
|
||||
|
||||
if (company != null && partner != null && operationTypeSelect != null ) {
|
||||
if (operationTypeSelect.intValue() == InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE) {
|
||||
if( partnerCategory != null){
|
||||
if(partnerCategory.getCode().equals("FRETG")){
|
||||
if( partner.getTypeOfSupplier() != null){
|
||||
if(partner.getTypeOfSupplier().equals("1")){
|
||||
journal = company.getAccountConfig().getSupplierPurchaseJournalForeigners();
|
||||
}
|
||||
if(partnerCategory.getCode().equals("FRLOC")){
|
||||
if(partner.getTypeOfSupplier().equals("2")){
|
||||
journal = company.getAccountConfig().getSupplierPurchaseJournalLocal();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user