Patch level : 12.0 310 316

Files correlati     : cg0.exe cg4.exe cg4300a.msk

Eliminate le richieste di ricalcolo della liquidazione.
Aggiunto il flag di definitiva modificabile dalla liquidazione.
Due campi nuovi in liquidazione Calcola e Definitiva impostati dai flags sul mese.
Da verificare, visto che le richieste erano molte (potrebbero esserne sfuggite), progressivi IVA, Liquidazione, Stampa registri e Visualizzazione liquidazione.

git-svn-id: svn://10.65.10.50/branches/R_10_00@23462 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2016-12-18 22:20:47 +00:00
parent c336747533
commit 380ea39b1e
9 changed files with 2311 additions and 2269 deletions

File diff suppressed because it is too large Load Diff

@ -89,7 +89,7 @@ TLiquidazione_app::TLiquidazione_app(int m)
_isriepilogo = false; _calcall = false;
_recalc_only = _recalc_regis = _isfinal = _isregis = false;
_stampa_vers = _stampa_acc = false;
_recalc = needed;
_recalc = never;
}
bool TLiquidazione_app::user_create()
@ -99,7 +99,7 @@ bool TLiquidazione_app::user_create()
TDate printdate;
TString filename;
long ditta = 0;
bool nocalc = false;
//bool nocalc = false;
_prind = NULL;
@ -154,6 +154,11 @@ bool TLiquidazione_app::user_create()
_month = subj.get_int(1);
ditta = subj.get_long(2);
char rcl = *(subj.get(3));
TRectype & lim = (TRectype &) get_lim(_month);
const bool def = lim.get_bool("B1");
bool calc = !def && (lim.empty() || lim.get_bool("B0"));
_recalc = calc ? one : never;
_recalc_only = rcl == 'C';
_recalc_regis = rcl == 'R' && atoi(_year) > 1997;
_is_visliq = rcl == 'V';
@ -163,10 +168,9 @@ bool TLiquidazione_app::user_create()
// R = solo ricalcolo per registri: aggiorna solo progressivi PRM e PRP. Non fa niente altro ne write_liq() ne pim, ne stampe...
// V = stampa ed ev. ricalcolo per visualizzazione
// s o l minuscoli = registro bollato
_isregis = (rcl == 'l' || rcl == 'L' ||
rcl == 'S' || rcl == 's'); // stampa per registri
_isfinal = rcl == 'l' || rcl == 's'; // se l minuscolo, definitivo
nocalc = rcl == 'S' || rcl == 's';
_isregis = (toupper(rcl == 'L') || toupper(rcl == 'S')); // stampa per registri
_isfinal = (rcl == 'l' || rcl == 's'); // se l minuscolo, definitivo
calc |= toupper(rcl) != 'S';
printdate = subj.get(4);
filename = subj.get(5);
char rliq = *(subj.get(6));
@ -324,7 +328,8 @@ bool TLiquidazione_app::user_create()
// calcola liquidazione
printer().setdate(printdate);
_recalc = nocalc ? never : needed;
_recalc = never;
TApplication::set_firm(ditta);
const TRectype & lia = get_lia();
@ -355,7 +360,7 @@ bool TLiquidazione_app::user_create()
_isannual = _isriepilogo = _month == 13;
//modifica del 03/05/1995
bool need_refresh = false;
/* bool need_refresh = false;
for (int m = 1; m < _month; m++)
{
const TRectype & lim = get_lim(m) ;
@ -367,7 +372,7 @@ bool TLiquidazione_app::user_create()
}
}
if (need_refresh)
_recalc = ever;
_recalc = ever; */
// determina attivita' prevalente e istanzia cazzuole
// per vedere che Kazzo di liquidazione calcolare
@ -386,16 +391,16 @@ bool TLiquidazione_app::user_create()
for (int mese = 1; mese < _month; mese++)
{
if ((is_month_plain(mese) && !(_freqviva == "T" && _recalc_regis)) || _recalc == ever)
update_firm(mese);
if (is_month_plain(mese) && !(_freqviva == "T" && _recalc_regis))
update_firm(mese, _recalc == one);
}
if (is_month_plain(_month) || _month == 13)
update_firm(_month);
update_firm(_month, _recalc == one);
if (_isprint && _descr_arr.items() > 0)
print();
if (!nocalc)
/*if (!nocalc)
{
// se ci sono altri mesi dopo l'ultimo calcolato, invalida il
// flag 'calcolato' del primo, per causare il ricalcolo dei
@ -411,7 +416,7 @@ bool TLiquidazione_app::user_create()
break;
}
}
}
} */
TApplication::set_firm(__firm);
user_destroy();
@ -610,6 +615,15 @@ bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key)
app().build_nomiditte();
app().build_ditte_sheet(f.mask().source_file().ends_with("cg4300a.msk") ?
(wht)f.mask().get_int(CG43_RDB_VERS) : all);
TMask& msk = f.mask();
const int vers = msk.get_int(CG43_RDB_VERS);
const int m = (vers == 3) ? msk.get_int(CG43_LST_TRIM) : msk.get_int(CG43_LST_MESE);
const TRectype & lim = app().get_lim(m);
const bool def = lim.get_bool("B1");
const bool calc = !def && (lim.empty() || lim.get_bool("B0"));
msk.set(CG43_CHK_CALCULATE, calc, 0x3);
msk.set(CG43_CHK_FINAL, def, 0x3);
}
return true;
}
@ -736,9 +750,20 @@ bool TLiquidazione_app::lst_tm_handler(TMask_field& f, KEY key)
msk.field(CG43_LST_CALC).disable();
}
else
{
if (key != K_ENTER)
{
const TRectype & lim = app().get_lim(m);
const bool def = lim.get_bool("B1");
const bool calc = !def && (lim.empty() || lim.get_bool("B0"));
msk.set(CG43_CHK_CALCULATE, calc, 0x3);
msk.set(CG43_CHK_FINAL, def, 0x3);
// Abilita il ricalcolo solo se non e' richiesta esplicitamente la sola stampa
if (!msk.get_bool(CG43_CHK_FINAL))
msk.field(CG43_LST_CALC).enable();
if (msk.get_bool(CG43_CHK_CALCULATE))
msk.field(CG43_LST_CALC).enable();
}
}
const bool change = (app()._month != 13 && m == 13) || (app()._month == 13 && m != 13);
if (change)
@ -777,7 +802,7 @@ bool TLiquidazione_app::reset_button(TMask_field& f, KEY key)
return true;
}
bool TLiquidazione_app::chk_final_handler(TMask_field& f, KEY key)
bool TLiquidazione_app::chk_calculate_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE)
{
@ -785,7 +810,7 @@ bool TLiquidazione_app::chk_final_handler(TMask_field& f, KEY key)
// Abilita solo se il mese di ricalcolo e' != 13 (annuale) e non e' checkkato il campo
const int vers = m.get_int(CG43_RDB_VERS);
const int mese = vers == 3 ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE);
const bool abilita = !m.get_bool(CG43_CHK_FINAL) && mese != 13;
const bool abilita = m.get_bool(CG43_CHK_CALCULATE) && mese != 13;
m.enable(CG43_LST_CALC, abilita);
}
return true;
@ -871,6 +896,9 @@ void TLiquidazione_app::build_ditte_sheet(wht what)
bool TLiquidazione_app::set_liquidazione()
{
TMask m("cg4300a");
TRectype & lim = (TRectype &) get_lim(_month);
const bool def = lim.get_bool("B1");
const bool calc = !def && (lim.empty() || lim.get_bool("B0"));
m.set_handler(CG43_FLD_DTO, to_ditt_handler);
m.set_handler(CG43_FLD_DFR, fr_ditt_handler);
@ -880,15 +908,18 @@ bool TLiquidazione_app::set_liquidazione()
m.set_handler(CG43_LST_TRIM, lst_tm_handler);
m.set_handler(CG43_BUT_SEL, select_button);
m.set_handler(CG43_BUT_ANN, reset_button);
m.set_handler(CG43_CHK_FINAL, chk_final_handler);
m.set_handler(CG43_CHK_CALCULATE, chk_calculate_handler);
m.set(CG43_FLD_ANNO, _year);
m.set(CG43_LST_MESE, _month);
m.set(CG43_CHK_STAMPA,"X"); // stampa abilitata per default
m.set(CG43_CHK_CALCULATE, calc, 0x3);
m.set(CG43_CHK_FINAL, def, 0x3);
m.set(CG43_RDB_VERS, _what);
const KEY k = m.run();
const KEY k = m.run();
if (k == K_ENTER)
if (k == K_ENTER)
{
// handlers have set everything
_month = _what == trimestre ? m.get_int(CG43_LST_TRIM) :
@ -897,11 +928,13 @@ bool TLiquidazione_app::set_liquidazione()
_year = m.get(CG43_FLD_ANNO);
_date = m.get(CG43_FLD_DATA);
_isprint = m.get_bool(CG43_CHK_STAMPA);
_recalc = (recalc)m.get_long(CG43_LST_CALC);
_printonly = m.get_bool(CG43_CHK_FINAL);
_recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never;
_printonly = !m.get_bool(CG43_CHK_CALCULATE);
if (_isprint) printer().setdate(_date);
if (_printonly) _recalc = never;
lim.zero("B0");
lim.put("B1", m.get_bool(CG43_CHK_FINAL));
put_lim(lim);
}
return k == K_ENTER;
}

