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);
|
Invoice invoice = request.getContext().asType(Invoice.class);
|
||||||
Company company = invoice.getCompany();
|
Company company = invoice.getCompany();
|
||||||
Partner partner = invoice.getPartner();
|
Partner partner = invoice.getPartner();
|
||||||
PartnerCategory partnerCategory = partner.getPartnerCategory();
|
|
||||||
Journal journal = null ;
|
Journal journal = null ;
|
||||||
Integer operationTypeSelect = invoice.getOperationTypeSelect();
|
Integer operationTypeSelect = invoice.getOperationTypeSelect();
|
||||||
|
|
||||||
if (company != null && partner != null && operationTypeSelect != null ) {
|
if (company != null && partner != null && operationTypeSelect != null ) {
|
||||||
if (operationTypeSelect.intValue() == InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE) {
|
if (operationTypeSelect.intValue() == InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE) {
|
||||||
if( partnerCategory != null){
|
if( partner.getTypeOfSupplier() != null){
|
||||||
if(partnerCategory.getCode().equals("FRETG")){
|
if(partner.getTypeOfSupplier().equals("1")){
|
||||||
journal = company.getAccountConfig().getSupplierPurchaseJournalForeigners();
|
journal = company.getAccountConfig().getSupplierPurchaseJournalForeigners();
|
||||||
}
|
}
|
||||||
if(partnerCategory.getCode().equals("FRLOC")){
|
if(partner.getTypeOfSupplier().equals("2")){
|
||||||
journal = company.getAccountConfig().getSupplierPurchaseJournalLocal();
|
journal = company.getAccountConfig().getSupplierPurchaseJournalLocal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
<string name="proformaComments" title="Comment to display on proforma" large="true"/>
|
<string name="proformaComments" title="Comment to display on proforma" large="true"/>
|
||||||
|
|
||||||
<many-to-one name="barCodeSeq" title="Barcode" ref="com.axelor.meta.db.MetaFile" />
|
<many-to-one name="barCodeSeq" title="Barcode" ref="com.axelor.meta.db.MetaFile" />
|
||||||
|
<string name="typeOfSupplier" title="Type of supplier" selection="partner.supplier.type.select"/>
|
||||||
|
|
||||||
<finder-method name="findByUser" using="user"/>
|
<finder-method name="findByUser" using="user"/>
|
||||||
|
|
||||||
|
|||||||
@@ -502,5 +502,10 @@
|
|||||||
<option value="asc">Ascending</option>
|
<option value="asc">Ascending</option>
|
||||||
<option value="desc">Descending</option>
|
<option value="desc">Descending</option>
|
||||||
</selection>
|
</selection>
|
||||||
|
|
||||||
|
<selection name="partner.supplier.type.select">
|
||||||
|
<option value="1">FOURNISSEURS ETRANGERS</option>
|
||||||
|
<option value="2">FOURNISSEURS LOCAL</option>
|
||||||
|
</selection>
|
||||||
|
|
||||||
</object-views>
|
</object-views>
|
||||||
|
|||||||
Reference in New Issue
Block a user