Patch level : 10.0
Files correlati : lv0 Ricompilazione Demo : [ ] Commento : Programma generico per stampa tabelle lavanderie git-svn-id: svn://10.65.10.50/trunk@17223 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3b202a25b5
commit
e5f3e5ed35
@ -7,6 +7,7 @@ int main(int argc, char** argv)
|
||||
const int r = (argc > 1) ? argv[1][1] - '0' : 0;
|
||||
switch (r)
|
||||
{
|
||||
case 1: lv0200(argc, argv); break; // stampa tabelle lavanderie lv0200
|
||||
case 2: lv0300(argc, argv); break; // parametri lavanderie lv0300
|
||||
case 3: lv0400(argc, argv); break; // gestione contratti lv0400
|
||||
case 4: lv0500(argc, argv); break; // passaggi planning per contratto lv0500 (e periodi di sospensione)
|
||||
|
1
lv/lv0.h
1
lv/lv0.h
@ -2,6 +2,7 @@
|
||||
#define __LV0_H
|
||||
|
||||
int lv0100(int argc, char* argv[]);
|
||||
int lv0200(int argc, char* argv[]);
|
||||
int lv0300(int argc, char* argv[]);
|
||||
int lv0400(int argc, char* argv[]);
|
||||
int lv0500(int argc, char* argv[]);
|
||||
|
67
lv/lv0200.cpp
Executable file
67
lv/lv0200.cpp
Executable file
@ -0,0 +1,67 @@
|
||||
#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);
|
||||
}
|
||||
|
||||
class TStampa_tabelle_lv : public TSkeleton_application
|
||||
{
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
};
|
||||
|
||||
void TStampa_tabelle_lv::main_loop()
|
||||
{
|
||||
// Costruisce il nome del report in base alla riga di comando
|
||||
TFilename rep;
|
||||
if (argc() > 2)
|
||||
{
|
||||
rep = argv(2);
|
||||
rep.strip("-&%$^");
|
||||
if (rep.len() == 3)
|
||||
rep.insert("lvst");
|
||||
rep.ext("rep");
|
||||
}
|
||||
|
||||
TReport_lv r;
|
||||
bool ok = r.load(rep); // Controlla l'effettiva esistenza del report
|
||||
while (ok)
|
||||
{
|
||||
TReport_book b;
|
||||
ok = b.add(r); // Richiede parametri di stampa in base alla maschera omonima
|
||||
if (ok)
|
||||
b.print_or_preview(); // Stampa effettivamente
|
||||
}
|
||||
}
|
||||
|
||||
int lv0200(int argc, char* argv[])
|
||||
{
|
||||
TStampa_tabelle_lv app;
|
||||
app.run(argc, argv, TR("Stampa tabelle"));
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user