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:
@@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomer;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250513122548 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetupQuery("COD_DTIP_A_VAL", "COD_DTIP_A_VAL", "SELECT COD_DTIP + '|' + COD_DTIP + ' - ' + DESCRIZIONE FROM DTB_TIPI WHERE gestione = 'A' AND segno_qta_car = 0 AND segno_val_car <> 0 AND flag_costo = 'S' AND tipo_emissione = 'DIRETTA' ");
|
||||||
|
createSetup("DTB_DOCT", "ALLINEA_COSTO_SUDDIVISIONE", "COD_DTIP", null,
|
||||||
|
"Inserire il tipo documento che verrà utilizzato per l'allineamento del costo.", false, "COD_DTIP_A_VAL", false, false,
|
||||||
|
false, false, false, null, false, "SELECT COD_DTIP + '|' + COD_DTIP + ' - ' + DESCRIZIONE FROM DTB_TIPI WHERE gestione = 'A' AND segno_qta_car = 0 AND segno_val_car <> 0 AND flag_costo = 'S' AND tipo_emissione = 'DIRETTA' ");
|
||||||
|
if (isCustomer(IntegryCustomer.Carelli)) {
|
||||||
|
updateSetupValue("DTB_DOCT", "ALLINEA_COSTO_SUDDIVISIONE", "COD_DTIP", "COSTO");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.ems.document.service;
|
||||||
|
|
||||||
|
import it.integry.ems.service.EntityProcessor;
|
||||||
|
import it.integry.ems_model.entity.DtbDoct;
|
||||||
|
import it.integry.ems_model.service.SetupGest;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Scope;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Scope("request")
|
||||||
|
public class AllinementoCostoSuddivisioneService {
|
||||||
|
private final Logger logger = LogManager.getLogger();
|
||||||
|
@Autowired
|
||||||
|
private SetupGest setupGest;
|
||||||
|
@Autowired
|
||||||
|
private EntityProcessor entityProcessor;
|
||||||
|
|
||||||
|
public List<DtbDoct> allineaCosto(LocalDate dataIniz) throws Exception {
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
|
while (dataIniz.isBefore(today) || dataIniz.isEqual(today)) {
|
||||||
|
|
||||||
|
dataIniz = dataIniz.plusDays(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user