temporary branch

This commit is contained in:
BACHIR SOULDI
2024-10-17 11:30:20 +01:00
parent cd115a234b
commit 742ec3e75e
212 changed files with 18396 additions and 1899 deletions

View File

@@ -29,20 +29,24 @@ public class PaymentVoucherManagementRepository extends PaymentVoucherRepository
@Override
public PaymentVoucher copy(PaymentVoucher entity, boolean deep) {
/**
* copy set are commented because there is a lot of vouchers that contains the same element to pay but partially
*/
PaymentVoucher copy = super.copy(entity, deep);
copy.setStatusSelect(STATUS_DRAFT);
copy.setRef(null);
copy.setPaymentDate(Beans.get(AppBaseService.class).getTodayDate());
copy.clearPayVoucherDueElementList();
copy.clearPayVoucherElementToPayList();
// copy.clearPayVoucherDueElementList();
// copy.clearPayVoucherElementToPayList();
copy.setGeneratedMove(null);
copy.setBankCardTransactionNumber(null);
copy.clearBatchSet();
copy.setImportId(null);
copy.setReceiptNo(null);
copy.setRemainingAmount(null);
copy.setRemainingAllocatedAmount(null);
// copy.setRemainingAmount(null);
// copy.setRemainingAllocatedAmount(null);
copy.setToSaveEmailOk(false);
copy.setDefaultEmailOk(false);
copy.setEmail(null);

View File

@@ -29,4 +29,5 @@ public interface IReport {
public static final String SUBROGATION_RELEASE = "SubrogationRelease.rptdesign";
public static final String CHEQUE_DEPOSIT_SLIP = "ChequeDepositSlip.rptdesign";
public static final String CASH_DEPOSIT_SLIP = "CashDepositSlip.rptdesign";
public static final String CASH_INVENTORY = "CashInventory%s.rptdesign";
}

View File

@@ -19,17 +19,23 @@ package com.axelor.apps.account.service;
import com.axelor.apps.account.db.Account;
import com.axelor.apps.account.db.AccountConfig;
import com.axelor.apps.account.db.AccountType;
import com.axelor.apps.account.db.AccountingSituation;
import com.axelor.apps.account.db.PaymentMode;
import com.axelor.apps.account.db.repo.AccountConfigRepository;
import com.axelor.apps.account.db.repo.AccountRepository;
import com.axelor.apps.account.db.repo.AccountTypeRepository;
import com.axelor.apps.account.db.repo.AccountingSituationRepository;
import com.axelor.apps.account.exception.IExceptionMessage;
import com.axelor.apps.account.service.app.AppAccountService;
import com.axelor.apps.account.service.config.AccountConfigService;
import com.axelor.apps.account.service.payment.PaymentModeService;
import com.axelor.apps.base.db.AppAccount;
import com.axelor.apps.base.db.BankDetails;
import com.axelor.apps.base.db.Company;
import com.axelor.apps.base.db.Partner;
import com.axelor.apps.base.db.Sequence;
import com.axelor.apps.base.db.repo.AppAccountRepository;
import com.axelor.apps.base.service.administration.SequenceService;
import com.axelor.apps.tool.StringTool;
import com.axelor.common.StringUtils;
@@ -120,14 +126,54 @@ public class AccountingSituationServiceImpl implements AccountingSituationServic
}
}
Account acc = this.createPartnerAccount(partner, company);
AccountConfig accountConfig = Beans.get(AccountConfigService.class).getAccountConfig(company);
accountingSituation.setInvoiceAutomaticMail(accountConfig.getInvoiceAutomaticMail());
accountingSituation.setInvoiceMessageTemplate(accountConfig.getInvoiceMessageTemplate());
if (acc != null) {
if (partner.getIsCustomer()) {
accountingSituation.setCustomerAccount(acc);
} else if (partner.getIsSupplier()) {
accountingSituation.setSupplierAccount(acc);
}
}
partner.addAccountingSituationListItem(accountingSituation);
return accountingSituationRepo.save(accountingSituation);
}
// sophal creating account
@Transactional
private Account createPartnerAccount(Partner partner, Company company) {
Account sAccount = new Account();
AppAccount appAccount = Beans.get(AppAccountService.class).getAppAccount();
int partnerCode = appAccount.getSupplierCodeSequence() + 1;
appAccount.setSupplierCodeSequence(partnerCode);
String accounString = "Fournisseurs";
if (partner.getIsCustomer()) {
accounString = "Clients";
partnerCode = appAccount.getClientCodeSequence() + 1;
appAccount.setClientCodeSequence(partnerCode);
}
AccountType accountType = Beans.get(AccountTypeRepository.class).findByName(accounString);
Account parenAccount = Beans.get(AccountRepository.class).findByCode("0");
sAccount.setAccountType(accountType);
sAccount.setCode(String.valueOf(partnerCode));
sAccount.setName(partner.getName());
sAccount.setReconcileOk(true);
sAccount.setUseForPartnerBalance(true);
sAccount.setCompany(company);
sAccount.setParentAccount(parenAccount);
Beans.get(AppAccountRepository.class).save(appAccount);
return sAccount;
}
@Override
public AccountingSituation getAccountingSituation(Partner partner, Company company) {
if (partner == null || partner.getAccountingSituationList() == null) {

View File

@@ -0,0 +1,81 @@
package com.axelor.apps.account.service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.axelor.apps.account.db.CashDenomination;
import com.axelor.apps.account.db.CashInventory;
import com.axelor.apps.account.db.CashInventoryLine;
import com.axelor.apps.account.db.repo.CashDenominationRepository;
import com.axelor.apps.account.db.repo.CashInventoryRepository;
import com.axelor.inject.Beans;
import com.google.inject.persist.Transactional;
public class CashInventoryService {
@Transactional
public void initThetoricalSoldeInWords(CashInventory cashInventory) {
CashInventoryRepository cashInventoryRepository = Beans.get(CashInventoryRepository.class);
CashInventory lastCashInventory = cashInventoryRepository.all().order("-createdOn").fetchOne();
BigDecimal theoricalSolde = BigDecimal.ZERO;
if(lastCashInventory == null){
theoricalSolde = BigDecimal.ZERO;
}else{
theoricalSolde = lastCashInventory.getTheoricalSolde();
}
cashInventory.setTheoricalSolde(theoricalSolde);
cashInventory.setRealDate(LocalDateTime.now());
cashInventoryRepository.save(cashInventory);
}
public Map<String, BigDecimal> computeToTals(CashInventory cashInventory){
HashMap<String, BigDecimal> map = new HashMap<>();
List<CashInventoryLine> cashInventoryLines = cashInventory.getCashInventoryLines();
BigDecimal theoricalSolde = cashInventory.getTheoricalSolde();
BigDecimal totalBankNotes = BigDecimal.ZERO;
BigDecimal totalCoins = BigDecimal.ZERO;
BigDecimal physicalSolde = BigDecimal.ZERO;
BigDecimal gap = BigDecimal.ZERO;
for (CashInventoryLine cashInventoryLine : cashInventoryLines) {
switch (cashInventoryLine.getCashDenomination().getTypeSelect()) {
case CashDenominationRepository.BANK_NOTE_TYPE:
totalBankNotes = totalBankNotes.add(cashInventoryLine.getTotalCashCount());
break;
case CashDenominationRepository.COINT_TYPE:
totalCoins = totalCoins.add(cashInventoryLine.getTotalCashCount());
break;
default:
totalBankNotes = BigDecimal.ZERO;
totalCoins = BigDecimal.ZERO;
break;
}
}
physicalSolde = physicalSolde.add(totalBankNotes).add(totalCoins);
gap = physicalSolde.subtract(theoricalSolde);
map.put("totalCoinsAmount", totalCoins);
map.put("totalBankNotesAmount", totalBankNotes);
map.put("totalCash", totalBankNotes);
map.put("physicalSolde", physicalSolde);
map.put("gap", gap);
return map;
}
}

View File

@@ -0,0 +1,123 @@
package com.axelor.apps.account.service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.annotation.Contract;
import com.axelor.apps.account.db.Invoice;
import com.axelor.apps.account.db.InvoiceLine;
import com.axelor.apps.account.db.InvoiceTemplate;
import com.axelor.apps.account.db.InvoiceTemplateLine;
import com.axelor.apps.account.db.repo.InvoiceRepository;
import com.axelor.apps.account.service.invoice.generator.InvoiceGenerator;
import com.axelor.apps.account.service.invoice.generator.InvoiceLineGenerator;
import com.axelor.apps.base.db.Company;
import com.axelor.apps.base.db.Partner;
import com.axelor.apps.base.db.Product;
import com.axelor.apps.base.service.app.AppBaseService;
import com.axelor.exception.AxelorException;
import com.axelor.inject.Beans;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
import com.google.inject.persist.Transactional;
public class InvoiceTemplateService {
@Transactional
public Invoice generateInvoiceFromTemplate(InvoiceTemplate invoiceTemplate) throws AxelorException {
Partner partner = invoiceTemplate.getPartner();
Company company = invoiceTemplate.getCompany();
InvoiceGenerator invoiceGenerator =
new InvoiceGenerator(
InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE,
company,
null,
null,
null,
partner,
partner,
partner.getCurrency(),
null,
"",
"",
null,
company.getDefaultBankDetails(),
null) {
@Override
public Invoice generate() throws AxelorException {
return super.createInvoiceHeader();
}
};
List<InvoiceLine> invoiceLineList = new ArrayList<>();
Invoice invoice = invoiceGenerator.generate();
int priority = 0;
for (InvoiceTemplateLine invoiceTemplateLine : invoiceTemplate.getMoveTemplateLineList()) {
invoiceLineList.addAll(createInvoiceLine(invoice, invoiceTemplateLine, priority));
priority++;
}
invoiceGenerator.populate(invoice, invoiceLineList);
Invoice returnInvoiced = Beans.get(InvoiceRepository.class).save(invoice);
return returnInvoiced;
}
protected List<InvoiceLine> createInvoiceLine(
Invoice invoice, InvoiceTemplateLine invoiceTemplateLine, int priority) throws AxelorException {
Product product = invoiceTemplateLine.getProduct();
InvoiceLineGenerator invoiceLineGenerator =
new InvoiceLineGenerator(
invoice,
product,
invoiceTemplateLine.getProduct().getName(),
BigDecimal.ZERO,
BigDecimal.ZERO,
BigDecimal.ZERO,
"",
invoiceTemplateLine.getQty(),
invoiceTemplateLine.getProduct().getUnit(),
null,
priority,
BigDecimal.ZERO,
0,
BigDecimal.ZERO,
BigDecimal.ZERO,
false,
false,
null) {
@Override
public List<InvoiceLine> creates() throws AxelorException {
InvoiceLine invoiceLine = this.createInvoiceLine();
invoiceLine.setQty(BigDecimal.ONE);
invoiceLine.setPrice(BigDecimal.ZERO);
invoiceLine.setPriceDiscounted(BigDecimal.ZERO);
List<InvoiceLine> invoiceLines = new ArrayList<InvoiceLine>();
invoiceLines.add(invoiceLine);
return invoiceLines;
}
};
return invoiceLineGenerator.creates();
}
}

View File

@@ -87,6 +87,15 @@ public interface ReconcileGroupService {
*/
void addAndValidate(ReconcileGroup reconcileGroup, Reconcile reconcile) throws AxelorException;
/**
* Add a reconcile to a group and validate the group if it is balanced.
*
* @param reconcileGroup a reconcileGroup.
* @param List<reconcile> a list reconcile.
*/
public void addAllAndValidate(ReconcileGroup reconcileGroup, List<Reconcile> reconcileList)
throws AxelorException;
/**
* Add the reconcile and its move line to the reconcile group.
*

View File

@@ -201,6 +201,18 @@ public class ReconcileGroupServiceImpl implements ReconcileGroupService {
}
}
@Override
public void addAllAndValidate(ReconcileGroup reconcileGroup, List<Reconcile> reconcileList)
throws AxelorException {
for (Reconcile reconcile : reconcileList) {
addToReconcileGroup(reconcileGroup, reconcile);
}
if (isBalanced(reconcileList)) {
validate(reconcileGroup, reconcileList);
}
}
@Override
public void addToReconcileGroup(ReconcileGroup reconcileGroup, Reconcile reconcile) {
reconcile.setReconcileGroup(reconcileGroup);

View File

@@ -174,11 +174,21 @@ public class ReconcileServiceImpl implements ReconcileService {
if (updateInvoicePayments) {
this.updateInvoicePayments(reconcile);
}
this.addToReconcileGroup(reconcile);
// this.addToReconcileGroup(reconcile);
return reconcileRepository.save(reconcile);
}
public void addAllToReconcileGroup(List<Reconcile> reconciles) throws AxelorException {
ReconcileGroupService reconcileGroupService = Beans.get(ReconcileGroupService.class);
ReconcileGroup reconcileGroup = reconcileGroupService.findOrCreateGroup(reconciles.get(0));
reconcileGroupService.addAllAndValidate(reconcileGroup, reconciles);
for (Reconcile reconcile : reconciles) {
this.confirmReconcile(reconcile, true);
}
}
@Override
public void addToReconcileGroup(Reconcile reconcile) throws AxelorException {
ReconcileGroupService reconcileGroupService = Beans.get(ReconcileGroupService.class);
@@ -474,6 +484,8 @@ public class ReconcileServiceImpl implements ReconcileService {
log.debug("Seuil respecté");
log.debug("Entrain de se cree");
MoveLine creditAdjustMoveLine =
moveAdjustementService.createAdjustmentCreditMove(debitMoveLine);
@@ -502,6 +514,7 @@ public class ReconcileServiceImpl implements ReconcileService {
if (creditMoveLine != null) {
BigDecimal creditAmountRemaining = creditMoveLine.getAmountRemaining();
log.debug("Montant à payer / à lettrer au crédit : {}", creditAmountRemaining);
log.debug("creditMoveLine: {}", creditMoveLine.toString());
if (creditAmountRemaining.compareTo(BigDecimal.ZERO) > 0) {
AccountConfig accountConfig =
@@ -515,8 +528,9 @@ public class ReconcileServiceImpl implements ReconcileService {
log.debug("Seuil respecté");
MoveLine debitAdjustmentMoveLine =
moveAdjustementService.createAdjustmentCreditMove(creditMoveLine);
moveAdjustementService.createAdjustmentDebitMove(creditMoveLine);
log.debug("/////////////// {}", creditAmountRemaining);
// Création de la réconciliation
Reconcile newReconcile =
this.createReconcile(

View File

@@ -0,0 +1,24 @@
package com.axelor.apps.account.service;
import java.math.BigDecimal;
public class Test {
public static void main(String[] args) {
BigDecimal debitTotalRemaining = BigDecimal.ZERO;
System.out.println(debitTotalRemaining);
setData(debitTotalRemaining);
System.out.println(debitTotalRemaining);
}
public static void setData(BigDecimal debitTotalRemaining){
debitTotalRemaining = debitTotalRemaining.add(BigDecimal.TEN);
}
}

View File

@@ -45,7 +45,6 @@ import com.axelor.apps.base.service.AddressService;
import com.axelor.apps.base.service.BlockingService;
import com.axelor.apps.base.service.PartnerService;
import com.axelor.apps.base.service.TradingNameService;
import com.axelor.apps.base.service.app.AppService;
import com.axelor.exception.AxelorException;
import com.axelor.exception.db.repo.TraceBackRepository;
import com.axelor.i18n.I18n;
@@ -420,12 +419,21 @@ public abstract class InvoiceGenerator {
}
// In the invoice currency
invoice.setInTaxTotal(invoice.getExTaxTotal().add(invoice.getTaxTotal()));
// invoice.setCompanyInTaxTotal(invoice.getCompanyInTaxTotal().add(invoice.getStamp().add(invoice.getFixTax())));
// invoice.setInTaxTotal(invoice.getExTaxTotal().add(invoice.getTaxTotal()));
invoice.setInTaxTotal(
invoice
.getExTaxTotal()
.add(invoice.getTaxTotal())
.add(invoice.getStamp().add(invoice.getFixTax())));
// In the company accounting currency
invoice.setCompanyInTaxTotal(invoice.getCompanyExTaxTotal().add(invoice.getCompanyTaxTotal()));
//invoice.setInTaxTotal(invoice.getExTaxTotal().add(invoice.getTaxTotal()).add(invoice.getStamp().add(invoice.getFixTax())));
//
// invoice.setCompanyInTaxTotal(invoice.getCompanyExTaxTotal().add(invoice.getCompanyTaxTotal()));
invoice.setCompanyInTaxTotal(
invoice
.getCompanyExTaxTotal()
.add(invoice.getCompanyTaxTotal())
.add(invoice.getStamp().add(invoice.getFixTax())));
invoice.setAmountRemaining(invoice.getInTaxTotal());
invoice.setHasPendingPayments(false);

View File

@@ -30,10 +30,15 @@ import com.axelor.apps.base.db.Partner;
import com.axelor.exception.AxelorException;
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
import java.lang.invoke.MethodHandles;
import java.math.BigDecimal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MoveAdjustementService {
private final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
protected MoveLineService moveLineService;
protected MoveCreateService moveCreateService;
protected MoveValidateService moveValidateService;
@@ -66,7 +71,7 @@ public class MoveAdjustementService {
* @throws AxelorException
*/
@Transactional(rollbackOn = {Exception.class})
public void createAdjustmentDebitMove(MoveLine debitMoveLine) throws AxelorException {
public MoveLine createAdjustmentDebitMove(MoveLine debitMoveLine) throws AxelorException {
Partner partner = debitMoveLine.getPartner();
Account account = debitMoveLine.getAccount();
@@ -76,6 +81,8 @@ public class MoveAdjustementService {
BigDecimal debitAmountRemaining = debitMoveLine.getAmountRemaining();
log.debug("============ debitAmountRemaining", debitAmountRemaining.toString());
Journal miscOperationJournal = accountConfigService.getAutoMiscOpeJournal(accountConfig);
Move adjustmentMove =
@@ -87,6 +94,11 @@ public class MoveAdjustementService {
null,
MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC);
adjustmentMove.setPaymentVoucher(debitMoveLine.getMove().getPaymentVoucher());
adjustmentMove.setPaymentMode(debitMoveLine.getMove().getPaymentVoucher().getPaymentMode());
debitMoveLine.getMove().getPaymentVoucher().getGeneratedMoveList().add(adjustmentMove);
log.debug("============ move", adjustmentMove.toString());
// Création de la ligne au crédit
MoveLine creditAdjustmentMoveLine =
moveLineService.createMoveLine(
@@ -94,7 +106,7 @@ public class MoveAdjustementService {
partner,
account,
debitAmountRemaining,
false,
true,
appAccountService.getTodayDate(),
1,
null,
@@ -107,7 +119,7 @@ public class MoveAdjustementService {
partner,
accountConfigService.getCashPositionVariationAccount(accountConfig),
debitAmountRemaining,
true,
false,
appAccountService.getTodayDate(),
2,
null,
@@ -118,6 +130,8 @@ public class MoveAdjustementService {
moveValidateService.validate(adjustmentMove);
moveRepository.save(adjustmentMove);
return creditAdjustmentMoveLine;
}
/**
@@ -138,6 +152,8 @@ public class MoveAdjustementService {
Journal miscOperationJournal = accountConfigService.getAutoMiscOpeJournal(accountConfig);
log.debug("============ debitMoveLine", debitMoveLine.toString());
Move adjustmentMove =
moveCreateService.createMove(
miscOperationJournal,

View File

@@ -38,11 +38,14 @@ import com.axelor.apps.account.exception.IExceptionMessage;
import com.axelor.apps.account.service.AccountManagementAccountService;
import com.axelor.apps.account.service.AnalyticMoveLineService;
import com.axelor.apps.account.service.FiscalPositionAccountService;
import com.axelor.apps.account.service.ReconcileServiceImpl;
import com.axelor.apps.account.service.TaxAccountService;
import com.axelor.apps.account.service.TaxPaymentMoveLineService;
import com.axelor.apps.account.service.app.AppAccountService;
import com.axelor.apps.account.service.config.AccountConfigService;
import com.axelor.apps.account.service.invoice.InvoiceToolService;
import com.axelor.apps.account.service.payment.PaymentService;
import com.axelor.apps.account.service.payment.PaymentServiceImpl;
import com.axelor.apps.base.db.Company;
import com.axelor.apps.base.db.Currency;
import com.axelor.apps.base.db.Partner;
@@ -514,6 +517,52 @@ public class MoveLineService {
moveLines.add(moveLine);
}
}
if (invoice.getFixTax().compareTo(BigDecimal.ZERO) > 0) {
Account taxAccount =
Beans.get((AccountConfigService.class))
.getAccountConfig(move.getCompany())
.getTaxAccount();
MoveLine moveLine2 =
this.createMoveLine(
move,
partner,
taxAccount,
invoice.getFixTax(),
invoice.getFixTax(),
null,
!isDebitCustomer,
invoice.getInvoiceDate(),
null,
invoice.getOriginDate(),
moveLineId++,
origin,
taxAccount.getName());
log.debug("#################### moveLine {}", moveLine2.toString());
moveLines.add(moveLine2);
}
if (invoice.getStamp().compareTo(BigDecimal.ZERO) > 0) {
Account stampAccount =
Beans.get((AccountConfigService.class))
.getAccountConfig(move.getCompany())
.getStampAccount();
MoveLine moveLine2 =
this.createMoveLine(
move,
partner,
stampAccount,
invoice.getStamp(),
invoice.getStamp(),
null,
!isDebitCustomer,
invoice.getInvoiceDate(),
null,
invoice.getOriginDate(),
moveLineId++,
origin,
stampAccount.getName());
log.debug("#################### moveLine {}", moveLine2.toString());
moveLines.add(moveLine2);
}
// Creation of tax move lines for each invoice line tax
for (InvoiceLineTax invoiceLineTax : invoice.getInvoiceLineTaxList()) {
@@ -948,32 +997,38 @@ public class MoveLineService {
*
* @param moveLineList
*/
public void reconcileMoveLinesWithCacheManagement(List<MoveLine> moveLineList) throws AxelorException{
public void reconcileMoveLinesWithCacheManagement(List<MoveLine> moveLineList)
throws AxelorException {
List<MoveLine> reconciliableCreditMoveLineList = getReconciliableCreditMoveLines(moveLineList);
List<MoveLine> reconciliableDebitMoveLineList = getReconciliableDebitMoveLines(moveLineList);
//pour desactiver le lettrage (Provisoire)
BigDecimal totalDebit = BigDecimal.ZERO;
BigDecimal totalCredit = BigDecimal.ZERO;
if (reconciliableCreditMoveLineList.size() > 0 && reconciliableDebitMoveLineList.size() > 0) {
for (MoveLine moveLine : reconciliableCreditMoveLineList) {
totalCredit = totalCredit.add(moveLine.getCredit());
}
for (MoveLine moveLine : reconciliableDebitMoveLineList) {
totalDebit = totalDebit.add(moveLine.getDebit());
}
}
//pour desactiver le lettrage (Provisoire)
// pour desactiver le lettrage (Provisoire)
// BigDecimal totalDebit = BigDecimal.ZERO;
// BigDecimal totalCredit = BigDecimal.ZERO;
if(totalDebit.equals(totalCredit)){
// if (reconciliableCreditMoveLineList.size() > 0 && reconciliableDebitMoveLineList.size() > 0)
// {
// for (MoveLine moveLine : reconciliableCreditMoveLineList) {
// totalCredit = totalCredit.add(moveLine.getCredit());
// }
// for (MoveLine moveLine : reconciliableDebitMoveLineList) {
// totalDebit = totalDebit.add(moveLine.getDebit());
// }
// }
// pour desactiver le lettrage (Provisoire)
// if(totalDebit.equals(totalCredit)){
Map<List<Object>, Pair<List<MoveLine>, List<MoveLine>>> moveLineMap = new HashMap<>();
populateCredit(moveLineMap, reconciliableCreditMoveLineList);
populateDebit(moveLineMap, reconciliableDebitMoveLineList);
System.out.println("************************************************");
System.out.println(moveLineMap.toString());
System.out.println("************************************************");
Comparator<MoveLine> byDate = Comparator.comparing(MoveLine::getDate);
PaymentService paymentService = Beans.get(PaymentService.class);
@@ -989,11 +1044,13 @@ public class MoveLineService {
JPA.clear();
}
}
}else{
throw new AxelorException(
TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
"(total Credit ="+totalCredit+") != (total Debit="+totalDebit+")");
}
// }
// else{
// throw new AxelorException(
// TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
// "(total Credit ="+totalCredit+") != (total Debit="+totalDebit+")");
// }
}
protected Pair<List<MoveLine>, List<MoveLine>> findMoveLineLists(
@@ -1075,7 +1132,7 @@ public class MoveLineService {
keys.add(move.getCompany());
keys.add(moveLine.getAccount());
keys.add(moveLine.getPartner());
// keys.add(moveLine.getPartner());
Pair<List<MoveLine>, List<MoveLine>> moveLineLists = moveLineMap.get(keys);

View File

@@ -83,7 +83,7 @@ public class MoveRemoveService {
return move;
}
protected void cleanMoveToArchived(Move move) throws Exception {
public void cleanMoveToArchived(Move move) throws Exception {
for (MoveLine moveLine : move.getMoveLineList()) {
for (Reconcile reconcile : moveLine.getDebitReconcileList()) {
reconcileService.unreconcile(reconcile);

View File

@@ -27,6 +27,7 @@ import com.axelor.exception.db.repo.TraceBackRepository;
import com.axelor.i18n.I18n;
import com.google.common.base.Strings;
import com.google.inject.Inject;
import java.time.LocalDate;
public class MoveSequenceService {
@@ -47,7 +48,7 @@ public class MoveSequenceService {
}
}
public void setSequence(Move move) throws AxelorException {
public void setSequence(Move move, LocalDate refDate) throws AxelorException {
Journal journal = move.getJournal();
@@ -57,6 +58,6 @@ public class MoveSequenceService {
I18n.get(IExceptionMessage.MOVE_5),
journal.getName());
}
move.setReference(sequenceService.getSequenceNumber(journal.getSequence()));
move.setReference(sequenceService.getSequenceNumber(journal.getSequence(), refDate));
}
}

View File

@@ -228,7 +228,7 @@ public class MoveValidateService {
accountConfigService.getAccountConfig(move.getCompany()).getAccountingDaybook();
if (!dayBookMode || move.getStatusSelect() == MoveRepository.STATUS_DAYBOOK) {
moveSequenceService.setSequence(move);
moveSequenceService.setSequence(move, move.getDate());
}
if (move.getPeriod().getStatusSelect() == PeriodRepository.STATUS_ADJUSTING) {

View File

@@ -110,8 +110,7 @@ public class PaymentModeServiceImpl implements PaymentModeService {
public Sequence getPaymentModeSequence(
PaymentMode paymentMode, Company company, BankDetails bankDetails) throws AxelorException {
AccountManagement accountManagement =
this.getAccountManagement(paymentMode, company, bankDetails);
AccountManagement accountManagement = this.getAccountManagement(paymentMode, company);
if (accountManagement == null || accountManagement.getSequence() == null) {
throw new AxelorException(

View File

@@ -25,6 +25,7 @@ import com.axelor.apps.account.db.PayVoucherElementToPay;
import com.axelor.apps.account.db.PaymentScheduleLine;
import com.axelor.apps.account.db.Reconcile;
import com.axelor.apps.account.service.ReconcileService;
import com.axelor.apps.account.service.ReconcileServiceImpl;
import com.axelor.apps.account.service.app.AppAccountService;
import com.axelor.apps.account.service.move.MoveLineService;
import com.axelor.apps.base.db.Company;
@@ -32,6 +33,7 @@ import com.axelor.apps.base.db.Partner;
import com.axelor.db.JPA;
import com.axelor.exception.AxelorException;
import com.axelor.exception.service.TraceBackService;
import com.axelor.inject.Beans;
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
import java.lang.invoke.MethodHandles;
@@ -50,7 +52,7 @@ public class PaymentServiceImpl implements PaymentService {
protected ReconcileService reconcileService;
protected MoveLineService moveLineService;
public List<Reconcile> reconciles = new ArrayList<>();
protected AppAccountService appAccountService;
@Inject
@@ -125,7 +127,7 @@ public class PaymentServiceImpl implements PaymentService {
log.debug(
"Emploie du trop perçu : ligne en crédit (restant à payer): {})",
creditMoveLine.getAmountRemaining());
creditTotalRemaining = creditTotalRemaining.add(creditMoveLine.getAmountRemaining());
creditTotalRemaining = creditTotalRemaining.add(creditMoveLine.getAmountRemaining().setScale(2,BigDecimal.ROUND_HALF_EVEN));
}
for (MoveLine debitMoveLine : debitMoveLines) {
@@ -134,7 +136,7 @@ public class PaymentServiceImpl implements PaymentService {
log.debug(
"Emploie du trop perçu : ligne en débit (restant à payer): {})",
debitMoveLine.getAmountRemaining());
debitTotalRemaining = debitTotalRemaining.add(debitMoveLine.getAmountRemaining());
debitTotalRemaining = debitTotalRemaining.add(debitMoveLine.getAmountRemaining().setScale(2,BigDecimal.ROUND_HALF_EVEN));
}
for (MoveLine creditMoveLine : creditMoveLines) {
@@ -146,7 +148,7 @@ public class PaymentServiceImpl implements PaymentService {
&& (creditMoveLine.getAmountRemaining().compareTo(BigDecimal.ZERO) == 1)) {
try {
createReconcile(
debitMoveLine, creditMoveLine, debitTotalRemaining, creditTotalRemaining);
debitMoveLine, creditMoveLine, debitTotalRemaining.setScale(4), creditTotalRemaining.setScale(4));
} catch (Exception e) {
if (dontThrow) {
TraceBackService.trace(e);
@@ -159,6 +161,7 @@ public class PaymentServiceImpl implements PaymentService {
}
}
}
Beans.get(ReconcileServiceImpl.class).addAllToReconcileGroup(reconciles);
}
}
@@ -201,6 +204,7 @@ public class PaymentServiceImpl implements PaymentService {
} else {
reconcile = reconcileService.createReconcile(debitMoveLine, creditMoveLine, amount, false);
}
this.reconciles.add(reconcile);
// End gestion du passage en 580
if (reconcile != null) {

View File

@@ -18,28 +18,39 @@
package com.axelor.apps.account.service.payment.paymentvoucher;
import com.axelor.apps.account.db.Account;
import com.axelor.apps.account.db.AccountConfig;
import com.axelor.apps.account.db.Invoice;
import com.axelor.apps.account.db.Journal;
import com.axelor.apps.account.db.Move;
import com.axelor.apps.account.db.MoveLine;
import com.axelor.apps.account.db.PayVoucherDueElement;
import com.axelor.apps.account.db.PayVoucherElementToPay;
import com.axelor.apps.account.db.PaymentMode;
import com.axelor.apps.account.db.PaymentVoucher;
import com.axelor.apps.account.db.Reconcile;
import com.axelor.apps.account.db.ReconcileGroup;
import com.axelor.apps.account.db.repo.InvoiceRepository;
import com.axelor.apps.account.db.repo.MoveRepository;
import com.axelor.apps.account.db.repo.PayVoucherElementToPayRepository;
import com.axelor.apps.account.db.repo.PaymentVoucherRepository;
import com.axelor.apps.account.exception.IExceptionMessage;
import com.axelor.apps.account.service.AccountCustomerService;
import com.axelor.apps.account.service.MoveLineExportService;
import com.axelor.apps.account.service.ReconcileGroupServiceImpl;
import com.axelor.apps.account.service.ReconcileService;
import com.axelor.apps.account.service.app.AppAccountService;
import com.axelor.apps.account.service.config.AccountConfigService;
import com.axelor.apps.account.service.move.MoveCancelService;
import com.axelor.apps.account.service.move.MoveLineService;
import com.axelor.apps.account.service.move.MoveService;
import com.axelor.apps.account.service.move.MoveServiceImpl;
import com.axelor.apps.account.service.payment.PaymentModeService;
import com.axelor.apps.account.service.payment.PaymentService;
import com.axelor.apps.base.db.BankDetails;
import com.axelor.apps.base.db.Company;
import com.axelor.apps.base.db.Partner;
import com.axelor.apps.purchase.db.PurchaseOrder;
import com.axelor.auth.AuthUtils;
import com.axelor.exception.AxelorException;
import com.axelor.exception.db.repo.TraceBackRepository;
import com.axelor.i18n.I18n;
@@ -50,7 +61,12 @@ import java.lang.invoke.MethodHandles;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,6 +84,7 @@ public class PaymentVoucherConfirmService {
protected PaymentVoucherToolService paymentVoucherToolService;
protected PayVoucherElementToPayRepository payVoucherElementToPayRepo;
protected PaymentVoucherRepository paymentVoucherRepository;
protected List<Reconcile> reconciles = new ArrayList<Reconcile>();
@Inject
public PaymentVoucherConfirmService(
@@ -105,21 +122,36 @@ public class PaymentVoucherConfirmService {
* @param paymentVoucher
*/
@Transactional(rollbackOn = {Exception.class})
public void confirmPaymentVoucher(PaymentVoucher paymentVoucher) throws AxelorException {
public void confirmPaymentVoucher(PaymentVoucher paymentVoucher, Boolean isConfirmed)
throws AxelorException {
log.debug("In confirmPaymentVoucherService ....");
paymentVoucherSequenceService.setReference(paymentVoucher);
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails();
Journal journal =
paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
Account paymentModeAccount =
paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails);
Journal journal;
if (paymentVoucher.getPaymentMode().getId() == 12 || paymentVoucher.getPaymentMode().getId() == 23) {
if(paymentVoucher.getPartner().getAccountingManagementList().size() == 0){
throw new AxelorException(
paymentVoucher,
TraceBackRepository.CATEGORY_INCONSISTENCY,
I18n.get("Journal manquant !!"),
I18n.get(com.axelor.apps.base.exceptions.IExceptionMessage.EXCEPTION));
}else{
journal = paymentVoucher.getPartner().getAccountingManagementList().get(0).getJournal();
}
}else{
journal =
paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
Account paymentModeAccount =
paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails);
paymentVoucherControlService.checkPaymentVoucherField(
paymentVoucher, company, paymentModeAccount, journal);
}
if (paymentVoucher.getRemainingAmount().compareTo(BigDecimal.ZERO) > 0
&& !journal.getExcessPaymentOk()) {
@@ -141,9 +173,15 @@ public class PaymentVoucherConfirmService {
&& paymentVoucher.getPaymentMode().getValidatePaymentByDepositSlipPublication()) {
waitForDepositSlip(paymentVoucher);
} else {
createMoveAndConfirm(paymentVoucher);
if (!isConfirmed && paymentVoucher.getGeneratedMoveList().size() == 0) {
createMoveAndConfirm(paymentVoucher);
}
if ((paymentVoucher.getPaymentMode().getId() == 12 || paymentVoucher.getPaymentMode().getId() == 23) && isConfirmed) {
confirmBankMove(paymentVoucher);
}
}
paymentVoucher.setStatusTypeSelect(1); // confirmé
paymentVoucherSequenceService.setReceiptNo(paymentVoucher, company, journal);
paymentVoucherRepository.save(paymentVoucher);
}
@@ -172,12 +210,23 @@ public class PaymentVoucherConfirmService {
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails();
Journal journal =
paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
LocalDate paymentDate = paymentVoucher.getPaymentDate();
Journal journal;
// LocalDate paymentDate = paymentVoucher.getPaymentDate();
LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate();
boolean scheduleToBePaid = false;
Account paymentModeAccount =
Account paymentModeAccount;
if (paymentVoucher.getPaymentMode().getId() == 12 || paymentVoucher.getPaymentMode().getId() == 23) {
paymentModeAccount =
paymentVoucher.getPartner().getAccountingManagementList().get(0).getCashAccount();
journal = paymentVoucher.getPartner().getAccountingManagementList().get(0).getJournal();
}else{
journal =
paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
paymentModeAccount =
paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails);
}
// If paid by a moveline check if all the lines selected have the same account + company
// Excess payment
@@ -218,37 +267,99 @@ public class PaymentVoucherConfirmService {
move.setPaymentVoucher(paymentVoucher);
paymentVoucher.setGeneratedMove(move);
// confirmed by
paymentVoucher.setConfirmedByUser(AuthUtils.getUser());
paymentVoucher.setConfirmationDate(LocalDate.now());
// Create move lines for payment lines
BigDecimal paidLineTotal = BigDecimal.ZERO;
int moveLineNo = 1;
boolean isDebitToPay = paymentVoucherToolService.isDebitToPay(paymentVoucher);
for (PayVoucherElementToPay payVoucherElementToPay :
this.getPayVoucherElementToPayList(paymentVoucher)) {
List<? extends PayVoucherElementToPay> payVoucherElementToPayList =
this.getPayVoucherElementToPayList(paymentVoucher);
MoveLine moveLineInvoices = null;
if(paymentVoucher.getOperationTypeSelect() == 6){
moveLineInvoices =
moveLineService.createMoveLine(
move,
payerPartner,
payerPartner.getAccountingSituationList().get(0).getCustomerAccount(),
paymentVoucher.getPaidAmount(),
!isDebitToPay,
paymentDate,
moveLineNo++,
paymentVoucher.getRef(),
null);
paidLineTotal = paymentVoucher.getPaidAmount();
move.getMoveLineList().add(moveLineInvoices);
}else{
for (PayVoucherElementToPay payVoucherElementToPay : payVoucherElementToPayList) {
MoveLine moveLineToPay = payVoucherElementToPay.getMoveLine();
log.debug("PV moveLineToPay debit : {}", moveLineToPay.getDebit());
log.debug("PV moveLineToPay credit : {}", moveLineToPay.getCredit());
log.debug("PV moveLineToPay amountPaid : {}", moveLineToPay.getAmountPaid());
BigDecimal amountToPay = payVoucherElementToPay.getAmountToPayCurrency();
log.debug(">>>> PV amountToPay : {}", amountToPay);
if (amountToPay.compareTo(BigDecimal.ZERO) > 0) {
Invoice invoice = payVoucherElementToPay.getMoveLine().getMove().getInvoice();
isDebitToPay = paymentVoucherToolService.isDebitToPay(invoice);
boolean isRefundInvoice = false;
if (invoice.getOperationTypeSelect()
== InvoiceRepository.OPERATION_TYPE_CLIENT_REFUND) {
isRefundInvoice = true;
}
log.debug("heyyyyyyyyyyyyyyyyy : {}", isRefundInvoice);
if (amountToPay.compareTo(BigDecimal.ZERO) > 0 || isRefundInvoice) {
if (isRefundInvoice
// || paymentVoucher.getOperationTypeSelect()
// == PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND
// || paymentVoucher.getOperationTypeSelect()
// == PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND
) {
amountToPay = payVoucherElementToPay.getTotalAmount();
log.debug(
"**** getInvoiceId {} *** isDebitToPay {} **** amountToPay {}",
invoice.getInvoiceId(),
isDebitToPay,
amountToPay);
}
paidLineTotal = paidLineTotal.add(amountToPay);
log.debug("amountToPay >>>>>>>>>>> {}", amountToPay);
this.payMoveLine(
move,
moveLineNo++,
payerPartner,
moveLineToPay,
amountToPay,
amountToPay,
// isRefundInvoice ? amountToPay : payVoucherElementToPay.getAmountToPayCurrency(),
payVoucherElementToPay,
isDebitToPay,
paymentDate);
}
}
}
// Create move line for the payment amount
MoveLine moveLine = null;
isDebitToPay = paymentVoucherToolService.isDebitToPay(paymentVoucher);
// cancelling the moveLine (excess payment) by creating the balance of all the payments
// on the same account as the moveLine (excess payment)
@@ -266,20 +377,27 @@ public class PaymentVoucherConfirmService {
paymentVoucher.getRef(),
null);
Reconcile reconcile =
reconcileService.createReconcile(
moveLine, paymentVoucher.getMoveLine(), moveLine.getDebit(), !isDebitToPay);
if (reconcile != null) {
reconcileService.confirmReconcile(reconcile, true);
}
// Reconcile reconcile =
// reconcileService.createReconcile(
// moveLine, paymentVoucher.getMoveLine(), moveLine.getDebit(), !isDebitToPay);
// if (reconcile != null) {
// reconcileService.confirmReconcile(reconcile, true);
// }
} else {
BigDecimal paidAmount = BigDecimal.ZERO;
// if(paymentVoucher.getOperationTypeSelect() == 6){
// paidAmount = processSaleAndRefund(payVoucherElementToPayList);
// }else{
paidAmount = paymentVoucher.getPaidAmount();
// }
moveLine =
moveLineService.createMoveLine(
move,
payerPartner,
paymentModeAccount,
paymentVoucher.getPaidAmount(),
paidAmount,
isDebitToPay,
paymentDate,
moveLineNo++,
@@ -287,9 +405,14 @@ public class PaymentVoucherConfirmService {
null);
}
move.getMoveLineList().add(moveLine);
// Check if the paid amount is > paid lines total
// Then Use Excess payment on old invoices / moveLines
if (paymentVoucher.getPaidAmount().compareTo(paidLineTotal) > 0) {
if (paymentVoucher.getPaidAmount().compareTo(paidLineTotal) > 0
|| paymentVoucher
.getPaidAmount()
.compareTo(processSaleAndRefundTotal(paymentVoucher).get("total"))
> 0) {
BigDecimal remainingPaidAmount = paymentVoucher.getRemainingAmount();
// TODO rajouter le process d'imputation automatique
@@ -321,20 +444,201 @@ public class PaymentVoucherConfirmService {
moveLineNo++,
paymentVoucher.getRef(),
null);
move.getMoveLineList().add(moveLine);
log.debug("******************** remainingPaidAmount {}", remainingPaidAmount);
log.debug("******************** isDebitToPay confirm voucher{}", moveLine.toString());
log.debug("******************** isDebitToPay confirm voucher{}", moveLine.toString());
if (isDebitToPay) {
reconcileService.balanceCredit(moveLine);
}
}
moveService.getMoveValidateService().validate(move);
paymentVoucher.setGeneratedMove(move);
paymentVoucher.addGeneratedMoveListItem(move);
}
paymentVoucher.setStatusSelect(PaymentVoucherRepository.STATUS_CONFIRMED);
// paymentVoucher.setStatusSelect(PaymentVoucherRepository.STATUS_CONFIRMED);
Beans.get(PaymentVoucherLoadService.class).updateVoucher(paymentVoucher);
deleteUnPaidLines(paymentVoucher);
}
@Transactional(rollbackOn = {Exception.class})
public void confirmBankMove(PaymentVoucher paymentVoucher) throws AxelorException {
Partner payerPartner = paymentVoucher.getPartner();
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails();
Journal journal =
paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
// LocalDate paymentDate = paymentVoucher.getPaymentDate();
LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate();
LocalDate paymentDateEchance = paymentVoucher.getDueDate();
if(paymentVoucher.getSort() == 3){
paymentDateEchance = paymentVoucher.getCreditDate();
}
boolean scheduleToBePaid = false;
Account paymentModeAccount =
paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails);
Move move =
moveService
.getMoveCreateService()
.createMoveWithPaymentVoucher(
journal,
company,
paymentVoucher,
payerPartner,
paymentDateEchance,
paymentMode,
MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC);
move.setPaymentVoucher(paymentVoucher);
boolean isDebitToPay = paymentVoucherToolService.isDebitToPay(paymentVoucher);
List<? extends PayVoucherElementToPay> payVoucherElementToPayList =
this.getPayVoucherElementToPayList(paymentVoucher);
BigDecimal paidAmount = paymentVoucher.getPaidAmount();
int moveLineNo = 1;
MoveLine moveLine2 =
moveLineService.createMoveLine(
move,
payerPartner,
paymentVoucher.getPartner().getAccountingManagementList().get(0).getCashAccount(),
paidAmount,
!isDebitToPay,
paymentDateEchance,
moveLineNo++,
paymentVoucher.getRef(),
null);
MoveLine moveLine =
moveLineService.createMoveLine(
move,
payerPartner,
paymentModeAccount,
paidAmount,
isDebitToPay,
paymentDateEchance,
moveLineNo++,
paymentVoucher.getRef(),
null);
move.getMoveLineList().add(moveLine);
move.getMoveLineList().add(moveLine2);
moveService.getMoveValidateService().validate(move);
paymentVoucher.setGeneratedMove(move);
paymentVoucher.addGeneratedMoveListItem(move);
if (isDebitToPay) {
reconcileService.balanceCredit(moveLine);
}
Beans.get(PaymentVoucherLoadService.class).updateVoucher(paymentVoucher);
}
@Transactional(rollbackOn = {Exception.class})
public void confirmOtherPayment(PaymentVoucher paymentVoucher) throws AxelorException {
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails();
Journal journal =
paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
// LocalDate paymentDate = paymentVoucher.getPaymentDate();
LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate();
LocalDate paymentDateEchance = paymentVoucher.getDueDate();
if(paymentVoucher.getSort() == 3){
paymentDateEchance = paymentVoucher.getCreditDate();
}
boolean scheduleToBePaid = false;
Account paymentModeAccount =
paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails);
Move move =
moveService
.getMoveCreateService()
.createMoveWithPaymentVoucher(
journal,
company,
paymentVoucher,
null,
paymentDate,
paymentMode,
MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC);
move.setPaymentVoucher(paymentVoucher);
List<? extends PayVoucherElementToPay> payVoucherElementToPayList =
this.getPayVoucherElementToPayList(paymentVoucher);
Boolean isDebitToPay = false;
Account accountToPay = null;
if(paymentModeAccount.getIsOriginRequired()){
MoveLine moveLineToPay = payVoucherElementToPayList.get(0).getMoveLine();
if(moveLineToPay.getCredit().compareTo(BigDecimal.ZERO) > 0){
isDebitToPay = true;
}
accountToPay = moveLineToPay.getAccount();
}else{
accountToPay = paymentVoucher.getPartner().getAccountingSituationList().get(0).getPartnerPaymentAccount();
}
BigDecimal paidAmount = paymentVoucher.getPaidAmount();
int moveLineNo = 1;
MoveLine moveLine2 =
moveLineService.createMoveLine(
move,
null,
accountToPay,
paidAmount,
!isDebitToPay,
paymentDateEchance,
moveLineNo++,
paymentVoucher.getRef(),
null);
MoveLine moveLine =
moveLineService.createMoveLine(
move,
null,
paymentModeAccount,
paidAmount,
isDebitToPay,
paymentDateEchance,
moveLineNo++,
paymentVoucher.getRef(),
null);
move.getMoveLineList().add(moveLine);
move.getMoveLineList().add(moveLine2);
moveService.getMoveValidateService().validate(move);
paymentVoucher.setGeneratedMove(move);
paymentVoucher.addGeneratedMoveListItem(move);
if (isDebitToPay) {
reconcileService.balanceCredit(moveLine);
}
// Beans.get(PaymentVoucherLoadService.class).updateVoucher(paymentVoucher);
}
public void deleteUnPaidLines(PaymentVoucher paymentVoucher) {
if (paymentVoucher.getPayVoucherElementToPayList() == null) {
@@ -418,6 +722,7 @@ public class PaymentVoucherConfirmService {
Partner payerPartner,
MoveLine moveLineToPay,
BigDecimal amountToPay,
BigDecimal amountToPayReel,
PayVoucherElementToPay payVoucherElementToPay,
boolean isDebitToPay,
LocalDate paymentDate)
@@ -446,11 +751,341 @@ public class PaymentVoucherConfirmService {
BigDecimal amountInCompanyCurrency = moveLine.getDebit().add(moveLine.getCredit());
Reconcile reconcile =
reconcileService.createReconcile(moveLineToPay, moveLine, amountInCompanyCurrency, true);
reconcileService.createReconcile(moveLineToPay, moveLine, amountToPayReel, true);
reconciles.add(reconcile);
if (reconcile != null) {
log.debug("Reconcile : : : {}", reconcile);
reconcileService.confirmReconcile(reconcile, true);
}
return moveLine;
}
public Map<String, BigDecimal> processSaleAndRefund(PaymentVoucher paymentVoucher) {
List<? extends PayVoucherDueElement> payVoucherElementToPayList =
paymentVoucher.getPayVoucherDueElementList();
BigDecimal total = BigDecimal.ZERO;
BigDecimal remaining = BigDecimal.ZERO;
Map<String, BigDecimal> tot = new HashMap<>();
for (PayVoucherDueElement dueElement : payVoucherElementToPayList) {
total =
total.add(dueElement.getMoveLine().getDebit().add(dueElement.getMoveLine().getCredit()));
}
if (paymentVoucher.getPaidAmount().compareTo(total) > 0) {
remaining = paymentVoucher.getPaidAmount().abs().subtract(total).abs();
}
tot.put("total", total.abs());
tot.put("remaining", remaining);
return tot;
}
public Map<String, BigDecimal> processSaleAndRefundTotal(PaymentVoucher paymentVoucher) {
List<? extends PayVoucherElementToPay> payVoucherElementToPayList =
paymentVoucher.getPayVoucherElementToPayList();
BigDecimal total = BigDecimal.ZERO;
BigDecimal remaining = BigDecimal.ZERO;
Map<String, BigDecimal> tot = new HashMap<>();
for (PayVoucherElementToPay elementToPay : payVoucherElementToPayList) {
total =
total.add(
elementToPay
.getMoveLine()
.getDebit()
.subtract(elementToPay.getMoveLine().getCredit()));
}
BigDecimal absTotal = total.abs();
if (paymentVoucher.getPaidAmount().compareTo(total) > 0) {
remaining = paymentVoucher.getPaidAmount().subtract(absTotal).abs();
} else {
remaining = BigDecimal.ZERO;
}
tot.put("total", absTotal);
tot.put("remaining", remaining);
return tot;
}
@Transactional(rollbackOn = {Exception.class})
public PaymentVoucher copyPaymentVoucher(PaymentVoucher paymentVoucher) throws AxelorException {
PaymentVoucher paymentVoucher2 =
Beans.get(PaymentVoucherRepository.class).copy(paymentVoucher, false);
paymentVoucher2.setGeneratedMove(null);
paymentVoucher2.setGeneratedMoveList(null);
paymentVoucher2.setOriginPaymentVoucher(paymentVoucher);
paymentVoucher2.setRequestDate(null);
paymentVoucher2.setRequestedByUser(null);
paymentVoucher2.setAcceptanceDate(null);
paymentVoucher2.setAcceptedByUser(null);
paymentVoucher2.setConfirmationDate(null);
paymentVoucher2.setConfirmedByUser(null);
paymentVoucher2.setConfirmedByUser(null);
paymentVoucher2.setRejectedDate(null);
paymentVoucher2.setRejectedByUser(null);
paymentVoucher2.setRejectionRaison(null);
for (PayVoucherElementToPay elementToPay : paymentVoucher.getPayVoucherElementToPayList()) {
PayVoucherElementToPay elementToPayCopy =
Beans.get(PayVoucherElementToPayRepository.class).copy(elementToPay, false);
paymentVoucher2.addPayVoucherElementToPayListItem(elementToPayCopy);
}
return paymentVoucherRepository.save(paymentVoucher2);
}
@Transactional(rollbackOn = {Exception.class})
public PaymentVoucher rejectPaymentVoucher(PaymentVoucher paymentVoucher, String cancelRaison)
throws AxelorException {
paymentVoucher.setStatusSelect(PaymentVoucherRepository.STATUS_REJECTED);
paymentVoucher.setRejectionRaison(cancelRaison);
paymentVoucher.setRejectedDate(LocalDate.now());
paymentVoucher.setRejectedByUser(AuthUtils.getUser());
paymentVoucher.setRejectedInstanceSelect(1);
// for (Move move : paymentVoucher.getGeneratedMoveList()) {
// for (MoveLine moveLine : move.getMoveLineList()) {
// ReconcileGroup reconcileGroup = moveLine.getReconcileGroup();
// if (reconcileGroup != null) {
// Beans.get(ReconcileGroupServiceImpl.class).unletter(reconcileGroup);
// log.debug("Unlettering ::: {} ******", reconcileGroup);
// }
// }
// // Move move = elementToPay.getMoveLine().getMove();
// // for (InvoicePayment invoicePayment : move.getInvoice().getInvoicePaymentList()) {
// // Beans.get(InvoicePaymentCancelService.class).cancel(invoicePayment);
// // }
// }
PaymentVoucher paymentVoucher2 =
Beans.get(PaymentVoucherConfirmService.class).copyPaymentVoucher(paymentVoucher);
for (Move move : paymentVoucher.getGeneratedMoveList()) {
log.debug("Rejecting move : : : {} **********", move);
try {
Move reverseMove = Beans.get(MoveServiceImpl.class).generateReverse(move, false, false, true, LocalDate.now());
paymentVoucher2.addGeneratedMoveListItem(reverseMove);
// moveCancelService.cancel(move);
} catch (AxelorException e) {
log.debug("Error : : : {}", e);
}
}
paymentVoucherRepository.save(paymentVoucher2);
return paymentVoucher2;
// Beans.get(InvoicePaymentRepository.class).all().filter("self.invoice = ?1", null);
}
@Transactional(rollbackOn = {Exception.class})
public Move confirmMultipleVoucher(List<PaymentVoucher> voucherList, List<PayVoucherElementToPay> elementToPays, boolean b) throws AxelorException {
if(voucherList != null && voucherList.size() > 0 ){
if(!samePaymentVoucherSelect(voucherList) || voucherAlreadyInMove(voucherList)){
throw new AxelorException(
voucherList.get(0),
TraceBackRepository.CATEGORY_INCONSISTENCY,
"Not the same operation type"
);
}
BigDecimal totalAmount = BigDecimal.ZERO;
totalAmount = voucherList.stream().map(PaymentVoucher::getPaidAmount).reduce(BigDecimal.ZERO,BigDecimal::add);
PaymentVoucher paymentVoucher = voucherList.get(0);
Partner payerPartner = paymentVoucher.getPartner();
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails();
Journal journal = paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails);
LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate();
Account paymentModeAccount =
paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails);
if (paymentVoucher.getPaymentMode().getId() == 12 || paymentVoucher.getPaymentMode().getId() == 23) {
paymentModeAccount =
paymentVoucher.getPartner().getAccountingManagementList().get(0).getCashAccount();
journal = paymentVoucher.getPartner().getAccountingManagementList().get(0).getJournal();
}
Move move =
moveService
.getMoveCreateService()
.createMoveWithPaymentVoucher(
journal,
company,
paymentVoucher,
payerPartner,
paymentDate,
paymentMode,
MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC);
// move.addPaymentVoucherListItem(paymentVoucher);
// paymentVoucher.setGeneratedMove(move);
paymentVoucher.setConfirmedByUser(AuthUtils.getUser());
paymentVoucher.setConfirmationDate(LocalDate.now());
boolean isDebitToPay = paymentVoucherToolService.isDebitToPay(paymentVoucher);
int moveLineNo = 0;
MoveLine moveLineAll =
moveLineService.createMoveLine(
move,
payerPartner,
paymentModeAccount,
totalAmount,
isDebitToPay,
paymentDate,
moveLineNo++,
paymentVoucher.getRef(),
null);
move.getMoveLineList().add(moveLineAll);
Set<Long> paymentVoucherIds = new HashSet<Long>();
for (PayVoucherElementToPay voucherElementToPay : elementToPays) {
MoveLine line = moveLineService.createMoveLine(
move,
payerPartner,
voucherElementToPay.getMoveLine().getAccount(),
voucherElementToPay.getAmountToPay(),
!isDebitToPay,
paymentDate,
moveLineNo++,
voucherElementToPay.getPaymentVoucher().getRef(),
null);
move.addMoveLineListItem(line);
paymentVoucherIds.add(voucherElementToPay.getPaymentVoucher().getId());
}
for (Long voucherId : paymentVoucherIds) {
PaymentVoucher voucher = Beans.get(PaymentVoucherRepository.class).find(voucherId);
System.out.println(":::::::::::::::::::>");
System.out.println(paymentVoucherIds);
System.out.println(voucher.getGeneratedMoveList());
System.out.println(":::::::::::::::::::>");
move.addPaymentVoucherListItem(voucher);
// voucher.addGeneratedMoveListItem(move);
voucher.setConfirmedByUser(AuthUtils.getUser());
voucher.setConfirmationDate(LocalDate.now());
paymentVoucher.setStatusSelect(PaymentVoucherRepository.STATUS_CONFIRMED);
}
return move;
}
return null;
}
public boolean samePaymentVoucherSelect(List<PaymentVoucher> voucherList){
Integer operationTypeSelect = voucherList.get(0).getOperationTypeSelect();
BankDetails bankDetails = voucherList.get(0).getCompanyBankDetails();
Partner partner = voucherList.get(0).getPartner();
for (int index = 1; index < voucherList.size(); index++) {
PaymentVoucher paymentVoucher = voucherList.get(index);
if(paymentVoucher.getOperationTypeSelect() != operationTypeSelect || paymentVoucher.getPartner() != partner || paymentVoucher.getCompanyBankDetails() != bankDetails){
return false;
}
}
return true;
}
public boolean voucherAlreadyInMove(List<PaymentVoucher> voucherList) {
if(voucherList != null){
for (PaymentVoucher voucher : voucherList) {
if(voucher.getGeneratedMoveList().size() > 0){
return true;
}
}
}
return false;
}
// Cash mvt
@Transactional(rollbackOn = {Exception.class})
public void confirmCashPayment(PaymentVoucher paymentVoucher) throws AxelorException {
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
AccountConfig accountConfig = Beans.get(AccountConfigService.class).getAccountConfig(company);
Journal journal = accountConfig.getCashJournal();
// LocalDate paymentDate = paymentVoucher.getPaymentDate();
LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate();
boolean scheduleToBePaid = false;
Account paymentModeAccount = paymentVoucher.getPartner().getAccountingSituationList().get(0).getPartnerPaymentAccount();
Move move =
moveService
.getMoveCreateService()
.createMoveWithPaymentVoucher(
journal,
company,
paymentVoucher,
null,
paymentDate,
paymentMode,
MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC);
move.setPaymentVoucher(paymentVoucher);
Boolean isDebitToPay = false;
if(Integer.parseInt(paymentVoucher.getDebitCreditSelect()) == 1){
isDebitToPay = true;
}
System.out.println(paymentVoucher.getDebitCreditSelect().toString());
System.out.println(isDebitToPay);
System.out.println("*******************999*********");
Account accountToPay = accountConfig.getCashAccount();
BigDecimal paidAmount = paymentVoucher.getPaidAmount();
int moveLineNo = 1;
MoveLine moveLine2 =
moveLineService.createMoveLine(
move,
null,
accountToPay,
paidAmount,
!isDebitToPay,
paymentDate,
moveLineNo++,
paymentVoucher.getRef(),
null);
MoveLine moveLine =
moveLineService.createMoveLine(
move,
null,
paymentModeAccount,
paidAmount,
isDebitToPay,
paymentDate,
moveLineNo++,
paymentVoucher.getRef(),
null);
move.getMoveLineList().add(moveLine);
move.getMoveLineList().add(moveLine2);
moveService.getMoveValidateService().validate(move);
paymentVoucher.setGeneratedMove(move);
paymentVoucher.addGeneratedMoveListItem(move);
if (isDebitToPay) {
reconcileService.balanceCredit(moveLine);
}
// Beans.get(PaymentVoucherLoadService.class).updateVoucher(paymentVoucher);
}
}

View File

@@ -120,7 +120,7 @@ public class PaymentVoucherCreateService {
paymentVoucherRepository.save(paymentVoucher);
paymentVoucherConfirmService.confirmPaymentVoucher(paymentVoucher);
paymentVoucherConfirmService.confirmPaymentVoucher(paymentVoucher, true);
return paymentVoucher;
}

View File

@@ -18,6 +18,7 @@
package com.axelor.apps.account.service.payment.paymentvoucher;
import com.axelor.apps.account.db.Account;
import com.axelor.apps.account.db.AccountingSituation;
import com.axelor.apps.account.db.Invoice;
import com.axelor.apps.account.db.Move;
import com.axelor.apps.account.db.MoveLine;
@@ -28,6 +29,7 @@ import com.axelor.apps.account.db.repo.InvoiceRepository;
import com.axelor.apps.account.db.repo.MoveLineRepository;
import com.axelor.apps.account.db.repo.MoveRepository;
import com.axelor.apps.account.db.repo.PayVoucherDueElementRepository;
import com.axelor.apps.account.db.repo.PayVoucherElementToPayRepository;
import com.axelor.apps.account.db.repo.PaymentVoucherRepository;
import com.axelor.apps.account.exception.IExceptionMessage;
import com.axelor.apps.base.db.BankDetails;
@@ -46,12 +48,14 @@ import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
public class PaymentVoucherLoadService {
protected CurrencyService currencyService;
protected PaymentVoucherToolService paymentVoucherToolService;
protected PayVoucherDueElementRepository payVoucherDueElementRepo;
protected PayVoucherElementToPayRepository elementToPayRepository;
protected PaymentVoucherRepository paymentVoucherRepository;
@Inject
@@ -59,11 +63,13 @@ public class PaymentVoucherLoadService {
CurrencyService currencyService,
PaymentVoucherToolService paymentVoucherToolService,
PayVoucherDueElementRepository payVoucherDueElementRepo,
PayVoucherElementToPayRepository elementToPayRepository,
PaymentVoucherRepository paymentVoucherRepository) {
this.currencyService = currencyService;
this.paymentVoucherToolService = paymentVoucherToolService;
this.payVoucherDueElementRepo = payVoucherDueElementRepo;
this.elementToPayRepository = elementToPayRepository;
this.paymentVoucherRepository = paymentVoucherRepository;
}
@@ -82,18 +88,33 @@ public class PaymentVoucherLoadService {
List<MoveLine> moveLines = null;
String query =
"self.partner = ?1 "
+ "and self.account.useForPartnerBalance = 't' "
"self.account.useForPartnerBalance = 't' "
+ "and self.amountRemaining > 0 "
+ "and (self.move.statusSelect = ?3 OR self.move.statusSelect = ?4)"
+ "and self.move.ignoreInDebtRecoveryOk = 'f' "
+ "and self.move.company = ?2 "
+ "and self.move.invoice.pfpValidateStatusSelect != ?5";
+ "and self.move.company = ?2 ";
if (paymentVoucherToolService.isDebitToPay(paymentVoucher)) {
query += " and self.debit > 0 ";
} else {
query += " and self.credit > 0 ";
if (paymentVoucher.getOperationTypeSelect() == PaymentVoucherRepository.OTHER){
AccountingSituation accountingSituation = paymentVoucher.getPartner().getAccountingSituationList().get(0);
query += " and self.account.id = "+accountingSituation.getPartnerPaymentAccount().getId();
if(accountingSituation.getDiretion() == 1){
query += " and self.debit > 0";
}else{
query += " and self.credit > 0";
}
}else{
query += " and self.move.invoice.pfpValidateStatusSelect != ?5 AND self.partner = ?1";
if (paymentVoucher.getOperationTypeSelect()
!= PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND
&& paymentVoucher.getOperationTypeSelect()
!= PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND) {
if (paymentVoucherToolService.isDebitToPay(paymentVoucher)) {
query += " and self.debit > 0 ";
} else {
query += " and self.credit > 0 ";
}
}
}
moveLines =
@@ -198,16 +219,25 @@ public class PaymentVoucherLoadService {
PaymentVoucher paymentVoucher, PaymentVoucher paymentVoucherContext) throws AxelorException {
int sequence = paymentVoucher.getPayVoucherElementToPayList().size() + 1;
BigDecimal amountRemaining = paymentVoucher.getRemainingAmount();
List<PayVoucherDueElement> dueElements = paymentVoucherContext.getPayVoucherDueElementList();
int sizeInvoiced = dueElements.stream().filter(t -> t.getMoveLine().getMove().getInvoice() == null).collect(Collectors.toList()).size();
System.out.println("sizeInvoiced : {}"+sizeInvoiced);
if(sizeInvoiced == 0){
dueElements.sort((o1, o2) -> o2.getMoveLine().getMove().getInvoice().getInvoiceId().compareTo(o1.getMoveLine().getMove().getInvoice().getInvoiceId()));
}
for (PayVoucherDueElement payVoucherDueElementContext :
paymentVoucherContext.getPayVoucherDueElementList()) {
for (PayVoucherDueElement payVoucherDueElementContext : dueElements) {
PayVoucherDueElement payVoucherDueElement =
payVoucherDueElementRepo.find(payVoucherDueElementContext.getId());
if (payVoucherDueElementContext.isSelected()) {
paymentVoucher.addPayVoucherElementToPayListItem(
this.createPayVoucherElementToPay(payVoucherDueElement, sequence++));
this.createPayVoucherElementToPay(payVoucherDueElement, sequence++,amountRemaining));
amountRemaining = amountRemaining.subtract(amountRemaining.min(payVoucherDueElement.getAmountRemaining()));
// Remove the line from the due elements lists
paymentVoucher.removePayVoucherDueElementListItem(payVoucherDueElement);
@@ -216,10 +246,10 @@ public class PaymentVoucherLoadService {
}
public PayVoucherElementToPay createPayVoucherElementToPay(
PayVoucherDueElement payVoucherDueElement, int sequence) throws AxelorException {
PayVoucherDueElement payVoucherDueElement, int sequence,BigDecimal amountRemaining) throws AxelorException {
PaymentVoucher paymentVoucher = payVoucherDueElement.getPaymentVoucher();
BigDecimal amountRemaining = paymentVoucher.getRemainingAmount();
// BigDecimal amountRemaining = paymentVoucher.getRemainingAmount();
LocalDate paymentDate = paymentVoucher.getPaymentDate();
PayVoucherElementToPay payVoucherElementToPay = new PayVoucherElementToPay();
@@ -388,6 +418,8 @@ public class PaymentVoucherLoadService {
}
int sequence = 0;
BigDecimal amountRemaining = paymentVoucher.getRemainingAmount();
for (Iterator<PayVoucherDueElement> it =
paymentVoucher.getPayVoucherDueElementList().iterator();
@@ -397,9 +429,49 @@ public class PaymentVoucherLoadService {
if (invoice.equals(payVoucherDueElement.getMoveLine().getMove().getInvoice())
&& paymentVoucher.getCurrency().equals(payVoucherDueElement.getCurrency())) {
paymentVoucher.addPayVoucherElementToPayListItem(
createPayVoucherElementToPay(payVoucherDueElement, ++sequence));
createPayVoucherElementToPay(payVoucherDueElement, ++sequence,amountRemaining));
amountRemaining = amountRemaining.subtract(amountRemaining.min(payVoucherDueElement.getAmountRemaining()));
it.remove();
}
}
}
@Transactional(rollbackOn = {Exception.class})
public void updateVoucher(PaymentVoucher paymentVoucher) throws AxelorException{
List<MoveLine> moveLines = new ArrayList<>();
List<PayVoucherElementToPay> payVoucherElementToPayList = paymentVoucher.getPayVoucherElementToPayList();
for (PayVoucherElementToPay elementToPay : payVoucherElementToPayList) {
moveLines.add(elementToPay.getMoveLine());
}
List<PayVoucherElementToPay> elementToPays = elementToPayRepository.all().filter("self.paymentVoucher.id != ?1 and self.moveLine in (?2)",paymentVoucher.getId(),moveLines).fetch();
for (PayVoucherElementToPay payVoucherElementToPay : elementToPays) {
Move move = payVoucherElementToPay.getMoveLine().getMove();
MoveLine moveLine = payVoucherElementToPay.getMoveLine();
payVoucherElementToPay.setTotalAmount(moveLine.getCurrencyAmount());
BigDecimal paidAmountInElementCurrency =
currencyService
.getAmountCurrencyConvertedAtDate(
move.getCompanyCurrency(),
move.getCurrency(),
moveLine.getAmountPaid(),
moveLine.getDate())
.setScale(2, RoundingMode.HALF_EVEN);
payVoucherElementToPay.setRemainingAmount(
moveLine.getCurrencyAmount().subtract(paidAmountInElementCurrency));
elementToPayRepository.save(payVoucherElementToPay);
}
}
}

View File

@@ -56,10 +56,12 @@ public class PaymentVoucherSequenceService {
PaymentMode paymentMode = paymentVoucher.getPaymentMode();
Company company = paymentVoucher.getCompany();
// Sequence seq = Beans.get(SequenceRepository.class).find(new Long("126"));
return sequenceService.getSequenceNumber(
paymentModeService.getPaymentModeSequence(
paymentMode, company, paymentVoucher.getCompanyBankDetails()));
// return sequenceService.getSequenceNumber(seq);
}
public void setReceiptNo(PaymentVoucher paymentVoucher, Company company, Journal journal) {

View File

@@ -17,7 +17,9 @@
*/
package com.axelor.apps.account.service.payment.paymentvoucher;
import com.axelor.apps.account.db.Invoice;
import com.axelor.apps.account.db.PaymentVoucher;
import com.axelor.apps.account.db.repo.InvoiceRepository;
import com.axelor.apps.account.db.repo.PaymentVoucherRepository;
import com.axelor.apps.account.exception.IExceptionMessage;
import com.axelor.exception.AxelorException;
@@ -40,12 +42,18 @@ public class PaymentVoucherToolService {
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE:
isDebitToPay = false;
break;
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND:
isDebitToPay = false;
break;
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_REFUND:
isDebitToPay = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE:
isDebitToPay = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND:
isDebitToPay = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_REFUND:
isDebitToPay = false;
break;
@@ -61,6 +69,40 @@ public class PaymentVoucherToolService {
return isDebitToPay;
}
public boolean isDebitToPay(Invoice invoice) throws AxelorException {
boolean isDebitToPay;
switch (invoice.getOperationTypeSelect()) {
case InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE:
isDebitToPay = false;
break;
case InvoiceRepository.OPERATION_TYPE_SUPPLIER_REFUND:
isDebitToPay = true;
break;
case InvoiceRepository.OPERATION_TYPE_CLIENT_SALE:
isDebitToPay = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND:
isDebitToPay = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND:
isDebitToPay = false;
break;
case InvoiceRepository.OPERATION_TYPE_CLIENT_REFUND:
isDebitToPay = false;
break;
default:
throw new AxelorException(
invoice,
TraceBackRepository.CATEGORY_MISSING_FIELD,
I18n.get(IExceptionMessage.INVOICE_GENERATOR_1),
invoice.getInvoiceId());
}
return isDebitToPay;
}
/**
* @param paymentVoucher : Une saisie Paiement
* <p>OperationTypeSelect 1 : Achat fournisseur 2 : Avoir fournisseur 3 : Vente client 4 :
@@ -76,12 +118,18 @@ public class PaymentVoucherToolService {
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE:
isPurchase = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND:
isPurchase = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_REFUND:
isPurchase = true;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE:
isPurchase = false;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND:
isPurchase = false;
break;
case PaymentVoucherRepository.OPERATION_TYPE_CLIENT_REFUND:
isPurchase = false;
break;

View File

@@ -0,0 +1,109 @@
package com.axelor.apps.account.web;
import java.lang.invoke.MethodHandles;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.axelor.apps.ReportFactory;
import com.axelor.apps.account.db.CashInventory;
import com.axelor.apps.account.db.PaymentVoucher;
import com.axelor.apps.account.db.repo.CashInventoryRepository;
import com.axelor.apps.account.db.repo.PaymentVoucherRepository;
import com.axelor.apps.account.report.IReport;
import com.axelor.apps.account.service.CashInventoryService;
import com.axelor.apps.base.service.ConvertNumberToFrenchWordsService;
import com.axelor.exception.AxelorException;
import com.axelor.i18n.I18n;
import com.axelor.inject.Beans;
import com.axelor.meta.schema.actions.ActionView;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
import com.google.common.base.Strings;
public class CashInventoryController {
private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public void printCashInventory(ActionRequest request, ActionResponse response)
throws AxelorException {
CashInventory cashInventory = request.getContext().asType(CashInventory.class);
String name = I18n.get("Cash");
if (!Strings.isNullOrEmpty(cashInventory.getRef())) {
name += " " + cashInventory.getRef();
}
String fileLink =
ReportFactory.createReport(String.format(IReport.CASH_INVENTORY, cashInventory.getOperationTypeSelect()), name + "-${date}")
.addParam("cashInventoryId", cashInventory.getId())
.generate()
.getFileLink();
logger.debug("Printing " + name);
response.setView(ActionView.define(name).add("html", fileLink).map());
}
public void computeGap(ActionRequest request, ActionResponse response){
CashInventory cashInventory = request.getContext().asType(CashInventory.class);
String[] arrOfStr = cashInventory.getTheoricalSolde().toString().split("\\.");
String left = Beans.get(ConvertNumberToFrenchWordsService.class).convert(Long.parseLong(arrOfStr[0]));
String right = Beans.get(ConvertNumberToFrenchWordsService.class).convert(Long.parseLong(arrOfStr[1]));
String number = left+" dinars algériens et "+right+" Cts";
response.setValue("theoricalSoldeInWords", number);
}
public void initThetoricalSoldeInWords(ActionRequest request, ActionResponse response){
CashInventory cashInventory = request.getContext().asType(CashInventory.class);
Beans.get(CashInventoryService.class).initThetoricalSoldeInWords(cashInventory);
}
public void computeToTals(ActionRequest request, ActionResponse response){
CashInventory cashInventory = request.getContext().asType(CashInventory.class);
Map<String, BigDecimal> map = Beans.get(CashInventoryService.class).computeToTals(cashInventory);
response.setValues(map);
}
public void getLastCashData(ActionRequest request, ActionResponse response){
CashInventory lastCashInventory = Beans.get(CashInventoryRepository.class).all().order("-id").fetchOne();
List<PaymentVoucher> cashVouchers = Beans.get(PaymentVoucherRepository.class).all().filter("self.operationTypeSelect = 9 and self.cashStatusSelect = 3").fetch();
BigDecimal totalSolde = lastCashInventory.getPhysicalSolde();
for (PaymentVoucher paymentVoucher : cashVouchers) {
switch (paymentVoucher.getDebitCreditSelect()) {
case "1":
totalSolde = totalSolde.subtract(paymentVoucher.getPaidAmount());
break;
case "2":
totalSolde = totalSolde.add(paymentVoucher.getPaidAmount());
break;
default:
break;
}
}
response.setValue("theoricalSolde", totalSolde);
}
}

View File

@@ -0,0 +1,52 @@
package com.axelor.apps.account.web;
import java.time.LocalDate;
import java.util.Map;
import com.axelor.apps.account.db.Invoice;
import com.axelor.apps.account.db.InvoiceTemplate;
import com.axelor.apps.account.db.repo.InvoiceRepository;
import com.axelor.apps.account.db.repo.InvoiceTemplateRepository;
import com.axelor.apps.account.service.InvoiceTemplateService;
import com.axelor.apps.account.service.invoice.print.InvoicePrintService;
import com.axelor.apps.base.db.repo.LanguageRepository;
import com.axelor.apps.report.engine.ReportSettings;
import com.axelor.exception.AxelorException;
import com.axelor.i18n.I18n;
import com.axelor.inject.Beans;
import com.axelor.meta.schema.actions.ActionView;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
import com.axelor.rpc.Context;
public class InvoiceTemplateControlller {
public void showInvoice2(ActionRequest request, ActionResponse response)
throws AxelorException {
Context context = request.getContext();
InvoiceTemplate invoiceTemplate = Beans.get(InvoiceTemplateRepository.class)
.find(Long.parseLong(context.get("id").toString()));
Invoice invoice = Beans.get(InvoiceTemplateService.class).generateInvoiceFromTemplate(invoiceTemplate);
System.out.println("*********************Invoice***********************");
System.out.println(invoice);
System.out.println("*********************Invoice***********************");
response.setView(
ActionView.define("Invoice")
.model(Invoice.class.getName())
.add("grid", "invoice-grid")
.add("form", "invoice-form")
.param("forceEdit", "true")
.context("_showRecord", String.valueOf(invoice.getId()))
.context("_operationTypeSelect", invoice.getOperationTypeSelect())
.context("todayDate", LocalDate.now())
.map());
}
}

View File

@@ -52,6 +52,12 @@ public class PayVoucherElementController {
TraceBackService.trace(response, e);
}
if (amountToPayCurrency != null) {
if(elementToPay.getRemainingAmount().compareTo(amountToPayCurrency) > 0){
BigDecimal remainingAmountAfterPayment = elementToPay.getRemainingAmount().subtract(amountToPayCurrency);
elementToPay.setRemainingAmountAfterPayment(remainingAmountAfterPayment);
}else{
elementToPay.setRemainingAmountAfterPayment(BigDecimal.ZERO);
}
elementToPay.setAmountToPayCurrency(amountToPayCurrency);
Beans.get(PayVoucherElementToPayRepository.class).save(elementToPay);
response.setReload(true);

View File

@@ -29,19 +29,26 @@ import com.axelor.apps.account.service.payment.paymentvoucher.PaymentVoucherSequ
import com.axelor.apps.base.db.BankDetails;
import com.axelor.apps.base.db.Company;
import com.axelor.apps.base.db.Partner;
import com.axelor.apps.base.db.Wizard;
import com.axelor.apps.base.db.repo.PartnerRepository;
import com.axelor.apps.base.service.BankDetailsService;
import com.axelor.apps.base.service.administration.SequenceService;
import com.axelor.db.mapper.Mapper;
import com.axelor.exception.AxelorException;
import com.axelor.exception.service.TraceBackService;
import com.axelor.i18n.I18n;
import com.axelor.inject.Beans;
import com.axelor.meta.schema.actions.ActionView;
import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
import com.google.common.base.Strings;
import com.google.inject.Singleton;
import java.lang.invoke.MethodHandles;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,9 +65,13 @@ public class PaymentVoucherController {
PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class);
if (Strings.isNullOrEmpty(paymentVoucher.getRef())) {
response.setValue(
if(paymentVoucher.getOperationTypeSelect() == 9){
response.setValue(
"ref", Beans.get(SequenceService.class).getSequenceNumber("CashSequence", paymentVoucher.getCompany()));
}else{
response.setValue(
"ref", Beans.get(PaymentVoucherSequenceService.class).getReference(paymentVoucher));
}
}
}
@@ -94,6 +105,129 @@ public class PaymentVoucherController {
}
}
public void setPaidAmount(ActionRequest request, ActionResponse response) {
PaymentVoucher paymentVoucherContext = request.getContext().asType(PaymentVoucher.class);
Map<String, BigDecimal> map = new HashMap<>();
BigDecimal total = BigDecimal.ZERO;
BigDecimal remaining = BigDecimal.ZERO;
if (paymentVoucherContext.getOperationTypeSelect()
== PaymentVoucherRepository.OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND
|| paymentVoucherContext.getOperationTypeSelect()
== PaymentVoucherRepository.OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND) {
map =
Beans.get(PaymentVoucherConfirmService.class).processSaleAndRefund(paymentVoucherContext);
for (PayVoucherDueElement each : paymentVoucherContext.getPayVoucherDueElementList()) {
if (each.isSelected()) {
total =
total.add(
each.getMoveLine()
.getDebit()
.subtract(each.getMoveLine().getCredit())
.subtract(each.getPaidAmount()));
}
}
remaining = paymentVoucherContext.getPaidAmount().subtract(total).abs();
} else {
for (PayVoucherDueElement each : paymentVoucherContext.getPayVoucherDueElementList()) {
if (each.isSelected()) {
total = total.add(each.getAmountRemaining());
}
}
}
if (paymentVoucherContext.getPaidAmount().compareTo(BigDecimal.ZERO) == 0
|| paymentVoucherContext.getPaidAmount() == null) {
response.setValue("paidAmount", total.abs());
}
response.setValue("remainingAmount", remaining);
}
public void computeRemainingAmount(ActionRequest request, ActionResponse response) {
PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class);
BigDecimal remaining = BigDecimal.ZERO;
BigDecimal totalElementToPay = BigDecimal.ZERO;
if (paymentVoucher.getPaidAmount().signum() != 0) {
if (paymentVoucher.getPayVoucherElementToPayList() != null
|| !paymentVoucher.getPayVoucherElementToPayList().isEmpty()) {
for (PayVoucherElementToPay payVoucherElementToPay :
paymentVoucher.getPayVoucherElementToPayList()) {
if (payVoucherElementToPay != null) {
if (paymentVoucher.getOperationTypeSelect() == 6) {
totalElementToPay =
totalElementToPay.add(
payVoucherElementToPay
.getMoveLine()
.getDebit()
.subtract(payVoucherElementToPay.getMoveLine().getCredit()));
} else {
totalElementToPay =
totalElementToPay.add(payVoucherElementToPay.getAmountToPayCurrency());
}
}
}
}
remaining = paymentVoucher.getPaidAmount().subtract(totalElementToPay);
} else {
remaining = totalElementToPay;
}
if (remaining.compareTo(BigDecimal.ZERO) < 0) {
remaining = BigDecimal.ZERO;
}
response.setValue("remainingAmount", remaining);
}
public void confirmRejectView(ActionRequest request, ActionResponse response) {
PaymentVoucher paymentVoucherContext = request.getContext().asType(PaymentVoucher.class);
PaymentVoucher paymentVoucher =
Beans.get(PaymentVoucherRepository.class).find(paymentVoucherContext.getId());
ActionViewBuilder confirmView =
ActionView.define("Confirm rejection")
.model(Wizard.class.getName())
.add("form", "action-payment-voucher-rejection-form")
.param("popup", "true")
.param("show-toolbar", "false")
.param("show-confirm", "false")
.param("popup-save", "false")
.param("forceEdit", "true");
confirmView.context("paymentVoucherId", paymentVoucher.getId());
response.setView(confirmView.map());
}
public void rejectPaymentVoucher(ActionRequest request, ActionResponse response)
throws AxelorException {
int paymentVoucherId = (int) request.getContext().get("paymentVoucherId");
String rejectionRaison = (String) request.getContext().get("rejectionRaison");
String rejectionInstance = (String) request.getContext().get("$rejectedInstanceSelect");
PaymentVoucher paymentVoucher =
Beans.get(PaymentVoucherRepository.class).find((long) paymentVoucherId);
// PaymentVoucher paymentVoucherCon text2 =
// request.getContext().getParent().asType(PaymentVoucher.class);
logger.debug(
"paymentVoucherId {} rejectionRaison {} paymentVoucher {} rejectionInstance {}",
paymentVoucherId,
rejectionRaison,
paymentVoucher,
rejectionInstance);
PaymentVoucher paymentVoucher2 =Beans.get(PaymentVoucherConfirmService.class)
.rejectPaymentVoucher(paymentVoucher, rejectionRaison);
// response.setReload(true);
response.setView(
ActionView.define("PaymentVoucher")
.model(PaymentVoucher.class.getName())
.add("form", "payment-voucher-cashing-form")
.add("grid", "payment-voucher-grid")
.context("_showRecord", paymentVoucher2.getId().toString())
.domain("self.id = " + paymentVoucher2.getId())
.map());
}
// Reset imputation
public void resetImputation(ActionRequest request, ActionResponse response) {
@@ -136,7 +270,48 @@ public class PaymentVoucherController {
paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(paymentVoucher.getId());
try {
Beans.get(PaymentVoucherConfirmService.class).confirmPaymentVoucher(paymentVoucher);
Beans.get(PaymentVoucherConfirmService.class).confirmPaymentVoucher(paymentVoucher, false);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
// Confirm the payment voucher
public void confirmPaymentVoucherFinal(ActionRequest request, ActionResponse response) {
PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class);
paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(paymentVoucher.getId());
try {
Beans.get(PaymentVoucherConfirmService.class).confirmPaymentVoucher(paymentVoucher, true);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
// Confirm the payment voucher
public void confirmOtherPayment(ActionRequest request, ActionResponse response) {
PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class);
paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(paymentVoucher.getId());
try {
Beans.get(PaymentVoucherConfirmService.class).confirmOtherPayment(paymentVoucher);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
public void confirmCashPayment(ActionRequest request, ActionResponse response) {
PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class);
paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(paymentVoucher.getId());
try {
Beans.get(PaymentVoucherConfirmService.class).confirmCashPayment(paymentVoucher);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
@@ -204,4 +379,87 @@ public class PaymentVoucherController {
TraceBackService.trace(response, e);
}
}
public void confirmMultipleVoucher(ActionRequest request,ActionResponse response) throws AxelorException {
List<PaymentVoucher> voucherList = new ArrayList<>();
List<PayVoucherElementToPay> elementToPays = new ArrayList<>();
@SuppressWarnings("unchecked")
List<Integer> idList = (List<Integer>) request.getContext().get("_ids");
for (Integer id : idList) {
PaymentVoucher paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(id.longValue());
voucherList.add(paymentVoucher);
elementToPays.addAll(paymentVoucher.getPayVoucherElementToPayList());
}
Move move = Beans.get(PaymentVoucherConfirmService.class).confirmMultipleVoucher(voucherList, elementToPays,true);
response.setView(
ActionView.define(I18n.get("Move"))
.model(Move.class.getName())
.add("grid", "move-grid")
.add("form", "move-form")
.context("_showRecord", String.valueOf(move.getId()))
.map());
}
public void getVoucherData(ActionRequest request,ActionResponse response) throws AxelorException {
List<PaymentVoucher> voucherList = new ArrayList<>();
List<PayVoucherElementToPay> elementToPays = new ArrayList<>();
@SuppressWarnings("unchecked")
List<Integer> idList = (List<Integer>) request.getContext().get("_ids");
BigDecimal totalVoucher = BigDecimal.ZERO;
BigDecimal totalAmount = BigDecimal.ZERO;
BigDecimal totalImputedAmount = BigDecimal.ZERO;
BigDecimal totalRemainingAmountAfterPayment = BigDecimal.ZERO;
BigDecimal totalAmountRefund = BigDecimal.ZERO;
BigDecimal totalImputedAmountRefund = BigDecimal.ZERO;
BigDecimal totalRemainingAmountAfterPaymentRefund = BigDecimal.ZERO;
for (Integer id : idList) {
PaymentVoucher paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(id.longValue());
voucherList.add(paymentVoucher);
elementToPays.addAll(paymentVoucher.getPayVoucherElementToPayList());
}
totalVoucher = voucherList.stream().map(t -> t.getPaidAmount()).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
for (PayVoucherElementToPay elementPay : elementToPays) {
Invoice invoice = elementPay.getMoveLine().getMove().getInvoice();
if( invoice.getOperationSubTypeSelect() == InvoiceRepository.OPERATION_SUB_TYPE_FINANCIAL_REFUNDS
|| invoice.getOperationSubTypeSelect() == InvoiceRepository.OPERATION_TYPE_SUPPLIER_REFUND){
totalImputedAmountRefund = totalImputedAmount.add(elementPay.getAmountToPay());
totalRemainingAmountAfterPaymentRefund = totalRemainingAmountAfterPayment.add(elementPay.getRemainingAmountAfterPayment());
totalAmountRefund = totalAmount.add(elementPay.getTotalAmount());
}else{
totalImputedAmount = totalImputedAmount.add(elementPay.getAmountToPay());
totalRemainingAmountAfterPayment = totalRemainingAmountAfterPayment.add(elementPay.getRemainingAmountAfterPayment());
totalAmount = totalAmount.add(elementPay.getTotalAmount());
}
}
response.setView(
ActionView.define("Calculation")
.model(Wizard.class.getName())
.add("form", "account-payment-voucher-calculation-wizard-form")
.param("popup", "true")
.param("show-toolbar", "false")
.param("show-confirm", "false")
.param("width", "800")
.param("popup-save", "false")
.context("_totalVoucher", totalVoucher)
.context("_totalImputedAmount", totalImputedAmount)
.context("_totalRemainingAmountAfterPayment", totalRemainingAmountAfterPayment)
.context("_totalAmount", totalAmount)
.context("_totalImputedAmountRefund", totalImputedAmountRefund)
.context("_totalRemainingAmountAfterPaymentRefund", totalRemainingAmountAfterPaymentRefund)
.context("_totalAmountRefund", totalAmountRefund)
.map());
}
}

View File

@@ -55,12 +55,12 @@ public class ImportPaymentVoucher {
PayVoucherDueElement payVoucherDueElement =
paymentVoucherLoadService.createPayVoucherDueElement(moveLineToPay);
paymentVoucher.addPayVoucherElementToPayListItem(
paymentVoucherLoadService.createPayVoucherElementToPay(payVoucherDueElement, 1));
paymentVoucherLoadService.createPayVoucherElementToPay(payVoucherDueElement, 1,paymentVoucher.getRemainingAmount()));
}
if (paymentVoucher.getStatusSelect() == PaymentVoucherRepository.STATUS_CONFIRMED) {
paymentVoucherConfirmService.confirmPaymentVoucher(paymentVoucher);
paymentVoucherConfirmService.confirmPaymentVoucher(paymentVoucher, false);
}
return paymentVoucher;
} catch (Exception e) {

View File

@@ -28,7 +28,9 @@
<boolean name="analyticDistributionAuthorized" title="Analytic distribution authorized" massUpdate="true"/>
<boolean name="isTaxAuthorizedOnMoveLine" title="Tax authorized on move line" massUpdate="true"/>
<boolean name="isTaxRequiredOnMoveLine" title="Tax required on move line" massUpdate="true"/>
<many-to-many name="batchSet" ref="com.axelor.apps.base.db.Batch" title="Batchs"/>
<boolean name="isUsedOnVoucher" title="Used on voucher" massUpdate="true"/>
<many-to-many name="batchSet" ref="com.axelor.apps.base.db.Batch" title="Batchs"/>
<boolean name="isOriginRequired" title="Is origin required" massUpdate="true"/>
<track>

View File

@@ -21,6 +21,7 @@
<many-to-one name="autoMiscOpeJournal" ref="com.axelor.apps.account.db.Journal" title="Auto Misc. Operation Journal"/>
<many-to-one name="manualMiscOpeJournal" ref="com.axelor.apps.account.db.Journal" title="Manual Misc. Operation Journal"/>
<many-to-one name="reportedBalanceJournal" ref="com.axelor.apps.account.db.Journal" title="Reported Balance Journal"/>
<many-to-one name="cashJournal" ref="com.axelor.apps.account.db.Journal" title="Cash Journal"/>
<many-to-one name="saleJournalType" ref="com.axelor.apps.account.db.JournalType" title="Sales journal type"/>
<many-to-one name="purchaseJournalType" ref="com.axelor.apps.account.db.JournalType" title="Purchase journal type"/>
@@ -37,11 +38,16 @@
<many-to-one name="employeeAccount" ref="com.axelor.apps.account.db.Account" title="Employee account"/>
<many-to-one name="irrecoverableAccount" ref="com.axelor.apps.account.db.Account" title="Irrecoverable account"/>
<many-to-one name="cashPositionVariationAccount" ref="com.axelor.apps.account.db.Account" title="Cashier Regulation account"/>
<many-to-one name="taxAccount" ref="com.axelor.apps.account.db.Account" title="Tax Account"/>
<many-to-one name="stampAccount" ref="com.axelor.apps.account.db.Account" title="Stamp Account"/>
<many-to-one name="cashPositionVariationAccountPlus" ref="com.axelor.apps.account.db.Account" title="Cashier Regulation account plus"/>
<many-to-one name="advancePaymentAccount" ref="com.axelor.apps.account.db.Account" title="Advance Payment Account"/>
<many-to-one name="factorDebitAccount" ref="com.axelor.apps.account.db.Account"/>
<many-to-one name="factorCreditAccount" ref="com.axelor.apps.account.db.Account"/>
<many-to-one name="yearOpeningAccount" ref="com.axelor.apps.account.db.Account" title="Year opening account"/>
<many-to-one name="yearClosureAccount" ref="com.axelor.apps.account.db.Account" title="Year closure account"/>
<one-to-many name="accountPaymentWithoutInvoice" ref="com.axelor.apps.account.db.Account" title="Account payment without invoice"/>
<many-to-one name="cashAccount" ref="com.axelor.apps.account.db.Account" title="Cash account"/>
<!-- Automatic account creation for partners -->
@@ -209,6 +215,7 @@
<field name="employeeAccount" on="UPDATE"/>
<field name="irrecoverableAccount" on="UPDATE"/>
<field name="cashPositionVariationAccount" on="UPDATE"/>
<field name="cashPositionVariationAccountPlus" on="UPDATE"/>
<field name="advancePaymentAccount" on="UPDATE"/>
<field name="factorDebitAccount" on="UPDATE"/>
<field name="factorCreditAccount" on="UPDATE"/>
@@ -310,4 +317,3 @@
</entity>
</domain-models>

View File

@@ -11,6 +11,7 @@
<many-to-one name="saleAccount" ref="com.axelor.apps.account.db.Account" title="Sale account"/>
<many-to-one name="cashAccount" ref="com.axelor.apps.account.db.Account" title="Payment account"/>
<many-to-one name="stockAccount" ref="com.axelor.apps.account.db.Account" title="Stock account"/>
<many-to-one name="consumptionAccount" ref="com.axelor.apps.account.db.Account" title="Consumption account"/>
<many-to-one name="purchFixedAssetsAccount" ref="com.axelor.apps.account.db.Account" title="Account of purchase fixed assets"/>
<many-to-one name="paymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="Payment mode"/>

View File

@@ -48,6 +48,9 @@
<boolean name="displayNameAccountColumnOnPrinting" title="Display column with accounting name"/>
<boolean name="displayMoveLineSequenceOnPrinting" title="Display moveline sequence"/>
<string name="statusSelectAccount" title="Statuses to take into account" />
<unique-constraint columns="ref,company"/>
<extra-code><![CDATA[

View File

@@ -15,6 +15,11 @@
<many-to-one name="supplierAccount" ref="com.axelor.apps.account.db.Account" title="Supplier account"/>
<many-to-one name="employeeAccount" ref="com.axelor.apps.account.db.Account" title="Employee account"/>
<!-- OTHER PAYMENTS -->
<many-to-one name="partnerPaymentAccount" ref="com.axelor.apps.account.db.Account" title="Partner payment account"/>
<integer name="diretion" title="Status" readonly="true" selection="iaccount.account.situation.payment.direction" default="1"/>
<!-- PAGE Compte Client -->
<decimal name="balanceCustAccount" title="Total balance" readonly="true"/>
<decimal name="balanceDueCustAccount" title="Due balance" readonly="true"/>

View File

@@ -26,6 +26,9 @@
<boolean name="paymentVouchersOnInvoice" />
<boolean name="activatePassedForPayment" title="Activate passed for payment"/>
<integer name="supplierCodeSequence" title="Supplier code" />
<integer name="clientCodeSequence" title="Client code" />
<extra-code><![CDATA[

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
<module name="account" package="com.axelor.apps.account.db"/>
<entity name="CashDenomination" lang="java" cacheable="true">
<string name="name" title="Name" required="true"/>
<string name="code" title="Code" required="true" hashKey="true"/>
<integer name="typeSelect" title="Type select" selection="account.cash.denomination.type.select"/>
<decimal name="denominationValue" title="Denomination value"/>
<extra-code><![CDATA[
// TTPE SELECT
public static final int BANK_NOTE_TYPE = 1;
public static final int COINT_TYPE = 2;
]]></extra-code>
<track>
<field name="name"/>
<field name="code"/>
<field name="denominationValue"/>
</track>
</entity>
</domain-models>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
<module name="account" package="com.axelor.apps.account.db"/>
<entity name="CashInventory" lang="java">
<string name="ref" title="Reference" namecolumn="true" required="false"/>
<integer name="statusSelect" title="Status" default="1" readonly="true" selection="account.cash.status.select"/>
<integer name="operationTypeSelect" title="Payment type" required="true" selection="account.cash.operation.type.select"/>
<datetime name="realDate" />
<decimal name="theoricalSolde" />
<decimal name="physicalSolde" />
<many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company"/>
<string name="amountInWords" title="Amount in words"/>
<string name="theoricalSoldeInWords" title="Theorical solde in words"/>
<decimal name="gap" title="Gap" />
<decimal name="numbeLastCashPiece" title="Number of last cash piece" />
<many-to-one name="approvedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Approved by"/>
<datetime name="approvalDate" title="Approval date" readonly="true"/>
<many-to-one name="valdiatedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Validated by"/>
<datetime name="validattionDate" title="Validation date" readonly="true"/>
<decimal name="totalCoinsAmount" title="Total coins amount" />
<decimal name="totalBankNotesAmount" title="Total bank notes amount" />
<decimal name="totalCash" title="Total cash" />
<one-to-many ref="CashInventoryLine" name="cashInventoryLines" title="Cash inventory lines"/>
<track>
<field name="name"/>
<field name="code"/>
<field name="denominationValue"/>
<field name="denominationQuantity"/>
<field name="theoricalSolde"/>
<field name="physicalSolde"/>
</track>
</entity>
</domain-models>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
<module name="account" package="com.axelor.apps.account.db"/>
<entity name="CashInventoryLine" lang="java">
<many-to-one name="cashInventory" ref="CashInventory" title="Cash inventory"/>
<many-to-one name="cashDenomination" ref="CashDenomination" title="Cash denomination"/>
<integer name="cashCount" />
<decimal name="totalCashCount" />
<track>
<field name="name"/>
<field name="code"/>
<field name="denominationValue"/>
<field name="denominationQuantity"/>
<field name="theoricalSolde"/>
<field name="physicalSolde"/>
</track>
</entity>
</domain-models>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
<module name="base" package="com.axelor.apps.base.db"/>
<entity name="ClientBank" lang="java">
<string name="label" namecolumn="true" title="Label" />
<string name="ownerName" title="Owner name" max="255"/>
<boolean name="active" title="Active" default="true"/>
</entity>
</domain-models>

View File

@@ -145,6 +145,7 @@
<!-- is approach -->
<boolean name="isInvoiceApproach" title="Facture d'approche" />
<boolean name="isImportationPartnerInvoice" title="Partner invoice" />
<decimal name="stamp" title="stamp" scale="2" precision="20" />
<decimal name="fixTax" title="fix Tax" scale="2" precision="20" />

View File

@@ -86,6 +86,12 @@
public static final int PACK_PRICE_ONLY = 0;
public static final int SUBLINE_PRICE_ONLY = 1;
]]></extra-code>
<track>
<field name="qty" />
<field name="price" />
</track>
</entity>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
<module name="account" package="com.axelor.apps.account.db"/>
<entity name="InvoiceTemplate" lang="java" cacheable="true">
<string name="name" title="Name" required="true"/>
<string name="code" title="Code" required="true"/>
<many-to-one name="partner" ref="com.axelor.apps.base.db.Partner" required="true" title="Partner" />
<!-- <many-to-one name="invoiceTemplateType" ref="MoveTemplateType" title="Type" required="1"/> -->
<many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" required="1" />
<boolean name="isValid" title="Valid" />
<many-to-one name="paymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="Payment mode" />
<many-to-one name="paymentCondition" ref="com.axelor.apps.account.db.PaymentCondition" title="Payment condition" />
<one-to-many name="moveTemplateLineList" ref="InvoiceTemplateLine" mappedBy="invoiceTemplate" title="Template Invoice Lines"/>
<date name="endOfValidityDate" title="End of validity date"/>
<string name="fullName" namecolumn="true" search="code,name">
<![CDATA[
return code+" - " + name;
]]>
</string>
</entity>
</domain-models>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
<module name="account" package="com.axelor.apps.account.db"/>
<entity name="InvoiceTemplateLine" lang="java" cacheable="true">
<many-to-one name="invoiceTemplate" title="Invoice template" ref="InvoiceTemplate" />
<many-to-one name="product" ref="com.axelor.apps.base.db.Product" title="Product"/>
<string name="productName" title="Product Name"/>
<string name="productCode" title="Product Code"/>
<boolean name="isValid" title="Valid"/>
<decimal name="qty" title="Qty" precision="20" scale="2" default="1"/>
</entity>
</domain-models>

View File

@@ -24,6 +24,7 @@
<boolean name="accountingOk" title="Exported" default="false"/>
<many-to-one name="accountingReport" ref="com.axelor.apps.account.db.AccountingReport" title="Accounting Export"/>
<many-to-one name="paymentVoucher" ref="com.axelor.apps.account.db.PaymentVoucher" title="Payment voucher"/>
<one-to-many name="paymentVoucherList" ref="com.axelor.apps.account.db.PaymentVoucher" title="Payment voucher list"/>
<many-to-one name="companyCurrency" ref="com.axelor.apps.base.db.Currency" title="Company currency"/>
<string name="companyCurrencyCode" title="Company currency code"/>
<many-to-one name="currency" ref="com.axelor.apps.base.db.Currency" title="Currency"/>

View File

@@ -75,7 +75,7 @@
<string name="name" title="Name" namecolumn="true">
<![CDATA[
if (move != null && move.getReference() != null){
return move.getReference() + "-" + Integer.toString(counter);
return move.getReference() + "-" + (counter != null ? Integer.toString(counter) : "0") ;
}
else {
return Integer.toString(counter);

View File

@@ -10,6 +10,7 @@
<decimal name="payerQuality" title="Payer quality" readonly="true"/>
<one-to-many name="accountingSituationList" ref="com.axelor.apps.account.db.AccountingSituation" mappedBy="partner" title="Accounting situation"/>
<one-to-many name="accountingManagementList" ref="com.axelor.apps.account.db.AccountManagement" mappedBy="partner" title="Account management"/>
<string name="invoiceSendingFormatSelect" title="Invoice sending media" selection="invoice.account.condition.invoice.sending.format.select"/>
<many-to-one name="inPaymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="In Payment Mode" index="false"/>

View File

@@ -8,20 +8,26 @@
<entity name="PaymentVoucher" sequential="true" lang="java">
<string name="ref" title="Reference" namecolumn="true" required="false"/>
<many-to-one name="partner" title="Partner" ref="com.axelor.apps.base.db.Partner" required="true"/>
<many-to-one name="partner" title="Partner" ref="com.axelor.apps.base.db.Partner" required="false"/>
<many-to-one name="account" ref="com.axelor.apps.account.db.Account" title="Partner account"/>
<many-to-one name="paymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="Payment mode" required="true"/>
<many-to-one name="accountOther" ref="com.axelor.apps.account.db.Account" title="Account other"/>
<many-to-one name="paymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="Payment mode" required="false"/>
<many-to-one name="companyBankDetails" ref="com.axelor.apps.base.db.BankDetails" title="Company bank details"/>
<many-to-one name="clientBanks" ref="com.axelor.apps.base.db.ClientBank" title="Client bank details"/>
<date name="paymentDate" title="Payment date"/>
<decimal name="paidAmount" title="Amount paid" />
<many-to-one name="user" column="user_id" ref="com.axelor.auth.db.User" title="User" readonly="true"/>
<many-to-one name="moveLine" ref="com.axelor.apps.account.db.MoveLine" title="Overdue moveline" />
<many-to-one name="moveLinePay" ref="com.axelor.apps.account.db.MoveLine" title="Pay moveline" />
<decimal name="remainingAllocatedAmount" title="Amount Remaining to allocate" />
<decimal name="allocatedAmount" title="Allocated amount" />
<one-to-many name="payVoucherDueElementList" ref="com.axelor.apps.account.db.PayVoucherDueElement" title="List of invoices/schedule lines with remaining amount to pay" mappedBy="paymentVoucher" />
<one-to-many name="payVoucherElementToPayList" ref="com.axelor.apps.account.db.PayVoucherElementToPay" title="List of invoices to pay" mappedBy="paymentVoucher" />
<integer name="statusSelect" title="Status" default="1" readonly="true" selection="iaccount.payment.voucher.status.select"/>
<integer name="cashStatusSelect" title="Cash status" default="1" readonly="true" selection="iaccount.cash.status.select"/>
<integer name="statusTypeSelect" title="Status" default="1" readonly="true" selection="iaccount.payment.voucher.status.type.select"/>
<many-to-one name="generatedMove" ref="com.axelor.apps.account.db.Move" title="Generated move" readonly="true"/>
<one-to-many name="generatedMoveList" ref="com.axelor.apps.account.db.Move" title="Generated moves" readonly="true"/>
<boolean name="hasAutoInput" title="Auto. input." default="false"/>
<many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" required="true"/>
<string name="bankCardTransactionNumber" title="CC Transaction N°" readonly="true"/>
@@ -36,23 +42,7 @@
<!-- <integer name="operationTypeSelect" title="Type de saisie paiement" required="true" selection="ipayment.operation.type.select"/> -->
<integer name="operationTypeSelect" title="Payment type" required="true" selection="iinvoice.operation.type.select"/>
<decimal name="remainingAmount" title="Amount remaining to allocate">
<![CDATA[
BigDecimal totalElementToPay = BigDecimal.ZERO;
if (getPaidAmount().signum() != 0) {
if (getPayVoucherElementToPayList() != null || !getPayVoucherElementToPayList().isEmpty() ) {
for (PayVoucherElementToPay payVoucherElementToPay : getPayVoucherElementToPayList()) {
if (payVoucherElementToPay != null) {
totalElementToPay = totalElementToPay.add(payVoucherElementToPay.getAmountToPayCurrency());
}
}
}
return getPaidAmount().subtract(totalElementToPay);
} else {
return totalElementToPay;
}
]]>
</decimal>
<decimal name="remainingAmount" title="Amount remaining to allocate" />
<string name="chequeNumber" />
<string name="chequeBank" />
@@ -74,7 +64,48 @@
<many-to-one name="recipientUser" ref="com.axelor.auth.db.User" readonly="true" title="recipient"/>
<date name="invoiceDate" title="invoice Date" />
<date name="dueDate" title="Due Date" />
<date name="puttingtDate" title="Credit Date" />
<!-- creadit date -->
<date name="creditDate" title="Credit Date" />
<date name="cagexDeadline" title="Cagex deadline" />
<!-- date d'enlevement -->
<date name="deliveryDate" title="Delivery Date" />
<date name="paymentEmissionDate" title="payment emission Date" />
<boolean name="rejected" default="false" title="Rejected" />
<date name="rejectedDate" title="Rejected Date" />
<many-to-one name="rejectedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Rejected by"/>
<integer name="rejectedInstanceSelect" title="Status" selection="iaccount.payment.voucher.rejection.status.select" />
<decimal name="rejectAmountFee" title="Reject Amount Fee"/>
<decimal name="amountAfterRejection" title="Amount after rejection"/>
<string name="rejectionRaison" large="true"/>
<integer name="sort" title="Sort" default="1" selection="iaccount.payment.voucher.sort.select"/>
<!-- <string name="clientBank" title="Client bank" selection="iaccount.payment.voucher.client.bank"/> -->
<string name="commercialTransactionNumber" title="Commercial Transaction N°" />
<many-to-one name="originPaymentVoucher" ref="com.axelor.apps.account.db.PaymentVoucher" title="Payment voucher"/>
<many-to-one name="paymentCondition" ref="com.axelor.apps.account.db.PaymentCondition" title="Payment condition" />
<date name="approvalDate" title="Approval date" />
<many-to-one name="approvedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Approved by"/>
<date name="refusalDate" title="Refusal date" />
<many-to-one name="refusedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Refused by"/>
<!-- date reception sur service finnance -->
<date name="receptionDateInOffice" title="Reception date in office" />
<many-to-one name="purchaseOrder" ref="com.axelor.apps.purchase.db.PurchaseOrder" title="Purchase Order" />
<string name="debitCreditSelect" title="Debit/Credit" selection="move.voucher.debit.credit.select"/>
<unique-constraint columns="ref,company"/>
<unique-constraint columns="receiptNo,company"/>
@@ -84,15 +115,31 @@
public static final int STATUS_DRAFT = 1;
public static final int STATUS_WAITING_FOR_DEPOSIT_SLIP = 2;
public static final int STATUS_CONFIRMED = 3;
public static final int STATUS_REQUESTED = 0;
public static final int STATUS_ACCEPTED = 4;
public static final int STATUS_APPROUVED = 5;
public static final int STATUS_REJECTED = 6;
public static final int STATUS_REFUSED = 7;
// OPERATION TYPE SELECT
public static final int OPERATION_TYPE_SUPPLIER_PURCHASE = 1;
public static final int OPERATION_TYPE_SUPPLIER_REFUND = 2;
public static final int OPERATION_TYPE_CLIENT_SALE = 3;
public static final int OPERATION_TYPE_CLIENT_REFUND = 4;
public static final int OPERATION_TYPE_CLIENT_SALE_CLIENT_REFUND = 6;
public static final int OPERATION_TYPE_SUPPLIER_PURCHASE_SUPPLIER_REFUND = 7;
public static final int OTHER = 8;
public static final int CASH = 9;
]]></extra-code>
<track>
<field name="statusSelect"/>
<message if="true" on="CREATE">Voucher created</message>
<message if="statusSelect == 3" tag="important">Confirmed</message>
</track>
</entity>
</domain-models>
</domain-models>

View File

@@ -12,6 +12,8 @@
<decimal name="amount" title="Amount reconciled" default="0.0" initParam="true"/>
<many-to-one name="debitMoveLine" ref="MoveLine" title="Debit line" required="true" initParam="true"/>
<many-to-one name="creditMoveLine" ref="MoveLine" title="Credit line" required="true" initParam="true"/>
<one-to-many name="debitMoveLineList" ref="MoveLine" title="Debit line list" />
<one-to-many name="creditMoveLineList" ref="MoveLine" title="Credit line list" />
<integer name="statusSelect" title="Status" default="1" readonly="true" selection="account.reconcile.status.select" initParam="true"/>
<date name="reconciliationDate" title="Reconciliation date" readonly="true"/>
<!-- Will be fully reconciled if the payment amount is with a range of +/-20 cts compare to the amount remaining to pay -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 4.6.0.v201606072122</property>
<property name="createdBy">Eclipse BIRT Designer Version 4.8.0.v201806261756</property>
<list-property name="propertyBindings">
<structure>
<property name="name">odaURL</property>
@@ -131,8 +131,9 @@
</ex-property>
</list-property>
<property name="odaDriverClass">org.postgresql.Driver</property>
<property name="odaURL">jdbc:postgresql://localhost:5432/axelor-open-suite</property>
<property name="odaUser">axelor</property>
<property name="odaURL">jdbc:postgresql://localhost:5432/bdd_last</property>
<property name="odaUser">postgres</property>
<encrypted-property name="odaPassword" encryptionID="base64">SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ=</encrypted-property>
</oda-data-source>
</data-sources>
<data-sets>
@@ -1979,8 +1980,16 @@ else{
</column>
<header>
<row id="4052">
<property name="backgroundColor">#C0C0C0</property>
<cell id="4142"/>
<cell id="4053"/>
<cell id="4053">
<text id="4270">
<property name="fontSize">9.5pt</property>
<property name="fontWeight">bold</property>
<property name="contentType">auto</property>
<text-property name="content"><![CDATA[Ecriture]]></text-property>
</text>
</cell>
<cell id="4252">
<text id="4265">
<property name="fontSize">9.5pt</property>
@@ -2397,6 +2406,7 @@ else{
<property name="colSpan">13</property>
<property name="rowSpan">1</property>
<data id="4115">
<property name="backgroundColor">#C0C0C0</property>
<property name="resultSetColumn">account</property>
</data>
</cell>
@@ -2404,6 +2414,7 @@ else{
</header>
<footer>
<row id="4106">
<property name="backgroundColor">#C0C0C0</property>
<cell id="4145"/>
<cell id="4107">
<property name="colSpan">7</property>
@@ -2465,8 +2476,25 @@ else{
<detail>
<row id="4067">
<method name="onCreate"><![CDATA[vars["PreviousBalance"]=row["balance"]]]></method>
<cell id="4144"/>
<cell id="4144">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
</cell>
<cell id="4068">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4269">
<property name="fontSize">8.5pt</property>
<list-property name="visibility">
@@ -2489,6 +2517,14 @@ else{
</data>
</cell>
<cell id="4254">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4266">
<property name="fontSize">8.5pt</property>
<property name="textAlign">center</property>
@@ -2496,6 +2532,14 @@ else{
</data>
</cell>
<cell id="4260">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4267">
<property name="fontSize">8.5pt</property>
<property name="textAlign">center</property>
@@ -2503,6 +2547,14 @@ else{
</data>
</cell>
<cell id="4070">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4073">
<property name="fontSize">8.5pt</property>
<structure name="dateTimeFormat">
@@ -2514,6 +2566,14 @@ else{
</data>
</cell>
<cell id="4234">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4239">
<property name="fontSize">8.5pt</property>
<structure name="dateTimeFormat">
@@ -2525,6 +2585,14 @@ else{
</data>
</cell>
<cell id="4246">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4251">
<property name="fontSize">8.5pt</property>
<property name="textAlign">left</property>
@@ -2532,18 +2600,42 @@ else{
</data>
</cell>
<cell id="4072">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4071">
<property name="fontSize">8.5pt</property>
<property name="resultSetColumn">move_line_description</property>
</data>
</cell>
<cell id="4074">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4075">
<property name="fontSize">8.5pt</property>
<property name="resultSetColumn">partner</property>
</data>
</cell>
<cell id="4078">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4079">
<property name="fontSize">8.5pt</property>
<structure name="numberFormat">
@@ -2555,6 +2647,14 @@ else{
</data>
</cell>
<cell id="4080">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4081">
<property name="fontSize">8.5pt</property>
<structure name="numberFormat">
@@ -2566,6 +2666,14 @@ else{
</data>
</cell>
<cell id="4150">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4155">
<property name="fontSize">8.5pt</property>
<structure name="numberFormat">
@@ -2583,6 +2691,14 @@ else{
</data>
</cell>
<cell id="4222">
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<data id="4242">
<property name="fontSize">8.5pt</property>
<property name="marginLeft">1pt</property>

View File

@@ -71,6 +71,7 @@
<panel name="paymentDifferencesPanel" title="Payment differences" colSpan="12">
<field name="thresholdDistanceFromRegulation"/>
<field name="cashPositionVariationAccount" domain="self.company = :company" grid-view="account-grid" form-view="account-form"/>
<field name="cashPositionVariationAccountPlus" domain="self.company = :company" grid-view="account-grid" form-view="account-form"/>
</panel>
<panel name="authorizeAutoReconcilePanel" title="Authorize auto reconcile" colSpan="12">
<field name="autoReconcileOnInvoice"/>