Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@17070 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
rajitgill 2008-08-21 15:41:07 +00:00
parent de0b940d47
commit 8a7c148eb6
2 changed files with 130 additions and 4 deletions

88
lv/lv0400.cpp Executable file
View File

@ -0,0 +1,88 @@
#include <relapp.h>
#include <recset.h>
#include "lv0400.h"
class TContratti_app: public TRelation_application
{
TMask* _amsk;
TMask* _bmsk;
TRelation* _rel;
bool _unicont;
protected:
virtual bool changing_mask (int mode) { return true;}
virtual TMask* get_mask (int mode) {return mode==MODE_QUERY?_amsk:_bmsk; }
virtual TRelation* get_relation() const {return _rel;}
virtual bool user_create();
virtual bool user_destroy();
virtual void on_config_change();
virtual bool get_next_key(TToken_string& key);
};
bool TContratti_app:: user_create()
{
_rel=new TRelation (LF_LVCONDV);
_amsk= new TMask ("lv0400a");
_bmsk= new TMask ("lv0400b");
return true;
}
bool TContratti_app:: user_destroy()
{
delete _bmsk;
delete _amsk;
delete _rel;
return true;
}
void TContratti_app:: on_config_change()
{
TConfig ini(CONFIG_DITTA);
_unicont=ini.get_bool("UniCont");
}
bool TContratti_app:: get_next_key(TToken_string& key)
{
const long cliente=_amsk->get_long(F_CODCF);
if (cliente<=0) return false;
key.add(F_CODCF);
key.add(cliente);
key.add(F_CODCONT);
long codcont=0;
if (_unicont)
{
TISAM_recordset recset ("USE LVCONDV");
for (bool ok=recset.move_first(); ok; ok=recset.move_next())
{
const long codice=recset.get("CODCONT").as_int();
if (codice>codcont)
codcont=codice;
}
}
else
{
TString query;
query<<"USE LVCONDV \n"
<<"FROM CODCF=#CLIENTE\n"
<<"TO CODCF=#CLIENTE\n";
TISAM_recordset recset (query);
recset.set_var("#CLIENTE",cliente);
if (recset.move_last())
codcont=recset.get("CODCONT").as_int();
}
codcont++;
key.add(codcont);
return true;
}
int lv0400(int argc, char* argv[])
{
TContratti_app app;
app.run (argc,argv,TR("Gestione contratti"));
return 0;
}

View File

@ -1,4 +1,42 @@
#define F_CODCF 101
#define F_RAGSOC_CLI 102
#define F_CODCONT 103
#define F_DES_CODCONT 104
#define F_CODCF 101
#define F_RAGSOC_CLI 102
#define F_CODCONT 103
#define F_DES_CODCONT 104
#define F_SHEET_ATTIV 105
#define F_PERFATT 106
#define F_TIPOCAN 107
#define F_INPERFATT 108
#define F_DTLASTFATT 109
#define F_ATTFATTNODT 110
#define F_FORFNOCONS 111
#define F_TIPOSTPRZ 112
#define F_TIPOLIS 113
#define F_TIPOIMB 114
#define F_CONTSPOR 115
#define F_RIFBOLLEFATT 116
#define F_ADDCAPROT 117
#define F_PROFORME 118
#define F_STRCONS 119
#define F_FATTSOSP 120
#define F_STDICITURA 121
#define F_CICLAGGIO 122
#define F_STPRZBOL 123
#define F_STETIMATI 124
#define F_STETITS 125
#define F_STDDTPTS 126
#define F_IMPMINFATT 127
#define F_PERCNOCONT 128
#define F_PERCTOLLPES 129
#define F_NUMUT 130
#define F_NUMETI 131
#define S_ARTICOLO 101
#define S_DESCR 102
#define S_UM 103
#define S_PREZZOST 104
#define S_PREZZORN 105
#define S_SCONTO 106
#define S_DOTIN 107
#define S_DOTIN 108
#define S_CONSMESE 109
#define S_CONSANNO 110
#define S_DOTTMP 111