Patch level : 2..0 442
Files correlati : cg4.exe Ricompilazione Demo : [ ] Commento : Aggiunto il supporto delle lingue a cg5 git-svn-id: svn://10.65.10.50/trunk@10970 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
aee9da7113
commit
abdfea53b7
@ -10,6 +10,6 @@ public:
|
|||||||
int cg5000 (int argc, char* argv[])
|
int cg5000 (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
CG5_App appc;
|
CG5_App appc;
|
||||||
appc.run(argc, argv, "Parametri Studio");
|
appc.run(argc, argv, TR("Parametri Studio"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
100
cg/cg5100.cpp
100
cg/cg5100.cpp
@ -2,6 +2,7 @@
|
|||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <modaut.h>
|
#include <modaut.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
|
||||||
#include <attiv.h>
|
#include <attiv.h>
|
||||||
@ -33,18 +34,18 @@ public:
|
|||||||
|
|
||||||
bool TParametri_ditta::user_create()
|
bool TParametri_ditta::user_create()
|
||||||
{
|
{
|
||||||
// _change_pcon = FALSE;
|
TRelation att(LF_ATTIV);
|
||||||
|
TRectype & r = att.curr();
|
||||||
|
|
||||||
TLocalisamfile attiv(LF_ATTIV);
|
r.put(ATT_CODDITTA, get_firm());
|
||||||
attiv.zero();
|
|
||||||
|
|
||||||
attiv.put(ATT_CODDITTA, get_firm());
|
TCursor cur(&att, "", 1, &r, &r);
|
||||||
TRectype r(attiv.curr());
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
for(attiv.read(_isgteq); attiv.status() == NOERR && attiv.curr() == r;
|
cur.freeze();
|
||||||
attiv.next())
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
// istanzia array _atts on le attivita' della ditta corrente
|
// istanzia array _atts on le attivita' della ditta corrente
|
||||||
_atts.add(new TString(attiv.get(ATT_CODATT)));
|
_atts.add(r.get(ATT_CODATT));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -54,55 +55,57 @@ void TParametri_ditta::check_registers(int year)
|
|||||||
{
|
{
|
||||||
// controlla che per ogni data attivita' esistano almeno un registro
|
// controlla che per ogni data attivita' esistano almeno un registro
|
||||||
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
||||||
TTable reg("REG");
|
|
||||||
TRecfield reg_year(reg.curr(), "CODTAB", 0,3);
|
|
||||||
|
|
||||||
const byte R_ACQ = 0x01;
|
const byte R_ACQ = 0x01;
|
||||||
const byte R_VEN = 0x02;
|
const byte R_VEN = 0x02;
|
||||||
const byte R_ALL = R_ACQ | R_VEN;
|
const byte R_ALL = R_ACQ | R_VEN;
|
||||||
|
TRelation relreg("REG");
|
||||||
bool is_giornale = FALSE;
|
TRectype & reg = relreg.curr();
|
||||||
|
bool is_giornale = FALSE;
|
||||||
byte flags = 0x00;
|
|
||||||
|
|
||||||
for (int i = 0; i < _atts.items(); i++)
|
for (int i = 0; i < _atts.items(); i++)
|
||||||
{
|
{
|
||||||
TString& att = (TString&)_atts[i];
|
byte flags = 0x00;
|
||||||
for (reg.first(); !reg.eof(); reg.next())
|
const TString& att = (TString&)_atts[i];
|
||||||
{
|
TString filter;
|
||||||
if (atoi(reg_year) == year && reg.get_int("I0") == 5)
|
|
||||||
{
|
reg.put("CODTAB", year);
|
||||||
|
filter.format("(S8==\"\")||(S8==\"%s\")", (const char *) att);
|
||||||
|
|
||||||
|
TCursor cur(&relreg, filter, 1, ®, ®);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0L; (flags != R_ALL || !is_giornale) && (cur.pos() < items); ++cur)
|
||||||
|
{
|
||||||
|
if (reg.get_int("I0") == 5)
|
||||||
is_giornale = TRUE;
|
is_giornale = TRUE;
|
||||||
continue;
|
else
|
||||||
}
|
{
|
||||||
if (atoi(reg_year) != year || att != reg.get("S8"))
|
switch (reg.get_int("I0"))
|
||||||
continue;
|
{
|
||||||
|
case 1: // vendite
|
||||||
switch (reg.get_int("I0"))
|
flags |= R_VEN; break;
|
||||||
{
|
case 2: // acquisti
|
||||||
case 1: // vendite
|
flags |= R_ACQ; break;
|
||||||
flags |= R_VEN; break;
|
default:
|
||||||
case 2: // acquisti
|
break;
|
||||||
flags |= R_ACQ; break;
|
}
|
||||||
default:
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (flags == R_ALL && is_giornale) break;
|
|
||||||
}
|
}
|
||||||
if (flags < R_ALL)
|
if (flags < R_ALL)
|
||||||
{
|
{
|
||||||
TString wrn("I seguenti registri non esistono per l'attivita' ");
|
TString wrn(TR("I seguenti registri non esistono per l'attivita' "));
|
||||||
wrn << att << "(" << year << "):";
|
wrn << att << "(" << year << "):";
|
||||||
if ((flags & R_VEN) == 0x00) wrn << "\n\tregistro vendite";
|
if ((flags & R_VEN) == 0x00) wrn << TR("\n\tregistro vendite");
|
||||||
if ((flags & R_ACQ) == 0x00) wrn << "\n\tregistro acquisti";
|
if ((flags & R_ACQ) == 0x00) wrn << TR("\n\tregistro acquisti");
|
||||||
warning_box(wrn);
|
warning_box(wrn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// libro giornale non si controlla per attivita'
|
// libro giornale non si controlla per attivita'
|
||||||
if(!is_giornale)
|
if(!is_giornale)
|
||||||
warning_box("Non esiste probabilmente nessun "
|
warning_box(FR("Non esiste probabilmente nessun "
|
||||||
"libro giornale per l'anno %d", year);
|
"libro giornale per l'anno %d"), year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,11 +192,14 @@ bool TParametri_ditta::postprocess_config(TMask& mask, TConfig& config)
|
|||||||
bool TParametri_ditta::postprocess_config_changed(const char* par, const char* var,
|
bool TParametri_ditta::postprocess_config_changed(const char* par, const char* var,
|
||||||
const char* oldv, const char* newv)
|
const char* oldv, const char* newv)
|
||||||
{
|
{
|
||||||
TString v(var);
|
const bool changed = strcmp(oldv, newv) != 0;
|
||||||
|
|
||||||
if (v == "AnCfCm")
|
if (!changed)
|
||||||
|
return TRUE;
|
||||||
|
const TFixed_string v(var);
|
||||||
|
if (v == "AnCfCm")
|
||||||
{
|
{
|
||||||
if (yesno_box("Confermi il cambiamento dell'anagrafica clienti/fornitori"))
|
if (yesno_box(TR("Confermare il cambiamento dell'anagrafica clienti/fornitori")))
|
||||||
{
|
{
|
||||||
swap_file(LF_CLIFO, *newv == 'X');
|
swap_file(LF_CLIFO, *newv == 'X');
|
||||||
swap_file(LF_INDSP, *newv == 'X');
|
swap_file(LF_INDSP, *newv == 'X');
|
||||||
@ -203,10 +209,8 @@ bool TParametri_ditta::postprocess_config_changed(const char* par, const char* v
|
|||||||
}
|
}
|
||||||
else if (v == "PcTcCm")
|
else if (v == "PcTcCm")
|
||||||
{
|
{
|
||||||
if (yesno_box("Confermi il cambiamento del piano conti/causali"))
|
if (yesno_box(TR("Confermare il cambiamento del piano conti/causali")))
|
||||||
{
|
{
|
||||||
// _change_pcon = TRUE;
|
|
||||||
// _val = newv;
|
|
||||||
swap_file(LF_PCON, *newv == 'X');
|
swap_file(LF_PCON, *newv == 'X');
|
||||||
swap_file(LF_CAUSALI, *newv == 'X');
|
swap_file(LF_CAUSALI, *newv == 'X');
|
||||||
swap_file(LF_RCAUSALI, *newv == 'X');
|
swap_file(LF_RCAUSALI, *newv == 'X');
|
||||||
@ -215,7 +219,7 @@ bool TParametri_ditta::postprocess_config_changed(const char* par, const char* v
|
|||||||
{
|
{
|
||||||
TDir d;
|
TDir d;
|
||||||
d.get(LF_PCON, _nolock, _comdir);
|
d.get(LF_PCON, _nolock, _comdir);
|
||||||
if (d.eod() == 0 && yesno_box("Vuoi caricare gli archivi standard ?"))
|
if (d.eod() == 0 && yesno_box(TR("Si desidera caricare gli archivi standard ?")))
|
||||||
{
|
{
|
||||||
load_file(LF_PCON);
|
load_file(LF_PCON);
|
||||||
load_file(LF_CAUSALI);
|
load_file(LF_CAUSALI);
|
||||||
@ -232,6 +236,6 @@ bool TParametri_ditta::postprocess_config_changed(const char* par, const char* v
|
|||||||
int cg5100 (int argc, char* argv[])
|
int cg5100 (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TParametri_ditta appc;
|
TParametri_ditta appc;
|
||||||
appc.run(argc, argv, "Parametri Ditta");
|
appc.run(argc, argv, TR("Parametri Ditta"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,6 @@ class TSaldibrowse_application : public TBrowse_application
|
|||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TCursor * _cur;
|
TCursor * _cur;
|
||||||
TRelation * _rel,* _rel1;
|
TRelation * _rel,* _rel1;
|
||||||
// TTable * _esc;
|
|
||||||
TRiga_array _riga;
|
TRiga_array _riga;
|
||||||
int _anno, _annop, _g, _c;
|
int _anno, _annop, _g, _c;
|
||||||
long _s;
|
long _s;
|
||||||
@ -204,12 +203,8 @@ bool TSaldibrowse_application::fai_filtro()
|
|||||||
_saldo_conto = TRUE;
|
_saldo_conto = TRUE;
|
||||||
else _saldo_sottoc = TRUE;
|
else _saldo_sottoc = TRUE;
|
||||||
|
|
||||||
TLocalisamfile& saldi = _rel1->lfile();
|
TRectype from (LF_SALDI);
|
||||||
TRectype from (saldi.curr());
|
TRectype to (LF_SALDI);
|
||||||
TRectype to (saldi.curr());
|
|
||||||
from.zero();
|
|
||||||
to.zero();
|
|
||||||
|
|
||||||
|
|
||||||
from.put(SLD_GRUPPO,_g);
|
from.put(SLD_GRUPPO,_g);
|
||||||
if (_c != 0)
|
if (_c != 0)
|
||||||
@ -238,7 +233,7 @@ bool TSaldibrowse_application::anno_handler(TMask_field& f, KEY key)
|
|||||||
if (anno > 0)
|
if (anno > 0)
|
||||||
{
|
{
|
||||||
if (!app()._ese.exist(anno))
|
if (!app()._ese.exist(anno))
|
||||||
return f.error_box("Esercizio %d non presente.", anno);
|
return f.error_box(FR("Esercizio %d non presente."), anno);
|
||||||
else
|
else
|
||||||
app()._anno = anno;
|
app()._anno = anno;
|
||||||
}
|
}
|
||||||
@ -265,8 +260,6 @@ bool TSaldibrowse_application::sottoc_handler(TMask_field& f, KEY key)
|
|||||||
int gruppo = m.get_int(F_GRUPPO);
|
int gruppo = m.get_int(F_GRUPPO);
|
||||||
int conto = m.get_int(F_CONTO);
|
int conto = m.get_int(F_CONTO);
|
||||||
const long sottoconto = atol(f.get());
|
const long sottoconto = atol(f.get());
|
||||||
TLocalisamfile pconti(LF_PCON);
|
|
||||||
|
|
||||||
const short id = f.dlg();
|
const short id = f.dlg();
|
||||||
|
|
||||||
if (sottoconto != 0)
|
if (sottoconto != 0)
|
||||||
@ -275,23 +268,26 @@ bool TSaldibrowse_application::sottoc_handler(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (gruppo != 0 && conto != 0)
|
if (gruppo != 0 && conto != 0)
|
||||||
{
|
{
|
||||||
pconti.setkey(1);
|
TString key;
|
||||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
|
||||||
pconti.put(PCN_CONTO, conto);
|
key.format("%d|%d|%ld", gruppo, conto, sottoconto);
|
||||||
pconti.put(PCN_SOTTOCONTO, sottoconto);
|
|
||||||
ok = stop = pconti.read() == NOERR;
|
const TRectype & pconti = cache().get(LF_PCON, key);
|
||||||
|
|
||||||
|
ok = stop = !pconti.empty();
|
||||||
}
|
}
|
||||||
//else ok = FALSE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char tipo = id == F_SOTTOC_CLIENTE ? 'C' : 'F';
|
const char tipo = id == F_SOTTOC_CLIENTE ? 'C' : 'F';
|
||||||
TLocalisamfile clifo (LF_CLIFO);
|
TString key;
|
||||||
clifo.setkey(1);
|
|
||||||
clifo.put(CLI_TIPOCF,tipo);
|
key.format("%c|%ld", tipo, sottoconto);
|
||||||
clifo.put(CLI_CODCF, sottoconto) ;
|
|
||||||
app()._s = sottoconto;
|
app()._s = sottoconto;
|
||||||
ok = stop = clifo.read() == NOERR;
|
|
||||||
|
const TRectype & clifo = cache().get(LF_CLIFO, key);
|
||||||
|
|
||||||
|
ok = stop = !clifo.empty();
|
||||||
if (ok && (gruppo == 0 || conto == 0))
|
if (ok && (gruppo == 0 || conto == 0))
|
||||||
{
|
{
|
||||||
m.set(F_GRUPPO, gruppo = clifo.get_int("GRUPPO"));
|
m.set(F_GRUPPO, gruppo = clifo.get_int("GRUPPO"));
|
||||||
@ -303,18 +299,20 @@ bool TSaldibrowse_application::sottoc_handler(TMask_field& f, KEY key)
|
|||||||
else
|
else
|
||||||
if (gruppo != 0 /* && conto != 0 */)
|
if (gruppo != 0 /* && conto != 0 */)
|
||||||
{
|
{
|
||||||
pconti.setkey(1);
|
TString key;
|
||||||
pconti.zero();
|
|
||||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
key.format("%d|%d", gruppo, conto);
|
||||||
pconti.put(PCN_CONTO, conto);
|
|
||||||
ok = stop = pconti.read() == NOERR;
|
const TRectype & pconti = cache().get(LF_PCON, key);
|
||||||
|
|
||||||
|
ok = stop = !pconti.empty();
|
||||||
if (ok)
|
if (ok)
|
||||||
m.set(F_DESCR_CONTO, pconti.get(PCN_DESCR));
|
m.set(F_DESCR_CONTO, pconti.get(PCN_DESCR));
|
||||||
else
|
else
|
||||||
m.reset(F_DESCR_CONTO);
|
m.reset(F_DESCR_CONTO);
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
f.error_box("Conto errato o incompleto");
|
f.error_box(TR("Conto errato o incompleto"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
@ -322,12 +320,12 @@ bool TSaldibrowse_application::sottoc_handler(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
bool TSaldibrowse_application::user_create()
|
bool TSaldibrowse_application::user_create()
|
||||||
{
|
{
|
||||||
|
open_files(LF_TABCOM, LF_TAB, LF_PCON, LF_SALDI, 0);
|
||||||
_rel = new TRelation(LF_PCON);
|
_rel = new TRelation(LF_PCON);
|
||||||
_rel->add(LF_CLIFO,"TIPOCF=TMCF");
|
_rel->add(LF_CLIFO,"TIPOCF=TMCF");
|
||||||
|
|
||||||
_rel1 = new TRelation(LF_SALDI);
|
_rel1 = new TRelation(LF_SALDI);
|
||||||
_cur = new TCursor(_rel1, "", 2);
|
_cur = new TCursor(_rel1, "", 2);
|
||||||
// _esc = new TTable("ESC");
|
|
||||||
_msk = new TMask("cg5200a");
|
_msk = new TMask("cg5200a");
|
||||||
_msk->set_handler(F_ANNO, anno_handler);
|
_msk->set_handler(F_ANNO, anno_handler);
|
||||||
_msk->set_handler(F_SCARICATO, flsca_handler);
|
_msk->set_handler(F_SCARICATO, flsca_handler);
|
||||||
@ -360,17 +358,14 @@ int TSaldibrowse_application::read(TMask& m)
|
|||||||
m.set(F_ANNO,_anno);
|
m.set(F_ANNO,_anno);
|
||||||
m.set(F_SCARICATO,_scarongly ? "X" : " ");
|
m.set(F_SCARICATO,_scarongly ? "X" : " ");
|
||||||
TString tipo(m.get(F_TIPOCF));
|
TString tipo(m.get(F_TIPOCF));
|
||||||
//if (tipo == "C")
|
|
||||||
// m.set(F_SOTTOC_CLIENTE,_s);
|
|
||||||
//else if (tipo == "F")
|
|
||||||
// m.set(F_SOTTOC_FORN,_s);
|
|
||||||
fai_filtro();
|
fai_filtro();
|
||||||
if (_cur->items() > 0)
|
if (_cur->items() > 0)
|
||||||
compilasheet();
|
compilasheet();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = _iskeynotfound;
|
err = _iskeynotfound;
|
||||||
error_box("Saldi non presenti per il conto specificato.");
|
error_box(TR("Saldi non presenti per il conto specificato."));
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
@ -437,27 +432,6 @@ int TSaldibrowse_application::compare_rows(const TObject** o1, const TObject** o
|
|||||||
{
|
{
|
||||||
TToken_string* r1 = (TToken_string*)*o1;
|
TToken_string* r1 = (TToken_string*)*o1;
|
||||||
TToken_string* r2 = (TToken_string*)*o2;
|
TToken_string* r2 = (TToken_string*)*o2;
|
||||||
|
|
||||||
/* Dick programming
|
|
||||||
TDate d1,d2;
|
|
||||||
TString c1,c2;
|
|
||||||
c1.format("%04d", r1->get_int(0));
|
|
||||||
c2.format("%04d", r2->get_int(0));
|
|
||||||
|
|
||||||
app()._esc->zero();
|
|
||||||
app()._esc->put("CODTAB",c1);
|
|
||||||
if (app()._esc->read() == NOERR)
|
|
||||||
d1 = app()._esc->get_date("D0");
|
|
||||||
else
|
|
||||||
d1 = botime;
|
|
||||||
|
|
||||||
app()._esc->put("CODTAB",c2);
|
|
||||||
if (app()._esc->read() == NOERR)
|
|
||||||
d2 = app()._esc->get_date("D0");
|
|
||||||
else
|
|
||||||
d2 = botime;
|
|
||||||
*/
|
|
||||||
|
|
||||||
TEsercizi_contabili& ese = app()._ese;
|
TEsercizi_contabili& ese = app()._ese;
|
||||||
int a1 = r1->get_int(0);
|
int a1 = r1->get_int(0);
|
||||||
TDate d1 = ese.exist(a1) ? ese[a1].inizio() : TDate(1, 1, a1);
|
TDate d1 = ese.exist(a1) ? ese[a1].inizio() : TDate(1, 1, a1);
|
||||||
@ -615,7 +589,7 @@ void TSaldibrowse_application::compilasheet()
|
|||||||
int cg5200(int argc, char* argv[])
|
int cg5200(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TSaldibrowse_application a;
|
TSaldibrowse_application a;
|
||||||
a.run(argc, argv, "Visualizzazione saldi");
|
a.run(argc, argv, TR("Visualizzazione saldi"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
243
cg/cg5300.cpp
243
cg/cg5300.cpp
@ -7,6 +7,7 @@
|
|||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
@ -24,10 +25,7 @@ class TParaliq_app : public TRelation_application
|
|||||||
{
|
{
|
||||||
TRelation * _rel;
|
TRelation * _rel;
|
||||||
TMask * _msk;
|
TMask * _msk;
|
||||||
TLocalisamfile * _attiv;
|
|
||||||
TLocalisamfile * _ditte;
|
|
||||||
int _yearliq;
|
int _yearliq;
|
||||||
TTable * _pla;
|
|
||||||
|
|
||||||
protected: // Applicat
|
protected: // Applicat
|
||||||
virtual void on_config_change();
|
virtual void on_config_change();
|
||||||
@ -86,19 +84,18 @@ bool TParaliq_app::gelidi_handler(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k==K_SPACE)
|
if (k==K_SPACE)
|
||||||
{
|
{
|
||||||
TLocalisamfile* ditte = app()._ditte;
|
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (m.get_bool(F_GELIDI))
|
if (m.get_bool(F_GELIDI))
|
||||||
{
|
{
|
||||||
const long ditta = m.get_long(F_CODDITTA);
|
const TString & cod = m.get(F_CODDITTA);
|
||||||
ditte->put("CODDITTA", ditta);
|
const TRectype & ditta = cache().get(LF_NDITTE, cod);
|
||||||
if (ditte->read()==NOERR)
|
|
||||||
if (ditte->get("DINIZIOATT").empty())
|
if (ditta.get(NDT_DINIZIOATT).empty())
|
||||||
{
|
{
|
||||||
f.set(" ");
|
f.set(" ");
|
||||||
f.error_box("La gestione della liquidazione differita richiede "
|
f.error_box(TR("La gestione della liquidazione differita richiede "
|
||||||
"la data di inizio attivita' sull'anagrafica della ditta.");
|
"la data di inizio attivita' sull'anagrafica della ditta."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -108,18 +105,21 @@ bool TParaliq_app::agrmin_handler(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
TLocalisamfile* attiv = app()._attiv;
|
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (m.get_bool(F_AGRMIN))
|
if (m.get_bool(F_AGRMIN))
|
||||||
{
|
{
|
||||||
const long ditta = m.get_long(F_CODDITTA);
|
const TString & cod = m.get(F_CODDITTA);
|
||||||
attiv->put(ATT_CODDITTA, ditta);
|
const TRectype & ditta = cache().get(LF_NDITTE, cod);
|
||||||
if (attiv->read(_isgteq) == NOERR && attiv->get_long(ATT_CODDITTA) == ditta
|
TString16 key;
|
||||||
&& !attiv->get_bool(ATT_REGAGR))
|
|
||||||
|
key.format("%s|%s", (const char *) cod, (const char *) ditta.get(NDT_CODATTPREV));
|
||||||
|
const TRectype & attiv = cache().get(LF_ATTIV, key);
|
||||||
|
|
||||||
|
if (!attiv.get_bool(ATT_REGAGR))
|
||||||
{
|
{
|
||||||
f.set(" ");
|
f.set(" ");
|
||||||
f.error_box("La gestione degli agricoltori minimi richiede "
|
f.error_box(TR("La gestione degli agricoltori minimi richiede "
|
||||||
"il settaggio del regime agricolo sull'attivita'.");
|
"il settaggio del regime agricolo sull'attivita'."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,9 +145,9 @@ bool TParaliq_app::credres_handler(TMask_field& f, KEY k)
|
|||||||
const real r = m.get_real(F_CRED_RES);
|
const real r = m.get_real(F_CRED_RES);
|
||||||
const int i = m.get_int(F_MESE_RES_AL);
|
const int i = m.get_int(F_MESE_RES_AL);
|
||||||
if (id == F_MESE_RES_AL && r != 0.0 && i == 0)
|
if (id == F_MESE_RES_AL && r != 0.0 && i == 0)
|
||||||
return f.error_box("Impostare anche il mese.");
|
return f.error_box(TR("Impostare anche il mese."));
|
||||||
if (id == F_CRED_RES && i != 0 && r == 0.0)
|
if (id == F_CRED_RES && i != 0 && r == 0.0)
|
||||||
return f.error_box("Impostare anche il credito residuo.");
|
return f.error_box(TR("Impostare anche il credito residuo."));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -179,19 +179,19 @@ bool TParaliq_app::utcred_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
if (anno_liq >= 2000 && f.get().not_empty())
|
if (anno_liq >= 2000 && f.get().not_empty())
|
||||||
{
|
{
|
||||||
m.field(F_CRED_PREC).set_prompt("Credito compensabile inizio anno ");
|
m.field(F_CRED_PREC).set_prompt(TR("Credito compensabile inizio anno "));
|
||||||
m.field(F_CRED_RES).set_prompt("Credito in compensaz.utilizzato ");
|
m.field(F_CRED_RES).set_prompt(TR("Credito in compensaz.utilizzato "));
|
||||||
m.enable(F_UTCR_IVA);
|
m.enable(F_UTCR_IVA);
|
||||||
cod_mesi = "0|-1";
|
cod_mesi = "0|-1";
|
||||||
des_mesi = " |Inizio Anno";
|
des_mesi = FR(" |Inizio Anno");
|
||||||
mese = !m.field(F_CRED_RES).empty() ? "-1" : "0";
|
mese = !m.field(F_CRED_RES).empty() ? "-1" : "0";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m.field(F_CRED_PREC).set_prompt("Credito precedente ");
|
m.field(F_CRED_PREC).set_prompt(TR("Credito precedente "));
|
||||||
m.field(F_CRED_RES).set_prompt("Credito residuo ");
|
m.field(F_CRED_RES).set_prompt(TR("Credito residuo "));
|
||||||
cod_mesi = "0|1|2|3|4|5|6|7|8|9|10|11|12";
|
cod_mesi = "0|1|2|3|4|5|6|7|8|9|10|11|12";
|
||||||
des_mesi = " |Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre";
|
des_mesi = FR(" |Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre");
|
||||||
mese = app().rel().lfile().get("I0");
|
mese = app().rel().lfile().get("I0");
|
||||||
if (!m.edit_mode() || atoi(mese) < 0)
|
if (!m.edit_mode() || atoi(mese) < 0)
|
||||||
mese.cut(0);
|
mese.cut(0);
|
||||||
@ -211,23 +211,26 @@ void TParaliq_app::check_registers(int year)
|
|||||||
// controlla che per ogni data attivita' esistano almeno un registro
|
// controlla che per ogni data attivita' esistano almeno un registro
|
||||||
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
||||||
TSheet_field& sf = (TSheet_field&)_msk->field(F_SHEET_PLA);
|
TSheet_field& sf = (TSheet_field&)_msk->field(F_SHEET_PLA);
|
||||||
TTable reg("REG");
|
|
||||||
TRecfield reg_year(reg.curr(), "CODTAB", 0,3);
|
|
||||||
|
|
||||||
const byte R_ACQ = 0x01;
|
const byte R_ACQ = 0x01;
|
||||||
const byte R_VEN = 0x02;
|
const byte R_VEN = 0x02;
|
||||||
const byte R_ALL = R_ACQ | R_VEN;
|
const byte R_ALL = R_ACQ | R_VEN;
|
||||||
|
TRelation relreg("REG");
|
||||||
byte flags = 0x00;
|
TRectype & reg = relreg.curr();
|
||||||
|
|
||||||
for (int i = 0; i < sf.items(); i++)
|
for (int i = 0; i < sf.items(); i++)
|
||||||
{
|
{
|
||||||
|
byte flags = 0x00;
|
||||||
const TString16 att(sf.row(i).get(0));
|
const TString16 att(sf.row(i).get(0));
|
||||||
for (reg.first(); !reg.eof(); reg.next())
|
TString filter;
|
||||||
{
|
|
||||||
if (atoi(reg_year) != year || att != reg.get("S8"))
|
reg.put("CODTAB", year);
|
||||||
continue;
|
filter.format("(S8==\"\")||(S8==\"%s\")", (const char *) att);
|
||||||
|
|
||||||
|
TCursor cur(&relreg, filter, 1, ®, ®);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
for (cur = 0L; flags != R_ALL && (cur.pos() < items); ++cur)
|
||||||
|
{
|
||||||
switch (reg.get_int("I0"))
|
switch (reg.get_int("I0"))
|
||||||
{
|
{
|
||||||
case 1: // vendite
|
case 1: // vendite
|
||||||
@ -239,14 +242,13 @@ void TParaliq_app::check_registers(int year)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (flags == R_ALL) break;
|
|
||||||
}
|
}
|
||||||
if (flags < R_ALL)
|
if (flags < R_ALL)
|
||||||
{
|
{
|
||||||
TString wrn("I seguenti registri non esistono per l'attivita' ");
|
TString wrn(TR("I seguenti registri non esistono per l'attivita' "));
|
||||||
wrn << att << "(" << year << "):";
|
wrn << att << "(" << year << "):";
|
||||||
if ((flags & R_VEN) == 0x00) wrn << "\n\tregistro vendite";
|
if ((flags & R_VEN) == 0x00) wrn << TR("\n\tregistro vendite");
|
||||||
if ((flags & R_ACQ) == 0x00) wrn << "\n\tregistro acquisti";
|
if ((flags & R_ACQ) == 0x00) wrn << TR("\n\tregistro acquisti");
|
||||||
warning_box(wrn);
|
warning_box(wrn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,24 +257,25 @@ void TParaliq_app::check_registers(int year)
|
|||||||
void TParaliq_app::init_array(TMask& m, bool update)
|
void TParaliq_app::init_array(TMask& m, bool update)
|
||||||
{
|
{
|
||||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||||
|
|
||||||
const long newditta = m.get_long(F_CODDITTA);
|
const long newditta = m.get_long(F_CODDITTA);
|
||||||
|
TRelation att(LF_ATTIV);
|
||||||
_attiv->zero();
|
TRectype & r = att.curr();
|
||||||
_attiv->put(ATT_CODDITTA, newditta);
|
|
||||||
TRectype r(_attiv->curr());
|
|
||||||
|
|
||||||
|
r.put(ATT_CODDITTA, newditta);
|
||||||
|
|
||||||
|
TCursor cur(&att, "", 1, &r, &r);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(_attiv->read(_isgteq);
|
|
||||||
_attiv->good() && _attiv->curr() == r;
|
cur.freeze();
|
||||||
_attiv->next(), i++)
|
for (cur = 0L; cur.pos() < items; ++cur, i++)
|
||||||
{
|
{
|
||||||
TToken_string& tt = sf.row(i);
|
TToken_string& tt = sf.row(i);
|
||||||
|
|
||||||
// istanzia array _atts on le attivita' della ditta corrente
|
// istanzia array _atts on le attivita' della ditta corrente
|
||||||
tt = "";
|
tt.cut(0);
|
||||||
tt.add(_attiv->get(ATT_CODATT));
|
tt.add(r.get(ATT_CODATT));
|
||||||
tt.add(_attiv->get(ATT_TIPOATT));
|
tt.add(r.get(ATT_TIPOATT));
|
||||||
tt.add("");
|
tt.add("");
|
||||||
tt.add("");
|
tt.add("");
|
||||||
tt.add("");
|
tt.add("");
|
||||||
@ -295,10 +298,9 @@ void TParaliq_app::on_config_change()
|
|||||||
|
|
||||||
bool TParaliq_app::user_create()
|
bool TParaliq_app::user_create()
|
||||||
{
|
{
|
||||||
|
open_files(LF_TABCOM, LF_TAB, LF_NDITTE, LF_ATTIV, 0);
|
||||||
|
|
||||||
_rel = new TRelation(TAB_LIA);
|
_rel = new TRelation(TAB_LIA);
|
||||||
_pla = new TTable(TAB_PLA);
|
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
|
||||||
_ditte = new TLocalisamfile(LF_NDITTE);
|
|
||||||
_msk = new TMask("cg5300a");
|
_msk = new TMask("cg5300a");
|
||||||
|
|
||||||
_msk->set_handler(F_GELIDI,gelidi_handler);
|
_msk->set_handler(F_GELIDI,gelidi_handler);
|
||||||
@ -315,10 +317,7 @@ bool TParaliq_app::user_create()
|
|||||||
bool TParaliq_app::user_destroy()
|
bool TParaliq_app::user_destroy()
|
||||||
{
|
{
|
||||||
delete _rel;
|
delete _rel;
|
||||||
delete _attiv;
|
|
||||||
delete _ditte;
|
|
||||||
delete _msk;
|
delete _msk;
|
||||||
delete _pla;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,52 +385,58 @@ int TParaliq_app::rewrite(const TMask& m)
|
|||||||
|
|
||||||
TString16 codtab;
|
TString16 codtab;
|
||||||
codtab.format("%05ld%4d%s", firm, year, (const char*)att);
|
codtab.format("%05ld%4d%s", firm, year, (const char*)att);
|
||||||
|
TTable pla(TAB_PLA);
|
||||||
|
|
||||||
_pla->zero();
|
pla.put("CODTAB", codtab);
|
||||||
_pla->put("CODTAB", codtab);
|
pla.remove(); // Rimuove dalla tabella PLA il record senza il tipo attivita' ad 1 (se non c'e' fa lo stesso)
|
||||||
_pla->remove(); // Rimuove dalla tabella PLA il record senza il tipo attivita' ad 1 (se non c'e' fa lo stesso)
|
|
||||||
codtab << "1"; // Questo invece e' il codice che deve esistere realmente
|
codtab << "1"; // Questo invece e' il codice che deve esistere realmente
|
||||||
_pla->put("CODTAB", codtab);
|
pla.put("CODTAB", codtab);
|
||||||
was =_pla->read() == NOERR;
|
was = (pla.read() == NOERR);
|
||||||
if (!was) _pla->zero();
|
if (!was) pla.zero();
|
||||||
|
|
||||||
real prorata = _pla->get_real("R8");
|
real prorata = pla.get_real("R8");
|
||||||
real es_a8 = _pla->get_real("R5");
|
real es_a8 = pla.get_real("R5");
|
||||||
real es_a8b = _pla->get_real("R6");
|
real es_a8b = pla.get_real("R6");
|
||||||
real es_a9 = _pla->get_real("R7");
|
real es_a9 = pla.get_real("R7");
|
||||||
|
|
||||||
_pla->put("CODTAB", codtab);
|
pla.put("CODTAB", codtab);
|
||||||
// scrive i campi (vedi a read() per i nomi)
|
// scrive i campi (vedi a read() per i nomi)
|
||||||
// in base alla riga sheet
|
// in base alla riga sheet
|
||||||
_pla->put("S7", tips); // tipo attivita'
|
pla.put("S7", tips); // tipo attivita'
|
||||||
_pla->put("R8", tt.get()); // prorata
|
pla.put("R8", tt.get()); // prorata
|
||||||
_pla->put("R5", tt.get()); // plafond art. 8
|
pla.put("R5", tt.get()); // plafond art. 8
|
||||||
_pla->put("R6", tt.get()); // plafond art. 8bis
|
pla.put("R6", tt.get()); // plafond art. 8bis
|
||||||
_pla->put("R7", tt.get()); // plafond art. 9
|
pla.put("R7", tt.get()); // plafond art. 9
|
||||||
|
|
||||||
err = (was ? _pla->rewrite() : _pla->write());
|
err = (was ? pla.rewrite() : pla.write());
|
||||||
|
|
||||||
// se si e' cambiato qualcosa..
|
// se si e' cambiato qualcosa..
|
||||||
if (prorata != _pla->get_real("R8") ||
|
if ((prorata != pla.get_real("R8")) ||
|
||||||
es_a8 != _pla->get_real("R5") ||
|
(es_a8 != pla.get_real("R5")) ||
|
||||||
es_a8b != _pla->get_real("R6") ||
|
(es_a8b != pla.get_real("R6")) ||
|
||||||
es_a9 != _pla->get_real("R7") ||
|
(es_a9 != pla.get_real("R7")) ||
|
||||||
m.field(F_CRED_PREC).dirty())
|
m.field(F_CRED_PREC).dirty())
|
||||||
{
|
{
|
||||||
// invalida la prima liquidazione calcolata se ce n'e'
|
// invalida la prima liquidazione calcolata se ce n'e'
|
||||||
TTable lim("LIM");
|
TRelation rellim("LIM");
|
||||||
|
TRectype & lim = rellim.curr();
|
||||||
|
|
||||||
TRecfield lim_anno(lim.curr(),"CODTAB",0,3);
|
lim.put("CODTAB", year);
|
||||||
TRecfield lim_mese(lim.curr(),"CODTAB",4,5);
|
|
||||||
|
TCursor cur(&rellim, "", 1, &lim, &lim);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (lim.first(); !lim.eof(); lim.next())
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
if (year == atoi(lim_anno) && (freq == 'M' || (freq == 'T' && atoi(lim_mese) == 3)))
|
// const int mese = atoi(lim.get("CODTAB").mid(4,2)); chiedere a cinzia
|
||||||
{
|
// if (freq == 'M' || (freq == 'T' && mese == 3))
|
||||||
lim.put("B0","");
|
// {
|
||||||
lim.rewrite();
|
rellim.lfile().reread(_lock);
|
||||||
break;
|
lim.zero("B0");
|
||||||
}
|
rellim.rewrite();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -444,11 +449,13 @@ int TParaliq_app::rewrite(const TMask& m)
|
|||||||
if (err == NOERR) err = was ? lia.rewrite() : lia.write();
|
if (err == NOERR) err = was ? lia.rewrite() : lia.write();
|
||||||
if (err == NOERR && year == _yearliq)
|
if (err == NOERR && year == _yearliq)
|
||||||
{
|
{
|
||||||
_ditte->put(NDT_CODDITTA, firm);
|
TLocalisamfile ditte(LF_NDITTE);
|
||||||
if (_ditte->read() == NOERR)
|
|
||||||
|
ditte.put(NDT_CODDITTA, firm);
|
||||||
|
if (ditte.read(_isequal, _lock) == NOERR)
|
||||||
{
|
{
|
||||||
_ditte->put(NDT_FREQVIVA, m.get(F_FREQ_VERS));
|
ditte.put(NDT_FREQVIVA, m.get(F_FREQ_VERS));
|
||||||
_ditte->rewrite();
|
ditte.rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,35 +477,35 @@ int TParaliq_app::read(TMask& m)
|
|||||||
|
|
||||||
const long firm = m.get_long(F_CODDITTA);
|
const long firm = m.get_long(F_CODDITTA);
|
||||||
const int year = m.get_int(F_YEAR);
|
const int year = m.get_int(F_YEAR);
|
||||||
|
|
||||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||||
//sf.reset();
|
TString16 ctab;
|
||||||
|
|
||||||
const TString16 ctab = format("%05ld%4d", firm, year);
|
|
||||||
_pla->put("CODTAB", ctab);
|
|
||||||
TToken_string tt(80);
|
TToken_string tt(80);
|
||||||
|
TRelation relpla(TAB_PLA);
|
||||||
|
TRectype & pla = relpla.curr();
|
||||||
|
|
||||||
init_array(m, FALSE); // Carica tutti i codici attivita'
|
ctab.format("%05ld%4d", firm, year);
|
||||||
|
pla.put("CODTAB", ctab);
|
||||||
|
|
||||||
for (_pla->read(_isgteq); _pla->good(); _pla->next())
|
TCursor cur(&relpla, "", 1, &pla, &pla);
|
||||||
{
|
const TRecnotype items = cur.items();
|
||||||
if (strncmp(ctab, _pla->get("CODTAB"), 9) == 0)
|
int i = 0;
|
||||||
{
|
|
||||||
tt = _pla->get("CODTAB").mid(9,5); // codice attivita'
|
|
||||||
|
|
||||||
for (int i = 0; i < sf.items(); i++) // Cerca riga corrispondente sullo sheet
|
init_array(m, FALSE); // Carica tutti i codici attivita'
|
||||||
if (tt == sf.row(i).get(0)) break;
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur, i++)
|
||||||
tt.add(_pla->get("S7")); // tipo attivita'
|
{
|
||||||
tt.add(_pla->get("R8")); // prorata
|
tt = pla.get("CODTAB").mid(9,5); // codice attivita'
|
||||||
tt.add(_pla->get("R5")); // plafond art. 8
|
|
||||||
tt.add(_pla->get("R6")); // plafond art. 8bis
|
for (int i = 0; i < sf.items(); i++) // Cerca riga corrispondente sullo sheet
|
||||||
tt.add(_pla->get("R7")); // plafond art. 9
|
if (tt == sf.row(i).get(0)) break;
|
||||||
sf.row(i) = tt;
|
|
||||||
}
|
tt.add(pla.get("S7")); // tipo attivita'
|
||||||
else break;
|
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
|
||||||
|
sf.row(i) = tt;
|
||||||
}
|
}
|
||||||
//sf.force_update();
|
|
||||||
|
|
||||||
return NOERR;
|
return NOERR;
|
||||||
}
|
}
|
||||||
@ -507,7 +514,7 @@ int TParaliq_app::read(TMask& m)
|
|||||||
int cg5300(int argc, char* argv[])
|
int cg5300(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TParaliq_app a;
|
TParaliq_app a;
|
||||||
a.run(argc, argv, "Parametri liquidazione");
|
a.run(argc, argv, TR("Parametri liquidazione"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
102
cg/cg5400.cpp
102
cg/cg5400.cpp
@ -20,8 +20,6 @@ protected: // TApplication
|
|||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void azzera_lim(int year, int month) const;
|
|
||||||
|
|
||||||
bool reg_restore(const TString& reg, int year, int month, int day, bool giornale);
|
bool reg_restore(const TString& reg, int year, int month, int day, bool giornale);
|
||||||
bool inl_restore(const TString& lbu, int year, int month);
|
bool inl_restore(const TString& lbu, int year, int month);
|
||||||
|
|
||||||
@ -29,23 +27,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Azzera flag di stampato della liquidazione mensile dal mese dato in poi
|
// Azzera flag di stampato della liquidazione mensile dal mese dato in poi
|
||||||
void TRipristina_stampa::azzera_lim(int year, int month) const
|
|
||||||
{
|
|
||||||
TTable lim("LIM"); // Azzera i flag di stampa liquidazione
|
|
||||||
TString16 cod; cod.format("%04d%02d", year, month);
|
|
||||||
lim.put("CODTAB", cod);
|
|
||||||
for (int err = lim.read(_isgteq); err == NOERR; err = lim.next())
|
|
||||||
{
|
|
||||||
if (atoi(lim.get("CODTAB").left(4)) != year) break;
|
|
||||||
const bool stampato = lim.get_bool("B1");
|
|
||||||
if (stampato)
|
|
||||||
{
|
|
||||||
lim.zero("B1");
|
|
||||||
lim.rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TRipristina_stampa::reg_restore(const TString& regist,
|
bool TRipristina_stampa::reg_restore(const TString& regist,
|
||||||
int year, int month, int day,
|
int year, int month, int day,
|
||||||
bool giornale)
|
bool giornale)
|
||||||
@ -67,25 +48,6 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
|
|||||||
{
|
{
|
||||||
TDate dlast(reg.get_date("D3"));
|
TDate dlast(reg.get_date("D3"));
|
||||||
|
|
||||||
/*
|
|
||||||
if (giornale)
|
|
||||||
{
|
|
||||||
TTable esc("ESC");
|
|
||||||
esc.zero();
|
|
||||||
esc.put("CODTAB", format("%04d", year));
|
|
||||||
if (esc.read() != NOERR)
|
|
||||||
return error_box("Esercizio %d assente", year);
|
|
||||||
|
|
||||||
TDate wd(esc.get_date("D0"));
|
|
||||||
inizio_anno = wd;
|
|
||||||
|
|
||||||
// Determina il corretto anno solare dell'esercizio: se il giorno di inizio esercizio
|
|
||||||
// e successivo alla data di ripristino allora mi trovo nell'anno solare successivo
|
|
||||||
year = wd.year();
|
|
||||||
if (wd.month() > month || (wd.month() == month && wd.day() > day))
|
|
||||||
year++;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
const int ld = TDate::last_day(month, year);
|
const int ld = TDate::last_day(month, year);
|
||||||
if (day > ld) day = ld;
|
if (day > ld) day = ld;
|
||||||
TDate d(day, month, year); // Data di ripristino
|
TDate d(day, month, year); // Data di ripristino
|
||||||
@ -105,7 +67,7 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
|
|||||||
cursor = 0L;
|
cursor = 0L;
|
||||||
const long nitems = cursor.items();
|
const long nitems = cursor.items();
|
||||||
|
|
||||||
TString msg; msg.format("Ripristino stampa del registro %s", (const char*)regist);
|
TString msg; msg.format(FR("Ripristino stampa del registro %s"), (const char*)regist);
|
||||||
TProgind p(nitems ? nitems : 1, msg , TRUE, TRUE);
|
TProgind p(nitems ? nitems : 1, msg , TRUE, TRUE);
|
||||||
|
|
||||||
if (giornale)
|
if (giornale)
|
||||||
@ -122,7 +84,7 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
|
|||||||
|
|
||||||
ok = (mov.rewrite() == NOERR);
|
ok = (mov.rewrite() == NOERR);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Errore nell'aggiornamento del movimento %ld.\n Errore n. %d",
|
error_box(FR("Errore nell'aggiornamento del movimento %ld.\n Errore n. %d"),
|
||||||
mov.get_long(MOV_NUMREG), mov.status());
|
mov.get_long(MOV_NUMREG), mov.status());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +99,6 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
|
|||||||
reg.put("I4", (long)mese); // Ultimo mese di stampa liquidazione
|
reg.put("I4", (long)mese); // Ultimo mese di stampa liquidazione
|
||||||
if (reg.get_int("I8") >= mese)
|
if (reg.get_int("I8") >= mese)
|
||||||
reg.zero("I8"); // Mese di ultima stampa credito precedente
|
reg.zero("I8"); // Mese di ultima stampa credito precedente
|
||||||
// azzera_lim(year, mese+1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -147,18 +108,17 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
|
|||||||
{
|
{
|
||||||
reg.zero("I4");
|
reg.zero("I4");
|
||||||
reg.zero("I8");
|
reg.zero("I8");
|
||||||
// azzera_lim(year, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = (reg.rewrite() == NOERR);
|
ok = (reg.rewrite() == NOERR);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Errore nell'aggiornamento del registro %s.\n Errore n. %d",
|
error_box(FR("Errore nell'aggiornamento del registro %s.\n Errore n. %d"),
|
||||||
(const char*)regist, mov.status());
|
(const char*)regist, mov.status());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok = error_box("Impossibile leggere il registro %s anno %s",
|
ok = error_box(FR("Impossibile leggere il registro %s anno %04d"),
|
||||||
(const char*)regist, (const char*)year);
|
(const char*)regist, year);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -166,34 +126,40 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
|
|||||||
|
|
||||||
bool TRipristina_stampa::inl_restore(const TString& lib, int year, int month)
|
bool TRipristina_stampa::inl_restore(const TString& lib, int year, int month)
|
||||||
{
|
{
|
||||||
TLocalisamfile inl(LF_INDLIB);
|
TString filter;
|
||||||
|
TRelation relinl(LF_INDLIB);
|
||||||
|
TRectype & inl = relinl.curr();
|
||||||
|
|
||||||
inl.zero();
|
|
||||||
inl.put("ANNO", year);
|
inl.put("ANNO", year);
|
||||||
inl.put("CODLIB", lib);
|
inl.put("CODLIB", lib);
|
||||||
const TRectype filter(inl.curr());
|
filter.format("STR(MESEREG>=%d)&&(STAMPATO==\"X\")", month);
|
||||||
|
|
||||||
|
TCursor cur(&relinl, filter, 1, &inl, &inl);
|
||||||
|
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
|
|
||||||
// Azzera il flag di stampato sugli indici con mese >= month
|
// Azzera il flag di stampato sugli indici con mese >= month
|
||||||
for (inl.read(_isgteq); inl.good() && inl.curr() == filter; inl.next())
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
if (inl.get_int("MESEREG") >= month && inl.get_bool("STAMPATO"))
|
{
|
||||||
|
relinl.lfile().reread(_lock);
|
||||||
|
inl.zero("STAMPATO");
|
||||||
|
ok = relinl.rewrite() == NOERR;
|
||||||
|
if (!ok)
|
||||||
{
|
{
|
||||||
inl.zero("STAMPATO");
|
error_box(FR("Errore di ripristino dell'indice %ld"), inl.get_long("NUMREG"));
|
||||||
ok = inl.rewrite() == NOERR;
|
break;
|
||||||
if (!ok)
|
}
|
||||||
{
|
}
|
||||||
error_box("Errore di ripristino dell'indice %ld", inl.get_long("NUMREG"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ok) // Se e' stato ripristinato almeno un indice e non ci sono stati errori
|
if (ok) // Se e' stato ripristinato almeno un indice e non ci sono stati errori
|
||||||
{
|
{
|
||||||
TTable lbu("%LBU");
|
TTable lbu("%LBU");
|
||||||
TString16 cod; cod.format("%4d%s", year, (const char*)lib);
|
TString16 cod; cod.format("%4d%s", year, (const char*)lib);
|
||||||
lbu.put("CODTAB", cod);
|
lbu.put("CODTAB", cod);
|
||||||
ok = lbu.read() == NOERR;
|
ok = lbu.read(_isequal, _lock) == NOERR;
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TDate d(1, month, year); // Riporta la data di ultima stampa
|
TDate d(1, month, year); // Riporta la data di ultima stampa
|
||||||
@ -201,7 +167,7 @@ bool TRipristina_stampa::inl_restore(const TString& lib, int year, int month)
|
|||||||
ok = lbu.rewrite() == NOERR;
|
ok = lbu.rewrite() == NOERR;
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Impossibile aggiornare il libro unico %s per l'anno %d", (const char*)lib, year);
|
error_box(FR("Impossibile aggiornare il libro unico %s per l'anno %d"), (const char*)lib, year);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
@ -238,18 +204,18 @@ void TRipristina_stampa::main_loop()
|
|||||||
|
|
||||||
if (prefix().exist(firm))
|
if (prefix().exist(firm))
|
||||||
{
|
{
|
||||||
TString256 mess("Attenzione ripristino della stampa de");
|
TString256 mess(TR("Attenzione ripristino della stampa"));
|
||||||
if (_op == restore_reg)
|
if (_op == restore_reg)
|
||||||
mess << (giornale ? "l giornale" : "l registro");
|
mess << (giornale ? TR(" del giornale") : TR(" del registro"));
|
||||||
else
|
else
|
||||||
mess << "gli indici del libro ";
|
mess << TR(" degli indici del libro ");
|
||||||
mess << ' ' << reg << "\ndel " << year;
|
mess << ' ' << reg << TR("\ndel ") << year;
|
||||||
if (_op == restore_reg) mess << " della ditta " << firm;
|
if (_op == restore_reg) mess << TR(" della ditta ") << firm;
|
||||||
mess << " dal " << day << '-' << month << '-' << year;
|
mess << " dal " << day << '-' << month << '-' << year;
|
||||||
|
|
||||||
if (yesno_box(mess))
|
if (yesno_box(mess))
|
||||||
{
|
{
|
||||||
mess << "\nSi desidera veramente continuare?";
|
mess << TR("\nSi desidera veramente continuare?");
|
||||||
if (yesno_box(mess))
|
if (yesno_box(mess))
|
||||||
{
|
{
|
||||||
switch (_op)
|
switch (_op)
|
||||||
@ -262,7 +228,7 @@ void TRipristina_stampa::main_loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else error_box("Gli archivi della ditta %ld non sono stati ancora generati", firm);
|
else error_box(FR("Gli archivi della ditta %ld non sono stati ancora generati"), firm);
|
||||||
msk.reset();
|
msk.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,6 +236,6 @@ void TRipristina_stampa::main_loop()
|
|||||||
int cg5400(int argc, char* argv[])
|
int cg5400(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TRipristina_stampa a ;
|
TRipristina_stampa a ;
|
||||||
a.run(argc, argv, "Ripristino stampe");
|
a.run(argc, argv, TR("Ripristino stampe"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
198
cg/cg5500.cpp
198
cg/cg5500.cpp
@ -7,6 +7,7 @@
|
|||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
|
#include <recarray.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <viswin.h>
|
#include <viswin.h>
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ const char* Visliq_app::itoname(int m)
|
|||||||
{
|
{
|
||||||
const char* mn;
|
const char* mn;
|
||||||
if (m == 13)
|
if (m == 13)
|
||||||
return "Annuale";
|
return TR("Annuale");
|
||||||
|
|
||||||
if (_freqviva == "M")
|
if (_freqviva == "M")
|
||||||
return itom(m);
|
return itom(m);
|
||||||
@ -32,16 +33,16 @@ const char* Visliq_app::itoname(int m)
|
|||||||
switch(m)
|
switch(m)
|
||||||
{
|
{
|
||||||
case 3:
|
case 3:
|
||||||
mn = "1 Trimestre";
|
mn = TR("1 Trimestre");
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
mn = "2 Trimestre";
|
mn = TR("2 Trimestre");
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
mn = "3 Trimestre";
|
mn = TR("3 Trimestre");
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
mn = "4 Trimestre";
|
mn = TR("4 Trimestre");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,11 +55,13 @@ void Visliq_app::set_freqviva()
|
|||||||
_freqviva = _lia->get("S7");
|
_freqviva = _lia->get("S7");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TLocalisamfile ditte(LF_NDITTE);
|
TString key;
|
||||||
ditte.zero();
|
|
||||||
ditte.put("CODDITTA", get_firm());
|
key.format("%ld", get_firm());
|
||||||
ditte.read();
|
|
||||||
_freqviva = ditte.get("FREQVIVA");
|
const TRectype & ditta = cache().get(LF_NDITTE, key);
|
||||||
|
|
||||||
|
_freqviva = ditta.get("FREQVIVA");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,12 +70,12 @@ bool Visliq_app::create()
|
|||||||
_firm = get_firm();
|
_firm = get_firm();
|
||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
_year = oggi.year();
|
_year = oggi.year();
|
||||||
|
open_files(LF_TABCOM, LF_TAB, LF_NDITTE, 0);
|
||||||
|
|
||||||
_nditte = new TRelation(LF_NDITTE);
|
_nditte = new TRelation(LF_NDITTE);
|
||||||
_ditte = new TArray_sheet(-1, -1, -4, -4, "Selezione Ditte",
|
_ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"),
|
||||||
"Cod.@5|Ragione Sociale@50|Vers.");
|
HR("Cod.@5|Ragione Sociale@50|Vers."));
|
||||||
|
|
||||||
_from_one = FALSE;
|
_from_one = FALSE;
|
||||||
|
|
||||||
_del = new TTable("%DEL");
|
_del = new TTable("%DEL");
|
||||||
_lia = new TTable("%LIA");
|
_lia = new TTable("%LIA");
|
||||||
_lim = new TTable("LIM");
|
_lim = new TTable("LIM");
|
||||||
@ -171,35 +174,36 @@ void Visliq_app::build_nomiditte()
|
|||||||
{
|
{
|
||||||
_nomiditte.destroy();
|
_nomiditte.destroy();
|
||||||
// ricostruire _nomiditte e rifare build_ditte_sheet
|
// ricostruire _nomiditte e rifare build_ditte_sheet
|
||||||
TLocalisamfile& dt = _nditte->lfile();
|
TRectype & ditta = _nditte->lfile().curr();
|
||||||
TString fr(2);
|
TCursor cur(_nditte);
|
||||||
TTable lia("%LIA");
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (dt.first(); !dt.eof(); dt.next())
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
// check no archivi
|
// check no archivi
|
||||||
fr = "??";
|
bool good = prefix().exist(ditta.get_long("CODDITTA"));
|
||||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
|
||||||
|
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
TString16 cod;
|
TString16 cod;
|
||||||
cod.format("%05ld%d", dt.get_long("CODDITTA"), _year);
|
|
||||||
lia.put("CODTAB", cod);
|
cod.format("%05ld%d", ditta.get_long("CODDITTA"), _year);
|
||||||
if (lia.read() != NOERR) good = FALSE;
|
|
||||||
else fr = lia.get("S7");
|
const TRectype & lia = cache().get("%LIA", cod);
|
||||||
}
|
TToken_string* d = new TToken_string(64);
|
||||||
else continue;
|
|
||||||
|
// add record
|
||||||
|
d->add(ditta.get("CODDITTA"));
|
||||||
|
d->add(ditta.get("RAGSOC"));
|
||||||
|
|
||||||
|
const TString & fr = lia.get("S7");
|
||||||
|
|
||||||
|
d->add(fr.empty() ? "??" : fr);
|
||||||
|
_nomiditte.add(d);
|
||||||
|
}
|
||||||
|
|
||||||
TToken_string* d = new TToken_string(64);
|
|
||||||
|
|
||||||
// add record
|
|
||||||
d->add(dt.get("CODDITTA"));
|
|
||||||
d->add(dt.get("RAGSOC"));
|
|
||||||
d->add(fr);
|
|
||||||
|
|
||||||
_nomiditte.add(d);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,21 +249,21 @@ const char* Visliq_app::link_handler(TMask& m,
|
|||||||
|
|
||||||
if (group != 0) m.hide(group);
|
if (group != 0) m.hide(group);
|
||||||
|
|
||||||
if (st.find("Iva chiesta a rimborso") >= 0 || st.find("Rimborsi") >= 0)
|
if (st.find(TR("Iva chiesta a rimborso")) >= 0 || st.find(TR("Rimborsi")) >= 0)
|
||||||
{ group = -1; firstfoc = F_RIMBORSO; }
|
{ group = -1; firstfoc = F_RIMBORSO; }
|
||||||
else if (st.find("debito") >= 0 || st.find("credito") >= 0)
|
else if (st.find(TR("debito")) >= 0 || st.find(TR("credito")) >= 0)
|
||||||
{ group = -2; firstfoc = F_RETTIFICA; }
|
{ group = -2; firstfoc = F_RETTIFICA; }
|
||||||
else if (st.find("cconto") >= 0)
|
else if (st.find(TR("acconto")) >= 0)
|
||||||
{ group = -3; firstfoc = F_ACCONTO; }
|
{ group = -3; firstfoc = F_ACCONTO; }
|
||||||
else if (st.find("Versamenti") >= 0)
|
else if (st.find(TR("Versamenti")) >= 0)
|
||||||
{ group = -4; firstfoc = F_DELDATE; }
|
{ group = -4; firstfoc = F_DELDATE; }
|
||||||
else if (st.find("Descrizione") >= 0)
|
else if (st.find(TR("Descrizione")) >= 0)
|
||||||
{ group = -5; firstfoc = F_DESCR3; }
|
{ group = -5; firstfoc = F_DESCR3; }
|
||||||
else if (st.find("Variazioni d'imposta") >= 0)
|
else if (st.find(TR("Variazioni d'imposta")) >= 0)
|
||||||
{ group = -6; firstfoc = F_VARIMP; }
|
{ group = -6; firstfoc = F_VARIMP; }
|
||||||
else if (st.find("Imposta non versata") >= 0)
|
else if (st.find(TR("Imposta non versata")) >= 0)
|
||||||
{ group = -7; firstfoc = F_IMPNONVER; }
|
{ group = -7; firstfoc = F_IMPNONVER; }
|
||||||
if (st.find("Crediti") >= 0)
|
if (st.find(TR("Crediti")) >= 0)
|
||||||
{ group = -8; firstfoc = F_CREDSPEC; }
|
{ group = -8; firstfoc = F_CREDSPEC; }
|
||||||
|
|
||||||
m.show(group);
|
m.show(group);
|
||||||
@ -309,7 +313,7 @@ bool Visliq_app::set_ditta(TMask_field& f, KEY k)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f.warning_box("Non sono definiti i parametri liquidazione per la ditta %ld",
|
f.warning_box(FR("Non sono definiti i parametri liquidazione per la ditta %ld"),
|
||||||
atol(ditta));
|
atol(ditta));
|
||||||
f.reset();
|
f.reset();
|
||||||
}
|
}
|
||||||
@ -373,7 +377,7 @@ bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
|
|||||||
//if (m.dirty() || sh.sheet_mask().dirty())
|
//if (m.dirty() || sh.sheet_mask().dirty())
|
||||||
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty)
|
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty)
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Registrazione modifiche effettuate?");
|
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?"));
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
app().write_general(m);
|
app().write_general(m);
|
||||||
else if (k == K_NO)
|
else if (k == K_NO)
|
||||||
@ -441,7 +445,7 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
|
|||||||
//if (m.dirty())
|
//if (m.dirty())
|
||||||
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty)
|
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty)
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Registrazione modifiche effettuate?");
|
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?"));
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
app().write_general(m);
|
app().write_general(m);
|
||||||
else if (k == K_NO)
|
else if (k == K_NO)
|
||||||
@ -471,13 +475,6 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
|
|||||||
tv.add(app().del()->get("S9"),4);
|
tv.add(app().del()->get("S9"),4);
|
||||||
tv.add(app().del()->get("R0"),5);
|
tv.add(app().del()->get("R0"),5);
|
||||||
sh.force_update(sel);
|
sh.force_update(sel);
|
||||||
/*
|
|
||||||
sv.field(102).set(app().del()->get("D0"));
|
|
||||||
sv.field(103).set(app().del()->get("S7"));
|
|
||||||
sv.field(104).set(app().del()->get("S8"));
|
|
||||||
sv.field(105).set(app().del()->get("S9"));
|
|
||||||
sv.field(106).set(app().del()->get("R0"));
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -577,7 +574,7 @@ bool Visliq_app::vis_all()
|
|||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
if (_mask->dirty())
|
if (_mask->dirty())
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Registrazione modifiche effettuate?");
|
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?"));
|
||||||
|
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
write_general(*_mask);
|
write_general(*_mask);
|
||||||
@ -614,7 +611,7 @@ bool Visliq_app::vis_one(int m)
|
|||||||
TMask msk("cg5500d");
|
TMask msk("cg5500d");
|
||||||
|
|
||||||
bool recorded = TRUE;
|
bool recorded = TRUE;
|
||||||
TString nomem("Liquidazione IVA ");
|
TString nomem(TR("Liquidazione IVA "));
|
||||||
|
|
||||||
nomem << itoname(m);
|
nomem << itoname(m);
|
||||||
nomem << " " << _year;
|
nomem << " " << _year;
|
||||||
@ -641,12 +638,12 @@ bool Visliq_app::vis_one(int m)
|
|||||||
|
|
||||||
TBrowsefile_field& brw = (TBrowsefile_field&)msk.field(F_VISFLQ);
|
TBrowsefile_field& brw = (TBrowsefile_field&)msk.field(F_VISFLQ);
|
||||||
brw.set_link_handler(link_handler);
|
brw.set_link_handler(link_handler);
|
||||||
brw.enable_link("Modifica: ", 'r');
|
brw.enable_link(TR("Modifica: "), 'r');
|
||||||
|
|
||||||
TExternal_app liq("cg4 -2");
|
TExternal_app liq("cg4 -2");
|
||||||
|
|
||||||
end_wait();
|
end_wait();
|
||||||
TProgind* pp = new TProgind(10,"Estrazione liquidazione: prego attendere",FALSE,FALSE);
|
TProgind* pp = new TProgind(10,TR("Estrazione liquidazione: prego attendere"),FALSE,FALSE);
|
||||||
liq.run();
|
liq.run();
|
||||||
if (liq.exitcode())
|
if (liq.exitcode())
|
||||||
{
|
{
|
||||||
@ -661,7 +658,7 @@ bool Visliq_app::vis_one(int m)
|
|||||||
real rettifica = _lim->get_real("R5");
|
real rettifica = _lim->get_real("R5");
|
||||||
|
|
||||||
if (_lim->get_bool("B2"))
|
if (_lim->get_bool("B2"))
|
||||||
nomem << " (diritto al rimborso infraannuale)";
|
nomem << TR(" (diritto al rimborso infraannuale)");
|
||||||
|
|
||||||
real acconto(0.0);
|
real acconto(0.0);
|
||||||
|
|
||||||
@ -709,7 +706,7 @@ bool Visliq_app::vis_one(int m)
|
|||||||
msk.set(F_CREDSPEC, credspec);
|
msk.set(F_CREDSPEC, credspec);
|
||||||
|
|
||||||
begin_wait();
|
begin_wait();
|
||||||
brw.set_text(f, "CALCOLO LIQUIDAZIONE D'IMPOSTA");
|
brw.set_text(f, TR("CALCOLO LIQUIDAZIONE D'IMPOSTA"));
|
||||||
brw.goto_pos(brw.lines()-16l, 9);
|
brw.goto_pos(brw.lines()-16l, 9);
|
||||||
delete pp;
|
delete pp;
|
||||||
|
|
||||||
@ -786,8 +783,8 @@ bool Visliq_app::vis_one(int m)
|
|||||||
const bool old_rim = !rimborso.is_zero();
|
const bool old_rim = !rimborso.is_zero();
|
||||||
// check diritto (se non ce n'era gia' uno prima)
|
// check diritto (se non ce n'era gia' uno prima)
|
||||||
if (!_lim->get_bool("B2") && !old_rim)
|
if (!_lim->get_bool("B2") && !old_rim)
|
||||||
ok = yesno_box("Non risulta diritto al rimborso per il mese %d. Si desidera "
|
ok = yesno_box(FR("Non risulta diritto al rimborso per il mese %d. Si desidera "
|
||||||
"confermare ugualmente?", m);
|
"confermare ugualmente?"), m);
|
||||||
}
|
}
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
@ -823,13 +820,6 @@ bool Visliq_app::vis_one(int m)
|
|||||||
if (msk.field(F_DELIMP).dirty())
|
if (msk.field(F_DELIMP).dirty())
|
||||||
{
|
{
|
||||||
real itt = _lim->get_real("R10");
|
real itt = _lim->get_real("R10");
|
||||||
// if (!itt.is_zero())
|
|
||||||
// {
|
|
||||||
// uso importi al netto degli interessi
|
|
||||||
// (vengono riapplicati dopo in write_del)
|
|
||||||
// n_vers = n_vers/((itt+real(100.0))/real(100.0));
|
|
||||||
// n_vers.round(0);
|
|
||||||
// }
|
|
||||||
vers = n_vers;
|
vers = n_vers;
|
||||||
d_mod = TRUE;
|
d_mod = TRUE;
|
||||||
}
|
}
|
||||||
@ -883,7 +873,7 @@ bool Visliq_app::vis_one(int m)
|
|||||||
{
|
{
|
||||||
if (!recorded)
|
if (!recorded)
|
||||||
{
|
{
|
||||||
KEY kk = yesnocancel_box("Modifiche non registrate: salvare?");
|
KEY kk = yesnocancel_box(TR("Modifiche non registrate: salvare?"));
|
||||||
if (kk == K_YES)
|
if (kk == K_YES)
|
||||||
{
|
{
|
||||||
if (l_mod) { write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); }
|
if (l_mod) { write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); }
|
||||||
@ -1101,27 +1091,27 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
// una sburlata di search ......
|
// una sburlata di search ......
|
||||||
int x = 0;
|
int x = 0;
|
||||||
long lvers = -1l;
|
long lvers = -1l;
|
||||||
long line = vsw->search("CALCOLO LIQUIDAZIONE D'IMPOSTA", x);
|
long line = vsw->search(TR("CALCOLO LIQUIDAZIONE D'IMPOSTA"), x);
|
||||||
int wasdebt = ris.sign();
|
int wasdebt = ris.sign();
|
||||||
long lrisd = vsw->search("RISULTATO", x, line, TRUE); // RISULTATO a debito
|
long lrisd = vsw->search(TR("RISULTATO"), x, line, TRUE); // RISULTATO a debito
|
||||||
long lrisc = vsw->search("RISULTATO", x, lrisd+1, TRUE); // credito
|
long lrisc = vsw->search(TR("RISULTATO"), x, lrisd+1, TRUE); // credito
|
||||||
long lrettc = vsw->search("Rettifiche IVA a credito",x,line,TRUE);
|
long lrettc = vsw->search(TR("Rettifiche IVA a credito"),x,line,TRUE);
|
||||||
long lrettd = vsw->search("Rettifiche IVA a debito", x,line,TRUE);
|
long lrettd = vsw->search(TR("Rettifiche IVA a debito"), x,line,TRUE);
|
||||||
long lacct = vsw->search("Versamento acconto dicembre",x,line,TRUE);
|
long lacct = vsw->search(TR("Versamento acconto dicembre"),x,line,TRUE);
|
||||||
long lintr = vsw->search("Interesse",x,line,TRUE);
|
long lintr = vsw->search(TR("Interesse"),x,line,TRUE);
|
||||||
long livdv = vsw->search("IVA DOVUTA",x,line,TRUE);
|
long livdv = vsw->search(TR("IVA DOVUTA"),x,line,TRUE);
|
||||||
long lrivr = vsw->search("Versamenti effettuati",x,line,TRUE);
|
long lrivr = vsw->search(TR("Versamenti effettuati"),x,line,TRUE);
|
||||||
long lvari = vsw->search("Variazioni d'imposta",x,line,TRUE);
|
long lvari = vsw->search(TR("Variazioni d'imposta"),x,line,TRUE);
|
||||||
long limnv = vsw->search("Imposta non versata",x,line,TRUE);
|
long limnv = vsw->search(TR("Imposta non versata"),x,line,TRUE);
|
||||||
long lcicd = vsw->search("Credito IVA compensabile detratto",x,line,TRUE);
|
long lcicd = vsw->search(TR("Credito IVA compensabile detratto"),x,line,TRUE);
|
||||||
long iadoc = vsw->search("IVA a debito o a credito per il periodo",x,line,TRUE);
|
long iadoc = vsw->search(TR("IVA a debito o a credito per il periodo"),x,line,TRUE);
|
||||||
long lrimb = vsw->search(iadoc > 0 ? "Rimborsi" : "Iva chiesta a rimborso",x,line,TRUE);
|
long lrimb = vsw->search(iadoc > 0 ? TR("Rimborsi") : TR("Iva chiesta a rimborso"),x,line,TRUE);
|
||||||
|
|
||||||
if (wasdebt != 0)
|
if (wasdebt != 0)
|
||||||
lvers = vsw->search(wasdebt < 0 ? "CREDITO ATTUALE" : "IVA DA VERSARE",
|
lvers = vsw->search(wasdebt < 0 ? TR("CREDITO ATTUALE") : TR("IVA DA VERSARE"),
|
||||||
x, line, TRUE);
|
x, line, TRUE);
|
||||||
if (lvers == -1l)
|
if (lvers == -1l)
|
||||||
lvers = vsw->search("IVA A DEBITO DA NON VERSARE", x, line, TRUE);
|
lvers = vsw->search(TR("IVA A DEBITO DA NON VERSARE"), x, line, TRUE);
|
||||||
if (lvers == -1l)
|
if (lvers == -1l)
|
||||||
lvers = lrisc+1l;
|
lvers = lrisc+1l;
|
||||||
|
|
||||||
@ -1164,7 +1154,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
|
|
||||||
vsw->replace(iadoc, " ", tab2);
|
vsw->replace(iadoc, " ", tab2);
|
||||||
|
|
||||||
iadoc = vsw->search("IVA dovuta o a credito per il periodo",x,line,TRUE);
|
iadoc = vsw->search(TR("IVA dovuta o a credito per il periodo"),x,line,TRUE);
|
||||||
v = risul + credspec;
|
v = risul + credspec;
|
||||||
if (v < ZERO)
|
if (v < ZERO)
|
||||||
{
|
{
|
||||||
@ -1178,7 +1168,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
vsw->replace(iadoc, " ", tab2);
|
vsw->replace(iadoc, " ", tab2);
|
||||||
|
|
||||||
TString256 ln;
|
TString256 ln;
|
||||||
long lcrs = vsw->search("Crediti speciali",x,line,TRUE);
|
long lcrs = vsw->search(TR("Crediti speciali"),x,line,TRUE);
|
||||||
|
|
||||||
if (credspec.is_zero())
|
if (credspec.is_zero())
|
||||||
vsw->replace(lcrs, " ", 58);
|
vsw->replace(lcrs, " ", 58);
|
||||||
@ -1186,7 +1176,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
replace_number(vsw, lcrs, credspec, 58);
|
replace_number(vsw, lcrs, credspec, 58);
|
||||||
|
|
||||||
const bool print_intr = _freqviva == "T" && intr != 0.0;
|
const bool print_intr = _freqviva == "T" && intr != 0.0;
|
||||||
const char* desc_inter = "Interessi dovuti per liquidazioni trimestrali";
|
const char* desc_inter = TR("Interessi dovuti per liquidazioni trimestrali");
|
||||||
lintr = vsw->search(desc_inter, x, line, TRUE);
|
lintr = vsw->search(desc_inter, x, line, TRUE);
|
||||||
|
|
||||||
if (print_intr)
|
if (print_intr)
|
||||||
@ -1208,16 +1198,16 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
vsw->replace(lintr, ln, 11);
|
vsw->replace(lintr, ln, 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
long idv = vsw->search("IMPORTO DA", x, iadoc, TRUE);
|
long idv = vsw->search(TR("IMPORTO DA"), x, iadoc, TRUE);
|
||||||
if (idv < 0)
|
if (idv < 0)
|
||||||
idv = iadoc+6;
|
idv = iadoc+6;
|
||||||
|
|
||||||
if (risul > ZERO)
|
if (risul > ZERO)
|
||||||
{
|
{
|
||||||
ln = "IMPORTO DA ";
|
ln = TR("IMPORTO DA ");
|
||||||
if (risul < min_vers(_year, month) && month < 13)
|
if (risul < min_vers(_year, month) && month < 13)
|
||||||
ln << "NON ";
|
ln << TR("NON ");
|
||||||
ln << "VERSARE ";
|
ln << TR("VERSARE ");
|
||||||
replace_number(vsw, idv, risul, 75);
|
replace_number(vsw, idv, risul, 75);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1234,7 +1224,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
TCurrency rabs(-risul);
|
TCurrency rabs(-risul);
|
||||||
TString16 str = rabs.string(TRUE); str.right_just(15);
|
TString16 str = rabs.string(TRUE); str.right_just(15);
|
||||||
|
|
||||||
ln.overwrite("CREDITO ATTUALE", 23);
|
ln.overwrite(TR("CREDITO ATTUALE"), 23);
|
||||||
ln.overwrite(str, 58);
|
ln.overwrite(str, 58);
|
||||||
if (lintr > 0) // Quindi niente riga "Interessi " ...
|
if (lintr > 0) // Quindi niente riga "Interessi " ...
|
||||||
{
|
{
|
||||||
@ -1257,14 +1247,14 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
if (lintr == -1)
|
if (lintr == -1)
|
||||||
{
|
{
|
||||||
lintr = lrisc + 2;
|
lintr = lrisc + 2;
|
||||||
vsw->replace(lintr, "Interesse", 23);
|
vsw->replace(lintr, TR("Interesse"), 23);
|
||||||
vsw->replace(lintr, itt.stringa(6,2), 33);
|
vsw->replace(lintr, itt.stringa(6,2), 33);
|
||||||
vsw->replace(lintr, "%", 43);
|
vsw->replace(lintr, "%", 43);
|
||||||
}
|
}
|
||||||
if (livdv == -1)
|
if (livdv == -1)
|
||||||
{
|
{
|
||||||
livdv = lrisc + 1;
|
livdv = lrisc + 1;
|
||||||
vsw->replace(livdv, "IVA DOVUTA", 23);
|
vsw->replace(livdv, TR("IVA DOVUTA"), 23);
|
||||||
}
|
}
|
||||||
if (lintr > 0)
|
if (lintr > 0)
|
||||||
replace_number(vsw, lintr, intr, 75);
|
replace_number(vsw, lintr, intr, 75);
|
||||||
@ -1274,7 +1264,7 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
|
|||||||
risul += intr;
|
risul += intr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ln.overwrite("IVA DA VERSARE", 23);
|
ln.overwrite(TR("IVA DA VERSARE"), 23);
|
||||||
|
|
||||||
TCurrency rabs(risul);
|
TCurrency rabs(risul);
|
||||||
TString16 str = rabs.string(TRUE); str.right_just(15);
|
TString16 str = rabs.string(TRUE); str.right_just(15);
|
||||||
@ -1498,9 +1488,9 @@ void Visliq_app::read_general(TMask& m)
|
|||||||
TMask_field & crprec = m.field(F_CREDPREC);
|
TMask_field & crprec = m.field(F_CREDPREC);
|
||||||
|
|
||||||
if (new_age_2000)
|
if (new_age_2000)
|
||||||
crprec.set_prompt("Credito compensabile inizio anno ");
|
crprec.set_prompt(TR("Credito compensabile inizio anno "));
|
||||||
else
|
else
|
||||||
crprec.set_prompt("Credito inizio anno ");
|
crprec.set_prompt(TR("Credito inizio anno "));
|
||||||
real cr_res = _lia->get_real("R0");
|
real cr_res = _lia->get_real("R0");
|
||||||
crprec.set(cr_res.string());
|
crprec.set(cr_res.string());
|
||||||
if (new_age_2000)
|
if (new_age_2000)
|
||||||
@ -1612,8 +1602,8 @@ void Visliq_app::read_general(TMask& m)
|
|||||||
if (nomemese == "4 Trimestre")
|
if (nomemese == "4 Trimestre")
|
||||||
nomemese = "4 Tr.";
|
nomemese = "4 Tr.";
|
||||||
|
|
||||||
if (i == 12) nomemese << " acconto";
|
if (i == 12) nomemese << TR(" acconto");
|
||||||
if (i == 13) nomemese << " saldo";
|
if (i == 13) nomemese << TR(" saldo");
|
||||||
|
|
||||||
tt.add(nomemese,0); // mese
|
tt.add(nomemese,0); // mese
|
||||||
tt.add(date[i-1].string(),1); // data vers.
|
tt.add(date[i-1].string(),1); // data vers.
|
||||||
@ -1872,11 +1862,11 @@ void Visliq_app::write_general(TMask& m)
|
|||||||
if (!nrimb.is_zero())
|
if (!nrimb.is_zero())
|
||||||
{
|
{
|
||||||
if (risc <= risd)
|
if (risc <= risd)
|
||||||
ok = yesno_box("Il risultato IVA non evidenzia crediti nel mese %d. Si conferma "
|
ok = yesno_box(FR("Il risultato IVA non evidenzia crediti nel mese %d. Si conferma "
|
||||||
" il rimborso?", i);
|
" il rimborso?"), i);
|
||||||
if (!_lim->get_bool("B2") && ok)
|
if (!_lim->get_bool("B2") && ok)
|
||||||
ok = yesno_box("Non risulta diritto al rimborso per il mese %d. Si conferma"
|
ok = yesno_box(FR("Non risulta diritto al rimborso per il mese %d. Si conferma"
|
||||||
" il rimborso?", i);
|
" il rimborso?"), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -1981,6 +1971,6 @@ void Visliq_app::write_general(TMask& m)
|
|||||||
int cg5500(int argc, char* argv[])
|
int cg5500(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
Visliq_app app;
|
Visliq_app app;
|
||||||
app.run(argc, argv, "Visualizzazione Liquidazione");
|
app.run(argc, argv, TR("Visualizzazione Liquidazione"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
220
cg/cg5600.cpp
220
cg/cg5600.cpp
@ -4,6 +4,7 @@
|
|||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
|
#include <recarray.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
@ -40,7 +41,8 @@ public:
|
|||||||
|
|
||||||
bool do_restore();
|
bool do_restore();
|
||||||
bool restore_firm(long firm);
|
bool restore_firm(long firm);
|
||||||
|
void zero_cursor(const char * tablename);
|
||||||
|
|
||||||
static TRipristino_liq& app() { return (TRipristino_liq&)main_app(); }
|
static TRipristino_liq& app() { return (TRipristino_liq&)main_app(); }
|
||||||
|
|
||||||
TRipristino_liq() {}
|
TRipristino_liq() {}
|
||||||
@ -83,35 +85,35 @@ void TRipristino_liq::build_nomiditte()
|
|||||||
{
|
{
|
||||||
_nomiditte.destroy();
|
_nomiditte.destroy();
|
||||||
// ricostruire _nomiditte e rifare build_ditte_sheet
|
// ricostruire _nomiditte e rifare build_ditte_sheet
|
||||||
TLocalisamfile& dt = _nditte->lfile();
|
TRectype & ditta = _nditte->lfile().curr();
|
||||||
TString fr("??");
|
TCursor cur(_nditte);
|
||||||
TTable lia("%LIA");
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (dt.first(); !dt.eof(); dt.next())
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
// check no archivi
|
// check no archivi
|
||||||
fr = "??";
|
bool good = prefix().exist(ditta.get_long("CODDITTA"));
|
||||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
|
||||||
|
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
lia.zero();
|
TString16 cod;
|
||||||
const TString16 cod(format("%05ld%4s", dt.get_long("CODDITTA"), (const char*)_year));
|
|
||||||
lia.put("CODTAB", cod);
|
cod.format("%05ld%s", ditta.get_long("CODDITTA"), (const char *)_year);
|
||||||
if (lia.read() != NOERR) good = FALSE;
|
|
||||||
else fr = lia.get("S7");
|
const TRectype & lia = cache().get("%LIA", cod);
|
||||||
}
|
|
||||||
else continue;
|
|
||||||
|
|
||||||
TToken_string* d = new TToken_string(64);
|
TToken_string* d = new TToken_string(64);
|
||||||
|
|
||||||
// add record
|
// add record
|
||||||
d->add(dt.get("CODDITTA"));
|
d->add(ditta.get("CODDITTA"));
|
||||||
d->add(dt.get("RAGSOC"));
|
d->add(ditta.get("RAGSOC"));
|
||||||
d->add(fr);
|
const TString & fr = lia.get("S7");
|
||||||
|
|
||||||
_nomiditte.add(d);
|
d->add(fr.empty() ? "??" : fr);
|
||||||
|
_nomiditte.add(d);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TApplication::set_firm(_firm);
|
TApplication::set_firm(_firm);
|
||||||
}
|
}
|
||||||
@ -124,8 +126,8 @@ bool TRipristino_liq::create()
|
|||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
_year.format("%d",oggi.year());
|
_year.format("%d",oggi.year());
|
||||||
_nditte = new TRelation(LF_NDITTE);
|
_nditte = new TRelation(LF_NDITTE);
|
||||||
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte",
|
_ditte = new TArray_sheet(-1, -1, 65, 20, TR("Selezione Ditte"),
|
||||||
"@1|Cod.@5|Ragione Sociale@50|Vers.");
|
HR("@1|Cod.@5|Ragione Sociale@50|Vers."));
|
||||||
build_nomiditte();
|
build_nomiditte();
|
||||||
build_ditte_sheet();
|
build_ditte_sheet();
|
||||||
|
|
||||||
@ -176,6 +178,21 @@ bool TRipristino_liq::do_restore()
|
|||||||
return k != K_QUIT;
|
return k != K_QUIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TRipristino_liq::zero_cursor(const char * tablename)
|
||||||
|
{
|
||||||
|
TRelation rel(tablename);
|
||||||
|
TRectype & rec = rel.curr();
|
||||||
|
|
||||||
|
rec.put("CODTAB", _year);
|
||||||
|
|
||||||
|
TCursor cur(&rel, "", 1, &rec, &rec);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
|
rel.remove();
|
||||||
|
}
|
||||||
|
|
||||||
bool TRipristino_liq::restore_firm(long firm)
|
bool TRipristino_liq::restore_firm(long firm)
|
||||||
{
|
{
|
||||||
// azzera: campi progressivi in LIA e PLA
|
// azzera: campi progressivi in LIA e PLA
|
||||||
@ -183,122 +200,53 @@ bool TRipristino_liq::restore_firm(long firm)
|
|||||||
set_firm(firm);
|
set_firm(firm);
|
||||||
|
|
||||||
TTable lia("%LIA");
|
TTable lia("%LIA");
|
||||||
TTable pla("%PLA");
|
TString cod;
|
||||||
TTable pim("PIM");
|
|
||||||
TTable plm("PLM");
|
cod.format("%05ld%s", firm, (const char *)_year);
|
||||||
TTable ptm("PTM");
|
lia.put("CODTAB", cod);
|
||||||
TTable ppa("PPA");
|
|
||||||
TTable rmb("RMB");
|
if (lia.read(_isequal, _lock) == NOERR)
|
||||||
TTable lim("LIM");
|
|
||||||
|
|
||||||
// LIA
|
|
||||||
for (lia.first(); !lia.eof(); lia.next())
|
|
||||||
{
|
{
|
||||||
TString codtab(lia.get("CODTAB"));
|
lia.zero("R1");
|
||||||
|
lia.zero("R2");
|
||||||
if (atol(codtab.mid(0,5)) == firm &&
|
lia.zero("R3");
|
||||||
codtab.mid(5,4) == _year)
|
lia.zero("R4");
|
||||||
{
|
lia.zero("R5");
|
||||||
lia.put("R1","");
|
lia.zero("R6");
|
||||||
lia.put("R2","");
|
lia.rewrite();
|
||||||
lia.put("R3","");
|
|
||||||
lia.put("R4","");
|
|
||||||
lia.put("R5","");
|
|
||||||
lia.put("R6","");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
lia.rewrite();
|
|
||||||
|
|
||||||
// PLA
|
TRelation relpla("%PLA");
|
||||||
for (pla.first(); !pla.eof(); pla.next())
|
TRectype & pla = relpla.curr();
|
||||||
|
|
||||||
|
pla.put("CODTAB", cod);
|
||||||
|
|
||||||
|
TCursor cur(&relpla, "", 1, &pla, &pla);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
TString codtab(pla.get("CODTAB"));
|
relpla.lfile().reread(_lock);
|
||||||
|
pla.zero("R0");
|
||||||
if (atol(codtab.mid(0,5)) == firm &&
|
pla.zero("R1");
|
||||||
codtab.mid(5,4) == _year)
|
pla.zero("R2");
|
||||||
{
|
pla.zero("R3");
|
||||||
pla.put("R0","");
|
pla.zero("R4");
|
||||||
pla.put("R1","");
|
pla.zero("R9");
|
||||||
pla.put("R2","");
|
pla.zero("R10");
|
||||||
pla.put("R3","");
|
pla.zero("S1");
|
||||||
pla.put("R4","");
|
pla.zero("S2");
|
||||||
pla.put("R9","");
|
pla.zero("S3");
|
||||||
pla.put("R10","");
|
pla.zero("S4");
|
||||||
pla.put("S1","");
|
relpla.rewrite();
|
||||||
pla.put("S2","");
|
|
||||||
pla.put("S3","");
|
|
||||||
pla.put("S4","");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pla.rewrite();
|
zero_cursor("PIM");
|
||||||
|
zero_cursor("PLM");
|
||||||
// PIM
|
zero_cursor("PTM");
|
||||||
for (pim.first(); !pim.eof(); pim.next())
|
zero_cursor("PPA");
|
||||||
{
|
zero_cursor("RMB");
|
||||||
TString codtab(pim.get("CODTAB"));
|
zero_cursor("LIM");
|
||||||
|
|
||||||
if (codtab.mid(0,4) == _year)
|
|
||||||
pim.remove();
|
|
||||||
}
|
|
||||||
// pim.packfile();
|
|
||||||
// pim.packindex();
|
|
||||||
|
|
||||||
// PLM
|
|
||||||
for (plm.first(); !plm.eof(); plm.next())
|
|
||||||
{
|
|
||||||
TString codtab(plm.get("CODTAB"));
|
|
||||||
|
|
||||||
if (codtab.mid(0,4) == _year)
|
|
||||||
plm.remove();
|
|
||||||
}
|
|
||||||
// plm.packfile();
|
|
||||||
// plm.packindex();
|
|
||||||
|
|
||||||
// PTM
|
|
||||||
for (ptm.first(); !ptm.eof(); ptm.next())
|
|
||||||
{
|
|
||||||
TString codtab(ptm.get("CODTAB"));
|
|
||||||
|
|
||||||
if (codtab.mid(0,4) == _year)
|
|
||||||
ptm.remove();
|
|
||||||
}
|
|
||||||
// ptm.packfile();
|
|
||||||
// ptm.packindex();
|
|
||||||
|
|
||||||
// PPA
|
|
||||||
for (ppa.first(); !ppa.eof(); ppa.next())
|
|
||||||
{
|
|
||||||
TString codtab(ppa.get("CODTAB"));
|
|
||||||
|
|
||||||
if (codtab.mid(0,4) == _year)
|
|
||||||
ppa.remove();
|
|
||||||
}
|
|
||||||
// ppa.packfile();
|
|
||||||
// ppa.packindex();
|
|
||||||
|
|
||||||
// RMB
|
|
||||||
for (rmb.first(); !rmb.eof(); rmb.next())
|
|
||||||
{
|
|
||||||
TString codtab(rmb.get("CODTAB"));
|
|
||||||
|
|
||||||
if (codtab.mid(0,4) == _year)
|
|
||||||
rmb.remove();
|
|
||||||
}
|
|
||||||
// rmb.packfile();
|
|
||||||
// rmb.packindex();
|
|
||||||
|
|
||||||
// LIM
|
|
||||||
for (lim.first(); !lim.eof(); lim.next())
|
|
||||||
{
|
|
||||||
TString codtab(lim.get("CODTAB"));
|
|
||||||
|
|
||||||
if (codtab.mid(0,4) == _year)
|
|
||||||
lim.remove();
|
|
||||||
}
|
|
||||||
// lim.packfile();
|
|
||||||
// lim.packindex();
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,6 +254,6 @@ bool TRipristino_liq::restore_firm(long firm)
|
|||||||
int cg5600(int argc, char* argv[])
|
int cg5600(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TRipristino_liq app;
|
TRipristino_liq app;
|
||||||
app.run(argc, argv, "Ripristino liquidazione");
|
app.run(argc, argv, TR("Ripristino liquidazione"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user