diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..299152f --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +./init-db \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2f85c30..3d77534 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,8 @@ hs_err_pid* node_modules src/main/resources/application.properties +src/main/resources/application.properties +src/main/resources/application.properties +init-db/bdd_sophal202506281027.sql +modules/axelor-open-suite/axelor-account/src/test/resources/META-INF/persistence.xml +modules/axelor-open-suite/axelor-supplychain/src/test/java/com/axelor/apps/supplychain/db/StockMove.java diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4782f52 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM openjdk:8-jdk-alpine + +WORKDIR /app + +# Install dos2unix for line-ending fixes +RUN apk add --no-cache bash dos2unix + +# Copy everything +COPY . . + +# Fix line endings for gradlew +RUN dos2unix ./gradlew && chmod +x ./gradlew + +# Clean and run the Gradle app +CMD ["./gradlew", "clean", "run", "--no-daemon"] + + diff --git a/build.gradle b/build.gradle index bcc93af..607f546 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,15 @@ buildscript { mavenCentral() mavenLocal() jcenter() - maven { url 'https://plugins.gradle.org/m2/' } - maven { url 'https://repository.axelor.com/nexus/public/' } + maven { + url 'https://plugins.gradle.org/m2/' + metadataSources { + artifact() + } + } + maven { + url 'https://repository.axelor.com/nexus/public/' + } } ext.openPlatformVersion = '5.2.2' ext.appVersion = '5.2.1' @@ -55,7 +62,7 @@ dependencies { } wrapper { - gradleVersion = "4.4.1" + gradleVersion = "4.5.1" } task("dataImport", type: JavaExec) { @@ -80,4 +87,23 @@ task archiveReports(type: Zip) { destinationDir = file("$buildDir/libs") } +war { + destinationDir = file("C:/apache-tomcat-8.5.0/webapps") + archiveName = "sophal2.war" +} + +task stopTomcat(type: Exec) { + dependsOn stopTomcat + workingDir 'C:/apache-tomcat-8.5.0/bin' + commandLine 'cmd', '/c', 'shutdown.bat' +} + +task startTomcat(type: Exec) { + dependsOn war + workingDir 'C:/apache-tomcat-8.5.0/bin' + commandLine 'cmd', '/c', 'startup.bat' + // commandLine 'cmd', '/c', 'start', '/b', 'startup.bat' +} + + build.finalizedBy archiveReports diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e6bb025 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,51 @@ +version: '3.8' + +services: + app: + build: . + depends_on: + - db + environment: + - DB_HOST=db + - DB_PORT=5432 + - DB_NAME=bdd_sophal + - DB_USER=postgres + - DB_PASSWORD=root + ports: + - "8080:8080" + networks: + - backend + + db: + image: postgres:9.6 + environment: + POSTGRES_DB: bdd_sophal + POSTGRES_USER: postgres + POSTGRES_PASSWORD: root + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - "5433:5432" + networks: + - backend + volumes: + - pgdata:/var/lib/postgresql/data + - ./init-db:/docker-entrypoint-initdb.d + + + pgadmin: + image: dpage/pgadmin4 + environment: + PGADMIN_DEFAULT_EMAIL: admin@admin.com + PGADMIN_DEFAULT_PASSWORD: admin + ports: + - "5050:80" + depends_on: + - db + networks: + - backend + +volumes: + pgdata: + +networks: + backend: diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2c2bbe5..568c50b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip diff --git a/modules/axelor-open-suite/axelor-account/build.gradle b/modules/axelor-open-suite/axelor-account/build.gradle index e1379c2..35b0641 100644 --- a/modules/axelor-open-suite/axelor-account/build.gradle +++ b/modules/axelor-open-suite/axelor-account/build.gradle @@ -17,6 +17,9 @@ dependencies { compile project(":modules:axelor-purchase") compile 'xalan:xalan:2.7.2' + testImplementation 'org.mockito:mockito-core:4.8.0' // Or latest version + + compile group: 'jdom', name: 'jdom', version: '1.1' compile group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '2.5.0' compile "org.bouncycastle:bcprov-jdk15on:1.62" diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/exception/IExceptionMessage.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/exception/IExceptionMessage.java index d4d9785..09f3c12 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/exception/IExceptionMessage.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/exception/IExceptionMessage.java @@ -797,4 +797,8 @@ public interface IExceptionMessage { static final String CLOSE_NO_REPORTED_BALANCE_DATE = /*$$(*/ "Please set a reported balance date on fiscal year" /*)*/; + + + String CASH_INVENTORY_MISSING_SEQUENCE = /*$$(*/ + "There is no configured sequence for cash inventory" /*)*/; } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/CashInventoryService.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/CashInventoryService.java index 8359207..457cf66 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/CashInventoryService.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/CashInventoryService.java @@ -1,5 +1,21 @@ package com.axelor.apps.account.service; +import com.axelor.apps.account.db.CashInventory; +import com.axelor.apps.account.db.CashInventoryLine; +import com.axelor.apps.account.db.CashRegister; +import com.axelor.apps.account.db.repo.CashDenominationRepository; +import com.axelor.apps.account.db.repo.CashInventoryRepository; +import com.axelor.apps.account.db.repo.CashRegisterRepository; +import com.axelor.apps.account.exception.IExceptionMessage; +import com.axelor.apps.base.db.Company; +import com.axelor.apps.base.service.administration.SequenceService; +import com.axelor.auth.AuthUtils; +import com.axelor.exception.AxelorException; +import com.axelor.exception.db.repo.TraceBackRepository; +import com.axelor.i18n.I18n; +import com.axelor.inject.Beans; +import com.google.inject.Inject; +import com.google.inject.persist.Transactional; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; @@ -7,75 +23,128 @@ 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); + private SequenceService sequenceService; + + @Inject + public CashInventoryService(SequenceService sequenceService) { + this.sequenceService = sequenceService; + } + + /** + * Initialize the theorical solde in words for a new cash inventory. + * + * @return the theorical solde in words as a BigDecimal + */ + public BigDecimal initThetoricalSolde() { + CashRegisterRepository casRegisterRepository = Beans.get(CashRegisterRepository.class); + CashRegister cashRegister = casRegisterRepository.all().order("-createdOn").fetchOne(); + BigDecimal theoricalSolde = BigDecimal.ZERO; + if (cashRegister == null) { + theoricalSolde = BigDecimal.ZERO; + } else { + theoricalSolde = cashRegister.getTheoricalSolde(); + } + return theoricalSolde; + } + + /** + * Computes the totals for the cash inventory, including total bank notes, total + * coins, physical + * solde, and gap. + * + * @param cashInventory The cash inventory to compute totals for. + * @return A map containing the computed totals. + */ + public Map computeToTals(CashInventory cashInventory) { + + HashMap map = new HashMap<>(); + + List 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); - public Map computeToTals(CashInventory cashInventory){ + map.put("totalCoinsAmount", totalCoins); + map.put("totalBankNotesAmount", totalBankNotes); + map.put("totalCash", totalBankNotes); + map.put("physicalSolde", physicalSolde); + map.put("gap", gap); - HashMap map = new HashMap<>(); + return map; + } - List cashInventoryLines = cashInventory.getCashInventoryLines(); - - BigDecimal theoricalSolde = cashInventory.getTheoricalSolde(); + public String getCashInventorySequence(CashInventory cashInventory) throws AxelorException { + Integer operationTypeSelect = cashInventory.getOperationTypeSelect(); + Company company = cashInventory.getCompany(); + String sequence = null; - 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; - + if (operationTypeSelect != null) { + switch (operationTypeSelect) { + case 1: // Cash inventory daily + sequence = "CASH_INVENTORY_DAILY"; + break; + case 2: // Cash inventory monthly + sequence = "CASH_INVENTORY_MONTHLY"; + break; + case 3: // Cash inventory annual + sequence = "CASH_INVENTORY_ANNUAL"; + break; + default: + sequence = "CASH_INVENTORY"; + // Default case for other operation types + break; + } + } else { + sequence = "CASH_INVENTORY"; } - - + String ref = sequenceService.getSequenceNumber(sequence, company); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.CASH_INVENTORY_MISSING_SEQUENCE), + company.getName()); + } else { + return ref; + } + } + + + @Transactional(rollbackOn = {Exception.class}) + public void approveCashInventory(CashInventory cashInventory) { + CashRegisterRepository casRegisterRepository = Beans.get(CashRegisterRepository.class); + CashRegister cashRegister = casRegisterRepository.all().order("-createdOn").fetchOne(); + // cashRegister.setTheoricalSolde(cashInventory.getPhysicalSolde()); + cashRegister.setPhysicalSolde(cashInventory.getPhysicalSolde()); + cashInventory.setValdiatedByUser(AuthUtils.getUser()); + cashInventory.setValidattionDate(LocalDateTime.now()); + cashInventory.setStatusSelect(3); + Beans.get(CashInventoryRepository.class).save(cashInventory); + casRegisterRepository.save(cashRegister); + } } - diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/InvoiceTemplateService.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/InvoiceTemplateService.java index a485e51..60d314d 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/InvoiceTemplateService.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/InvoiceTemplateService.java @@ -1,11 +1,5 @@ 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; @@ -16,21 +10,22 @@ 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; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; public class InvoiceTemplateService { @Transactional - public Invoice generateInvoiceFromTemplate(InvoiceTemplate invoiceTemplate) throws AxelorException { + public Invoice generateInvoiceFromTemplate(InvoiceTemplate invoiceTemplate) + throws AxelorException { Partner partner = invoiceTemplate.getPartner(); Company company = invoiceTemplate.getCompany(); - InvoiceGenerator invoiceGenerator = + InvoiceGenerator invoiceGenerator = new InvoiceGenerator( InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE, company, @@ -56,26 +51,23 @@ public class InvoiceTemplateService { List invoiceLineList = new ArrayList<>(); - Invoice invoice = invoiceGenerator.generate(); int priority = 0; for (InvoiceTemplateLine invoiceTemplateLine : invoiceTemplate.getMoveTemplateLineList()) { - invoiceLineList.addAll(createInvoiceLine(invoice, invoiceTemplateLine, priority)); - priority++; + invoiceLineList.addAll(createInvoiceLine(invoice, invoiceTemplateLine, priority)); + priority++; } invoiceGenerator.populate(invoice, invoiceLineList); - - Invoice returnInvoiced = Beans.get(InvoiceRepository.class).save(invoice); - - return returnInvoiced; + Invoice returnInvoiced = Beans.get(InvoiceRepository.class).save(invoice); + + return returnInvoiced; } - - - protected List createInvoiceLine( - Invoice invoice, InvoiceTemplateLine invoiceTemplateLine, int priority) throws AxelorException { + protected List createInvoiceLine( + Invoice invoice, InvoiceTemplateLine invoiceTemplateLine, int priority) + throws AxelorException { Product product = invoiceTemplateLine.getProduct(); @@ -117,7 +109,4 @@ public class InvoiceTemplateService { return invoiceLineGenerator.creates(); } - - - } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileService.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileService.java index b54605f..8e1e4a7 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileService.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileService.java @@ -38,6 +38,10 @@ public interface ReconcileService { public Reconcile confirmReconcile(Reconcile reconcile, boolean updateInvoicePayments) throws AxelorException; + @Transactional(rollbackOn = {Exception.class}) + public Reconcile confirmPaymentVoucherReconcile( + Reconcile reconcile, boolean updateInvoicePayments) throws AxelorException; + public void reconcilePreconditions(Reconcile reconcile) throws AxelorException; public void updatePartnerAccountingSituation(Reconcile reconcile) throws AxelorException; diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileServiceImpl.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileServiceImpl.java index 2a8d2d8..701d796 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileServiceImpl.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/ReconcileServiceImpl.java @@ -430,6 +430,30 @@ public class ReconcileServiceImpl implements ReconcileService { Beans.get(ReconcileGroupService.class).remove(reconcile); } + @Transactional(rollbackOn = {Exception.class}) + public void unreconcile2(Reconcile reconcile) throws AxelorException { + + log.debug("unreconcile : reconcile : {}", reconcile); + + MoveLine debitMoveLine = reconcile.getDebitMoveLine(); + MoveLine creditMoveLine = reconcile.getCreditMoveLine(); + + // Change the state + reconcile.setStatusSelect(ReconcileRepository.STATUS_CANCELED); + // Add the reconciled amount to the reconciled amount in the move line + creditMoveLine.setAmountPaid(creditMoveLine.getAmountPaid().subtract(reconcile.getAmount())); + debitMoveLine.setAmountPaid(debitMoveLine.getAmountPaid().subtract(reconcile.getAmount())); + reconcileRepository.save(reconcile); + + // Update amount remaining on invoice or refund + this.updatePartnerAccountingSituation(reconcile); + this.updateInvoiceCompanyInTaxTotalRemaining(reconcile); + this.updateInvoicePaymentsCanceled(reconcile); + this.reverseTaxPaymentMoveLines(reconcile); + // Update reconcile group + // Beans.get(ReconcileGroupService.class).remove(reconcile); + } + protected void reverseTaxPaymentMoveLines(Reconcile reconcile) throws AxelorException { Move debitMove = reconcile.getDebitMoveLine().getMove(); Move creditMove = reconcile.getCreditMoveLine().getMove(); @@ -556,4 +580,41 @@ public class ReconcileServiceImpl implements ReconcileService { } return Lists.newArrayList(); } + + @Override + public Reconcile confirmPaymentVoucherReconcile( + Reconcile reconcile, boolean updateInvoicePayments) throws AxelorException { + this.reconcilePreconditions(reconcile); + + MoveLine debitMoveLine = reconcile.getDebitMoveLine(); + MoveLine creditMoveLine = reconcile.getCreditMoveLine(); + + // Add the reconciled amount to the reconciled amount in the move line + creditMoveLine.setAmountPaid(creditMoveLine.getAmountPaid().add(reconcile.getAmount())); + debitMoveLine.setAmountPaid(debitMoveLine.getAmountPaid().add(reconcile.getAmount())); + + reconcile = reconcileRepository.save(reconcile); + + reconcile.setStatusSelect(ReconcileRepository.STATUS_CONFIRMED); + + if (reconcile.getCanBeZeroBalanceOk()) { + // Alors nous utilisons la règle de gestion consitant à imputer l'écart sur un compte + // transitoire si le seuil est respecté + canBeZeroBalance(reconcile); + } + + reconcile.setReconciliationDate(LocalDate.now()); + + reconcileSequenceService.setSequence(reconcile); + + this.updatePartnerAccountingSituation(reconcile); + this.updateInvoiceCompanyInTaxTotalRemaining(reconcile); + this.udpatePaymentTax(reconcile); + if (updateInvoicePayments) { + this.updateInvoicePayments(reconcile); + } + this.addToReconcileGroup(reconcile); + + return reconcileRepository.save(reconcile); + } } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveLineService.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveLineService.java index c2a43e7..15b3936 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveLineService.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveLineService.java @@ -486,11 +486,13 @@ public class MoveLineService { moveLineId++, origin, invoiceLine.getProductName()); - - moveLine.setAnalyticDistributionTemplate(invoiceLine.getAnalyticDistributionTemplate()); + if(invoiceLine.getAnalyticDistributionTemplate() != null) + moveLine.setAnalyticDistributionTemplate(invoiceLine.getAnalyticDistributionTemplate()); if (invoiceLine.getAnalyticMoveLineList() != null && !invoiceLine.getAnalyticMoveLineList().isEmpty()) { for (AnalyticMoveLine invoiceAnalyticMoveLine : invoiceLine.getAnalyticMoveLineList()) { + System.out.println("-----------------invoiceAnalyticMoveLine.getAccount().getName()----------------------------"); + System.out.println(invoiceAnalyticMoveLine.getAccount()); AnalyticMoveLine analyticMoveLine = analyticMoveLineRepository.copy(invoiceAnalyticMoveLine, false); analyticMoveLine.setTypeSelect(AnalyticMoveLineRepository.STATUS_REAL_ACCOUNTING); diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveServiceImpl.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveServiceImpl.java index 0c4ebc0..2066d61 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveServiceImpl.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/move/MoveServiceImpl.java @@ -185,11 +185,20 @@ public class MoveServiceImpl implements MoveService { isPurchase, isDebitCustomer)); + log.debug("Saving account move.............."); + moveRepository.save(move); + log.debug("saved account move.............."); + + invoice.setMove(move); invoice.setCompanyInTaxTotalRemaining(moveToolService.getInTaxTotalRemaining(invoice)); + + log.debug("loading account move.............. {}",move); + + moveValidateService.validate(move); } } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/PaymentServiceImpl.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/PaymentServiceImpl.java index 0fcab8d..492eece 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/PaymentServiceImpl.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/PaymentServiceImpl.java @@ -127,7 +127,9 @@ 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().setScale(2,BigDecimal.ROUND_HALF_EVEN)); + creditTotalRemaining = + creditTotalRemaining.add( + creditMoveLine.getAmountRemaining().setScale(2, BigDecimal.ROUND_HALF_EVEN)); } for (MoveLine debitMoveLine : debitMoveLines) { @@ -136,7 +138,9 @@ 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().setScale(2,BigDecimal.ROUND_HALF_EVEN)); + debitTotalRemaining = + debitTotalRemaining.add( + debitMoveLine.getAmountRemaining().setScale(2, BigDecimal.ROUND_HALF_EVEN)); } for (MoveLine creditMoveLine : creditMoveLines) { @@ -148,7 +152,10 @@ public class PaymentServiceImpl implements PaymentService { && (creditMoveLine.getAmountRemaining().compareTo(BigDecimal.ZERO) == 1)) { try { createReconcile( - debitMoveLine, creditMoveLine, debitTotalRemaining.setScale(4), creditTotalRemaining.setScale(4)); + debitMoveLine, + creditMoveLine, + debitTotalRemaining.setScale(4), + creditTotalRemaining.setScale(4)); } catch (Exception e) { if (dontThrow) { TraceBackService.trace(e); diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherConfirmService.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherConfirmService.java index 870da15..8fd2ff6 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherConfirmService.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherConfirmService.java @@ -19,6 +19,7 @@ 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.CashRegister; import com.axelor.apps.account.db.Invoice; import com.axelor.apps.account.db.Journal; import com.axelor.apps.account.db.Move; @@ -28,15 +29,13 @@ 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.CashRegisterRepository; 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; @@ -49,7 +48,6 @@ 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; @@ -66,7 +64,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -131,26 +128,25 @@ public class PaymentVoucherConfirmService { Company company = paymentVoucher.getCompany(); BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails(); Journal journal; - - - if (paymentVoucher.getPaymentMode().getId() == 12 || paymentVoucher.getPaymentMode().getId() == 23) { - if(paymentVoucher.getPartner().getAccountingManagementList().size() == 0){ + + 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{ + 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); + } else { + journal = paymentModeService.getPaymentModeJournal(paymentMode, company, companyBankDetails); Account paymentModeAccount = - paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails); + paymentModeService.getPaymentModeAccount(paymentMode, company, companyBankDetails); - paymentVoucherControlService.checkPaymentVoucherField( - paymentVoucher, company, paymentModeAccount, journal); + paymentVoucherControlService.checkPaymentVoucherField( + paymentVoucher, company, paymentModeAccount, journal); } if (paymentVoucher.getRemainingAmount().compareTo(BigDecimal.ZERO) > 0 @@ -176,7 +172,9 @@ public class PaymentVoucherConfirmService { if (!isConfirmed && paymentVoucher.getGeneratedMoveList().size() == 0) { createMoveAndConfirm(paymentVoucher); } - if ((paymentVoucher.getPaymentMode().getId() == 12 || paymentVoucher.getPaymentMode().getId() == 23) && isConfirmed) { + if ((paymentVoucher.getPaymentMode().getId() == 12 + || paymentVoucher.getPaymentMode().getId() == 23) + && isConfirmed) { confirmBankMove(paymentVoucher); } } @@ -210,22 +208,22 @@ public class PaymentVoucherConfirmService { PaymentMode paymentMode = paymentVoucher.getPaymentMode(); Company company = paymentVoucher.getCompany(); BankDetails companyBankDetails = paymentVoucher.getCompanyBankDetails(); - Journal journal; + 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) { + 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); + } 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 @@ -283,7 +281,7 @@ public class PaymentVoucherConfirmService { MoveLine moveLineInvoices = null; - if(paymentVoucher.getOperationTypeSelect() == 6){ + if (paymentVoucher.getOperationTypeSelect() == 6) { moveLineInvoices = moveLineService.createMoveLine( @@ -296,67 +294,65 @@ public class PaymentVoucherConfirmService { moveLineNo++, paymentVoucher.getRef(), null); - paidLineTotal = paymentVoucher.getPaidAmount(); + paidLineTotal = paymentVoucher.getPaidAmount(); - move.getMoveLineList().add(moveLineInvoices); + move.getMoveLineList().add(moveLineInvoices); - }else{ + } 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()); + 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); + BigDecimal amountToPay = payVoucherElementToPay.getAmountToPayCurrency(); + log.debug(">>>> PV amountToPay : {}", amountToPay); - Invoice invoice = payVoucherElementToPay.getMoveLine().getMove().getInvoice(); - isDebitToPay = paymentVoucherToolService.isDebitToPay(invoice); + 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); + boolean isRefundInvoice = false; + if (invoice.getOperationTypeSelect() == InvoiceRepository.OPERATION_TYPE_CLIENT_REFUND) { + isRefundInvoice = true; } - paidLineTotal = paidLineTotal.add(amountToPay); + log.debug("heyyyyyyyyyyyyyyyyy : {}", isRefundInvoice); - log.debug("amountToPay >>>>>>>>>>> {}", amountToPay); + if (amountToPay.compareTo(BigDecimal.ZERO) > 0 || isRefundInvoice) { - this.payMoveLine( - move, - moveLineNo++, - payerPartner, - moveLineToPay, - amountToPay, - amountToPay, - // isRefundInvoice ? amountToPay : payVoucherElementToPay.getAmountToPayCurrency(), - payVoucherElementToPay, - isDebitToPay, - paymentDate); + 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); @@ -477,9 +473,9 @@ public class PaymentVoucherConfirmService { // LocalDate paymentDate = paymentVoucher.getPaymentDate(); LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate(); LocalDate paymentDateEchance = paymentVoucher.getDueDate(); - - if(paymentVoucher.getSort() == 3){ - paymentDateEchance = paymentVoucher.getCreditDate(); + + if (paymentVoucher.getSort() == 3) { + paymentDateEchance = paymentVoucher.getCreditDate(); } boolean scheduleToBePaid = false; @@ -556,9 +552,9 @@ public class PaymentVoucherConfirmService { // LocalDate paymentDate = paymentVoucher.getPaymentDate(); LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate(); LocalDate paymentDateEchance = paymentVoucher.getDueDate(); - - if(paymentVoucher.getSort() == 3){ - paymentDateEchance = paymentVoucher.getCreditDate(); + + if (paymentVoucher.getSort() == 3) { + paymentDateEchance = paymentVoucher.getCreditDate(); } boolean scheduleToBePaid = false; @@ -576,7 +572,7 @@ public class PaymentVoucherConfirmService { paymentDate, paymentMode, MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC); - + move.setPaymentVoucher(paymentVoucher); List payVoucherElementToPayList = @@ -586,15 +582,20 @@ public class PaymentVoucherConfirmService { Account accountToPay = null; - if(paymentModeAccount.getIsOriginRequired()){ + if (paymentModeAccount.getIsOriginRequired()) { MoveLine moveLineToPay = payVoucherElementToPayList.get(0).getMoveLine(); - - if(moveLineToPay.getCredit().compareTo(BigDecimal.ZERO) > 0){ + + if (moveLineToPay.getCredit().compareTo(BigDecimal.ZERO) > 0) { isDebitToPay = true; } accountToPay = moveLineToPay.getAccount(); - }else{ - accountToPay = paymentVoucher.getPartner().getAccountingSituationList().get(0).getPartnerPaymentAccount(); + } else { + accountToPay = + paymentVoucher + .getPartner() + .getAccountingSituationList() + .get(0) + .getPartnerPaymentAccount(); } BigDecimal paidAmount = paymentVoucher.getPaidAmount(); @@ -631,14 +632,18 @@ public class PaymentVoucherConfirmService { moveService.getMoveValidateService().validate(move); paymentVoucher.setGeneratedMove(move); paymentVoucher.addGeneratedMoveListItem(move); + paymentVoucher.setConfirmationDate(LocalDate.now()); + paymentVoucher.setConfirmedByUser(AuthUtils.getUser()); if (isDebitToPay) { reconcileService.balanceCredit(moveLine); } + if(paymentVoucher.getPartner().getId() == 2040L){ + this.updateCashRegisterTheoricalSolde(paymentVoucher, isDebitToPay,paidAmount); + } // Beans.get(PaymentVoucherLoadService.class).updateVoucher(paymentVoucher); } - public void deleteUnPaidLines(PaymentVoucher paymentVoucher) { if (paymentVoucher.getPayVoucherElementToPayList() == null) { @@ -750,13 +755,13 @@ public class PaymentVoucherConfirmService { BigDecimal amountInCompanyCurrency = moveLine.getDebit().add(moveLine.getCredit()); - Reconcile reconcile = - reconcileService.createReconcile(moveLineToPay, moveLine, amountToPayReel, true); - reconciles.add(reconcile); - if (reconcile != null) { - log.debug("Reconcile : : : {}", reconcile); - reconcileService.confirmReconcile(reconcile, true); - } + // Reconcile reconcile = + // reconcileService.createReconcile(moveLineToPay, moveLine, amountToPayReel, true); + // reconciles.add(reconcile); + // if (reconcile != null) { + // log.debug("Reconcile : : : {}", reconcile); + // reconcileService.confirmPaymentVoucherReconcile(reconcile, true); + // // } return moveLine; } @@ -865,7 +870,9 @@ public class PaymentVoucherConfirmService { log.debug("Rejecting move : : : {} **********", move); try { - Move reverseMove = Beans.get(MoveServiceImpl.class).generateReverse(move, false, false, true, LocalDate.now()); + Move reverseMove = + Beans.get(MoveServiceImpl.class) + .generateReverse(move, false, false, true, LocalDate.now()); paymentVoucher2.addGeneratedMoveListItem(reverseMove); // moveCancelService.cancel(move); } catch (AxelorException e) { @@ -880,119 +887,128 @@ public class PaymentVoucherConfirmService { } @Transactional(rollbackOn = {Exception.class}) - public Move confirmMultipleVoucher(List voucherList, List elementToPays, boolean b) throws AxelorException { - if(voucherList != null && voucherList.size() > 0 ){ - if(!samePaymentVoucherSelect(voucherList) || voucherAlreadyInMove(voucherList)){ - throw new AxelorException( + public Move confirmMultipleVoucher( + List voucherList, List 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" - ); + "Not the same operation type"); } - BigDecimal totalAmount = BigDecimal.ZERO; - totalAmount = voucherList.stream().map(PaymentVoucher::getPaidAmount).reduce(BigDecimal.ZERO,BigDecimal::add); + 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(); + 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); + 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(); - } + 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 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()); - // move.addPaymentVoucherListItem(paymentVoucher); - // paymentVoucher.setGeneratedMove(move); - paymentVoucher.setConfirmedByUser(AuthUtils.getUser()); - paymentVoucher.setConfirmationDate(LocalDate.now()); + boolean isDebitToPay = paymentVoucherToolService.isDebitToPay(paymentVoucher); + int moveLineNo = 0; - 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); - MoveLine moveLineAll = - moveLineService.createMoveLine( - move, - payerPartner, - paymentModeAccount, - totalAmount, - isDebitToPay, - paymentDate, - moveLineNo++, - paymentVoucher.getRef(), - null); - move.getMoveLineList().add(moveLineAll); + Set paymentVoucherIds = new HashSet(); - Set paymentVoucherIds = new HashSet(); - - 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; + 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 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; - } + public boolean samePaymentVoucherSelect(List 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; + } + return true; } public boolean voucherAlreadyInMove(List voucherList) { - if(voucherList != null){ + if (voucherList != null) { for (PaymentVoucher voucher : voucherList) { - if(voucher.getGeneratedMoveList().size() > 0){ + if (voucher.getGeneratedMoveList().size() > 0) { return true; } } @@ -1000,11 +1016,20 @@ public class PaymentVoucherConfirmService { return false; } - // Cash mvt - + /** + * Confirm cash payment voucher and create move. + * + * @param paymentVoucher + * @throws AxelorException + */ @Transactional(rollbackOn = {Exception.class}) public void confirmCashPayment(PaymentVoucher paymentVoucher) throws AxelorException { + if(paymentVoucher.getGeneratedMoveList().size() > 0){ + throw new AxelorException( + TraceBackRepository.CATEGORY_INCONSISTENCY, + "Already ventilated."); + } PaymentMode paymentMode = paymentVoucher.getPaymentMode(); Company company = paymentVoucher.getCompany(); AccountConfig accountConfig = Beans.get(AccountConfigService.class).getAccountConfig(company); @@ -1012,11 +1037,9 @@ public class PaymentVoucherConfirmService { Journal journal = accountConfig.getCashJournal(); // LocalDate paymentDate = paymentVoucher.getPaymentDate(); LocalDate paymentDate = paymentVoucher.getPaymentEmissionDate(); - - - boolean scheduleToBePaid = false; - Account paymentModeAccount = paymentVoucher.getPartner().getAccountingSituationList().get(0).getPartnerPaymentAccount(); + Account paymentModeAccount = + paymentVoucher.getCashAccountConfig().getAccount(); Move move = moveService @@ -1034,15 +1057,10 @@ public class PaymentVoucherConfirmService { Boolean isDebitToPay = false; - if(Integer.parseInt(paymentVoucher.getDebitCreditSelect()) == 1){ + 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(); @@ -1059,7 +1077,7 @@ public class PaymentVoucherConfirmService { paymentDate, moveLineNo++, paymentVoucher.getRef(), - null); + paymentVoucher.getLabel()); MoveLine moveLine = moveLineService.createMoveLine( @@ -1071,21 +1089,125 @@ public class PaymentVoucherConfirmService { paymentDate, moveLineNo++, paymentVoucher.getRef(), - null); + paymentVoucher.getLabel()); move.getMoveLineList().add(moveLine); move.getMoveLineList().add(moveLine2); + String label = paymentVoucher.getLabel() != null ? paymentVoucher.getLabel() : ""; + String fullName = (paymentVoucher.getRecipientPartner() != null && paymentVoucher.getRecipientPartner().getFullName() != null) + ? paymentVoucher.getRecipientPartner().getFullName() + : ""; + + String description = label +" "+ fullName; + + moveLine.setDescription(description); + moveLine2.setDescription(description); + moveService.getMoveValidateService().validate(move); paymentVoucher.setGeneratedMove(move); paymentVoucher.addGeneratedMoveListItem(move); + + // confirmed is ventilation equivalent + paymentVoucher.setConfirmedByUser(AuthUtils.getUser()); + paymentVoucher.setConfirmationDate(LocalDate.now()); if (isDebitToPay) { reconcileService.balanceCredit(moveLine); } + // updateCashRegisterTheoricalSolde(paymentVoucher, isDebitToPay,paidAmount); // Beans.get(PaymentVoucherLoadService.class).updateVoucher(paymentVoucher); } + @Transactional(rollbackOn = {Exception.class}) + public void updateCashRegisterTheoricalSolde(PaymentVoucher paymentVoucher,Boolean isDebitCredit,BigDecimal amount) { + System.out.println("updateCashRegisterTheoricalSolde : : : " + paymentVoucher.getCashAccountConfig()); + if (paymentVoucher.getCashAccountConfig() != null || paymentVoucher.getPartner() != null) { + CashRegisterRepository casRegisterRepository = Beans.get(CashRegisterRepository.class); + CashRegister cashRegister = casRegisterRepository.all().order("-createdOn").fetchOne(); + BigDecimal theoreticalSolde = cashRegister.getTheoricalSolde(); + if (isDebitCredit) { + theoreticalSolde = theoreticalSolde.subtract(amount); + } else { + theoreticalSolde = theoreticalSolde.add(amount); + } + System.out.println("theoreticalSolde : : : " + theoreticalSolde); + cashRegister.setTheoricalSolde(theoreticalSolde); + Beans.get(CashRegisterRepository.class).save(cashRegister); + } + } + + @Transactional(rollbackOn = {Exception.class}) + public void validateCashPaymentVoucher(PaymentVoucher paymentVoucher) throws AxelorException { + if (paymentVoucher.getCashAccountConfig() == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_INCONSISTENCY, + "Cash account config is not set for the payment voucher."); + } + if (paymentVoucher.getCashAccountConfig().getAccount() == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_INCONSISTENCY, + "Cash account is not set for the payment voucher."); + } + CashRegisterRepository casRegisterRepository = Beans.get(CashRegisterRepository.class); + CashRegister cashRegister = casRegisterRepository.all().order("-createdOn").fetchOne(); + + BigDecimal solde = cashRegister.getTheoricalSolde(); + if (Integer.parseInt(paymentVoucher.getDebitCreditSelect()) == 1) { + solde = solde.subtract(paymentVoucher.getPaidAmount()); + }else{ + solde = solde.add(paymentVoucher.getPaidAmount()); + } + + paymentVoucher.setInitialTheoricalSolde(cashRegister.getTheoricalSolde()); + paymentVoucher.setTheoricalSolde(solde); + paymentVoucher.setCashStatusSelect(PaymentVoucherRepository.STATUS_WAITING_FOR_DEPOSIT_SLIP); + paymentVoucher.setApprovalDate(LocalDate.now()); + paymentVoucher.setApprovedByUser(AuthUtils.getUser()); + Boolean isDebitToPay = false; + + if (Integer.parseInt(paymentVoucher.getDebitCreditSelect()) == 1) { + isDebitToPay = true; + } + updateCashRegisterTheoricalSolde(paymentVoucher, isDebitToPay,paymentVoucher.getPaidAmount()); + } + + @Transactional(rollbackOn = {Exception.class}) + public void cancelCashPaymentVoucher(PaymentVoucher paymentVoucher) throws AxelorException { + if (paymentVoucher.getCashAccountConfig() == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_INCONSISTENCY, + "Cash account config is not set for the payment voucher."); + } + if (paymentVoucher.getCashAccountConfig().getAccount() == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_INCONSISTENCY, + "Cash account is not set for the payment voucher."); + } + CashRegisterRepository casRegisterRepository = Beans.get(CashRegisterRepository.class); + CashRegister cashRegister = casRegisterRepository.all().order("-createdOn").fetchOne(); + + BigDecimal solde = cashRegister.getTheoricalSolde(); + if (Integer.parseInt(paymentVoucher.getDebitCreditSelect()) == 2) { + solde = solde.subtract(paymentVoucher.getPaidAmount()); + }else{ + solde = solde.add(paymentVoucher.getPaidAmount()); + } + + paymentVoucher.setInitialTheoricalSolde(cashRegister.getTheoricalSolde()); + paymentVoucher.setTheoricalSolde(solde); + paymentVoucher.setCashStatusSelect(4); + Boolean isDebitToPay = false; + + if (Integer.parseInt(paymentVoucher.getDebitCreditSelect()) == 1) { + isDebitToPay = true; + } + // Beans.get(MoveServiceImpl.class). + updateCashRegisterTheoricalSolde(paymentVoucher, !isDebitToPay,paymentVoucher.getPaidAmount()); + for (Move move : paymentVoucher.getGeneratedMoveList()) { + Beans.get(MoveCancelService.class).cancel(move); + } + } } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherLoadService.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherLoadService.java index 37a267c..a3828fd 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherLoadService.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/service/payment/paymentvoucher/PaymentVoucherLoadService.java @@ -88,27 +88,27 @@ public class PaymentVoucherLoadService { List moveLines = null; String query = -"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 "; - - 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.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) { + != 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 { @@ -221,11 +221,22 @@ public class PaymentVoucherLoadService { int sequence = paymentVoucher.getPayVoucherElementToPayList().size() + 1; BigDecimal amountRemaining = paymentVoucher.getRemainingAmount(); List 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())); + + 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 : dueElements) { @@ -235,9 +246,11 @@ public class PaymentVoucherLoadService { if (payVoucherDueElementContext.isSelected()) { paymentVoucher.addPayVoucherElementToPayListItem( - this.createPayVoucherElementToPay(payVoucherDueElement, sequence++,amountRemaining)); + this.createPayVoucherElementToPay(payVoucherDueElement, sequence++, amountRemaining)); - amountRemaining = amountRemaining.subtract(amountRemaining.min(payVoucherDueElement.getAmountRemaining())); + amountRemaining = + amountRemaining.subtract( + amountRemaining.min(payVoucherDueElement.getAmountRemaining())); // Remove the line from the due elements lists paymentVoucher.removePayVoucherDueElementListItem(payVoucherDueElement); @@ -246,7 +259,8 @@ public class PaymentVoucherLoadService { } public PayVoucherElementToPay createPayVoucherElementToPay( - PayVoucherDueElement payVoucherDueElement, int sequence,BigDecimal amountRemaining) throws AxelorException { + PayVoucherDueElement payVoucherDueElement, int sequence, BigDecimal amountRemaining) + throws AxelorException { PaymentVoucher paymentVoucher = payVoucherDueElement.getPaymentVoucher(); // BigDecimal amountRemaining = paymentVoucher.getRemainingAmount(); @@ -420,7 +434,6 @@ public class PaymentVoucherLoadService { int sequence = 0; BigDecimal amountRemaining = paymentVoucher.getRemainingAmount(); - for (Iterator it = paymentVoucher.getPayVoucherDueElementList().iterator(); it.hasNext(); ) { @@ -429,49 +442,54 @@ public class PaymentVoucherLoadService { if (invoice.equals(payVoucherDueElement.getMoveLine().getMove().getInvoice()) && paymentVoucher.getCurrency().equals(payVoucherDueElement.getCurrency())) { paymentVoucher.addPayVoucherElementToPayListItem( - createPayVoucherElementToPay(payVoucherDueElement, ++sequence,amountRemaining)); - amountRemaining = amountRemaining.subtract(amountRemaining.min(payVoucherDueElement.getAmountRemaining())); + createPayVoucherElementToPay(payVoucherDueElement, ++sequence, amountRemaining)); + amountRemaining = + amountRemaining.subtract( + amountRemaining.min(payVoucherDueElement.getAmountRemaining())); it.remove(); } } } - @Transactional(rollbackOn = {Exception.class}) - public void updateVoucher(PaymentVoucher paymentVoucher) throws AxelorException{ + public void updateVoucher(PaymentVoucher paymentVoucher) throws AxelorException { List moveLines = new ArrayList<>(); - List payVoucherElementToPayList = paymentVoucher.getPayVoucherElementToPayList(); + List payVoucherElementToPayList = + paymentVoucher.getPayVoucherElementToPayList(); for (PayVoucherElementToPay elementToPay : payVoucherElementToPayList) { moveLines.add(elementToPay.getMoveLine()); } - - List elementToPays = elementToPayRepository.all().filter("self.paymentVoucher.id != ?1 and self.moveLine in (?2)",paymentVoucher.getId(),moveLines).fetch(); + + List 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()); + Move move = payVoucherElementToPay.getMoveLine().getMove(); + MoveLine moveLine = payVoucherElementToPay.getMoveLine(); - BigDecimal paidAmountInElementCurrency = - currencyService - .getAmountCurrencyConvertedAtDate( - move.getCompanyCurrency(), - move.getCurrency(), - moveLine.getAmountPaid(), - moveLine.getDate()) - .setScale(2, RoundingMode.HALF_EVEN); - - - - payVoucherElementToPay.setRemainingAmount( - moveLine.getCurrencyAmount().subtract(paidAmountInElementCurrency)); + payVoucherElementToPay.setTotalAmount(moveLine.getCurrencyAmount()); - elementToPayRepository.save(payVoucherElementToPay); - } - + 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); + } } - } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/CashInventoryController.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/CashInventoryController.java index 7a89f1f..d300bc0 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/CashInventoryController.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/CashInventoryController.java @@ -1,13 +1,5 @@ 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; @@ -23,11 +15,33 @@ import com.axelor.meta.schema.actions.ActionView; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.google.common.base.Strings; +import com.google.inject.Inject; + +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; public class CashInventoryController { private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - + @Inject + private final ConvertNumberToFrenchWordsService convertService; + + @Inject + public CashInventoryController(ConvertNumberToFrenchWordsService convertService) { + this.convertService = convertService; + } + + /** + * Prints the cash inventory report. + * + * @param request The action request containing the context. + * @param response The action response to set the view with the report link. + * @throws AxelorException If an error occurs during report generation. + */ public void printCashInventory(ActionRequest request, ActionResponse response) throws AxelorException { @@ -38,72 +52,109 @@ public class CashInventoryController { name += " " + cashInventory.getRef(); } - String fileLink = - ReportFactory.createReport(String.format(IReport.CASH_INVENTORY, cashInventory.getOperationTypeSelect()), name + "-${date}") - .addParam("cashInventoryId", cashInventory.getId()) - .generate() - .getFileLink(); + 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){ - + /** + * Computes the theoretical solde in words for the cash inventory. + * + * @param request The action request containing the context. + * @param response The action response to set the theoretical solde in words. + */ + public void convertTheoricalSoldeInWords(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"; + String[] arrOfStr = cashInventory.getPhysicalSolde().toString().split("\\."); + + String left = convertService.convert(Long.parseLong(arrOfStr[0])); + String right = convertService.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 map = Beans.get(CashInventoryService.class).computeToTals(cashInventory); - response.setValues(map); - + /** + * Initializes the theoretical solde in words for the cash inventory. + * + * @param request The action request containing the context. + * @param response The action response to set the theoretical solde value. + */ + public void initThetoricalSolde(ActionRequest request, ActionResponse response) { + BigDecimal theoricalSolde = Beans.get(CashInventoryService.class).initThetoricalSolde(); + response.setValue("theoricalSolde", theoricalSolde); } - public void getLastCashData(ActionRequest request, ActionResponse response){ - CashInventory lastCashInventory = Beans.get(CashInventoryRepository.class).all().order("-id").fetchOne(); + /** + * Computes the totals for the cash inventory. + * + * @param request The action request containing the context. + * @param response The action response to set the computed values. + */ + public void computeToTals(ActionRequest request, ActionResponse response) { - List cashVouchers = Beans.get(PaymentVoucherRepository.class).all().filter("self.operationTypeSelect = 9 and self.cashStatusSelect = 3").fetch(); + CashInventory cashInventory = request.getContext().asType(CashInventory.class); + if(cashInventory.getCashInventoryLines() != null && cashInventory.getCashInventoryLines().size() != 0){ + Map map = Beans.get(CashInventoryService.class).computeToTals(cashInventory); + response.setValues(map); + } + } + + /** + * Retrieves the last cash data and calculates the theoretical solde. + * + * @param request The action request containing the context. + * @param response The action response to set the theoretical solde value. + */ + public void getLastCashData(ActionRequest request, ActionResponse response) { + CashInventory lastCashInventory = Beans.get(CashInventoryRepository.class).all().order("-id").fetchOne(); + + List 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()); + totalSolde = totalSolde.subtract(paymentVoucher.getPaidAmount()); break; case "2": - totalSolde = totalSolde.add(paymentVoucher.getPaidAmount()); + totalSolde = totalSolde.add(paymentVoucher.getPaidAmount()); break; - + default: break; } } response.setValue("theoricalSolde", totalSolde); - } - + + // generate sequence for cash inventory + public void generateSequence(ActionRequest request, ActionResponse response) throws AxelorException { + CashInventory cashInventory = request.getContext().asType(CashInventory.class); + if (cashInventory.getRef() == null || cashInventory.getRef().isEmpty()) { + String sequence = Beans.get(CashInventoryService.class).getCashInventorySequence(cashInventory); + response.setValue("ref", sequence); + } + } + + + public void approveCashInventory(ActionRequest request, ActionResponse response) throws AxelorException{ + CashInventory cashInventoryContext = request.getContext().asType(CashInventory.class); + CashInventory cashInventory = Beans.get(CashInventoryRepository.class).find(cashInventoryContext.getId()); + Beans.get(CashInventoryService.class).approveCashInventory(cashInventory); + response.setReload(true); + } } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceController.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceController.java index a7d5f95..4912890 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceController.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceController.java @@ -17,16 +17,17 @@ */ package com.axelor.apps.account.web; +import com.axelor.apps.ReportFactory; import com.axelor.apps.account.db.AccountingSituation; import com.axelor.apps.account.db.Invoice; import com.axelor.apps.account.db.InvoicePayment; +import com.axelor.apps.account.db.Journal; import com.axelor.apps.account.db.PaymentCondition; import com.axelor.apps.account.db.PaymentMode; import com.axelor.apps.account.db.PaymentVoucher; -import com.axelor.apps.account.db.Journal; -import com.axelor.apps.account.db.repo.AccountConfigRepository; import com.axelor.apps.account.db.repo.InvoiceRepository; import com.axelor.apps.account.exception.IExceptionMessage; +import com.axelor.apps.account.report.IReport; import com.axelor.apps.account.service.AccountingSituationService; import com.axelor.apps.account.service.IrrecoverableService; import com.axelor.apps.account.service.app.AppAccountService; @@ -38,7 +39,6 @@ import com.axelor.apps.base.db.BankDetails; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Currency; import com.axelor.apps.base.db.Partner; -import com.axelor.apps.base.db.PartnerCategory; import com.axelor.apps.base.db.PriceList; import com.axelor.apps.base.db.PrintingSettings; import com.axelor.apps.base.db.Wizard; @@ -46,6 +46,7 @@ import com.axelor.apps.base.db.repo.LanguageRepository; import com.axelor.apps.base.db.repo.PartnerRepository; import com.axelor.apps.base.service.AddressService; import com.axelor.apps.base.service.BankDetailsService; +import com.axelor.apps.base.service.ConvertNumberToFrenchWordsService; import com.axelor.apps.base.service.PartnerPriceListService; import com.axelor.apps.base.service.PartnerService; import com.axelor.apps.base.service.TradingNameService; @@ -64,21 +65,17 @@ import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.axelor.rpc.Context; -import com.axelor.apps.base.service.ConvertNumberToFrenchWordsService; -import com.axelor.apps.ReportFactory; import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.inject.Singleton; import java.lang.invoke.MethodHandles; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; -import java.util.HashMap; import java.util.stream.Collectors; -import java.math.BigDecimal; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -962,72 +959,89 @@ public class InvoiceController { } response.setAttr("partner", "domain", domain); } - + public void printInvoicePayment(ActionRequest request, ActionResponse response) throws AxelorException { - - String name = I18n.get("Payment voucher"); - String AmountToPay = request.getContext().get("amount").toString(); - String[] arrOfStr = AmountToPay.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+" centimes"; - String chequeModelBank = request.getContext().get("chequeModelBank").toString(); - BigDecimal amount = new BigDecimal(AmountToPay); - - String fileLink = - ReportFactory.createReport("chequeModelBank.rptdesign", name + "-${date}") - .addParam("NumberToWords", number) - .addParam("Wilaya", request.getContext().get("wilaya").toString()) - .addParam("amount", amount) - .addParam("date", request.getContext().get("date").toString() ) - .addParam("name", request.getContext().get("PartnerName")) - .addParam("chequeModelBank", chequeModelBank) - .generate() - .getFileLink(); - - logger.debug("Printing " + name); - - response.setView(ActionView.define(name).add("html", fileLink).map()); - + String name = I18n.get("Payment voucher"); + String AmountToPay = request.getContext().get("amount").toString(); + String[] arrOfStr = AmountToPay.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 + " centimes"; + String chequeModelBank = request.getContext().get("chequeModelBank").toString(); + BigDecimal amount = new BigDecimal(AmountToPay); + + String fileLink = + ReportFactory.createReport("chequeModelBank.rptdesign", name + "-${date}") + .addParam("NumberToWords", number) + .addParam("Wilaya", request.getContext().get("wilaya").toString()) + .addParam("amount", amount) + .addParam("date", request.getContext().get("date").toString()) + .addParam("name", request.getContext().get("PartnerName")) + .addParam("chequeModelBank", chequeModelBank) + .generate() + .getFileLink(); + + logger.debug("Printing " + name); + + response.setView(ActionView.define(name).add("html", fileLink).map()); } - public void printPaymentFile(ActionRequest request, ActionResponse response) + public void printPaymentFile2(ActionRequest request, ActionResponse response) throws AxelorException { PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class); - + String name = I18n.get("Payment voucher"); String AmountToPay = paymentVoucher.getPaidAmount().toString(); - String[] arrOfStr = AmountToPay.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+" centimes"; - + String[] arrOfStr = AmountToPay.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 + " centimes"; + + String reportType = "PaymentRequest.rptdesign"; + + System.out.println("mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"); + System.out.println(paymentVoucher.getOperationTypeSelect()); + System.out.println(paymentVoucher.getDebitCreditSelect()); + System.out.println(paymentVoucher.getOperationTypeSelect() == 9); + System.out.println(paymentVoucher.getDebitCreditSelect() == "1"); + + if(paymentVoucher.getOperationTypeSelect() == 9){ + if(paymentVoucher.getDebitCreditSelect().equals("1")){ + reportType = "CashPaymentRequestDebit.rptdesign"; + }else if(paymentVoucher.getDebitCreditSelect().equals("2")){ + reportType = "CashPaymentRequestCredit.rptdesign"; + } + } + String fileLink = - ReportFactory.createReport("PaymentRequest.rptdesign", name + "-${date}") + ReportFactory.createReport(reportType, name + "-${date}") .addParam("PaymentVoucherId", paymentVoucher.getId()) .addParam("NumberToWords", number) .generate() .getFileLink(); logger.debug("Printing " + name); - - response.setView(ActionView.define(name).add("html", fileLink).map()); + + response.setView(ActionView.define(name).add("html", fileLink).map()); } - - public void showInvoice2(ActionRequest request, ActionResponse response) - throws AxelorException { + + public void showInvoice2(ActionRequest request, ActionResponse response) throws AxelorException { Context context = request.getContext(); - - Invoice invoice = Beans.get(InvoiceRepository.class) - .find(Long.parseLong(context.get("id").toString())); - String name = I18n.get("Invoice"); + Invoice invoice = + Beans.get(InvoiceRepository.class).find(Long.parseLong(context.get("id").toString())); + + String name = I18n.get("Invoice"); String format = context.get("format") != null ? context.get("format").toString() : "pdf"; Integer reportType = @@ -1048,14 +1062,16 @@ public class InvoiceController { .getCode() : null; - ReportSettings reportSettings = Beans.get(InvoicePrintService.class).prepareReportSettings(invoice, reportType, format, locale); + ReportSettings reportSettings = + Beans.get(InvoicePrintService.class) + .prepareReportSettings(invoice, reportType, format, locale); logger.debug("Printing " + name); - - response.setView(ActionView.define(name).add("html", reportSettings.generate().getFileLink()).map()); + + response.setView( + ActionView.define(name).add("html", reportSettings.generate().getFileLink()).map()); } - - + /** * set default value for automatic invoice Journal = supplier Purchase Journal * @@ -1067,23 +1083,21 @@ public class InvoiceController { Invoice invoice = request.getContext().asType(Invoice.class); Company company = invoice.getCompany(); Partner partner = invoice.getPartner(); - Journal journal = null ; + Journal journal = null; Integer operationTypeSelect = invoice.getOperationTypeSelect(); - - if (company != null && partner != null && operationTypeSelect != null ) { - if (operationTypeSelect.intValue() == InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE) { - if( partner.getTypeOfSupplier() != null){ - if(partner.getTypeOfSupplier().equals("1")){ - journal = company.getAccountConfig().getSupplierPurchaseJournalForeigners(); - } - if(partner.getTypeOfSupplier().equals("2")){ - journal = company.getAccountConfig().getSupplierPurchaseJournalLocal(); - } - } - response.setValue("journal", journal); - } - } - - } + if (company != null && partner != null && operationTypeSelect != null) { + if (operationTypeSelect.intValue() == InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE) { + if (partner.getTypeOfSupplier() != null) { + if (partner.getTypeOfSupplier().equals("1")) { + journal = company.getAccountConfig().getSupplierPurchaseJournalForeigners(); + } + if (partner.getTypeOfSupplier().equals("2")) { + journal = company.getAccountConfig().getSupplierPurchaseJournalLocal(); + } + } + response.setValue("journal", journal); + } + } + } } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceLineController.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceLineController.java index cb6130d..1078087 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceLineController.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceLineController.java @@ -403,22 +403,24 @@ public class InvoiceLineController { response.setValue("fixedAssetCategory", fixedAssetCategory); } - - public void updateQtyUg(ActionRequest request, ActionResponse response) throws AxelorException{ + public void updateQtyUg(ActionRequest request, ActionResponse response) throws AxelorException { Context context = request.getContext(); InvoiceLine invoiceLine = context.asType(InvoiceLine.class); - + BigDecimal qtyUg = invoiceLine.getProduct().getUg(); BigDecimal qty = invoiceLine.getQty(); - BigDecimal totalQty = qty.add(qty.multiply(qtyUg).divide(new BigDecimal(100), 4,RoundingMode.HALF_EVEN)); + BigDecimal totalQty = + qty.add(qty.multiply(qtyUg).divide(new BigDecimal(100), 4, RoundingMode.HALF_EVEN)); Product product = invoiceLine.getProduct(); - if(product.getUg() != null && product.getUg().compareTo(BigDecimal.ZERO) > 0){ - BigDecimal ug = invoiceLine.getProduct().getUg().divide(new BigDecimal(100), 10, RoundingMode.HALF_EVEN); - BigDecimal ugAmount = ug.divide(ug.add(BigDecimal.ONE),10, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)); + if (product.getUg() != null && product.getUg().compareTo(BigDecimal.ZERO) > 0) { + BigDecimal ug = + invoiceLine.getProduct().getUg().divide(new BigDecimal(100), 10, RoundingMode.HALF_EVEN); + BigDecimal ugAmount = + ug.divide(ug.add(BigDecimal.ONE), 10, RoundingMode.HALF_EVEN) + .multiply(new BigDecimal(100)); response.setValue("discountTypeSelect", 1); response.setValue("discountAmount", ugAmount); response.setValue("qty", totalQty); } } - } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceTemplateControlller.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceTemplateControlller.java index 6bad9e3..03c1421 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceTemplateControlller.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/InvoiceTemplateControlller.java @@ -1,52 +1,43 @@ 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; +import java.time.LocalDate; public class InvoiceTemplateControlller { - public void showInvoice2(ActionRequest request, ActionResponse response) - throws AxelorException { + 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); + InvoiceTemplate invoiceTemplate = + Beans.get(InvoiceTemplateRepository.class) + .find(Long.parseLong(context.get("id").toString())); - 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()); - + 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()); } - } diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/PaymentVoucherController.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/PaymentVoucherController.java index 081fa9c..214532c 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/PaymentVoucherController.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/PaymentVoucherController.java @@ -65,12 +65,14 @@ public class PaymentVoucherController { PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class); if (Strings.isNullOrEmpty(paymentVoucher.getRef())) { - if(paymentVoucher.getOperationTypeSelect() == 9){ + if (paymentVoucher.getOperationTypeSelect() == 9) { response.setValue( - "ref", Beans.get(SequenceService.class).getSequenceNumber("CashSequence", paymentVoucher.getCompany())); - }else{ + "ref", + Beans.get(SequenceService.class) + .getSequenceNumber("CashSequence", paymentVoucher.getCompany())); + } else { response.setValue( - "ref", Beans.get(PaymentVoucherSequenceService.class).getReference(paymentVoucher)); + "ref", Beans.get(PaymentVoucherSequenceService.class).getReference(paymentVoucher)); } } } @@ -214,8 +216,9 @@ public class PaymentVoucherController { paymentVoucher, rejectionInstance); - PaymentVoucher paymentVoucher2 =Beans.get(PaymentVoucherConfirmService.class) - .rejectPaymentVoucher(paymentVoucher, rejectionRaison); + PaymentVoucher paymentVoucher2 = + Beans.get(PaymentVoucherConfirmService.class) + .rejectPaymentVoucher(paymentVoucher, rejectionRaison); // response.setReload(true); response.setView( @@ -327,9 +330,24 @@ public class PaymentVoucherController { if (!Strings.isNullOrEmpty(paymentVoucher.getReceiptNo())) { name += " " + paymentVoucher.getReceiptNo(); } + String reportType = IReport.PAYMENT_VOUCHER; + + System.out.println("mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"); + System.out.println(paymentVoucher.getOperationTypeSelect()); + System.out.println(paymentVoucher.getDebitCreditSelect()); + System.out.println(paymentVoucher.getOperationTypeSelect() == 9); + System.out.println(paymentVoucher.getDebitCreditSelect() == "1"); + + if(paymentVoucher.getOperationTypeSelect() == 9){ + if(paymentVoucher.getDebitCreditSelect() == "1"){ + reportType = "CashPaymentRequestDebit.rptdesign"; + }else if(paymentVoucher.getDebitCreditSelect() == "2"){ + reportType = "CashPaymentRequestCredit.rptdesign"; + } + } String fileLink = - ReportFactory.createReport(IReport.PAYMENT_VOUCHER, name + "-${date}") + ReportFactory.createReport(reportType, name + "-${date}") .addParam("PaymentVoucherId", paymentVoucher.getId()) .generate() .getFileLink(); @@ -380,7 +398,8 @@ public class PaymentVoucherController { } } - public void confirmMultipleVoucher(ActionRequest request,ActionResponse response) throws AxelorException { + public void confirmMultipleVoucher(ActionRequest request, ActionResponse response) + throws AxelorException { List voucherList = new ArrayList<>(); List elementToPays = new ArrayList<>(); @@ -388,22 +407,26 @@ public class PaymentVoucherController { List idList = (List) request.getContext().get("_ids"); for (Integer id : idList) { - PaymentVoucher paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(id.longValue()); + 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); - + 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()); + 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 { + public void getVoucherData(ActionRequest request, ActionResponse response) + throws AxelorException { List voucherList = new ArrayList<>(); List elementToPays = new ArrayList<>(); @@ -419,47 +442,83 @@ public class PaymentVoucherController { BigDecimal totalRemainingAmountAfterPaymentRefund = BigDecimal.ZERO; for (Integer id : idList) { - PaymentVoucher paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(id.longValue()); + 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); + totalVoucher = + voucherList + .stream() + .map(t -> t.getPaidAmount()) + .reduce(BigDecimal::add) + .orElse(BigDecimal.ZERO); - for (PayVoucherElementToPay elementPay : elementToPays) { + 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()); - } + 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()); - + 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()); } -} + + public void validateCashPaymentVoucher( + ActionRequest request, ActionResponse response) throws AxelorException { + PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class); + paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(paymentVoucher.getId()); + + try { + Beans.get(PaymentVoucherConfirmService.class).validateCashPaymentVoucher(paymentVoucher); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + + public void cancelCashPaymentVoucher( + ActionRequest request, ActionResponse response) throws AxelorException { + PaymentVoucher paymentVoucher = request.getContext().asType(PaymentVoucher.class); + paymentVoucher = Beans.get(PaymentVoucherRepository.class).find(paymentVoucher.getId()); + + try { + Beans.get(PaymentVoucherConfirmService.class).cancelCashPaymentVoucher(paymentVoucher); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } +} \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/ReconcileController.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/ReconcileController.java index 68e67df..224d81d 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/ReconcileController.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/apps/account/web/ReconcileController.java @@ -20,6 +20,7 @@ package com.axelor.apps.account.web; import com.axelor.apps.account.db.Reconcile; import com.axelor.apps.account.db.repo.ReconcileRepository; import com.axelor.apps.account.service.ReconcileService; +import com.axelor.apps.account.service.ReconcileServiceImpl; import com.axelor.exception.service.TraceBackService; import com.axelor.inject.Beans; import com.axelor.rpc.ActionRequest; @@ -43,6 +44,20 @@ public class ReconcileController { } } + // Unreconcile button + public void unreconcile2(ActionRequest request, ActionResponse response) { + + Reconcile reconcile = request.getContext().asType(Reconcile.class); + + try { + Beans.get(ReconcileServiceImpl.class) + .unreconcile2(Beans.get(ReconcileRepository.class).find(reconcile.getId())); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + // Reconcile button public void reconcile(ActionRequest request, ActionResponse response) { diff --git a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/csv/script/ImportPaymentVoucher.java b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/csv/script/ImportPaymentVoucher.java index a243e74..1e61aae 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/csv/script/ImportPaymentVoucher.java +++ b/modules/axelor-open-suite/axelor-account/src/main/java/com/axelor/csv/script/ImportPaymentVoucher.java @@ -55,7 +55,8 @@ public class ImportPaymentVoucher { PayVoucherDueElement payVoucherDueElement = paymentVoucherLoadService.createPayVoucherDueElement(moveLineToPay); paymentVoucher.addPayVoucherElementToPayListItem( - paymentVoucherLoadService.createPayVoucherElementToPay(payVoucherDueElement, 1,paymentVoucher.getRemainingAmount())); + paymentVoucherLoadService.createPayVoucherElementToPay( + payVoucherDueElement, 1, paymentVoucher.getRemainingAmount())); } if (paymentVoucher.getStatusSelect() == PaymentVoucherRepository.STATUS_CONFIRMED) { diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AccountingReport.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AccountingReport.xml index c794c15..5b48a3f 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AccountingReport.xml +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AccountingReport.xml @@ -51,6 +51,8 @@ + + - + - - - - - - + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AppBudget.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AppBudget.xml index 65e7e44..ced8a1a 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AppBudget.xml +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/AppBudget.xml @@ -8,10 +8,12 @@ + + diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/Budget.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/Budget.xml index 14dee04..9b394df 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/Budget.xml +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/Budget.xml @@ -19,7 +19,11 @@ + + + + - + + \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/BudgetLine.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/BudgetLine.xml index 9d7d224..eef593e 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/BudgetLine.xml +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/BudgetLine.xml @@ -7,6 +7,7 @@ + diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashAccountConfig.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashAccountConfig.xml new file mode 100644 index 0000000..59749d6 --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashAccountConfig.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashInventory.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashInventory.xml index eb8df5e..7b53aad 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashInventory.xml +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashInventory.xml @@ -19,6 +19,7 @@ + @@ -26,6 +27,9 @@ + + + diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashRegister.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashRegister.xml new file mode 100644 index 0000000..e792703 --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/CashRegister.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/PaymentVoucher.xml b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/PaymentVoucher.xml index 3582046..e901a5d 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/domains/PaymentVoucher.xml +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/domains/PaymentVoucher.xml @@ -62,8 +62,11 @@ - + + + + @@ -106,6 +109,13 @@ + + + + + + + @@ -135,6 +145,7 @@ + Voucher created Confirmed diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType18.rptdesign b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType18.rptdesign index 7d358dc..fbd74c8 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType18.rptdesign +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType18.rptdesign @@ -150,7 +150,7 @@ org.postgresql.Driver - jdbc:postgresql://localhost:5432/bdd_sophal + jdbc:postgresql://localhost:5432/bdd_live2 postgres SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= @@ -187,6 +187,24 @@ product_code product_code + + product_name + dimension + product_name + product_name + + + category + dimension + category + category + + + sub_category + dimension + sub_category + sub_category + account_code dimension @@ -251,6 +269,26 @@ true false + + param_3 + AccountingReportId + + decimal + -5 + 3 + true + false + + + param_4 + AccountingReportId + + decimal + -5 + 4 + true + false + @@ -261,36 +299,51 @@ 2 - account_code + product_name string 3 + category + string + + + 4 + sub_category + string + + + 5 + account_code + string + + + 6 initial_qty decimal - 4 + 7 initial_value decimal - 5 + 8 qty_in decimal - 6 + 9 val_in decimal - 7 + 10 qty_out decimal - 8 + 11 val_out decimal @@ -308,48 +361,69 @@ 2 + product_name + product_name + string + 12 + + + 3 + category + category + string + 12 + + + 4 + sub_category + sub_category + string + 12 + + + 5 account_code account_code string 12 - 3 + 6 initial_qty initial_qty decimal 2 - 4 + 7 initial_value initial_value decimal 2 - 5 + 8 qty_in qty_in decimal 2 - 6 + 9 val_in val_in decimal 2 - 7 + 10 qty_out qty_out decimal 2 - 8 + 11 val_out val_out decimal @@ -357,35 +431,55 @@ 0 ) + GROUP BY PRODUCT_ID) as D2 on D2.PRODUCT_ID = D1.PRODUCT_ID) as s1 + full outer join (select - _ACCOUNT.code as account_code, -_product.code as product_code, -sum(real_qty) as initial_qty, - sum(real_qty) * avg(gap_value) as initial_value -from account_accounting_report AccountingReport -left join base_product _product on AccountingReport.id = ? -left join stock_inventory_line inventory_line on inventory_line.product = _product.id -left join stock_inventory inventory on inventory.id = inventory_line.inventory -LEFT JOIN ACCOUNT_ACCOUNT_MANAGEMENT _MANAGEMENT ON _MANAGEMENT.PRODUCT = _product.id - LEFT JOIN ACCOUNT_ACCOUNT _ACCOUNT ON _ACCOUNT.ID = _MANAGEMENT.STOCK_ACCOUNT -where (date_part('year',inventory.planned_start_datet) = 2022 or inventory.id is null) - and inventory.stock_location not in (5,6) -group by _ACCOUNT.code,product_code -) as s1 - full outer join -(select a.CODE, + a.CODE, a.NAME, - a.product_code, - a.qty_in, + coalesce(a.product_code,b.product_code) as productcode, + a.qty_in, val_in, b.qty_out, val_out @@ -395,11 +489,11 @@ group by _ACCOUNT.code,product_code _PRODUCT.CODE as product_code, sum(real_qty) as qty_in, sum(case - when _move.type_select = 3 and _move.partner != 853 then round(_LINE.UNIT_PRICE_UNTAXED,3) * _line.real_qty - when _move.type_select = 3 and _move.partner = 853 then ROUND(_LINE.wap_price,3) * _line.real_qty + when _move.type_select = 3 and _move.partner != 853 then round(_LINE.UNIT_PRICE_UNTAXED,2) * _line.real_qty + when _move.type_select = 3 and _move.partner = 853 then ROUND(_LINE.wap_price,2) * _line.real_qty else 0 end) val_in from account_accounting_report AccountingReport -left outer join STOCK_STOCK_MOVE_LINE _LINE on AccountingReport.id = 9 +left outer join STOCK_STOCK_MOVE_LINE _LINE on AccountingReport.id = ? LEFT JOIN STOCK_STOCK_MOVE _MOVE ON _MOVE.ID = _LINE.STOCK_MOVE LEFT JOIN BASE_PRODUCT _PRODUCT ON _PRODUCT.ID = _LINE.PRODUCT LEFT JOIN ACCOUNT_ACCOUNT_MANAGEMENT _MANAGEMENT ON _MANAGEMENT.PRODUCT = _LINE.PRODUCT @@ -410,14 +504,16 @@ WHERE _MOVE.estimated_date >= AccountingReport.date_from AND _MOVE.estimated_da AND (_LINE.ARCHIVED IS NULL OR _LINE.ARCHIVED IS FALSE) and _MOVE.type_select = 3 and (_MOVE.from_stock_location not in (5,6) and _MOVE.to_stock_location not in (5,6)) -group by _ACCOUNT.CODE, _ACCOUNT.NAME,_PRODUCT.CODE) as a full outer join +group by _ACCOUNT.CODE, _ACCOUNT.NAME,_PRODUCT.CODE) as a + full outer join (SELECT _ACCOUNT.CODE, _ACCOUNT.NAME, _PRODUCT.CODE as product_code, sum(real_qty) as qty_out, sum(case - when _move.type_select = 2 and _move.partner = 853 then round(_LINE.wap_price,3) * _line.real_qty + when _move.type_select = 2 and _move.partner = 853 then round(_LINE.wap_price,2) * _line.real_qty + when _move.type_select = 2 and _move.partner != 853 then round(_LINE.unit_price_untaxed,2) * _line.real_qty else 0 end ) val_out from account_accounting_report AccountingReport left outer join STOCK_STOCK_MOVE_LINE _LINE on AccountingReport.id = ? @@ -432,8 +528,14 @@ WHERE _MOVE.estimated_date >= AccountingReport.date_from AND _MOVE.estimated_da and _MOVE.type_select = 2 and (_MOVE.from_stock_location not in (5,6) and _MOVE.to_stock_location not in (5,6)) group by _ACCOUNT.CODE, _ACCOUNT.NAME,_PRODUCT.CODE) as b on a.product_code = b.product_code -order by a.code) as s2 on s1.product_code = s2.product_code -where account_code like '3%']]> +order by a.code) +as s2 on s1.product_code = s2.productcode +where (coalesce(s1.product_code,s2.productcode) is not null ) and account_code like '3%' +and (coalesce(initial_qty,0) + coalesce(qty_in,0) + coalesce(qty_out,0) != 0 ) + + + +]]> nulls lowest @@ -1735,7 +1837,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]> sumSoldeQtyAgg - sumSoldeQty + sumSoldeVal float NewTableGroup1 @@ -1749,9 +1851,136 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]> true + + Aggregation_6 + sumSoldeQty + float + + NewTableGroup1 + + SUM + + + Expression + row["Aggregation"] + row["Aggregation_2"] - row["Aggregation_4"] + + + true + + + product_name + product_name + dataSetRow["product_name"] + string + + + sumInitAll + sumInitAll + float + SUM + + + Expression + row["Aggregation"] + + + true + + + sumInitValAll + sumInitValAll + float + SUM + + + Expression + row["Aggregation_1"] + + + true + + + sumQttInAll + sumQtyInAll + float + SUM + + + Expression + row["Aggregation_2"] + + + true + + + sumValInAll + sumValInAll + float + SUM + + + Expression + row["Aggregation_3"] + + + true + + + sumQtyOutAll + sumQtyOutAll + float + SUM + + + Expression + row["Aggregation_4"] + + + true + + + sumValOutAll + sumValOutAll + float + SUM + + + Expression + row["Aggregation_5"] + + + true + + + sumSoldeQtyAll + sumSoldeQtyAll + float + SUM + + + Expression + row["Aggregation_6"] + + + true + + + sumSoldeValAll + sumSoldeValAll + float + SUM + + + Expression + row["sumSoldeQtyAgg"] + + + true + + @@ -1795,6 +2024,22 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>CODE PRODUIT + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + 2 1 @@ -1810,7 +2055,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]> "Tw Cen MT" 12pt - INITIALE + INITIAL @@ -1846,7 +2091,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]> "Tw Cen MT" 12pt - SOLDE + SOLDE FINAL @@ -1874,6 +2119,17 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin middle + + solid + thin + solid + thin + solid + thin + solid + thin + middle + solid thin @@ -2023,6 +2279,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]> + @@ -2050,13 +2307,19 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + + solid + thin + solid + thin + solid thin solid thin - 9pt + 8pt bold Currency @@ -2072,7 +2335,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin - 9pt + 8pt bold Currency @@ -2088,7 +2351,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin - 9pt + 8pt bold Currency @@ -2104,7 +2367,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin - 9pt + 8pt bold Currency @@ -2120,7 +2383,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin - 9pt + 8pt bold Currency @@ -2136,7 +2399,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin - 9pt + 8pt bold Currency @@ -2151,15 +2414,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin - - 9pt + + 8pt bold Currency #,##0.00{RoundingMode=HALF_UP} right - sumSoldeQtyAgg + Aggregation_6 @@ -2169,6 +2432,16 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumSoldeQtyAgg + @@ -2186,6 +2459,7 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin "Tw Cen MT" + 9pt account_code @@ -2200,9 +2474,25 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin "Tw Cen MT" + 9pt product_code + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + product_name + + solid thin @@ -2213,6 +2503,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt Currency #,##0.00{RoundingMode=HALF_UP} @@ -2231,6 +2523,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt Currency #,##0.00{RoundingMode=HALF_UP} @@ -2249,6 +2543,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt Currency #,##0.00{RoundingMode=HALF_UP} @@ -2267,6 +2563,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt Currency #,##0.00{RoundingMode=HALF_UP} @@ -2285,6 +2583,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt Currency #,##0.00{RoundingMode=HALF_UP} @@ -2303,6 +2603,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt Currency #,##0.00{RoundingMode=HALF_UP} @@ -2321,6 +2623,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt right MoveLineDS @@ -2357,6 +2661,8 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + "Tw Cen MT" + 9pt right MoveLineDS @@ -2407,6 +2713,16 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>solid thin + + solid + thin + solid + thin + solid + thin + solid + thin + solid thin @@ -2416,6 +2732,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumInitAll + solid @@ -2426,6 +2751,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumInitValAll + solid @@ -2436,6 +2770,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumQttInAll + solid @@ -2446,6 +2789,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumValInAll + solid @@ -2456,6 +2808,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumQtyOutAll + solid @@ -2466,6 +2827,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumValOutAll + solid @@ -2476,6 +2846,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumSoldeQtyAll + solid @@ -2486,6 +2865,15 @@ where LangTranslate.message_key = ? and LangTranslate.language = ?]]>thin solid thin + + 8pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumSoldeValAll + diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType19.rptdesign b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType19.rptdesign index 43a0c52..576d58e 100644 --- a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType19.rptdesign +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType19.rptdesign @@ -285,7 +285,9 @@ = AccountingReport.date_from) AND -(AccountingReport.date_to IS NULL OR MoveLine.origin_date <= AccountingReport.date_to) AND -MoveLine.origin_date <= AccountingReport.date_val -AND Move.company = AccountingReport.company and Move.status_select = 3 +(AccountingReport.date_from IS NULL OR MoveLine.date_val >= AccountingReport.date_from) AND +(AccountingReport.date_to IS NULL OR MoveLine.date_val <= AccountingReport.date_to) AND +MoveLine.date_val <= AccountingReport.date_val +AND Move.company = AccountingReport.company and Move.status_select = 3 group by -to_char(origin_date ,'YYYY-MM'), +to_char(MoveLine.date_val ,'YYYY-MM'), account_journal.code, account_journal.name order by -to_char(origin_date ,'YYYY-MM')]]> +to_char(MoveLine.date_val ,'YYYY-MM')]]> nulls lowest diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType21.rptdesign b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType21.rptdesign new file mode 100644 index 0000000..2f8d7c4 --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType21.rptdesign @@ -0,0 +1,14312 @@ + + + Eclipse BIRT Designer Version 4.8.0.v201806261756 + + + odaURL + 209 + params["DBName"].value + + + odaUser + 209 + params["UserName"].value + + + odaPassword + 209 + params["Password"].value + + + in + /templates/blank_report.gif + fixed layout + ltr + 96 + + + true + static + true + decimal + true + + 119 + + + simple + false + text-box + + Unformatted + + + + true + static + string + true + + jdbc:postgresql://localhost:5432/bdd_sophal + + + simple + text-box + + Unformatted + + + + true + static + string + true + + postgres + + + simple + text-box + + Unformatted + + + + true + password + static + string + true + + root23 + + + simple + text-box + + Unformatted + + + + true + static + string + true + + fr + + + simple + text-box + + Unformatted + + + + true + static + false + string + true + + + + + simple + text-box + + Unformatted + + + + + + + + disabledMetadataBidiFormatStr + + + disabledContentBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + metadataBidiFormatStr + ILYNN + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_inv + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + org.postgresql.Driver + jdbc:postgresql://192.168.1.103:5432/bdd_sophal + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + nulls lowest + + + other_debit + measure + other_debit + other_debit + + + treasury + measure + treasury + treasury + + + taxes + measure + taxes + taxes + + + other_debit_N409 + other_debit_N409 + measure + other_debit_N409 + other_debit_N409 + + + 409 + 409 + measure + 409 + 409 + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + measure + debit_taxes_444_445_447 + debit_taxes_444_445_447 + + + debit_48 + debit_48 + measure + debit_48 + debit_48 + + + 50_N509 + 50_N509 + measure + 50_N509 + 50_N509 + + + debit_51_52_53_54 + debit_51_52_53_54 + measure + debit_51_52_53_54 + debit_51_52_53_54 + + + 59 + 59 + measure + 59 + 59 + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + measure + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + + + 20_N207 + 20_N207 + measure + 20_N207 + 20_N207 + + + 21_22_N229 + 21_22_N229 + measure + 21_22_N229 + 21_22_N229 + + + 282_292 + measure + 282_292 + 282_292 + + + 265 + 265 + measure + 265 + 265 + + + 26_N265_N269 + 26_N265_N269 + measure + 26_N265_N269 + 26_N265_N269 + + + 271_272_273 + 271_272_273 + measure + 271_272_273 + 271_272_273 + + + 274_275_276 + 274_275_276 + measure + 274_275_276 + 274_275_276 + + + 30__38 + 30__38 + measure + 30__38 + 30__38 + + + 39 + 39 + measure + 39 + 39 + + + 41_N419 + 41_N419 + measure + 41_N419 + 41_N419 + + + 491 + 491 + measure + 491 + 491 + + + 207 + 207 + measure + 207 + 207 + + + 211 + 211 + measure + 211 + 211 + + + 221 + 221 + measure + 221 + 221 + + + 23 + 23 + measure + 23 + 23 + + + 213_212 + 213_212 + measure + 213_212 + 213_212 + + + 28140_28147_2912 + measure + 28140_28147_2912 + 28140_28147_2912 + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + measure + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + + + 280_290_N2807_N2907 + measure + 280_290_N2807_N2907 + 280_290_N2807_N2907 + + + 133_138 + measure + 133_138 + 133_138 + + + 2807_2907 + measure + 2807_2907 + 2807_2907 + + + 293 + measure + 293 + 293 + + + 495_496 + measure + 495_496 + 495_496 + + + other_debit2 + measure + other_debit2 + other_debit2 + + + 281_282_291_292 + measure + 281_282_291_292 + 281_282_291_292 + + + 280_290_N2807_N2907_1 + measure + 280_290_N2807_N2907 + 280_290_N2807_N2907 + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + + + + 1 + other_debit + decimal + + + 2 + treasury + decimal + + + 3 + taxes + decimal + + + 4 + other_debit_N409 + decimal + + + 5 + 409 + decimal + + + 6 + debit_taxes_444_445_447 + decimal + + + 7 + debit_48 + decimal + + + 8 + 50_N509 + decimal + + + 9 + debit_51_52_53_54 + decimal + + + 10 + 59 + decimal + + + 11 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + decimal + + + 12 + 20_N207 + decimal + + + 13 + 21_22_N229 + decimal + + + 14 + 282_292 + decimal + + + 15 + 265 + decimal + + + 16 + 26_N265_N269 + decimal + + + 17 + 271_272_273 + decimal + + + 18 + 274_275_276 + decimal + + + 19 + 30__38 + decimal + + + 20 + 39 + decimal + + + 21 + 41_N419 + decimal + + + 22 + 491 + decimal + + + 23 + 207 + decimal + + + 24 + 211 + decimal + + + 25 + 221 + decimal + + + 26 + 23 + decimal + + + 27 + 213_212 + decimal + + + 28 + 28140_28147_2912 + decimal + + + 29 + 21_22_N211_N213_NA212_N221 + decimal + + + 30 + 280_290_N2807_N2907 + decimal + + + 31 + 133_138 + decimal + + + 32 + 2807_2907 + decimal + + + 33 + 293 + decimal + + + 34 + 495_496 + decimal + + + 35 + other_debit2 + decimal + + + 36 + 281_282_291_292 + decimal + + + 37 + 280_290_N2807_N2907_1 + decimal + + + + 0 + Data Source + + + 1 + other_debit + other_debit + decimal + 2 + + + 2 + treasury + treasury + decimal + 2 + + + 3 + taxes + taxes + decimal + 2 + + + 4 + other_debit_N409 + other_debit_N409 + decimal + 2 + + + 5 + 409 + 409 + decimal + 2 + + + 6 + debit_taxes_444_445_447 + debit_taxes_444_445_447 + decimal + 2 + + + 7 + debit_48 + debit_48 + decimal + 2 + + + 8 + 50_N509 + 50_N509 + decimal + 2 + + + 9 + debit_51_52_53_54 + debit_51_52_53_54 + decimal + 2 + + + 10 + 59 + 59 + decimal + 2 + + + 11 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + decimal + 2 + + + 12 + 20_N207 + 20_N207 + decimal + 2 + + + 13 + 21_22_N229 + 21_22_N229 + decimal + 2 + + + 14 + 282_292 + 282_292 + decimal + 2 + + + 15 + 265 + 265 + decimal + 2 + + + 16 + 26_N265_N269 + 26_N265_N269 + decimal + 2 + + + 17 + 271_272_273 + 271_272_273 + decimal + 2 + + + 18 + 274_275_276 + 274_275_276 + decimal + 2 + + + 19 + 30__38 + 30__38 + decimal + 2 + + + 20 + 39 + 39 + decimal + 2 + + + 21 + 41_N419 + 41_N419 + decimal + 2 + + + 22 + 491 + 491 + decimal + 2 + + + 23 + 207 + 207 + decimal + 2 + + + 24 + 211 + 211 + decimal + 2 + + + 25 + 221 + 221 + decimal + 2 + + + 26 + 23 + 23 + decimal + 2 + + + 27 + 213_212 + 213_212 + decimal + 2 + + + 28 + 28140_28147_2912 + 28140_28147_2912 + decimal + 2 + + + 29 + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + decimal + 2 + + + 30 + 280_290_N2807_N2907 + 280_290_N2807_N2907 + decimal + 2 + + + 31 + 133_138 + 133_138 + decimal + 2 + + + 32 + 2807_2907 + 2807_2907 + decimal + 2 + + + 33 + 293 + 293 + decimal + 2 + + + 34 + 495_496 + 495_496 + decimal + 2 + + + 35 + other_debit2 + other_debit2 + decimal + 2 + + + 36 + 281_282_291_292 + 281_282_291_292 + decimal + 2 + + + 37 + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + decimal + 2 + + + = ACCOUNTINGREPORT.DATE_FROM) + AND (ACCOUNTINGREPORT.DATE_TO IS NULL OR MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_TO) + AND MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_VAL + AND MOVE.COMPANY = ACCOUNTINGREPORT.COMPANY + AND (ACCOUNTINGREPORT.PERIOD IS NULL OR ACCOUNTINGREPORT.PERIOD = MOVE.PERIOD) + AND MOVE.STATUS_SELECT = 3 + AND (MOVE.ARCHIVED IS NULL OR MOVE.ARCHIVED = FALSE) + AND (MOVELINE.ARCHIVED IS NULL OR MOVELINE.ARCHIVED = FALSE) +group by MOVELINE.ACCOUNT_CODE) +select + sum(CASE WHEN (d409 - c409) > 0 THEN (d409 - c409) ELSE 0 END) + + sum(CASE WHEN (d42 - c42) > 0 THEN (d42 - c42) ELSE 0 END )+ + sum(CASE WHEN (d43 - c43) > 0 THEN (d43 - c43) ELSE 0 END )+ + sum(CASE WHEN (d44 - c44) > 0 THEN (d44 - c44) ELSE 0 END )+ + sum(CASE WHEN (d45 - c45) > 0 THEN (d45 - c45) ELSE 0 END )+ + sum(CASE WHEN (d46 - c46) > 0 THEN (d46 - c46) ELSE 0 END )+ + sum(CASE WHEN (d47 - c47) > 0 THEN (d47 - c47) ELSE 0 END )+ + sum(CASE WHEN (d486 - c486) > 0 THEN (d486 - c486) ELSE 0 END )+ + sum(CASE WHEN (d487 - c487) > 0 THEN (d487 - c487) ELSE 0 END )- + sum(CASE WHEN (d444 - c444) > 0 THEN (d444 - c444) ELSE 0 END )- + sum(CASE WHEN (d445 - c445) > 0 THEN (d445 - c445) ELSE 0 END )- + sum(CASE WHEN (d446 - c446) > 0 THEN (d446 - c446) ELSE 0 END )- + sum(CASE WHEN (d447 - c447) > 0 THEN (d447 - c447) ELSE 0 END ) as other_debit, + sum(CASE WHEN (d51 - c51) > 0 THEN (d51 - c51) ELSE 0 END) + + sum(CASE WHEN (d52 - c52) > 0 THEN (d52 - c52) ELSE 0 END )+ + sum(CASE WHEN (d53 - c53) > 0 THEN (d53 - c53) ELSE 0 END )+ + sum(CASE WHEN (d54 - c54) > 0 THEN (d54 - c54) ELSE 0 END )+ + sum(CASE WHEN (d58 - c58) > 0 THEN (d58 - c58) ELSE 0 END) as treasury, + sum(CASE WHEN (d444 - c444) > 0 THEN (d444 - c444) ELSE 0 END) + + sum(CASE WHEN (d445 - c445) > 0 THEN (d445 - c445) ELSE 0 END )+ + sum(CASE WHEN (d447 - c447) > 0 THEN (d447 - c447) ELSE 0 END ) as taxes, +SUM("other_debit_N409") AS "other_debit_N409", +SUM("409") AS "409", +SUM("debit_taxes_444_445_447") AS "debit_taxes_444_445_447", +SUM("debit_48") AS "debit_48", +SUM("50_N509") AS "50_N509", +SUM("debit_51_52_53_54") AS "debit_51_52_53_54", +SUM("59") AS "59", +SUM("2813_2913_2815_2918_2814_N28140_N28147_2818") AS "2813_2913_2815_2918_2814_N28140_N28147_2818", +SUM("20_N207") AS "20_N207", +SUM("21_22_N229") AS "21_22_N229", +SUM("282_292") AS "282_292", +SUM("265") AS "265", +SUM("26_N265_N269") AS "26_N265_N269", +SUM("271_272_273") AS "271_272_273", +SUM("274_275_276") AS "274_275_276", +SUM("30__38") AS "30__38", +SUM("39") AS "39", +SUM("41_N419") AS "41_N419", +SUM("491") AS "491", +SUM("207") AS "207", +SUM("211") AS "211", +SUM("221") AS "221", +SUM("23") AS "23", +SUM("213_212") AS "213_212", +SUM("28140_28147_2912") AS "28140_28147_2912", +SUM("21_22_N211_N213_NA212_N221") AS "21_22_N211_N213_NA212_N221", +SUM("280_290_N2807_N2907") AS "280_290_N2807_N2907", +SUM("133_138") AS "133_138", +SUM("2807_2907") AS "2807_2907", +SUM("293") AS "293", +SUM("495_496") AS "495_496", +SUM("other_debit2") AS "other_debit2", +SUM("281_282_291_292") AS "281_282_291_292" , +sum("280_290_N2807_N2907") as "280_290_N2807_N2907" + from aa]]> + + + nulls lowest + + + company_name + dimension + company_name + company_name + + + logo_height + measure + logo_height + logo_height + + + logo_width + measure + logo_width + logo_width + + + date_from + dimension + date_from + date_from + + + date_to + dimension + date_to + date_to + + + report_date + dimension + report_date + report_date + + + report_date_edition + dimension + report_date_edition + report_date_edition + + + logo_path + dimension + logo_path + logo_path + + + period_name + dimension + period_name + period_name + + + journal_name + dimension + journal_name + journal_name + + + global + measure + global + global + + + global_by_date + measure + global_by_date + global_by_date + + + payment_mode + dimension + payment_mode + payment_mode + + + currency + dimension + currency + currency + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + false + true + false + + + + + + 1 + company_name + string + + + 2 + logo_height + integer + + + 3 + logo_width + integer + + + 4 + date_from + date + + + 5 + date_to + date + + + 6 + report_date + date + + + 7 + report_date_edition + date-time + + + 8 + logo_path + string + + + 9 + period_name + string + + + 10 + journal_name + string + + + 11 + global + integer + + + 12 + global_by_date + integer + + + 13 + payment_mode + string + + + 14 + currency + string + + + + Data Source + + + 1 + company_name + company_name + string + 12 + + + 2 + logo_height + logo_height + integer + 4 + + + 3 + logo_width + logo_width + integer + 4 + + + 4 + date_from + date_from + date + 91 + + + 5 + date_to + date_to + date + 91 + + + 6 + report_date + report_date + date + 91 + + + 7 + report_date_edition + report_date_edition + date-time + 93 + + + 8 + logo_path + logo_path + string + 12 + + + 9 + period_name + period_name + string + 12 + + + 10 + journal_name + journal_name + string + 12 + + + 11 + global + global + integer + -7 + + + 12 + global_by_date + global_by_date + integer + -7 + + + 13 + payment_mode + payment_mode + string + 12 + + + 14 + currency + currency + string + 12 + + + + + + nulls lowest + + + message_key + dimension + message_key + message_key + + + translation + dimension + translation + translation + + + + + param_1 + + string + -1 + 1 + true + + + param_2 + Locale + + string + -1 + 2 + true + false + + + + + + 1 + message_key + string + + + 2 + translation + string + + + + Data Source + + + 1 + message_key + message_key + string + 12 + + + 2 + translation + translation + string + 12 + + + + + + 2.0 + + + + In + + + + 1 + + -1 + 0 + 0 + Unknown + + + + + + In + + + + 2 + + -1 + 0 + 0 + Unknown + + + + +]]> + + + + + treasury + measure + treasury + treasury + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + + + + 1 + treasury + decimal + + + + Data Source + + + 1 + treasury + treasury + decimal + 2 + + + = ACCOUNTINGREPORT.DATE_FROM) + AND (ACCOUNTINGREPORT.DATE_TO IS NULL OR MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_TO) + AND MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_VAL + AND MOVE.COMPANY = ACCOUNTINGREPORT.COMPANY + AND (ACCOUNTINGREPORT.PERIOD IS NULL OR ACCOUNTINGREPORT.PERIOD = MOVE.PERIOD) + AND MOVE.STATUS_SELECT = 3 + AND (MOVE.ARCHIVED IS NULL OR MOVE.ARCHIVED = FALSE) + AND (MOVELINE.ARCHIVED IS NULL OR MOVELINE.ARCHIVED = FALSE) +) +SELECT + CASE WHEN (d51 - c51) > 0 THEN (d51 - c51) ELSE 0 END + + CASE WHEN (d52 - c52) > 0 THEN (d52 - c52) ELSE 0 END + + CASE WHEN (d53 - c53) > 0 THEN (d53 - c53) ELSE 0 END + + CASE WHEN (d54 - c54) > 0 THEN (d54 - c54) ELSE 0 END + + CASE WHEN (d58 - c58) > 0 THEN (d58 - c58) ELSE 0 END as treasury +FROM Summary; +]]> + + + 2.0 + + + + In + + + + 1 + + -5 + 0 + 0 + Unknown + + + + + + + + + + + treasury + 1 + + 2 + 0 + 0 + Unknown + + treasury + + + + treasury + + 131089 + + + + + + + +]]> + + + + + other_debit + measure + other_debit + other_debit + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + + + + 1 + other_debit + decimal + + + + Data Source + + + 1 + other_debit + other_debit + decimal + 2 + + + = ACCOUNTINGREPORT.DATE_FROM) + AND (ACCOUNTINGREPORT.DATE_TO IS NULL OR MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_TO) + AND MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_VAL + AND MOVE.COMPANY = ACCOUNTINGREPORT.COMPANY + AND (ACCOUNTINGREPORT.PERIOD IS NULL OR ACCOUNTINGREPORT.PERIOD = MOVE.PERIOD) + AND MOVE.STATUS_SELECT = 3 + AND (MOVE.ARCHIVED IS NULL OR MOVE.ARCHIVED = FALSE) + AND (MOVELINE.ARCHIVED IS NULL OR MOVELINE.ARCHIVED = FALSE) +) +SELECT + (CASE WHEN (d409 - c409) > 0 THEN (d409 - c409) ELSE 0 END + + CASE WHEN (d42 - c42) > 0 THEN (d42 - c42) ELSE 0 END + + CASE WHEN (d43 - c43) > 0 THEN (d43 - c43) ELSE 0 END + + CASE WHEN (d44 - c44) > 0 THEN (d44 - c44) ELSE 0 END + + CASE WHEN (d45 - c45) > 0 THEN (d45 - c45) ELSE 0 END + + CASE WHEN (d46 - c46) > 0 THEN (d46 - c46) ELSE 0 END + + CASE WHEN (d47 - c47) > 0 THEN (d47 - c47) ELSE 0 END + + CASE WHEN (d486 - c486) > 0 THEN (d486 - c486) ELSE 0 END + + CASE WHEN (d487 - c487) > 0 THEN (d487 - c487) ELSE 0 END - + CASE WHEN (d444 - c444) > 0 THEN (d444 - c444) ELSE 0 END - + CASE WHEN (d445 - c445) > 0 THEN (d445 - c445) ELSE 0 END - + CASE WHEN (d446 - c446) > 0 THEN (d446 - c446) ELSE 0 END - + CASE WHEN (d447 - c447) > 0 THEN (d447 - c447) ELSE 0 END ) as other_debit +FROM Summary; +]]> + + + 2.0 + + + + In + + + + 1 + + -5 + 0 + 0 + Unknown + + + + + + + + + + + other_debit + 1 + + 2 + 0 + 0 + Unknown + + other_debit + + + + other_debit + + 131089 + + + + + + + +]]> + + + + + + + + + + a4 + portrait + 0.8in + 0.33in + + + 0.71875in + 7.697916666666667in + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + logo_height + logo_height + if(dataSetRow["logo_height"]>0){dataSetRow["logo_height"]+'px'}else{'35px'} + integer + true + + + logo_width + logo_width + if(dataSetRow["logo_width"]>0){dataSetRow["logo_width"]+'px'}else{'100px'} + integer + true + + + currency + currency + dataSetRow["currency"] + string + + + + 1.9791666666666667in + + + 4.520833333333333in + + + 1.2in + + + 69px + + + 8pt + + + all + row["logo_path"] == null + + + html + + + + "" + + +]]> + + + + top + + + + top + + 9pt + html + row["report_date_edition"]]]> + + + + + + + + 11.033333333333333in + + 10.022222222222222in + + + 1.011111111111111in + + + + + + + + right + 0.3in + + + + + 0.3333333333333333in + + 0pt + 0pt + 0pt + 0pt + + 9pt + page-number + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + plain + + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + total-page + + + + + + + + + + + + + middle + 11.0625in + 7.666666666666667in + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + + 1.5104166666666667in + + + 4.1875in + + + 1.96875in + + + 0.34375in + + + + center + auto + + + + + + + 0.5in + + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.endDate' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + + + + 0.4166666666666667in + + + + 0.4166666666666667in + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["report_date"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.period' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + + + + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["period_name"]]]> + + + + + + + + 0.2708333333333333in + + 3 + 1 + + + + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.from' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["date_from"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.to' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["date_to"]]]> + + + + + + + + 0.2708333333333333in + + + + + + 9.479166666666666in + + 3 + 1 + + 7.5625in + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + + 2.4166666666666665in + + + 1.875in + + + 1.46875in + + + 1.8020833333333333in + +
+ + #C0C0C0 + bold + middle + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + +
+ + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 207 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["2807_2907"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row._outer["207"]) - Math.abs(row._outer["2807_2907"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 20_N207 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["280_290_N2807_N2907"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["20_N207"]) - +Math.abs(row["280_290_N2807_N2907"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + + + all + true + + + 21_22_N229 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + all + true + + + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["281_282_291_292"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + all + true + + + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["21_22_N229"]) - +Math.abs(row["281_282_291_292"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 211 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["211"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 213_212 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["28140_28147_2912"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["213_212"]) - +Math.abs(row["28140_28147_2912"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 21_22_N211_N213_NA212_N221 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["2813_2913_2815_2918_2814_N28140_N28147_2818"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["21_22_N211_N213_NA212_N221"]) - +Math.abs(row["2813_2913_2815_2918_2814_N28140_N28147_2818"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 221 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["282_292"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["221"]) - +Math.abs(row["282_292"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 23 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["293"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["23"]) - +Math.abs(row["293"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 265 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["265"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 26_N265_N269 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row._outer["26_N265_N269"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 271_272_273 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["271_272_273"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 274_275_276 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +Math.abs(row["274_275_276"]) +]]> + + + + + none + solid + thin + solid + thin + none + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 133_138 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 133_138 + + + + + #C0C0C0 + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +row._outer["207"] ++ row._outer["20_N207"] ++ row._outer["21_22_N229"] ++ row._outer["23"] ++ row._outer["265"] ++ row._outer["26_N265_N269"] ++ row._outer["271_272_273"] ++ row._outer["274_275_276"] ++ row._outer["133_138"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["2807_2907"]) ++ Math.abs(row["280_290_N2807_N2907"]) ++ Math.abs(row["281_282_291_292"]) ++ Math.abs(row["293"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +row["207"] ++ row["20_N207"] ++ row["21_22_N229"] ++ row["23"] ++ row["265"] ++ row["26_N265_N269"] ++ row["271_272_273"] ++ row["274_275_276"] ++ row["133_138"] +- +( +Math.abs(row["2807_2907"]) ++ Math.abs(row["280_290_N2807_N2907"]) ++ Math.abs(row["281_282_291_292"]) ++ Math.abs(row["293"]) +) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 30__38 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["39"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row["30__38"]) - Math.abs(row._outer["39"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 41_N419 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["491"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row["41_N419"]) - +Math.abs(row._outer["491"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + row["other_debit"]]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["495_496"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +row["other_debit"] - Math.abs(row._outer["495_496"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + row["taxes"]]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row._outer["taxes"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + 50_N509 + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row._outer["50_N509"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + html + +row["treasury"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["59"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row["treasury"]) - Math.abs(row["59"]) +]]> + + + + + #C0C0C0 + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +row["30__38"] ++ row["41_N419"] ++ row["other_debit"] ++ row["taxes"] ++ row["50_N509"] ++ row["treasury"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row._outer["39"] ++ row["491"] ++ row["495_496"] ++ row["59"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + html + +Math.abs(row["30__38"]) - Math.abs(row._outer["39"]) ++ +Math.abs(row["41_N419"]) - +Math.abs(row._outer["491"])+ +row["other_debit"] - Math.abs(row._outer["495_496"])+ +Math.abs(row._outer["taxes"])+ +Math.abs(row._outer["50_N509"])+ + +Math.abs(row["treasury"]) - Math.abs(row["59"]) + +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +row._outer["207"] ++ row._outer["20_N207"] ++ row._outer["21_22_N229"] ++ row._outer["23"] ++ row._outer["265"] ++ row._outer["26_N265_N269"] ++ row._outer["271_272_273"] ++ row._outer["274_275_276"] ++ row._outer["133_138"] ++ row["30__38"] ++ row["41_N419"] ++ row["other_debit"] ++ row["taxes"] ++ row["50_N509"] ++ row["treasury"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + html + +Math.abs(row["2807_2907"] ) ++ Math.abs(row["280_290_N2807_N2907"]) ++ Math.abs(row["281_282_291_292"]) ++ Math.abs(row["293"]) ++Math.abs(row["39"] ) ++Math.abs( row["491"] ) ++ Math.abs(row["495_496"]) ++ Math.abs(row["59"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + other_debit + other_debit + dataSetRow["other_debit"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_N409 + other_debit_N409 + dataSetRow["other_debit_N409"] + decimal + + + 409 + 409 + dataSetRow["409"] + decimal + + + debit_taxes_444_445_447 + debit_taxes_444_445_447 + dataSetRow["debit_taxes_444_445_447"] + decimal + + + debit_48 + debit_48 + dataSetRow["debit_48"] + decimal + + + 50_N509 + 50_N509 + dataSetRow["50_N509"] + decimal + + + debit_51_52_53_54 + debit_51_52_53_54 + dataSetRow["debit_51_52_53_54"] + decimal + + + 59 + 59 + dataSetRow["59"] + decimal + + + 2813_2913_2815_2918_2814_N28140_N28147_2818 + 2813_2913_2815_2918_2814_N28140_N28147_2818 + dataSetRow["2813_2913_2815_2918_2814_N28140_N28147_2818"] + decimal + + + 20_N207 + 20_N207 + dataSetRow["20_N207"] + decimal + + + 21_22_N229 + 21_22_N229 + dataSetRow["21_22_N229"] + decimal + + + 282_292 + 282_292 + dataSetRow["282_292"] + decimal + + + 265 + 265 + dataSetRow["265"] + decimal + + + 26_N265_N269 + 26_N265_N269 + dataSetRow["26_N265_N269"] + decimal + + + 271_272_273 + 271_272_273 + dataSetRow["271_272_273"] + decimal + + + 274_275_276 + 274_275_276 + dataSetRow["274_275_276"] + decimal + + + 30__38 + 30__38 + dataSetRow["30__38"] + decimal + + + 39 + 39 + dataSetRow["39"] + decimal + + + 41_N419 + 41_N419 + dataSetRow["41_N419"] + decimal + + + 491 + 491 + dataSetRow["491"] + decimal + + + 207 + 207 + dataSetRow["207"] + decimal + + + 211 + 211 + dataSetRow["211"] + decimal + + + 221 + 221 + dataSetRow["221"] + decimal + + + 23 + 23 + dataSetRow["23"] + decimal + + + 213_212 + 213_212 + dataSetRow["213_212"] + decimal + + + 28140_28147_2912 + 28140_28147_2912 + dataSetRow["28140_28147_2912"] + decimal + + + 21_22_N211_N213_NA212_N221 + 21_22_N211_N213_NA212_N221 + dataSetRow["21_22_N211_N213_NA212_N221"] + decimal + + + 280_290_N2807_N2907 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907"] + decimal + + + 133_138 + 133_138 + dataSetRow["133_138"] + decimal + + + 2807_2907 + 2807_2907 + dataSetRow["2807_2907"] + decimal + + + 293 + 293 + dataSetRow["293"] + decimal + + + 495_496 + 495_496 + dataSetRow["495_496"] + decimal + + + other_debit2 + other_debit2 + dataSetRow["other_debit2"] + decimal + + + 281_282_291_292 + 281_282_291_292 + dataSetRow["281_282_291_292"] + decimal + + + 280_290_N2807_N2907_1 + 280_290_N2807_N2907 + dataSetRow["280_290_N2807_N2907_1"] + decimal + + + html + +row._outer["207"] ++ row._outer["20_N207"] ++ row._outer["21_22_N229"] ++ row._outer["23"] ++ row._outer["265"] ++ row._outer["26_N265_N269"] ++ row._outer["271_272_273"] ++ row._outer["274_275_276"] ++ row._outer["133_138"] ++ row["30__38"] ++ row["41_N419"] ++ row["other_debit"] ++ row["taxes"] ++ row["50_N509"] ++ row["treasury"] - +( +Math.abs(row["2807_2907"] ) ++ Math.abs(row["280_290_N2807_N2907"]) ++ Math.abs(row["281_282_291_292"]) ++ Math.abs(row["293"]) ++Math.abs(row["39"] ) ++Math.abs( row["491"] ) ++ Math.abs(row["495_496"]) ++ Math.abs(row["59"]) + +) +]]> + + + + +
+ + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + +
+
+
+
+ + + 3 + 1 + + auto + + + + +
+ +
diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType22.rptdesign b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType22.rptdesign new file mode 100644 index 0000000..6b490c7 --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType22.rptdesign @@ -0,0 +1,12837 @@ + + + Eclipse BIRT Designer Version 4.8.0.v201806261756 + + + odaURL + 209 + params["DBName"].value + + + odaUser + 209 + params["UserName"].value + + + odaPassword + 209 + params["Password"].value + + + in + /templates/blank_report.gif + fixed layout + ltr + 96 + + + true + static + true + decimal + true + + 119 + + + simple + false + text-box + + Unformatted + + + + true + static + string + true + + jdbc:postgresql://localhost:5432/bdd_sophal + + + simple + text-box + + Unformatted + + + + true + static + string + true + + postgres + + + simple + text-box + + Unformatted + + + + true + password + static + string + true + + root23 + + + simple + text-box + + Unformatted + + + + true + static + string + true + + fr + + + simple + text-box + + Unformatted + + + + true + static + false + string + true + + + + + simple + text-box + + Unformatted + + + + + + + + disabledMetadataBidiFormatStr + + + disabledContentBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + metadataBidiFormatStr + ILYNN + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_live2 + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_sophal + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + nulls lowest + + + 100 + measure + 100 + 100 + + + 101_108 + measure + 101_108 + 101_108 + + + 109 + measure + 109 + 109 + + + 104_106 + measure + 104_106 + 104_106 + + + 105 + measure + 105 + 105 + + + 107 + measure + 107 + 107 + + + 12 + measure + 12 + 12 + + + 11 + measure + 11 + 11 + + + 16_17 + measure + 16_17 + 16_17 + + + 134_155 + measure + 134_155 + 134_155 + + + 229 + measure + 229 + 229 + + + 15_N155_131_132 + measure + 15_N155_131_132 + 15_N155_131_132 + + + 40_N409 + measure + 40_N409 + 40_N409 + + + credit_444_445_447 + measure + credit_444_445_447 + credit_444_445_447 + + + another_debt + measure + another_debt + another_debt + + + credit_51_52 + measure + credit_51_52 + credit_51_52 + + + resultat + measure + resultat + resultat + + + treasury + measure + treasury + treasury + + + taxes + measure + taxes + taxes + + + other_debit_old + measure + other_debit_old + other_debit_old + + + 100_old + measure + 100_old + 100_old + + + 101_108_old + measure + 101_108_old + 101_108_old + + + 109_old + measure + 109_old + 109_old + + + 104_106_old + measure + 104_106_old + 104_106_old + + + 105_old + measure + 105_old + 105_old + + + 107_old + measure + 107_old + 107_old + + + 12_old + measure + 12_old + 12_old + + + 11_old + measure + 11_old + 11_old + + + 16_17_old + measure + 16_17_old + 16_17_old + + + 134_155_old + measure + 134_155_old + 134_155_old + + + 229_old + measure + 229_old + 229_old + + + 15_N155_131_132_old + measure + 15_N155_131_132_old + 15_N155_131_132_old + + + 40_N409_old + measure + 40_N409_old + 40_N409_old + + + credit_444_445_447_old + measure + credit_444_445_447_old + credit_444_445_447_old + + + another_debt_old + measure + another_debt_old + another_debt_old + + + credit_51_52_old + measure + credit_51_52_old + credit_51_52_old + + + resultat_old + measure + resultat_old + resultat_old + + + treasury_old + measure + treasury_old + treasury_old + + + taxes_old + measure + taxes_old + taxes_old + + + other_debit_old_bb + measure + other_debit_old_bb + other_debit_old_bb + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + param_2 + AccountingReportId + + decimal + -5 + 2 + true + false + + + + + + 1 + 100 + decimal + + + 2 + 101_108 + decimal + + + 3 + 109 + decimal + + + 4 + 104_106 + decimal + + + 5 + 105 + decimal + + + 6 + 107 + decimal + + + 7 + 12 + decimal + + + 8 + 11 + decimal + + + 9 + 16_17 + decimal + + + 10 + 134_155 + decimal + + + 11 + 229 + decimal + + + 12 + 15_N155_131_132 + decimal + + + 13 + 40_N409 + decimal + + + 14 + credit_444_445_447 + decimal + + + 15 + another_debt + decimal + + + 16 + credit_51_52 + decimal + + + 17 + resultat + decimal + + + 18 + treasury + decimal + + + 19 + taxes + decimal + + + 20 + other_debit_old + decimal + + + 21 + 100_old + decimal + + + 22 + 101_108_old + decimal + + + 23 + 109_old + decimal + + + 24 + 104_106_old + decimal + + + 25 + 105_old + decimal + + + 26 + 107_old + decimal + + + 27 + 12_old + decimal + + + 28 + 11_old + decimal + + + 29 + 16_17_old + decimal + + + 30 + 134_155_old + decimal + + + 31 + 229_old + decimal + + + 32 + 15_N155_131_132_old + decimal + + + 33 + 40_N409_old + decimal + + + 34 + credit_444_445_447_old + decimal + + + 35 + another_debt_old + decimal + + + 36 + credit_51_52_old + decimal + + + 37 + resultat_old + decimal + + + 38 + treasury_old + decimal + + + 39 + taxes_old + decimal + + + 40 + other_debit_old_bb + decimal + + + + 0 + Data Source + + + 1 + 100 + 100 + decimal + 2 + + + 2 + 101_108 + 101_108 + decimal + 2 + + + 3 + 109 + 109 + decimal + 2 + + + 4 + 104_106 + 104_106 + decimal + 2 + + + 5 + 105 + 105 + decimal + 2 + + + 6 + 107 + 107 + decimal + 2 + + + 7 + 12 + 12 + decimal + 2 + + + 8 + 11 + 11 + decimal + 2 + + + 9 + 16_17 + 16_17 + decimal + 2 + + + 10 + 134_155 + 134_155 + decimal + 2 + + + 11 + 229 + 229 + decimal + 2 + + + 12 + 15_N155_131_132 + 15_N155_131_132 + decimal + 2 + + + 13 + 40_N409 + 40_N409 + decimal + 2 + + + 14 + credit_444_445_447 + credit_444_445_447 + decimal + 2 + + + 15 + another_debt + another_debt + decimal + 2 + + + 16 + credit_51_52 + credit_51_52 + decimal + 2 + + + 17 + resultat + resultat + decimal + 2 + + + 18 + treasury + treasury + decimal + 2 + + + 19 + taxes + taxes + decimal + 2 + + + 20 + other_debit_old + other_debit_old + decimal + 2 + + + 21 + 100_old + 100_old + decimal + 2 + + + 22 + 101_108_old + 101_108_old + decimal + 2 + + + 23 + 109_old + 109_old + decimal + 2 + + + 24 + 104_106_old + 104_106_old + decimal + 2 + + + 25 + 105_old + 105_old + decimal + 2 + + + 26 + 107_old + 107_old + decimal + 2 + + + 27 + 12_old + 12_old + decimal + 2 + + + 28 + 11_old + 11_old + decimal + 2 + + + 29 + 16_17_old + 16_17_old + decimal + 2 + + + 30 + 134_155_old + 134_155_old + decimal + 2 + + + 31 + 229_old + 229_old + decimal + 2 + + + 32 + 15_N155_131_132_old + 15_N155_131_132_old + decimal + 2 + + + 33 + 40_N409_old + 40_N409_old + decimal + 2 + + + 34 + credit_444_445_447_old + credit_444_445_447_old + decimal + 2 + + + 35 + another_debt_old + another_debt_old + decimal + 2 + + + 36 + credit_51_52_old + credit_51_52_old + decimal + 2 + + + 37 + resultat_old + resultat_old + decimal + 2 + + + 38 + treasury_old + treasury_old + decimal + 2 + + + 39 + taxes_old + taxes_old + decimal + 2 + + + 40 + other_debit_old_bb + other_debit_old_bb + decimal + 2 + + + = ACCOUNTINGREPORT.DATE_FROM) + AND (ACCOUNTINGREPORT.DATE_TO IS NULL OR MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_TO) + AND MOVELINE.DATE_VAL <= ACCOUNTINGREPORT.DATE_VAL + AND MOVE.COMPANY = ACCOUNTINGREPORT.COMPANY + AND (ACCOUNTINGREPORT.PERIOD IS NULL OR ACCOUNTINGREPORT.PERIOD = MOVE.PERIOD) + AND MOVE.STATUS_SELECT = 3 + AND (MOVE.ARCHIVED IS NULL OR MOVE.ARCHIVED = FALSE) + AND (MOVELINE.ARCHIVED IS NULL OR MOVELINE.ARCHIVED = FALSE) +group by MOVELINE.ACCOUNT_CODE), bb as +(select + MOVELINE.ACCOUNT_CODE, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '51%' THEN DEBIT ELSE 0 END) AS d51, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '51%' THEN CREDIT ELSE 0 END) AS c51, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '52%' THEN DEBIT ELSE 0 END) AS d52, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '52%' THEN CREDIT ELSE 0 END) AS c52, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '419%' THEN DEBIT ELSE 0 END) AS d419, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '419%' THEN CREDIT ELSE 0 END) AS c419, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '509%' THEN DEBIT ELSE 0 END) AS d509, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '509%' THEN CREDIT ELSE 0 END) AS c509, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '42%' THEN DEBIT ELSE 0 END) AS d42, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '42%' THEN CREDIT ELSE 0 END) AS c42, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '43%' THEN DEBIT ELSE 0 END) AS d43, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '43%' THEN CREDIT ELSE 0 END) AS c43, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '44%' THEN DEBIT ELSE 0 END) AS d44, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '44%' THEN CREDIT ELSE 0 END) AS c44, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '45%' THEN DEBIT ELSE 0 END) AS d45, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '45%' THEN CREDIT ELSE 0 END) AS c45, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '46%' THEN DEBIT ELSE 0 END) AS d46, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '46%' THEN CREDIT ELSE 0 END) AS c46, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '47%' THEN DEBIT ELSE 0 END) AS d47, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '47%' THEN CREDIT ELSE 0 END) AS c47, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '48%' THEN DEBIT ELSE 0 END) AS d48, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '48%' THEN CREDIT ELSE 0 END) AS c48, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '444%' THEN DEBIT ELSE 0 END) AS d444, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '444%' THEN CREDIT ELSE 0 END) AS c444, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '445%' THEN DEBIT ELSE 0 END) AS d445, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '445%' THEN CREDIT ELSE 0 END) AS c445, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '446%' THEN DEBIT ELSE 0 END) AS d446, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '446%' THEN CREDIT ELSE 0 END) AS c446, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '447%' THEN DEBIT ELSE 0 END) AS d447, + SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '447%' THEN CREDIT ELSE 0 END) AS c447, + (SUM(case when (MOVELINE.ACCOUNT_CODE like '100%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '100%') then CREDIT else 0 end)) AS "100_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '101%' or MOVELINE.ACCOUNT_CODE like '108%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '101%' or MOVELINE.ACCOUNT_CODE like '108%') then CREDIT else 0 end)) AS "101_108_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '109%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '109%') then CREDIT else 0 end)) AS "109_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '104%' or MOVELINE.ACCOUNT_CODE like '106%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '104%' or MOVELINE.ACCOUNT_CODE like '106%') then CREDIT else 0 end)) AS "104_106_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '105%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '105%') then CREDIT else 0 end)) AS "105_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '107%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '107%') then CREDIT else 0 end)) AS "107_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '12%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '12%') then CREDIT else 0 end)) AS "12_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '11%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '11%') then CREDIT else 0 end)) AS "11_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '16%' or MOVELINE.ACCOUNT_CODE like '17%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '16%' or MOVELINE.ACCOUNT_CODE like '17%') then CREDIT else 0 end)) AS "16_17_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '134%' or MOVELINE.ACCOUNT_CODE like '155%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '134%' or MOVELINE.ACCOUNT_CODE like '155%') then CREDIT else 0 end)) AS "134_155_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '229%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '229%') then CREDIT else 0 end)) AS "229_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '131%' or MOVELINE.ACCOUNT_CODE like '132%' or MOVELINE.ACCOUNT_CODE like '15%' and not MOVELINE.ACCOUNT_CODE like '155%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '131%' and MOVELINE.ACCOUNT_CODE like '132%' and MOVELINE.ACCOUNT_CODE like '15%' and not MOVELINE.ACCOUNT_CODE like '155%') then CREDIT else 0 end)) AS "15_N155_131_132_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '40%' and not MOVELINE.ACCOUNT_CODE like '409%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '40%' and not MOVELINE.ACCOUNT_CODE like '409%') then CREDIT else 0 end)) AS "40_N409_old", +SUM(case when (MOVELINE.ACCOUNT_CODE like '444%' or MOVELINE.ACCOUNT_CODE like '445%' or MOVELINE.ACCOUNT_CODE like '447%') then CREDIT else 0 end) AS "credit_444_445_447_old", + +((SUM(case when (MOVELINE.ACCOUNT_CODE like '419%' or MOVELINE.ACCOUNT_CODE like '509%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '419%' or MOVELINE.ACCOUNT_CODE like '509%') then CREDIT else 0 end)) + +( +SUM(case when (MOVELINE.ACCOUNT_CODE like '42%' + or MOVELINE.ACCOUNT_CODE like '43%' + or MOVELINE.ACCOUNT_CODE like '44%' + or MOVELINE.ACCOUNT_CODE like '45%' + or MOVELINE.ACCOUNT_CODE like '46%' + or MOVELINE.ACCOUNT_CODE like '48%' + and not ( + MOVELINE.ACCOUNT_CODE like '444%' + or MOVELINE.ACCOUNT_CODE like '445%' + or MOVELINE.ACCOUNT_CODE like '446%' + or MOVELINE.ACCOUNT_CODE like '447%' + ) + ) then CREDIT else 0 end) +)) as "another_debt_old", +SUM(case when (MOVELINE.ACCOUNT_CODE like '51%' or MOVELINE.ACCOUNT_CODE like '52%') then CREDIT else 0 end) AS "credit_51_52_old", +(SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '7%' THEN DEBIT ELSE 0 END) - SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '7%' THEN CREDIT ELSE 0 END)) + + + (SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '6%' THEN DEBIT ELSE 0 END) -SUM(CASE WHEN MOVELINE.ACCOUNT_CODE LIKE '6%' THEN CREDIT ELSE 0 END) ) as resultat_old + +from public.account_accounting_report as AccountingReport +left outer join public.account_move_line as MoveLine on (AccountingReport.id = ?) +left outer join public.account_move as Move on (MoveLine.move = Move.id AND Move.ignore_in_accounting_ok = false) +left outer join public.account_account as Account on (MoveLine.account = Account.id ) +left outer join public.account_accounting_report_account_set as AccountSet on (AccountSet.account_accounting_report = AccountingReport.id) +left join base_period _period on AccountingReport.period = _period.id +left join base_year _year on _year.id = _period.year +left join base_period MovePeriod on Move.period = MovePeriod.id +left join base_year MoveYear on MoveYear.id = MovePeriod.year +where +(AccountingReport.currency = Move.company_currency) AND +Move.ignore_in_accounting_ok = false AND (Move.status_select = 3) and +(Move.archived is null or Move.archived = false) +and (MoveLine.archived is null or MoveLine.archived = false) +AND cast(MoveYear.code as decimal) = cast(_year.code as decimal) - 1 + group by MOVELINE.ACCOUNT_CODE +) +SELECT + SUM(aa."100") AS "100", + SUM(aa."101_108") AS "101_108", + SUM(aa."109") AS "109", + SUM(aa."104_106") AS "104_106", + SUM(aa."105") AS "105", + SUM(aa."107") AS "107", + SUM(aa."12") AS "12", + SUM(aa."11") AS "11", + SUM(aa."16_17") AS "16_17", + SUM(aa."134_155") AS "134_155", + SUM(aa."229") AS "229", + SUM(aa."15_N155_131_132") AS "15_N155_131_132", + SUM(aa."40_N409") AS "40_N409", + SUM(aa."credit_444_445_447") AS "credit_444_445_447", + SUM(aa."another_debt") AS "another_debt", + SUM(aa."credit_51_52") AS "credit_51_52", + SUM(aa."resultat") AS "resultat", + SUM(CASE WHEN (aa.c51 - aa.d51) > 0 THEN (aa.c51 - aa.d51) ELSE 0 END) + + SUM(CASE WHEN (aa.c52 - aa.d52) > 0 THEN (aa.c52 - aa.d52) ELSE 0 END) AS treasury, + (SUM(CASE WHEN (aa.c444 - aa.d444) > 0 THEN (aa.c444 - aa.d444) ELSE 0 END) + + SUM(CASE WHEN (aa.c445 - aa.d445) > 0 THEN (aa.c445 - aa.d445) ELSE 0 END) + + SUM(CASE WHEN (aa.c447 - aa.d447) > 0 THEN (aa.c447 - aa.d447) ELSE 0 END)) AS taxes, + ((SUM(aa.d419) - SUM(aa.c419)) + (SUM(aa.d509) - SUM(aa.c509)) + + SUM(CASE WHEN (aa.c42 - aa.d42) > 0 THEN (aa.c42 - aa.d42) ELSE 0 END) + + SUM(CASE WHEN (aa.c43 - aa.d43) > 0 THEN (aa.c43 - aa.d43) ELSE 0 END) + + SUM(CASE WHEN (aa.c45 - aa.d45) > 0 THEN (aa.c45 - aa.d45) ELSE 0 END) + + SUM(CASE WHEN (aa.c46 - aa.d46) > 0 THEN (aa.c46 - aa.d46) ELSE 0 END) + + SUM(CASE WHEN (aa.c47 - aa.d47) > 0 THEN (aa.c47 - aa.d47) ELSE 0 END) + + SUM(CASE WHEN (aa.c48 - aa.d48) > 0 THEN (aa.c48 - aa.d48) ELSE 0 END) + + SUM(CASE WHEN (aa.c44 - aa.d44) > 0 THEN (aa.c44 - aa.d44) ELSE 0 END) - + SUM(CASE WHEN (aa.c444 - aa.d444) > 0 THEN (aa.c444 - aa.d444) ELSE 0 END) - + SUM(CASE WHEN (aa.c445 - aa.d445) > 0 THEN (aa.c445 - aa.d445) ELSE 0 END) - + SUM(CASE WHEN (aa.c446 - aa.d446) > 0 THEN (aa.c446 - aa.d446) ELSE 0 END) - + SUM(CASE WHEN (aa.c447 - aa.d447) > 0 THEN (aa.c447 - aa.d447) ELSE 0 END)) AS other_debit_old, + SUM(bb."100_old") AS "100_old", + SUM(bb."101_108_old") AS "101_108_old", + SUM(bb."109_old") AS "109_old", + SUM(bb."104_106_old") AS "104_106_old", + SUM(bb."105_old") AS "105_old", + SUM(bb."107_old") AS "107_old", + SUM(bb."12_old") AS "12_old", + SUM(bb."11_old") AS "11_old", + SUM(bb."16_17_old") AS "16_17_old", + SUM(bb."134_155_old") AS "134_155_old", + SUM(bb."229_old") AS "229_old", + SUM(bb."15_N155_131_132_old") AS "15_N155_131_132_old", + SUM(bb."40_N409_old") AS "40_N409_old", + SUM(bb."credit_444_445_447_old") AS "credit_444_445_447_old", + SUM(bb."another_debt_old") AS "another_debt_old", + SUM(bb."credit_51_52_old") AS "credit_51_52_old", + SUM(bb."resultat_old") AS "resultat_old", + SUM(CASE WHEN (bb.c51 - bb.d51) > 0 THEN (bb.c51 - bb.d51) ELSE 0 END) + + SUM(CASE WHEN (bb.c52 - bb.d52) > 0 THEN (bb.c52 - bb.d52) ELSE 0 END) AS treasury_old, + (SUM(CASE WHEN (bb.c444 - bb.d444) > 0 THEN (bb.c444 - bb.d444) ELSE 0 END) + + SUM(CASE WHEN (bb.c445 - bb.d445) > 0 THEN (bb.c445 - bb.d445) ELSE 0 END) + + SUM(CASE WHEN (bb.c447 - bb.d447) > 0 THEN (bb.c447 - bb.d447) ELSE 0 END)) AS taxes_old, + ((SUM(bb.d419) - SUM(bb.c419)) + (SUM(bb.d509) - SUM(bb.c509)) + + SUM(CASE WHEN (bb.c42 - bb.d42) > 0 THEN (bb.c42 - bb.d42) ELSE 0 END) + + SUM(CASE WHEN (bb.c43 - bb.d43) > 0 THEN (bb.c43 - bb.d43) ELSE 0 END) + + SUM(CASE WHEN (bb.c45 - bb.d45) > 0 THEN (bb.c45 - bb.d45) ELSE 0 END) + + SUM(CASE WHEN (bb.c46 - bb.d46) > 0 THEN (bb.c46 - bb.d46) ELSE 0 END) + + SUM(CASE WHEN (bb.c47 - bb.d47) > 0 THEN (bb.c47 - bb.d47) ELSE 0 END) + + SUM(CASE WHEN (bb.c48 - bb.d48) > 0 THEN (bb.c48 - bb.d48) ELSE 0 END) + + SUM(CASE WHEN (bb.c44 - bb.d44) > 0 THEN (bb.c44 - bb.d44) ELSE 0 END) - + SUM(CASE WHEN (bb.c444 - bb.d444) > 0 THEN (bb.c444 - bb.d444) ELSE 0 END) - + SUM(CASE WHEN (bb.c445 - bb.d445) > 0 THEN (bb.c445 - bb.d445) ELSE 0 END) - + SUM(CASE WHEN (bb.c446 - bb.d446) > 0 THEN (bb.c446 - bb.d446) ELSE 0 END) - + SUM(CASE WHEN (bb.c447 - bb.d447) > 0 THEN (bb.c447 - bb.d447) ELSE 0 END)) AS other_debit_old_bb +FROM + aa + full OUTER JOIN bb ON aa.ACCOUNT_CODE = bb.ACCOUNT_CODE +]]> + + + 2.0 + + + + In + + + + 2 + + -5 + 0 + 0 + Unknown + + + + +]]> + + + nulls lowest + + + company_name + dimension + company_name + company_name + + + logo_height + measure + logo_height + logo_height + + + logo_width + measure + logo_width + logo_width + + + date_from + dimension + date_from + date_from + + + date_to + dimension + date_to + date_to + + + report_date + dimension + report_date + report_date + + + report_date_edition + dimension + report_date_edition + report_date_edition + + + logo_path + dimension + logo_path + logo_path + + + period_name + dimension + period_name + period_name + + + journal_name + dimension + journal_name + journal_name + + + global + measure + global + global + + + global_by_date + measure + global_by_date + global_by_date + + + payment_mode + dimension + payment_mode + payment_mode + + + currency + dimension + currency + currency + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + false + true + false + + + + + + 1 + company_name + string + + + 2 + logo_height + integer + + + 3 + logo_width + integer + + + 4 + date_from + date + + + 5 + date_to + date + + + 6 + report_date + date + + + 7 + report_date_edition + date-time + + + 8 + logo_path + string + + + 9 + period_name + string + + + 10 + journal_name + string + + + 11 + global + integer + + + 12 + global_by_date + integer + + + 13 + payment_mode + string + + + 14 + currency + string + + + + Data Source + + + 1 + company_name + company_name + string + 12 + + + 2 + logo_height + logo_height + integer + 4 + + + 3 + logo_width + logo_width + integer + 4 + + + 4 + date_from + date_from + date + 91 + + + 5 + date_to + date_to + date + 91 + + + 6 + report_date + report_date + date + 91 + + + 7 + report_date_edition + report_date_edition + date-time + 93 + + + 8 + logo_path + logo_path + string + 12 + + + 9 + period_name + period_name + string + 12 + + + 10 + journal_name + journal_name + string + 12 + + + 11 + global + global + integer + -7 + + + 12 + global_by_date + global_by_date + integer + -7 + + + 13 + payment_mode + payment_mode + string + 12 + + + 14 + currency + currency + string + 12 + + + + + + nulls lowest + + + message_key + dimension + message_key + message_key + + + translation + dimension + translation + translation + + + + + param_1 + + string + -1 + 1 + true + + + param_2 + Locale + + string + -1 + 2 + true + false + + + + + + 1 + message_key + string + + + 2 + translation + string + + + + Data Source + + + 1 + message_key + message_key + string + 12 + + + 2 + translation + translation + string + 12 + + + + + + 2.0 + + + + In + + + + 1 + + -1 + 0 + 0 + Unknown + + + + + + In + + + + 2 + + -1 + 0 + 0 + Unknown + + + + +]]> + + + + + + + + + + a4 + portrait + 0.8in + 0.33in + + + 0.71875in + 7.697916666666667in + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + logo_height + logo_height + if(dataSetRow["logo_height"]>0){dataSetRow["logo_height"]+'px'}else{'35px'} + integer + true + + + logo_width + logo_width + if(dataSetRow["logo_width"]>0){dataSetRow["logo_width"]+'px'}else{'100px'} + integer + true + + + currency + currency + dataSetRow["currency"] + string + + + + 1.9791666666666667in + + + 4.520833333333333in + + + 1.2in + + + 69px + + + 8pt + + + all + row["logo_path"] == null + + + html + + + + "" + + +]]> + + + + top + + + + top + + 9pt + html + row["report_date_edition"]]]> + + + + + + + + 11.033333333333333in + + 10.022222222222222in + + + 1.011111111111111in + + + + + + + + right + 0.3in + + + + + 0.3333333333333333in + + 0pt + 0pt + 0pt + 0pt + + 9pt + page-number + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + plain + + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + total-page + + + + + + + + + + + + + middle + 9.416666666666666in + 7.666666666666667in + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + + 1.5104166666666667in + + + 4.1875in + + + 1.96875in + + + 0.34375in + + + + center + auto + + + + + + + 0.5in + + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.endDate' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + + + + 0.4166666666666667in + + + + 0.4166666666666667in + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["report_date"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.period' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + + + + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["period_name"]]]> + + + + + + + + 0.5208333333333334in + + 3 + 1 + + + + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.from' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["date_from"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.to' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["date_to"]]]> + + + + + + + + 0.2708333333333333in + + + + + + 7.104166666666667in + + 3 + 1 + + 7.5625in + MoveLineDS + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + + 2.4166666666666665in + + + 1.875in + + + 1.46875in + +
+ + #C0C0C0 + bold + middle + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + +
+ + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + html + +Math.abs(row["100"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["100_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + html + +Math.abs(row._outer["109"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["109_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + html + +Math.abs(row._outer["104_106"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["104_106_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + html + +Math.abs(row._outer["105"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["105_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + html + +Math.abs(row._outer["107"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["107_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["resultat"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["resultat_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +-row._outer["11"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +-Math.abs(row["11_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["100"])+ +Math.abs(row["109"])+ +Math.abs(row["104_106"])+ +Math.abs(row["105"])+ +Math.abs(row["107"])+ +Math.abs(row["resultat"]) +-Math.abs(row["11"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["100_old"])+ +Math.abs(row["109_old"])+ +Math.abs(row["104_106_old"])+ +Math.abs(row["105_old"])+ +Math.abs(row["107_old"])+ +Math.abs(row["resultat_old"])+ +Math.abs(row["11_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["16_17"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["16_17_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["134_155"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["134_155_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["229"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["229_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["15_N155_131_132"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["15_N155_131_132_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["16_17"])+ +Math.abs(row._outer["134_155"])+ +Math.abs(row._outer["229"])+ +Math.abs(row._outer["15_N155_131_132"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["16_17_old"])+ +Math.abs(row._outer["134_155_old"])+ +Math.abs(row._outer["229_old"])+ +Math.abs(row._outer["15_N155_131_132_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row._outer["40_N409"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["40_N409_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["taxes"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["taxes_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["other_debit_old"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["other_debit_old_bb"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["treasury"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["treasury_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["40_N409"])+ +Math.abs(row["taxes"])+ +Math.abs(row["other_debit_old"])+ +Math.abs(row["treasury"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["40_N409_old"])+ +Math.abs(row["taxes_old"])+ +Math.abs(row["other_debit_old"])+ +Math.abs(row["treasury_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["100"])+ +Math.abs(row["109"])+ +Math.abs(row["104_106"])+ +Math.abs(row["105"])+ +Math.abs(row["107"])+ +Math.abs(row["resultat"])+ +-Math.abs(row["11"])+ +Math.abs(row["16_17"])+ +Math.abs(row["134_155"])+ +Math.abs(row["229"])+ +Math.abs(row["15_N155_131_132"])+ +Math.abs(row["40_N409"])+ +Math.abs(row["taxes"])+ +Math.abs(row["other_debit_old"])+ +Math.abs(row["treasury"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 100 + 100 + dataSetRow["100"] + decimal + + + 101_108 + 101_108 + dataSetRow["101_108"] + decimal + + + 109 + 109 + dataSetRow["109"] + decimal + + + 104_106 + 104_106 + dataSetRow["104_106"] + decimal + + + 105 + 105 + dataSetRow["105"] + decimal + + + 107 + 107 + dataSetRow["107"] + decimal + + + 12 + 12 + dataSetRow["12"] + decimal + + + 11 + 11 + dataSetRow["11"] + decimal + + + 16_17 + 16_17 + dataSetRow["16_17"] + decimal + + + 134_155 + 134_155 + dataSetRow["134_155"] + decimal + + + 229 + 229 + dataSetRow["229"] + decimal + + + 15_N155_131_132 + 15_N155_131_132 + dataSetRow["15_N155_131_132"] + decimal + + + 40_N409 + 40_N409 + dataSetRow["40_N409"] + decimal + + + credit_444_445_447 + credit_444_445_447 + dataSetRow["credit_444_445_447"] + decimal + + + another_debt + another_debt + dataSetRow["another_debt"] + decimal + + + credit_51_52 + credit_51_52 + dataSetRow["credit_51_52"] + decimal + + + resultat + resultat + dataSetRow["resultat"] + decimal + + + treasury + treasury + dataSetRow["treasury"] + decimal + + + taxes + taxes + dataSetRow["taxes"] + decimal + + + other_debit_old + other_debit_old + dataSetRow["other_debit_old"] + decimal + + + 100_old + 100_old + dataSetRow["100_old"] + decimal + + + 101_108_old + 101_108_old + dataSetRow["101_108_old"] + decimal + + + 109_old + 109_old + dataSetRow["109_old"] + decimal + + + 104_106_old + 104_106_old + dataSetRow["104_106_old"] + decimal + + + 105_old + 105_old + dataSetRow["105_old"] + decimal + + + 107_old + 107_old + dataSetRow["107_old"] + decimal + + + 12_old + 12_old + dataSetRow["12_old"] + decimal + + + 11_old + 11_old + dataSetRow["11_old"] + decimal + + + 16_17_old + 16_17_old + dataSetRow["16_17_old"] + decimal + + + 134_155_old + 134_155_old + dataSetRow["134_155_old"] + decimal + + + 229_old + 229_old + dataSetRow["229_old"] + decimal + + + 15_N155_131_132_old + 15_N155_131_132_old + dataSetRow["15_N155_131_132_old"] + decimal + + + 40_N409_old + 40_N409_old + dataSetRow["40_N409_old"] + decimal + + + credit_444_445_447_old + credit_444_445_447_old + dataSetRow["credit_444_445_447_old"] + decimal + + + another_debt_old + another_debt_old + dataSetRow["another_debt_old"] + decimal + + + credit_51_52_old + credit_51_52_old + dataSetRow["credit_51_52_old"] + decimal + + + resultat_old + resultat_old + dataSetRow["resultat_old"] + decimal + + + treasury_old + treasury_old + dataSetRow["treasury_old"] + decimal + + + taxes_old + taxes_old + dataSetRow["taxes_old"] + decimal + + + other_debit_old_bb + other_debit_old_bb + dataSetRow["other_debit_old_bb"] + decimal + + + html + +Math.abs(row["100_old"])+ +Math.abs(row["109_old"])+ +Math.abs(row["104_106_old"])+ +Math.abs(row["105_old"])+ +Math.abs(row["107_old"])+ +Math.abs(row["resultat_old"])+ +Math.abs(row["11_old"])+ +Math.abs(row["16_17_old"])+ +Math.abs(row["134_155_old"])+ +Math.abs(row["229_old"])+ +Math.abs(row["15_N155_131_132_old"])+ +Math.abs(row["40_N409_old"])+ +Math.abs(row["taxes_old"])+ +Math.abs(row["other_debit_old_bb"])+ +Math.abs(row["treasury_old"]) +]]> + + + + +
+ + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + +
+
+
+
+ + 0.6770833333333334in + + 3 + 1 + + auto + + + + +
+ +
diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType23.rptdesign b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType23.rptdesign new file mode 100644 index 0000000..52c4a16 --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType23.rptdesign @@ -0,0 +1,11751 @@ + + + Eclipse BIRT Designer Version 4.8.0.v201806261756 + + + queryText + 210 + + + queryTimeOut + 210 + + + rowFetchSize + 210 + + + odaURL + 209 + params["DBName"].value + + + odaUser + 209 + params["UserName"].value + + + odaPassword + 209 + params["Password"].value + + + in + /templates/blank_report.gif + auto layout + ltr + 96 + + + true + static + true + decimal + true + + 119 + + + simple + false + text-box + + Unformatted + + + + true + static + string + true + + jdbc:postgresql://localhost:5432/bdd_sophal + + + simple + text-box + + Unformatted + + + + true + static + string + true + + postgres + + + simple + text-box + + Unformatted + + + + true + password + static + string + true + + root23 + + + simple + text-box + + Unformatted + + + + true + static + string + true + + fr + + + simple + text-box + + Unformatted + + + + true + static + false + string + true + + + + + simple + text-box + + Unformatted + + + + + + + + disabledMetadataBidiFormatStr + + + disabledContentBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + metadataBidiFormatStr + ILYNN + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_live2 + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_sophal + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + nulls lowest + + + 70 + measure + 70 + 70 + + + 72 + measure + 72 + 72 + + + 73 + measure + 73 + 73 + + + 74 + measure + 74 + 74 + + + 60 + measure + 60 + 60 + + + 61_62 + measure + 61_62 + 61_62 + + + 63 + measure + 63 + 63 + + + 64 + measure + 64 + 64 + + + 75 + measure + 75 + 75 + + + 65 + measure + 65 + 65 + + + 68 + measure + 68 + 68 + + + 78 + measure + 78 + 78 + + + 76 + measure + 76 + 76 + + + 66 + measure + 66 + 66 + + + 695_698 + measure + 695_698 + 695_698 + + + 692_693 + measure + 692_693 + 692_693 + + + 77 + measure + 77 + 77 + + + 67 + measure + 67 + 67 + + + 70_old + measure + 70_old + 70_old + + + 72_old + measure + 72_old + 72_old + + + 73_old + measure + 73_old + 73_old + + + 74_old + measure + 74_old + 74_old + + + 60_old + measure + 60_old + 60_old + + + 61_62_old + measure + 61_62_old + 61_62_old + + + 63_old + measure + 63_old + 63_old + + + 64_old + measure + 64_old + 64_old + + + 75_old + measure + 75_old + 75_old + + + 65_old + measure + 65_old + 65_old + + + 68_old + measure + 68_old + 68_old + + + 78_old + measure + 78_old + 78_old + + + 76_old + measure + 76_old + 76_old + + + 66_old + measure + 66_old + 66_old + + + 695_698_old + measure + 695_698_old + 695_698_old + + + 692_693_old + measure + 692_693_old + 692_693_old + + + 77_old + measure + 77_old + 77_old + + + 67_old + measure + 67_old + 67_old + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + param_2 + AccountingReportId + + decimal + -5 + 2 + true + false + + + + + + 1 + 70 + decimal + + + 2 + 72 + decimal + + + 3 + 73 + decimal + + + 4 + 74 + decimal + + + 5 + 60 + decimal + + + 6 + 61_62 + decimal + + + 7 + 63 + decimal + + + 8 + 64 + decimal + + + 9 + 75 + decimal + + + 10 + 65 + decimal + + + 11 + 68 + decimal + + + 12 + 78 + decimal + + + 13 + 76 + decimal + + + 14 + 66 + decimal + + + 15 + 695_698 + decimal + + + 16 + 692_693 + decimal + + + 17 + 77 + decimal + + + 18 + 67 + decimal + + + 19 + 70_old + decimal + + + 20 + 72_old + decimal + + + 21 + 73_old + decimal + + + 22 + 74_old + decimal + + + 23 + 60_old + decimal + + + 24 + 61_62_old + decimal + + + 25 + 63_old + decimal + + + 26 + 64_old + decimal + + + 27 + 75_old + decimal + + + 28 + 65_old + decimal + + + 29 + 68_old + decimal + + + 30 + 78_old + decimal + + + 31 + 76_old + decimal + + + 32 + 66_old + decimal + + + 33 + 695_698_old + decimal + + + 34 + 692_693_old + decimal + + + 35 + 77_old + decimal + + + 36 + 67_old + decimal + + + + 0 + Data Source + + + 1 + 70 + 70 + decimal + 2 + + + 2 + 72 + 72 + decimal + 2 + + + 3 + 73 + 73 + decimal + 2 + + + 4 + 74 + 74 + decimal + 2 + + + 5 + 60 + 60 + decimal + 2 + + + 6 + 61_62 + 61_62 + decimal + 2 + + + 7 + 63 + 63 + decimal + 2 + + + 8 + 64 + 64 + decimal + 2 + + + 9 + 75 + 75 + decimal + 2 + + + 10 + 65 + 65 + decimal + 2 + + + 11 + 68 + 68 + decimal + 2 + + + 12 + 78 + 78 + decimal + 2 + + + 13 + 76 + 76 + decimal + 2 + + + 14 + 66 + 66 + decimal + 2 + + + 15 + 695_698 + 695_698 + decimal + 2 + + + 16 + 692_693 + 692_693 + decimal + 2 + + + 17 + 77 + 77 + decimal + 2 + + + 18 + 67 + 67 + decimal + 2 + + + 19 + 70_old + 70_old + decimal + 2 + + + 20 + 72_old + 72_old + decimal + 2 + + + 21 + 73_old + 73_old + decimal + 2 + + + 22 + 74_old + 74_old + decimal + 2 + + + 23 + 60_old + 60_old + decimal + 2 + + + 24 + 61_62_old + 61_62_old + decimal + 2 + + + 25 + 63_old + 63_old + decimal + 2 + + + 26 + 64_old + 64_old + decimal + 2 + + + 27 + 75_old + 75_old + decimal + 2 + + + 28 + 65_old + 65_old + decimal + 2 + + + 29 + 68_old + 68_old + decimal + 2 + + + 30 + 78_old + 78_old + decimal + 2 + + + 31 + 76_old + 76_old + decimal + 2 + + + 32 + 66_old + 66_old + decimal + 2 + + + 33 + 695_698_old + 695_698_old + decimal + 2 + + + 34 + 692_693_old + 692_693_old + decimal + 2 + + + 35 + 77_old + 77_old + decimal + 2 + + + 36 + 67_old + 67_old + decimal + 2 + + + = AccountingReport.date_from) AND +(AccountingReport.date_to IS NULL OR MoveLine.date_val <= AccountingReport.date_to) AND +MoveLine.date_val <= AccountingReport.date_val AND Move.company = AccountingReport.company AND +(AccountingReport.period IS NULL OR AccountingReport.period = Move.period) AND +Move.ignore_in_accounting_ok = false AND (Move.status_select = 3) and +(Move.archived is null or Move.archived = false) +and (MoveLine.archived is null or MoveLine.archived = false) +) as aa + +left join +( +SELECT +(SUM(case when (MOVELINE.ACCOUNT_CODE like '70%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '70%') then CREDIT else 0 end)) AS "70_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '72%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '72%') then CREDIT else 0 end)) AS "72_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '73%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '73%') then CREDIT else 0 end)) AS "73_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '74%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '74%') then CREDIT else 0 end)) AS "74_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '60%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '60%') then CREDIT else 0 end)) AS "60_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '61%' or MOVELINE.ACCOUNT_CODE like '62%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '61%' or MOVELINE.ACCOUNT_CODE like '62%') then CREDIT else 0 end)) AS "61_62_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '63%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '63%') then CREDIT else 0 end)) AS "63_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '64%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '64%') then CREDIT else 0 end)) AS "64_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '75%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '75%') then CREDIT else 0 end)) AS "75_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '65%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '65%') then CREDIT else 0 end)) AS "65_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '68%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '68%') then CREDIT else 0 end)) AS "68_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '78%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '78%') then CREDIT else 0 end)) AS "78_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '76%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '76%') then CREDIT else 0 end)) AS "76_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '66%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '66%') then CREDIT else 0 end)) AS "66_old", + +(SUM(case when (MOVELINE.ACCOUNT_CODE like '695%' or MOVELINE.ACCOUNT_CODE like '698%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '695%' or MOVELINE.ACCOUNT_CODE like '698%') then CREDIT else 0 end)) AS "695_698_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '692%' or MOVELINE.ACCOUNT_CODE like '693%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '692%' or MOVELINE.ACCOUNT_CODE like '693%') then CREDIT else 0 end)) AS "692_693_old", + +(SUM(case when (MOVELINE.ACCOUNT_CODE like '77%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '77%') then CREDIT else 0 end)) AS "77_old", +(SUM(case when (MOVELINE.ACCOUNT_CODE like '67%') then DEBIT else 0 end) - SUM(case when (MOVELINE.ACCOUNT_CODE like '77%') then CREDIT else 0 end)) AS "67_old" + + +from public.account_accounting_report as AccountingReport +left outer join public.account_move_line as MoveLine on (AccountingReport.id = ?) +left outer join public.account_move as Move on (MoveLine.move = Move.id AND Move.ignore_in_accounting_ok = false) +left outer join public.account_account as Account on (MoveLine.account = Account.id ) +left outer join public.account_accounting_report_account_set as AccountSet on (AccountSet.account_accounting_report = AccountingReport.id) +left join base_period _period on AccountingReport.period = _period.id +left join base_year _year on _year.id = _period.year +left join base_period MovePeriod on Move.period = MovePeriod.id +left join base_year MoveYear on MoveYear.id = MovePeriod.year + +where +(AccountingReport.currency = Move.company_currency) AND Move.company = AccountingReport.company AND +Move.ignore_in_accounting_ok = false AND (Move.status_select = 3) and +(Move.archived is null or Move.archived = false) +and (MoveLine.archived is null or MoveLine.archived = false) +AND cast(MoveYear.code as decimal) = cast(_year.code as decimal) - 1 +) as ss on 1 = 1]]> + + + 2.0 + + + + In + + + + 2 + + -5 + 0 + 0 + Unknown + + + + +]]> + + + nulls lowest + + + company_name + dimension + company_name + company_name + + + logo_height + measure + logo_height + logo_height + + + logo_width + measure + logo_width + logo_width + + + date_from + dimension + date_from + date_from + + + date_to + dimension + date_to + date_to + + + report_date + dimension + report_date + report_date + + + report_date_edition + dimension + report_date_edition + report_date_edition + + + logo_path + dimension + logo_path + logo_path + + + period_name + dimension + period_name + period_name + + + journal_name + dimension + journal_name + journal_name + + + global + measure + global + global + + + global_by_date + measure + global_by_date + global_by_date + + + payment_mode + dimension + payment_mode + payment_mode + + + currency + dimension + currency + currency + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + false + true + false + + + + + + 1 + company_name + string + + + 2 + logo_height + integer + + + 3 + logo_width + integer + + + 4 + date_from + date + + + 5 + date_to + date + + + 6 + report_date + date + + + 7 + report_date_edition + date-time + + + 8 + logo_path + string + + + 9 + period_name + string + + + 10 + journal_name + string + + + 11 + global + integer + + + 12 + global_by_date + integer + + + 13 + payment_mode + string + + + 14 + currency + string + + + + Data Source + + + 1 + company_name + company_name + string + 12 + + + 2 + logo_height + logo_height + integer + 4 + + + 3 + logo_width + logo_width + integer + 4 + + + 4 + date_from + date_from + date + 91 + + + 5 + date_to + date_to + date + 91 + + + 6 + report_date + report_date + date + 91 + + + 7 + report_date_edition + report_date_edition + date-time + 93 + + + 8 + logo_path + logo_path + string + 12 + + + 9 + period_name + period_name + string + 12 + + + 10 + journal_name + journal_name + string + 12 + + + 11 + global + global + integer + -7 + + + 12 + global_by_date + global_by_date + integer + -7 + + + 13 + payment_mode + payment_mode + string + 12 + + + 14 + currency + currency + string + 12 + + + + + + nulls lowest + + + message_key + dimension + message_key + message_key + + + translation + dimension + translation + translation + + + + + param_1 + + string + -1 + 1 + true + + + param_2 + Locale + + string + -1 + 2 + true + false + + + + + + 1 + message_key + string + + + 2 + translation + string + + + + Data Source + + + 1 + message_key + message_key + string + 12 + + + 2 + translation + translation + string + 12 + + + + + + 2.0 + + + + In + + + + 1 + + -1 + 0 + 0 + Unknown + + + + + + In + + + + 2 + + -1 + 0 + 0 + Unknown + + + + +]]> + + + + + 70_old + measure + 70_old + 70_old + + + 72_old + measure + 72_old + 72_old + + + 73_old + measure + 73_old + 73_old + + + 74_old + measure + 74_old + 74_old + + + 60_old + measure + 60_old + 60_old + + + 61_62_old + measure + 61_62_old + 61_62_old + + + 63_old + measure + 63_old + 63_old + + + 64_old + measure + 64_old + 64_old + + + 75_old + measure + 75_old + 75_old + + + 65_old + measure + 65_old + 65_old + + + 68_old + measure + 68_old + 68_old + + + 78_old + measure + 78_old + 78_old + + + 76_old + measure + 76_old + 76_old + + + 66_old + measure + 66_old + 66_old + + + 695_698_old + measure + 695_698_old + 695_698_old + + + 692_693_old + measure + 692_693_old + 692_693_old + + + 77_old + measure + 77_old + 77_old + + + 67_old + measure + 67_old + 67_old + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + + + + 1 + 70_old + decimal + + + 2 + 72_old + decimal + + + 3 + 73_old + decimal + + + 4 + 74_old + decimal + + + 5 + 60_old + decimal + + + 6 + 61_62_old + decimal + + + 7 + 63_old + decimal + + + 8 + 64_old + decimal + + + 9 + 75_old + decimal + + + 10 + 65_old + decimal + + + 11 + 68_old + decimal + + + 12 + 78_old + decimal + + + 13 + 76_old + decimal + + + 14 + 66_old + decimal + + + 15 + 695_698_old + decimal + + + 16 + 692_693_old + decimal + + + 17 + 77_old + decimal + + + 18 + 67_old + decimal + + + + Data Source + + + 1 + 70_old + 70_old + decimal + 2 + + + 2 + 72_old + 72_old + decimal + 2 + + + 3 + 73_old + 73_old + decimal + 2 + + + 4 + 74_old + 74_old + decimal + 2 + + + 5 + 60_old + 60_old + decimal + 2 + + + 6 + 61_62_old + 61_62_old + decimal + 2 + + + 7 + 63_old + 63_old + decimal + 2 + + + 8 + 64_old + 64_old + decimal + 2 + + + 9 + 75_old + 75_old + decimal + 2 + + + 10 + 65_old + 65_old + decimal + 2 + + + 11 + 68_old + 68_old + decimal + 2 + + + 12 + 78_old + 78_old + decimal + 2 + + + 13 + 76_old + 76_old + decimal + 2 + + + 14 + 66_old + 66_old + decimal + 2 + + + 15 + 695_698_old + 695_698_old + decimal + 2 + + + 16 + 692_693_old + 692_693_old + decimal + 2 + + + 17 + 77_old + 77_old + decimal + 2 + + + 18 + 67_old + 67_old + decimal + 2 + + + + + + 2.0 + + + + + + + 70 + 1 + + 2 + 0 + 0 + Unknown + + 70 + + + + 70 + + 131089 + + + + + + + 72 + 2 + + 2 + 0 + 0 + Unknown + + 72 + + + + 72 + + 131089 + + + + + + + 73 + 3 + + 2 + 0 + 0 + Unknown + + 73 + + + + 73 + + 131089 + + + + + + + 74 + 4 + + 2 + 0 + 0 + Unknown + + 74 + + + + 74 + + 131089 + + + + + + + 60 + 5 + + 2 + 0 + 0 + Unknown + + 60 + + + + 60 + + 131089 + + + + + + + 61_62 + 6 + + 2 + 0 + 0 + Unknown + + 61_62 + + + + 61_62 + + 131089 + + + + + + + 63 + 7 + + 2 + 0 + 0 + Unknown + + 63 + + + + 63 + + 131089 + + + + + + + 64 + 8 + + 2 + 0 + 0 + Unknown + + 64 + + + + 64 + + 131089 + + + + + + + 75 + 9 + + 2 + 0 + 0 + Unknown + + 75 + + + + 75 + + 131089 + + + + + + + 65 + 10 + + 2 + 0 + 0 + Unknown + + 65 + + + + 65 + + 131089 + + + + + + + 68 + 11 + + 2 + 0 + 0 + Unknown + + 68 + + + + 68 + + 131089 + + + + + + + 78 + 12 + + 2 + 0 + 0 + Unknown + + 78 + + + + 78 + + 131089 + + + + + + + 76 + 13 + + 2 + 0 + 0 + Unknown + + 76 + + + + 76 + + 131089 + + + + + + + 66 + 14 + + 2 + 0 + 0 + Unknown + + 66 + + + + 66 + + 131089 + + + + + + + 695_698 + 15 + + 2 + 0 + 0 + Unknown + + 695_698 + + + + 695_698 + + 131089 + + + + + + + 692_693 + 16 + + 2 + 0 + 0 + Unknown + + 692_693 + + + + 692_693 + + 131089 + + + + + + + 77 + 17 + + 2 + 0 + 0 + Unknown + + 77 + + + + 77 + + 131089 + + + + + + + 67 + 18 + + 2 + 0 + 0 + Unknown + + 67 + + + + 67 + + 131089 + + + + + + + +]]> + + + + + + + + + + a4 + portrait + 0.6in + 0.33in + + + 0.5520833333333334in + 7.697916666666667in + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + logo_height + logo_height + if(dataSetRow["logo_height"]>0){dataSetRow["logo_height"]+'px'}else{'35px'} + integer + true + + + logo_width + logo_width + if(dataSetRow["logo_width"]>0){dataSetRow["logo_width"]+'px'}else{'100px'} + integer + true + + + currency + currency + dataSetRow["currency"] + string + + + + 1.9791666666666667in + + + 4.520833333333333in + + + 1.2in + + + 53px + + + 8pt + + + all + row["logo_path"] == null + + + html + + + + "" + + +]]> + + + + top + + + + top + + 9pt + html + row["report_date_edition"]]]> + + + + + + + + 11.033333333333333in + + 10.022222222222222in + + + 1.011111111111111in + + + + + + + + right + 0.3in + + + + + 0.3333333333333333in + + 0pt + 0pt + 0pt + 0pt + + 9pt + page-number + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + plain + + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + total-page + + + + + + + + + + + + + 9pt + middle + 11.760416666666666in + 7.666666666666667in + + 1.5104166666666667in + + + 4.1875in + + + 1.96875in + + + 0.4270833333333333in + + + + center + auto + + + + + + + 0.4791666666666667in + + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.endDate' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + + + + 0.4166666666666667in + + + + 0.4166666666666667in + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["report_date"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.period' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + + + + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["period_name"]]]> + + + + + + + + 0.375in + + 3 + 1 + + + + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.from' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["date_from"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.to' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + html + row["date_to"]]]> + + + + + + + + 0.23958333333333334in + + + + + + avoid + 9.864583333333334in + + 3 + 1 + + 7.5625in + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + 70_old + 70_old + dataSetRow["70_old"] + decimal + + + 72_old + 72_old + dataSetRow["72_old"] + decimal + + + 73_old + 73_old + dataSetRow["73_old"] + decimal + + + 74_old + 74_old + dataSetRow["74_old"] + decimal + + + 60_old + 60_old + dataSetRow["60_old"] + decimal + + + 61_62_old + 61_62_old + dataSetRow["61_62_old"] + decimal + + + 63_old + 63_old + dataSetRow["63_old"] + decimal + + + 64_old + 64_old + dataSetRow["64_old"] + decimal + + + 75_old + 75_old + dataSetRow["75_old"] + decimal + + + 65_old + 65_old + dataSetRow["65_old"] + decimal + + + 68_old + 68_old + dataSetRow["68_old"] + decimal + + + 78_old + 78_old + dataSetRow["78_old"] + decimal + + + 76_old + 76_old + dataSetRow["76_old"] + decimal + + + 66_old + 66_old + dataSetRow["66_old"] + decimal + + + 695_698_old + 695_698_old + dataSetRow["695_698_old"] + decimal + + + 692_693_old + 692_693_old + dataSetRow["692_693_old"] + decimal + + + 77_old + 77_old + dataSetRow["77_old"] + decimal + + + 67_old + 67_old + dataSetRow["67_old"] + decimal + + + + 2.4166666666666665in + + + 1.875in + + + 1.46875in + +
+ + #C0C0C0 + bold + middle + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + +
+ + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["72"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["72_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["73"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["73_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["74"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["74_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70"])+ +-(row._outer["72"])+ +-(row._outer["73"])+ +-(row._outer["74"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70_old"])+ +-(row._outer["72_old"])+ +-(row._outer["73_old"])+ +-(row._outer["74_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["60"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["60_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["61_62"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["61_62_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["60"])+ +(row._outer["61_62"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["60_old"])+ +(row._outer["61_62_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70"])+ +-(row._outer["72"])+ +-(row._outer["73"])+ +-(row._outer["74"])- +((row._outer["60"])+ +(row._outer["61_62"])) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70_old"])+ +-(row._outer["72_old"])+ +-(row._outer["73_old"])+ +-(row._outer["74_old"])- +((row._outer["60_old"])+ +(row._outer["61_62_old"])) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["63"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["63_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["64"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["64_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70"])+ +-(row._outer["72"])+ +-(row._outer["73"])+ +-(row._outer["74"])- +((row._outer["60"])+ +(row._outer["61_62"]))- +(row._outer["63"]) +-(row._outer["64"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70_old"])+ +-(row._outer["72_old"])+ +-(row._outer["73_old"])+ +-(row._outer["74_old"])- +((row._outer["60_old"])+ +(row._outer["61_62_old"])) +-(row._outer["63_old"]) +-(row._outer["64_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["75"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["75_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +row._outer["65"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +Math.abs(row._outer["65_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +row._outer["68"] +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +Math.abs(row._outer["68_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["78"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["78_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70"])+ +-(row._outer["72"])+ +-(row._outer["73"])+ +-(row._outer["74"])- +((row._outer["60"])+ +(row._outer["61_62"]))- +(row._outer["63"]) +-(row._outer["64"]) +-(row._outer["75"]) +-(row._outer["65"]) +-(row._outer["68"]) ++(-(row._outer["78"])) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70_old"])+ +-(row._outer["72_old"])+ +-(row._outer["73_old"])+ +-(row._outer["74_old"])- +((row._outer["60_old"])+ +(row._outer["61_62_old"]))- +(row._outer["63_old"]) +-(row._outer["64_old"]) +-(row._outer["75_old"]) +-(row._outer["65_old"]) +-(row._outer["68_old"]) ++(-(row._outer["78_old"])) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["76"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["76_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["66"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["66_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(-row._outer["76"]) - (row._outer["66"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["76_old"]) - (row._outer["66_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70"])+ +-(row._outer["72"])+ +-(row._outer["73"])+ +-(row._outer["74"])- +((row._outer["60"])+ +(row._outer["61_62"]))- +(row._outer["63"]) +-(row._outer["64"]) +-(row._outer["75"]) +-(row._outer["65"]) +-(row._outer["68"]) ++(-(row._outer["78"]))+ +(-row._outer["76"]) - (row._outer["66"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["70_old"])+ +-(row._outer["72_old"])+ +-(row._outer["73_old"])+ +-(row._outer["74_old"])- +((row._outer["60_old"])+ +(row._outer["61_62_old"]))- +(row._outer["63_old"]) +-(row._outer["64_old"]) +-(row._outer["75_old"]) +-(row._outer["65_old"]) +-(row._outer["68_old"]) ++(-(row._outer["78_old"]))+ +(-row._outer["76_old"]) - (row._outer["66_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["695_698"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["695_698_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + normal + left + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["692_693"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["692_693_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(Math.abs(row._outer["70"])+ +Math.abs(row._outer["72"])+ +Math.abs(row._outer["73"])+ +Math.abs(row._outer["74"]))- +(Math.abs(row._outer["60"])+ +Math.abs(row._outer["61_62"])) - +Math.abs(row._outer["63"]) - Math.abs(row._outer["64"]) +-(row._outer["75"]) +-Math.abs(row._outer["65"]) +-Math.abs(row._outer["68"])+ +-(row._outer["78"]) ++(-(row._outer["76"]) - (row._outer["66"]) ) +-(row._outer["695_698"]) +-(row._outer["692_693"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(Math.abs(row._outer["70_old"])+ +Math.abs(row._outer["72_old"])+ +Math.abs(row._outer["73_old"])+ +Math.abs(row._outer["74_old"]))- +(Math.abs(row._outer["60_old"])+ +Math.abs(row._outer["61_62_old"])) - +Math.abs(row._outer["63_old"]) - Math.abs(row._outer["64_old"]) +-(row._outer["75_old"]) +-Math.abs(row._outer["65_old"]) +-Math.abs(row._outer["68_old"])+ +-(row._outer["78_old"]) ++(-(row._outer["76_old"]) - (row._outer["66_old"]) ) +-(row._outer["695_698_old"]) +-(row._outer["692_693_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["77"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["77_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["67"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(row._outer["67_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["77"]) - (row._outer["67"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +-(row._outer["77_old"]) - (row._outer["67_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(Math.abs(row._outer["70"])+ +Math.abs(row._outer["72"])+ +Math.abs(row._outer["73"])+ +Math.abs(row._outer["74"]))- +(Math.abs(row._outer["60"])+ +Math.abs(row._outer["61_62"])) - +Math.abs(row._outer["63"]) - Math.abs(row._outer["64"]) +-(row._outer["75"]) +-Math.abs(row._outer["65"]) +-Math.abs(row._outer["68"])+ +-(row._outer["78"]) ++(-(row._outer["76"]) - (row._outer["66"]) ) +-(row._outer["695_698"]) +-(row._outer["692_693"])+ +-(row._outer["77"]) - (row._outer["67"]) +]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + right + MoveLineDS + + + 70 + 70 + dataSetRow["70"] + decimal + + + 72 + 72 + dataSetRow["72"] + decimal + + + 73 + 73 + dataSetRow["73"] + decimal + + + 74 + 74 + dataSetRow["74"] + decimal + + + 60 + 60 + dataSetRow["60"] + decimal + + + 61_62 + 61_62 + dataSetRow["61_62"] + decimal + + + 63 + 63 + dataSetRow["63"] + decimal + + + 64 + 64 + dataSetRow["64"] + decimal + + + 75 + 75 + dataSetRow["75"] + decimal + + + 65 + 65 + dataSetRow["65"] + decimal + + + 68 + 68 + dataSetRow["68"] + decimal + + + 78 + 78 + dataSetRow["78"] + decimal + + + 76 + 76 + dataSetRow["76"] + decimal + + + 66 + 66 + dataSetRow["66"] + decimal + + + 695_698 + 695_698 + dataSetRow["695_698"] + decimal + + + 692_693 + 692_693 + dataSetRow["692_693"] + decimal + + + 77 + 77 + dataSetRow["77"] + decimal + + + 67 + 67 + dataSetRow["67"] + decimal + + + html + +(Math.abs(row._outer["70_old"])+ +Math.abs(row._outer["72_old"])+ +Math.abs(row._outer["73_old"])+ +Math.abs(row._outer["74_old"]))- +(Math.abs(row._outer["60_old"])+ +Math.abs(row._outer["61_62_old"])) - +Math.abs(row._outer["63_old"]) - Math.abs(row._outer["64_old"]) +-(row._outer["75_old"]) +-Math.abs(row._outer["65_old"]) +-Math.abs(row._outer["68_old"])+ +-(row._outer["78_old"]) ++(-(row._outer["76_old"]) - (row._outer["66_old"]) ) +-(row._outer["695_698_old"]) +-(row._outer["692_693_old"])+ +-(row._outer["77_old"]) - (row._outer["67_old"]) +]]> + + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + bold + right + auto + + + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + +
+ + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + + solid + thin + solid + thin + solid + thin + solid + thin + 2pt + 2pt + 2pt + 2pt + + +
+
+
+
+ + 0.375in + + 3 + 1 + + auto + + + + +
+ +
diff --git a/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType25.rptdesign b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType25.rptdesign new file mode 100644 index 0000000..93e4801 --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/main/resources/reports/AccountingReportType25.rptdesign @@ -0,0 +1,2708 @@ + + + Eclipse BIRT Designer Version 4.8.0.v201806261756 + + + queryText + 210 + + + queryTimeOut + 210 + + + rowFetchSize + 210 + + + odaURL + 209 + params["DBName"].value + + + odaUser + 209 + params["UserName"].value + + + odaPassword + 209 + params["Password"].value + + + in + /templates/blank_report.gif + fixed layout + ltr + 96 + + + true + static + true + decimal + true + + 119 + + + simple + false + text-box + + Unformatted + + + + true + static + string + true + + jdbc:postgresql://localhost:5432/bdd_sophal + + + simple + text-box + + Unformatted + + + + true + static + string + true + + postgres + + + simple + text-box + + Unformatted + + + + true + password + static + string + true + + root23 + + + simple + text-box + + Unformatted + + + + true + static + string + true + + fr + + + simple + text-box + + Unformatted + + + + true + static + false + string + true + + + + + simple + text-box + + Unformatted + + + + + + + + disabledMetadataBidiFormatStr + + + disabledContentBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + metadataBidiFormatStr + ILYNN + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_live2 + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + org.postgresql.Driver + jdbc:postgresql://localhost:5432/bdd_sophal + postgres + SWpsdj1iQl5oU0dAUFYkLDlqa2hIek8qNzQ= + + + + + nulls lowest + + + product_code + dimension + product_code + product_code + + + product_name + dimension + product_name + product_name + + + category + dimension + category + category + + + sub_category + dimension + sub_category + sub_category + + + account_code + dimension + account_code + account_code + + + initial_qty + measure + initial_qty + initial_qty + + + initial_value + measure + initial_value + initial_value + + + qty_in + measure + qty_in + qty_in + + + val_in + measure + val_in + val_in + + + qty_out + measure + qty_out + qty_out + + + val_out + measure + val_out + val_out + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + true + false + + + param_2 + AccountingReportId + + decimal + -5 + 2 + true + false + + + param_3 + AccountingReportId + + decimal + -5 + 3 + true + false + + + param_4 + AccountingReportId + + decimal + -5 + 4 + true + false + + + + + + 1 + product_code + string + + + 2 + product_name + string + + + 3 + category + string + + + 4 + sub_category + string + + + 5 + account_code + string + + + 6 + initial_qty + decimal + + + 7 + initial_value + decimal + + + 8 + qty_in + decimal + + + 9 + val_in + decimal + + + 10 + qty_out + decimal + + + 11 + val_out + decimal + + + + 0 + Data Source + + + 1 + product_code + product_code + string + 12 + + + 2 + product_name + product_name + string + 12 + + + 3 + category + category + string + 12 + + + 4 + sub_category + sub_category + string + 12 + + + 5 + account_code + account_code + string + 12 + + + 6 + initial_qty + initial_qty + decimal + 2 + + + 7 + initial_value + initial_value + decimal + 2 + + + 8 + qty_in + qty_in + decimal + 2 + + + 9 + val_in + val_in + decimal + 2 + + + 10 + qty_out + qty_out + decimal + 2 + + + 11 + val_out + val_out + decimal + 2 + + + 0 ) + GROUP BY PRODUCT_ID) as D2 on D2.PRODUCT_ID = D1.PRODUCT_ID) as s1 + full outer join +(select + a.CODE, + a.NAME, + coalesce(a.product_code,b.product_code) as productcode, + a.qty_in, + val_in, + b.qty_out, + val_out + from (SELECT + _ACCOUNT.CODE, + _ACCOUNT.NAME, + _PRODUCT.CODE as product_code, + sum(real_qty) as qty_in, + sum(case + when _move.type_select = 3 and _move.partner != 853 then round(_LINE.UNIT_PRICE_UNTAXED,2) * _line.real_qty + when _move.type_select = 3 and _move.partner = 853 then ROUND(_LINE.wap_price,2) * _line.real_qty + else 0 end) val_in +from account_accounting_report AccountingReport +left outer join STOCK_STOCK_MOVE_LINE _LINE on AccountingReport.id = ? +LEFT JOIN STOCK_STOCK_MOVE _MOVE ON _MOVE.ID = _LINE.STOCK_MOVE +LEFT JOIN BASE_PRODUCT _PRODUCT ON _PRODUCT.ID = _LINE.PRODUCT +LEFT JOIN ACCOUNT_ACCOUNT_MANAGEMENT _MANAGEMENT ON _MANAGEMENT.PRODUCT = _LINE.PRODUCT +LEFT JOIN ACCOUNT_ACCOUNT _ACCOUNT ON _ACCOUNT.ID = _MANAGEMENT.STOCK_ACCOUNT +WHERE _MOVE.estimated_date >= AccountingReport.date_from AND _MOVE.estimated_date <= AccountingReport.date_to + AND _MOVE.STATUS_SELECT = 3 + AND (_MOVE.ARCHIVED IS NULL OR _MOVE.ARCHIVED IS FALSE) + AND (_LINE.ARCHIVED IS NULL OR _LINE.ARCHIVED IS FALSE) + and _MOVE.type_select = 3 + and (_MOVE.from_stock_location not in (5,6) and _MOVE.to_stock_location not in (5,6)) +group by _ACCOUNT.CODE, _ACCOUNT.NAME,_PRODUCT.CODE) as a + full outer join +(SELECT + _ACCOUNT.CODE, + _ACCOUNT.NAME, + _PRODUCT.CODE as product_code, + sum(real_qty) as qty_out, + sum(case + when _move.type_select = 2 and _move.partner = 853 then round(_LINE.wap_price,2) * _line.real_qty + else 0 end ) val_out +from account_accounting_report AccountingReport +left outer join STOCK_STOCK_MOVE_LINE _LINE on AccountingReport.id = ? +LEFT JOIN STOCK_STOCK_MOVE _MOVE ON _MOVE.ID = _LINE.STOCK_MOVE +LEFT JOIN BASE_PRODUCT _PRODUCT ON _PRODUCT.ID = _LINE.PRODUCT +LEFT JOIN ACCOUNT_ACCOUNT_MANAGEMENT _MANAGEMENT ON _MANAGEMENT.PRODUCT = _LINE.PRODUCT +LEFT JOIN ACCOUNT_ACCOUNT _ACCOUNT ON _ACCOUNT.ID = _MANAGEMENT.STOCK_ACCOUNT +WHERE _MOVE.estimated_date >= AccountingReport.date_from AND _MOVE.estimated_date <= AccountingReport.date_to + AND _MOVE.STATUS_SELECT = 3 + AND (_MOVE.ARCHIVED IS NULL OR _MOVE.ARCHIVED IS FALSE) + AND (_LINE.ARCHIVED IS NULL OR _LINE.ARCHIVED IS FALSE) + and _MOVE.type_select = 2 + and (_MOVE.from_stock_location not in (5,6) and _MOVE.to_stock_location not in (5,6)) +group by _ACCOUNT.CODE, _ACCOUNT.NAME,_PRODUCT.CODE) as b on a.product_code = b.product_code +order by a.code) +as s2 on s1.product_code = s2.productcode +where (coalesce(s1.product_code,s2.productcode) is not null ) and account_code like '3%' +and (coalesce(initial_qty,0) + coalesce(qty_in,0) + coalesce(qty_out,0) != 0 ) + + + +]]> + + + nulls lowest + + + company_name + dimension + company_name + company_name + + + logo_height + measure + logo_height + logo_height + + + logo_width + measure + logo_width + logo_width + + + date_from + dimension + date_from + date_from + + + date_to + dimension + date_to + date_to + + + report_date + dimension + report_date + report_date + + + report_date_edition + dimension + report_date_edition + report_date_edition + + + logo_path + dimension + logo_path + logo_path + + + period_name + dimension + period_name + period_name + + + journal_name + dimension + journal_name + journal_name + + + global + measure + global + global + + + global_by_date + measure + global_by_date + global_by_date + + + payment_mode + dimension + payment_mode + payment_mode + + + currency + dimension + currency + currency + + + + + param_1 + AccountingReportId + + decimal + -5 + 1 + false + true + false + + + + + + 1 + company_name + string + + + 2 + logo_height + integer + + + 3 + logo_width + integer + + + 4 + date_from + date + + + 5 + date_to + date + + + 6 + report_date + date + + + 7 + report_date_edition + date-time + + + 8 + logo_path + string + + + 9 + period_name + string + + + 10 + journal_name + string + + + 11 + global + integer + + + 12 + global_by_date + integer + + + 13 + payment_mode + string + + + 14 + currency + string + + + + Data Source + + + 1 + company_name + company_name + string + 12 + + + 2 + logo_height + logo_height + integer + 4 + + + 3 + logo_width + logo_width + integer + 4 + + + 4 + date_from + date_from + date + 91 + + + 5 + date_to + date_to + date + 91 + + + 6 + report_date + report_date + date + 91 + + + 7 + report_date_edition + report_date_edition + date-time + 93 + + + 8 + logo_path + logo_path + string + 12 + + + 9 + period_name + period_name + string + 12 + + + 10 + journal_name + journal_name + string + 12 + + + 11 + global + global + integer + -7 + + + 12 + global_by_date + global_by_date + integer + -7 + + + 13 + payment_mode + payment_mode + string + 12 + + + 14 + currency + currency + string + 12 + + + + + + nulls lowest + + + message_key + dimension + message_key + message_key + + + translation + dimension + translation + translation + + + + + param_1 + + string + -1 + 1 + true + + + param_2 + Locale + + string + -1 + 2 + true + false + + + + + + 1 + message_key + string + + + 2 + translation + string + + + + Data Source + + + 1 + message_key + message_key + string + 12 + + + 2 + translation + translation + string + 12 + + + + + + 2.0 + + + + In + + + + 1 + + -1 + 0 + 0 + Unknown + + + + + + In + + + + 2 + + -1 + 0 + 0 + Unknown + + + + +]]> + + + + + + + + + + a4 + landscape + 0.8in + 0.33in + + + 0.71875in + 11.033333333333333in + AccountingReportDS + + + company_name + company_name + dataSetRow["company_name"] + string + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + logo_height + logo_height + if(dataSetRow["logo_height"]>0){dataSetRow["logo_height"]+'px'}else{'35px'} + integer + true + + + logo_width + logo_width + if(dataSetRow["logo_width"]>0){dataSetRow["logo_width"]+'px'}else{'100px'} + integer + true + + + currency + currency + dataSetRow["currency"] + string + + + + 2in + + + 7.8in + + + 1.2in + + + 69px + + + 8pt + + + all + row["logo_path"] == null + + + html + + + + "" + + +]]> + + + + top + + + + top + + 9pt + html + row["report_date_edition"]]]> + + + + + + + + 11.033333333333333in + + 10.022222222222222in + + + 1.011111111111111in + + + + + + + + right + 0.3in + + + + + 0.3333333333333333in + + 0pt + 0pt + 0pt + 0pt + + 9pt + page-number + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + plain + + + + + 0pt + 0pt + 0pt + 0pt + + 9pt + total-page + + + + + + + + + + + + + 3.6145833333333335in + 11.1in + AccountingReportDS + + + + company_name + company_name + dataSetRow["company_name"] + string + + + logo_height + logo_height + dataSetRow["logo_height"] + integer + + + logo_width + logo_width + dataSetRow["logo_width"] + integer + + + date_from + date_from + dataSetRow["date_from"] + date + + + date_to + date_to + dataSetRow["date_to"] + date + + + report_date + report_date + dataSetRow["report_date"] + date + + + report_date_edition + report_date_edition + dataSetRow["report_date_edition"] + date-time + + + logo_path + logo_path + dataSetRow["logo_path"] + string + + + period_name + period_name + dataSetRow["period_name"] + string + + + journal_name + journal_name + dataSetRow["journal_name"] + string + + + global + global + dataSetRow["global"] + integer + + + global_by_date + global_by_date + dataSetRow["global_by_date"] + integer + + + payment_mode + payment_mode + dataSetRow["payment_mode"] + string + + + currency + currency + dataSetRow["currency"] + string + + + + 1.6in + + + 1.6in + + + 1.6in + + + 1.6in + + + 1.6in + + + 1.6in + + + 1.6in + + + 0.3020833333333333in + + 7 + 1 + + "Tw Cen MT" + 14pt + bold + none + none + none + none + center + TranslateDS + + + param_1 + + 'AccountingReportType18.title' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"]]]> + + + + + 0.1in + + + + + + + + + + double + 2px + 0.2604166666666667in + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.company' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["company_name"]]]> + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.endDate' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["report_date"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.period' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["period_name"]]]> + + + + + 0.4479166666666667in + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + all + !row._outer["journal_name"] + + + + + param_1 + + 'AccountingReportType2.journal' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["journal_name"]]]> + + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.from' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["date_from"]]]> + + + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'AccountingReportType2.to' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["date_to"]]]> + + + + + solid + thin + 0.46875in + + + 10pt + normal + none + none + none + none + right + TranslateDS + + + param_1 + + 'Currency' + + + + + + key + key + dataSetRow["message_key"] + string + + + translation + translation + dataSetRow["translation"] + string + + + html + row["translation"] :]]> + + + + + html + row["currency"]]]> + + + + + + + + + + 0.28125in + + 2 + 1 + + + + + + + + + auto + auto + auto + + 7 + 1 + + MoveLineDS + + + product_code + product_code + dataSetRow["product_code"] + string + + + account_code + account_code + dataSetRow["account_code"] + string + + + initial_qty + initial_qty + dataSetRow["initial_qty"] + decimal + + + initial_value + initial_value + dataSetRow["initial_value"] + decimal + + + qty_in + qty_in + dataSetRow["qty_in"] + decimal + + + val_in + val_in + dataSetRow["val_in"] + decimal + + + qty_out + qty_out + dataSetRow["qty_out"] + decimal + + + val_out + val_out + dataSetRow["val_out"] + decimal + + + Aggregation + sumInitialQty + float + + NewTableGroup1 + + SUM + + + Expression + row["initial_qty"] + + + true + + + Aggregation_1 + sumInitialVal + float + + NewTableGroup1 + + SUM + + + Expression + row["initial_value"] + + + true + + + Aggregation_2 + sumQtyIn + float + + NewTableGroup1 + + SUM + + + Expression + row["qty_in"] + + + true + + + Aggregation_3 + sumValIn + float + + NewTableGroup1 + + SUM + + + Expression + row["val_in"] + + + true + + + Aggregation_4 + sumQtyOut + float + + NewTableGroup1 + + SUM + + + Expression + row["qty_out"] + + + true + + + Aggregation_5 + sumValOut + float + + NewTableGroup1 + + SUM + + + Expression + row["val_out"] + + + true + + + sumSoldeQtyAgg + sumSoldeVal + float + + NewTableGroup1 + + SUM + + + Expression + row["Aggregation_1"] + row["Aggregation_3"] - row["Aggregation_5"] + + + true + + + Aggregation_6 + sumSoldeQty + float + + NewTableGroup1 + + SUM + + + Expression + row["Aggregation"] + row["Aggregation_2"] - row["Aggregation_4"] + + + true + + + product_name + product_name + dataSetRow["product_name"] + string + + + + + + + + + + + + + +
+ + #C0C0C0 + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + 2 + 1 + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + 4 + 1 + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + 2 + 1 + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + + #C0C0C0 + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + + solid + thin + solid + thin + solid + thin + solid + thin + middle + + + +
+ + NewTableGroup1 + row["account_code"] + + row["account_code"] + + false +
+ + #DDDDDD + + + bold + 1pt + 1pt + account_code + + + + + + + + + + + + + +
+
+ + #DBDBDB + + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + + + solid + thin + solid + thin + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation + + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation_1 + + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation_2 + + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation_3 + + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation_4 + + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation_5 + + + + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + Aggregation_6 + + + + solid + thin + solid + thin + solid + thin + + 8pt + bold + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + sumSoldeQtyAgg + + + +
+
+ + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + account_code + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + product_code + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + product_name + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + initial_qty + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + initial_value + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + qty_in + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + val_in + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + qty_out + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + + Currency + #,##0.00{RoundingMode=HALF_UP} + + right + val_out + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + right + MoveLineDS + + + initial_qty + initial_qty + dataSetRow["initial_qty"] + decimal + + + qty_in + qty_in + dataSetRow["qty_in"] + decimal + + + qty_out + qty_out + dataSetRow["qty_out"] + decimal + + + html + row._outer["initial_qty"] + row._outer["qty_in"] - row._outer["qty_out"]]]> + + + + solid + thin + solid + thin + solid + thin + solid + thin + + "Tw Cen MT" + 9pt + right + MoveLineDS + + + initial_qty + initial_qty + dataSetRow["initial_qty"] + decimal + + + qty_in + qty_in + dataSetRow["qty_in"] + decimal + + + qty_out + qty_out + dataSetRow["qty_out"] + decimal + + + html + row._outer["initial_value"] + row._outer["val_in"] - row._outer["val_out"]]]> + + + + +
+ + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + + solid + thin + solid + thin + solid + thin + solid + thin + + +
+
+
+
+
+ +
diff --git a/modules/axelor-open-suite/axelor-account/src/test/java/com/axelor/apps/account/web/CashInventoryControllerTest.java b/modules/axelor-open-suite/axelor-account/src/test/java/com/axelor/apps/account/web/CashInventoryControllerTest.java new file mode 100644 index 0000000..6bc4e4c --- /dev/null +++ b/modules/axelor-open-suite/axelor-account/src/test/java/com/axelor/apps/account/web/CashInventoryControllerTest.java @@ -0,0 +1,80 @@ +package com.axelor.apps.account.web; + +import org.junit.Before; +import org.junit.Test; + +import com.axelor.apps.account.db.CashInventory; +import com.axelor.apps.base.service.ConvertNumberToFrenchWordsService; +import com.axelor.inject.Beans; +import com.axelor.rpc.ActionRequest; +import com.axelor.rpc.ActionResponse; +import static org.mockito.Mockito.*; +import org.mockito.ArgumentCaptor; +import static org.junit.Assert.assertEquals; +import java.math.BigDecimal; + +public class CashInventoryControllerTest { + + private CashInventoryController controller; + private ActionRequest request; + private ActionResponse response; + private CashInventory cashInventory; + private ConvertNumberToFrenchWordsService convertService; + + @Before + public void setUp() { + request = mock(ActionRequest.class); + response = mock(ActionResponse.class); + cashInventory = mock(CashInventory.class); + convertService = mock(ConvertNumberToFrenchWordsService.class); + + controller = new CashInventoryController(convertService); // ✅ No Guice needed + + // Mock request.getContext().asType(CashInventory.class) + com.axelor.rpc.Context context = mock(com.axelor.rpc.Context.class); + when(request.getContext()).thenReturn(context); + when(context.asType(CashInventory.class)).thenReturn(cashInventory); + } + + @Test + public void testConvert_withDecimalSolde() { + // Given + when(cashInventory.getTheoricalSolde()).thenReturn(new BigDecimal("1234.56")); + when(convertService.convert(1234L)).thenReturn("mille deux cent trente-quatre"); + when(convertService.convert(56L)).thenReturn("cinquante-six"); + + } + + @Test + public void testConvert_withIntegerSolde() { + // Given + when(cashInventory.getTheoricalSolde()).thenReturn(new BigDecimal("1000.00")); + when(convertService.convert(1000L)).thenReturn("mille"); + when(convertService.convert(0L)).thenReturn("zéro"); + + + // Then + ArgumentCaptor keyCaptor = ArgumentCaptor.forClass(String.class); + ArgumentCaptor valueCaptor = ArgumentCaptor.forClass(String.class); + verify(response).setValue(keyCaptor.capture(), valueCaptor.capture()); + assertEquals("theoricalSoldeInWords", keyCaptor.getValue()); + assertEquals("mille dinars algériens et zéro Cts", valueCaptor.getValue()); + } + + // @Test + // public void testConvert_withNoDecimalPart() { + // // Given + // when(cashInventory.getTheoricalSolde()).thenReturn(new BigDecimal("42")); + // when(convertService.convert(42L)).thenReturn("quarante-deux"); + // when(convertService.convert(0L)).thenReturn("zéro"); + + + // // Then + // ArgumentCaptor keyCaptor = ArgumentCaptor.forClass(String.class); + // ArgumentCaptor valueCaptor = ArgumentCaptor.forClass(String.class); + // verify(response).setValue(keyCaptor.capture(), valueCaptor.capture()); + // assertEquals("theoricalSoldeInWords", keyCaptor.getValue()); + // assertEquals("quarante-deux dinars algériens et zéro Cts", + // valueCaptor.getValue()); + // } +} \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-account/src/test/resources/META-INF/persistence.xml b/modules/axelor-open-suite/axelor-account/src/test/resources/META-INF/persistence.xml index 094c8d7..25eb768 100644 --- a/modules/axelor-open-suite/axelor-account/src/test/resources/META-INF/persistence.xml +++ b/modules/axelor-open-suite/axelor-account/src/test/resources/META-INF/persistence.xml @@ -9,10 +9,10 @@ - + - - + + + + diff --git a/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Product.xml b/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Product.xml index c82a6c6..52ecdda 100644 --- a/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Product.xml +++ b/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Product.xml @@ -148,6 +148,9 @@ + + + diff --git a/modules/axelor-open-suite/axelor-base/src/main/resources/domains/ProductInventory.xml b/modules/axelor-open-suite/axelor-base/src/main/resources/domains/ProductInventory.xml new file mode 100644 index 0000000..cddb3fa --- /dev/null +++ b/modules/axelor-open-suite/axelor-base/src/main/resources/domains/ProductInventory.xml @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Product updated + + + + diff --git a/modules/axelor-open-suite/axelor-base/src/test/java/com/axelor/apps/base/test/UserServiceTest.java b/modules/axelor-open-suite/axelor-base/src/test/java/com/axelor/apps/base/test/UserServiceTest.java index b04a7db..3c3e9e3 100644 --- a/modules/axelor-open-suite/axelor-base/src/test/java/com/axelor/apps/base/test/UserServiceTest.java +++ b/modules/axelor-open-suite/axelor-base/src/test/java/com/axelor/apps/base/test/UserServiceTest.java @@ -21,35 +21,21 @@ import com.axelor.app.AxelorModule; import com.axelor.apps.base.module.AdminModule; import com.axelor.apps.base.module.BaseModule; import com.axelor.apps.base.service.user.UserService; -import com.axelor.apps.base.test.UserServiceTest.MyModule; import com.axelor.apps.message.module.MessageModule; import com.axelor.apps.tool.module.ToolModule; -import com.axelor.auth.db.User; import com.axelor.auth.db.repo.UserRepository; import com.axelor.exception.AxelorException; import com.axelor.inject.Beans; import com.axelor.test.GuiceModules; import com.axelor.test.GuiceRunner; import com.google.inject.Inject; -import com.google.inject.Injector; import com.google.inject.persist.Transactional; - -import static org.junit.Assert.assertNotNull; - -import java.util.List; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; - import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.inject.Injector; - @RunWith(GuiceRunner.class) @GuiceModules({UserServiceTest.MyModule.class}) @@ -58,7 +44,6 @@ public class UserServiceTest { static UserService userService; protected final Logger log = LoggerFactory.getLogger(getClass()); - public static class MyModule extends AxelorModule { @Override @@ -78,14 +63,13 @@ public class UserServiceTest { @Inject UserRepository injector; - // public void test() { - // assertNotNull(injector.find(1L)); + // assertNotNull(injector.find(1L)); // } @Test public void testMatchPasswordPatternUpperLowerDigit() { - Assert.assertTrue(userService.matchPasswordPattern("Axelor123")); + Assert.assertTrue(userService.matchPasswordPattern("5")); Assert.assertTrue(userService.matchPasswordPattern("123Axelor")); Assert.assertTrue(userService.matchPasswordPattern("axelor123A")); } @@ -125,19 +109,19 @@ public class UserServiceTest { Assert.assertFalse(userService.matchPasswordPattern("axelor123456")); } - @Test @Transactional public void findUser() throws AxelorException { - EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("testUnitManager"); - EntityManager entityManager = entityManagerFactory.createEntityManager(); + // EntityManagerFactory entityManagerFactory = + // Persistence.createEntityManagerFactory("testUnitManager"); + // EntityManager entityManager = entityManagerFactory.createEntityManager(); // Student student = new Student("Ramesh", "Fadatare", "rameshfadatare@javaguides.com"); - // Object partner = entityManager.createNativeQuery("select u from base_partner u where u.id = 1",Partner.class).getSingleResult(); + // Object partner = entityManager.createNativeQuery("select u from base_partner u where u.id = + // 1",Partner.class).getSingleResult(); // log.debug("data *******************************"+ partner.toString()); - entityManager.close(); - entityManagerFactory.close(); - + // entityManager.close(); + // entityManagerFactory.close(); } } diff --git a/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/exception/IExceptionMessage.java b/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/exception/IExceptionMessage.java index c879485..d358ac7 100644 --- a/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/exception/IExceptionMessage.java +++ b/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/exception/IExceptionMessage.java @@ -60,9 +60,8 @@ public interface IExceptionMessage { static final String EVENT_MEETING_INVITATION_1 = /*$$(*/ "No PERSON IS INVITED TO THIS MEETING" /*)*/; - - static final String USER_EMAIL_1 = /*$$(*/ - "No email address associated to %s" /*)*/; + + static final String USER_EMAIL_1 = /*$$(*/ "No email address associated to %s" /*)*/; /** Lead controller */ static final String LEAD_1 = /*$$(*/ "Please select the Lead(s) to print." /*)*/; diff --git a/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/service/EventServiceImpl.java b/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/service/EventServiceImpl.java index 43113eb..1ba24fc 100644 --- a/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/service/EventServiceImpl.java +++ b/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/service/EventServiceImpl.java @@ -17,15 +17,14 @@ */ package com.axelor.apps.crm.service; - -import com.axelor.apps.base.db.AppBase; -import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.base.db.Address; +import com.axelor.apps.base.db.AppBase; import com.axelor.apps.base.db.ICalendarUser; import com.axelor.apps.base.db.Partner; import com.axelor.apps.base.db.repo.PartnerRepository; import com.axelor.apps.base.ical.ICalendarService; import com.axelor.apps.base.service.PartnerService; +import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.crm.db.Event; import com.axelor.apps.crm.db.Lead; import com.axelor.apps.crm.db.RecurrenceConfiguration; @@ -34,14 +33,12 @@ import com.axelor.apps.crm.db.repo.LeadRepository; import com.axelor.apps.crm.db.repo.RecurrenceConfigurationRepository; import com.axelor.apps.crm.exception.IExceptionMessage; import com.axelor.apps.message.db.EmailAddress; +import com.axelor.apps.message.db.Template; import com.axelor.apps.message.db.repo.EmailAddressRepository; import com.axelor.apps.message.service.MessageService; import com.axelor.apps.message.service.TemplateMessageService; -import com.axelor.apps.message.db.Template; import com.axelor.auth.db.User; import com.axelor.exception.AxelorException; -import javax.mail.MessagingException; -import java.io.IOException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; @@ -52,6 +49,7 @@ import com.axelor.mail.db.repo.MailFollowerRepository; import com.google.common.base.Strings; import com.google.inject.Inject; import com.google.inject.persist.Transactional; +import java.io.IOException; import java.time.DayOfWeek; import java.time.Duration; import java.time.LocalDate; @@ -60,11 +58,12 @@ import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.HashMap; import java.util.List; -import java.util.Set; import java.util.Map; +import java.util.Set; import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; +import javax.mail.MessagingException; import org.apache.commons.math3.exception.TooManyIterationsException; public class EventServiceImpl implements EventService { @@ -664,30 +663,28 @@ public class EventServiceImpl implements EventService { } @Override - public void sendEmailMeetingInvitation(Event event, Set users) throws ClassNotFoundException, InstantiationException, IllegalAccessException, + public void sendEmailMeetingInvitation(Event event, Set users) + throws ClassNotFoundException, InstantiationException, IllegalAccessException, MessagingException, IOException, AxelorException { - AppBase appBase = Beans.get(AppBaseService.class).getAppBase(); - Template template = appBase.getSendMailToInvitedPersonInMeetingTemplate(); + AppBase appBase = Beans.get(AppBaseService.class).getAppBase(); + Template template = appBase.getSendMailToInvitedPersonInMeetingTemplate(); - if (template == null) { - throw new AxelorException( - appBase, - TraceBackRepository.CATEGORY_NO_VALUE, - I18n.get("Template for sending meeting invitation is missing.") - ); - } + if (template == null) { + throw new AxelorException( + appBase, + TraceBackRepository.CATEGORY_NO_VALUE, + I18n.get("Template for sending meeting invitation is missing.")); + } - TemplateMessageService templateMessageService = Beans.get(TemplateMessageService.class); - - try { - templateMessageService.generateAndSendMessageToBulkUsers(event, template, users); - } catch (MessagingException e) { - throw new AxelorException( - TraceBackRepository.CATEGORY_NO_VALUE, - I18n.get("Failed to send meeting invitation email."), - e - ); - } + TemplateMessageService templateMessageService = Beans.get(TemplateMessageService.class); + + try { + templateMessageService.generateAndSendMessageToBulkUsers(event, template, users); + } catch (MessagingException e) { + throw new AxelorException( + TraceBackRepository.CATEGORY_NO_VALUE, + I18n.get("Failed to send meeting invitation email."), + e); + } } - } diff --git a/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/web/EventController.java b/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/web/EventController.java index 1c67c31..4fc2aa4 100644 --- a/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/web/EventController.java +++ b/modules/axelor-open-suite/axelor-crm/src/main/java/com/axelor/apps/crm/web/EventController.java @@ -63,10 +63,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.Set; import java.util.Map; - -import org.apache.commons.math3.ode.events.EventState; +import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,7 +73,6 @@ public class EventController { @Inject ImportationFolderRepository importationFolderRepository; - private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public void computeFromStartDateTime(ActionRequest request, ActionResponse response) { @@ -557,10 +554,23 @@ public class EventController { public void setImportationFolderEvent(ActionRequest request, ActionResponse response) { Event event = new Event(); - final ArrayList importationSequences = new ArrayList(Arrays.asList("PREPARATION","ENTAME","VALIDATION COA/FICHE TECHNIQUE","LOGISTIQUE","TRANSIT","DEDOUANEMENT","RECEPTION")); + final ArrayList importationSequences = + new ArrayList( + Arrays.asList( + "PREPARATION", + "ENTAME", + "VALIDATION COA/FICHE TECHNIQUE", + "LOGISTIQUE", + "TRANSIT", + "DEDOUANEMENT", + "RECEPTION")); - ImportationFolder importationFolder = Beans.get(ImportationFolderRepository.class).find(request.getContext().asType(ImportationFolder.class).getId()); - event.setSubject(importationSequences.get(Integer.parseInt(request.getContext().get("statusSelect").toString()))); + ImportationFolder importationFolder = + Beans.get(ImportationFolderRepository.class) + .find(request.getContext().asType(ImportationFolder.class).getId()); + event.setSubject( + importationSequences.get( + Integer.parseInt(request.getContext().get("statusSelect").toString()))); event.setStatusSelect(1); event.setStartDateTime(LocalDateTime.now()); event.setEndDateTime(LocalDateTime.now().plusDays(10)); @@ -572,22 +582,19 @@ public class EventController { response.setReload(true); } - public void openRoqApplication(ActionRequest request, ActionResponse response) { - String uri = Beans.get(AppBaseService.class).getAppBase().getRoqURL(); - LOG.debug("link {}",uri+AuthUtils.getUser().getId()); + LOG.debug("link {}", uri + AuthUtils.getUser().getId()); - response.setView( - ActionView.define(I18n.get("ROQ")) - .model("") - .add("html", uri +AuthUtils.getUser().getId()) - .map()); + response.setView( + ActionView.define(I18n.get("ROQ")) + .model("") + .add("html", uri + AuthUtils.getUser().getId()) + .map()); } - public void printMeeting(ActionRequest request, ActionResponse response) throws AxelorException { Event event = request.getContext().asType(Event.class); event = Beans.get(EventRepository.class).find(event.getId()); @@ -601,41 +608,41 @@ public class EventController { .generate() .getFileLink(); - response.setView(ActionView.define(eventName).add("html", fileLink).map()); } - public void sendMailToGuests(ActionRequest request, ActionResponse response) throws AxelorException { + public void sendMailToGuests(ActionRequest request, ActionResponse response) + throws AxelorException { - Event event = request.getContext().asType(Event.class); - event = Beans.get(EventRepository.class).find(event.getId()); + Event event = request.getContext().asType(Event.class); + event = Beans.get(EventRepository.class).find(event.getId()); - Set users = event.getGuestList(); - if (event.getUser() != null) - users.add(event.getUser()); - users.add(event.getCreatedBy()); + Set users = event.getGuestList(); + if (event.getUser() != null) users.add(event.getUser()); + users.add(event.getCreatedBy()); - if (!users.isEmpty()) { - // Check if all users have an email address - for (User user : users) { - if (user.getEmail() == null) { - response.setFlash(I18n.get(String.format(IExceptionMessage.USER_EMAIL_1, user.getName()))); - return; // Exit the method if any user lacks an email - } - } - - // All users have emails; proceed to send emails - try { - Beans.get(EventService.class).sendEmailMeetingInvitation(event,users); - } catch (Exception e) { - LOG.error(e.getMessage()); - return; // Exit if any email fails to send - } - - response.setFlash(I18n.get("Emails successfully sent to all guests.")); - - } else { - response.setFlash(I18n.get(IExceptionMessage.EVENT_MEETING_INVITATION_1)); + if (!users.isEmpty()) { + // Check if all users have an email address + for (User user : users) { + if (user.getEmail() == null) { + response.setFlash( + I18n.get(String.format(IExceptionMessage.USER_EMAIL_1, user.getName()))); + return; // Exit the method if any user lacks an email + } } + + // All users have emails; proceed to send emails + try { + Beans.get(EventService.class).sendEmailMeetingInvitation(event, users); + } catch (Exception e) { + LOG.error(e.getMessage()); + return; // Exit if any email fails to send + } + + response.setFlash(I18n.get("Emails successfully sent to all guests.")); + + } else { + response.setFlash(I18n.get(IExceptionMessage.EVENT_MEETING_INVITATION_1)); + } } } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/job/FetchCheckInOutJob.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/job/FetchCheckInOutJob.java index d340235..ebb61ec 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/job/FetchCheckInOutJob.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/job/FetchCheckInOutJob.java @@ -1,20 +1,19 @@ package com.axelor.apps.hr.job; -import com.axelor.apps.hr.db.CheckInOut; +import com.axelor.app.AppSettings; import com.axelor.apps.hr.db.repo.CheckInOutRepository; import com.axelor.exception.service.TraceBackService; +import com.axelor.inject.Beans; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.time.LocalDate; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; +import org.quartz.SchedulerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.axelor.inject.Beans; -import java.time.LocalDate; -import org.quartz.SchedulerException; -import com.axelor.app.AppSettings; public class FetchCheckInOutJob implements Job { @@ -38,14 +37,18 @@ public class FetchCheckInOutJob implements Job { LocalDate today = LocalDate.now(); // Fetch the CheckInOut list from the repository where the date_attendance is today - int lenCheckInOutList = Beans.get(CheckInOutRepository.class) - .all() - .filter("self.date_attendance = :today") - .bind("today", today) - .fetch().size(); + int lenCheckInOutList = + Beans.get(CheckInOutRepository.class) + .all() + .filter("self.date_attendance = :today") + .bind("today", today) + .fetch() + .size(); // Define the command to run the Python script with the correct path (V3) - String[] args = {"python", pythonScriptDir + "\\Scrape\\main2.py", String.valueOf(lenCheckInOutList)}; + String[] args = { + "python", pythonScriptDir + "\\Scrape\\main2.py", String.valueOf(lenCheckInOutList) + }; // Execute the command Process p = Runtime.getRuntime().exec(args); @@ -101,5 +104,4 @@ public class FetchCheckInOutJob implements Job { return false; } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceService.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceService.java index c3bb5a1..c17ee9f 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceService.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceService.java @@ -3,9 +3,9 @@ package com.axelor.apps.hr.service; import com.axelor.apps.hr.db.Absence; import com.axelor.apps.hr.db.DailyReport; import com.google.inject.persist.Transactional; -import java.util.List; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; public interface AbsenceService { @@ -13,13 +13,16 @@ public interface AbsenceService { void attachTheAbsenceWithDailyReport(Absence absence, List dailyreports); @Transactional - void deAttachTheAbsenceWithDailyReport(Absence absence, List dailyreports, Boolean archive); + void deAttachTheAbsenceWithDailyReport( + Absence absence, List dailyreports, Boolean archive); @Transactional void chooseAbsenceType(Absence absence, Integer selectedType); @Transactional - BigDecimal calculateTotalAbsenceHours(LocalDateTime absenceStartDate, LocalDateTime absenceEndDate); + BigDecimal calculateTotalAbsenceHours( + LocalDateTime absenceStartDate, LocalDateTime absenceEndDate); - BigDecimal calculateTotalAbsenceMinutes(LocalDateTime absenceStartDate, LocalDateTime absenceEndDate); + BigDecimal calculateTotalAbsenceMinutes( + LocalDateTime absenceStartDate, LocalDateTime absenceEndDate); } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceServiceImpl.java index 1f4f542..372d567 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AbsenceServiceImpl.java @@ -1,25 +1,22 @@ package com.axelor.apps.hr.service; -import com.axelor.apps.base.db.EventsPlanning; import com.axelor.apps.base.db.EventsPlanningLine; -import com.axelor.apps.base.db.repo.EventsPlanningRepository; import com.axelor.apps.base.db.repo.EventsPlanningLineRepository; import com.axelor.apps.hr.db.Absence; import com.axelor.apps.hr.db.DailyReport; import com.axelor.apps.hr.db.repo.AbsenceRepository; import com.axelor.apps.hr.db.repo.DailyReportRepository; +import com.axelor.inject.Beans; import com.google.inject.Inject; import com.google.inject.persist.Transactional; -import com.axelor.inject.Beans; -import java.util.List; -import java.time.Year; -import java.time.DayOfWeek; import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.DayOfWeek; +import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; -import java.time.Duration; -import java.math.RoundingMode; +import java.util.List; public class AbsenceServiceImpl implements AbsenceService { @@ -28,19 +25,16 @@ public class AbsenceServiceImpl implements AbsenceService { private List eventsPlanningLines; @Inject - public AbsenceServiceImpl( AbsenceRepository absenceRepository, DailyReportRepository dailyReportRepository) { + public AbsenceServiceImpl( + AbsenceRepository absenceRepository, DailyReportRepository dailyReportRepository) { this.absenceRepository = absenceRepository; this.dailyReportRepository = dailyReportRepository; eventsPlanningLines = - Beans.get(EventsPlanningLineRepository.class) - .all() - .filter("self.id = 4") - .fetch(); + Beans.get(EventsPlanningLineRepository.class).all().filter("self.id = 4").fetch(); } @Transactional - public void attachTheAbsenceWithDailyReport( - Absence absence, List dailyreports) { + public void attachTheAbsenceWithDailyReport(Absence absence, List dailyreports) { // Iterate over each DailyReport in the list for (DailyReport dailyreport : dailyreports) { dailyreport.addAbsenceSetItem(absence); // Set the absence for each report @@ -49,8 +43,9 @@ public class AbsenceServiceImpl implements AbsenceService { } @Transactional - public void deAttachTheAbsenceWithDailyReport(Absence absence, List dailyreports, Boolean archive) { - if(dailyreports != null){ + public void deAttachTheAbsenceWithDailyReport( + Absence absence, List dailyreports, Boolean archive) { + if (dailyreports != null) { // Iterate over each DailyReport in the list for (DailyReport dailyreport : dailyreports) { dailyreport.removeAbsenceSetItem(null); // Set the absence for each report @@ -59,8 +54,8 @@ public class AbsenceServiceImpl implements AbsenceService { } if (archive) { - absence.setArchived(true); - absenceRepository.save(absence); + absence.setArchived(true); + absenceRepository.save(absence); } } @@ -74,46 +69,50 @@ public class AbsenceServiceImpl implements AbsenceService { absenceRepository.save(absence); } - public BigDecimal calculateTotalAbsenceHours(LocalDateTime absenceStartDate, LocalDateTime absenceEndDate) { - BigDecimal totalAbsenceHours = BigDecimal.ZERO; + public BigDecimal calculateTotalAbsenceHours( + LocalDateTime absenceStartDate, LocalDateTime absenceEndDate) { + BigDecimal totalAbsenceHours = BigDecimal.ZERO; - if(absenceStartDate.equals(absenceEndDate)){ - totalAbsenceHours = BigDecimal.valueOf(8); - } - else if (absenceStartDate.toLocalDate().equals(absenceEndDate.toLocalDate())) { - // If the start and end dates are the same, calculate the hour difference - long hours = ChronoUnit.HOURS.between(absenceStartDate, absenceEndDate); - totalAbsenceHours = BigDecimal.valueOf(hours); - } else { - long absenceDays = 0; - LocalDate currentDate = absenceStartDate.toLocalDate(); + if (absenceStartDate.equals(absenceEndDate)) { + totalAbsenceHours = BigDecimal.valueOf(8); + } else if (absenceStartDate.toLocalDate().equals(absenceEndDate.toLocalDate())) { + // If the start and end dates are the same, calculate the hour difference + long hours = ChronoUnit.HOURS.between(absenceStartDate, absenceEndDate); + totalAbsenceHours = BigDecimal.valueOf(hours); + } else { + long absenceDays = 0; + LocalDate currentDate = absenceStartDate.toLocalDate(); - // Loop through each day between start and end date - while (!currentDate.isAfter(absenceEndDate.toLocalDate())) { - DayOfWeek dayOfWeek = currentDate.getDayOfWeek(); + // Loop through each day between start and end date + while (!currentDate.isAfter(absenceEndDate.toLocalDate())) { + DayOfWeek dayOfWeek = currentDate.getDayOfWeek(); - // Exclude Friday (5) and Saturday (6) and holidays - if (dayOfWeek != DayOfWeek.FRIDAY && dayOfWeek != DayOfWeek.SATURDAY && !isSpecialOvertimeDay(currentDate)) { - absenceDays++; - } - currentDate = currentDate.plusDays(1); + // Exclude Friday (5) and Saturday (6) and holidays + if (dayOfWeek != DayOfWeek.FRIDAY + && dayOfWeek != DayOfWeek.SATURDAY + && !isSpecialOvertimeDay(currentDate)) { + absenceDays++; } - - // Multiply the counted days by 8 hours per day - totalAbsenceHours = BigDecimal.valueOf(absenceDays).multiply(BigDecimal.valueOf(8)); + currentDate = currentDate.plusDays(1); } - return totalAbsenceHours; + + // Multiply the counted days by 8 hours per day + totalAbsenceHours = BigDecimal.valueOf(absenceDays).multiply(BigDecimal.valueOf(8)); + } + return totalAbsenceHours; } - public BigDecimal calculateTotalAbsenceMinutes(LocalDateTime absenceStartDate, LocalDateTime absenceEndDate) { - // Calculate the duration between the two LocalDateTime objects - Duration duration = Duration.between(absenceStartDate, absenceEndDate); + public BigDecimal calculateTotalAbsenceMinutes( + LocalDateTime absenceStartDate, LocalDateTime absenceEndDate) { + // Calculate the duration between the two LocalDateTime objects + Duration duration = Duration.between(absenceStartDate, absenceEndDate); - // Convert the duration to minutes and then divide by 60 to get hours - long minutes = duration.toMinutes(); - BigDecimal hours = BigDecimal.valueOf(minutes).divide(BigDecimal.valueOf(60), 2, BigDecimal.ROUND_HALF_UP); + // Convert the duration to minutes and then divide by 60 to get hours + long minutes = duration.toMinutes(); + BigDecimal hours = + BigDecimal.valueOf(minutes).divide(BigDecimal.valueOf(60), 2, BigDecimal.ROUND_HALF_UP); - return customRound(hours); + return customRound(hours); } private boolean isSpecialOvertimeDay(LocalDate date) { @@ -147,5 +146,4 @@ public class AbsenceServiceImpl implements AbsenceService { return value; // In case no rounding is needed } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AuthorizationServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AuthorizationServiceImpl.java index 3acdc42..8af9d71 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AuthorizationServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/AuthorizationServiceImpl.java @@ -1,24 +1,20 @@ package com.axelor.apps.hr.service; import com.axelor.apps.hr.db.Authorization; -import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.DailyReport; +import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.repo.AuthorizationRepository; -import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.apps.hr.db.repo.DailyReportRepository; +import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.exception.AxelorException; import com.google.inject.persist.Transactional; import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -import java.util.ArrayList; -import java.util.List; import javax.inject.Inject; import wslite.json.JSONException; import wslite.json.JSONObject; -import java.util.Set; -import java.util.HashSet; public class AuthorizationServiceImpl implements AuthorizationService { @@ -40,143 +36,149 @@ public class AuthorizationServiceImpl implements AuthorizationService { public void saveAA(JSONObject jsonObject) throws AxelorException { try { - // Extract fields - int idInt = jsonObject.getInt("id"); - String id = Integer.toString(idInt); - String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; - String matricule = jsonObject.getString("matricule"); - String date_absence = jsonObject.getString("date_absence"); - String commentaire = jsonObject.getString("commentaire"); - int validation_status = jsonObject.optInt("validation_status",2); - String validateByUser = jsonObject.optString("validate_by_user",null); - String dateValidation = jsonObject.optString("validation_date", null); // Safely get validation_date + // Extract fields + int idInt = jsonObject.getInt("id"); + String id = Integer.toString(idInt); + String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; + String matricule = jsonObject.getString("matricule"); + String date_absence = jsonObject.getString("date_absence"); + String commentaire = jsonObject.getString("commentaire"); + int validation_status = jsonObject.optInt("validation_status", 2); + String validateByUser = jsonObject.optString("validate_by_user", null); + String dateValidation = + jsonObject.optString("validation_date", null); // Safely get validation_date - // GET EMPLOYEES - Employee employee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", matricule) - .fetchOne(); + // GET EMPLOYEES + Employee employee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", matricule) + .fetchOne(); - if (employee == null) { - System.err.println("Employee with matricule " + matricule + " not found."); - return; - } + if (employee == null) { + System.err.println("Employee with matricule " + matricule + " not found."); + return; + } - Employee validatedByEmployee = null; + Employee validatedByEmployee = null; - if(validateByUser != null){ - validatedByEmployee = employeeRepo + if (validateByUser != null) { + validatedByEmployee = + employeeRepo .all() .filter("self.registrationNumber = :matricule") .bind("matricule", validateByUser) .fetchOne(); - if (validatedByEmployee == null) { - System.err.println("Validator employee with matricule " + validateByUser + " not found."); - return; - } + if (validatedByEmployee == null) { + System.err.println("Validator employee with matricule " + validateByUser + " not found."); + return; } + } - // Parse validation date (handle null case) - LocalDate validationDate = null; - if (dateValidation != null && !dateValidation.isEmpty()) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - validationDate = offsetDateTime.toLocalDate(); // Extract only the date part - } catch (DateTimeParseException e) { - System.out.println("Error parsing dateValidation: " + dateValidation); - validationDate = null; - } - } - - // Parse absence Date - LocalDate absenceDate; + // Parse validation date (handle null case) + LocalDate validationDate = null; + if (dateValidation != null && !dateValidation.isEmpty()) { try { - absenceDate = LocalDate.parse(date_absence); + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + validationDate = offsetDateTime.toLocalDate(); // Extract only the date part } catch (DateTimeParseException e) { - System.out.println("Error parsing date_absence: " + date_absence); - absenceDate = null; + System.out.println("Error parsing dateValidation: " + dateValidation); + validationDate = null; + } + } + + // Parse absence Date + LocalDate absenceDate; + try { + absenceDate = LocalDate.parse(date_absence); + } catch (DateTimeParseException e) { + System.out.println("Error parsing date_absence: " + date_absence); + absenceDate = null; + } + + // Check if Authorization exists by ticketId + Authorization authorization = + authorizationRepository + .all() + .filter("self.ticketId = :ticketId") + .bind("ticketId", idInt) + .fetchOne(); + + if (authorization != null) { + // Authorization exists, compare previous and new status + int previousStatus = authorization.getStatusSelect(); // Previous status + int newStatus = validation_status; // New status + + if (previousStatus == 2 && newStatus == 3) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + // Update the fields of the existing Authorization + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + + // Get Daily report + DailyReport dailyReport = + dailyReportRepo + .all() + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) + .fetchOne(); + + if (dailyReport != null) { + dailyReport.setIsAuthorizedAbsence(true); + } + + } else if (previousStatus == 2 && newStatus == 4) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + } + } else { + // Authorization does not exist, create a new one as per the validation_status logic + authorization = new Authorization(); + authorization.setEmployee(employee); + authorization.setTicketId(idInt); + authorization.setTicket(ticketLink); + authorization.setRequisitionDate(absenceDate); + authorization.setDescription(commentaire); + authorization.setStatusSelect(validation_status); + authorization.setAuthorizationType(2); // Set default authorization type + + if (validation_status == 3) { + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + } else if (validation_status == 4) { + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); } - // Check if Authorization exists by ticketId - Authorization authorization = - authorizationRepository + // Get Daily report + DailyReport dailyReport = + dailyReportRepo .all() - .filter("self.ticketId = :ticketId") - .bind("ticketId", idInt) + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) .fetchOne(); - if (authorization != null) { - // Authorization exists, compare previous and new status - int previousStatus = authorization.getStatusSelect(); // Previous status - int newStatus = validation_status; // New status - - if (previousStatus == 2 && newStatus == 3) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - // Update the fields of the existing Authorization - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - - // Get Daily report - DailyReport dailyReport = - dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - dailyReport.setIsAuthorizedAbsence(true); - } - - } else if (previousStatus == 2 && newStatus == 4) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - } - } else { - // Authorization does not exist, create a new one as per the validation_status logic - authorization = new Authorization(); - authorization.setEmployee(employee); - authorization.setTicketId(idInt); - authorization.setTicket(ticketLink); - authorization.setRequisitionDate(absenceDate); - authorization.setDescription(commentaire); - authorization.setStatusSelect(validation_status); - authorization.setAuthorizationType(2); // Set default authorization type - - if (validation_status == 3) { - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - } else if (validation_status == 4) { - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - } - - // Get Daily report - DailyReport dailyReport = dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - authorization.setDailyReport(dailyReport); - if(validation_status == 3) - dailyReport.setIsAuthorizedAbsence(true); - } - // Save the new Authorization - authorizationRepository.save(authorization); + if (dailyReport != null) { + authorization.setDailyReport(dailyReport); + if (validation_status == 3) dailyReport.setIsAuthorizedAbsence(true); } + // Save the new Authorization + authorizationRepository.save(authorization); + } } catch (JSONException e) { System.err.println("Failed to parse JSON: " + jsonObject.toString()); @@ -190,142 +192,147 @@ public class AuthorizationServiceImpl implements AuthorizationService { public void saveAE(JSONObject jsonObject) throws AxelorException { try { - // Extract fields - int idInt = jsonObject.getInt("id"); - String id = Integer.toString(idInt); - String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; - String matricule = jsonObject.getString("matricule"); - String date_absence = jsonObject.getString("date_reprise"); - String commentaire = jsonObject.getString("commentaire"); - int validation_status = jsonObject.optInt("validation_status",2); - String validateByUser = jsonObject.optString("validate_by_user",null); - String dateValidation = jsonObject.optString("validation_date", null); + // Extract fields + int idInt = jsonObject.getInt("id"); + String id = Integer.toString(idInt); + String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; + String matricule = jsonObject.getString("matricule"); + String date_absence = jsonObject.getString("date_reprise"); + String commentaire = jsonObject.getString("commentaire"); + int validation_status = jsonObject.optInt("validation_status", 2); + String validateByUser = jsonObject.optString("validate_by_user", null); + String dateValidation = jsonObject.optString("validation_date", null); - // GET EMPLOYEES - Employee employee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", matricule) - .fetchOne(); + // GET EMPLOYEES + Employee employee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", matricule) + .fetchOne(); - if (employee == null) { - System.err.println("Employee with matricule " + matricule + " not found."); - return; - } + if (employee == null) { + System.err.println("Employee with matricule " + matricule + " not found."); + return; + } - Employee validatedByEmployee = null; + Employee validatedByEmployee = null; - if(validateByUser != null){ - validatedByEmployee = employeeRepo + if (validateByUser != null) { + validatedByEmployee = + employeeRepo .all() .filter("self.registrationNumber = :matricule") .bind("matricule", validateByUser) .fetchOne(); - if (validatedByEmployee == null) { - System.err.println("Validator employee with matricule " + validateByUser + " not found."); - return; - } + if (validatedByEmployee == null) { + System.err.println("Validator employee with matricule " + validateByUser + " not found."); + return; } + } - // Parse validation date (handle null case) - LocalDate validationDate = null; - if (dateValidation != null && !dateValidation.isEmpty()) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - validationDate = offsetDateTime.toLocalDate(); // Extract only the date part - } catch (DateTimeParseException e) { - System.out.println("Error parsing dateValidation: " + dateValidation); - validationDate = null; - } - } - - // Parse Requisition Date - LocalDate absenceDate; + // Parse validation date (handle null case) + LocalDate validationDate = null; + if (dateValidation != null && !dateValidation.isEmpty()) { try { - absenceDate = LocalDate.parse(date_absence); + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + validationDate = offsetDateTime.toLocalDate(); // Extract only the date part } catch (DateTimeParseException e) { - System.out.println("Error parsing date_absence: " + date_absence); - absenceDate = null; + System.out.println("Error parsing dateValidation: " + dateValidation); + validationDate = null; } - - // Check if Authorization exists by ticketId - Authorization authorization = - authorizationRepository + } + + // Parse Requisition Date + LocalDate absenceDate; + try { + absenceDate = LocalDate.parse(date_absence); + } catch (DateTimeParseException e) { + System.out.println("Error parsing date_absence: " + date_absence); + absenceDate = null; + } + + // Check if Authorization exists by ticketId + Authorization authorization = + authorizationRepository + .all() + .filter("self.ticketId = :ticketId") + .bind("ticketId", idInt) + .fetchOne(); + + if (authorization != null) { + // Authorization exists, compare previous and new status + int previousStatus = authorization.getStatusSelect(); // Previous status + int newStatus = validation_status; // New status + + if (previousStatus == 2 && newStatus == 3) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + // Update the fields of the existing Authorization + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + + // Get Daily report + DailyReport dailyReport = + dailyReportRepo + .all() + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) + .fetchOne(); + + if (dailyReport != null) { + dailyReport.setIsAuthorizedLateArrival(true); + } + } else if (previousStatus == 2 && newStatus == 4) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + } + } else { + // Authorization does not exist, create a new one as per the validation_status logic + authorization = new Authorization(); + authorization.setEmployee(employee); + authorization.setTicketId(idInt); + authorization.setTicket(ticketLink); + authorization.setRequisitionDate(absenceDate); + authorization.setDescription(commentaire); + authorization.setStatusSelect(validation_status); + authorization.setAuthorizationType(1); // Set default authorization type + + if (validation_status == 3) { + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + } else if (validation_status == 4) { + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); + } + + // Get Daily report + DailyReport dailyReport = + dailyReportRepo .all() - .filter("self.ticketId = :ticketId") - .bind("ticketId", idInt) + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) .fetchOne(); - if (authorization != null) { - // Authorization exists, compare previous and new status - int previousStatus = authorization.getStatusSelect(); // Previous status - int newStatus = validation_status; // New status - - if (previousStatus == 2 && newStatus == 3) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - // Update the fields of the existing Authorization - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - - // Get Daily report - DailyReport dailyReport = - dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - dailyReport.setIsAuthorizedLateArrival(true); - } - } else if (previousStatus == 2 && newStatus == 4) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - } - } else { - // Authorization does not exist, create a new one as per the validation_status logic - authorization = new Authorization(); - authorization.setEmployee(employee); - authorization.setTicketId(idInt); - authorization.setTicket(ticketLink); - authorization.setRequisitionDate(absenceDate); - authorization.setDescription(commentaire); - authorization.setStatusSelect(validation_status); - authorization.setAuthorizationType(1); // Set default authorization type - - if (validation_status == 3) { - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - } else if (validation_status == 4) { - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - } - - // Get Daily report - DailyReport dailyReport = dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - authorization.setDailyReport(dailyReport); - if(validation_status == 3) - dailyReport.setIsAuthorizedLateArrival(true); - } - // Save the new Authorization - authorizationRepository.save(authorization); + if (dailyReport != null) { + authorization.setDailyReport(dailyReport); + if (validation_status == 3) dailyReport.setIsAuthorizedLateArrival(true); } + // Save the new Authorization + authorizationRepository.save(authorization); + } } catch (JSONException e) { System.err.println("Failed to parse JSON: " + jsonObject.toString()); @@ -339,144 +346,150 @@ public class AuthorizationServiceImpl implements AuthorizationService { public void saveBS(JSONObject jsonObject) throws AxelorException { try { - // Extract fields - int idInt = jsonObject.getInt("id"); - String id = Integer.toString(idInt); - String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; - String matricule = jsonObject.getString("matricule"); - String date_absence = jsonObject.getString("date_sortie"); - String commentaire = jsonObject.getString("motif"); - String heure_sortie = jsonObject.getString("heure_sortie"); - int validation_status = jsonObject.optInt("validation_status",2); - String validateByUser = jsonObject.optString("validate_by_user",null); - String dateValidation = jsonObject.optString("validation_date",null); + // Extract fields + int idInt = jsonObject.getInt("id"); + String id = Integer.toString(idInt); + String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; + String matricule = jsonObject.getString("matricule"); + String date_absence = jsonObject.getString("date_sortie"); + String commentaire = jsonObject.getString("motif"); + String heure_sortie = jsonObject.getString("heure_sortie"); + int validation_status = jsonObject.optInt("validation_status", 2); + String validateByUser = jsonObject.optString("validate_by_user", null); + String dateValidation = jsonObject.optString("validation_date", null); - // GET EMPLOYEES - Employee employee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", matricule) - .fetchOne(); + // GET EMPLOYEES + Employee employee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", matricule) + .fetchOne(); - if (employee == null) { - System.err.println("Employee with matricule " + matricule + " not found."); - return; - } + if (employee == null) { + System.err.println("Employee with matricule " + matricule + " not found."); + return; + } - Employee validatedByEmployee = null; + Employee validatedByEmployee = null; - if(validateByUser != null){ - validatedByEmployee = employeeRepo + if (validateByUser != null) { + validatedByEmployee = + employeeRepo .all() .filter("self.registrationNumber = :matricule") .bind("matricule", validateByUser) .fetchOne(); - if (validatedByEmployee == null) { - System.err.println("Validator employee with matricule " + validateByUser + " not found."); - return; - } + if (validatedByEmployee == null) { + System.err.println("Validator employee with matricule " + validateByUser + " not found."); + return; } + } - // Parse validation date (handle null case) - LocalDate validationDate = null; - if (dateValidation != null && !dateValidation.isEmpty()) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - validationDate = offsetDateTime.toLocalDate(); // Extract only the date part - } catch (DateTimeParseException e) { - System.out.println("Error parsing dateValidation: " + dateValidation); - validationDate = null; - } - } - - // Parse Requisition Date - LocalDate absenceDate; + // Parse validation date (handle null case) + LocalDate validationDate = null; + if (dateValidation != null && !dateValidation.isEmpty()) { try { - absenceDate = LocalDate.parse(date_absence); + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + validationDate = offsetDateTime.toLocalDate(); // Extract only the date part } catch (DateTimeParseException e) { - System.out.println("Error parsing date_absence: " + date_absence); - absenceDate = null; + System.out.println("Error parsing dateValidation: " + dateValidation); + validationDate = null; + } + } + + // Parse Requisition Date + LocalDate absenceDate; + try { + absenceDate = LocalDate.parse(date_absence); + } catch (DateTimeParseException e) { + System.out.println("Error parsing date_absence: " + date_absence); + absenceDate = null; + } + + // Check if Authorization exists by ticketId + Authorization authorization = + authorizationRepository + .all() + .filter("self.ticketId = :ticketId") + .bind("ticketId", idInt) + .fetchOne(); + + if (authorization != null) { + // Authorization exists, compare previous and new status + int previousStatus = authorization.getStatusSelect(); // Previous status + int newStatus = validation_status; // New status + + if (previousStatus == 2 && newStatus == 3) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + // Update the fields of the existing Authorization + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + + // Get Daily report + DailyReport dailyReport = + dailyReportRepo + .all() + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) + .fetchOne(); + + if (dailyReport != null) { + dailyReport.setIsAuthorizedEarlyDeparture(true); + } + + } else if (previousStatus == 2 && newStatus == 4) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + } + } else { + String updatedDescription = commentaire + " - " + heure_sortie; + // Create an instance of Authorization + authorization = new Authorization(); + authorization.setEmployee(employee); + authorization.setTicketId(idInt); + authorization.setTicket(ticketLink); + authorization.setRequisitionDate(absenceDate); + authorization.setDescription(updatedDescription); + authorization.setStatusSelect(validation_status); + authorization.setAuthorizationType(0); + + if (validation_status == 3) { + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + } else if (validation_status == 4) { + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); } - // Check if Authorization exists by ticketId - Authorization authorization = authorizationRepository + // Get Daily report + DailyReport dailyReport = + dailyReportRepo .all() - .filter("self.ticketId = :ticketId") - .bind("ticketId", idInt) + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) .fetchOne(); - if (authorization != null) { - // Authorization exists, compare previous and new status - int previousStatus = authorization.getStatusSelect(); // Previous status - int newStatus = validation_status; // New status - - if (previousStatus == 2 && newStatus == 3) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - // Update the fields of the existing Authorization - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - - // Get Daily report - DailyReport dailyReport = - dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - dailyReport.setIsAuthorizedEarlyDeparture(true); - } - - } else if (previousStatus == 2 && newStatus == 4) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - } - } else { - String updatedDescription = commentaire + " - " + heure_sortie; - // Create an instance of Authorization - authorization = new Authorization(); - authorization.setEmployee(employee); - authorization.setTicketId(idInt); - authorization.setTicket(ticketLink); - authorization.setRequisitionDate(absenceDate); - authorization.setDescription(updatedDescription); - authorization.setStatusSelect(validation_status); - authorization.setAuthorizationType(0); - - if (validation_status == 3) { - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - } else if (validation_status == 4) { - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - } - - // Get Daily report - DailyReport dailyReport = dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - authorization.setDailyReport(dailyReport); - if(validation_status == 3) - dailyReport.setIsAuthorizedEarlyDeparture(true); - } - // Save the new Authorization - authorizationRepository.save(authorization); + if (dailyReport != null) { + authorization.setDailyReport(dailyReport); + if (validation_status == 3) dailyReport.setIsAuthorizedEarlyDeparture(true); } + // Save the new Authorization + authorizationRepository.save(authorization); + } } catch (JSONException e) { System.err.println("Failed to parse JSON: " + jsonObject.toString()); e.printStackTrace(); @@ -489,144 +502,150 @@ public class AuthorizationServiceImpl implements AuthorizationService { public void saveAP(JSONObject jsonObject) throws AxelorException { try { - // Extract fields - int idInt = jsonObject.getInt("id"); - String id = Integer.toString(idInt); - String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; - String matricule = jsonObject.getString("matricule"); - String date_absence = jsonObject.getString("date_sortie"); - String commentaire = jsonObject.getString("motif"); - String heure_sortie = jsonObject.getString("heure_sortie"); - int validation_status = jsonObject.optInt("validation_status",2); - String validateByUser = jsonObject.optString("validate_by_user",null); - String dateValidation = jsonObject.optString("validation_date",null); + // Extract fields + int idInt = jsonObject.getInt("id"); + String id = Integer.toString(idInt); + String ticketLink = "https://dsi.sophal.dz/front/ticket.form.php?id=" + id; + String matricule = jsonObject.getString("matricule"); + String date_absence = jsonObject.getString("date_sortie"); + String commentaire = jsonObject.getString("motif"); + String heure_sortie = jsonObject.getString("heure_sortie"); + int validation_status = jsonObject.optInt("validation_status", 2); + String validateByUser = jsonObject.optString("validate_by_user", null); + String dateValidation = jsonObject.optString("validation_date", null); - // GET EMPLOYEES - Employee employee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", matricule) - .fetchOne(); + // GET EMPLOYEES + Employee employee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", matricule) + .fetchOne(); - if (employee == null) { - System.err.println("Employee with matricule " + matricule + " not found."); - return; - } + if (employee == null) { + System.err.println("Employee with matricule " + matricule + " not found."); + return; + } - Employee validatedByEmployee = null; + Employee validatedByEmployee = null; - if(validateByUser != null){ - validatedByEmployee = employeeRepo + if (validateByUser != null) { + validatedByEmployee = + employeeRepo .all() .filter("self.registrationNumber = :matricule") .bind("matricule", validateByUser) .fetchOne(); - if (validatedByEmployee == null) { - System.err.println("Validator employee with matricule " + validateByUser + " not found."); - return; - } + if (validatedByEmployee == null) { + System.err.println("Validator employee with matricule " + validateByUser + " not found."); + return; } + } - // Parse validation date (handle null case) - LocalDate validationDate = null; - if (dateValidation != null && !dateValidation.isEmpty()) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - validationDate = offsetDateTime.toLocalDate(); // Extract only the date part - } catch (DateTimeParseException e) { - System.out.println("Error parsing dateValidation: " + dateValidation); - validationDate = null; - } - } - - // Parse Requisition Date - LocalDate absenceDate; + // Parse validation date (handle null case) + LocalDate validationDate = null; + if (dateValidation != null && !dateValidation.isEmpty()) { try { - absenceDate = LocalDate.parse(date_absence); + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + validationDate = offsetDateTime.toLocalDate(); // Extract only the date part } catch (DateTimeParseException e) { - System.out.println("Error parsing date_absence: " + date_absence); - absenceDate = null; + System.out.println("Error parsing dateValidation: " + dateValidation); + validationDate = null; + } + } + + // Parse Requisition Date + LocalDate absenceDate; + try { + absenceDate = LocalDate.parse(date_absence); + } catch (DateTimeParseException e) { + System.out.println("Error parsing date_absence: " + date_absence); + absenceDate = null; + } + + // Check if Authorization exists by ticketId + Authorization authorization = + authorizationRepository + .all() + .filter("self.ticketId = :ticketId") + .bind("ticketId", idInt) + .fetchOne(); + + if (authorization != null) { + // Authorization exists, compare previous and new status + int previousStatus = authorization.getStatusSelect(); // Previous status + int newStatus = validation_status; // New status + + if (previousStatus == 2 && newStatus == 3) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + // Update the fields of the existing Authorization + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + + // Get Daily report + DailyReport dailyReport = + dailyReportRepo + .all() + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) + .fetchOne(); + + if (dailyReport != null) { + dailyReport.setIsAuthorizedAbsence(true); + } + + } else if (previousStatus == 2 && newStatus == 4) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); + authorization.setStatusSelect(newStatus); + // Save the updated Authorization + authorizationRepository.save(authorization); + } + } else { + String updatedDescription = commentaire + " - " + heure_sortie; + // Create an instance of Authorization + authorization = new Authorization(); + authorization.setEmployee(employee); + authorization.setTicketId(idInt); + authorization.setTicket(ticketLink); + authorization.setRequisitionDate(absenceDate); + authorization.setDescription(updatedDescription); + authorization.setStatusSelect(validation_status); + authorization.setAuthorizationType(0); + + if (validation_status == 3) { + authorization.setValidatedByEmployee(validatedByEmployee); + authorization.setValidationDate(validationDate); + } else if (validation_status == 4) { + authorization.setRefusedByEmployee(validatedByEmployee); + authorization.setRefusalDate(validationDate); } - // Check if Authorization exists by ticketId - Authorization authorization = authorizationRepository + // Get Daily report + DailyReport dailyReport = + dailyReportRepo .all() - .filter("self.ticketId = :ticketId") - .bind("ticketId", idInt) + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", absenceDate) .fetchOne(); - if (authorization != null) { - // Authorization exists, compare previous and new status - int previousStatus = authorization.getStatusSelect(); // Previous status - int newStatus = validation_status; // New status - - if (previousStatus == 2 && newStatus == 3) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - // Update the fields of the existing Authorization - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - - // Get Daily report - DailyReport dailyReport = - dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - dailyReport.setIsAuthorizedAbsence(true); - } - - } else if (previousStatus == 2 && newStatus == 4) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - authorization.setStatusSelect(newStatus); - // Save the updated Authorization - authorizationRepository.save(authorization); - } - } else { - String updatedDescription = commentaire + " - " + heure_sortie; - // Create an instance of Authorization - authorization = new Authorization(); - authorization.setEmployee(employee); - authorization.setTicketId(idInt); - authorization.setTicket(ticketLink); - authorization.setRequisitionDate(absenceDate); - authorization.setDescription(updatedDescription); - authorization.setStatusSelect(validation_status); - authorization.setAuthorizationType(0); - - if (validation_status == 3) { - authorization.setValidatedByEmployee(validatedByEmployee); - authorization.setValidationDate(validationDate); - } else if (validation_status == 4) { - authorization.setRefusedByEmployee(validatedByEmployee); - authorization.setRefusalDate(validationDate); - } - - // Get Daily report - DailyReport dailyReport = dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", absenceDate) - .fetchOne(); - - if (dailyReport != null) { - authorization.setDailyReport(dailyReport); - if(validation_status == 3) - dailyReport.setIsAuthorizedAbsence(true); - } - // Save the new Authorization - authorizationRepository.save(authorization); + if (dailyReport != null) { + authorization.setDailyReport(dailyReport); + if (validation_status == 3) dailyReport.setIsAuthorizedAbsence(true); } + // Save the new Authorization + authorizationRepository.save(authorization); + } } catch (JSONException e) { System.err.println("Failed to parse JSON: " + jsonObject.toString()); e.printStackTrace(); @@ -637,12 +656,13 @@ public class AuthorizationServiceImpl implements AuthorizationService { // Helper function to parse dates private LocalDate parseDate(String dateString) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateString, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + try { + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateString, DateTimeFormatter.ISO_OFFSET_DATE_TIME); return offsetDateTime.toLocalDate(); - } catch (DateTimeParseException e) { + } catch (DateTimeParseException e) { System.out.println("Error parsing date: " + dateString); return null; + } } } -} diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/DailyReportServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/DailyReportServiceImpl.java index 90f85a3..724fbda 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/DailyReportServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/DailyReportServiceImpl.java @@ -2,23 +2,22 @@ package com.axelor.apps.hr.service; import com.axelor.apps.base.db.EventsPlanning; import com.axelor.apps.base.db.EventsPlanningLine; -import com.axelor.apps.base.db.repo.EventsPlanningRepository; import com.axelor.apps.base.db.repo.EventsPlanningLineRepository; import com.axelor.apps.hr.db.Absence; +import com.axelor.apps.hr.db.Authorization; +import com.axelor.apps.hr.db.DailyReport; import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.OffDayWork; -import com.axelor.apps.hr.db.DailyReport; import com.axelor.apps.hr.db.Shift; -import com.axelor.apps.hr.db.Authorization; import com.axelor.apps.hr.db.repo.AbsenceRepository; import com.axelor.apps.hr.db.repo.AuthorizationRepository; -import com.axelor.apps.hr.db.repo.OffDayWorkRepository; import com.axelor.apps.hr.db.repo.DailyReportRepository; +import com.axelor.apps.hr.db.repo.OffDayWorkRepository; import com.axelor.apps.hr.db.repo.ShiftRepository; -import com.axelor.apps.hr.service.AbsenceServiceImpl; -import com.axelor.inject.Beans; -import com.google.inject.persist.Transactional; import com.axelor.exception.AxelorException; +import com.axelor.inject.Beans; +import com.google.inject.Inject; +import com.google.inject.persist.Transactional; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.DayOfWeek; @@ -26,10 +25,8 @@ import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; -import java.time.Year; -import java.util.List; import java.util.ArrayList; -import com.google.inject.Inject; +import java.util.List; public class DailyReportServiceImpl implements DailyReportService { @@ -52,23 +49,35 @@ public class DailyReportServiceImpl implements DailyReportService { private LocalTime SHIFT_6h14_max; @Inject - public DailyReportServiceImpl(DailyReportRepository dailyReportRepository, AuthorizationRepository autorizationRepository, AbsenceRepository absenceRepository) { + public DailyReportServiceImpl( + DailyReportRepository dailyReportRepository, + AuthorizationRepository autorizationRepository, + AbsenceRepository absenceRepository) { this.dailyReportRepository = dailyReportRepository; this.autorizationRepository = autorizationRepository; this.absenceRepository = absenceRepository; - eventsPlanningLines = Beans.get(EventsPlanningLineRepository.class) - .all() - .filter("self.eventsPlanning = 4") - .fetch(); + eventsPlanningLines = + Beans.get(EventsPlanningLineRepository.class) + .all() + .filter("self.eventsPlanning = 4") + .fetch(); - SHIFT_8h16_min = Beans.get(ShiftRepository.class).all().filter("self.shift = 0").fetchOne().getEnterMin(); - SHIFT_8h16_max = Beans.get(ShiftRepository.class).all().filter("self.shift = 0").fetchOne().getEnterMax(); - SHIFT_14h22_min = Beans.get(ShiftRepository.class).all().filter("self.shift = 1").fetchOne().getEnterMin(); - SHIFT_14h22_max = Beans.get(ShiftRepository.class).all().filter("self.shift = 1").fetchOne().getEnterMax(); - SHIFT_22h6_min = Beans.get(ShiftRepository.class).all().filter("self.shift = 2").fetchOne().getEnterMin(); - SHIFT_22h6_max = Beans.get(ShiftRepository.class).all().filter("self.shift = 2").fetchOne().getEnterMax(); - SHIFT_6h14_min = Beans.get(ShiftRepository.class).all().filter("self.shift = 3").fetchOne().getEnterMin(); - SHIFT_6h14_max = Beans.get(ShiftRepository.class).all().filter("self.shift = 3").fetchOne().getEnterMax(); + SHIFT_8h16_min = + Beans.get(ShiftRepository.class).all().filter("self.shift = 0").fetchOne().getEnterMin(); + SHIFT_8h16_max = + Beans.get(ShiftRepository.class).all().filter("self.shift = 0").fetchOne().getEnterMax(); + SHIFT_14h22_min = + Beans.get(ShiftRepository.class).all().filter("self.shift = 1").fetchOne().getEnterMin(); + SHIFT_14h22_max = + Beans.get(ShiftRepository.class).all().filter("self.shift = 1").fetchOne().getEnterMax(); + SHIFT_22h6_min = + Beans.get(ShiftRepository.class).all().filter("self.shift = 2").fetchOne().getEnterMin(); + SHIFT_22h6_max = + Beans.get(ShiftRepository.class).all().filter("self.shift = 2").fetchOne().getEnterMax(); + SHIFT_6h14_min = + Beans.get(ShiftRepository.class).all().filter("self.shift = 3").fetchOne().getEnterMin(); + SHIFT_6h14_max = + Beans.get(ShiftRepository.class).all().filter("self.shift = 3").fetchOne().getEnterMax(); } @Override @@ -90,14 +99,17 @@ public class DailyReportServiceImpl implements DailyReportService { LocalDateTime firstEnter, lastQuit; - LocalTime shiftStartHour = null, shiftEndHour = null, shiftStartPauseHour = null, shiftEndPauseHour = null; - if(shift != null){ + LocalTime shiftStartHour = null, + shiftEndHour = null, + shiftStartPauseHour = null, + shiftEndPauseHour = null; + if (shift != null) { shiftStartHour = dailyReport.getShift().getStartHour(); shiftEndHour = dailyReport.getShift().getEndHour(); shiftStartPauseHour = dailyReport.getShift().getStartPause(); shiftEndPauseHour = dailyReport.getShift().getEndPause(); } - + if (enters[0] != null && quits[0] != null) { // Calculate total work duration Duration totalDuration = Duration.ZERO; @@ -117,45 +129,54 @@ public class DailyReportServiceImpl implements DailyReportService { dailyReport.setLastQuit(lastQuit); LocalTime firstEnterTime = firstEnter.toLocalTime(); LocalTime lastQuitTime = lastQuit.toLocalTime(); - + // Calculate late arrival if firstEnter is later than shift start - if(shiftStartHour != null){ + if (shiftStartHour != null) { if (firstEnterTime.isAfter(shiftStartHour)) { long minutesLate = Duration.between(shiftStartHour, firstEnterTime).toMinutes(); - BigDecimal lateArrival = BigDecimal.valueOf(minutesLate).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal lateArrival = + BigDecimal.valueOf(minutesLate) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setLateArrival(lateArrival); } } - + // Calculate early departure if lastQuit is earlier than shift end - if(shiftEndHour != null){ + if (shiftEndHour != null) { if (lastQuitTime.isBefore(shiftEndHour)) { long minutesEarly = Duration.between(lastQuitTime, shiftEndHour).toMinutes(); - BigDecimal earlyDeparture = BigDecimal.valueOf(minutesEarly).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal earlyDeparture = + BigDecimal.valueOf(minutesEarly) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setEarlyDeparture(earlyDeparture); } } - + // Total hours totalDuration = totalDuration.plus(Duration.between(firstEnter, lastQuit)); long totalMinutes = totalDuration.toMinutes(); - BigDecimal totalHours = BigDecimal.valueOf(totalMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal totalHours = + BigDecimal.valueOf(totalMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setWorkHours(totalHours); // Calculate night hours nightDuration = calculateNightDuration(firstEnter, lastQuit); long totalNightMinutes = nightDuration.toMinutes(); - BigDecimal totalNightHours = BigDecimal.valueOf(totalNightMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal totalNightHours = + BigDecimal.valueOf(totalNightMinutes) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setNightHours(totalNightHours); // Break Hours breakDuration = calculateBreakDuration(enters, quits); long breakMinutes = breakDuration.toMinutes(); - BigDecimal breakHours = BigDecimal.valueOf(breakMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal breakHours = + BigDecimal.valueOf(breakMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setBreakHours(breakHours); - if(shiftStartPauseHour != null && shiftEndPauseHour != null){ - boolean allInAllowedRange = areBreaksInAllowedRange(enters, quits, shiftStartPauseHour, shiftEndPauseHour); + if (shiftStartPauseHour != null && shiftEndPauseHour != null) { + boolean allInAllowedRange = + areBreaksInAllowedRange(enters, quits, shiftStartPauseHour, shiftEndPauseHour); dailyReport.setBreakNotInTheAllowedRange(allInAllowedRange); } @@ -172,14 +193,19 @@ public class DailyReportServiceImpl implements DailyReportService { // Calculate time from first enter to midnight Duration beforeMidnightDuration = Duration.between(firstEnter, midnight); long beforeMidnightMinutes = beforeMidnightDuration.toMinutes(); - BigDecimal beforeMidnightHours = BigDecimal.valueOf(beforeMidnightMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal beforeMidnightHours = + BigDecimal.valueOf(beforeMidnightMinutes) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); // Calculate time from midnight to last quit Duration afterMidnightDuration = Duration.between(midnight, lastQuit); long afterMidnightMinutes = afterMidnightDuration.toMinutes(); - BigDecimal afterMidnightHours = BigDecimal.valueOf(afterMidnightMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal afterMidnightHours = + BigDecimal.valueOf(afterMidnightMinutes) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); - if (enterDay == DayOfWeek.THURSDAY && quitDay == DayOfWeek.FRIDAY || isSpecialOvertimeDay(lastQuit)) { + if (enterDay == DayOfWeek.THURSDAY && quitDay == DayOfWeek.FRIDAY + || isSpecialOvertimeDay(lastQuit)) { extraHours100 = afterMidnightHours; dailyReport.setAllowance(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); if (enterDay == DayOfWeek.THURSDAY && quitDay == DayOfWeek.FRIDAY) @@ -205,9 +231,11 @@ public class DailyReportServiceImpl implements DailyReportService { extraHours50 = beforeMidnightHours; dailyReport.setAllowanceRecall(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); } else { - totalSupDuration = calculateSupplementaryHours(firstEnter,lastQuit,shift,reportDate); + totalSupDuration = calculateSupplementaryHours(firstEnter, lastQuit, shift, reportDate); long totalSupMinutes = totalSupDuration.toMinutes(); - extraHours50 = BigDecimal.valueOf(totalSupMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + extraHours50 = + BigDecimal.valueOf(totalSupMinutes) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setAllowance(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); } @@ -219,21 +247,26 @@ public class DailyReportServiceImpl implements DailyReportService { // Calculate supplementary hours totalSupDuration = calculateSupplementaryHours(firstEnter, lastQuit, shift, reportDate); long totalSupMinutes = totalSupDuration.toMinutes(); - BigDecimal totalSupHours = BigDecimal.valueOf(totalSupMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal totalSupHours = + BigDecimal.valueOf(totalSupMinutes) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); // Holidays and weekends if (firstEnter.getDayOfWeek() == DayOfWeek.SATURDAY) { - - if(shift == 0 || shift == 3){ + + if (shift == 0 || shift == 3) { dailyReport.setExtraHours50(totalHours.subtract(totalNightHours)); dailyReport.setExtraHours100(totalNightHours); - dailyReport.setAllowanceRecall(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); + dailyReport.setAllowanceRecall( + totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); } else { dailyReport.setExtraHours50(totalHours); - dailyReport.setAllowanceRecall(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); + dailyReport.setAllowanceRecall( + totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); } - } else if (firstEnter.getDayOfWeek() == DayOfWeek.FRIDAY || isSpecialOvertimeDay(firstEnter)) { + } else if (firstEnter.getDayOfWeek() == DayOfWeek.FRIDAY + || isSpecialOvertimeDay(firstEnter)) { // Add recup if (totalHours.compareTo(BigDecimal.valueOf(6)) >= 0) @@ -243,26 +276,28 @@ public class DailyReportServiceImpl implements DailyReportService { } else { - if(shift == 0 || shift == 3){ + if (shift == 0 || shift == 3) { dailyReport.setExtraHours50(totalSupHours.subtract(totalNightHours)); dailyReport.setExtraHours100(totalNightHours); dailyReport.setAllowance(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); - dailyReport.setAllowanceRecall(totalSupHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); + dailyReport.setAllowanceRecall( + totalSupHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); } else { dailyReport.setExtraHours50(totalSupHours); dailyReport.setAllowance(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); - dailyReport.setAllowanceRecall(totalSupHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); - } + dailyReport.setAllowanceRecall( + totalSupHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); + } } } // Calculate ITP - dailyReport.setItp(calculateItp(totalHours, shift,dailyReport.getHasItp())); + dailyReport.setItp(calculateItp(totalHours, shift, dailyReport.getHasItp())); dailyReport.setIsCalculated(true); } else if (enters[0] != null && quits[0] == null) { // When the employee registers attendance only once - if(shift!=2){ + if (shift != 2) { dailyReport.setWorkHours(BigDecimal.valueOf(8)); dailyReport.setAbsenceHours(BigDecimal.valueOf(0)); dailyReport.setIsCalculated(true); @@ -274,7 +309,8 @@ public class DailyReportServiceImpl implements DailyReportService { lastQuit = quits[quits.length - 1]; totalDuration = totalDuration.plus(Duration.between(firstEnter, lastQuit)); long totalMinutes = totalDuration.toMinutes(); - BigDecimal totalHours = BigDecimal.valueOf(totalMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + BigDecimal totalHours = + BigDecimal.valueOf(totalMinutes).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); dailyReport.setWorkHours(totalHours); dailyReport.setAllowance(totalHours.compareTo(BigDecimal.valueOf(5)) >= 0 ? 1 : 0); @@ -283,16 +319,19 @@ public class DailyReportServiceImpl implements DailyReportService { LocalTime lastQuitTime = lastQuit.toLocalTime(); // Calculate late arrival if firstEnter is later than shift start if (firstEnterTime.isAfter(shiftStartHour)) { - long minutesLate = Duration.between(shiftStartHour, firstEnterTime).toMinutes(); - BigDecimal lateArrival = BigDecimal.valueOf(minutesLate).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); - dailyReport.setLateArrival(lateArrival); + long minutesLate = Duration.between(shiftStartHour, firstEnterTime).toMinutes(); + BigDecimal lateArrival = + BigDecimal.valueOf(minutesLate).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + dailyReport.setLateArrival(lateArrival); } - + // Calculate early departure if lastQuit is earlier than shift end if (lastQuitTime.isBefore(shiftEndHour)) { - long minutesEarly = Duration.between(lastQuitTime, shiftEndHour).toMinutes(); - BigDecimal earlyDeparture = BigDecimal.valueOf(minutesEarly).divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); - dailyReport.setEarlyDeparture(earlyDeparture); + long minutesEarly = Duration.between(lastQuitTime, shiftEndHour).toMinutes(); + BigDecimal earlyDeparture = + BigDecimal.valueOf(minutesEarly) + .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); + dailyReport.setEarlyDeparture(earlyDeparture); } } else if (employee == null) { @@ -317,11 +356,15 @@ public class DailyReportServiceImpl implements DailyReportService { // Absences if (dailyReport.getAbsence() == null) { - Absence absence = Beans.get(AbsenceRepository.class) + Absence absence = + Beans.get(AbsenceRepository.class) .all() - .filter("self.employee = :employee and self.startDate <= :reportDate and self.endDate >= :reportDate and (self.archived = false or self.archived is null)") + .filter( + "self.employee = :employee and self.startDate <= :reportDate and self.endDate >= :reportDate and (self.archived = false or self.archived is null)") .bind("employee", employee) - .bind("reportDate",reportDate) // Changed from absenceStartDate and absenceEndDate to reportDate + .bind( + "reportDate", + reportDate) // Changed from absenceStartDate and absenceEndDate to reportDate .fetchOne(); if (absence != null) { @@ -331,33 +374,35 @@ public class DailyReportServiceImpl implements DailyReportService { // Authorization if (dailyReport.getAuthorizationList() == null) { - List authorizations = Beans.get(AuthorizationRepository.class) - .all() - .filter("self.employee = :employee and self.requisitionDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", reportDate) - .fetch(); + List authorizations = + Beans.get(AuthorizationRepository.class) + .all() + .filter("self.employee = :employee and self.requisitionDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", reportDate) + .fetch(); if (authorizations != null) { - List authorizationList = new ArrayList<>(); // Create a new list for authorizations + List authorizationList = + new ArrayList<>(); // Create a new list for authorizations - for (Authorization authorization : authorizations) { - authorization.setDailyReport(dailyReport); - authorizationList.add(authorization); // Add each authorization to the list + for (Authorization authorization : authorizations) { + authorization.setDailyReport(dailyReport); + authorizationList.add(authorization); // Add each authorization to the list - // Check authorization type and set corresponding flags in dailyReport - if (authorization.getAuthorizationType() == 0 && authorization.getStatusSelect() == 3) { - dailyReport.setIsAuthorizedEarlyDeparture(true); - } - if (authorization.getAuthorizationType() == 1 && authorization.getStatusSelect() == 3) { - dailyReport.setIsAuthorizedLateArrival(true); - } - if (authorization.getAuthorizationType() == 2 && authorization.getStatusSelect() == 3) { - dailyReport.setIsAuthorizedAbsence(true); - } + // Check authorization type and set corresponding flags in dailyReport + if (authorization.getAuthorizationType() == 0 && authorization.getStatusSelect() == 3) { + dailyReport.setIsAuthorizedEarlyDeparture(true); } - // Set the authorization list to dailyReport - dailyReport.setAuthorizationList(authorizationList); + if (authorization.getAuthorizationType() == 1 && authorization.getStatusSelect() == 3) { + dailyReport.setIsAuthorizedLateArrival(true); + } + if (authorization.getAuthorizationType() == 2 && authorization.getStatusSelect() == 3) { + dailyReport.setIsAuthorizedAbsence(true); + } + } + // Set the authorization list to dailyReport + dailyReport.setAuthorizationList(authorizationList); } } @@ -367,54 +412,68 @@ public class DailyReportServiceImpl implements DailyReportService { } // Weekends - if (reportDate.getDayOfWeek() == DayOfWeek.FRIDAY || reportDate.getDayOfWeek() == DayOfWeek.SATURDAY) { + if (reportDate.getDayOfWeek() == DayOfWeek.FRIDAY + || reportDate.getDayOfWeek() == DayOfWeek.SATURDAY) { dailyReport.setIsWeekend(true); } // Absence Hours - if (!(dailyReport.getIsWeekend() || dailyReport.getIsFerieDay()) && dailyReport.getWorkHours().compareTo(BigDecimal.valueOf(8)) < 0) { + if (!(dailyReport.getIsWeekend() || dailyReport.getIsFerieDay()) + && dailyReport.getWorkHours().compareTo(BigDecimal.valueOf(8)) < 0) { dailyReport.setAbsenceHours(BigDecimal.valueOf(8).subtract(dailyReport.getWorkHours())); // Create Absence AI - if(dailyReport.getAbsenceSet().isEmpty()){ + if (dailyReport.getAbsenceSet().isEmpty()) { Boolean isAuthorizedAbsence = dailyReport.getIsAuthorizedAbsence(); Boolean isAuthorizedLateArrival = dailyReport.getIsAuthorizedLateArrival(); Boolean isAuthorizedEarlyDeparture = dailyReport.getIsAuthorizedEarlyDeparture(); // AI all day - if(dailyReport.getAbsenceHours().compareTo(new BigDecimal("8")) == 0){ - if(!isAuthorizedAbsence){ + if (dailyReport.getAbsenceHours().compareTo(new BigDecimal("8")) == 0) { + if (!isAuthorizedAbsence) { Absence absence = new Absence(); absence.setEmployee(employee); absence.setAbsenceType(19); // Absence irrégulière absence.setStartDate(reportDate.atStartOfDay()); absence.setEndDate(reportDate.atStartOfDay()); - BigDecimal totalAbsenceHours = Beans.get(AbsenceServiceImpl.class).calculateTotalAbsenceHours(reportDate.atStartOfDay(),reportDate.atStartOfDay()); + BigDecimal totalAbsenceHours = + Beans.get(AbsenceServiceImpl.class) + .calculateTotalAbsenceHours( + reportDate.atStartOfDay(), reportDate.atStartOfDay()); absence.setTotalAbsenceHours(totalAbsenceHours); absenceRepository.save(absence); dailyReport.addAbsenceSetItem(absence); } - }else{ - if(dailyReport.getShift().getMaxTimeLateArrival() != null){ // to check that is different to shift N/A + } else { + if (dailyReport.getShift().getMaxTimeLateArrival() + != null) { // to check that is different to shift N/A LocalTime firstEnterTime = dailyReport.getEnter1().toLocalTime(); - if(firstEnterTime.isAfter(dailyReport.getShift().getMaxTimeLateArrival()) && !isAuthorizedLateArrival){ + if (firstEnterTime.isAfter(dailyReport.getShift().getMaxTimeLateArrival()) + && !isAuthorizedLateArrival) { Absence absence = new Absence(); absence.setEmployee(employee); absence.setAbsenceType(20); // Retard irrégulier absence.setStartDate(reportDate.atTime(shiftStartHour)); absence.setEndDate(dailyReport.getEnter1()); - BigDecimal totalAbsenceHours = Beans.get(AbsenceServiceImpl.class).calculateTotalAbsenceMinutes(reportDate.atTime(shiftStartHour),dailyReport.getEnter1()); + BigDecimal totalAbsenceHours = + Beans.get(AbsenceServiceImpl.class) + .calculateTotalAbsenceMinutes( + reportDate.atTime(shiftStartHour), dailyReport.getEnter1()); absence.setTotalAbsenceHours(totalAbsenceHours); absenceRepository.save(absence); dailyReport.addAbsenceSetItem(absence); } - if(dailyReport.getLastQuit() != null){ + if (dailyReport.getLastQuit() != null) { LocalTime lastQuitTime = dailyReport.getLastQuit().toLocalTime(); - if(lastQuitTime.isBefore(dailyReport.getShift().getMaxTimeEarlyDeparture()) && !isAuthorizedEarlyDeparture){ + if (lastQuitTime.isBefore(dailyReport.getShift().getMaxTimeEarlyDeparture()) + && !isAuthorizedEarlyDeparture) { Absence absence = new Absence(); absence.setEmployee(employee); absence.setAbsenceType(21); // Départ irrégulier absence.setStartDate(dailyReport.getLastQuit()); absence.setEndDate(reportDate.atTime(shiftEndHour)); - BigDecimal totalAbsenceHours = Beans.get(AbsenceServiceImpl.class).calculateTotalAbsenceMinutes(dailyReport.getLastQuit(),reportDate.atTime(shiftEndHour)); + BigDecimal totalAbsenceHours = + Beans.get(AbsenceServiceImpl.class) + .calculateTotalAbsenceMinutes( + dailyReport.getLastQuit(), reportDate.atTime(shiftEndHour)); absence.setTotalAbsenceHours(totalAbsenceHours); absenceRepository.save(absence); dailyReport.addAbsenceSetItem(absence); @@ -431,24 +490,24 @@ public class DailyReportServiceImpl implements DailyReportService { } @Transactional - public void determineShift(DailyReport dailyReport){ + public void determineShift(DailyReport dailyReport) { LocalDateTime enters1 = dailyReport.getEnter1(); - if(enters1 != null){ + if (enters1 != null) { // Extract time from enters1 LocalTime firstTime = enters1.toLocalTime(); - + // Define shifts Shift shift; if (firstTime.isAfter(SHIFT_6h14_min) && firstTime.isBefore(SHIFT_6h14_max)) { - shift = Beans.get(ShiftRepository.class).find(3L); // Shift 6h14 + shift = Beans.get(ShiftRepository.class).find(3L); // Shift 6h14 } else if (firstTime.isAfter(SHIFT_8h16_min) && firstTime.isBefore(SHIFT_8h16_max)) { - shift = Beans.get(ShiftRepository.class).find(4L); // Shift 8h16 + shift = Beans.get(ShiftRepository.class).find(4L); // Shift 8h16 } else if (firstTime.isAfter(SHIFT_14h22_min) && firstTime.isBefore(SHIFT_14h22_max)) { - shift = Beans.get(ShiftRepository.class).find(1L); // Shift 14h22 + shift = Beans.get(ShiftRepository.class).find(1L); // Shift 14h22 } else if (firstTime.isAfter(SHIFT_22h6_min) || firstTime.isBefore(SHIFT_22h6_max)) { - shift = Beans.get(ShiftRepository.class).find(2L); // Shift 22h6 + shift = Beans.get(ShiftRepository.class).find(2L); // Shift 22h6 } else { - shift = Beans.get(ShiftRepository.class).find(50L); // N/A + shift = Beans.get(ShiftRepository.class).find(50L); // N/A } dailyReport.setShift(shift); dailyReportRepository.save(dailyReport); @@ -499,7 +558,8 @@ public class DailyReportServiceImpl implements DailyReportService { return nightDuration1; } - private Duration calculateSupplementaryHours(LocalDateTime enter, LocalDateTime quit, int shift, LocalDate reportDate) { + private Duration calculateSupplementaryHours( + LocalDateTime enter, LocalDateTime quit, int shift, LocalDate reportDate) { // Calculate Supp hours for (0,1,2,3) shifts Shift shiftInstance = @@ -549,18 +609,22 @@ public class DailyReportServiceImpl implements DailyReportService { return breakDuration; } - private boolean areBreaksInAllowedRange(LocalDateTime[] enters, LocalDateTime[] quits, LocalTime allowedStartTime, LocalTime allowedEndTime) { + private boolean areBreaksInAllowedRange( + LocalDateTime[] enters, + LocalDateTime[] quits, + LocalTime allowedStartTime, + LocalTime allowedEndTime) { for (int i = 1; i < quits.length; i++) { - if (enters[i] != null && quits[i - 1] != null) { - LocalTime breakStartTime = quits[i - 1].toLocalTime(); - LocalTime breakEndTime = enters[i].toLocalTime(); + if (enters[i] != null && quits[i - 1] != null) { + LocalTime breakStartTime = quits[i - 1].toLocalTime(); + LocalTime breakEndTime = enters[i].toLocalTime(); - // Check if the break falls outside the allowed range - if (breakStartTime.isBefore(allowedStartTime) || breakEndTime.isAfter(allowedEndTime)) { - return false; - } + // Check if the break falls outside the allowed range + if (breakStartTime.isBefore(allowedStartTime) || breakEndTime.isAfter(allowedEndTime)) { + return false; } + } } return true; @@ -568,11 +632,9 @@ public class DailyReportServiceImpl implements DailyReportService { private BigDecimal calculateItp(BigDecimal totalHours, Integer shift, Boolean hasItp) { // Shift 0 (no itp) - if (hasItp == true && shift != 0) - return totalHours.min(BigDecimal.valueOf(8)); - else - return BigDecimal.ZERO; - } + if (hasItp == true && shift != 0) return totalHours.min(BigDecimal.valueOf(8)); + else return BigDecimal.ZERO; + } private void createOffDayWork(LocalDate reportDate, Employee employee) { @@ -651,35 +713,38 @@ public class DailyReportServiceImpl implements DailyReportService { } @Transactional(rollbackOn = {Exception.class}) - public void deducePrimes(DailyReport dailyReport, Integer primeSelection, BigDecimal valueToDeduce) throws AxelorException { + public void deducePrimes( + DailyReport dailyReport, Integer primeSelection, BigDecimal valueToDeduce) + throws AxelorException { switch (primeSelection) { case 1: // ITP - dailyReport.setDeduceItp(true); - dailyReport.setItpToDeduce(valueToDeduce); - break; + dailyReport.setDeduceItp(true); + dailyReport.setItpToDeduce(valueToDeduce); + break; case 2: // Nuissance - dailyReport.setDeduceNuissance(true); - dailyReport.setItpToDeduce(valueToDeduce); - break; + dailyReport.setDeduceNuissance(true); + dailyReport.setItpToDeduce(valueToDeduce); + break; case 3: // HS 50 - dailyReport.setDeduceSupHours50(true); - dailyReport.setSupHours50ToDeduce(valueToDeduce); - break; + dailyReport.setDeduceSupHours50(true); + dailyReport.setSupHours50ToDeduce(valueToDeduce); + break; case 4: // HS 100 - dailyReport.setDeduceSupHours100(true); - dailyReport.setSupHours100ToDeduce(valueToDeduce); - break; + dailyReport.setDeduceSupHours100(true); + dailyReport.setSupHours100ToDeduce(valueToDeduce); + break; default: - return; // Invalid configSelect, stop processing + return; // Invalid configSelect, stop processing } Beans.get(DailyReportRepository.class).save(dailyReport); } @Transactional(rollbackOn = {Exception.class}) - public void massDeducePrimes(List dailyReportList, Integer primeSelection, BigDecimal valueToDeduce) throws AxelorException { + public void massDeducePrimes( + List dailyReportList, Integer primeSelection, BigDecimal valueToDeduce) + throws AxelorException { for (DailyReport dailyReport : dailyReportList) { this.deducePrimes(dailyReport, primeSelection, valueToDeduce); } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/MonthlyReportServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/MonthlyReportServiceImpl.java index a3ea988..468cc3f 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/MonthlyReportServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/MonthlyReportServiceImpl.java @@ -2,15 +2,14 @@ package com.axelor.apps.hr.service; import com.axelor.apps.base.db.Period; import com.axelor.apps.hr.db.Absence; -import com.axelor.apps.hr.db.Authorization; +import com.axelor.apps.hr.db.DailyReport; import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.LeaveRequest; import com.axelor.apps.hr.db.MonthlyReport; -import com.axelor.apps.hr.db.DailyReport; import com.axelor.apps.hr.db.repo.AbsenceRepository; import com.axelor.apps.hr.db.repo.AuthorizationRepository; -import com.axelor.apps.hr.db.repo.MonthlyReportRepository; import com.axelor.apps.hr.db.repo.DailyReportRepository; +import com.axelor.apps.hr.db.repo.MonthlyReportRepository; import com.google.inject.persist.Transactional; import java.math.BigDecimal; import java.time.LocalDate; @@ -18,7 +17,6 @@ import java.time.temporal.TemporalAdjusters; import java.util.List; import java.util.Set; import javax.inject.Inject; -import com.axelor.inject.Beans; public class MonthlyReportServiceImpl implements MonthlyReportService { @@ -42,8 +40,13 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { @Transactional @Override - - public void createMensuelReport(Employee employee, Period period, LocalDate startDate, LocalDate endDate, List employeeDailyReports, List employeeAbsences) { + public void createMensuelReport( + Employee employee, + Period period, + LocalDate startDate, + LocalDate endDate, + List employeeDailyReports, + List employeeAbsences) { Boolean hasNuissance = employee.getHasNuissance(); LocalDate firstDayOfMonth = endDate.with(TemporalAdjusters.firstDayOfMonth()); @@ -61,7 +64,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { BigDecimal totalNuissance = BigDecimal.ZERO; BigDecimal totalAbsence = BigDecimal.ZERO; BigDecimal totalWorkHours = BigDecimal.ZERO; - + BigDecimal breastfeedingAbsenceMonth = BigDecimal.ZERO; BigDecimal authorizedPaidAbsenceMonth = BigDecimal.ZERO; BigDecimal recuperationLeaveAbsenceMonth = BigDecimal.ZERO; @@ -83,7 +86,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { BigDecimal militaryServiceAbsence = BigDecimal.ZERO; BigDecimal irregularAbsenceMonth = BigDecimal.ZERO; - //monthlyAllowance = monthlyAllowance + remainingDateToLastOfMonth; + // monthlyAllowance = monthlyAllowance + remainingDateToLastOfMonth; // Calculate totals for DailyReport for (DailyReport dailyReport : employeeDailyReports) { @@ -94,35 +97,49 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { monthlyAllowance = monthlyAllowance + 1; }*/ - monthlyAllowance = monthlyAllowance + dailyReport.getAllowance();; + monthlyAllowance = monthlyAllowance + dailyReport.getAllowance(); + ; monthlyAllowanceRecall = monthlyAllowanceRecall + dailyReport.getAllowanceRecall(); monthlyNightHours = monthlyNightHours.add(dailyReport.getNightHours()); totalWorkHours = totalWorkHours.add(dailyReport.getWorkHours()); - BigDecimal heureSup50 = dailyReport.getExtraHours50() != null ? dailyReport.getExtraHours50() : BigDecimal.ZERO; - BigDecimal heureSup100 = dailyReport.getExtraHours100() != null ? dailyReport.getExtraHours100() : BigDecimal.ZERO; + BigDecimal heureSup50 = + dailyReport.getExtraHours50() != null ? dailyReport.getExtraHours50() : BigDecimal.ZERO; + BigDecimal heureSup100 = + dailyReport.getExtraHours100() != null ? dailyReport.getExtraHours100() : BigDecimal.ZERO; BigDecimal itp = dailyReport.getItp() != null ? dailyReport.getItp() : BigDecimal.ZERO; - BigDecimal nuissance = dailyReport.getNuissance() != null ? dailyReport.getNuissance() : BigDecimal.ZERO; + BigDecimal nuissance = + dailyReport.getNuissance() != null ? dailyReport.getNuissance() : BigDecimal.ZERO; - BigDecimal supHours50ToDeduce = dailyReport.getSupHours50ToDeduce() != null ? dailyReport.getSupHours50ToDeduce() : BigDecimal.ZERO; - BigDecimal supHours100ToDeduce = dailyReport.getSupHours100ToDeduce() != null ? dailyReport.getSupHours100ToDeduce() : BigDecimal.ZERO; - BigDecimal itpToDeduce = dailyReport.getItpToDeduce() != null ? dailyReport.getItpToDeduce() : BigDecimal.ZERO; - BigDecimal nuissanceToDeduce = dailyReport.getNuissanceToDeduce() != null ? dailyReport.getNuissanceToDeduce() : BigDecimal.ZERO; + BigDecimal supHours50ToDeduce = + dailyReport.getSupHours50ToDeduce() != null + ? dailyReport.getSupHours50ToDeduce() + : BigDecimal.ZERO; + BigDecimal supHours100ToDeduce = + dailyReport.getSupHours100ToDeduce() != null + ? dailyReport.getSupHours100ToDeduce() + : BigDecimal.ZERO; + BigDecimal itpToDeduce = + dailyReport.getItpToDeduce() != null ? dailyReport.getItpToDeduce() : BigDecimal.ZERO; + BigDecimal nuissanceToDeduce = + dailyReport.getNuissanceToDeduce() != null + ? dailyReport.getNuissanceToDeduce() + : BigDecimal.ZERO; - if (dailyReport.getDeduceSupHours50() && heureSup50.compareTo(supHours50ToDeduce) > 0) { - heureSup50 = heureSup50.subtract(supHours50ToDeduce); + if (dailyReport.getDeduceSupHours50() && heureSup50.compareTo(supHours50ToDeduce) > 0) { + heureSup50 = heureSup50.subtract(supHours50ToDeduce); } if (dailyReport.getDeduceSupHours100() && heureSup100.compareTo(supHours100ToDeduce) > 0) { - heureSup100 = heureSup100.subtract(supHours100ToDeduce); + heureSup100 = heureSup100.subtract(supHours100ToDeduce); } if (dailyReport.getDeduceItp() && itp.compareTo(itpToDeduce) > 0) { - itp = itp.subtract(itpToDeduce); + itp = itp.subtract(itpToDeduce); } - if (dailyReport.getDeduceNuissance() && nuissance.compareTo(nuissanceToDeduce) > 0) { - nuissance = nuissance.subtract(nuissanceToDeduce); + if (dailyReport.getDeduceNuissance() && nuissance.compareTo(nuissanceToDeduce) > 0) { + nuissance = nuissance.subtract(nuissanceToDeduce); } monthlyITP = monthlyITP.add(itp); @@ -130,7 +147,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { // Sup Hours if (dailyReport.getIsValidSupHours()) { - + // Handle HeureSup50 if (heureSup50 != null) { if (totalSupHours.add(heureSup50).compareTo(new BigDecimal(32)) <= 0) { @@ -177,19 +194,25 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { LeaveRequest leaveRequest = dailyReport.getLeaveRequest(); Set absences = dailyReport.getAbsenceSet(); - if (dailyReport.getAbsenceHours() != null && dailyReport.getAbsenceHours().compareTo(BigDecimal.ZERO) > 0) { - if (isAuthorizedAbsence == false && isAuthorizedLateArrival == false && isAuthorizedEarlyDeparture == false && leaveRequest == null && absences == null) { + if (dailyReport.getAbsenceHours() != null + && dailyReport.getAbsenceHours().compareTo(BigDecimal.ZERO) > 0) { + if (isAuthorizedAbsence == false + && isAuthorizedLateArrival == false + && isAuthorizedEarlyDeparture == false + && leaveRequest == null + && absences == null) { irregularAbsenceMonth = irregularAbsenceMonth.add(dailyReport.getAbsenceHours()); - } else if(isAuthorizedAbsence){ + } else if (isAuthorizedAbsence) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getAbsenceHours()); - } else if(isAuthorizedLateArrival){ + } else if (isAuthorizedLateArrival) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getLateArrival()); - } else if(isAuthorizedEarlyDeparture){ + } else if (isAuthorizedEarlyDeparture) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getEarlyDeparture()); - } else if(leaveRequest != null){ - recuperationLeaveAbsenceMonth = recuperationLeaveAbsenceMonth.add(dailyReport.getAbsenceHours()); - } else if(absences != null){ - for(Absence absence:absences){ + } else if (leaveRequest != null) { + recuperationLeaveAbsenceMonth = + recuperationLeaveAbsenceMonth.add(dailyReport.getAbsenceHours()); + } else if (absences != null) { + for (Absence absence : absences) { totalAbsence = dailyReport.getAbsenceHours(); switch (absence.getAbsenceType()) { case 0: @@ -250,24 +273,26 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { militaryServiceAbsence = militaryServiceAbsence.add(totalAbsence); break; case 19: - if(dailyReport.getIsAuthorizedAbsence()){ + if (dailyReport.getIsAuthorizedAbsence()) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(totalAbsence); } else { irregularAbsenceMonth = irregularAbsenceMonth.add(totalAbsence); } break; case 20: - if(dailyReport.getIsAuthorizedLateArrival()){ + if (dailyReport.getIsAuthorizedLateArrival()) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getLateArrival()); } else { irregularAbsenceMonth = irregularAbsenceMonth.add(dailyReport.getLateArrival()); } break; case 21: - if(dailyReport.getIsAuthorizedEarlyDeparture()){ - justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getEarlyDeparture()); + if (dailyReport.getIsAuthorizedEarlyDeparture()) { + justifiedAbsenceMonth = + justifiedAbsenceMonth.add(dailyReport.getEarlyDeparture()); } else { - irregularAbsenceMonth = irregularAbsenceMonth.add(dailyReport.getEarlyDeparture()); + irregularAbsenceMonth = + irregularAbsenceMonth.add(dailyReport.getEarlyDeparture()); } break; default: @@ -276,7 +301,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { } } } - } + } } // Update or create MonthlyReport instance with calculated values @@ -321,7 +346,14 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { monthlyReportRepository.save(monthlyReport); } - public void updateMensuelReport(MonthlyReport monthlyReport, Employee employee, Period period, LocalDate startDate, LocalDate endDate, List employeeDailyReports, List employeeAbsences) { + public void updateMensuelReport( + MonthlyReport monthlyReport, + Employee employee, + Period period, + LocalDate startDate, + LocalDate endDate, + List employeeDailyReports, + List employeeAbsences) { Boolean hasNuissance = employee.getHasNuissance(); LocalDate firstDayOfMonth = endDate.with(TemporalAdjusters.firstDayOfMonth()); @@ -339,7 +371,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { BigDecimal totalNuissance = BigDecimal.ZERO; BigDecimal totalAbsence = BigDecimal.ZERO; BigDecimal totalWorkHours = BigDecimal.ZERO; - + BigDecimal breastfeedingAbsenceMonth = BigDecimal.ZERO; BigDecimal authorizedPaidAbsenceMonth = BigDecimal.ZERO; BigDecimal recuperationLeaveAbsenceMonth = BigDecimal.ZERO; @@ -361,7 +393,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { BigDecimal militaryServiceAbsence = BigDecimal.ZERO; BigDecimal irregularAbsenceMonth = BigDecimal.ZERO; - //monthlyAllowance = monthlyAllowance + remainingDateToLastOfMonth; + // monthlyAllowance = monthlyAllowance + remainingDateToLastOfMonth; // Calculate totals for DailyReport for (DailyReport dailyReport : employeeDailyReports) { @@ -372,35 +404,49 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { monthlyAllowance = monthlyAllowance + 1; }*/ - monthlyAllowance = monthlyAllowance + dailyReport.getAllowance();; + monthlyAllowance = monthlyAllowance + dailyReport.getAllowance(); + ; monthlyAllowanceRecall = monthlyAllowanceRecall + dailyReport.getAllowanceRecall(); monthlyNightHours = monthlyNightHours.add(dailyReport.getNightHours()); totalWorkHours = totalWorkHours.add(dailyReport.getWorkHours()); - BigDecimal heureSup50 = dailyReport.getExtraHours50() != null ? dailyReport.getExtraHours50() : BigDecimal.ZERO; - BigDecimal heureSup100 = dailyReport.getExtraHours100() != null ? dailyReport.getExtraHours100() : BigDecimal.ZERO; + BigDecimal heureSup50 = + dailyReport.getExtraHours50() != null ? dailyReport.getExtraHours50() : BigDecimal.ZERO; + BigDecimal heureSup100 = + dailyReport.getExtraHours100() != null ? dailyReport.getExtraHours100() : BigDecimal.ZERO; BigDecimal itp = dailyReport.getItp() != null ? dailyReport.getItp() : BigDecimal.ZERO; - BigDecimal nuissance = dailyReport.getNuissance() != null ? dailyReport.getNuissance() : BigDecimal.ZERO; + BigDecimal nuissance = + dailyReport.getNuissance() != null ? dailyReport.getNuissance() : BigDecimal.ZERO; - BigDecimal supHours50ToDeduce = dailyReport.getSupHours50ToDeduce() != null ? dailyReport.getSupHours50ToDeduce() : BigDecimal.ZERO; - BigDecimal supHours100ToDeduce = dailyReport.getSupHours100ToDeduce() != null ? dailyReport.getSupHours100ToDeduce() : BigDecimal.ZERO; - BigDecimal itpToDeduce = dailyReport.getItpToDeduce() != null ? dailyReport.getItpToDeduce() : BigDecimal.ZERO; - BigDecimal nuissanceToDeduce = dailyReport.getNuissanceToDeduce() != null ? dailyReport.getNuissanceToDeduce() : BigDecimal.ZERO; + BigDecimal supHours50ToDeduce = + dailyReport.getSupHours50ToDeduce() != null + ? dailyReport.getSupHours50ToDeduce() + : BigDecimal.ZERO; + BigDecimal supHours100ToDeduce = + dailyReport.getSupHours100ToDeduce() != null + ? dailyReport.getSupHours100ToDeduce() + : BigDecimal.ZERO; + BigDecimal itpToDeduce = + dailyReport.getItpToDeduce() != null ? dailyReport.getItpToDeduce() : BigDecimal.ZERO; + BigDecimal nuissanceToDeduce = + dailyReport.getNuissanceToDeduce() != null + ? dailyReport.getNuissanceToDeduce() + : BigDecimal.ZERO; - if (dailyReport.getDeduceSupHours50() && heureSup50.compareTo(supHours50ToDeduce) > 0) { - heureSup50 = heureSup50.subtract(supHours50ToDeduce); + if (dailyReport.getDeduceSupHours50() && heureSup50.compareTo(supHours50ToDeduce) > 0) { + heureSup50 = heureSup50.subtract(supHours50ToDeduce); } if (dailyReport.getDeduceSupHours100() && heureSup100.compareTo(supHours100ToDeduce) > 0) { - heureSup100 = heureSup100.subtract(supHours100ToDeduce); + heureSup100 = heureSup100.subtract(supHours100ToDeduce); } if (dailyReport.getDeduceItp() && itp.compareTo(itpToDeduce) > 0) { - itp = itp.subtract(itpToDeduce); + itp = itp.subtract(itpToDeduce); } - if (dailyReport.getDeduceNuissance() && nuissance.compareTo(nuissanceToDeduce) > 0) { - nuissance = nuissance.subtract(nuissanceToDeduce); + if (dailyReport.getDeduceNuissance() && nuissance.compareTo(nuissanceToDeduce) > 0) { + nuissance = nuissance.subtract(nuissanceToDeduce); } monthlyITP = monthlyITP.add(itp); @@ -408,7 +454,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { // Sup Hours if (dailyReport.getIsValidSupHours()) { - + // Handle HeureSup50 if (heureSup50 != null) { if (totalSupHours.add(heureSup50).compareTo(new BigDecimal(32)) <= 0) { @@ -455,19 +501,25 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { LeaveRequest leaveRequest = dailyReport.getLeaveRequest(); Set absences = dailyReport.getAbsenceSet(); - if (dailyReport.getAbsenceHours() != null && dailyReport.getAbsenceHours().compareTo(BigDecimal.ZERO) > 0) { - if (isAuthorizedAbsence == false && isAuthorizedLateArrival == false && isAuthorizedEarlyDeparture == false && leaveRequest == null && absences == null) { + if (dailyReport.getAbsenceHours() != null + && dailyReport.getAbsenceHours().compareTo(BigDecimal.ZERO) > 0) { + if (isAuthorizedAbsence == false + && isAuthorizedLateArrival == false + && isAuthorizedEarlyDeparture == false + && leaveRequest == null + && absences == null) { irregularAbsenceMonth = irregularAbsenceMonth.add(dailyReport.getAbsenceHours()); - } else if(isAuthorizedAbsence){ + } else if (isAuthorizedAbsence) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getAbsenceHours()); - } else if(isAuthorizedLateArrival){ + } else if (isAuthorizedLateArrival) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getLateArrival()); - } else if(isAuthorizedEarlyDeparture){ + } else if (isAuthorizedEarlyDeparture) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getEarlyDeparture()); - } else if(leaveRequest != null){ - recuperationLeaveAbsenceMonth = recuperationLeaveAbsenceMonth.add(dailyReport.getAbsenceHours()); - } else if(absences != null){ - for(Absence absence:absences){ + } else if (leaveRequest != null) { + recuperationLeaveAbsenceMonth = + recuperationLeaveAbsenceMonth.add(dailyReport.getAbsenceHours()); + } else if (absences != null) { + for (Absence absence : absences) { totalAbsence = dailyReport.getAbsenceHours(); switch (absence.getAbsenceType()) { case 0: @@ -528,24 +580,26 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { militaryServiceAbsence = militaryServiceAbsence.add(totalAbsence); break; case 19: - if(dailyReport.getIsAuthorizedAbsence()){ + if (dailyReport.getIsAuthorizedAbsence()) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(totalAbsence); } else { irregularAbsenceMonth = irregularAbsenceMonth.add(totalAbsence); } break; case 20: - if(dailyReport.getIsAuthorizedLateArrival()){ + if (dailyReport.getIsAuthorizedLateArrival()) { justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getLateArrival()); } else { irregularAbsenceMonth = irregularAbsenceMonth.add(dailyReport.getLateArrival()); } break; case 21: - if(dailyReport.getIsAuthorizedEarlyDeparture()){ - justifiedAbsenceMonth = justifiedAbsenceMonth.add(dailyReport.getEarlyDeparture()); + if (dailyReport.getIsAuthorizedEarlyDeparture()) { + justifiedAbsenceMonth = + justifiedAbsenceMonth.add(dailyReport.getEarlyDeparture()); } else { - irregularAbsenceMonth = irregularAbsenceMonth.add(dailyReport.getEarlyDeparture()); + irregularAbsenceMonth = + irregularAbsenceMonth.add(dailyReport.getEarlyDeparture()); } break; default: @@ -554,7 +608,7 @@ public class MonthlyReportServiceImpl implements MonthlyReportService { } } } - } + } } // Update or create MonthlyReport instance with calculated values diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/employee/EmployeeServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/employee/EmployeeServiceImpl.java index 8ba166b..73bb1fa 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/employee/EmployeeServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/employee/EmployeeServiceImpl.java @@ -253,7 +253,7 @@ public class EmployeeServiceImpl extends UserServiceImpl implements EmployeeServ @Override @Transactional - public void setEmployeeEnrolled(Employee employee){ + public void setEmployeeEnrolled(Employee employee) { employee.setIsEnrolled(true); Beans.get(EmployeeRepository.class).save(employee); } @@ -263,29 +263,27 @@ public class EmployeeServiceImpl extends UserServiceImpl implements EmployeeServ public void updateEmployeeConfig(Employee employee, Integer configSelect, Boolean status) throws AxelorException { switch (configSelect) { - case 1: // ITP - employee.setHasItp(status); - break; - case 2: // Nuissance - employee.setHasNuissance(status); - break; - case 3: // Transfaire - employee.setIsTransfaire(status); - break; - default: - return; // Invalid configSelect, stop processing - } + case 1: // ITP + employee.setHasItp(status); + break; + case 2: // Nuissance + employee.setHasNuissance(status); + break; + case 3: // Transfaire + employee.setIsTransfaire(status); + break; + default: + return; // Invalid configSelect, stop processing + } Beans.get(EmployeeRepository.class).save(employee); } @Override @Transactional(rollbackOn = {Exception.class}) - public void massUpdateEmployeeConfig(List employeesIds, Integer configSelect, Boolean status) throws AxelorException{ + public void massUpdateEmployeeConfig( + List employeesIds, Integer configSelect, Boolean status) throws AxelorException { List employees = - Beans.get(EmployeeRepository.class) - .all() - .filter("self.id in (?1)", employeesIds) - .fetch(); + Beans.get(EmployeeRepository.class).all().filter("self.id in (?1)", employeesIds).fetch(); if (employeesIds != null || !employeesIds.isEmpty()) { for (Employee employee : employees) { diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/extra/hours/ExtraHoursServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/extra/hours/ExtraHoursServiceImpl.java index 45d9997..cb51396 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/extra/hours/ExtraHoursServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/extra/hours/ExtraHoursServiceImpl.java @@ -17,17 +17,16 @@ */ package com.axelor.apps.hr.service.extra.hours; - -import com.axelor.apps.hr.db.DailyReport; -import com.axelor.apps.hr.db.repo.EmployeeRepository; -import com.axelor.apps.hr.db.repo.DailyReportRepository; -import com.axelor.apps.hr.db.Employee; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.repo.CompanyRepository; import com.axelor.apps.base.service.app.AppBaseService; +import com.axelor.apps.hr.db.DailyReport; +import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.ExtraHours; import com.axelor.apps.hr.db.ExtraHoursLine; import com.axelor.apps.hr.db.HRConfig; +import com.axelor.apps.hr.db.repo.DailyReportRepository; +import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.apps.hr.db.repo.ExtraHoursRepository; import com.axelor.apps.hr.service.config.HRConfigService; import com.axelor.apps.message.db.Message; @@ -37,13 +36,13 @@ import com.axelor.exception.AxelorException; import com.google.inject.Inject; import com.google.inject.persist.Transactional; import java.io.IOException; +import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalTime; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.ArrayList; -import java.math.BigDecimal; import java.util.List; import javax.mail.MessagingException; import wslite.json.JSONException; @@ -201,16 +200,17 @@ public class ExtraHoursServiceImpl implements ExtraHoursService { String heureDebut = jsonObject.getString("heure_debut"); String heureFin = jsonObject.getString("heure_fin"); String lieuTravail = jsonObject.getString("lieu_travail"); - int validation_status = jsonObject.optInt("validation_status",2); - String validateByUser = jsonObject.optString("validate_by_user",null); - String dateValidation = jsonObject.optString("validation_date",null); + int validation_status = jsonObject.optInt("validation_status", 2); + String validateByUser = jsonObject.optString("validate_by_user", null); + String dateValidation = jsonObject.optString("validation_date", null); // GET EMPLOYEES - Employee employee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", matricule) - .fetchOne(); + Employee employee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", matricule) + .fetchOne(); if (employee == null) { System.err.println("Employee with matricule " + matricule + " not found."); @@ -219,29 +219,31 @@ public class ExtraHoursServiceImpl implements ExtraHoursService { Employee validatedByEmployee = null; - if(validateByUser != null){ - validatedByEmployee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", validateByUser) - .fetchOne(); + if (validateByUser != null) { + validatedByEmployee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", validateByUser) + .fetchOne(); - if (validatedByEmployee == null) { - System.err.println("Validator employee with matricule " + validateByUser + " not found."); - return; - } + if (validatedByEmployee == null) { + System.err.println("Validator employee with matricule " + validateByUser + " not found."); + return; + } } // Parse validation date (handle null case) LocalDate validationDate = null; if (dateValidation != null && !dateValidation.isEmpty()) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - validationDate = offsetDateTime.toLocalDate(); // Extract only the date part - } catch (DateTimeParseException e) { - System.out.println("Error parsing dateValidation: " + dateValidation); - validationDate = null; - } + try { + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + validationDate = offsetDateTime.toLocalDate(); // Extract only the date part + } catch (DateTimeParseException e) { + System.out.println("Error parsing dateValidation: " + dateValidation); + validationDate = null; + } } // Parse Requisition Date @@ -254,46 +256,49 @@ public class ExtraHoursServiceImpl implements ExtraHoursService { } // Check if Authorization exists by ticketId - ExtraHours extraHours = extraHoursRepo - .all() - .filter("self.ticketId = :ticketId") - .bind("ticketId", idInt) - .fetchOne(); + ExtraHours extraHours = + extraHoursRepo + .all() + .filter("self.ticketId = :ticketId") + .bind("ticketId", idInt) + .fetchOne(); if (extraHours != null) { - // Authorization exists, compare previous and new status - int previousStatus = extraHours.getStatusSelect(); // Previous status - int newStatus = validation_status; // New status + // Authorization exists, compare previous and new status + int previousStatus = extraHours.getStatusSelect(); // Previous status + int newStatus = validation_status; // New status - if (previousStatus == 2 && newStatus == 3) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - // Update the fields of the existing Authorization - extraHours.setValidatedByEmployee(validatedByEmployee); - extraHours.setValidationDate(validationDate); - extraHours.setStatusSelect(newStatus); - // Save the updated Authorization - extraHoursRepo.save(extraHours); + if (previousStatus == 2 && newStatus == 3) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + // Update the fields of the existing Authorization + extraHours.setValidatedByEmployee(validatedByEmployee); + extraHours.setValidationDate(validationDate); + extraHours.setStatusSelect(newStatus); + // Save the updated Authorization + extraHoursRepo.save(extraHours); - // Get Daily report - DailyReport dailyReport = - dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate = :reportDate") - .bind("employee", employee) - .bind("reportDate", requisitionDate) - .fetchOne(); + // Get Daily report + DailyReport dailyReport = + dailyReportRepo + .all() + .filter("self.employee = :employee and self.reportDate = :reportDate") + .bind("employee", employee) + .bind("reportDate", requisitionDate) + .fetchOne(); - if (dailyReport != null) { - dailyReport.setIsValidSupHours(true); - } - } else if (previousStatus == 2 && newStatus == 4) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - extraHours.setRefusedByEmployee(validatedByEmployee); - extraHours.setRefusalDate(validationDate); - extraHours.setStatusSelect(newStatus); - // Save the updated Authorization - extraHoursRepo.save(extraHours); - } + if (dailyReport != null) { + dailyReport.setIsValidSupHours(true); + } + } else if (previousStatus == 2 && newStatus == 4) { + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + extraHours.setRefusedByEmployee(validatedByEmployee); + extraHours.setRefusalDate(validationDate); + extraHours.setStatusSelect(newStatus); + // Save the updated Authorization + extraHoursRepo.save(extraHours); + } } else { // Create an instance of ExtraHours extraHours = new ExtraHours(); @@ -325,14 +330,13 @@ public class ExtraHoursServiceImpl implements ExtraHoursService { } if (validation_status == 3) { - extraHours.setValidatedByEmployee(validatedByEmployee); - extraHours.setValidationDate(validationDate); + extraHours.setValidatedByEmployee(validatedByEmployee); + extraHours.setValidationDate(validationDate); } else if (validation_status == 4) { - extraHours.setRefusedByEmployee(validatedByEmployee); - extraHours.setRefusalDate(validationDate); + extraHours.setRefusedByEmployee(validatedByEmployee); + extraHours.setRefusalDate(validationDate); } - // Save the ExtraHours entity extraHoursRepo.save(extraHours); @@ -356,8 +360,7 @@ public class ExtraHoursServiceImpl implements ExtraHoursService { // Add the new ExtraHours to the list supHoursList.add(extraHours); - if (validation_status == 3) - dailyReport.setIsValidSupHours(true); + if (validation_status == 3) dailyReport.setIsValidSupHours(true); // Set the updated list back to dailyReport dailyReport.setSupHoursList(supHoursList); } @@ -369,5 +372,4 @@ public class ExtraHoursServiceImpl implements ExtraHoursService { e.printStackTrace(); } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/leave/LeaveServiceImpl.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/leave/LeaveServiceImpl.java index 9fccf8c..0d39eba 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/leave/LeaveServiceImpl.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/service/leave/LeaveServiceImpl.java @@ -27,14 +27,14 @@ import com.axelor.apps.base.db.repo.ICalendarEventRepository; import com.axelor.apps.base.ical.ICalendarService; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.base.service.weeklyplanning.WeeklyPlanningService; +import com.axelor.apps.hr.db.DailyReport; import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.HRConfig; import com.axelor.apps.hr.db.LeaveLine; import com.axelor.apps.hr.db.LeaveReason; import com.axelor.apps.hr.db.LeaveRequest; -import com.axelor.apps.hr.db.DailyReport; -import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.apps.hr.db.repo.DailyReportRepository; +import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.apps.hr.db.repo.LeaveLineRepository; import com.axelor.apps.hr.db.repo.LeaveReasonRepository; import com.axelor.apps.hr.db.repo.LeaveRequestRepository; @@ -57,14 +57,13 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.List; import javax.mail.MessagingException; import wslite.json.JSONException; import wslite.json.JSONObject; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - public class LeaveServiceImpl implements LeaveService { @@ -945,47 +944,50 @@ public class LeaveServiceImpl implements LeaveService { String dateDebut = jsonObject.getString("de"); String dateFin = jsonObject.getString("a"); String commentaire = jsonObject.getString("commentaire"); - int validation_status = jsonObject.optInt("validation_status",2); - String validateByUser = jsonObject.optString("validate_by_user",null); - String dateValidation = jsonObject.optString("validation_date",null); + int validation_status = jsonObject.optInt("validation_status", 2); + String validateByUser = jsonObject.optString("validate_by_user", null); + String dateValidation = jsonObject.optString("validation_date", null); // GET EMPLOYEES - Employee employee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", matricule) - .fetchOne(); + Employee employee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", matricule) + .fetchOne(); if (employee == null) { - System.err.println("Employee with matricule " + matricule + " not found."); - return; + System.err.println("Employee with matricule " + matricule + " not found."); + return; } Employee validatedByEmployee = null; - if(validateByUser != null){ - validatedByEmployee = employeeRepo - .all() - .filter("self.registrationNumber = :matricule") - .bind("matricule", validateByUser) - .fetchOne(); + if (validateByUser != null) { + validatedByEmployee = + employeeRepo + .all() + .filter("self.registrationNumber = :matricule") + .bind("matricule", validateByUser) + .fetchOne(); - if (validatedByEmployee == null) { - System.err.println("Validator employee with matricule " + validateByUser + " not found."); - return; - } + if (validatedByEmployee == null) { + System.err.println("Validator employee with matricule " + validateByUser + " not found."); + return; + } } // Parse validation date (handle null case) LocalDate validationDate = null; if (dateValidation != null && !dateValidation.isEmpty()) { - try { - OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - validationDate = offsetDateTime.toLocalDate(); // Extract only the date part - } catch (DateTimeParseException e) { - System.out.println("Error parsing dateValidation: " + dateValidation); - validationDate = null; - } + try { + OffsetDateTime offsetDateTime = + OffsetDateTime.parse(dateValidation, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + validationDate = offsetDateTime.toLocalDate(); // Extract only the date part + } catch (DateTimeParseException e) { + System.out.println("Error parsing dateValidation: " + dateValidation); + validationDate = null; + } } // Parse Dates @@ -1008,18 +1010,20 @@ public class LeaveServiceImpl implements LeaveService { LocalDateTime debutDateTime = debutDate.atStartOfDay(); LocalDateTime finDateTime = finDate.atStartOfDay(); - LeaveRequest leaveRequest = leaveRequestRepo - .all() - .filter("self.ticketId = :ticketId") - .bind("ticketId", idInt) - .fetchOne(); - - if (leaveRequest != null) { + LeaveRequest leaveRequest = + leaveRequestRepo + .all() + .filter("self.ticketId = :ticketId") + .bind("ticketId", idInt) + .fetchOne(); + + if (leaveRequest != null) { // Authorization exists, compare previous and new status - int previousStatus = leaveRequest.getStatusSelect(); // Previous status - int newStatus = validation_status; // New status + int previousStatus = leaveRequest.getStatusSelect(); // Previous status + int newStatus = validation_status; // New status if (previousStatus == 2 && newStatus == 3) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); // Update the fields of the existing Authorization leaveRequest.setValidatedByEmployee(validatedByEmployee); leaveRequest.setValidationDate(validationDate); @@ -1027,27 +1031,30 @@ public class LeaveServiceImpl implements LeaveService { // Save the updated Authorization leaveRequestRepo.save(leaveRequest); // Get Daily report - List dailyReports = dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate >= :debutDate and self.reportDate <= :finDate") - .bind("employee", employee) - .bind("debutDate", debutDate) - .bind("finDate", finDate) - .fetch(); + List dailyReports = + dailyReportRepo + .all() + .filter( + "self.employee = :employee and self.reportDate >= :debutDate and self.reportDate <= :finDate") + .bind("employee", employee) + .bind("debutDate", debutDate) + .bind("finDate", finDate) + .fetch(); if (dailyReports != null) { for (DailyReport dailyReport : dailyReports) { - dailyReport.setIsAuthorizedAbsence(true); - dailyReportRepo.save(dailyReport); + dailyReport.setIsAuthorizedAbsence(true); + dailyReportRepo.save(dailyReport); } } } else if (previousStatus == 2 && newStatus == 4) { - System.out.println("Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); - leaveRequest.setRefusedByEmployee(validatedByEmployee); - leaveRequest.setRefusalDate(validationDate); - leaveRequest.setStatusSelect(newStatus); - // Save the updated Authorization - leaveRequestRepo.save(leaveRequest); + System.out.println( + "Tickets :" + idInt + " Status changed from " + previousStatus + " to " + newStatus); + leaveRequest.setRefusedByEmployee(validatedByEmployee); + leaveRequest.setRefusalDate(validationDate); + leaveRequest.setStatusSelect(newStatus); + // Save the updated Authorization + leaveRequestRepo.save(leaveRequest); } } else { // Create an instance of ExtraHours @@ -1062,30 +1069,31 @@ public class LeaveServiceImpl implements LeaveService { leaveRequest.setCompany(company); if (validation_status == 3) { - leaveRequest.setValidatedByEmployee(validatedByEmployee); - leaveRequest.setValidationDate(validationDate); + leaveRequest.setValidatedByEmployee(validatedByEmployee); + leaveRequest.setValidationDate(validationDate); } else if (validation_status == 4) { - leaveRequest.setRefusedByEmployee(validatedByEmployee); - leaveRequest.setRefusalDate(validationDate); + leaveRequest.setRefusedByEmployee(validatedByEmployee); + leaveRequest.setRefusalDate(validationDate); } // Save the ExtraHours entity leaveRequestRepo.save(leaveRequest); // Get Daily report - List dailyReports = dailyReportRepo - .all() - .filter("self.employee = :employee and self.reportDate >= :debutDate and self.reportDate <= :finDate") - .bind("employee", employee) - .bind("debutDate", debutDate) - .bind("finDate", finDate) - .fetch(); + List dailyReports = + dailyReportRepo + .all() + .filter( + "self.employee = :employee and self.reportDate >= :debutDate and self.reportDate <= :finDate") + .bind("employee", employee) + .bind("debutDate", debutDate) + .bind("finDate", finDate) + .fetch(); if (dailyReports != null) { for (DailyReport dailyReport : dailyReports) { dailyReport.setLeaveRequest(leaveRequest); // Set the recup leave for each report - if(validation_status == 3) - dailyReport.setIsAuthorizedAbsence(true); + if (validation_status == 3) dailyReport.setIsAuthorizedAbsence(true); dailyReportRepo.save(dailyReport); } } @@ -1097,5 +1105,4 @@ public class LeaveServiceImpl implements LeaveService { e.printStackTrace(); } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AbsenceController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AbsenceController.java index 011b75f..f6e6770 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AbsenceController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AbsenceController.java @@ -1,23 +1,21 @@ package com.axelor.apps.hr.web; import com.axelor.apps.hr.db.Absence; -import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.DailyReport; +import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.repo.AbsenceRepository; import com.axelor.apps.hr.db.repo.DailyReportRepository; import com.axelor.apps.hr.service.AbsenceServiceImpl; +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 java.math.BigDecimal; -import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; import java.util.List; -import com.axelor.i18n.I18n; -import com.axelor.meta.schema.actions.ActionView; -import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder; import java.util.stream.Collectors; public class AbsenceController { @@ -32,35 +30,40 @@ public class AbsenceController { Employee employee = absence.getEmployee(); // Fetch all existing daily reports associated with this absence - List existingReports = - Beans.get(DailyReportRepository.class) - .all() - .filter("self.absenceSet = :absence") - .bind("absence", absence) - .fetch(); + List existingReports = + Beans.get(DailyReportRepository.class) + .all() + .filter("self.absenceSet = :absence") + .bind("absence", absence) + .fetch(); if (existingReports != null && !existingReports.isEmpty()) { // Detach absence only from reports that are outside the new date range - List reportsToDetach = existingReports.stream() - .filter(report -> report.getReportDate().isBefore(absenceStartDate) || report.getReportDate().isAfter(absenceEndDate)) - .collect(Collectors.toList()); - + List reportsToDetach = + existingReports + .stream() + .filter( + report -> + report.getReportDate().isBefore(absenceStartDate) + || report.getReportDate().isAfter(absenceEndDate)) + .collect(Collectors.toList()); + // Detach absence from these specific reports if (!reportsToDetach.isEmpty()) { - Beans.get(AbsenceServiceImpl.class).deAttachTheAbsenceWithDailyReport(absence, reportsToDetach, false); + Beans.get(AbsenceServiceImpl.class) + .deAttachTheAbsenceWithDailyReport(absence, reportsToDetach, false); } - } + } List newReports = - Beans.get(DailyReportRepository.class) - .all() - .filter( - "self.employee = :employee and self.reportDate between :absenceStartDate and :absenceEndDate") - .bind("employee", employee) - .bind("absenceStartDate", absenceStartDate) - .bind("absenceEndDate", absenceEndDate) - .fetch(); - + Beans.get(DailyReportRepository.class) + .all() + .filter( + "self.employee = :employee and self.reportDate between :absenceStartDate and :absenceEndDate") + .bind("employee", employee) + .bind("absenceStartDate", absenceStartDate) + .bind("absenceEndDate", absenceEndDate) + .fetch(); // Check if there are any reports if (newReports.isEmpty()) { @@ -108,25 +111,26 @@ public class AbsenceController { Long absenceId = (Long) request.getContext().asType(Absence.class).getId(); Absence absence = Beans.get(AbsenceRepository.class).find(absenceId); - List dailyreports = Beans.get(DailyReportRepository.class) - .all() - .filter("self.absence = :absence") - .bind("absence", absenceId) - .fetch(); + List dailyreports = + Beans.get(DailyReportRepository.class) + .all() + .filter("self.absence = :absence") + .bind("absence", absenceId) + .fetch(); - Beans.get(AbsenceServiceImpl.class).deAttachTheAbsenceWithDailyReport(absence, dailyreports, true); + Beans.get(AbsenceServiceImpl.class) + .deAttachTheAbsenceWithDailyReport(absence, dailyreports, true); ActionViewBuilder actionView = - ActionView.define(I18n.get("Absences")) - .model(Absence.class.getName()) - .add("grid", "absence-grid") - .add("form", "absence-form"); + ActionView.define(I18n.get("Absences")) + .model(Absence.class.getName()) + .add("grid", "absence-grid") + .add("form", "absence-form"); response.setView(actionView.map()); } catch (Exception e) { e.printStackTrace(); } } - public void calculateTotalAbsenceHours(ActionRequest request, ActionResponse response) { try { @@ -137,9 +141,10 @@ public class AbsenceController { LocalDateTime absenceEndDate = absence.getEndDate(); if (absenceStartDate.isAfter(absenceEndDate)) { response.setAlert("Start date cannot be after end date."); - } - else { - BigDecimal totalAbsenceHours = Beans.get(AbsenceServiceImpl.class).calculateTotalAbsenceHours(absenceStartDate,absenceEndDate); + } else { + BigDecimal totalAbsenceHours = + Beans.get(AbsenceServiceImpl.class) + .calculateTotalAbsenceHours(absenceStartDate, absenceEndDate); response.setValue("totalAbsenceHours", totalAbsenceHours); } } catch (Exception e) { diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AuthorizationController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AuthorizationController.java index eb734bd..50c5ee7 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AuthorizationController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/AuthorizationController.java @@ -168,7 +168,8 @@ public class AuthorizationController { } } catch (Exception e) { // General catch for unexpected exceptions - System.err.println("An error occurred while fetching Salary Authorization: " + e.getMessage()); + System.err.println( + "An error occurred while fetching Salary Authorization: " + e.getMessage()); e.printStackTrace(); } } @@ -369,5 +370,4 @@ public class AuthorizationController { } } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/DailyReportController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/DailyReportController.java index 5908ca4..e04a378 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/DailyReportController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/DailyReportController.java @@ -1,28 +1,24 @@ package com.axelor.apps.hr.web; -import com.axelor.apps.hr.db.Shift; -import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.DailyReport; +import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.repo.DailyReportRepository; -import com.axelor.apps.hr.db.repo.ShiftRepository; import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.apps.hr.service.DailyReportService; import com.axelor.apps.hr.service.DailyReportServiceImpl; +import com.axelor.exception.service.TraceBackService; import com.axelor.inject.Beans; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import java.lang.invoke.MethodHandles; -import java.util.LinkedHashMap; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.format.DateTimeParseException; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.time.LocalDateTime; -import java.time.format.DateTimeParseException; -import java.time.LocalTime; -import java.time.LocalDate; -import java.math.BigDecimal; -import com.axelor.exception.service.TraceBackService; public class DailyReportController { @@ -32,14 +28,12 @@ public class DailyReportController { * @param request * @param response */ - public void workingHours(ActionRequest request, ActionResponse response) { try { Long dailyReportId = (Long) request.getContext().asType(DailyReport.class).getId(); DailyReport DailyReport = Beans.get(DailyReportRepository.class).find(dailyReportId); if (DailyReport == null) { - throw new IllegalArgumentException( - "DailyReport with ID " + dailyReportId + " not found."); + throw new IllegalArgumentException("DailyReport with ID " + dailyReportId + " not found."); } Beans.get(DailyReportServiceImpl.class).determineShift(DailyReport); Beans.get(DailyReportServiceImpl.class).workingHours(DailyReport); @@ -55,8 +49,7 @@ public class DailyReportController { Long dailyReportId = (Long) request.getContext().asType(DailyReport.class).getId(); DailyReport DailyReport = Beans.get(DailyReportRepository.class).find(dailyReportId); if (DailyReport == null) { - throw new IllegalArgumentException( - "DailyReport with ID " + dailyReportId + " not found."); + throw new IllegalArgumentException("DailyReport with ID " + dailyReportId + " not found."); } Beans.get(DailyReportServiceImpl.class).workingHours(DailyReport); response.setReload(true); @@ -95,34 +88,33 @@ public class DailyReportController { List dailyReportList = Beans.get(DailyReportRepository.class) .all() - .filter( - "self.id in ?1 ",dailyReportIds) + .filter("self.id in ?1 ", dailyReportIds) .fetch(); - - for(DailyReport dailyReport: dailyReportList){ + + for (DailyReport dailyReport : dailyReportList) { Beans.get(DailyReportServiceImpl.class).determineShift(dailyReport); } Beans.get(DailyReportServiceImpl.class).workingHoursForAll(dailyReportList); response.setFlash("Working hours calculated successfully."); } else { - response.setFlash("No Daily report selected"); + response.setFlash("No Daily report selected"); } } public void workingHoursForChangedInstances(ActionRequest request, ActionResponse response) { - List dailyReportList = - Beans.get(DailyReportRepository.class) - .all() - .filter("self.isCalculated = ? and self.isChanged = ?", false,true) - .fetch(); - - for(DailyReport dailyReport: dailyReportList){ - Beans.get(DailyReportServiceImpl.class).determineShift(dailyReport); - } + List dailyReportList = + Beans.get(DailyReportRepository.class) + .all() + .filter("self.isCalculated = ? and self.isChanged = ?", false, true) + .fetch(); - Beans.get(DailyReportServiceImpl.class).workingHoursForAll(dailyReportList); - response.setReload(true); - response.setFlash("Working hours calculated successfully."); + for (DailyReport dailyReport : dailyReportList) { + Beans.get(DailyReportServiceImpl.class).determineShift(dailyReport); + } + + Beans.get(DailyReportServiceImpl.class).workingHoursForAll(dailyReportList); + response.setReload(true); + response.setFlash("Working hours calculated successfully."); } public void massDeducePrime(ActionRequest request, ActionResponse response) { @@ -135,46 +127,49 @@ public class DailyReportController { LocalDate endDate = null; try { - if (startDateStr != null) { - startDate = LocalDate.parse(startDateStr); - } - if (endDateStr != null) { - endDate = LocalDate.parse(endDateStr); - } + if (startDateStr != null) { + startDate = LocalDate.parse(startDateStr); + } + if (endDateStr != null) { + endDate = LocalDate.parse(endDateStr); + } - // Validate the dates - if (startDate == null || endDate == null) { - response.setFlash("Start date or end date is missing or invalid."); - return; - } + // Validate the dates + if (startDate == null || endDate == null) { + response.setFlash("Start date or end date is missing or invalid."); + return; + } - if (startDate.isAfter(endDate)) { - response.setFlash("Start date cannot be after end date."); - return; - } + if (startDate.isAfter(endDate)) { + response.setFlash("Start date cannot be after end date."); + return; + } } catch (DateTimeParseException e) { - response.setFlash("Invalid date format for startDate or endDate. Expected format: yyyy-MM-dd."); - return; + response.setFlash( + "Invalid date format for startDate or endDate. Expected format: yyyy-MM-dd."); + return; } Object valueToDeduceObj = request.getContext().get("valueToDeduce"); BigDecimal valueToDeduce = null; if (valueToDeduceObj instanceof Integer) { - valueToDeduce = BigDecimal.valueOf((Integer) valueToDeduceObj); + valueToDeduce = BigDecimal.valueOf((Integer) valueToDeduceObj); } else if (valueToDeduceObj instanceof BigDecimal) { - valueToDeduce = (BigDecimal) valueToDeduceObj; + valueToDeduce = (BigDecimal) valueToDeduceObj; } else if (valueToDeduceObj instanceof String) { - try { - valueToDeduce = new BigDecimal((String) valueToDeduceObj); - } catch (NumberFormatException e) { - response.setFlash("Value to deduce must be a valid number."); - return; - } - } else { - response.setFlash("Invalid value to deduce: unsupported type " + (valueToDeduceObj != null ? valueToDeduceObj.getClass().getName() : "null")); + try { + valueToDeduce = new BigDecimal((String) valueToDeduceObj); + } catch (NumberFormatException e) { + response.setFlash("Value to deduce must be a valid number."); return; + } + } else { + response.setFlash( + "Invalid value to deduce: unsupported type " + + (valueToDeduceObj != null ? valueToDeduceObj.getClass().getName() : "null")); + return; } Object employeesObject = request.getContext().get("employees"); @@ -183,53 +178,56 @@ public class DailyReportController { List employees = new ArrayList<>(); if (employeesObject instanceof List) { - List> employeesList = (List>) employeesObject; + List> employeesList = + (List>) employeesObject; - for (LinkedHashMap employeeMap : employeesList) { - Integer employeeIdInt = (Integer) employeeMap.get("id"); + for (LinkedHashMap employeeMap : employeesList) { + Integer employeeIdInt = (Integer) employeeMap.get("id"); - if (employeeIdInt != null) { - Long employeeId = employeeIdInt.longValue(); - Employee employee = Beans.get(EmployeeRepository.class).find(employeeId); + if (employeeIdInt != null) { + Long employeeId = employeeIdInt.longValue(); + Employee employee = Beans.get(EmployeeRepository.class).find(employeeId); - if (employee != null) { - employees.add(employee); - } - } + if (employee != null) { + employees.add(employee); + } } + } } if (employees.isEmpty()) { - response.setFlash("No employees selected."); - return; + response.setFlash("No employees selected."); + return; } List employeeIds = new ArrayList<>(); for (Employee employee : employees) { - employeeIds.add(employee.getId().intValue()); + employeeIds.add(employee.getId().intValue()); } // Fetch all rapport journaliers within the date range for all employees - List dailyReportList = Beans.get(DailyReportRepository.class) + List dailyReportList = + Beans.get(DailyReportRepository.class) .all() - .filter("self.employee.id in :employeeIds and self.reportDate >= :startDate and self.reportDate <= :endDate") + .filter( + "self.employee.id in :employeeIds and self.reportDate >= :startDate and self.reportDate <= :endDate") .bind("startDate", startDate) .bind("endDate", endDate) .bind("employeeIds", employeeIds) .fetch(); try { - if (!dailyReportList.isEmpty()) { - Beans.get(DailyReportService.class).massDeducePrimes(dailyReportList, primeSelection, valueToDeduce); - response.setReload(true); - response.setFlash("Prime deductions processed successfully."); - } else { - response.setFlash("No reports found for the selected date range."); - } + if (!dailyReportList.isEmpty()) { + Beans.get(DailyReportService.class) + .massDeducePrimes(dailyReportList, primeSelection, valueToDeduce); + response.setReload(true); + response.setFlash("Prime deductions processed successfully."); + } else { + response.setFlash("No reports found for the selected date range."); + } } catch (Exception e) { - TraceBackService.trace(response, e); - response.setFlash("An error occurred while processing the request."); + TraceBackService.trace(response, e); + response.setFlash("An error occurred while processing the request."); } } - } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/EmployeeController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/EmployeeController.java index ec21728..2b4adce 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/EmployeeController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/EmployeeController.java @@ -17,13 +17,14 @@ */ package com.axelor.apps.hr.web; -import com.axelor.apps.hr.db.Granding; -import com.axelor.apps.hr.db.repo.GrandingRepository; +import com.axelor.app.AppSettings; import com.axelor.apps.ReportFactory; import com.axelor.apps.base.db.Partner; import com.axelor.apps.hr.db.DPAE; import com.axelor.apps.hr.db.Employee; +import com.axelor.apps.hr.db.Granding; import com.axelor.apps.hr.db.repo.EmployeeRepository; +import com.axelor.apps.hr.db.repo.GrandingRepository; import com.axelor.apps.hr.report.IReport; import com.axelor.apps.hr.service.employee.EmployeeService; import com.axelor.apps.report.engine.ReportSettings; @@ -38,17 +39,16 @@ import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.google.inject.Singleton; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; import java.lang.invoke.MethodHandles; -import java.util.Map; import java.util.List; +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import wslite.json.JSONException; import wslite.json.JSONObject; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import com.axelor.app.AppSettings; @Singleton public class EmployeeController { @@ -149,22 +149,21 @@ public class EmployeeController { response.setReload(true); } - public void enrollEmployee(ActionRequest request, ActionResponse response){ + + public void enrollEmployee(ActionRequest request, ActionResponse response) { Long employeeId = (Long) request.getContext().asType(Employee.class).getId(); Employee employee = Beans.get(EmployeeRepository.class).find(employeeId); - Granding granding = Beans.get(GrandingRepository.class) - .all() - .filter("self.name = 'POINTEUSE-RDC'") - .fetchOne(); + Granding granding = + Beans.get(GrandingRepository.class).all().filter("self.name = 'POINTEUSE-RDC'").fetchOne(); String ipAdress = granding.getIpAdress(); String code = granding.getCode().toString(); - if(employee.getIsEnrolled()) { + if (employee.getIsEnrolled()) { response.setFlash("Employee is already enrolled."); } else { - if (employee.getContactPartner() != null){ + if (employee.getContactPartner() != null) { String employeeRegistrationNumber = employee.getRegistrationNumber(); String employeeName = employee.getContactPartner().getName(); @@ -172,54 +171,61 @@ public class EmployeeController { LOG.error("Pythons script path is not configured in AppSettings."); return; } - + try { - - + String[] args = { "python", pythonScriptDir + "\\Attendance\\main.py", - "--commande", "create", - "--ip_address", ipAdress, - "--code", code, - "--user_id", employeeRegistrationNumber, - "--name", employeeName + "--commande", + "create", + "--ip_address", + ipAdress, + "--code", + code, + "--user_id", + employeeRegistrationNumber, + "--name", + employeeName }; - + Process p = Runtime.getRuntime().exec(args); - + // Capture the output stream (standard output) BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while ((line = reader.readLine()) != null) { LOG.info("Python script (Employee Enrolling) output: " + line); } - + // Capture the error stream (standard error) - BufferedReader errorReader = new BufferedReader(new InputStreamReader(p.getErrorStream())); + BufferedReader errorReader = + new BufferedReader(new InputStreamReader(p.getErrorStream())); while ((line = errorReader.readLine()) != null) { LOG.error("Python script (Employee Enrolling) error: " + line); } - + // Wait for the process to complete and check the exit value int exitCode = p.waitFor(); - + // Check if the process ran successfully if (exitCode == 0) { LOG.info("Python script executed successfully (Employee Enrolling)."); Beans.get(EmployeeService.class).setEmployeeEnrolled(employee); response.setFlash("Employee enrolled successfully."); } else { - LOG.error("Python script execution (Employee Enrolling) failed with exit code: " + exitCode); + LOG.error( + "Python script execution (Employee Enrolling) failed with exit code: " + exitCode); response.setFlash("Failed to enroll the Employee."); } - + } catch (IOException e) { // Check if the file is not found based on the message or error code if (e.getMessage().contains("The system cannot find the file specified")) { LOG.error("Python script file (Employee Enrolling) not found: " + e.getMessage()); } else { - LOG.error("An error occurred while executing the Python script (Employee Enrolling).", e); + LOG.error( + "An error occurred while executing the Python script (Employee Enrolling).", e); } response.setFlash("Failed to enroll the Employee."); TraceBackService.trace(e); @@ -246,7 +252,7 @@ public class EmployeeController { } try { if (!employeeIds.isEmpty()) { - Beans.get(EmployeeService.class).massUpdateEmployeeConfig(employeeIds, configSelect,true); + Beans.get(EmployeeService.class).massUpdateEmployeeConfig(employeeIds, configSelect, true); response.setReload(true); } } catch (Exception e) { @@ -267,13 +273,12 @@ public class EmployeeController { } try { if (!employeeIds.isEmpty()) { - Beans.get(EmployeeService.class).massUpdateEmployeeConfig(employeeIds, configSelect,false); + Beans.get(EmployeeService.class).massUpdateEmployeeConfig(employeeIds, configSelect, false); response.setReload(true); } } catch (Exception e) { TraceBackService.trace(response, e); } - } - + } } diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/GrandingController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/GrandingController.java index 5c358b8..390b2d9 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/GrandingController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/GrandingController.java @@ -1,22 +1,17 @@ package com.axelor.apps.hr.web; - import com.axelor.apps.hr.db.Granding; import com.axelor.apps.hr.db.repo.GrandingRepository; +import com.axelor.exception.service.TraceBackService; import com.axelor.inject.Beans; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; -import java.time.temporal.TemporalAdjusters; -import java.util.LinkedHashMap; -import java.util.stream.Collectors; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStreamReader; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.invoke.MethodHandles; -import com.axelor.exception.service.TraceBackService; -import java.io.IOException; - public class GrandingController { @@ -31,15 +26,18 @@ public class GrandingController { String code = granding.getCode().toString(); try { - + String[] args = { "python", "C:\\Users\\administrator\\Desktop\\attendance\\main.py", - "--commande", "ping", - "--ip_address", ipAdress, - "--code", code + "--commande", + "ping", + "--ip_address", + ipAdress, + "--code", + code }; - + Process p = Runtime.getRuntime().exec(args); // Capture the output stream (standard output) @@ -83,4 +81,4 @@ public class GrandingController { Thread.currentThread().interrupt(); } } -} \ No newline at end of file +} diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/MonthlyReportController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/MonthlyReportController.java index e378b52..9d8bbb6 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/MonthlyReportController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/MonthlyReportController.java @@ -3,26 +3,26 @@ package com.axelor.apps.hr.web; import com.axelor.apps.base.db.Period; import com.axelor.apps.base.db.repo.PeriodRepository; import com.axelor.apps.hr.db.Absence; -import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.DailyReport; +import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.MonthlyReport; import com.axelor.apps.hr.db.repo.AbsenceRepository; +import com.axelor.apps.hr.db.repo.DailyReportRepository; import com.axelor.apps.hr.db.repo.EmployeeRepository; import com.axelor.apps.hr.db.repo.MonthlyReportRepository; -import com.axelor.apps.hr.db.repo.DailyReportRepository; import com.axelor.apps.hr.service.MonthlyReportServiceImpl; import com.axelor.inject.Beans; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; +import java.lang.invoke.MethodHandles; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.temporal.TemporalAdjusters; import java.util.ArrayList; import java.util.LinkedHashMap; +import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import java.lang.invoke.MethodHandles; -import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +41,7 @@ public class MonthlyReportController { LocalDate startDate = period.getFromDate(); LocalDate endDate = period.getToDate(); - //int remainingDateToLastOfMonth = calculateDaysExcludingFridaysAndThursdays(endDate); + // int remainingDateToLastOfMonth = calculateDaysExcludingFridaysAndThursdays(endDate); // Get active employees in this period List employees = @@ -72,29 +72,28 @@ public class MonthlyReportController { // Iterate over employees and calculate/update MonthlyReport instances for (Employee employee : employees) { // Filter rapport journaliers for the current employee - List employeeDailyReports = allDailyReports - .stream() - .filter(r -> r.getEmployee().equals(employee)) - .collect(Collectors.toList()); + List employeeDailyReports = + allDailyReports + .stream() + .filter(r -> r.getEmployee().equals(employee)) + .collect(Collectors.toList()); // Filter absences for the current employee - List employeeAbsences = allAbsences - .stream() - .filter(a -> a.getEmployee().equals(employee)) - .collect(Collectors.toList()); + List employeeAbsences = + allAbsences + .stream() + .filter(a -> a.getEmployee().equals(employee)) + .collect(Collectors.toList()); if (!employeeDailyReports.isEmpty() || !employeeAbsences.isEmpty()) { - System.out.println("Create monthly report for employee: "+ employee.getRegistrationNumber()); + System.out.println( + "Create monthly report for employee: " + employee.getRegistrationNumber()); // Process the employee's monthly report using filtered rapport and absences - Beans.get(MonthlyReportServiceImpl.class).createMensuelReport( - employee, - period, - startDate, - endDate, - employeeDailyReports, - employeeAbsences); + Beans.get(MonthlyReportServiceImpl.class) + .createMensuelReport( + employee, period, startDate, endDate, employeeDailyReports, employeeAbsences); } else { - log.error("No Daily Reports exist for employee: "+ employee.getRegistrationNumber()); + log.error("No Daily Reports exist for employee: " + employee.getRegistrationNumber()); } } // Indicate that the action was successful and a reload is needed @@ -126,35 +125,36 @@ public class MonthlyReportController { // Check if employeesObject is not null and cast it to a list if (employeesObject instanceof List) { - List> employeesList = (List>) employeesObject; + List> employeesList = + (List>) employeesObject; - // Loop through each employee in the list - for (LinkedHashMap employeeMap : employeesList) { - Integer employeeIdInt = (Integer) employeeMap.get("id"); - - // Check for null ID to avoid potential NullPointerException - if (employeeIdInt != null) { - Long employeeId = employeeIdInt.longValue(); - - // Retrieve the employee from the repository - Employee employee = Beans.get(EmployeeRepository.class).find(employeeId); - - if (employee != null) { - employees.add(employee); // Use add() instead of append() - } else { - System.out.println("Employee with ID " + employeeId + " not found."); - } - } else { - System.out.println("Employee ID is missing in the employeeMap."); - } + // Loop through each employee in the list + for (LinkedHashMap employeeMap : employeesList) { + Integer employeeIdInt = (Integer) employeeMap.get("id"); + + // Check for null ID to avoid potential NullPointerException + if (employeeIdInt != null) { + Long employeeId = employeeIdInt.longValue(); + + // Retrieve the employee from the repository + Employee employee = Beans.get(EmployeeRepository.class).find(employeeId); + + if (employee != null) { + employees.add(employee); // Use add() instead of append() + } else { + System.out.println("Employee with ID " + employeeId + " not found."); + } + } else { + System.out.println("Employee ID is missing in the employeeMap."); } + } } else { response.setFlash("No employees Selected."); } - //int remainingDateToLastOfMonth = calculateDaysExcludingFridaysAndThursdays(endDate); + // int remainingDateToLastOfMonth = calculateDaysExcludingFridaysAndThursdays(endDate); List employeesIds = new ArrayList<>(); - for(Employee e:employees){ + for (Employee e : employees) { employeesIds.add(e.getId().intValue()); } @@ -162,7 +162,8 @@ public class MonthlyReportController { List allDailyReports = Beans.get(DailyReportRepository.class) .all() - .filter("self.employee in :employeesIds and self.reportDate >= :startDate and self.reportDate <= :endDate") + .filter( + "self.employee in :employeesIds and self.reportDate >= :startDate and self.reportDate <= :endDate") .bind("startDate", startDate) .bind("endDate", endDate) .bind("employeesIds", employeesIds) @@ -172,7 +173,8 @@ public class MonthlyReportController { List allAbsences = Beans.get(AbsenceRepository.class) .all() - .filter("self.employee in :employeesIds and DATE(self.startDate) >= :startDate and DATE(self.startDate) <= :endDate") + .filter( + "self.employee in :employeesIds and DATE(self.startDate) >= :startDate and DATE(self.startDate) <= :endDate") .bind("startDate", startDate) .bind("endDate", endDate) .bind("employeesIds", employeesIds) @@ -180,42 +182,59 @@ public class MonthlyReportController { for (Employee employee : employees) { // Check if a MonthlyReport exists for this employee in the specified period - MonthlyReport monthlyReport = Beans.get(MonthlyReportRepository.class) - .all() - .filter("self.employee = :employee and self.period = :period") - .bind("employee", employee) - .bind("period", period) - .fetchOne(); + MonthlyReport monthlyReport = + Beans.get(MonthlyReportRepository.class) + .all() + .filter("self.employee = :employee and self.period = :period") + .bind("employee", employee) + .bind("period", period) + .fetchOne(); Optional monthlyReportOpt = Optional.ofNullable(monthlyReport); // Filter daily reports for the current employee - List employeeDailyReports = allDailyReports.stream() - .filter(r -> r.getEmployee().equals(employee)) - .collect(Collectors.toList()); + List employeeDailyReports = + allDailyReports + .stream() + .filter(r -> r.getEmployee().equals(employee)) + .collect(Collectors.toList()); // Filter absences for the current employee - List employeeAbsences = allAbsences.stream() - .filter(a -> a.getEmployee().equals(employee)) - .collect(Collectors.toList()); + List employeeAbsences = + allAbsences + .stream() + .filter(a -> a.getEmployee().equals(employee)) + .collect(Collectors.toList()); if (!employeeDailyReports.isEmpty() || !employeeAbsences.isEmpty()) { - if (monthlyReportOpt.isPresent()) { - MonthlyReport existingReport = monthlyReportOpt.get(); - System.out.println("Update monthly report for employee: " + employee.getRegistrationNumber()); - // Update the existing monthly report - Beans.get(MonthlyReportServiceImpl.class).updateMensuelReport(existingReport, employee, period, startDate, endDate, employeeDailyReports, employeeAbsences); - } else { - System.out.println("Create monthly report for employee: " + employee.getRegistrationNumber()); - // Create a new monthly report - Beans.get(MonthlyReportServiceImpl.class).createMensuelReport(employee, period, startDate, endDate, employeeDailyReports, employeeAbsences); - } + if (monthlyReportOpt.isPresent()) { + MonthlyReport existingReport = monthlyReportOpt.get(); + System.out.println( + "Update monthly report for employee: " + employee.getRegistrationNumber()); + // Update the existing monthly report + Beans.get(MonthlyReportServiceImpl.class) + .updateMensuelReport( + existingReport, + employee, + period, + startDate, + endDate, + employeeDailyReports, + employeeAbsences); + } else { + System.out.println( + "Create monthly report for employee: " + employee.getRegistrationNumber()); + // Create a new monthly report + Beans.get(MonthlyReportServiceImpl.class) + .createMensuelReport( + employee, period, startDate, endDate, employeeDailyReports, employeeAbsences); + } } else { - System.err.println("No Daily Reports exist for employee: " + employee.getRegistrationNumber()); + System.err.println( + "No Daily Reports exist for employee: " + employee.getRegistrationNumber()); } - } - - + } + // Indicate that the action was successful and a reload is needed response.setReload(true); } catch (Exception e) { diff --git a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/leave/LeaveController.java b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/leave/LeaveController.java index def2152..7e2889a 100644 --- a/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/leave/LeaveController.java +++ b/modules/axelor-open-suite/axelor-human-resource/src/main/java/com/axelor/apps/hr/web/leave/LeaveController.java @@ -51,8 +51,6 @@ import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.google.inject.Singleton; import com.google.inject.persist.Transactional; -import java.util.List; -import java.util.Map; import java.io.BufferedReader; import java.io.InputStreamReader; import java.lang.invoke.MethodHandles; @@ -502,5 +500,4 @@ public class LeaveController { } } } - } diff --git a/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageService.java b/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageService.java index 2660821..13bc1fb 100644 --- a/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageService.java +++ b/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageService.java @@ -19,6 +19,7 @@ package com.axelor.apps.message.service; import com.axelor.apps.message.db.Message; import com.axelor.apps.message.db.Template; +import com.axelor.auth.db.User; import com.axelor.db.Model; import com.axelor.exception.AxelorException; import com.axelor.meta.db.MetaFile; @@ -26,8 +27,6 @@ import com.axelor.tool.template.TemplateMaker; import java.io.IOException; import java.util.Set; import javax.mail.MessagingException; -import com.axelor.auth.db.User; -import java.util.List; public interface TemplateMessageService { @@ -44,8 +43,8 @@ public interface TemplateMessageService { InstantiationException, IllegalAccessException; public Message generateAndSendMessageToBulkUsers(Model model, Template template, Set users) - throws MessagingException, IOException, AxelorException, ClassNotFoundException, - InstantiationException, IllegalAccessException; + throws MessagingException, IOException, AxelorException, ClassNotFoundException, + InstantiationException, IllegalAccessException; public Set getMetaFiles(Template template) throws AxelorException, IOException; diff --git a/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageServiceImpl.java b/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageServiceImpl.java index 06b7f25..200a383 100644 --- a/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageServiceImpl.java +++ b/modules/axelor-open-suite/axelor-message/src/main/java/com/axelor/apps/message/service/TemplateMessageServiceImpl.java @@ -22,10 +22,12 @@ import com.axelor.apps.message.db.EmailAddress; import com.axelor.apps.message.db.Message; import com.axelor.apps.message.db.Template; import com.axelor.apps.message.db.TemplateContext; +import com.axelor.apps.message.db.repo.EmailAccountRepository; import com.axelor.apps.message.db.repo.EmailAddressRepository; import com.axelor.apps.message.db.repo.MessageRepository; import com.axelor.apps.message.db.repo.TemplateRepository; import com.axelor.apps.message.exception.IExceptionMessage; +import com.axelor.auth.db.User; import com.axelor.db.EntityHelper; import com.axelor.db.JPA; import com.axelor.db.Model; @@ -50,21 +52,20 @@ import com.google.inject.persist.Transactional; import java.io.IOException; import java.lang.invoke.MethodHandles; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.ArrayList; import java.util.Set; -import java.util.HashSet; import javax.mail.MessagingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.axelor.auth.db.User; public class TemplateMessageServiceImpl implements TemplateMessageService { private static final String RECIPIENT_SEPARATOR = ";|,"; private static final char TEMPLATE_DELIMITER = '$'; + @Inject protected EmailAccountRepository mailAccountRepo; private final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -235,7 +236,7 @@ public class TemplateMessageServiceImpl implements TemplateMessageService { // Set recipients as sets message.setToEmailAddressSet(emailAddresses); message.setCcEmailAddressSet(emailAddresses); - + messageService.sendMessage(message); return message; @@ -350,6 +351,33 @@ public class TemplateMessageServiceImpl implements TemplateMessageService { return mailAccount; } + System.out.println("getMailAccount"); + // EmailAccount mailAccount = Beans.get(MailAccountService.class).getDefaultSender(); + EmailAccount mail = getDefaultSender(); + + // if (mailAccount != null) { + // log.debug("Email account ::: {}", mailAccount); + // return mailAccount; + // } + if (mail != null) { + log.debug("Email ::: {}", mail); + return mail; + } + return null; + } + + protected EmailAccount getDefaultSender() { + EmailAccount mail = + mailAccountRepo + .all() + .filter( + "self.isDefault = true AND self.serverTypeSelect = ?1", + EmailAccountRepository.SERVER_TYPE_SMTP) + .fetchOne(); + if (mail != null) { + log.debug("Email ::: {}", mail); + return mail; + } return null; } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/exceptions/IExceptionMessage.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/exceptions/IExceptionMessage.java index bac5c09..749efc4 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/exceptions/IExceptionMessage.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/exceptions/IExceptionMessage.java @@ -147,4 +147,6 @@ public interface IExceptionMessage { static final String UNIT_COST_CALCULATION_NO_PRODUCT = /*$$(*/ "Please select an element (a product, a product category or a product family) to run calculation" /*)*/; + + static final String STOCK_MOVE_NOT_VALIDATED = /*$$(*/ "Stock move not validated by SCH" /*)*/; } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/BillOfMaterialServiceImpl.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/BillOfMaterialServiceImpl.java index 254c7b1..d335788 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/BillOfMaterialServiceImpl.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/BillOfMaterialServiceImpl.java @@ -24,8 +24,11 @@ import com.axelor.apps.base.service.ProductService; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.production.db.BillOfMaterial; import com.axelor.apps.production.db.BillOfMaterialConsumption; +import com.axelor.apps.production.db.ManufOrder; import com.axelor.apps.production.db.TempBomTree; +import com.axelor.apps.production.db.repo.BillOfMaterialConsumptionRepository; import com.axelor.apps.production.db.repo.BillOfMaterialRepository; +import com.axelor.apps.production.db.repo.ManufOrderRepository; import com.axelor.apps.production.db.repo.TempBomTreeRepository; import com.axelor.apps.production.exceptions.IExceptionMessage; import com.axelor.apps.production.report.IReport; @@ -50,7 +53,6 @@ import java.util.Set; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.axelor.apps.production.db.repo.BillOfMaterialConsumptionRepository; public class BillOfMaterialServiceImpl implements BillOfMaterialService { @@ -373,23 +375,67 @@ public class BillOfMaterialServiceImpl implements BillOfMaterialService { return newBom; } - @Transactional - public BillOfMaterialConsumption createBomConsumptionFromRawMaterial(BillOfMaterial bom) { + public BillOfMaterialConsumption createBomConsumptionFromRawMaterial( + BillOfMaterial bom, ManufOrder manufOrder) { BillOfMaterialConsumption newBom = new BillOfMaterialConsumption(); newBom.setDefineSubBillOfMaterial(false); newBom.setPriority(bom.getPriority()); newBom.setProduct(bom.getProduct()); newBom.setQty(bom.getQty()); newBom.setRealQty(bom.getQty()); - newBom.setUnit(bom.getUnit()); + newBom.setUnit(bom.getUnit()); newBom.setName(bom.getName()); newBom.setFullName(bom.getFullName()); - // billOfMaterialConsumptionRepository.save(newBom); - + newBom.setManufOrder(manufOrder); return newBom; } + @Transactional + public void createBomAndAttachToManufOrder(ManufOrder manufOrder) { + if (manufOrder.getBillOfMaterial() != null + && manufOrder.getBillOfMaterialConsumptionList().size() == 0) { + for (BillOfMaterial bom : manufOrder.getBillOfMaterial().getBillOfMaterialSet()) { + BillOfMaterialConsumption newBom = + Beans.get(BillOfMaterialServiceImpl.class) + .createBomConsumptionFromRawMaterial(bom, manufOrder); + manufOrder.addBillOfMaterialConsumptionListItem(newBom); + } + log.debug( + "Bill of Material Consumption List size: {}", + manufOrder.getBillOfMaterialConsumptionList().size()); + Beans.get(ManufOrderRepository.class).save(manufOrder); + } + } + /** + * Splits the Bill of Material consumption line into two lines. + * + * @param manufOrder + * @param billConsumptionList + * @param splitQty + */ + @Transactional + public void splitBillOfMaterialConsumption( + ManufOrder manufOrder, + List billConsumptionList, + BigDecimal splitQty) { + for (BillOfMaterialConsumption billOfMaterialConsumption : billConsumptionList) { + + BigDecimal totalQty = billOfMaterialConsumption.getQty(); + totalQty = totalQty.subtract(splitQty); + BillOfMaterialConsumption newLine = + Beans.get(BillOfMaterialConsumptionRepository.class) + .copy(billOfMaterialConsumption, true); + newLine.setProduct(billOfMaterialConsumption.getProduct()); + newLine.setRealQty(splitQty); + newLine.setQty(splitQty); + newLine.setUnit(billOfMaterialConsumption.getUnit()); + newLine.setName(billOfMaterialConsumption.getName()); + newLine.setTrackingNumber(billOfMaterialConsumption.getTrackingNumber()); + billOfMaterialConsumption.setQty(totalQty); + manufOrder.addBillOfMaterialConsumptionListItem(newLine); + } + } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/MrpServiceProductionImpl.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/MrpServiceProductionImpl.java index 5adc8d9..a51bd80 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/MrpServiceProductionImpl.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/MrpServiceProductionImpl.java @@ -41,13 +41,11 @@ import com.axelor.apps.supplychain.db.Mrp; import com.axelor.apps.supplychain.db.MrpForecast; import com.axelor.apps.supplychain.db.MrpLine; import com.axelor.apps.supplychain.db.MrpLineOrigin; -import com.axelor.apps.supplychain.db.MrpLineSaleAndMargin; import com.axelor.apps.supplychain.db.MrpLineSophal; import com.axelor.apps.supplychain.db.MrpLineType; import com.axelor.apps.supplychain.db.ProductionMasterPlan; import com.axelor.apps.supplychain.db.repo.MrpForecastRepository; import com.axelor.apps.supplychain.db.repo.MrpLineRepository; -import com.axelor.apps.supplychain.db.repo.MrpLineSaleAndMarginRepository; import com.axelor.apps.supplychain.db.repo.MrpLineSophalRepository; import com.axelor.apps.supplychain.db.repo.MrpLineTypeRepository; import com.axelor.apps.supplychain.db.repo.MrpRepository; @@ -65,15 +63,9 @@ import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.mozilla.universalchardet.prober.statemachine.Big5SMModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -475,9 +467,7 @@ public class MrpServiceProductionImpl extends MrpServiceImpl { Map productQty) throws AxelorException { - - log.debug("****** FORTHUPPER ******** {} {}",product,qty); - + log.debug("****** FORTHUPPER ******** {} {}", product, qty); if (mrp.getIncludeBOM()) { @@ -487,16 +477,20 @@ public class MrpServiceProductionImpl extends MrpServiceImpl { super.createdProductionMasterPlan(product, mrp, qty, defaultBillOfMaterial.getQty()); - for (BillOfMaterial billOfMaterial : defaultBillOfMaterial.getBillOfMaterialSet()) { - List productionMasterPlans = Beans.get(ProductionMasterPlanRepository.class).all().fetchStream() - .filter(t -> t.getProduct() == product && t.getMrp() == mrp).collect(Collectors.toList()); + List productionMasterPlans = + Beans.get(ProductionMasterPlanRepository.class) + .all() + .fetchStream() + .filter(t -> t.getProduct() == product && t.getMrp() == mrp) + .collect(Collectors.toList()); Product subProduct = billOfMaterial.getProduct(); if (this.isMrpProduct(subProduct)) { - Double prodQty = productQty.get(subProduct.getId()) == null + Double prodQty = + productQty.get(subProduct.getId()) == null ? Double.parseDouble("0") : productQty.get(subProduct.getId()); @@ -512,8 +506,6 @@ public class MrpServiceProductionImpl extends MrpServiceImpl { productionMasterPlans); } } - - } } else { super.createMrpLineSophal(mrp, product, unit, qty, mrpForecastList, productQty); @@ -528,113 +520,119 @@ public class MrpServiceProductionImpl extends MrpServiceImpl { BigDecimal qty, BillOfMaterial billOfMaterial, BigDecimal defaultQty, - List productionMasterPlans ) throws AxelorException { + List productionMasterPlans) + throws AxelorException { MrpLineSophal mrpLineSophal = new MrpLineSophal(); - log.debug("****** FORTH ******** {} {}",product,qty); - + log.debug("****** FORTH ******** {} {}", product, qty); BigDecimal qtyReqPerBatch = billOfMaterial.getQty(); int currentMonth = LocalDate.now().getMonth().getValue(); BigDecimal currentProductionPlan = BigDecimal.ZERO; - BigDecimal remaining= BigDecimal.ZERO; + BigDecimal remaining = BigDecimal.ZERO; BigDecimal decreasingQty = qty; BigDecimal totalQtyUsed = BigDecimal.ZERO; BigDecimal futureQty = BigDecimal.ZERO; BigDecimal purchaseQty = BigDecimal.ZERO; - - - if(mrp.getIncludeFutureQty()){ - futureQty = Beans.get(StockLocationServiceImpl.class).getFutureQty(product.getId(), mrp.getStockLocation().getCompany().getId(), 0L); + + if (mrp.getIncludeFutureQty()) { + futureQty = + Beans.get(StockLocationServiceImpl.class) + .getFutureQty(product.getId(), mrp.getStockLocation().getCompany().getId(), 0L); decreasingQty = decreasingQty.add(futureQty); } - if(mrp.getIncludePurchaseQty()){ - purchaseQty = Beans.get(ProductStockLocationServiceImpl.class).getPurchaseOrderQty(product, mrp.getStockLocation().getCompany(), null); + if (mrp.getIncludePurchaseQty()) { + purchaseQty = + Beans.get(ProductStockLocationServiceImpl.class) + .getPurchaseOrderQty(product, mrp.getStockLocation().getCompany(), null); decreasingQty = decreasingQty.add(purchaseQty); } - + BigDecimal initialQty = decreasingQty; for (int index = currentMonth; index < 13; index++) { - currentProductionPlan = getCurrentProductionPlan(parentProduct, mrp, index); - BigDecimal qtyReqForProd = currentProductionPlan.multiply(qtyReqPerBatch); - if(mrp.getIncludeBomWaste()){ - qtyReqForProd = qtyReqForProd.add(qtyReqForProd.multiply(billOfMaterial.getWasteRate().divide(new BigDecimal("100"),0,RoundingMode.HALF_UP))); - } + currentProductionPlan = getCurrentProductionPlan(parentProduct, mrp, index); + BigDecimal qtyReqForProd = currentProductionPlan.multiply(qtyReqPerBatch); + if (mrp.getIncludeBomWaste()) { + qtyReqForProd = + qtyReqForProd.add( + qtyReqForProd.multiply( + billOfMaterial + .getWasteRate() + .divide(new BigDecimal("100"), 0, RoundingMode.HALF_UP))); + } - totalQtyUsed.add(qtyReqForProd); - log.debug("totalQtyUsed**************** {}",totalQtyUsed); - - if(decreasingQty.compareTo(qtyReqForProd) > 0) { - remaining = decreasingQty.subtract(qtyReqForProd); - decreasingQty = BigDecimal.ZERO; - }else{ - - remaining = BigDecimal.ZERO; - - decreasingQty = qtyReqForProd.subtract(decreasingQty); + totalQtyUsed.add(qtyReqForProd); + log.debug("totalQtyUsed**************** {}", totalQtyUsed); - if(mrp.getIncludeStockRule()){ - StockRules stockRules = stockRulesService.getStockRules( - product, - null, - StockRulesRepository.TYPE_FUTURE, - StockRulesRepository.USE_CASE_USED_FOR_MRP); - if(stockRules != null && stockRules.getReOrderQty() != null){ - decreasingQty = stockRules.getReOrderQty().max(decreasingQty); - } + if (decreasingQty.compareTo(qtyReqForProd) > 0) { + remaining = decreasingQty.subtract(qtyReqForProd); + decreasingQty = BigDecimal.ZERO; + } else { + + remaining = BigDecimal.ZERO; + + decreasingQty = qtyReqForProd.subtract(decreasingQty); + + if (mrp.getIncludeStockRule()) { + StockRules stockRules = + stockRulesService.getStockRules( + product, + null, + StockRulesRepository.TYPE_FUTURE, + StockRulesRepository.USE_CASE_USED_FOR_MRP); + if (stockRules != null && stockRules.getReOrderQty() != null) { + decreasingQty = stockRules.getReOrderQty().max(decreasingQty); } + } + } - } - - switch (index) { - case 1: - mrpLineSophal.setJanuary(decreasingQty); - break; - case 2: - mrpLineSophal.setFebruary(decreasingQty); - break; - case 3: - mrpLineSophal.setMarch(decreasingQty); - break; - case 4: - mrpLineSophal.setApril(decreasingQty); - case 5: - mrpLineSophal.setMay(decreasingQty); - case 6: - mrpLineSophal.setJuin(decreasingQty); - break; - case 7: - mrpLineSophal.setJuly(decreasingQty); - break; - case 8: - mrpLineSophal.setAugust(decreasingQty); - break; - case 9: - mrpLineSophal.setSeptember(decreasingQty); - break; - case 10: - mrpLineSophal.setOctober(decreasingQty); - break; - case 11: - mrpLineSophal.setNovember(decreasingQty); - break; - case 12: - mrpLineSophal.setDecember(decreasingQty); - break; - default: - break; - } + switch (index) { + case 1: + mrpLineSophal.setJanuary(decreasingQty); + break; + case 2: + mrpLineSophal.setFebruary(decreasingQty); + break; + case 3: + mrpLineSophal.setMarch(decreasingQty); + break; + case 4: + mrpLineSophal.setApril(decreasingQty); + case 5: + mrpLineSophal.setMay(decreasingQty); + case 6: + mrpLineSophal.setJuin(decreasingQty); + break; + case 7: + mrpLineSophal.setJuly(decreasingQty); + break; + case 8: + mrpLineSophal.setAugust(decreasingQty); + break; + case 9: + mrpLineSophal.setSeptember(decreasingQty); + break; + case 10: + mrpLineSophal.setOctober(decreasingQty); + break; + case 11: + mrpLineSophal.setNovember(decreasingQty); + break; + case 12: + mrpLineSophal.setDecember(decreasingQty); + break; + default: + break; + } - if(remaining.compareTo(BigDecimal.ZERO) > 0){ - decreasingQty = decreasingQty.add(remaining); - }else{ - decreasingQty = BigDecimal.ZERO; - } - + if (remaining.compareTo(BigDecimal.ZERO) > 0) { + decreasingQty = decreasingQty.add(remaining); + } else { + decreasingQty = BigDecimal.ZERO; + } } - mrpLineSophal.setQty(qty); mrpLineSophal.setTotalQtyUsed(totalQtyUsed); mrpLineSophal.setInitialQty(initialQty); @@ -648,56 +646,58 @@ public class MrpServiceProductionImpl extends MrpServiceImpl { Beans.get(MrpLineSophalRepository.class).save(mrpLineSophal); } + private BigDecimal getCurrentProductionPlan(Product product, Mrp mrp, int monthSelect) { - private BigDecimal getCurrentProductionPlan(Product product,Mrp mrp,int monthSelect){ + ProductionMasterPlan productionMasterPlan = + Beans.get(ProductionMasterPlanRepository.class) + .all() + .fetchStream() + .filter(t -> t.getProduct() == product && t.getMrp() == mrp) + .findFirst() + .orElse(null); - ProductionMasterPlan productionMasterPlan = Beans.get(ProductionMasterPlanRepository.class).all().fetchStream().filter(t -> t.getProduct() == product && t.getMrp() == mrp).findFirst().orElse(null); + log.debug("productionMasterPlan >>>>>>>>>>>> {}", productionMasterPlan); - log.debug("productionMasterPlan >>>>>>>>>>>> {}" , productionMasterPlan); + if (productionMasterPlan != null) { - if(productionMasterPlan != null){ - switch (monthSelect) { case 1: return productionMasterPlan.getJanuaryBatchQty(); - + case 2: return productionMasterPlan.getFebruaryBatchQty(); - + case 3: return productionMasterPlan.getMarchBatchQty(); - + case 4: return productionMasterPlan.getAprilBatchQty(); case 5: return productionMasterPlan.getMayBatchQty(); case 6: return productionMasterPlan.getJuinBatchQty(); - + case 7: return productionMasterPlan.getJulyBatchQty(); - + case 8: return productionMasterPlan.getAugustBatchQty(); - + case 9: return productionMasterPlan.getSeptemberBatchQty(); - + case 10: return productionMasterPlan.getOctoberBatchQty(); - + case 11: return productionMasterPlan.getNovemberBatchQty(); - + case 12: return productionMasterPlan.getDecemberBatchQty(); default: return BigDecimal.ZERO; } - } return BigDecimal.ZERO; - } - } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/Previous.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/Previous.java index 7884ad2..c820f5d 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/Previous.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/Previous.java @@ -1,50 +1,34 @@ package com.axelor.apps.production.service; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.time.LocalDate; -import java.time.Month; -import java.time.format.TextStyle; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; - -import com.axelor.apps.supplychain.db.MrpForecast; public class Previous { - - - public static void main(String[] args) throws IOException { - String s = null; - Process p = Runtime.getRuntime().exec("python /Users\\Bachir.souldi.SOPHAL\\Desktop\\dev\\whatsapp_erp\\index.py hello"); - BufferedReader stdInput = new BufferedReader(new - InputStreamReader(p.getInputStream())); + public static void main(String[] args) throws IOException { + String s = null; - BufferedReader stdError = new BufferedReader(new - InputStreamReader(p.getErrorStream())); + Process p = + Runtime.getRuntime() + .exec( + "python /Users\\Bachir.souldi.SOPHAL\\Desktop\\dev\\whatsapp_erp\\index.py hello"); + BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream())); - // read the output from the command - System.out.println("Here is the standard output of the command:\n"); - while ((s = stdInput.readLine()) != null) { - System.out.println(s); - } - - // read any errors from the attempted command - System.out.println("Here is the standard error of the command (if any):\n"); - while ((s = stdError.readLine()) != null) { - System.out.println(s); - } - - System.exit(0); - } + BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream())); - - + // read the output from the command + System.out.println("Here is the standard output of the command:\n"); + while ((s = stdInput.readLine()) != null) { + System.out.println(s); } - \ No newline at end of file + + // read any errors from the attempted command + System.out.println("Here is the standard error of the command (if any):\n"); + while ((s = stdError.readLine()) != null) { + System.out.println(s); + } + + System.exit(0); + } +} diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/StockMoveProductionServiceImpl.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/StockMoveProductionServiceImpl.java index 9f117cf..d6d6b82 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/StockMoveProductionServiceImpl.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/StockMoveProductionServiceImpl.java @@ -67,10 +67,10 @@ public class StockMoveProductionServiceImpl extends StockMoveServiceSupplychainI @Override public void checkExpirationDates(StockMove stockMove) throws AxelorException { - if (stockMove.getInManufOrder() != null) { - stockMoveLineService.checkExpirationDates(stockMove); - } else { - super.checkExpirationDates(stockMove); - } + // if (stockMove.getInManufOrder() != null) { + // stockMoveLineService.checkExpirationDates(stockMove); + // } else { + super.checkExpirationDates(stockMove); + // } } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderService.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderService.java index 242410e..786d8a3 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderService.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderService.java @@ -68,6 +68,10 @@ public interface ManufOrderService { public void createToConsumeProdProductList(ManufOrder manufOrder); + @Transactional(rollbackOn = {Exception.class}) + public StockMove createToConsumeProdProductList(ManufOrder manufOrder, int size) + throws AxelorException; + /** * Compute the quantity on generated prod product line. If the quantity of the bill of material is * equal to the quantity of manuf order then the prod product line will have the same quantity as @@ -239,4 +243,7 @@ public interface ManufOrderService { * @return the query. */ public String getBuildingQtyForAProduct(Long productId, Long companyId, Long stockLocationId); + + @Transactional(rollbackOn = {Exception.class}) + public StockMove createOutgoinfStockMove(ManufOrder manufOrder) throws AxelorException; } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderServiceImpl.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderServiceImpl.java index 5d40e06..d34e05d 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderServiceImpl.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderServiceImpl.java @@ -123,7 +123,6 @@ public class ManufOrderServiceImpl implements ManufOrderService { } Company company = billOfMaterial.getCompany(); - // BigDecimal bomQty = billOfMaterial.getQty(); // BigDecimal qty = qtyRequested.divide(bomQty, 0, RoundingMode.CEILING).multiply(bomQty); @@ -150,6 +149,100 @@ public class ManufOrderServiceImpl implements ManufOrderService { } @Override + @Transactional(rollbackOn = {Exception.class}) + public StockMove createToConsumeProdProductList(ManufOrder manufOrder, int times) + throws AxelorException { + + BigDecimal manufOrderQty = manufOrder.getQty(); + + BillOfMaterial billOfMaterial = manufOrder.getBillOfMaterial(); + + BigDecimal bomQty = billOfMaterial.getQty(); + + StockMove stockMove = + Beans.get(ManufOrderStockMoveService.class) + ._createToConsumeStockMove(manufOrder, manufOrder.getCompany()); + + if (billOfMaterial.getBillOfMaterialSet() != null) { + + for (BillOfMaterial billOfMaterialLine : + getSortedBillsOfMaterials(billOfMaterial.getBillOfMaterialSet())) { + + if (!billOfMaterialLine.getHasNoManageStock()) { + + Product product = + productVariantService.getProductVariant( + manufOrder.getProduct(), billOfMaterialLine.getProduct()); + + BigDecimal qty = + computeToConsumeProdProductLineQuantity( + bomQty, manufOrderQty, billOfMaterialLine.getQty()) + .multiply(new BigDecimal(times)); + + ProdProduct prodProduct = new ProdProduct(product, qty, billOfMaterialLine.getUnit()); + StockMoveLine stockMoveline = + Beans.get(ManufOrderStockMoveService.class) + ._createStockMoveLine( + prodProduct, stockMove, StockMoveLineService.TYPE_IN_PRODUCTIONS); + stockMove.addStockMoveLineListItem(stockMoveline); + } + } + } + return Beans.get(StockMoveRepository.class).save(stockMove); + } + + @Override + @Transactional(rollbackOn = {Exception.class}) + public StockMove createOutgoinfStockMove(ManufOrder manufOrder) throws AxelorException { + + BigDecimal manufOrderQty = manufOrder.getQty(); + BillOfMaterial billOfMaterial = manufOrder.getBillOfMaterial(); + BigDecimal bomQty = billOfMaterial.getQty(); + + StockConfigProductionService stockConfigService = Beans.get(StockConfigProductionService.class); + StockConfig stockConfig = stockConfigService.getStockConfig(manufOrder.getCompany()); + StockLocation virtualStockLocation = + stockConfigService.getProductionVirtualStockLocation(stockConfig); + + StockMove stockMove = + Beans.get(ManufOrderStockMoveService.class) + ._createToConsumeStockMove(manufOrder, manufOrder.getCompany()); + + stockMove.setPartner(manufOrder.getCompany().getPartner()); + stockMove.setTypeSelect(StockMoveRepository.TYPE_OUTGOING); + stockMove.setFromStockLocation(manufOrder.getWorkshopStockLocation()); + stockMove.setToStockLocation(virtualStockLocation); + + if (billOfMaterial.getBillOfMaterialSet() != null) { + + for (BillOfMaterial billOfMaterialLine : + getSortedBillsOfMaterials(billOfMaterial.getBillOfMaterialSet())) { + + if (!billOfMaterialLine.getHasNoManageStock()) { + + Product product = + productVariantService.getProductVariant( + manufOrder.getProduct(), billOfMaterialLine.getProduct()); + + BigDecimal qty = + computeToConsumeProdProductLineQuantity( + bomQty, manufOrderQty, billOfMaterialLine.getQty()); + + ProdProduct prodProduct = new ProdProduct(product, qty, billOfMaterialLine.getUnit()); + StockMoveLine stockMoveline = + Beans.get(ManufOrderStockMoveService.class) + ._createStockMoveLine( + prodProduct, stockMove, StockMoveLineService.TYPE_IN_PRODUCTIONS); + stockMove.addStockMoveLineListItem(stockMoveline); + manufOrder.addConsumedStockMoveLineListItem(stockMoveline); + } + } + } + return Beans.get(StockMoveRepository.class).save(stockMove); + } + + @Override + @Transactional(rollbackOn = {Exception.class}) public void createToConsumeProdProductList(ManufOrder manufOrder) { BigDecimal manufOrderQty = manufOrder.getQty(); @@ -180,6 +273,38 @@ public class ManufOrderServiceImpl implements ManufOrderService { } } + public void createToConsumeProdProductListFromSelectedManufOrder( + List manufOrderList) { + + BigDecimal manufOrderQty = + manufOrderList.stream().map(ManufOrder::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); + + BillOfMaterial billOfMaterial = manufOrderList.get(0).getBillOfMaterial(); + + BigDecimal bomQty = billOfMaterial.getQty(); + + if (billOfMaterial.getBillOfMaterialSet() != null) { + + for (BillOfMaterial billOfMaterialLine : + getSortedBillsOfMaterials(billOfMaterial.getBillOfMaterialSet())) { + + if (!billOfMaterialLine.getHasNoManageStock()) { + + Product product = + productVariantService.getProductVariant( + manufOrderList.get(0).getProduct(), billOfMaterialLine.getProduct()); + + BigDecimal qty = + computeToConsumeProdProductLineQuantity( + bomQty, manufOrderQty, billOfMaterialLine.getQty()); + ProdProduct prodProduct = new ProdProduct(product, qty, billOfMaterialLine.getUnit()); + manufOrderList.get(0).addToConsumeProdProductListItem(prodProduct); + prodProductRepo.persist(prodProduct); // id by order of creation + } + } + } + } + @Override public BigDecimal computeToConsumeProdProductLineQuantity( BigDecimal bomQty, BigDecimal manufOrderQty, BigDecimal lineQty) { @@ -294,11 +419,11 @@ public class ManufOrderServiceImpl implements ManufOrderService { } if (!manufOrder.getIsConsProOnOperation()) { - //bachir temp + // bachir temp // this.createToConsumeProdProductList(manufOrder); } - //bachir temp + // bachir temp // this.createToProduceProdProductList(manufOrder); return manufOrder; @@ -328,10 +453,12 @@ public class ManufOrderServiceImpl implements ManufOrderService { } } - if(manufOrder.getBillOfMaterial() != null){ + if (manufOrder.getBillOfMaterial() != null) { for (BillOfMaterial bom : manufOrder.getBillOfMaterial().getBillOfMaterialSet()) { - BillOfMaterialConsumption newBom = Beans.get(BillOfMaterialServiceImpl.class).createBomConsumptionFromRawMaterial(bom); - manufOrder.addBillOfMaterialConsumptionListItem(newBom); + BillOfMaterialConsumption newBom = + Beans.get(BillOfMaterialServiceImpl.class) + .createBomConsumptionFromRawMaterial(bom, manufOrder); + manufOrder.addBillOfMaterialConsumptionListItem(newBom); } } @@ -339,6 +466,10 @@ public class ManufOrderServiceImpl implements ManufOrderService { manufOrder.setPlannedEndDateT(manufOrderWorkflowService.computePlannedEndDateT(manufOrder)); + System.out.println("***************************"); + System.out.println("yessssssssssssssssss"); + System.out.println("***************************"); + manufOrderRepo.save(manufOrder); } @@ -373,6 +504,10 @@ public class ManufOrderServiceImpl implements ManufOrderService { productionConfigService.getManufOrderSequence( productionConfig, manufOrder.getWorkshopStockLocation()); + if (manufOrder.getStypeSelect() == ManufOrderRepository.STYPE_PACKAGING_ORDER) { + sequence = productionConfig.getPackagingOrderSequence(); + } + String seq = sequenceService.getSequenceNumber(sequence); if (seq == null) { @@ -618,12 +753,13 @@ public class ManufOrderServiceImpl implements ManufOrderService { if (stockMoveOpt.isPresent()) { stockMove = stockMoveOpt.get(); } else { - stockMove = - manufOrderStockMoveService._createToConsumeStockMove(manufOrder, manufOrder.getCompany()); - manufOrder.addInStockMoveListItem(stockMove); - Beans.get(StockMoveService.class).plan(stockMove); + // stockMove = + // manufOrderStockMoveService._createToConsumeStockMove(manufOrder, + // manufOrder.getCompany()); + // manufOrder.addInStockMoveListItem(stockMove); + // Beans.get(StockMoveService.class).plan(stockMove); } - updateStockMoveFromManufOrder(consumedStockMoveLineList, stockMove); + // updateStockMoveFromManufOrder(consumedStockMoveLineList, stockMove); } @Override @@ -741,11 +877,11 @@ public class ManufOrderServiceImpl implements ManufOrderService { .convert( stockMoveLine.getUnit(), prodProduct.getUnit(), - stockMoveLine.getQty(), - stockMoveLine.getQty().scale(), + stockMoveLine.getRealQty(), + stockMoveLine.getRealQty().scale(), product)); } else { - consumedQty = consumedQty.add(stockMoveLine.getQty()); + consumedQty = consumedQty.add(stockMoveLine.getRealQty()); } } return consumedQty.subtract(prodProduct.getQty()); diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderStockMoveService.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderStockMoveService.java index 446ec28..6553503 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderStockMoveService.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderStockMoveService.java @@ -20,6 +20,7 @@ package com.axelor.apps.production.service.manuforder; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.repo.ProductRepository; +import com.axelor.apps.production.db.BillOfMaterialConsumption; import com.axelor.apps.production.db.ManufOrder; import com.axelor.apps.production.db.OperationOrder; import com.axelor.apps.production.db.ProdProcess; @@ -33,6 +34,7 @@ import com.axelor.apps.stock.db.StockConfig; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; +import com.axelor.apps.stock.db.repo.StockMoveLineRepository; import com.axelor.apps.stock.db.repo.StockMoveRepository; import com.axelor.apps.stock.service.StockMoveLineService; import com.axelor.apps.stock.service.StockMoveService; @@ -49,6 +51,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Optional; +import java.util.Set; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -92,7 +95,34 @@ public class ManufOrderStockMoveService { // case where we had to split tracked stock move lines if (stockMove.getStockMoveLineList() != null) { for (StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) { - manufOrder.addConsumedStockMoveLineListItem(stockMoveLine); + manufOrder.addTransferedStockMoveLineListItem(stockMoveLine); + } + } + } + } + + public void createToTransferStockMove(ManufOrder manufOrder) throws AxelorException { + Company company = manufOrder.getCompany(); + + if (manufOrder.getToConsumeProdProductList() != null && company != null) { + + StockMove stockMove = this._createToConsumeStockMove(manufOrder, company); + + for (ProdProduct prodProduct : manufOrder.getToConsumeProdProductList()) { + + this._createStockMoveLine(prodProduct, stockMove, StockMoveLineService.TYPE_IN_PRODUCTIONS); + } + + if (stockMove.getStockMoveLineList() != null && !stockMove.getStockMoveLineList().isEmpty()) { + stockMoveService.plan(stockMove); + manufOrder.addInStockMoveListItem(stockMove); + } + + // fill here the consumed stock move line list item to manage the + // case where we had to split tracked stock move lines + if (stockMove.getStockMoveLineList() != null) { + for (StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) { + manufOrder.addTransferedStockMoveLineListItem(stockMoveLine); } } } @@ -114,8 +144,8 @@ public class ManufOrderStockMoveService { null, null, company, - fromStockLocation, - virtualStockLocation, + manufOrder.getProdProcess().getStockLocation(), + manufOrder.getWorkshopStockLocation(), null, manufOrder.getPlannedStartDateT().toLocalDate(), null, @@ -205,6 +235,9 @@ public class ManufOrderStockMoveService { if (stockMove.getStockMoveLineList() != null) { for (StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) { + if (manufOrder.getTrackingNumber() != null) { + stockMoveLine.setTrackingNumber(manufOrder.getTrackingNumber()); + } manufOrder.addProducedStockMoveLineListItem(stockMoveLine); } } @@ -219,7 +252,52 @@ public class ManufOrderStockMoveService { */ @Transactional(rollbackOn = {Exception.class}) public void consumeInStockMoves(ManufOrder manufOrder) throws AxelorException { + StockConfigProductionService stockConfigService = Beans.get(StockConfigProductionService.class); + StockConfig stockConfig = stockConfigService.getStockConfig(manufOrder.getCompany()); + StockLocation virtualStockLocation = + stockConfigService.getProductionVirtualStockLocation(stockConfig); + for (StockMove stockMove : manufOrder.getInStockMoveList()) { + if (stockMove.getStatusSelect() == StockMoveRepository.STATUS_REALIZED) { + StockMove move = Beans.get(StockMoveRepository.class).copy(stockMove, true); + move.setPartner(manufOrder.getCompany().getPartner()); + move.setTypeSelect(StockMoveRepository.TYPE_OUTGOING); + move.setFromStockLocation(manufOrder.getWorkshopStockLocation()); + move.setToStockLocation(virtualStockLocation); + // move.setInManufOrder(null); + move.setOutManufOrder(manufOrder); + Beans.get(StockMoveRepository.class).save(move); + if (move.getStockMoveLineList() != null) { + for (StockMoveLine stockMoveLine : move.getStockMoveLineList()) { + stockMoveLine.setTransferedManufOrder(null); + stockMoveLine.setConsumedManufOrder(manufOrder); + manufOrder.addConsumedStockMoveLineListItem(stockMoveLine); + } + } + // stockMoveService.plan(move); + } + finishStockMove(stockMove); + } + } + + @Transactional(rollbackOn = {Exception.class}) + public void validateOutStockMoves(ManufOrder manufOrder) throws AxelorException { + + for (StockMove stockMove : manufOrder.getOutStockMoveList()) { + System.out.println("***************************"); + System.out.println(stockMove.getStockMoveSeq()); + stockMoveService.plan(stockMove); + finishStockMove(stockMove); + } + } + + @Transactional(rollbackOn = {Exception.class}) + public void validateInStockMoves(ManufOrder manufOrder) throws AxelorException { + + for (StockMove stockMove : manufOrder.getInStockMoveList()) { + System.out.println("***************************"); + System.out.println(stockMove.getStockMoveSeq()); + stockMoveService.plan(stockMove); finishStockMove(stockMove); } } @@ -270,7 +348,7 @@ public class ManufOrderStockMoveService { return stockMove; } - protected StockMoveLine _createStockMoveLine( + public StockMoveLine _createStockMoveLine( ProdProduct prodProduct, StockMove stockMove, int inOrOutType) throws AxelorException { return _createStockMoveLine(prodProduct, stockMove, inOrOutType, prodProduct.getQty()); @@ -318,9 +396,11 @@ public class ManufOrderStockMoveService { for (StockMove stockMove : manufOrder.getInStockMoveList()) { this.finishStockMove(stockMove); } - for (StockMove stockMove : manufOrder.getOutStockMoveList()) { - updateRealPrice(manufOrder, stockMove); - this.finishStockMove(stockMove); + if (manufOrder.getStypeSelect() == ManufOrderRepository.STYPE_PACKAGING_ORDER) { + for (StockMove stockMove : manufOrder.getOutStockMoveList()) { + updateRealPrice(manufOrder, stockMove); + // this.finishStockMove(stockMove); + } } } @@ -347,7 +427,7 @@ public class ManufOrderStockMoveService { if (stockMove != null && stockMove.getStatusSelect() == StockMoveRepository.STATUS_PLANNED) { stockMove.setIsWithBackorder(false); - stockMoveService.copyQtyToRealQty(stockMove); + // stockMoveService.copyQtyToRealQty(stockMove); stockMoveService.realize(stockMove); } } @@ -393,7 +473,7 @@ public class ManufOrderStockMoveService { StockLocation fromStockLocation; StockLocation toStockLocation; - List stockMoveList; + Set stockMoveList; if (inOrOut == PART_FINISH_IN) { stockMoveList = manufOrder.getInStockMoveList(); @@ -455,6 +535,13 @@ public class ManufOrderStockMoveService { * ManufOrder#outStockMoveList} * @return an optional stock move */ + public Optional getPlannedStockMove(Set stockMoveList) { + return stockMoveList + .stream() + .filter(stockMove -> stockMove.getStatusSelect() == StockMoveRepository.STATUS_PLANNED) + .findFirst(); + } + public Optional getPlannedStockMove(List stockMoveList) { return stockMoveList .stream() @@ -533,6 +620,7 @@ public class ManufOrderStockMoveService { for (StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) { stockMoveLine.setProducedManufOrder(null); + stockMoveLine.setTransferedManufOrder(null); } } } @@ -562,6 +650,13 @@ public class ManufOrderStockMoveService { stockMoveLine -> stockMoveLine.getStockMove().getStatusSelect() == StockMoveRepository.STATUS_CANCELED); + // clear all lists from planned lines + manufOrder + .getTransferedStockMoveLineList() + .removeIf( + stockMoveLine -> + stockMoveLine.getStockMove().getStatusSelect() + == StockMoveRepository.STATUS_CANCELED); stockMove.clearStockMoveLineList(); // create a new list @@ -641,4 +736,84 @@ public class ManufOrderStockMoveService { return qtyToUpdate.multiply(prodProductQty).divide(manufOrderQty, 2, RoundingMode.HALF_EVEN); } + + @Transactional + public void createToReturnStockMove(ManufOrder manufOrder) throws AxelorException { + + Company company = manufOrder.getCompany(); + + if (manufOrder.getConsumedStockMoveLineList() != null && company != null) { + StockMove outStockMove = manufOrder.getConsumedStockMoveLineList().get(0).getStockMove(); + + StockMove stockMove = Beans.get(StockMoveRepository.class).copy(outStockMove, false); + StockLocation fromLocation = manufOrder.getWorkshopStockLocation(); + StockLocation toLocation = manufOrder.getProdProcess().getStockLocation(); + stockMove.setFromStockLocation(fromLocation); + stockMove.setToStockLocation(toLocation); + stockMove.setPartner(null); + stockMove.setTypeSelect(StockMoveRepository.TYPE_INTERNAL); + + for (StockMoveLine stockMoveLine : manufOrder.getConsumedStockMoveLineList()) { + BigDecimal diff = stockMoveLine.getQty().subtract(stockMoveLine.getRealQty()); + StockMoveLine stockMoveLine2 = + Beans.get(StockMoveLineRepository.class).copy(stockMoveLine, false); + + if (diff.compareTo(BigDecimal.ZERO) > 0) { + stockMoveLine2.setQty(diff); + stockMoveLine2.setRealQty(diff); + stockMoveLine2.setConsumedManufOrder(null); + stockMoveLine2.setReturnedManufOrder(manufOrder); + stockMove.addStockMoveLineListItem(stockMoveLine2); + } + } + + stockMoveService.plan(stockMove); + manufOrder.addOutStockMoveListItem(stockMove); + + // fill here the consumed stock move line list item to manage the + // case where we had to split tracked stock move lines + if (stockMove.getStockMoveLineList() != null) { + for (StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) { + stockMoveLine.setConsumedManufOrder(null); + manufOrder.addToReturnStockMoveLineListItem(stockMoveLine); + } + } + } + } + + @Transactional + public void createTempStockMove(ManufOrder manufOrder) throws AxelorException { + StockMove stockMove = this._createToConsumeStockMove(manufOrder, manufOrder.getCompany()); + stockMove.setTypeSelect(StockMoveRepository.TYPE_OUTGOING); + stockMove.setFromStockLocation(manufOrder.getWorkshopStockLocation()); + StockConfigProductionService stockConfigService = Beans.get(StockConfigProductionService.class); + StockConfig stockConfig = stockConfigService.getStockConfig(manufOrder.getCompany()); + StockLocation virtualStockLocation = + stockConfigService.getProductionVirtualStockLocation(stockConfig); + stockMove.setToStockLocation(virtualStockLocation); + stockMove.setPartner(manufOrder.getCompany().getPartner()); + for (BillOfMaterialConsumption billOfMaterialConsumption : manufOrder.getBillOfMaterialConsumptionList()) { + StockMoveLine stockMoveLine = stockMoveLineService.createStockMoveLine( + billOfMaterialConsumption.getProduct(), + billOfMaterialConsumption.getProduct().getName(), + billOfMaterialConsumption.getProduct().getDescription(), + billOfMaterialConsumption.getRealQty(), + BigDecimal.ZERO, + BigDecimal.ZERO, + billOfMaterialConsumption.getProduct().getUnit(), + stockMove, + StockMoveLineService.TYPE_OUT_PRODUCTIONS, + false, + BigDecimal.ZERO); + stockMoveLine.setTrackingNumber(billOfMaterialConsumption.getTrackingNumber()); + stockMove.addStockMoveLineListItem(stockMoveLine); + } + + if (stockMove.getStockMoveLineList() != null && !stockMove.getStockMoveLineList().isEmpty()) { + stockMoveService.plan(stockMove); + manufOrder.addOutStockMoveListItem(stockMove); + } + + } + } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderWorkflowService.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderWorkflowService.java index d937619..7acc5ef 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderWorkflowService.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/manuforder/ManufOrderWorkflowService.java @@ -26,20 +26,30 @@ import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.message.db.Template; import com.axelor.apps.message.db.repo.EmailAccountRepository; import com.axelor.apps.message.service.TemplateMessageService; +import com.axelor.apps.production.db.BillOfMaterial; +import com.axelor.apps.production.db.BillOfMaterialConsumption; +import com.axelor.apps.production.db.DocumentationManufOrder; import com.axelor.apps.production.db.ManufOrder; import com.axelor.apps.production.db.OperationOrder; +import com.axelor.apps.production.db.ProdProcess; +import com.axelor.apps.production.db.ProdProcessLine; import com.axelor.apps.production.db.ProductionConfig; import com.axelor.apps.production.db.repo.BillOfMaterialRepository; import com.axelor.apps.production.db.repo.CostSheetRepository; +import com.axelor.apps.production.db.repo.DocumentationManufOrderRepository; import com.axelor.apps.production.db.repo.ManufOrderRepository; import com.axelor.apps.production.db.repo.OperationOrderRepository; import com.axelor.apps.production.db.repo.ProdProcessRepository; import com.axelor.apps.production.db.repo.ProductionConfigRepository; import com.axelor.apps.production.exceptions.IExceptionMessage; +import com.axelor.apps.production.service.BillOfMaterialServiceImpl; import com.axelor.apps.production.service.app.AppProductionService; import com.axelor.apps.production.service.costsheet.CostSheetService; +import com.axelor.apps.production.service.operationorder.OperationOrderService; import com.axelor.apps.production.service.operationorder.OperationOrderWorkflowService; import com.axelor.apps.stock.db.StockMove; +import com.axelor.apps.stock.db.TrackingNumber; +import com.axelor.apps.stock.db.repo.TrackingNumberRepository; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; @@ -49,8 +59,11 @@ import com.google.common.base.Strings; import com.google.inject.Inject; import com.google.inject.persist.Transactional; import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalAdjusters; import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -101,11 +114,16 @@ public class ManufOrderWorkflowService { } if (!manufOrder.getIsConsProOnOperation() && CollectionUtils.isEmpty(manufOrder.getToConsumeProdProductList())) { - // manufOrderService.createToConsumeProdProductList(manufOrder); + manufOrderService.createToConsumeProdProductList(manufOrder); } + System.out.println( + "*********************************************CollectionUtils.isEmpty(manufOrder.getToProduceProdProductList())"); + System.out.println(CollectionUtils.isEmpty(manufOrder.getToProduceProdProductList())); + System.out.println( + "*********************************************CollectionUtils.isEmpty(manufOrder.getToProduceProdProductList())"); if (CollectionUtils.isEmpty(manufOrder.getToProduceProdProductList())) { - // manufOrderService.createToProduceProdProductList(manufOrder); + manufOrderService.createToProduceProdProductList(manufOrder); } if (manufOrder.getPlannedStartDateT() == null && manufOrder.getPlannedEndDateT() == null) { @@ -132,11 +150,21 @@ public class ManufOrderWorkflowService { manufOrder.setUnit(manufOrder.getBillOfMaterial().getUnit()); } - if (!manufOrder.getIsConsProOnOperation()) { - // manufOrderStockMoveService.createToConsumeStockMove(manufOrder); + // if (!manufOrder.getIsConsProOnOperation()) { + System.out.println("manufOrder<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); + System.out.println(); + System.out.println(manufOrder); + System.out.println(manufOrder.getStypeSelect()); + System.out.println("manufOrder<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); + if (manufOrder.getStypeSelect() == ManufOrderRepository.STYPE_PACKAGING_ORDER) { + manufOrderStockMoveService.createToConsumeStockMove(manufOrder); } + manufOrderService.createOutgoinfStockMove(manufOrder); + // } - manufOrderStockMoveService.createToProduceStockMove(manufOrder); + if (manufOrder.getStypeSelect() == ManufOrderRepository.STYPE_PACKAGING_ORDER) { + manufOrderStockMoveService.createToProduceStockMove(manufOrder); + } manufOrder.setStatusSelect(ManufOrderRepository.STATUS_PLANNED); manufOrder.setCancelReason(null); manufOrder.setCancelReasonStr(null); @@ -147,15 +175,30 @@ public class ManufOrderWorkflowService { @Transactional(rollbackOn = {Exception.class}) public void start(ManufOrder manufOrder) throws AxelorException { - // manufOrder.setRealStartDateT( - // Beans.get(AppProductionService.class).getTodayDateTime().toLocalDateTime()); + manufOrder.setRealStartDateT( + Beans.get(AppProductionService.class).getTodayDateTime().toLocalDateTime()); int beforeOrAfterConfig = manufOrder.getProdProcess().getStockMoveRealizeOrderSelect(); if (beforeOrAfterConfig == ProductionConfigRepository.REALIZE_START) { for (StockMove stockMove : manufOrder.getInStockMoveList()) { - // manufOrderStockMoveService.finishStockMove(stockMove); + if (!stockMove.getIsValidatedProduction()) { + throw new AxelorException( + TraceBackRepository.CATEGORY_NO_VALUE, + I18n.get(IExceptionMessage.STOCK_MOVE_NOT_VALIDATED)); + } + manufOrderStockMoveService.finishStockMove(stockMove); } } + + if (manufOrder.getBillOfMaterial() != null) { + for (BillOfMaterial bom : manufOrder.getBillOfMaterial().getBillOfMaterialSet()) { + BillOfMaterialConsumption newBom = + Beans.get(BillOfMaterialServiceImpl.class) + .createBomConsumptionFromRawMaterial(bom, manufOrder); + manufOrder.addBillOfMaterialConsumptionListItem(newBom); + } + } + manufOrder.setStatusSelect(ManufOrderRepository.STATUS_IN_PROGRESS); manufOrderRepo.save(manufOrder); } @@ -234,8 +277,8 @@ public class ManufOrderWorkflowService { } manufOrderStockMoveService.finish(manufOrder); - // manufOrder.setRealEndDateT( - // Beans.get(AppProductionService.class).getTodayDateTime().toLocalDateTime()); + manufOrder.setRealEndDateT( + Beans.get(AppProductionService.class).getTodayDateTime().toLocalDateTime()); manufOrder.setStatusSelect(ManufOrderRepository.STATUS_FINISHED); manufOrder.setEndTimeDifference( new BigDecimal( @@ -325,6 +368,11 @@ public class ManufOrderWorkflowService { .getProducedStockMoveLineList() .forEach(stockMoveLine -> stockMoveLine.setProducedManufOrder(null)); } + if (manufOrder.getTransferedStockMoveLineList() != null) { + manufOrder + .getTransferedStockMoveLineList() + .forEach(stockMoveLine -> stockMoveLine.setTransferedManufOrder(null)); + } if (manufOrder.getDiffConsumeProdProductList() != null) { manufOrder.clearDiffConsumeProdProductList(); } @@ -449,4 +497,108 @@ public class ManufOrderWorkflowService { } return true; } + + @Transactional(rollbackOn = {Exception.class}) + public Long createDocumentationManufOrder(ManufOrder manufOrder) throws AxelorException { + DocumentationManufOrder documentationManufOrder = new DocumentationManufOrder(); + documentationManufOrder.setStatusSelect(1); + documentationManufOrder.setProduct(manufOrder.getProduct()); + documentationManufOrder.setTrackingNumber(manufOrder.getTrackingNumber()); + documentationManufOrder.setManufOrder(manufOrder); + + ProdProcess prodProcess = Beans.get(ProdProcessRepository.class).findByName("DOCUMENTATION"); + + for (ProdProcessLine prodProcessLine : + Beans.get(ManufOrderServiceImpl.class) + ._sortProdProcessLineByPriority(prodProcess.getProdProcessLineList())) { + documentationManufOrder.addOperationOrderListItem( + Beans.get(OperationOrderService.class).createOperationOrder(manufOrder, prodProcessLine)); + } + + DocumentationManufOrder savedocumentationManufOrder = + Beans.get(DocumentationManufOrderRepository.class).save(documentationManufOrder); + return savedocumentationManufOrder.getId(); + } + + @Transactional(rollbackOn = {Exception.class}) + public Long createPackagingOrder(ManufOrder manufOrder) throws AxelorException { + + ManufOrderService manufOrderService = Beans.get(ManufOrderService.class); + // ProdProcess prodProcess = Beans.get(ProdProcessRepository.class).all().filter("self.product = + // ?1 and self.typeSelect = ?2",manufOrder.getProduct(), + // ManufOrderRepository.STYPE_PACKAGING_ORDER).fetchOne(); + BillOfMaterial billOfMaterial = + Beans.get(BillOfMaterialRepository.class) + .all() + .filter( + "self.product = ?1 and self.typeSelect = ?2", + manufOrder.getProduct(), + ManufOrderRepository.STYPE_PACKAGING_ORDER) + .fetchOne(); + + ManufOrder packagingOrder = + manufOrderService.generateManufOrder( + manufOrder.getProduct(), + manufOrder.getQty(), + ManufOrderService.DEFAULT_PRIORITY, + ManufOrderService.IS_TO_INVOICE, + billOfMaterial, + manufOrder.getRealEndDateT(), + null, + ManufOrderService.ORIGIN_TYPE_OTHER); + + packagingOrder.setTrackingNumber(manufOrder.getTrackingNumber()); + packagingOrder.setStypeSelect(ManufOrderRepository.STYPE_PACKAGING_ORDER); + packagingOrder.setOriginManufOrder(manufOrder); + packagingOrder.setProductionOrder(manufOrder.getProductionOrder()); + + ManufOrder packOrder = Beans.get(ManufOrderRepository.class).save(packagingOrder); + + return packOrder.getId(); + } + + @Transactional(rollbackOn = {Exception.class}) + public void createAndAssignTrackingNumber(OperationOrder operationOrder) throws AxelorException { + + ManufOrderService manufOrderService = Beans.get(ManufOrderService.class); + // Optional operationOrder1 = + // manufOrder.getOperationOrderList().stream().filter(op + // ->op.getOperationName().equals("MELANGE")).findFirst(); + // Optional operationOrder2 = + // manufOrder.getOperationOrderList().stream().filter(op + // ->op.getOperationName().equals("GRANULATION")).findFirst(); + // ProdProcess prodProcess = Beans.get(ProdProcessRepository.class).all().filter("self.product = + // ?1 and self.typeSelect = ?2",manufOrder.getProduct(), + // ManufOrderRepository.STYPE_PACKAGING_ORDER).fetchOne(); + ManufOrder manufOrder = operationOrder.getManufOrder(); + BillOfMaterial billOfMaterial = manufOrder.getBillOfMaterial(); + Product product = billOfMaterial.getProduct(); + Integer lifeTime = billOfMaterial.getProductLifeTimeInMonth(); + Integer seq = billOfMaterial.getProducedTrackingNumberSeq(); + String workShopName = billOfMaterial.getWorkshopStockLocation().getName(); + String lastYear = String.valueOf(LocalDate.now().getYear()).substring(2); + String workShopCode = ""; + if (workShopName.length() >= 6) { + workShopCode = Character.toString(workShopName.charAt(5)); + } + + DecimalFormat df = new DecimalFormat("000"); + String formattedseq = df.format(seq); + + String sequence = workShopCode + lastYear + formattedseq; + + LocalDate perishableDate = + LocalDate.now().plusMonths(lifeTime).with(TemporalAdjusters.lastDayOfMonth()); + + TrackingNumber trackingNumber = new TrackingNumber(); + trackingNumber.setProduct(product); + trackingNumber.setPerishableExpirationDate(perishableDate); + trackingNumber.setTrackingNumberSeq(sequence); + manufOrder.setTrackingNumber(Beans.get(TrackingNumberRepository.class).save(trackingNumber)); + + Integer nextSeq = billOfMaterial.getProducedTrackingNumberSeq() + 1; + billOfMaterial.setProducedTrackingNumberSeq(nextSeq); + Beans.get(BillOfMaterialRepository.class).save(billOfMaterial); + Beans.get(ManufOrderRepository.class).save(manufOrder); + } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderServiceImpl.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderServiceImpl.java index 5a51a3a..8f03b24 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderServiceImpl.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderServiceImpl.java @@ -115,6 +115,10 @@ public class OperationOrderServiceImpl implements OperationOrderService { OperationOrderRepository.STATUS_DRAFT, prodProcessLine); + operationOrder.setProduct(prodProcessLine.getProduct()); + operationOrder.setQty(prodProcessLine.getQty()); + operationOrder.setUnit(prodProcessLine.getUnit()); + this._createHumanResourceList(operationOrder, machineWorkCenter); return Beans.get(OperationOrderRepository.class).save(operationOrder); diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderWorkflowService.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderWorkflowService.java index a18c603..00c0227 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderWorkflowService.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/operationorder/OperationOrderWorkflowService.java @@ -92,10 +92,10 @@ public class OperationOrderWorkflowService { // Duration.between( // operationOrder.getPlannedStartDateT(), operationOrder.getPlannedEndDateT()))); - // ManufOrder manufOrder = operationOrder.getManufOrder(); - // if (manufOrder == null || manufOrder.getIsConsProOnOperation()) { - // operationOrderStockMoveService.createToConsumeStockMove(operationOrder); - // } + ManufOrder manufOrder = operationOrder.getManufOrder(); + if (manufOrder == null || manufOrder.getIsConsProOnOperation()) { + operationOrderStockMoveService.createToConsumeStockMove(operationOrder); + } operationOrder.setStatusSelect(OperationOrderRepository.STATUS_PLANNED); @@ -195,26 +195,26 @@ public class OperationOrderWorkflowService { public void start(OperationOrder operationOrder) throws AxelorException { if (operationOrder.getStatusSelect() != OperationOrderRepository.STATUS_IN_PROGRESS) { operationOrder.setStatusSelect(OperationOrderRepository.STATUS_IN_PROGRESS); - // operationOrder.setRealStartDateT(appProductionService.getTodayDateTime().toLocalDateTime()); + operationOrder.setRealStartDateT(appProductionService.getTodayDateTime().toLocalDateTime()); - // startOperationOrderDuration(operationOrder); + startOperationOrderDuration(operationOrder); - // if (operationOrder.getManufOrder() != null) { - // int beforeOrAfterConfig = - // operationOrder.getManufOrder().getProdProcess().getStockMoveRealizeOrderSelect(); - // if (beforeOrAfterConfig == ProductionConfigRepository.REALIZE_START) { - // for (StockMove stockMove : operationOrder.getInStockMoveList()) { - // Beans.get(ManufOrderStockMoveService.class).finishStockMove(stockMove); - // } + if (operationOrder.getManufOrder() != null) { + int beforeOrAfterConfig = + operationOrder.getManufOrder().getProdProcess().getStockMoveRealizeOrderSelect(); + if (beforeOrAfterConfig == ProductionConfigRepository.REALIZE_START) { + for (StockMove stockMove : operationOrder.getInStockMoveList()) { + Beans.get(ManufOrderStockMoveService.class).finishStockMove(stockMove); + } - // StockMove newStockMove = - // operationOrderStockMoveService._createToConsumeStockMove( - // operationOrder, operationOrder.getManufOrder().getCompany()); - // newStockMove.setStockMoveLineList(new ArrayList<>()); - // Beans.get(StockMoveService.class).plan(newStockMove); - // operationOrder.addInStockMoveListItem(newStockMove); - // } - // } + StockMove newStockMove = + operationOrderStockMoveService._createToConsumeStockMove( + operationOrder, operationOrder.getManufOrder().getCompany()); + newStockMove.setStockMoveLineList(new ArrayList<>()); + Beans.get(StockMoveService.class).plan(newStockMove); + operationOrder.addInStockMoveListItem(newStockMove); + } + } operationOrderRepo.save(operationOrder); } @@ -233,7 +233,7 @@ public class OperationOrderWorkflowService { public void pause(OperationOrder operationOrder) { operationOrder.setStatusSelect(OperationOrderRepository.STATUS_STANDBY); - // stopOperationOrderDuration(operationOrder); + stopOperationOrderDuration(operationOrder); operationOrderRepo.save(operationOrder); } @@ -247,7 +247,7 @@ public class OperationOrderWorkflowService { public void resume(OperationOrder operationOrder) { operationOrder.setStatusSelect(OperationOrderRepository.STATUS_IN_PROGRESS); - // startOperationOrderDuration(operationOrder); + startOperationOrderDuration(operationOrder); operationOrderRepo.save(operationOrder); } @@ -261,9 +261,9 @@ public class OperationOrderWorkflowService { @Transactional(rollbackOn = {Exception.class}) public void finish(OperationOrder operationOrder) throws AxelorException { operationOrder.setStatusSelect(OperationOrderRepository.STATUS_FINISHED); - // operationOrder.setRealEndDateT(appProductionService.getTodayDateTime().toLocalDateTime()); + operationOrder.setRealEndDateT(appProductionService.getTodayDateTime().toLocalDateTime()); - // stopOperationOrderDuration(operationOrder); + stopOperationOrderDuration(operationOrder); // operationOrderStockMoveService.finish(operationOrder); operationOrderRepo.save(operationOrder); @@ -286,14 +286,14 @@ public class OperationOrderWorkflowService { operationOrder.setStatusSelect(OperationOrderRepository.STATUS_CANCELED); if (oldStatus == OperationOrderRepository.STATUS_IN_PROGRESS) { - // stopOperationOrderDuration(operationOrder); + stopOperationOrderDuration(operationOrder); } if (operationOrder.getConsumedStockMoveLineList() != null) { - // operationOrder - // .getConsumedStockMoveLineList() - // .forEach(stockMoveLine -> stockMoveLine.setConsumedOperationOrder(null)); + operationOrder + .getConsumedStockMoveLineList() + .forEach(stockMoveLine -> stockMoveLine.setConsumedOperationOrder(null)); } - // operationOrderStockMoveService.cancel(operationOrder); + operationOrderStockMoveService.cancel(operationOrder); operationOrderRepo.save(operationOrder); } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/productionorder/ProductionOrderServiceImpl.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/productionorder/ProductionOrderServiceImpl.java index 0a21069..ab3f48e 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/productionorder/ProductionOrderServiceImpl.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/service/productionorder/ProductionOrderServiceImpl.java @@ -23,19 +23,27 @@ import com.axelor.apps.base.service.administration.SequenceService; import com.axelor.apps.production.db.BillOfMaterial; import com.axelor.apps.production.db.ManufOrder; import com.axelor.apps.production.db.ProductionOrder; +import com.axelor.apps.production.db.repo.ManufOrderRepository; import com.axelor.apps.production.db.repo.ProductionOrderRepository; import com.axelor.apps.production.exceptions.IExceptionMessage; import com.axelor.apps.production.service.manuforder.ManufOrderService; +import com.axelor.apps.production.service.manuforder.ManufOrderServiceImpl; import com.axelor.apps.sale.db.SaleOrder; +import com.axelor.apps.stock.db.StockMove; +import com.axelor.apps.stock.db.StockMoveLine; +import com.axelor.apps.stock.db.repo.StockMoveRepository; +import com.axelor.apps.stock.service.StockMoveService; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; +import com.axelor.inject.Beans; import com.google.inject.Inject; import com.google.inject.persist.Transactional; import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; +import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -127,13 +135,11 @@ public class ProductionOrderServiceImpl implements ProductionOrderService { int originType) throws AxelorException { - BigDecimal bomQty = billOfMaterial.getQty(); BigDecimal manufCount = qtyRequested.divide(bomQty, 0, RoundingMode.CEILING); - -for (int index = 0; index < manufCount.intValue(); index++) { - ManufOrder manufOrder = + for (int index = 0; index < manufCount.intValue(); index++) { + ManufOrder manufOrder = manufOrderService.generateManufOrder( product, bomQty, @@ -143,17 +149,49 @@ for (int index = 0; index < manufCount.intValue(); index++) { startDate, endDate, originType); - + if (manufOrder != null) { if (saleOrder != null) { manufOrder.setSaleOrder(saleOrder); manufOrder.setClientPartner(saleOrder.getClientPartner()); } + manufOrder.setStypeSelect(ManufOrderRepository.STYPE_MANUF_ORDER); productionOrder.addManufOrderListItem(manufOrder); } -} - + } return productionOrderRepo.save(productionOrder); } + + @Transactional(rollbackOn = {Exception.class}) + public StockMove generateConsumeStockMoveFromSelectedManufOrder( + ProductionOrder productionOrder, List manufOrderList) throws AxelorException { + + ManufOrder manufOrder = manufOrderList.get(0); + StockMove stockMove = + Beans.get(ManufOrderServiceImpl.class) + .createToConsumeProdProductList(manufOrder, manufOrderList.size()); + + for (ManufOrder manufOrder2 : manufOrderList) { + if (stockMove.getStockMoveLineList() != null && !stockMove.getStockMoveLineList().isEmpty()) { + Beans.get(ManufOrderServiceImpl.class).createToConsumeProdProductList(manufOrder2); + Beans.get(StockMoveService.class).plan(stockMove); + } + + if (stockMove.getStockMoveLineList() != null) { + for (StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) { + manufOrder2.addTransferedStockMoveLineListItem(stockMoveLine); + } + } + + manufOrder2.addInStockMoveListItem(stockMove); + Beans.get(ProductionOrderRepository.class).save(productionOrder); + } + + stockMove.setOrigin(productionOrder.getProductionOrderSeq()); + stockMove.setOriginId(productionOrder.getId()); + stockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_PRODUCTION_ORDER); + + return Beans.get(StockMoveRepository.class).save(stockMove); + } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ManufOrderController.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ManufOrderController.java index 24f88b5..de6b959 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ManufOrderController.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ManufOrderController.java @@ -19,17 +19,24 @@ package com.axelor.apps.production.web; import com.axelor.apps.ReportFactory; import com.axelor.apps.base.service.app.AppBaseService; +import com.axelor.apps.production.db.BillOfMaterial; +import com.axelor.apps.production.db.BillOfMaterialConsumption; import com.axelor.apps.production.db.CostSheet; +import com.axelor.apps.production.db.DocumentationManufOrder; import com.axelor.apps.production.db.ManufOrder; +import com.axelor.apps.production.db.OperationOrder; +import com.axelor.apps.production.db.repo.BillOfMaterialConsumptionRepository; import com.axelor.apps.production.db.repo.CostSheetRepository; import com.axelor.apps.production.db.repo.ManufOrderRepository; import com.axelor.apps.production.exceptions.IExceptionMessage; import com.axelor.apps.production.report.IReport; +import com.axelor.apps.production.service.BillOfMaterialServiceImpl; import com.axelor.apps.production.service.costsheet.CostSheetService; import com.axelor.apps.production.service.manuforder.ManufOrderService; import com.axelor.apps.production.service.manuforder.ManufOrderStockMoveService; import com.axelor.apps.production.service.manuforder.ManufOrderWorkflowService; import com.axelor.apps.report.engine.ReportSettings; +import com.axelor.db.mapper.Mapper; import com.axelor.exception.AxelorException; import com.axelor.exception.service.TraceBackService; import com.axelor.i18n.I18n; @@ -45,7 +52,10 @@ import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.time.LocalDate; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Optional; import org.eclipse.birt.core.exception.BirtException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -107,7 +117,6 @@ public class ManufOrderController { response.setNotify(I18n.get(IExceptionMessage.MANUF_ORDER_EMAIL_NOT_SENT)); } - response.setReload(true); } catch (Exception e) { TraceBackService.trace(response, e); } @@ -185,9 +194,7 @@ public class ManufOrderController { manufOrders = Beans.get(ManufOrderRepository.class) .all() - .filter( - "self.id in ?1", - context.get("_ids")) + .filter("self.id in ?1", context.get("_ids")) .fetch(); } for (ManufOrder manufOrder : manufOrders) { @@ -211,9 +218,7 @@ public class ManufOrderController { manufOrders = Beans.get(ManufOrderRepository.class) .all() - .filter( - "self.id in ?1", - context.get("_ids")) + .filter("self.id in ?1", context.get("_ids")) .fetch(); } for (ManufOrder manufOrder : manufOrders) { @@ -237,9 +242,7 @@ public class ManufOrderController { manufOrders = Beans.get(ManufOrderRepository.class) .all() - .filter( - "self.id in ?1", - context.get("_ids")) + .filter("self.id in ?1", context.get("_ids")) .fetch(); } for (ManufOrder manufOrder : manufOrders) { @@ -263,9 +266,7 @@ public class ManufOrderController { manufOrders = Beans.get(ManufOrderRepository.class) .all() - .filter( - "self.id in ?1", - context.get("_ids")) + .filter("self.id in ?1", context.get("_ids")) .fetch(); } for (ManufOrder manufOrder : manufOrders) { @@ -297,6 +298,26 @@ public class ManufOrderController { TraceBackService.trace(response, e); } } + /** + * Called from manuf order form on clicking realize button. Call {@link + * ManufOrderStockMoveService#consumeInStockMoves(ManufOrder)} to consume material used in manuf + * order. + * + * @param request + * @param response + */ + public void validateOutStockMove(ActionRequest request, ActionResponse response) { + try { + + ManufOrder manufOrder = request.getContext().asType(ManufOrder.class); + manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrder.getId()); + + Beans.get(ManufOrderStockMoveService.class).validateOutStockMoves(manufOrder); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } /** * Method that generate a Pdf file for an manufacturing order @@ -581,4 +602,186 @@ public class ManufOrderController { TraceBackService.trace(response, e); } } + + public void createPackagingOrder(ActionRequest request, ActionResponse response) { + try { + Long manufOrderId = (Long) request.getContext().get("id"); + ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId); + + if (!Beans.get(ManufOrderWorkflowService.class).finish(manufOrder)) { + response.setNotify(I18n.get(IExceptionMessage.MANUF_ORDER_EMAIL_NOT_SENT)); + } + + // response.setReload(true); + ManufOrder manufOrder2 = Beans.get(ManufOrderRepository.class).find(manufOrderId); + if (manufOrder.getStypeSelect() == ManufOrderRepository.STYPE_MANUF_ORDER) { + + Long packagingOrderid = + Beans.get(ManufOrderWorkflowService.class).createPackagingOrder(manufOrder2); + + response.setView( + ActionView.define("Pckaging order") + .model(ManufOrder.class.getName()) + .add("form", "manuf-order-form") + .add("grid", "manuf-order-grid") + .context("_showRecord", String.valueOf(packagingOrderid)) + .domain("self.id = " + packagingOrderid) + .map()); + } else if (manufOrder2.getStypeSelect() == ManufOrderRepository.STYPE_PACKAGING_ORDER) { + Long docManufOrderid = + Beans.get(ManufOrderWorkflowService.class).createDocumentationManufOrder(manufOrder2); + + response.setView( + ActionView.define("Documentation order") + .model(DocumentationManufOrder.class.getName()) + .add("form", "documentation-manuf-order-form") + .add("grid", "documentation-manuf-order-grid") + .context("_showRecord", String.valueOf(docManufOrderid)) + .domain("self.id = " + docManufOrderid) + .map()); + } + + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void createTrackingNumberAndAssign(ActionRequest request, ActionResponse response) + throws AxelorException { + Long manufOrderId = (Long) request.getContext().get("id"); + ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId); + + Optional operationOrder1 = + manufOrder + .getOperationOrderList() + .stream() + .filter(op -> op.getOperationName().equals("MELANGE")) + .findFirst(); + Optional operationOrder2 = + manufOrder + .getOperationOrderList() + .stream() + .filter(op -> op.getOperationName().equals("GRANULATION")) + .findFirst(); + + if (operationOrder1 != null) { + if (operationOrder1.isPresent()) { + Beans.get(ManufOrderWorkflowService.class) + .createAndAssignTrackingNumber(operationOrder1.get()); + } + } else if (operationOrder2 != null) { + if (operationOrder2.isPresent()) { + Beans.get(ManufOrderWorkflowService.class) + .createAndAssignTrackingNumber(operationOrder2.get()); + } + } + + response.setReload(true); + } + + public void createToReturnStockMove(ActionRequest request, ActionResponse response) + throws AxelorException { + Long manufOrderId = (Long) request.getContext().get("id"); + ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId); + Beans.get(ManufOrderStockMoveService.class).createToReturnStockMove(manufOrder); + response.setReload(true); + } + + public void planOF(ActionRequest request, ActionResponse response) throws AxelorException { + try { + Long manufOrderId = (Long) request.getContext().get("id"); + ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId); + + if (manufOrder.getBillOfMaterial() != null) { + for (BillOfMaterial bom : manufOrder.getBillOfMaterial().getBillOfMaterialSet()) { + BillOfMaterialConsumption newBom = + Beans.get(BillOfMaterialServiceImpl.class) + .createBomConsumptionFromRawMaterial(bom, manufOrder); + manufOrder.addBillOfMaterialConsumptionListItem(newBom); + } + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void prefillConsumption(ActionRequest request, ActionResponse response) { + + try { + Long manufOrderId = (Long) request.getContext().get("id"); + ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId); + if (manufOrder.getBillOfMaterial() != null) { + Beans.get(BillOfMaterialServiceImpl.class).createBomAndAttachToManufOrder(manufOrder); + response.setReload(true); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + public void splitBillConsumption(ActionRequest request, ActionResponse response) { + try { + List selectedBillConsumptionMapList = + (List) request.getContext().get("billOfMaterialConsumptionList"); + Map manufOrderMap = (Map) request.getContext().get("manufOrder"); + if (selectedBillConsumptionMapList == null) { + response.setFlash(I18n.get("Please select at least one line.")); + return; + } + + List billConsumptionList = new ArrayList<>(); + BillOfMaterialConsumptionRepository billConsumptionRepo = + Beans.get(BillOfMaterialConsumptionRepository.class); + for (HashMap map : selectedBillConsumptionMapList) { + BillOfMaterialConsumption billConsumption = + (BillOfMaterialConsumption) Mapper.toBean(BillOfMaterialConsumption.class, map); + billConsumptionList.add(billConsumptionRepo.find(billConsumption.getId())); + } + + if (billConsumptionList.isEmpty()) { + response.setFlash(I18n.get("Please select at least one line.")); + return; + } + + BigDecimal splitQty = new BigDecimal(request.getContext().get("splitQty").toString()); + if (splitQty == null || splitQty.compareTo(BigDecimal.ZERO) < 1) { + response.setFlash(I18n.get("Please enter a valid quantity.")); + return; + } + + ManufOrder manufOrder = Mapper.toBean(ManufOrder.class, manufOrderMap); + manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrder.getId()); + Beans.get(BillOfMaterialServiceImpl.class) + .splitBillOfMaterialConsumption(manufOrder, billConsumptionList, splitQty); + response.setCanClose(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void consumeStockMoveTemp(ActionRequest request, ActionResponse response) { + try { + Context context = request.getContext(); + List manufOrders = new ArrayList<>(); + if (context.get("id") != null) { + Long manufOrderId = (Long) request.getContext().get("id"); + manufOrders.add(Beans.get(ManufOrderRepository.class).find(manufOrderId)); + } else if (context.get("_ids") != null) { + manufOrders = + Beans.get(ManufOrderRepository.class) + .all() + .filter( + "self.id in ?1", + context.get("_ids")) + .fetch(); + } + for (ManufOrder manufOrder : manufOrders) { + Beans.get(ManufOrderStockMoveService.class).createTempStockMove(manufOrder); + } + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/OperationOrderController.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/OperationOrderController.java index 1a0cac9..a941000 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/OperationOrderController.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/OperationOrderController.java @@ -129,6 +129,23 @@ public class OperationOrderController { try { OperationOrder operationOrder = request.getContext().asType(OperationOrder.class); operationOrder = Beans.get(OperationOrderRepository.class).find(operationOrder.getId()); + + System.out.println("*******************************************"); + System.out.println(operationOrder.getManufOrder().getTrackingNumber()); + System.out.println(operationOrder.getOperationName()); + System.out.println(operationOrder.getManufOrder().getTrackingNumber() == null); + System.out.println(operationOrder.getOperationName() == "MELANGE"); + + if (operationOrder.getManufOrder().getTrackingNumber() == null) { + System.out.println("***is null****99999"); + if (operationOrder.getOperationName().equals("MELANGE")) { + System.out.println("*******************************************99999"); + Beans.get(ManufOrderWorkflowService.class).createAndAssignTrackingNumber(operationOrder); + } else if (operationOrder.getOperationName().equals("GRANULATION")) { + Beans.get(ManufOrderWorkflowService.class).createAndAssignTrackingNumber(operationOrder); + } + } + Beans.get(OperationOrderWorkflowService.class).start(operationOrder); response.setReload(true); } catch (Exception e) { diff --git a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ProductionOrderController.java b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ProductionOrderController.java index 62d0cd4..83dc802 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ProductionOrderController.java +++ b/modules/axelor-open-suite/axelor-production/src/main/java/com/axelor/apps/production/web/ProductionOrderController.java @@ -21,13 +21,19 @@ import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.repo.ProductRepository; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.production.db.BillOfMaterial; +import com.axelor.apps.production.db.ManufOrder; import com.axelor.apps.production.db.ProductionOrder; import com.axelor.apps.production.db.repo.BillOfMaterialRepository; +import com.axelor.apps.production.db.repo.ManufOrderRepository; import com.axelor.apps.production.db.repo.ProductionOrderRepository; import com.axelor.apps.production.exceptions.IExceptionMessage; import com.axelor.apps.production.service.manuforder.ManufOrderService; import com.axelor.apps.production.service.productionorder.ProductionOrderService; +import com.axelor.apps.production.service.productionorder.ProductionOrderServiceImpl; +import com.axelor.apps.stock.db.StockMove; +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.rpc.ActionRequest; @@ -38,6 +44,9 @@ import java.math.BigDecimal; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; @Singleton @@ -104,4 +113,40 @@ public class ProductionOrderController { response.setCanClose(true); } } + + @SuppressWarnings({"unchecked", "rawtypes"}) + public void generateConsumeStockMoveFromSelectedManufOrder( + ActionRequest request, ActionResponse response) { + try { + List selectedManufOrderMapList = + (List) request.getContext().get("manufOrderList"); + Map productionOrderMap = (Map) request.getContext().get("productionOrder"); + if (selectedManufOrderMapList == null) { + response.setFlash(I18n.get(IExceptionMessage.UNIT_COST_CALCULATION_IMPORT_FAIL_ERROR)); + return; + } + + List manufOrderList = new ArrayList<>(); + ManufOrderRepository manufOrderRepository = Beans.get(ManufOrderRepository.class); + for (HashMap map : selectedManufOrderMapList) { + ManufOrder manufOrder = (ManufOrder) Mapper.toBean(ManufOrder.class, map); + manufOrderList.add(manufOrderRepository.find(manufOrder.getId())); + } + + if (manufOrderList.isEmpty()) { + response.setFlash(I18n.get(IExceptionMessage.UNIT_COST_CALCULATION_IMPORT_FAIL_ERROR)); + return; + } + + ProductionOrder productionOrder = Mapper.toBean(ProductionOrder.class, productionOrderMap); + productionOrder = Beans.get(ProductionOrderRepository.class).find(productionOrder.getId()); + StockMove stockMove = + Beans.get(ProductionOrderServiceImpl.class) + .generateConsumeStockMoveFromSelectedManufOrder(productionOrder, manufOrderList); + response.setCanClose(true); + response.setFlash("Generated successfully : " + stockMove.getStockMoveSeq()); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } } diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterial.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterial.xml index a2d5398..ccc9bf1 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterial.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterial.xml @@ -31,8 +31,15 @@ - + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterialConsumption.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterialConsumption.xml index aadd489..0e17302 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterialConsumption.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/BillOfMaterialConsumption.xml @@ -15,9 +15,9 @@ - - - + + + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/DocumentationManufOrder.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/DocumentationManufOrder.xml index a1a0c17..1d7e3b5 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/DocumentationManufOrder.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/DocumentationManufOrder.xml @@ -7,6 +7,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ManufOrder.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ManufOrder.xml index 1763d61..d4ffa1e 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ManufOrder.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ManufOrder.xml @@ -30,6 +30,8 @@ + + @@ -50,9 +52,9 @@ - - - + + + @@ -75,6 +77,9 @@ + + + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/OperationOrder.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/OperationOrder.xml index 776ec12..d439544 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/OperationOrder.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/OperationOrder.xml @@ -17,6 +17,7 @@ + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcess.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcess.xml index ff6b6e6..0bc735f 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcess.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcess.xml @@ -31,6 +31,11 @@ + + + + + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcessLine.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcessLine.xml index d32063d..8305a1b 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcessLine.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProdProcessLine.xml @@ -23,6 +23,7 @@ + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionConfig.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionConfig.xml index 0278cf8..5ee1a0c 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionConfig.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionConfig.xml @@ -11,6 +11,7 @@ + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionOrder.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionOrder.xml index 1f870ae..cf8b142 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionOrder.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/ProductionOrder.xml @@ -14,7 +14,12 @@ - + + + + + + - + + + + diff --git a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/StockMoveLine.xml b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/StockMoveLine.xml index af0eaf7..78960f5 100644 --- a/modules/axelor-open-suite/axelor-production/src/main/resources/domains/StockMoveLine.xml +++ b/modules/axelor-open-suite/axelor-production/src/main/resources/domains/StockMoveLine.xml @@ -9,6 +9,9 @@ + + + diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/module/PurchaseModule.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/module/PurchaseModule.java index c311c2f..f89645c 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/module/PurchaseModule.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/module/PurchaseModule.java @@ -35,8 +35,8 @@ import com.axelor.apps.purchase.service.PurchaseRequestServiceImpl; import com.axelor.apps.purchase.service.app.AppPurchaseService; import com.axelor.apps.purchase.service.app.AppPurchaseServiceImpl; import com.axelor.apps.purchase.service.print.PurchaseOrderPrintService; -import com.axelor.apps.purchase.service.print.PurchaseRequestPrintService; import com.axelor.apps.purchase.service.print.PurchaseOrderPrintServiceImpl; +import com.axelor.apps.purchase.service.print.PurchaseRequestPrintService; import com.axelor.apps.purchase.service.print.PurchaseRequestPrintServiceImpl; public class PurchaseModule extends AxelorModule { diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderService.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderService.java index 32c9e77..58d1f38 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderService.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderService.java @@ -1,23 +1,22 @@ package com.axelor.apps.purchase.service; -import java.net.MalformedURLException; -import java.util.List; - import com.axelor.apps.purchase.db.ImportationFolder; import com.axelor.apps.purchase.db.PurchaseOrder; import com.axelor.exception.AxelorException; - +import java.net.MalformedURLException; +import java.util.List; import wslite.json.JSONException; public interface ImportationFolderService { - public void draftImportationFolder(ImportationFolder importationFolder); + public void draftImportationFolder(ImportationFolder importationFolder); - public void openImportationFolder(ImportationFolder importationFolder) throws AxelorException; + public void openImportationFolder(ImportationFolder importationFolder) throws AxelorException; - public void closeImportationFolder(ImportationFolder importationFolder); + public void closeImportationFolder(ImportationFolder importationFolder); - public void cancelImportationFolder(ImportationFolder importationFolder); + public void cancelImportationFolder(ImportationFolder importationFolder); - public void calculateSum(List purchaseOrders,ImportationFolder importationFolder) throws MalformedURLException, JSONException, AxelorException; -} \ No newline at end of file + public void calculateSum(List purchaseOrders, ImportationFolder importationFolder) + throws MalformedURLException, JSONException, AxelorException; +} diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderServiceImpl.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderServiceImpl.java index f897e60..7e1e43d 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderServiceImpl.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/ImportationFolderServiceImpl.java @@ -16,7 +16,6 @@ import java.math.BigDecimal; import java.net.MalformedURLException; import java.util.List; import java.util.Map; - import wslite.json.JSONException; public class ImportationFolderServiceImpl implements ImportationFolderService { @@ -88,30 +87,27 @@ public class ImportationFolderServiceImpl implements ImportationFolderService { importationFolderRepository.save(importationFolder); } - @Transactional - public void calculateAvgPrice(List purchaseOrderLines, ImportationFolder importationFolder) + public void calculateAvgPrice( + List purchaseOrderLines, ImportationFolder importationFolder) throws MalformedURLException, JSONException, AxelorException { - for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLines) { - purchaseOrderLine.setPrice(purchaseOrderLine.getPrice().multiply(importationFolder.getCurrencyRate())); - + purchaseOrderLine.setPrice( + purchaseOrderLine.getPrice().multiply(importationFolder.getCurrencyRate())); + BigDecimal qty = purchaseOrderLine.getQty(); purchaseOrderLine.setQty(purchaseOrderLine.getReceivedQty()); - Map map = Beans.get(PurchaseOrderLineService.class).compute(purchaseOrderLine, purchaseOrderLine.getPurchaseOrder()); + Map map = + Beans.get(PurchaseOrderLineService.class) + .compute(purchaseOrderLine, purchaseOrderLine.getPurchaseOrder()); purchaseOrderLine.setExTaxTotal(map.get("exTaxTotal")); purchaseOrderLine.setInTaxTotal(map.get("inTaxTotal")); purchaseOrderLine.setQty(qty); Beans.get(PurchaseOrderLineRepository.class).save(purchaseOrderLine); - - } importationFolderRepository.save(importationFolder); } - - - } diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineService.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineService.java index a18ddee..d0685d9 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineService.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineService.java @@ -24,6 +24,7 @@ import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.Unit; import com.axelor.apps.purchase.db.PurchaseOrder; import com.axelor.apps.purchase.db.PurchaseOrderLine; +import com.axelor.apps.purchase.db.PurchaseRequestLine; import com.axelor.apps.purchase.db.SupplierCatalog; import com.axelor.exception.AxelorException; import com.axelor.rpc.ActionRequest; @@ -83,6 +84,16 @@ public interface PurchaseOrderLineService { Unit unit) throws AxelorException; + public PurchaseOrderLine createPurchaseOrderLine( + PurchaseOrder purchaseOrder, + Product product, + String productName, + String description, + BigDecimal qty, + Unit unit, + PurchaseRequestLine purchaseRequestLine) + throws AxelorException; + public BigDecimal getQty(PurchaseOrder purchaseOrder, PurchaseOrderLine purchaseOrderLine); public SupplierCatalog getSupplierCatalog( diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineServiceImpl.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineServiceImpl.java index f092699..a337d1b 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineServiceImpl.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderLineServiceImpl.java @@ -35,6 +35,7 @@ import com.axelor.apps.base.service.tax.AccountManagementService; import com.axelor.apps.base.service.tax.FiscalPositionService; import com.axelor.apps.purchase.db.PurchaseOrder; import com.axelor.apps.purchase.db.PurchaseOrderLine; +import com.axelor.apps.purchase.db.PurchaseRequestLine; import com.axelor.apps.purchase.db.SupplierCatalog; import com.axelor.apps.purchase.exception.IExceptionMessage; import com.axelor.apps.purchase.service.app.AppPurchaseService; @@ -158,7 +159,8 @@ public class PurchaseOrderLineServiceImpl implements PurchaseOrderLineService { BigDecimal amount = quantity .multiply(price) - .setScale(AppBaseService.DEFAULT_NB_DECIMAL_DIGITS_SUPPLIER_LINE, RoundingMode.HALF_EVEN); + .setScale( + AppBaseService.DEFAULT_NB_DECIMAL_DIGITS_SUPPLIER_LINE, RoundingMode.HALF_EVEN); LOG.debug( "Calcul du montant HT avec une quantité de {} pour {} : {}", @@ -726,4 +728,12 @@ public class PurchaseOrderLineServiceImpl implements PurchaseOrderLineService { product.getAllowToForcePurchaseQty(), response); } + + @Override + public PurchaseOrderLine createPurchaseOrderLine(PurchaseOrder purchaseOrder, Product product, String productName, + String description, BigDecimal qty, Unit unit, PurchaseRequestLine purchaseRequestLine) throws AxelorException { + PurchaseOrderLine purchaseOrderLine = this.createPurchaseOrderLine(purchaseOrder, product, productName, description, qty, unit); + return purchaseOrderLine; + + } } diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderServiceImpl.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderServiceImpl.java index e820254..8f175d1 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderServiceImpl.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseOrderServiceImpl.java @@ -29,7 +29,6 @@ import com.axelor.apps.base.db.PriceList; import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.TradingName; import com.axelor.apps.base.db.Unit; -import com.axelor.apps.base.db.Wizard; import com.axelor.apps.base.db.repo.BlockingRepository; import com.axelor.apps.base.db.repo.CurrencyRepository; import com.axelor.apps.base.db.repo.PartnerRepository; @@ -60,7 +59,6 @@ import com.axelor.apps.purchase.service.app.AppPurchaseService; import com.axelor.apps.report.engine.ReportSettings; import com.axelor.auth.AuthUtils; import com.axelor.auth.db.User; -import com.axelor.db.JPA; import com.axelor.dms.db.DMSFile; import com.axelor.dms.db.repo.DMSFileRepository; import com.axelor.exception.AxelorException; @@ -70,8 +68,6 @@ import com.axelor.inject.Beans; import com.axelor.meta.MetaFiles; import com.axelor.meta.db.MetaFile; import com.axelor.meta.db.repo.MetaAttachmentRepository; -import com.axelor.meta.schema.actions.ActionView; -import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder; import com.google.common.base.Strings; import com.google.inject.Inject; import com.google.inject.persist.Transactional; @@ -590,7 +586,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { purchaseOrder.setValidatedByUser(AuthUtils.getUser()); purchaseOrder.setSupplierPartner(validateSupplier(purchaseOrder)); - + updateCostPrice(purchaseOrder); if (purchaseOrder.getImportationFolder() != null) { @@ -601,33 +597,28 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { } } - @Transactional - public void addFareToImportationFolder(PurchaseOrder purchaseOrder,BigDecimal amount) throws AxelorException, MalformedURLException, JSONException { + public void addFareToImportationFolder(PurchaseOrder purchaseOrder, BigDecimal amount) + throws AxelorException, MalformedURLException, JSONException { Product product = Beans.get(ProductRepository.class).find(new Long("8931")); Unit unit = Beans.get(UnitRepository.class).find(new Long("4")); - TaxLine taxLine = Beans.get(TaxLineRepository.class).find(new Long("27")); + TaxLine taxLine = Beans.get(TaxLineRepository.class).find(new Long("27")); - PurchaseOrderLine purchaseOrderLine = Beans.get(PurchaseOrderLineService.class) - .createPurchaseOrderLine( - purchaseOrder, - product, - product.getName(), - "", - BigDecimal.ONE, - unit - ); - purchaseOrderLine.setPrice(amount); - purchaseOrderLine.setPriceDiscounted(amount); - purchaseOrderLine.setExTaxTotal(amount); - purchaseOrderLine.setInTaxTotal(amount); - purchaseOrderLine.setCompanyExTaxTotal(amount); - purchaseOrderLine.setCompanyInTaxTotal(amount); - purchaseOrderLine.setTaxLine(taxLine); - purchaseOrder.addPurchaseOrderLineListItem(purchaseOrderLine); + PurchaseOrderLine purchaseOrderLine = + Beans.get(PurchaseOrderLineService.class) + .createPurchaseOrderLine( + purchaseOrder, product, product.getName(), "", BigDecimal.ONE, unit); + purchaseOrderLine.setPrice(amount); + purchaseOrderLine.setPriceDiscounted(amount); + purchaseOrderLine.setExTaxTotal(amount); + purchaseOrderLine.setInTaxTotal(amount); + purchaseOrderLine.setCompanyExTaxTotal(amount); + purchaseOrderLine.setCompanyInTaxTotal(amount); + purchaseOrderLine.setTaxLine(taxLine); + purchaseOrder.addPurchaseOrderLineListItem(purchaseOrderLine); - validatePurchaseOrder(purchaseOrder); + validatePurchaseOrder(purchaseOrder); } @Override diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseRequestServiceImpl.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseRequestServiceImpl.java index b2dd4e4..d8bc148 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseRequestServiceImpl.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/PurchaseRequestServiceImpl.java @@ -130,7 +130,8 @@ public class PurchaseRequestServiceImpl implements PurchaseRequestService { : product.getName(), purchaseRequestLine.getNewProduct() ? null : product.getDescription(), purchaseRequestLine.getQuantity(), - purchaseRequestLine.getUnit()); + purchaseRequestLine.getUnit(), + purchaseRequestLine); purchaseOrder.addPurchaseOrderLineListItem(purchaseOrderLine); purchaseOrderLineList.add(purchaseOrderLine); purchaseOrderLineService.compute(purchaseOrderLine, purchaseOrder); diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/print/ImportationFolderPrintService.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/print/ImportationFolderPrintService.java index 4966f52..456e7c9 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/print/ImportationFolderPrintService.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/service/print/ImportationFolderPrintService.java @@ -1,18 +1,11 @@ package com.axelor.apps.purchase.service.print; -import java.io.File; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; - import com.axelor.apps.ReportFactory; import com.axelor.apps.base.exceptions.IExceptionMessage; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.purchase.db.ImportationFolder; import com.axelor.apps.purchase.report.IReport; import com.axelor.apps.report.engine.ReportSettings; - import com.axelor.apps.tool.ModelTool; import com.axelor.apps.tool.ThrowConsumer; import com.axelor.apps.tool.file.PdfTool; @@ -20,9 +13,14 @@ import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; +import java.io.File; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; public class ImportationFolderPrintService { - + public String printCostPriceSheet(ImportationFolder importationFolder, String formatPdf) throws AxelorException { @@ -38,7 +36,6 @@ public class ImportationFolderPrintService { ids, new ThrowConsumer() { - public void accept(ImportationFolder importationFolder) throws Exception { importationFolders.add(print(importationFolder, ReportSettings.FORMAT_PDF)); } @@ -57,17 +54,14 @@ public class ImportationFolderPrintService { if (importationFolder.getPrintingSettings() == null) { throw new AxelorException( TraceBackRepository.CATEGORY_MISSING_FIELD, - String.format( - I18n.get(IExceptionMessage.UNIT_CONVERSION_2), - importationFolder.getName()), - importationFolder); + String.format(I18n.get(IExceptionMessage.UNIT_CONVERSION_2), importationFolder.getName()), + importationFolder); } String locale = ReportSettings.getPrintingLocale(null); String title = getFileName(importationFolder); ReportSettings reportSetting = ReportFactory.createReport(IReport.COST_PRICE_SHEET, title + " - ${date}"); - return reportSetting .addParam("importationFolderId", importationFolder.getId()) .addParam("Locale", locale) @@ -83,11 +77,8 @@ public class ImportationFolderPrintService { + "." + formatPdf; } - - public String getFileName(ImportationFolder importationFolder) { - return I18n.get("Importation folder") - + " " - + importationFolder.getName(); - } + public String getFileName(ImportationFolder importationFolder) { + return I18n.get("Importation folder") + " " + importationFolder.getName(); + } } diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/EmailUtil.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/EmailUtil.java index a93b78a..1f76c23 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/EmailUtil.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/EmailUtil.java @@ -57,6 +57,62 @@ public class EmailUtil { msg.setSentDate(new Date()); + msg.addRecipient(Message.RecipientType.CC, new InternetAddress("")); + + msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toEmail, false)); + System.out.println("Message is ready"); + Transport.send(msg); + + System.out.println("EMail Sent Successfully!!"); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void sendEmailWithCC( + MailAccountService mailAccountService, + String toEmail, + String subject, + String body, + String cc1, + String cc2) { + System.out.println("TLSEmail Start"); + Properties props = new Properties(); + + final String fromEmail = mailAccountService.getDefaultSender().getLogin().toString(); + final String password = mailAccountService.getDefaultSender().getPassword().toString(); + props.put("mail.smtp.host", mailAccountService.getDefaultSender().getHost()); + props.put("mail.smtp.port", mailAccountService.getDefaultSender().getPort()); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.starttls.enable", "true"); + + Authenticator auth = + new Authenticator() { + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(fromEmail, password); + } + }; + Session session = Session.getInstance(props, auth); + try { + MimeMessage msg = new MimeMessage(session); + // set message headers + msg.addHeader("Content-type", "text/HTML; charset=UTF-8"); + msg.addHeader("format", "flowed"); + msg.addHeader("Content-Transfer-Encoding", "8bit"); + + msg.setFrom(new InternetAddress(fromEmail, "ERP SOPHAL")); + + msg.setReplyTo(InternetAddress.parse(fromEmail, false)); + + msg.setSubject(subject, "UTF-8"); + + msg.setContent(body, "text/html; charset=utf-8"); + + msg.setSentDate(new Date()); + + msg.addRecipient(Message.RecipientType.CC, new InternetAddress(cc1)); + msg.addRecipient(Message.RecipientType.CC, new InternetAddress(cc2)); + msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toEmail, false)); System.out.println("Message is ready"); Transport.send(msg); diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/ImportationFolderController.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/ImportationFolderController.java index b73b15c..61c3c31 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/ImportationFolderController.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/ImportationFolderController.java @@ -49,7 +49,7 @@ public class ImportationFolderController { Beans.get(ImportationFolderServiceImpl.class).calculateSum(purchaseOrders, importationFolder); } - + public void calculateAvgPrice(ActionRequest request, ActionResponse response) throws MalformedURLException, JSONException, AxelorException { @@ -59,6 +59,7 @@ public class ImportationFolderController { Beans.get(ImportationFolderRepository.class).find(iimportationFolder.getId()); List purchaseOrderLines = importationFolder.getPurchaseOrderLineList(); - Beans.get(ImportationFolderServiceImpl.class).calculateAvgPrice(purchaseOrderLines, importationFolder); + Beans.get(ImportationFolderServiceImpl.class) + .calculateAvgPrice(purchaseOrderLines, importationFolder); } } diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/PurchaseOrderController.java b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/PurchaseOrderController.java index f6bb1ac..e930a89 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/PurchaseOrderController.java +++ b/modules/axelor-open-suite/axelor-purchase/src/main/java/com/axelor/apps/purchase/web/PurchaseOrderController.java @@ -61,10 +61,6 @@ import com.google.common.base.Joiner; import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.inject.Singleton; - - -import wslite.json.JSONException; - import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.net.MalformedURLException; @@ -76,6 +72,7 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import wslite.json.JSONException; @Singleton public class PurchaseOrderController { @@ -426,66 +423,67 @@ public class PurchaseOrderController { } } - public void showFare(ActionRequest request, ActionResponse response) { PurchaseOrder purchaseOrder = request.getContext().asType(PurchaseOrder.class); - purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(purchaseOrder.getId()); - - if(purchaseOrder.getImportationType() == 2 ){ - - ActionViewBuilder confirmView = - ActionView.define("Confirm rejection") - .model(Wizard.class.getName()) - .add("form", "amount-to-pay-fare-form") - .param("popup", "true") - .param("show-toolbar", "false") - .param("show-confirm", "false") - .param("popup-save", "false") - .param("forceEdit", "true"); + purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(purchaseOrder.getId()); - confirmView.context("purchaseOrderId", purchaseOrder.getId()); - response.setView(confirmView.map()); - } + if (purchaseOrder.getImportationType() == 2) { + + ActionViewBuilder confirmView = + ActionView.define("Confirm rejection") + .model(Wizard.class.getName()) + .add("form", "amount-to-pay-fare-form") + .param("popup", "true") + .param("show-toolbar", "false") + .param("show-confirm", "false") + .param("popup-save", "false") + .param("forceEdit", "true"); + + confirmView.context("purchaseOrderId", purchaseOrder.getId()); + response.setView(confirmView.map()); + } } + public void validateImportationPurchaseOrder(ActionRequest request, ActionResponse response) + throws AxelorException, MalformedURLException, JSONException { - public void validateImportationPurchaseOrder(ActionRequest request, ActionResponse response) throws AxelorException, MalformedURLException, JSONException { + // if (request.getContext().get("val") == null) { + // throw new AxelorException( + // TraceBackRepository.CATEGORY_MISSING_FIELD, + // I18n.get(IExceptionMessage.NO_PURCHASE_ORDER_SELECTED_FOR_PRINTING)); + // } - if(request.getContext().get("val") == null){ - throw new AxelorException( - TraceBackRepository.CATEGORY_MISSING_FIELD, - I18n.get(IExceptionMessage.NO_PURCHASE_ORDER_SELECTED_FOR_PRINTING)); - } + // BigDecimal val = new BigDecimal(request.getContext().get("val").toString()); + BigDecimal purchaseOrderId = + new BigDecimal(request.getContext().get("purchaseOrderId").toString()); - BigDecimal val = new BigDecimal(request.getContext().get("val").toString()); - BigDecimal purchaseOrderId = new BigDecimal(request.getContext().get("purchaseOrderId").toString()); + PurchaseOrder purchaseOrder = + Beans.get(PurchaseOrderRepository.class).find(new Long(purchaseOrderId.toString())); - PurchaseOrder purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(new Long(purchaseOrderId.toString())); - - Beans.get(PurchaseOrderServiceImpl.class).addFareToImportationFolder(purchaseOrder, val); + // Beans.get(PurchaseOrderServiceImpl.class).addFareToImportationFolder(purchaseOrder, val); - ImportationFolder importationFolder = - Beans.get(PurchaseOrderServiceImpl.class).generateImportationFolder(purchaseOrder); + ImportationFolder importationFolder = + Beans.get(PurchaseOrderServiceImpl.class).generateImportationFolder(purchaseOrder); - // Beans.get(PurchaseOrderRepository.class).save(purchaseOrder); + // Beans.get(PurchaseOrderRepository.class).save(purchaseOrder); - response.setView( - ActionView.define("Importation folder") - .model(ImportationFolder.class.getName()) - .add("grid", "importation-folder-grid") - .add("form", "importation-folder-form") - .param("forceEdit", "true") - .domain("self.id = " + importationFolder.getId()) - .map()); - + response.setView( + ActionView.define("Importation folder") + .model(ImportationFolder.class.getName()) + .add("grid", "importation-folder-grid") + .add("form", "importation-folder-form") + .param("forceEdit", "true") + .domain("self.id = " + importationFolder.getId()) + .map()); } - public void validateFromFare(ActionRequest request, ActionResponse response) { try { - - BigDecimal purchaseOrderId = new BigDecimal(request.getContext().get("purchaseOrderId").toString()); - PurchaseOrder purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(new Long(purchaseOrderId.toString())); + + BigDecimal purchaseOrderId = + new BigDecimal(request.getContext().get("purchaseOrderId").toString()); + PurchaseOrder purchaseOrder = + Beans.get(PurchaseOrderRepository.class).find(new Long(purchaseOrderId.toString())); Beans.get(PurchaseOrderService.class).validatePurchaseOrder(purchaseOrder); response.setReload(true); } catch (Exception e) { @@ -493,7 +491,6 @@ public class PurchaseOrderController { } } - public void cancel(ActionRequest request, ActionResponse response) { try { PurchaseOrder purchaseOrder = request.getContext().asType(PurchaseOrder.class); @@ -699,24 +696,24 @@ public class PurchaseOrderController { Beans.get(PurchaseOrderRepository.class) .find(request.getContext().asType(PurchaseOrder.class).getId()); - // if (purchaseOrder.getImportationType() == 2 && purchaseOrder.getCurrency().getId() != 41){ + if (purchaseOrder.getCurrency().getId() != 41){ - // ImportationFolder importationFolder = - // Beans.get(PurchaseOrderServiceImpl.class).generateImportationFolder(purchaseOrder); + ImportationFolder importationFolder = + Beans.get(PurchaseOrderServiceImpl.class).generateImportationFolder(purchaseOrder); - // purchaseOrder.setImportationFolder(importationFolder); + purchaseOrder.setImportationFolder(importationFolder); - // // Beans.get(PurchaseOrderRepository.class).save(purchaseOrder); + // Beans.get(PurchaseOrderRepository.class).save(purchaseOrder); - // response.setView( - // ActionView.define("Importation folder") - // .model(ImportationFolder.class.getName()) - // .add("grid", "importation-folder-grid") - // .add("form", "importation-folder-form") - // .param("forceEdit", "true") - // .domain("self.id = " + importationFolder.getId()) - // .map()); - // } + response.setView( + ActionView.define("Importation folder") + .model(ImportationFolder.class.getName()) + .add("grid", "importation-folder-grid") + .add("form", "importation-folder-form") + .param("forceEdit", "true") + .domain("self.id = " + importationFolder.getId()) + .map()); + } } public void createPurchaseOrderBarCodeSeq(ActionRequest request, ActionResponse response) { diff --git a/modules/axelor-open-suite/axelor-purchase/src/main/resources/domains/ImportationFolder.xml b/modules/axelor-open-suite/axelor-purchase/src/main/resources/domains/ImportationFolder.xml index 07c023d..57c8b4d 100644 --- a/modules/axelor-open-suite/axelor-purchase/src/main/resources/domains/ImportationFolder.xml +++ b/modules/axelor-open-suite/axelor-purchase/src/main/resources/domains/ImportationFolder.xml @@ -119,6 +119,9 @@ + + + + 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"> - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-quality/src/main/java/com/axelor/apps/quality/service/print/ArtWorkPrintServiceImpl.java b/modules/axelor-open-suite/axelor-quality/src/main/java/com/axelor/apps/quality/service/print/ArtWorkPrintServiceImpl.java index 7e6c3c6..a53b3bb 100644 --- a/modules/axelor-open-suite/axelor-quality/src/main/java/com/axelor/apps/quality/service/print/ArtWorkPrintServiceImpl.java +++ b/modules/axelor-open-suite/axelor-quality/src/main/java/com/axelor/apps/quality/service/print/ArtWorkPrintServiceImpl.java @@ -19,8 +19,6 @@ package com.axelor.apps.quality.service.print; import com.axelor.apps.ReportFactory; import com.axelor.apps.quality.db.ArtWork; -import com.axelor.apps.base.service.app.AppBaseService; -import com.axelor.apps.quality.db.QualityControl; import com.axelor.apps.quality.exception.IExceptionMessage; import com.axelor.apps.quality.report.IReport; import com.axelor.apps.report.engine.ReportSettings; @@ -28,10 +26,8 @@ import com.axelor.apps.tool.file.PdfTool; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; -import com.axelor.inject.Beans; import java.io.File; import java.time.LocalDate; -import java.time.format.DateTimeFormatter; public class ArtWorkPrintServiceImpl { @@ -40,15 +36,9 @@ public class ArtWorkPrintServiceImpl { return I18n.get("ArtWork") + " " + artWork.getRef(); } - public String printArtWork(ArtWork artWork, String format) - throws AxelorException { + public String printArtWork(ArtWork artWork, String format) throws AxelorException { - String fileName = - I18n.get("ArtWork") - + " - " - + LocalDate.now().toString() - + "." - + format; + String fileName = I18n.get("ArtWork") + " - " + LocalDate.now().toString() + "." + format; return PdfTool.getFileLinkFromPdfFile(print(artWork, format), fileName); } @@ -70,8 +60,7 @@ public class ArtWorkPrintServiceImpl { artWork); } - String locale = - ReportSettings.getPrintingLocale(artWork.getCompany().getPartner()); + String locale = ReportSettings.getPrintingLocale(artWork.getCompany().getPartner()); String title = getFileName(artWork); ReportSettings reportSetting = diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationService.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationService.java index f8aac38..88c6727 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationService.java +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationService.java @@ -24,15 +24,19 @@ import com.google.inject.persist.Transactional; public interface QvmOperationService { - @Transactional - public QvmOperation createCalibrationSeq(Company company) throws AxelorException; + @Transactional + public QvmOperation createCalibrationSeq(Company company) throws AxelorException; - @Transactional - public QvmOperation createQualificationSeq(Company company) throws AxelorException; + @Transactional + public QvmOperation createQualificationSeq(Company company) throws AxelorException; - @Transactional - public QvmOperation createOperationSeq(Company company) throws AxelorException; + @Transactional + public QvmOperation createOperationSeq(Company company) throws AxelorException; - @Transactional - public QvmOperation setMachine(QvmOperation operation) throws AxelorException; + @Transactional + public QvmOperation setMachine(QvmOperation operation) throws AxelorException; + + @Transactional + public QvmOperation createNextOperation(QvmOperation operation, Long userId) + throws AxelorException; } diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationServiceImpl.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationServiceImpl.java index 101fdea..b8efb86 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationServiceImpl.java +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/QvmOperationServiceImpl.java @@ -21,84 +21,118 @@ import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.repo.SequenceRepository; import com.axelor.apps.base.service.administration.SequenceService; import com.axelor.apps.qvm.db.QvmOperation; +import com.axelor.apps.qvm.db.repo.QvmOperationRepository; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; +import com.axelor.inject.Beans; import com.google.inject.Inject; import com.google.inject.persist.Transactional; public class QvmOperationServiceImpl implements QvmOperationService { - @Inject - protected SequenceService sequenceService; + @Inject protected SequenceService sequenceService; - @Transactional - public QvmOperation createCalibrationSeq(Company company) throws AxelorException { + @Transactional + public QvmOperation createCalibrationSeq(Company company) throws AxelorException { - QvmOperation calibration = new QvmOperation(); - calibration.setSerialNumber(this.getCalibrationSequence(company)); + QvmOperation calibration = new QvmOperation(); + calibration.setSerialNumber(this.getCalibrationSequence(company)); - return calibration; + return calibration; + } + + @Transactional + public QvmOperation createQualificationSeq(Company company) throws AxelorException { + + QvmOperation qualification = new QvmOperation(); + qualification.setSerialNumber(this.getQualificationSequence(company)); + + return qualification; + } + + @Transactional + public QvmOperation createOperationSeq(Company company) throws AxelorException { + + QvmOperation operation = new QvmOperation(); + operation.setSerialNumber(this.getOperationSequence(company)); + + return operation; + } + + public String getCalibrationSequence(Company company) throws AxelorException { + String seq = sequenceService.getSequenceNumber(SequenceRepository.CALIB_SEQ, company); + if (seq == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get("Calibration Sequence is not defined"), + company.getName()); } + return seq; + } - @Transactional - public QvmOperation createQualificationSeq(Company company) throws AxelorException { - - QvmOperation qualification = new QvmOperation(); - qualification.setSerialNumber(this.getQualificationSequence(company)); - - return qualification; + public String getQualificationSequence(Company company) throws AxelorException { + String seq = sequenceService.getSequenceNumber(SequenceRepository.QUAL_SEQ, company); + if (seq == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get("Qualification Sequence is not defined"), + company.getName()); } + return seq; + } - @Transactional - public QvmOperation createOperationSeq(Company company) throws AxelorException { - - QvmOperation operation = new QvmOperation(); - operation.setSerialNumber(this.getOperationSequence(company)); - - return operation; + public String getOperationSequence(Company company) throws AxelorException { + String seq = sequenceService.getSequenceNumber(SequenceRepository.OP_SEQ, company); + if (seq == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get("Operation Sequence is not defined"), + company.getName()); } + return seq; + } - public String getCalibrationSequence(Company company) throws AxelorException { - String seq = sequenceService.getSequenceNumber(SequenceRepository.CALIB_SEQ, company); - if (seq == null) { - throw new AxelorException( - company, - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get("Calibration Sequence is not defined"), - company.getName()); + public QvmOperation setMachine(QvmOperation calibration) throws AxelorException { + if (calibration.getMachineName() != null) { + System.out.println("calibration.getMachineName : " + calibration.getMachineName()); + } + return calibration; + } + + public QvmOperation createNextOperation(QvmOperation operation, Long userId) { + QvmOperation nextOperation = Beans.get(QvmOperationRepository.class).copy(operation, true); + if (operation != null) { + try { + nextOperation.setStatusSelect(1); + nextOperation.setOperationOrigin(operation.getSerialNumber()); + nextOperation.setCreationType(2); + nextOperation.setPastOperationDate(operation.getOperationDate()); + nextOperation.setOperationDate(operation.getOperationDueDate()); + if (operation.getOperationFrequency() == 1) { + nextOperation.setOperationDueDate(operation.getOperationDueDate().plusYears(1)); + nextOperation.setCountdown(364); } - return seq; - } - - public String getQualificationSequence(Company company) throws AxelorException { - String seq = sequenceService.getSequenceNumber(SequenceRepository.QUAL_SEQ, company); - if (seq == null) { - throw new AxelorException( - company, - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get("Qualification Sequence is not defined"), - company.getName()); + if (operation.getOperationFrequency() == 2) { + nextOperation.setOperationDueDate(operation.getOperationDueDate().plusMonths(1)); + nextOperation.setCountdown(31); } - return seq; - } - - public String getOperationSequence(Company company) throws AxelorException { - String seq = sequenceService.getSequenceNumber(SequenceRepository.OP_SEQ, company); - if (seq == null) { - throw new AxelorException( - company, - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get("Operation Sequence is not defined"), - company.getName()); + if (operation.getOperationFrequency() == 3) { + nextOperation.setOperationDueDate(operation.getOperationDueDate().plusMonths(6)); + nextOperation.setCountdown(183); } - return seq; - } - - public QvmOperation setMachine(QvmOperation calibration) throws AxelorException { - if (calibration.getMachineName() != null) { - System.out.println("calibration.getMachineName : " + calibration.getMachineName()); - } - return calibration; + System.out.println( + "operation.getOperationFrequency : " + operation.getOperationFrequency()); + nextOperation.setSerialNumber(null); + nextOperation.setCreationType(2); + } catch (Exception exception) { + System.out.println(exception); + } } + // Beans.get(QvmOperationRepository.class).save(nextOperation); + return nextOperation; + } } diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/translation/ITranslation.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/translation/ITranslation.java new file mode 100644 index 0000000..9cd9ba0 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/translation/ITranslation.java @@ -0,0 +1,24 @@ +package com.axelor.apps.qvm.translation; + +/* + * Axelor Business Solutions + * + * Copyright (C) 2019 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +public interface ITranslation { + + public static final String OPERATION = /*$$(*/ "Operation"; /*)*/ +} diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java index 33dcf85..e9ef93e 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java @@ -18,85 +18,151 @@ package com.axelor.apps.qvm.web; import com.axelor.apps.qvm.db.QvmOperation; +import com.axelor.apps.qvm.db.repo.QvmOperationRepository; import com.axelor.apps.qvm.service.QvmOperationService; -import com.axelor.apps.qvm.service.QvmOperationServiceImpl; +import com.axelor.apps.qvm.translation.ITranslation; +import com.axelor.auth.AuthUtils; +import com.axelor.auth.db.User; 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.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; -import com.google.inject.Singleton; +import com.axelor.rpc.Context; import java.lang.invoke.MethodHandles; +import javax.persistence.EntityManager; +import javax.persistence.EntityTransaction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class QvmOperationController { - private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - public void setSequenceOperation(ActionRequest request, ActionResponse response) { + public void setSequenceOperation(ActionRequest request, ActionResponse response) { + try { + QvmOperation calibration = request.getContext().asType(QvmOperation.class); + + if (calibration != null && calibration.getCompany() != null) { + response.setValue( + "serialNumber", + Beans.get(QvmOperationService.class) + .createOperationSeq(calibration.getCompany()) + .getSerialNumber()); + } else { + System.out.println("Operation or company est null"); + System.out.println("Operation : " + calibration); + System.out.println("Company : " + calibration.getCompany()); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void setSequenceCalibration(ActionRequest request, ActionResponse response) { + try { + QvmOperation calibration = request.getContext().asType(QvmOperation.class); + + if (calibration != null && calibration.getCompany() != null) { + response.setValue( + "serialNumber", + Beans.get(QvmOperationService.class) + .createCalibrationSeq(calibration.getCompany()) + .getSerialNumber()); + } else { + System.out.println("Operation or company est null"); + System.out.println("Operation : " + calibration); + System.out.println("Company : " + calibration.getCompany()); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void setSequenceQualification(ActionRequest request, ActionResponse response) { + try { + QvmOperation calibration = request.getContext().asType(QvmOperation.class); + + if (calibration != null && calibration.getCompany() != null) { + response.setValue( + "serialNumber", + Beans.get(QvmOperationService.class) + .createQualificationSeq(calibration.getCompany()) + .getSerialNumber()); + } else { + System.out.println("Operation or company est null"); + System.out.println("Operation : " + calibration); + System.out.println("Company : " + calibration.getCompany()); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void setMachineInfo(ActionRequest request, ActionResponse response) + throws AxelorException { + QvmOperation calibration = request.getContext().asType(QvmOperation.class); + QvmOperation newOperation = Beans.get(QvmOperationService.class).setMachine(calibration); + } + + public void generateQvmOperation(ActionRequest request, ActionResponse response) { + try { + User user = AuthUtils.getUser(); + Context context = request.getContext(); + Long id = (Long) request.getContext().get("id"); + QvmOperation operation = Beans.get(QvmOperationRepository.class).find(id); + if (operation == null) { + response.setError("Operation not found."); + return; + } + operation = Beans.get(QvmOperationRepository.class).find(operation.getId()); + + // printOperationInformation(operation); + QvmOperation nextOperation = + Beans.get(QvmOperationService.class).createNextOperation(operation, user.getId()); + + // printOperationInformation(nextOperation); + if (nextOperation != null) { try { - QvmOperation calibration = request.getContext().asType(QvmOperation.class); - - if (calibration != null && calibration.getCompany() != null) { - response.setValue( - "serialNumber", - Beans.get(QvmOperationService.class) - .createOperationSeq(calibration.getCompany()) - .getSerialNumber()); - } else { - System.out.println("Operation or company est null"); - System.out.println("Operation : " + calibration); - System.out.println("Company : " + calibration.getCompany()); - } + // Beans.get(QvmOperationRepository.class).save(nextOperation); + saveQvmOperation(nextOperation); } catch (Exception e) { - TraceBackService.trace(response, e); + TraceBackService.trace(response, e); } + response.setView( + ActionView.define(I18n.get(ITranslation.OPERATION)) + .model(QvmOperation.class.getName()) + .add("grid", "operation-grid") + .add("form", "operation-form") + .param("forceEdit", "true") + .context("_showRecord", nextOperation.getId()) + .map()); + response.setCanClose(true); + } else { + response.setError("Failed to create the next operation."); + } + } catch (Exception e) { + TraceBackService.trace(response, e); } + } - public void setSequenceCalibration(ActionRequest request, ActionResponse response) { - try { - QvmOperation calibration = request.getContext().asType(QvmOperation.class); + public void saveQvmOperation(QvmOperation operation) { + EntityManager entityManager = Beans.get(EntityManager.class); + EntityTransaction transaction = entityManager.getTransaction(); - if (calibration != null && calibration.getCompany() != null) { - response.setValue( - "serialNumber", - Beans.get(QvmOperationService.class) - .createCalibrationSeq(calibration.getCompany()) - .getSerialNumber()); - } else { - System.out.println("Operation or company est null"); - System.out.println("Operation : " + calibration); - System.out.println("Company : " + calibration.getCompany()); - } - } catch (Exception e) { - TraceBackService.trace(response, e); - } - } - - public void setSequenceQualification(ActionRequest request, ActionResponse response) { - try { - QvmOperation calibration = request.getContext().asType(QvmOperation.class); - - if (calibration != null && calibration.getCompany() != null) { - response.setValue( - "serialNumber", - Beans.get(QvmOperationService.class) - .createQualificationSeq(calibration.getCompany()) - .getSerialNumber()); - } else { - System.out.println("Operation or company est null"); - System.out.println("Operation : " + calibration); - System.out.println("Company : " + calibration.getCompany()); - } - } catch (Exception e) { - TraceBackService.trace(response, e); - } - } - - public void setMachineInfo(ActionRequest request, ActionResponse response) - throws AxelorException { - QvmOperation calibration = request.getContext().asType(QvmOperation.class); - QvmOperation newOperation = Beans.get(QvmOperationService.class).setMachine(calibration); + System.out.println("Is transaction active? " + transaction.isActive()); + + try { + transaction.begin(); + entityManager.persist(operation); + transaction.commit(); + } catch (Exception e) { + if (transaction != null && transaction.isActive()) { + transaction.rollback(); + } + throw e; } + } } diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmMachineLocation.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmMachineLocation.xml index d5656c1..824e3f6 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmMachineLocation.xml +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmMachineLocation.xml @@ -7,10 +7,11 @@ - + - + + diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperation.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperation.xml index 5f667cd..92641a7 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperation.xml +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperation.xml @@ -40,6 +40,8 @@ + + diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperationType.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperationType.xml index 4512604..2db0c99 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperationType.xml +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/QvmOperationType.xml @@ -9,7 +9,11 @@ diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml index 36d2802..0c22937 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml @@ -37,4 +37,9 @@ + + + + + \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-sale/src/main/java/com/axelor/apps/sale/service/saleorder/SaleOrderWorkflowServiceImpl.java b/modules/axelor-open-suite/axelor-sale/src/main/java/com/axelor/apps/sale/service/saleorder/SaleOrderWorkflowServiceImpl.java index 07d7dff..739b0ce 100644 --- a/modules/axelor-open-suite/axelor-sale/src/main/java/com/axelor/apps/sale/service/saleorder/SaleOrderWorkflowServiceImpl.java +++ b/modules/axelor-open-suite/axelor-sale/src/main/java/com/axelor/apps/sale/service/saleorder/SaleOrderWorkflowServiceImpl.java @@ -137,21 +137,19 @@ public class SaleOrderWorkflowServiceImpl implements SaleOrderWorkflowService { Beans.get(BlockingService.class) .getBlocking(partner, saleOrder.getCompany(), BlockingRepository.SALE_BLOCKING); - - if (blocking != null && saleOrder.getInTaxTotal().compareTo(blocking.getMaxAmount()) > 0) { - + System.out.println("************************************"); System.out.println(blocking); System.out.println(saleOrder.getInTaxTotal().compareTo(blocking.getMaxAmount()) > 0); System.out.println("************************************"); saleOrder.setBlockedOnCustCreditExceed(true); // if (!saleOrder.getManualUnblock()) { - saleOrderRepo.save(saleOrder); - String reason = - blocking.getBlockingReason() != null ? blocking.getBlockingReason().getName() : ""; - throw new BlockedSaleOrderException( - partner, I18n.get("Client is sale blocked:") + " " + reason); + saleOrderRepo.save(saleOrder); + String reason = + blocking.getBlockingReason() != null ? blocking.getBlockingReason().getName() : ""; + throw new BlockedSaleOrderException( + partner, I18n.get("Client is sale blocked:") + " " + reason); // } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/db/repo/StockProductionRequestManagementRepository.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/db/repo/StockProductionRequestManagementRepository.java index 1ac5de5..6cfa277 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/db/repo/StockProductionRequestManagementRepository.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/db/repo/StockProductionRequestManagementRepository.java @@ -1,16 +1,13 @@ package com.axelor.apps.stock.db.repo; -import javax.persistence.PersistenceException; - import com.axelor.apps.base.service.administration.SequenceService; -import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockProductionRequest; -import com.axelor.apps.stock.service.StockMoveToolService; import com.axelor.inject.Beans; import com.google.common.base.Strings; +import javax.persistence.PersistenceException; + +public class StockProductionRequestManagementRepository extends StockProductionRequestRepository { -public class StockProductionRequestManagementRepository extends StockProductionRequestRepository{ - @Override public StockProductionRequest save(StockProductionRequest entity) { try { @@ -18,12 +15,15 @@ public class StockProductionRequestManagementRepository extends StockProduction SequenceService sequenceService = Beans.get(SequenceService.class); if (Strings.isNullOrEmpty(productionRequest.getStockProductionRequestSeq())) { - productionRequest.setStockProductionRequestSeq(sequenceService.getDraftSequenceNumber(productionRequest)); + productionRequest.setStockProductionRequestSeq( + sequenceService.getDraftSequenceNumber(productionRequest)); } if (Strings.isNullOrEmpty(productionRequest.getName()) - || productionRequest.getName().startsWith(productionRequest.getStockProductionRequestSeq())) { - productionRequest.setName(productionRequest.getStockProductionRequestSeq()); + || productionRequest + .getName() + .startsWith(productionRequest.getStockProductionRequestSeq())) { + productionRequest.setName(productionRequest.getStockProductionRequestSeq()); } return productionRequest; @@ -31,5 +31,4 @@ public class StockProductionRequestManagementRepository extends StockProduction throw new PersistenceException(e); } } - } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/exception/IExceptionMessage.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/exception/IExceptionMessage.java index 21a67db..e075158 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/exception/IExceptionMessage.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/exception/IExceptionMessage.java @@ -129,6 +129,8 @@ public interface IExceptionMessage { "You must configure a default receipt stock location for the company %s" /*)*/; static final String STOCK_CONFIG_PICKUP = /*$$(*/ "You must configure a default pickup stock location for the company %s" /*)*/; + static final String STOCK_CONFIG_NON_COMPLIANT = /*$$(*/ + "You must configure a default non compliant stock location for the company %s" /*)*/; /** Stock Location Controller */ static final String LOCATION_1 = /*$$(*/ diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InternalTrackingNumberService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InternalTrackingNumberService.java new file mode 100644 index 0000000..91b40dd --- /dev/null +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InternalTrackingNumberService.java @@ -0,0 +1,72 @@ +package com.axelor.apps.stock.service; + +import com.axelor.apps.base.db.Company; +import com.axelor.apps.base.db.Product; +import com.axelor.apps.stock.db.InternalTrackingNumber; +import com.axelor.apps.stock.db.StockConfig; +import com.axelor.apps.stock.db.TrackingNumber; +import com.axelor.apps.stock.db.repo.InternalTrackingNumberRepository; +import com.axelor.apps.stock.db.repo.StockConfigRepository; +import com.axelor.exception.AxelorException; +import com.axelor.inject.Beans; +import com.google.inject.persist.Transactional; +import java.time.LocalDate; + +public class InternalTrackingNumberService { + + @Transactional(rollbackOn = {Exception.class}) + public InternalTrackingNumber createInternalTrackingNumber( + Product product, Company company, LocalDate date, TrackingNumber trackingNumber) + throws AxelorException { + + InternalTrackingNumber internalTrackingNumber = new InternalTrackingNumber(); + internalTrackingNumber.setProduct(product); + internalTrackingNumber.setTrackingNumber(trackingNumber); + internalTrackingNumber.setPerishableExpirationDate( + trackingNumber.getPerishableExpirationDate()); + internalTrackingNumber.setFabricationDate(internalTrackingNumber.getFabricationDate()); + internalTrackingNumber.setReceptionDate(date); + + Long categoryId = product.getFamilleProduit().getId(); + + StockConfig stockConfig = + Beans.get(StockConfigRepository.class).all().filter("self.company = ?", company).fetchOne(); + + String sequence = ""; + + switch (categoryId.intValue()) { + case 67: + sequence = Beans.get(StockMoveToolServiceImpl.class).getInternalSequence(36, company, date); + stockConfig.setMpInternalSeq((stockConfig.getMpInternalSeq() + 1)); + break; + case 68: + sequence = Beans.get(StockMoveToolServiceImpl.class).getInternalSequence(36, company, date); + stockConfig.setMpInternalSeq((stockConfig.getMpInternalSeq() + 1)); + break; + case 59: + sequence = Beans.get(StockMoveToolServiceImpl.class).getInternalSequence(35, company, date); + stockConfig.setAcInternalSeq((stockConfig.getMpInternalSeq() + 1)); + break; + default: + // sequence = "AC" + stockConfig.getAcInternalSeq() + month + formattedYear; + // stockConfig.setAcInternalSeq((stockConfig.getMpInternalSeq() + 1)); + break; + } + + Beans.get(StockConfigRepository.class).save(stockConfig); + internalTrackingNumber.setTrackingNumberSeq(sequence); + + return internalTrackingNumber; + } + + public InternalTrackingNumber getInternalTrackingNumber( + Product product, TrackingNumber trackingNumber) { + InternalTrackingNumber internalTrackingNumber = + Beans.get(InternalTrackingNumberRepository.class) + .all() + .filter("self.product = ?1 and self.trackingNumber = ?2", product, trackingNumber) + .fetchOne(); + + return internalTrackingNumber; + } +} diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InventoryLineService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InventoryLineService.java index 79693bc..0fc22eb 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InventoryLineService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/InventoryLineService.java @@ -31,15 +31,13 @@ import com.axelor.db.Query; import com.axelor.inject.Beans; import com.google.inject.Inject; import com.google.inject.persist.Transactional; - import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; public class InventoryLineService { - @Inject - private ProductRepository productRepository; + @Inject private ProductRepository productRepository; private TrackingNumberRepository trackingNumberRepository; private InventoryLineRepository inventoryLineRepository; @@ -110,60 +108,67 @@ public class InventoryLineService { return inventoryLine; } + @Transactional + public void setInventoryLine( + Inventory inventory, + Product product, + TrackingNumber trackingNumber, + int countingType, + BigDecimal firstCounting, + BigDecimal secondCounting, + BigDecimal controlCounting) { + InventoryLine line; -@Transactional -public void setInventoryLine(Inventory inventory, Product product,TrackingNumber trackingNumber,int countingType, - BigDecimal firstCounting,BigDecimal secondCounting,BigDecimal controlCounting -) { - InventoryLine line; - - Query query = Beans.get(InventoryLineRepository.class).all(); + Query query = Beans.get(InventoryLineRepository.class).all(); - if(trackingNumber != null){ - line = query - .filter( - "self.product.id = ?1 AND self.trackingNumber.id = ?2 and self.inventory.id = ?3", - product.getId(),trackingNumber.getId(),inventory.getId()) - .fetchOne(); - }else{ - line = query - .filter( - "self.product.id = ?1 AND self.trackingNumber is null and self.inventory.id = ?2", - product.getId(),inventory.getId()) - .fetchOne(); + if (trackingNumber != null) { + line = + query + .filter( + "self.product.id = ?1 AND self.trackingNumber.id = ?2 and self.inventory.id = ?3", + product.getId(), + trackingNumber.getId(), + inventory.getId()) + .fetchOne(); + } else { + line = + query + .filter( + "self.product.id = ?1 AND self.trackingNumber is null and self.inventory.id = ?2", + product.getId(), + inventory.getId()) + .fetchOne(); } + if (line == null) { + line = this.createInventoryLine(inventory, product, BigDecimal.ZERO, null, trackingNumber); + } - if(line == null){ - line = this.createInventoryLine(inventory, product, BigDecimal.ZERO, null, trackingNumber); - } + BigDecimal counting = BigDecimal.ZERO; - BigDecimal counting = BigDecimal.ZERO; - - switch (countingType) { - case 1: - counting = line.getFirstCounting() != null ? line.getFirstCounting() : BigDecimal.ZERO; - line.setFirstCounting(counting.add(firstCounting)); - line.setFirstCountingByUser(AuthUtils.getUser()); - line.setFirstCountingDate(LocalDateTime.now()); - break; - case 2: - counting = line.getSecondCounting() != null ? line.getSecondCounting() : BigDecimal.ZERO; - line.setSecondCounting(counting.add(secondCounting)); - line.setSecondCountingByUser(AuthUtils.getUser()); - line.setSecondCountingDate(LocalDateTime.now()); - break; - case 3: - counting = line.getControlCounting() != null ? line.getControlCounting() : BigDecimal.ZERO; - line.setControlCounting(counting.add(controlCounting)); - line.setControlCountingByUser(AuthUtils.getUser()); - line.setControlCountingDate(LocalDateTime.now()); - break; - default: - break; - } - - Beans.get(InventoryLineRepository.class).save(line); -} + switch (countingType) { + case 1: + counting = line.getFirstCounting() != null ? line.getFirstCounting() : BigDecimal.ZERO; + line.setFirstCounting(counting.add(firstCounting)); + line.setFirstCountingByUser(AuthUtils.getUser()); + line.setFirstCountingDate(LocalDateTime.now()); + break; + case 2: + counting = line.getSecondCounting() != null ? line.getSecondCounting() : BigDecimal.ZERO; + line.setSecondCounting(counting.add(secondCounting)); + line.setSecondCountingByUser(AuthUtils.getUser()); + line.setSecondCountingDate(LocalDateTime.now()); + break; + case 3: + counting = line.getControlCounting() != null ? line.getControlCounting() : BigDecimal.ZERO; + line.setControlCounting(counting.add(controlCounting)); + line.setControlCountingByUser(AuthUtils.getUser()); + line.setControlCountingDate(LocalDateTime.now()); + break; + default: + break; + } + Beans.get(InventoryLineRepository.class).save(line); + } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockHistoryServiceImpl.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockHistoryServiceImpl.java index 53397d6..b00b4e9 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockHistoryServiceImpl.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockHistoryServiceImpl.java @@ -42,7 +42,7 @@ import com.axelor.meta.MetaFiles; import com.axelor.meta.db.MetaFile; import com.google.common.io.Files; import com.google.inject.Inject; - +import com.google.inject.persist.Transactional; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -54,16 +54,11 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.time.LocalDate; import java.util.ArrayList; -import java.util.Comparator; import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.stream.Collector; import java.util.stream.Collectors; - import javax.persistence.Query; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -83,7 +78,7 @@ public class StockHistoryServiceImpl implements StockHistoryService { } public List computeStockHistoryLineList( - Long productId, Long companyId, Long stockLocationId,LocalDate beginDate, LocalDate endDate) + Long productId, Long companyId, Long stockLocationId, LocalDate beginDate, LocalDate endDate) throws AxelorException { List stockHistoryLineList = new ArrayList<>(); @@ -126,6 +121,7 @@ public class StockHistoryServiceImpl implements StockHistoryService { return stockHistoryLineList; } + @Transactional protected void fetchAndFillResultForStockHistoryQuery( StockHistoryLine stockHistoryLine, Long productId, @@ -135,30 +131,31 @@ public class StockHistoryServiceImpl implements StockHistoryService { LocalDate periodEndDate, boolean incoming, boolean allLocations, - Long trackingNumberId) + TrackingNumber trackingNumber) throws AxelorException { + Long trackingNumberId = trackingNumber.getId(); String filter = "self.product.id = :productId " + "AND self.stockMove.statusSelect = :realized " + "AND self.stockMove.company.id = :companyId " + "AND self.stockMove.realDate >= :beginDate " + "AND self.stockMove.realDate < :endDate "; - + if (incoming) { - if(allLocations == true){ + if (allLocations == true) { filter += "AND self.stockMove.fromStockLocation.typeSelect = :typeSelect "; - }else{ + } else { filter += "AND self.stockMove.toStockLocation.id = :stockLocationId "; } } else { - if(allLocations == true){ + if (allLocations == true) { filter += "AND self.stockMove.toStockLocation.typeSelect = :typeSelect "; - }else{ + } else { filter += "AND self.stockMove.fromStockLocation.id = :stockLocationId "; } } - if(trackingNumberId != null){ + if (trackingNumberId != null) { filter += " AND self.trackingNumber.id = :trackingNumberId"; } @@ -362,30 +359,45 @@ public class StockHistoryServiceImpl implements StockHistoryService { return stockHistoryLine; } - - public List compuHistoryLinesPerDate(Long productId, Long companyId, Long stockLocationId, LocalDate beginDate, LocalDate endDate,Long categoryId,Long trackingNumberId,Integer searchTypeSelect) throws AxelorException { + @Transactional + public List compuHistoryLinesPerDate( + Long productId, + Long companyId, + Long stockLocationId, + LocalDate beginDate, + LocalDate endDate, + Long categoryId, + Long trackingNumberId, + Integer searchTypeSelect) + throws AxelorException { List stockHistoryLineList = new ArrayList<>(); Company company = Beans.get(CompanyRepository.class).find(companyId); - //ALL - if(searchTypeSelect == 1){ + // ALL + if (searchTypeSelect == 1) { - List products = Beans.get(ProductRepository.class).all().fetch(); - for (Product product : products) { - StockHistoryLine stockHistoryLine = new StockHistoryLine(); - stockHistoryLine.setLabel(product.getFullName().toString()); + List products = + Beans.get(StockLocationLineRepository.class) + .all() + .fetchStream() + .map(StockLocationLine::getProduct) + .distinct() + .collect(Collectors.toList()); + for (Product product : products) { + StockHistoryLine stockHistoryLine = new StockHistoryLine(); + stockHistoryLine.setLabel(product.getFullName().toString()); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + product.getId(), + companyId, + stockLocationId, + beginDate, + endDate, + true, + true, + null); - fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - product.getId(), - companyId, - stockLocationId, - beginDate, - endDate, - true, - true, - null); - fetchAndFillResultForStockHistoryQuery( stockHistoryLine, product.getId(), @@ -396,146 +408,27 @@ public class StockHistoryServiceImpl implements StockHistoryService { false, true, null); - - BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId,true,null); - BigDecimal realQty = totalQty.add(stockHistoryLine.getSumOutQtyPeriod()).subtract(stockHistoryLine.getSumIncQtyPeriod()); - stockHistoryLine.setRealQty(realQty); - stockHistoryLineList.add(stockHistoryLine); - } - }else if(searchTypeSelect == 3){ - List products = Beans.get(ProductRepository.class).all().filter("self.familleProduit.id in ("+String.valueOf(categoryId)+")").fetch(); + BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId, true, null); + BigDecimal realQty = + totalQty + .add(stockHistoryLine.getSumOutQtyPeriod()) + .subtract(stockHistoryLine.getSumIncQtyPeriod()); + stockHistoryLine.setRealQty(realQty); + stockHistoryLineList.add(stockHistoryLine); + } + + } else if (searchTypeSelect == 3) { + List products = + Beans.get(ProductRepository.class) + .all() + .filter("self.familleProduit.id in (" + String.valueOf(categoryId) + ")") + .fetch(); for (Product product : products) { StockHistoryLine stockHistoryLine = new StockHistoryLine(); stockHistoryLine.setLabel(product.getFullName().toString()); fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - product.getId(), - companyId, - stockLocationId, - beginDate, - endDate, - true, - true, - null); - - fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - product.getId(), - companyId, - stockLocationId, - beginDate, - endDate, - false, - true, - null); - - BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId,true,null); - BigDecimal realQty = totalQty.add(stockHistoryLine.getSumOutQtyPeriod()).subtract(stockHistoryLine.getSumIncQtyPeriod()); - stockHistoryLine.setRealQty(realQty); - stockHistoryLineList.add(stockHistoryLine); - } - - }else if(searchTypeSelect == 2){ - StockHistoryLine stockHistoryLine = new StockHistoryLine(); - stockHistoryLine.setLabel(beginDate.toString()); - - fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - productId, - companyId, - stockLocationId, - beginDate, - endDate, - true, - false, - null); - - fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - productId, - companyId, - stockLocationId, - beginDate, - endDate, - false, - false, - null); - - Product product = Beans.get(ProductRepository.class).find(productId); - BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId,false,null); - BigDecimal realQty = totalQty.add(stockHistoryLine.getSumOutQtyPeriod()).subtract(stockHistoryLine.getSumIncQtyPeriod()); - stockHistoryLine.setRealQty(realQty); - stockHistoryLineList.add(stockHistoryLine); - } - else if(searchTypeSelect == 4){ - StockHistoryLine stockHistoryLine = new StockHistoryLine(); - TrackingNumber trackingNumber = Beans.get(TrackingNumberRepository.class).find(trackingNumberId); - Product product = Beans.get(ProductRepository.class).find(productId); - - stockHistoryLine.setLabel(beginDate.toString() + " " + product.getName() + " " + trackingNumber.getTrackingNumberSeq()); - - fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - productId, - companyId, - stockLocationId, - beginDate, - endDate, - true, - true, - trackingNumberId); - - fetchAndFillResultForStockHistoryQuery( - stockHistoryLine, - productId, - companyId, - stockLocationId, - beginDate, - endDate, - false, - true, - trackingNumberId); - - BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId,true,trackingNumberId); - System.out.println("***************totalQty*******************"); - System.out.println(trackingNumberId); - System.out.println(totalQty); - System.out.println("***************totalQty*******************"); - BigDecimal realQty = totalQty.add(stockHistoryLine.getSumOutQtyPeriod()).subtract(stockHistoryLine.getSumIncQtyPeriod()); - stockHistoryLine.setRealQty(realQty); - stockHistoryLineList.add(stockHistoryLine); - } else if(searchTypeSelect == 5){ - List stockLocationLines = Beans.get(StockLocationLineRepository.class).all().filter("self.detailsStockLocation.typeSelect != " + StockLocationRepository.TYPE_VIRTUAL + " AND self.detailsStockLocation != null AND self.product.familleProduit.id in ("+String.valueOf(categoryId)+")").fetch(); - - log.debug("stockLocationLines : {}",stockLocationLines); - log.debug("stockLocationLines size : {}",stockLocationLines.size()); - log.debug("categoryId : {}",categoryId); - log.debug("categoryId : {}",categoryId); - - int sizeWithoutTraccking = stockLocationLines.stream().filter(t -> t.getTrackingNumber() == null).collect(Collectors.toList()).size(); - - log.debug("sizeWithoutTraccking : {}",sizeWithoutTraccking); - - List trackingNumbers = Beans.get(TrackingNumberRepository.class).all().fetch(); - List products = Beans.get(ProductRepository.class).all().fetch(); - - for (StockLocationLine line : stockLocationLines) { - - TrackingNumber trackingNumber = trackingNumbers.stream().filter(t -> t.getId() == line.getTrackingNumber().getId()).findFirst().get(); - Product product = products.stream().filter(t -> t.getId() == line.getProduct().getId()).findFirst().get(); - - Long trackingNumberId2 = trackingNumber.getId(); - - if(trackingNumber != null){ - log.debug("trackingNumber >>>>>> : {}",trackingNumber); - log.debug("product >>>>>> : {}",product); - - StockHistoryLine stockHistoryLine = new StockHistoryLine(); - stockHistoryLine.setLabel(beginDate.toString()); - - fetchAndFillResultForStockHistoryQuery( stockHistoryLine, product.getId(), companyId, @@ -544,66 +437,248 @@ public class StockHistoryServiceImpl implements StockHistoryService { endDate, true, true, - trackingNumberId2); - + null); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + product.getId(), + companyId, + stockLocationId, + beginDate, + endDate, + false, + true, + null); + + BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId, true, null); + BigDecimal realQty = + totalQty + .add(stockHistoryLine.getSumOutQtyPeriod()) + .subtract(stockHistoryLine.getSumIncQtyPeriod()); + stockHistoryLine.setRealQty(realQty); + stockHistoryLineList.add(stockHistoryLine); + } + + } else if (searchTypeSelect == 2) { + StockHistoryLine stockHistoryLine = new StockHistoryLine(); + stockHistoryLine.setLabel(beginDate.toString()); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + productId, + companyId, + stockLocationId, + beginDate, + endDate, + true, + false, + null); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + productId, + companyId, + stockLocationId, + beginDate, + endDate, + false, + false, + null); + + Product product = Beans.get(ProductRepository.class).find(productId); + BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId, false, null); + BigDecimal realQty = + totalQty + .add(stockHistoryLine.getSumOutQtyPeriod()) + .subtract(stockHistoryLine.getSumIncQtyPeriod()); + stockHistoryLine.setRealQty(realQty); + stockHistoryLineList.add(stockHistoryLine); + } else if (searchTypeSelect == 4) { + StockHistoryLine stockHistoryLine = new StockHistoryLine(); + TrackingNumber trackingNumber = + Beans.get(TrackingNumberRepository.class).find(trackingNumberId); + Product product = Beans.get(ProductRepository.class).find(productId); + + stockHistoryLine.setLabel( + beginDate.toString() + + " " + + product.getName() + + " " + + trackingNumber.getTrackingNumberSeq()); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + productId, + companyId, + stockLocationId, + beginDate, + endDate, + true, + true, + trackingNumber); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + productId, + companyId, + stockLocationId, + beginDate, + endDate, + false, + true, + trackingNumber); + + BigDecimal totalQty = + this.getTotalQty(product, company, stockLocationId, true, trackingNumberId); + System.out.println("***************totalQty*******************"); + System.out.println(trackingNumberId); + System.out.println(totalQty); + System.out.println("***************totalQty*******************"); + BigDecimal realQty = + totalQty + .add(stockHistoryLine.getSumOutQtyPeriod()) + .subtract(stockHistoryLine.getSumIncQtyPeriod()); + stockHistoryLine.setRealQty(realQty); + stockHistoryLineList.add(stockHistoryLine); + } else if (searchTypeSelect == 5) { + List stockLocationLines = + Beans.get(StockLocationLineRepository.class) + .all() + .filter( + "self.detailsStockLocation.typeSelect != " + + StockLocationRepository.TYPE_VIRTUAL + + " AND self.detailsStockLocation != null AND self.product.familleProduit.id in (" + + String.valueOf(categoryId) + + ")") + .fetch(); + + log.debug("stockLocationLines : {}", stockLocationLines); + log.debug("stockLocationLines size : {}", stockLocationLines.size()); + log.debug("categoryId : {}", categoryId); + log.debug("categoryId : {}", categoryId); + + int sizeWithoutTraccking = + stockLocationLines + .stream() + .filter(t -> t.getTrackingNumber() == null) + .collect(Collectors.toList()) + .size(); + + log.debug("sizeWithoutTraccking : {}", sizeWithoutTraccking); + + List trackingNumbers = + Beans.get(TrackingNumberRepository.class).all().fetch(); + List products = Beans.get(ProductRepository.class).all().fetch(); + + this.sumGroupByStocklocation(null, null, beginDate, null); + + for (StockLocationLine line : stockLocationLines) { + + TrackingNumber trackingNumber = + trackingNumbers + .stream() + .filter(t -> t.getId() == line.getTrackingNumber().getId()) + .findFirst() + .get(); + Product product = + products.stream().filter(t -> t.getId() == line.getProduct().getId()).findFirst().get(); + + Long trackingNumberId2 = trackingNumber.getId(); + + if (trackingNumber != null) { + StockLocation location = line.getDetailsStockLocation(); + log.debug("trackingNumber >>>>>> : {}", trackingNumber); + log.debug("product >>>>>> : {}", product); + + StockHistoryLine stockHistoryLine = new StockHistoryLine(); + stockHistoryLine.setLabel( + product.getName() + + "*" + + trackingNumber.getTrackingNumberSeq() + + "*" + + location.getName()); + fetchAndFillResultForStockHistoryQuery( stockHistoryLine, product.getId(), companyId, - stockLocationId, + location.getId(), + beginDate, + endDate, + true, + false, + trackingNumber); + + fetchAndFillResultForStockHistoryQuery( + stockHistoryLine, + product.getId(), + companyId, + location.getId(), beginDate, endDate, false, - true, - trackingNumberId2); - - BigDecimal totalQty = this.getTotalQty(product, company, stockLocationId,true,trackingNumberId2); - BigDecimal realQty = totalQty.add(stockHistoryLine.getSumOutQtyPeriod()).subtract(stockHistoryLine.getSumIncQtyPeriod()); + false, + trackingNumber); - log.debug("*** trackingNumber || totalQty || realQty : {} {} {}",trackingNumber,totalQty,realQty); + BigDecimal totalQty = + this.getTotalQty(product, company, location.getId(), false, trackingNumberId2); + BigDecimal realQty = + totalQty + .add(stockHistoryLine.getSumOutQtyPeriod()) + .subtract(stockHistoryLine.getSumIncQtyPeriod()); - stockHistoryLine.setRealQty(realQty); - stockHistoryLineList.add(stockHistoryLine); + log.debug( + "*** trackingNumber || totalQty || realQty : {} {} {}", + trackingNumber, + totalQty, + realQty); + + stockHistoryLine.setRealQty(realQty); + stockHistoryLineList.add(stockHistoryLine); } - } - } - + return stockHistoryLineList; } @SuppressWarnings({"unchecked", "rawtypes"}) - public BigDecimal getTotalQty(Product product, Company company,Long StockLocationId,boolean allLocations,Long trackingNumberId) { + public BigDecimal getTotalQty( + Product product, + Company company, + Long StockLocationId, + boolean allLocations, + Long trackingNumberId) { Long productId = product.getId(); String query = ""; - - query = - "SELECT new list(self.id, self.avgPrice, self.currentQty) FROM StockLocationLine as self " - + "WHERE self.product.id = " - + productId; - if(trackingNumberId == null){ - query += " AND self.stockLocation.typeSelect != " + StockLocationRepository.TYPE_VIRTUAL; - }else{ - query += " AND self.detailsStockLocation.typeSelect != " + StockLocationRepository.TYPE_VIRTUAL + " AND self.trackingNumber.id = "+trackingNumberId; - } + query = + "SELECT new list(self.id, self.avgPrice, self.currentQty) FROM StockLocationLine as self " + + "WHERE self.product.id = " + + productId; - + if (trackingNumberId == null) { + query += " AND self.stockLocation.typeSelect != " + StockLocationRepository.TYPE_VIRTUAL; + } else { + query += + " AND self.detailsStockLocation.typeSelect != " + + StockLocationRepository.TYPE_VIRTUAL + + " AND self.trackingNumber.id = " + + trackingNumberId; + } - if(!allLocations){ - if(trackingNumberId == null){ - query += " AND self.stockLocation.id in ("+StockLocationId+")" ; - }else{ - query += " AND self.detailsStockLocation.id in ("+StockLocationId+")" ; + if (!allLocations) { + if (trackingNumberId == null) { + query += " AND self.stockLocation.id in (" + StockLocationId + ")"; + } else { + query += " AND self.detailsStockLocation.id in (" + StockLocationId + ")"; } } - if (company != null) { - if(trackingNumberId == null){ + if (trackingNumberId == null) { query += " AND self.stockLocation.company = " + company.getId(); - }else{ + } else { query += " AND self.detailsStockLocation.company = " + company.getId(); } } @@ -623,7 +698,6 @@ public class StockHistoryServiceImpl implements StockHistoryService { return qtyTot; } - public MetaFile exportToCSV(List> historyLines) throws AxelorException, IOException { List allMoveLineData = new ArrayList<>(); @@ -632,15 +706,30 @@ public class StockHistoryServiceImpl implements StockHistoryService { System.out.println(historyLines.size()); System.out.println("***************************************"); - for (HashMap historyLine : historyLines) { + for (HashMap historyLine : historyLines) { String[] items = new String[6]; - int inc = historyLine.get("countIncMvtStockPeriod") != null ? Integer.parseInt(historyLine.get("countIncMvtStockPeriod").toString()) : 0; - int out = historyLine.get("countOutMvtStockPeriod") != null ? Integer.parseInt(historyLine.get("countOutMvtStockPeriod").toString()) : 0; + int inc = + historyLine.get("countIncMvtStockPeriod") != null + ? Integer.parseInt(historyLine.get("countIncMvtStockPeriod").toString()) + : 0; + int out = + historyLine.get("countOutMvtStockPeriod") != null + ? Integer.parseInt(historyLine.get("countOutMvtStockPeriod").toString()) + : 0; String label = historyLine.get("label") != null ? historyLine.get("label").toString() : ""; - BigDecimal sumInc = historyLine.get("sumIncQtyPeriod") != null ? new BigDecimal(historyLine.get("sumIncQtyPeriod").toString()) : BigDecimal.ZERO; - BigDecimal sumOut = historyLine.get("sumOutQtyPeriod") != null ? new BigDecimal(historyLine.get("sumOutQtyPeriod").toString()) : BigDecimal.ZERO; - BigDecimal realQty = historyLine.get("realQty") != null ? new BigDecimal(historyLine.get("realQty").toString()) : BigDecimal.ZERO; - + BigDecimal sumInc = + historyLine.get("sumIncQtyPeriod") != null + ? new BigDecimal(historyLine.get("sumIncQtyPeriod").toString()) + : BigDecimal.ZERO; + BigDecimal sumOut = + historyLine.get("sumOutQtyPeriod") != null + ? new BigDecimal(historyLine.get("sumOutQtyPeriod").toString()) + : BigDecimal.ZERO; + BigDecimal realQty = + historyLine.get("realQty") != null + ? new BigDecimal(historyLine.get("realQty").toString()) + : BigDecimal.ZERO; + items[0] = label; items[1] = String.valueOf(inc); items[2] = String.valueOf(sumInc); @@ -650,7 +739,6 @@ public class StockHistoryServiceImpl implements StockHistoryService { allMoveLineData.add(items); } - String filePath = Files.createTempDir().getAbsolutePath(); if (filePath == null) { @@ -677,22 +765,45 @@ public class StockHistoryServiceImpl implements StockHistoryService { try (InputStream is = new FileInputStream(file)) { return Beans.get(MetaFiles.class).upload(is, fileName); } - } - - public void sumGroupByStocklocation() { - Query q = - JPA.em() - .createQuery( - "select slLine.product,slLine.trackingNumber,sum(lLine.real_qty) FROM StockMove as slLine "+ - " LEFT JOIN Product p on p.id = StokLocationLine.product" - + "WHERE ml in ?1 group by ml.account"); - // q.setParameter(1, ); + public void sumGroupByStocklocation( + Long detailsStockLocationId, Long productId, LocalDate date, Long trackingNumberId) { + Query q = + JPA.em() + .createNativeQuery( + "select coalesce(m2.sum,0) inn,coalesce(m1.sum,0) outt from" + + " (SELECT product,line.tracking_number,from_stock_location,sum(real_qty)" + + " FROM STOCK_STOCK_MOVE_LINE LINE left join stock_stock_move move on move.id = line.stock_move" + + " where (line.archived = false OR line.archived is null) and move.estimated_date >= ?1 " + + " group by product,line.tracking_number,from_stock_location) m1" + + " full outer join" + + " (SELECT product,line.tracking_number,to_stock_location,sum(real_qty)" + + " FROM STOCK_STOCK_MOVE_LINE LINE left join stock_stock_move move on move.id = line.stock_move" + + " where (line.archived = false OR line.archived is null) and move.estimated_date >= ?2 " + + " group by product,line.tracking_number,to_stock_location) m2 " + + " on m1.product = m2.product and ((m1.tracking_number is null and m2.tracking_number is null) or m1.tracking_number = m2.tracking_number) and m1.from_stock_location = m2.to_stock_location" + // " where"+ + // " coalesce(m1.product, m2.product) = ?3 and "+ + // " coalesce(m1.tracking_number,m2.tracking_number) = ?4"+ + // " and coalesce(m1.from_stock_location,m2.to_stock_location) = ?5" + ); - // List> allMap = new ArrayList>(); - // allMap = q.getResultList(); + q.setParameter(1, date); + q.setParameter(2, date); + // q.setParameter(3, productId); + // q.setParameter(4, trackingNumberId); + // q.setParameter(5, detailsStockLocationId); + List resultList = q.getResultList(); + System.out.println("*************resultList***************"); + System.out.println(resultList.toString()); + System.out.println("*************resultList***************"); + + for (Object[] result : resultList) { + System.out.println("*************result***************"); + System.out.println(result.toString()); + System.out.println("*************result***************"); + } } - } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineService.java index 3bc9461..9ec6581 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineService.java @@ -41,7 +41,8 @@ public interface StockLocationLineService { boolean future, boolean isIncrement, LocalDate lastFutureStockMoveDate, - TrackingNumber trackingNumber) + TrackingNumber trackingNumber, + int conformitySelect) throws AxelorException; @Transactional(rollbackOn = {Exception.class}) @@ -246,8 +247,7 @@ public interface StockLocationLineService { * @param stockMoveLine the move line responsible for the WAP change. */ void updateWap(StockLocationLine stockLocationLine, BigDecimal wap, StockMoveLine stockMoveLine); - - + /** * Allow to get the available qty of product for a given Tracking Number. * diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineServiceImpl.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineServiceImpl.java index 7dc8877..e2a00fb 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineServiceImpl.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockLocationLineServiceImpl.java @@ -91,7 +91,8 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { boolean future, boolean isIncrement, LocalDate lastFutureStockMoveDate, - TrackingNumber trackingNumber) + TrackingNumber trackingNumber, + int conformitySelect) throws AxelorException { this.updateLocation( @@ -104,7 +105,7 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { isIncrement, lastFutureStockMoveDate); - if (trackingNumber != null) { + if (trackingNumber != null ) { this.updateDetailLocation( stockLocation, product, @@ -303,6 +304,7 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { lastFutureStockMoveDate); this.checkStockMin(detailLocationLine, true); + // detailLocationLine.setConformitySelect(StockLocationRepository.TYPE_QUARANTINE); stockLocationLineRepo.save(detailLocationLine); } @@ -473,16 +475,18 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { @Override public StockLocationLine getDetailLocationLine( StockLocation stockLocation, Product product, TrackingNumber trackingNumber) { - return stockLocationLineRepo - .all() - .filter( - "self.detailsStockLocation.id = :_stockLocationId " - + "AND self.product.id = :_productId " - + "AND self.trackingNumber.id = :_trackingNumberId") - .bind("_stockLocationId", stockLocation.getId()) - .bind("_productId", product.getId()) - .bind("_trackingNumberId", trackingNumber.getId()) - .fetchOne(); + + return stockLocationLineRepo + .all() + .filter( + "self.detailsStockLocation.id = :_stockLocationId " + + "AND self.product.id = :_productId " + + "AND self.trackingNumber.id = :_trackingNumberId " + ) + .bind("_stockLocationId", stockLocation.getId()) + .bind("_productId", product.getId()) + .bind("_trackingNumberId", trackingNumber.getId()) + .fetchOne(); } @Override @@ -501,6 +505,7 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { stockLocationLine.setUnit(product.getUnit()); stockLocationLine.setCurrentQty(BigDecimal.ZERO); stockLocationLine.setFutureQty(BigDecimal.ZERO); + stockLocationLine.setConformitySelect(4); // Quarantine return stockLocationLine; } @@ -510,7 +515,7 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { StockLocation stockLocation, Product product, TrackingNumber trackingNumber) { LOG.debug( - "Création d'une ligne de détail de stock : Entrepot? {}, Produit? {}, Num de suivi? {} ", + "**** Création d'une ligne de détail de stock : Entrepot? {}, Produit? {}, Num de suivi? {} ", stockLocation.getName(), product.getCode(), trackingNumber.getTrackingNumberSeq()); @@ -741,7 +746,7 @@ public class StockLocationLineServiceImpl implements StockLocationLineService { stockLocationLine.getUnit(), stockMoveLine)); } - + @Override public BigDecimal getTrackingNumberAvailableQty( StockLocation stockLocation, TrackingNumber trackingNumber) { diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineService.java index f658583..28c0438 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineService.java @@ -20,6 +20,7 @@ package com.axelor.apps.stock.service; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.Unit; +import com.axelor.apps.stock.db.InternalTrackingNumber; import com.axelor.apps.stock.db.LogisticalForm; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockLocationLine; @@ -143,7 +144,8 @@ public interface StockMoveLineService { int fromStatus, int toStatus, LocalDate lastFutureStockMoveDate, - TrackingNumber trackingNumber) + TrackingNumber trackingNumber, + InternalTrackingNumber internalTrackingNumber) throws AxelorException; public void updateAveragePriceLocationLine( diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineServiceImpl.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineServiceImpl.java index 63eb55d..aaacfc3 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineServiceImpl.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveLineServiceImpl.java @@ -26,6 +26,7 @@ import com.axelor.apps.base.db.repo.ProductRepository; import com.axelor.apps.base.service.UnitConversionService; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.stock.db.CustomsCodeNomenclature; +import com.axelor.apps.stock.db.InternalTrackingNumber; import com.axelor.apps.stock.db.LogisticalForm; import com.axelor.apps.stock.db.LogisticalFormLine; import com.axelor.apps.stock.db.StockLocation; @@ -55,6 +56,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; @@ -305,7 +307,7 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { * @param product * @param quantity * @param unit - * @param price + * @param unitPriceUntaxed * @param stockMove * @param trackingNumber * @return @@ -368,10 +370,13 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { List stockLocationLineList = this.getStockLocationLines(product, stockLocation); + // Collections.sort(stockLocationLineList, (o1, o2) -> + // o1.getTrackingNumber().getPerishableExpirationDate().compareTo(o2.getTrackingNumber().getPerishableExpirationDate())); + if (stockLocationLineList != null) { for (StockLocationLine stockLocationLine : stockLocationLineList) { - BigDecimal qty = stockLocationLine.getFutureQty(); + BigDecimal qty = stockLocationLine.getCurrentQty(); if (stockMoveLine.getQty().compareTo(qty) > 0) { this.splitStockMoveLine(stockMoveLine, qty, stockLocationLine.getTrackingNumber()); } else { @@ -390,7 +395,7 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { Beans.get(StockLocationLineRepository.class) .all() .filter( - "self.product = ?1 AND self.futureQty > 0 AND self.trackingNumber IS NOT NULL AND self.detailsStockLocation = ?2" + "self.product = ?1 AND self.currentQty > 0 AND self.trackingNumber IS NOT NULL AND self.detailsStockLocation = ?2" + trackingNumberService.getOrderMethod( product.getTrackingNumberConfiguration()), product, @@ -437,6 +442,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { stockMoveLineList = MoreObjects.firstNonNull(stockMoveLineList, Collections.emptyList()); + // this.checkValidStockLocationMvt(); + for (StockMoveLine stockMoveLine : stockMoveLineList) { Product product = stockMoveLine.getProduct(); @@ -461,12 +468,52 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { fromStatus, toStatus, lastFutureStockMoveDate, - stockMoveLine.getTrackingNumber()); + stockMoveLine.getTrackingNumber(), + stockMoveLine.getInternalTrackingNumber()); if (fromStockLocation.getTypeSelect() == StockLocationRepository.TYPE_VIRTUAL) { this.updateAveragePriceLocationLine(toStockLocation, stockMoveLine, fromStatus, toStatus); weightedAveragePriceService.computeAvgPriceForProduct(stockMoveLine.getProduct()); } - } + List listOfIds = Arrays.asList(10L, 11L, 13L, 14L, 15L, 16L,50L); + if(toStatus == StockMoveRepository.STATUS_REALIZED){ + if (stockMoveLine.getTrackingNumber() != null && stockMoveLine.getRealQty().compareTo(BigDecimal.ZERO) != 0) { + if (stockMoveLine.getStockMove() != null) { + if (stockMoveLine.getStockMove().getTypeSelect() == StockMoveRepository.TYPE_INCOMING) { + StockLocationLine toStockLocationLine = Beans.get(StockLocationLineService.class).getDetailLocationLine( + toStockLocation, product, stockMoveLine.getTrackingNumber()); + // TODO WMS + if (toStockLocationLine != null) { + // if(listOfIds.contains(fromStockLocation.getId())){ + if(stockMoveLine.getStockMove().getPartner().getId() != 853L){ + toStockLocationLine.setConformitySelect(StockLocationRepository.TYPE_QUARANTINE); + Beans.get(StockLocationLineRepository.class).save(toStockLocationLine); + }else{ + if(stockMoveLine.getRealQty().compareTo(toStockLocationLine.getCurrentQty()) == 0){ + toStockLocationLine.setConformitySelect(StockLocationRepository.TYPE_QUARANTINE); + Beans.get(StockLocationLineRepository.class).save(toStockLocationLine); + } + } + } + } else if (stockMoveLine.getStockMove().getTypeSelect() == StockMoveRepository.TYPE_INTERNAL) { + StockLocationLine fromStockLocationLine = Beans.get(StockLocationLineService.class).getDetailLocationLine( + fromStockLocation, product, stockMoveLine.getTrackingNumber() ); + StockLocationLine toStockLocationLine = Beans.get(StockLocationLineService.class).getDetailLocationLine( + toStockLocation, product, stockMoveLine.getTrackingNumber()); + log.debug( + "fromStockLocationLine: {}, toStockLocationLine: {}, fromStockLocationLineConformity: {}, toStockLocationLineConformity: {}", + fromStockLocationLine,toStockLocationLine,fromStockLocationLine.getConformitySelect(),toStockLocationLine.getConformitySelect()); + + if (toStockLocationLine != null && toStockLocationLine.getCurrentQty().compareTo(BigDecimal.ZERO) != 0) { + toStockLocationLine.setConformitySelect(fromStockLocationLine.getConformitySelect()); + toStockLocationLine.setAnalysisFolderValidated(fromStockLocationLine.getAnalysisFolderValidated()); + toStockLocationLine.setIsConformTag(fromStockLocationLine.getIsConformTag()); + Beans.get(StockLocationLineRepository.class).save(toStockLocationLine); + } + } + } + } + } + } } } @@ -488,29 +535,47 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { protected void computeNewAveragePriceLocationLine( StockLocationLine stockLocationLine, StockMoveLine stockMoveLine) throws AxelorException { - List stockLocationLines = stockLocationLineService.getStockLocationLines(stockMoveLine.getProduct()); + List stockLocationLines = + stockLocationLineService.getStockLocationLines(stockMoveLine.getProduct()); BigDecimal sumQty = BigDecimal.ZERO; - if(stockMoveLine.getProduct().getIsPerishable()){ - sumQty = stockLocationLines.stream().filter(t -> { - if(t.getDetailsStockLocation() != null) { - if(t.getDetailsStockLocation().getTypeSelect() != StockLocationRepository.TYPE_VIRTUAL){ - return true; - } - } - return false; - }).map(t -> t.getCurrentQty()).reduce(BigDecimal.ZERO,BigDecimal::add); - }else{ - sumQty = stockLocationLines.stream().filter(t -> { - if(t.getStockLocation() != null) { - if(t.getStockLocation().getTypeSelect() != StockLocationRepository.TYPE_VIRTUAL){ - return true; - } - } - return false; - }).map(t -> t.getCurrentQty()).reduce(BigDecimal.ZERO,BigDecimal::add); + if (stockMoveLine.getProduct().getIsPerishable()) { + sumQty = + stockLocationLines + .stream() + .filter( + t -> { + if (t.getDetailsStockLocation() != null) { + if (t.getDetailsStockLocation().getTypeSelect() + != StockLocationRepository.TYPE_VIRTUAL) { + return true; + } + } + return false; + }) + .map(t -> t.getCurrentQty()) + .reduce(BigDecimal.ZERO, BigDecimal::add); + } else { + sumQty = + stockLocationLines + .stream() + .filter( + t -> { + if (t.getStockLocation() != null) { + if (t.getStockLocation().getTypeSelect() + != StockLocationRepository.TYPE_VIRTUAL) { + return true; + } + } + return false; + }) + .map(t -> t.getCurrentQty()) + .reduce(BigDecimal.ZERO, BigDecimal::add); } - - BigDecimal oldAvgPrice = stockMoveLine.getProduct().getAvgPrice() == null ? stockMoveLine.getUnitPriceUntaxed() : stockLocationLine.getAvgPrice(); + + BigDecimal oldAvgPrice = + stockMoveLine.getProduct().getAvgPrice() == null + ? stockMoveLine.getUnitPriceUntaxed() + : stockLocationLine.getAvgPrice(); // avgPrice in stock move line is a bigdecimal but is nullable. BigDecimal newQty = stockMoveLine.getRealQty(); BigDecimal oldQty = sumQty.subtract(newQty); @@ -711,7 +776,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { int fromStatus, int toStatus, LocalDate lastFutureStockMoveDate, - TrackingNumber trackingNumber) + TrackingNumber trackingNumber, + InternalTrackingNumber internalTrackingNumber) throws AxelorException { Unit stockMoveLineUnit = stockMoveLine.getUnit(); @@ -726,7 +792,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, true, null, - trackingNumber); + trackingNumber, + 0); stockLocationLineService.updateLocation( toStockLocation, product, @@ -736,7 +803,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, false, null, - trackingNumber); + trackingNumber, + 0); break; case StockMoveRepository.STATUS_REALIZED: @@ -749,7 +817,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, true, null, - trackingNumber); + trackingNumber, + 0); stockLocationLineService.updateLocation( toStockLocation, product, @@ -759,7 +828,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, false, null, - trackingNumber); + trackingNumber, + 0); break; default: @@ -777,7 +847,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, false, lastFutureStockMoveDate, - trackingNumber); + trackingNumber, + 0); stockLocationLineService.updateLocation( toStockLocation, product, @@ -787,7 +858,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, true, lastFutureStockMoveDate, - trackingNumber); + trackingNumber, + 0); break; case StockMoveRepository.STATUS_REALIZED: @@ -800,7 +872,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, false, null, - trackingNumber); + trackingNumber, + 0); stockLocationLineService.updateLocation( toStockLocation, product, @@ -810,7 +883,8 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { true, true, null, - trackingNumber); + trackingNumber, + 0); break; default: @@ -835,13 +909,13 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING) { if (stockMoveLine.getProduct().getSellable() == true) { unitPriceUntaxed = stockMoveLine.getProduct().getSalePrice(); - }else{ + } else { unitPriceUntaxed = stockMoveLine.getProduct().getAvgPrice(); } } else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING) { - if(stockMoveLine.getProduct().getSellable() == true){ + if (stockMoveLine.getProduct().getSellable() == true) { unitPriceUntaxed = stockMoveLine.getProduct().getSalePrice(); - }else{ + } else { unitPriceUntaxed = stockMoveLine.getUnitPriceUntaxed(); } } else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INTERNAL @@ -1027,7 +1101,6 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { if (stockMove != null && !checkMassesRequired(stockMove, stockMoveLine)) { return product.getNetMass(); } - throw new AxelorException( TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, @@ -1230,22 +1303,22 @@ public class StockMoveLineServiceImpl implements StockMoveLineService { public void fillRealizeWapPrice(StockMoveLine stockMoveLine) { StockLocation stockLocation; - if (stockMoveLine.getStockMove().getFromStockLocation().getTypeSelect() != StockLocationRepository.TYPE_VIRTUAL) { - stockLocation = stockMoveLine.getStockMove().getFromStockLocation(); - }else{ - stockLocation = stockMoveLine.getStockMove().getToStockLocation(); + if (stockMoveLine.getStockMove().getFromStockLocation().getTypeSelect() + != StockLocationRepository.TYPE_VIRTUAL) { + stockLocation = stockMoveLine.getStockMove().getFromStockLocation(); + } else { + stockLocation = stockMoveLine.getStockMove().getToStockLocation(); } Optional stockLocationLineOpt = Optional.ofNullable( - stockLocationLineService.getStockLocationLine(stockLocation, - stockMoveLine.getProduct())); + stockLocationLineService.getStockLocationLine( + stockLocation, stockMoveLine.getProduct())); stockLocationLineOpt.ifPresent( - stockLocationLine -> { - if(stockLocationLine.getCurrentQty().compareTo(BigDecimal.ZERO) > 0){ + stockLocationLine -> { + if (stockLocationLine.getCurrentQty().compareTo(BigDecimal.ZERO) > 0) { stockMoveLine.setWapPrice(stockLocationLine.getAvgPrice()); } }); } - } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveService.java index c52d6d3..b8a075d 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveService.java @@ -238,4 +238,14 @@ public interface StockMoveService { void updateStocks(StockMove stockMove) throws AxelorException; void updateProductNetMass(StockMove stockMove) throws AxelorException; + + public void massCancel(List requestIds, CancelReason raison, String raisonStr) + throws AxelorException; + + public void massDraft(List requestIds) throws AxelorException; + + public void massPlan(List requestIds) throws AxelorException; + + public void massRealize(List requestIds) throws AxelorException; + } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveServiceImpl.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveServiceImpl.java index 238ae18..87c56d5 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveServiceImpl.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveServiceImpl.java @@ -37,24 +37,31 @@ import com.axelor.apps.message.service.TemplateMessageService; import com.axelor.apps.report.engine.ReportSettings; import com.axelor.apps.stock.db.FreightCarrierMode; import com.axelor.apps.stock.db.Incoterm; +import com.axelor.apps.stock.db.InternalTrackingNumber; import com.axelor.apps.stock.db.InventoryLine; import com.axelor.apps.stock.db.ShipmentMode; import com.axelor.apps.stock.db.StockConfig; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; +import com.axelor.apps.stock.db.StockMoveLineLocationLine; +import com.axelor.apps.stock.db.repo.InternalTrackingNumberRepository; import com.axelor.apps.stock.db.repo.InventoryLineRepository; import com.axelor.apps.stock.db.repo.InventoryRepository; +import com.axelor.apps.stock.db.repo.StockConfigRepository; import com.axelor.apps.stock.db.repo.StockLocationRepository; import com.axelor.apps.stock.db.repo.StockMoveLineRepository; import com.axelor.apps.stock.db.repo.StockMoveRepository; import com.axelor.apps.stock.exception.IExceptionMessage; import com.axelor.apps.stock.report.IReport; import com.axelor.common.ObjectUtils; +import com.axelor.db.JPA; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; +import com.axelor.rpc.ActionRequest; +import com.axelor.rpc.ActionResponse; import com.google.common.base.MoreObjects; import com.google.common.base.Strings; import com.google.inject.Inject; @@ -64,6 +71,7 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -71,6 +79,9 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; + +import javax.persistence.Query; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -284,7 +295,8 @@ public class StockMoveServiceImpl implements StockMoveService { if (Beans.get(SequenceService.class) .isEmptyOrDraftSequenceNumber(stockMove.getStockMoveSeq())) { draftSeq = stockMove.getStockMoveSeq(); - if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING && stockMove.getIsReversion() == true){ + if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING + && stockMove.getIsReversion() == true) { stockMove.setStockMoveSeq( stockMoveToolService.getSequenceStockMove( StockMoveRepository.TYPE_INCOMING_CLIENT, stockMove.getCompany())); @@ -292,8 +304,9 @@ public class StockMoveServiceImpl implements StockMoveService { && stockMove.getIsReversion() == false && stockMove.getPartner().getId() != 853) { stockMove.setStockMoveSeq( - stockMoveToolService.getSequenceStockMove(StockMoveRepository.TYPE_OUTGOING_CLIENT, stockMove.getCompany())); - }else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING + stockMoveToolService.getSequenceStockMove( + StockMoveRepository.TYPE_OUTGOING_CLIENT, stockMove.getCompany())); + } else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING && stockMove.getIsReversion() == false && stockMove.getPartner().getId() == 853) { stockMove.setStockMoveSeq( @@ -405,11 +418,102 @@ public class StockMoveServiceImpl implements StockMoveService { String newStockSeq = null; stockMoveLineService.checkTrackingNumber(stockMove); stockMoveLineService.checkConformitySelection(stockMove); - // if (stockMove.getFromStockLocation().getTypeSelect() != StockLocationRepository.TYPE_VIRTUAL) { - // stockMove.getStockMoveLineList().forEach(stockMoveLineService::fillRealizeWapPrice); - // } + System.out.println("Checking oooo..................."); + + // checking ..... + if (stockMove.getFromStockLocation().getTypeSelect() != StockLocationRepository.TYPE_VIRTUAL) + { + List listOfIds = Arrays.asList(10L, 11L, 13L, 14L, 15L, 16L, 13L, 12L, 54L, 55L, 58L,50L); + System.out.println("Checking..................."); + System.out.println(listOfIds.contains(stockMove.getToStockLocation().getId())); + System.out.println("Checking..................."); + + if(listOfIds.contains(stockMove.getToStockLocation().getId())){ + checkIfQuarantine(stockMove); + checkIfNonConformityTag(stockMove); + } + } + checkExpirationDates(stockMove); + if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING) { + partnerProductQualityRatingService.calculate(stockMove); + + stockMove + .getStockMoveLineList() + .forEach( + line -> { + line.getStockMoveLineLocationSet() + .forEach( + st -> { + st.setBusy(true); + StockMoveLineLocationLine stockMoveLineLocationLine = + new StockMoveLineLocationLine(); + stockMoveLineLocationLine.setProduct(line.getProduct()); + stockMoveLineLocationLine.setStockMoveLineLocation(st); + stockMoveLineLocationLine.setTrackingNumber(line.getTrackingNumber()); + st.addStockMoveLineLocationLineSetItem(stockMoveLineLocationLine); + }); + Long partnerId = stockMove.getPartner().getId(); + Long familleId = line.getProduct().getFamilleProduit().getId(); + BigDecimal realQty = line.getRealQty(); + + if (!partnerId.equals(853L) && (familleId == 59L || familleId == 67L || familleId == 68L)) { + System.out.println("****!partnerId.equals(853L) && (familleId == 59L || familleId == 67L || familleId == 68L)"); + InternalTrackingNumberService internalTrackingNumberService = Beans.get(InternalTrackingNumberService.class); + InternalTrackingNumberRepository internalTrackingNumberRepo = Beans.get(InternalTrackingNumberRepository.class); + StockMoveLineRepository stockMoveLineRepo = Beans.get(StockMoveLineRepository.class); + + try { + InternalTrackingNumber internalTrackingNumber = internalTrackingNumberService.getInternalTrackingNumber( + line.getProduct(), line.getTrackingNumber()); + + if (realQty.compareTo(BigDecimal.ZERO) > 0) { + if (internalTrackingNumber == null) { + InternalTrackingNumber internal = internalTrackingNumberService.createInternalTrackingNumber( + line.getProduct(), + line.getStockMove().getCompany(), + stockMove.getEstimatedDate(), + line.getTrackingNumber()); + System.out.println("***********************************internal***************"); + System.out.println(internal); + System.out.println("***********************************internal**********************"); + + line.setInternalTrackingNumber(internal); + internalTrackingNumberRepo.save(internal); + + } else { + LocalDate createdDate = internalTrackingNumber.getReceptionDate(); + LocalDate estimatedDate = stockMove.getEstimatedDate(); + System.out.println("***********************************internal not null***************"); + System.out.println(internalTrackingNumber); + System.out.println(createdDate); + System.out.println(estimatedDate); + System.out.println("***********************************internal noy null**********************"); + + if (createdDate.equals(estimatedDate)) { + line.setInternalTrackingNumber(internalTrackingNumber); + stockMoveLineRepo.save(line); + }else{ + InternalTrackingNumber internal = internalTrackingNumberService.createInternalTrackingNumber( + line.getProduct(), + line.getStockMove().getCompany(), + stockMove.getEstimatedDate(), + line.getTrackingNumber()); + + line.setInternalTrackingNumber(internal); + stockMoveLineRepo.save(line); + } + } + } + } catch (AxelorException e) { + e.printStackTrace(); // Consider logging this instead of printing. + } + } + }); + + } + setRealizedStatus(stockMove); stockMoveLineService.updateLocations( stockMove.getFromStockLocation(), @@ -433,7 +537,6 @@ public class StockMoveServiceImpl implements StockMoveService { stockMoveLineService.storeCustomsCodes(stockMove.getStockMoveLineList()); - stockMove.setRealDate(LocalDateTime.now()); resetMasses(stockMove); @@ -461,6 +564,7 @@ public class StockMoveServiceImpl implements StockMoveService { if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING) { partnerProductQualityRatingService.calculate(stockMove); + } else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING && stockMove.getRealStockMoveAutomaticMail() != null && stockMove.getRealStockMoveAutomaticMail()) { @@ -761,13 +865,15 @@ public class StockMoveServiceImpl implements StockMoveService { if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INTERNAL) newStockMove.setTypeSelect(StockMoveRepository.TYPE_INTERNAL); - if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING){ + if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING) { newStockMove.setStockMoveSeq( - stockMoveToolService.getSequenceStockMove(StockMoveRepository.TYPE_INCOMING_CLIENT, stockMove.getCompany())); - }else if(stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING){ + stockMoveToolService.getSequenceStockMove( + StockMoveRepository.TYPE_INCOMING_CLIENT, stockMove.getCompany())); + } else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING) { newStockMove.setStockMoveSeq( - stockMoveToolService.getSequenceStockMove(StockMoveRepository.TYPE_SUPPLIER_OUTGOING_CLIENT, stockMove.getCompany())); - }else{ + stockMoveToolService.getSequenceStockMove( + StockMoveRepository.TYPE_SUPPLIER_OUTGOING_CLIENT, stockMove.getCompany())); + } else { newStockMove.setStockMoveSeq( stockMoveToolService.getSequenceStockMove( newStockMove.getTypeSelect(), newStockMove.getCompany())); @@ -1467,4 +1573,125 @@ public class StockMoveServiceImpl implements StockMoveService { stockMove.addStockMoveLineListItem(newLine); } } + + @Override + public void massCancel(List moveIds, CancelReason reason, String reasonStr) + throws AxelorException { + if (moveIds == null || moveIds.isEmpty()) { + throw new AxelorException( + TraceBackRepository.CATEGORY_MISSING_FIELD, "Please Select at least one StockMove"); + } + + List stockMoves = + Beans.get(StockMoveRepository.class).all().filter("self.id in (?1)", moveIds).fetch(); + if (moveIds != null || !moveIds.isEmpty()) { + for (StockMove stockMove : stockMoves) { + this.cancel(stockMove); + } + } + } + + + public void checkIfQuarantine(StockMove stockMove) + throws AxelorException { + + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID"+ + " FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.INTERNAL_TRACKING_NUMBER = LOCATION_LINE.INTERNAL_TRACKING_NUMBER and LINE.product = LOCATION_LINE.product"+ + " where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.CONFORMITY_SELECT != 2 AND LOCATION_LINE.CONFORMITY_SELECT != 5 AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getFromStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + + System.out.println("*****************checkIfQuarantine******************"); + System.out.println(sql.getResultList().size() > 0); + System.out.println("******************checkIfQuarantine*****************"); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "Vous avez une ligne en etat qurantaine"); + } + } + + public void checkIfNonConformityTag(StockMove stockMove) + throws AxelorException { + + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID" + + " FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.INTERNAL_TRACKING_NUMBER = LOCATION_LINE.INTERNAL_TRACKING_NUMBER and LINE.product = LOCATION_LINE.product" + + " where LOCATION_LINE.DETAILS_STOCK_LOCATION = :location AND LOCATION_LINE.is_conform_tag is not true AND LINE.STOCK_MOVE = :move"); + + sql.setParameter("location", stockMove.getFromStockLocation().getId()); + sql.setParameter("move", stockMove.getId()); + + System.out.println("*****************checkIfNonConformityTag*****************"); + System.out.println(sql.getResultList().size() > 0); + System.out.println("*****************checkIfNonConformityTag****************"); + + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "Vous avez une ligne non étiquetée"); + } + } + + @Override + public void massPlan(List moveIds) throws AxelorException { + if (moveIds == null || moveIds.isEmpty()) { + throw new AxelorException( + TraceBackRepository.CATEGORY_MISSING_FIELD, "Please Select at least one StockMove"); + } + + List stockMoves = + Beans.get(StockMoveRepository.class).all().filter("self.id in (?1)", moveIds).fetch(); + if (moveIds != null || !moveIds.isEmpty()) { + for (StockMove stockMove : stockMoves) { + this.plan(stockMove); + } + } + } + + @Override + public void massRealize(List moveIds) throws AxelorException { + if (moveIds == null || moveIds.isEmpty()) { + throw new AxelorException( + TraceBackRepository.CATEGORY_MISSING_FIELD, "Please Select at least one StockMove"); + } + + List stockMoves = + Beans.get(StockMoveRepository.class).all().filter("self.id in (?1)", moveIds).fetch(); + if (moveIds != null || !moveIds.isEmpty()) { + for (StockMove stockMove : stockMoves) { + this.realize(stockMove); + } + } + } + + @Override + @Transactional(rollbackOn = {Exception.class}) + public void massDraft(List moveIds) throws AxelorException { + if (moveIds == null || moveIds.isEmpty()) { + throw new AxelorException( + TraceBackRepository.CATEGORY_MISSING_FIELD, "Please Select at least one StockMove"); + } + + List stockMoves = + Beans.get(StockMoveRepository.class).all().filter("self.id in (?1)", moveIds).fetch(); + if (moveIds != null || !moveIds.isEmpty()) { + for (StockMove stockMove : stockMoves) { + stockMove.setStatusSelect(StockMoveRepository.STATUS_DRAFT); + } + } + } + + // public boolean isProductExcluded(StockMove stockMove){ + // StockConfig stockConfig = + // Beans.get(StockConfigRepository.class).all().filter("self.company = ?", stockMove.getCompany()).fetchOne(); + // stockConfig.getExludedProductsFromWrkFlw(); + // } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveToolServiceImpl.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveToolServiceImpl.java index 82b95fc..746c1c0 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveToolServiceImpl.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockMoveToolServiceImpl.java @@ -20,6 +20,7 @@ package com.axelor.apps.stock.service; import com.axelor.apps.base.db.Address; 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.SequenceRepository; import com.axelor.apps.base.service.AddressService; import com.axelor.apps.base.service.administration.SequenceService; @@ -27,6 +28,7 @@ import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; +import com.axelor.apps.stock.db.StockProductionRequest; import com.axelor.apps.stock.db.repo.StockLocationRepository; import com.axelor.apps.stock.db.repo.StockMoveLineRepository; import com.axelor.apps.stock.db.repo.StockMoveRepository; @@ -41,6 +43,7 @@ import com.google.inject.Inject; import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.LocalDate; import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -140,35 +143,34 @@ public class StockMoveToolServiceImpl implements StockMoveToolService { break; case StockMoveRepository.TYPE_OUTGOING_CLIENT: - ref = sequenceService.getSequenceNumber(SequenceRepository.OUTGOING_CLIENT, company); - if (ref == null) { - throw new AxelorException( - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get(IExceptionMessage.STOCK_MOVE_3), - company.getName()); - } - break; - + ref = sequenceService.getSequenceNumber(SequenceRepository.OUTGOING_CLIENT, company); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_3), + company.getName()); + } + break; case StockMoveRepository.TYPE_INTERNAL_OUTGOING_CLIENT: - ref = sequenceService.getSequenceNumber(SequenceRepository.CUST_DELIVERY, company); - if (ref == null) { - throw new AxelorException( - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get(IExceptionMessage.STOCK_MOVE_3), - company.getName()); - } - break; + ref = sequenceService.getSequenceNumber(SequenceRepository.CUST_DELIVERY, company); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_3), + company.getName()); + } + break; case StockMoveRepository.TYPE_SUPPLIER_OUTGOING_CLIENT: - ref = sequenceService.getSequenceNumber(SequenceRepository.SUP_RETURN, company); - if (ref == null) { - throw new AxelorException( - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get(IExceptionMessage.STOCK_MOVE_3), - company.getName()); - } - break; + ref = sequenceService.getSequenceNumber(SequenceRepository.SUP_RETURN, company); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_3), + company.getName()); + } + break; default: throw new AxelorException( @@ -181,24 +183,67 @@ public class StockMoveToolServiceImpl implements StockMoveToolService { } // sequence for production request - public String getSequenceStockProductionRequest(int stockProductionRequestType, Company company) throws AxelorException { - + public String getSequenceStockProductionRequest(StockProductionRequest stockProductionRequest) + throws AxelorException { String ref = ""; + Integer stockProductionRequestType = stockProductionRequest.getTypeSelect(); + Company company = stockProductionRequest.getCompany(); if (stockProductionRequestType == 1) { - - ref = sequenceService.getSequenceNumber("stockProductionReques", company); - if (ref == null) { - throw new AxelorException( - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - I18n.get(IExceptionMessage.STOCK_MOVE_1), - company.getName()); - }else{ - return ref; - - } + ref = sequenceService.getSequenceNumber("stockProductionReques", company); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_1), + company.getName()); + } else { + return ref; } + } else if (stockProductionRequestType == 2) { + + ref = sequenceService.getSequenceNumber("stockProductionRequestReturn", company); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_1), + company.getName()); + } else { + return ref; + } + } + + return ref; + } + + // sequence for production request + public String getInternalSequence(int internalSequenceType, Company company ,LocalDate date) + throws AxelorException { + String ref = ""; + + if (internalSequenceType == 35) { + Sequence seq = sequenceService.getSequence("acInternalSequence", company); + ref = sequenceService.getSequenceNumber(seq, date); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_1), + company.getName()); + } else { + return ref; + } + } else if (internalSequenceType == 36) { + Sequence seq = sequenceService.getSequence("mpInternalSequence", company); + ref = sequenceService.getSequenceNumber(seq, date); + if (ref == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_MOVE_1), + company.getName()); + } else { + return ref; + } + } return ref; } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockProductionRequestLineService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockProductionRequestLineService.java index 5fcb1bb..e3cfe99 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockProductionRequestLineService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockProductionRequestLineService.java @@ -1,38 +1,38 @@ package com.axelor.apps.stock.service; -import java.math.BigDecimal; - import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Product; import com.axelor.apps.stock.db.StockProductionRequest; import com.axelor.apps.stock.db.StockProductionRequestLine; import com.google.common.base.Preconditions; +import java.math.BigDecimal; public class StockProductionRequestLineService { - public void setProductInfo(StockProductionRequest productionRequest,StockProductionRequestLine productionRequestLine, Company company) { - Preconditions.checkNotNull(productionRequestLine); - Preconditions.checkNotNull(company); - Product product = productionRequestLine.getProduct(); - if (product == null) { - return; - } - productionRequestLine.setUnit(product.getUnit()); - productionRequestLine.setProductName(product.getName()); + public void setProductInfo( + StockProductionRequest productionRequest, + StockProductionRequestLine productionRequestLine, + Company company) { + Preconditions.checkNotNull(productionRequestLine); + Preconditions.checkNotNull(company); + Product product = productionRequestLine.getProduct(); + if (product == null) { + return; } + productionRequestLine.setUnit(product.getUnit()); + productionRequestLine.setProductName(product.getName()); + } - public StockProductionRequestLine compute(StockProductionRequestLine productionRequestLine, - StockProductionRequest productionRequest) { - - BigDecimal unitPriceUntaxed = BigDecimal.ZERO; - if (productionRequestLine.getProduct() != null && productionRequest != null) { - unitPriceUntaxed = productionRequestLine.getProduct().getAvgPrice(); - } - productionRequestLine.setUnitPriceUntaxed(unitPriceUntaxed); - productionRequestLine.setUnitPriceTaxed(unitPriceUntaxed); - productionRequestLine.setCompanyUnitPriceUntaxed(unitPriceUntaxed); - return productionRequestLine; - + public StockProductionRequestLine compute( + StockProductionRequestLine productionRequestLine, StockProductionRequest productionRequest) { + + BigDecimal unitPriceUntaxed = BigDecimal.ZERO; + if (productionRequestLine.getProduct() != null && productionRequest != null) { + unitPriceUntaxed = productionRequestLine.getProduct().getAvgPrice(); } - + productionRequestLine.setUnitPriceUntaxed(unitPriceUntaxed); + productionRequestLine.setUnitPriceTaxed(unitPriceUntaxed); + productionRequestLine.setCompanyUnitPriceUntaxed(unitPriceUntaxed); + return productionRequestLine; + } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockRulesServiceImpl.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockRulesServiceImpl.java index 9cc4ce9..8ff4941 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockRulesServiceImpl.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/StockRulesServiceImpl.java @@ -160,14 +160,11 @@ public class StockRulesServiceImpl implements StockRulesService { Product product, StockLocation stockLocation, int type, int useCase) { if (useCase == StockRulesRepository.USE_CASE_USED_FOR_MRP) { - if(stockLocation == null){ + if (stockLocation == null) { return stockRuleRepo - .all() - .filter( - "self.product = ?1 AND self.useCaseSelect = ?2", - product, - useCase) - .fetchOne(); + .all() + .filter("self.product = ?1 AND self.useCaseSelect = ?2", product, useCase) + .fetchOne(); } return stockRuleRepo .all() diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/Test.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/Test.java index 5f71c07..de2e923 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/Test.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/Test.java @@ -1,9 +1,10 @@ package com.axelor.apps.stock.service; + import org.joda.time.LocalDate; public class Test { - public static void main(String[] args) { - LocalDate beginDate = LocalDate.now().withDayOfMonth(1); - System.out.println(beginDate); - } + public static void main(String[] args) { + LocalDate beginDate = LocalDate.now().withDayOfMonth(1); + System.out.println(beginDate); + } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/TrackingNumberService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/TrackingNumberService.java index d99a445..f16417c 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/TrackingNumberService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/TrackingNumberService.java @@ -71,10 +71,10 @@ public class TrackingNumberService { } switch (autoTrackingNbrOrderSelect) { case TrackingNumberConfigurationRepository.TRACKING_NUMBER_ORDER_FIFO: - return " ORDER BY self.trackingNumber ASC"; + return " ORDER BY self.trackingNumber.perishableExpirationDate ASC"; case TrackingNumberConfigurationRepository.TRACKING_NUMBER_ORDER_LIFO: - return " ORDER BY self.trackingNumber DESC"; + return " ORDER BY self.trackingNumber.perishableExpirationDate DESC"; default: return ""; diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/stockmove/print/StockProductionRequestPrintService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/stockmove/print/StockProductionRequestPrintService.java index 799d476..cf994d3 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/stockmove/print/StockProductionRequestPrintService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/service/stockmove/print/StockProductionRequestPrintService.java @@ -1,11 +1,5 @@ package com.axelor.apps.stock.service.stockmove.print; -import java.io.File; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; - import com.axelor.apps.ReportFactory; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.report.engine.ReportSettings; @@ -19,18 +13,22 @@ import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; +import java.io.File; +import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; public class StockProductionRequestPrintService { - - public String printStockProductionRequest(StockProductionRequest purchaseRequest, String formatPdf) - throws AxelorException { - String fileName = getPurchaseRequestFilesName(false, formatPdf); + public String printStockProductionRequest( + StockProductionRequest purchaseRequest, String formatPdf) throws AxelorException { + + String fileName = getPurchaseRequestFilesName(false, formatPdf); return PdfTool.getFileLinkFromPdfFile(print(purchaseRequest, formatPdf), fileName); } - public String printStockProductionRequests(List ids) throws IOException { List printedPurchaseRequests = new ArrayList<>(); ModelTool.apply( @@ -38,7 +36,6 @@ public class StockProductionRequestPrintService { ids, new ThrowConsumer() { - public void accept(StockProductionRequest purchaseRequest) throws Exception { printedPurchaseRequests.add(print(purchaseRequest, ReportSettings.FORMAT_PDF)); } @@ -47,13 +44,14 @@ public class StockProductionRequestPrintService { return PdfTool.mergePdfToFileLink(printedPurchaseRequests, fileName); } - public File print(StockProductionRequest stockProductionRequest, String formatPdf) throws AxelorException { + public File print(StockProductionRequest stockProductionRequest, String formatPdf) + throws AxelorException { ReportSettings reportSettings = prepareReportSettings(stockProductionRequest, formatPdf); return reportSettings.generate().getFile(); } - public ReportSettings prepareReportSettings(StockProductionRequest stockProductionRequest, String formatPdf) - throws AxelorException { + public ReportSettings prepareReportSettings( + StockProductionRequest stockProductionRequest, String formatPdf) throws AxelorException { if (stockProductionRequest.getPrintingSettings() == null) { throw new AxelorException( TraceBackRepository.CATEGORY_MISSING_FIELD, @@ -67,7 +65,6 @@ public class StockProductionRequestPrintService { ReportSettings reportSetting = ReportFactory.createReport(IReport.STOCK_PRODUCTION_REQUEST, title + " - ${date}"); - return reportSetting .addParam("StockProductionRequestId", stockProductionRequest.getId()) .addParam("Locale", locale) @@ -83,11 +80,10 @@ public class StockProductionRequestPrintService { + "." + formatPdf; } - + public String getFileName(StockProductionRequest StockProductionRequest) { return I18n.get("Stock production request") + " " + StockProductionRequest.getStockProductionRequestSeq(); } } - diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/InventoryLineController.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/InventoryLineController.java index 9d53f29..885a2a3 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/InventoryLineController.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/InventoryLineController.java @@ -17,41 +17,32 @@ */ package com.axelor.apps.stock.web; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.repo.ProductRepository; import com.axelor.apps.stock.db.Inventory; import com.axelor.apps.stock.db.InventoryLine; -import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockLocationLine; import com.axelor.apps.stock.db.TrackingNumber; import com.axelor.apps.stock.db.repo.InventoryLineRepository; import com.axelor.apps.stock.db.repo.InventoryRepository; import com.axelor.apps.stock.db.repo.TrackingNumberRepository; import com.axelor.apps.stock.service.InventoryLineService; -import com.axelor.auth.AuthUtils; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; 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; import com.google.inject.Inject; import com.google.inject.Singleton; +import java.math.BigDecimal; +import java.util.Map; @Singleton public class InventoryLineController { - @Inject - private ProductRepository productRepository; + @Inject private ProductRepository productRepository; private TrackingNumberRepository trackingNumberRepository; private InventoryLineRepository inventoryLineRepository; private InventoryRepository inventoryRepository; @@ -82,69 +73,78 @@ public class InventoryLineController { response.setValues(inventoryLine); } - public void setProdut(ActionRequest request, ActionResponse response) { + public void setProdut(ActionRequest request, ActionResponse response) { Context context = request.getContext(); if (mProduct != null) { System.out.println("************* set product"); - Long id = ((Inventory) context.get("inventory")).getId(); + Long id = ((Inventory) context.get("inventory")).getId(); Inventory inventory = Beans.get(InventoryRepository.class).find(id); - System.out.println("*******"+mProduct.getId().toString()); - - StockLocationLine sll= inventory - .getStockLocation().getStockLocationLineList() - .stream() - .filter(t -> { - System.out.println(mProduct.getId().toString() +" || "+t.getProduct().getId().toString()+" ******* "+(mProduct.getId().longValue() == t.getProduct().getId().longValue())); - return (t.getProduct().getId().longValue() == mProduct.getId().longValue()); - }) - .findFirst() - .orElse(null); - - - BigDecimal currentQty = BigDecimal.ZERO; - if(sll != null){ - System.out.println("ssl"+sll.toString()); - currentQty = sll.getCurrentQty(); - } + System.out.println("*******" + mProduct.getId().toString()); + + StockLocationLine sll = + inventory + .getStockLocation() + .getStockLocationLineList() + .stream() + .filter( + t -> { + System.out.println( + mProduct.getId().toString() + + " || " + + t.getProduct().getId().toString() + + " ******* " + + (mProduct.getId().longValue() == t.getProduct().getId().longValue())); + return (t.getProduct().getId().longValue() == mProduct.getId().longValue()); + }) + .findFirst() + .orElse(null); + + BigDecimal currentQty = BigDecimal.ZERO; + if (sll != null) { + System.out.println("ssl" + sll.toString()); + currentQty = sll.getCurrentQty(); + } response.setValue("product", mProduct); response.setValue("unit", mProduct.getUnit()); response.setValue("currentQty", currentQty); } } - - - public void setFromParameter(ActionRequest request,ActionResponse response) { + public void setFromParameter(ActionRequest request, ActionResponse response) { InventoryLine inventoryLine = request.getContext().asType(InventoryLine.class); - Map requestData = request.getData(); + Map requestData = request.getData(); final Map jsonContextValues = (Map) requestData.get("context"); Long id = Long.valueOf(jsonContextValues.get("vv").toString()); - System.out.println("setFromParameter ****************"+id.toString()); + System.out.println("setFromParameter ****************" + id.toString()); Product product = Beans.get(ProductRepository.class).find(id); - System.out.println("setFromParameter ****************"+product.toString()); + System.out.println("setFromParameter ****************" + product.toString()); response.setValue("product", product); - } public void setInventaire(ActionRequest request, ActionResponse response) { Context context = request.getContext(); - Long stockLocationId = new Long((Integer) ((Map) request.getContext().get("stockLocation")).get("id")); - Inventory inventory = Beans.get(InventoryRepository.class).all().filter("self.stockLocation.id = ?1",stockLocationId).order("-createdOn").fetchOne(); - - String code = context.get("productHolder").toString(); - + Long stockLocationId = + new Long((Integer) ((Map) request.getContext().get("stockLocation")).get("id")); + Inventory inventory = + Beans.get(InventoryRepository.class) + .all() + .filter("self.stockLocation.id = ?1", stockLocationId) + .order("-createdOn") + .fetchOne(); + + String code = context.get("productHolder").toString(); + Product product = productRepository.findByCode(code); - - if(product != null){ + if (product != null) { response.setValue("product", product); response.setValue("unit", product.getUnit()); response.setValue("inventory", inventory); @@ -163,54 +163,62 @@ public class InventoryLineController { // .context("_inventory", inventory) // .context("_showRecord", inventoryLine.getId()) // .map()); - }else{ - String strWithoutSlash = String.join("%",code.split("/")); - String strWithoutDash = String.join("%",strWithoutSlash.split("_")); - product = productRepository.all().filter("self.code like '"+strWithoutDash+"'").fetchOne(); + } else { + String strWithoutSlash = String.join("%", code.split("/")); + String strWithoutDash = String.join("%", strWithoutSlash.split("_")); + product = + productRepository.all().filter("self.code like '" + strWithoutDash + "'").fetchOne(); response.setValue("product", product); response.setValue("unit", product.getUnit()); response.setValue("inventory", inventory); // response.setFlash("Veuillez contacter votre administrateur"); } - } - public void setInventoryLine(ActionRequest request, ActionResponse response) throws AxelorException { - Context context = request.getContext(); - - Inventory inventory = ((Inventory) context.get("inventory")); - // Long stockLocationId = new Long((Integer) ((Map) request.getContext().get("inventory")).get("id")); - // Long trackingNumberId = new Long((Integer) ((Map) request.getContext().get("trackingNumber")).get("id")); - TrackingNumber trackingNumber = ((TrackingNumber) context.get("trackingNumber")); - Product product = ((Product) context.get("product")); + public void setInventoryLine(ActionRequest request, ActionResponse response) + throws AxelorException { + Context context = request.getContext(); - // Inventory inventory = Beans.get(InventoryRepository.class).find(stockLocationId); - // TrackingNumber trackingNumber = Beans.get(TrackingNumberRepository.class).find(trackingNumberId); - + Inventory inventory = ((Inventory) context.get("inventory")); + // Long stockLocationId = new Long((Integer) ((Map) + // request.getContext().get("inventory")).get("id")); + // Long trackingNumberId = new Long((Integer) ((Map) + // request.getContext().get("trackingNumber")).get("id")); + TrackingNumber trackingNumber = ((TrackingNumber) context.get("trackingNumber")); + Product product = ((Product) context.get("product")); - System.out.println(inventory.toString()); - System.out.println(trackingNumber); - System.out.println(product.toString()); + // Inventory inventory = Beans.get(InventoryRepository.class).find(stockLocationId); + // TrackingNumber trackingNumber = + // Beans.get(TrackingNumberRepository.class).find(trackingNumberId); - // Product product = productRepository.find(productId); - // Inventory inventory = inventoryRepository.find(inventoryId); - // TrackingNumber trackingNumber = trackingNumberRepository.find(trackingNumberId); - - if(inventory == null || product == null ){ - throw new AxelorException( - TraceBackRepository.CATEGORY_NO_VALUE, - I18n.get("Cannot find the data")); - } - + System.out.println(inventory.toString()); + System.out.println(trackingNumber); + System.out.println(product.toString()); - Integer countingType = Integer.parseInt(context.get("countingTypeSelect").toString()); - BigDecimal firstCounting = (BigDecimal) context.get("firstCounting"); - BigDecimal secondCounting = (BigDecimal) context.get("secondCounting"); - BigDecimal controlCounting = (BigDecimal) context.get("controlCounting"); + // Product product = productRepository.find(productId); + // Inventory inventory = inventoryRepository.find(inventoryId); + // TrackingNumber trackingNumber = trackingNumberRepository.find(trackingNumberId); - Beans.get(InventoryLineService.class).setInventoryLine(inventory, product, trackingNumber, countingType, firstCounting, secondCounting, controlCounting); - response.setFlash("Updated Successfully"); - // response.setReload(true); + if (inventory == null || product == null) { + throw new AxelorException( + TraceBackRepository.CATEGORY_NO_VALUE, I18n.get("Cannot find the data")); + } + + Integer countingType = Integer.parseInt(context.get("countingTypeSelect").toString()); + BigDecimal firstCounting = (BigDecimal) context.get("firstCounting"); + BigDecimal secondCounting = (BigDecimal) context.get("secondCounting"); + BigDecimal controlCounting = (BigDecimal) context.get("controlCounting"); + + Beans.get(InventoryLineService.class) + .setInventoryLine( + inventory, + product, + trackingNumber, + countingType, + firstCounting, + secondCounting, + controlCounting); + response.setFlash("Updated Successfully"); + // response.setReload(true); } - } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockHistoryController.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockHistoryController.java index 82251db..e37e88f 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockHistoryController.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockHistoryController.java @@ -17,7 +17,6 @@ */ package com.axelor.apps.stock.web; -import com.axelor.apps.base.db.FamilleProduit; import com.axelor.apps.stock.db.StockHistoryLine; import com.axelor.apps.stock.service.StockHistoryService; import com.axelor.apps.stock.service.StockHistoryServiceImpl; @@ -29,7 +28,6 @@ import com.axelor.meta.schema.actions.ActionView; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.axelor.rpc.Context; - import java.io.IOException; import java.time.LocalDate; import java.util.ArrayList; @@ -91,8 +89,7 @@ public class StockHistoryController { } } - - /** + /** * Called from stock history form view, on new and on date change. Call {@link * StockHistoryService#computeStockHistoryLineList(Long, Long, Long, LocalDate, LocalDate)} * @@ -123,19 +120,20 @@ public class StockHistoryController { beginDate = LocalDate.parse(beginDateContext.toString()); } - Integer searchTypeSelect = Integer.parseInt( (String) context.get("productSearchTypeSelect")); + Integer searchTypeSelect = Integer.parseInt((String) context.get("productSearchTypeSelect")); - Long categoryId = null; - if(context.get("familleProduit") != null){ - categoryId = Long.parseLong(((LinkedHashMap) context.get("familleProduit")).get("id").toString()); + Long categoryId = null; + if (context.get("familleProduit") != null) { + categoryId = + Long.parseLong(((LinkedHashMap) context.get("familleProduit")).get("id").toString()); } - Long trackingNumberId = null; - if(context.get("trackingNumber") != null){ - trackingNumberId = Long.parseLong(((LinkedHashMap) context.get("trackingNumber")).get("id").toString()); + Long trackingNumberId = null; + if (context.get("trackingNumber") != null) { + trackingNumberId = + Long.parseLong(((LinkedHashMap) context.get("trackingNumber")).get("id").toString()); } - System.out.println("**************searchTypeSelect**********************"); System.out.println(searchTypeSelect); System.out.println(categoryId); @@ -151,13 +149,19 @@ public class StockHistoryController { // && stockLocationId != null // && beginDate != null // ) { - stockHistoryLineList = - Beans.get(StockHistoryService.class) - .compuHistoryLinesPerDate( - productId, companyId, stockLocationId, beginDate, endDate,categoryId, trackingNumberId,searchTypeSelect); + stockHistoryLineList = + Beans.get(StockHistoryService.class) + .compuHistoryLinesPerDate( + productId, + companyId, + stockLocationId, + beginDate, + endDate, + categoryId, + trackingNumberId, + searchTypeSelect); // } - response.setValue("$stockHistoryLineList", stockHistoryLineList); } catch (Exception e) { @@ -166,11 +170,12 @@ public class StockHistoryController { } @SuppressWarnings("unchecked") - public static void exportStockHistoryLines(ActionRequest request, ActionResponse response) throws AxelorException, IOException { + public static void exportStockHistoryLines(ActionRequest request, ActionResponse response) + throws AxelorException, IOException { Context context = request.getContext(); - List> stockHistoryLineList = new ArrayList<>(); + List> stockHistoryLineList = new ArrayList<>(); if (context.get("stockHistoryLineList") != null) { stockHistoryLineList = (List>) context.get("stockHistoryLineList"); @@ -179,14 +184,13 @@ public class StockHistoryController { MetaFile metaFile = Beans.get(StockHistoryServiceImpl.class).exportToCSV(stockHistoryLineList); response.setView( - ActionView.define("name") - .add( - "html", - "ws/rest/com.axelor.meta.db.MetaFile/" - + metaFile.getId() - + "/content/download?v=" - + metaFile.getVersion()) - .map()); + ActionView.define("name") + .add( + "html", + "ws/rest/com.axelor.meta.db.MetaFile/" + + metaFile.getId() + + "/content/download?v=" + + metaFile.getVersion()) + .map()); } - } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveController.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveController.java index 86efcd1..89d9906 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveController.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveController.java @@ -17,13 +17,17 @@ */ package com.axelor.apps.stock.web; +import com.axelor.apps.base.db.CancelReason; import com.axelor.apps.base.db.PrintingSettings; import com.axelor.apps.base.db.Product; +import com.axelor.apps.base.service.BarcodeGeneratorService; import com.axelor.apps.base.service.TradingNameService; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.report.engine.ReportSettings; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; +import com.axelor.apps.stock.db.StockMoveLineLocation; +import com.axelor.apps.stock.db.repo.StockMoveLineLocationRepository; import com.axelor.apps.stock.db.repo.StockMoveLineRepository; import com.axelor.apps.stock.db.repo.StockMoveRepository; import com.axelor.apps.stock.exception.IExceptionMessage; @@ -41,11 +45,15 @@ import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.exception.service.TraceBackService; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; +import com.axelor.meta.MetaFiles; +import com.axelor.meta.db.MetaFile; import com.axelor.meta.schema.actions.ActionView; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.axelor.rpc.Context; import com.google.inject.Singleton; +import java.io.IOException; +import java.io.InputStream; import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.time.LocalDate; @@ -58,6 +66,7 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import javax.persistence.Query; +import javax.validation.ValidationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -147,6 +156,93 @@ public class StockMoveController { } } + public void massDraft(ActionRequest request, ActionResponse response) { + + @SuppressWarnings("unchecked") + List requestIds = (List) request.getContext().get("_ids"); + + if (requestIds == null || requestIds.isEmpty()) { + return; + } + try { + if (!requestIds.isEmpty()) { + Beans.get(StockMoveService.class).massDraft(requestIds); + response.setReload(true); + } + + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void massCancel(ActionRequest request, ActionResponse response) { + + @SuppressWarnings("unchecked") + List requestIds = (List) request.getContext().get("_ids"); + CancelReason raison = (CancelReason) request.getContext().get("cancelRaison"); + String raisonStr = (String) request.getContext().get("cancelRaisonStr"); + StockMove stockMove = request.getContext().asType(StockMove.class); + + + System.out.println("*********************************************"); + System.out.println(raisonStr); + System.out.println(raison); + System.out.println(stockMove.getCancelReason()); + System.out.println(stockMove.getCancelReasonStr()); + System.out.println("*********************************************"); + + if (requestIds == null || requestIds.isEmpty()) { + return; + } + try { + if (!requestIds.isEmpty()) { + Beans.get(StockMoveService.class).massCancel(requestIds, raison, raisonStr); + response.setReload(true); + } + + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void massPlan(ActionRequest request, ActionResponse response) { + + @SuppressWarnings("unchecked") + List requestIds = (List) request.getContext().get("_ids"); + + if (requestIds == null || requestIds.isEmpty()) { + return; + } + try { + if (!requestIds.isEmpty()) { + Beans.get(StockMoveService.class).massPlan(requestIds); + response.setReload(true); + } + + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void massRealize(ActionRequest request, ActionResponse response) { + + @SuppressWarnings("unchecked") + List requestIds = (List) request.getContext().get("_ids"); + + if (requestIds == null || requestIds.isEmpty()) { + return; + } + try { + if (!requestIds.isEmpty()) { + Beans.get(StockMoveService.class).massRealize(requestIds); + response.setReload(true); + } + + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + /** * Method called from stock move form and grid view. Print one or more stock move as PDF * @@ -718,4 +814,90 @@ public class StockMoveController { "vous avez deja une facture sur cette Piece"); } } + + public void checkIfQuarantine(ActionRequest request, ActionResponse response) + throws AxelorException { + + StockMove stockMoveFromRequest = request.getContext().asType(StockMove.class); + + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveFromRequest.getId()); + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID"+ +" FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.product = LOCATION_LINE.product"+ +" where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.CONFORMITY_SELECT != 2 AND LOCATION_LINE.CONFORMITY_SELECT != 5 AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getFromStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + logger.debug("sql.getResultList().size()",sql.getResultList().size()); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "vous avez une ligne en etat qurantaine"); + } + } + + public void checkIfNonConformityTag(ActionRequest request, ActionResponse response) + throws AxelorException { + + StockMove stockMoveFromContext = request.getContext().asType(StockMove.class); + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveFromContext.getId()); + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID " + + " FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.product = LOCATION_LINE.product" + +" where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.is_conform_tag is not true AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getToStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + logger.debug("sql.getResultList().size()",sql.getResultList().size()); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "vous avez une ligne non étiqueté"); + } + } + + public void createStockMoveLineLocationBarCodeSeq( + ActionRequest request, ActionResponse response) { + try { + boolean addPadding = false; + InputStream inStream = null; + + StockMoveLineLocation stockMoveLineLocationContext = + request.getContext().asType(StockMoveLineLocation.class); + + StockMoveLineLocation stockMoveLineLocation = + Beans.get(StockMoveLineLocationRepository.class) + .find(stockMoveLineLocationContext.getId()); + + inStream = + Beans.get(BarcodeGeneratorService.class) + .createBarCode( + stockMoveLineLocation.getCode(), + Beans.get(AppBaseService.class) + .getAppBase() + .getBarcodeTypeConfigPurchaseOrderSeq(), + addPadding); + + if (inStream != null) { + MetaFile barcodeFile = + Beans.get(MetaFiles.class) + .upload( + inStream, + String.format("StockMoveLineLocation%d.png", stockMoveLineLocation.getId())); + stockMoveLineLocation.setBarCodeSeq(barcodeFile); + } + } catch (IOException e) { + e.printStackTrace(); + } catch (AxelorException e) { + throw new ValidationException(e.getMessage()); + } + } + + public void showPopup(ActionRequest request, ActionResponse response) { + response.setAlert("Hello words!!"); + } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveLineController.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveLineController.java index 9300af9..07cec33 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveLineController.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockMoveLineController.java @@ -67,7 +67,8 @@ public class StockMoveLineController { return; } } - if(!(stockMove.getPartner() != stockMove.getCompany().getPartner() || stockMove.getTypeSelect()== StockMoveRepository.TYPE_INCOMING)) { + if (!(stockMove.getPartner() != stockMove.getCompany().getPartner() + || stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING)) { stockMoveLine = Beans.get(StockMoveLineService.class).compute(stockMoveLine, stockMove); response.setValue("unitPriceUntaxed", stockMoveLine.getUnitPriceUntaxed()); response.setValue("unitPriceTaxed", stockMoveLine.getUnitPriceTaxed()); diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestController.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestController.java index f49958d..dc49ace 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestController.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestController.java @@ -1,20 +1,11 @@ package com.axelor.apps.stock.web; -import java.lang.invoke.MethodHandles; -import java.util.List; - -import javax.annotation.Nullable; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.axelor.apps.report.engine.ReportSettings; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockProductionRequest; import com.axelor.apps.stock.db.repo.StockMoveRepository; import com.axelor.apps.stock.db.repo.StockProductionRequestRepository; import com.axelor.apps.stock.exception.IExceptionMessage; -import com.axelor.apps.stock.service.StockMoveService; import com.axelor.apps.stock.service.stockmove.print.StockProductionRequestPrintService; import com.axelor.common.ObjectUtils; import com.axelor.exception.AxelorException; @@ -29,65 +20,77 @@ import com.axelor.rpc.Context; import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.collect.Lists; +import java.lang.invoke.MethodHandles; +import java.util.List; +import javax.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StockProductionRequestController { - - private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - public void draft(ActionRequest request, ActionResponse response) { - StockProductionRequest productionRequest = request.getContext().asType(StockProductionRequest.class); - try { - Beans.get(StockProductionRequestService.class) - .draft(Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); - response.setReload(true); - } catch (Exception e) { - TraceBackService.trace(response, e); - } - } - public void plan(ActionRequest request, ActionResponse response) { - StockProductionRequest productionRequest = request.getContext().asType(StockProductionRequest.class); - try { - Beans.get(StockProductionRequestService.class) - .plan(Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); - response.setReload(true); - } catch (Exception e) { - TraceBackService.trace(response, e); - } - } - - public void realize(ActionRequest request, ActionResponse response) { - StockProductionRequest productionRequest = request.getContext().asType(StockProductionRequest.class); - try { - Beans.get(StockProductionRequestService.class) - .realize(Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); - response.setReload(true); - } catch (Exception e) { - TraceBackService.trace(response, e); - } - } + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - public void cancel(ActionRequest request, ActionResponse response) { - StockProductionRequest productionRequest = request.getContext().asType(StockProductionRequest.class); - try { - Beans.get(StockProductionRequestService.class) - .cancel(Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); - response.setReload(true); - } catch (Exception e) { - TraceBackService.trace(response, e); - } + public void draft(ActionRequest request, ActionResponse response) { + StockProductionRequest productionRequest = + request.getContext().asType(StockProductionRequest.class); + try { + Beans.get(StockProductionRequestService.class) + .draft(Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); } + } - public void print(ActionRequest request, ActionResponse response) { + public void plan(ActionRequest request, ActionResponse response) { + StockProductionRequest productionRequest = + request.getContext().asType(StockProductionRequest.class); + try { + Beans.get(StockProductionRequestService.class) + .plan(Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void realize(ActionRequest request, ActionResponse response) { + StockProductionRequest productionRequest = + request.getContext().asType(StockProductionRequest.class); + try { + Beans.get(StockProductionRequestService.class) + .realize( + Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void cancel(ActionRequest request, ActionResponse response) { + StockProductionRequest productionRequest = + request.getContext().asType(StockProductionRequest.class); + try { + Beans.get(StockProductionRequestService.class) + .cancel( + Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); + response.setReload(true); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void print(ActionRequest request, ActionResponse response) { Context context = request.getContext(); String fileLink; String title; - StockProductionRequestPrintService productionRequestPrintService = Beans.get(StockProductionRequestPrintService.class); + StockProductionRequestPrintService productionRequestPrintService = + Beans.get(StockProductionRequestPrintService.class); try { if (!ObjectUtils.isEmpty(request.getContext().get("_ids"))) { - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) List ids = Lists.transform( (List) request.getContext().get("_ids"), @@ -101,10 +104,11 @@ public class StockProductionRequestController { fileLink = productionRequestPrintService.printStockProductionRequests(ids); title = I18n.get("Purchase requests"); } else if (context.get("id") != null) { - StockProductionRequest productionRequest = request.getContext().asType(StockProductionRequest.class); + StockProductionRequest productionRequest = + request.getContext().asType(StockProductionRequest.class); title = productionRequestPrintService.getFileName(productionRequest); fileLink = - productionRequestPrintService.printStockProductionRequest( + productionRequestPrintService.printStockProductionRequest( productionRequest, ReportSettings.FORMAT_PDF); logger.debug("Printing " + title); } else { @@ -118,18 +122,19 @@ public class StockProductionRequestController { } } - public void createStockMove(ActionRequest request, ActionResponse response) { - StockProductionRequest productionRequest = request.getContext().asType(StockProductionRequest.class); + StockProductionRequest productionRequest = + request.getContext().asType(StockProductionRequest.class); try { if (productionRequest.getId() != null) { - StockProductionRequestService productionRequestService = Beans.get(StockProductionRequestService.class); + StockProductionRequestService productionRequestService = + Beans.get(StockProductionRequestService.class); List stockMoveList = - productionRequestService.createStocksMovesFromStockProductionRequest( + productionRequestService.createStocksMovesFromStockProductionRequest( Beans.get(StockProductionRequestRepository.class).find(productionRequest.getId())); if (stockMoveList != null && stockMoveList.size() == 1) { @@ -161,4 +166,29 @@ public class StockProductionRequestController { } } + public void generateReversion(ActionRequest request, ActionResponse response) + throws AxelorException { + StockProductionRequest productionRequestContext = + request.getContext().asType(StockProductionRequest.class); + StockProductionRequest productionRequest = + Beans.get(StockProductionRequestRepository.class).find(productionRequestContext.getId()); + + StockProductionRequestService productionRequestService = + Beans.get(StockProductionRequestService.class); + + StockProductionRequest stockProductionRequest = + productionRequestService.generateReversion(productionRequest); + + if (stockProductionRequest != null) { + response.setView( + ActionView.define(I18n.get("Stock production request")) + .model(StockProductionRequest.class.getName()) + .add("form", "stock-production-request-form") + .add("grid", "stock-production-request-grid") + .param("forceEdit", "true") + .domain("self.id = " + stockProductionRequest.getId()) + .context("_showRecord", String.valueOf(stockProductionRequest.getId())) + .map()); + } + } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestLineController.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestLineController.java index db834df..ff6da9a 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestLineController.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestLineController.java @@ -1,10 +1,7 @@ package com.axelor.apps.stock.web; -import com.axelor.apps.stock.db.StockMove; -import com.axelor.apps.stock.db.StockMoveLine; import com.axelor.apps.stock.db.StockProductionRequest; import com.axelor.apps.stock.db.StockProductionRequestLine; -import com.axelor.apps.stock.service.StockMoveLineService; import com.axelor.apps.stock.service.StockProductionRequestLineService; import com.axelor.db.mapper.Mapper; import com.axelor.exception.AxelorException; @@ -16,54 +13,56 @@ import com.axelor.rpc.ActionResponse; import com.axelor.rpc.Context; public class StockProductionRequestLineController { - - public void setProductInfo(ActionRequest request, ActionResponse response) { + public void setProductInfo(ActionRequest request, ActionResponse response) { - StockProductionRequestLine productionRequestLine; + StockProductionRequestLine productionRequestLine; - try { - productionRequestLine = request.getContext().asType(StockProductionRequestLine.class); - StockProductionRequest productionRequest = productionRequestLine.getStockProductionRequest(); + try { + productionRequestLine = request.getContext().asType(StockProductionRequestLine.class); + StockProductionRequest productionRequest = productionRequestLine.getStockProductionRequest(); - if (productionRequest == null) { - productionRequest = request.getContext().getParent().asType(StockProductionRequest.class); - } + if (productionRequest == null) { + productionRequest = request.getContext().getParent().asType(StockProductionRequest.class); + } - if (productionRequestLine.getProduct() == null) { - productionRequestLine = new StockProductionRequestLine(); - response.setValues(Mapper.toMap(productionRequestLine)); - return; - } + if (productionRequestLine.getProduct() == null) { + productionRequestLine = new StockProductionRequestLine(); + response.setValues(Mapper.toMap(productionRequestLine)); + return; + } - Beans.get(StockProductionRequestLineService.class).setProductInfo(productionRequest, productionRequestLine, productionRequest.getCompany()); - response.setValues(productionRequestLine); - } catch (Exception e) { - productionRequestLine = new StockProductionRequestLine(); - response.setValues(Mapper.toMap(productionRequestLine)); - TraceBackService.trace(response, e, ResponseMessageType.INFORMATION); - } + Beans.get(StockProductionRequestLineService.class) + .setProductInfo(productionRequest, productionRequestLine, productionRequest.getCompany()); + response.setValues(productionRequestLine); + } catch (Exception e) { + productionRequestLine = new StockProductionRequestLine(); + response.setValues(Mapper.toMap(productionRequestLine)); + TraceBackService.trace(response, e, ResponseMessageType.INFORMATION); } + } - - public void compute(ActionRequest request, ActionResponse response) throws AxelorException { - StockProductionRequestLine productionRequestLine = request.getContext().asType(StockProductionRequestLine.class); - StockProductionRequest productionRequest = productionRequestLine.getStockProductionRequest(); - if (productionRequest == null) { - Context parentContext = request.getContext().getParent(); - Context superParentContext = parentContext.getParent(); - if (parentContext.getContextClass().equals(StockProductionRequest.class)) { - productionRequest = parentContext.asType(StockProductionRequest.class); - } else if (superParentContext.getContextClass().equals(StockProductionRequest.class)) { - productionRequest = superParentContext.asType(StockProductionRequest.class); - } else { - return; - } - } - productionRequestLine = Beans.get(StockProductionRequestLineService.class).compute(productionRequestLine, productionRequest); - response.setValue("unitPriceUntaxed", productionRequestLine.getUnitPriceUntaxed()); - response.setValue("unitPriceTaxed", productionRequestLine.getUnitPriceTaxed()); - response.setValue("companyUnitPriceUntaxed", productionRequestLine.getCompanyUnitPriceUntaxed()); + public void compute(ActionRequest request, ActionResponse response) throws AxelorException { + StockProductionRequestLine productionRequestLine = + request.getContext().asType(StockProductionRequestLine.class); + StockProductionRequest productionRequest = productionRequestLine.getStockProductionRequest(); + if (productionRequest == null) { + Context parentContext = request.getContext().getParent(); + Context superParentContext = parentContext.getParent(); + if (parentContext.getContextClass().equals(StockProductionRequest.class)) { + productionRequest = parentContext.asType(StockProductionRequest.class); + } else if (superParentContext.getContextClass().equals(StockProductionRequest.class)) { + productionRequest = superParentContext.asType(StockProductionRequest.class); + } else { + return; + } } - + productionRequestLine = + Beans.get(StockProductionRequestLineService.class) + .compute(productionRequestLine, productionRequest); + response.setValue("unitPriceUntaxed", productionRequestLine.getUnitPriceUntaxed()); + response.setValue("unitPriceTaxed", productionRequestLine.getUnitPriceTaxed()); + response.setValue( + "companyUnitPriceUntaxed", productionRequestLine.getCompanyUnitPriceUntaxed()); + } } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestService.java b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestService.java index 57ff1a2..d4c3f2e 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestService.java +++ b/modules/axelor-open-suite/axelor-stock/src/main/java/com/axelor/apps/stock/web/StockProductionRequestService.java @@ -1,24 +1,11 @@ package com.axelor.apps.stock.web; -import java.lang.invoke.MethodHandles; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.axelor.apps.account.db.TaxLine; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.Unit; import com.axelor.apps.base.db.repo.ProductRepository; import com.axelor.apps.base.service.UnitConversionService; import com.axelor.apps.base.service.app.AppBaseService; -import com.axelor.apps.stock.db.StockConfig; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; @@ -38,217 +25,288 @@ import com.axelor.exception.AxelorException; import com.axelor.inject.Beans; import com.google.inject.Inject; import com.google.inject.persist.Transactional; +import java.lang.invoke.MethodHandles; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StockProductionRequestService { - protected StockProductionRequestRepository productionRequestRepository; - protected StockMoveService stockMoveService; - protected StockMoveLineService stockMoveLineService; - protected StockConfigService stockConfigService; - protected UnitConversionService unitConversionService; - protected StockMoveLineRepository stockMoveLineRepository; - protected AppBaseService appBaseService; - protected StockMoveToolService stockMoveToolService; + protected StockProductionRequestRepository productionRequestRepository; + protected StockMoveService stockMoveService; + protected StockMoveLineService stockMoveLineService; + protected StockConfigService stockConfigService; + protected UnitConversionService unitConversionService; + protected StockMoveLineRepository stockMoveLineRepository; + protected AppBaseService appBaseService; + protected StockMoveToolService stockMoveToolService; + private static final Logger logger = + LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - private static final Logger logger = - LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - @Inject - public StockProductionRequestService(StockProductionRequestRepository productionRequestRepository, - StockMoveService stockMoveService, + @Inject + public StockProductionRequestService( + StockProductionRequestRepository productionRequestRepository, + StockMoveService stockMoveService, StockMoveLineService stockMoveLineService, StockConfigService stockConfigService, UnitConversionService unitConversionService, StockMoveLineRepository stockMoveLineRepository, StockMoveToolService stockMoveToolService, - AppBaseService appBaseService){ - this.productionRequestRepository = productionRequestRepository; - this.stockMoveService = stockMoveService; - this.stockMoveLineService = stockMoveLineService; - this.stockConfigService = stockConfigService; - this.unitConversionService = unitConversionService; - this.stockMoveLineRepository = stockMoveLineRepository; - this.appBaseService = appBaseService; - this.stockMoveToolService = stockMoveToolService; + AppBaseService appBaseService) { + this.productionRequestRepository = productionRequestRepository; + this.stockMoveService = stockMoveService; + this.stockMoveLineService = stockMoveLineService; + this.stockConfigService = stockConfigService; + this.unitConversionService = unitConversionService; + this.stockMoveLineRepository = stockMoveLineRepository; + this.appBaseService = appBaseService; + this.stockMoveToolService = stockMoveToolService; + } - + @Transactional(rollbackOn = {Exception.class}) + public void draft(StockProductionRequest stockProductionRequest) { + stockProductionRequest.setStatusSelect(1); + productionRequestRepository.save(stockProductionRequest); + } + + @Transactional(rollbackOn = {Exception.class}) + public void plan(StockProductionRequest stockProductionRequest) throws AxelorException { + stockProductionRequest.setStatusSelect(2); + stockProductionRequest.setStockProductionRequestSeq( + Beans.get(StockMoveToolServiceImpl.class) + .getSequenceStockProductionRequest(stockProductionRequest)); + productionRequestRepository.save(stockProductionRequest); + } + + @Transactional(rollbackOn = {Exception.class}) + public void realize(StockProductionRequest stockProductionRequest) { + stockProductionRequest.setStatusSelect(3); + productionRequestRepository.save(stockProductionRequest); + } + + @Transactional(rollbackOn = {Exception.class}) + public void cancel(StockProductionRequest stockProductionRequest) { + stockProductionRequest.setStatusSelect(4); + productionRequestRepository.save(stockProductionRequest); + } + + @Transactional(rollbackOn = {Exception.class}) + public List createStocksMovesFromStockProductionRequest( + StockProductionRequest stockProductionRequest) throws AxelorException { + + List stockMoveList = new ArrayList<>(); + + // StockLocationLine stockLocationLine = this.getOrCreateStockLocationLine(stockLocation, + // product); + + // UnitConversionService unitConversionService = Beans.get(UnitConversionService.class); + // Unit stockLocationLineUnit = stockLocationLine.getUnit(); + + // if (stockLocationLineUnit != null && !stockLocationLineUnit.equals(stockMoveLineUnit)) { + // qty = + // unitConversionService.convert( + // stockMoveLineUnit, stockLocationLineUnit, qty, qty.scale(), product); + // } + + Company company = stockProductionRequest.getCompany(); + StockMove stockMove = this.createStockMove(stockProductionRequest, company, LocalDate.now()); + + stockMove.setExTaxTotal(stockMoveToolService.compute(stockMove)); + + stockMoveService.plan(stockMove); + + logger.debug("stockMove ************ {}", stockMove.toString()); + + stockMoveList.add(stockMove.getId()); + + for (StockProductionRequestLine productionRequestLine : + stockProductionRequest.getStockProductionRequestLineList()) { + if (productionRequestLine.getIsWithBackorder()) { + StockMoveLine line = + this.createStockMoveLine( + stockMove, productionRequestLine, productionRequestLine.getRealQty()); + logger.debug("createStockMoveLine ************ {}", line.toString()); + } } + logger.debug("stockMoveList ************ {}", stockMoveList); + return stockMoveList; + } - @Transactional(rollbackOn = {Exception.class}) - public void draft(StockProductionRequest stockProductionRequest) { - stockProductionRequest.setStatusSelect(1); - productionRequestRepository.save(stockProductionRequest); - } - - @Transactional(rollbackOn = {Exception.class}) - public void plan(StockProductionRequest stockProductionRequest) throws AxelorException { - stockProductionRequest.setStatusSelect(2); - stockProductionRequest.setStockProductionRequestSeq( - Beans.get(StockMoveToolServiceImpl.class).getSequenceStockProductionRequest(1, stockProductionRequest.getCompany())); - productionRequestRepository.save(stockProductionRequest); - } - - @Transactional(rollbackOn = {Exception.class}) - public void realize(StockProductionRequest stockProductionRequest) { - stockProductionRequest.setStatusSelect(3); - productionRequestRepository.save(stockProductionRequest); - } - - @Transactional(rollbackOn = {Exception.class}) - public void cancel(StockProductionRequest stockProductionRequest) { - stockProductionRequest.setStatusSelect(4); - productionRequestRepository.save(stockProductionRequest); - } + public StockMove createStockMove( + StockProductionRequest stockProductionRequest, + Company company, + LocalDate estimatedDeliveryDate) + throws AxelorException { - - @Transactional(rollbackOn = {Exception.class}) - public List createStocksMovesFromStockProductionRequest(StockProductionRequest stockProductionRequest) throws AxelorException { - - List stockMoveList = new ArrayList<>(); - - Company company = stockProductionRequest.getCompany(); - StockMove stockMove = this.createStockMove(stockProductionRequest, company, LocalDate.now()); - - stockMove.setExTaxTotal(stockMoveToolService.compute(stockMove)); - - stockMoveService.plan(stockMove); - - logger.debug("stockMove ************ {}",stockMove.toString()); - - stockMoveList.add(stockMove.getId()); - - for (StockProductionRequestLine productionRequestLine : stockProductionRequest.getStockProductionRequestLineList()) { - if(productionRequestLine.getIsWithBackorder()){ - StockMoveLine line = this.createStockMoveLine(stockMove, productionRequestLine,productionRequestLine.getRealQty()); - logger.debug("createStockMoveLine ************ {}",line.toString()); - } - } - - logger.debug("stockMoveList ************ {}",stockMoveList); - return stockMoveList; - - } - - - public StockMove createStockMove( - StockProductionRequest stockProductionRequest, Company company, LocalDate estimatedDeliveryDate) - throws AxelorException { - - StockLocation fromStockLocation = stockConfigService.getRawMaterialsDefaultStockLocation(stockConfigService.getStockConfig(company)); - StockLocationRepository stockLocationRepository = Beans.get(StockLocationRepository.class); - - - switch (stockProductionRequest.getFamilleProduit().getId().intValue()) { - // matiere premiere - case 67: - fromStockLocation = stockLocationRepository.find(3L); - break; - // MATIERE PREMIERE INJECTABLE - case 68: - fromStockLocation = stockLocationRepository.find(4L); - break; - // ARTICLES DE CONDITIONEMENT - case 59: - fromStockLocation = stockLocationRepository.find(2L); - break; - - default: - fromStockLocation = stockConfigService.getRawMaterialsDefaultStockLocation(stockConfigService.getStockConfig(company)); - break; - } - - // stockProductionRequest.getStocklocation(); - - StockLocation toStockLocation = - stockConfigService.getCustomerVirtualStockLocation( + StockLocation fromStockLocation = + stockConfigService.getRawMaterialsDefaultStockLocation( stockConfigService.getStockConfig(company)); + StockLocationRepository stockLocationRepository = Beans.get(StockLocationRepository.class); - StockMove stockMove = - stockMoveService.createStockMove( - null, - null, - company, - stockProductionRequest.getPartner(), - fromStockLocation, - toStockLocation, - null, - estimatedDeliveryDate, - stockProductionRequest.getNote(), - null, - null, - null, - null, - null, - StockMoveRepository.TYPE_OUTGOING); + switch (stockProductionRequest.getFamilleProduit().getId().intValue()) { + // matiere premiere + case 67: + fromStockLocation = stockLocationRepository.find(75L); + break; + // MATIERE PREMIERE INJECTABLE + case 68: + fromStockLocation = stockLocationRepository.find(75L); + break; + // ARTICLES DE CONDITIONEMENT + case 59: + fromStockLocation = stockLocationRepository.find(75L); + break; - stockMove.setToAddressStr(null); - stockMove.setOriginId(stockProductionRequest.getId()); - stockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_STOCK_PRODUCTION_REQUEST); - stockMove.setOrigin(stockProductionRequest.getStockProductionRequestSeq()); - stockMove.setStockMoveLineList(new ArrayList<>()); - stockMove.setTradingName(null); - stockMove.setNote(stockProductionRequest.getNote()); - return stockMove; + default: + fromStockLocation = + stockConfigService.getRawMaterialsDefaultStockLocation( + stockConfigService.getStockConfig(company)); + break; } - - public StockMoveLine createStockMoveLine( - StockMove stockMove, StockProductionRequestLine productionRequestLine, BigDecimal qty) throws AxelorException { - + // stockProductionRequest.getStocklocation(); + + StockLocation toStockLocation = stockProductionRequest.getStocklocation(); + // stockConfigService.getCustomerVirtualStockLocation( + // stockConfigService.getStockConfig(company)); + int stockType = StockMoveRepository.TYPE_INTERNAL; + if (stockProductionRequest.getTypeSelect() + == StockProductionRequestRepository.TYPE_SELECT_RETURN) { + toStockLocation = fromStockLocation; + fromStockLocation = + // stockProductionRequest.getStocklocation(); + stockConfigService.getCustomerVirtualStockLocation( + stockConfigService.getStockConfig(company)); + stockType = StockMoveRepository.TYPE_INCOMING; + System.out.println("***************************************yes*********************"); + System.out.println(stockProductionRequest.getTypeSelect()); + System.out.println(StockProductionRequestRepository.TYPE_SELECT_RETURN); + System.out.println(fromStockLocation); + System.out.println(toStockLocation); + System.out.println("***************************************yes*********************"); + } + + StockMove stockMove = + stockMoveService.createStockMove( + null, + null, + company, + stockProductionRequest.getPartner(), + fromStockLocation, + toStockLocation, + null, + estimatedDeliveryDate, + stockProductionRequest.getNote(), + null, + null, + null, + null, + null, + stockType); + + stockMove.setToAddressStr(null); + stockMove.setOriginId(stockProductionRequest.getId()); + stockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_STOCK_PRODUCTION_REQUEST); + stockMove.setOrigin(stockProductionRequest.getStockProductionRequestSeq()); + stockMove.setStockMoveLineList(new ArrayList<>()); + stockMove.setTradingName(null); + stockMove.setNote(stockProductionRequest.getNote()); + return stockMove; + } + + public StockMoveLine createStockMoveLine( + StockMove stockMove, StockProductionRequestLine productionRequestLine, BigDecimal qty) + throws AxelorException { + int scale = Beans.get(AppBaseService.class).getNbDecimalDigitForSalePrice(); if (this.isStockMoveProduct(productionRequestLine)) { Unit unit = productionRequestLine.getProduct().getUnit(); - if (unit != null && !unit.equals(productionRequestLine.getUnit())) { qty = unitConversionService.convert( - productionRequestLine.getUnit(), unit, qty, qty.scale(), productionRequestLine.getProduct()); + productionRequestLine.getUnit(), + unit, + qty, + qty.scale(), + productionRequestLine.getProduct()); } BigDecimal priceDiscounted = productionRequestLine.getUnitPriceTaxed(); - BigDecimal companyUnitPriceUntaxed = productionRequestLine.getCompanyUnitPriceUntaxed(); - BigDecimal unitPriceUntaxed = productionRequestLine.getUnitPriceUntaxed(); - + BigDecimal companyUnitPriceUntaxed = productionRequestLine.getCompanyUnitPriceUntaxed(); + BigDecimal unitPriceUntaxed = productionRequestLine.getUnitPriceUntaxed(); + StockMoveLine stockMoveLine = - stockMoveLineService.createStockMoveLine( - productionRequestLine.getProduct(), - productionRequestLine.getProductName(), - productionRequestLine.getDescription(), - qty, - unitPriceUntaxed, - companyUnitPriceUntaxed, - unit, - stockMove, - StockMoveLineService.TYPE_NULL, - false, - BigDecimal.ZERO); - return stockMoveLine; - + stockMoveLineService.createStockMoveLine( + productionRequestLine.getProduct(), + productionRequestLine.getProductName(), + productionRequestLine.getDescription(), + qty, + unitPriceUntaxed, + companyUnitPriceUntaxed, + companyUnitPriceUntaxed, + unit, + stockMove, + productionRequestLine.getTrackingNumber()); + return stockMoveLine; } if (productionRequestLine.getDeliveryState() == 0) { - productionRequestLine.setDeliveryState(StockProductionRequestLineRepository.DELIVERY_STATE_NOT_DELIVERED); + productionRequestLine.setDeliveryState( + StockProductionRequestLineRepository.DELIVERY_STATE_NOT_DELIVERED); } return null; + } + + @Transactional(rollbackOn = {Exception.class}) + public StockProductionRequest generateReversion(StockProductionRequest stockProductionRequest) + throws AxelorException { + StockProductionRequestRepository moveRepository = + Beans.get(StockProductionRequestRepository.class); + StockProductionRequestLineRepository moveRepositoryLineRepository = + Beans.get(StockProductionRequestLineRepository.class); + StockProductionRequest newStockProductionRequest = + moveRepository.copy(stockProductionRequest, false); + newStockProductionRequest.setStockProductionRequestSeq(null); + newStockProductionRequest.setStatusSelect(StockProductionRequestRepository.STATUS_DRAFT); + newStockProductionRequest.setTypeSelect(StockProductionRequestRepository.TYPE_SELECT_RETURN); + + for (StockProductionRequestLine requestLine : + stockProductionRequest.getStockProductionRequestLineList()) { + StockProductionRequestLine sLine = moveRepositoryLineRepository.copy(requestLine, false); + newStockProductionRequest.addStockProductionRequestLineListItem(sLine); + } + + return moveRepository.save(newStockProductionRequest); + // StockMove stockMove = Beans.get(StockMoveRepository.class).all() + // .filter( + // "self.originTypeSelect = ?1 AND self.originId = ?2 AND self.statusSelect = ?3", + // StockMoveRepository.ORIGIN_STOCK_PRODUCTION_REQUEST, + // stockProductionRequest.getId()) + // .fetchOne(); + // Optional stockMove = + // Beans.get(StockMoveServiceImpl.class).copyAndSplitStockMoveReverse(stockMove, false); + // return stockMove; } - - - - public boolean isStockMoveProduct(StockProductionRequestLine productionRequestLine) throws AxelorException { - return isStockMoveProduct(productionRequestLine, productionRequestLine.getStockProductionRequest()); + public boolean isStockMoveProduct(StockProductionRequestLine productionRequestLine) + throws AxelorException { + return isStockMoveProduct( + productionRequestLine, productionRequestLine.getStockProductionRequest()); } - public boolean isStockMoveProduct(StockProductionRequestLine productionRequestLine, StockProductionRequest productionRequest) + public boolean isStockMoveProduct( + StockProductionRequestLine productionRequestLine, StockProductionRequest productionRequest) throws AxelorException { Product product = productionRequestLine.getProduct(); - return (product != null && (product.getProductTypeSelect().equals(ProductRepository.PRODUCT_TYPE_STORABLE))); + return (product != null + && (product.getProductTypeSelect().equals(ProductRepository.PRODUCT_TYPE_STORABLE))); } - } diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InternalTrackingNumber.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InternalTrackingNumber.xml index 3ccb4ce..d78c26f 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InternalTrackingNumber.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InternalTrackingNumber.xml @@ -14,12 +14,12 @@ - - + + + - diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/Inventory.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/Inventory.xml index 4f383e0..aded286 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/Inventory.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/Inventory.xml @@ -29,7 +29,8 @@ - + + diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InventoryLine.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InventoryLine.xml index 122c10f..edd25be 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InventoryLine.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/InventoryLine.xml @@ -8,35 +8,68 @@ - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockConfig.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockConfig.xml index a9d102a..0614576 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockConfig.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockConfig.xml @@ -55,6 +55,10 @@ + + + + diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocation.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocation.xml index 9ad5188..92a2cf6 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocation.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocation.xml @@ -18,6 +18,8 @@ + + @@ -33,6 +35,10 @@ public static final int PRINT_TYPE_LOCATION_FINANCIAL_DATA = 1; public static final int PRINT_TYPE_STOCK_LOCATION_CONTENT = 2; + public static final int TYPE_COMPLIANT = 2; + public static final int TYPE_NOT_COMPLIANT = 3; + public static final int TYPE_QUARANTINE = 4; + ]]> diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocationLine.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocationLine.xml index cbee3a6..4b7c4c7 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocationLine.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockLocationLine.xml @@ -20,9 +20,29 @@ + + + + + + + + + + + + + + + + + + + +
diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLine.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLine.xml index 9152121..9f4aba1 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLine.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLine.xml @@ -95,6 +95,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLineLocationLine.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLineLocationLine.xml new file mode 100644 index 0000000..8a9520b --- /dev/null +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockMoveLineLocationLine.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequest.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequest.xml index 529343f..95eede3 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequest.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequest.xml @@ -37,6 +37,11 @@ public static final int STATUS_REALIZED = 3; public static final int STATUS_CANCELED = 4; + + // TYPE SELECT + public static final int TYPE_SELECT_ORDER = 1; + public static final int TYPE_SELECT_RETURN = 2; + ]]> diff --git a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequestLine.xml b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequestLine.xml index 18e67c0..55f8ec0 100644 --- a/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequestLine.xml +++ b/modules/axelor-open-suite/axelor-stock/src/main/resources/domains/StockProductionRequestLine.xml @@ -26,7 +26,7 @@ - + populate(Map json, Map context) { + Long supplierLine = (Long) json.get("id"); + PurchaseOrderSupplierLine line = find(supplierLine); + List budgetDistributiList = line.getPurchaseOrderLine().getBudgetDistributionList(); + BigDecimal totalBudgetAmountAvailable = BigDecimal.ZERO; + for (BudgetDistribution budgetDistribution : budgetDistributiList) { + totalBudgetAmountAvailable = totalBudgetAmountAvailable.add(budgetDistribution.getBudgetAmountAvailable()); + } + json.put("budgetRemainingAmount", totalBudgetAmountAvailable); + + return super.populate(json, context); + } + +} diff --git a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/module/SupplierManagementModule.java b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/module/SupplierManagementModule.java new file mode 100644 index 0000000..ca37bac --- /dev/null +++ b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/module/SupplierManagementModule.java @@ -0,0 +1,13 @@ +package com.axelor.apps.suppliermanagement.module; + +import com.axelor.app.AxelorModule; +import com.axelor.apps.suppliermanagement.db.repo.PurchaseOrderSupplierLineManagementRepository; +import com.axelor.apps.suppliermanagement.db.repo.PurchaseOrderSupplierLineRepository; + +public class SupplierManagementModule extends AxelorModule{ + @Override + protected void configure() { + bind(PurchaseOrderSupplierLineRepository.class).to(PurchaseOrderSupplierLineManagementRepository.class); + } + +} diff --git a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierLineService.java b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierLineService.java index d40cfdc..23a5eea 100644 --- a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierLineService.java +++ b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierLineService.java @@ -34,6 +34,7 @@ import com.axelor.apps.purchase.service.app.AppPurchaseService; import com.axelor.apps.purchase.web.EmailUtil; import com.axelor.apps.suppliermanagement.db.PurchaseOrderSupplierLine; import com.axelor.apps.suppliermanagement.db.repo.PurchaseOrderSupplierLineRepository; +import com.axelor.apps.supplychain.service.PurchaseOrderLineServiceSupplychainImpl; import com.axelor.auth.AuthUtils; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; @@ -44,8 +45,10 @@ import com.google.inject.persist.Transactional; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; public class PurchaseOrderSupplierLineService { @@ -61,7 +64,6 @@ public class PurchaseOrderSupplierLineService { @Inject private MailAccountService mailAccountService; - @Transactional(rollbackOn = {Exception.class}) public void accept(PurchaseOrderSupplierLine purchaseOrderSupplierLine) throws AxelorException { @@ -83,6 +85,7 @@ public class PurchaseOrderSupplierLineService { // set tax from tco BigDecimal priceDiscounted = this.computeDiscount(purchaseOrderSupplierLine); + purchaseOrderLine.setQty(purchaseOrderSupplierLine.getAvailableQty()); purchaseOrderLine.setTaxLine(purchaseOrderSupplierLine.getTaxLine()); purchaseOrderLine.setPrice(purchaseOrderSupplierLine.getPrice()); purchaseOrderLine.setExTaxTotal( @@ -95,7 +98,15 @@ public class PurchaseOrderSupplierLineService { // sophal add acceptedOn and By TCO purchaseOrderSupplierLine.setAcceptanceDate(appPurchaseService.getTodayDate()); purchaseOrderSupplierLine.setAcceptedByUser(AuthUtils.getUser()); - ; + + if(!purchaseOrderLine.getBudgetDistributionList().isEmpty()){ + Beans.get(PurchaseOrderLineServiceSupplychainImpl.class) + .computeBudgetDistributionSumAmount(purchaseOrderLine, purchaseOrderLine.getPurchaseOrder()); + } + + if(!purchaseOrderLine.getAnalyticMoveLineList().isEmpty()){ + Beans.get(PurchaseOrderLineServiceSupplychainImpl.class).computeAnalyticDistribution(purchaseOrderLine); + } poSupplierLineRepo.save(purchaseOrderSupplierLine); } @@ -151,11 +162,34 @@ public class PurchaseOrderSupplierLineService { this.putStandBy(line, raison); } } - PurchaseOrder po = purchaseOrderSupplierLines.get(0).getPurchaseOrderLine().getPurchaseOrder(); - String email = purchaseOrderSupplierLines.get(0).getPurchaseOrderLine().getCreatedBy().getPartner().getEmailAddress().getAddress(); - String raisonTmp = raison != null ? raison : ""; - if(email != null){ - EmailUtil.sendEmail(mailAccountService, email, "TCO En Attente "+po.getPurchaseOrderSeq(),po.getPurchaseOrderSeq()+ " a été mis en anttente avec le motif suivant
"+raisonTmp+""); + // PurchaseOrder po = + // purchaseOrderSupplierLines.get(0).getPurchaseOrderLine().getPurchaseOrder(); + + Set purchaseOrderSet = new HashSet<>(); + + for (PurchaseOrderSupplierLine line : purchaseOrderSupplierLines) { + purchaseOrderSet.add(line.getPurchaseOrderLine().getPurchaseOrder()); + } + + for (PurchaseOrder pOrder : purchaseOrderSet) { + // List pslines = purchaseOrderSupplierLines.stream().filter(arg0 + // -> arg0.getPurchaseOrderLine().getPurchaseOrder().getId() == + // pOrder.getId()).collect(Collectors.toList()); + String email = pOrder.getCreatedBy().getPartner().getEmailAddress().getAddress(); + String raisonTmp = raison != null ? raison : ""; + if (email != null) { + EmailUtil.sendEmailWithCC( + mailAccountService, + email, + "De(s) TCO(s) mis en attente(s) : " + pOrder.getPurchaseOrderSeq(), + "Des TCO's ont été mis en anttentes de la CA : " + + pOrder.getPurchaseOrderSeq() + + " avec le motif suivant
" + + raisonTmp + + "", + "bachir.souldi@sophal.dz", + "zakaria.hachemi@sophal.dz"); + } } } @@ -323,12 +357,12 @@ public class PurchaseOrderSupplierLineService { return map; } - BigDecimal priceDiscounted = this.computeDiscount(line).setScale(5,RoundingMode.HALF_EVEN); - + BigDecimal priceDiscounted = this.computeDiscount(line).setScale(5, RoundingMode.HALF_EVEN); + BigDecimal taxRate = line.getTaxLine().getValue(); - - - BigDecimal exTaxTotal = PurchaseOrderLineServiceImpl.computeAmount(line.getAvailableQty(), priceDiscounted); + + BigDecimal exTaxTotal = + PurchaseOrderLineServiceImpl.computeAmount(line.getAvailableQty(), priceDiscounted); BigDecimal taxTotal = exTaxTotal.multiply(taxRate); BigDecimal inTaxTotal = exTaxTotal.add(exTaxTotal.multiply(taxRate)); diff --git a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierService.java b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierService.java index 7445e79..b18707c 100644 --- a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierService.java +++ b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/service/PurchaseOrderSupplierService.java @@ -39,6 +39,7 @@ import com.axelor.apps.stock.service.StockLocationService; import com.axelor.apps.suppliermanagement.db.PurchaseOrderSupplierLine; import com.axelor.apps.suppliermanagement.db.repo.PurchaseOrderSupplierLineRepository; import com.axelor.apps.supplychain.exception.IExceptionMessage; +import com.axelor.apps.supplychain.service.PurchaseOrderLineServiceSupplychainImpl; import com.axelor.apps.supplychain.service.PurchaseOrderServiceSupplychainImpl; import com.axelor.auth.AuthUtils; import com.axelor.dms.db.DMSFile; @@ -70,7 +71,7 @@ public class PurchaseOrderSupplierService { @Inject private PurchaseOrderServiceSupplychainImpl purchaseOrderServiceSupplychainImpl; - @Inject private PurchaseOrderLineService purchaseOrderLineService; + @Inject private PurchaseOrderLineServiceSupplychainImpl purchaseOrderLineServiceSupplychainImpl; @Inject protected PurchaseOrderRepository poRepo; @@ -322,13 +323,7 @@ public class PurchaseOrderSupplierService { "Création d'une ligne de commande fournisseur pour le produit : {}", new Object[] {purchaseOrderLine.getProductName()}); - return purchaseOrderLineService.createPurchaseOrderLine( - purchaseOrder, - purchaseOrderLine.getProduct(), - purchaseOrderLine.getProductName(), - purchaseOrderLine.getDescription(), - purchaseOrderLine.getQty(), - purchaseOrderLine.getUnit()); + return purchaseOrderLineServiceSupplychainImpl.createPurchaseOrderLineFromSplit(purchaseOrderLine); } @Transactional(rollbackOn = {Exception.class}) @@ -398,13 +393,7 @@ public class PurchaseOrderSupplierService { new Object[] {purchaseOrderLine.getProductName()}); PurchaseOrderLine PurchaseOrderLineNew = - purchaseOrderLineService.createPurchaseOrderLine( - purchaseOrder, - purchaseOrderLine.getProduct(), - purchaseOrderLine.getProductName(), - purchaseOrderLine.getDescription(), - purchaseOrderLine.getQty(), - purchaseOrderLine.getUnit()); + purchaseOrderLineServiceSupplychainImpl.createPurchaseOrderLineFromSplit(purchaseOrderLine); PurchaseOrderLineNew.setPrice(purchaseOrderLine.getPrice()); PurchaseOrderLineNew.setInTaxPrice(purchaseOrderLine.getInTaxPrice()); @@ -455,6 +444,7 @@ public class PurchaseOrderSupplierService { po.setRefusedByUser(poLineSupplierParnet.getRefusedByUser()); po.setAttrs(poLineSupplierParnet.getAttrs()); po.setCurrency(poLineSupplierParnet.getCurrency()); + po.setPriceDiscounted(poLineSupplierParnet.getPriceDiscounted()); // LOG.debug("purchaseOrderLineNew.getId(): {}",purchaseOrderLineNew.get(index).getId()); Beans.get(PurchaseOrderSupplierLineRepository.class).save(po); } diff --git a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/web/PurchaseOrderSupplierLineController.java b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/web/PurchaseOrderSupplierLineController.java index 9f0b33d..a52bbdf 100644 --- a/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/web/PurchaseOrderSupplierLineController.java +++ b/modules/axelor-open-suite/axelor-supplier-management/src/main/java/com/axelor/apps/suppliermanagement/web/PurchaseOrderSupplierLineController.java @@ -28,6 +28,7 @@ import com.axelor.apps.purchase.service.app.AppPurchaseService; import com.axelor.apps.suppliermanagement.db.PurchaseOrderSupplierLine; import com.axelor.apps.suppliermanagement.db.repo.PurchaseOrderSupplierLineRepository; import com.axelor.apps.suppliermanagement.service.PurchaseOrderSupplierLineService; +import com.axelor.apps.supplychain.service.PurchaseOrderServiceSupplychainImpl; import com.axelor.exception.service.TraceBackService; import com.axelor.inject.Beans; import com.axelor.meta.schema.actions.ActionView; @@ -287,4 +288,13 @@ public class PurchaseOrderSupplierLineController { TraceBackService.trace(response, e); } } + + + public void computeBudgetDistribution(ActionRequest request, ActionResponse response){ + + PurchaseOrderSupplierLine purchaseOrderSupplierLine = Beans.get(PurchaseOrderSupplierLineRepository.class) + .find(request.getContext().asType(PurchaseOrderSupplierLine.class).getId()); + Beans.get(PurchaseOrderServiceSupplychainImpl.class).computeBudgetDistribution(purchaseOrderSupplierLine.getPurchaseOrderLine()); + response.setReload(true); + } } diff --git a/modules/axelor-open-suite/axelor-supplier-management/src/main/resources/domains/PurchaseOrderSupplierLine.xml b/modules/axelor-open-suite/axelor-supplier-management/src/main/resources/domains/PurchaseOrderSupplierLine.xml index e16565e..c18ff41 100644 --- a/modules/axelor-open-suite/axelor-supplier-management/src/main/resources/domains/PurchaseOrderSupplierLine.xml +++ b/modules/axelor-open-suite/axelor-supplier-management/src/main/resources/domains/PurchaseOrderSupplierLine.xml @@ -51,6 +51,8 @@ + + 0 ){ - - MoveLine moveLine = - moveLineService.createMoveLine( - move, - partner, - acc, - amountInCurrency, - isDebit(stockMove), - moveDate, - ++counter, - stockMove.getStockMoveSeq(), - description); - moveLine.setDate(moveDate); - moveLine.setDueDate(moveDate); - moveLine.setAccountId(acc.getId()); - moveLine.setAccountCode(acc.getCode()); - - MoveLine moveLine2 = - moveLineService.createMoveLine( - move, - partner, - acc2, - amountInCurrency, - !isDebit(stockMove), - moveDate, - ++counter, - stockMove.getStockMoveSeq(), - description); - moveLine2.setDate(moveDate); - moveLine2.setDueDate(moveDate); - moveLine2.setAccountId(acc2.getId()); - moveLine2.setAccountCode(acc2.getCode()); - + if (line.getRealQty().compareTo(BigDecimal.ZERO) > 0) { - move.addMoveLineListItem(moveLine); - move.addMoveLineListItem(moveLine2); + MoveLine moveLine = + moveLineService.createMoveLine( + move, + partner, + acc, + amountInCurrency, + isDebit(stockMove), + moveDate, + ++counter, + stockMove.getStockMoveSeq(), + description); + moveLine.setDate(moveDate); + moveLine.setDueDate(moveDate); + moveLine.setAccountId(acc.getId()); + moveLine.setAccountCode(acc.getCode()); + + MoveLine moveLine2 = + moveLineService.createMoveLine( + move, + partner, + acc2, + amountInCurrency, + !isDebit(stockMove), + moveDate, + ++counter, + stockMove.getStockMoveSeq(), + description); + moveLine2.setDate(moveDate); + moveLine2.setDueDate(moveDate); + moveLine2.setAccountId(acc2.getId()); + moveLine2.setAccountCode(acc2.getCode()); + + move.addMoveLineListItem(moveLine); + move.addMoveLineListItem(moveLine2); } - } stockMove.setIsVentilated(true); move.setIgnoreInAccountingOk(false); @@ -783,7 +782,7 @@ public class AccountingCutOffServiceImpl implements AccountingCutOffService { Move move = this.generateStockAccountMove(stockMove); movesId.add(move.getId()); } -; + ; return movesId; } @@ -807,7 +806,7 @@ public class AccountingCutOffServiceImpl implements AccountingCutOffService { Journal journal; // stockMove.getToStockLocation().getTypeSelect() == StockLocationRepository.TYPE_VIRTUAL if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING) { - journal = Beans.get(JournalRepository.class).find(10L); + journal = Beans.get(JournalRepository.class).find(10L); } else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING) { journal = Beans.get(JournalRepository.class).find(30L); } else @@ -835,44 +834,44 @@ public class AccountingCutOffServiceImpl implements AccountingCutOffService { return isDebit; } - - public Boolean isGapPositive(InventoryLine line){ - if(line.getGap().compareTo(BigDecimal.ZERO) > 0){ + public Boolean isGapPositive(InventoryLine line) { + if (line.getGap().compareTo(BigDecimal.ZERO) > 0) { return true; - }else{ + } else { return false; } } @Transactional(rollbackOn = {Exception.class}) public Move generateInventoryLineMove(InventoryLine inventoryLine) throws AxelorException { - + Map> stockAccounts = new HashMap<>(); Company company = inventoryLine.getInventory().getCompany(); Currency currency = inventoryLine.getInventory().getCompany().getCurrency(); Partner partner = inventoryLine.getInventory().getCompany().getPartner(); LocalDate moveDate = inventoryLine.getInventory().getPlannedEndDateT().toLocalDate(); Journal journal = Beans.get(JournalRepository.class).find(10L); - + Map accountMap = new HashMap(); - AccountManagement accountManagement = - Beans.get(AccountManagementRepository.class) - .all() - .filter("self.product = ?1 and self.company = ?2", inventoryLine.getProduct(), company) - .fetchOne(); - - if(accountManagement.getStockAccount() == null || accountManagement.getConsumptionAccount() == null){ - throw new AxelorException( + AccountManagement accountManagement = + Beans.get(AccountManagementRepository.class) + .all() + .filter("self.product = ?1 and self.company = ?2", inventoryLine.getProduct(), company) + .fetchOne(); + + if (accountManagement.getStockAccount() == null + || accountManagement.getConsumptionAccount() == null) { + throw new AxelorException( inventoryLine, TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get(IExceptionMessage.VENTILATE_STATE_6), inventoryLine.getProduct().getFullName()); - } + } - accountMap.put("stockAccount", accountManagement.getStockAccount()); - accountMap.put("consumptionAccount", accountManagement.getConsumptionAccount()); + accountMap.put("stockAccount", accountManagement.getStockAccount()); + accountMap.put("consumptionAccount", accountManagement.getConsumptionAccount()); - stockAccounts.put(inventoryLine, accountMap); + stockAccounts.put(inventoryLine, accountMap); Move move = moveCreateService.createMove( @@ -885,87 +884,81 @@ public class AccountingCutOffServiceImpl implements AccountingCutOffService { MoveRepository.TECHNICAL_ORIGIN_AUTOMATIC); int counter = 0; - - Account acc = stockAccounts.get(inventoryLine).get("consumptionAccount"); - Account acc2 = stockAccounts.get(inventoryLine).get("stockAccount"); + Account acc = stockAccounts.get(inventoryLine).get("consumptionAccount"); + Account acc2 = stockAccounts.get(inventoryLine).get("stockAccount"); - if(inventoryLine.getJustifiedGap()){ - if(isGapPositive(inventoryLine)){ - acc = stockAccounts.get(inventoryLine).get("consumptionAccount"); - acc2 = stockAccounts.get(inventoryLine).get("stockAccount"); - }else if(!isGapPositive(inventoryLine)){ - acc = stockAccounts.get(inventoryLine).get("stockAccount"); - acc2 = stockAccounts.get(inventoryLine).get("consumptionAccount"); - } - }else{ - if(isGapPositive(inventoryLine)){ - acc = Beans.get(AccountRepository.class).find(1360L); - acc2 = stockAccounts.get(inventoryLine).get("stockAccount"); - }else if(!isGapPositive(inventoryLine)){ - acc = stockAccounts.get(inventoryLine).get("stockAccount"); - acc2 = Beans.get(AccountRepository.class).find(1400L); - } + if (inventoryLine.getJustifiedGap()) { + if (isGapPositive(inventoryLine)) { + acc = stockAccounts.get(inventoryLine).get("consumptionAccount"); + acc2 = stockAccounts.get(inventoryLine).get("stockAccount"); + } else if (!isGapPositive(inventoryLine)) { + acc = stockAccounts.get(inventoryLine).get("stockAccount"); + acc2 = stockAccounts.get(inventoryLine).get("consumptionAccount"); } - - - - BigDecimal amountInCurrency = inventoryLine.getGapValue().multiply(inventoryLine.getGap()); - String description = inventoryLine.getInventory().getInventorySeq() + "-" + inventoryLine.getProduct().getCode(); - if (inventoryLine.getTrackingNumber() != null) { - description += "-" + inventoryLine.getTrackingNumber().getTrackingNumberSeq(); + } else { + if (isGapPositive(inventoryLine)) { + acc = Beans.get(AccountRepository.class).find(1360L); + acc2 = stockAccounts.get(inventoryLine).get("stockAccount"); + } else if (!isGapPositive(inventoryLine)) { + acc = stockAccounts.get(inventoryLine).get("stockAccount"); + acc2 = Beans.get(AccountRepository.class).find(1400L); } + } - MoveLine moveLine = - moveLineService.createMoveLine( - move, - partner, - acc, - amountInCurrency, - isDebitInventoryLine(inventoryLine), - moveDate, - ++counter, - inventoryLine.getInventory().getInventorySeq(), - description); - moveLine.setDescription(description); - moveLine.setDate(moveDate); - moveLine.setDueDate(moveDate); - moveLine.setAccountId(acc.getId()); - moveLine.setAccountCode(acc.getCode()); - moveLine.setAccountName(acc.getName()); + BigDecimal amountInCurrency = inventoryLine.getGapValue().multiply(inventoryLine.getGap()); + String description = + inventoryLine.getInventory().getInventorySeq() + "-" + inventoryLine.getProduct().getCode(); + if (inventoryLine.getTrackingNumber() != null) { + description += "-" + inventoryLine.getTrackingNumber().getTrackingNumberSeq(); + } - MoveLine moveLine2 = - moveLineService.createMoveLine( - move, - partner, - acc2, - amountInCurrency, - !isDebitInventoryLine(inventoryLine), - moveDate, - ++counter, - inventoryLine.getInventory().getInventorySeq(), - description); - moveLine2.setDescription(description); - moveLine2.setDate(moveDate); - moveLine2.setDueDate(moveDate); - moveLine2.setAccountId(acc2.getId()); - moveLine2.setAccountCode(acc2.getCode()); - moveLine2.setAccountName(acc2.getName()); + MoveLine moveLine = + moveLineService.createMoveLine( + move, + partner, + acc, + amountInCurrency, + isDebitInventoryLine(inventoryLine), + moveDate, + ++counter, + inventoryLine.getInventory().getInventorySeq(), + description); + moveLine.setDescription(description); + moveLine.setDate(moveDate); + moveLine.setDueDate(moveDate); + moveLine.setAccountId(acc.getId()); + moveLine.setAccountCode(acc.getCode()); + moveLine.setAccountName(acc.getName()); + MoveLine moveLine2 = + moveLineService.createMoveLine( + move, + partner, + acc2, + amountInCurrency, + !isDebitInventoryLine(inventoryLine), + moveDate, + ++counter, + inventoryLine.getInventory().getInventorySeq(), + description); + moveLine2.setDescription(description); + moveLine2.setDate(moveDate); + moveLine2.setDueDate(moveDate); + moveLine2.setAccountId(acc2.getId()); + moveLine2.setAccountCode(acc2.getCode()); + moveLine2.setAccountName(acc2.getName()); + move.addMoveLineListItem(moveLine); + move.addMoveLineListItem(moveLine2); + move.setInventoryLine(inventoryLine); + inventoryLine.setIsVentilated(true); - move.addMoveLineListItem(moveLine); - move.addMoveLineListItem(moveLine2); - move.setInventoryLine(inventoryLine); - inventoryLine.setIsVentilated(true); - move.setIgnoreInAccountingOk(false); move.setStatusSelect(MoveRepository.STATUS_DAYBOOK); return move; - } - public List massGenerationInventoryLineMove(List ids) throws AxelorException { List movesId = new ArrayList<>(); @@ -978,8 +971,6 @@ public class AccountingCutOffServiceImpl implements AccountingCutOffService { return movesId; } - - // public boolean isPurchase(StockMove stockMove){ // boolean isPurchase; // Partner partner = stockMove.getPartner() ; diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/BudgetSupplychainService.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/BudgetSupplychainService.java index 15297e8..fa7444e 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/BudgetSupplychainService.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/BudgetSupplychainService.java @@ -181,12 +181,12 @@ public class BudgetSupplychainService extends BudgetService { boolean idbudgetDistExist = true; for (PurchaseOrderLine line : purchaseOrderLineList) { - if(line.getBudgetDistributionList() == null){ - idbudgetDistExist = false; + if (line.getBudgetDistributionList() == null) { + idbudgetDistExist = false; } } - if(idbudgetDistExist){ + if (idbudgetDistExist) { purchaseOrderLineList .stream() .flatMap(x -> x.getBudgetDistributionList().stream()) @@ -196,6 +196,6 @@ public class BudgetSupplychainService extends BudgetService { updateLines(budget); computeTotalAmountCommitted(budget); }); - } } + } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/ImportationFolderServiceImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/ImportationFolderServiceImpl.java index f0147eb..4f09304 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/ImportationFolderServiceImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/ImportationFolderServiceImpl.java @@ -1,5 +1,34 @@ package com.axelor.apps.supplychain.service; +import com.axelor.apps.account.db.Account; +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.TaxLine; +import com.axelor.apps.account.db.repo.AccountRepository; +import com.axelor.apps.account.db.repo.InvoiceLineRepository; +import com.axelor.apps.account.db.repo.InvoiceRepository; +import com.axelor.apps.account.db.repo.TaxLineRepository; +import com.axelor.apps.account.service.InvoiceTemplateService; +import com.axelor.apps.account.service.invoice.generator.InvoiceLineGenerator; +import com.axelor.apps.base.db.Product; +import com.axelor.apps.base.db.repo.ProductRepository; +import com.axelor.apps.purchase.db.ImportationFolder; +import com.axelor.apps.purchase.db.repo.ImportationFolderRepository; +import com.axelor.apps.stock.db.ImportationFolderCostPrice; +import com.axelor.apps.stock.db.StockLocation; +import com.axelor.apps.stock.db.StockMove; +import com.axelor.apps.stock.db.StockMoveLine; +import com.axelor.apps.stock.db.repo.ImportationFolderCostPriceRepository; +import com.axelor.apps.stock.db.repo.StockMoveLineRepository; +import com.axelor.apps.supplychain.service.invoice.generator.InvoiceLineGeneratorSupplyChain; +import com.axelor.auth.AuthUtils; +import com.axelor.exception.AxelorException; +import com.axelor.exception.db.repo.TraceBackRepository; +import com.axelor.i18n.I18n; +import com.axelor.inject.Beans; +import com.google.inject.Inject; +import com.google.inject.persist.Transactional; import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.math.RoundingMode; @@ -14,71 +43,23 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import com.axelor.apps.account.db.Account; -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.PaymentVoucher; -import com.axelor.apps.account.db.TaxLine; -import com.axelor.apps.account.db.repo.AccountRepository; -import com.axelor.apps.account.db.repo.InvoiceLineRepository; -import com.axelor.apps.account.db.repo.InvoiceRepository; -import com.axelor.apps.account.db.repo.PaymentVoucherRepository; -import com.axelor.apps.account.db.repo.TaxLineRepository; -import com.axelor.apps.account.service.InvoiceTemplateService; -import com.axelor.apps.account.service.invoice.InvoiceLineServiceImpl; -import com.axelor.apps.account.service.invoice.InvoiceServiceImpl; -import com.axelor.apps.account.service.invoice.generator.InvoiceLineGenerator; -import com.axelor.apps.account.service.payment.paymentvoucher.PaymentVoucherConfirmService; -import com.axelor.apps.base.db.Product; -import com.axelor.apps.base.db.Wizard; -import com.axelor.apps.base.db.repo.ProductRepository; -import com.axelor.apps.purchase.db.ImportationFolder; -import com.axelor.apps.purchase.db.PurchaseOrder; -import com.axelor.apps.stock.db.ImportationFolderCostPrice; -import com.axelor.apps.stock.db.StockLocation; -import com.axelor.apps.purchase.db.PurchaseOrderLine; -import com.axelor.apps.stock.db.repo.ImportationFolderCostPriceRepository; -import com.axelor.apps.purchase.db.repo.ImportationFolderRepository; -import com.axelor.apps.purchase.db.repo.PurchaseOrderLineRepository; -import com.axelor.apps.purchase.service.PurchaseOrderLineService; -import com.axelor.apps.purchase.service.PurchaseOrderService; -import com.axelor.apps.stock.db.StockMove; -import com.axelor.apps.stock.db.StockMoveLine; -import com.axelor.apps.stock.db.repo.StockMoveLineRepository; -import com.axelor.apps.supplychain.service.invoice.generator.InvoiceLineGeneratorSupplyChain; -import com.axelor.auth.AuthUtils; -import com.axelor.exception.AxelorException; -import com.axelor.exception.db.repo.TraceBackRepository; -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.inject.Inject; -import com.google.inject.persist.Transactional; - import wslite.json.JSONException; public class ImportationFolderServiceImpl { - @Inject protected ImportationFolderRepository importationFolderRepository; - private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @Inject protected ImportationFolderRepository importationFolderRepository; + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - @Transactional - public List calculateAvgPriceAndGenerateInvoice(List stockMoveLines, ImportationFolder importationFolder) + public List calculateAvgPriceAndGenerateInvoice( + List stockMoveLines, ImportationFolder importationFolder) throws MalformedURLException, JSONException, AxelorException { - + Set stockMovesSet = new HashSet<>(); - HashMap> stockMovesMap = new HashMap<>(); - + HashMap> stockMovesMap = new HashMap<>(); + for (StockMoveLine stockMoveLine : stockMoveLines) { stockMovesSet.add(stockMoveLine.getStockMove()); } @@ -92,349 +73,541 @@ public class ImportationFolderServiceImpl { .add(stockMove); } - stockMovesMap.forEach((ref, stockMoveList) -> { + stockMovesMap.forEach( + (ref, stockMoveList) -> { + // List stockMoveList = new ArrayList<>(stockMovesSet); + if (stockMoveList.size() > 0) { - // List stockMoveList = new ArrayList<>(stockMovesSet); - if(stockMoveList.size() > 0) { + Optional invoiceOpt; + try { + invoiceOpt = + Beans.get(StockMoveMultiInvoiceService.class) + .createInvoiceFromMultiIncomingStockMove(stockMoveList); - Optional invoiceOpt; - try { - invoiceOpt = Beans.get(StockMoveMultiInvoiceService.class).createInvoiceFromMultiIncomingStockMove(stockMoveList); - - Invoice invoice = invoiceOpt.get(); - Product product = Beans.get(ProductRepository.class).find(8931L); - BigDecimal freightPrice = importationFolder.getFreight(); - StockLocation stockLocation = importationFolder.getStockMoveLineList().get(0).getStockMove().getToStockLocation(); - TaxLine taxLine = null; - if(stockLocation.getId() == 61 || stockLocation.getId() == 60){ - taxLine = Beans.get(TaxLineRepository.class).find(27L); - }else{ - if(importationFolder.getStockMoveLineList().get(0).getPurchaseOrderLine() == null){ - throw new AxelorException( - importationFolder, - TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, - "Purchase order missing", - I18n.get(com.axelor.apps.base.exceptions.IExceptionMessage.EXCEPTION)); - } - - taxLine = importationFolder.getStockMoveLineList().get(0).getPurchaseOrderLine().getTaxLine(); - } - - - InvoiceLineGenerator invoiceLineGenerator = - new InvoiceLineGeneratorSupplyChain( - invoice, - product, - product.getName(), - freightPrice, - freightPrice, - freightPrice, - "", - BigDecimal.ONE, - product.getUnit(), - taxLine, - 100, - BigDecimal.ZERO, - 0, - freightPrice, - freightPrice, - false, - null, - null, - null, - false, - null) { - @Override - public List creates() throws AxelorException { - - InvoiceLine invoiceLine = this.createInvoiceLine(); - invoiceLine.setPrice(stockMoveList.get(0).getStockMoveLineList().get(0).getFreight()); - Long categoryId = importationFolder.getStockMoveLineList().get(0).getProduct().getFamilleProduit().getId(); - Account account = null; - switch (categoryId.intValue()) { - case 67: - account= Beans.get(AccountRepository.class).find(1430L); - break; - case 68: - account= Beans.get(AccountRepository.class).find(1430L); - break; - case 59: - account= Beans.get(AccountRepository.class).find(1431L); - break; - default: - account= Beans.get(AccountRepository.class).find(1431L); - break; + Invoice invoice = invoiceOpt.get(); + Product product = Beans.get(ProductRepository.class).find(8931L); + // BigDecimal freightPrice = importationFolder.getFreight(); + + BigDecimal freightPrice = + stockMoveLines + .stream() + .filter(line -> line.getStockMove() == stockMovesMap.get(ref).get(0)) + .findFirst() + .get() + .getFreight() + .setScale(2); + StockLocation stockLocation = + importationFolder + .getStockMoveLineList() + .get(0) + .getStockMove() + .getToStockLocation(); + TaxLine taxLine = null; + if (stockLocation.getId() == 86) { + // if (stockLocation.getId() == 61 || stockLocation.getId() == 60) { + taxLine = Beans.get(TaxLineRepository.class).find(27L); + } else { + if (importationFolder.getStockMoveLineList().get(0).getPurchaseOrderLine() + == null) { + throw new AxelorException( + importationFolder, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "Purchase order missing", + I18n.get(com.axelor.apps.base.exceptions.IExceptionMessage.EXCEPTION)); + } + + taxLine = + importationFolder + .getStockMoveLineList() + .get(0) + .getPurchaseOrderLine() + .getTaxLine(); + } + + InvoiceLineGenerator invoiceLineGenerator = + new InvoiceLineGeneratorSupplyChain( + invoice, + product, + product.getName(), + freightPrice, + freightPrice, + freightPrice, + "", + BigDecimal.ONE, + product.getUnit(), + taxLine, + 100, + BigDecimal.ZERO, + 0, + freightPrice, + freightPrice, + false, + null, + null, + null, + false, + null) { + @Override + public List creates() throws AxelorException { + + InvoiceLine invoiceLine = this.createInvoiceLine(); + invoiceLine.setPrice(freightPrice); + invoiceLine.setPriceDiscounted(freightPrice); + Long categoryId = + importationFolder + .getStockMoveLineList() + .get(0) + .getProduct() + .getFamilleProduit() + .getId(); + Account account = null; + switch (categoryId.intValue()) { + case 67: + account = Beans.get(AccountRepository.class).find(1430L); + break; + case 68: + account = Beans.get(AccountRepository.class).find(1430L); + break; + case 59: + account = Beans.get(AccountRepository.class).find(1431L); + break; + default: + account = Beans.get(AccountRepository.class).find(1431L); + break; + } + invoiceLine.setAccount(account); + List invoiceLines = new ArrayList(); + invoiceLines.add(invoiceLine); + + return invoiceLines; + } + }; + + List invoiceLines = invoiceLineGenerator.creates(); + invoice.addInvoiceLineListItem(invoiceLines.get(0)); + + logger.debug( + "invoice.getInvoiceLineList() ********** ", invoice.getInvoiceLineList()); + + BigDecimal inTaxTotal = BigDecimal.ZERO; + BigDecimal exTaxTotal = BigDecimal.ZERO; + BigDecimal taxTotal = BigDecimal.ZERO; + + for (InvoiceLine invoiceLine : invoice.getInvoiceLineList()) { + BigDecimal currencyRate = BigDecimal.ZERO; + // if(invoiceLine.getProduct().getId() == product.getId()){ + currencyRate = importationFolder.getStockMoveLineList().get(0).getCurrencyRate(); + // }else{ + // currencyRate = invoiceLine.getStockMoveLine().getCurrencyRate(); + // } + + inTaxTotal = + inTaxTotal.add( + invoiceLine + .getInTaxTotal() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + exTaxTotal = + exTaxTotal.add( + invoiceLine + .getExTaxTotal() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + taxTotal = taxTotal.add(inTaxTotal.subtract(exTaxTotal)); + + BigDecimal price = + (invoiceLine.getPrice().multiply(currencyRate)) + .setScale(2, RoundingMode.HALF_UP); + + invoiceLine.setPrice(price); + invoiceLine.setPriceDiscounted( + invoiceLine + .getPriceDiscounted() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + invoiceLine.setInTaxTotal( + invoiceLine + .getInTaxTotal() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + invoiceLine.setExTaxTotal( + invoiceLine + .getExTaxTotal() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + invoiceLine.setInTaxPrice( + invoiceLine + .getInTaxPrice() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + invoiceLine.setCompanyExTaxTotal( + invoiceLine + .getCompanyExTaxTotal() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + invoiceLine.setCompanyInTaxTotal( + invoiceLine + .getCompanyInTaxTotal() + .multiply(currencyRate) + .setScale(2, RoundingMode.HALF_UP)); + + Beans.get(InvoiceLineRepository.class).save(invoiceLine); + + logger.debug("currencyRate****** {}", currencyRate); + logger.debug("Invoice line in importation folder {}", invoiceLine.toString()); + } + + invoice.setInTaxTotal(inTaxTotal); + invoice.setExTaxTotal(exTaxTotal); + invoice.setCompanyExTaxTotal(exTaxTotal); + invoice.setCompanyInTaxTotal(inTaxTotal); + invoice.setAmountRemaining(inTaxTotal); + invoice.setCurrency(invoice.getCompany().getCurrency()); + invoice.setTaxTotal(taxTotal); + invoice.setImportationFolder(importationFolder); + invoice.setIsImportationPartnerInvoice(true); + + importationFolder.setInvoicedFolder(true); + + Invoice generatedInvoice = Beans.get(InvoiceRepository.class).save(invoice); + invoiceIds.add(generatedInvoice.getId()); + } catch (AxelorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - invoiceLine.setAccount(account); - List invoiceLines = new ArrayList(); - invoiceLines.add(invoiceLine); - - return invoiceLines; } - }; - - List invoiceLines = invoiceLineGenerator.creates(); - invoice.addInvoiceLineListItem(invoiceLines.get(0)); - - logger.debug("invoice.getInvoiceLineList() ********** ",invoice.getInvoiceLineList()); - - BigDecimal inTaxTotal = BigDecimal.ZERO; - BigDecimal exTaxTotal = BigDecimal.ZERO; - BigDecimal taxTotal = BigDecimal.ZERO; - - for (InvoiceLine invoiceLine : invoice.getInvoiceLineList()) { - BigDecimal currencyRate = BigDecimal.ZERO; - // if(invoiceLine.getProduct().getId() == product.getId()){ - currencyRate = importationFolder.getStockMoveLineList().get(0).getCurrencyRate(); - // }else{ - // currencyRate = invoiceLine.getStockMoveLine().getCurrencyRate(); - // } - - inTaxTotal = inTaxTotal.add(invoiceLine.getInTaxTotal().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - exTaxTotal = exTaxTotal.add(invoiceLine.getExTaxTotal().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - taxTotal = taxTotal.add(inTaxTotal.subtract(exTaxTotal)); - - BigDecimal price = (invoiceLine.getPrice().multiply(currencyRate)).setScale(2,RoundingMode.HALF_UP); - - invoiceLine.setPrice(price); - invoiceLine.setPriceDiscounted(invoiceLine.getPriceDiscounted().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - invoiceLine.setInTaxTotal(invoiceLine.getInTaxTotal().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - invoiceLine.setExTaxTotal(invoiceLine.getExTaxTotal().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - invoiceLine.setInTaxPrice(invoiceLine.getInTaxPrice().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - invoiceLine.setCompanyExTaxTotal(invoiceLine.getCompanyExTaxTotal().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - invoiceLine.setCompanyInTaxTotal(invoiceLine.getCompanyInTaxTotal().multiply(currencyRate).setScale(2,RoundingMode.HALF_UP)); - - Beans.get(InvoiceLineRepository.class).save(invoiceLine); - - logger.debug("currencyRate****** {}",currencyRate); - logger.debug("Invoice line in importation folder {}",invoiceLine.toString()); - - } - - invoice.setInTaxTotal(inTaxTotal); - invoice.setExTaxTotal(exTaxTotal); - invoice.setCompanyExTaxTotal(exTaxTotal); - invoice.setCompanyInTaxTotal(inTaxTotal); - invoice.setAmountRemaining(inTaxTotal); - invoice.setCurrency(invoice.getCompany().getCurrency()); - invoice.setTaxTotal(taxTotal); - invoice.setImportationFolder(importationFolder); - invoice.setIsImportationPartnerInvoice(true); - - importationFolder.setInvoicedFolder(true); - - Invoice generatedInvoice = Beans.get(InvoiceRepository.class).save(invoice); - invoiceIds.add(generatedInvoice.getId()); - } catch (AxelorException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - }); - - + }); return invoiceIds; - } - public String computeCostPrice(ImportationFolder importationFolder) { List stockMoveLines = importationFolder.getStockMoveLineList(); String message = ""; BigDecimal costPrice = BigDecimal.ZERO; Set productSet = new HashSet<>(); - + // int scale = Beans.get(AppBaseService.class).getNbDecimalDigitForUnitPrice(); + int scale = 20; for (StockMoveLine line : stockMoveLines) { - productSet.add(line.getProduct()); + productSet.add(line.getProduct()); } - - + this.resetCostPriceList(importationFolder); - if(productSet.size() > 1) { - List supplierInvoices = importationFolder.getInvoices().stream().filter(t -> t.getIsImportationPartnerInvoice()).collect(Collectors.toList()); - // BigDecimal totalQty = stockMoveLines.stream().map(StockMoveLine::getRealQty).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal totalNetMass = stockMoveLines.stream().map(StockMoveLine::getNetMass).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal totalVolume = stockMoveLines.stream().map(StockMoveLine::getVolume).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal freight = importationFolder.getFreight().multiply(stockMoveLines.get(0).getCurrencyRate()).setScale(2,RoundingMode.HALF_EVEN); - - Map splitting = new HashMap<>(); - Map splittingQty = new HashMap<>(); + if (productSet.size() > 1) { + List supplierInvoices = + importationFolder + .getInvoices() + .stream() + .filter(t -> t.getIsImportationPartnerInvoice()) + .collect(Collectors.toList()); + // BigDecimal totalQty = + // stockMoveLines.stream().map(StockMoveLine::getRealQty).reduce(BigDecimal.ZERO, + // BigDecimal::add); + BigDecimal totalNetMass = + stockMoveLines + .stream() + .map(StockMoveLine::getNetMass) + .reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal totalVolume = + stockMoveLines + .stream() + .map(StockMoveLine::getVolume) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + BigDecimal freight = BigDecimal.ZERO; + + Set stockMovesSet = new HashSet<>(); + HashMap> stockMovesMap = new HashMap<>(); + + for (StockMoveLine stockMoveLine : stockMoveLines) { + stockMovesSet.add(stockMoveLine.getStockMove()); + } + + for (StockMove stockMove : stockMovesSet) { + stockMovesMap + .computeIfAbsent(stockMove.getSupplierShipmentRef(), k -> new ArrayList<>()) + .add(stockMove); + } + + freight = + new BigDecimal( + stockMovesMap + .values() + .stream() + .filter(t -> + t.get(0) + .getStockMoveLineList() + .stream() + .filter(line -> line.getRealQty() != null && line.getRealQty().compareTo(BigDecimal.ZERO) > 0) + .findFirst() + .isPresent()) + .mapToDouble(t -> + t.get(0) + .getStockMoveLineList() + .stream() + .filter(line -> line.getRealQty() != null && line.getRealQty().compareTo(BigDecimal.ZERO) > 0) + .findFirst() + .map(line -> line.getFreight() + .multiply(stockMoveLines.get(0).getCurrencyRate()) + .setScale(2, RoundingMode.HALF_EVEN) + .doubleValue()) + .orElse(0.0)) // In case no valid line found, fallback to 0.0 + .sum()); + + + System.out.println("*****************freight**************************************"); + System.out.println(freight); + System.out.println("*******************************************************"); + + Map splitting = new HashMap<>(); + Map splittingQty = new HashMap<>(); List invoiceLines = new ArrayList<>(); BigDecimal totalInvoiceWithoutFreight = BigDecimal.ZERO; BigDecimal totalQty = BigDecimal.ZERO; - + for (Invoice supplierInvoice : supplierInvoices) { BigDecimal freightInvoice = BigDecimal.ZERO; - Optional invoiceLine = supplierInvoice.getInvoiceLineList().stream().filter(t -> t.getProduct().getId() == 8931L).findAny(); - if(invoiceLine.isPresent()){ - freightInvoice = invoiceLine.get().getInTaxTotal(); - } - BigDecimal invoiceWithoutFreight = supplierInvoice.getInTaxTotal().subtract(freightInvoice).setScale(2, RoundingMode.HALF_EVEN); - totalInvoiceWithoutFreight = totalInvoiceWithoutFreight.add(invoiceWithoutFreight); - invoiceLines.addAll(supplierInvoice.getInvoiceLineList()); - // total qty without freight qty = 1 + Optional invoiceLine = + supplierInvoice + .getInvoiceLineList() + .stream() + .filter(t -> t.getProduct().getId() == 8931L) + .findAny(); + if (invoiceLine.isPresent()) { + freightInvoice = invoiceLine.get().getInTaxTotal(); + } + BigDecimal invoiceWithoutFreight = + supplierInvoice + .getInTaxTotal() + .subtract(freightInvoice) + .setScale(2, RoundingMode.HALF_EVEN); + totalInvoiceWithoutFreight = totalInvoiceWithoutFreight.add(invoiceWithoutFreight); + invoiceLines.addAll(supplierInvoice.getInvoiceLineList()); + // total qty without freight qty = 1 } - totalQty =invoiceLines.stream().filter(t -> t.getProduct().getId() != 8931L).map(InvoiceLine::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); - splittingQty = invoiceLines.stream().collect( - Collectors.groupingBy( - t -> t.getProduct(), - Collectors.summingDouble(o -> o.getQty().doubleValue()))); - if(importationFolder.getValorisation() == 1){ - splitting = invoiceLines.stream().collect( - Collectors.groupingBy( - t -> t.getProduct(), - Collectors.summingDouble(o -> o.getInTaxTotal().doubleValue()))); - }else if(importationFolder.getValorisation() == 2){ - splitting = invoiceLines.stream().collect( - Collectors.groupingBy( - t -> t.getProduct(), - Collectors.summingDouble(o -> o.getQty().doubleValue()))); - }else if(importationFolder.getValorisation() == 3){ - splitting = stockMoveLines.stream().collect( - Collectors.groupingBy( - t -> t.getProduct(), - Collectors.summingDouble(o -> o.getNetMass().doubleValue()))); + totalQty = + invoiceLines + .stream() + .filter(t -> t.getProduct().getId() != 8931L) + .map(InvoiceLine::getQty) + .reduce(BigDecimal.ZERO, BigDecimal::add); + splittingQty = + invoiceLines + .stream() + .collect( + Collectors.groupingBy( + t -> t.getProduct(), + Collectors.summingDouble(o -> o.getQty().doubleValue()))); - }else if(importationFolder.getValorisation() == 4){ - splitting = stockMoveLines.stream().collect( - Collectors.groupingBy( - t -> t.getProduct(), - Collectors.summingDouble(o -> o.getVolume().doubleValue()))); - } - - List invoices = importationFolder.getInvoices().stream().filter(t -> !t.getIsImportationPartnerInvoice()).collect(Collectors.toList()); - BigDecimal totalApproachs = invoices.stream().map(Invoice::getInTaxTotal).reduce(BigDecimal.ZERO, BigDecimal::add); - - - for (Product product : productSet) { - Stream invoiceLineStream = invoiceLines.stream().filter(t -> t.getProduct() == product); - - BigDecimal productQty = new BigDecimal(splitting.get(product)); - BigDecimal productQty2 = new BigDecimal(splittingQty.get(product)); - BigDecimal freightSplit = BigDecimal.ZERO; - // BigDecimal freightPerInvoiceForProduct= invoiceLineStream.findFirst().get().getInvoice().getInvoiceLineList().stream().filter(t -> t.getProduct().getId() == 8931L).findFirst().get().getInTaxTotal(); - - // total per product - BigDecimal totalInvoiceProduct = invoiceLineStream.map(InvoiceLine::getInTaxTotal).reduce(BigDecimal.ZERO, BigDecimal::add); + if (importationFolder.getValorisation() == 1) { + splitting = + invoiceLines + .stream() + .collect( + Collectors.groupingBy( + t -> t.getProduct(), + Collectors.summingDouble(o -> o.getInTaxTotal().doubleValue()))); + } else if (importationFolder.getValorisation() == 2) { + splitting = + invoiceLines + .stream() + .collect( + Collectors.groupingBy( + t -> t.getProduct(), + Collectors.summingDouble(o -> o.getQty().doubleValue()))); + } else if (importationFolder.getValorisation() == 3) { + splitting = + stockMoveLines + .stream() + .collect( + Collectors.groupingBy( + t -> t.getProduct(), + Collectors.summingDouble(o -> o.getNetMass().doubleValue()))); - BigDecimal percent = BigDecimal.ZERO; + } else if (importationFolder.getValorisation() == 4) { + splitting = + stockMoveLines + .stream() + .collect( + Collectors.groupingBy( + t -> t.getProduct(), + Collectors.summingDouble(o -> o.getVolume().doubleValue()))); + } - if(totalInvoiceWithoutFreight.compareTo(BigDecimal.ZERO) == 0){ - percent = productQty.divide(totalQty,10,RoundingMode.HALF_EVEN); - }else{ - switch (importationFolder.getValorisation()) { - case 1: - percent = totalInvoiceProduct.divide(totalInvoiceWithoutFreight,10,RoundingMode.HALF_EVEN); - break; - case 2: - percent = productQty.divide(totalQty,2,RoundingMode.HALF_EVEN); - break; - case 3: - percent = productQty.divide(totalNetMass,2,RoundingMode.HALF_EVEN); - break; - case 4: - percent = productQty.divide(totalVolume,2,RoundingMode.HALF_EVEN); - break; - default: - break; - } + List invoices = + importationFolder + .getInvoices() + .stream() + .filter(t -> !t.getIsImportationPartnerInvoice()) + .collect(Collectors.toList()); + BigDecimal totalApproachs = + invoices.stream().map(Invoice::getInTaxTotal).reduce(BigDecimal.ZERO, BigDecimal::add); + + for (Product product : productSet) { + Stream invoiceLineStream = + invoiceLines.stream().filter(t -> t.getProduct() == product); + + BigDecimal productQty = new BigDecimal(splitting.get(product)); + BigDecimal productQty2 = new BigDecimal(splittingQty.get(product)); + BigDecimal freightSplit = BigDecimal.ZERO; + // BigDecimal freightPerInvoiceForProduct= + // invoiceLineStream.findFirst().get().getInvoice().getInvoiceLineList().stream().filter(t + // -> t.getProduct().getId() == 8931L).findFirst().get().getInTaxTotal(); + + // total per product + BigDecimal totalInvoiceProduct = + invoiceLineStream + .map(InvoiceLine::getInTaxTotal) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + BigDecimal percent = BigDecimal.ZERO; + + if (totalInvoiceWithoutFreight.compareTo(BigDecimal.ZERO) == 0) { + percent = productQty.divide(totalQty, scale, RoundingMode.HALF_EVEN); + } else { + switch (importationFolder.getValorisation()) { + case 1: + percent = + totalInvoiceProduct.divide( + totalInvoiceWithoutFreight, scale, RoundingMode.HALF_EVEN); + break; + case 2: + percent = productQty.divide(totalQty, scale, RoundingMode.HALF_EVEN); + break; + case 3: + percent = productQty.divide(totalNetMass, scale, RoundingMode.HALF_EVEN); + break; + case 4: + percent = productQty.divide(totalVolume, scale, RoundingMode.HALF_EVEN); + break; + default: + break; } - - freightSplit = freight.multiply(percent).setScale(2, RoundingMode.HALF_EVEN); - - BigDecimal totalApproachsPerProduct = totalApproachs.multiply(percent).setScale(2, RoundingMode.HALF_EVEN); - - BigDecimal allPerProduct = totalApproachsPerProduct.add(totalInvoiceProduct).add(freightSplit); - - System.out.println("---------------------------------------------------------------------"); - System.out.println("allPerProduct *************"+allPerProduct.toString()); - System.out.println("totalApproachsPerProduct *************"+totalApproachsPerProduct.toString()); - System.out.println("totalInvoiceProduct *************"+totalInvoiceProduct.toString()); - System.out.println("freightSplit *************"+freightSplit.toString()); - System.out.println("productQty2 *************"+productQty2.toString()); - System.out.println("---------------------------------------------------------------------"); - - costPrice = allPerProduct.divide(productQty2,10, RoundingMode.HALF_EVEN); - - message += "Cost price of " + product.getName() + " is " + costPrice + " || "; - - List lines = stockMoveLines.stream().filter(t -> t.getProduct() == product).collect(Collectors.toList()); - for (StockMoveLine line : lines) { - this.computeCostPriceAndPersist(importationFolder, line, freightSplit,percent, totalInvoiceProduct,totalInvoiceProduct,costPrice); - } - } - }else{ - List invoices = importationFolder.getInvoices(); - BigDecimal inTaxTotal = invoices.stream().map(Invoice::getInTaxTotal).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2,RoundingMode.HALF_UP); - BigDecimal totalQty = stockMoveLines.stream().map(StockMoveLine::getRealQty).reduce(BigDecimal.ZERO, BigDecimal::add); + freightSplit = freight.multiply(percent).setScale(scale, RoundingMode.HALF_EVEN); + + BigDecimal totalApproachsPerProduct = + totalApproachs.multiply(percent).setScale(scale, RoundingMode.HALF_EVEN); + + BigDecimal allPerProduct = + totalApproachsPerProduct.add(totalInvoiceProduct).add(freightSplit); + + costPrice = allPerProduct.divide(productQty2, scale, RoundingMode.HALF_EVEN); + + message += "Cost price of " + product.getName() + " is " + costPrice + " || "; + + List lines = + stockMoveLines + .stream() + .filter(t -> t.getProduct() == product) + .collect(Collectors.toList()); + for (StockMoveLine line : lines) { + this.computeCostPriceAndPersist( + importationFolder, + line, + freightSplit, + percent, + totalApproachsPerProduct, + totalInvoiceProduct, + costPrice); + } + } + } else { + + List invoices = importationFolder.getInvoices(); + BigDecimal percent = BigDecimal.ZERO; + BigDecimal inTaxTotal = + invoices + .stream() + .map(Invoice::getInTaxTotal) + .reduce(BigDecimal.ZERO, BigDecimal::add) + .setScale(scale, RoundingMode.HALF_UP); + BigDecimal totalQty = + stockMoveLines + .stream() + .map(StockMoveLine::getRealQty) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + costPrice = inTaxTotal.divide(totalQty, scale, RoundingMode.HALF_UP); - costPrice = inTaxTotal.divide(totalQty,10, RoundingMode.HALF_UP); - // this.resetCostPriceList(importationFolder); for (StockMoveLine stockMoveLine : stockMoveLines) { - this.computeCostPriceAndPersist(importationFolder, stockMoveLine,null,null,null,null, costPrice); + this.computeCostPriceAndPersist( + importationFolder, + stockMoveLine, + BigDecimal.ZERO, + BigDecimal.ONE, + BigDecimal.ZERO, + BigDecimal.ZERO, + costPrice); } message = "CostPrice is : " + costPrice.toString(); - - } + } return message; } - @Transactional - public void setStockMoveLineCurrenyRate(List stockMoveLineList, BigDecimal currencyRate) { - for (StockMoveLine stockMoveLine : stockMoveLineList) { - stockMoveLine.setCurrencyRate(currencyRate); - Beans.get(StockMoveLineRepository.class).save(stockMoveLine); - } + public void setStockMoveLineCurrenyRate( + List stockMoveLineList, BigDecimal currencyRate) { + for (StockMoveLine stockMoveLine : stockMoveLineList) { + stockMoveLine.setCurrencyRate(currencyRate); + Beans.get(StockMoveLineRepository.class).save(stockMoveLine); + } } @Transactional public void setStockMoveLineFreight(List stockMoveLineList, BigDecimal freight) { - for (StockMoveLine stockMoveLine : stockMoveLineList) { - stockMoveLine.setFreight(freight); - Beans.get(StockMoveLineRepository.class).save(stockMoveLine); - } + for (StockMoveLine stockMoveLine : stockMoveLineList) { + stockMoveLine.setFreight(freight); + Beans.get(StockMoveLineRepository.class).save(stockMoveLine); + } } @Transactional - public void resetCostPriceList(ImportationFolder importationFolder){ + public void resetCostPriceList(ImportationFolder importationFolder) { importationFolder.getImportationFolderCostPriceList().clear(); } @Transactional - public void computeCostPriceAndPersist(ImportationFolder importationFolder,StockMoveLine stockMoveLine,BigDecimal freightSplit,BigDecimal precent,BigDecimal totalApproachsPerProduct,BigDecimal totalInvoiceProduct,BigDecimal costPrice) { + public void computeCostPriceAndPersist( + ImportationFolder importationFolder, + StockMoveLine stockMoveLine, + BigDecimal freightSplit, + BigDecimal precent, + BigDecimal totalApproachsPerProduct, + BigDecimal totalInvoiceProduct, + BigDecimal costPrice) { ImportationFolderCostPrice importationFolderCostPrice = new ImportationFolderCostPrice(); importationFolderCostPrice.setImportationFolder(importationFolder); importationFolderCostPrice.setStockMoveLine(stockMoveLine); - importationFolderCostPrice.setCostPrice(costPrice); + importationFolderCostPrice.setCostPrice(costPrice.setScale(4, RoundingMode.HALF_EVEN)); importationFolderCostPrice.setValorisation(importationFolder.getValorisation()); - importationFolderCostPrice.setPercent(precent); - importationFolderCostPrice.setFreightSplit(freightSplit); - importationFolderCostPrice.setTotalApproach(totalApproachsPerProduct); - importationFolderCostPrice.setTotalInvoice(totalInvoiceProduct); + importationFolderCostPrice.setPercent( + precent.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN)); + importationFolderCostPrice.setFreightSplit(freightSplit.setScale(2, RoundingMode.HALF_EVEN)); + importationFolderCostPrice.setTotalApproach( + totalApproachsPerProduct.setScale(2, RoundingMode.HALF_EVEN)); + importationFolderCostPrice.setTotalInvoice( + totalInvoiceProduct.setScale(2, RoundingMode.HALF_EVEN)); importationFolderCostPrice.setProduct(stockMoveLine.getProduct()); importationFolder.addImportationFolderCostPriceListItem(importationFolderCostPrice); importationFolderRepository.save(importationFolder); } - // public void valisateCostPrice(ActionRequest request, ActionResponse response) { @Transactional public void validateCostPrice(ImportationFolderCostPrice importationFolderCostPrice) { - ImportationFolderCostPriceRepository importationFolderCostPriceRepository = Beans.get(ImportationFolderCostPriceRepository.class); + ImportationFolderCostPriceRepository importationFolderCostPriceRepository = + Beans.get(ImportationFolderCostPriceRepository.class); StockMove stockMove = importationFolderCostPrice.getStockMoveLine().getStockMove(); Long productId = importationFolderCostPrice.getProduct().getId(); @@ -443,9 +616,12 @@ public class ImportationFolderServiceImpl { BigDecimal costPrice = importationFolderCostPrice.getCostPrice(); try { - Beans.get(StockMoveLineServiceSupplychainImpl.class).resetValorization(productId, stockMoveId, toDate,false); - Beans.get(StockMoveLineServiceSupplychainImpl.class).fillStockMoveLines(productId, toDate, stockMoveId,false); - Beans.get(StockMoveLineServiceSupplychainImpl.class).valorize(productId, stockMoveId, toDate, costPrice,false,false); + Beans.get(StockMoveLineServiceSupplychainImpl.class) + .resetValorization(productId, stockMoveId, toDate, false); + Beans.get(StockMoveLineServiceSupplychainImpl.class) + .fillStockMoveLines(productId, toDate, stockMoveId, false); + Beans.get(StockMoveLineServiceSupplychainImpl.class) + .valorize(productId, stockMoveId, toDate, costPrice, false, false); importationFolderCostPrice.setStatusSelect(2); importationFolderCostPrice.setValidationDate(LocalDate.now()); importationFolderCostPriceRepository.save(importationFolderCostPrice); @@ -455,7 +631,6 @@ public class ImportationFolderServiceImpl { } } - @Transactional public void setStockMoveLineNetMass(List stockMoveLineList, BigDecimal netMass) { for (StockMoveLine stockMoveLine : stockMoveLineList) { @@ -474,22 +649,22 @@ public class ImportationFolderServiceImpl { @Transactional public void rejectImportationFolder(ImportationFolder importationFolder, String rejectionRaison) { - + importationFolder.setStatusSelect(ImportationFolderRepository.STATUS_REJECTED); importationFolder.setRejectionRaison(rejectionRaison); importationFolder.setRejectedDate(LocalDate.now()); importationFolder.setRejectedByUser(AuthUtils.getUser()); importationFolder.setRejectedInstanceSelect(1); importationFolderRepository.save(importationFolder); - } @Transactional - public Invoice generateFromModel(ImportationFolder importationFolder,InvoiceTemplate invoiceTemplate) throws AxelorException{ - Invoice invoice = Beans.get(InvoiceTemplateService.class).generateInvoiceFromTemplate(invoiceTemplate); + public Invoice generateFromModel( + ImportationFolder importationFolder, InvoiceTemplate invoiceTemplate) throws AxelorException { + Invoice invoice = + Beans.get(InvoiceTemplateService.class).generateInvoiceFromTemplate(invoiceTemplate); invoice.setImportationFolder(importationFolder); invoice.setIsInvoiceApproach(true); return Beans.get(InvoiceRepository.class).save(invoice); } } - diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/MrpServiceImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/MrpServiceImpl.java index 31bcdda..784873b 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/MrpServiceImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/MrpServiceImpl.java @@ -17,14 +17,12 @@ */ package com.axelor.apps.supplychain.service; -import com.axelor.apps.base.db.ABCAnalysis; import com.axelor.apps.base.db.ABCAnalysisLine; 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.db.Unit; import com.axelor.apps.base.db.repo.ABCAnalysisLineRepository; -import com.axelor.apps.base.db.repo.ABCAnalysisRepository; import com.axelor.apps.base.db.repo.ProductRepository; import com.axelor.apps.base.service.UnitConversionService; import com.axelor.apps.base.service.app.AppBaseService; @@ -80,15 +78,12 @@ import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; -import java.time.Month; -import java.time.format.TextStyle; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -122,7 +117,6 @@ public class MrpServiceImpl implements MrpService { protected LocalDate today; public List mrpForecastListAll; - @Inject public MrpServiceImpl( AppBaseService appBaseService, @@ -197,9 +191,18 @@ public class MrpServiceImpl implements MrpService { public void resetSophalLine(Mrp mrp) { Beans.get(MrpLineSophalRepository.class).all().filter("self.mrp.id = ?1", mrp.getId()).remove(); - Beans.get(MrpLineSaleAndMarginRepository.class).all().filter("self.mrp.id = ?1", mrp.getId()).remove(); - Beans.get(SalesMasterPlanRepository.class).all().filter("self.mrp.id = ?1", mrp.getId()).remove(); - Beans.get(ProductionMasterPlanRepository.class).all().filter("self.mrp.id = ?1", mrp.getId()).remove(); + Beans.get(MrpLineSaleAndMarginRepository.class) + .all() + .filter("self.mrp.id = ?1", mrp.getId()) + .remove(); + Beans.get(SalesMasterPlanRepository.class) + .all() + .filter("self.mrp.id = ?1", mrp.getId()) + .remove(); + Beans.get(ProductionMasterPlanRepository.class) + .all() + .filter("self.mrp.id = ?1", mrp.getId()) + .remove(); mrp.setStatusSelect(MrpRepository.STATUS_DRAFT); @@ -1196,18 +1199,17 @@ public class MrpServiceImpl implements MrpService { .order("monthSelect") .fetch()); - mrpForecastListAll = new ArrayList<>(); + mrpForecastListAll = new ArrayList<>(); - - mrpForecastListAll.addAll( mrpForecastRepository + mrpForecastListAll.addAll( + mrpForecastRepository .all() .filter( "self.product.id in (?1) AND self.stockLocation in (?2) AND self.statusSelect = ?3 AND self.forecastDate < ?4", this.productMap.keySet(), slList2.stream().collect(Collectors.toList()), MrpForecastRepository.STATUS_CONFIRMED, - LocalDate.parse(String.valueOf(LocalDate.now().getYear())+"-01-01") - ) + LocalDate.parse(String.valueOf(LocalDate.now().getYear()) + "-01-01")) .order("monthSelect") .fetch()); @@ -1219,11 +1221,8 @@ public class MrpServiceImpl implements MrpService { BigDecimal qty = new BigDecimal(entry.getValue()); if (this.productMap.get(product.getId()) == 0) { this.createMrpLineSophal(mrp, product, product.getUnit(), qty, mrpForecastList, productQty); - } } - - } @Transactional @@ -1240,8 +1239,8 @@ public class MrpServiceImpl implements MrpService { mrpLineSophal.setQty(qty); BigDecimal reelQty = qty; BigDecimal sumQty = BigDecimal.ZERO; - Collections.sort(mrpForecastList, Comparator.comparingInt(MrpForecast ::getMonthSelect)); - for (MrpForecast forecast : mrpForecastList){ + Collections.sort(mrpForecastList, Comparator.comparingInt(MrpForecast::getMonthSelect)); + for (MrpForecast forecast : mrpForecastList) { if (forecast.getProduct() == product) { reelQty = reelQty.subtract(forecast.getQty()); BigDecimal displayedQty = reelQty; @@ -1298,248 +1297,273 @@ public class MrpServiceImpl implements MrpService { Beans.get(MrpLineSophalRepository.class).save(mrpLineSophal); } - @Transactional public void createMargeAndSaleLineSophal( - Mrp mrp, - Product product, - List mrpForecastList, - BigDecimal qty - ) + Mrp mrp, Product product, List mrpForecastList, BigDecimal qty) throws AxelorException { - MrpLineSaleAndMargin mrpLineSaleAndMargin = new MrpLineSaleAndMargin(); + MrpLineSaleAndMargin mrpLineSaleAndMargin = new MrpLineSaleAndMargin(); - ArrayList lastThreeMonths = new ArrayList<>(); - lastThreeMonths.add(10); - lastThreeMonths.add(11); - lastThreeMonths.add(12); - BigDecimal totalLastThree = BigDecimal.ZERO; - BigDecimal avgLastThree = BigDecimal.ZERO; - + ArrayList lastThreeMonths = new ArrayList<>(); + lastThreeMonths.add(10); + lastThreeMonths.add(11); + lastThreeMonths.add(12); + BigDecimal totalLastThree = BigDecimal.ZERO; + BigDecimal avgLastThree = BigDecimal.ZERO; - totalLastThree = mrpForecastList.stream().filter(t -> (t.getForecastDate().getYear() == (LocalDate.now().getYear() - 1)) && (t.getProduct().getId() == product.getId()) && lastThreeMonths.contains(t.getMonthSelect())).map(MrpForecast::getQty) - .reduce(BigDecimal.ZERO, BigDecimal::add); + totalLastThree = + mrpForecastList + .stream() + .filter( + t -> + (t.getForecastDate().getYear() == (LocalDate.now().getYear() - 1)) + && (t.getProduct().getId() == product.getId()) + && lastThreeMonths.contains(t.getMonthSelect())) + .map(MrpForecast::getQty) + .reduce(BigDecimal.ZERO, BigDecimal::add); + avgLastThree = totalLastThree.divide(new BigDecimal("3"), 2, RoundingMode.HALF_UP); - avgLastThree = totalLastThree.divide(new BigDecimal("3"),2,RoundingMode.HALF_UP); + log.debug("******* mrpForecastList {}", mrpForecastList); + log.debug("******* lastThreeMonths {}", lastThreeMonths); + log.debug("******* totalLastThree {}", totalLastThree); + log.debug("******* avgLastThree {}", avgLastThree); - log.debug("******* mrpForecastList {}",mrpForecastList); - log.debug("******* lastThreeMonths {}",lastThreeMonths); - log.debug("******* totalLastThree {}",totalLastThree); - log.debug("******* avgLastThree {}",avgLastThree); - - BigDecimal maxJan = getMaxOfMonth(1, product, mrpForecastList); - BigDecimal maxFeb = getMaxOfMonth(2, product, mrpForecastList); - BigDecimal maxMar = getMaxOfMonth(3, product, mrpForecastList); - BigDecimal maxApril = getMaxOfMonth(4, product, mrpForecastList); - BigDecimal maxMay = getMaxOfMonth(5, product, mrpForecastList); - BigDecimal maxJune = getMaxOfMonth(6, product, mrpForecastList); - BigDecimal maxJuly = getMaxOfMonth(7, product, mrpForecastList); - BigDecimal maxAugust = getMaxOfMonth(8, product, mrpForecastList); - BigDecimal maxSep = getMaxOfMonth(9, product, mrpForecastList); - BigDecimal maxOct = getMaxOfMonth(10, product, mrpForecastList); - BigDecimal maxNov = getMaxOfMonth(11, product, mrpForecastList); - BigDecimal maxDec = getMaxOfMonth(12, product, mrpForecastList); - - BigDecimal maxFirstQuarter = maxJan.add(maxFeb).add(maxMar).divide(new BigDecimal("3"), RoundingMode.HALF_UP); - BigDecimal maxSecQuarter = maxJune.add(maxApril).add(maxMay).divide(new BigDecimal("3"), RoundingMode.HALF_UP); - BigDecimal maxthirdQuarter = maxSep.add(maxJuly).add(maxAugust).divide(new BigDecimal("3"), RoundingMode.HALF_UP); - BigDecimal maxforthQuarter = maxOct.add(maxNov).add(maxDec).divide(new BigDecimal("3"), RoundingMode.HALF_UP); + BigDecimal maxJan = getMaxOfMonth(1, product, mrpForecastList); + BigDecimal maxFeb = getMaxOfMonth(2, product, mrpForecastList); + BigDecimal maxMar = getMaxOfMonth(3, product, mrpForecastList); + BigDecimal maxApril = getMaxOfMonth(4, product, mrpForecastList); + BigDecimal maxMay = getMaxOfMonth(5, product, mrpForecastList); + BigDecimal maxJune = getMaxOfMonth(6, product, mrpForecastList); + BigDecimal maxJuly = getMaxOfMonth(7, product, mrpForecastList); + BigDecimal maxAugust = getMaxOfMonth(8, product, mrpForecastList); + BigDecimal maxSep = getMaxOfMonth(9, product, mrpForecastList); + BigDecimal maxOct = getMaxOfMonth(10, product, mrpForecastList); + BigDecimal maxNov = getMaxOfMonth(11, product, mrpForecastList); + BigDecimal maxDec = getMaxOfMonth(12, product, mrpForecastList); - - if(maxFirstQuarter.compareTo(avgLastThree) > 0){ - mrpLineSaleAndMargin.setFirstQuarterMax(maxFirstQuarter); - }else{ - maxFirstQuarter = avgLastThree; - mrpLineSaleAndMargin.setFirstQuarterMax(maxFirstQuarter); - } + BigDecimal maxFirstQuarter = + maxJan.add(maxFeb).add(maxMar).divide(new BigDecimal("3"), RoundingMode.HALF_UP); + BigDecimal maxSecQuarter = + maxJune.add(maxApril).add(maxMay).divide(new BigDecimal("3"), RoundingMode.HALF_UP); + BigDecimal maxthirdQuarter = + maxSep.add(maxJuly).add(maxAugust).divide(new BigDecimal("3"), RoundingMode.HALF_UP); + BigDecimal maxforthQuarter = + maxOct.add(maxNov).add(maxDec).divide(new BigDecimal("3"), RoundingMode.HALF_UP); + if (maxFirstQuarter.compareTo(avgLastThree) > 0) { + mrpLineSaleAndMargin.setFirstQuarterMax(maxFirstQuarter); + } else { + maxFirstQuarter = avgLastThree; + mrpLineSaleAndMargin.setFirstQuarterMax(maxFirstQuarter); + } - mrpLineSaleAndMargin.setSecondQuarterMax(maxSecQuarter); - mrpLineSaleAndMargin.setThirdQuarterMax(maxthirdQuarter); - mrpLineSaleAndMargin.setForthQuarterMax(maxforthQuarter); + mrpLineSaleAndMargin.setSecondQuarterMax(maxSecQuarter); + mrpLineSaleAndMargin.setThirdQuarterMax(maxthirdQuarter); + mrpLineSaleAndMargin.setForthQuarterMax(maxforthQuarter); - String className = ""; - List abcAnalysisLines = Beans.get(ABCAnalysisLineRepository.class).all().fetch(); - ABCAnalysisLine abcAnalysisLine = abcAnalysisLines.stream().filter(t -> t.getProduct() == product).findFirst().get(); - if(abcAnalysisLine == null) { - throw new AxelorException( - mrp, - TraceBackRepository.CATEGORY_NO_VALUE, - "ABC classification needed"); - }else{ - className = abcAnalysisLine.getAbcAnalysisClass().getName(); - } + String className = ""; + List abcAnalysisLines = + Beans.get(ABCAnalysisLineRepository.class).all().fetch(); + ABCAnalysisLine abcAnalysisLine = + abcAnalysisLines.stream().filter(t -> t.getProduct() == product).findFirst().get(); + if (abcAnalysisLine == null) { + throw new AxelorException( + mrp, TraceBackRepository.CATEGORY_NO_VALUE, "ABC classification needed"); + } else { + className = abcAnalysisLine.getAbcAnalysisClass().getName(); + } - - BigDecimal firstQuarterMargin = BigDecimal.ZERO; - BigDecimal secondQuarterMargin = BigDecimal.ZERO; - BigDecimal thirdQuarterMargin = BigDecimal.ZERO; - BigDecimal fourthQuarterMargin = BigDecimal.ZERO; + BigDecimal firstQuarterMargin = BigDecimal.ZERO; + BigDecimal secondQuarterMargin = BigDecimal.ZERO; + BigDecimal thirdQuarterMargin = BigDecimal.ZERO; + BigDecimal fourthQuarterMargin = BigDecimal.ZERO; - switch (className) { - case "A": - firstQuarterMargin = maxFirstQuarter.add(maxFirstQuarter.multiply(new BigDecimal("0.15"))); - secondQuarterMargin = maxSecQuarter.add(maxSecQuarter.multiply(new BigDecimal("0.20"))) ; - thirdQuarterMargin = maxthirdQuarter.add(maxthirdQuarter.multiply(new BigDecimal("0.15"))); - fourthQuarterMargin = maxforthQuarter.add(maxforthQuarter.multiply(new BigDecimal("0.15"))); + switch (className) { + case "A": + firstQuarterMargin = maxFirstQuarter.add(maxFirstQuarter.multiply(new BigDecimal("0.15"))); + secondQuarterMargin = maxSecQuarter.add(maxSecQuarter.multiply(new BigDecimal("0.20"))); + thirdQuarterMargin = maxthirdQuarter.add(maxthirdQuarter.multiply(new BigDecimal("0.15"))); + fourthQuarterMargin = maxforthQuarter.add(maxforthQuarter.multiply(new BigDecimal("0.15"))); - break; - case "B": - firstQuarterMargin = maxFirstQuarter.add(maxFirstQuarter.multiply(new BigDecimal("0.10"))); - secondQuarterMargin = maxSecQuarter.add(maxSecQuarter.multiply(new BigDecimal("0.10"))) ; - thirdQuarterMargin = maxthirdQuarter.add(maxthirdQuarter.multiply(new BigDecimal("0.10"))); - fourthQuarterMargin = maxforthQuarter.add(maxforthQuarter.multiply(new BigDecimal("0.10"))); - break; - case "C": - firstQuarterMargin = maxFirstQuarter.add(maxFirstQuarter.multiply(new BigDecimal("0.05"))); - secondQuarterMargin = maxSecQuarter.add(maxSecQuarter.multiply(new BigDecimal("0.05"))) ; - thirdQuarterMargin = maxthirdQuarter.add(maxthirdQuarter.multiply(new BigDecimal("0.05"))); - fourthQuarterMargin = maxforthQuarter.add(maxforthQuarter.multiply(new BigDecimal("0.05"))); - break; - default: - firstQuarterMargin = maxFirstQuarter; - secondQuarterMargin = maxSecQuarter; - thirdQuarterMargin = maxthirdQuarter; - fourthQuarterMargin = maxforthQuarter; - break; - } + break; + case "B": + firstQuarterMargin = maxFirstQuarter.add(maxFirstQuarter.multiply(new BigDecimal("0.10"))); + secondQuarterMargin = maxSecQuarter.add(maxSecQuarter.multiply(new BigDecimal("0.10"))); + thirdQuarterMargin = maxthirdQuarter.add(maxthirdQuarter.multiply(new BigDecimal("0.10"))); + fourthQuarterMargin = maxforthQuarter.add(maxforthQuarter.multiply(new BigDecimal("0.10"))); + break; + case "C": + firstQuarterMargin = maxFirstQuarter.add(maxFirstQuarter.multiply(new BigDecimal("0.05"))); + secondQuarterMargin = maxSecQuarter.add(maxSecQuarter.multiply(new BigDecimal("0.05"))); + thirdQuarterMargin = maxthirdQuarter.add(maxthirdQuarter.multiply(new BigDecimal("0.05"))); + fourthQuarterMargin = maxforthQuarter.add(maxforthQuarter.multiply(new BigDecimal("0.05"))); + break; + default: + firstQuarterMargin = maxFirstQuarter; + secondQuarterMargin = maxSecQuarter; + thirdQuarterMargin = maxthirdQuarter; + fourthQuarterMargin = maxforthQuarter; + break; + } - BigDecimal j = getMaxLastYear(2, product, mrpForecastList); - BigDecimal f = getMaxLastYear(3, product, mrpForecastList); - BigDecimal max = j.max(f); + BigDecimal j = getMaxLastYear(2, product, mrpForecastList); + BigDecimal f = getMaxLastYear(3, product, mrpForecastList); + BigDecimal max = j.max(f); - log.debug("sssssss margin {} max : {} class {} ",firstQuarterMargin,maxFirstQuarter,className); - log.debug("last year jan {} feb {}",j,f); - log.debug("maxxxxxxxxxxx {}",max); + log.debug( + "sssssss margin {} max : {} class {} ", firstQuarterMargin, maxFirstQuarter, className); + log.debug("last year jan {} feb {}", j, f); + log.debug("maxxxxxxxxxxx {}", max); - firstQuarterMargin = firstQuarterMargin.add(max); + firstQuarterMargin = firstQuarterMargin.add(max); - mrpLineSaleAndMargin.setFirstQuarterMarge(firstQuarterMargin.setScale(0,RoundingMode.CEILING)); - mrpLineSaleAndMargin.setSecondQuarterMarge(secondQuarterMargin.setScale(0,RoundingMode.CEILING)); - mrpLineSaleAndMargin.setThirdQuarterMarge(thirdQuarterMargin.setScale(0,RoundingMode.CEILING)); - mrpLineSaleAndMargin.setForthQuarterMarge(fourthQuarterMargin.setScale(0,RoundingMode.CEILING)); + mrpLineSaleAndMargin.setFirstQuarterMarge(firstQuarterMargin.setScale(0, RoundingMode.CEILING)); + mrpLineSaleAndMargin.setSecondQuarterMarge( + secondQuarterMargin.setScale(0, RoundingMode.CEILING)); + mrpLineSaleAndMargin.setThirdQuarterMarge(thirdQuarterMargin.setScale(0, RoundingMode.CEILING)); + mrpLineSaleAndMargin.setForthQuarterMarge( + fourthQuarterMargin.setScale(0, RoundingMode.CEILING)); + this.createdSalesMasterPlanLine( + firstQuarterMargin, + secondQuarterMargin, + thirdQuarterMargin, + fourthQuarterMargin, + product, + mrp); - this.createdSalesMasterPlanLine(firstQuarterMargin, secondQuarterMargin, thirdQuarterMargin, fourthQuarterMargin, product, mrp); - - mrpLineSaleAndMargin.setProduct(product); - mrpLineSaleAndMargin.setProductOrigin(product); - mrpLineSaleAndMargin.setMrp(mrp); - Beans.get(MrpLineSaleAndMarginRepository.class).save(mrpLineSaleAndMargin); - - } - - - @Transactional - public void createdProductionMasterPlan(Product product,Mrp mrp,BigDecimal qty, BigDecimal batchQty) throws AxelorException { - - this.createMargeAndSaleLineSophal(mrp, product, mrpForecastListAll,qty); - - - ProductionMasterPlan productionMasterPlan = new ProductionMasterPlan(); - int currentMonth = LocalDate.now().getMonth().getValue(); - BigDecimal decreasingQty = qty; - BigDecimal currentMargin= BigDecimal.ZERO; - BigDecimal remaining= BigDecimal.ZERO; - BigDecimal annualQty= BigDecimal.ZERO; - BigDecimal batchQtyPerMonth = BigDecimal.ZERO; - - - for (int index = currentMonth; index < 13; index++) { - currentMargin = getCurrentSaleMargin(product, mrp, index); - - if(decreasingQty.compareTo(currentMargin) > 0) { - remaining = decreasingQty.subtract(currentMargin); - decreasingQty = BigDecimal.ZERO; - }else{ - remaining = BigDecimal.ZERO; - decreasingQty = currentMargin.subtract(decreasingQty); - } - - batchQtyPerMonth = decreasingQty.divide(batchQty,0,RoundingMode.UP); - - annualQty = annualQty.add(decreasingQty); - - switch (index) { - case 1: - productionMasterPlan.setJanuary(decreasingQty); - productionMasterPlan.setJanuaryBatchQty(batchQtyPerMonth); - break; - case 2: - productionMasterPlan.setFebruary(decreasingQty); - productionMasterPlan.setFebruaryBatchQty(batchQtyPerMonth); - break; - case 3: - productionMasterPlan.setMarch(decreasingQty); - productionMasterPlan.setMarchBatchQty(batchQtyPerMonth); - break; - case 4: - productionMasterPlan.setApril(decreasingQty); - productionMasterPlan.setAprilBatchQty(batchQtyPerMonth); - case 5: - productionMasterPlan.setMay(decreasingQty); - productionMasterPlan.setMayBatchQty(batchQtyPerMonth); - case 6: - productionMasterPlan.setJuin(decreasingQty); - productionMasterPlan.setJuinBatchQty(batchQtyPerMonth); - break; - case 7: - productionMasterPlan.setJuly(decreasingQty); - productionMasterPlan.setJulyBatchQty(batchQtyPerMonth); - break; - case 8: - productionMasterPlan.setAugust(decreasingQty); - productionMasterPlan.setAugustBatchQty(batchQtyPerMonth); - break; - case 9: - productionMasterPlan.setSeptember(decreasingQty); - productionMasterPlan.setSeptemberBatchQty(batchQtyPerMonth); - break; - case 10: - productionMasterPlan.setOctober(decreasingQty); - productionMasterPlan.setOctoberBatchQty(batchQtyPerMonth); - break; - case 11: - productionMasterPlan.setNovember(decreasingQty); - productionMasterPlan.setNovemberBatchQty(batchQtyPerMonth); - break; - case 12: - productionMasterPlan.setDecember(decreasingQty); - productionMasterPlan.setDecemberBatchQty(batchQtyPerMonth); - break; - default: - break; - } - - if(remaining.compareTo(BigDecimal.ZERO) > 0){ - decreasingQty = decreasingQty.add(remaining); - }else{ - decreasingQty = BigDecimal.ZERO; - } - } - - productionMasterPlan.setAnnualQty(annualQty); - productionMasterPlan.setMrp(mrp); - productionMasterPlan.setProduct(product); - - Beans.get(ProductionMasterPlanRepository.class).save(productionMasterPlan); - - } - - BigDecimal getMaxOfMonth(int monthSelect,Product product,List mrpForecastList){ - return mrpForecastList.stream().filter(t -> t.getProduct() == product && t.getMonthSelect() == monthSelect).map(t -> t.getQty()).max(Comparator.naturalOrder()).orElse(BigDecimal.ZERO); - } - - - BigDecimal getMaxLastYear(int monthSelect,Product product,List mrpForecastList){ - int lastYear = LocalDate.now().getYear() - 1; - return mrpForecastList.stream().filter(t -> t.getProduct() == product && t.getMonthSelect() == monthSelect && t.getForecastDate().getYear() == lastYear).map(t -> t.getQty()).max(Comparator.naturalOrder()).orElse(BigDecimal.ZERO); + mrpLineSaleAndMargin.setProduct(product); + mrpLineSaleAndMargin.setProductOrigin(product); + mrpLineSaleAndMargin.setMrp(mrp); + Beans.get(MrpLineSaleAndMarginRepository.class).save(mrpLineSaleAndMargin); } @Transactional - public void createdSalesMasterPlanLine(BigDecimal firstQuarterMargin,BigDecimal secondQuarterMargin,BigDecimal thirdQuarterMargin,BigDecimal fourthQuarterMargin,Product product,Mrp mrp){ + public void createdProductionMasterPlan( + Product product, Mrp mrp, BigDecimal qty, BigDecimal batchQty) throws AxelorException { + + this.createMargeAndSaleLineSophal(mrp, product, mrpForecastListAll, qty); + + ProductionMasterPlan productionMasterPlan = new ProductionMasterPlan(); + int currentMonth = LocalDate.now().getMonth().getValue(); + BigDecimal decreasingQty = qty; + BigDecimal currentMargin = BigDecimal.ZERO; + BigDecimal remaining = BigDecimal.ZERO; + BigDecimal annualQty = BigDecimal.ZERO; + BigDecimal batchQtyPerMonth = BigDecimal.ZERO; + + for (int index = currentMonth; index < 13; index++) { + currentMargin = getCurrentSaleMargin(product, mrp, index); + + if (decreasingQty.compareTo(currentMargin) > 0) { + remaining = decreasingQty.subtract(currentMargin); + decreasingQty = BigDecimal.ZERO; + } else { + remaining = BigDecimal.ZERO; + decreasingQty = currentMargin.subtract(decreasingQty); + } + + batchQtyPerMonth = decreasingQty.divide(batchQty, 0, RoundingMode.UP); + + annualQty = annualQty.add(decreasingQty); + + switch (index) { + case 1: + productionMasterPlan.setJanuary(decreasingQty); + productionMasterPlan.setJanuaryBatchQty(batchQtyPerMonth); + break; + case 2: + productionMasterPlan.setFebruary(decreasingQty); + productionMasterPlan.setFebruaryBatchQty(batchQtyPerMonth); + break; + case 3: + productionMasterPlan.setMarch(decreasingQty); + productionMasterPlan.setMarchBatchQty(batchQtyPerMonth); + break; + case 4: + productionMasterPlan.setApril(decreasingQty); + productionMasterPlan.setAprilBatchQty(batchQtyPerMonth); + case 5: + productionMasterPlan.setMay(decreasingQty); + productionMasterPlan.setMayBatchQty(batchQtyPerMonth); + case 6: + productionMasterPlan.setJuin(decreasingQty); + productionMasterPlan.setJuinBatchQty(batchQtyPerMonth); + break; + case 7: + productionMasterPlan.setJuly(decreasingQty); + productionMasterPlan.setJulyBatchQty(batchQtyPerMonth); + break; + case 8: + productionMasterPlan.setAugust(decreasingQty); + productionMasterPlan.setAugustBatchQty(batchQtyPerMonth); + break; + case 9: + productionMasterPlan.setSeptember(decreasingQty); + productionMasterPlan.setSeptemberBatchQty(batchQtyPerMonth); + break; + case 10: + productionMasterPlan.setOctober(decreasingQty); + productionMasterPlan.setOctoberBatchQty(batchQtyPerMonth); + break; + case 11: + productionMasterPlan.setNovember(decreasingQty); + productionMasterPlan.setNovemberBatchQty(batchQtyPerMonth); + break; + case 12: + productionMasterPlan.setDecember(decreasingQty); + productionMasterPlan.setDecemberBatchQty(batchQtyPerMonth); + break; + default: + break; + } + + if (remaining.compareTo(BigDecimal.ZERO) > 0) { + decreasingQty = decreasingQty.add(remaining); + } else { + decreasingQty = BigDecimal.ZERO; + } + } + + productionMasterPlan.setAnnualQty(annualQty); + productionMasterPlan.setMrp(mrp); + productionMasterPlan.setProduct(product); + + Beans.get(ProductionMasterPlanRepository.class).save(productionMasterPlan); + } + + BigDecimal getMaxOfMonth(int monthSelect, Product product, List mrpForecastList) { + return mrpForecastList + .stream() + .filter(t -> t.getProduct() == product && t.getMonthSelect() == monthSelect) + .map(t -> t.getQty()) + .max(Comparator.naturalOrder()) + .orElse(BigDecimal.ZERO); + } + + BigDecimal getMaxLastYear(int monthSelect, Product product, List mrpForecastList) { + int lastYear = LocalDate.now().getYear() - 1; + return mrpForecastList + .stream() + .filter( + t -> + t.getProduct() == product + && t.getMonthSelect() == monthSelect + && t.getForecastDate().getYear() == lastYear) + .map(t -> t.getQty()) + .max(Comparator.naturalOrder()) + .orElse(BigDecimal.ZERO); + } + + @Transactional + public void createdSalesMasterPlanLine( + BigDecimal firstQuarterMargin, + BigDecimal secondQuarterMargin, + BigDecimal thirdQuarterMargin, + BigDecimal fourthQuarterMargin, + Product product, + Mrp mrp) { SalesMasterPlan salesMasterPlan = new SalesMasterPlan(); salesMasterPlan.setJanuary(firstQuarterMargin); salesMasterPlan.setFebruary(firstQuarterMargin); @@ -1553,42 +1577,48 @@ public class MrpServiceImpl implements MrpService { salesMasterPlan.setOctober(fourthQuarterMargin); salesMasterPlan.setNovember(fourthQuarterMargin); salesMasterPlan.setDecember(fourthQuarterMargin); - salesMasterPlan.setAnnualQty((firstQuarterMargin.add(secondQuarterMargin).add(thirdQuarterMargin).add(fourthQuarterMargin)).multiply(new BigDecimal("3"))); + salesMasterPlan.setAnnualQty( + (firstQuarterMargin + .add(secondQuarterMargin) + .add(thirdQuarterMargin) + .add(fourthQuarterMargin)) + .multiply(new BigDecimal("3"))); salesMasterPlan.setMrp(mrp); salesMasterPlan.setProduct(product); Beans.get(SalesMasterPlanRepository.class).save(salesMasterPlan); } - private BigDecimal getCurrentSaleMargin(Product product,Mrp mrp,int monthSelect){ + private BigDecimal getCurrentSaleMargin(Product product, Mrp mrp, int monthSelect) { - MrpLineSaleAndMargin mrpLineSaleAndMargin = Beans.get(MrpLineSaleAndMarginRepository.class).all().fetchStream().filter(t -> t.getProduct() == product && t.getMrp() == mrp).findFirst().orElse(null); + MrpLineSaleAndMargin mrpLineSaleAndMargin = + Beans.get(MrpLineSaleAndMarginRepository.class) + .all() + .fetchStream() + .filter(t -> t.getProduct() == product && t.getMrp() == mrp) + .findFirst() + .orElse(null); - if(mrpLineSaleAndMargin != null){ - if(monthSelect == 1 || monthSelect == 2 || monthSelect == 3){ - return mrpLineSaleAndMargin.getFirstQuarterMarge(); + if (mrpLineSaleAndMargin != null) { + if (monthSelect == 1 || monthSelect == 2 || monthSelect == 3) { + return mrpLineSaleAndMargin.getFirstQuarterMarge(); - }else if(monthSelect == 4 || monthSelect == 5 || monthSelect == 6){ - return mrpLineSaleAndMargin.getSecondQuarterMarge(); + } else if (monthSelect == 4 || monthSelect == 5 || monthSelect == 6) { + return mrpLineSaleAndMargin.getSecondQuarterMarge(); - }else if(monthSelect == 7 || monthSelect == 8 || monthSelect == 9){ - return mrpLineSaleAndMargin.getThirdQuarterMarge(); + } else if (monthSelect == 7 || monthSelect == 8 || monthSelect == 9) { + return mrpLineSaleAndMargin.getThirdQuarterMarge(); - }else if(monthSelect == 10 || monthSelect == 11 || monthSelect == 12){ - return mrpLineSaleAndMargin.getForthQuarterMarge(); + } else if (monthSelect == 10 || monthSelect == 11 || monthSelect == 12) { + return mrpLineSaleAndMargin.getForthQuarterMarge(); - }else{ - return BigDecimal.ZERO; + } else { + return BigDecimal.ZERO; + } } - - } - return BigDecimal.ZERO; - -} - - - public boolean contains(final Object[] objects, final int key) - { - return Arrays.stream(objects).anyMatch(n-> (int) n ==key); + return BigDecimal.ZERO; } + public boolean contains(final Object[] objects, final int key) { + return Arrays.stream(objects).anyMatch(n -> (int) n == key); + } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineFileServiceService.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineFileServiceService.java new file mode 100644 index 0000000..1369bab --- /dev/null +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineFileServiceService.java @@ -0,0 +1,67 @@ +package com.axelor.apps.supplychain.service; + +import com.axelor.apps.purchase.db.PurchaseOrderLineFile; +import com.axelor.apps.purchase.db.repo.PurchaseOrderLineFileRepository; +import com.axelor.apps.purchase.service.app.AppPurchaseService; +import com.axelor.auth.AuthUtils; +import com.axelor.exception.AxelorException; +import com.axelor.inject.Beans; +import com.google.inject.Inject; +import com.google.inject.persist.Transactional; + +public class PurchaseOrderLineFileServiceService { + + @Inject + protected AppPurchaseService appPurchaseService; + + @Transactional(rollbackOn = { Exception.class }) + public void refuseCoa(PurchaseOrderLineFile purchaseOrderLineFile, String raison, String refusalOrigin) + throws AxelorException { + + System.out.println("purchaseOrderLineFile************************************"); + System.out.println(refusalOrigin); + System.out.println(raison); + System.out.println("purchaseOrderLineFile************************************"); + + switch (refusalOrigin) { + case PurchaseOrderLineFileRepository.DT_STATUS_SELECT: + purchaseOrderLineFile.setDtStatusSelect(4); + purchaseOrderLineFile.setDt_refusal_date(appPurchaseService.getTodayDateTime().toLocalDateTime()); + purchaseOrderLineFile.setDt_validator_refusal_user(AuthUtils.getUser()); + purchaseOrderLineFile.setDt_refusal_reason(raison); + break; + case PurchaseOrderLineFileRepository.RD_STATUS_SELECT: + purchaseOrderLineFile.setRdStatusSelect(4); + purchaseOrderLineFile.setRd_refusal_date(appPurchaseService.getTodayDateTime().toLocalDateTime()); + purchaseOrderLineFile.setRd_refusal_user(AuthUtils.getUser()); + purchaseOrderLineFile.setRd_refusal_reason(raison); + break; + + case PurchaseOrderLineFileRepository.QA_STATUS_SELECT: + purchaseOrderLineFile.setQaStatusSelect(4); + purchaseOrderLineFile.setQa_refusal_date(appPurchaseService.getTodayDateTime().toLocalDateTime()); + purchaseOrderLineFile.setQa_validator_refusal_user(AuthUtils.getUser()); + purchaseOrderLineFile.setQa_refusal_reason(raison); + break; + + case PurchaseOrderLineFileRepository.QC_STATUS_SELECT: + purchaseOrderLineFile.setQcStatusSelect(4); + purchaseOrderLineFile.setQc_refusal_date(appPurchaseService.getTodayDateTime().toLocalDateTime()); + purchaseOrderLineFile.setQc_validator_refusal_user(AuthUtils.getUser()); + purchaseOrderLineFile.setQc_refusal_reason(raison); + break; + + case PurchaseOrderLineFileRepository.PRODUCTION_STATUS_SELECT: + purchaseOrderLineFile.setProductionStatusSelect(4); + purchaseOrderLineFile.setProduction_refusal_date(appPurchaseService.getTodayDateTime().toLocalDateTime()); + purchaseOrderLineFile.setProduction_validator_refusal_user(AuthUtils.getUser()); + purchaseOrderLineFile.setProduction_refusal_reason(raison); + break; + + default: + break; + } + + Beans.get(PurchaseOrderLineFileRepository.class).save(purchaseOrderLineFile); + } +} diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineServiceSupplychainImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineServiceSupplychainImpl.java index 13a016c..470caef 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineServiceSupplychainImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderLineServiceSupplychainImpl.java @@ -17,10 +17,14 @@ */ package com.axelor.apps.supplychain.service; +import com.axelor.apps.account.db.AnalyticAccount; import com.axelor.apps.account.db.AnalyticDistributionTemplate; import com.axelor.apps.account.db.AnalyticMoveLine; +import com.axelor.apps.account.db.Budget; import com.axelor.apps.account.db.BudgetDistribution; import com.axelor.apps.account.db.repo.AnalyticMoveLineRepository; +import com.axelor.apps.account.db.repo.BudgetDistributionRepository; +import com.axelor.apps.account.db.repo.BudgetRepository; import com.axelor.apps.account.service.AnalyticMoveLineService; import com.axelor.apps.account.service.app.AppAccountService; import com.axelor.apps.base.db.Product; @@ -29,15 +33,19 @@ import com.axelor.apps.base.db.repo.AppAccountRepository; import com.axelor.apps.base.service.UnitConversionService; import com.axelor.apps.purchase.db.PurchaseOrder; import com.axelor.apps.purchase.db.PurchaseOrderLine; +import com.axelor.apps.purchase.db.PurchaseRequestLine; +import com.axelor.apps.purchase.db.repo.PurchaseOrderLineRepository; import com.axelor.apps.purchase.service.PurchaseOrderLineServiceImpl; import com.axelor.apps.sale.db.SaleOrderLine; import com.axelor.apps.sale.db.repo.SaleOrderLineRepository; import com.axelor.exception.AxelorException; +import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.inject.Beans; import com.google.common.base.Preconditions; import com.google.inject.Inject; import java.lang.invoke.MethodHandles; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDate; import java.util.List; import org.slf4j.Logger; @@ -110,12 +118,45 @@ public class PurchaseOrderLineServiceSupplychainImpl extends PurchaseOrderLineSe String productName, String description, BigDecimal qty, - Unit unit) + Unit unit, + PurchaseRequestLine purchaseRequestLine) throws AxelorException { PurchaseOrderLine purchaseOrderLine = - super.createPurchaseOrderLine(purchaseOrder, product, productName, description, qty, unit); + super.createPurchaseOrderLine(purchaseOrder, product, productName, description, qty, unit,purchaseRequestLine); + + List analyticMoveLines = purchaseRequestLine.getAnalyticMoveLineList(); + // if(analyticMoveLines.size() == 0){ + // throw new AxelorException( + // purchaseRequestLine.getPurchaseRequest(), + // TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + // "Vous avez une lignes expression des besoins sans Compte analytique"); + // } + + if(analyticMoveLines.size() != 0){ + for (AnalyticMoveLine analyticMoveLine : analyticMoveLines) { + AnalyticMoveLine analyticMoveLineCopy = Beans.get(AnalyticMoveLineRepository.class).copy(analyticMoveLine, false); + System.out.println("**************************************************"); + System.out.println(analyticMoveLine.getAnalyticAccount()); + System.out.println(analyticMoveLine.getAnalyticAccount().getParent()); + // Budget budget = Beans.get(BudgetRepository.class).findByAnalyticAccount(analyticMoveLine.getAnalyticAccount()); + Budget budget = findBudgetRecursive(analyticMoveLine.getAnalyticAccount()); + System.out.println(budget); + System.out.println("**************************************************"); + if(budget != null){ + BudgetDistribution newBudgetDistribution = new BudgetDistribution(); + newBudgetDistribution.setAmount(purchaseOrderLine.getCompanyExTaxTotal().multiply(analyticMoveLine.getPercentage()).divide(new BigDecimal("100")).setScale(2, RoundingMode.HALF_EVEN)); + newBudgetDistribution.setBudget(budget); + newBudgetDistribution.setPurchaseOrderLine(purchaseOrderLine); + newBudgetDistribution.setAnalyticMoveLine(analyticMoveLineCopy); + Beans.get(BudgetDistributionRepository.class).save(newBudgetDistribution); + Beans.get(PurchaseOrderLineServiceSupplychainImpl.class).computeBudgetDistributionSumAmount(purchaseOrderLine, purchaseOrder); + } + purchaseOrderLine.addAnalyticMoveLineListItem(analyticMoveLineCopy); + } + } + // purchaseOrderLine.setAmountInvoiced(BigDecimal.ZERO); // // purchaseOrderLine.setIsInvoiced(false); @@ -123,6 +164,33 @@ public class PurchaseOrderLineServiceSupplychainImpl extends PurchaseOrderLineSe return purchaseOrderLine; } + public PurchaseOrderLine createPurchaseOrderLineFromSplit( + PurchaseOrderLine purchaseOrderLine) + throws AxelorException { + + PurchaseOrderLine purchaseOrderLineNew = Beans.get(PurchaseOrderLineRepository.class).copy(purchaseOrderLine, true); + + List analyticMoveLines = purchaseOrderLine.getAnalyticMoveLineList(); + + // if(analyticMoveLines.size() == 0){ + // throw new AxelorException( + // purchaseRequestLine.getPurchaseRequest(), + // TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + // "Vous avez une lignes expression des besoins sans Compte analytique"); + // } + + // for (AnalyticMoveLine analyticMoveLine : analyticMoveLines) { + // AnalyticMoveLine analyticMoveLineCopy = Beans.get(AnalyticMoveLineRepository.class).copy(analyticMoveLine, false); + // purchaseOrderLineNew.addAnalyticMoveLineListItem(analyticMoveLineCopy); + // } + + // purchaseOrderLine.setAmountInvoiced(BigDecimal.ZERO); + // + // purchaseOrderLine.setIsInvoiced(false); + + return purchaseOrderLineNew; + } + public PurchaseOrderLine getAndComputeAnalyticDistribution( PurchaseOrderLine purchaseOrderLine, PurchaseOrder purchaseOrder) { @@ -208,4 +276,24 @@ public class PurchaseOrderLineServiceSupplychainImpl extends PurchaseOrderLineSe } purchaseOrderLine.setBudgetDistributionSumAmount(budgetDistributionSumAmount); } + + + private Budget findBudgetRecursive(AnalyticAccount account) { + while (account != null) { + System.out.println("???????????????????????????????? while loop"); + Budget budget = Beans.get(BudgetRepository.class) + .findByAnalyticAccount(account); + if (budget != null) { + System.out.println("???????????????????????????????? while loop inside if"); + System.out.println(account); + System.out.println(budget); + + return budget; // found budget, stop here + } + account = account.getParent(); // go up one level + } + return null; // no budget found in hierarchy + } + + } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderServiceSupplychainImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderServiceSupplychainImpl.java index 2d5f757..fed7cfe 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderServiceSupplychainImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderServiceSupplychainImpl.java @@ -120,6 +120,9 @@ public class PurchaseOrderServiceSupplychainImpl extends PurchaseOrderServiceImp externalReference, supplierPartner.getFullName()); + + System.out.println("Création d'une commande fournisseur : Société = {}, Reference externe = {}, Fournisseur = {}"); + PurchaseOrder purchaseOrder = super.createPurchaseOrder( buyerUser, @@ -434,8 +437,18 @@ public class PurchaseOrderServiceSupplychainImpl extends PurchaseOrderServiceImp public void finishSockMoves( PurchaseOrder purchaseOrder, CancelReason raison, String cancelReasonStr) throws AxelorException { - Beans.get(PurchaseOrderStockServiceImpl.class) - .cancelReceiptWithRaison(purchaseOrder, raison, cancelReasonStr); + Beans.get(PurchaseOrderStockServiceImpl.class).cancelReceiptWithRaison(purchaseOrder, raison, cancelReasonStr); this.finishPurchaseOrder(purchaseOrder, cancelReasonStr); } + + @Transactional + public void computeBudgetDistribution(PurchaseOrderLine purchaseOrderLine) { + List budgetDistributionList = purchaseOrderLine.getBudgetDistributionList(); + for (BudgetDistribution budgetDistribution : budgetDistributionList) { + BigDecimal percent = budgetDistribution.getAnalyticMoveLine().getPercentage(); + budgetDistribution.setAmount(purchaseOrderLine.getCompanyExTaxTotal().multiply(percent).setScale(2).divide(new BigDecimal("100"))); + Beans.get(BudgetDistributionRepository.class).save(budgetDistribution); + Beans.get(PurchaseOrderLineServiceSupplychainImpl.class).computeBudgetDistributionSumAmount(purchaseOrderLine, purchaseOrderLine.getPurchaseOrder()); + } + } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderStockServiceImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderStockServiceImpl.java index 15a31d6..f111ea9 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderStockServiceImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseOrderStockServiceImpl.java @@ -17,7 +17,9 @@ */ package com.axelor.apps.supplychain.service; +import com.axelor.apps.account.db.AnalyticMoveLine; import com.axelor.apps.account.db.TaxLine; +import com.axelor.apps.account.db.repo.AnalyticMoveLineRepository; import com.axelor.apps.base.db.Address; import com.axelor.apps.base.db.CancelReason; import com.axelor.apps.base.db.Company; @@ -219,6 +221,8 @@ public class PurchaseOrderStockServiceImpl implements PurchaseOrderStockService stockMove.setFixTax(purchaseOrder.getFixTax()); stockMove.setPayerPartner(purchaseOrder.getPayerPartner()); stockMove.setDeliveryPartner(purchaseOrder.getDeliveryPartner()); + stockMove.setAnalyticAccount(purchaseOrder.getAnalyticAccount()); + stockMove.setAnalyticAxis(purchaseOrder.getAnalyticAxis()); qualityStockMove.setOriginId(purchaseOrder.getId()); qualityStockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_PURCHASE_ORDER); @@ -336,6 +340,14 @@ public class PurchaseOrderStockServiceImpl implements PurchaseOrderStockService } else if (purchaseOrderLine.getIsTitleLine()) { stockMoveLine = createTitleStockMoveLine(purchaseOrderLine, stockMove); } + stockMoveLine.setAnalyticDistributionTemplate(purchaseOrderLine.getAnalyticDistributionTemplate()); + List analyticMoveLines = purchaseOrderLine.getAnalyticMoveLineList(); + if(analyticMoveLines.size() != 0){ + for (AnalyticMoveLine analyticMoveLine : analyticMoveLines) { + AnalyticMoveLine analyticMoveLineCopy = Beans.get(AnalyticMoveLineRepository.class).copy(analyticMoveLine, false); + stockMoveLine.addAnalyticMoveLineListItem(analyticMoveLineCopy); + } + } return stockMoveLine; } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseRequestServiceSupplychainImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseRequestServiceSupplychainImpl.java index d5373c1..02cc557 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseRequestServiceSupplychainImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/PurchaseRequestServiceSupplychainImpl.java @@ -17,12 +17,19 @@ */ package com.axelor.apps.supplychain.service; +import java.util.List; + +import com.axelor.apps.account.db.AnalyticMoveLine; +import com.axelor.apps.account.db.repo.AnalyticMoveLineRepository; import com.axelor.apps.purchase.db.PurchaseOrder; +import com.axelor.apps.purchase.db.PurchaseOrderLine; import com.axelor.apps.purchase.db.PurchaseRequest; +import com.axelor.apps.purchase.db.PurchaseRequestLine; import com.axelor.apps.purchase.service.PurchaseRequestServiceImpl; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.repo.StockLocationRepository; import com.axelor.exception.AxelorException; +import com.axelor.inject.Beans; import com.google.inject.Inject; public class PurchaseRequestServiceSupplychainImpl extends PurchaseRequestServiceImpl { @@ -35,6 +42,8 @@ public class PurchaseRequestServiceSupplychainImpl extends PurchaseRequestServic PurchaseOrder purchaseOrder = super.createPurchaseOrder(purchaseRequest); purchaseOrder.setStockLocation(purchaseRequest.getStockLocation()); + purchaseOrder.setAnalyticAccount(purchaseRequest.getAnalyticAccount()); + purchaseOrder.setAnalyticAxis(purchaseRequest.getAnalyticAxis()); return purchaseOrder; } @@ -47,4 +56,13 @@ public class PurchaseRequestServiceSupplychainImpl extends PurchaseRequestServic } return key; } + + public void setPurchaseOrderLineAnalyticMoveLine(PurchaseRequestLine purchaseRequestLine,PurchaseOrderLine purchaseOrderLine){ + List analyticMoveLines = purchaseRequestLine.getAnalyticMoveLineList(); + + for (AnalyticMoveLine analyticMoveLine : analyticMoveLines) { + AnalyticMoveLine aml = Beans.get(AnalyticMoveLineRepository.class).copy(analyticMoveLine, true); + purchaseOrderLine.addAnalyticMoveLineListItem(aml); + } + } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockConfigService.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockConfigService.java new file mode 100644 index 0000000..aa68a6c --- /dev/null +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockConfigService.java @@ -0,0 +1,38 @@ +package com.axelor.apps.supplychain.service; + +import com.axelor.apps.base.db.Company; +import com.axelor.apps.stock.db.StockConfig; +import com.axelor.apps.stock.db.StockLocation; +import com.axelor.apps.stock.exception.IExceptionMessage; +import com.axelor.exception.AxelorException; +import com.axelor.exception.db.repo.TraceBackRepository; +import com.axelor.i18n.I18n; + +public class StockConfigService { + public StockConfig getStockConfig(Company company) throws AxelorException { + + StockConfig stockConfig = company.getStockConfig(); + + if (stockConfig == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_CONFIG_1), + company.getName()); + } + + return stockConfig; + } + + public StockLocation getWarehouseNonCompliant(StockConfig stockConfig) + throws AxelorException { + if (stockConfig.getPickupDefaultStockLocation() == null) { + throw new AxelorException( + stockConfig, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get(IExceptionMessage.STOCK_CONFIG_1), + stockConfig.getCompany().getName()); + } + return stockConfig.getWarehouseNonCompliant(); + } +} diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockMoveLineServiceSupplychainImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockMoveLineServiceSupplychainImpl.java index cb82921..ab61f11 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockMoveLineServiceSupplychainImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/StockMoveLineServiceSupplychainImpl.java @@ -17,6 +17,8 @@ */ package com.axelor.apps.supplychain.service; +import com.axelor.apps.account.db.AnalyticMoveLine; +import com.axelor.apps.account.db.repo.AnalyticMoveLineRepository; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.Unit; @@ -33,6 +35,7 @@ import com.axelor.apps.purchase.service.PurchaseOrderLineService; import com.axelor.apps.purchase.service.PurchaseOrderLineServiceImpl; import com.axelor.apps.purchase.service.PurchaseOrderServiceImpl; import com.axelor.apps.sale.db.SaleOrderLine; +import com.axelor.apps.stock.db.InternalTrackingNumber; import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockLocationLine; import com.axelor.apps.stock.db.StockMove; @@ -68,7 +71,6 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; -import java.util.Optional; import java.util.stream.Collectors; @RequestScoped @@ -155,6 +157,11 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp TrackingNumberConfiguration trackingNumberConfiguration = product.getTrackingNumberConfiguration(); + if(purchaseOrderLine != null){ + System.out.println("Stepper loading ::::::::::::::::"); + // this.inheretAccountAnalyticMoveLine(purchaseOrderLine,stockMoveLine); + } + return assignOrGenerateTrackingNumber( stockMoveLine, stockMove, product, trackingNumberConfiguration, type); } else { @@ -172,6 +179,18 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp } } + @Transactional + private void inheretAccountAnalyticMoveLine(PurchaseOrderLine purchaseOrderLine, StockMoveLine stockMoveLine) { + List analyticMoveLines = purchaseOrderLine.getAnalyticMoveLineList(); + if(analyticMoveLines.size() != 0){ + for (AnalyticMoveLine analyticMoveLine : analyticMoveLines) { + AnalyticMoveLine aml = Beans.get(AnalyticMoveLineRepository.class).copy(analyticMoveLine, false); + aml.setStockMoveLine(stockMoveLine); + stockMoveLine.addAnalyticMoveLineListItem(aml); + } + } + } + @Override public StockMoveLine compute(StockMoveLine stockMoveLine, StockMove stockMove) throws AxelorException { @@ -482,35 +501,43 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp } @Transactional - public void resetValorization(Long productId, Long stockMoveId, LocalDate toDateTime,Boolean excludeValotisationStocklocation) { + public void resetValorization( + Long productId, + Long stockMoveId, + LocalDate toDateTime, + Boolean excludeValotisationStocklocation) { StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveId); Product product = Beans.get(ProductRepository.class).find(productId); - if(excludeValotisationStocklocation){ - this.stockMoveLines = getStockMoveLines(product, toDateTime, stockMove,true); - }else{ - this.stockMoveLines = getStockMoveLines(product, toDateTime, stockMove,false); + if (excludeValotisationStocklocation) { + this.stockMoveLines = getStockMoveLines(product, toDateTime, stockMove, true); + } else { + this.stockMoveLines = getStockMoveLines(product, toDateTime, stockMove, false); } - List lines = new ArrayList<>(); - if(this.stockMoveLines.size() > 1){ - lines = sliceStockMoveLines(this.stockMoveLines,stockMoveId,product); - }else{ + if (this.stockMoveLines.size() > 1) { + lines = sliceStockMoveLines(this.stockMoveLines, stockMoveId, product); + } else { lines.addAll(stockMoveLines); } - + for (StockMoveLine stockMoveLine : lines) { stockMoveLine.setIsWapUpdated(false); Beans.get(StockMoveLineRepository.class).save(stockMoveLine); } } - public void fillStockMoveLines(Long productId,LocalDate toDateTime,Long stockMoveId,Boolean excludeValotisationStocklocation){ + public void fillStockMoveLines( + Long productId, + LocalDate toDateTime, + Long stockMoveId, + Boolean excludeValotisationStocklocation) { StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveId); Product product = Beans.get(ProductRepository.class).find(productId); - this.stockMoveLines = getStockMoveLines(product, toDateTime, stockMove,excludeValotisationStocklocation); + this.stockMoveLines = + getStockMoveLines(product, toDateTime, stockMove, excludeValotisationStocklocation); System.out.println("***********************stockMoveLines****************************"); System.out.println(this.stockMoveLines); @@ -518,7 +545,13 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp } @Transactional - public void valorize(Long productId, Long stockMoveId, LocalDate toDateTime, BigDecimal price,Boolean updatePo,Boolean excludeValotisationStocklocation) + public void valorize( + Long productId, + Long stockMoveId, + LocalDate toDateTime, + BigDecimal price, + Boolean updatePo, + Boolean excludeValotisationStocklocation) throws AxelorException { StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveId); Product product = Beans.get(ProductRepository.class).find(productId); @@ -530,32 +563,30 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp // this.updatePurchaseOrderPrices(stockMove, product, price); // } - List lines = sliceStockMoveLines(this.stockMoveLines,stockMoveId,product); - - BigDecimal currentQty = this.getTotalQty(product, stockMove.getCompany(),false); - BigDecimal oldWap = this.getPreviousWap(lines.get(0),false); - - if(excludeValotisationStocklocation){ - currentQty = this.getTotalQty(product, stockMove.getCompany(),true); - oldWap = this.getPreviousWap(lines.get(0),true); - - } + List lines = sliceStockMoveLines(this.stockMoveLines, stockMoveId, product); - + BigDecimal currentQty = this.getTotalQty(product, stockMove.getCompany(), false); + BigDecimal oldWap = this.getPreviousWap(lines.get(0), false); + + if (excludeValotisationStocklocation) { + currentQty = this.getTotalQty(product, stockMove.getCompany(), true); + oldWap = this.getPreviousWap(lines.get(0), true); + } for (StockMoveLine stockMoveLine : lines) { if (stockMoveLine.getStockMove().getFromStockLocation().getTypeSelect() - == StockLocationRepository.TYPE_VIRTUAL && stockMoveLine.getStockMove().getToStockLocation().getId() != 6L) { + == StockLocationRepository.TYPE_VIRTUAL + && stockMoveLine.getStockMove().getToStockLocation().getId() != 6L) { currentQty = currentQty.subtract(stockMoveLine.getRealQty()); } else if (stockMoveLine.getStockMove().getToStockLocation().getTypeSelect() - == StockLocationRepository.TYPE_VIRTUAL || (stockMoveLine.getStockMove().getToStockLocation().getId() == 6L && stockMoveLine.getStockMove().getFromStockLocation().getTypeSelect() - != StockLocationRepository.TYPE_VIRTUAL)) { + == StockLocationRepository.TYPE_VIRTUAL + || (stockMoveLine.getStockMove().getToStockLocation().getId() == 6L + && stockMoveLine.getStockMove().getFromStockLocation().getTypeSelect() + != StockLocationRepository.TYPE_VIRTUAL)) { currentQty = currentQty.add(stockMoveLine.getRealQty()); } - System.out.println("..................>>>>>>>>>>>>>>>><<<<<"+currentQty.toString()); + System.out.println("..................>>>>>>>>>>>>>>>><<<<<" + currentQty.toString()); } - - BigDecimal newQty = lines.get(0).getRealQty(); BigDecimal newPrice = price; @@ -566,14 +597,12 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp .add(currentQty.multiply(oldWap)) .divide(currentQty.add(newQty), scale, BigDecimal.ROUND_HALF_UP); - - this.updateStockMoveLinePrices(product, price, stockMove, true, newWap); int index = 1; List lines2 = new ArrayList<>(); - if(lines.size() > 1){ - lines2 = this.stockMoveLineStartingFromIndex(index, lines); + if (lines.size() > 1) { + lines2 = this.stockMoveLineStartingFromIndex(index, lines); } for (StockMoveLine stockMoveLine : lines2) { @@ -596,7 +625,9 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp productId, stockMoveLine.getStockMove().getId(), toDateTime, - stockMoveLine.getUnitPriceUntaxed(),updatePo,excludeValotisationStocklocation); + stockMoveLine.getUnitPriceUntaxed(), + updatePo, + excludeValotisationStocklocation); break; } } @@ -650,11 +681,19 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp // stockMoveLineRepository // .all() // .filter( - // "self.stockMove.id = ?1 and self.product.id = ?2 and self.stockMove.statusSelect = 3 and self.realQty > 0", + // "self.stockMove.id = ?1 and self.product.id = ?2 and self.stockMove.statusSelect + // = 3 and self.realQty > 0", // stockMoveId, // productId) // .fetch(); - stockMove.getStockMoveLineList().stream().filter(t -> (t.getProduct().getId() == product.getId() && t.getRealQty().compareTo(BigDecimal.ZERO) > 0)).collect(Collectors.toList()); + stockMove + .getStockMoveLineList() + .stream() + .filter( + t -> + (t.getProduct().getId() == product.getId() + && t.getRealQty().compareTo(BigDecimal.ZERO) > 0)) + .collect(Collectors.toList()); if (!updatePmp) { for (StockMoveLine stockMoveLine : stockMoveLines) { stockMoveLine.setCompanyUnitPriceUntaxed(price); @@ -695,21 +734,25 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp } public List getStockMoveLines( - Product product, LocalDate toDate, StockMove stockMove,Boolean excludeValotisationStocklocation) { + Product product, + LocalDate toDate, + StockMove stockMove, + Boolean excludeValotisationStocklocation) { - String query = + String query = "self.stockMove.statusSelect = ?1 AND self.stockMove.realDate <= ?2 AND self.product = ?3 AND self.stockMove.realDate >= ?4 AND self.realQty > 0 AND (self.archived is null OR self.archived is false)"; if (excludeValotisationStocklocation) { - query += " AND (self.stockMove.toStockLocation.excludeValorisation is true or self.stockMove.fromStockLocation.excludeValorisation is true)"; - }else{ - query += " AND ((self.stockMove.toStockLocation.excludeValorisation is false or self.stockMove.toStockLocation.excludeValorisation is null) AND (self.stockMove.fromStockLocation.excludeValorisation is false or self.stockMove.fromStockLocation.excludeValorisation is null))"; + query += + " AND (self.stockMove.toStockLocation.excludeValorisation is true or self.stockMove.fromStockLocation.excludeValorisation is true)"; + } else { + query += + " AND ((self.stockMove.toStockLocation.excludeValorisation is false or self.stockMove.toStockLocation.excludeValorisation is null) AND (self.stockMove.fromStockLocation.excludeValorisation is false or self.stockMove.fromStockLocation.excludeValorisation is null))"; } - - System.out.println("***************getStockMoveLines************"); - System.out.println(query); - System.out.println("***************getStockMoveLines************"); - + + System.out.println("***************getStockMoveLines************"); + System.out.println(query); + System.out.println("***************getStockMoveLines************"); List params = Lists.newArrayList(); params.add(StockMoveRepository.STATUS_REALIZED); @@ -729,12 +772,14 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp return lines; } - public BigDecimal getPreviousWap(StockMoveLine stockMoveLine,Boolean excludeValotisationStocklocation) { + public BigDecimal getPreviousWap( + StockMoveLine stockMoveLine, Boolean excludeValotisationStocklocation) { String query = "self.stockMove.statusSelect = ?1 AND self.product = ?2 and self.stockMove.realDate < ?3 AND self.realQty > 0"; if (excludeValotisationStocklocation) { - query += " AND (self.stockMove.toStockLocation.excludeValorisation is true or self.stockMove.fromStockLocation.excludeValorisation is true)"; + query += + " AND (self.stockMove.toStockLocation.excludeValorisation is true or self.stockMove.fromStockLocation.excludeValorisation is true)"; } StockMoveLine l = stockMoveLineRepository.find(stockMoveLine.getId()); @@ -758,7 +803,8 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp } @SuppressWarnings({"unchecked", "rawtypes"}) - public BigDecimal getTotalQty(Product product, Company company,Boolean excludeValotisationStocklocation) { + public BigDecimal getTotalQty( + Product product, Company company, Boolean excludeValotisationStocklocation) { Long productId = product.getId(); String query = "SELECT new list(self.id, self.avgPrice, self.currentQty) FROM StockLocationLine as self " @@ -769,15 +815,15 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp if (excludeValotisationStocklocation) { query += " AND (self.stockLocation.excludeValorisation is true)"; - }else{ - query += " AND (self.stockLocation.excludeValorisation is false or self.stockLocation.excludeValorisation is null)"; + } else { + query += + " AND (self.stockLocation.excludeValorisation is false or self.stockLocation.excludeValorisation is null)"; } if (company != null) { query += " AND self.stockLocation.company = " + company.getId(); } - BigDecimal qtyTot = BigDecimal.ZERO; List> results = JPA.em().createQuery(query).getResultList(); if (results.isEmpty()) { @@ -791,7 +837,6 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp return BigDecimal.ZERO; } - System.out.println("***************query*************"); System.out.println(query); System.out.println("***************qtyTot*************"); @@ -806,7 +851,7 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp public void showLines(Long productId, Long stockMoveId, LocalDate toDateTime, BigDecimal price) { StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveId); Product product = Beans.get(ProductRepository.class).find(productId); - List lines = getStockMoveLines(product, toDateTime, stockMove,false); + List lines = getStockMoveLines(product, toDateTime, stockMove, false); System.out.println("*****************************************************"); for (StockMoveLine line : lines) { System.out.println(line.getStockMove().getStockMoveSeq()); @@ -837,64 +882,76 @@ public class StockMoveLineServiceSupplychainImpl extends StockMoveLineServiceImp public void valorizeAll(LocalDate fromDateTime, Long productCategoryId) throws AxelorException { // ,67 String query = - "self.stockMove.statusSelect = ?1 "+ - "and self.stockMove.realDate >= ?2 and self.realQty > 0 and "+ - "self.product.familleProduit.id in ("+String.valueOf(productCategoryId)+") and self.stockMove.fromStockLocation.id = 12 and self.stockMove.partner.id != 853"; - List params = Lists.newArrayList(); - params.add(StockMoveRepository.STATUS_REALIZED); - params.add(fromDateTime); - - List lines = - stockMoveLineRepository - .all() - .filter(query, params.toArray()) - .order("stockMove.realDate") - .order("id") - .fetch(); + "self.stockMove.statusSelect = ?1 " + + "and self.stockMove.realDate >= ?2 and self.realQty > 0 and " + + "self.product.familleProduit.id in (" + + String.valueOf(productCategoryId) + + ") and self.stockMove.fromStockLocation.id = 12 and self.stockMove.partner.id != 853"; + List params = Lists.newArrayList(); + params.add(StockMoveRepository.STATUS_REALIZED); + params.add(fromDateTime); + List lines = + stockMoveLineRepository + .all() + .filter(query, params.toArray()) + .order("stockMove.realDate") + .order("id") + .fetch(); List distinctLines = new ArrayList<>(); List products = new ArrayList<>(); for (StockMoveLine line : lines) { - if(products.indexOf(line.getProduct()) == -1){ + if (products.indexOf(line.getProduct()) == -1) { distinctLines.add(line); products.add(line.getProduct()); } } - int index = lines.size(); for (StockMoveLine line : distinctLines) { - System.out.println("Starting ............... "+String.valueOf(index)); - System.out.println("Size ............... "+String.valueOf(distinctLines.size())); + System.out.println("Starting ............... " + String.valueOf(index)); + System.out.println("Size ............... " + String.valueOf(distinctLines.size())); System.out.println(line.getStockMove().getStockMoveSeq()); System.out.println(line.getProductName()); System.out.println(line.getProduct().getId()); - this.resetValorization(line.getProduct().getId(), line.getStockMove().getId(), LocalDate.now(),false); - this.fillStockMoveLines(line.getProduct().getId(), LocalDate.now(), line.getStockMove().getId(),false); - this.valorize(line.getProduct().getId(), line.getStockMove().getId(), LocalDate.now(), line.getUnitPriceUntaxed(), false,false); + this.resetValorization( + line.getProduct().getId(), line.getStockMove().getId(), LocalDate.now(), false); + this.fillStockMoveLines( + line.getProduct().getId(), LocalDate.now(), line.getStockMove().getId(), false); + this.valorize( + line.getProduct().getId(), + line.getStockMove().getId(), + LocalDate.now(), + line.getUnitPriceUntaxed(), + false, + false); System.out.println("End ....................."); - index --; + index--; } - } + public List sliceStockMoveLines( + List lines, Long stockMoveId, Product product) { - public List sliceStockMoveLines(List lines,Long stockMoveId,Product product){ - - StockMoveLine emp = lines.stream().filter((t) -> { - return t.getStockMove().getId() == stockMoveId && t.getProduct() == product; - }).findFirst().orElse(null); + StockMoveLine emp = + lines + .stream() + .filter( + (t) -> { + return t.getStockMove().getId() == stockMoveId && t.getProduct() == product; + }) + .findFirst() + .orElse(null); - int index = lines.indexOf(emp); + int index = lines.indexOf(emp); - List slicedLines = new ArrayList<>(); - - for (int i = index; i < lines.size(); i++) { - slicedLines.add(lines.get(i)); - } - return slicedLines; + List slicedLines = new ArrayList<>(); + for (int i = index; i < lines.size(); i++) { + slicedLines.add(lines.get(i)); + } + return slicedLines; } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/SupplierRatingServiceImpl.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/SupplierRatingServiceImpl.java index 04cb1cc..20a9041 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/SupplierRatingServiceImpl.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/SupplierRatingServiceImpl.java @@ -14,8 +14,6 @@ import com.axelor.apps.supplychain.db.SupplierRating; import com.axelor.apps.supplychain.db.repo.SupplierRatingRepository; import com.axelor.inject.Beans; import com.google.inject.persist.Transactional; -import com.thoughtworks.xstream.mapper.Mapper; - import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; @@ -26,353 +24,354 @@ import java.util.stream.Collectors; public class SupplierRatingServiceImpl implements SupplierRatingService { - public final int COEF_PAYMENT_DELAY = 1; - public final int COEF_DELIVERY_TIME = 1; - public final int COEF_COMPLIANCE_WITH_TECHNICAL_SPECIFICATIONS = 3; - public final int COEF_PRICE = 3; - public final int COEF_QUANTITY_COMPLIANCE = 1; - public final int COEF_COMPLAINT_MANAGEMENT = 1; - public final int COEF_PRICE_STABILITY = 1; - public final int SUM_COEF = - COEF_PAYMENT_DELAY - + COEF_DELIVERY_TIME - + COEF_COMPLIANCE_WITH_TECHNICAL_SPECIFICATIONS - + COEF_PRICE - + COEF_QUANTITY_COMPLIANCE - + COEF_COMPLAINT_MANAGEMENT - + COEF_PRICE_STABILITY; + public final int COEF_PAYMENT_DELAY = 1; + public final int COEF_DELIVERY_TIME = 1; + public final int COEF_COMPLIANCE_WITH_TECHNICAL_SPECIFICATIONS = 3; + public final int COEF_PRICE = 3; + public final int COEF_QUANTITY_COMPLIANCE = 1; + public final int COEF_COMPLAINT_MANAGEMENT = 1; + public final int COEF_PRICE_STABILITY = 1; + public final int SUM_COEF = + COEF_PAYMENT_DELAY + + COEF_DELIVERY_TIME + + COEF_COMPLIANCE_WITH_TECHNICAL_SPECIFICATIONS + + COEF_PRICE + + COEF_QUANTITY_COMPLIANCE + + COEF_COMPLAINT_MANAGEMENT + + COEF_PRICE_STABILITY; - public void calculatRating(SupplierRating supplierRating) { - Integer paymentDelayRatingSelect = supplierRating.getPaymentDelayRatingSelect(); - Integer deliveryTimeRatingSelect = supplierRating.getDeliveryTimeRatingSelect(); - Integer complianceWithTechnicalSpecificationsRatingSelect = - supplierRating.getComplianceWithTechnicalSpecificationsRatingSelect(); - Integer priceRatingSelect = supplierRating.getPriceRatingSelect(); - Integer quantityComplianceRatingSelect = supplierRating.getQuantityComplianceRatingSelect(); - Integer complaintManagementRatingSelect = supplierRating.getComplaintManagementRatingSelect(); - Integer priceStabilityRatingSelect = supplierRating.getPriceStabilityRatingSelect(); + public void calculatRating(SupplierRating supplierRating) { + Integer paymentDelayRatingSelect = supplierRating.getPaymentDelayRatingSelect(); + Integer deliveryTimeRatingSelect = supplierRating.getDeliveryTimeRatingSelect(); + Integer complianceWithTechnicalSpecificationsRatingSelect = + supplierRating.getComplianceWithTechnicalSpecificationsRatingSelect(); + Integer priceRatingSelect = supplierRating.getPriceRatingSelect(); + Integer quantityComplianceRatingSelect = supplierRating.getQuantityComplianceRatingSelect(); + Integer complaintManagementRatingSelect = supplierRating.getComplaintManagementRatingSelect(); + Integer priceStabilityRatingSelect = supplierRating.getPriceStabilityRatingSelect(); - // Calculate the overall score based on ratings - int score = - (paymentDelayRatingSelect * COEF_PAYMENT_DELAY) - + (deliveryTimeRatingSelect * COEF_DELIVERY_TIME) - + (complianceWithTechnicalSpecificationsRatingSelect - * COEF_COMPLIANCE_WITH_TECHNICAL_SPECIFICATIONS) - + (priceRatingSelect * COEF_PRICE) - + (quantityComplianceRatingSelect * COEF_QUANTITY_COMPLIANCE) - + (complaintManagementRatingSelect * COEF_COMPLAINT_MANAGEMENT) - + (priceStabilityRatingSelect * COEF_PRICE_STABILITY); + // Calculate the overall score based on ratings + int score = + (paymentDelayRatingSelect * COEF_PAYMENT_DELAY) + + (deliveryTimeRatingSelect * COEF_DELIVERY_TIME) + + (complianceWithTechnicalSpecificationsRatingSelect + * COEF_COMPLIANCE_WITH_TECHNICAL_SPECIFICATIONS) + + (priceRatingSelect * COEF_PRICE) + + (quantityComplianceRatingSelect * COEF_QUANTITY_COMPLIANCE) + + (complaintManagementRatingSelect * COEF_COMPLAINT_MANAGEMENT) + + (priceStabilityRatingSelect * COEF_PRICE_STABILITY); - // Set the overall score - BigDecimal overallScore = - BigDecimal.valueOf(score * 20) - .divide(BigDecimal.valueOf(SUM_COEF * 3), 2, BigDecimal.ROUND_HALF_UP); - supplierRating.setOverallScore(overallScore); + // Set the overall score + BigDecimal overallScore = + BigDecimal.valueOf(score * 20) + .divide(BigDecimal.valueOf(SUM_COEF * 3), 2, BigDecimal.ROUND_HALF_UP); + supplierRating.setOverallScore(overallScore); + } + + @Transactional + public void createRating(StockMove stockMove) { + + StockMove stockMoveOrigin = stockMove.getStockMoveOrigin(); + Boolean isWithBackorder = stockMove.getIsWithBackorder(); + + if (stockMoveOrigin == null) { + LocalDateTime realDate; + if (isWithBackorder == true) { + realDate = stockMove.getRealDate(); + } else { + realDate = LocalDateTime.now(); + } + + Partner partner = stockMove.getPartner(); + + // Stock Move Lines + List stockMoveLinesList = stockMove.getStockMoveLineList(); + + // Purchase Order + Long originId = stockMove.getOriginId(); + PurchaseOrder purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(originId); + + // Purchase Order Lines + List purchaseOrderLinesList = purchaseOrder.getPurchaseOrderLineList(); + + // Délai de payment + PaymentCondition paymentCondition = purchaseOrder.getPaymentCondition(); + Integer paymentTime = paymentCondition.getPaymentTime(); + Integer paymentDelayRatingSelect = calculatPaymentDelayRatingSelect(paymentTime); + + // Date + LocalDate estimatedDate = purchaseOrder.getDeliveryDate(); + Integer deliveryTimeRatingSelect = calculatDeliveryTimeRatingSelect(estimatedDate, realDate); + + // Quantité + Integer quantityComplianceRatingSelect = + calculatQuantityComplianceRatingSelect(stockMoveLinesList); + + // Stabilité des prix + Integer priceStabilityRatingSelect = + calculatPriceStabilityRatingSelectLastPrice(purchaseOrderLinesList, partner); + + // Creation + SupplierRating supplierRating = new SupplierRating(); + supplierRating.setPaymentDelayRatingSelect(paymentDelayRatingSelect); + supplierRating.setDeliveryTimeRatingSelect(deliveryTimeRatingSelect); + supplierRating.setQuantityComplianceRatingSelect(quantityComplianceRatingSelect); + supplierRating.setPriceStabilityRatingSelect(priceStabilityRatingSelect); + supplierRating.setPurchaseOrder(purchaseOrder); + supplierRating.setSupplierPartner(partner); + Beans.get(SupplierRatingRepository.class).save(supplierRating); + + } else { + // Purchase Order + Long originId = stockMove.getOriginId(); + PurchaseOrder purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(originId); + + List originStockMoves = + Beans.get(StockMoveRepository.class) + .all() + .fetch() + .stream() + .filter(t -> t.getOriginId() == originId && t.getStatusSelect() == 3) + .collect(Collectors.toList()); + + // Purchase Order Lines + List purchaseOrderLinesList = purchaseOrder.getPurchaseOrderLineList(); + + // Related Stock Moves Lines + List originStockMovesLines = new ArrayList<>(); + for (StockMove originStockMove : originStockMoves) { + // Stock Move Lines + List originStockMovesLinesList = originStockMove.getStockMoveLineList(); + originStockMovesLines.addAll(originStockMovesLinesList); + } + // Quantité + Integer quantityComplianceRatingSelect = + calculatQuantityComplianceRatingSelect(purchaseOrderLinesList, originStockMovesLines); + + // update + SupplierRating supplierRating = purchaseOrder.getSupplierRating(); + supplierRating.setQuantityComplianceRatingSelect(quantityComplianceRatingSelect); + } + } + + private Integer calculatPaymentDelayRatingSelect(Integer paymentTime) { + Integer paymentDelayRatingSelect; + if (paymentTime == 0) { + paymentDelayRatingSelect = 0; + } else if (paymentTime <= 15) { + paymentDelayRatingSelect = 1; + } else if (paymentTime <= 30) { + paymentDelayRatingSelect = 2; + } else { + paymentDelayRatingSelect = 3; + } + return paymentDelayRatingSelect; + } + + private Integer calculatDeliveryTimeRatingSelect( + LocalDate estimatedDate, LocalDateTime realDate) { + int deliveryTimeRatingSelect; + if (realDate.toLocalDate().isBefore(estimatedDate.plusDays(1))) { + deliveryTimeRatingSelect = 3; + } else if (realDate.toLocalDate().isBefore(estimatedDate.plusDays(5))) { + deliveryTimeRatingSelect = 2; + } else if (realDate.toLocalDate().isBefore(estimatedDate.plusDays(15))) { + deliveryTimeRatingSelect = 1; + } else { + deliveryTimeRatingSelect = 0; + } + return deliveryTimeRatingSelect; + } + + private Integer calculatQuantityComplianceRatingSelect(List stockMoveLinesList) { + // Calculate total ordered quantity + BigDecimal totalOrderedQty = BigDecimal.ZERO; + BigDecimal totalReceivedQty = BigDecimal.ZERO; + for (StockMoveLine stockMoveLine : stockMoveLinesList) { + BigDecimal orderedQty = stockMoveLine.getQty(); + totalOrderedQty = totalOrderedQty.add(orderedQty); + BigDecimal receivedQty = stockMoveLine.getRealQty(); + totalReceivedQty = totalReceivedQty.add(receivedQty); } - @Transactional - public void createRating(StockMove stockMove) { - - StockMove stockMoveOrigin = stockMove.getStockMoveOrigin(); - Boolean isWithBackorder = stockMove.getIsWithBackorder(); - - if (stockMoveOrigin == null) { - LocalDateTime realDate; - if (isWithBackorder == true) { - realDate = stockMove.getRealDate(); - } else { - realDate = LocalDateTime.now(); - } - - Partner partner = stockMove.getPartner(); - - // Stock Move Lines - List stockMoveLinesList = stockMove.getStockMoveLineList(); - - // Purchase Order - Long originId = stockMove.getOriginId(); - PurchaseOrder purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(originId); - - // Purchase Order Lines - List purchaseOrderLinesList = purchaseOrder.getPurchaseOrderLineList(); - - // Délai de payment - PaymentCondition paymentCondition = purchaseOrder.getPaymentCondition(); - Integer paymentTime = paymentCondition.getPaymentTime(); - Integer paymentDelayRatingSelect = calculatPaymentDelayRatingSelect(paymentTime); - - // Date - LocalDate estimatedDate = purchaseOrder.getDeliveryDate(); - Integer deliveryTimeRatingSelect = calculatDeliveryTimeRatingSelect(estimatedDate, realDate); - - // Quantité - Integer quantityComplianceRatingSelect = - calculatQuantityComplianceRatingSelect(stockMoveLinesList); - - // Stabilité des prix - Integer priceStabilityRatingSelect = - calculatPriceStabilityRatingSelectLastPrice(purchaseOrderLinesList, partner); - - // Creation - SupplierRating supplierRating = new SupplierRating(); - supplierRating.setPaymentDelayRatingSelect(paymentDelayRatingSelect); - supplierRating.setDeliveryTimeRatingSelect(deliveryTimeRatingSelect); - supplierRating.setQuantityComplianceRatingSelect(quantityComplianceRatingSelect); - supplierRating.setPriceStabilityRatingSelect(priceStabilityRatingSelect); - supplierRating.setPurchaseOrder(purchaseOrder); - supplierRating.setSupplierPartner(partner); - Beans.get(SupplierRatingRepository.class).save(supplierRating); - - } else { - // Purchase Order - Long originId = stockMove.getOriginId(); - PurchaseOrder purchaseOrder = Beans.get(PurchaseOrderRepository.class).find(originId); - - List originStockMoves = - Beans.get(StockMoveRepository.class) - .all() - .fetch() - .stream() - .filter(t -> t.getOriginId() == originId && t.getStatusSelect() == 3) - .collect(Collectors.toList()); - - // Purchase Order Lines - List purchaseOrderLinesList = purchaseOrder.getPurchaseOrderLineList(); - - // Related Stock Moves Lines - List originStockMovesLines = new ArrayList<>(); - for (StockMove originStockMove : originStockMoves) { - // Stock Move Lines - List originStockMovesLinesList = originStockMove.getStockMoveLineList(); - originStockMovesLines.addAll(originStockMovesLinesList); - } - // Quantité - Integer quantityComplianceRatingSelect = - calculatQuantityComplianceRatingSelect(purchaseOrderLinesList, originStockMovesLines); - - // update - SupplierRating supplierRating = purchaseOrder.getSupplierRating(); - supplierRating.setQuantityComplianceRatingSelect(quantityComplianceRatingSelect); - } + // Calculate quantity compliance + BigDecimal compliancePercentage; + if (totalOrderedQty.compareTo(BigDecimal.ZERO) != 0) { + compliancePercentage = + totalReceivedQty + .divide(totalOrderedQty, 2, RoundingMode.HALF_UP) + .multiply(BigDecimal.valueOf(100)); + } else { + // Handle division by zero if necessary + compliancePercentage = BigDecimal.ZERO; } - private Integer calculatPaymentDelayRatingSelect(Integer paymentTime) { - Integer paymentDelayRatingSelect; - if (paymentTime == 0) { - paymentDelayRatingSelect = 0; - } else if (paymentTime <= 15) { - paymentDelayRatingSelect = 1; - } else if (paymentTime <= 30) { - paymentDelayRatingSelect = 2; - } else { - paymentDelayRatingSelect = 3; - } - return paymentDelayRatingSelect; + System.out.println("totalOrderedQty1:" + totalOrderedQty); + System.out.println("totalReceivedQty1:" + totalReceivedQty); + System.out.println("compliancePercentage1:" + compliancePercentage); + + // Determine quantityComplianceRatingSelect based on compliancePercentage + Integer quantityComplianceRatingSelect; + if (compliancePercentage.compareTo(BigDecimal.valueOf(100)) >= 0) { + quantityComplianceRatingSelect = 3; + } else if (compliancePercentage.compareTo(BigDecimal.valueOf(80)) >= 0) { + quantityComplianceRatingSelect = 2; + } else if (compliancePercentage.compareTo(BigDecimal.valueOf(70)) >= 0) { + quantityComplianceRatingSelect = 1; + } else { + quantityComplianceRatingSelect = 0; + } + return quantityComplianceRatingSelect; + } + + private Integer calculatQuantityComplianceRatingSelect( + List purchaseOrderLineslist, List stockMoveLinesList) { + // Calculate total ordered quantity + BigDecimal totalOrderedQty = BigDecimal.ZERO; + BigDecimal totalReceivedQty = BigDecimal.ZERO; + for (StockMoveLine stockMoveLine : stockMoveLinesList) { + BigDecimal receivedQty = stockMoveLine.getRealQty(); + totalReceivedQty = totalReceivedQty.add(receivedQty); } - private Integer calculatDeliveryTimeRatingSelect(LocalDate estimatedDate, LocalDateTime realDate) { - int deliveryTimeRatingSelect; - if (realDate.toLocalDate().isBefore(estimatedDate.plusDays(1))) { - deliveryTimeRatingSelect = 3; - } else if (realDate.toLocalDate().isBefore(estimatedDate.plusDays(5))) { - deliveryTimeRatingSelect = 2; - } else if (realDate.toLocalDate().isBefore(estimatedDate.plusDays(15))) { - deliveryTimeRatingSelect = 1; - } else { - deliveryTimeRatingSelect = 0; - } - return deliveryTimeRatingSelect; + for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLineslist) { + BigDecimal orderedQty = purchaseOrderLine.getQty(); + totalOrderedQty = totalOrderedQty.add(orderedQty); + } + // Calculate quantity compliance + BigDecimal compliancePercentage; + if (totalOrderedQty.compareTo(BigDecimal.ZERO) != 0) { + compliancePercentage = + totalReceivedQty + .divide(totalOrderedQty, 2, RoundingMode.HALF_UP) + .multiply(BigDecimal.valueOf(100)); + } else { + // Handle division by zero if necessary + compliancePercentage = BigDecimal.ZERO; } - private Integer calculatQuantityComplianceRatingSelect(List stockMoveLinesList) { - // Calculate total ordered quantity - BigDecimal totalOrderedQty = BigDecimal.ZERO; - BigDecimal totalReceivedQty = BigDecimal.ZERO; - for (StockMoveLine stockMoveLine : stockMoveLinesList) { - BigDecimal orderedQty = stockMoveLine.getQty(); - totalOrderedQty = totalOrderedQty.add(orderedQty); - BigDecimal receivedQty = stockMoveLine.getRealQty(); - totalReceivedQty = totalReceivedQty.add(receivedQty); - } + System.out.println("totalOrderedQty2:" + totalOrderedQty); + System.out.println("totalReceivedQty2:" + totalReceivedQty); + System.out.println("compliancePercentage2:" + compliancePercentage); - // Calculate quantity compliance - BigDecimal compliancePercentage; - if (totalOrderedQty.compareTo(BigDecimal.ZERO) != 0) { - compliancePercentage = - totalReceivedQty - .divide(totalOrderedQty, 2, RoundingMode.HALF_UP) - .multiply(BigDecimal.valueOf(100)); - } else { - // Handle division by zero if necessary - compliancePercentage = BigDecimal.ZERO; - } + // Determine quantityComplianceRatingSelect based on compliancePercentage + Integer quantityComplianceRatingSelect; + if (compliancePercentage.compareTo(BigDecimal.valueOf(100)) >= 0) { + quantityComplianceRatingSelect = 3; + } else if (compliancePercentage.compareTo(BigDecimal.valueOf(80)) >= 0) { + quantityComplianceRatingSelect = 2; + } else if (compliancePercentage.compareTo(BigDecimal.valueOf(70)) >= 0) { + quantityComplianceRatingSelect = 1; + } else { + quantityComplianceRatingSelect = 0; + } + return quantityComplianceRatingSelect; + } - System.out.println("totalOrderedQty1:" + totalOrderedQty); - System.out.println("totalReceivedQty1:" + totalReceivedQty); - System.out.println("compliancePercentage1:" + compliancePercentage); - - // Determine quantityComplianceRatingSelect based on compliancePercentage - Integer quantityComplianceRatingSelect; - if (compliancePercentage.compareTo(BigDecimal.valueOf(100)) >= 0) { - quantityComplianceRatingSelect = 3; - } else if (compliancePercentage.compareTo(BigDecimal.valueOf(80)) >= 0) { - quantityComplianceRatingSelect = 2; - } else if (compliancePercentage.compareTo(BigDecimal.valueOf(70)) >= 0) { - quantityComplianceRatingSelect = 1; - } else { - quantityComplianceRatingSelect = 0; - } - return quantityComplianceRatingSelect; + private Integer calculatPriceStabilityRatingSelect( + List purchaseOrderLinesList, Partner partner) { + List products = new ArrayList<>(); + for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLinesList) { + Product product = purchaseOrderLine.getProduct(); + products.add(product); } - private Integer calculatQuantityComplianceRatingSelect( - List purchaseOrderLineslist, List stockMoveLinesList) { - // Calculate total ordered quantity - BigDecimal totalOrderedQty = BigDecimal.ZERO; - BigDecimal totalReceivedQty = BigDecimal.ZERO; - for (StockMoveLine stockMoveLine : stockMoveLinesList) { - BigDecimal receivedQty = stockMoveLine.getRealQty(); - totalReceivedQty = totalReceivedQty.add(receivedQty); - } - - for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLineslist) { - BigDecimal orderedQty = purchaseOrderLine.getQty(); - totalOrderedQty = totalOrderedQty.add(orderedQty); - } - // Calculate quantity compliance - BigDecimal compliancePercentage; - if (totalOrderedQty.compareTo(BigDecimal.ZERO) != 0) { - compliancePercentage = - totalReceivedQty - .divide(totalOrderedQty, 2, RoundingMode.HALF_UP) - .multiply(BigDecimal.valueOf(100)); - } else { - // Handle division by zero if necessary - compliancePercentage = BigDecimal.ZERO; - } - - System.out.println("totalOrderedQty2:" + totalOrderedQty); - System.out.println("totalReceivedQty2:" + totalReceivedQty); - System.out.println("compliancePercentage2:" + compliancePercentage); - - // Determine quantityComplianceRatingSelect based on compliancePercentage - Integer quantityComplianceRatingSelect; - if (compliancePercentage.compareTo(BigDecimal.valueOf(100)) >= 0) { - quantityComplianceRatingSelect = 3; - } else if (compliancePercentage.compareTo(BigDecimal.valueOf(80)) >= 0) { - quantityComplianceRatingSelect = 2; - } else if (compliancePercentage.compareTo(BigDecimal.valueOf(70)) >= 0) { - quantityComplianceRatingSelect = 1; - } else { - quantityComplianceRatingSelect = 0; - } - return quantityComplianceRatingSelect; + List averages = new ArrayList<>(); + for (Product product : products) { + BigDecimal avg = calculateAvgProduct(product, partner); + averages.add(avg); } - private Integer calculatPriceStabilityRatingSelect( - List purchaseOrderLinesList, Partner partner) { - List products = new ArrayList<>(); - for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLinesList) { - Product product = purchaseOrderLine.getProduct(); - products.add(product); - } + List differences = new ArrayList<>(); + for (int i = 0; i < purchaseOrderLinesList.size(); i++) { + BigDecimal price = purchaseOrderLinesList.get(i).getPrice(); + BigDecimal avg = averages.get(i); - List averages = new ArrayList<>(); - for (Product product : products) { - BigDecimal avg = calculateAvgProduct(product, partner); - averages.add(avg); - } + BigDecimal difference = price.subtract(avg); + BigDecimal percentage = + difference.divide(avg, 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); - List differences = new ArrayList<>(); - for (int i = 0; i < purchaseOrderLinesList.size(); i++) { - BigDecimal price = purchaseOrderLinesList.get(i).getPrice(); - BigDecimal avg = averages.get(i); - - BigDecimal difference = price.subtract(avg); - BigDecimal percentage = - difference.divide(avg, 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); - - differences.add(percentage.abs()); - } - - BigDecimal totalDifference = BigDecimal.ZERO; - for (BigDecimal difference : differences) { - totalDifference = totalDifference.add(difference); - } - - // Calculate the average percentage difference - BigDecimal averageDifference = - totalDifference.divide(BigDecimal.valueOf(differences.size()), 2, BigDecimal.ROUND_HALF_UP); - - // Determine priceStabilityRatingSelect based on the average percentage difference - Integer priceStabilityRatingSelect; - if (averageDifference.compareTo(BigDecimal.ZERO) <= 0) { - priceStabilityRatingSelect = 3; // Stable prices - } else if (averageDifference.compareTo(BigDecimal.valueOf(5)) <= 0) { - priceStabilityRatingSelect = 2; // Moderately stable prices - } else if (averageDifference.compareTo(BigDecimal.valueOf(10)) <= 0) { - priceStabilityRatingSelect = 1; // Unstable prices - } else { - priceStabilityRatingSelect = 0; - } - - return priceStabilityRatingSelect; + differences.add(percentage.abs()); } - private Integer calculatPriceStabilityRatingSelectLastPrice( - List purchaseOrderLinesList, Partner partner) { - List products = new ArrayList<>(); - for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLinesList) { - Product product = purchaseOrderLine.getProduct(); - products.add(product); - } - - List lastPrices = new ArrayList<>(); - for (Product product : products) { - BigDecimal lastPrice = getLastPriceProduct(product, partner); - lastPrices.add(lastPrice); - } - - List differences = new ArrayList<>(); - for (int i = 0; i < purchaseOrderLinesList.size(); i++) { - BigDecimal price = purchaseOrderLinesList.get(i).getPrice(); - BigDecimal lastPrice = lastPrices.get(i); - - BigDecimal difference = price.subtract(lastPrice); - BigDecimal percentage = - difference - .divide(lastPrice, 4, BigDecimal.ROUND_HALF_UP) - .multiply(BigDecimal.valueOf(100)); - - differences.add(percentage); - } - - BigDecimal totalDifference = BigDecimal.ZERO; - for (BigDecimal difference : differences) { - totalDifference = totalDifference.add(difference); - } - - // Calculate the average percentage difference - BigDecimal averageDifference = - totalDifference.divide(BigDecimal.valueOf(differences.size()), 2, BigDecimal.ROUND_HALF_UP); - - // Determine priceStabilityRatingSelect based on the average percentage difference - Integer priceStabilityRatingSelect; - if (averageDifference.compareTo(BigDecimal.ZERO) <= 0) { - priceStabilityRatingSelect = 3; // Stable prices - } else if (averageDifference.compareTo(BigDecimal.valueOf(5)) <= 0) { - priceStabilityRatingSelect = 2; // Moderately stable prices - } else if (averageDifference.compareTo(BigDecimal.valueOf(10)) <= 0) { - priceStabilityRatingSelect = 1; // Unstable prices - } else { - priceStabilityRatingSelect = 0; - } - - return priceStabilityRatingSelect; + BigDecimal totalDifference = BigDecimal.ZERO; + for (BigDecimal difference : differences) { + totalDifference = totalDifference.add(difference); } - private BigDecimal calculateAvgProduct(Product product, Partner partner) { - // Beans.get(PurchaseOrderRepository.class).find(originId); + // Calculate the average percentage difference + BigDecimal averageDifference = + totalDifference.divide(BigDecimal.valueOf(differences.size()), 2, BigDecimal.ROUND_HALF_UP); + + // Determine priceStabilityRatingSelect based on the average percentage difference + Integer priceStabilityRatingSelect; + if (averageDifference.compareTo(BigDecimal.ZERO) <= 0) { + priceStabilityRatingSelect = 3; // Stable prices + } else if (averageDifference.compareTo(BigDecimal.valueOf(5)) <= 0) { + priceStabilityRatingSelect = 2; // Moderately stable prices + } else if (averageDifference.compareTo(BigDecimal.valueOf(10)) <= 0) { + priceStabilityRatingSelect = 1; // Unstable prices + } else { + priceStabilityRatingSelect = 0; + } + + return priceStabilityRatingSelect; + } + + private Integer calculatPriceStabilityRatingSelectLastPrice( + List purchaseOrderLinesList, Partner partner) { + List products = new ArrayList<>(); + for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLinesList) { + Product product = purchaseOrderLine.getProduct(); + products.add(product); + } + + List lastPrices = new ArrayList<>(); + for (Product product : products) { + BigDecimal lastPrice = getLastPriceProduct(product, partner); + lastPrices.add(lastPrice); + } + + List differences = new ArrayList<>(); + for (int i = 0; i < purchaseOrderLinesList.size(); i++) { + BigDecimal price = purchaseOrderLinesList.get(i).getPrice(); + BigDecimal lastPrice = lastPrices.get(i); + + BigDecimal difference = price.subtract(lastPrice); + BigDecimal percentage = + difference + .divide(lastPrice, 4, BigDecimal.ROUND_HALF_UP) + .multiply(BigDecimal.valueOf(100)); + + differences.add(percentage); + } + + BigDecimal totalDifference = BigDecimal.ZERO; + for (BigDecimal difference : differences) { + totalDifference = totalDifference.add(difference); + } + + // Calculate the average percentage difference + BigDecimal averageDifference = + totalDifference.divide(BigDecimal.valueOf(differences.size()), 2, BigDecimal.ROUND_HALF_UP); + + // Determine priceStabilityRatingSelect based on the average percentage difference + Integer priceStabilityRatingSelect; + if (averageDifference.compareTo(BigDecimal.ZERO) <= 0) { + priceStabilityRatingSelect = 3; // Stable prices + } else if (averageDifference.compareTo(BigDecimal.valueOf(5)) <= 0) { + priceStabilityRatingSelect = 2; // Moderately stable prices + } else if (averageDifference.compareTo(BigDecimal.valueOf(10)) <= 0) { + priceStabilityRatingSelect = 1; // Unstable prices + } else { + priceStabilityRatingSelect = 0; + } + + return priceStabilityRatingSelect; + } + + private BigDecimal calculateAvgProduct(Product product, Partner partner) { + // Beans.get(PurchaseOrderRepository.class).find(originId); /*List purchaseOrderLines = Beans.get(PurchaseOrderLineRepository.class) .all() .filter("self.purchaseOrder.supplierPartner = :partner AND self.product = :product") @@ -380,47 +379,48 @@ public class SupplierRatingServiceImpl implements SupplierRatingService { .bind("product", product) .fetch();*/ - List purchaseOrderLines = - Beans.get(PurchaseOrderLineRepository.class) - .all() - .fetch() - .stream() - .filter( - t -> - t.getPurchaseOrder().getSupplierPartner() == partner - && t.getProduct() == product) - .collect(Collectors.toList()); + List purchaseOrderLines = + Beans.get(PurchaseOrderLineRepository.class) + .all() + .fetch() + .stream() + .filter( + t -> + t.getPurchaseOrder().getSupplierPartner() == partner + && t.getProduct() == product) + .collect(Collectors.toList()); - if (purchaseOrderLines != null && !purchaseOrderLines.isEmpty()) { - BigDecimal total = BigDecimal.ZERO; - for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLines) { - BigDecimal price = purchaseOrderLine.getPrice(); - total = total.add(price); - } - BigDecimal avgPrice = - total.divide(BigDecimal.valueOf(purchaseOrderLines.size()), 2, BigDecimal.ROUND_HALF_UP); - return avgPrice; - } - // Handle the case where there are no purchase order lines for the given product and partner - return BigDecimal.ZERO; + if (purchaseOrderLines != null && !purchaseOrderLines.isEmpty()) { + BigDecimal total = BigDecimal.ZERO; + for (PurchaseOrderLine purchaseOrderLine : purchaseOrderLines) { + BigDecimal price = purchaseOrderLine.getPrice(); + total = total.add(price); + } + BigDecimal avgPrice = + total.divide(BigDecimal.valueOf(purchaseOrderLines.size()), 2, BigDecimal.ROUND_HALF_UP); + return avgPrice; } + // Handle the case where there are no purchase order lines for the given product and partner + return BigDecimal.ZERO; + } - private BigDecimal getLastPriceProduct(Product product, Partner partner) { + private BigDecimal getLastPriceProduct(Product product, Partner partner) { - List purchaseOrderLines = Beans.get(PurchaseOrderLineRepository.class) - .all() - .filter("self.purchaseOrder.supplierPartner = :partner AND self.product = :product") - .bind("partner", partner) - .bind("product", product) - .fetch(); + List purchaseOrderLines = + Beans.get(PurchaseOrderLineRepository.class) + .all() + .filter("self.purchaseOrder.supplierPartner = :partner AND self.product = :product") + .bind("partner", partner) + .bind("product", product) + .fetch(); - PurchaseOrderLine lastPurchaseOrderLine = - purchaseOrderLines.isEmpty() ? null : purchaseOrderLines.get(purchaseOrderLines.size() - 1); - if (lastPurchaseOrderLine != null) { - BigDecimal price = lastPurchaseOrderLine.getPrice(); - return price; - } else { - return BigDecimal.ZERO; - } + PurchaseOrderLine lastPurchaseOrderLine = + purchaseOrderLines.isEmpty() ? null : purchaseOrderLines.get(purchaseOrderLines.size() - 1); + if (lastPurchaseOrderLine != null) { + BigDecimal price = lastPurchaseOrderLine.getPrice(); + return price; + } else { + return BigDecimal.ZERO; } -} \ No newline at end of file + } +} diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/invoice/generator/InvoiceLineGeneratorSupplyChain.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/invoice/generator/InvoiceLineGeneratorSupplyChain.java index 7cceb01..aa746b1 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/invoice/generator/InvoiceLineGeneratorSupplyChain.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/service/invoice/generator/InvoiceLineGeneratorSupplyChain.java @@ -219,7 +219,7 @@ public abstract class InvoiceLineGeneratorSupplyChain extends InvoiceLineGenerat } else if (purchaseOrderLine != null) { - if (purchaseOrderLine.getAnalyticDistributionTemplate() != null) { + if (purchaseOrderLine.getAnalyticDistributionTemplate() != null || purchaseOrderLine.getAnalyticMoveLineList().size() != 0) { invoiceLine.setAnalyticDistributionTemplate( purchaseOrderLine.getAnalyticDistributionTemplate()); this.copyAnalyticMoveLines(purchaseOrderLine.getAnalyticMoveLineList(), invoiceLine); diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/ImportationFolderController.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/ImportationFolderController.java index 2620e0c..f4a466c 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/ImportationFolderController.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/ImportationFolderController.java @@ -1,51 +1,20 @@ package com.axelor.apps.supplychain.web; -import java.lang.invoke.MethodHandles; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.MalformedURLException; -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.Optional; -import java.util.Set; -import java.util.stream.Collector; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.annotation.Nullable; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - 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.PaymentVoucher; import com.axelor.apps.account.db.repo.InvoiceTemplateRepository; -import com.axelor.apps.base.db.Product; import com.axelor.apps.base.db.Wizard; import com.axelor.apps.purchase.db.ImportationFolder; import com.axelor.apps.purchase.db.repo.ImportationFolderRepository; import com.axelor.apps.purchase.service.print.ImportationFolderPrintService; import com.axelor.apps.report.engine.ReportSettings; import com.axelor.apps.stock.db.ImportationFolderCostPrice; -import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; -import com.axelor.apps.stock.db.StockProductionRequest; import com.axelor.apps.stock.db.repo.ImportationFolderCostPriceRepository; import com.axelor.apps.stock.db.repo.StockMoveLineRepository; -import com.axelor.apps.stock.db.repo.StockMoveRepository; import com.axelor.apps.stock.exception.IExceptionMessage; -import com.axelor.apps.stock.service.StockMoveService; -import com.axelor.apps.stock.service.stockmove.print.StockProductionRequestPrintService; import com.axelor.apps.supplychain.service.ImportationFolderServiceImpl; -import com.axelor.apps.supplychain.service.StockMoveLineServiceSupplychainImpl; import com.axelor.apps.supplychain.service.app.AppSupplychainService; -import com.axelor.common.ObjectUtils; import com.axelor.db.mapper.Mapper; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; @@ -57,16 +26,22 @@ import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; import com.axelor.rpc.Context; -import com.google.common.base.Function; import com.google.common.base.Joiner; -import com.google.common.collect.Lists; - +import java.lang.invoke.MethodHandles; +import java.math.BigDecimal; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import wslite.json.JSONException; public class ImportationFolderController { private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - + public void calculateAvgPrice(ActionRequest request, ActionResponse response) throws MalformedURLException, JSONException, AxelorException { @@ -77,20 +52,20 @@ public class ImportationFolderController { List stockMoveLines = importationFolder.getStockMoveLineList(); List invoiceIds = - Beans.get(ImportationFolderServiceImpl.class).calculateAvgPriceAndGenerateInvoice(stockMoveLines, importationFolder); - - response.setView( - ActionView.define("Invoice") - .model(Invoice.class.getName()) - .add("grid", "invoice-grid") - .add("form", "invoice-form") - .domain("self.id in (" + Joiner.on(",").join(invoiceIds) + ")") - .param("forceEdit", "true") - .context("todayDate", Beans.get(AppSupplychainService.class).getTodayDate()) - .map()); + Beans.get(ImportationFolderServiceImpl.class) + .calculateAvgPriceAndGenerateInvoice(stockMoveLines, importationFolder); + response.setView( + ActionView.define("Invoice") + .model(Invoice.class.getName()) + .add("grid", "invoice-grid") + .add("form", "invoice-form") + .domain("self.id in (" + Joiner.on(",").join(invoiceIds) + ")") + .param("forceEdit", "true") + .context("todayDate", Beans.get(AppSupplychainService.class).getTodayDate()) + .map()); } - + public void computeCostPrice(ActionRequest request, ActionResponse response) throws MalformedURLException, JSONException, AxelorException { @@ -98,20 +73,19 @@ public class ImportationFolderController { (ImportationFolder) request.getContext().asType(ImportationFolder.class); ImportationFolder importationFolder = Beans.get(ImportationFolderRepository.class).find(iimportationFolder.getId()); - + String msg = Beans.get(ImportationFolderServiceImpl.class).computeCostPrice(importationFolder); - response.setAlert(msg); - + response.setAlert(msg); } - @SuppressWarnings({"unchecked", "rawtypes"}) public void setStockMoveLineCurrenyRate(ActionRequest request, ActionResponse response) { try { List selectedStockMoveLineMapList = (List) request.getContext().get("stockMoveLineList"); - Map importationFolderMap = (Map) request.getContext().get("importationFolder"); + Map importationFolderMap = + (Map) request.getContext().get("importationFolder"); if (selectedStockMoveLineMapList == null) { response.setFlash(I18n.get(IExceptionMessage.STOCK_MOVE_14)); return; @@ -135,8 +109,10 @@ public class ImportationFolderController { return; } - ImportationFolder importationFolder = Mapper.toBean(ImportationFolder.class, importationFolderMap); - importationFolder = Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); + ImportationFolder importationFolder = + Mapper.toBean(ImportationFolder.class, importationFolderMap); + importationFolder = + Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); Beans.get(ImportationFolderServiceImpl.class) .setStockMoveLineCurrenyRate(stockMoveLineList, currencyRate); response.setCanClose(true); @@ -150,7 +126,8 @@ public class ImportationFolderController { try { List selectedStockMoveLineMapList = (List) request.getContext().get("stockMoveLineList"); - Map importationFolderMap = (Map) request.getContext().get("importationFolder"); + Map importationFolderMap = + (Map) request.getContext().get("importationFolder"); if (selectedStockMoveLineMapList == null) { response.setFlash(I18n.get(IExceptionMessage.STOCK_MOVE_14)); return; @@ -174,9 +151,12 @@ public class ImportationFolderController { return; } - ImportationFolder importationFolder = Mapper.toBean(ImportationFolder.class, importationFolderMap); - importationFolder = Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); - Beans.get(ImportationFolderServiceImpl.class).setStockMoveLineFreight(stockMoveLineList, freight); + ImportationFolder importationFolder = + Mapper.toBean(ImportationFolder.class, importationFolderMap); + importationFolder = + Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); + Beans.get(ImportationFolderServiceImpl.class) + .setStockMoveLineFreight(stockMoveLineList, freight); response.setCanClose(true); } catch (Exception e) { TraceBackService.trace(response, e); @@ -188,7 +168,8 @@ public class ImportationFolderController { try { List selectedStockMoveLineMapList = (List) request.getContext().get("stockMoveLineList"); - Map importationFolderMap = (Map) request.getContext().get("importationFolder"); + Map importationFolderMap = + (Map) request.getContext().get("importationFolder"); if (selectedStockMoveLineMapList == null) { response.setFlash("No selected move line"); return; @@ -212,8 +193,10 @@ public class ImportationFolderController { return; } - ImportationFolder importationFolder = Mapper.toBean(ImportationFolder.class, importationFolderMap); - importationFolder = Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); + ImportationFolder importationFolder = + Mapper.toBean(ImportationFolder.class, importationFolderMap); + importationFolder = + Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); Beans.get(ImportationFolderServiceImpl.class) .setStockMoveLineNetMass(stockMoveLineList, netMass); response.setCanClose(true); @@ -227,7 +210,8 @@ public class ImportationFolderController { try { List selectedStockMoveLineMapList = (List) request.getContext().get("stockMoveLineList"); - Map importationFolderMap = (Map) request.getContext().get("importationFolder"); + Map importationFolderMap = + (Map) request.getContext().get("importationFolder"); if (selectedStockMoveLineMapList == null) { response.setFlash("No selected move line"); return; @@ -251,8 +235,10 @@ public class ImportationFolderController { return; } - ImportationFolder importationFolder = Mapper.toBean(ImportationFolder.class, importationFolderMap); - importationFolder = Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); + ImportationFolder importationFolder = + Mapper.toBean(ImportationFolder.class, importationFolderMap); + importationFolder = + Beans.get(ImportationFolderRepository.class).find(importationFolder.getId()); Beans.get(ImportationFolderServiceImpl.class) .setStockMoveLineVolume(stockMoveLineList, volume); response.setCanClose(true); @@ -261,14 +247,13 @@ public class ImportationFolderController { } } - public void validateCostPrice(ActionRequest request, ActionResponse response) { ImportationFolderCostPrice importationFolderCostPrice = Beans.get(ImportationFolderCostPriceRepository.class) .find(request.getContext().asType(ImportationFolderCostPrice.class).getId()); // sophal refresh purchase order price - + try { Beans.get(ImportationFolderServiceImpl.class).validateCostPrice(importationFolderCostPrice); response.setReload(true); @@ -277,9 +262,30 @@ public class ImportationFolderController { } } - public void confirmRejectView(ActionRequest request, ActionResponse response) { - ImportationFolder ImportationFolderContext = request.getContext().asType(ImportationFolder.class); - ImportationFolder importationFolder = + public void massValidateCostPrice(ActionRequest request, ActionResponse response) { + + ImportationFolder iimportationFolder = + (ImportationFolder) request.getContext().asType(ImportationFolder.class); + ImportationFolder importationFolder = + Beans.get(ImportationFolderRepository.class).find(iimportationFolder.getId()); + + List importationFolderCostPriceList = + importationFolder.getImportationFolderCostPriceList(); + // TODO gorup by product and stockmove to minimize the proccessed line + for (ImportationFolderCostPrice line : importationFolderCostPriceList) { + try { + Beans.get(ImportationFolderServiceImpl.class).validateCostPrice(line); + } catch (Exception e) { + System.out.println(e.toString()); + } + } + response.setReload(true); + } + + public void confirmRejectView(ActionRequest request, ActionResponse response) { + ImportationFolder ImportationFolderContext = + request.getContext().asType(ImportationFolder.class); + ImportationFolder importationFolder = Beans.get(ImportationFolderRepository.class).find(ImportationFolderContext.getId()); ActionViewBuilder confirmView = @@ -296,7 +302,6 @@ public class ImportationFolderController { response.setView(confirmView.map()); } - public void rejectImportationFolder(ActionRequest request, ActionResponse response) throws AxelorException { @@ -306,29 +311,28 @@ public class ImportationFolderController { ImportationFolder importationFolder = Beans.get(ImportationFolderRepository.class).find((long) importationFolderId); - Beans.get(ImportationFolderServiceImpl.class).rejectImportationFolder(importationFolder, rejectionRaison); + Beans.get(ImportationFolderServiceImpl.class) + .rejectImportationFolder(importationFolder, rejectionRaison); response.setCanClose(true); - } - - public void print(ActionRequest request, ActionResponse response) { Context context = request.getContext(); String fileLink; String title; - - ImportationFolderPrintService importationFolderPrintService = Beans.get(ImportationFolderPrintService.class); + + ImportationFolderPrintService importationFolderPrintService = + Beans.get(ImportationFolderPrintService.class); try { - if (context.get("id") != null) { + if (context.get("id") != null) { ImportationFolder importationFolder = request.getContext().asType(ImportationFolder.class); title = importationFolderPrintService.getFileName(importationFolder); fileLink = - importationFolderPrintService.printCostPriceSheet( - importationFolder, ReportSettings.FORMAT_PDF); + importationFolderPrintService.printCostPriceSheet( + importationFolder, ReportSettings.FORMAT_PDF); logger.debug("Printing " + title); } else { throw new AxelorException( @@ -341,25 +345,28 @@ public class ImportationFolderController { } } - - public void generateFromModel(ActionRequest request, ActionResponse response) throws AxelorException{ + public void generateFromModel(ActionRequest request, ActionResponse response) + throws AxelorException { Long importationFolderId = (Long) request.getContext().get("id"); ImportationFolder importationFolder = Beans.get(ImportationFolderRepository.class).find((long) importationFolderId); - InvoiceTemplate template = (InvoiceTemplate) request.getContext().get("$invoiceTemplate"); - InvoiceTemplate invoiceTemplate = Beans.get(InvoiceTemplateRepository.class).find(template.getId()); + InvoiceTemplate template = (InvoiceTemplate) request.getContext().get("$invoiceTemplate"); + InvoiceTemplate invoiceTemplate = + Beans.get(InvoiceTemplateRepository.class).find(template.getId()); - Invoice invoice = Beans.get(ImportationFolderServiceImpl.class).generateFromModel(importationFolder, invoiceTemplate); - - 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", Beans.get(AppSupplychainService.class).getTodayDate()) - .map()); + Invoice invoice = + Beans.get(ImportationFolderServiceImpl.class) + .generateFromModel(importationFolder, invoiceTemplate); + + 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", Beans.get(AppSupplychainService.class).getTodayDate()) + .map()); } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/PurchaseOrderLineController.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/PurchaseOrderLineController.java index b684d16..7c74095 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/PurchaseOrderLineController.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/PurchaseOrderLineController.java @@ -20,8 +20,12 @@ package com.axelor.apps.supplychain.web; import com.axelor.apps.account.service.app.AppAccountService; import com.axelor.apps.purchase.db.PurchaseOrder; import com.axelor.apps.purchase.db.PurchaseOrderLine; +import com.axelor.apps.purchase.db.PurchaseOrderLineFile; +import com.axelor.apps.purchase.db.repo.PurchaseOrderLineFileRepository; +import com.axelor.apps.supplychain.service.PurchaseOrderLineFileServiceService; import com.axelor.apps.supplychain.service.PurchaseOrderLineServiceSupplychainImpl; import com.axelor.exception.AxelorException; +import com.axelor.exception.service.TraceBackService; import com.axelor.inject.Beans; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; @@ -63,4 +67,22 @@ public class PurchaseOrderLineController { "budgetDistributionSumAmount", purchaseOrderLine.getBudgetDistributionSumAmount()); response.setValue("budgetDistributionList", purchaseOrderLine.getBudgetDistributionList()); } + + public void refuseCoa(ActionRequest request, ActionResponse response) { + + System.out.println(String.valueOf(request.getContext().get("_id"))); + Long id = new Long(String.valueOf(request.getContext().get("_id"))); + String raison = (String) request.getContext().get("refusalRaison"); + String refusalOrigin = (String) request.getContext().get("refusalOrigin"); // Assuming refusal origin is passed here + + + try { + PurchaseOrderLineFile purchaseOrderLineFile = + Beans.get(PurchaseOrderLineFileRepository.class).find(id); + Beans.get(PurchaseOrderLineFileServiceService.class).refuseCoa(purchaseOrderLineFile, raison,refusalOrigin); + + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/StockMoveController.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/StockMoveController.java index 54c6200..52db592 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/StockMoveController.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/StockMoveController.java @@ -19,6 +19,7 @@ package com.axelor.apps.supplychain.web; import com.axelor.apps.base.db.Company; import com.axelor.apps.sale.db.SaleOrder; +import com.axelor.apps.stock.db.StockLocation; import com.axelor.apps.stock.db.StockMove; import com.axelor.apps.stock.db.StockMoveLine; import com.axelor.apps.stock.db.repo.StockMoveRepository; @@ -26,19 +27,31 @@ import com.axelor.apps.supplychain.db.SupplyChainConfig; import com.axelor.apps.supplychain.exception.IExceptionMessage; import com.axelor.apps.supplychain.service.SaleOrderReservedQtyService; import com.axelor.apps.supplychain.service.SaleOrderStockService; +import com.axelor.apps.supplychain.service.StockConfigService; import com.axelor.apps.supplychain.service.StockMoveServiceSupplychain; import com.axelor.apps.supplychain.service.StockMoveServiceSupplychainImpl; import com.axelor.apps.supplychain.service.app.AppSupplychainService; import com.axelor.apps.supplychain.service.config.SupplyChainConfigService; +import com.axelor.db.JPA; +import com.axelor.exception.AxelorException; +import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.exception.service.TraceBackService; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; import com.axelor.rpc.ActionRequest; import com.axelor.rpc.ActionResponse; + +import java.lang.invoke.MethodHandles; import java.util.List; import java.util.Optional; +import javax.persistence.Query; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class StockMoveController { + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public void addSubLines(ActionRequest request, ActionResponse response) { try { @@ -125,7 +138,8 @@ public class StockMoveController { try { StockMove newStockMove = - Beans.get(StockMoveServiceSupplychainImpl.class).splitInto2SameMove(stockMove, modifiedStockMoveLineList); + Beans.get(StockMoveServiceSupplychainImpl.class) + .splitInto2SameMove(stockMove, modifiedStockMoveLineList); if (newStockMove == null) { response.setFlash(I18n.get("")); @@ -137,5 +151,93 @@ public class StockMoveController { } } + public void checkIfQuarantine(ActionRequest request, ActionResponse response) + throws AxelorException { + + StockMove stockMoveFromRequest = request.getContext().asType(StockMove.class); + + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveFromRequest.getId()); + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID"+ +" FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.product = LOCATION_LINE.product"+ +" where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.CONFORMITY_SELECT != 2 AND LOCATION_LINE.CONFORMITY_SELECT != 5 AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getFromStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + logger.debug("sql.getResultList().size()",sql.getResultList().size()); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "vous avez une ligne en etat qurantaine"); + } + } + + public void checkIfDiffNonCompliant(ActionRequest request, ActionResponse response) + throws AxelorException { + + StockMove stockMoveFromContext = request.getContext().asType(StockMove.class); + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveFromContext.getId()); + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID" + + " FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.product = LOCATION_LINE.product" + + " where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.CONFORMITY_SELECT != 3 AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getFromStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + logger.debug("sql.getResultList().size()",sql.getResultList().size()); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "vous avez une ligne differente de NC"); + } + } + + public void checkIfNonCompliant(ActionRequest request, ActionResponse response) + throws AxelorException { + + StockMove stockMoveFromContext = request.getContext().asType(StockMove.class); + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveFromContext.getId()); + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID" + + " FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.product = LOCATION_LINE.product" + + " where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.CONFORMITY_SELECT = 3 AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getFromStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + logger.debug("sql.getResultList().size()",sql.getResultList().size()); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "vous avez une ligne NC"); + } + } + + public void checkIfNonConformityTag(ActionRequest request, ActionResponse response) + throws AxelorException { + + StockMove stockMoveFromContext = request.getContext().asType(StockMove.class); + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMoveFromContext.getId()); + Query sql = + JPA.em() + .createNativeQuery( + "SELECT LINE.ID" + + " FROM STOCK_STOCK_MOVE_LINE LINE LEFT JOIN STOCK_STOCK_LOCATION_LINE LOCATION_LINE ON LINE.TRACKING_NUMBER = LOCATION_LINE.TRACKING_NUMBER and LINE.product = LOCATION_LINE.product" + + " where LOCATION_LINE.DETAILS_STOCK_LOCATION = ?1 AND LOCATION_LINE.is_conform_tag is not true AND LINE.STOCK_MOVE = ?2"); + sql.setParameter(1, stockMove.getFromStockLocation().getId()); + sql.setParameter(2, stockMove.getId()); + logger.debug("sql.getResultList().size {}",sql.getResultList().size()); + if (sql.getResultList().size() > 0) { + throw new AxelorException( + stockMove, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + "vous avez une ligne non étiqueté"); + } + } } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplierRatingController.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplierRatingController.java index d628bc1..1229536 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplierRatingController.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplierRatingController.java @@ -13,47 +13,47 @@ import org.slf4j.LoggerFactory; public class SupplierRatingController { - private static final Logger LOG = LoggerFactory.getLogger(SupplierRatingController.class); + private static final Logger LOG = LoggerFactory.getLogger(SupplierRatingController.class); - private SupplierRatingServiceImpl service; + private SupplierRatingServiceImpl service; - @Inject - public SupplierRatingController(SupplierRatingServiceImpl service) { - this.service = service; + @Inject + public SupplierRatingController(SupplierRatingServiceImpl service) { + this.service = service; + } + + public void rating(ActionRequest request, ActionResponse response) { + + SupplierRating supplierRating = request.getContext().asType(SupplierRating.class); + + Integer paymentDelayRatingSelect = supplierRating.getPaymentDelayRatingSelect(); + Integer deliveryTimeRatingSelect = supplierRating.getDeliveryTimeRatingSelect(); + Integer complianceWithTechnicalSpecificationsRatingSelect = + supplierRating.getComplianceWithTechnicalSpecificationsRatingSelect(); + Integer priceRatingSelect = supplierRating.getPriceRatingSelect(); + Integer quantityComplianceRatingSelect = supplierRating.getQuantityComplianceRatingSelect(); + Integer complaintManagementRatingSelect = supplierRating.getComplaintManagementRatingSelect(); + Integer priceStabilityRatingSelect = supplierRating.getPriceStabilityRatingSelect(); + + if (paymentDelayRatingSelect != null + && deliveryTimeRatingSelect != null + && complianceWithTechnicalSpecificationsRatingSelect != null + && priceRatingSelect != null + && quantityComplianceRatingSelect != null + && complaintManagementRatingSelect != null + && priceStabilityRatingSelect != null) { + service.calculatRating(supplierRating); + response.setValue("overallScore", supplierRating.getOverallScore()); + } else { + String message = "You should fill all Fields First."; + response.setFlash(message); } + } - public void rating(ActionRequest request, ActionResponse response) { - - SupplierRating supplierRating = request.getContext().asType(SupplierRating.class); - - Integer paymentDelayRatingSelect = supplierRating.getPaymentDelayRatingSelect(); - Integer deliveryTimeRatingSelect = supplierRating.getDeliveryTimeRatingSelect(); - Integer complianceWithTechnicalSpecificationsRatingSelect = - supplierRating.getComplianceWithTechnicalSpecificationsRatingSelect(); - Integer priceRatingSelect = supplierRating.getPriceRatingSelect(); - Integer quantityComplianceRatingSelect = supplierRating.getQuantityComplianceRatingSelect(); - Integer complaintManagementRatingSelect = supplierRating.getComplaintManagementRatingSelect(); - Integer priceStabilityRatingSelect = supplierRating.getPriceStabilityRatingSelect(); - - if (paymentDelayRatingSelect != null - && deliveryTimeRatingSelect != null - && complianceWithTechnicalSpecificationsRatingSelect != null - && priceRatingSelect != null - && quantityComplianceRatingSelect != null - && complaintManagementRatingSelect != null - && priceStabilityRatingSelect != null) { - service.calculatRating(supplierRating); - response.setValue("overallScore", supplierRating.getOverallScore()); - } else { - String message = "You should fill all Fields First."; - response.setFlash(message); - } - } - - public void rateSupplier(ActionRequest request, ActionResponse response) { - System.out.println("Start"); - StockMove stockMovetemp = request.getContext().asType(StockMove.class); - StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMovetemp.getId()); - service.createRating(stockMove); - } -} \ No newline at end of file + public void rateSupplier(ActionRequest request, ActionResponse response) { + System.out.println("Start"); + StockMove stockMovetemp = request.getContext().asType(StockMove.class); + StockMove stockMove = Beans.get(StockMoveRepository.class).find(stockMovetemp.getId()); + service.createRating(stockMove); + } +} diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplychainBatchController.java b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplychainBatchController.java index db0d022..382e3bb 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplychainBatchController.java +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/java/com/axelor/apps/supplychain/web/SupplychainBatchController.java @@ -87,14 +87,14 @@ public class SupplychainBatchController { @SuppressWarnings("unchecked") List ids = - (List) - (((List) request.getContext().get("_ids")) - .stream() - .filter(ObjectUtils::notEmpty) - .map(input -> Long.parseLong(input.toString())) - .collect(Collectors.toList())); - List moveList = Beans.get(AccountingCutOffServiceImpl.class).massGenerationMove(ids); - + (List) + (((List) request.getContext().get("_ids")) + .stream() + .filter(ObjectUtils::notEmpty) + .map(input -> Long.parseLong(input.toString())) + .collect(Collectors.toList())); + List moveList = Beans.get(AccountingCutOffServiceImpl.class).massGenerationMove(ids); + if (moveList != null && !moveList.isEmpty()) { response.setView( ActionView.define(I18n.get(IExceptionMessage.MOVE_TEMPLATE_3)) @@ -109,20 +109,20 @@ public class SupplychainBatchController { } } - public void generateInventoryLineMove(ActionRequest request, ActionResponse response) { try { @SuppressWarnings("unchecked") List ids = - (List) - (((List) request.getContext().get("_ids")) - .stream() - .filter(ObjectUtils::notEmpty) - .map(input -> Long.parseLong(input.toString())) - .collect(Collectors.toList())); - List moveList = Beans.get(AccountingCutOffServiceImpl.class).massGenerationInventoryLineMove(ids); - + (List) + (((List) request.getContext().get("_ids")) + .stream() + .filter(ObjectUtils::notEmpty) + .map(input -> Long.parseLong(input.toString())) + .collect(Collectors.toList())); + List moveList = + Beans.get(AccountingCutOffServiceImpl.class).massGenerationInventoryLineMove(ids); + if (moveList != null && !moveList.isEmpty()) { response.setView( ActionView.define(I18n.get(IExceptionMessage.MOVE_TEMPLATE_3)) @@ -136,5 +136,4 @@ public class SupplychainBatchController { TraceBackService.trace(response, e); } } - } diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/AnalyticMoveLine.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/AnalyticMoveLine.xml index b54958d..ac92b62 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/AnalyticMoveLine.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/AnalyticMoveLine.xml @@ -9,7 +9,13 @@ - + + + + + + + diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/BudgetDistribution.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/BudgetDistribution.xml index 46c91e6..7f75950 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/BudgetDistribution.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/BudgetDistribution.xml @@ -8,7 +8,10 @@ + + + diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/MrpForecast.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/MrpForecast.xml index a81ad88..b6ae6a6 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/MrpForecast.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/MrpForecast.xml @@ -7,6 +7,7 @@ + @@ -15,7 +16,7 @@ - + + + + diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequest.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequest.xml index a195b3b..4647b80 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequest.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequest.xml @@ -8,6 +8,8 @@ + + diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequestLine.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequestLine.xml new file mode 100644 index 0000000..b64c263 --- /dev/null +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/PurchaseRequestLine.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockConfig.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockConfig.xml index 56ce099..6d754f3 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockConfig.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockConfig.xml @@ -7,7 +7,9 @@ - + + + diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMove.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMove.xml index 39558a7..1cb669e 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMove.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMove.xml @@ -18,6 +18,14 @@ + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMoveLine.xml b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMoveLine.xml index 8cf615e..6ff3a31 100644 --- a/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMoveLine.xml +++ b/modules/axelor-open-suite/axelor-supplychain/src/main/resources/domains/StockMoveLine.xml @@ -23,6 +23,12 @@ + + + + + + diff --git a/settings.gradle b/settings.gradle index 8f835a4..c6ca0c8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ //Include all modules -rootProject.name = "axelor-erp" +rootProject.name = "sophal" def modules = [] file("modules").traverse(type: groovy.io.FileType.DIRECTORIES, maxDepth: 1) { it -> diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 67937dd..40d5144 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,9 +8,10 @@ # ~~~~~ db.default.driver = org.postgresql.Driver db.default.ddl = update -db.default.url = jdbc:postgresql://localhost:5432/bdd_test2 +db.default.url = jdbc:postgresql://localhost:5432/bdd_aout +# db.default.url = jdbc:postgresql://db:5432/bdd_sophal db.default.user = postgres -db.default.password = Mal@Ben$$23 +db.default.password = root # Api # ~~~~~ @@ -140,20 +141,20 @@ hibernate.search.default.indexBase = {java.io.tmpdir}/axelor # HikariCP connection pool # ~~~~~ -hibernate.hikari.minimumIdle = 5 -hibernate.hikari.maximumPoolSize = 25 +hibernate.hikari.minimumIdle = 15 +hibernate.hikari.maximumPoolSize = 40 hibernate.hikari.idleTimeout = 300000 # CORS configuration to allow cross origin requests # ~~~~~ # regular expression to test allowed origin or * to allow all (not recommended) # regular expression to test allowed origin or * to allow all (not recommended) -# cors.allow.origin = * -# cors.allow.credentials = true -# cors.allow.methods = GET,PUT,POST,DELETE,HEAD,OPTIONS -# cors.allow.headers = Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers -# cors.expose.headers = -# cors.max.age = 1728000 +cors.allow.origin = * +cors.allow.credentials = true +cors.allow.methods = GET,PUT,POST,DELETE,HEAD,OPTIONS +cors.allow.headers = Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers +cors.expose.headers = +cors.max.age = 1728000 # Logging # ~~~~~ # Custom logback configuration can be provided with `logging.config` property pointing @@ -197,7 +198,7 @@ logging.level.com.axelor = DEBUG # Quartz scheduler # ~~~~~ -quartz.enable = true +quartz.enable = false quartz.threadCount = 1 # Allows to open maximum 10 Tabs