regola per la valorizzazione del cod paga
This commit is contained in:
@@ -40,6 +40,15 @@ public class DocumentRules extends QueryRules {
|
||||
return dataRicezione;
|
||||
}
|
||||
|
||||
public static String getCodPagaDocV(DtbDoct dtbDoct) {
|
||||
if (!UtilityString.isNullOrEmpty(dtbDoct.getDtbTipi().getCodPaga())) {
|
||||
return dtbDoct.getDtbTipi().getCodPaga();
|
||||
} else if (UtilityString.isNullOrEmpty(dtbDoct.getVtbClie().getCodPaga())) {
|
||||
return dtbDoct.getVtbClie().getCodPaga();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void completeIdRigaDrlTipiNoteDoc(Connection conn, DtbNoteDoc dtbNoteDoc) throws SQLException {
|
||||
if (!dtbNoteDoc.getDrlTipiNoteDoc().isEmpty()) {
|
||||
for (DrlTipiNoteDoc drlTipiNoteDoc : dtbNoteDoc.getDrlTipiNoteDoc()) {
|
||||
|
||||
@@ -37,7 +37,6 @@ then
|
||||
setCodVage(QueryRules.<String>getEntityData(dati.getCodVage(), $docT.getCodVage())),
|
||||
setCodVzon(QueryRules.<String>getEntityData(dati.getCodVzon(), $docT.getCodVzon())),
|
||||
setCodBanc(QueryRules.<String>getEntityData(dati.getCodBanc(), $docT.getCodBanc())),
|
||||
setCodPaga(QueryRules.<String>getEntityData(dati.getCodPaga(), $docT.getCodPaga())),
|
||||
setPorto(QueryRules.<String>getEntityData(dati.getPorto(), $docT.getPorto())),
|
||||
setMezzo(QueryRules.<String>getEntityData(dati.getMezzo(), $docT.getMezzo())),
|
||||
setSconto1(QueryRules.<BigDecimal>getEntityData(dati.getSconto1(), $docT.getSconto1())),
|
||||
@@ -51,6 +50,19 @@ then
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
rule "completeCodPagaTipoDocV"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$docT : DtbDoct(gestione == "V" && dtbTipi != null && vtbClie != null && codPaga == null)
|
||||
then
|
||||
String codPaga = DocumentRules.getCodPagaDocV($docT);
|
||||
modify($docT){
|
||||
setCodPaga(codPaga)
|
||||
}
|
||||
end
|
||||
|
||||
rule "completeCodLinguaDocV"
|
||||
no-loop
|
||||
when
|
||||
|
||||
Reference in New Issue
Block a user