Aggiunta stampa acconti in coda a stampa registri e correzioni varie
git-svn-id: svn://10.65.10.50/trunk@1919 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ba64f9d51e
commit
538add6ec9
@ -234,6 +234,7 @@ bool TLiquidazione_app::user_create()
|
||||
to.put(MOV_DATAREG, t);
|
||||
_cur->setregion(from, to);
|
||||
_canprint = is_month_ok_strict(_month) || _month == 13;
|
||||
_isannual = _isriepilogo = _month == 13;
|
||||
|
||||
//modifica del 03/05/1995
|
||||
int need_refresh = FALSE;
|
||||
|
@ -99,6 +99,7 @@ enum tbc { precedente = 1, incorso = 2};
|
||||
#define DELCRED 16 // header tabulato deleghe ditte a credito
|
||||
#define DELEGA 17 // descrizione versamenti
|
||||
#define PIM_HEAD 18 // bytes sprecati per far vedere l'intestazione pim
|
||||
#define LIQACC 19 // prospetto liquidazione acconto
|
||||
|
||||
// ...............................................................
|
||||
// support structs
|
||||
@ -203,7 +204,8 @@ class TLiquidazione_app : public TPrint_application
|
||||
bool _isservizio; // servizi, professionisti, artisti
|
||||
bool _isrimborso; // vuole il rimborso infraannuale
|
||||
bool _isricacq; // ricalcolo imposte acq. riv (par. ditta)
|
||||
bool _isdifferita; // liquidazione differita
|
||||
bool _isdifferita; // liquidazione differita e mese != 13
|
||||
bool _isdiffacc; // liq. differita (usato per stampa registri)
|
||||
bool _recalc_only; // solo ricalcolo progressivi
|
||||
bool _calcall; // tutte le ditte nessuna esclusa
|
||||
bool _isbase; // stampa base di calcolo acconto
|
||||
@ -388,6 +390,7 @@ public:
|
||||
void describe_error(const char* errstr, const char* codatt);
|
||||
void describe_annual(const char* codatt);
|
||||
void describe_consistence(const char* codatt);
|
||||
void describe_liqacc();
|
||||
|
||||
_DescrItem* describe_deleghe(int month);
|
||||
|
||||
@ -433,6 +436,7 @@ public:
|
||||
bool set_annual(_DescrItem& d);
|
||||
void set_grand(_DescrItem& d);
|
||||
void set_pim_head();
|
||||
void set_liqacc(_DescrItem& d);
|
||||
|
||||
// cercapalle in tabelle con opzione di creazione se serve
|
||||
bool look_pim(int m, const char* a, const char* r, const char* cr,
|
||||
|
@ -150,8 +150,12 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
return TRUE;
|
||||
|
||||
TConfig cnf(CONFIG_DITTA, "cg");
|
||||
_isdifferita = cnf.get_bool("GeLiDi") && _month != 13;
|
||||
_isdiffacc = cnf.get_bool("GeLiDi"); //usato per stampa acconto in coda ai registri
|
||||
_isdifferita = _isdiffacc && _month != 13;
|
||||
_isintr = !cnf.get_bool("InTrTr") && _freqviva != "M";
|
||||
bool gest4 = FALSE; //usato alla riga 342 per stampa acconto
|
||||
if (_isbenzinaro)
|
||||
gest4 = cnf.get_bool("GesT74");
|
||||
// controlla che il periodo corrente non sia l'inizio dell'attivita'
|
||||
// nel caso, differita va a FALSE
|
||||
TDate inatt(_nditte->lfile().get("DINIZIOATT"));
|
||||
@ -326,8 +330,20 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
if (month == _month && stliq)
|
||||
{
|
||||
describe_firm(month);
|
||||
describe_liq(_month, atts, _isregis ? NULL : rimb_d);
|
||||
//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) ||
|
||||
(_isannual && _freqviva == "T" && !_isbenzinaro) ||
|
||||
(_isannual && _isbenzinaro && !gest4))
|
||||
describe_liqacc();
|
||||
}
|
||||
return ok || calc;
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include <utility.h>
|
||||
|
||||
#include "cg4300.h"
|
||||
|
||||
// flags per annuale
|
||||
@ -70,6 +69,9 @@ void TLiquidazione_app::set_page(int file, int cnt)
|
||||
case THE_END:
|
||||
set_grand(d);
|
||||
break;
|
||||
case LIQACC:
|
||||
set_liqacc(d);
|
||||
break;
|
||||
case ACCONTO:
|
||||
set_acconto_p(d);
|
||||
break;
|
||||
@ -157,6 +159,33 @@ void TLiquidazione_app::describe_firm(int month)
|
||||
_descr_arr.add(d);
|
||||
}
|
||||
|
||||
void TLiquidazione_app::describe_liqacc()
|
||||
{
|
||||
if (!_isprint || !_canprint) return;
|
||||
|
||||
if (!look_lia()) return;
|
||||
|
||||
if (_lia->get("S8") != "A") return;
|
||||
|
||||
_DescrItem* d = new _DescrItem(LIQACC);
|
||||
|
||||
d->_r0 = _lia->get_real("R7");
|
||||
d->_r1 = _lia->get_real("R13");
|
||||
d->_r2 = _lia->get_real("R14");
|
||||
d->_r3 = _lia->get_real("R9");
|
||||
d->_r4 = _lia->get_real("R10");
|
||||
d->_r5 = _lia->get_real("R8");
|
||||
d->_r6 = _lia->get_real("R12");
|
||||
d->_r7 = _lia->get_real("R11");
|
||||
d->_r8 = _lia->get_real("R4");
|
||||
TToken_string ff(_lia->get("S1"));
|
||||
real cre_pre (ff.get(0));
|
||||
real acq_intr (ff.get(1));
|
||||
d->_r9 = cre_pre;
|
||||
d->_r10 = acq_intr;
|
||||
|
||||
_descr_arr.add(d);
|
||||
}
|
||||
|
||||
void TLiquidazione_app::describe_plafond(int month, const char* codatt)
|
||||
{
|
||||
@ -1012,6 +1041,64 @@ void TLiquidazione_app::set_plafond(_DescrItem& d)
|
||||
set_auto_ff();
|
||||
}
|
||||
|
||||
void TLiquidazione_app::set_liqacc(_DescrItem& d)
|
||||
{
|
||||
real r1 = d._r0 + d._r1 + d._r2 + d._r3 + d._r4;
|
||||
real r2 = d._r5 + d._r10;
|
||||
real r3 = r2 + d._r9 + d._r7 + abs(d._r3);
|
||||
|
||||
set_row(1,""); set_row(2,""); set_row(3,""); set_row(4,"");
|
||||
set_row(5,"@11gCALCOLO ACCONTO SU OPERAZIONI EFFETTUATE");
|
||||
set_row(6,"");
|
||||
set_row(7,"@72gCredito@90gDebito"); set_row(8,"");
|
||||
if (!_isdiffacc)
|
||||
set_row(9,"@11gIva sulle operazioni annotate fino al 20 Dicembre@81g%r",
|
||||
&(d._r0));
|
||||
else set_row(9,"@11gIva sulle operazioni di vendita@81g%r",
|
||||
&(d._r0));
|
||||
int i = 10;
|
||||
if (!_isdiffacc)
|
||||
{
|
||||
set_row(i++,"@11gIva su operazioni fino al 20 Dic., ma non fatturate@81g%r",
|
||||
&(d._r1));
|
||||
set_row(i++,"@11gIva su operazioni fino al 20 Dic., ma non annotate@81g%r",
|
||||
&(d._r2));
|
||||
}
|
||||
set_row(i,"@11gRettifiche iva a debito");
|
||||
if (d._r3.sign() > 0)
|
||||
set_row(i,"@81g%r", &(d._r3));
|
||||
i++;
|
||||
set_row(i++,"@11gIva chiesta a rimborso@81g%r", &(d._r4));
|
||||
set_row(i++,"@11gRISULTATO@81g%r", &r1);
|
||||
|
||||
if (!_isdiffacc)
|
||||
set_row(i++,"@11gIva sugli acquisti annotati fino al 20 Dicembre@64g%r",
|
||||
&r2);
|
||||
else set_row(i++,"@11gIva sulle operazioni di acquisto@64g%r", &r2);
|
||||
if (d._r6 != ZERO)
|
||||
set_row(i++,"@11gmeno perc. di prorata pari a lire %r", &(d._r6));
|
||||
set_row(i++, "@11gCredito precedente@64g%r", &(d._r9));
|
||||
set_row(i, "@11gRettifiche iva a credito");
|
||||
if ((d._r3).sign() <= 0)
|
||||
{
|
||||
real ab = abs(d._r3);
|
||||
set_row(i,"@64g%r", &ab);
|
||||
}
|
||||
i++;
|
||||
set_row(i++,"@11gRISULTATO@64g%r", &r3);
|
||||
if ((d._r8).sign() < 0)
|
||||
{
|
||||
real ab = abs(d._r8);
|
||||
set_row(i++,"@23gCREDITO DA EVIDENZIARE@64g%r", &ab);
|
||||
}
|
||||
else if ((d._r8).sign() > 0 && d._r8 > ACCONTO_MINIMO_DA_VERSARE)
|
||||
set_row(i++,"@23gACCONTO DA VERSARE@81g%r", &(d._r8));
|
||||
else if ((d._r8).sign() > 0 && d._r8 <= ACCONTO_MINIMO_DA_VERSARE)
|
||||
set_row(i++,"@23gACCONTO DA NON VERSARE@64g%r", &(d._r8));
|
||||
|
||||
set_auto_ff();
|
||||
}
|
||||
|
||||
void TLiquidazione_app::set_pim_head()
|
||||
{
|
||||
set_bookmark("Riepilogo progressivi", _att_bookmark);
|
||||
|
@ -556,7 +556,8 @@ else error = 1;
|
||||
// sbatti l'acconto (e non solo!) in LIA
|
||||
if (look_lia())
|
||||
{
|
||||
isdifferita = _lia->get_bool("B1");
|
||||
TConfig cnf(CONFIG_DITTA, "cg");
|
||||
isdifferita = cnf.get_bool("GeLiDi");
|
||||
if (isdifferita && _basecalc == incorso) acc *= real(double(2/3));
|
||||
_lia->put("R4",acc);
|
||||
_lia->put("R7",iva_ven);
|
||||
|
@ -2338,13 +2338,13 @@ void CG4400_application::stampa_vidi()
|
||||
TabVid.put("CODTAB", vid);
|
||||
if (TabVid.read() == NOERR)
|
||||
{
|
||||
row.put(format("%s", (const char*)TabVid.get("S0")), 39);
|
||||
row.put(format("%-.32s", (const char*)TabVid.get("S0")), 39);
|
||||
row.put(format("%7d",TabVid.get_long("I0")), 71);
|
||||
row.put(format("%7d",TabVid.get_long("I1")), 79);
|
||||
row.put(format("%7d",TabVid.get_long("I2")), 87);
|
||||
TDate d(TabVid.get_long("D0"));
|
||||
row.put(format("%s", (const char*)d.string()), 95);
|
||||
row.put(format("%s", (const char*)TabVid.get("S1")), 106);
|
||||
row.put(format("%-.26s", (const char*)TabVid.get("S1")), 106);
|
||||
}
|
||||
printer().print(row);
|
||||
}
|
||||
|
@ -372,9 +372,10 @@ bool LiqAcc_app::video_vis()
|
||||
if (lia.read() != NOERR) //da verificare se e' giusto
|
||||
return FALSE;
|
||||
|
||||
TConfig cnf(CONFIG_DITTA, "cg");
|
||||
bool liqdiff = cnf.get_bool("GeLiDi");
|
||||
_tipo_acc = lia.get("S8");
|
||||
TString16 freqviva = lia.get("S7");
|
||||
bool liqdiff = lia.get_bool("B1");
|
||||
real acconto = ZERO;
|
||||
real iva_ven = ZERO;
|
||||
real iva_acq = ZERO;
|
||||
@ -460,7 +461,7 @@ bool LiqAcc_app::video_vis()
|
||||
if (acconto.sign() < 0)
|
||||
{
|
||||
m.show(F_CREEVI);
|
||||
m.field(F_CREEVI).set(acconto.string());
|
||||
m.field(F_CREEVI).set(abs(acconto).string());
|
||||
m.hide(F_ACCVER);
|
||||
m.hide(F_ACCNVER);
|
||||
}
|
||||
@ -478,9 +479,18 @@ bool LiqAcc_app::video_vis()
|
||||
m.hide(F_ACCVER);
|
||||
m.field(F_ACCNVER).set(acconto.string());
|
||||
}
|
||||
else //==0
|
||||
{
|
||||
m.hide(F_CREEVI);
|
||||
m.hide(F_ACCNVER);
|
||||
m.hide(F_ACCVER);
|
||||
}
|
||||
|
||||
if (!liqdiff)
|
||||
{
|
||||
m.set_handler(F_NONFAT, msk_risul);
|
||||
m.set_handler(F_NONANN, msk_risul);
|
||||
}
|
||||
m.set_handler(msk_hide);
|
||||
|
||||
for (bool stop = FALSE; !stop;)
|
||||
|
Loading…
x
Reference in New Issue
Block a user