Commit di visualizzazione non piu' funzionante in seguito a
spostamento prematuro tabelle LIA e PLA by Guido Il commit si inquadra in una visione pluralista della programmazione illuminata da un concetto nel quale tutte le forze in campo sono chiamate a dare un contributo in un'ottica autenticamente collaborativa e caratterizzata dalla massima trasparenza dell'operato. git-svn-id: svn://10.65.10.50/trunk@994 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3c9e5b7de5
commit
7dc0277741
@ -11,6 +11,7 @@
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
#include <utility.h>
|
||||
|
||||
// Calcola l'anno di esercizio di una data
|
||||
// Certified 99%
|
||||
|
@ -178,8 +178,9 @@ bool TLiquidazione_app::user_create()
|
||||
_lam_mese = new TRecfield(*_lam_r,"CODTAB",4,6);
|
||||
|
||||
_rmb_anno = new TRecfield(*_rmb_r,"CODTAB",0,3);
|
||||
_rmb_mese = new TRecfield(*_rmb_r,"CODTAB",4,6);
|
||||
_rmb_codiva = new TRecfield(*_rmb_r,"CODTAB",7,10);
|
||||
_rmb_mese = new TRecfield(*_rmb_r,"CODTAB",4,5);
|
||||
_rmb_codiva = new TRecfield(*_rmb_r,"CODTAB",6,9);
|
||||
_rmb_tiporeg = new TRecfield(*_rmb_r,"CODTAB",10,10);
|
||||
|
||||
|
||||
__firm = TApplication::get_firm();
|
||||
@ -431,8 +432,7 @@ void TLiquidazione_app::build_nomiditte(TProgind* pnd)
|
||||
if (good)
|
||||
{
|
||||
// check no parametri liquidazione
|
||||
TApplication::set_firm(dt.get_long("CODDITTA"));
|
||||
if (!look_lia()) good = FALSE;
|
||||
if (!look_lia(dt.get_long("CODDITTA"))) good = FALSE;
|
||||
}
|
||||
|
||||
TToken_string* d = new TToken_string(64);
|
||||
@ -446,7 +446,6 @@ void TLiquidazione_app::build_nomiditte(TProgind* pnd)
|
||||
_nomiditte.add(d);
|
||||
}
|
||||
if (pnd) pnd->addstatus(1);
|
||||
TApplication::set_firm(__firm);
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::to_ditt_handler(TMask_field& f, KEY key)
|
||||
|
@ -424,7 +424,7 @@ public:
|
||||
bool look_del(int month, int type, bool create = FALSE);
|
||||
bool look_iva(const char* cod);
|
||||
bool look_reg(const char* reg);
|
||||
bool look_lia(bool create = FALSE, int anno = 0);
|
||||
bool look_lia(long ditta = 0l, bool create = FALSE, int anno = 0);
|
||||
bool look_rmb(int month, const char* codiva, tiporeg tr, bool create);
|
||||
|
||||
_VendItem* look_vendita(int m, const char* codreg);
|
||||
|
@ -570,7 +570,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
ok = (tipocr == 0 || tipocr == 1 || tipocr == 5);
|
||||
|
||||
if (tipomov == vendita && !ok)
|
||||
ok = !tipoiva.empty() && tipodoc != "CR" &&
|
||||
ok = tipoiva.empty() && tipodoc != "CR" &&
|
||||
tipodoc != "SC" && tipodoc != "RF";
|
||||
|
||||
if (ok)
|
||||
@ -837,7 +837,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
_pim_r->put("R5",ifs);
|
||||
_pim_r->put("R6",vfs);
|
||||
_pim_r->put("R7",adf);
|
||||
_pim_r->put("R8",adi);
|
||||
_pim_r->put("R8",adi);
|
||||
|
||||
// questi servono per i ricalcoli altrui (classify_pim)
|
||||
_pim_r->put("I1", (long)tipomov);
|
||||
_pim_r->put("B3", ivarimb ? "X" : "");
|
||||
_pim_r->put("B4", _isricacq ? "X" : "");
|
||||
_pim_r->put("S5", tipoiva);
|
||||
_pim->rewrite();
|
||||
}
|
||||
while (_cur->next_match(LF_RMOVIVA));
|
||||
|
@ -452,10 +452,11 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TLiquidazione_app::look_lia(bool create, int year)
|
||||
bool TLiquidazione_app::look_lia(long ditta, bool create, int year)
|
||||
{
|
||||
if (year == 0) year = atoi(_year);
|
||||
TString16 y; y.format("%05ld%04d", get_firm(), year);
|
||||
if (year == 0) year = atoi(_year);
|
||||
if (ditta == 0l) ditta = get_firm();
|
||||
TString16 y; y.format("%05ld%04d", ditta, year);
|
||||
|
||||
_lia->zero();
|
||||
_lia->put("CODTAB", y);
|
||||
|
@ -309,10 +309,12 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
|
||||
|
||||
// scorri i bellissimi progressivi mensili rimborso
|
||||
for (_rmb->first(); !_rmb->eof(); _rmb->next())
|
||||
{
|
||||
if (_year != (const char*)_rmb_anno ||
|
||||
( atoi((const char*)_rmb_mese) < month -2 ||
|
||||
atoi((const char*)_rmb_mese) > month))
|
||||
{
|
||||
int year = atoi((const char*)_year);
|
||||
int ryear = atoi((const char*)(*_rmb_anno));
|
||||
int rmese = atoi((const char*)(*_rmb_mese));
|
||||
|
||||
if (year != ryear || (rmese < (month - 2) || rmese > month))
|
||||
continue;
|
||||
|
||||
real imp = _rmb->get("R0");
|
||||
@ -324,7 +326,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
|
||||
rb->_iva = iva;
|
||||
rb->_perc = per;
|
||||
|
||||
TArray& arr = (tiporeg)atoi((const char*)_rmb_tiporeg) == vendita ? varr : aarr;
|
||||
TArray& arr = (tiporeg)atoi((const char*)(*_rmb_tiporeg)) == vendita ? varr : aarr;
|
||||
|
||||
for (int i = 0; i < arr.items(); i++)
|
||||
{
|
||||
@ -335,7 +337,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
|
||||
arr.insert(rb, i);
|
||||
|
||||
// totali imponibili
|
||||
if ((tiporeg)atoi((const char*)_rmb_tiporeg) == vendita)
|
||||
if ((tiporeg)atoi((const char*)(*_rmb_tiporeg)) == vendita)
|
||||
vtot += imp;
|
||||
else
|
||||
atot += imp;
|
||||
|
@ -36,7 +36,6 @@ protected:
|
||||
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual void on_firm_change();
|
||||
|
||||
// minchia di cristo
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
@ -53,7 +52,9 @@ protected:
|
||||
// creati automaticamente
|
||||
virtual int write(const TMask& m) { return rewrite(m);}
|
||||
virtual int read(TMask& m);
|
||||
|
||||
|
||||
void init_array(TMask& m);
|
||||
|
||||
// notifier
|
||||
static bool sheet_action(int r, KEY k);
|
||||
|
||||
@ -119,9 +120,9 @@ void TParaliq_app::check_registers(int year)
|
||||
}
|
||||
|
||||
|
||||
void TParaliq_app::on_firm_change()
|
||||
void TParaliq_app::init_array(TMask& m)
|
||||
{
|
||||
const long newditta = get_firm();
|
||||
const long newditta = m.get_long(F_CODDITTA);
|
||||
|
||||
if (newditta != _lastditta)
|
||||
{
|
||||
@ -146,7 +147,7 @@ void TParaliq_app::on_firm_change()
|
||||
_freqiva = _ditte->get(NDT_FREQVIVA);
|
||||
else
|
||||
_freqiva = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TParaliq_app::user_create()
|
||||
@ -191,7 +192,9 @@ void TParaliq_app::init_insert_mode(TMask& m)
|
||||
{
|
||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||
TToken_string tt(60);
|
||||
|
||||
|
||||
init_array(m);
|
||||
|
||||
m.set(F_FREQ_VERS, _freqiva);
|
||||
|
||||
for (int i = 0; i < _atts.items(); i++)
|
||||
@ -210,7 +213,7 @@ void TParaliq_app::init_insert_mode(TMask& m)
|
||||
sf.row(-1) = tt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int TParaliq_app::rewrite(const TMask& m)
|
||||
{
|
||||
// scrive %LIA
|
||||
@ -309,35 +312,27 @@ int TParaliq_app::read(TMask& m)
|
||||
m.autoload(get_relation());
|
||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||
TToken_string tt(60);
|
||||
const long firm = get_firm();
|
||||
const int year = m.get_int(F_YEAR);
|
||||
const long firm = m.get_long(F_CODDITTA);
|
||||
const int year = m.get_int(F_YEAR);
|
||||
|
||||
sf.reset();
|
||||
for (int i = 0; i < _atts.items(); i++)
|
||||
const TString16 ctab = format("%05ld%d", firm, year);
|
||||
_pla->zero();
|
||||
_pla->put("CODTAB", ctab);
|
||||
|
||||
for (int err = _pla->read(_isgteq); err == NOERR; _pla->next())
|
||||
{
|
||||
TString& att = (TString&)_atts[i];
|
||||
|
||||
// cerca l'attivita' in pla
|
||||
_pla->zero();
|
||||
_pla->put("CODTAB", format("%05ld%d%s1", firm, year, (const char *) att));
|
||||
tt = "";
|
||||
tt.add(att);
|
||||
if (_pla->read() == NOERR)
|
||||
if (ctab == _pla->get("CODTAB").left(9))
|
||||
{
|
||||
tt = "";
|
||||
tt.add(ctab.mid(9,5));
|
||||
tt.add(_pla->get("S7")); // tipo attivita'
|
||||
tt.add(_pla->get("R8")); // prorata
|
||||
tt.add(_pla->get("R5")); // plafond art. 8
|
||||
tt.add(_pla->get("R6")); // plafond art. 8bis
|
||||
tt.add(_pla->get("R7")); // plafond art. 9
|
||||
}
|
||||
else
|
||||
{
|
||||
tt.add("");
|
||||
tt.add("");
|
||||
tt.add("");
|
||||
tt.add("");
|
||||
tt.add("");
|
||||
}
|
||||
else break;
|
||||
sf.row(-1) = tt;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,8 @@ BEGIN
|
||||
DISPLAY "Ragione Sociale@50" RAGSOC
|
||||
DISPLAY "Codice" CODDITTA
|
||||
COPY OUTPUT F_CODDITTA
|
||||
CHECKTYPE REQUIRED
|
||||
CHECKTYPE REQUIRED
|
||||
KEY 2
|
||||
END
|
||||
|
||||
NUMBER F_YEAR 4
|
||||
|
@ -67,7 +67,7 @@ bool Visliq_app::create()
|
||||
"Cod.@5|Ragione Sociale@50|Vers.");
|
||||
|
||||
_del = new TTable("%DEL");
|
||||
_lia = new TTable("LIA");
|
||||
_lia = new TTable("%LIA");
|
||||
_lim = new TTable("LIM");
|
||||
_del_r = &(_del->curr());
|
||||
_lim_r = &(_lim->curr());
|
||||
@ -147,6 +147,7 @@ void Visliq_app::build_nomiditte()
|
||||
// ricostruire _nomiditte e rifare build_ditte_sheet
|
||||
TLocalisamfile& dt = _nditte->lfile();
|
||||
TString fr(2);
|
||||
TTable lia("%LIA");
|
||||
|
||||
for (dt.first(); !dt.eof(); dt.next())
|
||||
{
|
||||
@ -157,9 +158,7 @@ void Visliq_app::build_nomiditte()
|
||||
if (good)
|
||||
{
|
||||
// check no parametri liquidazione
|
||||
TApplication::set_firm(dt.get_long("CODDITTA"));
|
||||
TTable lia("LIA");
|
||||
lia.put("CODTAB", format("%d",_year));
|
||||
lia.put("CODTAB", format("%05ld%d",dt.get_long("CODDITTA"),_year));
|
||||
if (lia.read() != NOERR) good = FALSE;
|
||||
else fr = lia.get("S7");
|
||||
}
|
||||
@ -173,7 +172,6 @@ void Visliq_app::build_nomiditte()
|
||||
|
||||
_nomiditte.add(d);
|
||||
}
|
||||
TApplication::set_firm(_firm);
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
void build_ditte_sheet();
|
||||
void build_nomiditte();
|
||||
|
||||
bool look_lia(int year = 0);
|
||||
bool look_lia(long ditta = 0l, int year = 0);
|
||||
bool look_lim(int m);
|
||||
bool look_del(int month, int type, bool create = FALSE);
|
||||
|
||||
|
@ -35,10 +35,11 @@ bool Visliq_app::look_del(int month, int type, bool create)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool Visliq_app::look_lia(int year)
|
||||
bool Visliq_app::look_lia(long ditta, int year)
|
||||
{
|
||||
if (year == 0) year = _year;
|
||||
TString16 y; y << year;
|
||||
if (year == 0) year = _year;
|
||||
if (ditta == 0l) ditta = get_firm();
|
||||
TString16 y; y << format("%05ld", ditta); y << year;
|
||||
|
||||
_lia->zero();
|
||||
_lia->put("CODTAB", y);
|
||||
|
Loading…
x
Reference in New Issue
Block a user