Patch level : 10.0

Files correlati     : ri0.exe
Ricompilazione Demo : [ ]
Commento            :
Modifiche cosmetiche: tolti metodi virtuali vuoti; TRUE -> true.


git-svn-id: svn://10.65.10.50/branches/R_10_00@21733 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-03-03 11:39:14 +00:00
parent f7d184c2bd
commit 3055eb875b
2 changed files with 11 additions and 23 deletions

View File

@ -11,39 +11,34 @@
#include "ri0400a.h" #include "ri0400a.h"
#include "rilib01.h" #include "rilib01.h"
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// TRicl_mask // TRicl_mask
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
class TRicl_mask : public TAutomask class TRicl_mask : public TAutomask
{ {
protected: protected:
void update_date_to(); void update_date_to();
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public: public:
TRicl_mask() : TAutomask("ri0400a") { } TRicl_mask() : TAutomask("ri0400a") { }
virtual ~TRicl_mask() { }
}; };
void TRicl_mask::update_date_to() void TRicl_mask::update_date_to()
{ {
const TString16 codper = get(F_PER);
const TDate dal = get_date(F_DAL); const TDate dal = get_date(F_DAL);
if (dal.ok()) if (dal.ok())
{ {
TEsercizi_contabili & es = esercizi(); TEsercizi_contabili & es = esercizi();
es.update(); es.update();
const TRectype & per = cache().get("&PER", codper);
const TString& codper = get(F_PER);
const TRectype& per = cache().get("&PER", codper);
TDate al = dal; TDate al = dal;
int nper = get_int(F_NPER); int nper = get_int(F_NPER);
if (nper <= 0)
if (nper == 0)
nper = 1; nper = 1;
al += per.get_int("I0") * nper; al += per.get_int("I0") * nper;
al += per.get_int("I1") * 7 * nper; al += per.get_int("I1") * 7 * nper;
@ -98,7 +93,7 @@ bool TRicl_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
default: default:
break; break;
} }
return TRUE; return true;
} }
@ -108,9 +103,6 @@ class TRicl_saldi : public TSkeleton_application
public: public:
virtual void main_loop(); virtual void main_loop();
TRicl_saldi() {}
virtual ~TRicl_saldi() {}
}; };
void TRicl_saldi::main_loop() void TRicl_saldi::main_loop()
@ -122,18 +114,17 @@ void TRicl_saldi::main_loop()
while (mask.run() != K_QUIT) while (mask.run() != K_QUIT)
{ {
output_file = mask.get(F_OUTPUT); output_file = mask.get(F_OUTPUT);
const TRecordsetExportFormat fmt = TString(output_file.ext()) == "txt" ? fmt_as400 : fmt_unknown; const TFixed_string ext(output_file.ext());
const TRecordsetExportFormat fmt = ext == "txt" ? fmt_as400 : fmt_unknown;
if (mask.get(F_RICL).full()) if (mask.get(F_RICL).full())
{ {
TSaldi_ricl_recordset recset(mask); TSaldi_ricl_recordset recset(mask);
recset.save_as(output_file, fmt); recset.save_as(output_file, fmt);
} }
else else
{ {
TSaldi_conti_recordset recset(mask); TSaldi_conti_recordset recset(mask);
recset.save_as(output_file, fmt); recset.save_as(output_file, fmt);
} }
} }
@ -152,13 +143,11 @@ void TRicl_saldi::main_loop()
if (codricl.full()) if (codricl.full())
{ {
TSaldi_ricl_recordset recset(codricl, codper, nper, dal, provv, all); TSaldi_ricl_recordset recset(codricl, codper, nper, dal, provv, all);
recset.save_as(output_file); recset.save_as(output_file);
} }
else else
{ {
TSaldi_conti_recordset recset(codper, nper, dal, provv, all); TSaldi_conti_recordset recset(codper, nper, dal, provv, all);
recset.save_as(output_file); recset.save_as(output_file);
} }
} }
@ -168,5 +157,5 @@ int ri0400 (int argc, char* argv[])
{ {
TRicl_saldi main_app; TRicl_saldi main_app;
main_app.run(argc, argv, TR("Riclassificazione saldi")); main_app.run(argc, argv, TR("Riclassificazione saldi"));
return TRUE; return true;
} }

View File

@ -590,9 +590,8 @@ TSaldi_conti_recordset::TSaldi_conti_recordset(const char * codper, int nper, co
set_fromto(); set_fromto();
if (sql.blank()) if (sql.blank())
{ {
TString query("USE "); TString query;
query << "USE " << LF_PCON;
query << LF_PCON;
query << "\nDISPLAY \"Gruppo\" GRUPPO\nDISPLAY \"Conto\" CONTO\nDISPLAY \"Sottoconto\" SOTTOCONTO\nDISPLAY \"Descrizione\" DESCR\nDISPLAY \"Indicatore Bil.\" INDBIL\n"; query << "\nDISPLAY \"Gruppo\" GRUPPO\nDISPLAY \"Conto\" CONTO\nDISPLAY \"Sottoconto\" SOTTOCONTO\nDISPLAY \"Descrizione\" DESCR\nDISPLAY \"Indicatore Bil.\" INDBIL\n";
set(query); set(query);
} }