Merge branch 'develop' into feature/JDK11
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -369,7 +369,7 @@ public class AccountingBusinessLogic {
|
||||
if (("S".equals(testata.getGeneraScad()) || numCmovRC == null) && testata.getCtbMovtRc() == null) {
|
||||
List<CtbScad> elencoScadenze = testata.getCtbScad();
|
||||
if (elencoScadenze == null) {
|
||||
elencoScadenze = loadScadenze(conn, testata.getTipoAnag(), testata.getCodAnag(), testata.getAnnoComp(), testata.getSerDoc(), testata.getNumDoc());
|
||||
elencoScadenze = loadScadenze(conn, testata.getTipoAnag(), testata.getCodAnag(), testata.getDataDoc(), testata.getSerDoc(), testata.getNumDoc());
|
||||
}
|
||||
if (elencoScadenze != null && !elencoScadenze.isEmpty()) {
|
||||
//CALCOLO LE SCADENZE SOLO SE IL MOVIMENTO E' NUOVO
|
||||
@@ -499,6 +499,11 @@ public class AccountingBusinessLogic {
|
||||
return residuo;
|
||||
}
|
||||
|
||||
public static List<CtbScad> loadScadenze(Connection conn, String tipoAnag, String codAnag, Date dataDoc, String serDoc, Integer numDoc) throws Exception {
|
||||
return loadScadenze(conn, tipoAnag, codAnag, UtilityDate.datePart(Calendar.YEAR, dataDoc), serDoc, numDoc);
|
||||
|
||||
}
|
||||
|
||||
public static List<CtbScad> loadScadenze(Connection conn, String tipoAnag, String codAnag, Integer annoPart, String serDoc, Integer numDoc) throws Exception {
|
||||
String sql =
|
||||
"SELECT ctb_scad.* , ctb_part.tipo_partita " +
|
||||
|
||||
@@ -234,22 +234,13 @@ public class DocumentRules extends QueryRules {
|
||||
}
|
||||
|
||||
public static String completeGeneraMovCont(Connection conn, DtbDoct entity) throws Exception {
|
||||
String codCcau = null;
|
||||
String codDtip = entity.getCodDtip();
|
||||
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT IsNull(cod_ccau, cod_ccau_ant) as cod_ccau " +
|
||||
" FROM dtb_tipi " +
|
||||
" WHERE dtb_tipi.cod_dtip = " + UtilityDB.valueToString(codDtip);
|
||||
" WHERE dtb_tipi.cod_dtip = %s", entity.getCodDtip());
|
||||
|
||||
PreparedStatement ps = conn.prepareStatement(sql);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
if (rs.next()) {
|
||||
codCcau = rs.getString(1);
|
||||
}
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
String codCcau = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
|
||||
String generaMovCont = "N";
|
||||
if (!UtilityString.isNullOrEmpty(codCcau)) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DroolsDataCompleting {
|
||||
"OrdP.drl", "DocL.drl", "LottiProd.drl", "Agenti.drl",
|
||||
"commesse.drl", "inventari.drl", "DistBase.drl",
|
||||
"tabGenTextiles.drl", "OrdWebV.drl", "ordini.drl",
|
||||
"attach.drl", "sian.drl","Integry.drl"
|
||||
"attach.drl", "sian.drl","Integry.drl", "RossoGargano.drl"
|
||||
};
|
||||
|
||||
@PreDestroy
|
||||
|
||||
24
ems-core/src/main/resources/rules/RossoGargano.drl
Normal file
24
ems-core/src/main/resources/rules/RossoGargano.drl
Normal file
@@ -0,0 +1,24 @@
|
||||
package it.integry.rules
|
||||
|
||||
import java.math.*
|
||||
import java.util.*
|
||||
import it.integry.ems_model.entity.*
|
||||
import it.integry.ems_model.base.EntityBase
|
||||
import it.integry.ems.rules.util.*
|
||||
import it.integry.ems.rules.completing.*
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.IntegryCustomer
|
||||
import it.integry.ems_model.utility.Query
|
||||
import it.integry.ems_model.utility.UtilityDB
|
||||
import it.integry.ems_model.config.EmsRestConstants
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
|
||||
global Connection conn
|
||||
global String username
|
||||
global Boolean checkRulesEnabled
|
||||
global Boolean completeRulesEnabled
|
||||
global IntegryCustomerDB customerDb
|
||||
global IntegryCustomer customer
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ public class AutofatturaService {
|
||||
"ctb_movt.tipo_anag, " +
|
||||
"ctb_movt.cod_anag, " +
|
||||
"ctb_movt.anno_comp, " +
|
||||
"ctb_movt.data_doc, " +
|
||||
"ctb_movt.ser_doc, " +
|
||||
"ctb_movt.num_doc, " +
|
||||
"ctb_movt.data_cmov, " +
|
||||
@@ -265,7 +266,7 @@ public class AutofatturaService {
|
||||
entityList.add(crlMovtRifCmov);
|
||||
if (pagaScadenze) {
|
||||
List<CtbScad> elencoScadenze = AccountingBusinessLogic.loadScadenze(multiDBTransactionManager.getPrimaryConnection(),
|
||||
ctbMovtOrig.getTipoAnag(), ctbMovtOrig.getCodAnag(), ctbMovtOrig.getAnnoComp(), ctbMovtOrig.getSerDoc(), ctbMovtOrig.getNumDoc());
|
||||
ctbMovtOrig.getTipoAnag(), ctbMovtOrig.getCodAnag(), ctbMovtOrig.getDataDoc(), ctbMovtOrig.getSerDoc(), ctbMovtOrig.getNumDoc());
|
||||
if (elencoScadenze != null && !elencoScadenze.isEmpty()) {
|
||||
//CALCOLO LE SCADENZE SOLO SE IL MOVIMENTO E' NUOVO
|
||||
BigDecimal residuo = docRet.getTotIva();
|
||||
|
||||
@@ -620,7 +620,7 @@ public class ContabilService {
|
||||
List<CtbScad> elencoScadenze = null;
|
||||
if (chiudiPartita) {
|
||||
BigDecimal impScadDivisa = impScad.multiply(cambioPart);
|
||||
elencoScadenze = AccountingBusinessLogic.loadScadenze(multiDBTransactionManager.getPrimaryConnection(), riga.getTipoAnag(), codAnag, UtilityDate.getYear(riga.getDataDoc()), riga.getSerDoc(), riga.getNumDoc());
|
||||
elencoScadenze = AccountingBusinessLogic.loadScadenze(multiDBTransactionManager.getPrimaryConnection(), riga.getTipoAnag(), codAnag, riga.getDataDoc(), riga.getSerDoc(), riga.getNumDoc());
|
||||
if (elencoScadenze != null && !elencoScadenze.isEmpty()) {
|
||||
elencoScadenze = Stream.of(elencoScadenze).filter(s -> s.getIdRiga().equals(riga.getNumScad()) && s.getDataPag() == null).toList();
|
||||
if (elencoScadenze != null && !elencoScadenze.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user