Patch level : 12.0 934

Files correlati     : cg4.exe cg5000a.msk cg5300a.msk ba3.exe batbiva.msk f124.trr
Commento            :

 - Aggiunto calcolo pro rata con numeratore e denominatore impostato sui codici IVA
This commit is contained in:
Alessandro Bonazzi 2020-01-30 20:22:23 +01:00
parent da6afbcc7e
commit 66f4c9de7e
4 changed files with 125 additions and 78 deletions

View File

@ -9,6 +9,7 @@
#include "../cg/cgtbdel.h"
#include "../cg/cgtbreg.h"
#include "../cg/cgtbver.h"
#include "batbiva.h"
#include "batbnoc.h"
#include "batbval.h"
@ -24,6 +25,7 @@
#define TAB_DELEGHE "%DEL"
#define TAB_DET "%DET"
#define TAB_IVDIRETTIVA "%IVD"
#define TAB_IVA "%IVA"
#define TAB_REGISTRI "REG"
#define TAB_VALUTE "%VAL"
#define TAB_VERSAMENTI "%VER"
@ -167,6 +169,17 @@ void TGeneric_table_app::init_insert_mode(TMask& m)
else
if (n == TAB_VALUTE)
m.enable(-3);
else
if (n == TAB_IVA)
{
const bool pro_rata_nd = ini_get_bool(CONFIG_STUDIO, "cg", "ProRataNumDen", false);
if (!pro_rata_nd)
{
m.reset(FLD_NUM_B6);
m.reset(FLD_DEN_B7);
}
}
}
void TGeneric_table_app::init_modify_mode(TMask& m)
@ -182,15 +195,18 @@ void TGeneric_table_app::init_modify_mode(TMask& m)
const int what = ini.get_int("Type", NULL, -1, -1);
m.set(F_CONFIG, what >= 0 ? "X" : "");
m.enable(F_CONFIG, what >= 0);
} else
}
else
if (n == TAB_VALUTE)
{
m.disable(-3); // Disabilita scelta decimali e contro-euro
} else
}
else
if (n == TAB_VERSAMENTI)
{
load_rec_in_disabled_fields(m);
}
else
if (n == TAB_DET)
{
const bool prot = get_relation()->curr().get_bool(FPC);
@ -198,6 +214,17 @@ void TGeneric_table_app::init_modify_mode(TMask& m)
m.enable(DLG_SAVEREC, !prot);
m.enable(DLG_DELREC, !prot);
}
else
if (n == TAB_IVA)
{
const bool pro_rata_nd = ini_get_bool(CONFIG_STUDIO, "cg", "ProRataNumDen", false);
if (!pro_rata_nd)
{
m.reset(FLD_NUM_B6);
m.reset(FLD_DEN_B7);
}
}
}
void TGeneric_table_app::init_query_mode(TMask& m)
@ -642,6 +669,14 @@ bool TGeneric_table_app::user_create()
if (name == TAB_NOMENCOMB)
mask.set_handler(NOC_CODICE2, codnoc_handler);
if (name == TAB_IVA)
{
const bool pro_rata_nd = ini_get_bool(CONFIG_STUDIO, "cg", "ProRataNumDen", false);
mask.show(FLD_NUM_B6, pro_rata_nd);
mask.show(FLD_DEN_B7, pro_rata_nd);
}
if (name == TAB_IVDIRETTIVA)
mask.set_handler(F_NUM, numivd_handler);
}

View File

@ -382,18 +382,18 @@ bool TCond_pag_app::ult_class(TMask_field& f, KEY k)
bool TCond_pag_app::cond_pagamento(TMask_field& f, KEY k)
{
if (!f.to_check(k) || f.mask().query_mode() || !f.mask().get(F_NUM_RATE).full())
return true;
if (f.to_check(k) || (!f.mask().query_mode() && k == K_ENTER))
{
// Controllo se il tipo è coerente con quello segnato prima
int nrate = f.mask().get_int(F_NUM_RATE);
bool err = false;
int nrate = f.mask().sfield(F_SHEET_RPG).items();
switch (atoi(f.get().right(1)))
{
// Pagamento a rate
case 1:
case 1: // Pagamento a rate
if (nrate <= 1)
{
err = true;
warning_box("Impossibile impostare questo tipo di pagamento con %d rat%c!", nrate, nrate == 0 ? 'e' : 'a');
f.set("TP02");
}
break;
@ -401,7 +401,7 @@ bool TCond_pag_app::cond_pagamento(TMask_field& f, KEY k)
case 2:
if (nrate > 1)
{
err = true;
warning_box("Impossibile impostare questo tipo di pagamento con %d rate!", nrate);
f.set("TP01");
}
break;
@ -410,10 +410,6 @@ bool TCond_pag_app::cond_pagamento(TMask_field& f, KEY k)
// Non so che fare!
break;
}
if(err)
{
warning_box("Impossibile impostare questo tipo di pagamento con %d rate!", nrate);
}
return true;
}

View File

@ -25,3 +25,5 @@
#define FLD_INDET_S4 126
#define FLD_NATURA 127
#define CHK_TABIVA_B5 128
#define FLD_NUM_B6 129
#define FLD_DEN_B7 130

View File

@ -326,9 +326,23 @@ ITEM "N6|N6 - IVA in reverse charge"
ITEM "N7|N7 - IVA assolta in altro stato U3"
END
BOOLEAN FLD_NUM_B6
BEGIN
PROMPT 3 21 "Fa parte del numeratore pro-rata"
MESSAGE TRUE DISABLE,FLD_DEN_B7|"X",FLD_DEN_B7
MESSAGE FALSE ENABLE,FLD_DEN_B7
FIELD B6
END
BOOLEAN FLD_DEN_B7
BEGIN
PROMPT 40 21 "Fa parte del denominatore pro-rata"
FIELD B7
END
BOOLEAN FLD_SOSPESO_B2
BEGIN
PROMPT 3 21 "Codice IVA sospeso"
PROMPT 3 22 "Codice IVA sospeso"
FIELD B2
END