Corretto ripristino stampa registri

git-svn-id: svn://10.65.10.50/trunk@1023 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-02-21 15:11:01 +00:00
parent 47ce8a782f
commit 80f7a4ef54
3 changed files with 22 additions and 12 deletions

View File

@ -141,7 +141,7 @@ BEGIN
END END
// Questo rimane quasi sempre nascosto // Questo rimane quasi sempre nascosto
STRING F_TIPO_MOV 2 STRING F_TIPO_MOV 1
BEGIN BEGIN
PROMPT 2 5 "" PROMPT 2 5 ""
FIELD TIPOMOV FIELD TIPOMOV

View File

@ -97,12 +97,12 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
TRectype from(mov.curr()); from.zero(); TRectype from(mov.curr()); from.zero();
TRectype to(from); TRectype to(from);
TString16 filter; TString80 filter;
from.put(MOV_DATAREG, d); from.put(MOV_DATAREG, d);
to.put(MOV_DATAREG, dlast); to.put(MOV_DATAREG, dlast);
if (!giornale) if (!giornale)
filter.format("%s==\"%s\"", MOV_REG, regist); filter.format("%s==\"%s\"", MOV_REG, (const char*)regist);
TCursor cursor(&rel, filter, 2, &from, &to); TCursor cursor(&rel, filter, 2, &from, &to);
long last_num = 0L; long last_num = 0L;
@ -131,17 +131,25 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
--d; --d;
if (d > inizio_anno) // Aggiorna data ultima stampa if (d > inizio_anno) // Aggiorna data ultima stampa
{ {
reg.put("D3", d); // Data ultima stampa reg.put("D3", d); // Data ultima stampa
reg.put("I4", d.month()-1); // Ultimo mese di stampa liquidazione if (!giornale)
if (reg.get_int("I8") >= d.month()) {
reg.zero("I8"); // Mese di ultima stampa credito precedente const int mese = d.month();
if (reg.get_int("I4") > mese)
reg.put("I4", mese); // Ultimo mese di stampa liquidazione
if (reg.get_int("I8") >= mese)
reg.zero("I8"); // Mese di ultima stampa credito precedente
}
} }
else else
{ {
reg.zero("D3"); reg.zero("D3");
reg.zero("I4"); if (!giornale)
reg.zero("I8"); {
reg.zero("I4");
reg.zero("I8");
}
} }
ok = (reg.rewrite() == NOERR); ok = (reg.rewrite() == NOERR);
@ -246,7 +254,7 @@ bool TRipristina_stampa::menu(MENU_TAG)
if (yesno_box(mess)) if (yesno_box(mess))
{ {
switch (_op) switch (_op)
{ {
case restore_inl: case restore_inl:
inl_restore(reg, year, month); break; inl_restore(reg, year, month); break;
default: default:
@ -264,6 +272,6 @@ bool TRipristina_stampa::menu(MENU_TAG)
int cg5400(int argc, char* argv[]) int cg5400(int argc, char* argv[])
{ {
TRipristina_stampa a ; TRipristina_stampa a ;
a.run(argc, argv, "Ripristino stampa registri"); a.run(argc, argv, "Ripristino stampe");
return 0; return 0;
} }

View File

@ -37,6 +37,7 @@ BEGIN
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
HELP "Anno IVA da cui ripristinare la stampa" HELP "Anno IVA da cui ripristinare la stampa"
WARNING "L'anno deve essere specificato" WARNING "L'anno deve essere specificato"
MESSAGE COPY,F_ESER
END END
STRING F_ESER 4 STRING F_ESER 4
@ -65,6 +66,7 @@ BEGIN
DISPLAY "Descrizione @50" S0 DISPLAY "Descrizione @50" S0
DISPLAY "Tipo" I0 DISPLAY "Tipo" I0
OUTPUT F_YEAR CODTAB[1,4] OUTPUT F_YEAR CODTAB[1,4]
OUTPUT F_ESER CODTAB[1,4]
OUTPUT F_REG CODTAB[5,7] OUTPUT F_REG CODTAB[5,7]
OUTPUT F_DREG S0 OUTPUT F_DREG S0
OUTPUT F_TIPO I0 OUTPUT F_TIPO I0