Merge branch 'develop' into feature/RefactoringGestioneColli
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:
@@ -13,6 +13,9 @@ public class Migration_20250923113155 extends BaseMigration implements Migration
|
||||
if (!isTextiles())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("ftx_getDisponibilitaArticoli", "CREATE FUNCTION [dbo].[ftx_getDisponibilitaArticoli](@datavalidita DATETIME,\n" +
|
||||
" @codmdep VARCHAR(8000),\n" +
|
||||
" @annostag VARCHAR(10),\n" +
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250924151610 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("COD_PROMO_TAGLI", "Query per selezionare i tagli prezzo", "SELECT COD_PROMO FROM VTB_PROMO WHERE flag_tipo_promo = 'T'");
|
||||
executeStatement("update stb_gest_setup\n" +
|
||||
"set query_default = 'c' where gest_name = 'pvm' and section = 'CHIUSURA_TAGLI_PREZZO'\n" +
|
||||
"and key_section ='COD_PROMO_TAGLI' ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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_20250925130833 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Carelli))
|
||||
return;
|
||||
|
||||
|
||||
updateSetupValue("DATI_AZIENDA", "SETUP", "LOGIN_OVER_WEBSERVICES", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250925133902 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isTextiles()) return;
|
||||
|
||||
|
||||
executeStatement(
|
||||
"alter table ttb_grtg_el add range_taglie tinyint DEFAULT 1; ",
|
||||
"update ttb_grtg_el set range_taglie = 1; ",
|
||||
"alter table ttb_grtg_el alter column range_taglie tinyint NOT NULL; ",
|
||||
"create table ttb_qta_min_ord ( " +
|
||||
" cod_style varchar(15) not null, " +
|
||||
" cod_grtg varchar(5) not null, " +
|
||||
" range_taglie tinyint not null, " +
|
||||
" qta_min_ord numeric(20,5) not null default 0) ",
|
||||
"alter table ttb_qta_min_ord ADD constraint pk_ttb_qta_min_ord primary key (cod_style, cod_grtg, range_taglie, qta_min_ord); ",
|
||||
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_style FOREIGN KEY(cod_style) REFERENCES dbo.ttb_style ( cod_style )",
|
||||
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_grtg FOREIGN KEY(cod_grtg) REFERENCES dbo.ttb_grtg ( cod_grtg )");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250925145607 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("f_GetCostoUltArt_depo", "CREATE FUNCTION [dbo].[f_GetCostoUltArt_depo](@dataReg datetime, @codMdep varchar(5), @codMart varchar(15))\n" +
|
||||
"RETURNS numeric(20,5) AS\n" +
|
||||
"BEGIN\n" +
|
||||
" /* UFFICIALE DEL 20-06-2016 */\n" +
|
||||
" DECLARE @lc_costoUltUnt numeric(20,5),\n" +
|
||||
" @lc_costoComp numeric(20,5),\n" +
|
||||
" @ls_codComp varchar(15),\n" +
|
||||
" @lc_qtaStd numeric(20,5),\n" +
|
||||
" @ls_flagCalcPrzAcq varchar(1),\n" +
|
||||
" @ls_isKit varchar(1),\n" +
|
||||
" @ls_idArtEqui varchar(40),\n" +
|
||||
" @ls_flagUltCostoEqui varchar(1),\n" +
|
||||
" @ls_flagArticoloMov varchar(1),\n" +
|
||||
" @ls_codMartEqui varchar(40),\n" +
|
||||
" @ldt_dataDocMax datetime,\n" +
|
||||
" @lc_qtaCarTot numeric(20,5),\n" +
|
||||
" @lc_valCarTot numeric(20,5);\n" +
|
||||
" \n" +
|
||||
" select @ls_isKit = 'N';\n" +
|
||||
" \n" +
|
||||
" select @codMdep = (case when value = 'S' AND @codMdep is not null then @codMdep else null end) \n" +
|
||||
" from stb_gest_setup where gest_name = 'dati_azienda' and section = 'COSTO_ULTIMO' AND key_section = 'COSTO_DA_DEPO' \n" +
|
||||
"\n" +
|
||||
" Declare csr_comp Cursor LOCAL SCROLL FOR\n" +
|
||||
" SELECT mtb_comp.cod_comp, \n" +
|
||||
" mtb_comp.qta_std,\n" +
|
||||
" mtb_aart.flag_calc_prz_acq \n" +
|
||||
" FROM mtb_comp,\n" +
|
||||
" mtb_aart\n" +
|
||||
" WHERE mtb_comp.cod_mart = @codMart and\n" +
|
||||
" mtb_aart.cod_mart = mtb_comp.cod_mart and\n" +
|
||||
" mtb_aart.articolo_composto = 'S' ;\n" +
|
||||
" OPEN csr_comp\n" +
|
||||
" FETCH NEXT FROM csr_comp INTO @ls_codComp, @lc_qtaStd, @ls_flagCalcPrzAcq\n" +
|
||||
" if @@CURSOR_ROWS > 0\n" +
|
||||
" begin\n" +
|
||||
"\n" +
|
||||
" select @ls_isKit = 'S'\n" +
|
||||
" SELECT @lc_costoUltUnt = 0 \n" +
|
||||
" if @ls_flagCalcPrzAcq = 'K' \n" +
|
||||
" begin\n" +
|
||||
" SELECT @lc_costoUltUnt = IsNull(Round(sum([dbo].[f_getPrzNettoAcqArt] (last_doc.data_doc,last_doc.listino,last_doc.cod_mart,last_doc.cod_art_for)) * last_doc.cambio / gtb_divi.cambio_euro , 5),0)\n" +
|
||||
" FROM dtb_docr, \n" +
|
||||
" gtb_anag,\n" +
|
||||
" (SELECT TOP 1 dtb_doct.cod_anag,\n" +
|
||||
" dtb_doct.cod_dtip,\n" +
|
||||
" dtb_doct.data_doc,\n" +
|
||||
" dtb_doct.ser_doc,\n" +
|
||||
" dtb_doct.num_doc,\n" +
|
||||
" dtb_doct.cod_divi,\n" +
|
||||
" dtb_doct.cambio,\n" +
|
||||
" dtb_doct.listino,\n" +
|
||||
" dtb_docr.cod_mart,\n" +
|
||||
" dtb_docr.cod_art_for\n" +
|
||||
" FROM dtb_doct, \n" +
|
||||
" dtb_docr,\n" +
|
||||
" dtb_tipi\n" +
|
||||
" WHERE dtb_doct.cod_anag = dtb_docr.cod_anag and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_docr.cod_dtip and\n" +
|
||||
" dtb_doct.data_doc = dtb_docr.data_doc and\n" +
|
||||
" dtb_doct.ser_doc = dtb_docr.ser_doc and\n" +
|
||||
" dtb_doct.num_doc = dtb_docr.num_doc and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_tipi.cod_dtip and \n" +
|
||||
" dtb_tipi.segno_val_car = 1 and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" dtb_doct.data_doc <= @dataReg and\n" +
|
||||
" dtb_docr.cod_mart = @codMart and\n" +
|
||||
" dtb_doct.cod_mdep like IsNUll(@codMdep, '%')\n" +
|
||||
" ORDER BY dtb_doct.data_reg DESC ) last_doc, \n" +
|
||||
" mtb_aart,\n" +
|
||||
" gtb_divi\n" +
|
||||
" WHERE dtb_docr.cod_anag = last_doc.cod_anag and\n" +
|
||||
" dtb_docr.cod_dtip = last_doc.cod_dtip and\n" +
|
||||
" dtb_docr.data_doc = last_doc.data_doc and\n" +
|
||||
" dtb_docr.ser_doc = last_doc.ser_doc and\n" +
|
||||
" dtb_docr.num_doc = last_doc.num_doc and\n" +
|
||||
" dtb_docr.cod_mart = last_doc.cod_mart and\n" +
|
||||
" last_doc.cod_anag = gtb_anag.cod_anag and\n" +
|
||||
" dtb_docr.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" last_doc.cod_divi = gtb_divi.cod_divi and\n" +
|
||||
" mtb_aart.cod_mart = @codMart\n" +
|
||||
" group by last_doc.cambio , gtb_divi.cambio_euro \n" +
|
||||
" end\n" +
|
||||
" end\n" +
|
||||
" \n" +
|
||||
" if @lc_costoUltUnt = 0 or @ls_flagCalcPrzAcq = 'C'\n" +
|
||||
" begin\n" +
|
||||
" WHILE @@FETCH_STATUS = 0\n" +
|
||||
" Begin\n" +
|
||||
" select @lc_costoComp = dbo.f_GetCostoUltArt_depo(@dataReg, @codMdep, @ls_codComp)\n" +
|
||||
" select @lc_costoUltUnt = @lc_costoUltUnt + (@lc_costoComp * @lc_qtaStd)\n" +
|
||||
" FETCH NEXT FROM csr_comp INTO @ls_codComp, @lc_qtaStd, @ls_flagCalcPrzAcq\n" +
|
||||
" end\n" +
|
||||
" close csr_comp\n" +
|
||||
" deallocate csr_comp\n" +
|
||||
" end \n" +
|
||||
" select @ldt_dataDocMax = null;\n" +
|
||||
" if @ls_isKit = 'N' \n" +
|
||||
" begin\n" +
|
||||
" SELECT @ls_idArtEqui = mtb_aart.id_art_equi, \n" +
|
||||
" @ls_flagUltCostoEqui = mtb_aart_equi.flag_equi_costo, \n" +
|
||||
" @ls_flagArticoloMov = mtb_aart.flag_mov_art_mag \n" +
|
||||
" FROM mtb_aart_equi, mtb_aart \n" +
|
||||
" WHERE mtb_aart.id_art_equi = mtb_aart_equi.id_art_equi AND \n" +
|
||||
" mtb_aart.cod_mart = @codMart;\n" +
|
||||
" \n" +
|
||||
" if @ls_idArtEqui is not null and Len(@ls_idArtEqui) > 0 and (@ls_flagUltCostoEqui = 'S' )\n" +
|
||||
" begin\n" +
|
||||
" if @codMdep is null\n" +
|
||||
" begin\n" +
|
||||
" SELECT TOP 1 @ls_codMartEqui = mtb_movi.cod_mart, \n" +
|
||||
" @ldt_dataDocMax = Max(data_reg)\n" +
|
||||
" FROM mtb_movi, mtb_aart, dtb_tipi\n" +
|
||||
" WHERE mtb_aart.id_art_equi = @ls_idArtEqui and\n" +
|
||||
" mtb_movi.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" mtb_movi.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" qta_car > 0 AND val_car > 0 and\n" +
|
||||
" data_reg <= @dataReg\n" +
|
||||
" group by mtb_movi.cod_mart\n" +
|
||||
" order by 2 desc;\n" +
|
||||
" end \n" +
|
||||
" else\n" +
|
||||
" begin\n" +
|
||||
" SELECT TOP 1 @ls_codMartEqui = mtb_movi.cod_mart, \n" +
|
||||
" @ldt_dataDocMax = Max(data_reg) \n" +
|
||||
" FROM mtb_movi, mtb_aart, dtb_tipi\n" +
|
||||
" WHERE mtb_aart.id_art_equi = @ls_idArtEqui and\n" +
|
||||
" mtb_movi.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" mtb_movi.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" qta_car > 0 AND val_car > 0 and\n" +
|
||||
" cod_mdep = @codMdep and\n" +
|
||||
" data_reg <= @dataReg\n" +
|
||||
" group by mtb_movi.cod_mart\n" +
|
||||
" order by 2 desc;\n" +
|
||||
" end\n" +
|
||||
" select @codMart = @ls_codMartEqui; \n" +
|
||||
" end\n" +
|
||||
" else\n" +
|
||||
" begin\n" +
|
||||
" if @codMdep is null\n" +
|
||||
" SELECT @ldt_dataDocMax = Max(data_reg)\n" +
|
||||
" FROM mtb_movi, dtb_tipi\n" +
|
||||
" WHERE mtb_movi.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" cod_mart = @codMart AND data_reg <= @dataReg AND\n" +
|
||||
" qta_car > 0 AND val_car > 0 ;\n" +
|
||||
" else\n" +
|
||||
" SELECT @ldt_dataDocMax = Max(data_reg)\n" +
|
||||
" FROM mtb_movi, dtb_tipi\n" +
|
||||
" WHERE mtb_movi.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" cod_mart = @codMart AND data_reg <= @dataReg AND\n" +
|
||||
" qta_car > 0 AND val_car > 0 AND\n" +
|
||||
" cod_mdep = @codMdep;\n" +
|
||||
" end\n" +
|
||||
"\n" +
|
||||
" if @ldt_dataDocMax is null\n" +
|
||||
" begin\n" +
|
||||
" SELECT @lc_costoUltUnt = val_ult_car / cambio_divi_car\n" +
|
||||
" FROM mtb_aart\n" +
|
||||
" WHERE cod_mart = @codMart;\n" +
|
||||
" end \n" +
|
||||
" else\n" +
|
||||
" begin\n" +
|
||||
" IF @codMdep is null\n" +
|
||||
" SELECT @lc_qtaCarTot = sum(qta_car) , \n" +
|
||||
" @lc_valCarTot = sum(val_car_costo / cambio_divi_cont) \n" +
|
||||
" FROM mtb_movi, dtb_tipi\n" +
|
||||
" WHERE mtb_movi.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" cod_mart = @codMart AND \n" +
|
||||
" data_reg = @ldt_dataDocMax AND\n" +
|
||||
" (qta_car > 0 or (qta_car = 0 and val_car <> 0));\n" +
|
||||
" ELSE\n" +
|
||||
" SELECT @lc_qtaCarTot = sum(qta_car), \n" +
|
||||
" @lc_valCarTot = sum(val_car_costo /cambio_divi_cont)\n" +
|
||||
" FROM mtb_movi, \n" +
|
||||
" dtb_tipi\n" +
|
||||
" WHERE mtb_movi.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione <> 'V' and\n" +
|
||||
" dtb_tipi.flag_costo = 'S' and\n" +
|
||||
" cod_mart = @codMart AND \n" +
|
||||
" data_reg = @ldt_dataDocMax AND\n" +
|
||||
" (qta_car > 0 or (qta_car = 0 and val_car <> 0)) and\n" +
|
||||
" cod_mdep = @codMdep;\n" +
|
||||
" \n" +
|
||||
" select @lc_costoUltUnt =0\n" +
|
||||
" if @lc_qtaCarTot > 0 \n" +
|
||||
" select @lc_costoUltUnt = round(@lc_valCarTot / @lc_qtaCarTot, 5)\n" +
|
||||
" end\n" +
|
||||
" end\n" +
|
||||
" if @lc_costoUltUnt is null \n" +
|
||||
" SELECT @lc_costoUltUnt = 0\n" +
|
||||
" RETURN @lc_costoUltUnt\n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250925151323 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
if (!isTextiles()) return;
|
||||
|
||||
executeStatement(
|
||||
"drop table ttb_qta_min_ord",
|
||||
"create table ttb_qta_min_ord (\n" +
|
||||
" id bigint identity,\n" +
|
||||
" cod_line varchar(5),\n" +
|
||||
" cod_style varchar(15),\n" +
|
||||
" cod_grtg varchar(5) not null,\n" +
|
||||
" range_taglie tinyint not null,\n" +
|
||||
" qta_min_ord numeric(20,5) not null default 0)",
|
||||
"alter table ttb_qta_min_ord ADD constraint pk_ttb_qta_min_ord primary key (id);",
|
||||
"create unique index ix_unique_ttb_qta_min_ord on ttb_qta_min_ord (cod_line, cod_style, cod_grtg);",
|
||||
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_style FOREIGN KEY(cod_style) REFERENCES dbo.ttb_style ( cod_style )",
|
||||
"ALTER TABLE dbo.ttb_qta_min_ord WITH CHECK ADD CONSTRAINT fk_ttb_qta_min_ord_ttb_grtg FOREIGN KEY(cod_grtg) REFERENCES dbo.ttb_grtg ( cod_grtg )");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250926113139 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("w_mriassegna_costo_dlg", "LAVORAZIONE", "COSTO_DA_DISTINTA_SENZA_MDO", "N",
|
||||
"Se impostato a S e l'azienda non gestisce il costo sul deposito allora dal costo totale che viene dalla funzione di DB f_explode_dist verrà sottratto il cost della manodopera, sia il costo associato al servizio di MDO della distinta, sia l'eventuale costo MDO specificato nel ciclo di produzione della distinta", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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_20250926130028 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Maggio_MaggioSrl))
|
||||
return;
|
||||
|
||||
updateSetupValue("w_mriassegna_costo_dlg", "LAVORAZIONE", "COSTO_DA_DISTINTA_SENZA_MDO", "S",
|
||||
"Se impostato a S e l'azienda non gestisce il costo sul deposito allora dal costo totale che viene dalla funzione di DB f_explode_dist verrà sottratto il cost della manodopera, sia il costo associato al servizio di MDO della distinta, sia l'eventuale costo MDO specificato nel ciclo di produzione della distinta", false, null, false, false, false,
|
||||
false, false, null, false, null);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM stb_gest_setup_depo\n" +
|
||||
"WHERE gest_name = 'w_mriassegna_costo_dlg'\n" +
|
||||
" AND section = 'LAVORAZIONE'\n" +
|
||||
" AND key_section = 'COSTO_DA_DISTINTA_SENZA_MDO'"
|
||||
);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM wtb_gest_setup_user\n" +
|
||||
"WHERE gest_name = 'w_mriassegna_costo_dlg'\n" +
|
||||
" AND section = 'LAVORAZIONE'\n" +
|
||||
" AND key_section = 'COSTO_DA_DISTINTA_SENZA_MDO'"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -55,16 +55,17 @@ public class AccountingRules extends QueryRules {
|
||||
public static boolean checkDeleteMov(Connection connection, Integer numCmov) throws Exception {
|
||||
String sql =
|
||||
"select cast(count(*) as bit)\n" +
|
||||
"from ctb_movt inner join ctb_caus on ctb_movt.cod_ccau = ctb_caus.cod_ccau\n" +
|
||||
" inner join ctb_parr on ctb_movt.num_cmov = ctb_parr.num_cmov\n" +
|
||||
"from ctb_movt inner join ctb_parr on ctb_movt.num_cmov = ctb_parr.num_cmov\n" +
|
||||
"inner join ctb_parr cp ON ctb_parr.anno_part = cp.anno_part AND\n" +
|
||||
" ctb_parr.tipo_anag = cp.tipo_anag AND\n" +
|
||||
" ctb_parr.cod_anag = cp.cod_anag AND\n" +
|
||||
" ctb_parr.ser_doc = cp.ser_doc AND\n" +
|
||||
" ctb_parr.num_doc = cp.num_doc AND\n" +
|
||||
" ctb_movt.num_cmov <> cp.num_cmov\n" +
|
||||
" ctb_movt.num_cmov <> cp.num_cmov\n" +
|
||||
"inner join ctb_movt ct on ct.num_cmov = cp.num_cmov\n" +
|
||||
"inner join ctb_caus on ct.cod_ccau = ctb_caus.cod_ccau\n" +
|
||||
"where ctb_movt.num_cmov = " + UtilityDB.valueToString(numCmov) + " AND\n" +
|
||||
" ctb_caus.azione_su_partita = 0\n" +
|
||||
" ctb_caus.azione_su_partita = 1\n" +
|
||||
"and not exists (select * from crl_movt_rif_cmov where num_cmov = ctb_movt.num_cmov and cp.num_cmov = crl_movt_rif_cmov. num_cmov_rif )";
|
||||
boolean existParr = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
return existParr;
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.annotation.Master;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.EntityChild;
|
||||
|
||||
@Master()
|
||||
@PropertyReactive()
|
||||
@Table(value = TtbGrtg.ENTITY)
|
||||
@JsonTypeName(value = TtbGrtg.ENTITY)
|
||||
public class TtbGrtg extends EntityBase {
|
||||
|
||||
public final static String ENTITY = "Ttb_Grtg";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public TtbGrtg() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_grtg", maxLength = 5, nullable = false)
|
||||
private String codGrtg;
|
||||
|
||||
@SqlField(value = "cod_tagl_min", maxLength = 15, nullable = false)
|
||||
private String codTaglMin;
|
||||
|
||||
@SqlField(value = "cod_tagl_max", maxLength = 15, nullable = false)
|
||||
private String codTaglMax;
|
||||
|
||||
@SqlField(value = "note", maxLength = 40, nullable = true)
|
||||
private String note;
|
||||
|
||||
@EntityChild()
|
||||
private List<TtbGrtgEl> ttbGrtgEl = new ArrayList<>();
|
||||
|
||||
public String getCodGrtg() {
|
||||
return codGrtg;
|
||||
}
|
||||
|
||||
public TtbGrtg setCodGrtg(String codGrtg) {
|
||||
this.codGrtg = codGrtg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTaglMin() {
|
||||
return codTaglMin;
|
||||
}
|
||||
|
||||
public TtbGrtg setCodTaglMin(String codTaglMin) {
|
||||
this.codTaglMin = codTaglMin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTaglMax() {
|
||||
return codTaglMax;
|
||||
}
|
||||
|
||||
public TtbGrtg setCodTaglMax(String codTaglMax) {
|
||||
this.codTaglMax = codTaglMax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public TtbGrtg setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<TtbGrtgEl> getTtbGrtgEl() {
|
||||
return ttbGrtgEl;
|
||||
}
|
||||
|
||||
public TtbGrtg setTtbGrtgEl(List<TtbGrtgEl> ttbGrtgEl) {
|
||||
this.ttbGrtgEl = ttbGrtgEl;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void deleteChilds() throws Exception {
|
||||
TtbGrtgEl ttbGrtgEl = new TtbGrtgEl();
|
||||
ttbGrtgEl.deleteAllEntities(connection, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.FK;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@PropertyReactive()
|
||||
@Table(value = TtbGrtgEl.ENTITY)
|
||||
@JsonTypeName(value = TtbGrtgEl.ENTITY)
|
||||
public class TtbGrtgEl extends EntityBase {
|
||||
|
||||
public final static String ENTITY = "Ttb_Grtg_el";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public TtbGrtgEl() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_grtg", maxLength = 5, nullable = false)
|
||||
@FK(tableName = TtbGrtg.ENTITY, columnName = "cod_grtg")
|
||||
private String codGrtg;
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_tagl", maxLength = 15, nullable = false)
|
||||
private String codTagl;
|
||||
|
||||
@SqlField(value = "cod_tagl_estera", maxLength = 15, nullable = false)
|
||||
private String codTaglEstera;
|
||||
|
||||
@SqlField(value = "pos", nullable = false)
|
||||
private Integer pos;
|
||||
|
||||
@SqlField(value = "num_scatto", nullable = false)
|
||||
private BigDecimal numScatto;
|
||||
|
||||
@SqlField(value = "statura", maxLength = 15, nullable = true)
|
||||
private String statura;
|
||||
|
||||
@SqlField(value = "cod_tagl_cad", maxLength = 15, nullable = true)
|
||||
private String codTaglCad;
|
||||
|
||||
@SqlField(value = "eta", maxLength = 5, nullable = true)
|
||||
private String eta;
|
||||
|
||||
@SqlField(value = "babynobaby", maxLength = 2, nullable = true)
|
||||
private String babynobaby;
|
||||
|
||||
@SqlField(value = "range_taglie", nullable = false)
|
||||
private Short rangeTaglie;
|
||||
|
||||
public String getCodGrtg() {
|
||||
return codGrtg;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setCodGrtg(String codGrtg) {
|
||||
this.codGrtg = codGrtg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTagl() {
|
||||
return codTagl;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setCodTagl(String codTagl) {
|
||||
this.codTagl = codTagl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTaglEstera() {
|
||||
return codTaglEstera;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setCodTaglEstera(String codTaglEstera) {
|
||||
this.codTaglEstera = codTaglEstera;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPos() {
|
||||
return pos;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setPos(Integer pos) {
|
||||
this.pos = pos;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumScatto() {
|
||||
return numScatto;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setNumScatto(BigDecimal numScatto) {
|
||||
this.numScatto = numScatto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStatura() {
|
||||
return statura;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setStatura(String statura) {
|
||||
this.statura = statura;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTaglCad() {
|
||||
return codTaglCad;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setCodTaglCad(String codTaglCad) {
|
||||
this.codTaglCad = codTaglCad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEta() {
|
||||
return eta;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setEta(String eta) {
|
||||
this.eta = eta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBabynobaby() {
|
||||
return babynobaby;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setBabynobaby(String babynobaby) {
|
||||
this.babynobaby = babynobaby;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Short getRangeTaglie() {
|
||||
return rangeTaglie;
|
||||
}
|
||||
|
||||
public TtbGrtgEl setRangeTaglie(Short rangeTaglie) {
|
||||
this.rangeTaglie = rangeTaglie;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.annotation.Master;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.Identity;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.FK;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Master()
|
||||
@PropertyReactive()
|
||||
@Table(value = TtbQtaMinOrd.ENTITY)
|
||||
@JsonTypeName(value = TtbQtaMinOrd.ENTITY)
|
||||
public class TtbQtaMinOrd extends EntityBase {
|
||||
|
||||
public final static String ENTITY = "ttb_qta_min_ord";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public TtbQtaMinOrd() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@PK()
|
||||
@Identity()
|
||||
@SqlField(value = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@SqlField(value = "cod_line", maxLength = 5, nullable = true)
|
||||
private String codLine;
|
||||
|
||||
@SqlField(value = "cod_style", maxLength = 15, nullable = true)
|
||||
@FK(tableName = TtbStyle.ENTITY, columnName = "cod_style")
|
||||
private String codStyle;
|
||||
|
||||
@SqlField(value = "cod_grtg", maxLength = 5, nullable = false)
|
||||
@FK(tableName = TtbGrtg.ENTITY, columnName = "cod_grtg")
|
||||
private String codGrtg;
|
||||
|
||||
@SqlField(value = "range_taglie", nullable = false)
|
||||
private Short rangeTaglie;
|
||||
|
||||
@SqlField(value = "qta_min_ord", nullable = false)
|
||||
private BigDecimal qtaMinOrd;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public TtbQtaMinOrd setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodLine() {
|
||||
return codLine;
|
||||
}
|
||||
|
||||
public TtbQtaMinOrd setCodLine(String codLine) {
|
||||
this.codLine = codLine;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodStyle() {
|
||||
return codStyle;
|
||||
}
|
||||
|
||||
public TtbQtaMinOrd setCodStyle(String codStyle) {
|
||||
this.codStyle = codStyle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodGrtg() {
|
||||
return codGrtg;
|
||||
}
|
||||
|
||||
public TtbQtaMinOrd setCodGrtg(String codGrtg) {
|
||||
this.codGrtg = codGrtg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Short getRangeTaglie() {
|
||||
return rangeTaglie;
|
||||
}
|
||||
|
||||
public TtbQtaMinOrd setRangeTaglie(Short rangeTaglie) {
|
||||
this.rangeTaglie = rangeTaglie;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaMinOrd() {
|
||||
return qtaMinOrd;
|
||||
}
|
||||
|
||||
public TtbQtaMinOrd setQtaMinOrd(BigDecimal qtaMinOrd) {
|
||||
this.qtaMinOrd = qtaMinOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class StampaSchedaCostiJavabean extends BaseReportJavabean implements IRe
|
||||
" (1 - mtb_lisv_data.perc_sco3 / 100) * \n" +
|
||||
" (1 - mtb_lisv_data.perc_sco4 / 100) * \n" +
|
||||
" (1 - IsNull(vtb_clie.sconto1,0) / 100) *\n" +
|
||||
" (1 - IsNull(vtb_clie.sconto2,0) / 100) ) / mtb_lisv_data.rap_conv) / mtb_aart.peso_kg AS prz_vend_kg,\n" +
|
||||
" (1 - IsNull(vtb_clie.sconto2,0) / 100) ) / mtb_lisv_data.rap_conv) / NULLIF(mtb_aart.peso_kg,0) AS prz_vend_kg,\n" +
|
||||
" vtb_list.descrizione AS descr_lisv\n" +
|
||||
"FROM mtb_lisv_data\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_lisv_data.cod_mart = mtb_aart.cod_mart\n" +
|
||||
@@ -118,7 +118,7 @@ public class StampaSchedaCostiJavabean extends BaseReportJavabean implements IRe
|
||||
" vtb_offr.unt_mis_vend,\n" +
|
||||
" vtb_offr.note,\n" +
|
||||
" vtb_offr.prz_unt,\n" +
|
||||
" (vtb_offr.prz_unt / vtb_offr.rap_conv) / mtb_aart.peso_kg AS prz_vend_kg,\n" +
|
||||
" (vtb_offr.prz_unt / vtb_offr.rap_conv) / NULLIF(mtb_aart.peso_kg,0) AS prz_vend_kg,\n" +
|
||||
" id_offerta\n" +
|
||||
"FROM vtb_offr\n" +
|
||||
" INNER JOIN mtb_aart ON vtb_offr.cod_mart = mtb_aart.cod_mart\n" +
|
||||
|
||||
@@ -635,7 +635,7 @@ public class ContabilImportService {
|
||||
"UNION\n" +
|
||||
"SELECT NULL, ctb_cont.cod_ccon, NULL, ctb_cont.descrizione\n" +
|
||||
"FROM ctb_cont\n" +
|
||||
"WHERE diacod = %s",
|
||||
"WHERE IsNull(ctb_cont.diacod, ctb_cont.cod_ccon) = %s",
|
||||
diacod, diacod
|
||||
);
|
||||
HashMap<String, Object> resultQuery = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
||||
|
||||
@@ -91,7 +91,6 @@ public class PrintDocumentRequestDTO {
|
||||
pairsDTOList.add(new PairsDTO("num_doc", numDoc));
|
||||
pairsDTOList.add(new PairsDTO("data_doc", UtilityDate.formatDate(dataDoc, "yyyy/MM/dd")));
|
||||
pairsDTOList.add(new PairsDTO("cod_dtip", codDtip));
|
||||
pairsDTOList.add(new PairsDTO("cod_dtip", codDtip));
|
||||
pairsDTOList.add(new PairsDTO("num_copia", Integer.toString(copy)));
|
||||
|
||||
return pairsDTOList;
|
||||
|
||||
@@ -125,33 +125,37 @@ public class DocumentiDirettiService {
|
||||
entityList.addAll(mtbLisaCostoData);
|
||||
}
|
||||
|
||||
List<EntityBase> entityRet = entityProcessor.processEntityList(entityList, true);
|
||||
UtilityEntity.throwEntitiesException(entityRet);
|
||||
try {
|
||||
List<EntityBase> entityRet = entityProcessor.processEntityList(entityList, true);
|
||||
UtilityEntity.throwEntitiesException(entityRet);
|
||||
|
||||
boolean salvaImballiAttiva = setupGest.getSetupBoolean("DTB_DOCT", "FATTURA_PEDANE", "ATTIVA");
|
||||
boolean salvaImballiAttiva = setupGest.getSetupBoolean("DTB_DOCT", "FATTURA_PEDANE", "ATTIVA");
|
||||
|
||||
if (UtilityString.equalsIgnoreCase(gestione, "A")) {
|
||||
List<MtbLisaCostoData> mtbLisaCostoData = documentService.popolaTabellaCosti(dtbDoct.getCodAnag(),
|
||||
dtbDoct.getCodDtip(),
|
||||
dtbDoct.getDataDoc(),
|
||||
dtbDoct.getSerDoc(),
|
||||
dtbDoct.getNumDoc(), false, false);
|
||||
if (mtbLisaCostoData != null) {
|
||||
entityRet = entityProcessor.processEntityList(mtbLisaCostoData, true);
|
||||
UtilityEntity.throwEntitiesException(entityRet);
|
||||
if (UtilityString.equalsIgnoreCase(gestione, "A")) {
|
||||
List<MtbLisaCostoData> mtbLisaCostoData = documentService.popolaTabellaCosti(dtbDoct.getCodAnag(),
|
||||
dtbDoct.getCodDtip(),
|
||||
dtbDoct.getDataDoc(),
|
||||
dtbDoct.getSerDoc(),
|
||||
dtbDoct.getNumDoc(), false, false);
|
||||
if (mtbLisaCostoData != null) {
|
||||
entityRet = entityProcessor.processEntityList(mtbLisaCostoData, true);
|
||||
UtilityEntity.throwEntitiesException(entityRet);
|
||||
}
|
||||
} else if (gestione.equalsIgnoreCase("V") && !UtilityString.isNullOrEmpty(dtbDoct.getCodFornTrasp()) &&
|
||||
TipoEmissione.valueOf(UtilityHashMap.getValueIfExists(datiTipoDoc, "tipo_emissione")) == TipoEmissione.DIRETTA &&
|
||||
!dtbDoct.getDtbDocImb().isEmpty() && salvaImballiAttiva) {
|
||||
DtbDoct dtbDoctSave =
|
||||
entityRet.stream().filter(x -> x instanceof DtbDoct && ((DtbDoct) x).getCodDtip().equals(dtbDoct.getCodDtip())).map(x -> (DtbDoct) x).findFirst().orElse(null);
|
||||
saveDocImballi(dtbDoctSave, isInsert);
|
||||
}
|
||||
} else if (gestione.equalsIgnoreCase("V") &&
|
||||
TipoEmissione.valueOf(UtilityHashMap.getValueIfExists(datiTipoDoc, "tipo_emissione")) == TipoEmissione.DIRETTA &&
|
||||
!dtbDoct.getDtbDocImb().isEmpty() && salvaImballiAttiva) {
|
||||
DtbDoct dtbDoctSave =
|
||||
entityRet.stream().filter(x -> x instanceof DtbDoct && ((DtbDoct) x).getCodDtip().equals(dtbDoct.getCodDtip())).map(x -> (DtbDoct) x).findFirst().orElse(null);
|
||||
saveDocImballi(dtbDoctSave, isInsert);
|
||||
|
||||
multiDBTransactionManager.commitAll();
|
||||
|
||||
return entityRet;
|
||||
} catch (Exception e) {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
throw e;
|
||||
}
|
||||
|
||||
multiDBTransactionManager.commitAll();
|
||||
|
||||
return entityRet;
|
||||
|
||||
}
|
||||
|
||||
private List<MtbColt> checkUDSForTransfer(DtbDoct dtbDoct, List<EntityBase> entityList, boolean isNewDoc) throws Exception {
|
||||
|
||||
@@ -127,6 +127,7 @@ public class RestLoggerBodyFilter extends AbstractRequestLoggingFilter {
|
||||
!serviceName.endsWith("status") &&
|
||||
!serviceName.contains("system/ok") &&
|
||||
!serviceName.contains("system/login") &&
|
||||
!serviceName.contains("auth/login") &&
|
||||
!serviceName.contains("logs") &&
|
||||
!serviceName.contains("getCurrentMachinesStatus") &&
|
||||
!serviceName.contains("getOrdiniLavorazione") &&
|
||||
|
||||
Reference in New Issue
Block a user