Patch level : 2..0 444
Files correlati : cg5.exe Ricompilazione Demo : [ ] Commento : Aggiunto il supporto delle lingue a cg5 git-svn-id: svn://10.65.10.50/trunk@10986 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d1d0fdcebe
commit
a99abe585d
@ -33,8 +33,8 @@ public:
|
|||||||
|
|
||||||
TDich_periodica_selfirm_mask::TDich_periodica_selfirm_mask() : TAutomask("cg5700a")
|
TDich_periodica_selfirm_mask::TDich_periodica_selfirm_mask() : TAutomask("cg5700a")
|
||||||
{
|
{
|
||||||
_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");
|
HR("Cod.@5|Ragione Sociale@50"));
|
||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
|
|
||||||
_year = oggi.year();
|
_year = oggi.year();
|
||||||
@ -51,19 +51,23 @@ TDich_periodica_selfirm_mask::~TDich_periodica_selfirm_mask()
|
|||||||
void TDich_periodica_selfirm_mask::build_nomiditte()
|
void TDich_periodica_selfirm_mask::build_nomiditte()
|
||||||
{
|
{
|
||||||
TString cod;
|
TString cod;
|
||||||
TLocalisamfile dt(LF_NDITTE);
|
TRelation relditte(LF_NDITTE);
|
||||||
|
TRectype & ditta = relditte.lfile().curr();
|
||||||
|
TCursor cur(&relditte);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
_nomiditte.destroy();
|
_nomiditte.destroy();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
for (dt.first(); !dt.eof(); dt.next())
|
|
||||||
{
|
{
|
||||||
const long codditta = dt.get_long("CODDITTA");
|
const long codditta = ditta.get_long("CODDITTA");
|
||||||
bool good = prefix().exist(codditta);
|
bool good = prefix().exist(codditta);
|
||||||
|
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
TToken_string* d = new TToken_string(64);
|
TToken_string* d = new TToken_string(64);
|
||||||
d->add(codditta);
|
d->add(codditta);
|
||||||
d->add(dt.get("RAGSOC"));
|
d->add(ditta.get("RAGSOC"));
|
||||||
_nomiditte.add(d);
|
_nomiditte.add(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +127,7 @@ bool TDich_periodica_selfirm_mask::on_field_event(TOperable_field& o, TField_eve
|
|||||||
}
|
}
|
||||||
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));
|
||||||
o.reset();
|
o.reset();
|
||||||
}
|
}
|
||||||
@ -191,10 +195,10 @@ bool change_prompt(TString& p, int year)
|
|||||||
switch (vp)
|
switch (vp)
|
||||||
{
|
{
|
||||||
case 6:
|
case 6:
|
||||||
p = "VP11 - IVA detratta per il periodo";
|
p = TR("VP11 - IVA detratta per il periodo");
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
p = "VP14 - IVA non versata o in eccesso da dich. prec.";
|
p = TR("VP14 - IVA non versata o in eccesso da dich. prec.");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
TString4 n;
|
TString4 n;
|
||||||
@ -270,19 +274,15 @@ TDich_periodica_iva_mask::TDich_periodica_iva_mask(TDich_periodica_selfirm_mask
|
|||||||
|
|
||||||
void TDich_periodica_iva_mask::read_iva_data()
|
void TDich_periodica_iva_mask::read_iva_data()
|
||||||
{
|
{
|
||||||
TTable lim("LIM");
|
|
||||||
TTable lam("LAM");
|
|
||||||
|
|
||||||
TString16 key;
|
TString16 key;
|
||||||
|
|
||||||
key.format("%4d13", _sf->get_year());
|
key.format("%4d13", _sf->get_year());
|
||||||
lim.put("CODTAB", key);
|
|
||||||
lam.put("CODTAB", key);
|
|
||||||
|
|
||||||
const bool good = lim.read() == NOERR;
|
const TRectype & lim = cache().get("LIM", key);
|
||||||
|
|
||||||
if (good && lim.get_bool("B0"))
|
if (lim.get_bool("B0"))
|
||||||
{
|
{
|
||||||
lam.read();
|
const TRectype & lam = cache().get("LAM", key);
|
||||||
|
|
||||||
TString descrizione(120);
|
TString descrizione(120);
|
||||||
descrizione = lim.get("S0");
|
descrizione = lim.get("S0");
|
||||||
@ -300,34 +300,38 @@ void TDich_periodica_iva_mask::read_iva_data()
|
|||||||
real cd3_1 = ZERO;
|
real cd3_1 = ZERO;
|
||||||
real cd3_2 = ZERO;
|
real cd3_2 = ZERO;
|
||||||
|
|
||||||
TTable pum("PUM");
|
TRelation relpum("PUM");
|
||||||
|
TRectype & pum = relpum.curr();
|
||||||
|
|
||||||
key.format("%04d",_sf->get_year());
|
key.format("%04d",_sf->get_year());
|
||||||
pum.put("CODTAB", key);
|
pum.put("CODTAB", key);
|
||||||
for (int err = pum.read(_isgteq); err == NOERR; err= pum.next())
|
TCursor cur(&relpum, "", 1, &pum, &pum);
|
||||||
|
const TRecnotype items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
const TString16 codtab = pum.get("CODTAB");
|
const TString & codtab = pum.get("CODTAB");
|
||||||
|
|
||||||
const TString& anno = codtab.left(4);
|
if (atoi(codtab.right(2)) == 13) // Solo annuale
|
||||||
if (anno != key)
|
{
|
||||||
break;
|
cd1_1 += pum.get_real("R14");
|
||||||
if (codtab.right(2) != "13") // Solo annuale
|
cd1_2 += pum.get_real("R15");
|
||||||
continue;
|
cd1_3 += pum.get_real("R16");
|
||||||
|
cd1_4 += pum.get_real("R17");
|
||||||
cd1_1 += pum.get_real("R14");
|
cd2_1 += pum.get_real("R18");
|
||||||
cd1_2 += pum.get_real("R15");
|
cd2_2 += pum.get_real("R19");
|
||||||
cd1_3 += pum.get_real("R16");
|
cd2_3 += pum.get_real("R20");
|
||||||
cd1_4 += pum.get_real("R17");
|
cd2_4 += pum.get_real("R21");
|
||||||
cd2_1 += pum.get_real("R18");
|
cd3_1 += pum.get_real("R22");
|
||||||
cd2_2 += pum.get_real("R19");
|
cd3_2 += pum.get_real("R23");
|
||||||
cd2_3 += pum.get_real("R20");
|
}
|
||||||
cd2_4 += pum.get_real("R21");
|
|
||||||
cd3_1 += pum.get_real("R22");
|
|
||||||
cd3_2 += pum.get_real("R23");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const real rettifica = lim.get_real("R5"); // Rettifiche
|
const real rettifica = lim.get_real("R5"); // Rettifiche
|
||||||
|
|
||||||
real cd4 = lam.get_real("R0"); // Iva esigibile per il periodo
|
real cd4 = lam.get_real("R0"); // Iva esigibile per il periodo
|
||||||
|
|
||||||
if (rettifica > ZERO)
|
if (rettifica > ZERO)
|
||||||
cd4 += rettifica;
|
cd4 += rettifica;
|
||||||
|
|
||||||
@ -349,7 +353,7 @@ void TDich_periodica_iva_mask::read_iva_data()
|
|||||||
set(F_CD6_1, cd6_1); set(F_CD6_2, cd6_2);
|
set(F_CD6_1, cd6_1); set(F_CD6_2, cd6_2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error_box("Risultati liquidazione non presenti o da ricalcolare per il periodo richiesto.");
|
error_box(TR("Risultati liquidazione non presenti o da ricalcolare per il periodo richiesto."));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDich_periodica_iva_mask::print_prospect()
|
void TDich_periodica_iva_mask::print_prospect()
|
||||||
@ -449,7 +453,7 @@ void TDich_periodica_iva_app::main_loop()
|
|||||||
{
|
{
|
||||||
if (m1->get(F_CODDITTA).empty() || m1->get(F_RAGSOC).empty())
|
if (m1->get(F_CODDITTA).empty() || m1->get(F_RAGSOC).empty())
|
||||||
{
|
{
|
||||||
error_box("Selezionare una ditta");
|
error_box(TR("Selezionare una ditta"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,6 +475,6 @@ void TDich_periodica_iva_app::main_loop()
|
|||||||
int cg5700(int argc, char* argv[])
|
int cg5700(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TDich_periodica_iva_app a;
|
TDich_periodica_iva_app a;
|
||||||
a.run(argc, argv, "Comunicazione annuale IVA");
|
a.run(argc, argv, TR("Comunicazione annuale IVA"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user