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 <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
// Calcola l'anno di esercizio di una data
|
// Calcola l'anno di esercizio di una data
|
||||||
// Certified 99%
|
// Certified 99%
|
||||||
|
@ -178,8 +178,9 @@ bool TLiquidazione_app::user_create()
|
|||||||
_lam_mese = new TRecfield(*_lam_r,"CODTAB",4,6);
|
_lam_mese = new TRecfield(*_lam_r,"CODTAB",4,6);
|
||||||
|
|
||||||
_rmb_anno = new TRecfield(*_rmb_r,"CODTAB",0,3);
|
_rmb_anno = new TRecfield(*_rmb_r,"CODTAB",0,3);
|
||||||
_rmb_mese = new TRecfield(*_rmb_r,"CODTAB",4,6);
|
_rmb_mese = new TRecfield(*_rmb_r,"CODTAB",4,5);
|
||||||
_rmb_codiva = new TRecfield(*_rmb_r,"CODTAB",7,10);
|
_rmb_codiva = new TRecfield(*_rmb_r,"CODTAB",6,9);
|
||||||
|
_rmb_tiporeg = new TRecfield(*_rmb_r,"CODTAB",10,10);
|
||||||
|
|
||||||
|
|
||||||
__firm = TApplication::get_firm();
|
__firm = TApplication::get_firm();
|
||||||
@ -431,8 +432,7 @@ void TLiquidazione_app::build_nomiditte(TProgind* pnd)
|
|||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
TApplication::set_firm(dt.get_long("CODDITTA"));
|
if (!look_lia(dt.get_long("CODDITTA"))) good = FALSE;
|
||||||
if (!look_lia()) good = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TToken_string* d = new TToken_string(64);
|
TToken_string* d = new TToken_string(64);
|
||||||
@ -446,7 +446,6 @@ void TLiquidazione_app::build_nomiditte(TProgind* pnd)
|
|||||||
_nomiditte.add(d);
|
_nomiditte.add(d);
|
||||||
}
|
}
|
||||||
if (pnd) pnd->addstatus(1);
|
if (pnd) pnd->addstatus(1);
|
||||||
TApplication::set_firm(__firm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TLiquidazione_app::to_ditt_handler(TMask_field& f, KEY key)
|
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_del(int month, int type, bool create = FALSE);
|
||||||
bool look_iva(const char* cod);
|
bool look_iva(const char* cod);
|
||||||
bool look_reg(const char* reg);
|
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);
|
bool look_rmb(int month, const char* codiva, tiporeg tr, bool create);
|
||||||
|
|
||||||
_VendItem* look_vendita(int m, const char* codreg);
|
_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);
|
ok = (tipocr == 0 || tipocr == 1 || tipocr == 5);
|
||||||
|
|
||||||
if (tipomov == vendita && !ok)
|
if (tipomov == vendita && !ok)
|
||||||
ok = !tipoiva.empty() && tipodoc != "CR" &&
|
ok = tipoiva.empty() && tipodoc != "CR" &&
|
||||||
tipodoc != "SC" && tipodoc != "RF";
|
tipodoc != "SC" && tipodoc != "RF";
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -838,6 +838,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
_pim_r->put("R6",vfs);
|
_pim_r->put("R6",vfs);
|
||||||
_pim_r->put("R7",adf);
|
_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();
|
_pim->rewrite();
|
||||||
}
|
}
|
||||||
while (_cur->next_match(LF_RMOVIVA));
|
while (_cur->next_match(LF_RMOVIVA));
|
||||||
|
@ -452,10 +452,11 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
|||||||
return ok;
|
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);
|
if (year == 0) year = atoi(_year);
|
||||||
TString16 y; y.format("%05ld%04d", get_firm(), year);
|
if (ditta == 0l) ditta = get_firm();
|
||||||
|
TString16 y; y.format("%05ld%04d", ditta, year);
|
||||||
|
|
||||||
_lia->zero();
|
_lia->zero();
|
||||||
_lia->put("CODTAB", y);
|
_lia->put("CODTAB", y);
|
||||||
|
@ -310,9 +310,11 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
|
|||||||
// scorri i bellissimi progressivi mensili rimborso
|
// scorri i bellissimi progressivi mensili rimborso
|
||||||
for (_rmb->first(); !_rmb->eof(); _rmb->next())
|
for (_rmb->first(); !_rmb->eof(); _rmb->next())
|
||||||
{
|
{
|
||||||
if (_year != (const char*)_rmb_anno ||
|
int year = atoi((const char*)_year);
|
||||||
( atoi((const char*)_rmb_mese) < month -2 ||
|
int ryear = atoi((const char*)(*_rmb_anno));
|
||||||
atoi((const char*)_rmb_mese) > month))
|
int rmese = atoi((const char*)(*_rmb_mese));
|
||||||
|
|
||||||
|
if (year != ryear || (rmese < (month - 2) || rmese > month))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
real imp = _rmb->get("R0");
|
real imp = _rmb->get("R0");
|
||||||
@ -324,7 +326,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
|
|||||||
rb->_iva = iva;
|
rb->_iva = iva;
|
||||||
rb->_perc = per;
|
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++)
|
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);
|
arr.insert(rb, i);
|
||||||
|
|
||||||
// totali imponibili
|
// totali imponibili
|
||||||
if ((tiporeg)atoi((const char*)_rmb_tiporeg) == vendita)
|
if ((tiporeg)atoi((const char*)(*_rmb_tiporeg)) == vendita)
|
||||||
vtot += imp;
|
vtot += imp;
|
||||||
else
|
else
|
||||||
atot += imp;
|
atot += imp;
|
||||||
|
@ -36,7 +36,6 @@ protected:
|
|||||||
|
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
virtual void on_firm_change();
|
|
||||||
|
|
||||||
// minchia di cristo
|
// minchia di cristo
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
virtual TRelation* get_relation() const { return _rel; }
|
||||||
@ -54,6 +53,8 @@ protected:
|
|||||||
virtual int write(const TMask& m) { return rewrite(m);}
|
virtual int write(const TMask& m) { return rewrite(m);}
|
||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
|
|
||||||
|
void init_array(TMask& m);
|
||||||
|
|
||||||
// notifier
|
// notifier
|
||||||
static bool sheet_action(int r, KEY k);
|
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)
|
if (newditta != _lastditta)
|
||||||
{
|
{
|
||||||
@ -192,6 +193,8 @@ void TParaliq_app::init_insert_mode(TMask& m)
|
|||||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||||
TToken_string tt(60);
|
TToken_string tt(60);
|
||||||
|
|
||||||
|
init_array(m);
|
||||||
|
|
||||||
m.set(F_FREQ_VERS, _freqiva);
|
m.set(F_FREQ_VERS, _freqiva);
|
||||||
|
|
||||||
for (int i = 0; i < _atts.items(); i++)
|
for (int i = 0; i < _atts.items(); i++)
|
||||||
@ -309,35 +312,27 @@ int TParaliq_app::read(TMask& m)
|
|||||||
m.autoload(get_relation());
|
m.autoload(get_relation());
|
||||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||||
TToken_string tt(60);
|
TToken_string tt(60);
|
||||||
const long firm = get_firm();
|
const long firm = m.get_long(F_CODDITTA);
|
||||||
const int year = m.get_int(F_YEAR);
|
const int year = m.get_int(F_YEAR);
|
||||||
|
|
||||||
sf.reset();
|
sf.reset();
|
||||||
for (int i = 0; i < _atts.items(); i++)
|
const TString16 ctab = format("%05ld%d", firm, year);
|
||||||
{
|
|
||||||
TString& att = (TString&)_atts[i];
|
|
||||||
|
|
||||||
// cerca l'attivita' in pla
|
|
||||||
_pla->zero();
|
_pla->zero();
|
||||||
_pla->put("CODTAB", format("%05ld%d%s1", firm, year, (const char *) att));
|
_pla->put("CODTAB", ctab);
|
||||||
tt = "";
|
|
||||||
tt.add(att);
|
for (int err = _pla->read(_isgteq); err == NOERR; _pla->next())
|
||||||
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("S7")); // tipo attivita'
|
||||||
tt.add(_pla->get("R8")); // prorata
|
tt.add(_pla->get("R8")); // prorata
|
||||||
tt.add(_pla->get("R5")); // plafond art. 8
|
tt.add(_pla->get("R5")); // plafond art. 8
|
||||||
tt.add(_pla->get("R6")); // plafond art. 8bis
|
tt.add(_pla->get("R6")); // plafond art. 8bis
|
||||||
tt.add(_pla->get("R7")); // plafond art. 9
|
tt.add(_pla->get("R7")); // plafond art. 9
|
||||||
}
|
}
|
||||||
else
|
else break;
|
||||||
{
|
|
||||||
tt.add("");
|
|
||||||
tt.add("");
|
|
||||||
tt.add("");
|
|
||||||
tt.add("");
|
|
||||||
tt.add("");
|
|
||||||
}
|
|
||||||
sf.row(-1) = tt;
|
sf.row(-1) = tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ BEGIN
|
|||||||
DISPLAY "Codice" CODDITTA
|
DISPLAY "Codice" CODDITTA
|
||||||
COPY OUTPUT F_CODDITTA
|
COPY OUTPUT F_CODDITTA
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
|
KEY 2
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_YEAR 4
|
NUMBER F_YEAR 4
|
||||||
|
@ -67,7 +67,7 @@ bool Visliq_app::create()
|
|||||||
"Cod.@5|Ragione Sociale@50|Vers.");
|
"Cod.@5|Ragione Sociale@50|Vers.");
|
||||||
|
|
||||||
_del = new TTable("%DEL");
|
_del = new TTable("%DEL");
|
||||||
_lia = new TTable("LIA");
|
_lia = new TTable("%LIA");
|
||||||
_lim = new TTable("LIM");
|
_lim = new TTable("LIM");
|
||||||
_del_r = &(_del->curr());
|
_del_r = &(_del->curr());
|
||||||
_lim_r = &(_lim->curr());
|
_lim_r = &(_lim->curr());
|
||||||
@ -147,6 +147,7 @@ void Visliq_app::build_nomiditte()
|
|||||||
// ricostruire _nomiditte e rifare build_ditte_sheet
|
// ricostruire _nomiditte e rifare build_ditte_sheet
|
||||||
TLocalisamfile& dt = _nditte->lfile();
|
TLocalisamfile& dt = _nditte->lfile();
|
||||||
TString fr(2);
|
TString fr(2);
|
||||||
|
TTable lia("%LIA");
|
||||||
|
|
||||||
for (dt.first(); !dt.eof(); dt.next())
|
for (dt.first(); !dt.eof(); dt.next())
|
||||||
{
|
{
|
||||||
@ -157,9 +158,7 @@ void Visliq_app::build_nomiditte()
|
|||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
TApplication::set_firm(dt.get_long("CODDITTA"));
|
lia.put("CODTAB", format("%05ld%d",dt.get_long("CODDITTA"),_year));
|
||||||
TTable lia("LIA");
|
|
||||||
lia.put("CODTAB", format("%d",_year));
|
|
||||||
if (lia.read() != NOERR) good = FALSE;
|
if (lia.read() != NOERR) good = FALSE;
|
||||||
else fr = lia.get("S7");
|
else fr = lia.get("S7");
|
||||||
}
|
}
|
||||||
@ -173,7 +172,6 @@ void Visliq_app::build_nomiditte()
|
|||||||
|
|
||||||
_nomiditte.add(d);
|
_nomiditte.add(d);
|
||||||
}
|
}
|
||||||
TApplication::set_firm(_firm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
void build_ditte_sheet();
|
void build_ditte_sheet();
|
||||||
void build_nomiditte();
|
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_lim(int m);
|
||||||
bool look_del(int month, int type, bool create = FALSE);
|
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;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Visliq_app::look_lia(int year)
|
bool Visliq_app::look_lia(long ditta, int year)
|
||||||
{
|
{
|
||||||
if (year == 0) year = _year;
|
if (year == 0) year = _year;
|
||||||
TString16 y; y << year;
|
if (ditta == 0l) ditta = get_firm();
|
||||||
|
TString16 y; y << format("%05ld", ditta); y << year;
|
||||||
|
|
||||||
_lia->zero();
|
_lia->zero();
|
||||||
_lia->put("CODTAB", y);
|
_lia->put("CODTAB", y);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user