Liquidazione e visualizzazione e classificazione
git-svn-id: svn://10.65.10.50/trunk@1968 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4d5fee2b55
commit
3e6569f09e
@ -165,7 +165,9 @@ public:
|
||||
|
||||
class _ErrItem : public TObject
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
TString _err;
|
||||
TString _att;
|
||||
TString _firm;
|
||||
@ -183,7 +185,7 @@ class TLiquidazione_app : public TPrint_application
|
||||
TArray_sheet* _ditte;
|
||||
wht _what;
|
||||
TBit_array _selected;
|
||||
int _menu; // 1 = Liquidazione, 2 = Deleghe, 3 = Deleghe
|
||||
int _menu; // 1 = Liquidazione, 2 = Deleghe, 3 =
|
||||
TString _year; // anno di calcolo
|
||||
int _month; // mese da calcolare
|
||||
TDate _date; // data di stampa
|
||||
@ -234,6 +236,8 @@ class TLiquidazione_app : public TPrint_application
|
||||
bool _is_interactive; // lanciata da menu o da altro prog
|
||||
bool _is_visliq; // lanciata da visualizzazione liquidazione
|
||||
|
||||
int _monthinatt; // mese inizio attivita' (serve per differita)
|
||||
|
||||
static real CENTO;
|
||||
|
||||
// main cursor
|
||||
@ -436,7 +440,7 @@ public:
|
||||
void set_plm(_DescrItem& d);
|
||||
bool set_annual(_DescrItem& d);
|
||||
void set_grand(_DescrItem& d);
|
||||
void set_pim_head();
|
||||
void set_pim_head(_DescrItem& d);
|
||||
void set_liqacc(_DescrItem& d);
|
||||
|
||||
// cercapalle in tabelle con opzione di creazione se serve
|
||||
|
@ -155,11 +155,13 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
_isintr = !cnf.get_bool("InTrTr") && _freqviva != "M";
|
||||
bool gest4 = FALSE; //usato alla riga 342 per stampa acconto
|
||||
if (_isbenzinaro)
|
||||
_gest4 = cnf.get_bool("GesT74");
|
||||
gest4 = cnf.get_bool("GesT74");
|
||||
// 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;
|
||||
TDate inatt(_nditte->lfile().get("DINIZIOATT"));
|
||||
if (is_in_liq_period(inatt)) _isdifferita = FALSE;
|
||||
if (inatt.year() == atoi(_year)) _monthinatt = inatt.month();
|
||||
|
||||
TConfig cnf1(CONFIG_STUDIO, "cg");
|
||||
_isricacq = cnf1.get_bool("RicAcq");
|
||||
@ -333,16 +335,16 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
//describe_liq(_month, atts, _isregis ? NULL : rimb_d);
|
||||
describe_liq(_month, atts, rimb_d);
|
||||
}
|
||||
|
||||
|
||||
//in caso di stampa registri e in caso sia
|
||||
//stato calcolato l'acconto (metodo analitico)
|
||||
//deve essere stampato il prospetto di liquidazione
|
||||
//dell'acconto in coda al resto
|
||||
if (_isregis && stliq)
|
||||
if ((month == 12 && _freqviva == "M") ||
|
||||
(month == 12 && _isbenzinaro && _gest4) ||
|
||||
(month == 12 && _isbenzinaro && gest4) ||
|
||||
(_isannual && _freqviva == "T" && !_isbenzinaro) ||
|
||||
(_isannual && _isbenzinaro && !_gest4))
|
||||
(_isannual && _isbenzinaro && !gest4))
|
||||
describe_liqacc();
|
||||
}
|
||||
return ok || calc;
|
||||
@ -502,6 +504,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
TString16 reg = _mov->get("REG");
|
||||
bool isreg = look_reg(_mov->get("REG"));
|
||||
TString16 tipodoc = _mov->get("TIPODOC");
|
||||
bool corrisp = _reg->get_bool("B0");
|
||||
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
||||
|
||||
if (_isviaggio && tipomov == vendita && !(_mov->get("DATA74TER").empty()))
|
||||
date = _mov->get_date("DATA74TER");
|
||||
|
||||
/*
|
||||
* check register present, rmoviva present and date OK
|
||||
*/
|
||||
@ -540,9 +548,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
if (!_isdifferita && date.day() > 20)
|
||||
continue;
|
||||
|
||||
bool corrisp = _reg->get_bool("B0");
|
||||
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
||||
|
||||
do
|
||||
{
|
||||
look_iva(_rmoviva->get("CODIVA"));
|
||||
@ -693,9 +698,16 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
* Comprende anche autofatture, anche nell'annuale
|
||||
* (Sergio 1995)
|
||||
*/
|
||||
{
|
||||
cess_amm += imponibile;
|
||||
cess_amm_iva += imposta;
|
||||
{
|
||||
/* NO!
|
||||
* Invece non le deve comprendere nell'annuale
|
||||
* (Vladimiro 1995, piu' tardi)
|
||||
*/
|
||||
if (!(_month == 13 && autodafe))
|
||||
{
|
||||
cess_amm += imponibile;
|
||||
cess_amm_iva += imposta;
|
||||
}
|
||||
}
|
||||
else if (tipomov == acquisto && tipocr == 8)
|
||||
// Acquisto beni strum. acquisiti in leasing
|
||||
@ -703,7 +715,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
leasing += imponibile;
|
||||
leasing_iva += imposta;
|
||||
}
|
||||
else if (tipomov == acquisto && tipocr == 9)
|
||||
else if (tipomov == acquisto && tipocr == 9)
|
||||
// Spese generali
|
||||
{
|
||||
spgen += imponibile;
|
||||
@ -1274,7 +1286,14 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
// Calcolo liq. mensili e liq. annuali
|
||||
{
|
||||
TToken_string atts(codatts);
|
||||
const char* tmpatt;
|
||||
const char* tmpatt;
|
||||
|
||||
// evita casino se differita ma si sta ricalcolando il primo
|
||||
// mese con ricalcolo di piu' mesi
|
||||
bool wasdifferita = (_isdifferita && month <= _monthinatt &&
|
||||
_month > _monthinatt);
|
||||
|
||||
if (wasdifferita) _isdifferita = FALSE;
|
||||
|
||||
// liq. differita: considera mese precedente (solo per i risultati)
|
||||
int deltam = month;
|
||||
@ -1562,6 +1581,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
look_pla(att, TRUE);
|
||||
_pla->put("R8", prorata);
|
||||
_pla->rewrite();
|
||||
look_lia();
|
||||
_lia->put("R5", cred_cost);
|
||||
_lia->rewrite();
|
||||
_year = yr;
|
||||
}
|
||||
}
|
||||
@ -1573,7 +1595,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
/***08/09/1995
|
||||
_lia->put("R4", acc_dec);
|
||||
***/
|
||||
_lia->put("R5", cred_cost);
|
||||
_lia->rewrite();
|
||||
}
|
||||
|
||||
@ -1612,14 +1633,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
/*
|
||||
* acconto dicembre se previsto
|
||||
*/
|
||||
/*
|
||||
if ((month == 12 && _isbenzinaro) ||
|
||||
(month >= 12 && _freqviva == "M"))
|
||||
*/
|
||||
if ((month == 12 && _freqviva == "M") ||
|
||||
(month == 12 && _isbenzinaro && _gest4) ||
|
||||
(_isannual && _freqviva == "T" && !_isbenzinaro) ||
|
||||
(_isannual && _isbenzinaro && !_gest4))
|
||||
{
|
||||
risultato -= versamenti_IVA(12,"7");
|
||||
acc_dec = versamenti_IVA(12,"7");
|
||||
@ -1655,8 +1670,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
* Ora gestito esplicitamente nei parametri ditta, forzato
|
||||
* FALSE per ditte mensili e liq. annuale
|
||||
*/
|
||||
//if (_isintr && month < 13)
|
||||
if ((_isintr && ((month != 12 || (_isbenzinaro && !_gest4)))))
|
||||
if (_isintr && month < 13)
|
||||
{
|
||||
real interesse = interesse_trimestrale(_month);
|
||||
real ivi = risultato * (interesse / CENTO);
|
||||
@ -1665,8 +1679,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
}
|
||||
|
||||
// questo serve anche per la visualizzazione e per l'estrazione deleghe
|
||||
//if (_isintr && month < 13)
|
||||
if ((_isintr && ((month != 12 || (_isbenzinaro && !_gest4)))))
|
||||
if (_isintr && month < 13)
|
||||
_lim->put("R10",interesse_trimestrale(_month));
|
||||
|
||||
// totale conguaglio su tutte le attivita'
|
||||
@ -1685,7 +1698,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
if (!_recalc_only)
|
||||
_lim->put("B0","X");
|
||||
if (_isfinal) _lim->put("B1", "X");
|
||||
|
||||
|
||||
if (wasdifferita) _isdifferita = TRUE;
|
||||
|
||||
_lim->rewrite();
|
||||
_lam->rewrite();
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ real TLiquidazione_app::credito_costo_prec(int month)
|
||||
// (travel agency only)
|
||||
{
|
||||
real c(0.0);
|
||||
if (is_first_month(month))
|
||||
if (is_first_month(month) || month == 13)
|
||||
{
|
||||
// credito inizio anno
|
||||
if (look_lia())
|
||||
|
@ -46,7 +46,7 @@ void TLiquidazione_app::set_page(int file, int cnt)
|
||||
set_pim(d);
|
||||
break;
|
||||
case PIM_HEAD:
|
||||
set_pim_head();
|
||||
set_pim_head(d);
|
||||
break;
|
||||
case MISC_LIQ:
|
||||
set_pumpam(d);
|
||||
@ -399,6 +399,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
||||
// chiarezza, una peggiore efficienza, una gran rottura di coglioni,
|
||||
// ma risulta identico al dio Sistema.
|
||||
_DescrItem* hea = new _DescrItem(PIM_HEAD);
|
||||
hea->_f0 = skip_acq; // cosi' non compare nemmeno la colonnina! contento?
|
||||
_descr_arr.add(hea);
|
||||
|
||||
while ((tmpatt = atts.get()) != NULL)
|
||||
@ -809,7 +810,7 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
||||
|
||||
if (!_is_visliq)
|
||||
{
|
||||
_DescrItem* dv = describe_deleghe(month);
|
||||
_DescrItem* dv = describe_deleghe(month);
|
||||
if (dv != NULL) d->_arr.add(dv);
|
||||
}
|
||||
_descr_arr.add(d);
|
||||
@ -850,7 +851,7 @@ _DescrItem* TLiquidazione_app::describe_deleghe(int month)
|
||||
d->_d0 = _del->get_date("D0");
|
||||
} // altrimenti lascia tutto in bianco e ci scriveranno i dati a mano
|
||||
}
|
||||
|
||||
|
||||
if (look_del(month,7))
|
||||
{
|
||||
d->_s4 = "ACC";
|
||||
@ -1134,12 +1135,20 @@ void TLiquidazione_app::set_liqacc(_DescrItem& d)
|
||||
set_auto_ff();
|
||||
}
|
||||
|
||||
void TLiquidazione_app::set_pim_head()
|
||||
void TLiquidazione_app::set_pim_head(_DescrItem& d)
|
||||
{
|
||||
set_bookmark("Riepilogo progressivi", _att_bookmark);
|
||||
set_row(1," Cod.@41gVENDITE@71gCORRISPETTIVI@106gACQUISTI");
|
||||
set_row(2," IVA Descrizione@30gImponibile@49gImposta@63gImponibile"
|
||||
"@82gImposta@96gImponibile@115gImposta");
|
||||
set_bookmark("Riepilogo progressivi", _att_bookmark);
|
||||
if (d._f0)
|
||||
{
|
||||
set_row(1," Cod.@41gVENDITE@71gCORRISPETTIVI");
|
||||
set_row(2," IVA Descrizione@30gImponibile@49gImposta@63gImponibile@82gImposta");
|
||||
}
|
||||
else
|
||||
{
|
||||
set_row(1," Cod.@41gVENDITE@71gCORRISPETTIVI@106gACQUISTI");
|
||||
set_row(2," IVA Descrizione@30gImponibile@49gImposta@63gImponibile"
|
||||
"@82gImposta@96gImponibile@115gImposta");
|
||||
}
|
||||
set_row(3,"");
|
||||
}
|
||||
|
||||
@ -1596,7 +1605,7 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
TString vr = di._r0.string("###.###.###.###");
|
||||
|
||||
// la cincia non vuole lo zero
|
||||
if (atof(vr) == 0.0 && vr[vr.len()-1] == '0') vr[vr.len()-1] = ' ';
|
||||
if (atof(vr) == 0.0 && vr[vr.len()-1] == '0') vr[vr.len()-1] = ' ';
|
||||
|
||||
//11/10/1995
|
||||
if (di._s4 == "ACC")
|
||||
@ -1624,13 +1633,14 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
set_row(rw++, "- SALDO -");
|
||||
}
|
||||
//fine
|
||||
|
||||
set_row(rw++, "Versamento di L. %s effettuato il %s@68gdiretto all'ufficio IVA di %s",
|
||||
(const char*)vr,
|
||||
(const char*)dt,
|
||||
(const char*)(di._s0));
|
||||
set_row(rw++, "@68gtramite %s", (const char*)(di._s1));
|
||||
set_row(rw++, "@68gcodice azienda %s codice dipendenza %s",
|
||||
(const char*)(di._s2), (const char*)(di._s3));
|
||||
(const char*)(di._s2), (const char*)(di._s3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ END
|
||||
|
||||
BOOLEAN CHK_INTRTR
|
||||
BEGIN
|
||||
PROMPT 3 12 "Calcolare interessi per frequenza versamenti trimestrale"
|
||||
PROMPT 3 12 "Non calcolare interessi per frequenza versamenti trimestrale"
|
||||
HELP "Se selezionato, gli interessi non vengono calcolati"
|
||||
FIELD InTrTr
|
||||
END
|
||||
|
@ -351,7 +351,7 @@ bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
|
||||
if (sh.items() == 4) month *= 3;
|
||||
|
||||
bool ok = FALSE;
|
||||
if (m.dirty())
|
||||
if (m.dirty() || sh.sheet_mask().dirty())
|
||||
{
|
||||
KEY k = yesnocancel_box("Registrazione modifiche effettuate?");
|
||||
if (k == K_YES)
|
||||
@ -697,8 +697,8 @@ bool Visliq_app::vis_one(int m)
|
||||
bool ok = TRUE;
|
||||
if (!n_rimborso.is_zero())
|
||||
{
|
||||
// check diritto
|
||||
if (!_lim->get_bool("B2"))
|
||||
// check diritto (se non ce n'era gia' uno prima)
|
||||
if (!_lim->get_bool("B2") && rimborso.is_zero())
|
||||
ok = yesno_box("Non risulta diritto al rimborso per il mese %d. Si desidera "
|
||||
"confermare ugualmente?", m);
|
||||
}
|
||||
@ -1063,7 +1063,8 @@ void Visliq_app::write_del()
|
||||
|
||||
if (vers.is_zero() && (wasdel = look_del(month,1)))
|
||||
{
|
||||
_del->remove();
|
||||
_del->remove();
|
||||
_del->rewrite();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1074,7 +1075,7 @@ void Visliq_app::write_del()
|
||||
if (!intr.is_zero())
|
||||
{
|
||||
// riapplica il tasso di interesse
|
||||
// se trimstrale e' stato scorporato rispetto
|
||||
// se trimestrale e' stato scorporato rispetto
|
||||
// all'eventuale input utente
|
||||
inter = vers*(real(100.0)/(real(100.0)+intr));
|
||||
inter = vers - inter;
|
||||
|
@ -89,9 +89,9 @@ BEGIN
|
||||
PROMPT 1 5 "Versamenti"
|
||||
ITEM "Mese@15"
|
||||
ITEM "Data@10"
|
||||
ITEM "Azienda@5"
|
||||
ITEM "Dipend.@5"
|
||||
ITEM "Concess.@5"
|
||||
ITEM "ABI@5"
|
||||
ITEM "CAB@5"
|
||||
ITEM "Conc.@5"
|
||||
ITEM "Versamenti@15"
|
||||
// ITEM "D/C"
|
||||
END
|
||||
|
@ -67,9 +67,9 @@ BEGIN
|
||||
PROMPT 1 12 "Versamenti"
|
||||
ITEM "Mese@10"
|
||||
ITEM "Data@10"
|
||||
ITEM "Azienda@5"
|
||||
ITEM "Dipend.@5"
|
||||
ITEM "Concess.@5"
|
||||
ITEM "ABI@5"
|
||||
ITEM "CAB@5"
|
||||
ITEM "Conc.@5"
|
||||
ITEM "Versamenti@15"
|
||||
// ITEM "D/C"
|
||||
END
|
||||
|
@ -38,8 +38,8 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
|
||||
tipodet == 5 || tipodet == 9 */);
|
||||
if (found)
|
||||
{
|
||||
imp = pimr.get_real("R0") - pimr.get_real("R9");
|
||||
iva = pimr.get_real("R1") - pimr.get_real("R10");
|
||||
imp = pimr.get_real("R0") /* - pimr.get_real("R9") */; // comprese BD!
|
||||
iva = pimr.get_real("R1") /* - pimr.get_real("R10") */; // yuk yuk!
|
||||
}
|
||||
break;
|
||||
case vend_norm:
|
||||
|
Loading…
x
Reference in New Issue
Block a user