Divisa setup TIPO_MOVIMENTO_FISCALE in TIPO_MOVIMENTO_FISCALE_CAR e TIPO_MOVIMENTO_FISCALE_SCAR
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:
@@ -423,6 +423,25 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
}
|
||||
}
|
||||
|
||||
protected String getSetupValue(String gestName, String section, String keySection) throws SQLException {
|
||||
String sql = Query.format("SELECT value FROM " + StbGestSetup.ENTITY +
|
||||
" WHERE gest_name = %s AND" +
|
||||
" section = %s AND" +
|
||||
" key_section = %s", gestName, section, keySection);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
}
|
||||
|
||||
//Create a getStbGestSetup method to return the entire StbGestSetup object
|
||||
protected StbGestSetup getStbGestSetup(String gestName, String section, String keySection) throws SQLException, DataConverterNotFoundException, InstantiationException, IllegalAccessException {
|
||||
String sql = Query.format("SELECT * FROM stb_gest_setup " +
|
||||
" WHERE gest_name = %s AND" +
|
||||
" section = %s AND" +
|
||||
" key_section = %s", gestName, section, keySection);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowDTO(connection, sql, StbGestSetup.class);
|
||||
}
|
||||
|
||||
protected void deleteSetup(String gestName, String section, String keySection) throws Exception {
|
||||
StbGestSetup stbGestSetup = new StbGestSetup()
|
||||
.setGestName(gestName)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.entity.StbGestSetup;
|
||||
|
||||
public class Migration_20251205173303 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
StbGestSetup setupMovimentoFiscale = getStbGestSetup("PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE");
|
||||
|
||||
deleteSetup("PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE");
|
||||
|
||||
createSetup(setupMovimentoFiscale.getGestName(),
|
||||
setupMovimentoFiscale.getSection(),
|
||||
setupMovimentoFiscale.getKeySection() + "_CAR",
|
||||
setupMovimentoFiscale.getValue(),
|
||||
setupMovimentoFiscale.getDescription(),
|
||||
setupMovimentoFiscale.getQueryDefault());
|
||||
|
||||
|
||||
createSetup(setupMovimentoFiscale.getGestName(),
|
||||
setupMovimentoFiscale.getSection(),
|
||||
setupMovimentoFiscale.getKeySection() + "_SCAR",
|
||||
setupMovimentoFiscale.getValue(),
|
||||
setupMovimentoFiscale.getDescription(),
|
||||
setupMovimentoFiscale.getQueryDefault());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -1256,10 +1256,16 @@ public class WMSGenericService {
|
||||
DtbDoct dtbDoctInv = null;
|
||||
|
||||
if (shouldCreateMovimentoFiscale && isDocumentAttached) {
|
||||
String codDtipToUse = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE");
|
||||
String codDtipToUse = null;
|
||||
|
||||
if (isPositiveUpdate)
|
||||
codDtipToUse = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE_CAR");
|
||||
else
|
||||
codDtipToUse = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE_SCAR");
|
||||
|
||||
if (UtilityString.isNullOrEmpty(codDtipToUse))
|
||||
throw new Exception("Per poter generare il movimento fiscale è necessario configurare anche la setup TIPO_MOVIMENTO_FISCALE");
|
||||
throw new Exception("Per poter generare il movimento fiscale è necessario configurare la setup PICKING > RETTIFICA_GIACENZE > TIPO_MOVIMENTO_FISCALE" +
|
||||
(isPositiveUpdate ? "_CAR" : "_SCAR"));
|
||||
|
||||
|
||||
String sqlCheckDocExists = Query.format("SELECT TOP 1 cod_anag, cod_dtip, ser_doc, data_doc, num_doc " +
|
||||
|
||||
Reference in New Issue
Block a user