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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -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)) if (!look_ppa(month == 1 ? 1 : month -1/*previous_month(month)*/, codatt,jj))
// mazza che bella chiamata ricorsiva // mazza che bella chiamata ricorsiva
{ {
if (_recalc != needed) /* if (_recalc != needed)
{ {
describe_error(TR("Progressivi plafond non ricalcolati per i mesi precedenti: possibili errori"), describe_error(TR("Progressivi plafond non ricalcolati per i mesi precedenti: possibili errori"),
codatt); 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"), describe_error(TR("Progressivi plafond non ricalcolati per i mesi precedenti: possibili errori"),
codatt); codatt);
look_ppa(previous_month(month),codatt,jj); 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 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 // 1) ricalcola i pim dei mesi dal primo al corrente se necessario
recalc rcl = _recalc; recalc rcl = _recalc ;
_recalc = needed; _recalc = one;
int m; int m;
for (m = 1; m < month; m++) for (m = 1; m < month; m++)
update_att(m,codatt, FALSE); update_att(m,codatt, FALSE);

View File

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

View File

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