From e05c633c7bc52f3eddf1fc6094921499c5742c7b Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Wed, 22 Jan 2020 00:20:02 +0100 Subject: [PATCH] Patch level : 12.0 930 Files correlati : ve0.exe ve1.exe ve5.exe ve6.exe Commento : - Aggiunte funzioni sulle righe documento : QTACONAI( [ [ = 1 && nparms < 3 ? _qtaconai : -1; + return nparms >= 1 && nparms < 4 ? _qtaconai : -1; if (strcmp(name, "VALCONAI") == 0) - return nparms >= 1 && nparms < 3 ? _valconai : -1; + return nparms >= 1 && nparms < 4 ? _valconai : -1; return -1; } @@ -1068,12 +1068,11 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st break; case _qtaconai: { - int sp = stack.count(); - int tipo_calcolo = (nparms > 1) ? (int)stack.pop_real().integer() : 0; - TString cat = stack.pop_string(); + const int ndec = (nparms > 2) ? (int)stack.pop_real().integer() : 5; + const int tipo_calcolo = (nparms > 1) ? (int)stack.pop_real().integer() : 0; + const TString cat = stack.pop_string(); - if (stack.count() >= sp - 2) - stack.push(ZERO); + stack.push(ZERO); real & val = stack.peek_real(); @@ -1107,7 +1106,7 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st val *= (perc_esenz / CENTO); } - val.round(5); + val.round(ndec); } else val = ZERO; @@ -1115,13 +1114,12 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st break; case _valconai: { - int sp = stack.count(); - int tipo_calcolo = (nparms > 1) ? (int)stack.pop_real().integer() : 0; - TString cat = stack.pop_string(); + const int ndec = (nparms > 2) ? (int)stack.pop_real().integer() : 5; + const int tipo_calcolo = (nparms > 1) ? (int)stack.pop_real().integer() : 0; + const TString cat = stack.pop_string(); TString_array sottocat_found; - if (stack.count() >= sp - 2) - stack.push(ZERO); + stack.push(ZERO); real & val = stack.peek_real(); @@ -1135,7 +1133,7 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st { sottocat_found.add(sottocat); stack.push(sottocat); - stack.push(tipo_calcolo); + stack.push(tipo_calcolo); evaluate_user_func(_qtaconai, 2, stack, type); real valqta = stack.pop_real(); @@ -1155,7 +1153,7 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st const real prezzo = rdoc.get_real(RDOC_PREZZO); val = valqta * prezzo; - val.round(5); + val.round(ndec); break; }