File diff suppressed because it is too large Load Diff

@ -1,17 +1,18 @@
#define CG43_BUT_SEL 102
#define CG43_BUT_MEM 103
#define CG43_BUT_ANN 104
#define CG43_BUT_CHK 105
#define CG43_LST_MESE 106
#define CG43_LST_TRIM 107
#define CG43_FLD_ANNO 108
#define CG43_FLD_DATA 109
#define CG43_CHK_STAMPA 110
#define CG43_FLD_SELECTED 111
#define CG43_RDB_VERS 112
#define CG43_FLD_DFR 113
#define CG43_FLD_DTO 114
#define CG43_LST_CALC 115
#define CG43_CHK_FINAL 116
#define CG43_LST_CALC_13A 117
#define CG43_BUT_SEL 102
#define CG43_BUT_MEM 103
#define CG43_BUT_ANN 104
#define CG43_BUT_CHK 105
#define CG43_LST_MESE 106
#define CG43_LST_TRIM 107
#define CG43_FLD_ANNO 108
#define CG43_FLD_DATA 109
#define CG43_CHK_STAMPA 110
#define CG43_FLD_SELECTED 111
#define CG43_RDB_VERS 112
#define CG43_FLD_DFR 113
#define CG43_FLD_DTO 114
#define CG43_LST_CALC 115
#define CG43_CHK_CALCULATE 116
#define CG43_LST_CALC_13A 117
#define CG43_CHK_FINAL 118

