1994-09-22 07:46:09 +00:00
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
|
// Calcolo liquidazioni
|
|
|
|
|
// Part 5: stampa
|
|
|
|
|
// fv 21-1-94
|
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
#include <utility.h>
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
#include "cg4300.h"
|
|
|
|
|
|
|
|
|
|
// flags per annuale
|
|
|
|
|
#define IS_PRORATA 0x0001
|
|
|
|
|
|
|
|
|
|
// minchietta per prospetto ventilazione
|
|
|
|
|
class _vDesc : public TObject
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TString _codiva;
|
|
|
|
|
real _acq;
|
|
|
|
|
real _vnd;
|
|
|
|
|
real _viv;
|
|
|
|
|
_vDesc() : _codiva(5) {}
|
|
|
|
|
virtual ~_vDesc() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static char sep[] =
|
|
|
|
|
"------------------------------------------------------------------"
|
|
|
|
|
"------------------------------------------------------------------";
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_page(int file, int cnt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
_DescrItem& d = (_DescrItem&)_descr_arr[cnt];
|
|
|
|
|
|
|
|
|
|
set_auto_ff(FALSE);
|
|
|
|
|
reset_print();
|
|
|
|
|
|
|
|
|
|
switch(d._flags)
|
|
|
|
|
{
|
|
|
|
|
case CHG_PARMS: set_att(d); break;
|
|
|
|
|
case SET_FIRM: set_firm(d); break;
|
|
|
|
|
case PIM_ROW: set_pim(d); break;
|
|
|
|
|
case TOT_ROW: set_plm(d); break;
|
|
|
|
|
case MISC_LIQ: set_ptm(d); break;
|
|
|
|
|
case PLAFOND: set_plafond(d); break;
|
|
|
|
|
case VENTILA: set_ventila(d); break;
|
|
|
|
|
case REGAGR: set_regagr(d); break;
|
|
|
|
|
case REGVIA: set_viaggio(d); break;
|
|
|
|
|
case THE_END: set_grand(d); break;
|
|
|
|
|
case ACCONTO: set_acconto_p(d); break;
|
|
|
|
|
case ACCHEAD: set_acchead_p(d); break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
print_action TLiquidazione_app::postprocess_page(int file, int cnt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
if (_descr_arr.items() == 0 || cnt == _descr_arr.items()-1)
|
|
|
|
|
return NEXT_PAGE;
|
|
|
|
|
return REPEAT_PAGE;
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
bool TLiquidazione_app::preprocess_page(int file, int cnt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
return _descr_arr.items() != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
|
// Print description
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
|
|
1995-01-18 10:54:05 +00:00
|
|
|
|
void TLiquidazione_app::describe_att(int month, const char* codatt, bool isresult)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
TToken_string atts(codatt);
|
|
|
|
|
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (_isprint && _canprint)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
describe_name(month, atts);
|
|
|
|
|
if (atts.items() == 1 && _isplafond)
|
|
|
|
|
describe_plafond(month, codatt);
|
|
|
|
|
if (atts.items() == 1 && _isvent)
|
|
|
|
|
describe_ventilation(month, codatt);
|
|
|
|
|
if (atts.items() == 1 && _isagricolo)
|
|
|
|
|
describe_agricolo(month, codatt);
|
|
|
|
|
if (atts.items() == 1 && _isviaggio)
|
|
|
|
|
describe_viaggio(month, codatt);
|
1995-01-19 12:43:16 +00:00
|
|
|
|
if (isresult || _isannual)
|
1995-01-18 10:54:05 +00:00
|
|
|
|
describe_pims(month,codatt);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (atts.items() == 1)
|
|
|
|
|
describe_consistence(codatt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_name(int month, TToken_string& codatts)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
_DescrItem* d = new _DescrItem(CHG_PARMS);
|
|
|
|
|
|
|
|
|
|
d->_s0 = _nditte->curr().get("CODDITTA");
|
|
|
|
|
d->_s1 = _nditte->curr().get("RAGSOC");
|
|
|
|
|
d->_s2 = _nditte->curr(LF_ATTIV).get("CODATT");
|
|
|
|
|
d->_s3 = codatts.items() == 1 ? (const char*)_nditte->curr(LF_ATTIV).get("DESCR") : "";
|
1994-10-31 10:28:09 +00:00
|
|
|
|
d->_s4 = _freqviva;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
d->_f1 = month;
|
|
|
|
|
d->_f2 = _isbenzinaro;
|
1994-10-25 11:42:58 +00:00
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (_mixed && codatts.items() == 1)
|
|
|
|
|
d->_f0 = atoi(codatts.mid(5));
|
1994-10-25 11:42:58 +00:00
|
|
|
|
else d->_f0 = 0;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_firm(int month)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (!_isprint || !_canprint) return;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
_DescrItem* d = new _DescrItem(SET_FIRM);
|
|
|
|
|
|
|
|
|
|
d->_s0 = _nditte->curr().get("CODDITTA");
|
|
|
|
|
d->_s1 = _nditte->curr().get("RAGSOC");
|
1994-10-31 10:28:09 +00:00
|
|
|
|
d->_s2 = _freqviva;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
d->_f1 = month;
|
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-14 11:50:04 +00:00
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_plafond(int month, const char* codatt)
|
1994-11-14 11:50:04 +00:00
|
|
|
|
{
|
|
|
|
|
// prepara la descrizione del riepilogo da stampare e lo accoda
|
|
|
|
|
real t1, t2, t3;
|
|
|
|
|
_DescrItem* d = new _DescrItem(PLAFOND);
|
|
|
|
|
|
|
|
|
|
for (int jj = 1; jj <= 3; jj++) // three types of plafond
|
|
|
|
|
{
|
|
|
|
|
t1 = 0.0; t2 = 0.0; t3 = 0.0;
|
1995-01-18 10:54:05 +00:00
|
|
|
|
for (int m = 1; m <= month && m < 13; m++)
|
1994-11-14 11:50:04 +00:00
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (is_month_ok(m,month) && look_ppa(m,codatt,jj))
|
1994-11-14 11:50:04 +00:00
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
t1 += _ppa->get_real("R0");
|
|
|
|
|
t2 += _ppa->get_real("R1");
|
|
|
|
|
t3 = _ppa->get_real("R2");
|
1994-11-14 11:50:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switch (jj)
|
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
case 1:
|
|
|
|
|
d->_r0 = t1; d->_r1 = t2; d->_r2 = t3;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
d->_r3 = t1; d->_r4 = t2; d->_r5 = t3;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
d->_r6 = t1; d->_r7 = t2; d->_r8 = t3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1994-11-14 11:50:04 +00:00
|
|
|
|
} // for tipo esenzione plafond
|
|
|
|
|
|
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
|
1994-12-02 08:55:16 +00:00
|
|
|
|
{
|
|
|
|
|
if (!_isvent) return;
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (_isriepilogo || _isannual) month = 12;
|
|
|
|
|
|
|
|
|
|
_DescrItem* d = new _DescrItem(VENTILA);
|
|
|
|
|
TString att(codatt);
|
|
|
|
|
|
|
|
|
|
look_ptm(month, att);
|
1994-10-27 11:47:11 +00:00
|
|
|
|
real r0(_ptm->get("S4"));
|
|
|
|
|
real r1(_ptm->get("S5"));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
d->_r0 = r0; d->_r1 = r1;
|
|
|
|
|
|
|
|
|
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(*_pim_codatt,att) != 0)
|
|
|
|
|
continue;
|
1994-12-07 09:03:51 +00:00
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
look_reg(*_pim_codreg);
|
|
|
|
|
look_iva(*_pim_codiva);
|
|
|
|
|
|
|
|
|
|
int tipocr = atoi(*_pim_tipocr);
|
1994-12-07 09:03:51 +00:00
|
|
|
|
int tipodet = atoi(*_pim_tipodet);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
int mese = atoi(*_pim_mese);
|
|
|
|
|
bool corrisp = _reg->get_bool("B0");
|
|
|
|
|
real imponibile = _pim->get_real("R0");
|
|
|
|
|
real imposta = _pim->get_real("R1");
|
|
|
|
|
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
|
|
|
|
|
1994-10-27 11:47:11 +00:00
|
|
|
|
if (imponibile.is_zero() && imposta.is_zero()) continue;
|
1994-12-07 09:03:51 +00:00
|
|
|
|
|
|
|
|
|
// questi non vanno in liquidazione, i totali sono
|
|
|
|
|
// gia' calcolati altrove
|
|
|
|
|
if (tipodet == 1 || tipodet == 3 || tipodet == 9)
|
|
|
|
|
continue;
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (mese <= month)
|
|
|
|
|
{
|
|
|
|
|
if (tipocr == 1 && tipomov == acquisto)
|
|
|
|
|
{
|
|
|
|
|
// somma agli acquisti
|
|
|
|
|
_vDesc* vd = NULL;
|
|
|
|
|
for (int i = 0; i < d->_arr.items(); i++)
|
|
|
|
|
{
|
|
|
|
|
_vDesc* vv = (_vDesc*)&(d->_arr[i]);
|
|
|
|
|
if (strcmp(vv->_codiva,*_pim_codiva) == 0)
|
|
|
|
|
{ vd = vv; break; }
|
|
|
|
|
}
|
|
|
|
|
if (vd == NULL) { vd = new _vDesc; }
|
|
|
|
|
|
|
|
|
|
vd->_acq += (imponibile+imposta);
|
|
|
|
|
|
|
|
|
|
if (vd->_codiva.empty())
|
|
|
|
|
{
|
|
|
|
|
vd->_codiva = *_pim_codiva;
|
|
|
|
|
d->_arr.add(vd);
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-01-18 10:54:05 +00:00
|
|
|
|
else if (is_month_ok(mese,month) && corrisp
|
1994-09-22 07:46:09 +00:00
|
|
|
|
&& _pim->get_bool("B1") &&
|
|
|
|
|
tipocr == 0 && tipomov == vendita)
|
|
|
|
|
// non sono sicurissimo della above condition
|
|
|
|
|
{
|
|
|
|
|
// somma alle vendite
|
|
|
|
|
_vDesc* vd = NULL;
|
|
|
|
|
for (int i = 0; i < d->_arr.items(); i++)
|
|
|
|
|
{
|
|
|
|
|
_vDesc* vv = (_vDesc*)&(d->_arr[i]);
|
|
|
|
|
if (strcmp(vv->_codiva,*_pim_codiva) == 0)
|
|
|
|
|
{ vd = vv; break; }
|
|
|
|
|
}
|
|
|
|
|
if (vd == NULL) { vd = new _vDesc; }
|
|
|
|
|
|
|
|
|
|
vd->_vnd += imponibile;
|
|
|
|
|
vd->_viv += imposta;
|
|
|
|
|
|
|
|
|
|
if (vd->_codiva.empty())
|
|
|
|
|
{
|
|
|
|
|
vd->_codiva = *_pim_codiva;
|
|
|
|
|
d->_arr.add(vd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
_DescrItem* d = new _DescrItem(REGAGR);
|
|
|
|
|
|
1995-01-19 16:12:58 +00:00
|
|
|
|
for (int mese = 1; mese <= month; mese++)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1995-01-19 16:12:58 +00:00
|
|
|
|
if (!is_month_ok(mese,month))
|
1994-09-22 07:46:09 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
1995-01-19 16:12:58 +00:00
|
|
|
|
if (!look_plm(mese, codatt))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
// vendite regime agricolo
|
|
|
|
|
d->_r0 += _plm->get_real("R5");
|
|
|
|
|
// vendite non regime agricolo
|
|
|
|
|
d->_r1 += _plm->get_real("R6");
|
|
|
|
|
// acquisti in regime agricolo
|
|
|
|
|
d->_r2 += _plm->get_real("R9") + _plm->get_real("R10");
|
|
|
|
|
// acquisti non in regime agricolo (compr. ammort.)
|
|
|
|
|
d->_r3 += _plm->get_real("R7") + _plm->get_real("R8");
|
|
|
|
|
// acquisti beni ammortizzabili
|
|
|
|
|
d->_r4 += _plm->get_real("R8");
|
1995-01-18 10:54:05 +00:00
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1995-01-19 15:07:36 +00:00
|
|
|
|
if (!look_lim(month)) return;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
_DescrItem* d = new _DescrItem(REGVIA);
|
|
|
|
|
|
1995-01-19 15:07:36 +00:00
|
|
|
|
for (int mese = 1; mese <= month; mese++)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (!is_month_ok(mese,month) || !look_plm(mese, codatt))
|
|
|
|
|
continue;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
d->_r0 += _plm->get_real("R5"); // corrispettivi CEE
|
|
|
|
|
d->_r1 += _plm->get_real("R9"); // corrispettivi misti CEE
|
|
|
|
|
d->_r2 += _plm->get_real("R6"); // corrispettivi fuori CE
|
|
|
|
|
d->_r3 += _plm->get_real("R7"); // acquisti CEE
|
|
|
|
|
d->_r4 += _plm->get_real("R10"); // acquisti misti parte CEE
|
|
|
|
|
d->_r5 += _plm->get_real("R8"); // acquisti fuori CEE
|
|
|
|
|
d->_r6 += _plm->get_real("R11"); // acquisti misti parte fuori CEE
|
1995-01-19 15:07:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// percentuale ripartizione
|
|
|
|
|
d->_r7 = _lim->get_real("R4");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// credito di costo precedente (CHECK annuale)
|
1995-01-19 15:07:36 +00:00
|
|
|
|
d->_r8 = credito_costo_prec(mese);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// le si passa una tokenstring (o un codatt) e lei, da brava, calcola
|
|
|
|
|
// cumulando per tutte le attivita' nominatele
|
|
|
|
|
// ogni riga riguarda un codiva ma tutti i registri
|
|
|
|
|
// se il mese e' 13 si guarda tutto l'anno
|
|
|
|
|
{
|
|
|
|
|
TToken_string atts(codatt);
|
|
|
|
|
TString ref(atts.items() == 1 ? codatt : "ALL");
|
|
|
|
|
const char* tmpatt;
|
|
|
|
|
int last = _descr_arr.last();
|
|
|
|
|
bool isfirst = TRUE;
|
|
|
|
|
real t0, t1, t2, t3, t4, t5;
|
1995-01-12 11:36:08 +00:00
|
|
|
|
real autodafe, autodafe_iva;
|
|
|
|
|
|
|
|
|
|
// descrittore riga autodafe'
|
|
|
|
|
_DescrItem* ads = NULL;
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
while ((tmpatt = atts.get()) != NULL)
|
|
|
|
|
{
|
|
|
|
|
TString att(tmpatt);
|
|
|
|
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
|
|
|
|
{
|
|
|
|
|
_DescrItem* d = NULL;
|
|
|
|
|
// compute
|
|
|
|
|
bool ok = look_reg(*_pim_codreg);
|
|
|
|
|
ok |= look_iva(*_pim_codiva);
|
|
|
|
|
bool isnew = FALSE;
|
|
|
|
|
|
|
|
|
|
if (!ok) continue;
|
|
|
|
|
|
|
|
|
|
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
1994-12-07 09:03:51 +00:00
|
|
|
|
bool corrisp = _reg->get_bool("B0");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
TString tipoiva = _iva->get("S1");
|
1994-12-07 09:03:51 +00:00
|
|
|
|
int tipodet = atoi(*_pim_tipodet);
|
1994-10-26 11:29:09 +00:00
|
|
|
|
TString codiva((const char*)(*_pim_codiva));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
// se e' corrispettivo da ventilare non
|
|
|
|
|
// scrivo un cannolo ripieno visto che e' stato ventilato
|
|
|
|
|
if (tipomov == vendita && tipoiva == "VE") continue;
|
|
|
|
|
|
1994-12-07 09:03:51 +00:00
|
|
|
|
// questi non vanno in liquidazione, i totali sono
|
|
|
|
|
// gia' calcolati altrove
|
|
|
|
|
if (tipodet == 1 || tipodet == 3 || tipodet == 9)
|
|
|
|
|
continue;
|
|
|
|
|
|
1994-10-25 11:42:58 +00:00
|
|
|
|
// se ha tutti gli importi nulli viene da un annullamento di
|
|
|
|
|
// movimenti esistenti
|
1994-11-15 11:11:33 +00:00
|
|
|
|
if (_pim->get_real("R0").is_zero() &&
|
|
|
|
|
_pim->get_real("R1").is_zero() &&
|
1994-10-25 11:42:58 +00:00
|
|
|
|
_pim->get_real("R2").is_zero())
|
|
|
|
|
continue;
|
|
|
|
|
|
1995-01-19 12:43:16 +00:00
|
|
|
|
if (strcmp((const char*)*_pim_codatt, att) == 0 &&
|
|
|
|
|
(is_month_ok(atoi(*_pim_mese),month) || _isannual) &&
|
1994-09-22 07:46:09 +00:00
|
|
|
|
_year == (const char*)*_pim_anno)
|
|
|
|
|
{
|
|
|
|
|
// vedi se c'e' gia' un item corrispondente
|
|
|
|
|
for(int i = last+1; i < _descr_arr.items(); i++)
|
|
|
|
|
{
|
|
|
|
|
d = (_DescrItem*)&_descr_arr[i];
|
|
|
|
|
if (d->_flags == PIM_ROW &&
|
|
|
|
|
d->_s0 == ref &&
|
|
|
|
|
d->_s1 == (const char*)*_pim_codiva)
|
|
|
|
|
break;
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (d->_s1 > (const char*)*_pim_codiva)
|
|
|
|
|
{
|
|
|
|
|
isnew = TRUE;
|
|
|
|
|
_DescrItem* dd = new _DescrItem(PIM_ROW);
|
|
|
|
|
// CiccioPrassi li vuole in ordine crescente
|
|
|
|
|
_descr_arr.insert(dd,i);
|
|
|
|
|
// che cazzo di due marroni: se quello dopo
|
|
|
|
|
// era il primo, quello prima e' dopo
|
|
|
|
|
if (d->_f0)
|
|
|
|
|
{
|
|
|
|
|
dd->_f0 = TRUE;
|
|
|
|
|
d->_f0 = FALSE;
|
|
|
|
|
}
|
|
|
|
|
else if (isfirst)
|
|
|
|
|
{
|
|
|
|
|
d->_f0 = TRUE;
|
|
|
|
|
isfirst = FALSE;
|
|
|
|
|
}
|
|
|
|
|
d = dd;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (!isnew && i == _descr_arr.items())
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
isnew = TRUE;
|
|
|
|
|
d = new _DescrItem(PIM_ROW);
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (isfirst) { d->_f0 = TRUE; isfirst = FALSE; }
|
|
|
|
|
_descr_arr.add(d);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
1995-01-18 10:54:05 +00:00
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (tipomov == acquisto)
|
|
|
|
|
{
|
|
|
|
|
d->_r4 += _pim->get_real("R0");
|
|
|
|
|
d->_r5 += _pim->get_real("R1");
|
|
|
|
|
t4 += _pim->get_real("R0");
|
|
|
|
|
t5 += _pim->get_real("R1");
|
|
|
|
|
}
|
|
|
|
|
else // vendita
|
|
|
|
|
{
|
|
|
|
|
if (corrisp)
|
|
|
|
|
{
|
|
|
|
|
// usa R0 e R1 visto che la ventilazione e' gia'
|
1995-01-05 10:31:00 +00:00
|
|
|
|
// stata calcolata
|
|
|
|
|
real ifs(_pim->get_real("R5"));
|
|
|
|
|
real vfs(_pim->get_real("R6"));
|
|
|
|
|
|
|
|
|
|
d->_r2 += _pim->get_real("R0") - ifs;
|
|
|
|
|
d->_r3 += _pim->get_real("R1") - vfs;
|
|
|
|
|
t2 += _pim->get_real("R0") - ifs;
|
|
|
|
|
t3 += _pim->get_real("R1") - vfs;
|
|
|
|
|
t0 += ifs;
|
|
|
|
|
t1 += vfs;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
1995-01-12 11:36:08 +00:00
|
|
|
|
{
|
|
|
|
|
real adf, adi;
|
|
|
|
|
|
|
|
|
|
// si scorporano solo per l'annuale, altrimenti
|
|
|
|
|
// vengono normalmente considerati nelle vendite
|
|
|
|
|
if (_isannual)
|
|
|
|
|
{
|
|
|
|
|
adf = _pim->get_real("R7");
|
|
|
|
|
adi = _pim->get_real("R8");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
d->_r0 += _pim->get_real("R0") - adf;
|
|
|
|
|
d->_r1 += _pim->get_real("R1") - adi;
|
|
|
|
|
t0 += _pim->get_real("R0") - adf;
|
|
|
|
|
t1 += _pim->get_real("R1") - adi;
|
|
|
|
|
|
|
|
|
|
autodafe += adf;
|
|
|
|
|
autodafe_iva += adi;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isnew)
|
|
|
|
|
{
|
|
|
|
|
d->_s0 = ref;
|
|
|
|
|
d->_s1 = *_pim_codiva;
|
|
|
|
|
// flag per stampare l'intestazione colonne
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-01-12 11:36:08 +00:00
|
|
|
|
|
|
|
|
|
if (autodafe.sign() > 0 || autodafe_iva.sign() > 0)
|
|
|
|
|
{
|
|
|
|
|
_DescrItem* ads = new _DescrItem(PIM_ROW);
|
|
|
|
|
ads->_s0 = ref;
|
|
|
|
|
ads->_s1 = "A35"; // cosi' vollero
|
|
|
|
|
ads->_r0 = autodafe;
|
|
|
|
|
ads->_r1 = autodafe_iva;
|
|
|
|
|
if (isfirst)
|
|
|
|
|
{
|
|
|
|
|
isfirst = FALSE;
|
|
|
|
|
ads->_f0 = TRUE;
|
|
|
|
|
}
|
|
|
|
|
_descr_arr.add(ads);
|
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// prepara una bella riga di totali
|
|
|
|
|
if (!isfirst)
|
|
|
|
|
{
|
|
|
|
|
_DescrItem* d = new _DescrItem(TOT_ROW);
|
|
|
|
|
d->_r0 = t0; d->_r1 = t1;
|
|
|
|
|
d->_r2 = t2; d->_r3 = t3;
|
|
|
|
|
d->_r4 = t4; d->_r5 = t5;
|
|
|
|
|
|
|
|
|
|
// aggiunge dati ptm
|
|
|
|
|
_DescrItem* t = new _DescrItem(MISC_LIQ);
|
|
|
|
|
|
|
|
|
|
for (int m = 1; m <= month && m < 13; m++)
|
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (!is_month_ok(m,month) && !(_isannual || _isriepilogo)) continue;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
atts.restart();
|
|
|
|
|
while ((tmpatt = atts.get()) != NULL)
|
|
|
|
|
{
|
|
|
|
|
TString att(tmpatt);
|
|
|
|
|
look_ptm(m, att);
|
|
|
|
|
d->_r6 += _ptm->get_real("R0"); // acq. intracomunitari
|
|
|
|
|
d->_r7 += _ptm->get_real("R1"); // inded. art 19
|
|
|
|
|
d->_r8 += _ptm->get_real("R2"); // IVA su inded. art. 19
|
|
|
|
|
t->_r0 += _ptm->get_real("R3"); // acq. ammortizz.
|
|
|
|
|
t->_r1 += _ptm->get_real("R4"); // IVA acq. ammort.
|
|
|
|
|
t->_r2 += _ptm->get_real("R5"); // ammort. detr. 6%
|
|
|
|
|
t->_r3 += _ptm->get_real("R12"); // IVA ammort detr. 6%
|
|
|
|
|
t->_r4 += _ptm->get_real("R6"); // acq. beni rivendita
|
|
|
|
|
t->_r5 += _ptm->get_real("R7"); // IVA acq. beni rivendita
|
|
|
|
|
t->_r6 += _ptm->get_real("R8"); // acq. leasing
|
|
|
|
|
t->_r7 += _ptm->get_real("R9"); // IVA acq. leasing
|
|
|
|
|
t->_r8 += _ptm->get_real("R10"); // cessioni beni ammort.
|
|
|
|
|
t->_r9 += _ptm->get_real("R11"); // IVA su cessioni ammort.
|
|
|
|
|
t->_r10 += _ptm->get_real("R13"); // tot. esenti IVA
|
|
|
|
|
|
|
|
|
|
look_plm(m, att);
|
|
|
|
|
|
|
|
|
|
t->_r11 += _plm->get_real("R2"); // pro-rata indetraibile
|
1994-11-15 11:11:33 +00:00
|
|
|
|
t->_s0 = (_plm->get_real("R12")).string(); // % pro-rata
|
1994-12-01 14:48:17 +00:00
|
|
|
|
t->_f0 = !_prorata.is_zero(); // flag per segnalare l'esistenza
|
|
|
|
|
|
|
|
|
|
// minchie indeducibili su ricavi esenti
|
|
|
|
|
TToken_string s(_plm->get("S2"));
|
|
|
|
|
|
|
|
|
|
real aie(s.get(0)); // acq. inded. su ricavi esenti
|
|
|
|
|
real aiev(s.get(1)); // IVA acq. inded. su ricavi esenti
|
1994-11-11 11:26:28 +00:00
|
|
|
|
d->_r9 += aie;
|
|
|
|
|
d->_r10 += aiev;
|
1994-12-01 14:48:17 +00:00
|
|
|
|
|
|
|
|
|
// passaggi interni
|
|
|
|
|
s = _plm->get("S3");
|
|
|
|
|
real aipi(s.get(0)); // acq. inded. per pass. int.
|
|
|
|
|
real aipiv(s.get(1)); // IVA acq. inded. per pass. int.
|
1994-11-15 11:11:33 +00:00
|
|
|
|
real aipip(d->_s0); // progressivo ...
|
|
|
|
|
real aipivp(d->_s1); // ... (che mazzata sulle palle...)
|
|
|
|
|
aipip += aipi; // ricalcolo ...
|
|
|
|
|
aipivp += aipiv; // ...
|
|
|
|
|
d->_s0 = aipip.string(); // risbatto ...
|
1994-12-01 14:48:17 +00:00
|
|
|
|
d->_s1 = aipivp.string(); // ..
|
|
|
|
|
|
|
|
|
|
// spese generali.
|
|
|
|
|
s = _plm->get("S4");
|
|
|
|
|
real spgn(s.get(0)); // spese generali.
|
|
|
|
|
real spgnv(s.get(1)); // IVA spese generali
|
|
|
|
|
real spgnp(t->_s2); // progressivo ...
|
|
|
|
|
real spgnvp(t->_s3); // ... (che doppia mazzata sulle palle...)
|
|
|
|
|
spgnp += spgn; // ricalcolo ...
|
|
|
|
|
spgnvp += spgnv; // ...
|
|
|
|
|
t->_s2 = spgnp.string(); // risbatto ...
|
|
|
|
|
t->_s3 = spgnvp.string(); // ..
|
1995-01-12 11:36:08 +00:00
|
|
|
|
} // while (attivita')
|
|
|
|
|
} // for (mese ok)
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// annual follows in _arr
|
|
|
|
|
if ((_isannual || _isriepilogo) && ref != "ALL")
|
|
|
|
|
{
|
|
|
|
|
// tutte quelle cose che vanno alla liquidazione annuale, come il
|
|
|
|
|
// calcolo del prorata o del nuovo plafond o ....
|
|
|
|
|
if (look_pla(codatt))
|
|
|
|
|
{
|
|
|
|
|
real v = _pla->get_real("R0");
|
|
|
|
|
real e1 = _pla->get_real("R1");
|
|
|
|
|
real e2 = _pla->get_real("R2");
|
|
|
|
|
real e3 = _pla->get_real("R3");
|
|
|
|
|
real am = _pla->get_real("R4");
|
|
|
|
|
real pr = _pla->get_real("R9");
|
|
|
|
|
real co = _pla->get_real("R10");
|
|
|
|
|
|
|
|
|
|
_DescrItem* dd = new _DescrItem(ANNUAL);
|
|
|
|
|
|
|
|
|
|
// prorata
|
1994-12-09 16:29:50 +00:00
|
|
|
|
if (!_prorata.is_zero())
|
1994-09-22 07:46:09 +00:00
|
|
|
|
dd->_f0 |= IS_PRORATA;
|
|
|
|
|
dd->_r0 = v - am - e3;
|
|
|
|
|
dd->_r1 = e1;
|
|
|
|
|
dd->_r2 = pr;
|
|
|
|
|
dd->_r3 = co;
|
|
|
|
|
dd->_r4 = e2;
|
|
|
|
|
dd->_r5 = e3;
|
|
|
|
|
t->_arr.add(dd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
_descr_arr.add(t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
|
|
|
|
_DescrItem* di)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (!_isprint || !_canprint) return;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (_isannual || _isriepilogo) month = 12;
|
|
|
|
|
|
|
|
|
|
_DescrItem* d = new _DescrItem(THE_END);
|
|
|
|
|
TToken_string atts(codatts);
|
|
|
|
|
const char* tmpatt;
|
|
|
|
|
real conguaglio;
|
|
|
|
|
|
|
|
|
|
// serve per pagare anche meno di 50000 a dicembre
|
|
|
|
|
d->_f1 = month == 12;
|
|
|
|
|
d->_f2 = month;
|
|
|
|
|
|
|
|
|
|
while ((tmpatt = atts.get()) != NULL)
|
|
|
|
|
{
|
|
|
|
|
TString att(tmpatt);
|
1995-01-18 10:54:05 +00:00
|
|
|
|
for (int mm = 1; mm <= 12; mm++)
|
|
|
|
|
{
|
|
|
|
|
if (!is_month_ok(mm, month)) continue;
|
|
|
|
|
look_plm(mm, att);
|
|
|
|
|
d->_r0 += _plm->get_real("R0"); // IVA vendite
|
|
|
|
|
d->_r1 += _plm->get_real("R1"); // IVA acquisti
|
|
|
|
|
d->_r2 += _plm->get_real("R3"); // Detrazioni 1
|
|
|
|
|
d->_r2 += _plm->get_real("R4"); // Detrazioni 2
|
|
|
|
|
d->_r1 -= _plm->get_real("R2"); // pro-rata
|
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// ev. conguaglio prorata
|
|
|
|
|
if (_isannual || _isriepilogo)
|
|
|
|
|
{
|
|
|
|
|
look_pla(att);
|
|
|
|
|
conguaglio += _pla->get_real("R10");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
look_lim(month);
|
1995-01-18 10:54:05 +00:00
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
d->_r3 += _lim->get_real("R0"); // risultato
|
|
|
|
|
d->_r4 += _lim->get_real("R1"); // rimborso
|
1995-01-18 10:54:05 +00:00
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (_lim->get("S7") == "D")
|
1995-01-05 10:31:00 +00:00
|
|
|
|
d->_r5 += abs(_lim->get_real("R5")); // rettifiche a debito
|
1994-09-22 07:46:09 +00:00
|
|
|
|
else
|
1995-01-05 10:31:00 +00:00
|
|
|
|
d->_r6 += abs(_lim->get_real("R5")); // rettifiche a credito
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
1994-10-31 10:28:09 +00:00
|
|
|
|
d->_f0 = _freqviva == "T";
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
// r7 = credito precedente
|
|
|
|
|
d->_r7 = credito_prec(month);
|
1994-11-11 11:26:28 +00:00
|
|
|
|
|
|
|
|
|
// r11 = ulteriori detrazioni
|
|
|
|
|
d->_r11 = _lim->get_real("R6");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
1995-01-12 14:46:51 +00:00
|
|
|
|
// se ci sono stati versamenti IVA li riporta in _s2
|
|
|
|
|
d->_s2 = versamenti_IVA(month).string();
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// vedi se c'era un debito precedente e schiaffa in r10
|
|
|
|
|
if (!is_first_month(month))
|
|
|
|
|
{
|
|
|
|
|
if (look_lim(previous_month(month)))
|
|
|
|
|
{
|
|
|
|
|
real r = _lim->get_real("R0");
|
|
|
|
|
if (_lim->get_real("R5").sign() > 0)
|
|
|
|
|
r += _plm->get_real("R5");
|
|
|
|
|
// non considera il rimborso in quanto se e' a debito
|
|
|
|
|
// non c'e' rimborso, e se e' rettificato pure
|
|
|
|
|
if (r.sign() > 0 && r < IVA_DA_RIPORTARE)
|
|
|
|
|
d->_r10 += r;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_isannual || _isriepilogo)
|
|
|
|
|
{
|
|
|
|
|
look_lia();
|
|
|
|
|
|
|
|
|
|
// r8 = acconto dicembre
|
1995-01-12 11:36:08 +00:00
|
|
|
|
d->_r8 = _lia->get_real("R4");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// r9 = conguaglio prorata
|
1995-01-12 11:36:08 +00:00
|
|
|
|
d->_r9 = conguaglio;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// aggiunge eventuale satellite per rimborso infraannuale
|
|
|
|
|
if (di != NULL) d->_arr.add(di);
|
|
|
|
|
|
|
|
|
|
_descr_arr.add(d);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_consistence(const char* codatt)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
// controlla eventuali condizioni di conflitto con le normative
|
|
|
|
|
// per la ditta e crea i messaggi appropriati
|
|
|
|
|
// tutte le condizioni sono valutate sull'esercizio precedente
|
|
|
|
|
int pryear = atoi(_year) - 1;
|
|
|
|
|
TString att = codatt;
|
|
|
|
|
|
|
|
|
|
_pla->zero();
|
|
|
|
|
*_pla_anno = pryear;
|
|
|
|
|
*_pla_codatt = att;
|
|
|
|
|
|
|
|
|
|
if (_pla->read() == NOERR)
|
|
|
|
|
{
|
|
|
|
|
real va = _pla->get_real("R0");
|
|
|
|
|
|
|
|
|
|
// 1) consistenza volume d'affari <-> frequenza versamenti
|
|
|
|
|
// deve essere: trimestrale ammesso solo se < 360.000.000
|
|
|
|
|
// per servizi, < 1.000.000.000 per altre imprese
|
|
|
|
|
// a meno che non sia benzinaro che ha diritto comunque
|
|
|
|
|
|
|
|
|
|
if (_freqviva == "T" && !_isbenzinaro)
|
|
|
|
|
{
|
|
|
|
|
bool err = FALSE;
|
|
|
|
|
if (_isservizio) err = va > SOGLIA_TRIM_SERVIZI;
|
|
|
|
|
else err = va > SOGLIA_TRIM_ALTRE;
|
|
|
|
|
if (err)
|
|
|
|
|
describe_error("Incoerenza volume affari/frequenza versamenti",
|
|
|
|
|
att);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::describe_error(const char* err, const char* codatt)
|
1995-01-18 10:54:05 +00:00
|
|
|
|
{
|
|
|
|
|
if (!_isprint || !_canprint) return;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
_errors.add(new _ErrItem(err,codatt,_nditte->curr().get("CODDITTA")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
|
// Setrows
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_firm(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
TString tim_title(80);
|
|
|
|
|
tim_title << "Liquidazione IVA";
|
|
|
|
|
|
|
|
|
|
if (d._f1 == 13)
|
|
|
|
|
tim_title << format(": Riepilogo Annuale %s",(const char*)_year);
|
|
|
|
|
else
|
|
|
|
|
{
|
1994-11-14 11:50:04 +00:00
|
|
|
|
if (d._s2 == "T")
|
1994-10-24 13:43:30 +00:00
|
|
|
|
tim_title << format(" del %d<> Trimestre %s", d._f1/3, (const char *) _year);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
else
|
|
|
|
|
tim_title << format(" del mese di %s %s", itom(d._f1),
|
|
|
|
|
(const char*)_year);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reset_header();
|
1994-10-24 13:43:30 +00:00
|
|
|
|
set_header(1,"Ditta %s %s@109gData @<@125gPag. @#",
|
1994-09-22 07:46:09 +00:00
|
|
|
|
(const char*)(d._s0), (const char*)(d._s1));
|
|
|
|
|
set_header(2,"");
|
|
|
|
|
set_header(3,sep);
|
|
|
|
|
set_header(4,"%s@102gFrequenza %s",
|
|
|
|
|
(const char*)tim_title,
|
|
|
|
|
d._s2 == "T" ? "Trimestrale" : "Mensile");
|
|
|
|
|
set_header(5,sep);
|
|
|
|
|
set_header(6,"");
|
|
|
|
|
|
|
|
|
|
// notify errors if any
|
|
|
|
|
int j = 0;
|
|
|
|
|
for (int i = 0; i < _errors.items(); i++)
|
|
|
|
|
{
|
|
|
|
|
_ErrItem& s = (_ErrItem&)_errors[i];
|
|
|
|
|
if (s._att == "ALL" && s._firm == d._s0)
|
1995-01-18 10:54:05 +00:00
|
|
|
|
{ j++; set_row(i+3, "@5g@b*** %s ***@r", (const char*)s._err); }
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (j) set_row(i+3,"");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_att(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
// set header
|
|
|
|
|
TString tim_title(78);
|
|
|
|
|
TString att_title(48);
|
|
|
|
|
|
|
|
|
|
tim_title << "Liquidazione IVA";
|
|
|
|
|
|
|
|
|
|
if (d._f1 == 13)
|
|
|
|
|
{
|
|
|
|
|
if (d._s4 == "T" && !(d._f2)) // trimestrale e non benzinaro
|
|
|
|
|
tim_title << format(": Riepilogo Annuale %s",(const char*)_year);
|
|
|
|
|
else
|
|
|
|
|
tim_title << format(": Dichiarazione Annuale %s",(const char*)_year);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (d._s4 == "T")
|
1994-11-14 11:50:04 +00:00
|
|
|
|
tim_title << format(" del %d<> Trimestre %s", d._f1/3, (const char *) _year);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
else
|
|
|
|
|
tim_title << format(" del mese di %s %s", itom(d._f1),
|
|
|
|
|
(const char*)_year);
|
|
|
|
|
}
|
|
|
|
|
|
1994-10-25 11:42:58 +00:00
|
|
|
|
TString tipatt;
|
|
|
|
|
|
|
|
|
|
if (d._f0 > 0)
|
1995-01-18 10:54:05 +00:00
|
|
|
|
tipatt.format(d._f0 == 1 ? "SERVIZI" : "ALTRE ATTIVITA'");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
if (d._s3.empty())
|
|
|
|
|
{
|
|
|
|
|
att_title = "Riepilogo attivita' ";
|
1994-12-27 16:28:35 +00:00
|
|
|
|
// att_title << d._s2;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
att_title = format("Attivita' %s %s %s",
|
|
|
|
|
(const char*)(d._s2),
|
|
|
|
|
(const char*)(d._s3),
|
|
|
|
|
(const char*)tipatt);
|
|
|
|
|
|
|
|
|
|
reset_header();
|
1994-10-24 13:43:30 +00:00
|
|
|
|
set_header(1,"Ditta %s %s@109gData @<@125gPag. @#",
|
1994-09-22 07:46:09 +00:00
|
|
|
|
(const char*)(d._s0), (const char*)(d._s1));
|
|
|
|
|
set_header(2,"");
|
|
|
|
|
set_header(3,sep);
|
|
|
|
|
set_header(4,"%s@55g%s", (const char*)tim_title, (const char*)att_title);
|
|
|
|
|
set_header(5,sep);
|
|
|
|
|
set_header(6,"");
|
|
|
|
|
|
|
|
|
|
// notify errors if any
|
|
|
|
|
int j = 0;
|
|
|
|
|
for (int i = 0; i < _errors.items(); i++)
|
|
|
|
|
{
|
|
|
|
|
_ErrItem& s = (_ErrItem&)_errors[i];
|
|
|
|
|
if (d._s2 == s._att && s._firm == d._s0)
|
|
|
|
|
{ j++; set_row(i+10, "@5g@b*** %s ***@r", (const char*)s._err); }
|
|
|
|
|
}
|
|
|
|
|
if (j) set_auto_ff(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_plafond(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1994-12-27 16:28:35 +00:00
|
|
|
|
real r1 = d._r2 - d._r1 - d._r0;
|
|
|
|
|
real r2 = d._r5 - d._r4 - d._r3;
|
|
|
|
|
real r3 = d._r8 - d._r7 - d._r6;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
set_print_zero(TRUE);
|
|
|
|
|
|
|
|
|
|
set_row(1,"QUADRO RELATIVO ALLA DISPONIBILITA' ED ALL'UTILIZZO "
|
|
|
|
|
"MENSILE DEI PLAFOND");
|
|
|
|
|
|
|
|
|
|
set_row(2,""); set_row(3,"");
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(4,"Art. 8 1<> comma lettere a-b@31gDisponibile@48g%r",
|
1994-12-27 16:28:35 +00:00
|
|
|
|
&(d._r2));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(5,"Utilizzato all'interno@48g%r", &(d._r0));
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(6,"Utilizzato per l'importazione@48g%r@69gRiporto@78g%r",
|
1994-12-27 16:28:35 +00:00
|
|
|
|
&(d._r1), &r1);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
set_row(7,"");
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(8,"Art. 8bis 1<> comma@31gDisponibile@48g%r",
|
1994-12-27 16:28:35 +00:00
|
|
|
|
&(d._r5));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(9,"Utilizzato all'interno@48g%r", &(d._r3));
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(10,"Utilizzato per l'importazione@48g%r@69gRiporto@78g%r",
|
1994-12-27 16:28:35 +00:00
|
|
|
|
&(d._r4), &(r2));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
set_row(11,"");
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(12,"Art. 9 1<> comma@31gDisponibile@48g%r",
|
1994-12-27 16:28:35 +00:00
|
|
|
|
&(d._r8));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(13,"Utilizzato all'interno@48g%r", &(d._r6));
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(14,"Utilizzato per l'importazione@48g%r@69gRiporto@78g%r",
|
1994-12-27 16:28:35 +00:00
|
|
|
|
&(d._r7), &r3);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
set_print_zero(FALSE);
|
|
|
|
|
set_auto_ff();
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_pim(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1995-01-12 11:36:08 +00:00
|
|
|
|
if (d._s1 == "A35")
|
|
|
|
|
{
|
|
|
|
|
d._s2 = "Artt.17c3/74c1";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
look_iva(d._s1);
|
|
|
|
|
d._s2 = _iva->get("S0");
|
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (d._f0) // e' il primo
|
|
|
|
|
{
|
|
|
|
|
// intestazioncina
|
1994-10-26 11:29:09 +00:00
|
|
|
|
set_row(1," Cod.@41gVENDITE@71gCORRISPETTIVI@106gACQUISTI");
|
|
|
|
|
set_row(2," IVA Descrizione@30gImponibile@49gImposta@63gImponibile"
|
1994-09-22 07:46:09 +00:00
|
|
|
|
"@82gImposta@96gImponibile@115gImposta");
|
|
|
|
|
set_row(3,"");
|
|
|
|
|
}
|
1994-11-11 11:26:28 +00:00
|
|
|
|
set_row(d._f0 ? 4 : 1,"%4s %-20s@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r",
|
1994-09-22 07:46:09 +00:00
|
|
|
|
(const char*)d._s1,
|
|
|
|
|
(const char*)d._s2,
|
|
|
|
|
&(d._r0),
|
|
|
|
|
&(d._r1),
|
|
|
|
|
&(d._r2),
|
|
|
|
|
&(d._r3),
|
|
|
|
|
&(d._r4),
|
|
|
|
|
&(d._r5));
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_plm(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
set_row(1,""); set_row(2,"");
|
1994-11-11 11:26:28 +00:00
|
|
|
|
set_row(3,"Totale@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r",
|
1994-09-22 07:46:09 +00:00
|
|
|
|
&(d._r0),
|
|
|
|
|
&(d._r1),
|
|
|
|
|
&(d._r2),
|
|
|
|
|
&(d._r3),
|
|
|
|
|
&(d._r4),
|
|
|
|
|
&(d._r5));
|
|
|
|
|
// totalazzi parziali e generali
|
1994-11-14 11:50:04 +00:00
|
|
|
|
int rw = 4;
|
|
|
|
|
if (!d._r6.is_zero())
|
|
|
|
|
{
|
|
|
|
|
set_row(rw++,"di cui per acquisti intracomunitari@107g%r", &(d._r6));
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
}
|
|
|
|
|
if (!(d._r7.is_zero() && d._r8.is_zero()))
|
|
|
|
|
{
|
|
|
|
|
set_row(rw++,"Totali acquisti indeducibili per art.19@91g%r@107g%r",
|
|
|
|
|
&(d._r7), &(d._r8));
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
}
|
1994-11-11 11:26:28 +00:00
|
|
|
|
if (! (d._r9.is_zero() && d._r10.is_zero()))
|
|
|
|
|
{
|
|
|
|
|
set_row(rw++, "Totale acquisti indeducibili su ricavi esenti@91g%r@107g%r",
|
|
|
|
|
&(d._r9),
|
|
|
|
|
&(d._r10));
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
}
|
1994-11-15 11:11:33 +00:00
|
|
|
|
|
|
|
|
|
real acq_pint(d._s0);
|
|
|
|
|
real acq_pint_iva(d._s1);
|
1994-11-11 11:26:28 +00:00
|
|
|
|
|
1994-11-15 11:11:33 +00:00
|
|
|
|
if (! (acq_pint.is_zero() && acq_pint_iva.is_zero()))
|
|
|
|
|
{
|
|
|
|
|
set_row(rw++, "Totale acquisti indeducibili per passaggi interni@91g%r@107g%r",
|
|
|
|
|
&acq_pint,
|
|
|
|
|
&acq_pint_iva);
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
1994-11-30 09:33:40 +00:00
|
|
|
|
real tot1 = d._r7 + d._r4 + d._r9 + acq_pint;
|
|
|
|
|
real tot2 = d._r8 + d._r5 + d._r10 + acq_pint_iva;
|
|
|
|
|
|
|
|
|
|
if (tot1 != d._r4 || tot2 != d._r5)
|
|
|
|
|
set_row(rw++,"Totale Generale IVA@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r",
|
|
|
|
|
&(d._r0),
|
|
|
|
|
&(d._r1),
|
|
|
|
|
&(d._r2),
|
|
|
|
|
&(d._r3),
|
|
|
|
|
&tot1,
|
|
|
|
|
&tot2);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-01-18 10:54:05 +00:00
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_ptm(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
|
1994-12-06 10:30:52 +00:00
|
|
|
|
bool printed = FALSE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
1994-12-01 14:48:17 +00:00
|
|
|
|
real spgn(d._s2);
|
|
|
|
|
real spgn_iva(d._s3);
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
int row = 5;
|
|
|
|
|
|
1994-12-06 10:30:52 +00:00
|
|
|
|
if (!(d._r8.is_zero() && d._r9.is_zero()))
|
|
|
|
|
{
|
|
|
|
|
printed = TRUE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(row++, "Cessione beni ammortizzabili@50g%r@69g%r",
|
|
|
|
|
&(d._r8),
|
|
|
|
|
&(d._r9));
|
1994-12-06 10:30:52 +00:00
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (! (d._r4.is_zero() && d._r5.is_zero()))
|
1994-12-06 10:30:52 +00:00
|
|
|
|
{
|
|
|
|
|
printed = TRUE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(row++, "Acquisto beni destinati alla rivendita@50g%r@69g%r",
|
|
|
|
|
&(d._r4),
|
|
|
|
|
&(d._r5));
|
1994-12-06 10:30:52 +00:00
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
if (! (d._r0.is_zero() && d._r1.is_zero()))
|
1994-12-06 10:30:52 +00:00
|
|
|
|
{
|
|
|
|
|
printed = TRUE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(row++, "Acquisto beni ammortizzabili IVA detraibile@50g%r@69g%r",
|
|
|
|
|
&(d._r0),
|
|
|
|
|
&(d._r1));
|
1994-12-06 10:30:52 +00:00
|
|
|
|
}
|
1994-12-27 16:28:35 +00:00
|
|
|
|
if (!(spgn.is_zero() && spgn_iva.is_zero()))
|
1994-12-06 10:30:52 +00:00
|
|
|
|
{
|
1995-01-18 10:54:05 +00:00
|
|
|
|
printed = TRUE;
|
1994-12-01 14:48:17 +00:00
|
|
|
|
set_row(row++, "Spese generali@50g%r@69g%r",
|
|
|
|
|
&spgn,
|
|
|
|
|
&spgn_iva);
|
1994-12-06 10:30:52 +00:00
|
|
|
|
}
|
1994-12-27 16:28:35 +00:00
|
|
|
|
if (!(d._r6.is_zero() && d._r7.is_zero()))
|
1994-12-06 10:30:52 +00:00
|
|
|
|
{
|
|
|
|
|
printed = TRUE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(row++, "Altri beni strumentali acquisiti in leasing@50g%r@69g%r",
|
|
|
|
|
&(d._r6),
|
1994-12-06 10:30:52 +00:00
|
|
|
|
&(d._r7));
|
|
|
|
|
}
|
1994-12-27 16:28:35 +00:00
|
|
|
|
if (!(d._r2.is_zero() && d._r3.is_zero()))
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1994-12-06 10:30:52 +00:00
|
|
|
|
printed = TRUE;
|
1994-12-01 14:48:17 +00:00
|
|
|
|
real rn = d._r2 * real(DETRAZIONE_6PERCENTO);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(row++, "Acquisto beni soggetti a detrazione (6%%)"
|
1994-11-11 11:26:28 +00:00
|
|
|
|
"@50g%r@69g%r@86g%r",
|
1994-09-22 07:46:09 +00:00
|
|
|
|
&(d._r2),
|
|
|
|
|
&(d._r3),
|
|
|
|
|
&rn);
|
|
|
|
|
}
|
1995-01-18 10:54:05 +00:00
|
|
|
|
if (d._f0)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1994-12-06 10:30:52 +00:00
|
|
|
|
printed = TRUE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
|
|
|
|
(const char*)(d._s0),
|
|
|
|
|
&(d._r11));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// items vari per dichiarazione annuale
|
|
|
|
|
for (int i = 0; i < d._arr.items(); i++)
|
1994-12-06 10:30:52 +00:00
|
|
|
|
{
|
1994-09-22 07:46:09 +00:00
|
|
|
|
_DescrItem& dd = (_DescrItem&)d._arr[i];
|
1994-12-27 16:28:35 +00:00
|
|
|
|
printed |= set_annual(dd);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
1994-12-06 10:30:52 +00:00
|
|
|
|
if (printed)
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"");
|
|
|
|
|
set_row(2,"");
|
|
|
|
|
set_row(3,"ALTRI DATI RELATIVI ALLA DICHIARAZIONE@55gimponibile"
|
|
|
|
|
"@77gimposta@91gdetrazione");
|
|
|
|
|
set_row(4,"");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
set_row(1,"");
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// form feed
|
|
|
|
|
set_auto_ff(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_grand(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
set_row(1,""); set_row(2,""); set_row(3,""); set_row(4,"");
|
|
|
|
|
set_row(5,"@11g@bCALCOLO LIQUIDAZIONE D'IMPOSTA@r");
|
|
|
|
|
set_row(6,""); int rw = 7;
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_row(rw++," @66gCredito@84gDebito"); set_row(rw++,"");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(rw++,"@11gIva sulle operazioni di vendita@75g%r", &(d._r0));
|
1995-01-12 14:46:51 +00:00
|
|
|
|
set_row(rw++,"%s@11gRettifiche IVA a debito@75g%r",
|
|
|
|
|
_is_visliq ? "$[r]" : "", &(d._r5));
|
|
|
|
|
set_row(rw++,"%s@11gIva chiesta a rimborso@75g%r",
|
|
|
|
|
_is_visliq ? "$[r]" : "", &(d._r4));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
real rd = d._r0 + d._r5 + d._r4;
|
1995-01-12 14:46:51 +00:00
|
|
|
|
real vers;
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// conguaglio prorata
|
1994-11-14 11:50:04 +00:00
|
|
|
|
if (d._r9.sign() < 0)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1994-11-14 11:50:04 +00:00
|
|
|
|
real r = abs(d._r9);
|
|
|
|
|
set_row(rw++,"@11gConguaglio pro-rata@58g%r", &r);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// debito liq. precedente < 50000
|
1995-01-19 10:00:40 +00:00
|
|
|
|
if (d._r10 > ZERO)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
rd += d._r10;
|
|
|
|
|
set_row(rw++,"@11gDebito da liquidazione precedente@75g%r", &(d._r10));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_row(rw++,"@11gRISULTATO@75g%r", &rd);
|
|
|
|
|
set_row(rw++,"@11gIva sulle operazioni di acquisto@58g%r", &(d._r1));
|
|
|
|
|
|
|
|
|
|
// credito precedente scorporato dell'acconto
|
|
|
|
|
d._r7 -= d._r8;
|
|
|
|
|
set_row(rw++,"@11gCredito precedente@58g%r", &(d._r7));
|
|
|
|
|
|
1994-12-16 10:14:26 +00:00
|
|
|
|
if ((_is_visliq && _month == 12) || !(d._r8.is_zero()))
|
|
|
|
|
set_row(rw++,"%s@11gVersamento acconto dicembre@58g%r",
|
|
|
|
|
_is_visliq ? "$[r]" : "", &(d._r8));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
1994-11-11 11:26:28 +00:00
|
|
|
|
if (!(d._r11.is_zero()))
|
|
|
|
|
set_row(rw++,"@11gUlteriori detrazioni@58g%r", &(d._r11));
|
|
|
|
|
|
1995-01-12 14:46:51 +00:00
|
|
|
|
set_row(rw++,"%s@11gRettifiche IVA a credito@58g%r",
|
|
|
|
|
_is_visliq ? "$[r]" : "", &(d._r6));
|
1994-11-11 11:26:28 +00:00
|
|
|
|
real rc = d._r1 + d._r7 + d._r8 + d._r6 -d._r11;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
// conguaglio prorata
|
|
|
|
|
if (d._r9.sign() < 0) rc -= d._r9;
|
|
|
|
|
|
1995-01-12 14:46:51 +00:00
|
|
|
|
// versamenti effettuati
|
|
|
|
|
if (!d._s2.empty())
|
1995-01-19 10:39:48 +00:00
|
|
|
|
{
|
|
|
|
|
real unixtihavoluto(d._s2);
|
|
|
|
|
vers = unixtihavoluto;
|
1995-01-12 14:46:51 +00:00
|
|
|
|
rc += vers;
|
|
|
|
|
set_row(rw++,"@11gVersamenti effettuati@58g%r", &vers);
|
|
|
|
|
}
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(rw++,"@11gRISULTATO@58g%r", &rc);
|
|
|
|
|
|
|
|
|
|
real iva = rd - rc;
|
|
|
|
|
char how = iva.sign() < 0 ? 'c' : 'd';
|
|
|
|
|
iva = abs(iva);
|
1994-12-01 14:48:17 +00:00
|
|
|
|
iva.ceil(_isannual ? ROUND_MILLELIRE : ROUND_LIRA);
|
1994-10-26 11:29:09 +00:00
|
|
|
|
|
1994-12-23 11:56:34 +00:00
|
|
|
|
// se non c'e' nulla da versare stampa solo una riga vuota
|
|
|
|
|
// Serve, non toglierla, stronzo.
|
|
|
|
|
if (iva.is_zero())
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
else
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
1994-10-26 11:29:09 +00:00
|
|
|
|
if (how == 'c')
|
1995-01-12 14:46:51 +00:00
|
|
|
|
{
|
1994-10-26 11:29:09 +00:00
|
|
|
|
set_row(rw++,"@23gCREDITO ATTUALE@58g%r",&iva);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1994-10-26 11:29:09 +00:00
|
|
|
|
if (d._f0)
|
|
|
|
|
{
|
|
|
|
|
// trimestrale: interesse
|
|
|
|
|
real interesse = interesse_trimestrale(d._f2);
|
1994-12-01 14:48:17 +00:00
|
|
|
|
real ivi = iva * interesse / CENTO; ivi.ceil(ROUND_LIRA);
|
1994-10-26 11:29:09 +00:00
|
|
|
|
real ivt = iva + ivi;
|
1994-12-01 14:48:17 +00:00
|
|
|
|
ivt.ceil(_isannual ? ROUND_MILLELIRE : ROUND_LIRA);
|
1995-01-12 14:46:51 +00:00
|
|
|
|
|
|
|
|
|
if (!iva.is_zero())
|
|
|
|
|
{
|
|
|
|
|
set_row(rw++,"@23gIVA DOVUTA@75g%r",&iva);
|
|
|
|
|
set_row(rw++,"@23gInteresse %6.2r %%@75g%r",&interesse, &ivi);
|
1994-10-26 11:29:09 +00:00
|
|
|
|
|
1995-01-12 14:46:51 +00:00
|
|
|
|
if (ivt.is_zero() || ivt >= IVA_DA_RIPORTARE || d._f1)
|
|
|
|
|
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&ivt);
|
|
|
|
|
else
|
|
|
|
|
set_row(rw++,"@23gIVA DA VERSARE@85g0 (%s < 50.000)",
|
|
|
|
|
(const char*)ivt.string("."));
|
|
|
|
|
}
|
|
|
|
|
else set_row(rw++,"");
|
1994-10-26 11:29:09 +00:00
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
else
|
1995-01-12 14:46:51 +00:00
|
|
|
|
{
|
|
|
|
|
if (!iva.is_zero())
|
|
|
|
|
{
|
|
|
|
|
if (iva >= IVA_DA_RIPORTARE || d._f1)
|
|
|
|
|
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&iva);
|
|
|
|
|
else
|
|
|
|
|
set_row(rw++,"@23gIVA DA VERSARE@85g0 (%s < 50.000)",
|
|
|
|
|
(const char*)iva.string("."));
|
|
|
|
|
}
|
|
|
|
|
else set_row(rw++,"");
|
1994-10-26 11:29:09 +00:00
|
|
|
|
}
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// rapportini per rimborso infraannuale
|
|
|
|
|
if (d._arr.items() > 0)
|
|
|
|
|
{
|
|
|
|
|
_DescrItem& di = (_DescrItem&)d._arr[0];
|
|
|
|
|
|
1994-11-14 11:50:04 +00:00
|
|
|
|
set_print_zero(TRUE);
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
set_row(rw++, " PROSPETTO DI RIMBORSO");
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
|
|
|
|
|
if (di._f0)
|
1994-11-14 11:50:04 +00:00
|
|
|
|
{
|
1994-09-22 07:46:09 +00:00
|
|
|
|
// esenti
|
|
|
|
|
set_row(rw++,"1) Soggetto con quota di operazioni esenti e non"
|
|
|
|
|
" imponibili superiore al 50%%");
|
|
|
|
|
|
1994-10-24 13:43:30 +00:00
|
|
|
|
real perc = (di._r0/di._r1) * CENTO;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
TString sep(strlen(REAL_PICTURE)+2); sep.fill('-');
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
set_row(rw++,"@26gTotale operazioni esenti e non imp.@66g%r",
|
|
|
|
|
&(di._r0));
|
|
|
|
|
set_row(rw++,"@66g%t x 100 = %5.2r", &sep, &perc);
|
|
|
|
|
set_row(rw++,"@26gVolume di affari lordo@66g%r", &(di._r1));
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (di._f1)
|
|
|
|
|
{
|
|
|
|
|
set_row(rw++,"2) Soggetto con acquisti ad aliquota media "
|
|
|
|
|
"superiore a quella delle vendite");
|
|
|
|
|
TString sep(strlen(REAL_PICTURE)+2); sep.fill('-');
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
set_row(rw++,"@26gTotale imposte sugli acquisti@66g%r", &(di._r5));
|
|
|
|
|
set_row(rw++,"@66g%t x 100 = %5.2r", &sep, &(di._r7));
|
|
|
|
|
set_row(rw++,"@26gTotale imponibili sugli acquisti@66g%r",
|
|
|
|
|
&(di._r3));
|
|
|
|
|
set_row(rw++,"");
|
|
|
|
|
set_row(rw++,"@26gTotale imposte sulle vendite@66g%r", &(di._r4));
|
|
|
|
|
set_row(rw++,"@66g%t x 100 = %5.2r", &sep, &(di._r6));
|
|
|
|
|
set_row(rw++,"@26gTotale imponibili sulle vendite@66g%r", &(di._r2));
|
1994-11-14 11:50:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_print_zero(FALSE);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
1994-12-16 10:14:26 +00:00
|
|
|
|
|
|
|
|
|
if (!_is_visliq) set_auto_ff(TRUE);
|
|
|
|
|
else set_auto_ff(FALSE);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-12-27 16:28:35 +00:00
|
|
|
|
bool TLiquidazione_app::set_annual(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
// chiamata internamente a set_pims
|
1994-12-27 16:28:35 +00:00
|
|
|
|
bool ret = FALSE;
|
|
|
|
|
|
1994-09-22 07:46:09 +00:00
|
|
|
|
int row = get_maxrow()+1;
|
|
|
|
|
if (d._f0 & IS_PRORATA)
|
1994-12-27 16:28:35 +00:00
|
|
|
|
{
|
|
|
|
|
ret = TRUE;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_print_zero(TRUE);
|
|
|
|
|
set_row(row++,"");
|
|
|
|
|
set_row(row++,"CALCOLO DELLA PERCENTUALE DI INDETRAIBILITA'");
|
|
|
|
|
set_row(row++,"");
|
|
|
|
|
set_row(row++,"Operazioni esenti riga B1@30g%r", &(d._r1));
|
|
|
|
|
set_row(row++,"Operazioni esenti riga B2@30g%r", &(d._r4));
|
|
|
|
|
set_row(row++,"Operazioni esenti riga B3@30g%r", &(d._r5));
|
|
|
|
|
set_row(row++,"Volume d'affari riga B4@30g%r", &(d._r0));
|
|
|
|
|
set_row(row++,"Indetraibilita' @40g%2.2r%%", &(d._r2));
|
|
|
|
|
if (!(d._r3.is_zero()))
|
|
|
|
|
{
|
|
|
|
|
real ccc = abs(d._r3);
|
|
|
|
|
set_row(row++,"Conguaglio a %s@30g%r", d._r3.sign() < 0 ? "credito" :
|
|
|
|
|
"debito", &ccc);
|
|
|
|
|
}
|
|
|
|
|
set_print_zero(FALSE);
|
|
|
|
|
}
|
1994-12-27 16:28:35 +00:00
|
|
|
|
return ret;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_ventila(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
if (d._arr.items() == 0 || d._r0.is_zero())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
set_row(1,"@54gPROSPETTO VENTILAZIONE");
|
|
|
|
|
set_row(2,"");
|
|
|
|
|
set_row(3,"");
|
|
|
|
|
set_row(4,"@10gTotale acquisti destinati alla rivendita@55g%r",
|
|
|
|
|
&(d._r0));
|
|
|
|
|
set_row(5,"@10gTotale dei corrispettivi da ventilare@55g%r",
|
|
|
|
|
&(d._r1));
|
|
|
|
|
real m = d._r1 / d._r0;
|
|
|
|
|
set_row(6,"@10gMoltiplicatore@59g%3.9r",&m);
|
|
|
|
|
set_row(7,"");
|
|
|
|
|
set_row(8,"@10gCod.");
|
|
|
|
|
set_row(9,"@10gIVA@17gDescrizione@48gAcquisti"
|
|
|
|
|
"@65gImponibile vendite@89gImposta vendite");
|
|
|
|
|
set_row(10,"");
|
|
|
|
|
int row = 11;
|
|
|
|
|
real t1, t2, t3;
|
|
|
|
|
for(int i = 0; i < d._arr.items(); i++)
|
|
|
|
|
{
|
|
|
|
|
_vDesc& vd = (_vDesc&)d._arr[i];
|
|
|
|
|
look_iva(vd._codiva);
|
|
|
|
|
TString s0 = _iva->get("S0");
|
|
|
|
|
set_row(row+i,"@8g%5s@17g%s@41g%r@68g%r@89g%r",
|
|
|
|
|
(const char*)vd._codiva,
|
|
|
|
|
(const char*)s0,
|
|
|
|
|
&(vd._acq),
|
|
|
|
|
&(vd._vnd),
|
|
|
|
|
&(vd._viv));
|
|
|
|
|
t1 += vd._acq;
|
|
|
|
|
t2 += vd._vnd;
|
|
|
|
|
t3 += vd._viv;
|
|
|
|
|
}
|
|
|
|
|
set_row(row+i+1,"");
|
|
|
|
|
set_row(row+i+2,"@10gTotale@41g%r@68g%r@89g%r",
|
|
|
|
|
&t1, &t2, &t3);
|
|
|
|
|
set_auto_ff(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_regagr(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
set_print_zero(TRUE);
|
|
|
|
|
|
|
|
|
|
set_row(1,"@50gPROSPETTO REGIME AGRICOLO");
|
|
|
|
|
set_row(2,"");
|
1995-01-19 16:12:58 +00:00
|
|
|
|
set_row(3, "Cessioni in regime agricolo (Tabella A/I)@54g%r",&(d._r0));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(4, "");
|
1995-01-19 16:12:58 +00:00
|
|
|
|
set_row(5, "Cessioni non in regime agricolo@54g%r",&(d._r1));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(6, "");
|
1995-01-19 16:12:58 +00:00
|
|
|
|
set_row(7, "Acquisti in regime agricolo@54g%r",&(d._r2));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_row(8, "");
|
1995-01-19 16:12:58 +00:00
|
|
|
|
set_row(9, "Acquisti non in regime agricolo@54g%r",&(d._r3));
|
|
|
|
|
set_row(10, "... di cui beni ammortizzabili@54g%r",&(d._r4));
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
set_auto_ff(TRUE);
|
|
|
|
|
set_print_zero(FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
// the longest & stronzest
|
|
|
|
|
|
|
|
|
|
// Nel corso della scrittura di questa funzione
|
|
|
|
|
// Berlusconi + Fini + Bossi hanno vinto le elezioni
|
|
|
|
|
// Il moderno imprenditore illuminato dalla fiamma tricolore
|
|
|
|
|
// ha rincoglionito gli imbecilli con la TV
|
|
|
|
|
// Che la rovina, la galera e la giustizia rossa
|
|
|
|
|
// possano aver campo su tutto
|
|
|
|
|
|
|
|
|
|
set_print_zero(TRUE);
|
|
|
|
|
|
|
|
|
|
set_row(1,"");
|
|
|
|
|
set_row(2,"@54gRIEPILOGO 74 TER");
|
|
|
|
|
set_row(3,"");
|
|
|
|
|
set_row(4,"Ammontare dei corrispettivi relativi a viaggi eseguiti"
|
|
|
|
|
" interamente nella CEE .....................@100g%r", &(d._r0));
|
|
|
|
|
set_row(5,"Ammontare dei corrispettivi relativi a viaggi misti (dentro"
|
|
|
|
|
" e fuori CEE) ......................... @100g%r", &(d._r1));
|
|
|
|
|
set_row(6,"Ammontare dei corrispettivi relativi a viaggi eseguiti"
|
|
|
|
|
" interamente fuori CEE ..................... @100g%r", &(d._r2));
|
|
|
|
|
|
|
|
|
|
real tc = d._r0 + d._r1 + d._r2;
|
|
|
|
|
|
|
|
|
|
set_row(7,"");
|
|
|
|
|
set_row(8,"@56gTotale corrispettivi@100g%r", &tc);
|
|
|
|
|
set_row(9,"");
|
|
|
|
|
|
|
|
|
|
set_row(10,"Ammontare dei costi relativi a viaggi interamente"
|
|
|
|
|
" svolti nella CEE ............................... @100g%r",
|
|
|
|
|
&(d._r3));
|
|
|
|
|
set_row(11,"Ammontare dei costi relativi a viaggi misti (per la"
|
|
|
|
|
" parte CEE) ................................... @100g%r",
|
|
|
|
|
&(d._r4));
|
|
|
|
|
set_row(12,"Ammontare dei costi relativi a viaggi interamente"
|
|
|
|
|
" svolti fuori CEE ............................... @100g%r",
|
|
|
|
|
&(d._r5));
|
|
|
|
|
set_row(13,"Ammontare dei costi relativi a viaggi misti (per la"
|
|
|
|
|
" parte fuori CEE) .............................@100g%r",
|
|
|
|
|
&(d._r6));
|
|
|
|
|
|
|
|
|
|
real tco = d._r3 + d._r4 + d._r5 + d._r6;
|
|
|
|
|
|
|
|
|
|
set_row(14,"");
|
|
|
|
|
set_row(15,"@64gTotale costi@100g%r", &tco);
|
|
|
|
|
|
|
|
|
|
set_row(16,"");
|
|
|
|
|
set_row(17,"DETERMINAZIONE CORRISPETTIVI IMPONIBILI "
|
|
|
|
|
"RELATIVI A VIAGGI MISTI");
|
|
|
|
|
set_row(18,"");
|
|
|
|
|
|
|
|
|
|
// la bella frazioncina della percentuale di ripartizione
|
|
|
|
|
TString tmp(d._r4.string(REAL_PICTURE)); tmp.ltrim();
|
|
|
|
|
TString up = tmp;
|
|
|
|
|
up << " x 100";
|
|
|
|
|
TString dn = tmp;
|
|
|
|
|
tmp = d._r6.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
dn << " + " << tmp;
|
|
|
|
|
int ln = max(up.len(), dn.len()) + 2;
|
|
|
|
|
TString den(ln); den.fill('-');
|
|
|
|
|
up.center_just(ln); dn.center_just(ln);
|
1995-01-18 10:54:05 +00:00
|
|
|
|
real rip = d._r7; rip.round(2);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
// la bella frazioncina degli imponibili viaggi misti
|
|
|
|
|
TString tmp2 = d._r1.string(REAL_PICTURE); tmp2.ltrim();
|
|
|
|
|
TString up2 = tmp;
|
|
|
|
|
up2 << " x " << rip.string(2);
|
|
|
|
|
TString dn2 = "100";
|
|
|
|
|
int ln2 = max(up2.len(), 3) + 2;
|
|
|
|
|
TString den2(ln2); den2.fill('-');
|
|
|
|
|
up2.center_just(ln2); dn2.center_just(ln2);
|
|
|
|
|
|
|
|
|
|
// la gran frazionazza centrata e stupenda
|
|
|
|
|
int tot = 35 + ln + ln2;
|
|
|
|
|
int rem1 = (100 - tot)/2; if (rem1 < 0) rem1 = 0;
|
|
|
|
|
int pos1 = rem1 + 13;
|
|
|
|
|
int rem2 = pos1+ den.len() + 11;
|
|
|
|
|
int pos2 = rem2 + 20;
|
|
|
|
|
|
1995-01-18 10:54:05 +00:00
|
|
|
|
real cim = (d._r1 * d._r7)/CENTO; cim.round(ROUND_LIRA);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
set_row(19,format("@%dg%%t@%dg%%t", pos1, pos2),
|
|
|
|
|
&up, &up2);
|
|
|
|
|
set_row(20,format("@%dgPerc. rip. = %%t = %%5.2r; @%dg"
|
|
|
|
|
"Imp. viaggi misti = %%t = @100g%%r",
|
|
|
|
|
rem1, rem2),
|
|
|
|
|
&den, &rip, &den2, &cim);
|
|
|
|
|
set_row(21,format("@%dg%%t@%dg%%t", pos1, pos2),
|
|
|
|
|
&dn, &dn2);
|
|
|
|
|
|
|
|
|
|
real tmr = d._r0 + cim;
|
|
|
|
|
|
|
|
|
|
// whew, come dicono su Topolino
|
|
|
|
|
|
|
|
|
|
tmp = d._r0.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up = "("; up << tmp << " + ";
|
|
|
|
|
tmp = cim.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up << tmp << ")";
|
|
|
|
|
den.fill('.',59-up.len());
|
|
|
|
|
set_row(23,"Ammontare dei corrispettivi imponibili@40g%t %t@100g%r",
|
|
|
|
|
&up, &den, &tmr);
|
|
|
|
|
|
|
|
|
|
// se e' l'annuale non ha senso altro
|
1995-01-19 15:07:36 +00:00
|
|
|
|
if (d._f1) return;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
1995-01-18 10:54:05 +00:00
|
|
|
|
real tma = d._r3 + d._r4;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
tmp = d._r3.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up = "("; up << tmp << " + ";
|
|
|
|
|
tmp = d._r4.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up << tmp << ")";
|
|
|
|
|
den.fill('.',59-up.len());
|
|
|
|
|
set_row(24,"Ammontare dei costi deducibili@40g%t %t@100g%r",
|
1995-01-18 10:54:05 +00:00
|
|
|
|
&up, &den, &tma);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
den.fill('.',60);
|
|
|
|
|
set_row(25,"Credito di costo precedente @40g%t@100g%r", &den, &(d._r8));
|
|
|
|
|
|
1995-01-18 10:54:05 +00:00
|
|
|
|
real bil = tmr - tma - d._r8;
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
bool iscred = bil.sign() < 0;
|
|
|
|
|
bil = abs(bil);
|
|
|
|
|
|
|
|
|
|
tmp = d._r0.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up = "["; up << tmp << " - (";
|
|
|
|
|
tmp = tmr.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up << tmp << " + ";
|
|
|
|
|
tmp = d._r8.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up << tmp << ")]";
|
|
|
|
|
den.fill('.',59-up.len());
|
|
|
|
|
|
|
|
|
|
set_row(27,"");
|
|
|
|
|
if (iscred)
|
|
|
|
|
{
|
|
|
|
|
set_row(26,"");
|
|
|
|
|
set_row(iscred ? 28 : 26,"%s@40g%t %t@100g%r",
|
|
|
|
|
iscred ? "CREDITO DI COSTO " : "Base imponibile lorda",
|
|
|
|
|
&up, &den, &bil);
|
|
|
|
|
}
|
1995-01-18 10:54:05 +00:00
|
|
|
|
else if (bil.sign() > 0)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
real aliva = aliquota_agvia();
|
1995-01-18 10:54:05 +00:00
|
|
|
|
real dovuta = (bil/((aliva+CENTO)/CENTO)) * (aliva/CENTO);
|
|
|
|
|
dovuta.round(ROUND_LIRA);
|
1994-09-22 07:46:09 +00:00
|
|
|
|
|
|
|
|
|
tmp = bil.string(REAL_PICTURE); tmp.ltrim();
|
|
|
|
|
up = tmp;
|
|
|
|
|
up << " x " << aliva.string(5,2);
|
|
|
|
|
dn = "100";
|
|
|
|
|
ln = max(up.len(), 3) + 2;
|
|
|
|
|
den.fill('-',ln);
|
|
|
|
|
up.center_just(ln); dn.center_just(ln);
|
|
|
|
|
|
|
|
|
|
tmp.fill('.', 59 - den.len());
|
|
|
|
|
|
|
|
|
|
set_row(28,"@40g%t",&up);
|
|
|
|
|
set_row(29,"IVA A DEBITO@40g%t %t@100g%r", &den, &tmp, &dovuta);
|
|
|
|
|
set_row(30,"@40g%t", &dn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set_print_zero(FALSE);
|
|
|
|
|
set_auto_ff(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_acconto_p(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
set_print_zero(TRUE);
|
|
|
|
|
|
|
|
|
|
set_row(1,"%t@8g%t",&(d._s0), &(d._s1));
|
|
|
|
|
if (d._f2) set_row(1,"@50g@b*** ERRORE: liquidazione anno precedente "
|
|
|
|
|
"non presente ***@r");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (d._f0) // base anno in corso
|
|
|
|
|
{
|
|
|
|
|
if (d._f1) // stampa base di calcolo
|
|
|
|
|
{
|
|
|
|
|
real bc = d._r0;
|
|
|
|
|
if (bc.sign() < 0)
|
|
|
|
|
{
|
|
|
|
|
bc = abs(bc);
|
|
|
|
|
set_row(1,"@73g%r@86g%r@119g%s", &bc, &d._r1,
|
|
|
|
|
d._f3 ? "Si" : "No");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@55g%r@86g%r@119g%s", &bc, &(d._r1),
|
|
|
|
|
d._f3 ? "Si" : "No");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@51g%r@75g%s", &(d._r1), d._f3 ? "Si" : "No");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (d._f1) // stampa base di calcolo
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@57g%r@85g%r", &(d._r0), &(d._r1));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@85g%r",&(d._r1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
set_print_zero(FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 15:49:47 +00:00
|
|
|
|
void TLiquidazione_app::set_acchead_p(_DescrItem& d)
|
1994-09-22 07:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
reset_header();
|
1994-10-24 13:43:30 +00:00
|
|
|
|
set_header(1,"Gestione IVA@109gData @<@125gPag. @#");
|
1994-09-22 07:46:09 +00:00
|
|
|
|
set_header(3,sep);
|
|
|
|
|
|
|
|
|
|
if (d._f0) // base anno in corso
|
|
|
|
|
{
|
|
|
|
|
set_header(2,"@40gCALCOLO ACCONTI IVA DICEMBRE "
|
|
|
|
|
"1994 (base anno in corso)");
|
|
|
|
|
if (d._f1) // stampa base calcolo
|
|
|
|
|
{
|
|
|
|
|
set_header(4,"@51g------- Base di calcolo -------");
|
|
|
|
|
set_header(5,"@1gDitta@8gDenominazione@55gDebito@73gCredito"
|
|
|
|
|
"@86gACCONTO calcolato@109gLiq. differita");
|
|
|
|
|
set_header(6,sep);
|
|
|
|
|
set_header(7,"");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_header(4,"@1gDitta@8gDenominazione@51gACCONTO calcolato"
|
|
|
|
|
"@75gLiq. differita");
|
|
|
|
|
set_header(5,sep);
|
|
|
|
|
set_header(6,"");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_header(5,sep);
|
|
|
|
|
set_header(6,"");
|
|
|
|
|
if (d._f1)
|
|
|
|
|
set_header(4,"@1gDitta@8gDenominazione@57gBase di calcolo"
|
|
|
|
|
"@85gACCONTO calcolato");
|
|
|
|
|
else
|
|
|
|
|
set_header(4,"@1gDitta@8gDenominazione@85gACCONTO calcolato");
|
|
|
|
|
}
|
|
|
|
|
}
|