COrrezioni liquidazione e visualizzazione

git-svn-id: svn://10.65.10.50/trunk@1545 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-07-03 10:39:38 +00:00
parent 0f26593d44
commit bca2780adb
8 changed files with 230 additions and 186 deletions

View File

@ -1460,6 +1460,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
risultato -= cred_prec; risultato -= cred_prec;
res_cred += cred_prec; res_cred += cred_prec;
} }
} else if (_isdifferita)
{
// TBI gestione struonza
} }
if (month == 13) if (month == 13)
@ -1550,7 +1553,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
* versamenti effettuati: si conteggiano in R0, * versamenti effettuati: si conteggiano in R0,
* sono > 0 solo se andavano calcolati (vedi sopra) * sono > 0 solo se andavano calcolati (vedi sopra)
*/ */
risultato -= (versamenti + vers_int); risultato -= versamenti + vers_int;
/* /*
* acconto dicembre se previsto * acconto dicembre se previsto
*/ */

View File

@ -478,9 +478,33 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
} }
if (create) if (create)
{ {
// vedi se titolare conto fiscale
bool titcf = FALSE;
bool isdel = FALSE;
TLocalisamfile anag(LF_ANAG);
anag.zero();
anag.put("TIPOA", _nditte->lfile().get("TIPOA"));
anag.put("CODANAGR", _nditte->lfile().get("CODANAGR"));
if (anag.read() == NOERR)
{
titcf = anag.get_bool("TITCF");
isdel = anag.get_long("TIPOSTDEL") == 0l;
}
if (!titcf || isdel)
{
// non titolare conto fiscale oppure paga con delega:
// cerca banca
// codici ABI e CAB da anagrafica ditte // codici ABI e CAB da anagrafica ditte
TString abi = _nditte->lfile().get("ABIBAN"); TString abi = _nditte->lfile().get("ABIBAN");
TString cab = _nditte->lfile().get("CABBAN"); TString cab = _nditte->lfile().get("CABBAN");
if (abi.empty())
{
abi = anag.get("CODABI");
abi = anag.get("CODCAB");
}
_del->put("S7", abi); _del->put("S7", abi);
_del->put("S8", cab); _del->put("S8", cab);
@ -495,7 +519,11 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
TString desban(ban.get("S0")); TString desban(ban.get("S0"));
_del->put("S1", desban); _del->put("S1", desban);
} }
}
else
{
// non usa delega bensi' bollettino o distinta:
// cerca concessione comune
// infila ufficio concessione in S9 // infila ufficio concessione in S9
// e descrizione comune in S2 // e descrizione comune in S2
TString16 con; TString uva; TString16 con; TString uva;
@ -504,6 +532,7 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
_del->put("S9", con); _del->put("S9", con);
_del->put("S2", uva); _del->put("S2", uva);
} }
}
// scrive codice tributo // scrive codice tributo
int ctri = 6000; int ctri = 6000;

View File