@ -1,128 +1,135 @@
#include "cg4300a.h"
TOOLBAR "topbar" 0 0 0 2
#include <printbar.h>
ENDPAGE
PAGE "Calcolo Liquidazioni" 0 2 0 0
RADIOBUTTON CG43_RDB_VERS 1 18
BEGIN
PROMPT 4 1 "Versamenti"
ITEM "1|Tutti" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE
ITEM "2|Mensili" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE
ITEM "3|Trimestrali" MESSAGE SHOW,CG43_LST_TRIM|HIDE,CG43_LST_MESE
END
GROUPBOX DLG_NULL 38 5
BEGIN
PROMPT 26 1 "Anno/Periodo"
END
NUMBER CG43_FLD_ANNO 4
BEGIN
PROMPT 28 2 "Anno "
HELP "Anno per cui effettuare il calcolo"
FLAGS "P"
CHECKTYPE REQUIRED
END
LIST CG43_LST_MESE 15
BEGIN
PROMPT 28 3 "Periodo "
HELP "Mese per cui effettuare il calcolo liquidazione"
ITEM "13|13a liquid."
FLAGS "MP"
END
LIST CG43_LST_TRIM 15
BEGIN
PROMPT 28 3 "Periodo "
HELP "Trimestre di cui effettuare il calcolo liquidazione"
ITEM "3|1 Trimestre "
ITEM "6|2 Trimestre "
ITEM "9|3 Trimestre "
ITEM "12|4 Trimestre"
ITEM "13|13a liquid."
END
LIST CG43_LST_CALC 15
BEGIN
PROMPT 28 4 "Ricalcola "
HELP "Indicare se rifare il calcolo durante la stampa"
ITEM "2|Mese/trimestre"
ITEM "3|Da inizio anno"
END
LIST CG43_LST_CALC_13A 15
BEGIN
PROMPT 28 4 "Ricalcola "
HELP "Indicare se rifare il calcolo durante la stampa"
ITEM "3|Da inizio anno"
FLAGS "HD"
END
GROUPBOX DLG_NULL 40 5
BEGIN
PROMPT 4 6 "Scelta ditte"
END
NUMBER CG43_FLD_DFR 5
BEGIN
PROMPT 5 7 "Da codice "
HELP "Codice ditta di partenza per la selezione"
FLAGS "B"
END
NUMBER CG43_FLD_DTO 5
BEGIN
PROMPT 5 8 "A codice "
HELP "Codice ditta di fine selezione"
FLAGS "B"
END
STRING CG43_FLD_SELECTED 5
BEGIN
PROMPT 5 9 "Scelte n. "
FLAGS "DR"
END
BUTTON CG43_BUT_SEL 10 2
BEGIN
PROMPT 28 7 "~Selezione"
PICTURE TOOL_FINDREC
HELP "Selezione ditte di cui fare la liquidazione"
END
BUTTON CG43_BUT_ANN 10
BEGIN
PROMPT 28 9 "A~zzera"
HELP "Azzerare la selezione delle ditte da fare la liquidazione"
END
GROUPBOX DLG_NULL 60 3
BEGIN
PROMPT 4 11 "Stampa"
END
BOOLEAN CG43_CHK_STAMPA
BEGIN
PROMPT 5 12 "Esegui "
MESSAGE TRUE ENABLE,CG43_FLD_DATA
MESSAGE FALSE DISABLE,CG43_FLD_DATA
END
DATE CG43_FLD_DATA
BEGIN
PROMPT 18 12 "con data "
FLAGS "A"
END
BOOLEAN CG43_CHK_FINAL
BEGIN
PROMPT 45 12 "Solo stampa"
END
ENDPAGE
ENDMASK
#include "cg4300a.h"
TOOLBAR "topbar" 0 0 0 2
#include <printbar.h>
ENDPAGE
PAGE "Calcolo Liquidazioni" 0 2 0 0
RADIOBUTTON CG43_RDB_VERS 1 18
BEGIN
PROMPT 4 1 "Versamenti"
ITEM "1|Tutti" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE
ITEM "2|Mensili" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE
ITEM "3|Trimestrali" MESSAGE SHOW,CG43_LST_TRIM|HIDE,CG43_LST_MESE
END
GROUPBOX DLG_NULL 38 7
BEGIN
PROMPT 26 1 "Anno/Periodo"
END
NUMBER CG43_FLD_ANNO 4
BEGIN
PROMPT 28 2 "Anno "
HELP "Anno per cui effettuare il calcolo"
FLAGS "P"
CHECKTYPE REQUIRED
END
BOOLEAN CG43_CHK_CALCULATE
BEGIN
PROMPT 28 3 "Calcola"
END
BOOLEAN CG43_CHK_FINAL
BEGIN
PROMPT 28 4 "Definitiva"
MESSAGE FALSE ENABLE,CG43_CHK_CALCULATE
MESSAGE TRUE DISABLE,CG43_CHK_CALCULATE
END
LIST CG43_LST_MESE 15
BEGIN
PROMPT 28 5 "Periodo "
HELP "Mese per cui effettuare il calcolo liquidazione"
ITEM "13|13a liquid."
FLAGS "MP"
END
LIST CG43_LST_TRIM 15
BEGIN
PROMPT 28 5 "Periodo "
HELP "Trimestre di cui effettuare il calcolo liquidazione"
ITEM "3|1 Trimestre "
ITEM "6|2 Trimestre "
ITEM "9|3 Trimestre "
ITEM "12|4 Trimestre"
ITEM "13|13a liquid."
END
LIST CG43_LST_CALC 15
BEGIN
PROMPT 28 6 "Ricalcola "
HELP "Indicare se rifare il calcolo durante la stampa"
ITEM "2|Mese/trimestre"
ITEM "3|Da inizio anno"
END
LIST CG43_LST_CALC_13A 15
BEGIN
PROMPT 28 6 "Ricalcola "
HELP "Indicare se rifare il calcolo durante la stampa"
ITEM "3|Da inizio anno"
FLAGS "HD"
END
GROUPBOX DLG_NULL 40 5
BEGIN
PROMPT 4 7 "Scelta ditte"
END
NUMBER CG43_FLD_DFR 5
BEGIN
PROMPT 5 8 "Da codice "
HELP "Codice ditta di partenza per la selezione"
FLAGS "B"
END
NUMBER CG43_FLD_DTO 5
BEGIN
PROMPT 5 9 "A codice "
HELP "Codice ditta di fine selezione"
FLAGS "B"
END
STRING CG43_FLD_SELECTED 5
BEGIN
PROMPT 5 10 "Scelte n. "
FLAGS "DR"
END
BUTTON CG43_BUT_SEL 10 2
BEGIN
PROMPT 28 9 "~Selezione"
PICTURE TOOL_FINDREC
HELP "Selezione ditte di cui fare la liquidazione"
END
BUTTON CG43_BUT_ANN 10
BEGIN
PROMPT 28 11 "A~zzera"
HELP "Azzerare la selezione delle ditte da fare la liquidazione"
END
GROUPBOX DLG_NULL 60 3
BEGIN
PROMPT 4 12 "Stampa"
END
BOOLEAN CG43_CHK_STAMPA
BEGIN
PROMPT 5 13 "Esegui "
MESSAGE TRUE ENABLE,CG43_FLD_DATA
MESSAGE FALSE DISABLE,CG43_FLD_DATA
END
DATE CG43_FLD_DATA
BEGIN
PROMPT 18 13 "con data "
FLAGS "A"
END
ENDPAGE
ENDMASK

