Corretto ripristino stampa giornale

git-svn-id: svn://10.65.10.50/trunk@3635 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-09-19 13:28:01 +00:00
parent 80a6750a53
commit 6eae35b2c2
3 changed files with 15 additions and 29 deletions

View File

@ -64,18 +64,19 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
reg.zero(); reg.zero();
reg.put("CODTAB", s); reg.put("CODTAB", s);
TDate inizio_anno(1, 1, year); const TDate inizio_anno(1, 1, year);
if (reg.read(_isequal, _lock) == NOERR) if (reg.read(_isequal, _lock) == NOERR)
{ {
TDate dlast(reg.get_date("D3")); TDate dlast(reg.get_date("D3"));
/*
if (giornale) if (giornale)
{ {
TTable esc("ESC"); TTable esc("ESC");
esc.zero(); esc.zero();
esc.put("CODTAB", format("%04d", year)); esc.put("CODTAB", format("%04d", year));
if (esc.read() != NOERR) if (esc.read() != NOERR)
return error_box("Esercizio %s assente", year); return error_box("Esercizio %d assente", year);
TDate wd(esc.get_date("D0")); TDate wd(esc.get_date("D0"));
inizio_anno = wd; inizio_anno = wd;
@ -86,7 +87,7 @@ bool TRipristina_stampa::reg_restore(const TString& regist,
if (wd.month() > month || (wd.month() == month && wd.day() > day)) if (wd.month() > month || (wd.month() == month && wd.day() > day))
year++; year++;
} }
*/
const int ld = TDate::last_day(month, year); const int ld = TDate::last_day(month, year);
if (day > ld) day = ld; if (day > ld) day = ld;
TDate d(day, month, year); // Data di ripristino TDate d(day, month, year); // Data di ripristino
@ -234,7 +235,7 @@ bool TRipristina_stampa::menu(MENU_TAG)
giornale = msk.get_int(F_TIPO) == 5; giornale = msk.get_int(F_TIPO) == 5;
} }
const int year = msk.get_int(giornale ? F_ESER : F_YEAR); const int year = msk.get_int(F_YEAR);
const int month = msk.get_int(F_MESE); const int month = msk.get_int(F_MESE);
int day = giornale ? msk.get_int(F_DAY) : 1; int day = giornale ? msk.get_int(F_DAY) : 1;
if (day < 1) day = 1; if (day < 1) day = 1;
@ -246,7 +247,7 @@ bool TRipristina_stampa::menu(MENU_TAG)
mess << (giornale ? "l giornale" : "l registro"); mess << (giornale ? "l giornale" : "l registro");
else else
mess << "gli indici del libro "; mess << "gli indici del libro ";
mess << ' ' << reg << "\ndell'" << (giornale ? "esercizio " : "anno ") << year; mess << ' ' << reg << "\ndel " << year;
if (_op == restore_reg) mess << " della ditta " << firm; if (_op == restore_reg) mess << " della ditta " << firm;
mess << " dal " << day << '-' << month << '-' << year; mess << " dal " << day << '-' << month << '-' << year;

View File

@ -4,6 +4,8 @@
#define F_DREG 104 #define F_DREG 104
#define F_TIPO 105 #define F_TIPO 105
#define F_YEAR 106 #define F_YEAR 106
#define F_ESER 107 #define F_MESE 107
#define F_MESE 108 #define F_DAY 108
#define F_DAY 109
// #define F_ESER 109

View File

@ -38,22 +38,6 @@ 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
STRING F_ESER 4
BEGIN
PROMPT 4 3 "Esercizio "
USE ESC
INPUT CODTAB F_ESER
DISPLAY "Anno esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1
OUTPUT F_ESER CODTAB
CHECKTYPE REQUIRED
HELP "Esercizio da cui ripristinare la stampa"
WARNING "Esercizio assente"
ADD RUN cg0 -5 esc
END END
STRING F_REG 3 STRING F_REG 3
@ -68,7 +52,6 @@ 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
@ -95,10 +78,10 @@ END
LIST F_TIPO 15 LIST F_TIPO 15
BEGIN BEGIN
FLAGS "HG" FLAGS "HG"
ITEM "1|Vendite" MESSAGE HIDE,F_ESER|SHOW,F_YEAR|HIDE,F_DAY ITEM "1|Vendite" MESSAGE SHOW,F_YEAR|HIDE,F_DAY
ITEM "2|Vendite" MESSAGE HIDE,F_ESER|SHOW,F_YEAR|HIDE,F_DAY ITEM "2|Vendite" MESSAGE SHOW,F_YEAR|HIDE,F_DAY
ITEM "3|Riepilogativo" MESSAGE HIDE,F_ESER|SHOW,F_YEAR|HIDE,F_DAY ITEM "3|Riepilogativo" MESSAGE SHOW,F_YEAR|HIDE,F_DAY
ITEM "5|Giornale" MESSAGE SHOW,F_ESER|HIDE,F_YEAR|SHOW,F_DAY ITEM "5|Giornale" MESSAGE HIDE,F_YEAR|SHOW,F_DAY
END END
NUMBER F_DAY 2 NUMBER F_DAY 2