Fix ricalcolo peso netto e lordo mtb_colr se modificate le qta col
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:
@@ -350,6 +350,14 @@ public class PackagesRules extends QueryRules {
|
||||
|
||||
HashMap<String, Object> queryResults = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
||||
|
||||
if (((MtbColr) entity.getOriginalEntity()).getPesoNettoKg() != null && ((MtbColr) entity.getOriginalEntity()).getPesoLordoKg() != null) {
|
||||
HashMap<String, Object> pesi = new HashMap<String, Object>();
|
||||
pesi.put("peso_netto", entity.getPesoNettoKg());
|
||||
pesi.put("peso_lordo", entity.getPesoLordoKg());
|
||||
|
||||
return pesi;
|
||||
}
|
||||
|
||||
BigDecimal pesoNetto = BigDecimal.ZERO, pesoLordo = BigDecimal.ZERO;
|
||||
if (queryResults != null) {
|
||||
BigDecimal taraKg = (BigDecimal) queryResults.get("tara_kg");
|
||||
|
||||
@@ -349,7 +349,7 @@ rule "completePesoMtbColr"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity: MtbColr((pesoNettoKg == null || pesoLordoKg == null) && qtaCol != null && numCnf != null && qtaCnf != null && operation != OperationType.DELETE)
|
||||
$entity: MtbColr(qtaCol != null && numCnf != null && qtaCnf != null && operation != OperationType.DELETE)
|
||||
then
|
||||
HashMap<String, Object> dati = PackagesRules.calcPeso(conn, $entity);
|
||||
modify ( $entity ) {
|
||||
|
||||
Reference in New Issue
Block a user