Corretta ricerca dei registri in seguito al zerofilling dell'anno
git-svn-id: svn://10.65.10.50/trunk@228 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1d414b2abc
commit
5c70586f90
@ -72,7 +72,7 @@ END
|
|||||||
NUMBER F_ANNOES 4
|
NUMBER F_ANNOES 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 51 7 "Anno di esercizio "
|
PROMPT 51 7 "Anno di esercizio "
|
||||||
FLAGS "D"
|
FLAGS "DRZ"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_CODCAUS 3
|
STRING F_CODCAUS 3
|
||||||
|
@ -55,7 +55,7 @@ NUMBER F_ANNOES 4
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 4 "Esercizio "
|
PROMPT 57 4 "Esercizio "
|
||||||
FIELD ANNOES
|
FIELD ANNOES
|
||||||
FLAGS "D"
|
FLAGS "DRZ"
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATADOC
|
DATE F_DATADOC
|
||||||
|
@ -95,7 +95,7 @@ NUMBER F_ANNOES 4
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 32 4 "Anno esercizio "
|
PROMPT 32 4 "Anno esercizio "
|
||||||
FIELD LF_MOV->ANNOES
|
FIELD LF_MOV->ANNOES
|
||||||
FLAGS "DG"
|
FLAGS "DGRZ"
|
||||||
MESSAGE COPY,H_ANNOES
|
MESSAGE COPY,H_ANNOES
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ BEGIN
|
|||||||
PROMPT 51 9 "Riepilogo fino al n. "
|
PROMPT 51 9 "Riepilogo fino al n. "
|
||||||
FIELD LF_MOV->UPROTIVA
|
FIELD LF_MOV->UPROTIVA
|
||||||
NUM_EXPR (#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)
|
NUM_EXPR (#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)
|
||||||
WARNING "Il riepilogo non puo' essere inferiore al protocollo IVA"
|
WARNING "Inserire un riepilogo non inferiore al protocollo IVA"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_CLIFO 1
|
STRING F_CLIFO 1
|
||||||
@ -504,7 +504,7 @@ END
|
|||||||
NUMBER H_ANNOES 4
|
NUMBER H_ANNOES 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 61 1 "Esercizio "
|
PROMPT 61 1 "Esercizio "
|
||||||
FLAGS "D"
|
FLAGS "DRZ"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING H_CODCAUS 3
|
STRING H_CODCAUS 3
|
||||||
|
@ -20,7 +20,8 @@ int date2esc(const TDate& d, int* prevesc)
|
|||||||
{
|
{
|
||||||
const TDate ia(esc.get("D0")); // Data inizio esercizio
|
const TDate ia(esc.get("D0")); // Data inizio esercizio
|
||||||
const TDate fa(esc.get("D1")); // Data fine esercizio
|
const TDate fa(esc.get("D1")); // Data fine esercizio
|
||||||
const anno = esc.get_int("CODTAB");
|
TString16 sanno(esc.get_int("CODTAB")); sanno.cut(4);
|
||||||
|
const int anno = atoi(sanno);
|
||||||
if (d >= ia && d <= fa)
|
if (d >= ia && d <= fa)
|
||||||
return anno;
|
return anno;
|
||||||
if (prevesc) *prevesc = anno;
|
if (prevesc) *prevesc = anno;
|
||||||
|
@ -427,18 +427,22 @@ real TPrimanota_application::calcola_saldo() const
|
|||||||
// Certified 90%
|
// Certified 90%
|
||||||
bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_ENTER)
|
if ((k == K_TAB && !f.mask().is_running()) || k == K_ENTER)
|
||||||
{
|
{
|
||||||
TSheet_field& cg = app().cgs();
|
TSheet_field& cg = app().cgs();
|
||||||
real saldo = app().calcola_saldo();
|
const real saldo = app().calcola_saldo();
|
||||||
if (saldo != ZERO)
|
|
||||||
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
const char* ss = saldo.string(".");
|
if (saldo != ZERO)
|
||||||
return f.error_box("Il movimento e' sbilanciato di %s lire.", ss);
|
{
|
||||||
|
const char* ss = saldo.string(".");
|
||||||
|
return f.error_box("Il movimento e' sbilanciato di %s lire.", ss);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (app().get_cgs_imp(0).valore() == ZERO)
|
||||||
|
return f.error_box("Il movimento non ha una prima riga contabile valida!");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
if (app().get_cgs_imp(0).valore() == ZERO)
|
|
||||||
return f.error_box("Il movimento non ha una prima riga contabile valida!");
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -713,19 +717,21 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
|||||||
// Certified 90%
|
// Certified 90%
|
||||||
bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
|
bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k != K_ENTER) return TRUE;
|
if ((k == K_TAB && !f.mask().is_running()) || k == K_ENTER)
|
||||||
|
|
||||||
const real imp = app().calcola_imp();
|
|
||||||
const real tot = app().totale_documento();
|
|
||||||
|
|
||||||
if (imp != tot)
|
|
||||||
{
|
{
|
||||||
TString16 t(tot.string("."));
|
const real imp = app().calcola_imp();
|
||||||
TString16 i(imp.string("."));
|
const real tot = app().totale_documento();
|
||||||
return error_box("La somma del totale documento e delle ritenute (%s) e' diverso dalla "
|
if (k == K_ENTER)
|
||||||
"somma degli imponibili e delle imposte (%s)", (const char*)t, (const char*)i);
|
{
|
||||||
|
if (imp != tot)
|
||||||
|
{
|
||||||
|
TString16 t(tot.string("."));
|
||||||
|
TString16 i(imp.string("."));
|
||||||
|
return error_box("La somma del totale documento e delle ritenute (%s) e' diverso dalla "
|
||||||
|
"somma degli imponibili e delle imposte (%s)", (const char*)t, (const char*)i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,6 +1203,7 @@ bool TPrimanota_application::solaiva_handler(TMask_field& f, KEY key)
|
|||||||
pi.setstatus(i+1);
|
pi.setstatus(i+1);
|
||||||
}
|
}
|
||||||
app().fill_sheet(m);
|
app().fill_sheet(m);
|
||||||
|
app().cgs().force_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
|
|
||||||
|
|
||||||
const char* iva2name(TipoIVA iva)
|
const char* iva2name(TipoIVA iva)
|
||||||
{
|
{
|
||||||
const char* i;
|
const char* i;
|
||||||
@ -48,8 +47,7 @@ bool TRegistro::read(const char* cod, int year)
|
|||||||
TTable reg("REG");
|
TTable reg("REG");
|
||||||
if (cod && *cod > ' ')
|
if (cod && *cod > ' ')
|
||||||
{
|
{
|
||||||
TString16 chiave;
|
TString16 chiave; chiave.format("%04d%s", year, cod);
|
||||||
chiave << year << cod;
|
|
||||||
reg.put("CODTAB", chiave);
|
reg.put("CODTAB", chiave);
|
||||||
err = reg.read();
|
err = reg.read();
|
||||||
}
|
}
|
||||||
@ -64,7 +62,15 @@ bool TRegistro::read(const char* cod, int year)
|
|||||||
|
|
||||||
|
|
||||||
int TRegistro::year() const
|
int TRegistro::year() const
|
||||||
{ return ok() ? atoi(_rec.get("CODTAB")) : 0; }
|
{
|
||||||
|
int anno = 0;
|
||||||
|
if (ok())
|
||||||
|
{
|
||||||
|
TString16 sanno(_rec.get("CODTAB")); sanno.cut(4);
|
||||||
|
anno = atoi(sanno);
|
||||||
|
}
|
||||||
|
return anno;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -120,12 +126,9 @@ bool TRegistro::read_att()
|
|||||||
|
|
||||||
bool TRegistro::agenzia_viaggi()
|
bool TRegistro::agenzia_viaggi()
|
||||||
{
|
{
|
||||||
if (iva() != iva_vendite)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
bool av = FALSE;
|
bool av = FALSE;
|
||||||
if (read_att()) av = _att.get_bool("REG74TER");
|
if (iva() == iva_vendite && read_att())
|
||||||
|
av = _att.get_bool("REG74TER");
|
||||||
return av;
|
return av;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +179,7 @@ bool TLibro_giornale::read(int y)
|
|||||||
TTable reg("REG");
|
TTable reg("REG");
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
|
|
||||||
TString16 anno; anno.format("%4d", y);
|
TString16 anno; anno.format("%04d", y);
|
||||||
|
|
||||||
reg.setkey(1);
|
reg.setkey(1);
|
||||||
reg.put("CODTAB", anno); // Cerca il primo registro dell'anno y
|
reg.put("CODTAB", anno); // Cerca il primo registro dell'anno y
|
||||||
@ -197,22 +200,24 @@ bool TLibro_giornale::read(int y)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDate TLibro_giornale::global_last_print() const
|
/*
|
||||||
{
|
TDate TLibro_giornale::global_last_print() const
|
||||||
TTable reg("REG");
|
{
|
||||||
reg.setkey(1);
|
TTable reg("REG");
|
||||||
|
reg.setkey(1);
|
||||||
|
|
||||||
TDate last(botime);
|
TDate last(botime);
|
||||||
for (int err = reg.first(); err == NOERR; err = reg.next())
|
for (int err = reg.first(); err == NOERR; err = reg.next())
|
||||||
{
|
{
|
||||||
if (reg.get_int("I0") == libro_giornale)
|
if (reg.get_int("I0") == libro_giornale)
|
||||||
{
|
{
|
||||||
const TDate l(reg.get("D3"));
|
const TDate l(reg.get("D3"));
|
||||||
if (l > last) last = l;
|
if (l > last) last = l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
TLibro_giornale::TLibro_giornale(int y)
|
TLibro_giornale::TLibro_giornale(int y)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user