Patch level : 10.0 549

Files correlati     :
Ricompilazione Demo : [ ]

Corretta keyword nextcons nella stampa giri


git-svn-id: svn://10.65.10.50/trunk@19774 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-12-14 16:56:24 +00:00
parent 70d62e8472
commit 0411450568
4 changed files with 33 additions and 28 deletions

View File

@ -1,32 +1,6 @@
#include <applicat.h>
#include <reprint.h>
class TReport_lv : public TReport
{
protected:
virtual bool get_usr_val(const TString& name, TVariant& var) const;
};
bool TReport_lv::get_usr_val(const TString& name, TVariant& var) const
{
if (name == "#NEXTCONS")
{
TRecordset& recset = *recordset();
const long clifo = recset.get("CODCF").as_int();
const long contr = recset.get("CODCONT").as_int();
const TDate dtcons = recset.get("DTCONS").as_date();
if (clifo > 0 && contr > 0 && dtcons.ok())
{
// Scrivere qui il calcolo della prossima data di consegna ...
// ... al momento non sono capace di farlo!
TDate next_dtcons = dtcons;
next_dtcons += 7;
var = next_dtcons;
return true;
}
}
return TReport::get_usr_val(name, var);
}
#include "lvlib.h"
class TStampa_tabelle_lv : public TSkeleton_application
{

View File

@ -3,6 +3,7 @@
#include <reprint.h>
#include <textset.h>
#include "lvlib.h"
#include "lv2300a.h"
class TGiri_recordset: public TCSV_recordset
@ -174,7 +175,7 @@ bool TGiri_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
return true;
}
class TGiri_report : public TReport
class TGiri_report : public TReport_lv
{
protected:
virtual bool use_mask() { return false; }

View File

@ -1509,3 +1509,24 @@ TGiac_per_cli::TGiac_per_cli()
_year = 0;
_indsped = 0;
}
bool TReport_lv::get_usr_val(const TString& name, TVariant& var) const
{
if (name == "#NEXTCONS")
{
TRecordset& recset = *recordset();
const long clifo = recset.get("CODCF").as_int();
const long contr = recset.get("CODCONT").as_int();
const TDate dtcons = recset.get("DTCONS").as_date();
if (clifo > 0 && contr > 0 && dtcons.ok())
{
// Scrivere qui il calcolo della prossima data di consegna ...
// ... al momento non sono capace di farlo!
TDate next_dtcons = dtcons;
next_dtcons += 7;
var = next_dtcons;
return true;
}
}
return TReport::get_usr_val(name, var);
}

View File

@ -5,6 +5,10 @@
#include <recset.h>
#endif
#ifndef __REPORT_H
#include <report.h>
#endif
#ifndef __MGLIB_H
#include "../mg/mglib.h"
#endif
@ -355,5 +359,10 @@ public:
TGiac_per_cli(); //costruttore
};
class TReport_lv : public TReport
{
protected:
virtual bool get_usr_val(const TString& name, TVariant& var) const;
};
#endif