Patch level : 2..0 434
Files correlati : cg4.exe Ricompilazione Demo : [ ] Commento : Aggiunto il supporto delle lingue a cg4 git-svn-id: svn://10.65.10.50/trunk@10946 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
730be22a7a
commit
33712eacad
10
cg/cg4.h
10
cg/cg4.h
@ -16,15 +16,5 @@ int cg4800(int argc, char* argv[]);
|
|||||||
int cg4900(int argc, char* argv[]);
|
int cg4900(int argc, char* argv[]);
|
||||||
int cg4a00(int argc, char* argv[]);
|
int cg4a00(int argc, char* argv[]);
|
||||||
|
|
||||||
#ifdef __MAIN__
|
|
||||||
#define extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern TString256 TMP;
|
|
||||||
|
|
||||||
#ifdef __MAIN__
|
|
||||||
#undef extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __CG4_H
|
#endif // __CG4_H
|
||||||
|
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
PAGE "Riordino Movimenti" -1 -1 47 10
|
|
||||||
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 16 1 "ATTENZIONE"
|
|
||||||
END
|
|
||||||
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 3 "Il riordino degli archivi puo' richiedere"
|
|
||||||
END
|
|
||||||
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 3 4 "tempo. Siate certi di voler proseguire."
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_OK 10 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -12 -1 ""
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_QUIT 10 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -22 -1 ""
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
|
||||||
ENDMASK
|
|
288
cg/cg4500.cpp
288
cg/cg4500.cpp
@ -1,36 +1,41 @@
|
|||||||
|
#include <recarray.h>
|
||||||
|
#include <relation.h>
|
||||||
#include "cg4501.h"
|
#include "cg4501.h"
|
||||||
#include "cg4500a.h"
|
#include "cg4500a.h"
|
||||||
|
#include "cglib01.h"
|
||||||
|
|
||||||
class TAp_eser : public TSkeleton_application
|
class TAp_eser : public TSkeleton_application
|
||||||
{
|
{
|
||||||
int _anno, _newanno;
|
int _anno, _newanno;
|
||||||
TDate _dataini, _datafin, _datainp, _datafip;
|
TDate _dataini, _datafin, _datainp, _datafip;
|
||||||
TString _conserva;
|
TString _conserva;
|
||||||
|
TEsercizi_contabili * _esc;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool check_esercizio(const TString& cod, TDate s1, TDate f1);
|
bool check_esercizio(const int cod, TDate s1, TDate f1);
|
||||||
static bool mask_dataini (TMask_field&, KEY);
|
static bool mask_dataini (TMask_field&, KEY);
|
||||||
static bool mask_newanno (TMask_field&, KEY);
|
static bool mask_newanno (TMask_field&, KEY);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
|
|
||||||
bool set();
|
bool set();
|
||||||
bool apertura_es();
|
bool apertura_es();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TAp_eser& app() { return (TAp_eser&) main_app(); }
|
||||||
|
|
||||||
bool TAp_eser::mask_newanno (TMask_field& f, KEY k)
|
bool TAp_eser::mask_newanno (TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
int newanno = f.mask().get_int(F_NUOVOANNO);
|
const int newanno = f.mask().get_int(F_NUOVOANNO);
|
||||||
TString16 codtab; codtab.format("%04d", newanno);
|
|
||||||
TTable TabEs("ESC");
|
if (app()._esc->exist(newanno))
|
||||||
TabEs.put ("CODTAB", codtab);
|
return f.warning_box (FR("Il codice %04d e' gia' presente nella tabella degli esercizi!"),
|
||||||
if (TabEs.read() == NOERR)
|
|
||||||
return f.warning_box ("Il codice %04d e' gia' presente nella tabella degli esercizi!",
|
|
||||||
newanno);
|
newanno);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -42,11 +47,9 @@ bool TAp_eser::mask_dataini (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
TDate data(f.mask().get(F_DATAINI));
|
TDate data(f.mask().get(F_DATAINI));
|
||||||
TDate fine(f.mask().get(F_DATAFINC));
|
TDate fine(f.mask().get(F_DATAFINC));
|
||||||
|
|
||||||
if ( data <= fine )
|
if ( data <= fine )
|
||||||
{
|
return f.warning_box (TR("La data di inizio del nuovo esercizio deve essere superiore alla data di fine esercizio precedente"));
|
||||||
f.warning_box ("La data di inizio del nuovo esercizio deve essere superiore alla data di fine esercizio precedente");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -55,140 +58,128 @@ bool TAp_eser::create()
|
|||||||
{
|
{
|
||||||
open_files(LF_TAB, 0);
|
open_files(LF_TAB, 0);
|
||||||
enable_menu_item(M_FILE_NEW, FALSE);
|
enable_menu_item(M_FILE_NEW, FALSE);
|
||||||
return TSkeleton_application::create();
|
_esc = new TEsercizi_contabili;
|
||||||
|
|
||||||
|
return TSkeleton_application::create();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAp_eser::destroy()
|
||||||
|
{
|
||||||
|
delete _esc;
|
||||||
|
|
||||||
|
return TSkeleton_application::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAp_eser::main_loop()
|
void TAp_eser::main_loop()
|
||||||
{
|
{
|
||||||
TTable TabEs ("ESC");
|
int anno = _esc->last();
|
||||||
TMask msk ("cg4500a");
|
|
||||||
|
|
||||||
if (TabEs.last() != NOERR)
|
if (anno > 0)
|
||||||
{
|
{
|
||||||
error_box("Non e' ancora stato aperto alcun esercizio!");
|
TMask msk ("cg4500a");
|
||||||
return;
|
msk.set_handler (F_NUOVOANNO, mask_newanno);
|
||||||
}
|
msk.set_handler (F_DATAINI, mask_dataini);
|
||||||
TabEs.first();
|
TDate inizio = _esc->esercizio(anno).inizio(); //data inizio es. in corso
|
||||||
TRecnotype rn = TabEs.recno();
|
TDate fine = _esc->esercizio(anno).fine(); //data fine es. in corso
|
||||||
int anno = TabEs.get_int ("CODTAB");
|
|
||||||
TDate inizio = TabEs.get_date("D0"); //data inizio es. in corso
|
|
||||||
TDate fine = TabEs.get_date("D1"); //data fine es. in corso
|
|
||||||
|
|
||||||
// determina esercizio con data fine piu' alta
|
msk.set(F_ANNO, anno);
|
||||||
for ( ; !TabEs.eof(); TabEs.next())
|
msk.set(F_DATAINIC, inizio.string());
|
||||||
if (TabEs.get_date("D1") > fine)
|
msk.set(F_DATAFINC, fine.string());
|
||||||
{
|
|
||||||
rn = TabEs.recno();
|
|
||||||
fine = TabEs.get_date("D1");
|
|
||||||
_conserva = TabEs.get("S1");
|
|
||||||
}
|
|
||||||
|
|
||||||
TabEs.readat(rn);
|
anno++;
|
||||||
// rilegge dati
|
inizio.addyear();
|
||||||
anno = TabEs.get_int ("CODTAB");
|
fine.addyear();
|
||||||
inizio = TabEs.get_date("D0"); //data inizio es. in corso
|
|
||||||
fine = TabEs.get_date("D1"); //data fine es. in corso
|
|
||||||
|
|
||||||
msk.set(F_ANNO, anno);
|
msk.set(F_NUOVOANNO, anno);
|
||||||
msk.set(F_DATAINIC, inizio.string());
|
msk.set(F_DATAINI, inizio.string());
|
||||||
msk.set(F_DATAFINC, fine.string());
|
msk.set(F_DATAFIN, fine.string());
|
||||||
|
if (msk.run() == K_ENTER)
|
||||||
|
{
|
||||||
|
_anno = msk.get_int(F_ANNO);
|
||||||
|
_datainp = msk.get(F_DATAINIC);
|
||||||
|
_datafip = msk.get(F_DATAFINC);
|
||||||
|
_newanno = msk.get_int(F_NUOVOANNO); //nuovo anno esercizio
|
||||||
|
_dataini = msk.get(F_DATAINI);
|
||||||
|
_datafin = msk.get(F_DATAFIN);
|
||||||
|
|
||||||
msk.set_handler (F_NUOVOANNO, mask_newanno);
|
apertura_es();
|
||||||
msk.set_handler (F_DATAINI, mask_dataini);
|
}
|
||||||
|
}
|
||||||
if (msk.run() == K_ENTER)
|
else
|
||||||
{
|
error_box(TR("Non e' ancora stato aperto alcun esercizio!"));
|
||||||
_anno = msk.get_int(F_ANNO);
|
|
||||||
_datainp = msk.get(F_DATAINIC);
|
|
||||||
_datafip = msk.get(F_DATAFINC);
|
|
||||||
_newanno = msk.get_int(F_NUOVOANNO); //nuovo anno esercizio
|
|
||||||
_dataini = msk.get(F_DATAINI);
|
|
||||||
_datafin = msk.get(F_DATAFIN);
|
|
||||||
|
|
||||||
apertura_es();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAp_eser::apertura_es()
|
bool TAp_eser::apertura_es()
|
||||||
{
|
{
|
||||||
TTable TabReg ("REG");
|
TString8 anno;
|
||||||
TTable TabEs ("ESC");
|
TString8 annonew;
|
||||||
TString anno (4);
|
|
||||||
TString annonew(4);
|
|
||||||
TDate data;
|
TDate data;
|
||||||
|
TRelation reg("REG");
|
||||||
|
TRectype & tabreg = reg.curr();
|
||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
|
|
||||||
//viene aggiornata la tabella dei registri. Se esisteva gia' un record relativo al nuovo esercizio, viene cancellato.
|
//viene aggiornata la tabella dei registri. Se esisteva gia' un record relativo al nuovo esercizio, viene cancellato.
|
||||||
//In ogni caso ne viene creato uno nuovo relativo al nuovo esercizio.
|
//In ogni caso ne viene creato uno nuovo relativo al nuovo esercizio.
|
||||||
TabReg.zero();
|
anno.format ("%04d", _datafip.year());
|
||||||
annonew.format("%04d", _datafin.year());
|
annonew.format("%04d", _datafin.year());
|
||||||
TabReg.put ("CODTAB", annonew);
|
|
||||||
|
|
||||||
TRectype r (TabReg.curr());
|
tabreg.put ("CODTAB", annonew);
|
||||||
|
|
||||||
TabReg.read(_isgteq);
|
TCursor cur(®, "", 1, &tabreg, &tabreg);
|
||||||
|
TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (; !TabReg.eof(); TabReg.next())
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
|
if (tabreg.get_int("I0") == 5)
|
||||||
|
reg.remove();
|
||||||
|
|
||||||
|
cur.freeze(FALSE);
|
||||||
|
tabreg.zero();
|
||||||
|
tabreg.put ("CODTAB", anno);
|
||||||
|
cur.setregion(tabreg, tabreg);
|
||||||
|
|
||||||
|
items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
if (TabReg.curr() != r) break;
|
if (tabreg.get_int("I0") == 5)
|
||||||
|
|
||||||
int tiporeg = TabReg.get_int("I0");
|
|
||||||
if (tiporeg == 5)
|
|
||||||
TabReg.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
TabReg.zero();
|
|
||||||
TRectype nuovo (TabReg.curr());
|
|
||||||
anno.format ("%04d", _datafip.year());
|
|
||||||
TabReg.put ("CODTAB", anno);
|
|
||||||
|
|
||||||
TRectype rec (TabReg.curr());
|
|
||||||
|
|
||||||
TabReg.read(_isgteq);
|
|
||||||
|
|
||||||
for (; !TabReg.eof(); TabReg.next())
|
|
||||||
{
|
|
||||||
if (TabReg.curr() != rec) break;
|
|
||||||
|
|
||||||
int tiporeg = TabReg.get_int("I0");
|
|
||||||
TString cod_reg = TabReg.get("CODTAB");
|
|
||||||
cod_reg = cod_reg.mid(4,3);
|
|
||||||
if (tiporeg == 5)
|
|
||||||
{
|
{
|
||||||
ok = TRUE;
|
TString16 cod(tabreg.get("CODTAB"));
|
||||||
nuovo = TabReg.curr();
|
|
||||||
TString16 cod;
|
|
||||||
annonew.format ("%04d", _datafin.year());
|
|
||||||
cod << annonew << cod_reg;
|
|
||||||
nuovo.put("CODTAB", cod);
|
|
||||||
nuovo.put("D0", data);
|
|
||||||
nuovo.put("D2", data);
|
|
||||||
nuovo.put("D3", data);
|
|
||||||
nuovo.put("I6", 0L);
|
|
||||||
nuovo.put("I1", 0L);
|
|
||||||
nuovo.put("R1", real(0.0));
|
|
||||||
nuovo.put("R2", real(0.0));
|
|
||||||
|
|
||||||
TabReg.write(nuovo);
|
ok = TRUE;
|
||||||
|
annonew.format("%04d", _datafin.year());
|
||||||
|
cod.overwrite(annonew);
|
||||||
|
tabreg.put("CODTAB", cod);
|
||||||
|
tabreg.zero("I1");
|
||||||
|
tabreg.zero("I6");
|
||||||
|
tabreg.zero("S1");
|
||||||
|
tabreg.put("D0", data);
|
||||||
|
tabreg.put("D2", data);
|
||||||
|
tabreg.put("D3", data);
|
||||||
|
tabreg.zero("R1");
|
||||||
|
tabreg.zero("R2");
|
||||||
|
|
||||||
|
reg.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// se tutto ok viene aggiornata la tabella degli esercizi
|
// se tutto ok viene aggiornata la tabella degli esercizi
|
||||||
annonew.format("%04d", _newanno);
|
if (check_esercizio(_newanno, _dataini, _datafin))
|
||||||
if (check_esercizio(annonew, _dataini, _datafin))
|
|
||||||
{
|
{
|
||||||
TabEs.zero();
|
TTable tabesc("ESC");
|
||||||
annonew.format ("%04d", _newanno);
|
tabesc.zero();
|
||||||
TabEs.put ("CODTAB", annonew);
|
annonew.format("%04d", _newanno);
|
||||||
TabEs.put ("D0", _dataini);
|
tabesc.put ("CODTAB", annonew);
|
||||||
TabEs.put ("D1", _datafin);
|
tabesc.put ("D0", _dataini);
|
||||||
TabEs.put ("S1", _conserva);
|
tabesc.put ("D1", _datafin);
|
||||||
TabEs.write();
|
tabesc.put ("S1", _conserva);
|
||||||
message_box("Apertura nuovo esercizio completata");
|
tabesc.write();
|
||||||
|
message_box(TR("Apertura nuovo esercizio completata"));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAp_eser::check_esercizio(const TString& cod, TDate s1, TDate f1)
|
bool TAp_eser::check_esercizio(const int cod_es, TDate s1, TDate f1)
|
||||||
{
|
{
|
||||||
// -----------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------
|
||||||
// chiamata prima di registrare. Controlla:
|
// chiamata prima di registrare. Controlla:
|
||||||
@ -200,39 +191,40 @@ bool TAp_eser::check_esercizio(const TString& cod, TDate s1, TDate f1)
|
|||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
byte err = 0x00; bool ret = TRUE;
|
byte err = 0x00; bool ret = TRUE;
|
||||||
TTable esc("ESC");
|
|
||||||
|
|
||||||
bool basta1 = FALSE, basta2 = FALSE;
|
bool basta1 = FALSE, basta2 = FALSE;
|
||||||
|
|
||||||
for (esc.first(); !esc.eof(); esc.next())
|
for (int cod = _esc->first(); cod > 0; cod = _esc->next(cod))
|
||||||
{
|
{
|
||||||
if (esc.get("CODTAB") == cod)
|
if (cod != cod_es)
|
||||||
continue;
|
|
||||||
|
|
||||||
TDate s2 = esc.get_date("D0");
|
|
||||||
TDate f2 = esc.get_date("D1");
|
|
||||||
TDate s1d = s1; --s1d;
|
|
||||||
TDate s2d = s2; --s2d;
|
|
||||||
|
|
||||||
// check sovrapposizione
|
|
||||||
if (s1 <= f2 && s2 <= f1)
|
|
||||||
err |= 0x01;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (!basta1 && f1 < s2 && f1 != s2d)
|
const TEsercizio & e = (*_esc)[cod];
|
||||||
err |= 0x02;
|
const TDate s2 = e.inizio();
|
||||||
if (f1 < s2 && f1 == s2d)
|
const TDate f2 = e.fine();
|
||||||
{
|
|
||||||
err &= ~0x02;
|
// check sovrapposizione
|
||||||
basta1 = TRUE;
|
if (s1 <= f2 && s2 <= f1)
|
||||||
}
|
err |= 0x01;
|
||||||
if (!basta2 && s1 > f2 && f2 != s1d)
|
else
|
||||||
err |= 0x04;
|
{
|
||||||
if (s1 > f2 && f2 == s1d)
|
const TDate s1d(s1 - 1L);
|
||||||
{
|
const TDate s2d(s2 - 1L);
|
||||||
err &= ~0x04;
|
|
||||||
basta2 = TRUE;
|
if (!basta1 && f1 < s2 && f1 != s2d)
|
||||||
}
|
err |= 0x02;
|
||||||
|
if (f1 < s2 && f1 == s2d)
|
||||||
|
{
|
||||||
|
err &= ~0x02;
|
||||||
|
basta1 = TRUE;
|
||||||
|
}
|
||||||
|
if (!basta2 && s1 > f2 && f2 != s1d)
|
||||||
|
err |= 0x04;
|
||||||
|
if (s1 > f2 && f2 == s1d)
|
||||||
|
{
|
||||||
|
err &= ~0x04;
|
||||||
|
basta2 = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,18 +232,18 @@ bool TAp_eser::check_esercizio(const TString& cod, TDate s1, TDate f1)
|
|||||||
{
|
{
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
TString errstr(120);
|
TString errstr(120);
|
||||||
errstr << "Date esercizio errate: \n";
|
errstr << TR("Date esercizio errate: \n");
|
||||||
// build error string
|
// build error string
|
||||||
if (err & 0x01)
|
if (err & 0x01)
|
||||||
errstr << "\n - l'esercizio si sovrappone ad altro gia' esistente";
|
errstr << TR("\n - l'esercizio si sovrappone ad altro gia' esistente");
|
||||||
if (err & 0x02)
|
if (err & 0x02)
|
||||||
errstr << "\n - l'esercizio non e' contiguo ad esercizi successivi";
|
errstr << TR("\n - l'esercizio non e' contiguo ad esercizi successivi");
|
||||||
if (err & 0x04)
|
if (err & 0x04)
|
||||||
errstr << "\n - l'esercizio non e' contiguo ad esercizi precedenti";
|
errstr << TR("\n - l'esercizio non e' contiguo ad esercizi precedenti");
|
||||||
|
|
||||||
if (!(err & 0x01))
|
if (!(err & 0x01))
|
||||||
{
|
{
|
||||||
errstr << "\nSi desidera registrare ugualmente?";
|
errstr << TR("\nSi desidera registrare ugualmente?");
|
||||||
ret = yesno_box(errstr);
|
ret = yesno_box(errstr);
|
||||||
}
|
}
|
||||||
else error_box(errstr);
|
else error_box(errstr);
|
||||||
@ -266,17 +258,17 @@ int cg4500 (int argc, char* argv[])
|
|||||||
case 'C':
|
case 'C':
|
||||||
{
|
{
|
||||||
TAp_eser a;
|
TAp_eser a;
|
||||||
a.run(argc, argv, "Apertura nuovo esercizio");
|
a.run(argc, argv, TR("Apertura nuovo esercizio"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
{
|
{
|
||||||
TAp_iva a;
|
TAp_iva a;
|
||||||
a.run(argc, argv, "Apertura nuovo esercizio IVA");
|
a.run(argc, argv, TR("Apertura nuovo esercizio IVA"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error_box("Uso: cg4 -4 [C,I]");
|
error_box("Uso: cg4 -4 [C,I]");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
265
cg/cg4501.cpp
265
cg/cg4501.cpp
@ -1,222 +1,163 @@
|
|||||||
|
#include <recarray.h>
|
||||||
|
#include <relation.h>
|
||||||
|
|
||||||
#include "cg4501.h"
|
#include "cg4501.h"
|
||||||
#include "cg4500b.h"
|
#include "cg4500b.h"
|
||||||
|
|
||||||
#include "nditte.h"
|
#include "nditte.h"
|
||||||
|
|
||||||
bool TAp_iva::mask_annoiva (TMask_field& f, KEY k)
|
bool TAp_iva::mask_annoiva (TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if ( (k == K_ENTER) && f.to_check(k) )
|
if ( (k == K_ENTER) && f.to_check(k) )
|
||||||
//if ( (k == K_TAB) && f.mask().is_running() )
|
|
||||||
{
|
{
|
||||||
int annoiva = f.mask().get_int(F_ANNOIVA);
|
int annoiva = f.mask().get_int(F_ANNOIVA);
|
||||||
TConfig conf(CONFIG_DITTA);
|
TConfig conf(CONFIG_DITTA);
|
||||||
int annoivap = conf.get_int("AnLiIv");
|
int annoivap = conf.get_int("AnLiIv");
|
||||||
if (annoivap > 0 && annoiva != annoivap + 1)
|
if (annoivap > 0 && annoiva != annoivap + 1)
|
||||||
return f.error_box("Il nuovo anno esercizio IVA deve essere %d", (annoivap+1));
|
return f.error_box(FR("Il nuovo anno esercizio IVA deve essere %d"), (annoivap+1));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAp_iva::create()
|
bool TAp_iva::create()
|
||||||
{
|
{
|
||||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
open_files(LF_TAB, LF_TABCOM, LF_NDITTE, 0);
|
||||||
_reg = new TTable("REG");
|
|
||||||
_lia = new TTable("%LIA");
|
|
||||||
_lbu = new TTable("%LBU");
|
|
||||||
|
|
||||||
enable_menu_item(M_FILE_NEW, FALSE);
|
enable_menu_item(M_FILE_NEW, FALSE);
|
||||||
|
|
||||||
return TSkeleton_application::create();
|
return TSkeleton_application::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAp_iva::destroy()
|
|
||||||
{
|
|
||||||
delete _nditte;
|
|
||||||
delete _reg;
|
|
||||||
delete _lia;
|
|
||||||
delete _lbu;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TAp_iva::apertura_iva()
|
bool TAp_iva::apertura_iva()
|
||||||
{
|
{
|
||||||
TTable TabReg ("REG");
|
TString16 annoiva;
|
||||||
TTable TabLia ("%LIA");
|
TString16 codlia;
|
||||||
TTable TabLbu ("%LBU");
|
|
||||||
TLocalisamfile nditte (LF_NDITTE);
|
|
||||||
TString annoiva (4), codlia(10);
|
|
||||||
TDate data;
|
TDate data;
|
||||||
bool ok = FALSE;
|
|
||||||
|
|
||||||
int annop = _annop;
|
int annop = _annop;
|
||||||
annoiva.format("%04d", _annoiva);
|
annoiva.format("%04d", _annoiva);
|
||||||
|
|
||||||
//viene aggiornata la tabella LIA (liquidazione iva annuale)
|
//viene aggiornata la tabella LIA (liquidazione iva annuale)
|
||||||
TabLia.zero();
|
TTable tablia ("%LIA");
|
||||||
|
|
||||||
codlia.format("%05ld%04d", get_firm(), _annoiva);
|
codlia.format("%05ld%04d", get_firm(), _annoiva);
|
||||||
TabLia.put ("CODTAB", codlia);
|
tablia.put ("CODTAB", codlia);
|
||||||
if (TabLia.read() == NOERR)
|
if (tablia.read() == NOERR)
|
||||||
TabLia.remove();
|
tablia.remove();
|
||||||
|
|
||||||
TabLia.zero();
|
tablia.zero();
|
||||||
TRectype newrec (TabLia.curr());
|
|
||||||
codlia.format("%05ld%04d", get_firm(), annop);
|
codlia.format("%05ld%04d", get_firm(), annop);
|
||||||
TabLia.put ("CODTAB", codlia);
|
tablia.put ("CODTAB", codlia);
|
||||||
|
|
||||||
if (TabLia.read() == NOERR)
|
if (tablia.read() != NOERR)
|
||||||
|
return error_box(TR("Non esiste il record relativo all'anno iva precedente sulla tabella liquidazione annuale iva"));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ok = TRUE;
|
|
||||||
newrec = TabLia.curr();
|
|
||||||
codlia.format("%05ld%04d", get_firm(), _annoiva);
|
codlia.format("%05ld%04d", get_firm(), _annoiva);
|
||||||
newrec.put("CODTAB", codlia);
|
tablia.put("CODTAB", codlia);
|
||||||
newrec.put("S7", _frequenza);
|
tablia.put("S7", _frequenza);
|
||||||
newrec.put("B2", _is_minagr);
|
tablia.put("B2", _is_minagr);
|
||||||
newrec.zero("R0");
|
tablia.zero("R0");
|
||||||
TabLia.write(newrec);
|
tablia.write();
|
||||||
}
|
|
||||||
if (!ok)
|
|
||||||
{
|
|
||||||
error_box("Non esiste il record relativo all'anno iva precedente sulla tabella liquidazione annuale iva");
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//viene aggiornata la tabella del libro unico.
|
//viene aggiornata la tabella del libro unico.
|
||||||
TabLbu.zero();
|
TRelation lbu("%LBU");
|
||||||
TabLbu.put ("CODTAB", annoiva);
|
TRectype & tablbu = lbu.curr();
|
||||||
|
|
||||||
TRectype r (TabLbu.curr());
|
tablbu.put ("CODTAB", annoiva);
|
||||||
|
|
||||||
TabLbu.read(_isgteq);
|
TCursor cur(&lbu, "", 1, &tablbu, &tablbu);
|
||||||
|
TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (; !TabLbu.eof(); TabLbu.next())
|
cur.freeze();
|
||||||
|
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
|
lbu.remove();
|
||||||
|
|
||||||
|
cur.freeze(FALSE);
|
||||||
|
tablbu.zero();
|
||||||
|
tablbu.put ("CODTAB", _annop);
|
||||||
|
cur.setregion(tablbu, tablbu);
|
||||||
|
items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
if (TabLbu.curr() != r) break;
|
TString16 cod(tablbu.get("CODTAB"));
|
||||||
|
|
||||||
TabLbu.remove();
|
cod.overwrite(annoiva);
|
||||||
|
tablbu.put("CODTAB", cod);
|
||||||
|
tablbu.zero("I0");
|
||||||
|
lbu.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = FALSE;
|
|
||||||
TabLbu.zero();
|
|
||||||
TRectype nrec (TabLbu.curr());
|
|
||||||
TabLbu.put ("CODTAB", _annop);
|
|
||||||
|
|
||||||
TRectype rec (TabLbu.curr());
|
|
||||||
|
|
||||||
TabLbu.read(_isgteq);
|
|
||||||
|
|
||||||
for (; !TabLbu.eof(); TabLbu.next())
|
|
||||||
{
|
|
||||||
if (TabLbu.curr() != rec) break;
|
|
||||||
|
|
||||||
TRecnotype nr = TabLbu.recno();
|
|
||||||
TString cod_lib = TabLbu.get("CODTAB");
|
|
||||||
cod_lib = cod_lib.mid(4,3);
|
|
||||||
ok = TRUE;
|
|
||||||
nrec = TabLbu.curr();
|
|
||||||
TString16 cod;
|
|
||||||
cod << _annoiva << cod_lib;
|
|
||||||
nrec.put("CODTAB", cod);
|
|
||||||
nrec.put("I0", 0L);
|
|
||||||
|
|
||||||
TabLbu.write(nrec);
|
|
||||||
TabLbu.readat(nr);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if (!ok)
|
|
||||||
{
|
|
||||||
error_box("Non esistono i registri del libro unico relativi all'anno iva precedente");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//viene aggiornata la tabella dei registri.
|
//viene aggiornata la tabella dei registri.
|
||||||
TabReg.zero();
|
TRelation reg("REG");
|
||||||
TabReg.put ("CODTAB", annoiva);
|
TRectype & tabreg = reg.curr();
|
||||||
|
|
||||||
const TRectype rr (TabReg.curr());
|
tabreg.put ("CODTAB", annoiva);
|
||||||
|
|
||||||
TabReg.read(_isgteq);
|
TCursor cur_reg(®, "", 1, &tabreg, &tabreg);
|
||||||
|
|
||||||
for (; !TabReg.eof(); TabReg.next())
|
items = cur_reg.items();
|
||||||
|
cur_reg.freeze();
|
||||||
|
for (cur_reg = 0L; cur_reg.pos() < items; ++cur_reg)
|
||||||
{
|
{
|
||||||
if (TabReg.curr() != rr) break;
|
const int tiporeg = tabreg.get_int("I0");
|
||||||
|
if ((tiporeg == 1) || (tiporeg == 2) || (tiporeg == 3) || (tiporeg==9))
|
||||||
int tiporeg = TabReg.get_int("I0");
|
reg.remove();
|
||||||
if ( (tiporeg == 1)||(tiporeg == 2)||(tiporeg == 3)||(tiporeg==9))
|
|
||||||
TabReg.remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = FALSE;
|
cur_reg.freeze(FALSE);
|
||||||
TabReg.zero();
|
tabreg.zero();
|
||||||
TRectype nuovo (TabReg.curr());
|
tabreg.put ("CODTAB", _annop);
|
||||||
TabReg.put ("CODTAB", _annop);
|
cur_reg.setregion(tabreg, tabreg);
|
||||||
|
items = cur_reg.items();
|
||||||
const TRectype recc (TabReg.curr());
|
cur_reg.freeze();
|
||||||
|
for (cur_reg = 0L; cur_reg.pos() < items; ++cur_reg)
|
||||||
TabReg.read(_isgteq);
|
|
||||||
|
|
||||||
for (; !TabReg.eof(); TabReg.next())
|
|
||||||
{
|
{
|
||||||
if (TabReg.curr() != recc) break;
|
int tiporeg = tabreg.get_int("I0");
|
||||||
|
|
||||||
TRecnotype nr = TabReg.recno();
|
|
||||||
int tiporeg = TabReg.get_int("I0");
|
|
||||||
TString cod_reg = TabReg.get("CODTAB");
|
|
||||||
//TDate data_vid = TabReg.get_date("D0");
|
|
||||||
//data_vid.addyear();
|
|
||||||
cod_reg = cod_reg.mid(4,3);
|
|
||||||
if ( (tiporeg == 1)||(tiporeg == 2)||(tiporeg==3)||(tiporeg==9))
|
if ( (tiporeg == 1)||(tiporeg == 2)||(tiporeg==3)||(tiporeg==9))
|
||||||
{
|
{
|
||||||
ok = TRUE;
|
TString16 cod = tabreg.get("CODTAB");
|
||||||
nuovo = TabReg.curr();
|
|
||||||
TString16 cod;
|
|
||||||
cod << annoiva << cod_reg;
|
|
||||||
nuovo.put("CODTAB", cod);
|
|
||||||
nuovo.put("I1", 0L);
|
|
||||||
nuovo.put("I2", 0L);
|
|
||||||
nuovo.put("I4", 0L);
|
|
||||||
nuovo.put("I5", 0L);
|
|
||||||
nuovo.put("I6", 0L);
|
|
||||||
nuovo.put("S1", "");
|
|
||||||
//nuovo.put("D0", data_vid);
|
|
||||||
nuovo.put("D0", data);
|
|
||||||
nuovo.put("D2", data);
|
|
||||||
nuovo.put("D3", data);
|
|
||||||
nuovo.put("R1", real(0.0));
|
|
||||||
nuovo.put("R2", real(0.0));
|
|
||||||
|
|
||||||
TabReg.write(nuovo);
|
cod.overwrite(annoiva);
|
||||||
TabReg.readat(nr);
|
tabreg.put("CODTAB", cod);
|
||||||
|
tabreg.zero("I1");
|
||||||
|
tabreg.zero("I2");
|
||||||
|
tabreg.zero("I4");
|
||||||
|
tabreg.zero("I5");
|
||||||
|
tabreg.zero("I6");
|
||||||
|
tabreg.zero("S1");
|
||||||
|
tabreg.put("D0", data);
|
||||||
|
tabreg.put("D2", data);
|
||||||
|
tabreg.put("D3", data);
|
||||||
|
tabreg.zero("R1");
|
||||||
|
tabreg.zero("R2");
|
||||||
|
|
||||||
|
reg.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (!ok)
|
|
||||||
{
|
|
||||||
error_box("Non esistono i registri iva relativi all'anno iva precedente");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//viene aggiornato l'anno iva sui parametri ditta
|
//viene aggiornato l'anno iva sui parametri ditta
|
||||||
TConfig conf(CONFIG_DITTA);
|
TConfig conf(CONFIG_DITTA);
|
||||||
conf.set("AnLiIv", annoiva);
|
conf.set("AnLiIv", annoiva);
|
||||||
|
|
||||||
//sull'anagrafica ditte viene aggiornata la frequenza versamento
|
//sull'anagrafica ditte viene aggiornata la frequenza versamento
|
||||||
nditte.zero();
|
TLocalisamfile nditte (LF_NDITTE);
|
||||||
|
|
||||||
nditte.put("CODDITTA", _ditta);
|
nditte.put("CODDITTA", _ditta);
|
||||||
if (nditte.read() == NOERR)
|
if (nditte.read(_isequal, _lock) == NOERR)
|
||||||
{
|
{
|
||||||
nditte.put(NDT_FREQVIVA, _frequenza);
|
nditte.put(NDT_FREQVIVA, _frequenza);
|
||||||
nditte.rewrite();
|
nditte.rewrite();
|
||||||
}
|
}
|
||||||
message_box("Apertura nuovo esercizio IVA completata");
|
message_box(TR("Apertura nuovo esercizio IVA completata"));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAp_iva::main_loop()
|
void TAp_iva::main_loop()
|
||||||
{
|
{
|
||||||
TTable TabLia ("%LIA");
|
|
||||||
TLocalisamfile nditte (LF_NDITTE);
|
|
||||||
TMask msk ("cg4500b");
|
TMask msk ("cg4500b");
|
||||||
|
|
||||||
TConfig conf(CONFIG_DITTA);
|
TConfig conf(CONFIG_DITTA);
|
||||||
@ -227,31 +168,37 @@ void TAp_iva::main_loop()
|
|||||||
int anno = aivap+1;
|
int anno = aivap+1;
|
||||||
_is_minagr = FALSE;
|
_is_minagr = FALSE;
|
||||||
|
|
||||||
TabLia.zero();
|
TTable tablia ("%LIA");
|
||||||
TString16 chiave; chiave.format("%05ld%04d", get_firm(), anno);
|
TString16 chiave;
|
||||||
TabLia.put("CODTAB",chiave);
|
|
||||||
if (TabLia.read() == NOERR)
|
tablia.zero();
|
||||||
|
chiave.format("%05ld%04d", get_firm(), anno);
|
||||||
|
tablia.put("CODTAB",chiave);
|
||||||
|
if (tablia.read() == NOERR)
|
||||||
{
|
{
|
||||||
msk.set(F_FREQUENZA, TabLia.get("S7"));
|
msk.set(F_FREQUENZA, tablia.get("S7"));
|
||||||
_is_minagr = TabLia.get_bool("B2");
|
_is_minagr = tablia.get_bool("B2");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TabLia.zero();
|
tablia.zero();
|
||||||
chiave = "";
|
chiave = "";
|
||||||
chiave.format("%05ld%04d", get_firm(), aivap);
|
chiave.format("%05ld%04d", get_firm(), aivap);
|
||||||
TabLia.put("CODTAB", chiave);
|
tablia.put("CODTAB", chiave);
|
||||||
if (TabLia.read() == NOERR)
|
if (tablia.read() == NOERR)
|
||||||
{
|
{
|
||||||
msk.set(F_FREQUENZA, TabLia.get("S7"));
|
msk.set(F_FREQUENZA, tablia.get("S7"));
|
||||||
_is_minagr = TabLia.get_bool("B2");
|
_is_minagr = tablia.get_bool("B2");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nditte.zero();
|
TString16 key;
|
||||||
nditte.put("CODDITTA", get_firm());
|
|
||||||
if (nditte.read() == NOERR)
|
key.format("%ld", get_firm());
|
||||||
msk.set(F_FREQUENZA, nditte.get(NDT_FREQVIVA));
|
|
||||||
|
const TString & freq_iva = cache().get(LF_NDITTE, key, NDT_FREQVIVA);
|
||||||
|
|
||||||
|
msk.set(F_FREQUENZA, freq_iva);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
class TAp_iva : public TSkeleton_application
|
class TAp_iva : public TSkeleton_application
|
||||||
{
|
{
|
||||||
TTable* _reg, * _lia, * _lbu;
|
// TTable* _reg, * _lia, * _lbu;
|
||||||
TLocalisamfile* _nditte;
|
|
||||||
int _annoiva;
|
int _annoiva;
|
||||||
int _annop;
|
int _annop;
|
||||||
long _ditta;
|
long _ditta;
|
||||||
@ -25,7 +24,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
virtual bool destroy();
|
virtual bool destroy() { return TRUE;}
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
|
|
||||||
bool setta();
|
bool setta();
|
||||||
|
726
cg/cg4600.cpp
726
cg/cg4600.cpp
File diff suppressed because it is too large
Load Diff
@ -86,12 +86,9 @@ bool GesAcc_app::msk_credito(TMask_field& f, KEY k)
|
|||||||
real credito (f.get());
|
real credito (f.get());
|
||||||
real acconto (f.mask().get(F_ACCONTO));
|
real acconto (f.mask().get(F_ACCONTO));
|
||||||
if (credito.sign() < 0)
|
if (credito.sign() < 0)
|
||||||
return f.error_box("Introdurre un valore non negativo");
|
return f.error_box(TR("Introdurre un valore non negativo"));
|
||||||
if (credito > acconto)
|
if (credito > acconto)
|
||||||
return f.error_box("Il credito non puo' essere superiore all'acconto");
|
return f.error_box(TR("Il credito non puo' essere superiore all'acconto"));
|
||||||
if (acconto.is_zero())
|
|
||||||
if (!credito.is_zero())
|
|
||||||
return f.error_box("Non e' possibile indicare il credito se l'acconto e' nullo");
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -114,16 +111,16 @@ bool GesAcc_app::msk_acconto(TMask_field& f, KEY k)
|
|||||||
const TMask& m = f.mask();
|
const TMask& m = f.mask();
|
||||||
TInteressi_IVA_table ver;
|
TInteressi_IVA_table ver;
|
||||||
if (ver.read(m.get_int(F_ANNO),12)!=NOERR)
|
if (ver.read(m.get_int(F_ANNO),12)!=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());
|
||||||
const TCurrency acconto_minimo = ver.get(I_ACCONTOIVA);
|
const TCurrency acconto_minimo = ver.get(I_ACCONTOIVA);
|
||||||
|
|
||||||
const TCurrency acconto = real(f.get());
|
const TCurrency acconto = real(f.get());
|
||||||
if (!acconto.is_zero())
|
if (!acconto.is_zero())
|
||||||
{
|
{
|
||||||
if (acconto.sign() < 0)
|
if (acconto.sign() < 0)
|
||||||
return f.error_box("Introdurre un valore non negativo");
|
return f.error_box(TR("Introdurre un valore non negativo"));
|
||||||
if (acconto < acconto_minimo)
|
if (acconto < acconto_minimo)
|
||||||
return f.error_box("L'importo dell'acconto inserito deve essere superiore a %s", acconto_minimo.string(TRUE));
|
return f.error_box(FR("L'importo dell'acconto inserito deve essere superiore a %s"), acconto_minimo.string(TRUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -137,6 +134,6 @@ TMask* GesAcc_app::get_mask(int /* mode */)
|
|||||||
int cg4700(int argc, char* argv[])
|
int cg4700(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
GesAcc_app app;
|
GesAcc_app app;
|
||||||
app.run(argc, argv, "Gestione acconti");
|
app.run(argc, argv, TR("Gestione acconti"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
223
cg/cg4800.cpp
223
cg/cg4800.cpp
@ -3,6 +3,7 @@
|
|||||||
#include <currency.h>
|
#include <currency.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
#include <recarray.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -25,11 +26,6 @@ class VersAcc_app : public TApplication
|
|||||||
TBit_array _selected;
|
TBit_array _selected;
|
||||||
|
|
||||||
TInteressi_IVA_table* _ver;
|
TInteressi_IVA_table* _ver;
|
||||||
TTable* _lim;
|
|
||||||
TTable* _lia;
|
|
||||||
TTable* _del;
|
|
||||||
TTable* _ban;
|
|
||||||
TTable* _ucc;
|
|
||||||
TProgind* _prind;
|
TProgind* _prind;
|
||||||
|
|
||||||
int _year;
|
int _year;
|
||||||
@ -57,12 +53,12 @@ public:
|
|||||||
void lettura_delega();
|
void lettura_delega();
|
||||||
void lettura_anagrafica(bool*);
|
void lettura_anagrafica(bool*);
|
||||||
void crea_riga_stampa(bool);
|
void crea_riga_stampa(bool);
|
||||||
void aggiorna_delega();
|
void aggiorna_delega(TTable & del);
|
||||||
void crea_delega();
|
void crea_delega(TTable & del);
|
||||||
void vers_acc();
|
void vers_acc();
|
||||||
|
|
||||||
bool look_lia();
|
bool look_lia();
|
||||||
bool video_conferma();
|
bool video_conferma(TTable & del);
|
||||||
bool check_acc();
|
bool check_acc();
|
||||||
|
|
||||||
VersAcc_app() : _ditte(NULL), _selected(10000), _nomiditte(100), _desc(100) {}
|
VersAcc_app() : _ditte(NULL), _selected(10000), _nomiditte(100), _desc(100) {}
|
||||||
@ -70,43 +66,32 @@ public:
|
|||||||
|
|
||||||
bool VersAcc_app::look_lia()
|
bool VersAcc_app::look_lia()
|
||||||
{
|
{
|
||||||
TTable lia("%LIA");
|
TString16 y;
|
||||||
|
|
||||||
TString16 y; y.format("%05ld%04d", _nditte->lfile().get_long("CODDITTA"), _year);
|
y.format("%05ld%04d", _nditte->lfile().get_long("CODDITTA"), _year);
|
||||||
|
|
||||||
|
const TRectype & lia = cache().get("%LIA", y);
|
||||||
|
|
||||||
|
_acconto = lia.get_real("R4");
|
||||||
|
_credito = lia.get_real("R6");
|
||||||
|
|
||||||
|
return !lia.empty();
|
||||||
|
|
||||||
lia.zero();
|
|
||||||
lia.put("CODTAB", y);
|
|
||||||
lia.read();
|
|
||||||
const bool ok = lia.good();
|
|
||||||
if (ok)
|
|
||||||
{
|
|
||||||
_acconto = lia.get_real("R4");
|
|
||||||
_credito = lia.get_real("R6");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_acconto = ZERO;
|
|
||||||
_credito = ZERO;
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VersAcc_app::create()
|
bool VersAcc_app::create()
|
||||||
{
|
{
|
||||||
TApplication::create();
|
TApplication::create();
|
||||||
|
|
||||||
_nditte = new TRelation(LF_NDITTE);
|
open_files(LF_TABCOM, LF_TAB, LF_NDITTE, LF_ANAG, LF_COMUNI, 0);
|
||||||
|
|
||||||
|
_nditte = new TRelation(LF_NDITTE);
|
||||||
_nditte->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
|
_nditte->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
|
||||||
_nditte->add(LF_COMUNI, "COM=COMRF(COMRES)", 1, LF_ANAG);
|
_nditte->add(LF_COMUNI, "COM=COMRF(COMRES)", 1, LF_ANAG);
|
||||||
|
|
||||||
_ditte = new TArray_sheet(-1, -1, -4, -4, "Selezione Ditte",
|
_ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"),
|
||||||
"@1|Cod.@5R|Ragione Sociale@50|Vers.");
|
HR("@1|Cod.@5R|Ragione Sociale@50|Vers."));
|
||||||
_ver = new TInteressi_IVA_table();
|
_ver = new TInteressi_IVA_table();
|
||||||
_del = new TTable("%DEL");
|
|
||||||
_lia = new TTable("%LIA");
|
|
||||||
_ban = new TTable("%BAN");
|
|
||||||
_ucc = new TTable("%UCC");
|
|
||||||
_lim = new TTable("LIM");
|
|
||||||
|
|
||||||
TConfig c (CONFIG_STUDIO, "cg");
|
TConfig c (CONFIG_STUDIO, "cg");
|
||||||
_abips = c.get("CodABI");
|
_abips = c.get("CodABI");
|
||||||
@ -128,11 +113,6 @@ bool VersAcc_app::create()
|
|||||||
bool VersAcc_app::destroy()
|
bool VersAcc_app::destroy()
|
||||||
{
|
{
|
||||||
delete _ver;
|
delete _ver;
|
||||||
delete _lim;
|
|
||||||
delete _lia;
|
|
||||||
delete _del;
|
|
||||||
delete _ban;
|
|
||||||
delete _ucc;
|
|
||||||
delete _ditte;
|
delete _ditte;
|
||||||
delete _nditte;
|
delete _nditte;
|
||||||
|
|
||||||
@ -174,33 +154,31 @@ void VersAcc_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();
|
TCursor cur(_nditte, "", 1);
|
||||||
TString fr(2);
|
TRectype & dt = _nditte->curr();
|
||||||
TTable lia("%LIA");
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (dt.first(); !dt.eof(); dt.next())
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
// check no archivi
|
// check no archivi
|
||||||
fr = "??";
|
if (prefix().exist(dt.get_long("CODDITTA")))
|
||||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
|
||||||
|
|
||||||
if (good)
|
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
lia.put("CODTAB", format("%05ld%d",dt.get_long("CODDITTA"),_year));
|
TString key;
|
||||||
if (lia.read() != NOERR) good = FALSE;
|
TToken_string d;
|
||||||
else fr = lia.get("S7");
|
|
||||||
|
// add record
|
||||||
|
d.add(dt.get_long("CODDITTA"));
|
||||||
|
d.add(dt.get("RAGSOC"));
|
||||||
|
|
||||||
|
key.format("%05ld%d", dt.get_long("CODDITTA"), _year);
|
||||||
|
|
||||||
|
const TRectype & lia = cache().get("%LIA", key);
|
||||||
|
|
||||||
|
d.add(lia.empty() ? "??" : lia.get("S7"));
|
||||||
|
_nomiditte.add(d);
|
||||||
}
|
}
|
||||||
else continue;
|
|
||||||
|
|
||||||
TToken_string* d = new TToken_string(64);
|
|
||||||
|
|
||||||
// add record
|
|
||||||
d->add(dt.get_long("CODDITTA"));
|
|
||||||
d->add(dt.get("RAGSOC"));
|
|
||||||
d->add(fr);
|
|
||||||
|
|
||||||
_nomiditte.add(d);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +195,7 @@ bool VersAcc_app::menu(MENU_TAG)
|
|||||||
print();
|
print();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else warning_box("Nessuna ditta selezionata!");
|
else warning_box(TR("Nessuna ditta selezionata!"));
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -272,13 +250,13 @@ void VersAcc_app::vers_acc()
|
|||||||
_da_stampare = _print = FALSE;
|
_da_stampare = _print = FALSE;
|
||||||
|
|
||||||
_prind = new TProgind(_calcall ? 0l : _selected.ones(),
|
_prind = new TProgind(_calcall ? 0l : _selected.ones(),
|
||||||
" Creazione versam. acconti \n"
|
TR(" Creazione versam. acconti \n"
|
||||||
" preparazione archivi \n"
|
" preparazione archivi \n"
|
||||||
" \n",
|
" \n"),
|
||||||
TRUE,TRUE,30);
|
TRUE, TRUE);
|
||||||
|
|
||||||
if (_ver->read(_year,12)!=NOERR)
|
if (_ver->read(_year,12)!=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());
|
||||||
_acconto_minimo = _ver->get(I_ACCONTOIVA);
|
_acconto_minimo = _ver->get(I_ACCONTOIVA);
|
||||||
for (int l = 0; l < _ditte->items(); l++)
|
for (int l = 0; l < _ditte->items(); l++)
|
||||||
{
|
{
|
||||||
@ -302,7 +280,7 @@ void VersAcc_app::vers_acc()
|
|||||||
|
|
||||||
if (!look_lia()) continue;
|
if (!look_lia()) continue;
|
||||||
|
|
||||||
sprintf (buf,"Creazione vers. acconti:\nditta %s\n ",
|
sprintf (buf,FR("Creazione vers. acconti:\nditta %s\n "),
|
||||||
(const char*)_nditte->lfile().get("RAGSOC"));
|
(const char*)_nditte->lfile().get("RAGSOC"));
|
||||||
_prind->set_text(buf);
|
_prind->set_text(buf);
|
||||||
|
|
||||||
@ -327,13 +305,13 @@ void VersAcc_app::print()
|
|||||||
|
|
||||||
TPrintrow row;
|
TPrintrow row;
|
||||||
|
|
||||||
row.put("Gestione iva", 0);
|
row.put(TR("Gestione iva"), 0);
|
||||||
row.put("Data @>", 106);
|
row.put(FR("Data @>"), 106);
|
||||||
row.put("Pag.@#", 124);
|
row.put(FR("Pag.@#"), 124);
|
||||||
printer().setheaderline(0,row);
|
printer().setheaderline(0,row);
|
||||||
|
|
||||||
row.reset();
|
row.reset();
|
||||||
TString256 t("@bCREAZIONE VERSAMENTI PER ACCONTI DICEMBRE");
|
TString256 t(FR("@bCREAZIONE VERSAMENTI PER ACCONTI DICEMBRE"));
|
||||||
t <<' '<<_year;
|
t <<' '<<_year;
|
||||||
row.put(t,34);
|
row.put(t,34);
|
||||||
printer().setheaderline(1,row);
|
printer().setheaderline(1,row);
|
||||||
@ -346,12 +324,12 @@ void VersAcc_app::print()
|
|||||||
printer().setheaderline(4,row);
|
printer().setheaderline(4,row);
|
||||||
|
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put("Ditta",0);
|
row.put(TR("Ditta"),0);
|
||||||
row.put("Denominazione",7);
|
row.put(TR("Denominazione"),7);
|
||||||
row.put("Importo",46);
|
row.put(TR("Importo"),46);
|
||||||
row.put("Banca",55);
|
row.put(TR("Banca"),55);
|
||||||
row.put("Dipendenza",62);
|
row.put(TR("Dipendenza"),62);
|
||||||
row.put("Concessione",74);
|
row.put(TR("Concessione"),74);
|
||||||
printer().setheaderline(3,row);
|
printer().setheaderline(3,row);
|
||||||
|
|
||||||
for (int i = 0; i < _desc.items(); i++)
|
for (int i = 0; i < _desc.items(); i++)
|
||||||
@ -414,36 +392,36 @@ void VersAcc_app::lettura_delega()
|
|||||||
|
|
||||||
cod << y << _year << 12 << 7;
|
cod << y << _year << 12 << 7;
|
||||||
|
|
||||||
_del->zero();
|
TTable del("%DEL");
|
||||||
_del->put("CODTAB", cod);
|
|
||||||
|
|
||||||
if (_del->read() == NOERR)
|
del.put("CODTAB", cod);
|
||||||
|
if (del.read() == NOERR)
|
||||||
{
|
{
|
||||||
if (_diff < minimo) //l'importo non e' dovuto
|
if (_diff < minimo) //l'importo non e' dovuto
|
||||||
{
|
{
|
||||||
//cancello la delega
|
//cancello la delega
|
||||||
_del->remove();
|
del.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// se sono qui e' perche' l'importo e' dovuto (_diff >= minimo)
|
// se sono qui e' perche' l'importo e' dovuto (_diff >= minimo)
|
||||||
bool stampata = _del->get_bool("B0");
|
bool stampata = del.get_bool("B0");
|
||||||
|
|
||||||
_impver = _del->get_real("R0");
|
_impver = del.get_real("R0");
|
||||||
_dataver = _del->get_date("D0");
|
_dataver = del.get_date("D0");
|
||||||
|
|
||||||
if (stampata)
|
if (stampata)
|
||||||
{
|
{
|
||||||
_abi = _del->get("S7");
|
_abi = del.get("S7");
|
||||||
_cab = _del->get("S8");
|
_cab = del.get("S8");
|
||||||
_con = _del->get("S9");
|
_con = del.get("S9");
|
||||||
if (_diff != _impver)
|
if (_diff != _impver)
|
||||||
video_conferma();
|
video_conferma(del);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aggiorna_delega();
|
aggiorna_delega(del);
|
||||||
_da_stampare = TRUE;
|
_da_stampare = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -452,38 +430,38 @@ void VersAcc_app::lettura_delega()
|
|||||||
if (_diff >= minimo)
|
if (_diff >= minimo)
|
||||||
//creo record delega
|
//creo record delega
|
||||||
{
|
{
|
||||||
crea_delega();
|
crea_delega(del);
|
||||||
_da_stampare = TRUE;
|
_da_stampare = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VersAcc_app::crea_delega()
|
void VersAcc_app::crea_delega(TTable & del)
|
||||||
{
|
{
|
||||||
TString16 y (format("%05ld", _nditte->lfile().get_long("CODDITTA")));
|
TString16 y (format("%05ld", _nditte->lfile().get_long("CODDITTA")));
|
||||||
TString16 cod;
|
TString16 cod;
|
||||||
|
|
||||||
cod << y << _year << 12 << 7;
|
cod << y << _year << 12 << 7;
|
||||||
|
|
||||||
_del->zero();
|
del.zero();
|
||||||
_del->put("CODTAB", cod);
|
del.put("CODTAB", cod);
|
||||||
_del->put("S7", _abi);
|
del.put("S7", _abi);
|
||||||
_del->put("S8", _cab);
|
del.put("S8", _cab);
|
||||||
_del->put("S9", _con);
|
del.put("S9", _con);
|
||||||
_del->put("R0", _diff);
|
del.put("R0", _diff);
|
||||||
|
|
||||||
_del->write();
|
del.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VersAcc_app::aggiorna_delega()
|
void VersAcc_app::aggiorna_delega(TTable & del)
|
||||||
{
|
{
|
||||||
_del->put("S7", _abi);
|
del.put("S7", _abi);
|
||||||
_del->put("S8", _cab);
|
del.put("S8", _cab);
|
||||||
_del->put("S9", _con);
|
del.put("S9", _con);
|
||||||
_del->put("R0", _diff);
|
del.put("R0", _diff);
|
||||||
|
|
||||||
_del->rewrite();
|
del.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
static real pezza_euro(real n)
|
static real pezza_euro(real n)
|
||||||
@ -523,11 +501,8 @@ void VersAcc_app::lettura_anagrafica(bool* tipo)
|
|||||||
{
|
{
|
||||||
*tipo = FALSE;
|
*tipo = FALSE;
|
||||||
_con = "";
|
_con = "";
|
||||||
//const long codabi = anag.get_long("CODABI");
|
|
||||||
//const long codcab = anag.get_long("CODCAB");
|
|
||||||
const long codabi = _nditte->lfile().get_long("ABIBAN");
|
const long codabi = _nditte->lfile().get_long("ABIBAN");
|
||||||
const long codcab = _nditte->lfile().get_long("CABBAN");
|
const long codcab = _nditte->lfile().get_long("CABBAN");
|
||||||
//if (codabi != 0 || codcab != 0)
|
|
||||||
if (codabi != 0 && codcab != 0)
|
if (codabi != 0 && codcab != 0)
|
||||||
{
|
{
|
||||||
_abi = format("%05ld", codabi);
|
_abi = format("%05ld", codabi);
|
||||||
@ -536,7 +511,7 @@ void VersAcc_app::lettura_anagrafica(bool* tipo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VersAcc_app::video_conferma()
|
bool VersAcc_app::video_conferma(TTable & del)
|
||||||
{
|
{
|
||||||
TMask m("cg4800b");
|
TMask m("cg4800b");
|
||||||
|
|
||||||
@ -557,13 +532,13 @@ bool VersAcc_app::video_conferma()
|
|||||||
{
|
{
|
||||||
case K_SAVE:
|
case K_SAVE:
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Delega gia' stampata. Si desidera ugualmente confermare l'aggiornamento?");
|
KEY k = yesnocancel_box(TR("Delega gia' stampata. Si desidera ugualmente confermare l'aggiornamento?"));
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
{
|
{
|
||||||
_da_stampare = TRUE;
|
_da_stampare = TRUE;
|
||||||
_del->put("R0",_diff);
|
del.put("R0",_diff);
|
||||||
_del->put("B0", "");
|
del.put("B0", "");
|
||||||
_del->rewrite();
|
del.rewrite();
|
||||||
}
|
}
|
||||||
if (k == K_YES || k == K_NO)
|
if (k == K_YES || k == K_NO)
|
||||||
stop = TRUE;
|
stop = TRUE;
|
||||||
@ -586,26 +561,19 @@ void VersAcc_app::crea_riga_stampa(bool tipost)
|
|||||||
if (tipost) //prendo la descrizione dell'ufficio concessione
|
if (tipost) //prendo la descrizione dell'ufficio concessione
|
||||||
{
|
{
|
||||||
if (_con.not_empty())
|
if (_con.not_empty())
|
||||||
{
|
desc = cache().get("%UCC", _con, "S0");
|
||||||
TTable ucc("%UCC");
|
|
||||||
ucc.zero();
|
|
||||||
ucc.put("CODTAB", _con);
|
|
||||||
if (ucc.read() == NOERR)
|
|
||||||
desc = ucc.get("S0");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else //prendo la descrizione della banca
|
else //prendo la descrizione della banca
|
||||||
{
|
{
|
||||||
if (_abi.not_empty())
|
if (_abi.not_empty())
|
||||||
{
|
{
|
||||||
TTable ban("%BAN");
|
TString16 key;
|
||||||
TString16 cod;
|
|
||||||
cod = _abi; if (!_cab.empty()) cod << _cab;
|
key = _abi;
|
||||||
ban.zero();
|
if (!_cab.empty())
|
||||||
ban.put("CODTAB", cod);
|
key << _cab;
|
||||||
if (ban.read() == NOERR)
|
desc = cache().get("%BAN", key, "S0");
|
||||||
desc = ban.get("S0");
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tt->add(_nditte->lfile().get("CODDITTA"));
|
tt->add(_nditte->lfile().get("CODDITTA"));
|
||||||
@ -617,12 +585,13 @@ void VersAcc_app::crea_riga_stampa(bool tipost)
|
|||||||
tt->add(desc);
|
tt->add(desc);
|
||||||
tt->add(tipost);
|
tt->add(tipost);
|
||||||
|
|
||||||
if (tt != NULL) _desc.add(tt);
|
if (tt != NULL)
|
||||||
|
_desc.add(tt);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cg4800(int argc, char* argv[])
|
int cg4800(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
VersAcc_app app;
|
VersAcc_app app;
|
||||||
app.run(argc, argv, "Creazione versam. acconti dicembre");
|
app.run(argc, argv, TR("Creazione versam. acconti dicembre"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -3,6 +3,7 @@
|
|||||||
#include <currency.h>
|
#include <currency.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
#include <recarray.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -62,9 +63,10 @@ bool LiqAcc_app::create()
|
|||||||
|
|
||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
_year = oggi.year();
|
_year = oggi.year();
|
||||||
|
open_files(LF_TAB, LF_TABCOM, 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."));
|
||||||
|
|
||||||
_lia = new TTable("%LIA");
|
_lia = new TTable("%LIA");
|
||||||
_lam = new TTable("LAM");
|
_lam = new TTable("LAM");
|
||||||
@ -104,7 +106,7 @@ bool LiqAcc_app::msk_hide(TMask& m,KEY k)
|
|||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
if (m1.dirty())
|
if (m1.dirty())
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Registrazione modifiche effettuate?");
|
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?"));
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
{
|
{
|
||||||
TString16 tipo (m1.get(F_TIPO));
|
TString16 tipo (m1.get(F_TIPO));
|
||||||
@ -112,7 +114,7 @@ bool LiqAcc_app::msk_hide(TMask& m,KEY k)
|
|||||||
TString16 y; y.format("%05ld%04d", app()._ditta, app()._year);
|
TString16 y; y.format("%05ld%04d", app()._ditta, app()._year);
|
||||||
lia.zero();
|
lia.zero();
|
||||||
lia.put("CODTAB", y);
|
lia.put("CODTAB", y);
|
||||||
if (lia.read() != NOERR)
|
if (lia.read(_isequal, _lock) != NOERR)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
lia.put("S8", tipo);
|
lia.put("S8", tipo);
|
||||||
lia.rewrite();
|
lia.rewrite();
|
||||||
@ -131,7 +133,7 @@ bool LiqAcc_app::msk_hide(TMask& m,KEY k)
|
|||||||
TString16 y; y.format("%05ld%04d", app()._ditta, app()._year);
|
TString16 y; y.format("%05ld%04d", app()._ditta, app()._year);
|
||||||
lia.zero();
|
lia.zero();
|
||||||
lia.put("CODTAB", y);
|
lia.put("CODTAB", y);
|
||||||
if (lia.read() != NOERR)
|
if (lia.read(_isequal, _lock) != NOERR)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
lia.put("S8", tipo);
|
lia.put("S8", tipo);
|
||||||
lia.rewrite();
|
lia.rewrite();
|
||||||
@ -199,7 +201,7 @@ bool LiqAcc_app::set_ditta(TMask_field& f, KEY k)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
warning_box("Non sono definiti i parametri liquidazione per la ditta %ld",
|
warning_box(FR("Non sono definiti i parametri liquidazione per la ditta %ld"),
|
||||||
atol(ditta));
|
atol(ditta));
|
||||||
f.reset();
|
f.reset();
|
||||||
}
|
}
|
||||||
@ -292,33 +294,31 @@ void LiqAcc_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();
|
TCursor cur(_nditte, "", 1);
|
||||||
TString fr(2);
|
TRectype & dt = _nditte->curr();
|
||||||
TTable lia("%LIA");
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
for (dt.first(); !dt.eof(); dt.next())
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
// check no archivi
|
// check no archivi
|
||||||
fr = "??";
|
if (prefix().exist(dt.get_long("CODDITTA")))
|
||||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
|
||||||
|
|
||||||
if (good)
|
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
lia.put("CODTAB", format("%05ld%d",dt.get_long("CODDITTA"),_year));
|
TString key;
|
||||||
if (lia.read() != NOERR) good = FALSE;
|
TToken_string d;
|
||||||
else fr = lia.get("S7");
|
|
||||||
|
// add record
|
||||||
|
d.add(dt.get_long("CODDITTA"));
|
||||||
|
d.add(dt.get("RAGSOC"));
|
||||||
|
|
||||||
|
key.format("%05ld%d", dt.get_long("CODDITTA"), _year);
|
||||||
|
|
||||||
|
const TRectype & lia = cache().get("%LIA", key);
|
||||||
|
|
||||||
|
d.add(lia.empty() ? "??" : lia.get("S7"));
|
||||||
|
_nomiditte.add(d);
|
||||||
}
|
}
|
||||||
else continue;
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ bool LiqAcc_app::video_vis_1999()
|
|||||||
TString16 y; y.format("%05ld%04d", _ditta, _year);
|
TString16 y; y.format("%05ld%04d", _ditta, _year);
|
||||||
lia.zero();
|
lia.zero();
|
||||||
lia.put("CODTAB", y);
|
lia.put("CODTAB", y);
|
||||||
if (lia.read() != NOERR) //da verificare se e' giusto
|
if (lia.read(_isequal, _lock) != NOERR) //da verificare se e' giusto
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// TConfig cnf(CONFIG_DITTA, "cg");
|
// TConfig cnf(CONFIG_DITTA, "cg");
|
||||||
@ -388,7 +388,7 @@ bool LiqAcc_app::video_vis_1999()
|
|||||||
TString16 freqviva = lia.get("S7");
|
TString16 freqviva = lia.get("S7");
|
||||||
TInteressi_IVA_table ver;
|
TInteressi_IVA_table ver;
|
||||||
if (ver.read(_year,12)!=NOERR)
|
if (ver.read(_year,12)!=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());
|
||||||
const real acconto_min_da_versare = ver.get(I_ACCONTOIVA);
|
const real acconto_min_da_versare = ver.get(I_ACCONTOIVA);
|
||||||
real acconto = ZERO;
|
real acconto = ZERO;
|
||||||
real iva_ven = ZERO;
|
real iva_ven = ZERO;
|
||||||
@ -524,7 +524,7 @@ bool LiqAcc_app::video_vis_1999()
|
|||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
if (m.dirty())
|
if (m.dirty())
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Registrazione modifiche effettuate?");
|
KEY k = yesnocancel_box(TR("Registrazione modifiche effettuate?"));
|
||||||
|
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
{
|
{
|
||||||
@ -533,7 +533,7 @@ bool LiqAcc_app::video_vis_1999()
|
|||||||
real nf (m.get(F_NONFAT));
|
real nf (m.get(F_NONFAT));
|
||||||
real na (m.get(F_NONANN));
|
real na (m.get(F_NONANN));
|
||||||
if (nf != non_fat || na != non_ann)
|
if (nf != non_fat || na != non_ann)
|
||||||
message_box("Valori modificati: rieseguire il calcolo dell'acconto");
|
message_box(TR("Valori modificati: rieseguire il calcolo dell'acconto"));
|
||||||
lia.put("R13", nf);
|
lia.put("R13", nf);
|
||||||
lia.put("R14", na);
|
lia.put("R14", na);
|
||||||
lia.rewrite();
|
lia.rewrite();
|
||||||
@ -554,7 +554,7 @@ bool LiqAcc_app::video_vis_1999()
|
|||||||
real nf (m.get(F_NONFAT));
|
real nf (m.get(F_NONFAT));
|
||||||
real na (m.get(F_NONANN));
|
real na (m.get(F_NONANN));
|
||||||
if (nf != non_fat || na != non_ann)
|
if (nf != non_fat || na != non_ann)
|
||||||
message_box("Valori modificati: rieseguire il calcolo dell'acconto");
|
message_box(TR("Valori modificati: rieseguire il calcolo dell'acconto"));
|
||||||
lia.put("R13", nf);
|
lia.put("R13", nf);
|
||||||
lia.put("R14", na);
|
lia.put("R14", na);
|
||||||
lia.rewrite();
|
lia.rewrite();
|
||||||
@ -633,7 +633,7 @@ bool LiqAcc_app::video_vis_2000()
|
|||||||
TTable lia ("%LIA");
|
TTable lia ("%LIA");
|
||||||
TString16 key; key.format("%05ld%04d", _ditta, _year);
|
TString16 key; key.format("%05ld%04d", _ditta, _year);
|
||||||
lia.put("CODTAB", key);
|
lia.put("CODTAB", key);
|
||||||
if (lia.read() != NOERR)
|
if (lia.read(_isequal, _lock) != NOERR)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
const bool liqdiff = lia.get_bool("B1"); // MI3262..
|
const bool liqdiff = lia.get_bool("B1"); // MI3262..
|
||||||
@ -643,7 +643,7 @@ bool LiqAcc_app::video_vis_2000()
|
|||||||
|
|
||||||
TInteressi_IVA_table ver;
|
TInteressi_IVA_table ver;
|
||||||
if (ver.read(_year,12)!=NOERR)
|
if (ver.read(_year,12)!=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());
|
||||||
|
|
||||||
const real acconto_min_da_versare = ver.get(I_ACCONTOIVA);
|
const real acconto_min_da_versare = ver.get(I_ACCONTOIVA);
|
||||||
real acconto = lia.get("R4"); // Acconto di Dicembre
|
real acconto = lia.get("R4"); // Acconto di Dicembre
|
||||||
@ -734,10 +734,10 @@ bool LiqAcc_app::video_vis_2000()
|
|||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
if (!liqdiff && m.dirty())
|
if (!liqdiff && m.dirty())
|
||||||
{
|
{
|
||||||
KEY k = yesnocancel_box("Registrare le modifiche effettuate?");
|
KEY k = yesnocancel_box(TR("Registrare le modifiche effettuate?"));
|
||||||
if (k == K_YES)
|
if (k == K_YES)
|
||||||
{
|
{
|
||||||
warning_box("E' necessario rieseguire il calcolo dell'acconto");
|
warning_box(TR("E' necessario rieseguire il calcolo dell'acconto"));
|
||||||
const real nf = m.get(F_NONFAT);
|
const real nf = m.get(F_NONFAT);
|
||||||
const real na = m.get(F_NONANN);
|
const real na = m.get(F_NONANN);
|
||||||
lia.put("R13", nf);
|
lia.put("R13", nf);
|
||||||
@ -754,7 +754,7 @@ bool LiqAcc_app::video_vis_2000()
|
|||||||
_registra = TRUE;
|
_registra = TRUE;
|
||||||
if (!liqdiff && m.dirty())
|
if (!liqdiff && m.dirty())
|
||||||
{
|
{
|
||||||
warning_box("E' necessario rieseguire il calcolo dell'acconto");
|
warning_box(TR("E' necessario rieseguire il calcolo dell'acconto"));
|
||||||
const real nf = m.get(F_NONFAT);
|
const real nf = m.get(F_NONFAT);
|
||||||
const real na = m.get(F_NONANN);
|
const real na = m.get(F_NONANN);
|
||||||
lia.put("R13", nf);
|
lia.put("R13", nf);
|
||||||
@ -770,6 +770,8 @@ bool LiqAcc_app::video_vis_2000()
|
|||||||
int cg4900(int argc, char* argv[])
|
int cg4900(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
LiqAcc_app app;
|
LiqAcc_app app;
|
||||||
app.run(argc, argv, "Visualizzazione liquidazione acconti");
|
|
||||||
return 0;
|
app.run(argc, argv, TR("Visualizzazione liquidazione acconti"));
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,8 @@ bool cau_filter1 (const TRelation *r)
|
|||||||
const bool b1 = reg.get_bool("B1");
|
const bool b1 = reg.get_bool("B1");
|
||||||
if (i9 == 1 || i9 == 0 && b1) // Il registro deve avere la X di sospensione NORMALE
|
if (i9 == 1 || i9 == 0 && b1) // Il registro deve avere la X di sospensione NORMALE
|
||||||
{
|
{
|
||||||
TLocalisamfile& rcau = r->lfile(LF_RCAUSALI); // La riga 1 (gia' posizionata nella relazione) deve essere di tipo cliente
|
TLocalisamfile & rcau = r->lfile(LF_RCAUSALI); // La riga 1 (gia' posizionata nella relazione) deve essere di tipo cliente
|
||||||
|
|
||||||
if (rcau.get(RCA_TIPOCF) == "C")
|
if (rcau.get(RCA_TIPOCF) == "C")
|
||||||
rt = TRUE;
|
rt = TRUE;
|
||||||
}
|
}
|
||||||
@ -155,7 +156,7 @@ void TGestAutoTrasp_mask::fill_sheet(const short id)
|
|||||||
TProgind* pi = NULL;
|
TProgind* pi = NULL;
|
||||||
|
|
||||||
if (items > 10)
|
if (items > 10)
|
||||||
pi = new TProgind(items, "Selezione movimenti...", FALSE, TRUE);
|
pi = new TProgind(items, TR("Selezione movimenti..."), FALSE, TRUE);
|
||||||
|
|
||||||
TLocalisamfile causali(LF_CAUSALI);
|
TLocalisamfile causali(LF_CAUSALI);
|
||||||
|
|
||||||
@ -180,7 +181,7 @@ void TGestAutoTrasp_mask::fill_sheet(const short id)
|
|||||||
causali.put(CAU_CODCAUS, caus);
|
causali.put(CAU_CODCAUS, caus);
|
||||||
|
|
||||||
const bool ok = causali.read() == NOERR;
|
const bool ok = causali.read() == NOERR;
|
||||||
tt->add(ok ? causali.get(CAU_DESCR) : "** Non presente **", 1);
|
tt->add(ok ? causali.get(CAU_DESCR) : TR("** Non presente **"), 1);
|
||||||
tt->add(ok ? causali.get(CAU_TIPODOC) : "**", 2);
|
tt->add(ok ? causali.get(CAU_TIPODOC) : "**", 2);
|
||||||
|
|
||||||
sa.add(tt);
|
sa.add(tt);
|
||||||
@ -194,7 +195,7 @@ void TGestAutoTrasp_mask::fill_sheet(const short id)
|
|||||||
|
|
||||||
if (items == 0)
|
if (items == 0)
|
||||||
{
|
{
|
||||||
warning_box("Non vi sono operazioni da effettuare nell'intervallo specificato.");
|
warning_box(TR("Non vi sono operazioni da effettuare nell'intervallo specificato."));
|
||||||
set_focus_field(id);
|
set_focus_field(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,9 +249,9 @@ bool TGestAutoTrasp_mask::on_field_event(TOperable_field& o, TField_event e, lon
|
|||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
if (sf.items() == 0)
|
if (sf.items() == 0)
|
||||||
error_box("Non vi sono movimenti in sospensione da stornare nel periodo indicato.");
|
error_box(TR("Non vi sono movimenti in sospensione da stornare nel periodo indicato."));
|
||||||
else
|
else
|
||||||
error_box("E' necessario indicare almeno una causale definitiva.");
|
error_box(TR("E' necessario indicare almeno una causale definitiva."));
|
||||||
}
|
}
|
||||||
|
|
||||||
return !error;
|
return !error;
|
||||||
@ -292,12 +293,15 @@ bool TGestAutoTrasp_mask::on_field_event(TOperable_field& o, TField_event e, lon
|
|||||||
const long TGestAutoTrasp_mask::get_last_nreg()
|
const long TGestAutoTrasp_mask::get_last_nreg()
|
||||||
{
|
{
|
||||||
TLocalisamfile& mov = _rel->lfile();
|
TLocalisamfile& mov = _rel->lfile();
|
||||||
|
const int key = mov.getkey();
|
||||||
long nr = 1L;
|
long nr = 1L;
|
||||||
|
|
||||||
if (!mov.empty())
|
if (!mov.empty())
|
||||||
{
|
{
|
||||||
|
mov.setkey(1);
|
||||||
mov.last();
|
mov.last();
|
||||||
nr = mov.get_long(MOV_NUMREG) + 1L;
|
nr = mov.get_long(MOV_NUMREG) + 1L;
|
||||||
|
mov.setkey(key);
|
||||||
}
|
}
|
||||||
return nr;
|
return nr;
|
||||||
}
|
}
|
||||||
@ -368,7 +372,7 @@ void TGestAutoTrasp_mask::write_movs()
|
|||||||
|
|
||||||
_cur->freeze();
|
_cur->freeze();
|
||||||
|
|
||||||
TProgind pi(cur_items, "Creazione movimenti...", FALSE, TRUE);
|
TProgind pi(cur_items, TR("Creazione movimenti..."), FALSE, TRUE);
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
int movs = 0;
|
int movs = 0;
|
||||||
|
|
||||||
@ -465,19 +469,19 @@ void TGestAutoTrasp_mask::write_movs()
|
|||||||
movs++;
|
movs++;
|
||||||
err = mpn_sosp.rewrite(); // Aggiorna il movimento in sospensione con i flags aggiornati
|
err = mpn_sosp.rewrite(); // Aggiorna il movimento in sospensione con i flags aggiornati
|
||||||
if (err != NOERR)
|
if (err != NOERR)
|
||||||
error_box("Errore %d in fase di riscrittura del movimento di sospensione nr. %d.", err, nsosp);
|
error_box(FR("Errore %d in fase di riscrittura del movimento di sospensione nr. %d."), err, nsosp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error_box("Errore %d in fase di scrittura del movimento definitivo. Movimento di sospensione nr. %d.", err, nsosp);
|
error_box(FR("Errore %d in fase di scrittura del movimento definitivo. Movimento di sospensione nr. %d."), err, nsosp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error_box("Errore %d in fase di scrittura del movimento di storno. Movimento di sospensione nr. %d.", err, nsosp);
|
error_box(FR("Errore %d in fase di scrittura del movimento di storno. Movimento di sospensione nr. %d."), err, nsosp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_cur->freeze(FALSE);
|
_cur->freeze(FALSE);
|
||||||
|
|
||||||
message_box("Totale movimenti generati: %d", movs);
|
message_box(FR("Totale movimenti generati: %d"), movs);
|
||||||
}
|
}
|
||||||
|
|
||||||
class TGestAutoTrasp_app : public TSkeleton_application
|
class TGestAutoTrasp_app : public TSkeleton_application
|
||||||
@ -510,7 +514,7 @@ void TGestAutoTrasp_app::main_loop()
|
|||||||
{
|
{
|
||||||
while (_msk->run() != K_QUIT)
|
while (_msk->run() != K_QUIT)
|
||||||
{
|
{
|
||||||
if (yesno_box("Procedo con la creazione dei movimenti?"))
|
if (yesno_box(TR("Procedo con la creazione dei movimenti?")))
|
||||||
{
|
{
|
||||||
_msk->write_movs();
|
_msk->write_movs();
|
||||||
_msk->reset();
|
_msk->reset();
|
||||||
@ -521,6 +525,6 @@ void TGestAutoTrasp_app::main_loop()
|
|||||||
int cg4a00(int argc, char* argv[])
|
int cg4a00(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TGestAutoTrasp_app app;
|
TGestAutoTrasp_app app;
|
||||||
app.run(argc, argv, "Gestione Autotrasportatori");
|
app.run(argc, argv, TR("Gestione Autotrasportatori"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user