@ -857,9 +857,12 @@ void TLiquidazione_app::set_firm(_DescrItem& d)
reset_header(); reset_header();
if (!_isregis)
{
set_header(1,"Ditta %s %s@109gData @<@125gPag. @#", set_header(1,"Ditta %s %s@109gData @<@125gPag. @#",
(const char*)(d._s0), (const char*)(d._s1)); (const char*)(d._s0), (const char*)(d._s1));
set_header(2,""); set_header(2,"");
}
set_header(3,sep); set_header(3,sep);
set_header(4,"%s@102gFrequenza %s", set_header(4,"%s@102gFrequenza %s",
(const char*)tim_title, (const char*)tim_title,
@ -934,9 +937,12 @@ void TLiquidazione_app::set_att(_DescrItem& d)
(const char*)tipatt); (const char*)tipatt);
reset_header(); reset_header();
if (!_isregis)
{
set_header(1,"Ditta %s %s@109gData @<@125gPag. @#", set_header(1,"Ditta %s %s@109gData @<@125gPag. @#",
(const char*)(d._s0), (const char*)(d._s1)); (const char*)(d._s0), (const char*)(d._s1));
set_header(2,""); set_header(2,"");
}
set_header(3,sep); set_header(3,sep);
set_header(4,"%s@55g%s", (const char*)tim_title, (const char*)att_title); set_header(4,"%s@55g%s", (const char*)tim_title, (const char*)att_title);
set_header(5,sep); set_header(5,sep);
@ -956,6 +962,8 @@ void TLiquidazione_app::set_att(_DescrItem& d)
void TLiquidazione_app::set_plafond(_DescrItem& d) void TLiquidazione_app::set_plafond(_DescrItem& d)
{ {
if (_isregis) return;
set_bookmark("Quadro plafond", _att_bookmark); set_bookmark("Quadro plafond", _att_bookmark);
real r1 = d._r2 - d._r1 - d._r0; real r1 = d._r2 - d._r1 - d._r0;
@ -1012,13 +1020,14 @@ void TLiquidazione_app::set_pim(_DescrItem& d)
{ {
look_iva(d._s1); look_iva(d._s1);
d._s2 = _iva->get("S0"); d._s2 = _iva->get("S0");
if (d._s2.len() > 19) d._s2.cut(19);
} }
if (d._f0) // e' il primo: non fa piu' nulla perche' l'intestazione if (d._f0) // e' il primo: non fa piu' nulla perche' l'intestazione
// viene fatta comunque da set_pim_head // viene fatta comunque da set_pim_head
{} {}
set_row(rw++,"%4s %-20s@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r", set_row(rw++,"%4s %s@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r",
(const char*)d._s1, (const char*)d._s1,
(const char*)d._s2, (const char*)d._s2,
&(d._r0), &(d._r0),

View File

@ -157,8 +157,10 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
if (look_lim(month)) if (look_lim(month))
{ {
real topay = result_liq(month); real topay = result_liq(month); // TBC non si puo' fa' accussi'!!!!! pena il casino!
topay += _lim->get_real("R14"); real intr = _lim->get_real("R14");
topay += intr; // lo vogliono registrato con interessi
real nrnd = topay;
topay.round(-3); topay.round(-3);
if (!topay.is_zero()) if (!topay.is_zero())
@ -169,14 +171,15 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
tt->add(_freqviva); tt->add(_freqviva);
tt->add(topay.string()); tt->add(topay.string());
tt->add(""); tt->add("");
// tt->add(intr.string()); // tt->add(intr.string());
} }
if (topay.sign() > 0) if (topay.sign() > 0)
{ {
look_del(month, _isannual ? 2 : 1, TRUE); look_del(month, _isannual ? 2 : 1, TRUE);
_del->put("R0",topay); _del->put("R0",topay);
// _del->put("R1",intr); _del->put("R1",intr);
_del->put("R2",nrnd); // non arrotondato, per calcolo risultato a debito/cr
_del->rewrite(); _del->rewrite();
tt->add(_del->get("S7")); tt->add(_del->get("S7"));
@ -199,7 +202,6 @@ bool TLiquidazione_app::set_acconto(real& inf, real& ina)
TMask m("cg4300c.msk"); TMask m("cg4300c.msk");
m.set(CHK_CGC_PRINT,"X"); m.set(CHK_CGC_PRINT,"X");
m.field(FLD_CGC_YEAR).set_handler(ch_year_handler); m.field(FLD_CGC_YEAR).set_handler(ch_year_handler);
int k = 0; long j; int k = 0; long j;
_calcall = FALSE; _calcall = FALSE;
@ -382,8 +384,8 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
} }
_year = thyear; _year = thyear;
} }
else if (_basecalc == incorso) else if (_basecalc == incorso)
{ {
// that's pazzesc but as it turns out there's no better way // that's pazzesc but as it turns out there's no better way
_comp_acconto = TRUE; _comp_acconto = TRUE;
// force recalc of current month // force recalc of current month
@ -398,40 +400,39 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
bc = result_liq(12); bc = result_liq(12);
// somma i non fatturati/non annotati // somma i non fatturati/non annotati
bc += inf + ina; bc += inf + ina;
if (bc.sign() > 0) if (bc.sign() > 0) acc = bc;
acc = bc * ACCONTO_DICEMBRE;
} }
else error = 1; else error = 1;
// pulisci il water // pulisci il water
_comp_acconto = FALSE; _comp_acconto = FALSE;
update_firm(12); update_firm(12);
} }
// sbatti l'acconto in LIA // sbatti l'acconto in LIA
if (look_lia()) if (look_lia())
{ {
_lia->put("R4",acc); _lia->put("R4",acc);
isdifferita = _lia->get_bool("B1"); isdifferita = _lia->get_bool("B1");
_lia->rewrite(); _lia->rewrite();
} }
bool wasdel = look_del(12,7); bool wasdel = look_del(12,7);
if (acc.sign() > 0 && acc > ACCONTO_MINIMO_DA_VERSARE) if (acc.sign() > 0 && acc > ACCONTO_MINIMO_DA_VERSARE)
{ {
// crea o aggiorna delega // crea o aggiorna delega
// TBC everything // TBC everything
look_del(12,7,TRUE); look_del(12,7,TRUE);
_del->put("R0", acc); _del->put("R0", acc);
_del->rewrite(); _del->rewrite();
} }
else if (wasdel) else if (wasdel)
_del->remove(); _del->remove();
// per questa volta lasciamo perdere la describe_acconto // per questa volta lasciamo perdere la describe_acconto
if (_isprint) if (_isprint)
{ {
// segnalazioni di errore da gesticolare: // segnalazioni di errore da gesticolare:
// error = 0: no error // error = 0: no error
// error = 1: manca tabella risultati liquidazione per l'anno indicato // error = 1: manca tabella risultati liquidazione per l'anno indicato
@ -447,6 +448,6 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
d->_s0 = _nditte->curr().get("CODDITTA"); d->_s0 = _nditte->curr().get("CODDITTA");
d->_s1 = _nditte->curr().get("RAGSOC"); d->_s1 = _nditte->curr().get("RAGSOC");
_descr_arr.add(d); _descr_arr.add(d);
} }
return TRUE; return TRUE;
} }

