Patch level : 2..0 430
Files correlati : cg4.exe Ricompilazione Demo : [ ] Commento : Aggiunto il supporto delle lingue a cg4 git-svn-id: svn://10.65.10.50/trunk@10939 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d2a3f37668
commit
c1f550fd68
250
cg/cg4100.cpp
250
cg/cg4100.cpp
@ -36,7 +36,6 @@ struct therec {
|
||||
class CG4100_App : public TSkeleton_application
|
||||
{
|
||||
int _year;
|
||||
char _optype;
|
||||
TMask* _msk;
|
||||
|
||||
public:
|
||||
@ -45,262 +44,34 @@ public:
|
||||
bool set_parms();
|
||||
virtual void main_loop();
|
||||
|
||||
void restore_mov(TSystemisamfile& a, TSystemisamfile& b, TSystemisamfile& c);
|
||||
void sort_all();
|
||||
bool sort_mov();
|
||||
bool sort_sal();
|
||||
|
||||
CG4100_App() : _optype('S') {}
|
||||
CG4100_App() {}
|
||||
virtual ~CG4100_App() {}
|
||||
};
|
||||
|
||||
|
||||
bool CG4100_App::set_parms()
|
||||
{
|
||||
_msk->run();
|
||||
|
||||
if (_optype == 'S')
|
||||
_year = _msk->get_int(FLD_CG41_YEAR);
|
||||
else
|
||||
_year = 0;
|
||||
|
||||
_year = _msk->get_int(FLD_CG41_YEAR);
|
||||
return _msk->last_key() == K_ENTER;
|
||||
}
|
||||
|
||||
|
||||
void CG4100_App::main_loop()
|
||||
{
|
||||
|
||||
if (fexist("__sal__.sav"))
|
||||
warning_box("Un'operazione di riordino saldi si e' conclusa"
|
||||
" impropriamente. Si raccomanda di rieseguirla");
|
||||
warning_box(TR("Un'operazione di riordino saldi si e' conclusa"
|
||||
" impropriamente. Si raccomanda di rieseguirla"));
|
||||
|
||||
_msk = new TMask("cg4100b");
|
||||
|
||||
if (fexist("__mov__.sav"))
|
||||
warning_box("Un'operazione di riordino movimenti si e' conclusa"
|
||||
" impropriamente. Si raccomanda di rieseguirla");
|
||||
|
||||
if (argc() > 2)
|
||||
_optype = toupper(argv(2)[0]);
|
||||
|
||||
_msk = new TMask(_optype == 'S' ? "cg4100b" : "cg4100a");
|
||||
|
||||
if (_optype == 'S')
|
||||
sort_sal();
|
||||
else
|
||||
sort_mov();
|
||||
sort_sal();
|
||||
|
||||
delete _msk;
|
||||
}
|
||||
|
||||
|
||||
void CG4100_App::restore_mov(TSystemisamfile& mov, TSystemisamfile& rmov,
|
||||
TSystemisamfile& rmoviva)
|
||||
{
|
||||
long rn, rec;
|
||||
if (fexist("__mov__.ind"))
|
||||
{
|
||||
// rebuild all indexes
|
||||
mov.close(); rmov.close(); rmoviva.close();
|
||||
mov.packfile(); rmov.packfile(); rmoviva.packfile();
|
||||
mov.packindex(); rmov.packindex(); rmoviva.packindex();
|
||||
remove("__mov__.ind");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fp = fopen("__mov__.sav","r");
|
||||
if (feof(fp))
|
||||
{
|
||||
warning_box("File di ripristino vuoto; il ripristino non e' necessario");
|
||||
remove("__mov__.sav");
|
||||
return;
|
||||
};
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (feof(fp)) break;
|
||||
fscanf(fp,"%ld %ld", &rn, &rec);
|
||||
|
||||
mov.readat(rec);
|
||||
mov.put(MOV_NUMREG,rn);
|
||||
mov.rewrite();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (feof(fp)) break;
|
||||
fscanf(fp,"%ld",&rec);
|
||||
if (rec == -1l) break;
|
||||
rmov.readat(rec);
|
||||
rmov.put(RMV_NUMREG,rn);
|
||||
rmov.rewrite();
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
if (feof(fp)) break;
|
||||
fscanf(fp,"%ld",&rec);
|
||||
if (rec == -1l) break;
|
||||
rmoviva.readat(rec);
|
||||
rmoviva.put(RMI_NUMREG,rn);
|
||||
rmoviva.rewrite();
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
remove("__mov__.sav");
|
||||
}
|
||||
|
||||
|
||||
bool CG4100_App::sort_mov()
|
||||
{
|
||||
if (!set_parms())
|
||||
return FALSE;
|
||||
|
||||
TSystemisamfile mov(LF_MOV); mov.open(_excllock);
|
||||
TSystemisamfile rmov(LF_RMOV); rmov.open(_excllock);
|
||||
TSystemisamfile rmoviva(LF_RMOVIVA); rmoviva.open(_excllock);
|
||||
|
||||
mov.indexoff(); rmov.indexoff(); rmoviva.indexoff();
|
||||
mov.first();
|
||||
|
||||
TSort sort(sizeof(struct therec));
|
||||
|
||||
if (fexist("__mov__.sav") || fexist("__mov__.ind"))
|
||||
{
|
||||
// previous operation failed
|
||||
if (yesno_box("Un riordinamento precedente e' fallito.\n"
|
||||
" Ripristino la situazione iniziale ora?" ))
|
||||
restore_mov(mov, rmov, rmoviva);
|
||||
else return FALSE;
|
||||
}
|
||||
|
||||
therec rbuf;
|
||||
|
||||
sort.addsortkey(rbuf.DATAREG - (char*)&rbuf, 8);
|
||||
sort.addsortkey(rbuf.REG - (char*)&rbuf, 3);
|
||||
sort.addsortkey(rbuf.NUMPROT - (char*)&rbuf, 8);
|
||||
sort.addsortkey(rbuf.DATADOC - (char*)&rbuf, 8);
|
||||
sort.addsortkey(rbuf.NUMREG - (char*)&rbuf, 7);
|
||||
|
||||
sort.init();
|
||||
|
||||
TProgind prnd(mov.items(),
|
||||
"Riordino archivio movimenti in corso\nOrdinamento file movimenti...",
|
||||
FALSE,TRUE,30);
|
||||
TString16 s;
|
||||
|
||||
while (!mov.eof())
|
||||
{
|
||||
do_events();
|
||||
TDate d(mov.get(MOV_DATAREG));
|
||||
strcpy(rbuf.DATAREG, d.string(ANSI));
|
||||
strcpy(rbuf.REG, mov.get(MOV_REG));
|
||||
d = mov.get(MOV_DATADOC);
|
||||
s = mov.get(MOV_PROTIVA);
|
||||
if (s.len() > 0 && isdigit(s[s.len() - 1])) s << " ";
|
||||
s.right_just(8);
|
||||
strcpy(rbuf.NUMPROT, (const char *) s);
|
||||
strcpy(rbuf.DATADOC, d.string(ANSI));
|
||||
strcpy(rbuf.ANNOES, mov.get(MOV_ANNOES));
|
||||
strcpy(rbuf.NUMREG, mov.get(MOV_NUMREG));
|
||||
|
||||
sort.sort((char*)&rbuf);
|
||||
mov.next();
|
||||
prnd.addstatus(1);
|
||||
}
|
||||
sort.endsort();
|
||||
|
||||
prnd.setstatus(0);
|
||||
prnd.set_text("Riordino archivio movimenti in corso\nRiscrittura file movimenti...");
|
||||
|
||||
therec* rr;
|
||||
long num = 1;
|
||||
TRecnotype recno;
|
||||
|
||||
while ((rr = (therec*)sort.retrieve()) != NULL)
|
||||
{
|
||||
do_events();
|
||||
if (atol(rr->NUMREG) != num)
|
||||
{
|
||||
// find record
|
||||
mov.curr().zero();
|
||||
mov.put(MOV_NUMREG, rr->NUMREG);
|
||||
|
||||
mov.read();
|
||||
// should never happen
|
||||
CHECK(mov.good(), "Archivio movimenti inconsistente. Questo si' che e' un casino.");
|
||||
|
||||
// retrieve and change NUMREG
|
||||
recno = mov.recno();
|
||||
TString rgn = rr->NUMREG;
|
||||
FILE* fsav = fopen("__mov__.sav","a");
|
||||
fprintf(fsav,"%s %d ", (const char*)rgn, recno);
|
||||
fclose(fsav);
|
||||
|
||||
mov.put(MOV_NUMREG,num);
|
||||
mov.rewriteat(recno);
|
||||
// update linked records
|
||||
|
||||
rmov.curr().zero();
|
||||
rmov.put(RMV_NUMREG,rgn);
|
||||
rmov.read(_isgteq);
|
||||
|
||||
int row = 0;
|
||||
|
||||
while (!rmov.eof() && rgn == rmov.get(RMV_NUMREG) &&
|
||||
row++ < rmov.get_int(RMV_NUMRIG))
|
||||
{
|
||||
recno = rmov.recno();
|
||||
fsav = fopen("__mov__.sav","a");
|
||||
fprintf(fsav,"%ld ", recno);
|
||||
fclose(fsav);
|
||||
rmov.put(RMV_NUMREG,num);
|
||||
rmov.rewriteat(recno);
|
||||
rmov.next();
|
||||
}
|
||||
fsav = fopen("__mov__.sav","a");
|
||||
fprintf(fsav,"-1"); fclose(fsav);
|
||||
|
||||
rmoviva.zero();
|
||||
rmoviva.put(RMI_NUMREG,rgn);
|
||||
rmoviva.read(_isgteq);
|
||||
|
||||
row = 0;
|
||||
|
||||
while (!rmoviva.eof() && rgn == rmoviva.get(RMV_NUMREG) &&
|
||||
row++ < rmoviva.get_int(RMV_NUMRIG))
|
||||
{
|
||||
recno = rmoviva.recno();
|
||||
fsav = fopen("__mov__.sav","a");
|
||||
fprintf(fsav,"%ld ", recno);
|
||||
fclose(fsav);
|
||||
rmoviva.put(RMI_NUMREG,num);
|
||||
rmoviva.rewriteat(recno);
|
||||
rmoviva.next();
|
||||
}
|
||||
fsav = fopen("__mov__.sav","a");
|
||||
fprintf(fsav,"-1"); fclose(fsav);
|
||||
}
|
||||
num++;
|
||||
prnd.addstatus(1);
|
||||
}
|
||||
|
||||
remove("__mov__.sav");
|
||||
|
||||
FILE* fsav = fopen("__mov__.ind","w"); fclose(fsav);
|
||||
|
||||
prnd.set_text("Riordino archivio movimenti in corso\nRicostruzione files indice...");
|
||||
|
||||
// rebuild indexes
|
||||
mov.close(); rmov.close(); rmoviva.close();
|
||||
mov.indexon(); rmov.indexon(); rmoviva.indexon();
|
||||
mov.packfile(); rmov.packfile(); rmoviva.packfile();
|
||||
mov.packindex(); rmov.packindex(); rmoviva.packindex();
|
||||
|
||||
remove("__mov__.ind");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bool CG4100_App::sort_sal()
|
||||
{
|
||||
if (!set_parms())
|
||||
@ -318,8 +89,8 @@ bool CG4100_App::sort_sal()
|
||||
const int year = _year;
|
||||
long oldnumreg = 0L, sottoconto;
|
||||
TProgind prnd(rmov.items(),
|
||||
"Riordino archivio saldi in corso\nLettura archivio movimenti...",
|
||||
FALSE,TRUE,30);
|
||||
TR("Riordino archivio saldi in corso\nLettura archivio movimenti..."),
|
||||
FALSE,TRUE);
|
||||
|
||||
mov.setkey(1);
|
||||
rmov.first();
|
||||
@ -401,10 +172,9 @@ bool CG4100_App::sort_sal()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int cg4100(int argc, char* argv[])
|
||||
{
|
||||
CG4100_App main_app;
|
||||
main_app.run(argc, argv, "Ricalcolo Saldi");
|
||||
main_app.run(argc, argv, TR("Ricalcolo Saldi"));
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ bool TCopia_archivi::check_comfile(int logicnum)
|
||||
if (fexist(dir.filename()))
|
||||
return TRUE;
|
||||
else
|
||||
return error_box("Non esiste il file sorgente : archivi comuni - %s", dir.filename());
|
||||
return error_box(FR("Non esiste il file sorgente : archivi comuni - %s"), dir.filename());
|
||||
}
|
||||
|
||||
bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
||||
@ -48,7 +48,7 @@ bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
||||
if (dir.is_com())
|
||||
{
|
||||
dir.get(logicnum);
|
||||
return error_box("Non posso copiare su un'archivio comune : ditta %ld - archivio %s", to, dir.filename());
|
||||
return error_box(FR("Non posso copiare su un'archivio comune : ditta %ld - archivio %s"), to, dir.filename());
|
||||
}
|
||||
if (from > 0) set_firm(from);
|
||||
else
|
||||
@ -58,13 +58,13 @@ bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
||||
TSystemisamfile file(logicnum);
|
||||
|
||||
if (file.dump(t) != NOERR)
|
||||
return error_box("Impossibile leggere i dati da copiare errore n. %d", file.status());
|
||||
return error_box(FR("Impossibile leggere i dati da copiare errore n. %d"), file.status());
|
||||
set_firm(to);
|
||||
|
||||
TFilename s; s.tempdir(); s << "/sv" << logicnum;
|
||||
|
||||
if (file.dump(s) != NOERR)
|
||||
return error_box("Impossibile salvare i dati originali errore n. %d", file.status());
|
||||
return error_box(FR("Impossibile salvare i dati originali errore n. %d"), file.status());
|
||||
|
||||
|
||||
dir.get(logicnum, _lock, _nordir, _sysdirop);
|
||||
@ -74,13 +74,13 @@ bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
||||
file.packindex();
|
||||
if (file.load(t) != NOERR)
|
||||
{
|
||||
error_box("Impossibile scrivere i dati errore n. %d. Cerco di ripristinare i dati originali.", file.status());
|
||||
error_box(FR("Impossibile scrivere i dati errore n. %d. Cerco di ripristinare i dati originali."), file.status());
|
||||
dir.get(logicnum, _lock, _nordir, _sysdirop);
|
||||
dir.eod() = 0L;
|
||||
dir.put(logicnum, _nordir, _sysdirop);
|
||||
file.packindex();
|
||||
if (file.load(s))
|
||||
error_box("Impossibile scrivere i dati originali errore n. %d", file.status());
|
||||
error_box(FR("Impossibile scrivere i dati originali errore n. %d"), file.status());
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
@ -184,7 +184,7 @@ void TCopia_archivi::main_loop()
|
||||
const long from_firm = _msk->get_long(F_FROMFIRM);
|
||||
const long to_firm = _msk->get_long(F_TOFIRM);
|
||||
if (from_firm == to_firm)
|
||||
error_box("La copia si puo' effettuare solo tra due ditte diverse");
|
||||
error_box(TR("La copia si puo' effettuare solo tra due ditte diverse"));
|
||||
else
|
||||
{
|
||||
const bool copy_pcon = _msk->get_bool(F_PCON);
|
||||
@ -200,48 +200,48 @@ void TCopia_archivi::main_loop()
|
||||
if (ok && prefix().exist(to_firm))
|
||||
{
|
||||
set_firm(to_firm);
|
||||
{
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
ok = (mov.eod() == 0);
|
||||
}
|
||||
{
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
ok = (mov.eod() == 0);
|
||||
}
|
||||
|
||||
if (ok || (!copy_pcon && !copy_causali && !copy_clifo))
|
||||
{
|
||||
TString256 mess("Attenzione \n");
|
||||
TString256 mess(TR("Attenzione \n"));
|
||||
int count = 0;
|
||||
|
||||
if (copy_pcon)
|
||||
{
|
||||
mess << "il piano dei conti";
|
||||
mess << TR("il piano dei conti");
|
||||
count++;
|
||||
}
|
||||
if (copy_causali)
|
||||
{
|
||||
if (count > 0) mess << ",\n";
|
||||
mess << " le causali";
|
||||
mess << TR(" le causali");
|
||||
count++;
|
||||
}
|
||||
if (copy_clifo)
|
||||
{
|
||||
if (count > 0) mess << ",\n";
|
||||
mess << " i clienti e fornitori";
|
||||
mess << TR(" i clienti e fornitori");
|
||||
count++;
|
||||
}
|
||||
if (copy_ivd)
|
||||
{
|
||||
if (count > 0) mess << ",\n";
|
||||
mess << " la riclassificazione IV direttiva";
|
||||
mess << TR(" la riclassificazione IV direttiva");
|
||||
count++;
|
||||
}
|
||||
mess << "\n della ditta " << to_firm;
|
||||
mess << TR("\n della ditta ") << to_firm;
|
||||
if (count > 1)
|
||||
mess << " saranno sovrascritti";
|
||||
mess << TR(" saranno sovrascritti");
|
||||
else
|
||||
mess << " sara' sovrascritto";
|
||||
mess << ". Devo continuare";
|
||||
mess << TR(" sara' sovrascritto");
|
||||
mess << TR(". Devo continuare");
|
||||
if (yesno_box((const char *) mess))
|
||||
{
|
||||
mess.rtrim(16); mess << " Devo veramente continuare";
|
||||
mess.rtrim(16); mess << TR(" Devo veramente continuare");
|
||||
if (yesno_box((const char *) mess))
|
||||
{
|
||||
if (copy_pcon)
|
||||
@ -261,10 +261,10 @@ void TCopia_archivi::main_loop()
|
||||
}
|
||||
}
|
||||
}
|
||||
else error_box("La copia si puo' effettuare solo se non sono stati registrati movimenti");
|
||||
else error_box(TR("La copia si puo' effettuare solo se non sono stati registrati movimenti"));
|
||||
set_firm(_default_firm);
|
||||
}
|
||||
else error_box("Gli archivi della ditta %ld non sono stati ancora generati",to_firm);
|
||||
else error_box(FR("Gli archivi della ditta %ld non sono stati ancora generati"),to_firm);
|
||||
_msk->reset();
|
||||
}
|
||||
}
|
||||
@ -274,6 +274,6 @@ void TCopia_archivi::main_loop()
|
||||
int cg4200(int argc, char* argv[])
|
||||
{
|
||||
TCopia_archivi a ;
|
||||
a.run(argc, argv, "Copia archivi");
|
||||
a.run(argc, argv, TR("Copia archivi"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ END
|
||||
NUMBER F_FROMFIRM 5
|
||||
BEGIN
|
||||
PROMPT 4 5 "Ditta "
|
||||
FLAGS "F"
|
||||
USE LF_NDITTE KEY 1
|
||||
CHECKTYPE NORMAL
|
||||
INPUT CODDITTA F_FROMFIRM
|
||||
|
@ -5,7 +5,8 @@
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include <currency.h>
|
||||
#include <defmask.h>
|
||||
#include <defmask.h>
|
||||
#include <recarray.h>
|
||||
#include <mailbox.h>
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
@ -108,8 +109,8 @@ bool TLiquidazione_app::user_create()
|
||||
if (msg != NULL) subj = msg->body();
|
||||
|
||||
if (_is_interactive)
|
||||
pnd = new TProgind (3,"Preparazione archivi\nPrego attendere",
|
||||
FALSE, TRUE, 30);
|
||||
pnd = new TProgind (3,TR("Preparazione archivi\nPrego attendere"),
|
||||
FALSE, TRUE);
|
||||
else begin_wait();
|
||||
|
||||
_nditte = new TRelation(LF_NDITTE);
|
||||
@ -117,8 +118,8 @@ bool TLiquidazione_app::user_create()
|
||||
_nditte_r = &(_nditte->curr());
|
||||
_att_r = &(_nditte->curr(LF_ATTIV));
|
||||
|
||||
_ditte = new TArray_sheet(-1, -1, -4, -4, "Selezione Ditte",
|
||||
"@1|Cod.@5R|Ragione Sociale@50|Vers.|Agr.Min");
|
||||
_ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"),
|
||||
HR("@1|Cod.@5R|Ragione Sociale@50|Vers.|Agr.Min"));
|
||||
_n_ditte = 0l;
|
||||
|
||||
// Caro tab11, ricordati che un giorno sarai un file unico!
|
||||
@ -358,11 +359,12 @@ bool TLiquidazione_app::user_create()
|
||||
// determina attivita' prevalente e istanzia cazzuole
|
||||
// per vedere che Kazzo di liquidazione calcolare
|
||||
TString attprev = _nditte->curr().get("CODATTPREV");
|
||||
TLocalisamfile& atts = _nditte->lfile(LF_ATTIV);
|
||||
atts.zero();
|
||||
atts.put("CODDITTA",ditta);
|
||||
atts.put("CODATT", attprev);
|
||||
if (atts.read() != NOERR) atts.zero();
|
||||
TString16 key;
|
||||
|
||||
key.format("%ld|%s", ditta, (const char *) attprev);
|
||||
|
||||
const TRectype & atts = cache().get(LF_ATTIV, key);
|
||||
|
||||
// istanzia benzinaro
|
||||
_isbenzinaro = atts.get_bool("ART74_4");
|
||||
|
||||
@ -506,7 +508,7 @@ bool TLiquidazione_app::set_print(int)
|
||||
{
|
||||
if (_selected.ones() > 0l)
|
||||
return recalc_all() && _isprint;
|
||||
else warning_box("Nessuna ditta selezionata!");
|
||||
else warning_box(TR("Nessuna ditta selezionata!"));
|
||||
}
|
||||
break;
|
||||
case 2: // estrazione deleghe
|
||||
@ -521,7 +523,7 @@ bool TLiquidazione_app::set_print(int)
|
||||
extract_deleghe();
|
||||
return _isprint;
|
||||
}
|
||||
else warning_box("Nessuna ditta selezionata!");
|
||||
else warning_box(TR("Nessuna ditta selezionata!"));
|
||||
}
|
||||
break;
|
||||
case 3: // calcolo acconto
|
||||
@ -538,7 +540,7 @@ bool TLiquidazione_app::set_print(int)
|
||||
recalc_acconti(inf, ina);
|
||||
return _isprint;
|
||||
}
|
||||
else warning_box("Nessuna ditta selezionata!");
|
||||
else warning_box(TR("Nessuna ditta selezionata!"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -897,27 +899,27 @@ int cg4300(int argc, char* argv[])
|
||||
{
|
||||
TApplication::check_parameters(argc, argv);
|
||||
|
||||
const char* title = "Liquidazione IVA";
|
||||
const char* title = TR("Liquidazione IVA");
|
||||
int menu = 1;
|
||||
|
||||
if (argc > 2)
|
||||
if (argc > 2)
|
||||
{
|
||||
const char mode = argv[2][1];
|
||||
switch (mode)
|
||||
{
|
||||
case 'A':
|
||||
title = "Calcolo acconti";
|
||||
title = TR("Calcolo acconti");
|
||||
menu = 3;
|
||||
break;
|
||||
case 'C':
|
||||
title = "Ricalcolo progressivi IVA";
|
||||
title = TR("Ricalcolo progressivi IVA");
|
||||
break;
|
||||
case 'D':
|
||||
title = "Estrazione versamenti";
|
||||
title = TR("Estrazione versamenti");
|
||||
menu = 2;
|
||||
break;
|
||||
case 'S':
|
||||
title = "Stampa liquidazione";
|
||||
title = TR("Stampa liquidazione");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <os_dep.h>
|
||||
#include <recarray.h>
|
||||
#include <progind.h>
|
||||
#include <sheet.h>
|
||||
|
||||
@ -27,13 +28,13 @@
|
||||
bool TLiquidazione_app::recalc_all()
|
||||
{
|
||||
_prind = new TProgind(_selected.ones()*2, _printonly ?
|
||||
" Stampa liquidazione... \n"
|
||||
" Preparazione archivi \n"
|
||||
" " :
|
||||
" Calcolo liquidazione... \n"
|
||||
" Preparazione archivi \n"
|
||||
" ",
|
||||
TRUE,TRUE,45);
|
||||
TR(" Stampa liquidazione... \n"
|
||||
" Preparazione archivi \n"
|
||||
" ") :
|
||||
TR(" Calcolo liquidazione... \n"
|
||||
" Preparazione archivi \n"
|
||||
" "),
|
||||
TRUE,TRUE);
|
||||
|
||||
for (int l = 0; l < _ditte->items(); l++)
|
||||
{
|
||||
@ -63,11 +64,11 @@ bool TLiquidazione_app::recalc_all()
|
||||
// determina attivita' prevalente e istanzia cazzuole
|
||||
// per vedere che Kazzo di liquidazione calcolare
|
||||
TString attprev = _nditte->curr().get("CODATTPREV");
|
||||
TLocalisamfile& atts = _nditte->lfile(LF_ATTIV);
|
||||
atts.zero();
|
||||
atts.put("CODDITTA",codditta);
|
||||
atts.put("CODATT", attprev);
|
||||
if (atts.read() != NOERR) atts.zero();
|
||||
TString16 key;
|
||||
|
||||
key.format("%ld|%s", codditta, (const char *) attprev);
|
||||
|
||||
const TRectype & atts = cache().get(LF_ATTIV, key);
|
||||
// istanzia benzinaro
|
||||
_isbenzinaro = atts.get_bool("ART74_4");
|
||||
|
||||
@ -108,9 +109,9 @@ bool TLiquidazione_app::recalc_all()
|
||||
break;
|
||||
}
|
||||
|
||||
if (need_refresh && yesno_box("Alcuni mesi precedenti non "
|
||||
if (need_refresh && yesno_box(TR("Alcuni mesi precedenti non "
|
||||
"risultano ricalcolati. E' consigliabile il ricalcolo. "
|
||||
"Si desidera eseguirlo?"))
|
||||
"Si desidera eseguirlo?")))
|
||||
_recalc = ever;
|
||||
}
|
||||
|
||||
@ -207,8 +208,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
// se diventa TRUE);
|
||||
_mixed = FALSE;
|
||||
|
||||
buf.format( _printonly ? "Stampa liquidazione (%d)...\n%s: %s\n" :
|
||||
"Calcolo liquidazione (%d)...\n%s: %s\n",
|
||||
buf.format( _printonly ? FR("Stampa liquidazione (%d)...\n%s: %s\n") :
|
||||
FR("Calcolo liquidazione (%d)...\n%s: %s\n"),
|
||||
month,
|
||||
(const char*)_nditte_r->get("RAGSOC"),
|
||||
(const char*)desatt);
|
||||
@ -307,7 +308,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
|
||||
if (calc || !recalc)
|
||||
if (!update_att(month, cattiv) && stliq)
|
||||
describe_error("Attivita' non ricalcolate: possibili errori",
|
||||
describe_error(TR("Attivita' non ricalcolate: possibili errori"),
|
||||
codatt);
|
||||
if (_recalc_regis)
|
||||
continue;
|
||||
@ -699,9 +700,9 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
#ifdef DBG
|
||||
TString msgdbg;
|
||||
long freespace;
|
||||
msgdbg.format("Ricalcolo attivita': %ld/%ld",_cur->pos(),items);
|
||||
msgdbg.format(FR("Ricalcolo attivita': %ld/%ld"),_cur->pos(),items);
|
||||
freespace = os_get_free_memory();
|
||||
msgdbg << " Memoria libera: " << freespace/1024 << " Kbytes.";
|
||||
msgdbg << TR(" Memoria libera: ") << freespace/1024 << TR(" Kbytes.");
|
||||
xvt_statbar_set(msgdbg);
|
||||
#endif
|
||||
do_events();
|
||||
@ -2475,7 +2476,7 @@ void TLiquidazione_app::iva11_write(bool reset_r1r2)
|
||||
|
||||
if (_tab11->write() != NOERR)
|
||||
if ((err=_tab11->rewrite()) != NOERR)
|
||||
error_box("Errore %d tentando di scrivere sul file tab1100.",err);
|
||||
error_box(TR("Errore %d tentando di scrivere sul file tab1100."),err);
|
||||
}
|
||||
|
||||
_iva11_arr.destroy(); // resetta l'array.
|
||||
@ -2488,7 +2489,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
const int year_int = atoi(_year);
|
||||
|
||||
if (_ver->read(year_int, _month)!=NOERR)
|
||||
warning_box("Errore %d in lettura tabella versamenti ed interessi.",_ver->status());
|
||||
warning_box(TR("Errore %d in lettura tabella versamenti ed interessi."),_ver->status());
|
||||
|
||||
/* Cazzata galattica: già gestito BENE da update_firm, prima di chiamare questa funzione
|
||||
// evita casino se differita ma si sta ricalcolando il primo mese con ricalcolo di piu' mesi
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <currency.h>
|
||||
#include <recarray.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cglib03.h"
|
||||
@ -637,11 +638,12 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
||||
bool titcf = FALSE;
|
||||
bool isdel = FALSE;
|
||||
int uffiva;
|
||||
TLocalisamfile anag(LF_ANAG);
|
||||
anag.zero();
|
||||
anag.put("TIPOA", _nditte->lfile().get("TIPOA"));
|
||||
anag.put("CODANAGR", _nditte->lfile().get("CODANAGR"));
|
||||
if (anag.read() == NOERR)
|
||||
TString16 key;
|
||||
|
||||
key.format("%s|%s", (const char *)_nditte->lfile().get("TIPOA"), (const char *) _nditte->lfile().get("CODANAGR"));
|
||||
|
||||
const TRectype & anag = cache().get(LF_ANAG, key);
|
||||
if (!anag.empty())
|
||||
{
|
||||
titcf = anag.get_bool("TITCF");
|
||||
isdel = anag.get_long("TIPOSTDEL") == 0l;
|
||||
@ -696,11 +698,12 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
||||
if (ok)
|
||||
{
|
||||
int uffiva;
|
||||
TLocalisamfile anag(LF_ANAG);
|
||||
anag.zero();
|
||||
anag.put("TIPOA", _nditte->lfile().get("TIPOA"));
|
||||
anag.put("CODANAGR", _nditte->lfile().get("CODANAGR"));
|
||||
if (anag.read() == NOERR)
|
||||
TString16 key;
|
||||
|
||||
key.format("%s|%s", (const char *)_nditte->lfile().get("TIPOA"), (const char *) _nditte->lfile().get("CODANAGR"));
|
||||
|
||||
const TRectype & anag = cache().get(LF_ANAG, key);
|
||||
if (!anag.empty())
|
||||
uffiva = anag.get_int("UFFIVA");
|
||||
|
||||
TString16 abi = _del->get("S7");
|
||||
@ -710,22 +713,18 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
||||
// descrizione banca
|
||||
if (abi.not_empty())
|
||||
{
|
||||
TTable ban("%BAN");
|
||||
ban.zero();
|
||||
TString codban = format("%05ld", atol(abi));
|
||||
if (!cab.empty()) codban << format("%05ld", atol(cab));
|
||||
ban.put("CODTAB", codban);
|
||||
if (ban.read() == NOERR)
|
||||
const TRectype & ban = cache().get("%BAN", codban);
|
||||
if (!ban.empty())
|
||||
{
|
||||
TString desban(ban.get("S0"));
|
||||
_del->put("S1", desban);
|
||||
}
|
||||
//che rottura: ogni giorno alla prassi cambiano idea!!!
|
||||
TTable uiv("%UIV");
|
||||
uiv.zero();
|
||||
TString16 coduff = format("%03d", uffiva);
|
||||
uiv.put("CODTAB", coduff);
|
||||
if (uiv.read() == NOERR)
|
||||
const TRectype & uiv = cache().get("%UIV", coduff);
|
||||
if (!uiv.empty())
|
||||
{
|
||||
TString desiva(uiv.get("S0"));
|
||||
_del->put("S2", desiva);
|
||||
@ -1000,35 +999,35 @@ bool TLiquidazione_app::look_conc(TString& uffcon, TString& uffiva)
|
||||
TString ana(_nditte->lfile().get("TIPOA"));
|
||||
TString codana(_nditte->lfile().get("CODANAGR"));
|
||||
// look anagrafica
|
||||
TLocalisamfile anagr(LF_ANAG);
|
||||
anagr.zero();
|
||||
anagr.put("TIPOA", ana);
|
||||
anagr.put("CODANAGR", codana);
|
||||
if (anagr.read() != NOERR) return FALSE;
|
||||
TString16 key;
|
||||
|
||||
key.format("%s|%s", (const char *) ana, (const char *) codana);
|
||||
|
||||
const TRectype & anag = cache().get(LF_ANAG, key);
|
||||
if (anag.empty()) return FALSE;
|
||||
|
||||
// becca comune residenza fiscale
|
||||
TString com(anagr.get("COMRF"));
|
||||
TString com(anag.get("COMRF"));
|
||||
// se non c'e', residenza
|
||||
if (com.empty())
|
||||
com = anagr.get("COMRES");
|
||||
com = anag.get("COMRES");
|
||||
|
||||
if (com.empty()) return FALSE;
|
||||
|
||||
// becca comune
|
||||
TLocalisamfile comuni(LF_COMUNI);
|
||||
comuni.zero(); // STATO = "" ovvero ITAGLIA
|
||||
comuni.put("COM", com);
|
||||
if (comuni.read() != NOERR) return FALSE;
|
||||
key.format("|%s", (const char *) com);
|
||||
|
||||
const TRectype comuni = cache().get(LF_COMUNI, key);
|
||||
|
||||
if (comuni.empty()) return FALSE;
|
||||
|
||||
const int uffa = comuni.get_int("UFFCONC");
|
||||
if (uffcon.empty())
|
||||
uffcon = format("%03d",uffa);
|
||||
if (uffcon.not_empty())
|
||||
{
|
||||
TTable ucc("%UCC");
|
||||
ucc.zero();
|
||||
ucc.put("CODTAB", uffcon);
|
||||
if (ucc.read() == NOERR)
|
||||
const TRectype & ucc = cache().get("%UCC", uffcon);
|
||||
if (!ucc.empty())
|
||||
uffiva = ucc.get("S0");
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -39,16 +39,16 @@ void TLiquidazione_app::zero_plafond (int month, const char* codatt)
|
||||
{
|
||||
if (_recalc != needed)
|
||||
{
|
||||
describe_error("Progressivi plafond non ricalcolati per "
|
||||
"i mesi precedenti: possibili errori",
|
||||
describe_error(TR("Progressivi plafond non ricalcolati per "
|
||||
"i mesi precedenti: possibili errori"),
|
||||
codatt);
|
||||
is_ok = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!update_att(previous_month(month),codatt, FALSE))
|
||||
describe_error("Progressivi plafond non ricalcolati per "
|
||||
"i mesi precedenti: possibili errori",
|
||||
describe_error(TR("Progressivi plafond non ricalcolati per "
|
||||
"i mesi precedenti: possibili errori"),
|
||||
codatt);
|
||||
look_ppa(previous_month(month),codatt,jj);
|
||||
}
|
||||
|
555
cg/cg4304.cpp
555
cg/cg4304.cpp
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
||||
|
||||
#include <currency.h>
|
||||
#include <defmask.h>
|
||||
#include <recarray.h>
|
||||
#include <progind.h>
|
||||
#include <prefix.h>
|
||||
#include <sheet.h>
|
||||
@ -72,13 +73,13 @@ bool TLiquidazione_app::extract_deleghe()
|
||||
{
|
||||
TString buf(256); TArray desc;
|
||||
_prind = new TProgind(_calcall ? _n_ditte : _selected.ones(),
|
||||
" Estrazione deleghe \n"
|
||||
" preparazione archivi \n "
|
||||
" \n ",
|
||||
TRUE,TRUE,40);
|
||||
TR(" Estrazione deleghe \n"
|
||||
" preparazione archivi \n "
|
||||
" \n "),
|
||||
TRUE,TRUE);
|
||||
|
||||
if (_ver->read(atoi(_year),(_month > 12) ? 12 : _month) != NOERR)
|
||||
warning_box("Errore %d in lettura tabella versamenti ed interessi.",_ver->status());
|
||||
warning_box(FR("Errore %d in lettura tabella versamenti ed interessi."),_ver->status());
|
||||
for (int l = 0; l < _ditte->items(); l++)
|
||||
{
|
||||
if (_prind->iscancelled())
|
||||
@ -99,7 +100,7 @@ bool TLiquidazione_app::extract_deleghe()
|
||||
look_lia();
|
||||
_freqviva = _lia->get("S7");
|
||||
|
||||
buf.format("Estrazione deleghe (%d):\nditta %s\n ",
|
||||
buf.format(FR("Estrazione deleghe (%d):\nditta %s\n "),
|
||||
_month, (const char*)_nditte_r->get("RAGSOC"));
|
||||
_prind->set_text(buf);
|
||||
|
||||
@ -218,21 +219,19 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
||||
TString desc;
|
||||
if (_del->get("S9").not_empty())
|
||||
{
|
||||
TTable ucc("%UCC");
|
||||
ucc.zero();
|
||||
ucc.put("CODTAB", _del->get("S9"));
|
||||
if (ucc.read() == NOERR)
|
||||
desc = ucc.get("S0");
|
||||
const TRectype & ucc = cache().get("%UCC", _del->get("S9"));
|
||||
if (!ucc.empty())
|
||||
desc = ucc.get("S0");
|
||||
}
|
||||
if (_del->get("S7").not_empty())
|
||||
{
|
||||
TTable ban("%BAN");
|
||||
TString16 cod;
|
||||
cod = _del->get("S7");
|
||||
if (_del->get("S8").not_empty()) cod << _del->get("S8");
|
||||
ban.zero();
|
||||
ban.put("CODTAB", cod);
|
||||
if (ban.read() == NOERR)
|
||||
|
||||
const TRectype & ban = cache().get("%BAN", cod);
|
||||
|
||||
if (!ban.empty())
|
||||
desc = ban.get("S0");
|
||||
}
|
||||
tt->add(desc);
|
||||
@ -241,7 +240,7 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
||||
{
|
||||
bool stampato = _del->get_bool("B0");
|
||||
TString buf;
|
||||
buf.format("Il versamento relativo alla ditta %ld e' gia' stato stampato. Si desidera eliminare il flag di stampa definitiva?",_nditte->lfile().get_long("CODDITTA"));
|
||||
buf.format(FR("Il versamento relativo alla ditta %ld e' gia' stato stampato. Si desidera eliminare il flag di stampa definitiva?"),_nditte->lfile().get_long("CODDITTA"));
|
||||
if (stampato && yesno_box(buf))
|
||||
{ // Se la delega e' gia' stampata in definitva, chiede se deve eliminare il flag di stampa
|
||||
_del->put("B0",FALSE);
|
||||
@ -265,7 +264,7 @@ bool TLiquidazione_app::video_conferma(const real& newimp, const real& intr,
|
||||
{
|
||||
TMask m("cg4800b");
|
||||
|
||||
m.set_caption(to_del ? "Conferma eliminazione" : "Estrazione versamenti"); // Modifica il titolo...
|
||||
m.set_caption(to_del ? TR("Conferma eliminazione") : TR("Estrazione versamenti")); // Modifica il titolo...
|
||||
m.field(F_CODDITTA).set(_nditte->lfile().get("CODDITTA"));
|
||||
m.field(F_RAGSOC).set(_nditte->lfile().get("RAGSOC"));
|
||||
m.field(F_DATAVER).set(_del->get_date("D0"));
|
||||
@ -293,9 +292,9 @@ bool TLiquidazione_app::video_conferma(const real& newimp, const real& intr,
|
||||
case K_SAVE:
|
||||
{
|
||||
k = yesnocancel_box(to_del ?
|
||||
"Si desidera veramente confermare l'eliminazione?"
|
||||
TR("Si desidera veramente confermare l'eliminazione?")
|
||||
:
|
||||
"Delega gia' stampata. Si desidera ugualmente confermare l'aggiornamento?");
|
||||
TR("Delega gia' stampata. Si desidera ugualmente confermare l'aggiornamento?"));
|
||||
if (k == K_YES)
|
||||
{
|
||||
if (to_del)
|
||||
@ -380,13 +379,13 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
|
||||
|
||||
const long firm = TApplication::get_firm();
|
||||
_prind = new TProgind(_n_ditte,
|
||||
" Calcolo acconto "
|
||||
"\n Preparazione archivi "
|
||||
"\n ",
|
||||
TRUE,TRUE,40);
|
||||
TR(" Calcolo acconto "
|
||||
"\n Preparazione archivi "
|
||||
"\n "),
|
||||
TRUE,TRUE);
|
||||
|
||||
if (_ver->read(atoi(_year),(_month > 12) ? 12 : _month) != NOERR)
|
||||
warning_box("Errore %d in lettura tabella versamenti ed interessi.",_ver->status());
|
||||
warning_box(FR("Errore %d in lettura tabella versamenti ed interessi."),_ver->status());
|
||||
for (int l = 0; l < _ditte->items(); l++)
|
||||
{
|
||||
if (_prind->iscancelled())
|
||||
@ -418,7 +417,7 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
|
||||
inf = _lia->get_real("R13");
|
||||
ina = _lia->get_real("R14");
|
||||
|
||||
buf.format("Calcolo acconto:\nditta %s",
|
||||
buf.format(FR("Calcolo acconto:\nditta %s"),
|
||||
(const char*)_nditte_r->get("RAGSOC"));
|
||||
_prind->set_text(buf);
|
||||
recalc_acconto(inf, ina);
|
||||
@ -480,11 +479,12 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
// casino benzinari
|
||||
TString attprev = _nditte->curr().get("CODATTPREV");
|
||||
long codd = _nditte->curr().get_long("CODDITTA");
|
||||
TLocalisamfile& atts = _nditte->lfile(LF_ATTIV);
|
||||
atts.zero();
|
||||
atts.put("CODDITTA", codd);
|
||||
atts.put("CODATT", attprev);
|
||||
if (atts.read() != NOERR) atts.zero();
|
||||
TString16 key;
|
||||
|
||||
key.format("%ld|%s", codd, (const char *) attprev);
|
||||
|
||||
const TRectype & atts = cache().get(LF_ATTIV, key);
|
||||
|
||||
if (atts.get_bool("ART74_4")) // e' proprio un gran benzinaro
|
||||
history = _lia->get_bool("B4") ? mm : tt; // Was CNF_DITTA->GesT74
|
||||
|
||||
@ -546,7 +546,6 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
if (bc.sign() > 0) //debito
|
||||
{
|
||||
acc = ((bc / divide_by_three) * _ver->get(isdifferita ? B_LIQ_DIFF : B_LIQ_NORM))/CENTO;
|
||||
// acc.round(ROUND_LIRA);
|
||||
acc.round(TCurrency::get_firm_dec());
|
||||
}
|
||||
|
||||
@ -568,8 +567,8 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
need_refresh = TRUE;
|
||||
break;
|
||||
}
|
||||
if (need_refresh && yesno_box("Alcuni mesi precedenti non risultano ricalcolati:\n"
|
||||
"è consigliabile il ricalcolo. Si desidera eseguirlo?"))
|
||||
if (need_refresh && yesno_box(FR("Alcuni mesi precedenti non risultano ricalcolati:\n"
|
||||
"è consigliabile il ricalcolo. Si desidera eseguirlo?")))
|
||||
_recalc = ever;
|
||||
|
||||
for (int m = 1; m <= _month; m++)
|
||||
@ -671,25 +670,6 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
_lia->rewrite();
|
||||
}
|
||||
|
||||
/*** Non bisogna aggiornare la delega
|
||||
Se in un prossimo futuro si decidesse di ripristinare questa
|
||||
parte di codice, ricordarsi che il valore ACCONTO_MINIMO_DA_VERSARE
|
||||
va sostituito con cio' che si trova nella tabella %VER, al
|
||||
periodo corrispondente (campo I_ACCONTOIVA).
|
||||
|
||||
bool wasdel = look_del(12,7);
|
||||
|
||||
if (acc.sign() > 0 && acc >= ACCONTO_MINIMO_DA_VERSARE)
|
||||
{
|
||||
// crea o aggiorna delega
|
||||
// TBC everything
|
||||
look_del(12,7,TRUE);
|
||||
_del->put("R0", acc);
|
||||
_del->rewrite();
|
||||
}
|
||||
else if (wasdel)
|
||||
_del->remove();
|
||||
***/
|
||||
|
||||
// per questa volta lasciamo perdere la describe_acconto
|
||||
if (_isprint)
|
||||
|
Loading…
x
Reference in New Issue
Block a user