Agenzie di viaggio, regimi agricoli e minchie di pollo vanno da dio
git-svn-id: svn://10.65.10.50/trunk@1197 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
383c9efa3e
commit
bc6e3fe620
@ -80,6 +80,7 @@ enum tbc { precedente = 1, incorso = 2};
|
||||
#define ACCHEAD 14 // header prospetto acconti
|
||||
#define DELDEB 15 // righe tabulato deleghe ditte a debito
|
||||
#define DELCRED 16 // header tabulato deleghe ditte a credito
|
||||
#define DELEGA 17 // descrizione versamenti
|
||||
|
||||
// ...............................................................
|
||||
// support structs
|
||||
@ -138,6 +139,7 @@ public:
|
||||
_r6, _r7, _r8,
|
||||
_r9, _r10,_r11;
|
||||
TArray _arr;
|
||||
TDate _d0;
|
||||
|
||||
_DescrItem(word f) : _f0(0), _f1(0), _f2(0)
|
||||
{ _flags = f; }
|
||||
@ -371,6 +373,8 @@ public:
|
||||
void describe_error(const char* errstr, const char* codatt);
|
||||
void describe_annual(const char* codatt);
|
||||
void describe_consistence(const char* codatt);
|
||||
|
||||
_DescrItem* describe_deleghe(int month);
|
||||
|
||||
// corrispettivi
|
||||
void recalc_corrispettivi (int month, const char* codatt);
|
||||
@ -431,6 +435,9 @@ public:
|
||||
bool look_lia(long ditta = 0l, bool create = FALSE, int anno = 0);
|
||||
bool look_rmb(int month, const char* codiva, tiporeg tr, bool create);
|
||||
|
||||
// trova il mytical ufficio concessione da mettere nelle deleghe
|
||||
bool look_conc(TString& uffcon, TString& uffiva);
|
||||
|
||||
_VendItem* look_vendita(int m, const char* codreg);
|
||||
_VentItem* look_ventilation(int m, const char* codreg);
|
||||
|
||||
|
255
cg/cg4301.cpp
255
cg/cg4301.cpp
@ -309,7 +309,7 @@ bool TLiquidazione_app::update_att(int month, const char* codatt,
|
||||
recalc_att(month,codatt);
|
||||
if (month == 13)
|
||||
recalc_annual(codatt);
|
||||
else
|
||||
else if (!_isagricolo)
|
||||
{
|
||||
// nei PIM della 13a vanno solo alcune stranezze,
|
||||
// mi rifiuto di pensare che vadano ventilate
|
||||
@ -372,48 +372,58 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
// occhecasino. Se _comp_acconto e' TRUE, i movimenti considerati
|
||||
// saranno solo quelli di dicembre per data <= 20/12;
|
||||
{
|
||||
real totintra = 0.0;
|
||||
real nond19_imp = 0.0;
|
||||
real nond19_iva = 0.0;
|
||||
real ammort = 0.0;
|
||||
real ammort_iva = 0.0;
|
||||
real ammort_6 = 0.0;
|
||||
real ammort_6_iva = 0.0;
|
||||
real acq_riv = 0.0;
|
||||
real acq_riv_iva = 0.0;
|
||||
real leasing = 0.0;
|
||||
real leasing_iva = 0.0;
|
||||
real cess_amm = 0.0;
|
||||
real cess_amm_iva = 0.0;
|
||||
real acquisti = 0.0;
|
||||
real acquisti_iva = 0.0;
|
||||
real vendite = 0.0;
|
||||
real vendite_iva = 0.0;
|
||||
real esenti_b1 = 0.0;
|
||||
real esenti_b2 = 0.0;
|
||||
real esenti_b3 = 0.0;
|
||||
real esenti_b14 = 0.0;
|
||||
real corr_CEE = 0.0;
|
||||
real corr_noCEE = 0.0;
|
||||
real acq_CEE = 0.0;
|
||||
real acq_noCEE = 0.0;
|
||||
real corr_misCEE = 0.0;
|
||||
real acq_misCEE = 0.0;
|
||||
real acq_misnoCEE = 0.0;
|
||||
real agr_1 = 0.0;
|
||||
real agr_2 = 0.0;
|
||||
real agr_3 = 0.0;
|
||||
real agr_4 = 0.0;
|
||||
real agr_5 = 0.0;
|
||||
real agr_6 = 0.0;
|
||||
real for_rimb = 0.0;
|
||||
real acq_ies = 0.0;
|
||||
real acq_ies_iva = 0.0;
|
||||
real ult_detr = 0.0;
|
||||
real acq_pint = 0.0;
|
||||
real acq_pint_iva = 0.0;
|
||||
real spgen = 0.0;
|
||||
real spgen_iva = 0.0;
|
||||
real totintra = 0.0;
|
||||
real nond19_imp = 0.0;
|
||||
real nond19_iva = 0.0;
|
||||
real ammort_det = 0.0;
|
||||
real ammort_det_iva = 0.0;
|
||||
real ammort_indet = 0.0;
|
||||
real ammort_indet_iva = 0.0;
|
||||
real ammort_6 = 0.0;
|
||||
real ammort_6_iva = 0.0;
|
||||
real acq_riv = 0.0;
|
||||
real acq_riv_iva = 0.0;
|
||||
real leasing = 0.0;
|
||||
real leasing_iva = 0.0;
|
||||
real cess_amm = 0.0;
|
||||
real cess_amm_iva = 0.0;
|
||||
real acquisti = 0.0;
|
||||
real acquisti_iva = 0.0;
|
||||
real vendite = 0.0;
|
||||
real vendite_iva = 0.0;
|
||||
real esenti_b1 = 0.0;
|
||||
real esenti_b2 = 0.0;
|
||||
real esenti_b3 = 0.0;
|
||||
real esenti_b14 = 0.0;
|
||||
real corr_CEE = 0.0;
|
||||
real corr_noCEE = 0.0;
|
||||
real acq_CEE = 0.0;
|
||||
real acq_noCEE = 0.0;
|
||||
real corr_misCEE = 0.0;
|
||||
real acq_misCEE = 0.0;
|
||||
real acq_misnoCEE = 0.0;
|
||||
real agr_1 = 0.0;
|
||||
real agr_2 = 0.0;
|
||||
real agr_3 = 0.0;
|
||||
real agr_4 = 0.0;
|
||||
real agr_5 = 0.0;
|
||||
real agr_6 = 0.0;
|
||||
real agr_7 = 0.0;
|
||||
real for_rimb = 0.0;
|
||||
real acq_ies = 0.0;
|
||||
real acq_ies_iva = 0.0;
|
||||
real ult_detr = 0.0;
|
||||
real acq_pint = 0.0;
|
||||
real acq_pint_iva = 0.0;
|
||||
real spgen = 0.0;
|
||||
real spgen_iva = 0.0;
|
||||
real assp_imp = 0.0;
|
||||
real assp_iva = 0.0;
|
||||
real vssp_imp = 0.0;
|
||||
real vssp_iva = 0.0;
|
||||
real bdog_imp = 0.0;
|
||||
real bdog_iva = 0.0;
|
||||
|
||||
|
||||
*_cur = 0;
|
||||
long items = _cur->items();
|
||||
@ -518,19 +528,19 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
*/
|
||||
if (_month == 13)
|
||||
{
|
||||
// si contano soltanto le vendite.
|
||||
bool okc = tipomov == vendita;
|
||||
// purche' ...
|
||||
bool cond1 = (rcs.get_bool("AUTOFATT") && tipoiva == "NS" && tipodoc == "AF");
|
||||
// oppure ...
|
||||
bool cond2 = (rcs.get_bool("AUTOFATT") && tipoiva == "NS" && tipodoc != "AF" &&
|
||||
// si contano soltanto le vendite.
|
||||
bool okc = tipomov == vendita;
|
||||
// purche' ...
|
||||
bool cond1 = (rcs.get_bool("AUTOFATT") && tipoiva == "NS" && tipodoc == "AF");
|
||||
// oppure ...
|
||||
bool cond2 = (rcs.get_bool("AUTOFATT") && tipoiva == "NS" && tipodoc != "AF" &&
|
||||
rcs.get_bool("INTRACOM") && rcs.get_bool("VALINTRA"));
|
||||
/*
|
||||
* Fatture in ritardo vengono considerate solo in dichiarazione
|
||||
* annuale, ma vanno comunque sommate per i porci registri
|
||||
*/
|
||||
if (!(okc && (cond1 || cond2)) && !fattrit)
|
||||
continue;
|
||||
/*
|
||||
* Fatture in ritardo vengono considerate solo in dichiarazione
|
||||
* annuale, ma vanno comunque sommate per i porci registri
|
||||
*/
|
||||
if (!(okc && (cond1 || cond2)) && !fattrit)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -545,12 +555,16 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
{
|
||||
asimp_imp = imponibile;
|
||||
asimp_iva = imposta;
|
||||
}
|
||||
}
|
||||
assp_imp += asimp_imp;
|
||||
assp_iva += asimp_iva;
|
||||
vssp_imp += vsimp_imp;
|
||||
vssp_iva += vsimp_iva;
|
||||
}
|
||||
else if (fattrit && _month != 13)
|
||||
{
|
||||
rit_imp = imponibile;
|
||||
rit_iva = imposta;
|
||||
rit_imp = imponibile;
|
||||
rit_iva = imposta;
|
||||
}
|
||||
else if (!fattrit) // normale
|
||||
{
|
||||
@ -576,11 +590,17 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
acq_riv_iva += imposta;
|
||||
}
|
||||
|
||||
else if (tipomov == acquisto && tipocr == 2)
|
||||
// Acquisto beni ammortizzabili
|
||||
else if (tipomov == acquisto && tipocr == 2 && tipodet == 0)
|
||||
// Acquisto beni ammortizzabili detraibili
|
||||
{
|
||||
ammort += imponibile;
|
||||
ammort_iva += imposta;
|
||||
ammort_det += imponibile;
|
||||
ammort_det_iva += imposta;
|
||||
}
|
||||
else if (tipomov == acquisto && tipocr == 2 && tipodet != 0)
|
||||
// Acquisto beni ammortizzabili indetraibili
|
||||
{
|
||||
ammort_indet += imponibile;
|
||||
ammort_indet_iva += imposta;
|
||||
}
|
||||
else if (tipomov == acquisto && tipocr == 3)
|
||||
// Acquisto beni ammortizzabili detr. 6%
|
||||
@ -666,7 +686,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
if (tipodoc == "BD")
|
||||
{
|
||||
bolld_imp = imponibile;
|
||||
bolld_iva = imposta;
|
||||
bolld_iva = imposta;
|
||||
|
||||
bdog_imp += bolld_imp;
|
||||
bdog_iva += bolld_iva;
|
||||
}
|
||||
|
||||
// plafond
|
||||
@ -681,18 +704,19 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
switch (tipoag)
|
||||
{
|
||||
case 1:
|
||||
if (tipomov == acquisto) acq_CEE += imponibile;
|
||||
else corr_CEE += imponibile;
|
||||
if (tipomov == acquisto) acq_CEE += imponibile + imposta;
|
||||
else corr_CEE += imponibile + imposta;
|
||||
break;
|
||||
case 2:
|
||||
if (tipomov == acquisto) acq_noCEE += imponibile;
|
||||
else corr_noCEE += imponibile;
|
||||
if (tipomov == acquisto) acq_noCEE += imponibile + imposta;
|
||||
else corr_noCEE += imponibile + imposta;
|
||||
break;
|
||||
case 3: corr_misCEE += imponibile; break;
|
||||
case 4: acq_misCEE += imponibile; break;
|
||||
case 5: acq_misnoCEE += imponibile; break;
|
||||
case 3: corr_misCEE += imponibile + imposta; break;
|
||||
case 4: acq_misCEE += imponibile + imposta; break;
|
||||
case 5: acq_misnoCEE += imponibile + imposta; break;
|
||||
}
|
||||
|
||||
|
||||
if (_isagricolo)
|
||||
{
|
||||
/*
|
||||
@ -702,7 +726,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
*/
|
||||
if (tipomov == vendita)
|
||||
{
|
||||
if (tipoagr == 1 && tipoagr == 3)
|
||||
if (tipoagr == 1 || tipoagr == 3)
|
||||
agr_1 += imposta;
|
||||
else if (tipoagr == 2)
|
||||
agr_2 += imposta;
|
||||
@ -716,15 +740,21 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
else
|
||||
agr_4 += imposta;
|
||||
}
|
||||
else
|
||||
else if (tipoagr == 3)
|
||||
{
|
||||
if (tipocr != 2 && tipocr != 3 && tipocr != 8)
|
||||
agr_7 += imposta;
|
||||
}
|
||||
else // ne' 2 ne' 3
|
||||
{
|
||||
if (tipocr != 2 && tipocr != 3 && tipocr != 8)
|
||||
agr_5 += imposta;
|
||||
agr_5 += imposta;
|
||||
else
|
||||
agr_6 += imposta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tipodet == 1) // acquisti indeducibili su ricavi esenti art. 10
|
||||
{
|
||||
acq_ies += imponibile;
|
||||
@ -945,10 +975,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
_pim_r->put("R6",vfs);
|
||||
_pim_r->put("R7",adf);
|
||||
_pim_r->put("R8",adi);
|
||||
_pim_r->put("R9",bdi);
|
||||
_pim_r->put("R10",bdv);
|
||||
_pim_r->put("R13",fci);
|
||||
_pim_r->put("R14",fcv);
|
||||
_pim_r->put("R9",bdi);
|
||||
_pim_r->put("R10",bdv);
|
||||
_pim_r->put("R13",fci);
|
||||
_pim_r->put("R14",fcv);
|
||||
}
|
||||
|
||||
// questi servono per i ricalcoli altrui (classify_pim)
|
||||
@ -1013,17 +1043,26 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
// ---------------------------------------
|
||||
}
|
||||
else if (_isagricolo)
|
||||
{
|
||||
{
|
||||
_plm->put("R5", agr_1);
|
||||
_plm->put("R6", agr_2);
|
||||
_plm->put("R7", agr_3);
|
||||
_plm->put("R8", agr_4);
|
||||
_plm->put("R9", agr_5);
|
||||
_plm->put("R10", agr_6);
|
||||
|
||||
_plm->put("R11", agr_7);
|
||||
|
||||
// Il porco agricoltore spende poco e paga meno
|
||||
vendite_iva = agr_2;
|
||||
acquisti_iva = agr_3 - agr_4;
|
||||
vendite_iva = agr_2;
|
||||
acquisti_iva = agr_3;
|
||||
|
||||
// nuovo calcolo IVA detraibile
|
||||
if (!agr_7.is_zero())
|
||||
{
|
||||
real pdetr = (agr_2 / (agr_1 + agr_2));
|
||||
acquisti_iva += agr_7 * pdetr;
|
||||
acquisti_iva.round(ROUND_LIRA);
|
||||
}
|
||||
}
|
||||
|
||||
_plm->put("R0", vendite_iva);
|
||||
@ -1041,27 +1080,35 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
_pom->put("R0", totintra);
|
||||
_pom->put("R1", nond19_imp);
|
||||
_pom->put("R2", nond19_iva);
|
||||
_pom->put("R3", ammort);
|
||||
_pom->put("R4", ammort_iva);
|
||||
_pom->put("R3", ammort_det);
|
||||
_pom->put("R4", ammort_det_iva);
|
||||
_pom->put("R5", acq_riv);
|
||||
_pom->put("R6", acq_riv_iva);
|
||||
_pom->put("R7", leasing);
|
||||
_pom->put("R8", leasing_iva);
|
||||
_pum->put("R0", cess_amm);
|
||||
_pum->put("R1", cess_amm_iva);
|
||||
_pum->put("R2", ammort_6);
|
||||
_pum->put("R3", ammort_6_iva);
|
||||
_pum->put("R4", esenti_b1);
|
||||
_pum->put("R5", esenti_b2);
|
||||
_pum->put("R6", esenti_b3);
|
||||
_pum->put("R7", esenti_b14);
|
||||
_pam->put("R0", acquisti);
|
||||
_pam->put("R1", vendite);
|
||||
|
||||
_pom->put("R11", ammort_indet);
|
||||
_pom->put("R12", ammort_indet_iva);
|
||||
_pum->put("R0", cess_amm);
|
||||
_pum->put("R1", cess_amm_iva);
|
||||
_pum->put("R2", ammort_6);
|
||||
_pum->put("R3", ammort_6_iva);
|
||||
_pum->put("R4", esenti_b1);
|
||||
_pum->put("R5", esenti_b2);
|
||||
_pum->put("R6", esenti_b3);
|
||||
_pum->put("R7", esenti_b14);
|
||||
_pam->put("R0", acquisti);
|
||||
_pam->put("R1", vendite);
|
||||
_pam->put("R6", assp_imp);
|
||||
_pam->put("R7", assp_iva);
|
||||
_pam->put("R8", vssp_imp);
|
||||
_pam->put("R9", vssp_iva);
|
||||
_pam->put("R4", bdog_imp);
|
||||
_pam->put("R5", bdog_iva);
|
||||
|
||||
_plm->rewrite();
|
||||
_pam->rewrite();
|
||||
_pum->rewrite();
|
||||
_pom->rewrite();
|
||||
_pom->rewrite();
|
||||
}
|
||||
|
||||
void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
@ -1243,11 +1290,11 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
if (_isviaggio)
|
||||
{
|
||||
// calcolo credito costo, debito mensile, perc. ripart.
|
||||
perc_r = (a_mCEE * CENTO)/(a_mCEE + a_meCEE);
|
||||
real c = (c_mCEE * perc_r)/CENTO; c.round(ROUND_LIRA);
|
||||
real tc = (c_iCEE + c);
|
||||
real ta = (a_iCEE + a_mCEE);
|
||||
real bi = tc - ta - credito_costo_prec(month);
|
||||
perc_r = (a_mCEE * CENTO)/(a_mCEE + a_meCEE);
|
||||
real ivm = (c_mCEE * perc_r)/CENTO; ivm.round(ROUND_LIRA);
|
||||
real tc = (c_iCEE + ivm);
|
||||
real ta = (a_iCEE + a_mCEE);
|
||||
real bi = tc - ta - credito_costo_prec(month);
|
||||
|
||||
if (bi.sign() < 0)
|
||||
// credito di costo
|
||||
@ -1397,8 +1444,12 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
_lim->put("R2",cred_cost);
|
||||
_lim->put("R3",deb_mens);
|
||||
_lim->put("R4",perc_r);
|
||||
_lim->put("R6",detrazioni);
|
||||
|
||||
|
||||
if (!_isagricolo)
|
||||
_lim->put("R6",detrazioni);
|
||||
else // per evitare sbagli nei ricalcoli esterni
|
||||
_lim->put("R6","");
|
||||
|
||||
if (month == 13 || differita)
|
||||
{
|
||||
// scrivi totali rettifiche e rimborsi
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <utility.h>
|
||||
#include <lffiles.h>
|
||||
|
||||
#include "cg4300.h"
|
||||
|
||||
@ -435,9 +436,34 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
||||
_del->zero();
|
||||
_del->put("CODTAB",ctab);
|
||||
|
||||
// TBI infila ufficio concessione in S9
|
||||
|
||||
// sistema codice tributo
|
||||
// codici ABI e CAB da anagrafica ditte
|
||||
TString abi = _nditte->lfile().get("ABIBAN");
|
||||
TString cab = _nditte->lfile().get("CABBAN");
|
||||
_del->put("S7", abi);
|
||||
_del->put("S8", cab);
|
||||
|
||||
// descrizione banca
|
||||
TTable ban("%BAN");
|
||||
ban.zero();
|
||||
TString codban = format("%05ld", atol(abi));
|
||||
if (!cab.empty()) codban << format("%05ld", atol(cab));
|
||||
ban.put("CODTAB", codban);
|
||||
if (ban.read() != NOERR)
|
||||
{
|
||||
TString desban(ban.get("S0"));
|
||||
_del->put("S1", desban);
|
||||
}
|
||||
|
||||
// infila ufficio concessione in S9
|
||||
// e descrizione comune in S2
|
||||
TString16 con; TString uva;
|
||||
if (look_conc(con, uva))
|
||||
{
|
||||
_del->put("S9", con);
|
||||
_del->put("S2", uva);
|
||||
}
|
||||
|
||||
// scrive codice tributo
|
||||
int ctri = 6000;
|
||||
if (month == 13 && type == 7)
|
||||
ctri = 6035; // acconto IVA annuale (trimestrali?)
|
||||
@ -584,3 +610,42 @@ real TLiquidazione_app::interesse_trimestrale(int month)
|
||||
real r(cnf.get("InTr", NULL, month));
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
bool TLiquidazione_app::look_conc(TString& uffcon, TString& uffiva)
|
||||
{
|
||||
// piazza nelle TString passate: l'ufficio concessioni
|
||||
// l'ufficio IVA. Quest'ultimo e' preso dall'anagrafica se
|
||||
// c'e', dal comune (primo non vuoto) se non
|
||||
|
||||
// Assume _nditte correctly positioned
|
||||
TString codana(_nditte->lfile().get("TIPOA"));
|
||||
TString ana(_nditte->lfile().get("CODANAGR"));
|
||||
// look anagrafica
|
||||
TLocalisamfile anagr(LF_ANAG);
|
||||
anagr.zero();
|
||||
anagr.put("TIPOA", ana);
|
||||
anagr.put("CODANAGR", codana);
|
||||
if (anagr.read() != NOERR) return FALSE;
|
||||
|
||||
// becca comune residenza fiscale
|
||||
TString com(anagr.get("COMRF"));
|
||||
// se non c'e', residenza
|
||||
if (com.empty())
|
||||
com = anagr.get("COMRIF");
|
||||
|
||||
if (com.empty()) return FALSE;
|
||||
|
||||
// becca comune
|
||||
TLocalisamfile comuni(LF_COMUNI);
|
||||
comuni.zero(); // STATO = "" ovvero ITAGLIA
|
||||
comuni.put("COM", com);
|
||||
if (comuni.read() != NOERR) return FALSE;
|
||||
|
||||
uffcon = comuni.get("UFFCONC");
|
||||
uffiva = comuni.get("DENCOM");
|
||||
if (!comuni.get("PROVCOM").empty())
|
||||
uffiva << " (" << comuni.get("PROVCOM") << ")";
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
309
cg/cg4304.cpp
309
cg/cg4304.cpp
@ -286,16 +286,13 @@ void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
|
||||
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");
|
||||
d->_r2 += _plm->get_real("R7");
|
||||
d->_r3 += _plm->get_real("R8");
|
||||
d->_r4 += _plm->get_real("R9");
|
||||
d->_r5 += _plm->get_real("R10");
|
||||
d->_r6 += _plm->get_real("R11");
|
||||
}
|
||||
_descr_arr.add(d);
|
||||
}
|
||||
@ -323,7 +320,7 @@ void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
||||
// percentuale ripartizione
|
||||
d->_r7 = _lim->get_real("R4");
|
||||
// credito di costo precedente (CHECK annuale)
|
||||
d->_r8 = credito_costo_prec(mese);
|
||||
d->_r8 = credito_costo_prec(month);
|
||||
|
||||
_descr_arr.add(d);
|
||||
}
|
||||
@ -463,8 +460,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
||||
d->_r3 += (cvv /* - vfs */);
|
||||
d->_r0 += ifs; // aggiungo FS alle vendite
|
||||
d->_r1 += vfs;
|
||||
t2 += (cvi /* - ifs */); // idem per i totali
|
||||
t3 += (cvv /* - vfs */);
|
||||
t0 += (cvi /* - ifs */); // idem per i totali (era t2/t3: sk MI0452)
|
||||
t1 += (cvv /* - vfs */); // non sono molto convinto ma vogliono cio'
|
||||
t0 += ifs;
|
||||
t1 += vfs;
|
||||
}
|
||||
@ -542,8 +539,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
||||
d->_r6 += _pom->get_real("R0"); // acq. intracomunitari
|
||||
d->_r7 += _pom->get_real("R1"); // inded. art 19
|
||||
d->_r8 += _pom->get_real("R2"); // IVA su inded. art. 19
|
||||
t->_r0 += _pom->get_real("R3"); // acq. ammortizz.
|
||||
t->_r1 += _pom->get_real("R4"); // IVA acq. ammort.
|
||||
t->_r0 += _pom->get_real("R3"); // acq. ammortizz. detr
|
||||
t->_r1 += _pom->get_real("R4"); // IVA acq. ammort. detr
|
||||
t->_r2 += _pum->get_real("R2"); // ammort. detr. 6%
|
||||
t->_r3 += _pum->get_real("R3"); // IVA ammort detr. 6%
|
||||
t->_r4 += _pom->get_real("R5"); // acq. beni rivendita
|
||||
@ -555,6 +552,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
||||
t->_r10 += _pum->get_real("R4"); // tot. esenti IVA
|
||||
t->_r11 += _plm->get_real("R2"); // pro-rata indetraibile
|
||||
t->_s0 = (_plm->get_real("R12")).string(); // % pro-rata
|
||||
t->_s0 << "|" << _pom->get_real("R11").string(); // imp. acq. amm. indetr.
|
||||
t->_s0 << "|" << _pom->get_real("R12").string(); // IVA acq. amm. indetr
|
||||
t->_f0 = !_prorata.is_zero(); // flag per segnalare l'esistenza
|
||||
d->_r9 += _pom->get_real("R9"); // acq. inded. su ricavi esenti
|
||||
d->_r10 += _pom->get_real("R10"); // IVA acq. inded. su ricavi esenti
|
||||
@ -574,9 +573,33 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
||||
spgnvp += _pam->get_real("R11"); // IVA spese generali.
|
||||
t->_s2 = spgnp.string(); // risbatto ...
|
||||
t->_s3 = spgnvp.string(); // ..
|
||||
|
||||
// sospensione imposta: non piu' due palle, ma QUATTRO
|
||||
TToken_string tt(t->_s4);
|
||||
real aqsi(tt.get(0));
|
||||
real aqsv(tt.get(1));
|
||||
real vnsi(tt.get(2));
|
||||
real vnsv(tt.get(3));
|
||||
|
||||
aqsi += _pam->get_real("R6");
|
||||
aqsv += _pam->get_real("R7");
|
||||
vnsi += _pam->get_real("R8");
|
||||
vnsv += _pam->get_real("R9");
|
||||
|
||||
tt = aqsi.string();
|
||||
tt.add(aqsv.string());
|
||||
tt.add(vnsi.string());
|
||||
tt.add(vnsv.string());
|
||||
t->_s4 = tt;
|
||||
|
||||
} // while (attivita')
|
||||
} // for (mese ok)
|
||||
|
||||
|
||||
// ag. viaggio: iva dovuta 74 ter
|
||||
look_lim(month);
|
||||
d->_s2 = _lim->get_real("R3").string();
|
||||
|
||||
// annual follows in _arr
|
||||
if (month == 13 && ref != "ALL")
|
||||
{
|
||||
@ -660,10 +683,31 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
||||
|
||||
// aggiunge eventuale satellite per rimborso infraannuale
|
||||
if (di != NULL) d->_arr.add(di);
|
||||
|
||||
|
||||
if (!_is_visliq)
|
||||
{
|
||||
_DescrItem* dv = describe_deleghe(month);
|
||||
if (dv != NULL) d->_arr.add(dv);
|
||||
}
|
||||
_descr_arr.add(d);
|
||||
}
|
||||
|
||||
_DescrItem* TLiquidazione_app::describe_deleghe(int month)
|
||||
{
|
||||
if (!look_del(month,1)) return NULL;
|
||||
|
||||
_DescrItem* d = new _DescrItem(DELEGA);
|
||||
|
||||
d->_s0 = _del->get("S2"); // localita'
|
||||
d->_s1 = _del->get("S1"); // banca
|
||||
d->_s2 = _del->get("S7"); // ABI
|
||||
d->_s3 = _del->get("S8"); // CAB
|
||||
d->_r0 = _del->get_real("R0") + _del->get_real("R1");
|
||||
d->_d0 = _del->get_date("D0");
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
void TLiquidazione_app::describe_consistence(const char* codatt)
|
||||
{
|
||||
// controlla eventuali condizioni di conflitto con le normative
|
||||
@ -924,6 +968,14 @@ void TLiquidazione_app::set_plm(_DescrItem& d)
|
||||
set_row(rw++,"");
|
||||
}
|
||||
|
||||
real iva74ter(d._s2);
|
||||
if (!iva74ter.is_zero())
|
||||
{
|
||||
set_row(rw++, "Iva dovuta - 74ter@41g%r", &iva74ter);
|
||||
d._r1 += iva74ter;
|
||||
set_row(rw++,"");
|
||||
}
|
||||
|
||||
real tot1 = d._r7 + d._r4 + d._r9 + acq_pint;
|
||||
real tot2 = d._r8 + d._r5 + d._r10 + acq_pint_iva;
|
||||
|
||||
@ -943,12 +995,34 @@ void TLiquidazione_app::set_pumpam(_DescrItem& d)
|
||||
bool printed = FALSE;
|
||||
|
||||
// d._f1 dice se c'era qualcosa sopra nella stessa pagina
|
||||
|
||||
real spgn(d._s2);
|
||||
real spgn_iva(d._s3);
|
||||
real spgn_iva(d._s3);
|
||||
|
||||
TToken_string tt(d._s4); // Token String
|
||||
TToken_string dp(d._s0); // Due Palle
|
||||
real aqsi(tt.get(0));
|
||||
real aqsv(tt.get(1));
|
||||
real vnsi(tt.get(2));
|
||||
real vnsv(tt.get(3));
|
||||
real ammindi(dp.get(1));
|
||||
real ammindv(dp.get(2));
|
||||
|
||||
int row = 5;
|
||||
|
||||
if (!(aqsi.is_zero() && aqsv.is_zero()))
|
||||
{
|
||||
printed = TRUE;
|
||||
set_row(row++, "Acquisti in sospensione di imposta@50g%r@69g%r",
|
||||
&aqsi,
|
||||
&aqsv);
|
||||
}
|
||||
if (!(vnsi.is_zero() && vnsv.is_zero()))
|
||||
{
|
||||
printed = TRUE;
|
||||
set_row(row++, "Vendite in sospensione di imposta@50g%r@69g%r",
|
||||
&vnsi,
|
||||
&vnsv);
|
||||
}
|
||||
if (!(d._r8.is_zero() && d._r9.is_zero()))
|
||||
{
|
||||
printed = TRUE;
|
||||
@ -967,6 +1041,13 @@ void TLiquidazione_app::set_pumpam(_DescrItem& d)
|
||||
{
|
||||
printed = TRUE;
|
||||
set_row(row++, "Acquisto beni ammortizzabili IVA detraibile@50g%r@69g%r",
|
||||
&ammindi,
|
||||
&ammindv);
|
||||
}
|
||||
if (! (ammindi.is_zero() && ammindv.is_zero()))
|
||||
{
|
||||
printed = TRUE;
|
||||
set_row(row++, "Acquisto beni ammortizzabili IVA indetraibile@50g%r@69g%r",
|
||||
&(d._r0),
|
||||
&(d._r1));
|
||||
}
|
||||
@ -998,7 +1079,7 @@ void TLiquidazione_app::set_pumpam(_DescrItem& d)
|
||||
{
|
||||
printed = TRUE;
|
||||
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
||||
(const char*)(d._s0),
|
||||
(const char*)(dp.get(0)),
|
||||
&(d._r11));
|
||||
}
|
||||
|
||||
@ -1149,48 +1230,69 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
// rapportini per rimborso infraannuale
|
||||
// non si stampano se la stampa serve per la visualizz.
|
||||
if (d._arr.items() > 0 && !_is_visliq)
|
||||
{
|
||||
_DescrItem& di = (_DescrItem&)d._arr[0];
|
||||
set_print_zero(TRUE);
|
||||
set_row(rw++,"");
|
||||
set_row(rw++,"");
|
||||
set_row(rw++, " PROSPETTO DI RIMBORSO");
|
||||
set_row(rw++,"");
|
||||
|
||||
if (di._f0)
|
||||
{
|
||||
// esenti
|
||||
set_row(rw++,"1) Soggetto con quota di operazioni esenti e non"
|
||||
" imponibili superiore al 50%%");
|
||||
|
||||
real perc = (di._r0/di._r1) * CENTO;
|
||||
|
||||
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)
|
||||
{
|
||||
for (int i = 0; i < d._arr.items(); i++)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
set_print_zero(FALSE);
|
||||
|
||||
_DescrItem& di = (_DescrItem&)d._arr[i];
|
||||
|
||||
if (di._flags == RIMBORSO)
|
||||
{
|
||||
set_print_zero(TRUE);
|
||||
set_row(rw++,"");
|
||||
set_row(rw++,"");
|
||||
set_row(rw++, " PROSPETTO DI RIMBORSO");
|
||||
set_row(rw++,"");
|
||||
|
||||
if (di._f0)
|
||||
{
|
||||
// esenti
|
||||
set_row(rw++,"1) Soggetto con quota di operazioni esenti e non"
|
||||
" imponibili superiore al 50%%");
|
||||
|
||||
real perc = (di._r0/di._r1) * CENTO;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
set_print_zero(FALSE);
|
||||
}
|
||||
else if (d._flags == DELEGA)
|
||||
{
|
||||
_DescrItem& di = (_DescrItem&)d._arr[1];
|
||||
|
||||
if (rw < (printer().formlen() - 4))
|
||||
rw = printer().formlen() - 4;
|
||||
|
||||
set_row(rw++, "Versamento di L. %r effettuato il %s @71gdiretto all'ufficio IVA di %s",
|
||||
&(di._r0), (const char*)(d._d0.string()), (const char*)(d._s0));
|
||||
set_row(rw++, "@71gtramite %s", (const char*)(d._s1));
|
||||
set_row(rw++, "@71gcodice azienda %s codice dipendenza %s",
|
||||
(const char*)(d._s2), (const char*)(d._s3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!_is_visliq && !_isregis) set_auto_ff(TRUE);
|
||||
@ -1274,17 +1376,71 @@ void TLiquidazione_app::set_regagr(_DescrItem& d)
|
||||
{
|
||||
set_print_zero(TRUE);
|
||||
|
||||
real& agr_1 = d._r0;
|
||||
real& agr_2 = d._r1;
|
||||
real& agr_3 = d._r2;
|
||||
real& agr_4 = d._r3;
|
||||
real& agr_5 = d._r4;
|
||||
real& agr_6 = d._r5;
|
||||
real& agr_7 = d._r6;
|
||||
|
||||
real ara = agr_5 + agr_6;
|
||||
real arn = agr_3 + agr_4;
|
||||
|
||||
// percentuale detraibilita'
|
||||
// real pdetr = ();
|
||||
|
||||
set_row(1,"@50gPROSPETTO REGIME AGRICOLO");
|
||||
set_row(2,"");
|
||||
set_row(3, "Cessioni in regime agricolo (Tabella A/I)@54g%r",&(d._r0));
|
||||
set_row(3, "Cessioni in regime agricolo (Tabella A/I)@54g%r",&agr_1);
|
||||
set_row(4, "");
|
||||
set_row(5, "Cessioni non in regime agricolo@54g%r",&(d._r1));
|
||||
set_row(5, "Cessioni non in regime agricolo@54g%r",&agr_2);
|
||||
set_row(6, "");
|
||||
set_row(7, "Acquisti in regime agricolo@54g%r",&(d._r2));
|
||||
set_row(7, "Acquisti in regime agricolo@54g%r",&ara);
|
||||
set_row(8, "");
|
||||
set_row(9, "Acquisti non in regime agricolo@54g%r",&(d._r3));
|
||||
set_row(10, "... di cui beni ammortizzabili@54g%r",&(d._r4));
|
||||
set_row(9, "Acquisti non in regime agricolo@54g%r",&arn);
|
||||
set_row(10, "... di cui beni ammortizzabili@54g%r",&agr_4);
|
||||
set_row(11, "");
|
||||
set_row(12, "Acquisti ad uso promiscuo@54g%r",&agr_7);
|
||||
|
||||
if (/*agr_7.sign() > 0*/ TRUE)
|
||||
{
|
||||
real pdetr = (agr_2 / (agr_1 + agr_2));
|
||||
real ivadt = agr_7 * pdetr;
|
||||
pdetr *= CENTO; pdetr.round(2);
|
||||
ivadt.round(ROUND_LIRA);
|
||||
|
||||
TString up = agr_2.string(".");
|
||||
up << " x 100";
|
||||
TString dn = agr_1.string(".");
|
||||
dn << " + " << agr_2.string(".");
|
||||
int ln = max(up.len(), dn.len()) + 2;
|
||||
TString den(ln); den.fill('-');
|
||||
up.center_just(ln); dn.center_just(ln);
|
||||
|
||||
set_row(13, "");
|
||||
set_row(14, "@31g%s", (const char*)up);
|
||||
set_row(15, "Percentuale di detraibilita'@31g%s = @64g%s",
|
||||
(const char*)den,
|
||||
(const char*)pdetr.string("##,##"));
|
||||
set_row(16, "@31g%s", (const char*)dn);
|
||||
|
||||
up = agr_7.string(".");
|
||||
up << " x " << pdetr.string(".2");
|
||||
dn = "100";
|
||||
if ((max(up.len(), dn.len()) + 2) > ln)
|
||||
ln = max(up.len(), dn.len()) + 2;
|
||||
TString den1(ln); den1.fill('-');
|
||||
up.center_just(ln); dn.center_just(ln);
|
||||
|
||||
set_row(17, "");
|
||||
set_row(18, "@31g%s", (const char*)up);
|
||||
set_row(19, "Iva detraibile@31g%s = @54g%r",
|
||||
(const char*)den1,
|
||||
&ivadt);
|
||||
set_row(20, "@31g%s", (const char*)dn);
|
||||
}
|
||||
|
||||
set_auto_ff(TRUE);
|
||||
set_print_zero(FALSE);
|
||||
}
|
||||
@ -1354,8 +1510,8 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
||||
real rip = d._r7; rip.round(2);
|
||||
|
||||
// la bella frazioncina degli imponibili viaggi misti
|
||||
TString tmp2 = d._r1.string(REAL_PICTURE); tmp2.ltrim();
|
||||
TString up2 = tmp;
|
||||
TString tmp2 = d._r3.string(REAL_PICTURE); tmp2.ltrim();
|
||||
TString up2 = tmp2;
|
||||
up2 << " x " << rip.string(2);
|
||||
TString dn2 = "100";
|
||||
int ln2 = max(up2.len(), 3) + 2;
|
||||
@ -1411,32 +1567,31 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
||||
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 = "["; up << tmp << " - (";
|
||||
tmp = tma.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);
|
||||
}
|
||||
else if (bil.sign() > 0)
|
||||
set_row(26,"");
|
||||
set_row(iscred ? 28 : 26,"%s@40g%t %t@100g%r",
|
||||
iscred ? "CREDITO DI COSTO " : "Base imponibile lorda",
|
||||
&up, &den, &bil);
|
||||
|
||||
if (bil.sign() > 0 && !iscred)
|
||||
{
|
||||
real aliva = aliquota_agvia();
|
||||
real dovuta = (bil/((aliva+CENTO)/CENTO)) * (aliva/CENTO);
|
||||
real alcnt = aliquota_agvia() + CENTO;
|
||||
real dovuta = (bil/(alcnt/CENTO)) * (aliva/CENTO);
|
||||
dovuta.round(ROUND_LIRA);
|
||||
|
||||
tmp = bil.string(REAL_PICTURE); tmp.ltrim();
|
||||
up = tmp;
|
||||
up << " x " << aliva.string(5,2);
|
||||
dn = "100";
|
||||
dn = alcnt.string();
|
||||
ln = max(up.len(), 3) + 2;
|
||||
den.fill('-',ln);
|
||||
up.center_just(ln); dn.center_just(ln);
|
||||
|
@ -2888,14 +2888,13 @@ void CG4400_application::stampa_liq_mesi_succ()
|
||||
|
||||
void CG4400_application::send_message(char tipo, const TFilename& nome, int mese)
|
||||
{
|
||||
//const char* const app = "cg4a -2 -icon";
|
||||
const char* app;
|
||||
|
||||
if (tipo == 'S' || tipo == 's')
|
||||
app = "cg4a -2 -S";
|
||||
app = "cg4 -2 -S";
|
||||
else if (tipo == 'C')
|
||||
app = "cg4a -2 -C";
|
||||
else app = "cg4a -2";
|
||||
app = "cg4 -2 -C";
|
||||
else app = "cg4 -2";
|
||||
|
||||
TToken_string ss(10);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user