Separati i programmi di rinumerazione e ricalcolo saldi

Corretta segnalazione nelle copie


git-svn-id: svn://10.65.10.50/trunk@668 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-11-18 17:38:53 +00:00
parent 00bfa3954b
commit 30ff853857
5 changed files with 314 additions and 278 deletions

View File

@ -4,9 +4,6 @@
MENU TASK_MENUBAR MENU TASK_MENUBAR
SUBMENU MENU_FILE "~File" SUBMENU MENU_FILE "~File"
ITEM BAR_ITEM(1) "~Movimenti"
ITEM BAR_ITEM(2) "~Saldi"
/* cg4 -1 Copia archivi piano conti, causali, clienti/fornitori iv direttiva */ /* cg4 -1 Copia archivi piano conti, causali, clienti/fornitori iv direttiva */
MENUBAR MENU_BAR(1) MENUBAR MENU_BAR(1)

View File

@ -49,13 +49,14 @@ struct therec {
class CG4100_App : public TApplication class CG4100_App : public TApplication
{ {
TString _year; TString _year;
char _optype;
public: public:
virtual bool create(); virtual bool create();
virtual bool destroy(); virtual bool destroy();
bool set_parms(bool year); bool set_parms();
virtual bool menu(MENU_TAG m); virtual bool menu(MENU_TAG m);
void restore_mov(TSystemisamfile& a, TSystemisamfile& b, TSystemisamfile& c); void restore_mov(TSystemisamfile& a, TSystemisamfile& b, TSystemisamfile& c);
@ -63,8 +64,7 @@ public:
bool sort_mov(); bool sort_mov();
bool sort_sal(); bool sort_sal();
CG4100_App() : TApplication(), _year(4) CG4100_App() : TApplication(), _year(4), _optype('S') {}
{ }
virtual ~CG4100_App() {} virtual ~CG4100_App() {}
}; };
@ -85,7 +85,9 @@ bool CG4100_App::create()
if (fexist("__mov__.sav")) if (fexist("__mov__.sav"))
warning_box("Un'operazione di riordino movimenti si e' conclusa" warning_box("Un'operazione di riordino movimenti si e' conclusa"
" impropriamente. Si raccomanda di rieseguirla"); " impropriamente. Si raccomanda di rieseguirla");
if (argc() > 2)
_optype = toupper(argv(2)[0]);
dispatch_e_menu(MENU_ITEM(1));
return TRUE; return TRUE;
} }
@ -99,16 +101,17 @@ bool CG4100_App::destroy()
return TApplication::destroy(); return TApplication::destroy();
} }
bool CG4100_App::set_parms(bool year) bool CG4100_App::set_parms()
{ {
TMask m("cg4100a"); const bool saldi = _optype == 'S';
TMask m(saldi ? "cg4100b" : "cg4100a");
if (!year)
m.hide(FLD_CG41_YEAR);
m.run(); m.run();
if (saldi)
_year = m.get(FLD_CG41_YEAR); _year = m.get(FLD_CG41_YEAR);
else
_year = 0;
return m.last_key() == K_ENTER; return m.last_key() == K_ENTER;
} }
@ -116,16 +119,12 @@ bool CG4100_App::set_parms(bool year)
bool CG4100_App::menu(MENU_TAG m) bool CG4100_App::menu(MENU_TAG m)
{ {
switch (m) if (_optype == 'S')
{
case BAR_ITEM(1):
sort_mov();
break;
case BAR_ITEM(2):
sort_sal(); sort_sal();
break; else
} if (_optype == 'M')
return TApplication::menu(m); sort_mov();
return FALSE;
} }
@ -187,7 +186,7 @@ void CG4100_App::restore_mov(TSystemisamfile& mov, TSystemisamfile& rmov,
bool CG4100_App::sort_mov() bool CG4100_App::sort_mov()
{ {
if (!set_parms(FALSE)) if (!set_parms())
return FALSE; return FALSE;
TSystemisamfile mov(LF_MOV); TSystemisamfile mov(LF_MOV);
@ -238,7 +237,7 @@ bool CG4100_App::sort_mov()
strcpy(rbuf.REG, mov.get(MOV_REG)); strcpy(rbuf.REG, mov.get(MOV_REG));
d = mov.get(MOV_DATADOC); d = mov.get(MOV_DATADOC);
s = mov.get(MOV_PROTIVA); s = mov.get(MOV_PROTIVA);
if (isdigit(s[s.len() - 1])) s << " "; if (s.len() > 0 && isdigit(s[s.len() - 1])) s << " ";
s.right_just(8); s.right_just(8);
strcpy(rbuf.NUMPROT, (const char *) s); strcpy(rbuf.NUMPROT, (const char *) s);
strcpy(rbuf.DATADOC, d.string(ANSI)); strcpy(rbuf.DATADOC, d.string(ANSI));
@ -347,7 +346,7 @@ bool CG4100_App::sort_mov()
bool CG4100_App::sort_sal() bool CG4100_App::sort_sal()
{ {
if (!set_parms(TRUE)) if (!set_parms())
return FALSE; return FALSE;
FILE* fp = fopen ("__sal__.sav","w"); FILE* fp = fopen ("__sal__.sav","w");

View File

@ -1,6 +1,4 @@
#define FLD_CG41_YEAR 100 PAGE "Riordino Movimenti" -1 -1 47 10
PAGE "Riordino Movimenti/Saldi" -1 -1 47 10
TEXT DLG_NULL TEXT DLG_NULL
BEGIN BEGIN
@ -17,22 +15,14 @@ BEGIN
PROMPT 3 4 "tempo. Siate certi di voler proseguire." PROMPT 3 4 "tempo. Siate certi di voler proseguire."
END END
NUMBER FLD_CG41_YEAR 4
BEGIN
PROMPT 3 6 "Anno da riordinare "
FLAGS "A"
HELP "Anno del quale si desidera il riordino degli archivi"
END
BUTTON DLG_OK 9 2 BUTTON DLG_OK 9 2
BEGIN BEGIN
PROMPT -12 -1 "Conferma" PROMPT -12 -1 "Conferma"
END END
BUTTON DLG_CANCEL 9 2 BUTTON DLG_QUIT 9 2
BEGIN BEGIN
PROMPT -22 -1 "Annulla" PROMPT -22 -1 ""
END END
ENDPAGE ENDPAGE

46
cg/cg4100b.uml Executable file
View File

@ -0,0 +1,46 @@
#define FLD_CG41_YEAR 100
PAGE "Ricalcolo Saldi" -1 -1 47 10
TEXT DLG_NULL
BEGIN
PROMPT 16 1 "ATTENZIONE"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 3 "Il ricalcolo degli saldi puo' richiedere"
END
TEXT DLG_NULL
BEGIN
PROMPT 3 4 "tempo. Siate certi di voler proseguire."
END
NUMBER FLD_CG41_YEAR 4
BEGIN
PROMPT 3 6 "Anno di esercizio "
USE ESC
INPUT CODTAB FLD_CG41_YEAR
DISPLAY "Anno Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1
OUTPUT FLD_CG41_YEAR CODTAB
CHECKTYPE REQUIRED
HELP "Anno del quale si desidera il ricalcolo dei saldi"
WARNING "L' anno di esercizio e' obbligatorio"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 "Conferma"
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -172,7 +172,7 @@ bool TCopia_archivi::menu(MENU_TAG)
if ((mov.eod() == 0) || (!copy_pcon && !copy_causali && !copy_clifo)) if ((mov.eod() == 0) || (!copy_pcon && !copy_causali && !copy_clifo))
{ {
TString mess("Attenzione "); TString mess("Attenzione \n");
int count = 0; int count = 0;
if (copy_pcon) if (copy_pcon)
@ -182,29 +182,32 @@ bool TCopia_archivi::menu(MENU_TAG)
} }
if (copy_causali) if (copy_causali)
{ {
if (count > 0) mess << ","; if (count > 0) mess << ",\n";
mess << " le causali"; mess << " le causali";
count++; count++;
} }
if (copy_clifo) if (copy_clifo)
{ {
if (count > 0) mess << ","; if (count > 0) mess << ",\n";
mess << " i clienti e fornitori"; mess << " i clienti e fornitori";
count++; count++;
} }
if (copy_ivd) if (copy_ivd)
{ {
if (count > 0) mess << ","; if (count > 0) mess << ",\n";
mess << " la riclassificazione IV direttiva"; mess << " la riclassificazione IV direttiva";
count++; count++;
} }
mess << " della ditta " << to_firm; mess << "\n della ditta " << to_firm;
if (count > 1) if (count > 1)
mess << " saranno sovrascritti"; mess << " saranno sovrascritti";
else else
mess << " sara' sovrascritto"; mess << " sara' sovrascritto";
mess << ". Devo continuare"; mess << ". Devo continuare";
if (yesno_box((const char *) mess)) if (yesno_box((const char *) mess))
{
mess.rtrim(16); mess << " Devo veramente continuare";
if (yesno_box((const char *) mess))
{ {
if (copy_pcon) if (copy_pcon)
{ {
@ -222,6 +225,7 @@ bool TCopia_archivi::menu(MENU_TAG)
copyivd(from_firm, to_firm); copyivd(from_firm, to_firm);
} }
} }
}
else error_box("La copia si puo' effettuare solo se non sono stati registrati movimenti"); else error_box("La copia si puo' effettuare solo se non sono stati registrati movimenti");
set_firm(_default_firm); set_firm(_default_firm);
} }