@ -103,7 +103,7 @@ bool TLiquidazione_app::recalc_all()
* --------------------------------------------------------------
*/
int need_refresh = false;
/* int need_refresh = false;
if (_recalc != ever)
{
int m = _month == 13 ? _month : 1;
@ -123,18 +123,20 @@ bool TLiquidazione_app::recalc_all()
"risultano ricalcolati. E' consigliabile il ricalcolo. "
"Si desidera eseguirlo?")))
_recalc = ever;
}
}
int m;
for (m = 1; m <= _month; m++) // fino a 13 compreso
{
if (is_month_plain(m) || _recalc == ever)
update_firm(m);
}
} */
if (is_month_plain(_month))
update_firm(_month, _recalc == one);
// se ci sono altri mesi dopo l'ultimo calcolato, invalida il
// flag 'calcolato' del primo, per causare il ricalcolo dei
// successivi (evitando problemi per credito precedente)
for (m = _month+1; m <= 13; m++)
for (int m = _month+1; m <= 13; m++)
{
TRectype lim = get_lim(m);
@ -211,7 +213,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
return true;
if (_recalc_regis)
ok = false; // Se sta ricalcolando i PRM/PRP se ne sbatte delle LIM
bool calc = (_recalc == ever || (_recalc == one && is_month_ok(month,_month)));
bool calc = (_recalc == one && is_month_ok(month,_month));
if (!calc && _recalc != never) calc = !ok;
bool gheravergot = false;
bool quater = false;
@ -379,21 +381,6 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
}
while (_nditte->next_match(LF_ATTIV));
if (_recalc_regis)
{
_nditte->restore_status();
// Se trattasi di ricalcolo per registri, setta il flag relativo, onde evitare ricalcoli
// nel caso di registro riepilogativo: se i PRM esistono già (perchè creati
// da stampa bollato precedente o altro riepilogo) non vanno ricalcolati.
TRectype lim = get_lim(month, true); // Crea se non esiste
lim.put("B1","X");
put_lim(lim);
return true;
}
// se quater stampa riepilogo
if (quater && month == _month && riepliq)
describe_att(month,atts, true, 'Q');
@ -473,7 +460,7 @@ bool TLiquidazione_app::update_att(int month, const char* codatt, bool recalc)
ok = false; // Se sta ricalcolando i PRM/PRP se ne sbatte dei PLM
if (ok && !recalc)
return true;
bool calc = _recalc == ever || (_recalc == one && is_month_ok(month,_month));
bool calc = (_recalc == one && is_month_ok(month,_month));
if (!calc && _recalc != never)
calc = !ok;
@ -705,7 +692,6 @@ static bool partita_chiusa_al(const TPartita& p, const TDate& d)
return c;
}
static void LOG_IVA_DIFF(const TRectype& id)
{
#ifndef NDEBUG
@ -1392,8 +1378,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
{
const TDate datareg = _mov->get(MOV_DATAREG);
sezfat = tipomov == vendita ? 'D' : 'A';
id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG));
sezfat = tipomov == vendita ? 'D' : 'A';
id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG));
id.put(RMI_NUMRIG, _rmoviva->get(RMI_NUMRIG));
id.put("NUMPRO", 0);
id.put(PART_TIPOMOV, tm);
@ -1431,7 +1417,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
real totfat = _mov->get(MOV_TOTDOC);
real tot = totfat;
FOR_EACH_ARRAY_ITEM(pagscatt, r, obj)
FOR_EACH_ARRAY_ITEM(pagscatt, r, obj)
{
const TRectype& pagsca = *(TRectype*)obj;
const int nrigp = pagsca.get_int(PAGSCA_NRIGP);
@ -1466,12 +1452,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
tipo_movimento tipomov_pag = tm_pagamento;
if (nrigp > 0 && nrigp < 9999)
{
const TPartita& p = arrpart.partita(pagsca);
const TRiga_partite& rp = p.riga(nrigp);
const TPartita& p = arrpart.partita(pagsca);
const TRiga_partite& rp = p.riga(nrigp);
nregpag = rp.get_long(PART_NREG);
nrigpag = rp.get_int(PART_NUMRIG);
tipomov_pag = rp.tipo();
nregpag = rp.get_long(PART_NREG);
nrigpag = rp.get_int(PART_NUMRIG);
tipomov_pag = rp.tipo();
id.put(PART_TIPOMOV, tipomov_pag);
id.put("NUMREGP", nregpag);
id.put("NUMRIGP", nrigpag);
@ -4124,12 +4110,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
_lam->put("R2", cred_prec);
_lam->put("R3", debt_precd);
if (!_recalc_only && _recalc != never)
lim.put("B0","X");
lim.put("B0","");
if (_recalc_only)
lim.put("B1", "X");
// AWFUL! se siamo in annuale, occorre arrotondare alle 1000 lire
// schiaffo tutto il codice nell'IF che segue, e se lo si vuole togliere
// non si fara' che scancellare tutto il blocco

@ -39,7 +39,7 @@ void TLiquidazione_app::zero_plafond (int month, const char* codatt)
if (!look_ppa(month == 1 ? 1 : month -1/*previous_month(month)*/, codatt,jj))
// mazza che bella chiamata ricorsiva
{
if (_recalc != needed)
/* if (_recalc != needed)
{
describe_error(TR("Progressivi plafond non ricalcolati per i mesi precedenti: possibili errori"),
codatt);
@ -51,7 +51,7 @@ void TLiquidazione_app::zero_plafond (int month, const char* codatt)
describe_error(TR("Progressivi plafond non ricalcolati per i mesi precedenti: possibili errori"),
codatt);
look_ppa(previous_month(month),codatt,jj);
}
} */
}
if (is_ok) // Se il record prec. esiste allora esegue i calcoli; In caso contrario diventa un errore sistematico
@ -116,8 +116,8 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
// 1) ricalcola i pim dei mesi dal primo al corrente se necessario
recalc rcl = _recalc;
_recalc = needed;
recalc rcl = _recalc ;
_recalc = one;
int m;
for (m = 1; m < month; m++)
update_att(m,codatt, FALSE);

@ -374,7 +374,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
_comp_acconto = TRUE;
// force recalc of current month
_recalc = one;
int need_refresh = FALSE;
/* int need_refresh = FALSE;
for (int mese = 1; mese < _month; mese++)
if (is_month_ok_strict(mese))
{
@ -386,7 +386,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
break;
}
}
if (need_refresh && yesno_box(FR("Alcuni mesi precedenti non risultano ricalcolati:\n"
if (need_refresh && yesno_box(FR("Alcuni mesi precedenti non risultano ricalcolati:\n"
"è consigliabile il ricalcolo. Si desidera eseguirlo?")))
_recalc = ever;
@ -396,8 +396,10 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
if (_prind->iscancelled())
break;
update_firm(m);
}
} */
if (is_month_plain(_month) && !_prind->iscancelled())
update_firm(_month, _recalc == one);
// calcola l'acconto
TRectype lim = get_lim(12);
@ -457,18 +459,21 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
// pulisci il water
_comp_acconto = FALSE;
_isprint = FALSE;
for (int i = 1; i <= _month; i++)
/* for (int i = 1; i <= _month; i++)
if (is_month_plain(i))
update_firm(i);
lim.put("B0","");
put_lim(lim);
// put_lim(lim);
lim = get_lim(13);
if (lim.not_empty())
// lim = get_lim(13);
// if (lim.not_empty())
{
lim.put("B0","");
put_lim(lim);
}
*/
if (is_month_plain(_month))
update_firm(_month, _recalc == one);
//fine
_isprint = true;
}

@ -216,7 +216,7 @@ bool TStampa_registri_app::ricalcola(int mese)
{
TString8 key; key.format("%04d%02d", _annoes, m);
lim.put("CODTAB", key);
if (lim.read() != NOERR || !lim.get_bool("B1"))
if (lim.read() != NOERR)
return true;
}
}
@ -225,7 +225,7 @@ bool TStampa_registri_app::ricalcola(int mese)
{
TString8 key; key.format("%04d%02d", _annoes, mese);
lim.put("CODTAB", key);
if (lim.read() != NOERR || !lim.get_bool("B1"))
if (lim.read() != NOERR)
return true;
}
else
@ -234,7 +234,7 @@ bool TStampa_registri_app::ricalcola(int mese)
mese += 2 - ((mese-1) % 3);
TString8 key; key.format("%04d%02d", _annoes, mese);
lim.put("CODTAB", key);
if (lim.read() != NOERR || !lim.get_bool("B1"))
if (lim.read() != NOERR)
return true;
}
return false;
@ -1165,7 +1165,12 @@ messaggio TStampa_registri_app::controlla_liquidazione()
chiave.format("%04d%02d", _annoes, i);
lim.put("CODTAB", chiave);
if (lim.read() != NOERR || !lim.get_bool("B0"))
mesi_cal << itom(i) << '\n';
{
if (lim.get_bool("B1"))
mesi_cal ="";
else
mesi_cal << itom(i) << '\n';
}
}
} else
if (_frequiva == 'M')
@ -1175,7 +1180,12 @@ messaggio TStampa_registri_app::controlla_liquidazione()
chiave.format("%04d%02d", _annoes, i);
lim.put("CODTAB", chiave);
if (lim.read() != NOERR || !lim.get_bool("B0"))
mesi_cal << itom(i) << '\n';
{
if (lim.get_bool("B1"))
mesi_cal ="";
else
mesi_cal << itom(i) << '\n';
}
}
}
if (mesi_cal.not_empty())
@ -1184,22 +1194,26 @@ messaggio TStampa_registri_app::controlla_liquidazione()
(const char*)ditta, (const char*) _codreg, (const char *)mesi_cal);
continua = yesno_box(TR("Si desidera ugualmente proseguire?"));
if (!continua) return non_proseguire;
continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)"));
/* continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)"));
if (!continua) return prosegui_stampa;
return prosegui_cal_stampa;
*/
return prosegui_stampa;
}
}
else if (_tipo_riepilogativo == 'A')
{
chiave.format("%04d%02d", _annoes, 13);
lim.put("CODTAB", chiave);
if (lim.read() != NOERR || !lim.get_bool("B0"))
if (lim.read() != NOERR || lim.get_bool("B0"))
{
continua = yesno_box(FR("Ditta %s: non eseguito calcolo liquidazione annuale da stampare sul registro %s. Si desidera ugualmente proseguire?"), (const char*)ditta, (const char*) _codreg);
if (!continua) return non_proseguire;
continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)"));
/* continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)"));
if (!continua) return prosegui_stampa;
return prosegui_cal_stampa;
return prosegui_cal_stampa; */
return prosegui_stampa;
}
else
{
@ -1211,20 +1225,18 @@ messaggio TStampa_registri_app::controlla_liquidazione()
chiave.format("%04d%02d", _annoes, m);
lim.put("CODTAB", chiave);
if (lim.read() != NOERR || !lim.get_bool("B0"))
{
need_refresh = true;
break;
}
need_refresh |= !lim.get_bool("B1");
}
if (need_refresh)
{
continua = yesno_box(FR("Ditta %s: la liquidazione di alcuni mesi precedenti deve essere ricalcolata.\n"
"Si desidera ugualmente proseguire?"), (const char*)ditta);
if (!continua) return non_proseguire;
continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione?\n"
/* continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione?\n"
"(altrimenti si prosegue con la sola stampa liquidazione)"));
if (!continua) return prosegui_stampa;
return prosegui_cal_stampa;
return prosegui_cal_stampa; */
return prosegui_stampa;
}
}
}