View File

@ -602,7 +602,7 @@ bool Visliq_app::vis_one(int m)
if (is_delega = look_del(m,1)) if (is_delega = look_del(m,1))
{ {
vers = _del->get_real("R0") /* + _del->get_real("R1") */; vers = _del->get_real("R0");
date = _del->get_date("D0"); date = _del->get_date("D0");
abi = _del->get("S7"); abi = _del->get("S7");
cab = _del->get("S8"); cab = _del->get("S8");
@ -941,6 +941,7 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
_lim->put("R0", risl); _lim->put("R0", risl);
_lim->put("R12", risc); _lim->put("R12", risc);
_lim->put("R13", risd); _lim->put("R13", risd);
// interessi // interessi
if (intt.sign() > 0) if (intt.sign() > 0)
{ {
@ -972,13 +973,14 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
} }
// se non si fa questa non scrive una delega, // se non si fa questa non scrive una delega,
// bensi' una bovazza // bensi' una bovazza (escremento bovino)
look_lim(start_month); look_lim(start_month);
} }
void Visliq_app::write_liq() void Visliq_app::write_liq()
{ {
// piccola, ma simpatica // piccola, ma simpatica
// naturalmente era much bigger
_lim->rewrite(); _lim->rewrite();
} }
@ -1080,7 +1082,7 @@ void Visliq_app::read_general(TMask& m)
if (m >= 12) if (m >= 12)
m = tipod == 7 ? 12 : 13; m = tipod == 7 ? 12 : 13;
versamenti[m-1] += _del->get_real("R0") + _del->get_real("R1"); versamenti[m-1] += _del->get_real("R0");
date[m-1] = _del->get_date("D0"); date[m-1] = _del->get_date("D0");
banche[m-1].add(_del->get("S7"),0); banche[m-1].add(_del->get("S7"),0);
banche[m-1].add(_del->get("S8"),1); banche[m-1].add(_del->get("S8"),1);

View File

@ -104,7 +104,7 @@ public:
bool vis_all(); bool vis_all();
bool vis_one(int); bool vis_one(int);
Visliq_app() : TApplication() {} Visliq_app() : TApplication(), _vers_sheet(NULL), _liq_sheet(NULL) {}
virtual ~Visliq_app() {} virtual ~Visliq_app() {}
}; };

View File

