Implementata Gestione Vendite
git-svn-id: svn://10.65.10.50/trunk@189 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
94bfe36dfa
commit
fcb4332ba2
204
cg/cg0200.cpp
204
cg/cg0200.cpp
@ -8,14 +8,24 @@
|
|||||||
#include <anafis.h>
|
#include <anafis.h>
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
|
#include <msksheet.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "cg0.h"
|
#include "cg0.h"
|
||||||
#include "cg0200.h"
|
#include "cg0200.h"
|
||||||
|
#include "cg0201.h"
|
||||||
|
|
||||||
|
|
||||||
|
bool gest_vend()
|
||||||
|
{
|
||||||
|
TConfig c(CONFIG_DITTA,"cg");
|
||||||
|
return (c.get("GesVen") == "X");
|
||||||
|
}
|
||||||
|
|
||||||
class CG0200_application : public TRelation_application
|
class CG0200_application : public TRelation_application
|
||||||
{
|
{
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TRelation *_rel;
|
//TRelation *_rel;
|
||||||
|
TClifoVI *_rel;
|
||||||
TLocalisamfile* _saldi;
|
TLocalisamfile* _saldi;
|
||||||
TLocalisamfile* _anag;
|
TLocalisamfile* _anag;
|
||||||
TLocalisamfile* _fis;
|
TLocalisamfile* _fis;
|
||||||
@ -29,12 +39,27 @@ class CG0200_application : public TRelation_application
|
|||||||
virtual bool protected_record(TRectype &rec);
|
virtual bool protected_record(TRectype &rec);
|
||||||
virtual const char* get_next_key();
|
virtual const char* get_next_key();
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
|
virtual void init_insert_mode(TMask& m);
|
||||||
|
|
||||||
|
////////////
|
||||||
|
static bool indsp_notify(int r, KEY key);
|
||||||
|
static bool indsp_handler(TMask_field& f, KEY key) { return TRUE; }
|
||||||
|
virtual int write(const TMask& m);
|
||||||
|
virtual int rewrite(const TMask& m);
|
||||||
|
virtual int read(TMask& m);
|
||||||
|
TSheet_field& indsp_sheet() const;
|
||||||
|
void indsp_pack();
|
||||||
|
void common_f(const TMask& m);
|
||||||
|
///////////
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TRelation* get_relation() const {return _rel;}
|
virtual TRelation* get_relation() const {return (TRelation*)_rel;}
|
||||||
CG0200_application() {}
|
CG0200_application() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline CG0200_application& app()
|
||||||
|
{return (CG0200_application&)*MainApp();}
|
||||||
|
|
||||||
bool CG0200_application::protected_record(TRectype &rec)
|
bool CG0200_application::protected_record(TRectype &rec)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -305,6 +330,24 @@ HIDDEN bool codalleg_handler(TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CG0200_application::init_insert_mode(TMask& m)
|
||||||
|
{
|
||||||
|
if (!gest_vend())
|
||||||
|
{
|
||||||
|
for (int j=3; j<8;j++)
|
||||||
|
m.disable_page(j);
|
||||||
|
for (int i=F_CODINDDOC; i<= F_SHEET_G_VEN; i++)
|
||||||
|
m.disable(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int j=3; j<8;j++)
|
||||||
|
m.enable_page(j);
|
||||||
|
for (int i=F_CODINDDOC; i<= F_SHEET_G_VEN; i++)
|
||||||
|
m.enable(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CG0200_application::init_query_mode(TMask& m)
|
void CG0200_application::init_query_mode(TMask& m)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -312,6 +355,150 @@ void CG0200_application::init_query_mode(TMask& m)
|
|||||||
|
|
||||||
lbcn = (conf.get("GsLbCn") == "X");
|
lbcn = (conf.get("GsLbCn") == "X");
|
||||||
m.send_key(K_SHIFT + K_CTRL + (lbcn ? 's' : 'h'), -5);
|
m.send_key(K_SHIFT + K_CTRL + (lbcn ? 's' : 'h'), -5);
|
||||||
|
// Se non e' abilitata la gestione delle vendite disabilita le
|
||||||
|
// maschere dalla 4 in poi
|
||||||
|
|
||||||
|
if (!gest_vend())
|
||||||
|
{
|
||||||
|
for (int j=3; j<8;j++)
|
||||||
|
m.disable_page(j);
|
||||||
|
for (int i=F_CODINDDOC; i<= F_SHEET_G_VEN; i++)
|
||||||
|
m.disable(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int j=3; j<8;j++)
|
||||||
|
m.enable_page(j);
|
||||||
|
for (int i=F_CODINDDOC; i<= F_SHEET_G_VEN; i++)
|
||||||
|
m.enable(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int CG0200_application::read(TMask& m)
|
||||||
|
{
|
||||||
|
m.autoload(_rel);
|
||||||
|
indsp_sheet().reset();
|
||||||
|
TToken_string riga(240);
|
||||||
|
for (int i=0; i< _rel->indirizzi_items();i++)
|
||||||
|
{
|
||||||
|
TRectype& rec=_rel->indirizzo(i);
|
||||||
|
riga.cut(0);
|
||||||
|
riga.add(rec.get("CODIND"));
|
||||||
|
riga.add(rec.get("RAGSOC"));
|
||||||
|
riga.add(rec.get("INDIR"));
|
||||||
|
riga.add(rec.get("CIV"));
|
||||||
|
riga.add(rec.get("LOCALITA"));
|
||||||
|
riga.add(rec.get("CAP"));
|
||||||
|
riga.add(rec.get("STATO"));
|
||||||
|
riga.add(rec.get("COM"));
|
||||||
|
riga.add(rec.get("PTEL"));
|
||||||
|
riga.add(rec.get("TEL"));
|
||||||
|
riga.add(rec.get("PFAX"));
|
||||||
|
riga.add(rec.get("FAX"));
|
||||||
|
riga.add(rec.get("IVARID"));
|
||||||
|
indsp_sheet().row(i)=riga;
|
||||||
|
}
|
||||||
|
return _rel->status();
|
||||||
|
}
|
||||||
|
|
||||||
|
int CG0200_application::rewrite(const TMask& m)
|
||||||
|
{
|
||||||
|
common_f(m);
|
||||||
|
return _rel->rewrite(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CG0200_application::write(const TMask& m)
|
||||||
|
{
|
||||||
|
common_f(m);
|
||||||
|
return _rel->write(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
TSheet_field& CG0200_application::indsp_sheet() const
|
||||||
|
{
|
||||||
|
TSheet_field& o_sheet=(TSheet_field&) _msk->field(F_SHEET_G_VEN);
|
||||||
|
return o_sheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CG0200_application::indsp_pack()
|
||||||
|
{
|
||||||
|
TArray& rows = indsp_sheet().rows_array();
|
||||||
|
int nr=rows.items();
|
||||||
|
|
||||||
|
for (int i=0; i<nr; i++)
|
||||||
|
{
|
||||||
|
TToken_string& riga=(TToken_string&)rows[i];
|
||||||
|
if (riga.empty_items())
|
||||||
|
rows.destroy(i,FALSE);
|
||||||
|
}
|
||||||
|
rows.pack();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CG0200_application::common_f(const TMask& m)
|
||||||
|
{
|
||||||
|
char tipocf = m.get(F_TIPOCF)[0];
|
||||||
|
long codcf = m.get_long(F_CODCF);
|
||||||
|
_rel->lfile()->zero();
|
||||||
|
m.autosave(_rel);
|
||||||
|
_rel->destroy_rows();
|
||||||
|
indsp_pack();
|
||||||
|
TArray& rows=indsp_sheet().rows_array();
|
||||||
|
int n_items = rows.items();
|
||||||
|
for (int i=0; i<n_items;i++)
|
||||||
|
{
|
||||||
|
TToken_string& row=(TToken_string&)rows[i];
|
||||||
|
TRectype& rec=_rel->indirizzo(i);
|
||||||
|
rec.zero();
|
||||||
|
rec.put("TIPOCF",tipocf);
|
||||||
|
rec.put("CODCF",codcf);
|
||||||
|
rec.put("CODIND",row.get_long());
|
||||||
|
rec.put("RAGSOC",row.get());
|
||||||
|
rec.put("INDIR",row.get());
|
||||||
|
rec.put("CIV",row.get());
|
||||||
|
rec.put("LOCALITA",row.get());
|
||||||
|
rec.put("CAP",row.get());
|
||||||
|
rec.put("STATO",atoi(row.get()));
|
||||||
|
rec.put("COM",row.get());
|
||||||
|
rec.put("PTEL",row.get());
|
||||||
|
rec.put("TEL",row.get());
|
||||||
|
rec.put("PFAX",row.get());
|
||||||
|
rec.put("FAX",row.get());
|
||||||
|
rec.put("IVARID",row.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CG0200_application::indsp_notify(int r, KEY key)
|
||||||
|
{
|
||||||
|
TSheet_field& indsp=app().indsp_sheet();
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case K_DEL:
|
||||||
|
// Request to delete the row #r
|
||||||
|
// I need an empty record; leave only TIPOCF CODCF & CODIND
|
||||||
|
// so it returns FALSE because I don't want it to remove this row
|
||||||
|
// see cg0200b.uml
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
case K_SPACE: //request to modify row #r
|
||||||
|
// I hope it's always something like K_SPACE (Request to modify)
|
||||||
|
// Disable field # 101 (CODIND) update # of row
|
||||||
|
TMask& m = indsp.sheet_mask();
|
||||||
|
|
||||||
|
if (m.get_int(101)==0) // Is it a new row ?
|
||||||
|
m.set(101,(long)indsp.items());
|
||||||
|
m.disable(101);
|
||||||
|
break;
|
||||||
|
case K_INS: // request to add the row #r
|
||||||
|
if (indsp.items() == 999)
|
||||||
|
{
|
||||||
|
error_box("Raggiunto il numero massimo degli indirizzi per questo C/F");
|
||||||
|
return FALSE; // Refuse Permission
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0200_application::user_create() // initvar e arrmask
|
bool CG0200_application::user_create() // initvar e arrmask
|
||||||
@ -320,22 +507,18 @@ bool CG0200_application::user_create() // initvar e arrmask
|
|||||||
const bool spaut = has_module(SPAUT);
|
const bool spaut = has_module(SPAUT);
|
||||||
const bool anyaut = spaut || ftaut;
|
const bool anyaut = spaut || ftaut;
|
||||||
|
|
||||||
_rel = new TRelation(LF_CLIFO);
|
_rel = new TClifoVI;
|
||||||
|
|
||||||
_saldi = new TLocalisamfile(LF_SALDI);
|
_saldi = new TLocalisamfile(LF_SALDI);
|
||||||
_anag = new TLocalisamfile(LF_ANAG);
|
_anag = new TLocalisamfile(LF_ANAG);
|
||||||
_fis = new TLocalisamfile(LF_ANAGFIS);
|
_fis = new TLocalisamfile(LF_ANAGFIS);
|
||||||
_pcon = new TLocalisamfile(LF_PCON);
|
_pcon = new TLocalisamfile(LF_PCON);
|
||||||
_comuni = new TLocalisamfile(LF_COMUNI);
|
_comuni = new TLocalisamfile(LF_COMUNI);
|
||||||
_msk = new TMask("cg0200a") ;
|
_msk = new TMask("cg0200a") ;
|
||||||
_msk->enable(F_SCONTO,ftaut);
|
|
||||||
_msk->enable(F_CODVAL,ftaut);
|
_msk->enable(F_CODVAL,ftaut);
|
||||||
_msk->enable(F_RAGGRB,ftaut);
|
|
||||||
_msk->enable(F_RAGGFT,ftaut);
|
|
||||||
_msk->enable(F_CODVETT1,ftaut);
|
_msk->enable(F_CODVETT1,ftaut);
|
||||||
_msk->enable(F_CODVETT2,ftaut);
|
_msk->enable(F_CODVETT2,ftaut);
|
||||||
_msk->enable(F_CODVETT3,ftaut);
|
_msk->enable(F_CODVETT3,ftaut);
|
||||||
_msk->enable(F_CODCFFATT,ftaut);
|
|
||||||
_msk->enable(F_DESTIN,ftaut);
|
|
||||||
_msk->enable(F_FIDO,spaut);
|
_msk->enable(F_FIDO,spaut);
|
||||||
_msk->enable(F_CODABI, anyaut);
|
_msk->enable(F_CODABI, anyaut);
|
||||||
_msk->enable(F_CODBAN, anyaut);
|
_msk->enable(F_CODBAN, anyaut);
|
||||||
@ -348,6 +531,11 @@ bool CG0200_application::user_create() // initvar e arrmask
|
|||||||
_msk->set_handler(F_ALLEG, alleg_handler);
|
_msk->set_handler(F_ALLEG, alleg_handler);
|
||||||
_msk->set_handler(F_CODALLEG, codalleg_handler);
|
_msk->set_handler(F_CODALLEG, codalleg_handler);
|
||||||
|
|
||||||
|
_msk->set_handler(F_SHEET_G_VEN, indsp_handler);
|
||||||
|
|
||||||
|
TSheet_field& ind = (TSheet_field&) _msk->field(F_SHEET_G_VEN);
|
||||||
|
ind.set_notify(indsp_notify);
|
||||||
|
|
||||||
_saldi->setkey(2);
|
_saldi->setkey(2);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
84
cg/cg0200.h
84
cg/cg0200.h
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define F_TIPOCF 101
|
#define F_TIPOCF 101
|
||||||
#define F_CODCF 102
|
#define F_CODCF 102
|
||||||
#define F_RAGSOC 103
|
#define F_RAGSOC 103
|
||||||
@ -44,16 +43,9 @@
|
|||||||
#define F_RAGSOC1 132
|
#define F_RAGSOC1 132
|
||||||
#define F_CODABI 133
|
#define F_CODABI 133
|
||||||
#define F_CODBAN 134
|
#define F_CODBAN 134
|
||||||
#define F_SCONTO 135
|
|
||||||
#define F_CODVAL 136
|
#define F_CODVAL 136
|
||||||
#define F_RAGGRB 137
|
|
||||||
#define F_RAGGFT 138
|
|
||||||
#define F_FIDO 139
|
#define F_FIDO 139
|
||||||
#define F_CODVETT1 140
|
#define F_LOCALITACF 144
|
||||||
#define F_CODVETT2 141
|
|
||||||
#define F_CODVETT3 142
|
|
||||||
#define F_CODCFFATT 143
|
|
||||||
#define F_DESTIN 144
|
|
||||||
#define F_CODAG 145
|
#define F_CODAG 145
|
||||||
#define F_SOSPESO 146
|
#define F_SOSPESO 146
|
||||||
#define F_CODALLEG 148
|
#define F_CODALLEG 148
|
||||||
@ -61,6 +53,76 @@
|
|||||||
#define F_DENCOMCF 150
|
#define F_DENCOMCF 150
|
||||||
#define F_PROVCF 152
|
#define F_PROVCF 152
|
||||||
|
|
||||||
#define DLG_RIC 200
|
#define F_RICALT 151
|
||||||
#define DLG_CST 201
|
#define F_PTEL2 153
|
||||||
|
#define F_TEL2 154
|
||||||
|
#define F_PTEL3 155
|
||||||
|
#define F_TEL3 156
|
||||||
|
#define F_CODLIN 157
|
||||||
|
|
||||||
|
#define F_TIPOCFVEN 158
|
||||||
|
#define F_CODCFVEN 159
|
||||||
|
#define F_CODINDDOC 160
|
||||||
|
#define F_CODNOTE 161
|
||||||
|
#define F_CODLEG 162
|
||||||
|
#define F_CODCATC 163
|
||||||
|
#define F_CODZONA 164
|
||||||
|
#define F_PROVV 165
|
||||||
|
#define F_LIQPAG 166
|
||||||
|
#define F_CODPRCF 167
|
||||||
|
#define F_CODINDSP 168
|
||||||
|
#define F_CODPORTO 169
|
||||||
|
#define F_RAGGDOC 170
|
||||||
|
#define F_NCOPIE 171
|
||||||
|
#define F_CODCFASS 172
|
||||||
|
#define F_ASSFIS 173
|
||||||
|
#define F_FATTSOSP 174
|
||||||
|
#define F_VSNRPROT 175
|
||||||
|
#define F_VSDATAREG 176
|
||||||
|
#define F_NSNRPROT 177
|
||||||
|
#define F_NSDATAREG 178
|
||||||
|
#define F_ADDBNS1500 179
|
||||||
|
#define F_CATFIN 180
|
||||||
|
#define F_CODABIPR 181
|
||||||
|
#define F_CODBANPR 182
|
||||||
|
#define F_CODINDEFF 183
|
||||||
|
#define F_EMEFFRICH 184
|
||||||
|
#define F_CODNOTESP1 185
|
||||||
|
#define F_CODNOTESP2 186
|
||||||
|
#define F_CODSPMEZZO 187
|
||||||
|
#define F_IMPMINEFF 188
|
||||||
|
#define F_NONACCEFF 189
|
||||||
|
#define F_NONSCADEFF 190
|
||||||
|
#define F_ADDBOLLIRB 191
|
||||||
|
#define F_ADDBOLLITR 192
|
||||||
|
#define F_ADDSPINC 193
|
||||||
|
#define F_IVARID 194
|
||||||
|
#define F_GESTCONTR 195
|
||||||
|
#define F_CATVEN 196
|
||||||
|
#define F_CODLIST 197
|
||||||
|
#define F_CODSCINC 198
|
||||||
|
#define F_SCONTOCL 199
|
||||||
|
#define F_CODMAG 200
|
||||||
|
#define F_CODSP1 201
|
||||||
|
#define F_CODSP2 202
|
||||||
|
#define F_CODSP3 203
|
||||||
|
#define F_CODSP4 204
|
||||||
|
#define F_PROFSOLL 205
|
||||||
|
#define F_MAXSOLL 206
|
||||||
|
#define F_DATAESC 207
|
||||||
|
#define F_DATASOLL 208
|
||||||
|
#define F_SCONTOR 209
|
||||||
|
#define F_TITOLO 210
|
||||||
|
#define F_RAGGOR 211
|
||||||
|
#define F_MINORD 212
|
||||||
|
#define F_MAXORD 213
|
||||||
|
#define F_PREVORD 214
|
||||||
|
#define F_TIPOEVORD 215
|
||||||
|
#define F_SHEET_G_VEN 216
|
||||||
|
#define F_CODVETT1 217
|
||||||
|
#define F_CODVETT2 218
|
||||||
|
#define F_CODVETT3 219
|
||||||
|
|
||||||
|
#define DLG_RIC 300
|
||||||
|
#define DLG_CST 301
|
||||||
#endif // __CG0200_H
|
#endif // __CG0200_H
|
||||||
|
138
cg/cg0200b.uml
Executable file
138
cg/cg0200b.uml
Executable file
@ -0,0 +1,138 @@
|
|||||||
|
|
||||||
|
#include "cg0200.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 74 16
|
||||||
|
|
||||||
|
NUMBER 101 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Codice "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 102 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Rag. soc. "
|
||||||
|
HELP "Inserire la ragione sociale"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 103 35
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Indirizzo "
|
||||||
|
HELP "Inserire l'indirizzo"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 104 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 54 4 "N. "
|
||||||
|
HELP "Inserire il numero civico"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 105 35
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Localita "
|
||||||
|
HELP "Inserire la localita"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 106 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 54 5 "CAP "
|
||||||
|
HELP "Inserire il Codice di Avviamento Postale"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER 107 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Stato "
|
||||||
|
FLAGS "RZ"
|
||||||
|
USE %STA
|
||||||
|
INPUT CODTAB 107
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Stato@50" S0
|
||||||
|
OUTPUT 107 CODTAB
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Stato assente"
|
||||||
|
HELP "Inserire il codice dello stato"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 108 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 54 6 "Comune "
|
||||||
|
FLAGS "U"
|
||||||
|
USE LF_COMUNI
|
||||||
|
INPUT STATO 107
|
||||||
|
INPUT COM 108
|
||||||
|
DISPLAY "Stato" STATO
|
||||||
|
DISPLAY "Codice" COM
|
||||||
|
DISPLAY "Comune@50" DENCOM
|
||||||
|
OUTPUT 107 STATO
|
||||||
|
OUTPUT 108 COM
|
||||||
|
OUTPUT 106 CAPCOM
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Comune assente"
|
||||||
|
ADD MASK ba4100a
|
||||||
|
HELP "Inserire il codice del comune"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 72 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "Numeri Telefonici"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 109 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 9 "Telefono "
|
||||||
|
HELP "Inserire il prefisso ed il numero di telefono"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 110 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 9 ""
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 111 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 10 "Fax "
|
||||||
|
HELP "Inserire il prefisso del numero di fax"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING 112 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 10 ""
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN 113
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 13 "Riduzione IVA"
|
||||||
|
HELP "Flag per la riduzione IVA"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -13 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -23 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_NULL 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -33 -1 "Elimina"
|
||||||
|
MESSAGE RESET,1@
|
||||||
|
MESSAGE EXIT,K_ENTER
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
147
cg/cg0201.cpp
Executable file
147
cg/cg0201.cpp
Executable file
@ -0,0 +1,147 @@
|
|||||||
|
#include "cg0201.h"
|
||||||
|
#include <lffiles.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern bool gest_vend();
|
||||||
|
// Definizione dei metodi relativi alla classe TClifoVI
|
||||||
|
|
||||||
|
|
||||||
|
TClifoVI::TClifoVI():TRelation(LF_CLIFO), _oldindirizzi(0)
|
||||||
|
{
|
||||||
|
add(LF_CFVEN,"TIPOCF=TIPOCF|CODCF=CODCF");
|
||||||
|
add(LF_INDSP,"TIPOCF=TIPOCF|CODCF=CODCF");
|
||||||
|
}
|
||||||
|
|
||||||
|
void TClifoVI::destroy_rows()
|
||||||
|
{
|
||||||
|
_indirizzi.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
TRectype& TClifoVI::indirizzo(int i)
|
||||||
|
{
|
||||||
|
TRectype *r=(TRectype*)_indirizzi.objptr(i);
|
||||||
|
|
||||||
|
if (r == NULL)
|
||||||
|
{
|
||||||
|
r = new TRectype(LF_INDSP);
|
||||||
|
_indirizzi.add(r,i);
|
||||||
|
}
|
||||||
|
return *r;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::read_indirizzi()
|
||||||
|
{
|
||||||
|
const TLocalisamfile* rind = lfile(LF_INDSP);
|
||||||
|
// Put here gest_vend() discrimination
|
||||||
|
if (gest_vend())
|
||||||
|
{
|
||||||
|
position_rels();
|
||||||
|
destroy_rows();
|
||||||
|
for (bool ok=is_first_match(LF_INDSP); ok; ok=next_match(LF_INDSP))
|
||||||
|
{
|
||||||
|
const int nriga=rind->get_int("CODIND") -1;
|
||||||
|
indirizzo(nriga)=rind->curr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_oldindirizzi=indirizzi_items();
|
||||||
|
return NOERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::read(TIsamop op, TReclock lockop, TDate& atdate)
|
||||||
|
{
|
||||||
|
int err=file()->read(op,lockop,atdate);
|
||||||
|
if (err==NOERR) read_indirizzi();
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::write_rec(bool re, const TRectype& rec, TLocalisamfile* f)
|
||||||
|
{
|
||||||
|
if (re)
|
||||||
|
{
|
||||||
|
const bool scrivi= (f->rewrite(rec)!=NOERR);
|
||||||
|
if (scrivi) f->write(rec);
|
||||||
|
} else
|
||||||
|
f->write(rec);
|
||||||
|
return f->status();
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::cancella(TLocalisamfile* f, int da, int a)
|
||||||
|
{
|
||||||
|
const char tipocf=lfile()->get("TIPOCF")[0];
|
||||||
|
const long codcf=lfile()->get_long("CODCF");
|
||||||
|
|
||||||
|
for (int i=da; i<=a;i++)
|
||||||
|
{
|
||||||
|
f->zero();
|
||||||
|
f->put("TIPOCF",tipocf);
|
||||||
|
f->put("CODCF",codcf);
|
||||||
|
f->put("CODIND",i);
|
||||||
|
if (f->read(_isequal,_lock)==NOERR)
|
||||||
|
f->remove();
|
||||||
|
}
|
||||||
|
return f->status();
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::registra(bool re, bool force)
|
||||||
|
{
|
||||||
|
TLocalisamfile* c=lfile(LF_CLIFO);
|
||||||
|
int err=write_rec(re,c->curr(),c);
|
||||||
|
if (err!=NOERR) return err;
|
||||||
|
|
||||||
|
// Put here gest_vend() discrimination
|
||||||
|
if (gest_vend())
|
||||||
|
{
|
||||||
|
TLocalisamfile* v=lfile(LF_CFVEN);
|
||||||
|
err=write_rec(TRUE,v->curr(),v);
|
||||||
|
if (err!=NOERR) return err;
|
||||||
|
|
||||||
|
TLocalisamfile* rind=lfile(LF_INDSP);
|
||||||
|
const char tipocf=c->get("TIPOCF")[0];
|
||||||
|
const long codcf=c->get_long("CODCF");
|
||||||
|
|
||||||
|
for (int i=0; i<indirizzi_items(); i++)
|
||||||
|
{
|
||||||
|
if (!re)
|
||||||
|
{
|
||||||
|
indirizzo(i).put("TIPOCF",tipocf);
|
||||||
|
indirizzo(i).put("CODCF",codcf);
|
||||||
|
}
|
||||||
|
err=write_rec(TRUE,indirizzo(i),rind);
|
||||||
|
}
|
||||||
|
if (i<_oldindirizzi)
|
||||||
|
cancella(rind,i+1,_oldindirizzi);
|
||||||
|
_oldindirizzi=indirizzi_items();
|
||||||
|
}
|
||||||
|
// END of gest_vend() discrimination
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::write(bool force, TDate&)
|
||||||
|
{
|
||||||
|
_oldindirizzi=0;
|
||||||
|
return registra(FALSE,force);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::rewrite(bool force, TDate&)
|
||||||
|
{
|
||||||
|
return registra(TRUE,force);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TClifoVI::remove(TDate&)
|
||||||
|
{
|
||||||
|
TLocalisamfile* c=lfile(LF_CLIFO);
|
||||||
|
TLocalisamfile* v=lfile(LF_CFVEN);
|
||||||
|
TLocalisamfile* rind=lfile(LF_INDSP);
|
||||||
|
|
||||||
|
c->remove();
|
||||||
|
|
||||||
|
// Put here gest_vend() discrimination
|
||||||
|
if (gest_vend())
|
||||||
|
{
|
||||||
|
cancella(rind,1,_oldindirizzi);
|
||||||
|
v->remove();
|
||||||
|
}
|
||||||
|
_oldindirizzi=0;
|
||||||
|
|
||||||
|
return c->status();
|
||||||
|
}
|
35
cg/cg0201.h
Executable file
35
cg/cg0201.h
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#ifndef __RELATION_H
|
||||||
|
#include <relation.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class TClifoVI:public TRelation
|
||||||
|
{
|
||||||
|
// @DPRIV
|
||||||
|
TArray _indirizzi;
|
||||||
|
int _oldindirizzi;
|
||||||
|
// @END
|
||||||
|
protected:
|
||||||
|
// @FPROT
|
||||||
|
int write_rec(bool re, const TRectype& r, TLocalisamfile* f);
|
||||||
|
int cancella(TLocalisamfile* f, int da, int a);
|
||||||
|
int registra(bool re, bool force);
|
||||||
|
int read_indirizzi();
|
||||||
|
// @END
|
||||||
|
public:
|
||||||
|
virtual int next(TReclock lockop=_nolock) {return (lfile()->next(lockop) || read_indirizzi());}
|
||||||
|
virtual int prev(TReclock lockop=_nolock) {return (lfile()->prev(lockop) || read_indirizzi());}
|
||||||
|
virtual int first(TReclock lockop=_nolock) {return (lfile()->first(lockop) || read_indirizzi());}
|
||||||
|
virtual int last(TReclock lockop=_nolock) {return (lfile()->last(lockop) || read_indirizzi());}
|
||||||
|
virtual int skip(TReclock lockop=_nolock) {return (lfile()->skip(lockop) || read_indirizzi());}
|
||||||
|
virtual int read(TIsamop = _isgteq, TReclock lockop = _nolock, TDate& atdate = (TDate&) botime);
|
||||||
|
virtual int write(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
||||||
|
virtual int rewrite(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
||||||
|
virtual int remove(TDate& atdate = (TDate&) botime);
|
||||||
|
|
||||||
|
TRectype& indirizzo(int i);
|
||||||
|
int indirizzi_items() const {return _indirizzi.items();}
|
||||||
|
void destroy_rows();
|
||||||
|
|
||||||
|
TClifoVI();
|
||||||
|
virtual ~TClifoVI() {}
|
||||||
|
};
|
@ -40,3 +40,5 @@
|
|||||||
#define CHK_RRMECO 139
|
#define CHK_RRMECO 139
|
||||||
#define FLD_RRCCRA 140
|
#define FLD_RRCCRA 140
|
||||||
#define FLD_RRCCRI 141
|
#define FLD_RRCCRI 141
|
||||||
|
|
||||||
|
#define CHK_GESVEN 142
|
||||||
|
@ -55,7 +55,7 @@ BEGIN
|
|||||||
FIELD RifPar
|
FIELD RifPar
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 76 9
|
GROUPBOX DLG_NULL 76 10
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 7 ""
|
PROMPT 2 7 ""
|
||||||
END
|
END
|
||||||
@ -118,6 +118,12 @@ BEGIN
|
|||||||
FIELD GeLiDi
|
FIELD GeLiDi
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN CHK_GESVEN
|
||||||
|
BEGIN
|
||||||
|
PROMPT 4 15 "Gestione vendite"
|
||||||
|
HELP ""
|
||||||
|
FIELD GesVen
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
@ -32,7 +32,9 @@ $(O)/cg0.o: cg0.cpp $(I10) $(I24) $(I32)
|
|||||||
|
|
||||||
$(O)/cg0100.o: cg0100.cpp $(I15) $(I31) $(I53) cg0100.h cg0.h $(IP)pconti.h
|
$(O)/cg0100.o: cg0100.cpp $(I15) $(I31) $(I53) cg0100.h cg0.h $(IP)pconti.h
|
||||||
|
|
||||||
$(O)/cg0200.o: cg0200.cpp $(I8) $(I15) $(I31) $(I53) $(I31) $(I43) $(I46) $(I56) cg0200.h cg0.h
|
$(O)/cg0200.o: cg0200.cpp $(I8) $(I15) $(I31) $(I53) $(I31) $(I43) $(I46) $(I56) cg0200.h cg0.h cg0201.h
|
||||||
|
|
||||||
|
$(O)/cg0201.o: cg0201.cpp $(I8) $(I15) $(I31) $(I53) $(I31) $(I43) $(I46) $(I56) cg0201.h
|
||||||
|
|
||||||
$(O)/cg0300.o: cg0300.cpp $(I15) $(I31) $(I53) cg0300.h cg0.h
|
$(O)/cg0300.o: cg0300.cpp $(I15) $(I31) $(I53) cg0300.h cg0.h
|
||||||
|
|
||||||
@ -41,8 +43,8 @@ $(O)/cg0400.o: cg0400.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0400.h cg
|
|||||||
$(O)/cg0500.o: cg0500.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h
|
$(O)/cg0500.o: cg0500.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h
|
||||||
$(O)/cg0501.o: cg0501.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h cg0501.h
|
$(O)/cg0501.o: cg0501.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h cg0501.h
|
||||||
|
|
||||||
$(EP)cg0: $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg0501.o $(O)/conto.o $(LIBD1) $(EP)cg0.frl
|
$(EP)cg0: $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0201.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg0501.o $(O)/conto.o $(LIBD1) $(EP)cg0.frl
|
||||||
$(LINK) $(LFLAGSD1) $@ $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg0501.o $(O)/conto.o
|
$(LINK) $(LFLAGSD1) $@ $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0201.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg0501.o $(O)/conto.o
|
||||||
|
|
||||||
$(EP)cg0.frl: cg0.url $(U1)
|
$(EP)cg0.frl: cg0.url $(U1)
|
||||||
$(RCOMP) cg0 -l $(EP)cg0
|
$(RCOMP) cg0 -l $(EP)cg0
|
||||||
|
@ -74,5 +74,7 @@ RrMeCo = X
|
|||||||
RrCcRa =
|
RrCcRa =
|
||||||
# Codice causale riscontri
|
# Codice causale riscontri
|
||||||
RrCcRi =
|
RrCcRi =
|
||||||
|
# Gestione Vendite
|
||||||
|
GesVen =
|
||||||
|
|
||||||
[EOF]
|
[EOF]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user