Gestione note fattura in generazione xml fattura elettronica

This commit is contained in:
2024-05-03 18:50:27 +02:00
parent 9a6b6f88d9
commit 49576b0558
3 changed files with 66 additions and 1 deletions

View File

@@ -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_20240503181252 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
createSetup("FATTURA_ELETTRONICA_CUSTOM", "CAUSALE", "NOTE_PIE_PAGINA", null, "Elenco note da visualizzare a pie pagina separate da |", false, null, false, false, false, false, false, null, false, null);
}
@Override
public void down() throws Exception {
}
}

View File

@@ -0,0 +1,34 @@
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;
import it.integry.ems_model.utility.UtilityDB;
public class Migration_20240503184010 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
if (!isCustomerDb(
IntegryCustomerDB.Frudis_Frudis)){
return;
}
executeStatement(
"UPDATE stb_gest_setup " +
" SET value = 'Paese d''origine: ITALIA (CEE 3148/94)|Condiz. di vendita: COFREUROP/RUCIP|CONTRIBUTO AMBIENTALE CONAI ASSOLTO' " +
"WHERE gest_name = " + UtilityDB.valueToString("FATTURA_ELETTRONICA_CUSTOM") + " AND " +
"section = " + UtilityDB.valueToString("CAUSALE") + " AND " +
"key_section = " + UtilityDB.valueToString("NOTE_PIE_PAGINA")
);
}
@Override
public void down() throws Exception {
}
}

View File

@@ -215,7 +215,6 @@ public class DigitalInvoiceBodyFactory {
resultSet.close();
ps.close();
BigDecimal tot_imponib = BigDecimal.ZERO, tot_iva = BigDecimal.ZERO;
for (DatiRiepilogoDTO dato : datiRiepilogo) {
String codDtipCcau = dato.getCodDtipCcau();
@@ -513,6 +512,16 @@ public class DigitalInvoiceBodyFactory {
datiGeneraliDocumento.getCausale().add(matricole[0]);
}
}
// Elenco note da aggiungere alla fattura (Es. dicitura CONAI )
String noteDoc = setup.getSetup("FATTURA_ELETTRONICA_CUSTOM", "CAUSALE", "NOTE_PIE_PAGINA");
if (noteDoc != null && !noteDoc.isEmpty()) {
String[] notes = noteDoc.split("\\|");
for (int j = 0; j < notes.length; j++) {
datiGeneraliDocumento.getCausale().add(notes[j]);
}
}
return datiGeneraliDocumento;
}