importazione scontrini carelli
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-10-06 09:23:37 +02:00
parent 18f4f2770a
commit e10f2d3a0c
3 changed files with 27 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
package it.integry.ems.migration.model;
import it.integry.ems.migration._base.BaseMigration;
import it.integry.ems.migration._base.MigrationModelInterface;
public class Migration_20251006091145 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
executeStatement("exec sp_rename 'ntb_docr.val_voucher', 'val_sco_st'");
}
@Override
public void down() throws Exception {
}
}

View File

@@ -101,8 +101,8 @@ public class NtbDocr extends EntityBase {
@SqlField(value = "causale_reso", maxLength = 5)
private String causaleReso;
@SqlField(value = "val_voucher", nullable = false, defaultObjectValue = "0")
private BigDecimal valVoucher;
@SqlField(value = "val_sco_st", nullable = false, defaultObjectValue = "0")
private BigDecimal valScoSt;
@EntityChild
private List<NtbDocs> ntbDocs = new ArrayList<>();
@@ -336,12 +336,12 @@ public class NtbDocr extends EntityBase {
return this;
}
public BigDecimal getValVoucher() {
return valVoucher;
public BigDecimal getValScoSt() {
return valScoSt;
}
public NtbDocr setValVoucher(BigDecimal valVoucher) {
this.valVoucher = valVoucher;
public NtbDocr setValScoSt(BigDecimal valScoSt) {
this.valScoSt = valScoSt;
return this;
}

View File

@@ -283,11 +283,11 @@ rule "completeValScoArtNtbDocr"
no-loop
when
eval(completeRulesEnabled)
$entity: NtbDocr(( valVoucher == null || valVoucher == 0 ) && operation != OperationType.DELETE )
$entity: NtbDocr(( valScoSt == null || valScoSt == 0 ) && operation != OperationType.DELETE )
then
BigDecimal valScoArt = ReceiptRules.calcValScoArt($entity);
BigDecimal valSco = $entity.getValSco() != null ? $entity.getValSco() : BigDecimal.ZERO;
modify ( $entity ) {
setValVoucher(valSco.subtract(valScoArt))
setValScoSt(valSco.subtract(valScoArt))
}
end