Corretta IVA autotrasportatori e impostazione automatica del flag "stampato" sui versamenti IVA, in modo che compaiano immediatamente in liquidazione

git-svn-id: svn://10.65.10.50/branches/R_10_00@23020 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2014-12-10 16:08:15 +00:00
parent 0d2e2d4bca
commit ec024943ae
17 changed files with 323 additions and 406 deletions

View File

@ -1928,10 +1928,14 @@ void TPrimanota_application::ini2mask(TConfig& ini, TMask& msk, bool query)
if (numrig < 0 || !(cg.cell_disabled(numrig, 0) && cg.cell_disabled(numrig, 1))) if (numrig < 0 || !(cg.cell_disabled(numrig, 0) && cg.cell_disabled(numrig, 1)))
{ {
TImporto import(ini.get_char(RMV_SEZIONE), real(ini.get(RMV_IMPORTO))); TString4 sez = ini.get(RMV_SEZIONE); sez.strip("\"");
if (sez == "A" || sez == "D")
{
TImporto import(sez[0], real(ini.get(RMV_IMPORTO)));
if (!import.is_zero()) if (!import.is_zero())
import.add_to(riga, 0); // Dare/Avere 101-102 import.add_to(riga, 0); // Dare/Avere 101-102
} }
}
if (numrig < 0 || !cg.cell_disabled(numrig, 3)) if (numrig < 0 || !cg.cell_disabled(numrig, 3))
{ {

View File

@ -265,7 +265,6 @@ class TLiquidazione_app : public TPrint_application
bool _isricacq; // ricalcolo imposte acq. riv (par. ditta) bool _isricacq; // ricalcolo imposte acq. riv (par. ditta)
bool _isdifferita; // liquidazione differita e mese != 13 bool _isdifferita; // liquidazione differita e mese != 13
bool _isdiffacc; // liq. differita (usato per stampa registri) bool _isdiffacc; // liq. differita (usato per stampa registri)
bool _isagr98; // TRUE se l'anno e' > 1997 e si sta calcolando una attivita' agricola
bool _recalc_only; // solo ricalcolo progressivi bool _recalc_only; // solo ricalcolo progressivi
bool _recalc_regis; // solo ricalcolo progressivi per registri bool _recalc_regis; // solo ricalcolo progressivi per registri
bool _calcall; // tutte le ditte nessuna esclusa bool _calcall; // tutte le ditte nessuna esclusa

View File

@ -286,7 +286,6 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
_isviaggio = ndt_att.get_bool("REG74TER"); _isviaggio = ndt_att.get_bool("REG74TER");
_isagricolo = ndt_att.get_bool("REGAGR"); _isagricolo = ndt_att.get_bool("REGAGR");
_isagr98 = _isagricolo && atoi(_year) >= 1998;
_isvent = false; _isvent = false;
if (!_recalc_regis && tipoatt == 1 && waspla && month == 13) if (!_recalc_regis && tipoatt == 1 && waspla && month == 13)
@ -542,7 +541,7 @@ void TLiquidazione_app::zero_att(int month, const char* codatt)
} }
// Azzera i progressivi per il prospetto agricolo dal 1998 // Azzera i progressivi per il prospetto agricolo dal 1998
if (_isagr98) if (_isagricolo)
{ {
for (_pia->first(); !_pia->eof(); _pia->next()) for (_pia->first(); !_pia->eof(); _pia->next())
{ {
@ -1086,7 +1085,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
if (_isviaggio) if (_isviaggio)
{ {
if (tipomov == vendita && _mov->get(MOV_DATA74TER).not_empty()) if (tipomov == vendita && _mov->get_date(MOV_DATA74TER).ok())
date = _mov->get_date(MOV_DATA74TER); date = _mov->get_date(MOV_DATA74TER);
if (date.year() != year_int) // Controlla anno di appartenenza, altrimenti is_date_ok potrebbe non funzionare if (date.year() != year_int) // Controlla anno di appartenenza, altrimenti is_date_ok potrebbe non funzionare
continue; continue;
@ -1953,8 +1952,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
agr_1i += agr_imp; agr_1i += agr_imp;
// Nuovo regime agricolo dal 1998: si sommino per codice iva di compensazione (da reperire su PCON) // Nuovo regime agricolo dal 1998: si sommino per codice iva di compensazione (da reperire su PCON)
if (_isagr98)
{
TString ivacomp("00"); // Se non esiste o non si trova il conto questo e' il default (fa un poco schifo ma e' cosi') TString ivacomp("00"); // Se non esiste o non si trova il conto questo e' il default (fa un poco schifo ma e' cosi')
if (_cur->is_first_match(-AGR_PCON1)) // Esiste il conto ? if (_cur->is_first_match(-AGR_PCON1)) // Esiste il conto ?
@ -1971,7 +1968,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
_pia->put("B0", true); // Seguo l'esempio dei PIM per il ricalcolo acquisti alla fine del ciclo _pia->put("B0", true); // Seguo l'esempio dei PIM per il ricalcolo acquisti alla fine del ciclo
_pia->rewrite(); // infine scrive _pia->rewrite(); // infine scrive
} }
}
else if (tipoagr == 2 && is_not_fs) else if (tipoagr == 2 && is_not_fs)
{ {
agr_2 += agr_iva; agr_2 += agr_iva;
@ -2495,7 +2491,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
// Ricalcola le imposte per regime agricolo dal 1998 (PIA) // Ricalcola le imposte per regime agricolo dal 1998 (PIA)
if (_isagr98) if (_isagricolo)
{ {
for (_pia->first(); !_pia->eof(); _pia->next()) for (_pia->first(); !_pia->eof(); _pia->next())
{ {
@ -2516,7 +2512,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
} }
} }
/* /* rediito_
* calcola il lercio prorata * calcola il lercio prorata
* solo se liq. periodica * solo se liq. periodica
*/ */
@ -2625,12 +2621,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
round_al_centesimo(acquisti_iva); round_al_centesimo(acquisti_iva);
} }
if (_isagr98) // Dal 1998
{
_plm->put("R13", agr_detIA); _plm->put("R13", agr_detIA);
acquisti_iva += agr_detIA; acquisti_iva += agr_detIA;
} }
}
_plm->put("R12", _prorata.percentuale(_year)); // per comodita' in stampa _plm->put("R12", _prorata.percentuale(_year)); // per comodita' in stampa
_plm->put("R4", percentuale1); _plm->put("R4", percentuale1);

View File

@ -105,7 +105,8 @@ int TLiquidazione_app::previous_month(int m) const
if (_freqviva == "M") if (_freqviva == "M")
return m == 1 ? 1 : m - 1; return m == 1 ? 1 : m - 1;
else else
return m == 3 ? 3 : m - 3; //return m == 3 ? 3 : m - 3; // Cambiato il 10/11/2014
return m <= 6 ? 3 : m >= 10 ? 9 : 6;
} }
bool TLiquidazione_app::is_date_ok(const TDate& d, int month, int liqmonth, int year) const bool TLiquidazione_app::is_date_ok(const TDate& d, int month, int liqmonth, int year) const
@ -623,17 +624,15 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
// deve rifarsi la delega con l'ESTRAZIONE VERSAMENTI // deve rifarsi la delega con l'ESTRAZIONE VERSAMENTI
// io l'ho lasciato per rispetto del lavoro altrui // io l'ho lasciato per rispetto del lavoro altrui
long ditta = _nditte->curr().get_long("CODDITTA"); const long ditta = _nditte->curr().get_long("CODDITTA");
_del->zero(); _del->zero();
(*_del_ditta) = format("%05ld", ditta); (*_del_ditta) = format("%05ld", ditta);
(*_del_anno) = _year; (*_del_anno) = _year;
(*_del_mese) = format("%02d", month); (*_del_mese) = format("%02d", month);
(*_del_tipo) = format("%1d", type); (*_del_tipo) = format("%1d", type);
TString16 ctab = _del->get("CODTAB"); const TString16 ctab = _del->get("CODTAB");
_del->read(); bool ok = _del->read() == NOERR;
bool ok = _del->good();
if (!ok && create) if (!ok && create)
{ {
@ -834,17 +833,19 @@ real TLiquidazione_app::credito_prec(int month)
// ritorna l'appropriato credito precedente al mese in corso // ritorna l'appropriato credito precedente al mese in corso
{ {
real c = ZERO; real c = ZERO;
if (!(_freqviva =="M" || is_trim(month))) // Aggiunto il 10/11/2014
return c;
const bool lia_ok = look_lia(); const bool lia_ok = look_lia();
const bool old_age = /*atoi(_year) < 2000 ||*/ _lia->get("S9") != "NV"; const bool credito_visibile = _lia->get("S9") != "NV";
if (is_first_month(month)) if (is_first_month(month))
{ {
// credito inizio anno // credito inizio anno
if (lia_ok) if (lia_ok)
{ {
// Dal 2000 se S8="NV" il credito precedente non esiste piu' // Dal 2000 se S9="NV" il credito precedente non esiste piu'
if (old_age) if (credito_visibile)
c = _lia->get_real("R0"); c = _lia->get_real("R0");
} }
// e' positivo o 0 // e' positivo o 0
@ -852,13 +853,13 @@ real TLiquidazione_app::credito_prec(int month)
else else
{ {
c = result_liq(previous_month(month)); c = result_liq(previous_month(month));
if (c.sign() < 0) if (c < ZERO)
c = abs(c); c = -c;
else else
c = ZERO; c = ZERO;
// Dal 2000 se S8="NV" il credito trasferito non esiste piu' // Dal 2000 se S9="NV" il credito trasferito non esiste piu'
if (old_age) if (credito_visibile)
{ {
// Nel caso di trimestrali considera dal trimestre corrispondente a // Nel caso di trimestrali considera dal trimestre corrispondente a
// quello impostato+1. Ad es. se m == 1 considera dal I trim. (m=3) // quello impostato+1. Ad es. se m == 1 considera dal I trim. (m=3)
@ -880,7 +881,7 @@ real TLiquidazione_app::credito_costo_prec(int month)
// ritorna l'appropriato credito di costo precedente al mese in corso // ritorna l'appropriato credito di costo precedente al mese in corso
// (travel agency only) // (travel agency only)
{ {
real c(0.0); real c = ZERO;
if (is_first_month(month) || month == 13) if (is_first_month(month) || month == 13)
{ {
// credito inizio anno // credito inizio anno

View File

@ -19,15 +19,10 @@
#define IS_PRORATA 0x0001 #define IS_PRORATA 0x0001
// minchietta per prospetto ventilazione // minchietta per prospetto ventilazione
class _vDesc : public TObject struct _vDesc : public TObject
{ {
public:
TString4 _codiva; TString4 _codiva;
real _acq; real _acq, _vnd, _viv;
real _vnd;
real _viv;
_vDesc() {}
virtual ~_vDesc() {}
}; };
const char* const sep = const char* const sep =
@ -91,14 +86,7 @@ void TLiquidazione_app::set_page(int file, int cnt)
set_grand(d); set_grand(d);
break; break;
case LIQACC: case LIQACC:
/* Obsoleto
if (atoi(_year) >= 2000)
set_liqacc_2000(d); set_liqacc_2000(d);
else
set_liqacc_1999(d);
*/
set_liqacc_2000(d);
break; break;
case ACCONTO: case ACCONTO:
set_acconto_p(d); set_acconto_p(d);
@ -282,10 +270,11 @@ void TLiquidazione_app::describe_plafond(int month, const char* codatt)
void TLiquidazione_app::describe_ventilation(int month, const char* codatt) void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
{ {
if (!_isvent || _isagricolo || _isviaggio) return; if (!_isvent || _isagricolo || _isviaggio)
return;
_DescrItem* d = new _DescrItem(VENTILA); _DescrItem* d = new _DescrItem(VENTILA);
TString att(codatt); TString16 att = codatt;
look_plm(month, att); look_plm(month, att);
@ -304,7 +293,7 @@ void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
real imponibile = _pim->get_real("R0"); real imponibile = _pim->get_real("R0");
real imposta = _pim->get_real("R1"); real imposta = _pim->get_real("R1");
tiporeg tipomov = (tiporeg)_reg->get_long("I0"); tiporeg tipomov = (tiporeg)_reg->get_long("I0");
TString tipoiva = _iva->get("S1"); TString4 tipoiva = _iva->get("S1");
if (_year != *_pim_anno || (month == 13 && mese < 13)) if (_year != *_pim_anno || (month == 13 && mese < 13))
continue; continue;
@ -389,8 +378,7 @@ void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
{ {
_DescrItem* d = new _DescrItem(REGAGR); _DescrItem* d = new _DescrItem(REGAGR);
if (_isagr98) // Setta l'array interno con tutti gli items relativi alla tabella PIA // Setta l'array interno con tutti gli items relativi alla tabella PIA
{
TArray& agr_array = d->_arr; TArray& agr_array = d->_arr;
for (_pia->first(); !_pia->eof(); _pia->next()) // Scorre i progressivi agricoli for (_pia->first(); !_pia->eof(); _pia->next()) // Scorre i progressivi agricoli
{ {
@ -406,7 +394,6 @@ void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
agr_array.add(p); // Aggiunge il fottuto item agricolo agr_array.add(p); // Aggiunge il fottuto item agricolo
} }
} }
}
for (int mese = month == 13 ? 13 : 1; mese <= month; mese++) for (int mese = month == 13 ? 13 : 1; mese <= month; mese++)
{ {
@ -1342,7 +1329,7 @@ _DescrItem* TLiquidazione_app::describe_deleghe(int month)
if (_stampa_vers) //solo se sono a debito if (_stampa_vers) //solo se sono a debito
if (look_del(month,month == 13 ? 2 : 1)) if (look_del(month,month == 13 ? 2 : 1))
{ {
if (_del->get_bool("B0")) if (_del->get_bool("B0")) // Stampata?
{ {
//_del->S2 descr. ufficio iva/concessione //_del->S2 descr. ufficio iva/concessione
//_del->S1 descrizione banca //_del->S1 descrizione banca
@ -1361,7 +1348,7 @@ _DescrItem* TLiquidazione_app::describe_deleghe(int month)
{ {
d->_s4 = "ACC"; d->_s4 = "ACC";
TToken_string t; TToken_string t;
if (_del->get_bool("B0")) if (_del->get_bool("B0")) // Stampata?
{ {
//_del->S2 descr. ufficio iva/concessione //_del->S2 descr. ufficio iva/concessione
//_del->S1 descrizione banca //_del->S1 descrizione banca
@ -2813,9 +2800,10 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
// prospettino versamento // prospettino versamento
else if (di._flags == DELEGA) else if (di._flags == DELEGA)
{ {
const bool acconto = di._s4 == "ACC";
int rr = rw; int rr = rw;
int cont = 10; int cont = 10;
if (di._s4 == "ACC") if (acconto)
{ {
TToken_string ac(di._s5); TToken_string ac(di._s5);
if (!ac.empty_items() && _stampa_vers) if (!ac.empty_items() && _stampa_vers)
@ -2829,20 +2817,17 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
set_bookmark(TR("Riepilogo versamenti"), _firm_bookmark); set_bookmark(TR("Riepilogo versamenti"), _firm_bookmark);
TString dt = di._d0.string(); if (acconto) // Acconto
TString vr; imp2string(di._r0, vr);
if (di._s4 == "ACC") // Acconto
{ {
TToken_string ac(di._s5); TToken_string ac(di._s5);
if (!ac.empty_items()) if (!ac.empty_items())
{ {
TString dt (ac.get(4)); TString16 dt (ac.get(4));
real app (ac.get(3)); real app (ac.get(3));
TString vr; imp2string(app, vr); TString16 vr; imp2string(app, vr);
TString con (ac.get(0)); TString4 con (ac.get(0));
TString abi (ac.get(1)); TString8 abi (ac.get(1));
TString cab (ac.get(2)); TString8 cab (ac.get(2));
set_row(rw++, TR("- ACCONTO DICEMBRE -")); set_row(rw++, TR("- ACCONTO DICEMBRE -"));
set_row(rw, FR(" Versamento di %s effettuato il %s"), set_row(rw, FR(" Versamento di %s effettuato il %s"),
@ -2858,9 +2843,10 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
if (_stampa_vers) if (_stampa_vers)
{ {
TString16 dt = di._d0.string();
TString16 vr; imp2string(di._r0, vr);
set_row(rw, FR(" Versamento di %s effettuato il %s"), set_row(rw, FR(" Versamento di %s effettuato il %s"),
(const char*)vr, (const char*)vr, (const char*)dt);
(const char*)dt);
set_row(rw++, FR("@68gCod Conc.: %3s"),(const char*)di._s0); set_row(rw++, FR("@68gCod Conc.: %3s"),(const char*)di._s0);
set_row(rw++, FR("@68gCod. ABI: %5s Cod. CAB o Cod. Dipendenza: %5s"),(const char*)di._s1,(const char*)di._s2); set_row(rw++, FR("@68gCod. ABI: %5s Cod. CAB o Cod. Dipendenza: %5s"),(const char*)di._s1,(const char*)di._s2);
} }
@ -2988,9 +2974,6 @@ void TLiquidazione_app::set_regagr(_DescrItem& d)
{ {
set_print_zero(TRUE); set_print_zero(TRUE);
const bool is1998 = atoi(_year) >= 1998;
CHECK(is1998 == _isagr98, "Mucca pazza!");
real& agr_1 = d._r0; real& agr_1 = d._r0;
real& agr_2 = d._r1; real& agr_2 = d._r1;
real& agr_3 = d._r2; real& agr_3 = d._r2;
@ -3007,7 +2990,7 @@ void TLiquidazione_app::set_regagr(_DescrItem& d)
real ara = agr_5 + agr_6; real ara = agr_5 + agr_6;
real arn = agr_3 + agr_4; real arn = agr_3 + agr_4;
real agr_ven = agr_1 + agr_2; real agr_ven = agr_1 + agr_2;
real ivadt_amm = agr_3 + ivadt + (is1998 ? iva_detIA : agr_1); real ivadt_amm = agr_3 + ivadt + iva_detIA;
set_bookmark(TR("Prospetto regime agricolo"), _att_bookmark); set_bookmark(TR("Prospetto regime agricolo"), _att_bookmark);
int r = 1; int r = 1;
@ -3064,17 +3047,14 @@ void TLiquidazione_app::set_regagr(_DescrItem& d)
set_row(r++, ""); set_row(r++, "");
set_row(r++, "@56g%r", &agr_7); set_row(r++, "@56g%r", &agr_7);
riga.format(FR("Iva ammessa in detrazione sugli acquisti promiscui@%dg%%s"),xl - corr - ln/2); riga.format(FR("IVA ammessa in detrazione sugli acquisti promiscui@%dg%%s"),xl - corr - ln/2);
set_row(r++, riga, (const char*)middle); set_row(r++, riga, (const char*)middle);
corr = dn.len() % 2 == 0 ? 0 : 1; corr = dn.len() % 2 == 0 ? 0 : 1;
riga.format("@%dg%%s",xl - corr - dn.len()/2); riga.format("@%dg%%s",xl - corr - dn.len()/2);
set_row(r++, riga, (const char*)dn); set_row(r++, riga, (const char*)dn);
set_row(r++, ""); set_row(r++, "");
if (is1998)
{
set_row(r++, FR("Iva ammessa in detrazione I parte tabella A@56g%r"),&iva_detIA); set_row(r++, FR("Iva ammessa in detrazione I parte tabella A@56g%r"),&iva_detIA);
set_row(r++, ""); set_row(r++, "");
}
set_row(r++, FR("Totale iva ammessa in detrazione@56g%r"),&ivadt_amm); set_row(r++, FR("Totale iva ammessa in detrazione@56g%r"),&ivadt_amm);
// Last pain... // Last pain...

View File

@ -399,7 +399,7 @@ bool TLiquidazione_app::video_conferma(const real& newimp, const real& intr,
_del->remove(); _del->remove();
else else
{ {
_del->put("B0", ""); _del->put("B0", false);
_del->put("R0",newimp); _del->put("R0",newimp);
_del->put("R1",intr); _del->put("R1",intr);
_del->put("R2",narr); _del->put("R2",narr);

View File

@ -31,9 +31,11 @@ BEGIN
VALIDATE FIXLEN_FUNC 4 VALIDATE FIXLEN_FUNC 4
END END
STRING F_FREQUENZA 1 LIST F_FREQUENZA 1 16
BEGIN BEGIN
PROMPT 2 5 "Frequenza versamenti (M/T) " PROMPT 2 5 "Frequenza versamenti "
ITEM "M|Mensile"
ITEM "T|Trimestrale"
FLAGS "U" FLAGS "U"
HELP "Indicare la frequenza delle liquidazioni IVA per il nuovo esercizio" HELP "Indicare la frequenza delle liquidazioni IVA per il nuovo esercizio"
END END

View File

@ -68,14 +68,10 @@ void TAp_iva::libro_unico()
bool TAp_iva::apertura_iva() bool TAp_iva::apertura_iva()
{ {
TString16 codlia;
TString4 annoiva; annoiva.format("%04d", _annoiva);
//viene aggiornata la tabella LIA (liquidazione iva annuale) //viene aggiornata la tabella LIA (liquidazione iva annuale)
TTable tablia ("%LIA"); TTable tablia ("%LIA");
codlia.format("%05ld%04d", get_firm(), _annoiva); TString16 codlia; codlia.format("%05ld%04d", get_firm(), _annoiva);
tablia.put ("CODTAB", codlia); tablia.put ("CODTAB", codlia);
if (tablia.read() == NOERR) if (tablia.read() == NOERR)
tablia.remove(); tablia.remove();
@ -94,7 +90,7 @@ bool TAp_iva::apertura_iva()
tablia.put("B2", _is_minagr); tablia.put("B2", _is_minagr);
tablia.zero("R0"); tablia.zero("R0");
if (tablia.get_bool("B5")) // IVA per casssa if (tablia.get_bool("B5")) // IVA per cassa
{ {
tablia.put("D0", TDate( 1, 1, _annoiva)); tablia.put("D0", TDate( 1, 1, _annoiva));
tablia.put("D1", TDate(31,12, _annoiva)); tablia.put("D1", TDate(31,12, _annoiva));
@ -109,6 +105,7 @@ bool TAp_iva::apertura_iva()
TRelation reg("REG"); TRelation reg("REG");
TRectype & tabreg = reg.curr(); TRectype & tabreg = reg.curr();
TString4 annoiva; annoiva.format("%04d", _annoiva);
tabreg.put ("CODTAB", annoiva); tabreg.put ("CODTAB", annoiva);
TCursor cur_reg(&reg, "", 1, &tabreg, &tabreg); TCursor cur_reg(&reg, "", 1, &tabreg, &tabreg);
@ -133,7 +130,7 @@ bool TAp_iva::apertura_iva()
const int tiporeg = tabreg.get_int("I0"); const int tiporeg = tabreg.get_int("I0");
if ( (tiporeg == 1)||(tiporeg == 2)||(tiporeg==3)||(tiporeg==9)) if ( (tiporeg == 1)||(tiporeg == 2)||(tiporeg==3)||(tiporeg==9))
{ {
TString16 cod = tabreg.get("CODTAB"); TString8 cod = tabreg.get("CODTAB");
cod.overwrite(annoiva); cod.overwrite(annoiva);
tabreg.put("CODTAB", cod); tabreg.put("CODTAB", cod);

View File

@ -24,23 +24,15 @@ bool cau_filter1 (const TRelation *r)
if (rec.get(CAU_TIPODOC) == "ST") // Solo i tipi documento STorno if (rec.get(CAU_TIPODOC) == "ST") // Solo i tipi documento STorno
{ {
TTable& reg = (TTable&) r->lfile("REG"); TString16 cod; cod << __anno << rec.get(CAU_REG);
TString16 cod; const TRectype& reg = cache().get("REG", cod);
cod << __anno;
cod << rec.get(CAU_REG);
reg.put("CODTAB", cod);
if (reg.read() == NOERR )
{
const int i9 = reg.get_int("I9");
const bool b1 = reg.get_bool("B1"); const bool b1 = reg.get_bool("B1");
if (i9 == 1 || i9 == 0 && b1) // Il registro deve avere la X di sospensione NORMALE const int i9 = reg.get_int("I9");
if (b1 && i9 <= 1) // Il registro deve avere la X di sospensione NORMALE
{ {
TLocalisamfile & rcau = r->lfile(LF_RCAUSALI); // La riga 1 (gia' posizionata nella relazione) deve essere di tipo cliente cod.format("%s|1", (const char*)rec.get(CAU_CODCAUS));
const TRectype& rcau = cache().get(LF_RCAUSALI, cod);
if (rcau.get(RCA_TIPOCF) == "C") rt = rcau.get_char(RCA_TIPOCF) == 'C';
rt = TRUE;
}
} }
} }
@ -49,17 +41,13 @@ bool cau_filter1 (const TRelation *r)
bool cau_filter2 (const TRelation *r) bool cau_filter2 (const TRelation *r)
{ {
bool rt = FALSE; bool rt = false;
const TRectype& rec = r->curr(LF_CAUSALI); const TRectype& rec = r->curr(LF_CAUSALI);
const TString& tipo = rec.get(CAU_TIPODOC); const TString& tipo = rec.get(CAU_TIPODOC);
if (tipo == "FV" || tipo == "NC") // Solo i tipi documento Fatture Vendita if (tipo == "FV" || tipo == "NC") // Solo i tipi documento Fatture Vendita
{ {
TTable& reg = (TTable&) r->lfile("REG"); TString16 cod; cod << __anno << rec.get(CAU_REG);
TString16 cod; const TRectype& reg = cache().get("REG", cod);
cod << __anno;
cod << rec.get(CAU_REG);
reg.put("CODTAB", cod);
if (reg.read() == NOERR)
rt = !reg.get_bool("B1"); rt = !reg.get_bool("B1");
} }
@ -140,7 +128,7 @@ void TGestAutoTrasp_mask::fill_sheet(const short id)
TRectype fromrec(LF_MOV); TRectype fromrec(LF_MOV);
TRectype torec(LF_MOV); TRectype torec(LF_MOV);
TString filter; TString filter;
TString16 caus; TString4 caus;
filter << "(REG==\"" << codreg << "\")"; filter << "(REG==\"" << codreg << "\")";
filter << "&&((STAMPATO!=\"X\")&&(REGST!=\"X\"))"; filter << "&&((STAMPATO!=\"X\")&&(REGST!=\"X\"))";
@ -212,11 +200,9 @@ bool TGestAutoTrasp_mask::on_field_event(TOperable_field& o, TField_event e, lon
set(F_ANNO, __anno); set(F_ANNO, __anno);
TCursor* cur1 = efield(F_CAUS).browse()->cursor(); TCursor* cur1 = efield(F_CAUS).browse()->cursor();
cur1->set_filterfunction(cau_filter1, TRUE); cur1->set_filterfunction(cau_filter1, TRUE);
TCursor* cur2 = sfield(F_SHEET_CAUSALI).sheet_mask().efield(F_CAUDEF).browse()->cursor(); TCursor* cur2 = sfield(F_SHEET_CAUSALI).sheet_mask().efield(F_CAUDEF).browse()->cursor();
cur2->set_filterfunction(cau_filter2, TRUE); cur2->set_filterfunction(cau_filter2, TRUE);
if (e == fe_modify) if (e == fe_modify)
@ -350,7 +336,6 @@ void TGestAutoTrasp_mask::write_movs()
for (int i=0; i<items;i++) for (int i=0; i<items;i++)
{ {
TToken_string& tt = sf.row(i); TToken_string& tt = sf.row(i);
TString& s = (TString&)_caudef[tt.get(0)]; TString& s = (TString&)_caudef[tt.get(0)];
s = tt.get(F_CAUDEF - F_CAUMOV); s = tt.get(F_CAUDEF - F_CAUMOV);
} }
@ -381,8 +366,8 @@ void TGestAutoTrasp_mask::write_movs()
{ {
pi.addstatus(1); pi.addstatus(1);
const TString16 cod_caus = curr_rec.get(MOV_CODCAUS); const TString4 cod_caus = curr_rec.get(MOV_CODCAUS);
const TString16 cod_caus_def = (TString&)_caudef[cod_caus]; const TString4 cod_caus_def = (TString&)_caudef[cod_caus];
if (cod_caus_def.blank()) if (cod_caus_def.blank())
continue; continue;
@ -412,8 +397,8 @@ void TGestAutoTrasp_mask::write_movs()
// Flag operazione stampata in definitiva, solo per quelli in sospensione ed il movimento di storno, // Flag operazione stampata in definitiva, solo per quelli in sospensione ed il movimento di storno,
// il movimento definitivo non va flaggato. // il movimento definitivo non va flaggato.
mpn_sosp_rec.put(MOV_STAMPATO, TRUE); mpn_sosp_rec.put(MOV_STAMPATO, true);
mpn_sosp_rec.put(MOV_REGST, TRUE); mpn_sosp_rec.put(MOV_REGST, true);
// Sistema il movimento di storno a partire da quello in sospensione // Sistema il movimento di storno a partire da quello in sospensione
TCausale storno_caus(get(F_CAUS), __anno); // Forse è ridondante ma serve per tener aggiornato il nr. protocollo TCausale storno_caus(get(F_CAUS), __anno); // Forse è ridondante ma serve per tener aggiornato il nr. protocollo
@ -514,7 +499,7 @@ void TGestAutoTrasp_app::main_loop()
{ {
while (_msk->run() != K_QUIT) while (_msk->run() != K_QUIT)
{ {
if (yesno_box(TR("Procedo con la creazione dei movimenti?"))) if (yesno_box(TR("Procedere con la creazione dei movimenti?")))
{ {
_msk->write_movs(); _msk->write_movs();
_msk->reset(); _msk->reset();

View File

@ -2,15 +2,7 @@
TOOLBAR "topbar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 10 2 #include <stdbar.h>
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE ENDPAGE
@ -65,12 +57,14 @@ END
STRING F_CODREG 3 STRING F_CODREG 3
BEGIN BEGIN
PROMPT 2 6 "Codice registro " PROMPT 2 6 "Codice registro "
USE REG SELECT ((B1=="X")&&((I9==1)||(I9==0))) USE REG SELECT (B1=="X")&&(I9<=1)
INPUT CODTAB[1,4] F_ANNO INPUT CODTAB[1,4] F_ANNO SELECT
INPUT CODTAB[5,7] F_CODREG INPUT CODTAB[5,7] F_CODREG
DISPLAY "Anno " CODTAB[1,4] DISPLAY "Anno " CODTAB[1,4]
DISPLAY "Codice " CODTAB[5,7] DISPLAY "Codice " CODTAB[5,7]
DISPLAY "Descrizione @40" S0 DISPLAY "Descrizione @40" S0
DISPLAY "Sosp.@4C" B1
DISPLAY "Tipo Sosp.@10" I9
OUTPUT F_CODREG CODTAB[5,7] OUTPUT F_CODREG CODTAB[5,7]
OUTPUT F_DESREG S0 OUTPUT F_DESREG S0
FLAGS "U" FLAGS "U"
@ -100,9 +94,7 @@ STRING F_CAUS 3
BEGIN BEGIN
PROMPT 2 10 "Causale di storno " PROMPT 2 10 "Causale di storno "
FLAGS "UZ" FLAGS "UZ"
USE LF_CAUSALI USE LF_CAUSALI SELECT TIPODOC="ST"
JOIN REG INTO CODTAB==TIPODOC
JOIN LF_RCAUSALI INTO CODCAUS==CODCAUS NRIGA=="1"
INPUT CODCAUS F_CAUS INPUT CODCAUS F_CAUS
DISPLAY "Codice" CODCAUS DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
@ -112,6 +104,7 @@ BEGIN
OUTPUT F_DESCRCAUS DESCR OUTPUT F_DESCRCAUS DESCR
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
WARNING "Causale indicata non completa od errata" WARNING "Causale indicata non completa od errata"
ADD RUN cg0 -4
END END
STRING F_DESCRCAUS 50 40 STRING F_DESCRCAUS 50 40
@ -160,7 +153,7 @@ BEGIN
PROMPT 1 4 "Caus. mov. definitivo " PROMPT 1 4 "Caus. mov. definitivo "
FLAGS "UZ" FLAGS "UZ"
USE LF_CAUSALI USE LF_CAUSALI
JOIN REG INTO CODTAB==TIPODOC JOIN REG INTO CODTAB[1,4]=-#ANNO CODTAB[5,7]=REG
INPUT CODCAUS F_CAUDEF INPUT CODCAUS F_CAUDEF
DISPLAY "Codice" CODCAUS DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
@ -170,7 +163,7 @@ BEGIN
OUTPUT F_DESCAUDEF DESCR[1,15] OUTPUT F_DESCAUDEF DESCR[1,15]
OUTPUT F_CAUDEFREG REG OUTPUT F_CAUDEFREG REG
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "La causale definitiva e' obbligatoria" WARNING "La causale definitiva è obbligatoria"
END END
STRING F_DESCAUDEF 15 STRING F_DESCAUDEF 15

View File

@ -8,7 +8,7 @@ ENDPAGE
/* page1 */ /* page1 */
PAGE "Parametri ditta" 0 0 0 2 PAGE "Parametri ditta" 0 2 0 0
NUMBER FLD_ANLIIV 4 NUMBER FLD_ANLIIV 4
BEGIN BEGIN

View File

@ -1,10 +1,7 @@
#include <browfile.h> #include <browfile.h>
#include <currency.h>
#include <prefix.h>
#include <execp.h> #include <execp.h>
#include <msksheet.h> #include <msksheet.h>
#include <mailbox.h> #include <mailbox.h>
#include <prefix.h>
#include <progind.h> #include <progind.h>
#include <relation.h> #include <relation.h>
#include <recarray.h> #include <recarray.h>
@ -55,27 +52,23 @@ void Visliq_app::set_freqviva()
_freqviva = _lia->get("S7"); _freqviva = _lia->get("S7");
else else
{ {
TString key; const TRectype& ditta = cache().get(LF_NDITTE, get_firm());
key.format("%ld", get_firm());
const TRectype & ditta = cache().get(LF_NDITTE, key);
_freqviva = ditta.get("FREQVIVA"); _freqviva = ditta.get("FREQVIVA");
} }
} }
bool Visliq_app::create() bool Visliq_app::create()
{ {
_firm = get_firm();
TDate oggi(TODAY);
_year = oggi.year();
open_files(LF_TABCOM, LF_TAB, LF_NDITTE, 0); open_files(LF_TABCOM, LF_TAB, LF_NDITTE, 0);
const TDate oggi(TODAY);
_year = oggi.year();
_firm = get_firm();
_nditte = new TRelation(LF_NDITTE); _nditte = new TRelation(LF_NDITTE);
_ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"), _ditte = new TArray_sheet(-1, -1, 76, 20, TR("Selezione Ditte"),
HR("Cod.@5|Ragione Sociale@50|Vers.")); HR("Codice|Ragione Sociale@50|Vers."));
_from_one = FALSE; _from_one = false;
_del = new TTable("%DEL"); _del = new TTable("%DEL");
_lia = new TTable("%LIA"); _lia = new TTable("%LIA");
_lim = new TTable("LIM"); _lim = new TTable("LIM");
@ -128,7 +121,7 @@ bool Visliq_app::ch_year_handler(TMask_field& f, KEY key)
app().build_ditte_sheet(); app().build_ditte_sheet();
app().reset_fields(); app().reset_fields();
} }
return TRUE; return true;
} }
@ -165,9 +158,9 @@ bool Visliq_app::select_butt(TMask& m)
m.field(F_RAGSOC).set(row.get(1)); m.field(F_RAGSOC).set(row.get(1));
set_freqviva(row.get(2)); set_freqviva(row.get(2));
set_mask_freq(m); set_mask_freq(m);
return TRUE; return true;
} }
return FALSE; return false;
} }
void Visliq_app::build_nomiditte() void Visliq_app::build_nomiditte()
@ -225,7 +218,7 @@ void Visliq_app::set_mask_freq(TMask& m)
bool Visliq_app::sheet_action(TSheet_field& s, int r, KEY k) bool Visliq_app::sheet_action(TSheet_field& s, int r, KEY k)
{ {
if (k == K_ENTER) if (k == K_ENTER)
app()._sh_dirty = TRUE; app()._sh_dirty = true;
// non si possono cancellare o aggiungere righe // non si possono cancellare o aggiungere righe
return (k != K_DEL && k != K_INS); return (k != K_DEL && k != K_INS);
} }
@ -233,7 +226,7 @@ bool Visliq_app::sheet_action(TSheet_field& s, int r, KEY k)
bool Visliq_app::vers_action(TSheet_field& s, int r, KEY k) bool Visliq_app::vers_action(TSheet_field& s, int r, KEY k)
{ {
if (k == K_ENTER) if (k == K_ENTER)
app()._sv_dirty = TRUE; app()._sv_dirty = true;
// non si possono cancellare o aggiungere righe // non si possono cancellare o aggiungere righe
return (k != K_DEL && k != K_INS); return (k != K_DEL && k != K_INS);
} }
@ -243,7 +236,7 @@ const char* Visliq_app::link_handler(TMask& m,
{ {
// con click visualizza, con double click modifica // con click visualizza, con double click modifica
TString st(txt); TString st(txt);
bool iscred = FALSE; bool iscred = false;
static int group; static int group;
int firstfoc = 0; int firstfoc = 0;
@ -288,14 +281,14 @@ void Visliq_app::main_loop()
// handlers // handlers
bool Visliq_app::set_ditta(TMask_field& f, KEY k) bool Visliq_app::set_ditta(TMask_field& f, KEY k)
{ {
bool found = TRUE; bool found = true;
if (k == K_F9) if (k == K_F9)
return app().select_butt(f.mask()); return app().select_butt(f.mask());
if (k == K_TAB && f.focusdirty()) if (k == K_TAB && f.focusdirty())
{ {
found = FALSE; found = false;
TString ditta = f.get(); TString ditta = f.get();
TArray_sheet* sh = app().get_ditte_sheet(); TArray_sheet* sh = app().get_ditte_sheet();
for (int i = 0; i < sh->items(); i++) for (int i = 0; i < sh->items(); i++)
@ -309,7 +302,7 @@ bool Visliq_app::set_ditta(TMask_field& f, KEY k)
f.mask().field(F_RAGSOC).set(row.get(1)); f.mask().field(F_RAGSOC).set(row.get(1));
app().set_freqviva(row.get(2)); app().set_freqviva(row.get(2));
app().set_mask_freq(f.mask()); app().set_mask_freq(f.mask());
found = TRUE; found = true;
} }
else else
{ {
@ -327,14 +320,14 @@ bool Visliq_app::set_ditta(TMask_field& f, KEY k)
bool Visliq_app::set_ragsoc(TMask_field& f, KEY k) bool Visliq_app::set_ragsoc(TMask_field& f, KEY k)
{ {
bool found = TRUE; bool found = true;
if (k == K_F9) if (k == K_F9)
return app().select_butt(f.mask()); return app().select_butt(f.mask());
if (k == K_TAB && f.focusdirty()) if (k == K_TAB && f.focusdirty())
{ {
found = FALSE; found = false;
TString ditta = f.get(); TString ditta = f.get();
TArray_sheet* sh = app().get_ditte_sheet(); TArray_sheet* sh = app().get_ditte_sheet();
for (int i = 0; i < sh->items(); i++) for (int i = 0; i < sh->items(); i++)
@ -349,7 +342,7 @@ bool Visliq_app::set_ragsoc(TMask_field& f, KEY k)
f.mask().field(F_RAGSOC).set(row.get(1)); f.mask().field(F_RAGSOC).set(row.get(1));
app().set_freqviva(row.get(2)); app().set_freqviva(row.get(2));
app().set_mask_freq(f.mask()); app().set_mask_freq(f.mask());
found = TRUE; found = true;
break; break;
} }
} }
@ -362,7 +355,7 @@ bool Visliq_app::set_ragsoc(TMask_field& f, KEY k)
bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k) bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
{ {
if (k != K_SPACE) return TRUE; if (k != K_SPACE) return true;
TMask& m = *(app().get_main_mask()); TMask& m = *(app().get_main_mask());
TSheet_field& sh = m.sfield(F_VISLIQ1); TSheet_field& sh = m.sfield(F_VISLIQ1);
@ -370,29 +363,31 @@ bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
int sel = sh.selected(); int sel = sh.selected();
int month = sh.selected()+1; int month = sh.selected()+1;
TToken_string& tt = sh.row(sh.selected()); TToken_string& tt = sh.row(sh.selected());
if (sh.items() == 4) month *= 3; if (sh.items() == 4)
month *= 3;
bool ok = FALSE; bool ok = false;
//if (m.dirty() || sh.sheet_mask().dirty()) //if (m.dirty() || sh.sheet_mask().dirty())
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty) if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty)
{ {
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?")); KEY k = yesnocancel_box(TR("Registrare le modifiche effettuate?"));
if (k == K_YES) if (k == K_YES)
app().write_general(m); app().write_general(m);
else if (k == K_NO) else if (k == K_NO)
app().read_general(m); app().read_general(m);
ok = (k == K_YES || k == K_NO); ok = (k == K_YES || k == K_NO);
} }
else ok = TRUE; else
ok = true;
TMask& sm = sh.sheet_mask(); TMask& sm = sh.sheet_mask();
if (ok) if (ok)
{ {
if (sm.is_running()) sm.stop_run(K_ENTER); if (sm.is_running()) sm.stop_run(K_ENTER);
app().vis_one(month); app().vis_one(month);
const bool new_age_2000 = (app()._year >= 2000) && (app()._lia->get("S9") == "NV"); const bool non_vis_ma_comp = app()._lia->get("S9") == "NV";
if (new_age_2000) if (non_vis_ma_comp)
app().read_general(m); app().read_general(m);
} }
@ -423,13 +418,13 @@ bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
sv.force_update(sel == (sh.items() - 1) ? sel -1 : sel); sv.force_update(sel == (sh.items() - 1) ? sel -1 : sel);
} }
return TRUE; return true;
} }
bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k) bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
{ {
if (k != K_SPACE) return TRUE; if (k != K_SPACE) return true;
TMask& m = *(app().get_main_mask()); TMask& m = *(app().get_main_mask());
TSheet_field& sh = (TSheet_field&)m.field(F_VISLIQ2); TSheet_field& sh = (TSheet_field&)m.field(F_VISLIQ2);
@ -439,9 +434,9 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
month *= 3; month *= 3;
// click su acconto // click su acconto
if (month > 12) return TRUE; if (month > 12) return true;
bool ok = FALSE; bool ok = false;
//if (m.dirty()) //if (m.dirty())
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty) if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty)
{ {
@ -452,7 +447,7 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
app().read_general(m); app().read_general(m);
ok = k == K_YES || k == K_NO; ok = k == K_YES || k == K_NO;
} }
else ok = TRUE; else ok = true;
TMask& sv = sh.sheet_mask(); TMask& sv = sh.sheet_mask();
if (ok) if (ok)
@ -477,7 +472,7 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
sh.force_update(sel); sh.force_update(sel);
} }
return TRUE; return true;
} }
@ -509,7 +504,7 @@ void Visliq_app::vis_liq()
set_firm(dtt); set_firm(dtt);
TIva_round ir; TIva_round ir;
ir.set_default_iva_mode(_year, FALSE); ir.set_default_iva_mode(_year, false);
const int month = m.get_int(_freqviva == "M" ? F_MONTHS : F_TRIMS); const int month = m.get_int(_freqviva == "M" ? F_MONTHS : F_TRIMS);
_is_annual = (month == 13); _is_annual = (month == 13);
@ -527,7 +522,7 @@ void Visliq_app::vis_liq()
bool Visliq_app::vis_all() bool Visliq_app::vis_all()
{ {
if (!look_lia()) if (!look_lia())
return FALSE; return false;
// mask diverse per trimestrale e annuale // mask diverse per trimestrale e annuale
_mask = new TMask(_freqviva == "M" ? "cg5500b" : "cg5500c"); _mask = new TMask(_freqviva == "M" ? "cg5500b" : "cg5500c");
@ -545,8 +540,8 @@ bool Visliq_app::vis_all()
sh.sheet_mask().set_handler(100,sel_mese_sh1); sh.sheet_mask().set_handler(100,sel_mese_sh1);
sv.sheet_mask().set_handler(100,sel_mese_sh2); sv.sheet_mask().set_handler(100,sel_mese_sh2);
const bool new_age_2000 = (_year >= 2000) && (_lia->get("S9") == "NV"); const bool new_print_2000 = true; // _year >= 2000;
const bool new_print_2000 = _year >= 2000; const bool new_age_2000 = _lia->get("S9") == "NV";
TMask& shm = sh.sheet_mask(); TMask& shm = sh.sheet_mask();
for (int id = 103; shm.id2pos(id) > 0; id++) for (int id = 103; shm.id2pos(id) > 0; id++)
@ -564,28 +559,27 @@ bool Visliq_app::vis_all()
// fill the mask in // fill the mask in
read_general(*_mask); read_general(*_mask);
for (bool stop = FALSE; !stop;) for (bool stop = false; !stop;)
{ {
KEY k = _mask->run(); KEY k = _mask->run();
switch(k) switch(k)
{ {
case K_ESC: case K_ESC:
case K_QUIT: case K_QUIT:
if (_mask->dirty()) if (_mask->dirty())
{ {
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?")); KEY k = yesnocancel_box(TR("Registrare le modifiche effettuate?"));
if (k == K_YES) if (k == K_YES)
write_general(*_mask); write_general(*_mask);
else else
read_general(*_mask); read_general(*_mask);
if (k == K_YES || k == K_NO) if (k == K_YES || k == K_NO)
stop = TRUE; stop = true;
break; break;
} }
else stop = TRUE; else
stop = true;
break; break;
case K_SAVE: case K_SAVE:
// write values // write values
@ -601,7 +595,7 @@ bool Visliq_app::vis_all()
_vers_sheet = NULL; _vers_sheet = NULL;
_liq_sheet = NULL; _liq_sheet = NULL;
return TRUE; return true;
} }
@ -610,7 +604,7 @@ bool Visliq_app::vis_one(int m)
begin_wait(); begin_wait();
TMask msk("cg5500d"); TMask msk("cg5500d");
bool recorded = TRUE; bool recorded = true;
TString nomem(TR("Liquidazione IVA ")); TString nomem(TR("Liquidazione IVA "));
nomem << itoname(m); nomem << itoname(m);
@ -643,12 +637,12 @@ bool Visliq_app::vis_one(int m)
TExternal_app liq("cg4 -2"); TExternal_app liq("cg4 -2");
end_wait(); end_wait();
TProgind* pp = new TProgind(10,TR("Estrazione liquidazione: prego attendere"),FALSE,FALSE); TProgind* pp = new TProgind(10,TR("Estrazione liquidazione: prego attendere"),false,false);
liq.run(); liq.run();
if (liq.exitcode()) if (liq.exitcode())
{ {
beep(); beep();
return FALSE; return false;
} }
look_lim(m); look_lim(m);
@ -711,7 +705,7 @@ bool Visliq_app::vis_one(int m)
delete pp; delete pp;
TViswin & vsw = brw.vis_win(); TViswin & vsw = brw.vis_win();
bool is_delega = FALSE; bool is_delega = false;
real vers; TDate date; TString abi(5), cab(5), con(3); real vers; TDate date; TString abi(5), cab(5), con(3);
@ -732,10 +726,10 @@ bool Visliq_app::vis_one(int m)
end_wait(); end_wait();
bool l_mod = FALSE; bool l_mod = false;
bool d_mod = FALSE; bool d_mod = false;
_from_one = TRUE; _from_one = true;
for(;;) for(;;)
{ {
@ -768,16 +762,16 @@ bool Visliq_app::vis_one(int m)
if (msk.field(F_RETTIFICA).dirty() || msk.field(F_DEBCRE).dirty()) if (msk.field(F_RETTIFICA).dirty() || msk.field(F_DEBCRE).dirty())
{ {
rettifica = n_rettifica; rettifica = n_rettifica;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_ACCONTO).dirty()) if (msk.field(F_ACCONTO).dirty())
{ {
acconto = n_acconto; acconto = n_acconto;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_RIMBORSO).dirty()) if (msk.field(F_RIMBORSO).dirty())
{ {
bool ok = TRUE; bool ok = true;
if (!n_rimborso.is_zero()) if (!n_rimborso.is_zero())
{ {
const bool old_rim = !rimborso.is_zero(); const bool old_rim = !rimborso.is_zero();
@ -789,70 +783,70 @@ bool Visliq_app::vis_one(int m)
if (ok) if (ok)
{ {
rimborso = n_rimborso; rimborso = n_rimborso;
l_mod = TRUE; l_mod = true;
} }
else else
{ {
msk.field(F_RIMBORSO).set(rimborso.string()); msk.field(F_RIMBORSO).set(rimborso.string());
msk.field(F_RIMBORSO).set_dirty(FALSE); msk.field(F_RIMBORSO).set_dirty(false);
} }
} }
if (msk.field(F_DESCR1).dirty()) if (msk.field(F_DESCR1).dirty())
{ {
desc1 = n_desc1; desc1 = n_desc1;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_DESCR2).dirty()) if (msk.field(F_DESCR2).dirty())
{ {
desc2 = n_desc2; desc2 = n_desc2;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_DESCR3).dirty()) if (msk.field(F_DESCR3).dirty())
{ {
desc3 = n_desc3; desc3 = n_desc3;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_DELDATE).dirty()) if (msk.field(F_DELDATE).dirty())
{ {
date = n_date; date = n_date;
d_mod = TRUE; d_mod = true;
} }
if (msk.field(F_DELIMP).dirty()) if (msk.field(F_DELIMP).dirty())
{ {
real itt = _lim->get_real("R10"); real itt = _lim->get_real("R10");
vers = n_vers; vers = n_vers;
d_mod = TRUE; d_mod = true;
} }
if (msk.field(F_DELABI).dirty()) if (msk.field(F_DELABI).dirty())
{ {
abi = n_abi; abi = n_abi;
d_mod = TRUE; d_mod = true;
} }
if (msk.field(F_DELCAB).dirty()) if (msk.field(F_DELCAB).dirty())
{ {
cab = n_cab; cab = n_cab;
d_mod = TRUE; d_mod = true;
} }
if (msk.field(F_DELCON).dirty()) if (msk.field(F_DELCON).dirty())
{ {
con = n_con; con = n_con;
d_mod = TRUE; d_mod = true;
} }
if (msk.field(F_VARIMP).dirty() || msk.field(F_VARIMP_DC).dirty()) if (msk.field(F_VARIMP).dirty() || msk.field(F_VARIMP_DC).dirty())
{ {
varimp = n_varimp; varimp = n_varimp;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_IMPNONVER).dirty()) if (msk.field(F_IMPNONVER).dirty())
{ {
impnonver = n_impnonver; impnonver = n_impnonver;
l_mod = TRUE; l_mod = true;
} }
if (msk.field(F_CREDSPEC).dirty()) if (msk.field(F_CREDSPEC).dirty())
{ {
credspec = n_credspec; credspec = n_credspec;
l_mod = TRUE; l_mod = true;
} }
if (recorded) recorded = !(d_mod || l_mod); if (recorded) recorded = !(d_mod || l_mod);
@ -866,8 +860,8 @@ bool Visliq_app::vis_one(int m)
{ {
{ write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); } { write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); }
if (d_mod) { write_del(); } if (d_mod) { write_del(); }
l_mod = d_mod = FALSE; l_mod = d_mod = false;
recorded = TRUE; recorded = true;
} }
if (k == K_QUIT) if (k == K_QUIT)
{ {
@ -878,8 +872,8 @@ bool Visliq_app::vis_one(int m)
{ {
if (l_mod) { write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); } if (l_mod) { write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); }
if (d_mod) { write_del(); } if (d_mod) { write_del(); }
l_mod = d_mod = FALSE; l_mod = d_mod = false;
recorded = TRUE; recorded = true;
} }
if (kk == K_YES || kk == K_NO) if (kk == K_YES || kk == K_NO)
break; break;
@ -924,7 +918,7 @@ HIDDEN void replace_number(TViswin* vsw, long rig, real num, int tab)
else else
{ {
const TCurrency c(num); const TCurrency c(num);
str = c.string(TRUE); str = c.string(true);
str.right_just(15); str.right_just(15);
} }
vsw->replace(rig, str, tab); vsw->replace(rig, str, tab);
@ -1093,25 +1087,25 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
long lvers = -1l; long lvers = -1l;
long line = vsw->search(TR("CALCOLO LIQUIDAZIONE D'IMPOSTA"), x); long line = vsw->search(TR("CALCOLO LIQUIDAZIONE D'IMPOSTA"), x);
int wasdebt = ris.sign(); int wasdebt = ris.sign();
long lrisd = vsw->search(TR("RISULTATO"), x, line, TRUE); // RISULTATO a debito long lrisd = vsw->search(TR("RISULTATO"), x, line, true); // RISULTATO a debito
long lrisc = vsw->search(TR("RISULTATO"), x, lrisd+1, TRUE); // credito long lrisc = vsw->search(TR("RISULTATO"), x, lrisd+1, true); // credito
long lrettc = vsw->search(TR("Rettifiche IVA a credito"),x,line,TRUE); long lrettc = vsw->search(TR("Rettifiche IVA a credito"),x,line,true);
long lrettd = vsw->search(TR("Rettifiche IVA a debito"), x,line,TRUE); long lrettd = vsw->search(TR("Rettifiche IVA a debito"), x,line,true);
long lacct = vsw->search(TR("Versamento acconto dicembre"),x,line,TRUE); long lacct = vsw->search(TR("Versamento acconto dicembre"),x,line,true);
long lintr = vsw->search(TR("Interesse"),x,line,TRUE); long lintr = vsw->search(TR("Interesse"),x,line,true);
long livdv = vsw->search(TR("IVA DOVUTA"),x,line,TRUE); long livdv = vsw->search(TR("IVA DOVUTA"),x,line,true);
long lrivr = vsw->search(TR("Versamenti effettuati"),x,line,TRUE); long lrivr = vsw->search(TR("Versamenti effettuati"),x,line,true);
long lvari = vsw->search(TR("Variazioni d'imposta"),x,line,TRUE); long lvari = vsw->search(TR("Variazioni d'imposta"),x,line,true);
long limnv = vsw->search(TR("Imposta non versata"),x,line,TRUE); long limnv = vsw->search(TR("Imposta non versata"),x,line,true);
long lcicd = vsw->search(TR("Credito IVA compensabile detratto"),x,line,TRUE); long lcicd = vsw->search(TR("Credito IVA compensabile detratto"),x,line,true);
long iadoc = vsw->search(TR("IVA a debito o a credito per il periodo"),x,line,TRUE); long iadoc = vsw->search(TR("IVA a debito o a credito per il periodo"),x,line,true);
long lrimb = vsw->search(iadoc > 0 ? TR("Rimborsi") : TR("Iva chiesta a rimborso"),x,line,TRUE); long lrimb = vsw->search(iadoc > 0 ? TR("Rimborsi") : TR("Iva chiesta a rimborso"),x,line,true);
if (wasdebt != 0) if (wasdebt != 0)
lvers = vsw->search(wasdebt < 0 ? TR("CREDITO ATTUALE") : TR("IVA DA VERSARE"), lvers = vsw->search(wasdebt < 0 ? TR("CREDITO ATTUALE") : TR("IVA DA VERSARE"),
x, line, TRUE); x, line, true);
if (lvers == -1l) if (lvers == -1l)
lvers = vsw->search(TR("IVA A DEBITO DA NON VERSARE"), x, line, TRUE); lvers = vsw->search(TR("IVA A DEBITO DA NON VERSARE"), x, line, true);
if (lvers == -1l) if (lvers == -1l)
lvers = lrisc+1l; lvers = lrisc+1l;
@ -1154,7 +1148,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
vsw->replace(iadoc, " ", tab2); vsw->replace(iadoc, " ", tab2);
iadoc = vsw->search(TR("IVA dovuta o a credito per il periodo"),x,line,TRUE); iadoc = vsw->search(TR("IVA dovuta o a credito per il periodo"),x,line,true);
v = risul + credspec; v = risul + credspec;
if (v < ZERO) if (v < ZERO)
{ {
@ -1168,7 +1162,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
vsw->replace(iadoc, " ", tab2); vsw->replace(iadoc, " ", tab2);
TString256 ln; TString256 ln;
long lcrs = vsw->search(TR("Crediti speciali"),x,line,TRUE); long lcrs = vsw->search(TR("Crediti speciali"),x,line,true);
if (credspec.is_zero()) if (credspec.is_zero())
vsw->replace(lcrs, " ", 58); vsw->replace(lcrs, " ", 58);
@ -1177,7 +1171,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
const bool print_intr = _freqviva == "T" && intr != 0.0; const bool print_intr = _freqviva == "T" && intr != 0.0;
const char* desc_inter = TR("Interessi dovuti per liquidazioni trimestrali"); const char* desc_inter = TR("Interessi dovuti per liquidazioni trimestrali");
lintr = vsw->search(desc_inter, x, line, TRUE); lintr = vsw->search(desc_inter, x, line, true);
if (print_intr) if (print_intr)
{ {
@ -1198,7 +1192,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
vsw->replace(lintr, ln, 11); vsw->replace(lintr, ln, 11);
} }
long idv = vsw->search(TR("IMPORTO DA"), x, iadoc, TRUE); long idv = vsw->search(TR("IMPORTO DA"), x, iadoc, true);
if (idv < 0) if (idv < 0)
idv = iadoc+6; idv = iadoc+6;
@ -1222,7 +1216,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
if (risul.sign() < 0) // Significa che in questo momento il risultato e' a credito if (risul.sign() < 0) // Significa che in questo momento il risultato e' a credito
{ {
TCurrency rabs(-risul); TCurrency rabs(-risul);
TString16 str = rabs.string(TRUE); str.right_just(15); TString16 str = rabs.string(true); str.right_just(15);
ln.overwrite(TR("CREDITO ATTUALE"), 23); ln.overwrite(TR("CREDITO ATTUALE"), 23);
ln.overwrite(str, 58); ln.overwrite(str, 58);
@ -1267,7 +1261,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
ln.overwrite(TR("IVA DA VERSARE"), 23); ln.overwrite(TR("IVA DA VERSARE"), 23);
TCurrency rabs(risul); TCurrency rabs(risul);
TString16 str = rabs.string(TRUE); str.right_just(15); TString16 str = rabs.string(true); str.right_just(15);
ln.overwrite(str, 75); ln.overwrite(str, 75);
} }
vsw->replace(lvers, ln, 0); vsw->replace(lvers, ln, 0);
@ -1427,12 +1421,12 @@ void Visliq_app::write_liq()
void Visliq_app::write_del() void Visliq_app::write_del()
{ {
bool wasdel = FALSE; bool wasdel = false;
int month = atoi(*_lim_mese); int month = atoi(*_lim_mese);
TString abi(_lim->get("S4")); TString8 abi(_lim->get("S4"));
TString cab(_lim->get("S5")); TString8 cab(_lim->get("S5"));
TString con(_lim->get("S6")); TString4 con(_lim->get("S6"));
TDate date(_lim->get("D0")); TDate date(_lim->get("D0"));
real vers(_lim->get_real("R8")); real vers(_lim->get_real("R8"));
real intr(_lim->get_real("R10")); real intr(_lim->get_real("R10"));
@ -1440,25 +1434,22 @@ void Visliq_app::write_del()
if (vers.is_zero() && (wasdel = look_del(month,1))) if (vers.is_zero() && (wasdel = look_del(month,1)))
{ {
_del->remove(); _del->remove();
_del->rewrite(); // ??? //_del->rewrite(); // ???
return; return;
} }
if (!wasdel) if (!wasdel)
look_del(month,1,TRUE); // Crea delega look_del(month,1,true); // Crea delega
real inter(0.0); real inter;
if (!intr.is_zero()) if (!intr.is_zero())
{ {
// riapplica il tasso di interesse // riapplica il tasso di interesse
// se trimestrale e' stato scorporato rispetto // se trimestrale e' stato scorporato rispetto all'eventuale input utente
// all'eventuale input utente inter = vers*CENTO/(CENTO+intr);
inter = vers*real(100.0)/(real(100.0)+intr);
inter = vers - inter; inter = vers - inter;
inter.ceil(); inter.ceil();
if (_year >= 2000)
round_imposta(inter);
} }
_del->put("R0",vers); _del->put("R0",vers);
@ -1467,8 +1458,9 @@ void Visliq_app::write_del()
_del->put("S7",abi); _del->put("S7",abi);
_del->put("S8",cab); _del->put("S8",cab);
_del->put("S9",con); _del->put("S9",con);
_del->put("B0", true); // Preimposta flag di stampato, altrimenti viene ignorato dalla liquidazione 04-12-2014
int ctri = _freqviva == "M" ? 6000 + month : 6030 + (month/3); const int ctri = _freqviva == "M" ? 6000 + month : 6030 + (month/3);
_del->put("S6", ctri); _del->put("S6", ctri);
_del->rewrite(); _del->rewrite();
@ -1477,11 +1469,11 @@ void Visliq_app::write_del()
void Visliq_app::read_general(TMask& m) void Visliq_app::read_general(TMask& m)
{ {
TString abi(5); TString8 abi;
TString cab(5); TString8 cab;
TString cnc(5); TString4 cnc;
const int step = _freqviva == "M" ? 1 : 3; const int step = _freqviva == "M" ? 1 : 3;
const bool new_age_2000 = (_year >= 2000) && (_lia->get("S9") == "NV"); const bool new_age_2000 = _lia->get("S9") == "NV";
TSheet_field& sh = m.sfield(F_VISLIQ1); TSheet_field& sh = m.sfield(F_VISLIQ1);
TSheet_field& sv = m.sfield(F_VISLIQ2); TSheet_field& sv = m.sfield(F_VISLIQ2);
@ -1496,17 +1488,13 @@ void Visliq_app::read_general(TMask& m)
if (new_age_2000) if (new_age_2000)
cr_res -= _lia->get_real("R15"); cr_res -= _lia->get_real("R15");
// set sheet // set sheet
int i; for (int i = step; i < 13; i+=step)
for (i = step; i < 13; i+=step)
{ {
int row = (i/step) - 1;
if (!is_month_ok(i)) if (!is_month_ok(i))
continue; continue;
const int row = (i/step) - 1;
if (!look_lim(i)) if (!look_lim(i))
{ {
if (sh.items() < row) if (sh.items() < row)
@ -1585,28 +1573,27 @@ void Visliq_app::read_general(TMask& m)
versamenti[m-1] += _del->get_real("R0"); versamenti[m-1] += _del->get_real("R0");
date[m-1] = _del->get_date("D0"); date[m-1] = _del->get_date("D0");
banche[m-1].add(_del->get("S7"),0); TToken_string& b = banche[m-1];
banche[m-1].add(_del->get("S8"),1); b.add(_del->get("S7"),0);
banche[m-1].add(_del->get("S9"),2); b.add(_del->get("S8"),1);
b.add(_del->get("S9"),2);
} }
// Sheet versamenti // Sheet versamenti
TString nomemese; TString nomemese;
sv.destroy(); sv.destroy();
for (i = 1; i <= 13; i++) for (int i = 1; i <= 13; i++)
{ {
if (!is_month_ok(i) && i != 13) if (!is_month_ok(i) && i != 13)
continue; continue;
TToken_string tt;
nomemese = itoname(i == 13 ? 12 : i); nomemese = itoname(i == 13 ? 12 : i);
if (nomemese == "4 Trimestre") if (nomemese == "4 Trimestre")
nomemese = "4 Tr."; nomemese = TR("4 Tr.");
if (i == 12) nomemese << TR(" acconto"); if (i == 12) nomemese << TR(" acconto");
if (i == 13) nomemese << TR(" saldo"); if (i == 13) nomemese << TR(" saldo");
TToken_string tt;
tt.add(nomemese,0); // mese tt.add(nomemese,0); // mese
tt.add(date[i-1].string(),1); // data vers. tt.add(date[i-1].string(),1); // data vers.
tt.add(banche[i-1].get(0),2); // azienda tt.add(banche[i-1].get(0),2); // azienda
@ -1616,11 +1603,11 @@ void Visliq_app::read_general(TMask& m)
sv.row(-1) = tt; sv.row(-1) = tt;
if (i == 12) if (i == 12)
sv.enable_cell(sv.items() - 1, -1, FALSE); sv.enable_cell(sv.items() - 1, -1, false);
} }
// sh.enable_column(0, FALSE); // sh.enable_column(0, false);
// sv.enable_column(0, FALSE); // sv.enable_column(0, false);
sh.force_update(); sh.force_update();
sv.force_update(); sv.force_update();
@ -1629,16 +1616,16 @@ void Visliq_app::read_general(TMask& m)
_vers_rows = sv.rows_array(); _vers_rows = sv.rows_array();
_liq_rows = sh.rows_array(); _liq_rows = sh.rows_array();
m.field(F_CREDPREC).set_dirty(FALSE); m.field(F_CREDPREC).set_dirty(false);
m.field(F_VISLIQ1).set_dirty(_sh_dirty=FALSE); m.field(F_VISLIQ1).set_dirty(_sh_dirty=false);
m.field(F_VISLIQ2).set_dirty(_sv_dirty=FALSE); m.field(F_VISLIQ2).set_dirty(_sv_dirty=false);
} }
void Visliq_app::write_general(TMask& m) void Visliq_app::write_general(TMask& m)
{ {
TSheet_field& sh = (TSheet_field&)m.field(F_VISLIQ1); TSheet_field& sh = m.sfield(F_VISLIQ1);
TSheet_field& sv = (TSheet_field&)m.field(F_VISLIQ2); TSheet_field& sv = m.sfield(F_VISLIQ2);
const bool new_age_2000 = (_year >= 2000) && (_lia->get("S9") == "NV"); const bool new_age_2000 = _lia->get("S9") == "NV";
if (m.field(F_CREDPREC).dirty()) if (m.field(F_CREDPREC).dirty())
{ {
@ -1660,7 +1647,7 @@ void Visliq_app::write_general(TMask& m)
// indicatore ricalcolo crediti e debiti OK // indicatore ricalcolo crediti e debiti OK
int step = _freqviva == "M" ? 1 : 3; int step = _freqviva == "M" ? 1 : 3;
bool carry = TRUE; bool carry = true;
bool was_lim; bool was_lim;
TMask& shm = sh.sheet_mask(); TMask& shm = sh.sheet_mask();
TMask& svm = sv.sheet_mask(); TMask& svm = sv.sheet_mask();
@ -1705,10 +1692,10 @@ void Visliq_app::write_general(TMask& m)
TDate ndate(tt_vn.get(1)); TDate ndate(tt_vn.get(1));
TString odbcr(tt_lo.get(5)); TString odbcr(tt_lo.get(5));
TString ndbcr(tt_ln.get(5)); TString ndbcr(tt_ln.get(5));
TString oabi (tt_vo.get(2)); TString8 oabi (tt_vo.get(2));
TString nabi (tt_vn.get(2)); TString8 nabi (tt_vn.get(2));
TString ocab (tt_vo.get(3)); TString8 ocab (tt_vo.get(3));
TString ncab (tt_vn.get(3)); TString8 ncab (tt_vn.get(3));
TString ocon (tt_vo.get(4)); TString ocon (tt_vo.get(4));
TString ncon (tt_vn.get(4)); TString ncon (tt_vn.get(4));
TString descr(tt_ln.get(9)); TString descr(tt_ln.get(9));
@ -1723,22 +1710,22 @@ void Visliq_app::write_general(TMask& m)
real nacct (vn.get(5)); real nacct (vn.get(5));
TDate aodate(vo.get(1)); TDate aodate(vo.get(1));
TDate andate(vn.get(1)); TDate andate(vn.get(1));
TString aoabi (vo.get(2)); TString8 aoabi (vo.get(2));
TString anabi (vn.get(2)); TString8 anabi (vn.get(2));
TString aocab (vo.get(3)); TString8 aocab (vo.get(3));
TString ancab (vn.get(3)); TString8 ancab (vn.get(3));
TString aocon (vo.get(4)); TString aocon (vo.get(4));
TString ancon (vn.get(4)); TString ancon (vn.get(4));
was_lim = look_lim(i); was_lim = look_lim(i);
if (!was_lim) if (!was_lim)
carry = FALSE; // blocca riporto crediti e debiti carry = false; // blocca riporto crediti e debiti
// ricalcola crediti e debiti se non ci sono // ricalcola crediti e debiti se non ci sono
// liquidazioni non calcolate in mezzo // liquidazioni non calcolate in mezzo
if (carry) if (carry)
{ {
bool rt_mod = FALSE, rm_mod = FALSE, vr_mod = FALSE; bool rt_mod = false, rm_mod = false, vr_mod = false;
real risl = _lim->get_real("R0"); real risl = _lim->get_real("R0");
real vers = _lim->get_real("R8"); real vers = _lim->get_real("R8");
@ -1749,7 +1736,7 @@ void Visliq_app::write_general(TMask& m)
// e crea/aggiorna la delega // e crea/aggiorna la delega
if (i == 12) if (i == 12)
{ {
bool ac_mod = FALSE; bool ac_mod = false;
if (oacct != nacct) if (oacct != nacct)
{ {
risc -= oacct; risc -= oacct;
@ -1757,14 +1744,14 @@ void Visliq_app::write_general(TMask& m)
risl += oacct; risl += oacct;
risl -= nacct; risl -= nacct;
_lim->put("R11", nacct); _lim->put("R11", nacct);
ac_mod = TRUE; ac_mod = true;
} }
if (ndate != odate || anabi != aoabi || ancab != aocab || ancon != aocon) if (ndate != odate || anabi != aoabi || ancab != aocab || ancon != aocon)
ac_mod = TRUE; ac_mod = true;
// write delega acconto // write delega acconto
if (ac_mod) if (ac_mod)
{ {
look_del(12,7,TRUE); look_del(12,7,true);
_del->put("R0",nacct); _del->put("R0",nacct);
_del->put("R1",""); _del->put("R1","");
_del->put("S7",anabi); _del->put("S7",anabi);
@ -1778,11 +1765,9 @@ void Visliq_app::write_general(TMask& m)
// ricalcola versamenti se occorre // ricalcola versamenti se occorre
// e crea/aggiorna le deleghe // e crea/aggiorna le deleghe
if (nvers != overs) if (nvers != overs)
{ vr_mod = true;
vr_mod = TRUE;
} if (vr_mod || ndate != odate || nabi != oabi || ncab != ocab || ncon != ocon)
if (vr_mod || ndate != odate || nabi != oabi ||
ncab != ocab || ncon != ocon)
{ {
_lim->put("R8", nvers); _lim->put("R8", nvers);
_lim->put("D0", ndate); _lim->put("D0", ndate);
@ -1790,7 +1775,7 @@ void Visliq_app::write_general(TMask& m)
_lim->put("S5", ncab); _lim->put("S5", ncab);
_lim->put("S6", ncon); _lim->put("S6", ncon);
write_del(); write_del();
vr_mod = TRUE; vr_mod = true;
} }
// se modificate rettifiche // se modificate rettifiche
@ -1859,16 +1844,14 @@ void Visliq_app::write_general(TMask& m)
if (nrimb != orimb && !_from_one) if (nrimb != orimb && !_from_one)
{ {
// check compatibilità // check compatibilità
bool ok = TRUE; bool ok = true;
if (!nrimb.is_zero()) if (!nrimb.is_zero())
{ {
if (risc <= risd) if (risc <= risd)
ok = yesno_box(FR("Il risultato IVA non evidenzia crediti nel mese %d. Si conferma " ok = yesno_box(FR("Il risultato IVA non evidenzia crediti nel mese %d. Si conferma il rimborso?"), i);
" il rimborso?"), i);
if (!_lim->get_bool("B2") && ok) if (!_lim->get_bool("B2") && ok)
ok = yesno_box(FR("Non risulta diritto al rimborso per il mese %d. Si conferma" ok = yesno_box(FR("Non risulta diritto al rimborso per il mese %d. Si conferma il rimborso?"), i);
" il rimborso?"), i);
} }
if (ok) if (ok)
@ -1920,7 +1903,7 @@ void Visliq_app::write_general(TMask& m)
else else
{ {
// salva i valori modificati senza fare controlli // salva i valori modificati senza fare controlli
// e rimetti a lui i suoi debiti mettendo B0 a FALSE // e rimetti a lui i suoi debiti mettendo B0 a false
if (was_lim) if (was_lim)
{ {
if (orett != nrett) if (orett != nrett)
@ -1952,7 +1935,7 @@ void Visliq_app::write_general(TMask& m)
// sh.force_update(row); // sh.force_update(row);
} }
_from_one = FALSE; _from_one = false;
} // for mese liq. (riga sheet) } // for mese liq. (riga sheet)
sh.force_update(); sh.force_update();
@ -1962,10 +1945,10 @@ void Visliq_app::write_general(TMask& m)
set_vers_rows(sv); set_vers_rows(sv);
set_liq_rows(sh); set_liq_rows(sh);
// m.dirty() deve ritornare FALSE // m.dirty() deve ritornare false
m.field(F_CREDPREC).set_dirty(FALSE); m.field(F_CREDPREC).set_dirty(false);
m.field(F_VISLIQ1).set_dirty(_sh_dirty=FALSE); m.field(F_VISLIQ1).set_dirty(_sh_dirty=false);
m.field(F_VISLIQ2).set_dirty(_sv_dirty=FALSE); m.field(F_VISLIQ2).set_dirty(_sv_dirty=false);
} }

View File

@ -9,16 +9,7 @@ PICTURE TOOL_SAVEREC
MESSAGE EXIT,K_SAVE MESSAGE EXIT,K_SAVE
END END
BUTTON DLG_CANCEL 10 2 #include <cancelbar.h>
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -33 -1 ""
MESSAGE EXIT,K_QUIT
END
ENDPAGE ENDPAGE
@ -51,9 +42,9 @@ BEGIN
PROMPT 1 5 "Credito compensabile inizio anno " PROMPT 1 5 "Credito compensabile inizio anno "
END END
SPREADSHEET F_VISLIQ1 78 SPREADSHEET F_VISLIQ1 -2 -1
BEGIN BEGIN
PROMPT 1 7 "Liquidazione" PROMPT 0 7 "Liquidazione"
ITEM "Mese@10" ITEM "Mese@10"
ITEM "Risultato@15" ITEM "Risultato@15"
ITEM "D/C@3" ITEM "D/C@3"
@ -63,7 +54,7 @@ BEGIN
ITEM "Credito\nutilizzato IVA@15" ITEM "Credito\nutilizzato IVA@15"
ITEM "Credito\nutilizzato F24@15" ITEM "Credito\nutilizzato F24@15"
ITEM "Credito IVA\nresiduo@15" ITEM "Credito IVA\nresiduo@15"
ITEM "Descrizione@35" ITEM "Descrizione@50"
END END
ENDPAGE ENDPAGE

View File

@ -60,9 +60,9 @@ BEGIN
ITEM "13|Annuale" ITEM "13|Annuale"
END END
BROWSEFILE F_VISFLQ 78 10 BROWSEFILE F_VISFLQ -3 -1
BEGIN BEGIN
PROMPT 1 4 "" PROMPT 0 4 ""
END END
/* gruppo 1: edit rimborso */ /* gruppo 1: edit rimborso */

View File

@ -1,4 +1,5 @@
#include "cg5500.h" #include "cg5500.h"
#include <utility.h> #include <utility.h>
bool Visliq_app::look_lim(int m) bool Visliq_app::look_lim(int m)

View File

@ -154,7 +154,7 @@ void TInv_cont::main_loop()
TString data (msk->get(F_DATALIM)); TString data (msk->get(F_DATALIM));
if (_scelta == 'S') if (_scelta == 'S')
{ {
app = riconverti_data(data,FALSE); app = riconverti_data(data,false);
str.format("%03d%6s", num, (const char*) app); str.format("%03d%6s", num, (const char*) app);
aggiorna_marker(str,14); aggiorna_marker(str,14);
} }
@ -195,8 +195,8 @@ void TInv_cont::main_loop()
TFilename floppy,percorso; TFilename floppy,percorso;
int num_disk; int num_disk;
bool ok = FALSE; bool ok = false;
bool abbandona = FALSE; bool abbandona = false;
do do
{ {
k = mask->run(); k = mask->run();
@ -256,8 +256,8 @@ void TInv_cont::main_loop()
if (!continua) if (!continua)
return; // Nel caso in cui l'utente decida di annullare l'operazione return; // Nel caso in cui l'utente decida di annullare l'operazione
setta_tabella_studio(*msk,FALSE); //Aggiorna la tabella studio per invio setta_tabella_studio(*msk,false); //Aggiorna la tabella studio per invio
setta_tabella_ditta(*msk," ",FALSE); //Aggiorna la tabella ditta per invio setta_tabella_ditta(*msk," ",false); //Aggiorna la tabella ditta per invio
setta_parametri_record(" "); //Aggiorna parametri contabili ditta setta_parametri_record(" "); //Aggiorna parametri contabili ditta
_tras_file.open(_header); _tras_file.open(_header);
@ -293,8 +293,8 @@ void TInv_cont::main_loop()
TFilename floppy,percorso; TFilename floppy,percorso;
int num_disk; int num_disk;
bool ok = FALSE; bool ok = false;
bool abbandona = FALSE; bool abbandona = false;
do do
{ {
k = mask->run(); k = mask->run();
@ -352,8 +352,8 @@ void TInv_cont::main_loop()
if (!continua) if (!continua)
return; // Nel caso in cui l'utente decida di annullare l'operazione return; // Nel caso in cui l'utente decida di annullare l'operazione
setta_tabella_studio(*msk,FALSE); //Aggiorna la tabella studio per invio setta_tabella_studio(*msk,false); //Aggiorna la tabella studio per invio
setta_tabella_ditta(*msk," ",FALSE); //Aggiorna la tabella ditta per invio setta_tabella_ditta(*msk," ",false); //Aggiorna la tabella ditta per invio
setta_parametri_record(" "); //Aggiorna parametri contabili ditta setta_parametri_record(" "); //Aggiorna parametri contabili ditta
_tras_file.open(_header); _tras_file.open(_header);
@ -374,7 +374,7 @@ void TInv_cont::main_loop()
delete mask; delete mask;
} }
_tras_file.remove_all(FALSE); _tras_file.remove_all(false);
::remove(_marker); ::remove(_marker);
_trasf = ""; _trasf = "";
_trasf = firm2dir(0); _trasf = firm2dir(0);
@ -586,13 +586,13 @@ bool TInv_cont::leggi_header()
{ {
_control_rec = _tras_file.record(); _control_rec = _tras_file.record();
if (!record_controllo()) if (!record_controllo())
return FALSE; return false;
} }
else else
return FALSE; return false;
} }
else else
return FALSE; return false;
return TRUE; return TRUE;
} }
@ -602,7 +602,7 @@ bool TInv_cont::record_controllo() const
/* /*
TString tiporecord = _control_rec.sub(0,2); TString tiporecord = _control_rec.sub(0,2);
if (tiporecord != " 1") if (tiporecord != " 1")
return FALSE; return false;
return TRUE; return TRUE;
*/ */
const TString& tiporecord = _control_rec.sub(0,2); const TString& tiporecord = _control_rec.sub(0,2);
@ -649,19 +649,19 @@ bool TInv_cont::sub_controlli()
if (_ditta == ditta_trasfer) if (_ditta == ditta_trasfer)
{ {
if (!prefix().exist(_ditta)) if (!prefix().exist(_ditta))
return FALSE; return false;
if (!tabella_ditta()) if (!tabella_ditta())
return FALSE; return false;
} }
else else
return FALSE; return false;
if (!controlla_stato_invio()) if (!controlla_stato_invio())
return FALSE; return false;
if (!numero_data()) if (!numero_data())
return FALSE; return false;
return TRUE; return TRUE;
} }
@ -722,7 +722,7 @@ bool TInv_cont::tabella_ditta()
return TRUE; return TRUE;
} }
return FALSE; return false;
} }
bool TInv_cont::controlla_stato_invio() bool TInv_cont::controlla_stato_invio()
@ -733,13 +733,13 @@ bool TInv_cont::controlla_stato_invio()
_std = conf.get("FlStInv"); _std = conf.get("FlStInv");
if (_stato != _std) if (_stato != _std)
return FALSE; return false;
else else
{ {
TString uselab = _tras_file.ult_file(); TString uselab = _tras_file.ult_file();
if (_stato == "D" && uselab != "") if (_stato == "D" && uselab != "")
return FALSE; return false;
} }
return TRUE; return TRUE;
@ -752,7 +752,7 @@ bool TInv_cont::numero_data()
TDate data (str); TDate data (str);
if (_num != num || data != _data) if (_num != num || data != _data)
return FALSE; return false;
return TRUE; return TRUE;
} }
@ -966,7 +966,7 @@ void TInv_cont::crea_record_controllo(TMask& m)
_tras_file.open(_header); _tras_file.open(_header);
else else
{ {
_tras_file.open(_header, true); //Metto il parametro TRUE (che di default e' FALSE), perche' voglio creare un file che non e' ancore esistente _tras_file.open(_header, true); //Metto il parametro TRUE (che di default e' false), perche' voglio creare un file che non e' ancore esistente
buffer.spaces(); buffer.spaces();
buffer.overwrite(" 1",0); //Tipo record buffer.overwrite(" 1",0); //Tipo record
@ -1061,7 +1061,7 @@ bool TInv_cont::invio_tempfile(TMask& m)
_tras_file.write_control_rec(_control_rec,1024); _tras_file.write_control_rec(_control_rec,1024);
_tras_file.close(); _tras_file.close();
setta_tabella_ditta(m,"D",FALSE); setta_tabella_ditta(m,"D",false);
setta_parametri_record("D"); setta_parametri_record("D");
return TRUE; return TRUE;
@ -1142,7 +1142,7 @@ void TInv_cont::causali2tempfile(TString& key, TMask& m)
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
_tras_file.close(); _tras_file.close();
// setta_tabella_ditta(m,"D",FALSE); // setta_tabella_ditta(m,"D",false);
// setta_parametri_record("D"); // setta_parametri_record("D");
} }
@ -1195,7 +1195,7 @@ void TInv_cont::clifo2tempfile(TString& key, TMask& m)
_tras_file.open(_header); _tras_file.open(_header);
long items = _clifo->items(); long items = _clifo->items();
_prog = new TProgind(items,"Invio Clienti / Fornitori in corso... Prego attendere.",FALSE); _prog = new TProgind(items,"Invio Clienti / Fornitori in corso... Prego attendere.",false);
_clifo->setkey(1); _clifo->setkey(1);
@ -1264,7 +1264,7 @@ void TInv_cont::clifo2tempfile(TString& key, TMask& m)
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
_tras_file.close(); _tras_file.close();
// setta_tabella_ditta(m,"D",FALSE); // setta_tabella_ditta(m,"D",false);
// setta_parametri_record(m,"D"); // setta_parametri_record(m,"D");
} }
@ -1276,7 +1276,7 @@ void TInv_cont::pcon2tempfile(TString& key, TMask& m)
_tras_file.open(_header); _tras_file.open(_header);
long items = _pcon->items(); long items = _pcon->items();
_prog = new TProgind(items,"Invio Piano dei Conti in corso... Prego attendere.",FALSE); _prog = new TProgind(items,"Invio Piano dei Conti in corso... Prego attendere.",false);
_pcon->setkey(1); _pcon->setkey(1);
@ -1351,7 +1351,7 @@ void TInv_cont::pcon2tempfile(TString& key, TMask& m)
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
_tras_file.close(); _tras_file.close();
// setta_tabella_ditta(m,"D",FALSE); // setta_tabella_ditta(m,"D",false);
// setta_parametri_record(m,"D"); // setta_parametri_record(m,"D");
} }
@ -1396,7 +1396,7 @@ void TInv_cont::movPN2tempfile(TString& key, TMask& m)
_tras_file.open(_header); _tras_file.open(_header);
long items = _mov->items(); long items = _mov->items();
_prog = new TProgind(items,"Invio movimenti di Primanota in corso... Prego attendere.",FALSE); _prog = new TProgind(items,"Invio movimenti di Primanota in corso... Prego attendere.",false);
_mov->setkey(1); _mov->setkey(1);
@ -1477,7 +1477,7 @@ void TInv_cont::movPN2tempfile(TString& key, TMask& m)
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
_tras_file.close(); _tras_file.close();
// setta_tabella_ditta(m,"D",FALSE); // setta_tabella_ditta(m,"D",false);
// setta_parametri_record(m,"D"); // setta_parametri_record(m,"D");
} }
@ -1522,7 +1522,7 @@ void TInv_cont::movIVA2tempfile(const TString& key, TMask& m)
_tras_file.open(_header); _tras_file.open(_header);
const long items = _rmoviva->items(); const long items = _rmoviva->items();
_prog = new TProgind(items, TR("Invio movimenti Iva"), FALSE); _prog = new TProgind(items, TR("Invio movimenti Iva"), false);
_rmoviva->setkey(1); _rmoviva->setkey(1);
@ -1623,7 +1623,7 @@ void TInv_cont::movIVA2tempfile(const TString& key, TMask& m)
_tras_file.write_control_rec(_control_rec,size); _tras_file.write_control_rec(_control_rec,size);
_tras_file.close(); _tras_file.close();
// setta_tabella_ditta(m,"D",FALSE); // setta_tabella_ditta(m,"D",false);
// setta_parametri_record(m,"D"); // setta_parametri_record(m,"D");
} }
@ -1654,7 +1654,7 @@ void TInv_cont::movSC2tempfile(TString& key, TMask& m)
_tras_file.open(_header); _tras_file.open(_header);
const long items = _part->items(); const long items = _part->items();
_prog = new TProgind(items, TR("Invio movimenti di Saldaconto."), FALSE); _prog = new TProgind(items, TR("Invio movimenti di Saldaconto."), false);
_part->setkey(1); _part->setkey(1);

View File

@ -11,7 +11,6 @@ Item_05 = "Stampa tabelle studio", [CGMENU_006]
Item_06 = "Scelta contabilità", [CGMENU_013] Item_06 = "Scelta contabilità", [CGMENU_013]
Item_07 = "IVA", [CGMENU_010] Item_07 = "IVA", [CGMENU_010]
Item_08 = "Parametri di studio", "cg5 -0", "" Item_08 = "Parametri di studio", "cg5 -0", ""
Item_09 = "Gestione Libro Unico", [CGMENU_014]
Item_10 = "Invio", [CGMENU_019] Item_10 = "Invio", [CGMENU_019]
Item_11 = "Ricezione", [CGMENU_020] Item_11 = "Ricezione", [CGMENU_020]
Item_12 = "Trasferimenti di contabilità", <tcmenu.men> Item_12 = "Trasferimenti di contabilità", <tcmenu.men>
@ -152,18 +151,6 @@ Item_04 = "Gestione versamenti F24", <gvmenu.men>
Item_05 = "Operazioni di inizio fine es.", [CGMENU_021] Item_05 = "Operazioni di inizio fine es.", [CGMENU_021]
Item_06 = "Servizio", [CGMENU_016] Item_06 = "Servizio", [CGMENU_016]
[CGMENU_014]
Caption = "Gestione libro unico"
Picture = <cg01>
Module = 7
Flags = ""
Item_01 = "Gestione libro unico", "ba3 -0 %lbu", ""
Item_02 = "Gestione indici libro unico", "ba3 -8", ""
Item_03 = "Tabella vidimazioni", "ba3 -0 %vid", ""
Item_04 = "Stampa indici libro unico", "ba3 -5", ""
Item_05 = "Stampa indici libro unico per ditta", "ba3 -5 A", ""
Item_06 = "Ripristino indici libro unico", "cg5 -4 inl", "F"
[CGMENU_016] [CGMENU_016]
Caption = "Servizi" Caption = "Servizi"
Picture = <ba04> Picture = <ba04>