Kazzi e rikazzi per: rimborsi, acconti, prorati, parametri ditta
Still unfinished git-svn-id: svn://10.65.10.50/trunk@1513 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2f696981f3
commit
f527a2b4b8
@ -385,8 +385,9 @@ bool TLiquidazione_app::set_print(int)
|
||||
break;
|
||||
case 3: // calcolo acconto
|
||||
_isprint = TRUE;
|
||||
build_ditte_sheet(all);
|
||||
while (set_acconto())
|
||||
build_ditte_sheet(all);
|
||||
real inf; real ina; // cotale obbrobrio non fu da me cercato, ne' mai condiviso
|
||||
while (set_acconto(inf, ina))
|
||||
{
|
||||
if (_calcall || _selected.ones() > 0l)
|
||||
{
|
||||
@ -399,7 +400,7 @@ bool TLiquidazione_app::set_print(int)
|
||||
from.put(MOV_DATAREG, f);
|
||||
to.put(MOV_DATAREG, t);
|
||||
_cur->setregion(from, to);
|
||||
recalc_acconti();
|
||||
recalc_acconti(inf, ina);
|
||||
return _isprint;
|
||||
}
|
||||
else warning_box("Nessuna ditta selezionata!");
|
||||
|
30
cg/cg4300.h
30
cg/cg4300.h
@ -1,4 +1,4 @@
|
||||
// of course this is -*-C++-*-
|
||||
// dear emacs, this is -*-C++-*-
|
||||
// Questa e' la famosa palla della liquidazione IVA
|
||||
|
||||
#ifndef __MASK_H
|
||||
@ -19,30 +19,31 @@ class TProgind;
|
||||
// Parametri modificabili
|
||||
// ------------------------------------------------------------------
|
||||
//
|
||||
// da cambiare se la lira si appesantisce o in caso di
|
||||
// inflazione polacca
|
||||
// arrotondamento default
|
||||
// da cambiare se la lira si appesantisce o in caso di inflazione polacca
|
||||
#define ROUND_LIRA (0)
|
||||
#define ROUND_MILLELIRE (-3)
|
||||
// picture default per i reali
|
||||
// in caso di inflazione polacca occorrera' modificare la lunghezza
|
||||
// e quindi cambiare le set_row in cg4304.cpp onde evitare overlap
|
||||
#define REAL_PICTURE "###.###.###.###"
|
||||
// IVA a debito da riportare al mese successivo
|
||||
#define IVA_DA_RIPORTARE real(50000)
|
||||
// IVA a debito da non pagare ma riportare al mese successivo
|
||||
#define IVA_DA_RIPORTARE real(50000.0)
|
||||
// detrazione per detraibili 6%
|
||||
#define DETRAZIONE_6PERCENTO real(0.06)
|
||||
// soglia che da' diritto alla liquidazione trimestrale per servizi
|
||||
// currently trecentsesantamiliu'
|
||||
#define SOGLIA_TRIM_SERVIZI real(360000000)
|
||||
#define SOGLIA_TRIM_SERVIZI real(360000000.0)
|
||||
// soglia che da' diritto alla liquidazione trimestrale per altri
|
||||
// currently un miliardun
|
||||
#define SOGLIA_TRIM_ALTRE real(1000000000)
|
||||
#define SOGLIA_TRIM_ALTRE real(1000000000.0)
|
||||
// minima percentuale di operazioni esenti per aver diritto al rimborso
|
||||
// infrannuale
|
||||
#define MIN_PARTE_ESENTE real(0.25)
|
||||
// percentuale IVA da versare in acconto a dicembre
|
||||
#define ACCONTO_DICEMBRE real(0.88)
|
||||
// importo minimo acconto a dicembre da versare
|
||||
#define ACCONTO_MINIMO_DA_VERSARE real(200000.0)
|
||||
// percentuale degli imponibili da usare nel calcolo aliquota
|
||||
// media acquisti e vendite per controllo diritto al rimborso
|
||||
// infraanuuale secondo norme 1994
|
||||
@ -454,6 +455,9 @@ public:
|
||||
|
||||
// tutti i controlli del mondo sui mesi da calcolare
|
||||
static bool is_trim (int x);
|
||||
// ritorna il mese corrispondente alla scadenza del trimestre relativo
|
||||
// senza considerare la frequenza versamenti
|
||||
int next_trim(int x);
|
||||
// is_month_ok controlla che il mese passato sia
|
||||
// da prendere in considerazione per la liquidazione
|
||||
// controllando il regime trimestrale o mensile e
|
||||
@ -483,10 +487,14 @@ public:
|
||||
// stampa
|
||||
void set_deltab(_DescrItem& d, bool iscred);
|
||||
|
||||
// Funzioni accessorie: calcolo acconto dicembre
|
||||
bool set_acconto();
|
||||
bool recalc_acconti();
|
||||
bool recalc_acconto();
|
||||
// Funzioni accessorie: calcolo acconto dicembre
|
||||
// i real passati sono due cazzi di correzioni iva che
|
||||
// vanno settate nella maschera anche se non potranno
|
||||
// mai riguardare tutte le ditte
|
||||
|
||||
bool set_acconto (real&, real&);
|
||||
bool recalc_acconti(real&, real&);
|
||||
bool recalc_acconto(real&, real&);
|
||||
// stampa
|
||||
void set_acconto_p(_DescrItem& d);
|
||||
void set_acchead_p(_DescrItem& d);
|
||||
|
@ -4,3 +4,5 @@
|
||||
#define CHK_CGC_PRINT 105
|
||||
#define CHK_CGC_BASE 106
|
||||
#define RDB_CGC_BASE 107
|
||||
#define FLD_CGC_INF 108
|
||||
#define FLD_CGC_INA 109
|
||||
|
@ -1,28 +1,28 @@
|
||||
#include "cg4300c.h"
|
||||
|
||||
PAGE "Calcolo acconto" -1 -1 52 11
|
||||
PAGE "Calcolo acconto" -1 -1 60 14
|
||||
|
||||
|
||||
RADIOBUTTON RDB_CGC_BASE 4 21
|
||||
RADIOBUTTON RDB_CGC_BASE 4 24
|
||||
BEGIN
|
||||
PROMPT 3 1 "Base di calcolo"
|
||||
HELP "Indicare l'anno di cui calcolare l'acconto"
|
||||
ITEM "1|Anno precedente"
|
||||
ITEM "2|Anno in corso"
|
||||
HELP "Indicare l'anno di cui calcolare l'acconto"
|
||||
ITEM "1|Anno precedente" MESSAGE HIDE,FLD_CGC_INF|HIDE,FLD_CGC_INA
|
||||
ITEM "2|Anno in corso" MESSAGE SHOW,FLD_CGC_INF|SHOW,FLD_CGC_INA
|
||||
END
|
||||
|
||||
BOOLEAN CHK_CGC_PRINT
|
||||
BEGIN
|
||||
PROMPT 27 2 "Stampa prospetto"
|
||||
HELP "Indicare se stampare anche un prospetto riepilogativo"
|
||||
PROMPT 30 2 "Stampa prospetto"
|
||||
HELP "Indicare se stampare anche un prospetto riepilogativo"
|
||||
MESSAGE TRUE ENABLE,CHK_CGC_BASE
|
||||
MESSAGE FALSE DISABLE,CHK_CGC_BASE
|
||||
END
|
||||
|
||||
BOOLEAN CHK_CGC_BASE
|
||||
BEGIN
|
||||
PROMPT 27 3 "Stampa base di calcolo"
|
||||
HELP "Indicare se stampare la base di calcolo"
|
||||
PROMPT 30 3 "Stampa base di calcolo"
|
||||
HELP "Indicare se stampare la base di calcolo"
|
||||
END
|
||||
|
||||
NUMBER FLD_CGC_YEAR 4
|
||||
@ -32,7 +32,7 @@ BEGIN
|
||||
FLAGS "A"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 46 4
|
||||
GROUPBOX DLG_NULL 52 4
|
||||
BEGIN
|
||||
PROMPT 3 6 "Scelta ditte"
|
||||
END
|
||||
@ -50,6 +50,18 @@ BEGIN
|
||||
HELP "Selezionare tutte le ditte di cui fare il calcolo dell'acconto"
|
||||
MESSAGE EXIT,BUT_CGC_ALL
|
||||
END
|
||||
|
||||
NUMBER FLD_CGC_INF 15 0
|
||||
BEGIN
|
||||
PROMPT 1 10 "IVA su vendite prec. 20 dic. non fatturate "
|
||||
HELP "Inserire l'importo dell'IVA su operazioni non fatturate eseguite anteriormente al 20 dicembre"
|
||||
END
|
||||
|
||||
NUMBER FLD_CGC_INA 15 0
|
||||
BEGIN
|
||||
PROMPT 1 11 "IVA su vendite prec. 20 dic. non annotate "
|
||||
HELP "Inserire l'importo dell'IVA su operazioni non annotate eseguite anteriormente al 20 dicembre"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
|
@ -147,7 +147,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
|
||||
look_lim(liq_month(month), TRUE);
|
||||
|
||||
if (_isregis && _lim->get_bool("B1"))
|
||||
if (_isregis && _lim->get_bool("B1") && _month != 13)
|
||||
return TRUE;
|
||||
|
||||
TConfig cnf(CONFIG_DITTA, "cg");
|
||||
@ -448,7 +448,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
real esenti_b1 = 0.0;
|
||||
real esenti_b2 = 0.0;
|
||||
real esenti_b3 = 0.0;
|
||||
real esenti_b14 = 0.0;
|
||||
real esenti_b14 = 0.0;
|
||||
real nonimp = 0.0;
|
||||
real corr_CEE = 0.0;
|
||||
real corr_noCEE = 0.0;
|
||||
real acq_CEE = 0.0;
|
||||
@ -544,7 +545,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
int tipoag = atoi(_iva->get("S5"));
|
||||
int tipopla = atoi(_iva->get("S3"));
|
||||
int tipodet = atoi(_rmoviva->get("TIPODET"));
|
||||
bool ivarimb = !_iva->get_bool("B3");
|
||||
bool ivarimb = !_iva->get_bool("B4");
|
||||
TString tipocr_s = _rmoviva->get("TIPOCR");
|
||||
int tipocr = atoi(tipocr_s);
|
||||
real imponibile = _rmoviva->get_real("IMPONIBILE");
|
||||
@ -730,6 +731,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
esenti_b14 += imponibile;
|
||||
}
|
||||
|
||||
// non imponibili
|
||||
if (tipoiva == "NI" && tipomov == vendita)
|
||||
nonimp += imponibile;
|
||||
|
||||
// bolle doganali
|
||||
if (tipodoc == "BD")
|
||||
{
|
||||
@ -1149,7 +1154,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
_pum->put("R4", esenti_b1);
|
||||
_pum->put("R5", esenti_b2);
|
||||
_pum->put("R6", esenti_b3);
|
||||
_pum->put("R7", esenti_b14);
|
||||
_pum->put("R7", esenti_b14);
|
||||
_pum->put("R12", nonimp);
|
||||
_pam->put("R0", acquisti);
|
||||
_pam->put("R1", vendite);
|
||||
_pam->put("R6", assp_imp);
|
||||
|
@ -64,7 +64,13 @@ int TLiquidazione_app::liq_month(int x)
|
||||
{
|
||||
if (x == 13 || _freqviva == "M")
|
||||
return x;
|
||||
else return x + (2 - ((x-1) % 3));
|
||||
else return next_trim(x);
|
||||
}
|
||||
|
||||
int TLiquidazione_app::next_trim(int x)
|
||||
{
|
||||
if (x == 13) x = 12;
|
||||
return x + (2 - ((x-1) % 3));
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::is_in_liq_period(TDate& d)
|
||||
@ -448,7 +454,11 @@ bool TLiquidazione_app::look_rmb(int month, const char* codiva, tiporeg tr, bool
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::look_del(int month, int type, bool create)
|
||||
{
|
||||
{
|
||||
// se chiamata con il flag di creazione, aggiorna le info su
|
||||
// codici tributo, concessione, conto fiscale anche se la
|
||||
// delega esiste gia'
|
||||
|
||||
long ditta = _nditte->curr().get_long("CODDITTA");
|
||||
_del->zero();
|
||||
(*_del_ditta) = format("%05ld", ditta);
|
||||
|
@ -283,12 +283,13 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||
while ((tmpatt = atts.get()) != NULL)
|
||||
{
|
||||
att = tmpatt;
|
||||
for (int m = (month == 13 ? 1 : (month - 2)); m <= month; m++)
|
||||
for (int m = (month == 13 ? 1 : (next_trim(month)-2)); m <= month; m++)
|
||||
{
|
||||
if (!look_plm(m,att)) continue;
|
||||
|
||||
vol_aff += _pam->get_real("R1");
|
||||
es_ni += _pum->get_real("R6");
|
||||
es_ni += _pum->get_real("R4") + _pum->get_real("R5") +
|
||||
_pum->get_real("R6") + _pum->get_real("R12");
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,9 +303,8 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||
d->_r1 = vol_aff;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------- condizione 2
|
||||
// u'casinu pazzescu d'u nuiu guvernu
|
||||
// u' casinu pazzescu d'u nuiu guvernu
|
||||
|
||||
real vtot = 0.0;
|
||||
real atot = 0.0;
|
||||
@ -439,7 +439,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||
int rmese = atoi((const char*)(*_rmb_mese));
|
||||
|
||||
if (year != ryear ||
|
||||
(month != 13 && (rmese < (month - 2) || rmese > month)))
|
||||
(month != 13 && (rmese < (next_trim(month)-2) || rmese > month)))
|
||||
continue;
|
||||
|
||||
real imp = _rmb->get("R0");
|
||||
|
@ -1335,10 +1335,8 @@ 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)
|
||||
{
|
||||
|
||||
|
||||
if (d._arr.items() > 0 && !_is_visliq && !_isregis)
|
||||
{
|
||||
for (int i = 0; i < d._arr.items(); i++)
|
||||
{
|
||||
|
||||
@ -1391,8 +1389,7 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
}
|
||||
// prospettino versamento
|
||||
else if (di._flags == DELEGA)
|
||||
{
|
||||
|
||||
{
|
||||
int rr = rw;
|
||||
if (rw < (printer().formlen() - 10))
|
||||
rw = printer().formlen() - 10;
|
||||
@ -1404,6 +1401,9 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
TString dt = di._d0.string();
|
||||
TString vr = di._r0.string("###.###.###.###");
|
||||
|
||||
// la cincia non vuole lo zero
|
||||
if (atof(vr) == 0.0 && vr[vr.len()-1] == '0') vr[vr.len()-1] = ' ';
|
||||
|
||||
set_row(rw++, "Versamento di L. %s effettuato il %s@68gdiretto all'ufficio IVA di %s",
|
||||
(const char*)vr,
|
||||
(const char*)dt,
|
||||
@ -1748,42 +1748,47 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
||||
|
||||
void TLiquidazione_app::set_acconto_p(_DescrItem& d)
|
||||
{
|
||||
set_print_zero(TRUE);
|
||||
set_print_zero(TRUE);
|
||||
|
||||
const char* errmsg[3] = {
|
||||
{"manca la tabella risultati liquidazione per l'anno corrente"},
|
||||
{"manca la tabella risultati liquidazione per l'anno precedente"},
|
||||
{"manca la tabella dichiarazione annuale per l'anno precedente"}};
|
||||
|
||||
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
|
||||
set_row(1,"%t@8g%t",&(d._s0), &(d._s1));
|
||||
if (d._f2)
|
||||
set_row(1,"@50g@b*** %s ***@r", errmsg[d._f2 -1]);
|
||||
else
|
||||
{
|
||||
if (d._f0) // base anno in corso
|
||||
{
|
||||
if (d._f0) // base anno in corso
|
||||
if (d._f1) // stampa base di calcolo
|
||||
{
|
||||
if (d._f1) // stampa base di calcolo
|
||||
real bc = d._r0;
|
||||
if (bc.sign() < 0)
|
||||
{
|
||||
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");
|
||||
bc = abs(bc);
|
||||
set_row(1,"@73g%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");
|
||||
}
|
||||
set_row(1,"@55g%r@86g%r@119g%s", &bc, &(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_row(1,"@51g%r@75g%s", &(d._r1), d._f3 ? "Si" : "No");
|
||||
}
|
||||
}
|
||||
set_print_zero(FALSE);
|
||||
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);
|
||||
}
|
||||
|
||||
void TLiquidazione_app::set_acchead_p(_DescrItem& d)
|
||||
|
158
cg/cg4305.cpp
158
cg/cg4305.cpp
@ -6,6 +6,7 @@
|
||||
#include <prefix.h>
|
||||
#include <sheet.h>
|
||||
#include <utility.h>
|
||||
#include <config.h>
|
||||
|
||||
#include "cg4300.h"
|
||||
#include "cg4300b.h"
|
||||
@ -193,7 +194,7 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
||||
}
|
||||
|
||||
// -------------------------------------------- calcolo acconto dicembre
|
||||
bool TLiquidazione_app::set_acconto()
|
||||
bool TLiquidazione_app::set_acconto(real& inf, real& ina)
|
||||
{
|
||||
TMask m("cg4300c.msk");
|
||||
m.set(CHK_CGC_PRINT,"X");
|
||||
@ -212,15 +213,18 @@ bool TLiquidazione_app::set_acconto()
|
||||
_year = m.get(FLD_CGC_YEAR);
|
||||
_isprint = m.get_bool(CHK_CGC_PRINT);
|
||||
_isbase = m.get_bool(CHK_CGC_BASE);
|
||||
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
|
||||
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
|
||||
|
||||
inf = real(m.get(FLD_CGC_INF));
|
||||
ina = real(m.get(FLD_CGC_INA));
|
||||
|
||||
switch (k)
|
||||
{
|
||||
case DLG_SELECT:
|
||||
|
||||
// scegli ditte
|
||||
_ditte->run();
|
||||
|
||||
|
||||
for (j = 0l; j < _ditte->items(); j++)
|
||||
if (_ditte->checked(j)) _selected.set(j);
|
||||
|
||||
@ -239,7 +243,7 @@ bool TLiquidazione_app::set_acconto()
|
||||
}
|
||||
|
||||
|
||||
bool TLiquidazione_app::recalc_acconti()
|
||||
bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
@ -274,7 +278,7 @@ bool TLiquidazione_app::recalc_acconti()
|
||||
sprintf (buf,"Calcolo acconto:\nditta %s",
|
||||
(const char*)_nditte_r->get("RAGSOC"));
|
||||
_prind->set_text(buf);
|
||||
recalc_acconto();
|
||||
recalc_acconto(inf, ina);
|
||||
onemade = TRUE;
|
||||
}
|
||||
_prind->addstatus(1);
|
||||
@ -285,16 +289,101 @@ bool TLiquidazione_app::recalc_acconti()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::recalc_acconto()
|
||||
bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
{
|
||||
real basecalcolo, acconto;
|
||||
real bc, acc;
|
||||
bool isdifferita = FALSE;
|
||||
bool error = FALSE;
|
||||
|
||||
// this is absolutely fundamental
|
||||
|
||||
if (_basecalc == incorso)
|
||||
// TBI rewrite from scratch
|
||||
// this is absolutely fundamental
|
||||
if (_basecalc == precedente)
|
||||
{
|
||||
// determina casistica
|
||||
enum { mm, tt, mt, tm, boh } history = boh;
|
||||
char thh = *_freqviva;
|
||||
|
||||
TString16 thyear = _year;
|
||||
_year = format("%d", atoi(_year)-1);
|
||||
|
||||
if (!look_lia())
|
||||
error = 3;
|
||||
else
|
||||
{
|
||||
char ohh = _lia->get_char("S7");
|
||||
|
||||
if (ohh == 'M') history = thh == 'M' ? mm : mt;
|
||||
if (ohh == 'T') history = thh == 'M' ? tm : tt;
|
||||
if (history == boh) return FALSE;
|
||||
|
||||
// casino benzinari
|
||||
TString attprev = _nditte->curr().get("CODATTPREV");
|
||||
long codd = _nditte->curr().get_long("CODDITTA");
|
||||
TLocalisamfile& atts = _nditte->lfile(LF_ATTIV);
|
||||
atts.zero();
|
||||
atts.put("CODDITTA", codd);
|
||||
atts.put("CODATT", attprev);
|
||||
if (atts.read() != NOERR) atts.zero();
|
||||
if (atts.get_bool("ART74/4")) // e' proprio un gran benzinaro
|
||||
{
|
||||
TConfig cnf(CONFIG_DITTA, "cg");
|
||||
history = cnf.get_bool("GesT74") ? mm : tt;
|
||||
}
|
||||
|
||||
switch (history)
|
||||
{
|
||||
case mm:
|
||||
// base calcolo: 12a anno preced, Rideterminare a seconda dell'acconto
|
||||
// versato; ris = 88% del debito (0 se credito)
|
||||
if (!look_lim(12)) error = 2;
|
||||
else
|
||||
{
|
||||
bc += _lim->get_real("R0");
|
||||
real av = _lim->get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
break;
|
||||
case tt:
|
||||
case tm:
|
||||
// base calcolo: 13a anno precedente. Rideterm. per eventuale acconto
|
||||
if (!look_lim(12)) error = 2; // TBC sara' 13a davvero? Secondo me e' 12
|
||||
else
|
||||
{
|
||||
bc += _lim->get_real("R0");
|
||||
real av = _lim->get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
if (_basecalc == tm)
|
||||
// tm come tt ma si divide per 3 la base di calcolo prima di calcolare l'88%
|
||||
bc /= real(3.0);
|
||||
break;
|
||||
case mt:
|
||||
// basecalcolo: 10, 11, 12 anno prec., 10 e 11 se a debito, 12 vedi acconto;
|
||||
// sommare e prendi 88% se a debito
|
||||
if (!look_lim(10)) error = 2;
|
||||
else bc += _lim->get_real("R0");
|
||||
if (!look_lim(11)) error = 2;
|
||||
else bc += _lim->get_real("R0");
|
||||
if (!look_lim(12)) error = 2;
|
||||
else
|
||||
{
|
||||
bc += _lim->get_real("R0");
|
||||
real av = _lim->get_real("R11");
|
||||
bc += av;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (bc.sign() > 0)
|
||||
{
|
||||
acc = bc * ACCONTO_DICEMBRE;
|
||||
acc.round(ROUND_LIRA);
|
||||
}
|
||||
}
|
||||
_year = thyear;
|
||||
}
|
||||
else if (_basecalc == incorso)
|
||||
{
|
||||
// that's pazzesc but as it turns out there's no better way
|
||||
_comp_acconto = TRUE;
|
||||
// force recalc of current month
|
||||
@ -304,52 +393,53 @@ bool TLiquidazione_app::recalc_acconto()
|
||||
|
||||
// calcola l'acconto
|
||||
if (look_lim(12))
|
||||
{
|
||||
basecalcolo = result_liq(12);
|
||||
if (basecalcolo.sign() > 0)
|
||||
acconto = basecalcolo * ACCONTO_DICEMBRE;
|
||||
{
|
||||
// TBC trimestrali, differite
|
||||
bc = result_liq(12);
|
||||
// somma i non fatturati/non annotati
|
||||
bc += inf + ina;
|
||||
if (bc.sign() > 0)
|
||||
acc = bc * ACCONTO_DICEMBRE;
|
||||
}
|
||||
else acconto = real(-1.0);
|
||||
else error = 1;
|
||||
|
||||
// pulisci il water
|
||||
_comp_acconto = FALSE;
|
||||
update_firm(12);
|
||||
}
|
||||
else if (_basecalc == precedente)
|
||||
{
|
||||
int yr = atoi(_year);
|
||||
_year = format("%d",yr-1);
|
||||
if (look_lim(12))
|
||||
{
|
||||
basecalcolo = result_liq(12);
|
||||
if (basecalcolo.sign() > 0)
|
||||
acconto = basecalcolo * ACCONTO_DICEMBRE;
|
||||
}
|
||||
else error = TRUE;
|
||||
_year = format("%d", yr);
|
||||
}
|
||||
|
||||
// sbatti l'acconto in LIA
|
||||
if (look_lia())
|
||||
{
|
||||
_lia->put("R4",acconto);
|
||||
_lia->put("R4",acc);
|
||||
isdifferita = _lia->get_bool("B1");
|
||||
_lia->rewrite();
|
||||
}
|
||||
|
||||
if (acconto.sign() > 0)
|
||||
bool wasdel = look_del(12,7);
|
||||
|
||||
if (acc.sign() > 0 && acc > ACCONTO_MINIMO_DA_VERSARE)
|
||||
{
|
||||
// crea o aggiorna delega
|
||||
// crea o aggiorna delega
|
||||
// TBC everything
|
||||
look_del(12,7,TRUE);
|
||||
_del->put("R0", acconto);
|
||||
_del->put("R0", acc);
|
||||
_del->rewrite();
|
||||
}
|
||||
else if (wasdel)
|
||||
_del->remove();
|
||||
|
||||
// per questa volta lasciamo perdere la describe_acconto
|
||||
if (_isprint)
|
||||
{
|
||||
// segnalazioni di errore da gesticolare:
|
||||
// error = 0: no error
|
||||
// error = 1: manca tabella risultati liquidazione per l'anno indicato
|
||||
// error = 2: manca tabella risultati liquidazione per l'anno precedente
|
||||
// error = 3: manca tabella dichiarazione annuale per l'anno precedente
|
||||
_DescrItem* d = new _DescrItem(ACCONTO);
|
||||
d->_r0 = basecalcolo;
|
||||
d->_r1 = acconto;
|
||||
d->_r0 = bc;
|
||||
d->_r1 = acc;
|
||||
d->_f0 = _basecalc == incorso;
|
||||
d->_f1 = _isbase;
|
||||
d->_f2 = error;
|
||||
|
@ -53,4 +53,5 @@
|
||||
#define FLD_DCSUECE 152
|
||||
#define FLD_DCSPECE 153
|
||||
#define FLD_DESLIN 154
|
||||
#define FLD_DESLIC 155
|
||||
#define FLD_DESLIC 155
|
||||
#define CHK_GEST74 156
|
@ -22,7 +22,7 @@ PAGE "Impostazione parametri ditta" -1 -1 77 8
|
||||
|
||||
NUMBER FLD_ANLIIV 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "@bANNO LIQUIDAZIONE IVA "
|
||||
PROMPT 2 0 "@bANNO LIQUIDAZIONE IVA "
|
||||
HELP "Indicare l'anno dell'esercizio IVA corrente"
|
||||
FIELD AnLiIv
|
||||
VALIDATE FIXLEN_FUNC 4
|
||||
@ -30,7 +30,7 @@ END
|
||||
|
||||
BOOLEAN CHK_ANCFCM
|
||||
BEGIN
|
||||
PROMPT 4 3 "Anagrafica clienti / anagrafica fornitori"
|
||||
PROMPT 4 2 "Anagrafica clienti / anagrafica fornitori"
|
||||
HELP "Indicare se gestire un'unica anagrafica clienti/fornitori"
|
||||
FLAGS "D"
|
||||
FIELD AnCfCm
|
||||
@ -38,7 +38,7 @@ END
|
||||
|
||||
BOOLEAN CHK_PCTCCM
|
||||
BEGIN
|
||||
PROMPT 4 4 "Piano conti / tabella causali"
|
||||
PROMPT 4 3 "Piano conti / tabella causali"
|
||||
HELP "Indicare se gestire un'unico archivio piano dei conti/causali"
|
||||
FLAGS "D"
|
||||
FIELD PcTcCm
|
||||
@ -46,13 +46,13 @@ END
|
||||
|
||||
GROUPBOX DLG_NULL 76 4
|
||||
BEGIN
|
||||
PROMPT 2 2 "Archivi in comune"
|
||||
PROMPT 2 1 "Archivi in comune"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 76 7
|
||||
GROUPBOX DLG_NULL 76 8
|
||||
BEGIN
|
||||
PROMPT 2 6 "Parametri contabilita'"
|
||||
PROMPT 2 5 "Parametri contabilita'"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 76 6
|
||||
@ -62,39 +62,46 @@ END
|
||||
|
||||
BOOLEAN CHK_GSLBCN
|
||||
BEGIN
|
||||
PROMPT 4 7 "Gestione libro cronologico "
|
||||
PROMPT 4 6 "Gestione libro cronologico "
|
||||
HELP "Indicare se attivare il libro cronologico della gestione per i professionisti"
|
||||
FIELD GsLbCn
|
||||
END
|
||||
|
||||
BOOLEAN CHK_STTFFR
|
||||
BEGIN
|
||||
PROMPT 4 8 "Stampa totali fatture a fine registro "
|
||||
PROMPT 4 7 "Stampa totali fatture a fine registro "
|
||||
HELP "Indicare se attivare il computo dei totali fatture a fine registro"
|
||||
FIELD StTfFr
|
||||
END
|
||||
|
||||
BOOLEAN CHK_STLGIU
|
||||
BEGIN
|
||||
PROMPT 4 9 "Stampa libro giornale e libro IVA unico "
|
||||
PROMPT 4 8 "Stampa libro giornale e libro IVA unico "
|
||||
HELP "Indicare se utilizzare un unico registro per libro giornale e libro IVA"
|
||||
FIELD StLgiU
|
||||
END
|
||||
|
||||
BOOLEAN CHK_GELIDI
|
||||
BEGIN
|
||||
PROMPT 4 10 "Gestione liquidazione differita"
|
||||
PROMPT 4 9 "Gestione liquidazione differita"
|
||||
HELP "Indicare se effettuare la liq. diff. ex DL 151 del 13-5-91 convertito da L. 202"
|
||||
FIELD GeLiDi
|
||||
END
|
||||
|
||||
BOOLEAN CHK_GESVEN
|
||||
BEGIN
|
||||
PROMPT 4 11 "Gestione vendite"
|
||||
PROMPT 4 10 "Gestione vendite"
|
||||
HELP "Indicare se e' attivata anche la gestione delle vendite"
|
||||
FIELD GesVen
|
||||
END
|
||||
|
||||
BOOLEAN CHK_GEST74
|
||||
BEGIN
|
||||
PROMPT 4 11 "Gestione versamenti 4.tr per soggetti art. 74/4"
|
||||
HELP "Indicare se si deve gestire il versamento del 4. trimestre per benzinai e autotrasportatori"
|
||||
FIELD GesT74
|
||||
END
|
||||
|
||||
BOOLEAN CHK_GESSAL
|
||||
BEGIN
|
||||
PROMPT 4 14 "Gestione saldaconto "
|
||||
|
Loading…
x
Reference in New Issue
Block a user