@ -173,18 +173,18 @@ PAGE "Prospetto versamenti" -1 -1 50 12
STRING 101 20 STRING 101 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 1 "Mese "
FLAGS "D" FLAGS "D"
END END
DATE 102 DATE 102
BEGIN BEGIN
PROMPT 1 5 "Data " PROMPT 1 2 "Data "
END END
NUMBER 103 5 NUMBER 103 5
BEGIN BEGIN
PROMPT 4 8 "Codice ABI " PROMPT 1 3 "Codice ABI "
HELP "Codice ABI banca di appoggio" HELP "Codice ABI banca di appoggio"
FIELD S7 FIELD S7
FLAGS "RZ" FLAGS "RZ"
@ -202,7 +202,7 @@ END
NUMBER 104 5 NUMBER 104 5
BEGIN BEGIN
PROMPT 40 8 "Codice CAB " PROMPT 1 4 "Codice CAB "
HELP "Codice CAB banca di appoggio" HELP "Codice CAB banca di appoggio"
FIELD S8 FIELD S8
FLAGS "RZ" FLAGS "RZ"
@ -214,7 +214,7 @@ END
NUMBER 105 3 NUMBER 105 3
BEGIN BEGIN
PROMPT 4 9 "Concessione " PROMPT 1 5 "Concessione "
HELP "Codice Concessione del Comune di residenza fiscale" HELP "Codice Concessione del Comune di residenza fiscale"
// FIELD S9 // FIELD S9
FLAGS "RZ" FLAGS "RZ"
@ -223,15 +223,15 @@ END
NUMBER 106 15 0 NUMBER 106 15 0
BEGIN BEGIN
PROMPT 1 4 "Versamenti " PROMPT 1 6 "Versamenti "
FLAGS "R" FLAGS "R"
PICTURE "." PICTURE "."
END END
/* /*
LIST 107 1 8 LIST 107 1 10
BEGIN BEGIN
PROMPT 1 9 "Importo a " PROMPT 1 7 "Importo a "
ITEM " | " ITEM " | "
ITEM "D|Debito" ITEM "D|Debito"
ITEM "C|Credito" ITEM "C|Credito"

View File

@ -81,21 +81,21 @@ PAGE "Prospetto mensile" -1 -1 50 10
STRING 101 20 STRING 101 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 1 "Mese "
FLAGS "D" FLAGS "D"
END END
NUMBER 102 15 0 NUMBER 102 15 0
BEGIN BEGIN
PROMPT 1 3 "Risultato " PROMPT 1 2 "Risultato "
FLAGS "DR" FLAGS "DR"
PICTURE "." PICTURE "."
END END
LIST 103 1 8 LIST 103 1 10
BEGIN BEGIN
PROMPT 1 4 "Importo a " PROMPT 1 3 "Importo a "
ITEM " | " ITEM " | "
ITEM "D|Debito" ITEM "D|Debito"
ITEM "C|Credito" ITEM "C|Credito"
@ -106,21 +106,21 @@ END
NUMBER 104 15 NUMBER 104 15
BEGIN BEGIN
PROMPT 22 5 "IVA a rimborso " PROMPT 1 4 "IVA a rimborso "
FLAGS "R" FLAGS "R"
PICTURE "." PICTURE "."
END END
NUMBER 105 15 NUMBER 105 15
BEGIN BEGIN
PROMPT 22 6 "Debito/Credito " PROMPT 1 5 "Debito/Credito "
FLAGS "R" FLAGS "R"
PICTURE "." PICTURE "."
END END
LIST 106 1 8 LIST 106 1 8
BEGIN BEGIN
PROMPT 1 7 "Importo a " PROMPT 1 6 "Importo a "
ITEM " | " ITEM " | "
ITEM "D|Debito" ITEM "D|Debito"
ITEM "C|Credito" ITEM "C|Credito"
@ -151,18 +151,18 @@ PAGE "Prospetto versamenti" -1 -1 50 12
STRING 101 20 STRING 101 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 1 "Mese "
FLAGS "D" FLAGS "D"
END END
DATE 102 DATE 102
BEGIN BEGIN
PROMPT 1 5 "Data " PROMPT 1 2 "Data "
END END
NUMBER 103 5 NUMBER 103 5
BEGIN BEGIN
PROMPT 4 8 "Codice ABI " PROMPT 1 3 "Codice ABI "
HELP "Codice ABI banca di appoggio" HELP "Codice ABI banca di appoggio"
FIELD S7 FIELD S7
FLAGS "RZ" FLAGS "RZ"
@ -180,7 +180,7 @@ END
NUMBER 104 5 NUMBER 104 5
BEGIN BEGIN
PROMPT 40 8 "Codice CAB " PROMPT 1 4 "Codice CAB "
HELP "Codice CAB banca di appoggio" HELP "Codice CAB banca di appoggio"
FIELD S8 FIELD S8
FLAGS "RZ" FLAGS "RZ"
@ -192,7 +192,7 @@ END
NUMBER 105 3 NUMBER 105 3
BEGIN BEGIN
PROMPT 4 9 "Concessione " PROMPT 1 5 "Concessione "
HELP "Codice Concessione del Comune di residenza fiscale" HELP "Codice Concessione del Comune di residenza fiscale"
// FIELD S9 // FIELD S9
FLAGS "RZ" FLAGS "RZ"
@ -201,7 +201,7 @@ END
NUMBER 106 15 0 NUMBER 106 15 0
BEGIN BEGIN
PROMPT 1 4 "Versamenti " PROMPT 1 6 "Versamenti "
FLAGS "R" FLAGS "R"
PICTURE "." PICTURE "."
END END
@ -209,7 +209,7 @@ END
/* /*
LIST 107 1 8 LIST 107 1 8
BEGIN BEGIN
PROMPT 1 9 "Importo a " PROMPT 1 7 "Importo a "
ITEM "D|Debito" ITEM "D|Debito"
ITEM "C|Credito" ITEM "C|Credito"
INPUT 104 INPUT 104