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 "rilib01.h"
///////////////////////////////////////////////////////////
// TRicl_mask
///////////////////////////////////////////////////////////
class TRicl_mask : public TAutomask
{
protected:
void update_date_to();
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TRicl_mask() : TAutomask("ri0400a") { }
virtual ~TRicl_mask() { }
};
void TRicl_mask::update_date_to()
{
const TString16 codper = get(F_PER);
const TDate dal = get_date(F_DAL);
if (dal.ok())
{
TEsercizi_contabili & es = esercizi();
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;
int nper = get_int(F_NPER);
if (nper == 0)
if (nper <= 0)
nper = 1;
al += per.get_int("I0") * nper;
al += per.get_int("I1") * 7 * nper;
@ -98,19 +93,16 @@ bool TRicl_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
default:
break;
}
return TRUE;
return true;
}
class TRicl_saldi : public TSkeleton_application
{
TRicl_mask *_mask;
public:
virtual void main_loop();
TRicl_saldi() {}
virtual ~TRicl_saldi() {}
};
void TRicl_saldi::main_loop()
@ -122,18 +114,17 @@ void TRicl_saldi::main_loop()
while (mask.run() != K_QUIT)
{
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())
{
TSaldi_ricl_recordset recset(mask);
recset.save_as(output_file, fmt);
}
else
{
TSaldi_conti_recordset recset(mask);
recset.save_as(output_file, fmt);
}
}
@ -152,13 +143,11 @@ void TRicl_saldi::main_loop()
if (codricl.full())
{
TSaldi_ricl_recordset recset(codricl, codper, nper, dal, provv, all);
recset.save_as(output_file);
}
else
{
TSaldi_conti_recordset recset(codper, nper, dal, provv, all);
recset.save_as(output_file);
}
}
@ -168,5 +157,5 @@ int ri0400 (int argc, char* argv[])
{
TRicl_saldi main_app;
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();
if (sql.blank())
{
TString query("USE ");
query << LF_PCON;
TString query;
query << "USE " << LF_PCON;
query << "\nDISPLAY \"Gruppo\" GRUPPO\nDISPLAY \"Conto\" CONTO\nDISPLAY \"Sottoconto\" SOTTOCONTO\nDISPLAY \"Descrizione\" DESCR\nDISPLAY \"Indicatore Bil.\" INDBIL\n";
set(query);
}