Patch level : 10.0 278
Files correlati : cg4.exe cg5.exe cg5300a.uml cg5500b.uml cg5500d.uml cg5500a.rep cg5500b.rep Ricompilazione Demo : [ ] Commento : Modifiche al prospetto della liquidazione iva. Implementare la gestione del credito iva infrannuale e modifiche a quello dell'anno precedente. Aggiunta stampa dei prospetti di liquidazione. Considerato il credito utilizzato a inizio anno come utilizzato e solo se il credito è compensabile in F24 a Gennaio. In realtà era già così git-svn-id: svn://10.65.10.50/branches/R_10_00@23221 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c93f5b89bd
commit
a2de8ed91a
107
cg/cg4300.cpp
107
cg/cg4300.cpp
@ -114,11 +114,13 @@ bool TLiquidazione_app::user_create()
|
||||
#ifdef DBG
|
||||
else if (argv(2)[1] == 'C')
|
||||
{
|
||||
subj = "2012|12|9058|R|12-12-2012|c:/Temp/110|X|60";
|
||||
subj = "2016|9|1|R|01-01-2016|c:/Temp/110|X|60";
|
||||
_is_interactive = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
open_files(LF_TAB, LF_TABCOM, LF_NDITTE, LF_MOV, LF_ATTIV, LF_CLIFO, LF_OCCAS, LF_RMOV, LF_RMOVIVA,
|
||||
LF_COMUNI, LF_ANAG, LF_UNLOC, LF_CAUSALI, LF_RMOVIVA, LF_INDLIB, 0);
|
||||
|
||||
TProgress_monitor pnd(3, TR("Preparazione archivi"), false);
|
||||
|
||||
@ -194,13 +196,11 @@ bool TLiquidazione_app::user_create()
|
||||
_ppa = new TTable("PPA");
|
||||
_plm = new TTable("PLM");
|
||||
_pia = new TTable("PIA");
|
||||
_lim = new TTable("LIM");
|
||||
_lam = new TTable("LAM");
|
||||
_pla = new TTable("%PLA");
|
||||
_reg = new TTable("REG");
|
||||
_iva = new TTable("%IVA");
|
||||
_del = new TTable("%DEL");
|
||||
_lia = new TTable("%LIA");
|
||||
|
||||
_mov = &_cur->file(LF_MOV);
|
||||
_rmoviva = &_cur->file(LF_RMOVIVA);
|
||||
@ -218,7 +218,6 @@ bool TLiquidazione_app::user_create()
|
||||
_pom_r = &(_pom->curr());
|
||||
_iva_r = &(_iva->curr());
|
||||
_del_r = &(_del->curr());
|
||||
_lim_r = &(_lim->curr());
|
||||
_lam_r = &(_lam->curr());
|
||||
_pla_r = &(_pla->curr());
|
||||
_ppa_r = &(_ppa->curr());
|
||||
@ -294,8 +293,6 @@ bool TLiquidazione_app::user_create()
|
||||
_del_mese = new TRecfield(*_del_r,"CODTAB",9,10);
|
||||
_del_tipo = new TRecfield(*_del_r,"CODTAB",11,11);
|
||||
|
||||
_lim_anno = new TRecfield(*_lim_r,"CODTAB",0,3);
|
||||
_lim_mese = new TRecfield(*_lim_r,"CODTAB",4,6);
|
||||
|
||||
_lam_anno = new TRecfield(*_lam_r,"CODTAB",0,3);
|
||||
_lam_mese = new TRecfield(*_lam_r,"CODTAB",4,6);
|
||||
@ -314,13 +311,13 @@ bool TLiquidazione_app::user_create()
|
||||
|
||||
TApplication::set_firm(__firm);
|
||||
set_real_picture(REAL_PICTURE);
|
||||
set_magic_currency(TRUE);
|
||||
set_magic_currency(true);
|
||||
|
||||
if (!_is_interactive)
|
||||
{
|
||||
TTemp_window w(TASK_WIN);
|
||||
if (_recalc_only)
|
||||
_isprint = FALSE;
|
||||
_isprint = false;
|
||||
//else printer().set_export_file(filename, is_header, headerlen);
|
||||
else
|
||||
printer().set_export_file(filename, is_header);
|
||||
@ -330,7 +327,9 @@ bool TLiquidazione_app::user_create()
|
||||
_recalc = nocalc ? never : needed;
|
||||
TApplication::set_firm(ditta);
|
||||
|
||||
if (!look_lia())
|
||||
const TRectype & lia = get_lia();
|
||||
|
||||
if (lia.empty())
|
||||
return false;
|
||||
|
||||
TIva_round ir; // Imposta arrotondamento iva
|
||||
@ -339,7 +338,7 @@ bool TLiquidazione_app::user_create()
|
||||
_nditte->zero();
|
||||
_nditte_r->put("CODDITTA", ditta);
|
||||
_nditte->read();
|
||||
_freqviva = _lia->get("S7");
|
||||
_freqviva = lia.get("S7");
|
||||
|
||||
TRectype& mov = _cur->curr();
|
||||
TRectype from(_cur->curr()); from.zero();
|
||||
@ -359,7 +358,9 @@ bool TLiquidazione_app::user_create()
|
||||
bool need_refresh = false;
|
||||
for (int m = 1; m < _month; m++)
|
||||
{
|
||||
if (is_month_ok_strict(m) && (!look_lim(m) || !_lim->get_bool("B0")))
|
||||
const TRectype & lim = get_lim(m) ;
|
||||
|
||||
if (is_month_ok_strict(m) && !lim.get_bool("B0"))
|
||||
{
|
||||
need_refresh = true;
|
||||
break;
|
||||
@ -399,12 +400,17 @@ bool TLiquidazione_app::user_create()
|
||||
// se ci sono altri mesi dopo l'ultimo calcolato, invalida il
|
||||
// flag 'calcolato' del primo, per causare il ricalcolo dei
|
||||
// successivi (evitando problemi per credito precedente)
|
||||
for (int m = _month+1; m <= 13; m++) if (look_lim(m))
|
||||
{
|
||||
_lim->zero("B0");
|
||||
_lim->rewrite();
|
||||
break;
|
||||
}
|
||||
for (int m = _month+1; m <= 13; m++)
|
||||
{
|
||||
TRectype lim = get_lim(m);
|
||||
|
||||
if (lim.not_empty())
|
||||
{
|
||||
lim.zero("B0");
|
||||
put_lim(lim);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TApplication::set_firm(__firm);
|
||||
@ -467,8 +473,6 @@ bool TLiquidazione_app::user_destroy()
|
||||
delete _pom_codatt;
|
||||
delete _pom_anno;
|
||||
delete _pom_mese;
|
||||
delete _lim_anno;
|
||||
delete _lim_mese;
|
||||
delete _lam_anno;
|
||||
delete _lam_mese;
|
||||
delete _pla_anno;
|
||||
@ -489,7 +493,6 @@ bool TLiquidazione_app::user_destroy()
|
||||
delete _ppa;
|
||||
delete _plm;
|
||||
delete _pia;
|
||||
delete _lim;
|
||||
delete _lam;
|
||||
delete _pla;
|
||||
delete _del;
|
||||
@ -523,9 +526,9 @@ bool TLiquidazione_app::set_print(int)
|
||||
break;
|
||||
/*
|
||||
case 2: // estrazione deleghe
|
||||
_isprint = FALSE;
|
||||
_isprint = false;
|
||||
_selected.reset();
|
||||
_ditte->check(-1, FALSE);
|
||||
_ditte->check(-1, false);
|
||||
build_ditte_sheet(all);
|
||||
while (set_deleghe())
|
||||
{
|
||||
@ -540,10 +543,10 @@ bool TLiquidazione_app::set_print(int)
|
||||
*/
|
||||
case 3: // calcolo acconto
|
||||
{
|
||||
_isprint = TRUE;
|
||||
_isprint = true;
|
||||
_month = 12;
|
||||
_selected.reset();
|
||||
_ditte->check(-1, FALSE);
|
||||
_ditte->check(-1, false);
|
||||
build_ditte_sheet(all);
|
||||
real inf; real ina; // cotale obbrobrio non fu da me cercato, ne' mai condiviso
|
||||
while (set_acconto(inf, ina))
|
||||
@ -561,6 +564,7 @@ bool TLiquidazione_app::set_print(int)
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
long TLiquidazione_app::select_firm_range(long from, long to, wht freq)
|
||||
@ -586,7 +590,7 @@ long TLiquidazione_app::select_firm_range(long from, long to, wht freq)
|
||||
}
|
||||
else
|
||||
{
|
||||
_selected.set(i,FALSE);
|
||||
_selected.set(i,false);
|
||||
_ditte->uncheck(i);
|
||||
}
|
||||
}
|
||||
@ -618,33 +622,26 @@ void TLiquidazione_app::build_nomiditte()
|
||||
|
||||
for (dt.first(); !dt.eof(); dt.next())
|
||||
{
|
||||
// check no archivi
|
||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
||||
if (prefix().exist(dt.get_long("CODDITTA"))) // check no archivi
|
||||
{
|
||||
const TRectype & lia = get_lia(dt.get_long("CODDITTA"));
|
||||
TToken_string d(63);
|
||||
|
||||
if (good)
|
||||
{
|
||||
// check no parametri liquidazione
|
||||
good = look_lia(dt.get_long("CODDITTA"));
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
TToken_string* d = new TToken_string(63);
|
||||
|
||||
// add record
|
||||
d->add(dt.get("CODDITTA"));
|
||||
d->add(dt.get("RAGSOC"));
|
||||
if (good)
|
||||
{
|
||||
d->add(_lia->get("S7"));
|
||||
d->add(_lia->get("B5")); // IVA per cassa
|
||||
}
|
||||
else
|
||||
{
|
||||
d->add("??");
|
||||
d->add("??");
|
||||
}
|
||||
_nomiditte.add(d);
|
||||
// add record
|
||||
d.add(dt.get("CODDITTA"));
|
||||
d.add(dt.get("RAGSOC"));
|
||||
if (lia.not_empty())
|
||||
{
|
||||
d.add(lia.get("S7"));
|
||||
d.add(lia.get("B5")); // IVA per cassa
|
||||
}
|
||||
else
|
||||
{
|
||||
d.add("??");
|
||||
d.add("??");
|
||||
}
|
||||
_nomiditte.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -797,7 +794,7 @@ bool TLiquidazione_app::chk_final_handler(TMask_field& f, KEY key)
|
||||
void TLiquidazione_app::reset_choices(TMask& m)
|
||||
{
|
||||
_selected.reset();
|
||||
_ditte->check(-1, FALSE);
|
||||
_ditte->check(-1, false);
|
||||
if (m.source_file().ends_with("cg4300a.msk"))
|
||||
{
|
||||
const long ditta = get_firm();
|
||||
@ -805,9 +802,11 @@ void TLiquidazione_app::reset_choices(TMask& m)
|
||||
m.set(CG43_FLD_DTO, ditta, 0x2);
|
||||
|
||||
wht freq = all;
|
||||
if (look_lia(ditta, false, m.get_int(CG43_FLD_ANNO)))
|
||||
const TRectype & lia = get_lia(ditta, false, m.get_int(CG43_FLD_ANNO));
|
||||
|
||||
if (lia.not_empty())
|
||||
{
|
||||
freq = _lia->get_char("S7") == 'T' ? trimestre : mnt;
|
||||
freq = lia.get_char("S7") == 'T' ? trimestre : mnt;
|
||||
if (m.get_int(CG43_RDB_VERS) != freq)
|
||||
m.set(CG43_RDB_VERS, freq, 0x3);
|
||||
}
|
||||
|
63
cg/cg4300.h
63
cg/cg4300.h
@ -169,7 +169,7 @@ public:
|
||||
_r20, _r21, _r22, _r23, _r24, _r25, _r26, _r27, _r28, _r29,
|
||||
_r30, _r31, _r32, _r33;
|
||||
TArray _arr;
|
||||
TDate _d0;
|
||||
TDate _d0, _d1;
|
||||
real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva;
|
||||
|
||||
_DescrItem(word f) : _flags(f), _f0(0), _f1(0), _f2(0) { }
|
||||
@ -326,14 +326,12 @@ class TLiquidazione_app : public TPrint_application
|
||||
TTable* _pom;
|
||||
TTable* _plm;
|
||||
TTable* _pia;
|
||||
TTable* _lim;
|
||||
TTable* _lam;
|
||||
TTable* _pla;
|
||||
TTable* _ppa;
|
||||
TTable* _reg;
|
||||
TTable* _iva;
|
||||
TTable* _del;
|
||||
TTable* _lia;
|
||||
|
||||
// a reference rectype per file/table
|
||||
TRectype* _mov_r;
|
||||
@ -354,7 +352,6 @@ class TLiquidazione_app : public TPrint_application
|
||||
TRectype* _plm_r;
|
||||
TRectype* _pia_r;
|
||||
TRectype* _ppa_r;
|
||||
TRectype* _lim_r;
|
||||
TRectype* _lam_r;
|
||||
TRectype* _del_r;
|
||||
TRectype* _att_r;
|
||||
@ -418,8 +415,6 @@ class TLiquidazione_app : public TPrint_application
|
||||
TRecfield* _del_anno;
|
||||
TRecfield* _del_mese;
|
||||
TRecfield* _del_tipo;
|
||||
TRecfield* _lim_anno;
|
||||
TRecfield* _lim_mese;
|
||||
TRecfield* _lam_anno;
|
||||
TRecfield* _lam_mese;
|
||||
|
||||
@ -468,8 +463,8 @@ public:
|
||||
bool recalc_all();
|
||||
|
||||
// ricalcolo progressivi mese
|
||||
bool update_firm (int month, bool recalc = TRUE);
|
||||
bool update_att (int month, const char* codatt, bool recalc = TRUE);
|
||||
bool update_firm (int month, bool recalc = true);
|
||||
bool update_att (int month, const char* codatt, bool recalc = true);
|
||||
void zero_att (int month, const char* codatt);
|
||||
void zero_annual (int month);
|
||||
void recalc_att (int month, const char* codatt);
|
||||
@ -482,8 +477,8 @@ public:
|
||||
// Scorre tutti i PIM della ditta, per completare _iva11_arr prima di chiamare write_IVA11()
|
||||
void iva11_set_arr_phase_2 (const TString& codatt);
|
||||
// Scrive per la ditta/attivita' corrente, i dati relativi al trasferimento IVA11
|
||||
// Se viene passato TRUE come parametro, azzera i campi R1 ed R2.
|
||||
void iva11_write (bool reset_r1r2 = FALSE);
|
||||
// Se viene passato true come parametro, azzera i campi R1 ed R2.
|
||||
void iva11_write (bool reset_r1r2 = false);
|
||||
|
||||
// ricalcolo liquidazioni dai progressivi mensili
|
||||
void write_liq (int month, const char* atts);
|
||||
@ -500,8 +495,8 @@ public:
|
||||
real credito_costo_prec(int month);
|
||||
// ritorna i versamenti effettuati nel mese per
|
||||
// i tipi delega passati (stile tokenstring) sommando
|
||||
// gli interessi se interesse = TRUE
|
||||
real versamenti_IVA(int month, const char* types, bool interesse = FALSE);
|
||||
// gli interessi se interesse = true
|
||||
real versamenti_IVA(int month, const char* types, bool interesse = false);
|
||||
// Ritorna il valore dell'iva da riportare (solitamente 50500)
|
||||
real iva_da_riportare(int month);
|
||||
|
||||
@ -596,31 +591,33 @@ public:
|
||||
void set_liqacc_2000(_DescrItem& d);
|
||||
|
||||
// Utility per stampare nella colonna debito o credito
|
||||
void print_importo(int rw, const char* prompt, real imp, bool red = FALSE);
|
||||
void print_importo(int rw, const char* prompt, real imp, bool red = false);
|
||||
|
||||
// cercapalle in tabelle con opzione di creazione se serve
|
||||
bool look_pim(int m, const char* a, const char* r, const char* cr,
|
||||
const char* i, int tipodet = 0, bool create = FALSE);
|
||||
const char* i, int tipodet = 0, bool create = false);
|
||||
bool look_pis(int m, const char* a, const char* r, const char* cr,
|
||||
const char* i, int tipodet = 0, bool create = FALSE);
|
||||
const char* i, int tipodet = 0, bool create = false);
|
||||
bool look_prm(int m, const char* a, const char* r, const char* cr,
|
||||
const char* i, int tipodet = 0, bool create = FALSE);
|
||||
const char* i, int tipodet = 0, bool create = false);
|
||||
bool look_prp(int m, const char* a, const char* r, const char* cr,
|
||||
const char* i, int tipodet = 0, bool create = FALSE);
|
||||
bool look_pum(int m, const char* a, bool create = FALSE);
|
||||
bool look_pam(int m, const char* a, bool create = FALSE);
|
||||
const char* i, int tipodet = 0, bool create = false);
|
||||
bool look_pum(int m, const char* a, bool create = false);
|
||||
bool look_pam(int m, const char* a, bool create = false);
|
||||
bool look_pem(TTable & pem, int codreg);
|
||||
bool look_pom(int m, const char* a, bool create = FALSE);
|
||||
bool look_plm(int m, const char* a, bool create = FALSE);
|
||||
bool look_pia(int m, const char* a, const char* cod1, const char* cod2, bool create = FALSE);
|
||||
bool look_lim(int m, bool create = FALSE);
|
||||
bool look_lam(int m, bool create = FALSE);
|
||||
bool look_pla(const char* a, bool create = FALSE);
|
||||
bool look_ppa(int m, const char* a, int t, bool create = FALSE);
|
||||
bool look_del(int month, int type, bool create = FALSE);
|
||||
bool look_pom(int m, const char* a, bool create = false);
|
||||
bool look_plm(int m, const char* a, bool create = false);
|
||||
bool look_pia(int m, const char* a, const char* cod1, const char* cod2, bool create = false);
|
||||
const TRectype & get_lim(int month, bool create = false);
|
||||
const int put_lim(const TRectype & lim, bool re = true);
|
||||
bool look_lam(int m, bool create = false);
|
||||
bool look_pla(const char* a, bool create = false);
|
||||
bool look_ppa(int m, const char* a, int t, bool create = false);
|
||||
bool look_del(int month, int type, bool create = false);
|
||||
bool look_iva(const char* cod);
|
||||
bool look_reg(const char* reg);
|
||||
bool look_lia(long ditta = 0l, bool create = FALSE, int anno = 0);
|
||||
const TRectype & get_lia(long ditta = 0l, bool create = false, int anno = 0);
|
||||
const int put_lia(const TRectype & lia, bool re = true);
|
||||
|
||||
int count_activities() const;
|
||||
|
||||
@ -641,7 +638,7 @@ public:
|
||||
// il ricalcolo annuale
|
||||
bool is_month_ok(int x, int mtocalc) const;
|
||||
// is_month_ok_strict controlla che il mese sia OK per la
|
||||
// liquidazione, ma ritorna TRUE per le trimestrali solo
|
||||
// liquidazione, ma ritorna true per le trimestrali solo
|
||||
// se il mese cade ESATTAMENTE su un trimestre
|
||||
bool is_month_ok_strict(int x, int month = -1) const;
|
||||
// questa e' la piu' semplice, per vedere se devo
|
||||
@ -661,7 +658,7 @@ public:
|
||||
bool set_deleghe();
|
||||
bool extract_deleghe();
|
||||
bool extract_delega(int m, TArray& desc);
|
||||
bool video_conferma(const real&, const real&, const real&, bool to_del = FALSE);
|
||||
bool video_conferma(const real&, const real&, const real&, bool to_del = false);
|
||||
*/
|
||||
|
||||
// stampa
|
||||
@ -679,7 +676,11 @@ public:
|
||||
void set_acconto_p(_DescrItem& d);
|
||||
void set_acchead_p(_DescrItem& d);
|
||||
|
||||
real credito_utilizzato(int month, bool iva, bool f24) const;
|
||||
|
||||
const real credito_utilizzato_F24(int month) const;
|
||||
const real credito_utilizzato_IVA(int month) const;
|
||||
const real credito_utilizzato(int month) const { return credito_utilizzato_F24(month) + credito_utilizzato_IVA(month);}
|
||||
const real credito_autorizzato(int month) const;
|
||||
|
||||
// cippiuppiu'
|
||||
TLiquidazione_app(int men);
|
||||
|
397
cg/cg4301.cpp
397
cg/cg4301.cpp
@ -108,11 +108,16 @@ bool TLiquidazione_app::recalc_all()
|
||||
{
|
||||
int m = _month == 13 ? _month : 1;
|
||||
for (; m < _month; m++)
|
||||
if (is_month_ok_strict(m) && (!look_lim(m) || !_lim->get_bool("B0")))
|
||||
{
|
||||
need_refresh = true;
|
||||
break;
|
||||
}
|
||||
if (is_month_ok_strict(m))
|
||||
{
|
||||
const TRectype & lim = get_lim(m);
|
||||
|
||||
if (lim.empty() || !lim.get_bool("B0"))
|
||||
{
|
||||
need_refresh = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (need_refresh && yesno_box(TR("Alcuni mesi precedenti non "
|
||||
"risultano ricalcolati. E' consigliabile il ricalcolo. "
|
||||
@ -129,11 +134,16 @@ bool TLiquidazione_app::recalc_all()
|
||||
// se ci sono altri mesi dopo l'ultimo calcolato, invalida il
|
||||
// flag 'calcolato' del primo, per causare il ricalcolo dei
|
||||
// successivi (evitando problemi per credito precedente)
|
||||
for (m = _month+1; m <= 13; m++) if (look_lim(m))
|
||||
{
|
||||
_lim->zero("B0");
|
||||
_lim->rewrite();
|
||||
break;
|
||||
for (m = _month+1; m <= 13; m++)
|
||||
{
|
||||
TRectype lim = get_lim(m);
|
||||
|
||||
if (lim.not_empty())
|
||||
{
|
||||
lim.zero("B0");
|
||||
put_lim(lim);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_month = save_month;
|
||||
@ -149,10 +159,10 @@ bool TLiquidazione_app::recalc_all()
|
||||
|
||||
bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
{
|
||||
// Se recalc e' TRUE considera la necessita' di ricalcolare e le
|
||||
// opzioni utente. Se FALSE se ne impipa dell'utente e ricalcola
|
||||
// Se recalc e' true considera la necessita' di ricalcolare e le
|
||||
// opzioni utente. Se false se ne impipa dell'utente e ricalcola
|
||||
// se necessario (serve nelle chiamate ricorsive)
|
||||
// Ritorna FALSE soltanto se il ricalcolo era necessario e non e'
|
||||
// Ritorna false soltanto se il ricalcolo era necessario e non e'
|
||||
// stato effettuato per scelta dello stronzo commercialista.
|
||||
|
||||
// Gestione IVA differita, da non confondere con _isdifferita
|
||||
@ -170,18 +180,18 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
}
|
||||
}
|
||||
|
||||
look_lim(liq_month(month), true);
|
||||
_isdiffacc = is_acconto_differito(); // Gestione differimento acconto IVA
|
||||
_isdifferita = _isdiffacc;
|
||||
|
||||
look_lia();
|
||||
_isintr = _freqviva == "T" && !_lia->get_bool("B3"); // was CNF_DITTA->InTrtr
|
||||
_gest4 = _isbenzinaro && _lia->get_bool("B4"); // was CNF_DITTA->Gest74
|
||||
const TRectype & lia = get_lia();
|
||||
|
||||
_isintr = _freqviva == "T" && !lia.get_bool("B3"); // was CNF_DITTA->InTrtr
|
||||
_gest4 = _isbenzinaro && lia.get_bool("B4"); // was CNF_DITTA->Gest74
|
||||
|
||||
const bool has_single_activity = count_activities() == 1;
|
||||
|
||||
// controlla che il periodo corrente non sia l'inizio dell'attivita'
|
||||
// nel caso, differita va a FALSE
|
||||
// nel caso, differita va a false
|
||||
_monthinatt = 1;
|
||||
const TDate inatt = _nditte->curr().get(NDT_DINIZIOATT);
|
||||
if (is_in_liq_period(inatt))
|
||||
@ -193,7 +203,9 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
|
||||
// ricalcolo normale
|
||||
// lim c'e' solo per i trimestri
|
||||
bool ok = _lim->get_bool("B0");
|
||||
const TRectype & lim = get_lim(liq_month(month), true);
|
||||
|
||||
bool ok = lim.get_bool("B0");
|
||||
if (ok && !recalc)
|
||||
return true;
|
||||
if (_recalc_regis)
|
||||
@ -207,8 +219,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
TToken_string cattivs;
|
||||
|
||||
// casini per stampa minchie in coda ai registri
|
||||
bool riepliq = _isregis ? _riepilogo : FALSE;
|
||||
bool stliq = TRUE;
|
||||
bool riepliq = _isregis ? _riepilogo : false;
|
||||
bool stliq = true;
|
||||
|
||||
_nditte->save_status();
|
||||
if (_nditte->is_first_match(LF_ATTIV))
|
||||
@ -221,7 +233,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
quater = _nditte->curr().get_bool("FLIVA11Q");
|
||||
|
||||
// attività mista: ce ne sono in realtà due
|
||||
// viene calcolato nel ciclo su tipoatt (che viene ripetuto solo se diventa TRUE);
|
||||
// viene calcolato nel ciclo su tipoatt (che viene ripetuto solo se diventa true);
|
||||
_mixed = false;
|
||||
|
||||
if (_prind)
|
||||
@ -369,18 +381,21 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
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.
|
||||
look_lim(month, TRUE); // Crea se non esiste
|
||||
_lim->put("B1","X");
|
||||
_lim->rewrite();
|
||||
return TRUE;
|
||||
|
||||
TRectype lim = get_lim(month, true); // Crea se non esiste
|
||||
|
||||
lim.put("B1","X");
|
||||
put_lim(lim);
|
||||
return true;
|
||||
}
|
||||
|
||||
// se quater stampa riepilogo
|
||||
if (quater && month == _month && riepliq)
|
||||
describe_att(month,atts, TRUE, 'Q');
|
||||
describe_att(month,atts, true, 'Q');
|
||||
|
||||
// occorre poterla chiamare altre volte con mesi diversi
|
||||
_nditte->restore_status();
|
||||
@ -415,11 +430,17 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
//describe_liq(_month, atts, _isregis ? NULL : rimb_d);
|
||||
describe_liq(_month, atts, rimb_d);
|
||||
}
|
||||
if (_month == 13 && look_lim(_month)) // scrive i risultati solo in annuale
|
||||
{
|
||||
real r0 = _lim->get_real("R0");
|
||||
iva11_write(rimb_d == NULL || r0.sign() >= 0); // scrive su tab1100 at last.
|
||||
}
|
||||
if (_month == 13) // scrive i risultati solo in annuale
|
||||
{
|
||||
const TRectype & lim = get_lim(_month);
|
||||
|
||||
if (lim.not_empty()) // scrive i risultati solo in annuale
|
||||
{
|
||||
const real r0 = lim.get_real("R0");
|
||||
|
||||
iva11_write(rimb_d == NULL || r0 >= ZERO); // scrive su tab1100 at last.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//in caso di stampa registri e in caso sia
|
||||
@ -441,14 +462,14 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
bool TLiquidazione_app::update_att(int month, const char* codatt, bool recalc)
|
||||
// viene passato un codice attivita' con codatt+tipoatt
|
||||
// vedi update_firm per il burdel dei calc e recalc
|
||||
// occhecasino. Se _comp_acconto e' TRUE, i movimenti considerati
|
||||
// occhecasino. Se _comp_acconto e' true, i movimenti considerati
|
||||
// saranno solo quelli di dicembre per data <= 20/12;
|
||||
// il ricalcolo e' FORZATO da _recalc messo a one
|
||||
{
|
||||
look_plm(month, codatt, true);
|
||||
bool ok = _plm->get_bool("B0");
|
||||
if (_recalc_regis)
|
||||
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)
|
||||
return true;
|
||||
bool calc = _recalc == ever || (_recalc == one && is_month_ok(month,_month));
|
||||
@ -869,7 +890,7 @@ static bool is_autofattura_articolo_17(const TRectype& mov)
|
||||
|
||||
void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
// il codatt passato e' codice att + tipo att ( IN {1|2} )
|
||||
// occhecasino. Se _comp_acconto e' TRUE, i movimenti considerati
|
||||
// occhecasino. Se _comp_acconto e' true, i movimenti considerati
|
||||
// saranno solo quelli di dicembre per data <= 20/12;
|
||||
{
|
||||
const bool has_sc = has_module(SCAUT, CHK_DONGLE) && ini_get_bool(CONFIG_DITTA, "cg", "GesSal");
|
||||
@ -2119,14 +2140,14 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
} // non sosp_imp ne' altre casistiche che escludono la liq.
|
||||
|
||||
/*
|
||||
* se ign == TRUE non bisogna neppure PROGRESSIVARLI
|
||||
* se ign == true non bisogna neppure PROGRESSIVARLI
|
||||
*/
|
||||
const bool sosp_vaf = sosp_imp == vol_affari;
|
||||
const bool sosp_liq = sosp_imp == liquidazione;
|
||||
bool ign = sosp_imp == normale || (fattrit && month != 13) || noninc;
|
||||
|
||||
/*
|
||||
* se liq == FALSE gli importi non contano ai fini
|
||||
* se liq == false gli importi non contano ai fini
|
||||
* del calcolo liquidazione
|
||||
*/
|
||||
bool liq = !(tipodet == 1 || tipodet == 3 || tipodet == 9 || ign || sosp_vaf);
|
||||
@ -2252,7 +2273,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
*/
|
||||
if (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC")
|
||||
{
|
||||
true_corrisp = TRUE;
|
||||
true_corrisp = true;
|
||||
_pim->put("I0",LORDO);
|
||||
// questi sono corrispettivi davvero; comportamento normale
|
||||
if (tipoiva == "VE") // da ventilare
|
||||
@ -2272,7 +2293,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
else if (tipodoc == "FF") // CM500415: prima non c'era questo if
|
||||
{
|
||||
// queste sono fatture fiscali
|
||||
true_corrisp = TRUE;
|
||||
true_corrisp = true;
|
||||
|
||||
real tot = imponibile + imposta;
|
||||
lor += tot;
|
||||
@ -2413,16 +2434,16 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
switch (i)
|
||||
{
|
||||
case 1: // Progressivi Iva mensili da periodo Successivo
|
||||
look_pis(month, codatt, reg, tipocr_s, codiva, tipodet, TRUE);
|
||||
look_pis(month, codatt, reg, tipocr_s, codiva, tipodet, true);
|
||||
break;
|
||||
case 2: // Progressivi Registri iva Mensili
|
||||
look_prm(month, codatt, reg, tipocr_s, codiva, tipodet, TRUE);
|
||||
look_prm(month, codatt, reg, tipocr_s, codiva, tipodet, true);
|
||||
break;
|
||||
case 3: // Progressivi Registri iva Mensili da periodo Precedente
|
||||
look_prp(month, codatt, reg, tipocr_s, codiva, tipodet, TRUE);
|
||||
look_prp(month, codatt, reg, tipocr_s, codiva, tipodet, true);
|
||||
break;
|
||||
default: // Progressivi Iva Mensili normali
|
||||
look_pim(month, codatt, reg, tipocr_s, codiva, tipodet, TRUE);
|
||||
look_pim(month, codatt, reg, tipocr_s, codiva, tipodet, true);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2652,7 +2673,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
prorata += prorata_diff;
|
||||
fdiffinc_iva_acq -= prorata_diff; // Rettifica acquisti_iva differiti incassati
|
||||
}
|
||||
look_plm(month, codatt, TRUE);
|
||||
look_plm(month, codatt, true);
|
||||
|
||||
/*
|
||||
* ACHTUNG: l'iva sulle vendite e' calcolata sommando anche i
|
||||
@ -3505,7 +3526,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
/* Cazzata galattica: già gestito BENE da update_firm, prima di chiamare questa funzione
|
||||
// evita casino se differita ma si sta ricalcolando il primo mese con ricalcolo di piu' mesi
|
||||
const bool wasdifferita = (_isdifferita && month <= _monthinatt && _month > _monthinatt);
|
||||
if (wasdifferita) _isdifferita = FALSE;
|
||||
if (wasdifferita) _isdifferita = false;
|
||||
*/
|
||||
// liq. differita: considera mese precedente (solo per i risultati)
|
||||
int deltam = month;
|
||||
@ -3513,8 +3534,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
month -= (_freqviva == "T" ? 3 : 1);
|
||||
deltam -= month;
|
||||
|
||||
look_lia();
|
||||
const bool new_age_2000 = (_lia->get("S9") == "NV");
|
||||
const TRectype & lia = get_lia();
|
||||
|
||||
const bool credito_compensabile = (lia.get("S9") == "CM");
|
||||
|
||||
real risultato = ZERO;
|
||||
|
||||
@ -3567,19 +3589,19 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
real vol_aff_l = ZERO;
|
||||
real tot_cong = ZERO;
|
||||
|
||||
bool differita = FALSE;
|
||||
bool almeno_una_agricola = FALSE;
|
||||
bool almeno_una_normale = FALSE;
|
||||
bool differita = false;
|
||||
bool almeno_una_agricola = false;
|
||||
bool almeno_una_normale = false;
|
||||
int attc = 0; // counter attivita'
|
||||
|
||||
// nuova liquidazione
|
||||
real credito_utilizzabile_inizio_anno = ZERO;
|
||||
real credito_utilizzato_inizio_anno = ZERO;
|
||||
real credito_utilizzato_iva = ZERO;
|
||||
if (new_age_2000)
|
||||
if (credito_compensabile)
|
||||
{
|
||||
credito_utilizzato_inizio_anno = _lia->get_real("R15");
|
||||
credito_utilizzabile_inizio_anno = _lia->get_real("R0") - credito_utilizzato_inizio_anno;
|
||||
credito_utilizzato_inizio_anno = lia.get_real("R15");
|
||||
credito_utilizzabile_inizio_anno = lia.get_real("R0") - credito_utilizzato_inizio_anno;
|
||||
if (credito_utilizzabile_inizio_anno < ZERO)
|
||||
credito_utilizzabile_inizio_anno = ZERO;
|
||||
}
|
||||
@ -3600,13 +3622,15 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
{
|
||||
// usa i totali del mese di dicembre dell'anno
|
||||
// precedente
|
||||
differita = TRUE;
|
||||
differita = true;
|
||||
const TString4 yr(_year); // Salvo anno corrente
|
||||
_year.format("%d", year_int-1);
|
||||
if (!look_lim(12)) //controlla solamente, il vero posizionamento lo fa dopo
|
||||
const TRectype & lim = get_lim(12);
|
||||
|
||||
if (lim.empty()) //controlla solamente, il vero posizionamento lo fa dopo
|
||||
{
|
||||
_year = yr; // Ripristino anno corrente
|
||||
differita = FALSE;
|
||||
differita = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3617,7 +3641,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
continue;
|
||||
|
||||
look_plm(differita ? 12 : m, att);
|
||||
bool is_lim = look_lim(_isdifferita ? m+deltam : m);
|
||||
TRectype lim = get_lim(_isdifferita ? m+deltam : m);
|
||||
bool is_lim = lim.not_empty();
|
||||
|
||||
// Se trattasi di annuale considera solo PLM/PUM del mese 13
|
||||
if ((month == 13 && m == 13) || month != 13)
|
||||
@ -3740,8 +3765,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
*/
|
||||
if (attc == 0 && is_lim && m < 13 && is_month_ok_strict(m,month))
|
||||
{
|
||||
const real rimborso_richiesto = _lim->get_real("R1");
|
||||
risultato += rimborso_richiesto;
|
||||
const real rimborso_richiesto = lim.get_real("R1");
|
||||
|
||||
risultato += rimborso_richiesto;
|
||||
rimborsi += rimborso_richiesto;
|
||||
res_debt += rimborso_richiesto;
|
||||
}
|
||||
@ -3754,12 +3780,13 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
const bool somma_rettifiche = month < 13 || m < 13; // CM00278
|
||||
if (somma_rettifiche)
|
||||
{
|
||||
const real rett = _lim->get_real("R5");
|
||||
if (!rett.is_zero())
|
||||
const real rett = lim.get_real("R5");
|
||||
|
||||
if (rett.not_zero())
|
||||
{
|
||||
risultato += rett;
|
||||
rettifiche += rett;
|
||||
if (rett.sign() < 0)
|
||||
if (rett < ZERO)
|
||||
res_cred -= rett;
|
||||
else
|
||||
res_debt += rett;
|
||||
@ -3772,20 +3799,23 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
*/
|
||||
if (attc == 0 && is_lim && m < 13 && is_month_ok_strict(m,month))
|
||||
{
|
||||
const real r17 = _lim->get_real("R17");
|
||||
const real r17 = lim.get_real("R17");
|
||||
|
||||
variazioni_imposta += r17;
|
||||
risultato += r17;
|
||||
if (r17.sign() >= 0)
|
||||
if (r17 >= ZERO)
|
||||
res_debt += r17;
|
||||
else
|
||||
res_cred -= r17;
|
||||
|
||||
const real r18 = _lim->get_real("R18");
|
||||
const real r18 = lim.get_real("R18");
|
||||
|
||||
imposta_non_versata += r18;
|
||||
risultato += r18;
|
||||
res_debt += r18;
|
||||
|
||||
const real r19 = _lim->get_real("R19");
|
||||
const real r19 = lim.get_real("R19");
|
||||
|
||||
crediti_speciali += r19;
|
||||
risultato -= r19;
|
||||
res_cred += r19;
|
||||
@ -3841,7 +3871,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
} // end ciclo su attivita'
|
||||
|
||||
real credito_utilizzabile = ZERO;
|
||||
|
||||
const bool utilizza_credito_autorizzato = lia.get_bool("B6");
|
||||
|
||||
if (month < 13) // va bene anche se differita sommando deltam (che e' 0 normalmente)
|
||||
{
|
||||
// toglie credito precedente
|
||||
@ -3852,18 +3883,36 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
debt_precd = debt_prec(month+deltam);
|
||||
risultato += debt_precd;
|
||||
res_debt += debt_precd;
|
||||
|
||||
|
||||
if (new_age_2000 && credito_utilizzabile_inizio_anno > ZERO &&
|
||||
(_freqviva == "M" || is_trim(month+deltam)))
|
||||
if (credito_compensabile && credito_utilizzabile_inizio_anno > ZERO &&
|
||||
(_freqviva == "M" || is_trim(month + deltam)))
|
||||
{
|
||||
real debiti = res_debt; round_imposta(debiti);
|
||||
real crediti = res_cred; round_imposta(crediti);
|
||||
const real risul = debiti - crediti;
|
||||
TRectype lim = get_lim(month+deltam);
|
||||
const real cred_util_F24 = lim.get_real("R16");
|
||||
|
||||
credito_utilizzabile = credito_utilizzabile_inizio_anno;
|
||||
credito_utilizzabile -= credito_utilizzato(month + deltam);
|
||||
if (utilizza_credito_autorizzato)
|
||||
credito_utilizzabile += credito_autorizzato(month + deltam);
|
||||
|
||||
credito_utilizzabile -= cred_util_F24;
|
||||
if (utilizza_credito_autorizzato)
|
||||
{
|
||||
const real cred_aut_F24 = lim.get_real("R20");
|
||||
|
||||
credito_utilizzabile += cred_aut_F24;
|
||||
}
|
||||
|
||||
|
||||
if (credito_utilizzabile < ZERO)
|
||||
credito_utilizzabile = ZERO;
|
||||
if (risul > ZERO)
|
||||
{
|
||||
credito_utilizzabile = credito_utilizzabile_inizio_anno;
|
||||
credito_utilizzabile -= credito_utilizzato(month+deltam, TRUE, TRUE);
|
||||
if (credito_utilizzabile < ZERO) credito_utilizzabile = ZERO;
|
||||
|
||||
credito_utilizzato_iva = min(risul, credito_utilizzabile);
|
||||
res_cred += credito_utilizzato_iva;
|
||||
risultato -= credito_utilizzato_iva;
|
||||
@ -3872,18 +3921,19 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (new_age_2000)
|
||||
if (credito_compensabile)
|
||||
{
|
||||
cred_prec = ZERO;
|
||||
if (credito_utilizzabile_inizio_anno > ZERO)
|
||||
{
|
||||
credito_utilizzato_iva = credito_utilizzato(13, TRUE, FALSE); // CM00285
|
||||
credito_utilizzato_iva = credito_utilizzato_IVA(13); // CM00285
|
||||
res_cred += credito_utilizzato_iva;
|
||||
risultato -= credito_utilizzato_iva;
|
||||
|
||||
// Calcola credito utilizzabile da riportare nell'anno successivo
|
||||
credito_utilizzabile = credito_utilizzabile_inizio_anno;
|
||||
credito_utilizzabile -= credito_utilizzato(13, TRUE, TRUE);
|
||||
credito_utilizzabile -= credito_utilizzato(13);
|
||||
credito_utilizzabile += credito_autorizzato(13);
|
||||
if (credito_utilizzabile < ZERO)
|
||||
credito_utilizzabile = ZERO;
|
||||
}
|
||||
@ -3892,7 +3942,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
{
|
||||
// per l'annuale considera solo il credito a inizio anno
|
||||
cred_prec = credito_prec(_freqviva == "M" ? 1 : 3);
|
||||
cred_trasf = _lia->get_real("R15");
|
||||
cred_trasf = lia.get_real("R15");
|
||||
const real cred_res = cred_prec - cred_trasf;
|
||||
risultato -= cred_res;
|
||||
res_cred += cred_res;
|
||||
@ -3928,9 +3978,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
real es_c1a_am = _pla->get_real("R17");
|
||||
real csamm = _pla->get_real("R4");
|
||||
real ven_rev = _pla->get_real("R18");
|
||||
real prorata = 0.0;
|
||||
real conguaglio = 0.0;
|
||||
real topay = 0.0;
|
||||
real prorata;
|
||||
real conguaglio;
|
||||
real topay;
|
||||
const real ris = vf1 + vf2; // gia' esclusi: NS, B3, cess. amm
|
||||
|
||||
// calcola nuovo prorata dal 1998 per ogni attivita' (miste: 1+2)
|
||||
@ -3971,13 +4021,15 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
look_pla(att, true);
|
||||
_pla->put("R8", prorata);
|
||||
_pla->rewrite();
|
||||
if (look_lia(0l, true))
|
||||
{
|
||||
TRectype lia = get_lia(0l, true);
|
||||
|
||||
if (lia.not_empty())
|
||||
{
|
||||
real cc = cred_cost;
|
||||
round_imposta(cc);
|
||||
_lia->put("R5", cc);
|
||||
_lia->rewrite();
|
||||
}
|
||||
lia.put("R5", cc);
|
||||
put_lia(lia);
|
||||
}
|
||||
_year = yr;
|
||||
|
||||
// Aggiusta DiffIncIVAAcq sul record della 13ma che non poteva ancora sapere il prorata definitivo!
|
||||
@ -3994,12 +4046,13 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
}
|
||||
}
|
||||
|
||||
look_lia();
|
||||
_lia->put("R1", vol_aff_l);
|
||||
_lia->put("R2", vol_aff_1);
|
||||
_lia->put("R3", vol_aff_2);
|
||||
_lia->rewrite();
|
||||
}
|
||||
TRectype lia = get_lia();
|
||||
|
||||
lia.put("R1", vol_aff_l);
|
||||
lia.put("R2", vol_aff_1);
|
||||
lia.put("R3", vol_aff_2);
|
||||
put_lia(lia);
|
||||
}
|
||||
|
||||
// comprende anche il conguaglio prorata
|
||||
risultato += tot_cong;
|
||||
@ -4016,23 +4069,26 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
res_cred += abs(tot_cong);
|
||||
}
|
||||
|
||||
look_lim(month+deltam,TRUE);
|
||||
// azzeriamo tutto (tranne r1, r5, s1, s0, s7)
|
||||
const TString16 codtab = _lim->get("CODTAB");
|
||||
TRectype lim = get_lim(month+deltam, true);
|
||||
const TString16 codtab = lim.get("CODTAB");
|
||||
|
||||
real rimborso = _lim->get("R1");
|
||||
real r5 = _lim->get("R5"); // Rettifiche
|
||||
real credito_utilizzato_f24 = _lim->get("R16");
|
||||
real r17 = _lim->get("R17");
|
||||
real r18 = _lim->get("R18");
|
||||
real r19 = _lim->get("R19");
|
||||
TString s7 = _lim->get("S7");
|
||||
/*
|
||||
// azzeriamo tutto (tranne r1, r5, s1, s0, s7)
|
||||
const real rimborso = _lim->get("R1");
|
||||
const real r5 = _lim->get("R5"); // Rettifiche
|
||||
const real credito_utilizzato_f24 = _lim->get("R16");
|
||||
const real r17 = _lim->get("R17");
|
||||
const real r18 = _lim->get("R18");
|
||||
const real r19 = _lim->get("R19");
|
||||
const real credito_autorizzato_f24 = _lim->get_real("R20");
|
||||
const TDate data_autorizzazione = _lim->get_date("D1");
|
||||
const TString s7 = _lim->get("S7");
|
||||
const TString s0 = _lim->get("S0"); // Descrizioni rettifiche
|
||||
const TString s1 = _lim->get("S1");
|
||||
const TString s2 = _lim->get("S2");
|
||||
const TString s3 = _lim->get("S3");
|
||||
bool wasb0 = _lim->get_bool("B0");
|
||||
bool wasb1 = _lim->get_bool("B1");
|
||||
const bool wasb0 = _lim->get_bool("B0");
|
||||
const bool wasb1 = _lim->get_bool("B1");
|
||||
|
||||
_lim->zero();
|
||||
_lim->put("CODTAB", codtab);
|
||||
@ -4042,13 +4098,15 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
_lim->put("R17", r17);
|
||||
_lim->put("R18", r18);
|
||||
_lim->put("R19", r19);
|
||||
_lim->put("R20", credito_autorizzato_f24);
|
||||
_lim->put("D1", data_autorizzazione);
|
||||
_lim->put("S0", s0);
|
||||
_lim->put("S1", s1);
|
||||
_lim->put("S2", s2);
|
||||
_lim->put("S3", s3);
|
||||
_lim->put("S7", s7);
|
||||
_lim->put("B0", wasb0 ? "X" : "");
|
||||
_lim->put("B1", wasb1 ? "X" : "");
|
||||
_lim->put("B1", wasb1 ? "X" : ""); */
|
||||
|
||||
|
||||
/*
|
||||
@ -4072,20 +4130,21 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
// se no il conguaglio prorata fa casino
|
||||
round_al_centesimo(risultato);
|
||||
|
||||
_lim->put("R0",risultato);
|
||||
_lim->put("R2",cred_cost);
|
||||
_lim->put("R3",deb_mens);
|
||||
_lim->put("R4",perc_r);
|
||||
lim.put("R0", risultato);
|
||||
lim.put("R2", cred_cost);
|
||||
lim.put("R3", deb_mens);
|
||||
lim.put("R4", perc_r);
|
||||
|
||||
if (almeno_una_normale)
|
||||
_lim->put("R6",detrazioni);
|
||||
lim.put("R6", detrazioni);
|
||||
else // per evitare sbagli nei ricalcoli esterni
|
||||
_lim->put("R6","");
|
||||
lim.zero("R6");
|
||||
|
||||
if (month == 13 || differita)
|
||||
{
|
||||
// Arrotonda totali in quanto possono avere un arrotondamento diverso dal mensile
|
||||
TIva_round ir;
|
||||
|
||||
ir.round(rimborsi);
|
||||
ir.round(rettifiche);
|
||||
ir.round(variazioni_imposta);
|
||||
@ -4095,19 +4154,19 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
// scrivi totali rettifiche e rimborsi
|
||||
// nella finale oppure se copiati da
|
||||
// anno precedente
|
||||
_lim->put("R1",rimborsi);
|
||||
_lim->put("R5",rettifiche);
|
||||
lim.put("R1",rimborsi);
|
||||
lim.put("R5",rettifiche);
|
||||
|
||||
_lim->put("R17", variazioni_imposta);
|
||||
_lim->put("R18", imposta_non_versata);
|
||||
_lim->put("R19", crediti_speciali);
|
||||
lim.put("R17", variazioni_imposta);
|
||||
lim.put("R18", imposta_non_versata);
|
||||
lim.put("R19", crediti_speciali);
|
||||
}
|
||||
|
||||
/*
|
||||
* Interessi dovuti solo da trimestrali in periodica,
|
||||
* Era anche non benzinari, smentito da Cinzia (MI0853);
|
||||
* Ora gestito esplicitamente nei parametri ditta, forzato
|
||||
* FALSE per ditte mensili e liq. annuale
|
||||
* false per ditte mensili e liq. annuale
|
||||
* Ulteriormente smentito e rettificato
|
||||
*/
|
||||
bool true_trim = (month == 3 || month == 6 || month == 9);
|
||||
@ -4118,44 +4177,45 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
const real r = risultato - imposta_non_versata; // CM 26-09-2000
|
||||
real ivi = r.sign() > 0 ? (r * interesse / CENTO) : ZERO;
|
||||
round_al_centesimo(ivi);
|
||||
_lim->put("R14", ivi);
|
||||
lim.put("R14", ivi);
|
||||
}
|
||||
|
||||
//questo serve anche per la visualizzazione e per l'estrazione deleghe
|
||||
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|
||||
|| (month == 13 && !(_isbenzinaro && _gest4)) ))
|
||||
_lim->put("R10",interesse_trimestrale(_month));
|
||||
lim.put("R10", interesse_trimestrale(_month));
|
||||
|
||||
_lim->put("R7", tot_cong); // totale conguaglio su tutte le attivita'
|
||||
_lim->put("R8", versamenti);
|
||||
_lim->put("R9", vers_int);
|
||||
_lim->put("R11", acc_dec);
|
||||
_lim->put("R12", res_cred);
|
||||
_lim->put("R13", res_debt);
|
||||
lim.put("R7", tot_cong); // totale conguaglio su tutte le attivita'
|
||||
lim.put("R8", versamenti);
|
||||
lim.put("R9", vers_int);
|
||||
lim.put("R11", acc_dec);
|
||||
lim.put("R12", res_cred);
|
||||
lim.put("R13", res_debt);
|
||||
|
||||
_lim->put("R26", fdiff_imp); // Imponibile IVA diff Fatture di vendita
|
||||
_lim->put("R27", fdiff_iva); // Imposta IVA diff Fatture di vendita
|
||||
_lim->put("R28", fdiffinc_imp); // Imponibile IVA diff Incassi
|
||||
_lim->put("R29", fdiffinc_iva); // Imposta IVA diff Incassi
|
||||
lim.put("R26", fdiff_imp); // Imponibile IVA diff Fatture di vendita
|
||||
lim.put("R27", fdiff_iva); // Imposta IVA diff Fatture di vendita
|
||||
lim.put("R28", fdiffinc_imp); // Imponibile IVA diff Incassi
|
||||
lim.put("R29", fdiffinc_iva); // Imposta IVA diff Incassi
|
||||
|
||||
_lim->put("R30", fdiff_imp_acq); // Imponibile IVA diff Fatture di acquisto
|
||||
_lim->put("R31", fdiff_iva_acq); // Imposta IVA diff Fatture di acquisto
|
||||
_lim->put("R32", fdiffinc_imp_acq); // Imponibile IVA diff Pagamenti
|
||||
_lim->put("R33", fdiffinc_iva_acq); // Imposta IVA diff Pagamenti
|
||||
lim.put("R30", fdiff_imp_acq); // Imponibile IVA diff Fatture di acquisto
|
||||
lim.put("R31", fdiff_iva_acq); // Imposta IVA diff Fatture di acquisto
|
||||
lim.put("R32", fdiffinc_imp_acq); // Imponibile IVA diff Pagamenti
|
||||
lim.put("R33", fdiffinc_iva_acq); // Imposta IVA diff Pagamenti
|
||||
|
||||
look_lam(month+deltam, true);
|
||||
_lam->put("R0", iva_vend);
|
||||
_lam->put("R1", iva_acq);
|
||||
_lam->put("R2", cred_prec);
|
||||
_lam->put("R3", debt_precd);
|
||||
|
||||
if (!_recalc_only && _recalc != never)
|
||||
_lim->put("B0","X");
|
||||
lim.put("B0","X");
|
||||
|
||||
if (_recalc_only)
|
||||
_lim->put("B1", "X");
|
||||
lim.put("B1", "X");
|
||||
|
||||
/* Cazzata galattica: vedi sopra
|
||||
if (wasdifferita) _isdifferita = TRUE;
|
||||
if (wasdifferita) _isdifferita = true;
|
||||
*/
|
||||
|
||||
// AWFUL! se siamo in annuale, occorre arrotondare alle 1000 lire
|
||||
@ -4223,49 +4283,48 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
_lam->put("R3", debt_precd);
|
||||
_lam->put("R4", cred_trasf);
|
||||
|
||||
_lim->put("R0", risultato);
|
||||
_lim->put("R1", rimborsi);
|
||||
_lim->put("R2", cred_cost);
|
||||
_lim->put("R3", deb_mens);
|
||||
_lim->put("R5", rettifiche);
|
||||
_lim->put("R6", detrazioni);
|
||||
_lim->put("R7", tot_cong);
|
||||
_lim->put("R8", versamenti);
|
||||
_lim->put("R9", vers_int);
|
||||
_lim->put("R11", acc_dec);
|
||||
_lim->put("R12", res_cred);
|
||||
_lim->put("R13", res_debt);
|
||||
lim.put("R0", risultato);
|
||||
lim.put("R1", rimborsi);
|
||||
lim.put("R2", cred_cost);
|
||||
lim.put("R3", deb_mens);
|
||||
lim.put("R5", rettifiche);
|
||||
lim.put("R6", detrazioni);
|
||||
lim.put("R7", tot_cong);
|
||||
lim.put("R8", versamenti);
|
||||
lim.put("R9", vers_int);
|
||||
lim.put("R11", acc_dec);
|
||||
lim.put("R12", res_cred);
|
||||
lim.put("R13", res_debt);
|
||||
|
||||
real ivi = _lim->get("R14"); round_imposta(ivi);
|
||||
_lim->put("R14", ivi);
|
||||
_lim->put("R15", credito_utilizzato_iva);
|
||||
real ivi = lim.get("R14"); round_imposta(ivi);
|
||||
lim.put("R14", ivi);
|
||||
lim.put("R15", credito_utilizzato_iva);
|
||||
|
||||
if (month == 13)
|
||||
{
|
||||
// Riporta eventuale credito nella tabella parametri liquidazione dell'anno successivo
|
||||
const real riporto = credito_utilizzabile - risultato;
|
||||
if (riporto >= ZERO) // Risultato a credito
|
||||
{
|
||||
const int anno_prossimo = atoi(_year) + 1;
|
||||
if (look_lia(0l, TRUE, anno_prossimo))
|
||||
{
|
||||
_lia->put("R0", riporto);
|
||||
_lia->rewrite();
|
||||
}
|
||||
}
|
||||
real riporto = credito_utilizzabile - risultato;
|
||||
|
||||
if (riporto < ZERO)
|
||||
riporto = ZERO;
|
||||
|
||||
const int anno_prossimo = atoi(_year) + 1;
|
||||
TRectype lia = get_lia(0l, true, anno_prossimo);
|
||||
|
||||
lia.put("R0", riporto);
|
||||
put_lia(lia);
|
||||
}
|
||||
_lim->put("R26", fdiff_imp);
|
||||
_lim->put("R27", fdiff_iva);
|
||||
_lim->put("R28", fdiffinc_imp);
|
||||
_lim->put("R29", fdiffinc_iva);
|
||||
_lim->put("R30", fdiff_imp_acq);
|
||||
_lim->put("R31", fdiff_iva_acq);
|
||||
_lim->put("R32", fdiffinc_imp_acq);
|
||||
_lim->put("R33", fdiffinc_iva_acq);
|
||||
lim.put("R26", fdiff_imp);
|
||||
lim.put("R27", fdiff_iva);
|
||||
lim.put("R28", fdiffinc_imp);
|
||||
lim.put("R29", fdiffinc_iva);
|
||||
lim.put("R30", fdiff_imp_acq);
|
||||
lim.put("R31", fdiff_iva_acq);
|
||||
lim.put("R32", fdiffinc_imp_acq);
|
||||
lim.put("R33", fdiffinc_iva_acq);
|
||||
// ciapa
|
||||
}
|
||||
|
||||
_lim->rewrite();
|
||||
put_lim(lim);
|
||||
_lam->rewrite();
|
||||
}
|
||||
|
||||
|
2142
cg/cg4302.cpp
2142
cg/cg4302.cpp
File diff suppressed because it is too large
Load Diff
@ -611,9 +611,10 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||
|
||||
if (rimborsami && is_month_ok_strict(month))
|
||||
{
|
||||
look_lim(month);
|
||||
_lim->put("B2", "X");
|
||||
_lim->rewrite();
|
||||
TRectype lim = get_lim(month);
|
||||
|
||||
lim.put("B2", "X");
|
||||
put_lim(lim);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
6884
cg/cg4304.cpp
6884
cg/cg4304.cpp
File diff suppressed because it is too large
Load Diff
612
cg/cg4305.cpp
612
cg/cg4305.cpp
@ -17,410 +17,6 @@
|
||||
#include "cg4300c.h"
|
||||
#include "cg4800b.h"
|
||||
|
||||
/*
|
||||
|
||||
// -------------------------------------------------- estrazione deleghe
|
||||
bool TLiquidazione_app::set_deleghe()
|
||||
{
|
||||
TMask m("cg4300b.msk");
|
||||
m.field(FLD_CGB_YEAR).set_handler(ch_year_handler);
|
||||
|
||||
m.field(FLD_CGB_YEAR).set(_year);
|
||||
m.field(CHK_CGB_PRINT).set(_isprint ? "X" : "");
|
||||
|
||||
int k = 0;
|
||||
long j;
|
||||
_calcall = FALSE;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (k == K_ESC || k == K_QUIT || k == K_ENTER)
|
||||
break;
|
||||
|
||||
k = m.run();
|
||||
|
||||
_isprint = m.get_bool(CHK_CGB_PRINT);
|
||||
|
||||
switch (k)
|
||||
{
|
||||
case DLG_SELECT:
|
||||
|
||||
_ditte->run();
|
||||
for (j = 0l; j < _ditte->items(); j++)
|
||||
if (_ditte->checked(j)) _selected.set(j);
|
||||
break;
|
||||
|
||||
case BUT_CGB_ALL:
|
||||
|
||||
_ditte->check(-1);
|
||||
for (j = 0l; j < _ditte->items(); j++)
|
||||
if (_ditte->checked(j) && !_ditte->row_disabled(j))
|
||||
_selected.set(j);
|
||||
_calcall = TRUE;
|
||||
k = K_ENTER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
_year = m.get(FLD_CGB_YEAR);
|
||||
_month = atoi(m.get(FLD_CGB_MONTH));
|
||||
}
|
||||
|
||||
return k == K_ENTER;
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::extract_deleghe()
|
||||
{
|
||||
TString buf(256); TArray desc;
|
||||
_prind = new TProgind(_calcall ? _n_ditte : _selected.ones(),
|
||||
TR(" Estrazione deleghe \n"
|
||||
" preparazione archivi \n "
|
||||
" \n "),
|
||||
TRUE,TRUE);
|
||||
|
||||
if (_ver->read(atoi(_year),(_month > 12) ? 12 : _month) != NOERR)
|
||||
warning_box(FR("Errore %d in lettura tabella versamenti ed interessi."),_ver->status());
|
||||
for (int l = 0; l < _ditte->items(); l++)
|
||||
{
|
||||
if (_prind->iscancelled())
|
||||
break;
|
||||
|
||||
if (!(_calcall || _selected[l]) || _ditte->row_disabled(l))
|
||||
continue;
|
||||
|
||||
const long ditta = _ditte->row(l).get_long(1);
|
||||
TApplication::set_firm(ditta);
|
||||
TIva_round ir; ir.set_default_iva_mode(atoi(_year), _month > 12, ditta);
|
||||
|
||||
_nditte->curr().zero();
|
||||
_nditte->curr().put("CODDITTA", ditta);
|
||||
_nditte->read();
|
||||
|
||||
// must succeed
|
||||
look_lia();
|
||||
_freqviva = _lia->get("S7");
|
||||
|
||||
buf.format(FR("Estrazione deleghe (%d):\nditta %s\n "),
|
||||
_month, (const char*)_nditte_r->get("RAGSOC"));
|
||||
_prind->set_text(buf);
|
||||
|
||||
if (is_month_ok_strict(_month) || _month == 13)
|
||||
{
|
||||
const bool mens = _freqviva == "M";
|
||||
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74_4");
|
||||
_isriepilogo = _month == 13;
|
||||
_isendliq = _isannual || _isriepilogo;
|
||||
if (mens || _isbenzinaro || _month!=12)
|
||||
extract_delega(_month, desc);
|
||||
}
|
||||
_prind->addstatus(1);
|
||||
}
|
||||
|
||||
TApplication::set_firm(__firm);
|
||||
delete _prind;
|
||||
|
||||
if (_isprint)
|
||||
{
|
||||
_DescrItem* ddeb = NULL;
|
||||
_DescrItem* dcrd = NULL;
|
||||
|
||||
// scorri desc e prepara descritems
|
||||
for (int i = 0; i < desc.items(); i++)
|
||||
{
|
||||
TToken_string& tt = (TToken_string&)desc[i];
|
||||
|
||||
real tp(tt.get(3));
|
||||
if (tp.sign() > 0)
|
||||
{
|
||||
if (ddeb == NULL)
|
||||
{
|
||||
ddeb = new _DescrItem(DELDEB);
|
||||
ddeb->_f0 = _month;
|
||||
}
|
||||
ddeb->_arr.add(tt);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dcrd == NULL)
|
||||
{
|
||||
dcrd = new _DescrItem(DELCRED);
|
||||
dcrd->_f0 = _month;
|
||||
}
|
||||
dcrd->_arr.add(tt);
|
||||
}
|
||||
}
|
||||
if (dcrd != NULL) _descr_arr.add(dcrd);
|
||||
if (ddeb != NULL) _descr_arr.add(ddeb);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
||||
{
|
||||
const bool has_f24 = main_app().has_module(GVAUT);
|
||||
TToken_string* tt = NULL;
|
||||
bool versare = FALSE;
|
||||
bool skip_print = FALSE;
|
||||
|
||||
if (look_lim(month))
|
||||
{
|
||||
real topay = result_liq(month); // TBC non si puo' fa' accussi'!!!!! pena il casino!
|
||||
if (month == 12)
|
||||
{
|
||||
if (topay > _ver->get(I_ANNUALE))
|
||||
versare = TRUE;
|
||||
}
|
||||
else if (topay > _ver->get(I_PERIODICO))
|
||||
versare = TRUE;
|
||||
|
||||
real intr = _lim->get_real("R14");
|
||||
topay += intr; // lo vogliono registrato con interessi
|
||||
real nrnd = topay;
|
||||
round_imposta(topay); // importo totale del versamento arrotondato
|
||||
|
||||
bool wasdel = look_del(month, 1);
|
||||
|
||||
//la stampa deve essere fatta sia se a credito che a debito
|
||||
if (!topay.is_zero())
|
||||
{
|
||||
tt = new TToken_string(80);
|
||||
tt->add(_nditte->curr().get("CODDITTA"));
|
||||
tt->add(_nditte->curr().get("RAGSOC"));
|
||||
tt->add(_freqviva);
|
||||
tt->add(topay.string());
|
||||
tt->add("");
|
||||
}
|
||||
|
||||
if (versare)
|
||||
{
|
||||
look_del(month, 1, TRUE); //ci mette abi, cab o con
|
||||
//che legge dall'anagrafica!!!
|
||||
bool stampato = _del->get_bool("B0");
|
||||
if (stampato) //se esiste e stampato si richiede conferma aggiornamento
|
||||
{
|
||||
if (topay != _del->get_real("R0"))
|
||||
skip_print = !video_conferma(topay, intr, nrnd); // se non conferma o annulla, salta il tabulato
|
||||
else
|
||||
skip_print = true; // Se l'importo e' lo stesso e la delega era gia' stampata, salta il tabulato
|
||||
}
|
||||
else //aggiorna importo versamento
|
||||
{
|
||||
_del->put("R0",topay);
|
||||
_del->put("R1",intr);
|
||||
_del->put("R2",nrnd); // non arrotondato, per calcolo risultato a debito/cr
|
||||
_del->rewrite();
|
||||
}
|
||||
|
||||
if (has_f24)
|
||||
{
|
||||
TLocalisamfile f24(LF_RIGHEF24);
|
||||
TTable trib("%TRB");
|
||||
long progr = 0L;
|
||||
TString descr("IVA annuale");
|
||||
const bool mensile = _freqviva == "M";
|
||||
const int codtrib = mensile ? 6000 + month : 6031 + (month / 3);
|
||||
|
||||
TDate scad(16, (mensile ? month : ((month + 2) / 3) * 3), atoi(_year));
|
||||
const long codditta = _nditte->lfile().get_long("CODDITTA");
|
||||
|
||||
if (month < 13)
|
||||
scad.addmonth(mensile ? 1 : 2);
|
||||
while (scad.wday() > 5)
|
||||
++scad;
|
||||
|
||||
if (month < 13)
|
||||
{
|
||||
if (mensile)
|
||||
descr.format("IVA mese di %s %s", itom(month), (const char *)_year);
|
||||
else
|
||||
descr.format("IVA %s Trimestre %s", itor(month / 3 + 1), (const char *)_year);
|
||||
}
|
||||
trib.put("CODTAB", codtrib);
|
||||
if (trib.read() != NOERR)
|
||||
{
|
||||
int g = 0, c = 0;
|
||||
long s = 0;
|
||||
trib.put("CODTAB", 6001);
|
||||
if (trib.read(_isgteq) == NOERR)
|
||||
{
|
||||
const int cod = trib.get_int("CODTAB");
|
||||
if (cod > 6000 && cod < 6036)
|
||||
{
|
||||
g = trib.get_int("I0");
|
||||
c = trib.get_int("I1");
|
||||
s = trib.get_long("I2");
|
||||
}
|
||||
}
|
||||
trib.zero();
|
||||
trib.put("CODTAB", codtrib);
|
||||
TString d(descr);
|
||||
trib.put("S0", d.rtrim(5));
|
||||
trib.put("S6", "E");
|
||||
trib.put("I0", g);
|
||||
trib.put("I1", c);
|
||||
trib.put("I2", s);
|
||||
trib.write();
|
||||
}
|
||||
f24.setkey(4);
|
||||
f24.put(F24_TIPOINTEST, "D");
|
||||
f24.put(F24_INTEST, codditta);
|
||||
f24.put(F24_ANNO, _year);
|
||||
f24.put(F24_TRIBUTO, codtrib);
|
||||
if (f24.read() == NOERR)
|
||||
{
|
||||
if (f24.get(F24_DATAVERS).blank() || skip_print)
|
||||
{
|
||||
f24.put(F24_IMPORTODEB, topay);
|
||||
f24.put(F24_INTIVATRIM, intr);
|
||||
f24.put(F24_DATASCAD, scad);
|
||||
|
||||
const int err = f24.rewrite();
|
||||
|
||||
if (err != NOERR)
|
||||
error_box(FR("Ditta %ld\n%s\nerrore %d"), codditta, (const char *) descr, err);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
f24.setkey(1);
|
||||
if (f24.last() == NOERR)
|
||||
progr = f24.get_long(F24_PROGR);
|
||||
progr++;
|
||||
f24.zero();
|
||||
f24.put(F24_PROGR, progr);
|
||||
|
||||
|
||||
f24.put(F24_TRIBUTO, codtrib);
|
||||
f24.put(F24_TIPOINTEST, "D");
|
||||
f24.put(F24_INTEST, codditta);
|
||||
f24.put(F24_DESCR, descr);
|
||||
f24.put(F24_DATASCAD, scad);
|
||||
f24.put(F24_ANNO, _year);
|
||||
f24.put(F24_IMPORTODEB, topay);
|
||||
f24.put(F24_INTIVATRIM, intr);
|
||||
|
||||
const int err = f24.write();
|
||||
|
||||
if (err != NOERR)
|
||||
error_box(FR("Ditta %ld\n%s\nerrore %d"), codditta, (const char *) descr, err);
|
||||
}
|
||||
}
|
||||
|
||||
tt->add(_del->get("S7"));
|
||||
tt->add(_del->get("S8"));
|
||||
tt->add(_del->get("S9"));
|
||||
tt->add(_nditte->curr().get("PTEL"));
|
||||
tt->add(_nditte->curr().get("TEL"));
|
||||
TString desc;
|
||||
if (_del->get("S9").not_empty())
|
||||
{
|
||||
const TRectype & ucc = cache().get("%UCC", _del->get("S9"));
|
||||
if (!ucc.empty())
|
||||
desc = ucc.get("S0");
|
||||
}
|
||||
if (_del->get("S7").not_empty())
|
||||
{
|
||||
TString16 cod;
|
||||
cod = _del->get("S7");
|
||||
if (_del->get("S8").not_empty()) cod << _del->get("S8");
|
||||
|
||||
const TRectype & ban = cache().get("%BAN", cod);
|
||||
|
||||
if (!ban.empty())
|
||||
desc = ban.get("S0");
|
||||
}
|
||||
tt->add(desc);
|
||||
}
|
||||
else if (wasdel) //se esiste e no versare
|
||||
{
|
||||
bool stampato = _del->get_bool("B0");
|
||||
TString buf;
|
||||
buf.format(FR("Il versamento relativo alla ditta %ld e' gia' stato stampato. Si desidera eliminare il flag di stampa definitiva?"),_nditte->lfile().get_long("CODDITTA"));
|
||||
if (stampato && yesno_box(buf))
|
||||
{ // Se la delega e' gia' stampata in definitva, chiede se deve eliminare il flag di stampa
|
||||
_del->put("B0",FALSE);
|
||||
_del->rewrite();
|
||||
}
|
||||
// Se non e' stampata invece visualizza la delega presente su file e l'importo a credito che ha calcolato
|
||||
// chiedendo cosa fare: Registra elimina fisicamente la delega dal file, Annulla lo fa proseguire
|
||||
if (!stampato)
|
||||
video_conferma(topay, intr, nrnd, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (tt != NULL && !skip_print) // Se il tabulato deve essere stampato per questa delega...
|
||||
desc.add(tt);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::video_conferma(const real& newimp, const real& intr,
|
||||
const real& narr, bool to_del)
|
||||
{
|
||||
TMask m("cg4800b");
|
||||
|
||||
m.set_caption(to_del ? TR("Conferma eliminazione") : TR("Estrazione versamenti")); // Modifica il titolo...
|
||||
m.field(F_CODDITTA).set(_nditte->lfile().get("CODDITTA"));
|
||||
m.field(F_RAGSOC).set(_nditte->lfile().get("RAGSOC"));
|
||||
m.field(F_DATAVER).set(_del->get_date("D0"));
|
||||
m.field(F_ABI).set(_del->get("S7"));
|
||||
m.field(F_CAB).set(_del->get("S8"));
|
||||
m.field(F_CON).set(_del->get("S9"));
|
||||
m.field(F_IMPVER).set(_del->get("R0"));
|
||||
if (to_del)
|
||||
{
|
||||
real xr = abs(newimp);
|
||||
m.hide(F_NEWIMP);
|
||||
m.show(F_NEWIMPCRED);m.disable(F_NEWIMPCRED);
|
||||
m.field(F_NEWIMPCRED).set(xr.string());
|
||||
}
|
||||
else
|
||||
m.field(F_NEWIMP).set(newimp.string());
|
||||
|
||||
KEY k;
|
||||
for (bool stop = FALSE; !stop;)
|
||||
{
|
||||
k = m.run();
|
||||
|
||||
switch(k)
|
||||
{
|
||||
case K_SAVE:
|
||||
{
|
||||
k = yesnocancel_box(to_del ?
|
||||
TR("Si desidera veramente confermare l'eliminazione?")
|
||||
:
|
||||
TR("Delega gia' stampata. Si desidera ugualmente confermare l'aggiornamento?"));
|
||||
if (k == K_YES)
|
||||
{
|
||||
if (to_del)
|
||||
_del->remove();
|
||||
else
|
||||
{
|
||||
_del->put("B0", false);
|
||||
_del->put("R0",newimp);
|
||||
_del->put("R1",intr);
|
||||
_del->put("R2",narr);
|
||||
_del->rewrite();
|
||||
}
|
||||
}
|
||||
if (k == K_YES || k == K_NO)
|
||||
stop = TRUE;
|
||||
}
|
||||
break;
|
||||
case K_ESC:
|
||||
//case K_QUIT:
|
||||
stop = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return k == K_YES;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// -------------------------------------------- calcolo acconto dicembre
|
||||
bool TLiquidazione_app::set_acconto(real& inf, real& ina)
|
||||
@ -513,10 +109,11 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
|
||||
|
||||
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74_4");
|
||||
|
||||
look_lia();
|
||||
_freqviva = _lia->get("S7");
|
||||
inf = _lia->get_real("R13");
|
||||
ina = _lia->get_real("R14");
|
||||
const TRectype & lia = get_lia();
|
||||
|
||||
_freqviva = lia.get("S7");
|
||||
inf = lia.get_real("R13");
|
||||
ina = lia.get_real("R14");
|
||||
|
||||
buf.format(FR("Calcolo acconto:\nditta %s"),
|
||||
(const char*)_nditte_r->get("RAGSOC"));
|
||||
@ -563,11 +160,13 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
const TString4 thyear = _year;
|
||||
_year.format("%d", atoi(_year)-1);
|
||||
|
||||
if (!look_lia())
|
||||
const TRectype & lia = get_lia();
|
||||
|
||||
if (lia.empty())
|
||||
error = 3;
|
||||
else
|
||||
{
|
||||
char ohh = _lia->get_char("S7");
|
||||
char ohh = lia.get_char("S7");
|
||||
|
||||
if (ohh == 'M') history = thh == 'M' ? mm : mt;
|
||||
if (ohh == 'T') history = thh == 'M' ? tm : tt;
|
||||
@ -587,69 +186,88 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
const TRectype & atts = cache().get(LF_ATTIV, key);
|
||||
|
||||
if (atts.get_bool("ART74_4")) // e' proprio un gran benzinaro
|
||||
history = _lia->get_bool("B4") ? mm : tt; // Was CNF_DITTA->GesT74
|
||||
history = lia.get_bool("B4") ? mm : tt; // Was CNF_DITTA->GesT74
|
||||
|
||||
switch (history)
|
||||
{
|
||||
case mm:
|
||||
{
|
||||
// base calcolo: 12a anno preced, Rideterminare a seconda dell'acconto
|
||||
// versato; ris = 88% del debito (0 se credito)
|
||||
if (!look_lim(12)) error = 2;
|
||||
else
|
||||
{
|
||||
bc += _lim->get_real("R0");
|
||||
real av = _lim->get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
// versato; ris = 88% del debito (0 se credito
|
||||
const TRectype & lim = get_lim(12);
|
||||
|
||||
if (lim.empty())
|
||||
error = 2;
|
||||
else
|
||||
{
|
||||
bc += lim.get_real("R0");
|
||||
const real av = lim.get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case tt:
|
||||
case tm:
|
||||
// base calcolo: 13a anno precedente. Rideterm. per eventuale acconto
|
||||
if (!look_lim(13)) error = 2; // TBC sara' 13a davvero? Secondo me e' 12
|
||||
else
|
||||
{
|
||||
bc += _lim->get_real("R0");
|
||||
real av = _lim->get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
if (history == tm)
|
||||
// tm come tt ma si divide per 3 la base di calcolo prima di calcolare l'88%
|
||||
divide_by_three = 3.0;
|
||||
{
|
||||
// base calcolo: 13a anno precedente. Rideterm. per eventuale acconto
|
||||
const TRectype & lim = get_lim(13); // TBC sara' 13a davvero? Secondo me e' 12
|
||||
|
||||
if (lim.empty())
|
||||
error = 2;
|
||||
else
|
||||
{
|
||||
bc += lim.get_real("R0");
|
||||
const real av = lim.get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
if (history == tm)
|
||||
// tm come tt ma si divide per 3 la base di calcolo prima di calcolare l'88%
|
||||
divide_by_three = 3.0;
|
||||
}
|
||||
break;
|
||||
case mt:
|
||||
{
|
||||
// basecalcolo: 10, 11, 12 anno prec., 10 e 11 se a debito, 12 vedi acconto;
|
||||
// sommare e prendi 88% se a debito
|
||||
if (!look_lim(10)) error = 2;
|
||||
else
|
||||
{
|
||||
real app = _lim->get_real("R0");
|
||||
if (app.sign() > 0) //a debito
|
||||
bc += app;
|
||||
}
|
||||
if (!look_lim(11)) error = 2;
|
||||
else
|
||||
{
|
||||
real app = _lim->get_real("R0");
|
||||
if (app.sign() > 0) //a debito
|
||||
bc += app;
|
||||
}
|
||||
if (!look_lim(12)) error = 2;
|
||||
else
|
||||
{
|
||||
bc += _lim->get_real("R0");
|
||||
real av = _lim->get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
const TRectype & lim10 = get_lim(10);
|
||||
const TRectype & lim11 = get_lim(11);
|
||||
const TRectype & lim12 = get_lim(12);
|
||||
|
||||
if (lim10.empty())
|
||||
error = 2;
|
||||
else
|
||||
{
|
||||
const real app = lim10.get_real("R0");
|
||||
|
||||
if (app > ZERO) //a debito
|
||||
bc += app;
|
||||
}
|
||||
if (lim11.empty())
|
||||
error = 2;
|
||||
else
|
||||
{
|
||||
const real app = lim11.get_real("R0");
|
||||
if (app > ZERO) //a debito
|
||||
bc += app;
|
||||
}
|
||||
if (lim12.empty())
|
||||
error = 2;
|
||||
else
|
||||
{
|
||||
bc += lim12.get_real("R0");
|
||||
const real av = lim12.get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
round_imposta(bc);
|
||||
if (bc.sign() > 0) //debito
|
||||
if (bc > ZERO) //debito
|
||||
{
|
||||
acc = ((bc / divide_by_three) * _ver->get(isdifferita ? B_LIQ_DIFF : B_LIQ_NORM))/CENTO;
|
||||
acc = ((bc / divide_by_three) * _ver->get(isdifferita ? B_LIQ_DIFF : B_LIQ_NORM)) / CENTO;
|
||||
acc.round(TCurrency::get_firm_dec());
|
||||
}
|
||||
|
||||
tipo_acc = "S";
|
||||
}
|
||||
_year = thyear;
|
||||
@ -663,11 +281,16 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
_recalc = one;
|
||||
int need_refresh = FALSE;
|
||||
for (int mese = 1; mese < _month; mese++)
|
||||
if (is_month_ok_strict(mese) && (!look_lim(mese) || !_lim->get_bool("B0")))
|
||||
{
|
||||
need_refresh = TRUE;
|
||||
break;
|
||||
}
|
||||
if (is_month_ok_strict(mese))
|
||||
{
|
||||
const TRectype & lim = get_lim(mese);
|
||||
|
||||
if (lim.empty() || !lim.get_bool("B0"))
|
||||
{
|
||||
need_refresh = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (need_refresh && yesno_box(FR("Alcuni mesi precedenti non risultano ricalcolati:\n"
|
||||
"è consigliabile il ricalcolo. Si desidera eseguirlo?")))
|
||||
_recalc = ever;
|
||||
@ -681,28 +304,34 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
}
|
||||
|
||||
// calcola l'acconto
|
||||
if (look_lim(12)) //posiziona anche la tabella lam
|
||||
TRectype lim = get_lim(12);
|
||||
|
||||
if (lim.not_empty())
|
||||
{
|
||||
cre = _lim->get_real("R12");
|
||||
cre -= _lim->get_real("R19");
|
||||
cre = lim.get_real("R12");
|
||||
cre -= lim.get_real("R19");
|
||||
|
||||
deb = _lim->get_real("R13") + inf + ina;
|
||||
deb -= _lim->get_real("R18") + _lim->get_real("R1"); // CM600446
|
||||
deb = lim.get_real("R13") + inf + ina;
|
||||
deb -= lim.get_real("R18"); // CM600446
|
||||
deb -= lim.get_real("R1"); // CM600446
|
||||
|
||||
if (_lim->get_real("R17") > ZERO)
|
||||
deb -= _lim->get_real("R17");
|
||||
if (lim.get_real("R17") > ZERO)
|
||||
deb -= lim.get_real("R17");
|
||||
else
|
||||
cre += _lim->get_real("R17");
|
||||
cre += lim.get_real("R17");
|
||||
|
||||
bc = deb - cre;
|
||||
if (bc.sign() > 0) acc = bc;
|
||||
if (bc > ZERO)
|
||||
acc = bc;
|
||||
|
||||
look_lam(12); //posiziona anche la tabella lam
|
||||
|
||||
iva_ven = _lam->get_real("R0"); //iva sulle vendite annotate fino al 20/12
|
||||
iva_acq = _lam->get_real("R1"); //iva sugli acquisti annotati fino al 20/12
|
||||
cre_pre = _lam->get_real("R2"); //credito precedente
|
||||
iva_ret = _lim->get_real("R5"); //rettifica
|
||||
iva_rim = _lim->get_real("R1"); //iva chiesta a rimborso
|
||||
ult_det = _lim->get_real("R6"); //ulteriori detrazioni
|
||||
iva_ret = lim.get_real("R5"); //rettifica
|
||||
iva_rim = lim.get_real("R1"); //iva chiesta a rimborso
|
||||
ult_det = lim.get_real("R6"); //ulteriori detrazioni
|
||||
//iva_pro: //iva relativa alla percentuale di prorata
|
||||
TTable plm ("PLM");
|
||||
plm.zero();
|
||||
@ -736,40 +365,43 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
for (int i = 1; i <= _month; i++)
|
||||
if (is_month_plain(i))
|
||||
update_firm(i);
|
||||
|
||||
_lim->put("B0","");
|
||||
_lim->rewrite();
|
||||
if (look_lim(13))
|
||||
lim.put("B0","");
|
||||
put_lim(lim);
|
||||
|
||||
lim = get_lim(13);
|
||||
if (lim.not_empty())
|
||||
{
|
||||
_lim->put("B0","");
|
||||
_lim->rewrite();
|
||||
lim.put("B0","");
|
||||
put_lim(lim);
|
||||
}
|
||||
//fine
|
||||
_isprint = TRUE;
|
||||
_isprint = true;
|
||||
}
|
||||
|
||||
// sbatti l'acconto (e non solo!) in LIA
|
||||
if (look_lia())
|
||||
TRectype lia = get_lia();
|
||||
|
||||
if (lia.not_empty())
|
||||
{
|
||||
if (isdifferita && _basecalc == incorso)
|
||||
{
|
||||
acc *= real(2.0);
|
||||
acc /= real(3.0);
|
||||
}
|
||||
_lia->put("R4",acc);
|
||||
_lia->put("R7",iva_ven);
|
||||
_lia->put("R8",iva_acq);
|
||||
_lia->put("R9",iva_ret);
|
||||
_lia->put("R10",iva_rim);
|
||||
_lia->put("R11",ult_det);
|
||||
_lia->put("R12",iva_pro);
|
||||
lia.put("R4",acc);
|
||||
lia.put("R7",iva_ven);
|
||||
lia.put("R8",iva_acq);
|
||||
lia.put("R9",iva_ret);
|
||||
lia.put("R10",iva_rim);
|
||||
lia.put("R11",ult_det);
|
||||
lia.put("R12",iva_pro);
|
||||
TToken_string rr("",'!');
|
||||
rr.add(cre_pre.string(),0);
|
||||
rr.add(acq_intr.string(),1);
|
||||
_lia->put("S1",rr);
|
||||
_lia->put("S8",tipo_acc);
|
||||
_lia->rewrite();
|
||||
}
|
||||
lia.put("S1",rr);
|
||||
lia.put("S8",tipo_acc);
|
||||
put_lia(lia);
|
||||
}
|
||||
|
||||
|
||||
// per questa volta lasciamo perdere la describe_acconto
|
||||
|
@ -30,7 +30,6 @@ protected: // Applicat
|
||||
static bool agrmin_handler(TMask_field& f, KEY k);
|
||||
static bool credres_handler(TMask_field& f, KEY k);
|
||||
static bool credpreccost_handler(TMask_field& f, KEY k);
|
||||
static bool utcred_handler(TMask_field& f, KEY k);
|
||||
|
||||
protected: // Relapp
|
||||
virtual bool user_create();
|
||||
@ -132,18 +131,6 @@ bool TParaliq_app::credres_handler(TMask_field& f, KEY k)
|
||||
r.round(euro ? m.get_int(F_ROUNDDIC) : -3);
|
||||
f.set(r.string());
|
||||
}
|
||||
|
||||
if (k == K_ENTER) // In uscita dalla maschera
|
||||
{
|
||||
const TMask& m = f.mask();
|
||||
const short id = f.dlg();
|
||||
const real r = m.get_real(F_CRED_RES);
|
||||
const int i = m.get_int(F_MESE_RES_AL);
|
||||
if (id == F_MESE_RES_AL && r != 0.0 && i == 0)
|
||||
return f.error_box(TR("Impostare anche il mese."));
|
||||
if (id == F_CRED_RES && i != 0 && r == 0.0)
|
||||
return f.error_box(TR("Impostare anche il credito residuo."));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -161,46 +148,6 @@ bool TParaliq_app::credpreccost_handler(TMask_field& f, KEY k)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TParaliq_app::utcred_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TMask & m = f.mask();
|
||||
if ((k == K_TAB && f.focusdirty()) || !m.is_running())
|
||||
{
|
||||
const int anno_liq = m.get_int(F_YEAR);
|
||||
TString80 cod_mesi;
|
||||
TString des_mesi(128);
|
||||
TString8 mese;
|
||||
TList_field& mese_res = m.lfield(F_MESE_RES_AL);
|
||||
|
||||
if (anno_liq >= 2000 && !f.get().not_empty())
|
||||
{
|
||||
m.field(F_CRED_PREC).set_prompt(TR("Credito compensabile inizio anno "));
|
||||
m.field(F_CRED_RES).set_prompt(TR("Credito in compensaz.utilizzato "));
|
||||
m.enable(F_UTCR_IVA);
|
||||
cod_mesi = "0|-1";
|
||||
des_mesi = FR(" |Inizio Anno");
|
||||
mese = !m.field(F_CRED_RES).empty() ? "-1" : "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
m.field(F_CRED_PREC).set_prompt(TR("Credito precedente "));
|
||||
m.field(F_CRED_RES).set_prompt(TR("Credito residuo "));
|
||||
cod_mesi = "0|1|2|3|4|5|6|7|8|9|10|11|12";
|
||||
des_mesi = FR(" |Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre");
|
||||
mese = app().rel().lfile().get("I0");
|
||||
if (!m.edit_mode() || atoi(mese) < 0)
|
||||
mese.cut(0);
|
||||
}
|
||||
const TString16 oldmese = m.get(F_MESE_RES_AL);
|
||||
mese_res.replace_items(cod_mesi, des_mesi);
|
||||
if (m.is_running())
|
||||
m.set(F_MESE_RES_AL, mese);
|
||||
else
|
||||
m.set(F_MESE_RES_AL, oldmese);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TParaliq_app::check_registers(int year)
|
||||
{
|
||||
// controlla che per ogni data attività esistano almeno un registro
|
||||
@ -298,7 +245,6 @@ bool TParaliq_app::user_create()
|
||||
_msk->set_handler(F_CRED_PREC,credpreccost_handler);
|
||||
_msk->set_handler(F_CRED_COST,credpreccost_handler);
|
||||
_msk->set_handler(F_CODDITTA,ditta_handler);
|
||||
_msk->set_handler(F_UTCR_IVA,utcred_handler);
|
||||
_msk->sfield(F_SHEET_PLA).set_notify(sheet_action);
|
||||
|
||||
return true;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#define F_GESIC 216
|
||||
#define F_ICDAL 217
|
||||
#define F_ICAL 218
|
||||
#define F_UTILAUT 219
|
||||
|
||||
#define F_ROUNDLIQ 221
|
||||
#define F_ROUNDDIC 222
|
||||
|
@ -107,8 +107,8 @@ BOOLEAN F_GESIC
|
||||
BEGIN
|
||||
PROMPT 4 7 "Gestione IVA per cassa"
|
||||
FIELD B5
|
||||
MESSAGE false DISABLE,F_ICDAL|DISABLE,F_ICAL
|
||||
MESSAGE true ENABLE,F_ICDAL|ENABLE,F_ICAL
|
||||
MESSAGE FALSE DISABLE,F_ICDAL|DISABLE,F_ICAL
|
||||
MESSAGE TRUE ENABLE,F_ICDAL|ENABLE,F_ICAL
|
||||
MODULE IC
|
||||
END
|
||||
|
||||
@ -128,6 +128,12 @@ BEGIN
|
||||
MODULE IC
|
||||
END
|
||||
|
||||
BOOLEAN F_UTILAUT
|
||||
BEGIN
|
||||
PROMPT 4 8 "Riutilizza il credito autorizzato in IVA"
|
||||
FIELD B6
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 10 "@bCredito"
|
||||
@ -136,7 +142,7 @@ END
|
||||
|
||||
CURRENCY F_CRED_COST 18
|
||||
BEGIN
|
||||
PROMPT 4 11 "Credito di costo "
|
||||
PROMPT 4 11 "Credito di costo "
|
||||
HELP "Eventuale credito di costo dell'anno precedente"
|
||||
FIELD R5
|
||||
DRIVENBY F_CODVAL
|
||||
@ -144,15 +150,18 @@ END
|
||||
|
||||
LISTBOX F_UTCR_IVA 2 34
|
||||
BEGIN
|
||||
PROMPT 4 12 "Utilizzo credito IVA "
|
||||
ITEM " |Visibile e utilizzato solo in IVA"
|
||||
ITEM "NV|Non visibile ma compensabile"
|
||||
PROMPT 4 12 "Utilizzo credito IVA "
|
||||
ITEM " |Utilizzato solo in IVA"
|
||||
MESSAGE CLEAR,F_CRED_RES
|
||||
ITEM "CM|Compensabile con altre imposte"
|
||||
MESSAGE ENABLE,F_CRED_RES
|
||||
|
||||
FIELD S9
|
||||
END
|
||||
|
||||
CURRENCY F_CRED_PREC 18
|
||||
BEGIN
|
||||
PROMPT 4 13 "Credito compensabile inizio anno "
|
||||
PROMPT 4 13 "Credito IVA inizio anno "
|
||||
HELP "Eventuale credito di imposta dell'anno precedente"
|
||||
FIELD R0
|
||||
DRIVENBY F_CODVAL
|
||||
@ -160,20 +169,13 @@ END
|
||||
|
||||
CURRENCY F_CRED_RES 18
|
||||
BEGIN
|
||||
PROMPT 4 14 "Credito in compensaz.utilizzato "
|
||||
PROMPT 4 14 "Credito IVA utilizzato a Gennaio "
|
||||
FIELD R15
|
||||
DRIVENBY F_CODVAL
|
||||
NUM_EXPR #THIS<=#F_CRED_PREC
|
||||
WARNING "L'importo non puo' essere maggiore del Credito Precedente"
|
||||
END
|
||||
|
||||
LISTBOX F_MESE_RES_AL 2 14
|
||||
BEGIN
|
||||
PROMPT 57 14 "A "
|
||||
ITEM "0|"
|
||||
FIELD I0
|
||||
END
|
||||
|
||||
SPREADSHEET F_SHEET_PLA 78
|
||||
BEGIN
|
||||
PROMPT 1 16 "Parametri attività"
|
||||
|
647
cg/cg5500.cpp
647
cg/cg5500.cpp
@ -1,10 +1,13 @@
|
||||
#include <browfile.h>
|
||||
#include <colors.h>
|
||||
#include <defmask.h>
|
||||
#include <execp.h>
|
||||
#include <msksheet.h>
|
||||
#include <mailbox.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <recarray.h>
|
||||
#include <reprint.h>
|
||||
#include <sheet.h>
|
||||
#include <viswin.h>
|
||||
|
||||
@ -115,7 +118,6 @@ bool Visliq_app::ch_year_handler(TMask_field& f, KEY key)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Visliq_app::build_ditte_sheet()
|
||||
{
|
||||
// build sheet
|
||||
@ -249,6 +251,10 @@ const char* Visliq_app::link_handler(TMask& m,
|
||||
{ group = -7; firstfoc = F_IMPNONVER; }
|
||||
if (st.find(TR("Crediti")) >= 0)
|
||||
{ group = -8; firstfoc = F_CREDSPEC; }
|
||||
if (st.find(TR("Credito IVA compensabile detratto in F24")) >= 0)
|
||||
{ group = -9; firstfoc = F_CREDUTIL; }
|
||||
if (st.find(TR("Credito IVA autorizzato in F24")) >= 0)
|
||||
{ group = -10; firstfoc = F_CREDAUT; }
|
||||
|
||||
m.show(group);
|
||||
if (app()._is_annual && (group != -3 || app()._freqviva == "M"))
|
||||
@ -343,6 +349,34 @@ bool Visliq_app::set_ragsoc(TMask_field& f, KEY k)
|
||||
return found;
|
||||
}
|
||||
|
||||
void Visliq_app::print()
|
||||
{
|
||||
TReport_book book("Stampa prospetti liquidazione");
|
||||
TProgram_report rep;
|
||||
|
||||
rep.load("cg5500a");
|
||||
|
||||
TRecordset* r = rep.recordset();
|
||||
TString key ; key.format("%05ld%04d", get_firm(), year());
|
||||
TString key1; key1 << "\"" << key << "\"";
|
||||
|
||||
r->set_var("#FILTER", key1, true);
|
||||
r->set_var("#ANNO", TVariant((long)year()), true);
|
||||
book.add(rep);
|
||||
rep.load("cg5500b");
|
||||
r = rep.recordset();
|
||||
r->set_var("#FILTER", key, true);
|
||||
r->set_var("#ANNO", TVariant((long)year()), true);
|
||||
book.add(rep);
|
||||
book.print_or_preview();
|
||||
}
|
||||
|
||||
bool Visliq_app::print_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
app().print();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
|
||||
{
|
||||
@ -372,13 +406,14 @@ bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
|
||||
else
|
||||
ok = true;
|
||||
|
||||
|
||||
TMask& sm = sh.sheet_mask();
|
||||
if (ok)
|
||||
{
|
||||
if (sm.is_running()) sm.stop_run(K_ENTER);
|
||||
app().vis_one(month);
|
||||
const bool non_vis_ma_comp = app()._lia->get("S9") == "NV";
|
||||
if (non_vis_ma_comp)
|
||||
const bool compensabile = app()._lia->get("S9") == "CM";
|
||||
if (compensabile)
|
||||
app().read_general(m);
|
||||
}
|
||||
|
||||
@ -412,6 +447,33 @@ bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Visliq_app::enable_date(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_TAB && (f.focusdirty()|| !f.mask().is_running()))
|
||||
{
|
||||
const bool enable = f.mask().get(104).full() || f.mask().get(109).full();
|
||||
|
||||
f.mask().enable(110, enable);
|
||||
if (!enable)
|
||||
f.mask().set(110, "");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Visliq_app::check_date(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_TAB && (f.focusdirty()|| !f.mask().is_running()))
|
||||
{
|
||||
const TDate d(f.get());
|
||||
const int row = f.mask().get_sheet()->selected();
|
||||
|
||||
if (d.year() != app().year())
|
||||
return f.error_box(FR("L'anno deve essere %d"), app().year());
|
||||
if (d.month() != row + 1)
|
||||
return f.error_box(FR("Il mese deve essere %s"), itom(row + 1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
|
||||
{
|
||||
@ -445,14 +507,14 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
|
||||
{
|
||||
if (sv.is_running()) sv.stop_run(K_ENTER);
|
||||
app().vis_one(month);
|
||||
const bool new_age_2000 = (app()._year >= 2000) && (app()._lia->get("S9") == "NV");
|
||||
if (new_age_2000)
|
||||
const bool compensabile = app()._lia->get("S9") == "CM";
|
||||
if ((app()._year >= 2000) && compensabile)
|
||||
app().read_general(m);
|
||||
}
|
||||
|
||||
app().set_vers_rows(sh);
|
||||
|
||||
if (app().look_del(month, /* sel == (sh.items() - 1) ? 7 : */ 1))
|
||||
if (app().look_del(month, 1))
|
||||
{
|
||||
TToken_string& tv = sh.row(sel);
|
||||
tv.add(app().del()->get("D0"),1);
|
||||
@ -528,24 +590,33 @@ bool Visliq_app::vis_all()
|
||||
// qui occorre modificare le deleghe
|
||||
sv.set_notify(vers_action);
|
||||
|
||||
sh.sheet_mask().set_handler(100,sel_mese_sh1);
|
||||
sv.sheet_mask().set_handler(100,sel_mese_sh2);
|
||||
_mask->set_handler(DLG_PRINT, print_handler);
|
||||
sh.sheet_mask().set_handler(100, sel_mese_sh1);
|
||||
sh.sheet_mask().set_handler(104, enable_date);
|
||||
sh.sheet_mask().set_handler(109, enable_date);
|
||||
sh.sheet_mask().set_handler(110, check_date);
|
||||
|
||||
sv.sheet_mask().set_handler(100, sel_mese_sh2);
|
||||
|
||||
const bool new_print_2000 = true; // _year >= 2000;
|
||||
const bool new_age_2000 = _lia->get("S9") == "NV";
|
||||
const bool compensabile = _lia->get("S9") == "CM";
|
||||
TMask& shm = sh.sheet_mask();
|
||||
|
||||
for (int id = 103; shm.id2pos(id) > 0; id++)
|
||||
{
|
||||
TMask_field& f = shm.field(id);
|
||||
if ((f.in_group(11) && new_print_2000) || (f.in_group(12) && !new_print_2000))
|
||||
if (compensabile)
|
||||
for (int id = 103; shm.id2pos(id) > 0; id++)
|
||||
{
|
||||
/*
|
||||
TMask_field& f = shm.field(id);
|
||||
|
||||
if ((f.in_group(11) && true) || (f.in_group(12) && !true))
|
||||
{
|
||||
f.hide();
|
||||
sh.delete_column(id);
|
||||
}
|
||||
if (id == 108 || id == 110)
|
||||
sh.enable_column(id, new_age_2000);
|
||||
}
|
||||
}
|
||||
*/
|
||||
if ((id >= 107 && id <= 110) || id == 112)
|
||||
sh.enable_column(id, true);
|
||||
}
|
||||
|
||||
// fill the mask in
|
||||
read_general(*_mask);
|
||||
@ -643,47 +714,44 @@ bool Visliq_app::vis_one(int m)
|
||||
if (_lim->get_bool("B2"))
|
||||
nomem << TR(" (diritto al rimborso infraannuale)");
|
||||
|
||||
real acconto(0.0);
|
||||
real acconto;
|
||||
|
||||
if (m == 12 && look_del(12,7))
|
||||
acconto = _del->get_real("R0"); else
|
||||
if (m == 13)
|
||||
acconto = _lim->get_real("R11");
|
||||
acconto = _del->get_real("R0");
|
||||
else
|
||||
if (m == 13)
|
||||
acconto = _lim->get_real("R11");
|
||||
|
||||
|
||||
msk.field(F_YEAR).set(nomem);
|
||||
msk.set(F_YEAR, nomem);
|
||||
msk.set(F_RIMBORSO, rimborso);
|
||||
|
||||
// Ottima procedura di 16 righe, di cui 14 inutili!
|
||||
if (rettifica.sign() < 0)
|
||||
{
|
||||
real rabs = abs(rettifica);
|
||||
msk.field(F_RETTIFICA).set(rabs.string());
|
||||
msk.field(F_DEBCRE).set("C");
|
||||
}
|
||||
else if (rettifica.sign() > 0)
|
||||
{
|
||||
msk.field(F_RETTIFICA).set(rettifica.string());
|
||||
msk.field(F_DEBCRE).set("D");
|
||||
}
|
||||
else
|
||||
{
|
||||
msk.field(F_RETTIFICA).set("");
|
||||
msk.field(F_DEBCRE).set("");
|
||||
}
|
||||
if (!rettifica.is_zero())
|
||||
{
|
||||
msk.set(F_DEBCRE, rettifica > ZERO ? "D" : "C");
|
||||
rettifica = abs(rettifica);
|
||||
msk.set(F_RETTIFICA, rettifica);
|
||||
}
|
||||
|
||||
TString desc1 = _lim->get("S0"), desc2 = _lim->get("S1"), desc3 = _lim->get("S2");
|
||||
msk.field(F_DESCR1).set(desc1);
|
||||
msk.field(F_DESCR2).set(desc2);
|
||||
msk.field(F_DESCR3).set(desc3);
|
||||
TString desc1 = _lim->get("S0"), desc2 = _lim->get("S1"), desc3 = _lim->get("S2"), desc4 = _lim->get("S3");
|
||||
|
||||
msk.set(F_DESCR1, desc1);
|
||||
msk.set(F_DESCR2, desc2);
|
||||
msk.set(F_DESCR3, desc3);
|
||||
msk.set(F_DESCR4, desc4);
|
||||
msk.set(F_ACCONTO, acconto);
|
||||
|
||||
real varimp = _lim->get("R17");
|
||||
real impnonver= _lim->get("R18");
|
||||
real credspec = _lim->get("R19");
|
||||
|
||||
msk.set(F_VARIMP, varimp >= ZERO ? varimp : -varimp);
|
||||
msk.set(F_VARIMP_DC, varimp >= ZERO ? "D" : "C");
|
||||
if (!varimp.is_zero())
|
||||
{
|
||||
msk.set(F_VARIMP_DC, varimp > ZERO ? "D" : "C");
|
||||
varimp = abs(varimp);
|
||||
msk.set(F_VARIMP, varimp);
|
||||
}
|
||||
|
||||
msk.set(F_IMPNONVER, impnonver);
|
||||
msk.set(F_CREDSPEC, credspec);
|
||||
@ -695,7 +763,7 @@ bool Visliq_app::vis_one(int m)
|
||||
TViswin & vsw = brw.vis_win();
|
||||
bool is_delega = false;
|
||||
|
||||
real vers; TDate date; TString abi(5), cab(5), con(3);
|
||||
real vers; TDate date; TString8 abi, cab, con;
|
||||
|
||||
if (is_delega = look_del(m,1))
|
||||
{
|
||||
@ -706,141 +774,95 @@ bool Visliq_app::vis_one(int m)
|
||||
con = _del->get("S9");
|
||||
}
|
||||
|
||||
msk.field(F_DELDATE).set(date.string());
|
||||
msk.field(F_DELIMP).set(vers.string());
|
||||
msk.field(F_DELABI).set(abi);
|
||||
msk.field(F_DELCAB).set(cab);
|
||||
msk.field(F_DELCON).set(con);
|
||||
msk.set(F_DELDATE, date);
|
||||
msk.set(F_DELIMP, vers);
|
||||
msk.set(F_DELABI, abi);
|
||||
msk.set(F_DELCAB, cab);
|
||||
msk.set(F_DELCON, con);
|
||||
|
||||
bool l_mod = false;
|
||||
bool d_mod = false;
|
||||
real cred_util = _lim->get_real("R16");
|
||||
|
||||
msk.set(F_CREDUTIL, cred_util);
|
||||
|
||||
real cred_aut = _lim->get_real("R20");
|
||||
TDate data_aut = _lim->get_date("D1");
|
||||
|
||||
msk.set(F_CREDAUT, cred_aut);
|
||||
msk.set(F_DATAAUT, data_aut);
|
||||
|
||||
_from_one = true;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
KEY k = msk.run();
|
||||
|
||||
if (k == K_ESC) break;
|
||||
|
||||
real n_acconto (msk.get(F_ACCONTO));
|
||||
real n_rimborso (msk.get(F_RIMBORSO));
|
||||
real n_rettifica(msk.get(F_RETTIFICA));
|
||||
real n_delimp(msk.get(F_DELIMP));
|
||||
TString n_desc1 (msk.get(F_DESCR1));
|
||||
TString n_desc2 (msk.get(F_DESCR2));
|
||||
TString n_desc3 (msk.get(F_DESCR3));
|
||||
real n_vers (msk.get(F_DELIMP));
|
||||
TDate n_date (msk.get(F_DELDATE));
|
||||
TString n_abi (msk.get(F_DELABI));
|
||||
TString n_cab (msk.get(F_DELCAB));
|
||||
TString n_con (msk.get(F_DELCON));
|
||||
real n_varimp(msk.get(F_VARIMP));
|
||||
real n_impnonver(msk.get(F_IMPNONVER));
|
||||
real n_credspec(msk.get(F_CREDSPEC));
|
||||
|
||||
if (msk.field(F_DEBCRE).get()[0] == 'C')
|
||||
n_rettifica = -n_rettifica;
|
||||
|
||||
if (msk.get(F_VARIMP_DC)[0] == 'C')
|
||||
n_varimp = -n_varimp;
|
||||
KEY k;
|
||||
|
||||
while ((k = msk.run()) != K_ESC && msk.dirty())
|
||||
{
|
||||
acconto = msk.get_real(F_ACCONTO);
|
||||
rettifica = msk.get_real(F_RETTIFICA);
|
||||
if (msk.field(F_DEBCRE).get()[0] == 'C')
|
||||
rettifica = -rettifica;
|
||||
if (msk.get(F_VARIMP_DC)[0] == 'C')
|
||||
varimp = -varimp;
|
||||
desc1 = msk.get(F_DESCR1);
|
||||
desc2 = msk.get(F_DESCR2);
|
||||
desc3 = msk.get(F_DESCR3);
|
||||
desc4 = msk.get(F_DESCR4);
|
||||
vers = msk.get_real(F_DELIMP);
|
||||
date = msk.get_date(F_DELDATE);
|
||||
abi = msk.get(F_DELABI);
|
||||
cab = msk.get(F_DELCAB);
|
||||
con = msk.get(F_DELCON);
|
||||
varimp = msk.get_real(F_VARIMP);
|
||||
impnonver = msk.get_real(F_IMPNONVER);
|
||||
credspec = msk.get_real(F_CREDSPEC);
|
||||
cred_util = msk.get_real(F_CREDUTIL);
|
||||
cred_aut = msk.get_real(F_CREDAUT);
|
||||
data_aut = msk.get_date(F_DATAAUT);
|
||||
|
||||
bool l_mod = msk.field(F_ACCONTO).dirty() ||
|
||||
msk.field(F_RETTIFICA).dirty() || msk.field(F_DEBCRE).dirty() ||
|
||||
msk.field(F_VARIMP).dirty() || msk.field(F_VARIMP_DC).dirty() ||
|
||||
msk.field(F_DESCR1).dirty() ||
|
||||
msk.field(F_DESCR2).dirty() ||
|
||||
msk.field(F_DESCR3).dirty() ||
|
||||
msk.field(F_CREDSPEC).dirty() ||
|
||||
msk.field(F_CREDUTIL).dirty() ||
|
||||
msk.field(F_CREDAUT).dirty() ||
|
||||
msk.field(F_DATAAUT).dirty() ? true : false;
|
||||
bool d_mod = msk.field(F_DELDATE).dirty() ||
|
||||
msk.field(F_DELIMP).dirty() ||
|
||||
msk.field(F_DELABI).dirty() ||
|
||||
msk.field(F_DELCAB).dirty() ||
|
||||
msk.field(F_DELCON).dirty() ? true : false;
|
||||
|
||||
if (msk.field(F_RETTIFICA).dirty() || msk.field(F_DEBCRE).dirty())
|
||||
{
|
||||
rettifica = n_rettifica;
|
||||
l_mod = true;
|
||||
}
|
||||
if (msk.field(F_ACCONTO).dirty())
|
||||
{
|
||||
acconto = n_acconto;
|
||||
l_mod = true;
|
||||
}
|
||||
if (msk.field(F_RIMBORSO).dirty())
|
||||
{
|
||||
// check diritto (se non ce n'era già uno prima)
|
||||
const bool old_rim = !rimborso.is_zero();
|
||||
real nuovo_rimborso = msk.get_real(F_RIMBORSO);
|
||||
bool ok = true;
|
||||
if (!n_rimborso.is_zero())
|
||||
{
|
||||
const bool old_rim = !rimborso.is_zero();
|
||||
// check diritto (se non ce n'era già uno prima)
|
||||
if (!_lim->get_bool("B2") && !old_rim)
|
||||
|
||||
if (!nuovo_rimborso.is_zero() && !_lim->get_bool("B2") && !old_rim)
|
||||
ok = yesno_box(FR("Non risulta diritto al rimborso per il mese %d. Si desidera "
|
||||
"confermare ugualmente?"), m);
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
rimborso = n_rimborso;
|
||||
l_mod = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
msk.field(F_RIMBORSO).set(rimborso.string());
|
||||
{
|
||||
rimborso = nuovo_rimborso;
|
||||
l_mod = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
msk.set(F_RIMBORSO, rimborso);
|
||||
msk.field(F_RIMBORSO).set_dirty(false);
|
||||
}
|
||||
}
|
||||
if (msk.field(F_DESCR1).dirty())
|
||||
{
|
||||
desc1 = n_desc1;
|
||||
l_mod = true;
|
||||
}
|
||||
if (msk.field(F_DESCR2).dirty())
|
||||
{
|
||||
desc2 = n_desc2;
|
||||
l_mod = true;
|
||||
}
|
||||
if (msk.field(F_DESCR3).dirty())
|
||||
{
|
||||
desc3 = n_desc3;
|
||||
l_mod = true;
|
||||
}
|
||||
if (msk.field(F_DELDATE).dirty())
|
||||
{
|
||||
date = n_date;
|
||||
d_mod = true;
|
||||
}
|
||||
if (msk.field(F_DELIMP).dirty())
|
||||
{
|
||||
real itt = _lim->get_real("R10");
|
||||
vers = n_vers;
|
||||
d_mod = true;
|
||||
}
|
||||
if (msk.field(F_DELABI).dirty())
|
||||
{
|
||||
abi = n_abi;
|
||||
d_mod = true;
|
||||
}
|
||||
if (msk.field(F_DELCAB).dirty())
|
||||
{
|
||||
cab = n_cab;
|
||||
d_mod = true;
|
||||
}
|
||||
if (msk.field(F_DELCON).dirty())
|
||||
{
|
||||
con = n_con;
|
||||
d_mod = true;
|
||||
}
|
||||
if (msk.field(F_VARIMP).dirty() || msk.field(F_VARIMP_DC).dirty())
|
||||
{
|
||||
varimp = n_varimp;
|
||||
l_mod = true;
|
||||
}
|
||||
if (msk.field(F_IMPNONVER).dirty())
|
||||
{
|
||||
impnonver = n_impnonver;
|
||||
l_mod = true;
|
||||
}
|
||||
|
||||
if (msk.field(F_CREDSPEC).dirty())
|
||||
{
|
||||
credspec = n_credspec;
|
||||
l_mod = true;
|
||||
}
|
||||
|
||||
if (recorded) recorded = !(d_mod || l_mod);
|
||||
if (recorded)
|
||||
recorded = !(d_mod || l_mod);
|
||||
|
||||
if (k == K_INS || k == K_SAVE)
|
||||
{
|
||||
recalc_liq_data(&vsw, rimborso, rettifica, vers, acconto, varimp, impnonver, credspec,
|
||||
desc1, desc2, desc3, date, abi, cab, con);
|
||||
desc1, desc2, desc3, desc4, date, abi, cab, con,
|
||||
cred_util, cred_aut, data_aut);
|
||||
}
|
||||
if (k == K_SAVE)
|
||||
{
|
||||
@ -877,20 +899,35 @@ bool Visliq_app::vis_one(int m)
|
||||
real Visliq_app::credito_utilizzato(int year, int month) const
|
||||
{
|
||||
real credito;
|
||||
|
||||
TTable lim("LIM");
|
||||
TString16 cod;
|
||||
for (int m = 1; m <= month; m++)
|
||||
|
||||
for (int m = 1; m <= month; m++)
|
||||
{
|
||||
cod.format("%04d%02d", year, m);
|
||||
lim.put("CODTAB", cod);
|
||||
if (lim.read() == NOERR)
|
||||
{
|
||||
if (m < month)
|
||||
credito += lim.get_real("R15"); // Credito utilizzato IVA
|
||||
if (m < 13)
|
||||
credito += lim.get_real("R16"); // Credito utilizzato F24
|
||||
}
|
||||
|
||||
const TRectype& lim = cache().get("LIM", cod);
|
||||
|
||||
if (m < month)
|
||||
credito += lim.get_real("R15"); // Credito utilizzato IVA
|
||||
if (m < 13)
|
||||
credito += lim.get_real("R16"); // Credito utilizzato F24
|
||||
}
|
||||
|
||||
return credito;
|
||||
}
|
||||
|
||||
real Visliq_app::credito_autorizzato(int year, int month) const
|
||||
{
|
||||
real credito;
|
||||
TString16 cod;
|
||||
|
||||
for (int m = 1; m <= month; m++)
|
||||
{
|
||||
cod.format("%04d%02d", year, m);
|
||||
|
||||
const TRectype& lim = cache().get("LIM", cod);
|
||||
|
||||
credito += lim.get_real("R20"); // Credito utilizzato IVA
|
||||
}
|
||||
|
||||
return credito;
|
||||
@ -929,8 +966,10 @@ real Visliq_app::min_vers(int anno, int month)
|
||||
|
||||
void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& vers,
|
||||
real& acc, real& varimp, real& impnonver, real & credspec,
|
||||
TString& d1, TString& d2, TString& d3, TDate& date,
|
||||
TString& abi, TString& cab, TString& con)
|
||||
TString& d1, TString& d2, TString& d3, TString& d4,
|
||||
TDate& date, TString& abi, TString& cab, TString& con,
|
||||
real & credito_utilizzato_F24,
|
||||
real & credito_autorizzato_F24, TDate & data_autorizzazione)
|
||||
{
|
||||
// ricalcola tutto, scrive nei lim, NON salva e riaggiusta
|
||||
// la paginata della liquidazione
|
||||
@ -952,7 +991,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
||||
real crd = _lim->get_real("R12"); // totale a credito si
|
||||
real dbt = _lim->get_real("R13"); // totale a debito si
|
||||
real itr = _lim->get_real("R14"); // interesse totale si
|
||||
real cui = _lim->get_real("R15"); // Credito utilizzato iva si
|
||||
real cui = _lim->get_real("R15"); // Credito util.IVA prec. si
|
||||
real var = _lim->get_real("R17"); // Variazioni d'imposta no
|
||||
real inv = _lim->get_real("R18"); // Imposta non versata no
|
||||
real crs = _lim->get_real("R19"); // Crediti speciali no
|
||||
@ -983,31 +1022,24 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
||||
// calcola vecchio risultato: se e' diverso da R0 ci sono cazzi strani
|
||||
// e invalidiamo B0 cosi' impara
|
||||
real risul = iva_ven - iva_acq - udt + rmb + cgp - vri + rtt - act - cre_pre + deb_pre +
|
||||
var + inv - cui - crs;
|
||||
|
||||
if (risul != ris)
|
||||
{
|
||||
#ifdef DBG
|
||||
yesnofatal_box("Porca vacca: Risultato non coincidente!");
|
||||
#endif
|
||||
_lim->put("B0", "X");
|
||||
}
|
||||
|
||||
var + inv - cui - crs; //qui
|
||||
|
||||
// calcola nuovi dati
|
||||
real riscr = iva_acq + udt + acc + cre_pre + credspec;
|
||||
real risdb = iva_ven + rimb + deb_pre + impnonver;
|
||||
|
||||
if (rett.sign() < 0) riscr -= rett;
|
||||
if (rett < ZERO) riscr -= rett;
|
||||
else risdb += rett;
|
||||
if (cgp.sign() < 0) riscr -= cgp;
|
||||
else riscr += cgp;
|
||||
if (varimp.sign() < 0) riscr -= varimp;
|
||||
if (cgp < ZERO) riscr -= cgp;
|
||||
else riscr += cgp;
|
||||
if (varimp < ZERO) riscr -= varimp;
|
||||
else risdb += varimp;
|
||||
|
||||
real credito_utilizzato_iva = ZERO;
|
||||
const bool new_age_2000 = (_year >= 2000) && look_lia() && (_lia->get("S9") == "NV");
|
||||
if (new_age_2000)
|
||||
const bool compensabile = _lia->get("S9") == "CM";
|
||||
|
||||
// if ((_year >= 2000) && look_lia() && compensabile)
|
||||
if (look_lia() && compensabile)
|
||||
{
|
||||
real credito_utilizzabile_inizio_anno = _lia->get_real("R0") - _lia->get_real("R15");
|
||||
if (credito_utilizzabile_inizio_anno < ZERO)
|
||||
@ -1018,6 +1050,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
||||
{
|
||||
real credito_utilizzabile = credito_utilizzabile_inizio_anno;
|
||||
|
||||
credito_utilizzabile += credito_autorizzato(year, month);
|
||||
credito_utilizzabile -= credito_utilizzato(year, month);
|
||||
if (credito_utilizzabile < ZERO) credito_utilizzabile = ZERO;
|
||||
if (month < 13)
|
||||
@ -1030,13 +1063,24 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
||||
}
|
||||
|
||||
risul = risdb - riscr;
|
||||
|
||||
real intr(0.0);
|
||||
|
||||
if (!itt.is_zero() && risul.sign() > 0)
|
||||
const real check01 = risul.round(2);
|
||||
const real check02 = ris.round(2);
|
||||
|
||||
if (check01 != check02)
|
||||
{
|
||||
#ifdef DBG
|
||||
yesnofatal_box("Porca vacca: Risultato non coincidente!");
|
||||
#endif
|
||||
_lim->put("B0", "X");
|
||||
}
|
||||
|
||||
real intr;
|
||||
|
||||
if (!itt.is_zero() && risul > ZERO)
|
||||
{
|
||||
// calcola interesse
|
||||
intr = risul * itt / real(100.0);
|
||||
intr = risul * itt / CENTO;
|
||||
intr.ceil();
|
||||
if (after2000)
|
||||
round_imposta(intr);
|
||||
@ -1052,13 +1096,19 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
||||
_lim->put("R13", risdb);
|
||||
_lim->put("R14", intr);
|
||||
_lim->put("R15", credito_utilizzato_iva);
|
||||
_lim->put("R16", credito_utilizzato_F24);
|
||||
|
||||
_lim->put("R17", varimp);
|
||||
_lim->put("R18", impnonver);
|
||||
_lim->put("R19", credspec);
|
||||
_lim->put("R20", credito_autorizzato_F24);
|
||||
|
||||
_lim->put("D1", data_autorizzazione);
|
||||
|
||||
_lim->put("S0", d1);
|
||||
_lim->put("S1", d2);
|
||||
_lim->put("S2", d3);
|
||||
_lim->put("S3", d4);
|
||||
|
||||
// i dati dei versamenti si schiaffano in LIM:
|
||||
// D0 la data, S4/5/6 le tre cazzate ABI CAB CON
|
||||
@ -1303,7 +1353,11 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
|
||||
|
||||
int step = _freqviva == "M" ? 1 : 3;
|
||||
real rstart = _lim->get("R0");
|
||||
|
||||
real cr_res = _lia->get_real("R0");
|
||||
const bool compensabile = _lia->get("S9") == "CM";
|
||||
|
||||
cr_res -= _lia->get_real("R15");
|
||||
|
||||
for (int i = start_month; i < 13; i += step)
|
||||
{
|
||||
int row = (i/step) - 1;
|
||||
@ -1322,6 +1376,7 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
|
||||
real risd = _lim->get_real("R13");
|
||||
real intt = _lim->get_real("R10");
|
||||
real crf24 = _lim->get_real("R16");
|
||||
real autf24 = _lim->get_real("R20");
|
||||
|
||||
// toglie vecchio credito e debito
|
||||
risl += cred;
|
||||
@ -1352,7 +1407,7 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
|
||||
_lim->put("R0", risl);
|
||||
_lim->put("R12", risc);
|
||||
_lim->put("R13", risd);
|
||||
if (intt.sign() > 0) // interessi
|
||||
if (intt > ZERO) // interessi
|
||||
{
|
||||
real intr = risl * intt / real(100.0);
|
||||
if (_year >= 2000)
|
||||
@ -1360,6 +1415,7 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
|
||||
_lim->put("R14",intr);
|
||||
}
|
||||
_lim->put("R16", crf24);
|
||||
_lim->put("R20", autf24);
|
||||
|
||||
_lim->rewrite();
|
||||
_lam->rewrite();
|
||||
@ -1372,27 +1428,62 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
|
||||
TToken_string& t = sl->row(row);
|
||||
t.add(itoname(i),0);
|
||||
|
||||
int sr0 = (_lim->get_real("R0")).sign();
|
||||
int sr5 = (_lim->get_real("R5")).sign();
|
||||
|
||||
real r0abs = abs(_lim->get_real("R0"));
|
||||
real r5abs = abs(_lim->get_real("R5"));
|
||||
t.add(r0abs.string(),1);
|
||||
t.add(sr0 == 0 ? "" : (sr0 > 0 ? "D" : "C"), 2);
|
||||
t.add((_lim->get_real("R1")).string(),3);
|
||||
t.add(r5abs.string(),4);
|
||||
const real r0 = _lim->get_real("R0");
|
||||
const real r1 = _lim->get_real("R1");
|
||||
bool enable_date = !r1.is_zero();
|
||||
const real r5 = _lim->get_real("R5");
|
||||
|
||||
t.add(sr5 == 0 ? "" : (sr5 > 0 ? "D" : "C"),5);
|
||||
|
||||
real absv = abs(r0);
|
||||
t.add(absv, 1);
|
||||
if (!r0.is_zero())
|
||||
t.add(r0 > ZERO ? "D" : "C", 2);
|
||||
t.add(r1, 3);
|
||||
absv = abs(r5);
|
||||
t.add(absv, 4);
|
||||
if (!r5.is_zero())
|
||||
t.add(r5 >ZERO ? "D" : "C", 5);
|
||||
|
||||
const real criva = _lim->get_real("R15");
|
||||
const real crf24 = _lim->get_real("R16");
|
||||
const real autf24 = _lim->get_real("R20");
|
||||
TDate dautf24 = _lim->get_date("D1");
|
||||
|
||||
enable_date |= !autf24.is_zero();
|
||||
t.add(criva, 6);
|
||||
t.add(crf24, 7);
|
||||
t.add(autf24, 8);
|
||||
if (enable_date)
|
||||
t.add(dautf24, 9);
|
||||
if (compensabile)
|
||||
{
|
||||
cr_res += autf24;
|
||||
cr_res -= crf24;
|
||||
cr_res -= criva;
|
||||
if (cr_res < ZERO)
|
||||
{
|
||||
sl->set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, 7);
|
||||
t.add("", 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
sl->set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, 7);
|
||||
t.add(cr_res, 10);
|
||||
}
|
||||
}
|
||||
else
|
||||
t.add("", 10);
|
||||
t.add(_lim->get("S3"), 11);
|
||||
|
||||
for (int kk = 3; kk < 6 ; kk++)
|
||||
sl->enable_cell(row, kk);
|
||||
sl->enable_cell(row, 7);
|
||||
sl->enable_cell(row, 8);
|
||||
sl->enable_cell(row, 9);
|
||||
|
||||
sl->force_update(row);
|
||||
sl->enable_cell(row, 9, enable_date);
|
||||
sl->enable_cell(row, 12);
|
||||
}
|
||||
}
|
||||
|
||||
sl->force_update();
|
||||
// se non si fa questa non scrive una delega,
|
||||
// bensi' una bovazza (escremento bovino)
|
||||
look_lim(start_month);
|
||||
@ -1459,20 +1550,23 @@ void Visliq_app::read_general(TMask& m)
|
||||
TString8 cab;
|
||||
TString4 cnc;
|
||||
const int step = _freqviva == "M" ? 1 : 3;
|
||||
const bool new_age_2000 = _lia->get("S9") == "NV";
|
||||
const bool compensabile = _lia->get("S9") == "CM";
|
||||
|
||||
TSheet_field& sh = m.sfield(F_VISLIQ1);
|
||||
TSheet_field& sv = m.sfield(F_VISLIQ2);
|
||||
TMask_field& crprec = m.field(F_CREDPREC);
|
||||
|
||||
if (new_age_2000)
|
||||
/* if (compensabile)
|
||||
crprec.set_prompt(TR("Credito compensabile inizio anno "));
|
||||
else
|
||||
crprec.set_prompt(TR("Credito inizio anno "));
|
||||
real cr_res = _lia->get_real("R0");
|
||||
crprec.set(cr_res.string());
|
||||
if (new_age_2000)
|
||||
cr_res -= _lia->get_real("R15");
|
||||
crprec.set_prompt(TR("Credito inizio anno ")); */
|
||||
|
||||
real cr_res = _lia->get_real("R0");
|
||||
real cr_util = _lia->get_real("R15");
|
||||
|
||||
m.set(F_CREDPREC, cr_res);
|
||||
m.set(F_CREDUTILIN, cr_util);
|
||||
|
||||
cr_res -= cr_util;
|
||||
|
||||
// set sheet
|
||||
for (int i = step; i < 13; i+=step)
|
||||
@ -1498,8 +1592,10 @@ void Visliq_app::read_general(TMask& m)
|
||||
else
|
||||
tt = &(sh.row(row));
|
||||
|
||||
real r0abs = abs(_lim->get_real("R0"));
|
||||
real r5abs = abs(_lim->get_real("R5"));
|
||||
const real r0abs = abs(_lim->get_real("R0"));
|
||||
const real r1 = _lim->get_real("R1");
|
||||
const real r5abs = abs(_lim->get_real("R5"));
|
||||
|
||||
tt->add(itoname(i),0);
|
||||
tt->add(r0abs.string(),1);
|
||||
|
||||
@ -1507,31 +1603,47 @@ void Visliq_app::read_general(TMask& m)
|
||||
int sr5 = (_lim->get_real("R5")).sign();
|
||||
|
||||
tt->add(sr0 == 0 ? "" : (sr0 > 0 ? "D" : "C"),2);
|
||||
tt->add(_lim->get_real("R1").string(),3);
|
||||
tt->add(r1.string(),3);
|
||||
tt->add(r5abs.string(),4);
|
||||
bool enable_date = !r1.is_zero();
|
||||
tt->add(sr5 == 0 ? "" : (sr5 > 0 ? "D" : "C"),5);
|
||||
|
||||
const real criva = _lim->get_real("R15");
|
||||
tt->add(criva.string(), 6);
|
||||
const real crf24 = _lim->get_real("R16");
|
||||
tt->add(crf24.string(),7);
|
||||
if (new_age_2000)
|
||||
const real autf24 = _lim->get_real("R20");
|
||||
tt->add(autf24.string(),8);
|
||||
enable_date |= !autf24.is_zero();
|
||||
TDate dautf24 = _lim->get_date("D1");
|
||||
if (enable_date)
|
||||
tt->add(dautf24.string(),9);
|
||||
sh.enable_cell(row, 9, enable_date);
|
||||
if (compensabile)
|
||||
{
|
||||
if (cr_res > ZERO)
|
||||
{
|
||||
cr_res -= crf24;
|
||||
cr_res -= criva;
|
||||
}
|
||||
if (cr_res < ZERO)
|
||||
cr_res = ZERO;
|
||||
tt->add(cr_res.string(), 8);
|
||||
// if (cr_res > ZERO)
|
||||
// {
|
||||
cr_res += autf24;
|
||||
cr_res -= crf24;
|
||||
cr_res -= criva;
|
||||
if (cr_res < ZERO)
|
||||
{
|
||||
sh.set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, 7);
|
||||
tt->add("", 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
sh.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, 7);
|
||||
tt->add(cr_res.string(), 10);
|
||||
}
|
||||
}
|
||||
else
|
||||
tt->add("", 8);
|
||||
tt->add(_lim->get("S3"), 9);
|
||||
|
||||
tt->add("", 10);
|
||||
tt->add(_lim->get("S3"), 11);
|
||||
sh.row(row) = (*tt);
|
||||
// sh.force_update(row);
|
||||
}
|
||||
sh.force_update();
|
||||
|
||||
// calcola versamenti
|
||||
real versamenti[13];
|
||||
@ -1611,25 +1723,23 @@ void Visliq_app::write_general(TMask& m)
|
||||
{
|
||||
TSheet_field& sh = m.sfield(F_VISLIQ1);
|
||||
TSheet_field& sv = m.sfield(F_VISLIQ2);
|
||||
const bool new_age_2000 = _lia->get("S9") == "NV";
|
||||
const bool compensabile = _lia->get("S9") == "CM";
|
||||
|
||||
if (m.field(F_CREDPREC).dirty())
|
||||
{
|
||||
const real r = m.get(F_CREDPREC);
|
||||
_lia->put("R0",r);
|
||||
_lia->rewrite();
|
||||
}
|
||||
real rstart = m.get_real(F_CREDPREC);
|
||||
real rutil = m.get_real(F_CREDUTILIN);
|
||||
|
||||
_lia->put("R0", rstart);
|
||||
_lia->put("R15", rutil);
|
||||
_lia->rewrite();
|
||||
|
||||
// credito iniziale
|
||||
real rstart = _lia->get_real("R0");
|
||||
real cr_res;
|
||||
if (!new_age_2000)
|
||||
{
|
||||
if (!rstart.is_zero())
|
||||
rstart = -rstart;
|
||||
}
|
||||
|
||||
rstart -= rutil;
|
||||
if (!compensabile)
|
||||
rstart = -rstart;
|
||||
else
|
||||
cr_res = rstart - _lia->get_real("R15");
|
||||
cr_res = rstart;
|
||||
|
||||
// indicatore ricalcolo crediti e debiti OK
|
||||
int step = _freqviva == "M" ? 1 : 3;
|
||||
@ -1652,7 +1762,7 @@ void Visliq_app::write_general(TMask& m)
|
||||
// risolve menata del dettaglio si'/no
|
||||
if (lfrommask)
|
||||
{
|
||||
for (int i = 1; i <= 9; i++)
|
||||
for (int i = 1; i <= 11; i++)
|
||||
tt_ln.add(shm.get(101+i),i);
|
||||
}
|
||||
|
||||
@ -1674,6 +1784,8 @@ void Visliq_app::write_general(TMask& m)
|
||||
real overs(tt_vo.get(5));
|
||||
real nvers(tt_vn.get(5));
|
||||
real crf24(tt_ln.get(7));
|
||||
real autf24(tt_ln.get(8));
|
||||
TDate dautf24(tt_ln.get(9));
|
||||
TDate odate(tt_vo.get(1));
|
||||
TDate ndate(tt_vn.get(1));
|
||||
TString odbcr(tt_lo.get(5));
|
||||
@ -1684,7 +1796,7 @@ void Visliq_app::write_general(TMask& m)
|
||||
TString8 ncab (tt_vn.get(3));
|
||||
TString ocon (tt_vo.get(4));
|
||||
TString ncon (tt_vn.get(4));
|
||||
TString descr(tt_ln.get(9));
|
||||
TString descr(tt_ln.get(11));
|
||||
|
||||
if (odbcr == "C") orett = -orett;
|
||||
if (ndbcr == "C") nrett = -nrett;
|
||||
@ -1868,16 +1980,23 @@ void Visliq_app::write_general(TMask& m)
|
||||
}
|
||||
|
||||
_lim->put("R16", crf24);
|
||||
if (new_age_2000)
|
||||
_lim->put("R20", autf24);
|
||||
_lim->put("D1", dautf24);
|
||||
if (compensabile)
|
||||
{
|
||||
const real criva(tt_ln.get(6));
|
||||
if (cr_res > ZERO)
|
||||
{
|
||||
// if (cr_res > ZERO)
|
||||
// {
|
||||
cr_res += autf24;
|
||||
cr_res -= crf24;
|
||||
cr_res -= criva;
|
||||
}
|
||||
if (cr_res < ZERO)
|
||||
cr_res = ZERO;
|
||||
// }
|
||||
// if (cr_res < ZERO)
|
||||
// cr_res = ZERO;
|
||||
if (cr_res < ZERO)
|
||||
sh.set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, 7);
|
||||
else
|
||||
sh.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, 7);
|
||||
}
|
||||
_lim->put("S3", descr);
|
||||
|
||||
@ -1897,8 +2016,10 @@ void Visliq_app::write_general(TMask& m)
|
||||
if (orimb != nrimb)
|
||||
_lim->put("R1", nrimb);
|
||||
_lim->put("R16", crf24);
|
||||
_lim->put("S3", descr);
|
||||
_lim->put("B0", "");
|
||||
_lim->put("R20", autf24);
|
||||
_lim->put("D1", dautf24);
|
||||
_lim->put("S3", descr);
|
||||
_lim->zero("B0");
|
||||
_lim->rewrite();
|
||||
}
|
||||
}
|
||||
@ -1914,12 +2035,14 @@ void Visliq_app::write_general(TMask& m)
|
||||
|
||||
tt_ln.add(r0abs.string(),1);
|
||||
tt_ln.add(sr0 == 0 ? "" : (sr0 > 0 ? "D" : "C"), 2);
|
||||
|
||||
tt_ln.add((_lim->get_real("R1")).string(),3);
|
||||
tt_ln.add(r5abs.string(),4);
|
||||
tt_ln.add(sr5 == 0 ? "" : (sr5 > 0 ? "D" : "C"),5);
|
||||
tt_ln.add(cr_res.string(),8);
|
||||
|
||||
// sh.force_update(row);
|
||||
if ( cr_res < ZERO)
|
||||
tt_ln.add("",10);
|
||||
else
|
||||
tt_ln.add(cr_res.string(),10);
|
||||
}
|
||||
_from_one = false;
|
||||
} // for mese liq. (riga sheet)
|
||||
|
13
cg/cg5500.h
13
cg/cg5500.h
@ -56,7 +56,10 @@ protected:
|
||||
// handlers
|
||||
static bool set_ditta(TMask_field&, KEY);
|
||||
static bool set_ragsoc(TMask_field&, KEY);
|
||||
static bool print_handler(TMask_field&, KEY);
|
||||
static bool sel_mese_sh1 (TMask_field&, KEY);
|
||||
static bool enable_date (TMask_field&, KEY);
|
||||
static bool check_date (TMask_field&, KEY);
|
||||
static bool sel_mese_sh2 (TMask_field&, KEY);
|
||||
static bool ch_year_handler(TMask_field& f, KEY key);
|
||||
|
||||
@ -64,6 +67,7 @@ protected:
|
||||
|
||||
static bool sheet_action(TSheet_field& s, int r, KEY k);
|
||||
static bool vers_action(TSheet_field& s, int r, KEY k);
|
||||
virtual void print();
|
||||
|
||||
public:
|
||||
virtual bool firm_change_enabled() const { return false; }
|
||||
@ -95,6 +99,7 @@ public:
|
||||
|
||||
// 2 palle
|
||||
TMask* get_main_mask() { return _mask; }
|
||||
int year() { return _year;}
|
||||
bool select_butt(TMask& m);
|
||||
TTable* del() { return _del; }
|
||||
|
||||
@ -102,11 +107,15 @@ public:
|
||||
// riaggiusta la liquidazione del mese dato
|
||||
void recalc_liq_data(TViswin* v, real& rimb, real& rett, real& vers, real& acc,
|
||||
real& varimp, real& impnonver, real& credspec,
|
||||
TString& d1, TString& d2, TString& d3, TDate& date,
|
||||
TString& abi, TString& cab, TString& con);
|
||||
TString& d1, TString& d2, TString& d3, TString& d4,
|
||||
TDate& date, TString& abi, TString& cab, TString& con,
|
||||
real & credito_utilizzato_F24,
|
||||
real & credito_autorizzato_F24, TDate & data_autorizzazione);
|
||||
|
||||
// Calcolo del credito utilizzato IVA ed F24
|
||||
real credito_utilizzato(int year, int month) const;
|
||||
// Calcolo del credito autorizzato F24
|
||||
real credito_autorizzato(int year, int month) const;
|
||||
|
||||
// riaggiusta le liquidazioni successive se serve
|
||||
void recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field* sv);
|
||||
|
65
cg/cg5500a.h
65
cg/cg5500a.h
@ -1,32 +1,37 @@
|
||||
#define F_CODDITTA 151
|
||||
#define F_RAGSOC 152
|
||||
#define F_MONTHS 153
|
||||
#define F_TRIMS 154
|
||||
#define F_YEAR 155
|
||||
#define F_VISLIQ1 156
|
||||
#define F_VISLIQ2 157
|
||||
#define F_CREDPREC 158
|
||||
#define F_VISFLQ 109
|
||||
#define F_ACCONTO 110
|
||||
#define F_RIMBORSO 111
|
||||
#define F_RETTIFICA 112
|
||||
#define F_DESCR1 113
|
||||
#define F_DESCR2 114
|
||||
#define F_DEBCRE 115
|
||||
#define F_SELECT 116
|
||||
#define F_DELDATE 117
|
||||
#define F_DELIMP 118
|
||||
#define F_DELABI 119
|
||||
#define F_DELCAB 120
|
||||
#define F_DELCON 121
|
||||
#define F_PERIODOM 122
|
||||
#define F_PERIODOT 123
|
||||
#define F_DESCR3 124
|
||||
#define F_VARIMP 125
|
||||
#define F_VARIMP_DC 126
|
||||
#define F_IMPNONVER 127
|
||||
#define F_CREDSPEC 128
|
||||
#define F_CODDITTA 151
|
||||
#define F_RAGSOC 152
|
||||
#define F_MONTHS 153
|
||||
#define F_TRIMS 154
|
||||
#define F_YEAR 155
|
||||
#define F_VISLIQ1 156
|
||||
#define F_VISLIQ2 157
|
||||
#define F_CREDPREC 158
|
||||
#define F_CREDUTILIN 159
|
||||
#define F_VISFLQ 109
|
||||
#define F_ACCONTO 110
|
||||
#define F_RIMBORSO 111
|
||||
#define F_RETTIFICA 112
|
||||
#define F_DESCR1 113
|
||||
#define F_DESCR2 114
|
||||
#define F_DEBCRE 115
|
||||
#define F_SELECT 116
|
||||
#define F_DELDATE 117
|
||||
#define F_DELIMP 118
|
||||
#define F_DELABI 119
|
||||
#define F_DELCAB 120
|
||||
#define F_DELCON 121
|
||||
#define F_PERIODOM 122
|
||||
#define F_PERIODOT 123
|
||||
#define F_DESCR3 124
|
||||
#define F_VARIMP 125
|
||||
#define F_VARIMP_DC 126
|
||||
#define F_IMPNONVER 127
|
||||
#define F_CREDSPEC 128
|
||||
#define F_CREDUTIL 129
|
||||
#define F_CREDAUT 130
|
||||
#define F_DATAAUT 131
|
||||
#define F_DESCR4 132
|
||||
|
||||
#define F_CODDITTA2 201
|
||||
#define F_RAGSOC2 202
|
||||
#define F_CODDITTA2 201
|
||||
#define F_RAGSOC2 202
|
||||
|
||||
|
197
cg/cg5500a.rep
Normal file
197
cg/cg5500a.rep
Normal file
@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report name="cg5500a" page_split="1" lpi="6">
|
||||
<description>Stampa prospetto liquidazione</description>
|
||||
<font face="Courier New" size="8" />
|
||||
<section type="Head" pattern="1">
|
||||
<font face="Courier New" bold="1" size="8" />
|
||||
<field type="Stringa" align="center" width="175" height="2" pattern="1">
|
||||
<font face="Arial" bold="1" size="14" />
|
||||
<prescript description="H0.0 PRESCRIPT">"Stampa Prospetto Liquidazione "
|
||||
#ANNO @
|
||||
+
|
||||
#THIS !</prescript>
|
||||
</field>
|
||||
<field type="Testo" width="4" pattern="2" text="Data">
|
||||
<font italic="1" face="Courier New" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="5" type="Data" width="11" pattern="2">
|
||||
<source>#SYSTEM.DATE</source>
|
||||
</field>
|
||||
<field x="165" type="Testo" width="4" pattern="2" text="Pag.">
|
||||
<font italic="1" face="Courier New" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="170" type="Numero" align="right" width="5" pattern="2">
|
||||
<source>#PAGE</source>
|
||||
</field>
|
||||
<field x="0.5" y="2" type="Testo" width="20" pattern="1" text="Ragione sociale" />
|
||||
<field x="20" y="2" type="Stringa" width="50" pattern="1">
|
||||
<source>#SYSTEM.RAGSOC</source>
|
||||
</field>
|
||||
<field x="80" y="2" type="Testo" width="17" pattern="1" text="Codice fiscale" />
|
||||
<field x="99" y="2" type="Stringa" width="16" pattern="1">
|
||||
<prescript description="H0.0 PRESCRIPT">"!CF"
|
||||
GET_FIRM_DATA </prescript>
|
||||
</field>
|
||||
<field x="120" y="2" type="Testo" width="15" pattern="1" text="Partita IVA" />
|
||||
<field x="134.5" y="2" type="Stringa" width="11" pattern="1">
|
||||
<prescript description="H0.0 PRESCRIPT">"!IVA"
|
||||
GET_FIRM_DATA</prescript>
|
||||
</field>
|
||||
<field x="111.5" y="3.5" type="Testo" width="25" pattern="1" text="Credito anno precedente" />
|
||||
<field border="1" y="5" type="Testo" valign="center" align="center" width="13" height="2" pattern="1" text="Mese" />
|
||||
<field border="1" x="13" y="5" type="Testo" valign="center" align="center" width="22" height="2" pattern="1" text="Risultato" />
|
||||
<field border="1" x="35" y="5" type="Testo" valign="center" align="center" width="18" height="2" pattern="1" text="Rimborsi" />
|
||||
<field border="1" x="53" y="5" type="Testo" valign="center" align="center" width="22" height="2" pattern="1" text="Rettifiche" />
|
||||
<field border="1" x="75" y="5" type="Testo" valign="center" align="center" width="18" height="2" pattern="1" text="Credito utilizz. IVA" />
|
||||
<field border="1" x="93" y="5" type="Testo" valign="center" align="center" width="18" height="2" pattern="1" text="Credito utilizz. F24 " />
|
||||
<field border="1" x="111" y="5" type="Testo" valign="center" align="center" width="17" height="2" pattern="1" text="Credito autorizzato" />
|
||||
<field border="1" x="128" y="5" type="Testo" valign="center" align="center" width="12" height="2" pattern="1" text="Data Autorizz." />
|
||||
<field border="1" x="140" y="5" type="Testo" valign="center" align="center" width="18" height="2" pattern="1" text="Credito residuo" />
|
||||
<field border="1" x="158" y="5" type="Testo" valign="center" align="center" width="17" height="2" pattern="1" text="Descrizione" />
|
||||
<field x="48" y="3.5" type="Valuta" hidden="1" align="right" width="18" id="108" pattern="1" text="#########,@@">
|
||||
<prescript description="H0.108 PRESCRIPT">"R0"
|
||||
#FILTER @
|
||||
"%LIA"
|
||||
TABLE_READ</prescript>
|
||||
</field>
|
||||
<field x="78" y="3.5" type="Valuta" hidden="1" align="right" width="18" id="109" pattern="1" text="#########,@@">
|
||||
<prescript description="H0.109 PRESCRIPT">"R15"
|
||||
#FILTER @
|
||||
"%LIA"
|
||||
TABLE_READ</prescript>
|
||||
</field>
|
||||
<field x="139.5" y="3.5" type="Valuta" align="right" width="18" id="110" pattern="1" text="###.###.###,@@">
|
||||
<font face="Courier New" size="8" />
|
||||
<prescript description="H0.110 PRESCRIPT">#108 @
|
||||
#109 @
|
||||
-
|
||||
#THIS !</prescript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Head" level="1" pattern="1" />
|
||||
<section type="Body" pattern="1" />
|
||||
<section type="Body" level="1" pattern="1">
|
||||
<field border="2" type="Linea" pattern="1" />
|
||||
<field border="2" x="13" type="Linea" pattern="1" />
|
||||
<field border="2" x="35" type="Linea" pattern="1" />
|
||||
<field border="2" x="53" type="Linea" pattern="1" />
|
||||
<field border="2" x="75" type="Linea" pattern="1" />
|
||||
<field border="2" x="93" type="Linea" pattern="1" />
|
||||
<field border="2" x="111" type="Linea" pattern="1" />
|
||||
<field border="2" x="128" type="Linea" pattern="1" />
|
||||
<field border="2" x="140" type="Linea" pattern="1" />
|
||||
<field border="2" x="158" type="Linea" pattern="1" />
|
||||
<field border="2" x="175" type="Linea" pattern="1" />
|
||||
<field type="Array" width="13" id="109" pattern="1">
|
||||
<source>CODTAB[5,7]</source>
|
||||
<list>
|
||||
<li Value="Gennaio" Code="01" />
|
||||
<li Value="Febbraio" Code="02" />
|
||||
<li Value="Marzo" Code="03" />
|
||||
<li Value="Aprile" Code="04" />
|
||||
<li Value="Maggio" Code="05" />
|
||||
<li Value="Giugno" Code="06" />
|
||||
<li Value="Luglio" Code="07" />
|
||||
<li Value="Agosto" Code="08" />
|
||||
<li Value="Settembre" Code="09" />
|
||||
<li Value="Ottobre" Code="10" />
|
||||
<li Value="Novembre" Code="11" />
|
||||
<li Value="Dicembre" Code="12" />
|
||||
<li Value="Annuale" Code="13" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="14" type="Valuta" align="right" width="18" id="110" pattern="1" text="###.###.###,@@">
|
||||
<source>R0</source>
|
||||
<prescript description="B1.110 PRESCRIPT">#THIS @
|
||||
0
|
||||
E;
|
||||
IF
|
||||
"D"
|
||||
ELSE
|
||||
0
|
||||
#THIS @
|
||||
-
|
||||
#THIS !
|
||||
"C"
|
||||
THEN
|
||||
#201 !</prescript>
|
||||
</field>
|
||||
<field x="35" type="Valuta" align="right" width="18" id="111" pattern="1" text="###.###.###,@@">
|
||||
<source>R1</source>
|
||||
</field>
|
||||
<field x="54" type="Valuta" align="right" width="18" id="112" pattern="1" text="###.###.###,@@">
|
||||
<source>R5</source>
|
||||
<prescript description="B1.112 PRESCRIPT">#THIS @
|
||||
0
|
||||
E;
|
||||
IF
|
||||
"D"
|
||||
ELSE
|
||||
0
|
||||
#THIS @
|
||||
-
|
||||
#THIS !
|
||||
"C"
|
||||
THEN
|
||||
#202 !</prescript>
|
||||
</field>
|
||||
<field x="75" type="Valuta" align="right" width="18" id="113" pattern="1" text="###.###.###,@@">
|
||||
<source>R15</source>
|
||||
</field>
|
||||
<field x="93" type="Valuta" align="right" width="18" id="114" pattern="1" text="###.###.###,@@">
|
||||
<source>R16</source>
|
||||
</field>
|
||||
<field x="111" type="Valuta" align="right" width="17" id="115" pattern="1" text="###.###.###,@@">
|
||||
<source>R20</source>
|
||||
</field>
|
||||
<field x="128" type="Data" align="center" width="12" id="116" pattern="1">
|
||||
<source>D1</source>
|
||||
</field>
|
||||
<field x="140" type="Valuta" align="right" width="18" id="117" pattern="1" text="###.###.###,@@">
|
||||
<prescript description="B1.117 PRESCRIPT">#H0.110 @
|
||||
#113 @ -
|
||||
#114 @ -
|
||||
#115 @ +
|
||||
DUP
|
||||
#THIS !
|
||||
#H0.110 !</prescript>
|
||||
</field>
|
||||
<field x="158" type="Stringa" dynamic_height="1" width="17" height="3" id="118" pattern="1">
|
||||
<source>S3</source>
|
||||
</field>
|
||||
<field x="33" type="Stringa" width="1" id="201" pattern="1" />
|
||||
<field x="73" type="Stringa" width="1" id="202" pattern="1" />
|
||||
</section>
|
||||
<section hidden_if_needed="1" type="Foot" pattern="1">
|
||||
<field border="2" type="Linea" pattern="1" />
|
||||
<field border="2" x="13" type="Linea" pattern="1" />
|
||||
<field border="2" x="35" type="Linea" pattern="1" />
|
||||
<field border="2" x="53" type="Linea" pattern="1" />
|
||||
<field border="2" x="75" type="Linea" pattern="1" />
|
||||
<field border="2" x="93" type="Linea" pattern="1" />
|
||||
<field border="2" x="111" type="Linea" pattern="1" />
|
||||
<field border="2" x="128" type="Linea" pattern="1" />
|
||||
<field border="2" x="140" type="Linea" pattern="1" />
|
||||
<field border="2" x="158" type="Linea" pattern="1" />
|
||||
<field border="2" x="175" type="Linea" pattern="1" />
|
||||
<field border="2" y="1" type="Linea" width="175" height="0" pattern="1" />
|
||||
</section>
|
||||
<section type="Foot" level="1" pattern="1">
|
||||
<font face="Courier New" bold="1" size="10" />
|
||||
<field border="2" type="Linea" pattern="1" />
|
||||
<field border="2" x="13" type="Linea" pattern="1" />
|
||||
<field border="2" x="35" type="Linea" pattern="1" />
|
||||
<field border="2" x="53" type="Linea" pattern="1" />
|
||||
<field border="2" x="75" type="Linea" pattern="1" />
|
||||
<field border="2" x="93" type="Linea" pattern="1" />
|
||||
<field border="2" x="111" type="Linea" pattern="1" />
|
||||
<field border="2" x="128" type="Linea" pattern="1" />
|
||||
<field border="2" x="140" type="Linea" pattern="1" />
|
||||
<field border="2" x="158" type="Linea" pattern="1" />
|
||||
<field border="2" x="175" type="Linea" pattern="1" />
|
||||
<field border="2" y="1" type="Linea" width="175" height="0" pattern="1" />
|
||||
</section>
|
||||
<sql>USE LIM
|
||||
FROM CODTAB=#ANNO
|
||||
TO CODTAB=#ANNO</sql>
|
||||
</report>
|
129
cg/cg5500b.rep
Normal file
129
cg/cg5500b.rep
Normal file
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report name="cg5500b" page_split="1" lpi="6" command="ba8 -4">
|
||||
<description>Stampa prospetto versamenti</description>
|
||||
<font face="Courier New" size="10" />
|
||||
<section type="Head" pattern="1">
|
||||
<font face="Courier New" bold="1" size="10" />
|
||||
<field type="Stringa" align="center" width="80" height="2" pattern="1">
|
||||
<font face="Arial" bold="1" size="14" />
|
||||
<prescript description="H0.0 PRESCRIPT">"Stampa Prospetto Versamenti "
|
||||
#ANNO @
|
||||
+
|
||||
#THIS !</prescript>
|
||||
</field>
|
||||
<field type="Testo" width="4" pattern="2" text="Data">
|
||||
<font italic="1" face="Courier New" bold="1" size="10" />
|
||||
</field>
|
||||
<field x="5" type="Data" width="11" pattern="2">
|
||||
<source>#SYSTEM.DATE</source>
|
||||
</field>
|
||||
<field x="70" type="Testo" width="4" pattern="2" text="Pag.">
|
||||
<font italic="1" face="Courier New" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="75" type="Numero" align="right" width="5" pattern="2">
|
||||
<font face="Courier New" bold="1" size="8" />
|
||||
<source>#PAGE</source>
|
||||
</field>
|
||||
<field x="1" y="2" type="Testo" width="18" pattern="1" text="Ragione sociale" />
|
||||
<field x="18" y="2" type="Stringa" width="50" pattern="1">
|
||||
<source>#SYSTEM.RAGSOC</source>
|
||||
</field>
|
||||
<field x="1" y="3.5" type="Testo" width="15" pattern="1" text="Codice fiscale" />
|
||||
<field x="15.5" y="3.5" type="Stringa" width="16" pattern="1">
|
||||
<prescript description="H0.0 PRESCRIPT">"!CF"
|
||||
GET_FIRM_DATA </prescript>
|
||||
</field>
|
||||
<field x="32.5" y="3.5" type="Testo" width="13" pattern="1" text="Partita IVA" />
|
||||
<field x="44.5" y="3.5" type="Stringa" width="10" pattern="1">
|
||||
<prescript description="H0.0 PRESCRIPT">"!IVA"
|
||||
GET_FIRM_DATA</prescript>
|
||||
</field>
|
||||
<field border="1" x="10.5" y="5" type="Testo" valign="center" align="center" width="13" height="2" pattern="1" text="Mese" />
|
||||
<field border="1" x="23.5" y="5" type="Testo" valign="center" align="center" width="11" height="2" pattern="1" text="Data" />
|
||||
<field border="1" x="34.5" y="5" type="Testo" valign="center" align="center" width="6" height="2" pattern="1" text="ABI" />
|
||||
<field border="1" x="40.5" y="5" type="Testo" valign="center" align="center" width="6" height="2" pattern="1" text="CAB" />
|
||||
<field border="1" x="46.5" y="5" type="Testo" valign="center" align="center" width="5" height="2" pattern="1" text="Conc." />
|
||||
<field border="1" x="51.5" y="5" type="Testo" valign="center" align="center" width="18" height="2" pattern="1" text="Versamento" />
|
||||
</section>
|
||||
<section type="Head" level="1" pattern="1" />
|
||||
<section type="Body" pattern="1" />
|
||||
<section type="Body" level="1" pattern="1">
|
||||
<field border="2" x="10.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="23.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="34.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="40.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="46.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="51.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="69.5" type="Linea" pattern="1" />
|
||||
<field x="10.5" type="Array" width="13" id="109" pattern="1">
|
||||
<source>CODTAB[10,11]</source>
|
||||
<list>
|
||||
<li Value="Gennaio" Code="01" />
|
||||
<li Value="Febbraio" Code="02" />
|
||||
<li Value="Marzo" Code="03" />
|
||||
<li Value="Aprile" Code="04" />
|
||||
<li Value="Maggio" Code="05" />
|
||||
<li Value="Giugno" Code="06" />
|
||||
<li Value="Luglio" Code="07" />
|
||||
<li Value="Agosto" Code="08" />
|
||||
<li Value="Settembre" Code="09" />
|
||||
<li Value="Ottobre" Code="10" />
|
||||
<li Value="Novembre" Code="11" />
|
||||
<li Value="Dicembre" Code="12" />
|
||||
<li Value="Annuale" Code="13" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="23.5" type="Data" align="center" width="11" id="110" pattern="1">
|
||||
<source>D0</source>
|
||||
</field>
|
||||
<field x="34.5" type="Stringa" align="center" width="6" id="111" pattern="1">
|
||||
<source>S7</source>
|
||||
</field>
|
||||
<field x="40.5" type="Stringa" align="center" width="6" id="112" pattern="1">
|
||||
<source>S8</source>
|
||||
</field>
|
||||
<field x="47.5" type="Stringa" width="3" id="113" pattern="1">
|
||||
<source>S9</source>
|
||||
</field>
|
||||
<field x="51.5" type="Valuta" align="right" width="18" id="114" pattern="1" text="###.###.###,@@">
|
||||
<source>R0</source>
|
||||
<prescript description="B1.114 PRESCRIPT">#THIS @
|
||||
0
|
||||
E;
|
||||
IF
|
||||
"D"
|
||||
ELSE
|
||||
0
|
||||
#THIS @
|
||||
-
|
||||
#THIS !
|
||||
"C"
|
||||
THEN
|
||||
#201 !</prescript>
|
||||
</field>
|
||||
</section>
|
||||
<section hidden_if_needed="1" type="Foot" pattern="1">
|
||||
<field border="2" x="10.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="23.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="34.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="40.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="46.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="51.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="69.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="10.5" y="1" type="Linea" width="59" height="0" pattern="1" />
|
||||
</section>
|
||||
<section type="Foot" level="1" pattern="1">
|
||||
<font face="Courier New" bold="1" size="10" />
|
||||
<field border="2" x="10.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="23.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="34.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="40.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="46.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="51.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="69.5" type="Linea" pattern="1" />
|
||||
<field border="2" x="10.5" y="1" type="Linea" width="59" height="0" pattern="1" />
|
||||
</section>
|
||||
<sql>USE %DEL
|
||||
FROM CODTAB=#FILTER
|
||||
TO CODTAB=#FILTER</sql>
|
||||
</report>
|
102
cg/cg5500b.uml
102
cg/cg5500b.uml
@ -9,6 +9,18 @@ PICTURE TOOL_SAVEREC
|
||||
MESSAGE EXIT,K_SAVE
|
||||
END
|
||||
|
||||
BUTTON DLG_PRINT 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "Stampa"
|
||||
PICTURE TOOL_PRINT
|
||||
END
|
||||
|
||||
BUTTON DLG_SETPRINT 2 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Imposta"
|
||||
PICTURE TOOL_SETPRINT
|
||||
END
|
||||
|
||||
#include <cancelbar.h>
|
||||
|
||||
ENDPAGE
|
||||
@ -39,7 +51,12 @@ END
|
||||
|
||||
CURRENCY F_CREDPREC 15
|
||||
BEGIN
|
||||
PROMPT 1 5 "Credito compensabile inizio anno "
|
||||
PROMPT 1 5 "Credito inizio anno "
|
||||
END
|
||||
|
||||
CURRENCY F_CREDUTILIN 15
|
||||
BEGIN
|
||||
PROMPT 1 6 "Credito utilizzato a inizio anno "
|
||||
END
|
||||
|
||||
SPREADSHEET F_VISLIQ1 -2 -1
|
||||
@ -52,7 +69,9 @@ BEGIN
|
||||
ITEM "IVA rettifiche@15"
|
||||
ITEM "D/C@3"
|
||||
ITEM "Credito\nutilizzato IVA@15"
|
||||
ITEM "Credito\nutilizzato F24@15"
|
||||
ITEM "Credito utilizzato F24@20"
|
||||
ITEM "Credito anno in corso\nautorizzato F24@20"
|
||||
ITEM "Data autorizzazione@20"
|
||||
ITEM "Credito IVA\nresiduo@15"
|
||||
ITEM "Descrizione@50"
|
||||
END
|
||||
@ -93,24 +112,30 @@ END
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
PAGE "Prospetto mensile" -1 -1 50 10
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
|
||||
#include <stdbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Prospetto mensile" -1 -1 75 22
|
||||
|
||||
STRING 101 20
|
||||
BEGIN
|
||||
PROMPT 1 1 "Mese "
|
||||
PROMPT 1 1 "Mese "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
||||
CURRENCY 102 15
|
||||
BEGIN
|
||||
PROMPT 1 2 "Risultato "
|
||||
PROMPT 1 2 "Risultato "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
LIST 103 1 10
|
||||
BEGIN
|
||||
PROMPT 35 2 ""
|
||||
PROMPT 57 2 ""
|
||||
ITEM " | "
|
||||
ITEM "D|Debito"
|
||||
ITEM "C|Credito"
|
||||
@ -119,20 +144,20 @@ END
|
||||
|
||||
CURRENCY 104 15
|
||||
BEGIN
|
||||
PROMPT 1 3 "IVA rimborso "
|
||||
PROMPT 1 3 "IVA rimborso "
|
||||
PICTURE "."
|
||||
GROUP 11
|
||||
END
|
||||
|
||||
CURRENCY 105 15
|
||||
BEGIN
|
||||
PROMPT 1 4 "IVA rettifiche "
|
||||
PROMPT 1 4 "IVA rettifiche "
|
||||
GROUP 11
|
||||
END
|
||||
|
||||
LIST 106 1 10
|
||||
BEGIN
|
||||
PROMPT 35 4 ""
|
||||
PROMPT 57 4 ""
|
||||
ITEM " | "
|
||||
ITEM "D|Debito"
|
||||
ITEM "C|Credito"
|
||||
@ -142,48 +167,62 @@ END
|
||||
|
||||
CURRENCY 107 15
|
||||
BEGIN
|
||||
PROMPT 1 3 "Credito utilizzato IVA "
|
||||
PROMPT 1 5 "Credito utilizzato IVA "
|
||||
FLAGS "D"
|
||||
GROUP 12
|
||||
END
|
||||
|
||||
CURRENCY 108 15
|
||||
BEGIN
|
||||
PROMPT 1 4 "Credito utilizzato F24 "
|
||||
PROMPT 1 6 "Credito utilizzato F24 anno precedente "
|
||||
GROUP 12
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
CURRENCY 109 15
|
||||
BEGIN
|
||||
PROMPT 1 5 "Credito IVA residuo "
|
||||
PROMPT 1 7 "Credito autorizzato F24 anno in corso "
|
||||
GROUP 12
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE 110
|
||||
BEGIN
|
||||
PROMPT 1 8 "Data di autorizzazione "
|
||||
GROUP 12
|
||||
CHECTYPE REQUIRED
|
||||
WARNING "La data è obbligatoria"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
CURRENCY 111 15
|
||||
BEGIN
|
||||
PROMPT 1 9 "Credito IVA residuo "
|
||||
FLAGS "D"
|
||||
GROUP 12
|
||||
END
|
||||
|
||||
STRING 110 50 35
|
||||
STRING 112 50 35
|
||||
BEGIN
|
||||
PROMPT 1 6 "Descr. "
|
||||
PROMPT 1 10 "Descr. "
|
||||
GROUP 12
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -13 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -23 -1 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BUTTON 100 10 2
|
||||
BEGIN
|
||||
PROMPT -33 -1 "Dettaglio"
|
||||
PROMPT -11 -1 "Dettaglio"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
|
||||
#include <stdbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Prospetto versamenti" -1 -1 50 12
|
||||
|
||||
STRING 101 20
|
||||
@ -254,20 +293,9 @@ BEGIN
|
||||
PROMPT 1 6 "Versamenti "
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -13 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -23 -1 ""
|
||||
END
|
||||
|
||||
BUTTON 100 10 2
|
||||
BEGIN
|
||||
PROMPT -33 -1 "Dettaglio"
|
||||
// FLAGS "H"
|
||||
PROMPT -11 -1 "Dettaglio"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
@ -237,6 +237,39 @@ BEGIN
|
||||
PICTURE "."
|
||||
END
|
||||
|
||||
/* gruppo 9: edit credito IVA utilizzato un F24*/
|
||||
|
||||
CURRENCY F_CREDUTIL 15
|
||||
BEGIN
|
||||
PROMPT 2 17 "Credito IVA compensabile detratto in F24 : "
|
||||
GROUP 9
|
||||
FLAGS "H"
|
||||
PICTURE "."
|
||||
END
|
||||
|
||||
/* gruppo 9: edit credito IVA autorizzato in F24 */
|
||||
|
||||
CURRENCY F_CREDAUT 15
|
||||
BEGIN
|
||||
PROMPT 2 17 "Credito IVA autorizzato in F24 : "
|
||||
GROUP 10
|
||||
FLAGS "H"
|
||||
PICTURE "."
|
||||
END
|
||||
|
||||
DATE F_DATAAUT
|
||||
BEGIN
|
||||
PROMPT 50 17 "il "
|
||||
GROUP 10
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING F_DESCR4 60
|
||||
BEGIN
|
||||
PROMPT 2 18 "Descrizione "
|
||||
GROUP 10
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user