varie: steup, invio variazioni, controllo resi
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20241022134530 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("PVM", "DOC_INTERNI", "DAYS_TO_EXP", null,
|
||||
"Giorni da utilizzare per considerare l'articolo scaduto", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Carelli_Carelli) || isCustomerDb(IntegryCustomerDB.Carelli_GestFood) || isCustomerDb(IntegryCustomerDB.Carelli_Panimal))
|
||||
updateSetupValue("PVM", "DOC_INTERNI", "DAYS_TO_EXP", "5");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20241022151650 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
deleteSetup("w_marti_rc", "SETUP", "RICHIEDI_DATA_VAR");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -853,7 +853,8 @@ public class SteUPService {
|
||||
sql = UtilityDB.addwhereCond(sql, whereCond, false);
|
||||
} else if (activityTypeId.equalsIgnoreCase(tipoAttivitaRotturaStock)) {
|
||||
if (repartiFreschi.contains(codJfas)) {
|
||||
sql = "Select cod_mart,descrizione,bar_code as barcode,cod_msgr from steup_getGrigliaVendita(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ")";
|
||||
sql = "Select cod_mart,descrizione,bar_code as barcode,cod_msgr " +
|
||||
" from steup_getGrigliaVendita(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ") order by descrizione";
|
||||
} else if (chkRotturaStock) {
|
||||
sql = "SELECT cod_mart,descrizione,bar_code as barcode,cod_msgr\n" +
|
||||
"FROM steup_getAssortimento(" + UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codJfas) + ", " + UtilityDB.valueToString(dataCreation) +") art\n" +
|
||||
|
||||
@@ -90,6 +90,7 @@ public class OlioProductionService {
|
||||
Short segnoDoc = (Short) datiDoc.get("segno_doc");
|
||||
|
||||
List<DtbDocr> righeDoc = new ArrayList<>();
|
||||
if ( olioProductionDTO.getRigaMov() != null && !olioProductionDTO.getRigaMov().isEmpty() ) {
|
||||
for (OlioProductionDTO.RigaMov riga : olioProductionDTO.getRigaMov()) {
|
||||
String posizione = riga.getPosturaFine().getPosizione();
|
||||
|
||||
@@ -272,6 +273,7 @@ public class OlioProductionService {
|
||||
entityList.add(dtbDoctCar);
|
||||
}
|
||||
dtbDoct.setDtbDocr(righeDoc);
|
||||
}
|
||||
entityList.add(dtbDoct);
|
||||
} else {
|
||||
String whereCondDoc =
|
||||
|
||||
@@ -726,19 +726,19 @@ public class VariazioniPvService {
|
||||
" 'A' AS tipo_variazione,\n" +
|
||||
" CONVERT(VARCHAR(15), NULL) AS cod_mart_new\n" +
|
||||
" FROM mtb_aart\n" +
|
||||
" WHERE mtb_aart.data_ult_var = '[DATA_VALIDITA]'\n" +
|
||||
" WHERE mtb_aart.data_ult_var BETWEEN dateAdd( day, -1, '[DATA_VALIDITA]') AND '[DATA_VALIDITA]'\n" +
|
||||
" UNION\n" +
|
||||
" SELECT jtb_cicl.cod_prod,\n" +
|
||||
" 'A' AS tipo_variazione,\n" +
|
||||
" CONVERT(VARCHAR(15), NULL) AS cod_mart_new\n" +
|
||||
" FROM jtb_cicl\n" +
|
||||
" WHERE jtb_cicl.data_ult_var = '[DATA_VALIDITA]'\n" +
|
||||
" WHERE jtb_cicl.data_ult_var BETWEEN dateAdd( day, -1, '[DATA_VALIDITA]') AND '[DATA_VALIDITA]'\n" +
|
||||
" UNION\n" +
|
||||
" SELECT mtb_cambio_art.codice_nuovo,\n" +
|
||||
" 'C' AS tipo_variazione,\n" +
|
||||
" mtb_cambio_art.codice_vecchio\n" +
|
||||
" FROM mtb_cambio_art\n" +
|
||||
" WHERE CAST(mtb_cambio_art.dataora_cambio AS DATE) = '[DATA_VALIDITA]') art\n" +
|
||||
" WHERE CAST(mtb_cambio_art.dataora_cambio AS DATE) BETWEEN dateAdd( day, -1, '[DATA_VALIDITA]') AND '[DATA_VALIDITA]') art\n" +
|
||||
" INNER JOIN (SELECT vtb_list.cod_vlis AS cod_vlis,\n" +
|
||||
" mtb_lisv.cod_mart\n" +
|
||||
" FROM vtb_list\n" +
|
||||
@@ -813,7 +813,6 @@ public class VariazioniPvService {
|
||||
"Convert(varchar(1), max(assortimento.fine_promo)) as fine_promo\n " +
|
||||
" FROM (\n" + queryAssortimento + "\n) assortimento inner join mtb_aart on assortimento.cod_mart = mtb_aart.cod_mart\n " +
|
||||
" WHERE mtb_aart.flag_incl_listino = 'S' AND\n " +
|
||||
"mtb_aart.flag_stato = 'A' AND\n " +
|
||||
" EXISTS ( SELECT cod_barre from mvw_barcode WHERE mvw_barcode.cod_mart = mtb_aart.cod_mart )\n " +
|
||||
(UtilityString.isNullOrEmpty(whereCond) ? "" : " AND " + whereCond) +
|
||||
(UtilityString.isNullOrEmpty(filtroMenu) ? "" : " AND " + filtroMenu) +
|
||||
|
||||
@@ -2684,6 +2684,8 @@ public class PvmService {
|
||||
}
|
||||
|
||||
if (chkTracciabilita) {
|
||||
String gg = setupGest.getSetup("PVM", "DOC_INTERNI", "DAYS_TO_EXP");
|
||||
|
||||
sql =
|
||||
Query.format(
|
||||
"WITH " +
|
||||
@@ -2810,11 +2812,18 @@ public class PvmService {
|
||||
continue;
|
||||
}
|
||||
/*valutare se creare una setup per riconoscere DDTEC*/
|
||||
if (UtilityDate.DaysAfter(dataScad, UtilityDate.getTodayWithoutTime()) > 0 && codDtip.equalsIgnoreCase("DDTEC")) {
|
||||
anomalieResiDTO.add(setAnomalia(anomalieResiDTO, codMart, dataScad, "Impossibile effetture un reso di in articolo già scaduto."));
|
||||
if (codDtip.equalsIgnoreCase("DDTEC")) {
|
||||
if (UtilityDate.DaysAfter(dataScad, UtilityDate.getTodayWithoutTime()) > 0 ) {
|
||||
anomalieResiDTO.add(setAnomalia(anomalieResiDTO, codMart, dataScad, "Impossibile effetture un reso di un articolo già scaduto."));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(gg) && UtilityDate.DaysAfter(dataScad, UtilityDate.dateAdd(Calendar.DATE, Integer.parseInt(gg), UtilityDate.getTodayWithoutTime())) > 0 ) {
|
||||
anomalieResiDTO.add(setAnomalia(anomalieResiDTO, codMart, dataScad, "Impossibile effetture un reso di un articolo sotto scadenza."));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (UtilityDate.DaysAfter(dataScad, UtilityDate.getTodayWithoutTime()) > 15) {
|
||||
anomalieResiDTO.add(setAnomalia(anomalieResiDTO, codMart, dataScad, "Impossibile effetture un reso dopo più di 15gg dalla scadenza."));
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user