Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@18392 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c66486725c
commit
ea275165bd
27
ve/ve0.cpp
27
ve/ve0.cpp
@ -2,30 +2,19 @@
|
||||
|
||||
#include "ve0.h"
|
||||
|
||||
int main( int argc, char** argv )
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = -1;
|
||||
const int r = (argc > 1) ? atoi( &argv[1][1] ) : 1;
|
||||
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : 1;
|
||||
switch (r)
|
||||
{
|
||||
case 2:
|
||||
rt = ve0200( argc, argv ); // Parametri Vendite
|
||||
break;
|
||||
case 3:
|
||||
rt = ve0300( argc, argv ); // Compilatore Profili
|
||||
break;
|
||||
case 4:
|
||||
rt = ve0400( argc, argv ); // Gestione Tabelle
|
||||
break;
|
||||
case 5:
|
||||
rt = ve0500( argc, argv ); // Gestione Glossario
|
||||
break;
|
||||
default:
|
||||
rt = ve0100( argc, argv ); // Gestione Documenti
|
||||
break;
|
||||
case 2: rt = ve0200(argc, argv); break; // Parametri Vendite
|
||||
case 3: rt = ve0300(argc, argv); break; // Compilatore Profili
|
||||
case 4: rt = ve0400(argc, argv); break; // Gestione Tabelle
|
||||
case 5: rt = ve0500(argc, argv); break; // Gestione Glossario
|
||||
case 6: rt = ve0600(argc, argv); break; // Tabelle di modulo
|
||||
default: rt = ve0100(argc, argv); break; // Gestione Documenti
|
||||
}
|
||||
exit(rt);
|
||||
return rt;
|
||||
}
|
||||
|
||||
|
2
ve/ve0.h
2
ve/ve0.h
@ -6,6 +6,6 @@ int ve0200(int argc, char* argv[]); // Configurazione vendite
|
||||
int ve0300(int argc, char* argv[]); // Generatore di maschere
|
||||
int ve0400(int argc, char* argv[]); // Generatore di tabelle
|
||||
int ve0500(int argc, char* argv[]); // Gestione Glossario
|
||||
int ve0600(int argc, char* argv[]); // Gestione tabelle di modulo
|
||||
|
||||
#endif // __VE0_H
|
||||
|
||||
|
@ -473,7 +473,7 @@ bool num_filter(const TRelation* r)
|
||||
{
|
||||
const TCodice_numerazione & cod_num = cached_numerazione(r->curr().get("CODTAB"));
|
||||
|
||||
int last = cod_num.ntipi_doc();
|
||||
const int last = cod_num.ntipi_doc();
|
||||
for (int i = 0; i < last; i++ )
|
||||
if (tipodoc_ok(cod_num.tipo_doc(i)))
|
||||
return true;
|
||||
|
@ -41,9 +41,11 @@ public:
|
||||
void TVendite_mask::get_printer_config(TString& config) const
|
||||
{
|
||||
config = _tab;
|
||||
for (TEditable_field* f = get_key_field(1, TRUE); f;
|
||||
f = get_key_field(1, FALSE)) if (f->shown())
|
||||
config << f->get();
|
||||
for (TEditable_field* f = get_key_field(1, TRUE); f; f = get_key_field(1, FALSE))
|
||||
{
|
||||
if (f->shown())
|
||||
config << f->get();
|
||||
}
|
||||
}
|
||||
|
||||
bool TVendite_mask::get_printer_name(TString& name) const
|
||||
@ -145,6 +147,8 @@ protected:
|
||||
virtual int write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
|
||||
bool is_table(const char* tab) const { return get_tabname() == tab; }
|
||||
|
||||
public:
|
||||
};
|
||||
|
||||
@ -243,7 +247,7 @@ TMask* TVendite_tabapp::set_mask(TMask* m)
|
||||
{
|
||||
ca_create_fields(*vm, 0, LF_PCONANA, 2, 16, RSS_CDC_V1, RSS_CDC_V1+10, 0x0, "S1");
|
||||
add_anal_fields(*vm);
|
||||
}
|
||||
} else
|
||||
if (vm->table_code() == "ATR")
|
||||
{
|
||||
ca_create_fields(*vm, 0, LF_PCONANA, 2, 12, ATR_CDC_V1, ATR_CDC_V1+10, 0x0, "S1");
|
||||
@ -257,7 +261,7 @@ TMask* TVendite_tabapp::set_mask(TMask* m)
|
||||
|
||||
void TVendite_tabapp::init_query_mode(TMask& m)
|
||||
{
|
||||
if (get_tabname() == "RSS")
|
||||
if (is_table("RSS"))
|
||||
{
|
||||
m.enable(RSS_RAGSOC);
|
||||
}
|
||||
@ -265,7 +269,7 @@ void TVendite_tabapp::init_query_mode(TMask& m)
|
||||
|
||||
void TVendite_tabapp::init_insert_mode(TMask& m)
|
||||
{
|
||||
if (get_tabname() == "RSS")
|
||||
if (is_table("RSS"))
|
||||
{
|
||||
m.disable(RSS_RAGSOC);
|
||||
}
|
||||
@ -273,7 +277,7 @@ void TVendite_tabapp::init_insert_mode(TMask& m)
|
||||
|
||||
void TVendite_tabapp::init_modify_mode(TMask& m)
|
||||
{
|
||||
if (get_tabname() == "RSS")
|
||||
if (is_table("RSS"))
|
||||
{
|
||||
m.disable(RSS_RAGSOC);
|
||||
}
|
||||
@ -282,57 +286,54 @@ void TVendite_tabapp::init_modify_mode(TMask& m)
|
||||
int TVendite_tabapp::read(TMask& m)
|
||||
{
|
||||
int err = Tab_application::read(m);
|
||||
const TString & table_name = get_tabname();
|
||||
|
||||
if (get_relation()->lfile().get_real("R10") == ZERO)
|
||||
if (table_name == "SPP")
|
||||
m.set(SPP_PREZZO, get_relation()->lfile().get("R0"));
|
||||
else
|
||||
if (table_name == "PRS")
|
||||
m.set(PRS_PREZZO, get_relation()->lfile().get("R0"));
|
||||
else
|
||||
if (table_name == "RSS")
|
||||
m.set(RSS_PREZZO, get_relation()->lfile().get("R0"));
|
||||
else
|
||||
if (table_name == "ATR")
|
||||
m.set(ATR_PREZZO, get_relation()->lfile().get("R0"));
|
||||
if (err == NOERR)
|
||||
{
|
||||
const TRectype& curr = get_relation()->curr();
|
||||
if (curr.get_real("R10").is_zero())
|
||||
{
|
||||
const TString& r0 = curr.get("R0");
|
||||
if (is_table("SPP"))
|
||||
m.set(SPP_PREZZO, r0); else
|
||||
if (is_table("PRS"))
|
||||
m.set(PRS_PREZZO, r0); else
|
||||
if (is_table("RSS"))
|
||||
m.set(RSS_PREZZO, r0); else
|
||||
if (is_table("ATR"))
|
||||
m.set(ATR_PREZZO, r0);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
int TVendite_tabapp::write(const TMask& m)
|
||||
{
|
||||
const TString & table_name = get_tabname();
|
||||
const TString& table_name = get_tabname();
|
||||
|
||||
if (table_name == "SPP")
|
||||
get_relation()->lfile().put("R0", m.get(SPP_PREZZO));
|
||||
else
|
||||
if (table_name == "PRS")
|
||||
get_relation()->lfile().put("R0", m.get(PRS_PREZZO));
|
||||
else
|
||||
if (table_name == "RSS")
|
||||
get_relation()->lfile().put("R0", m.get(RSS_PREZZO));
|
||||
else
|
||||
if (table_name == "ATR")
|
||||
get_relation()->lfile().put("R0", m.get(ATR_PREZZO));
|
||||
TRectype& curr = get_relation()->curr();
|
||||
if (is_table("SPP"))
|
||||
curr.put("R0", m.get(SPP_PREZZO)); else
|
||||
if (is_table("PRS"))
|
||||
curr.put("R0", m.get(PRS_PREZZO)); else
|
||||
if (is_table("RSS"))
|
||||
curr.put("R0", m.get(RSS_PREZZO)); else
|
||||
if (is_table("ATR"))
|
||||
curr.put("R0", m.get(ATR_PREZZO));
|
||||
|
||||
return Tab_application::write(m);
|
||||
}
|
||||
|
||||
int TVendite_tabapp::rewrite(const TMask& m)
|
||||
{
|
||||
const TString & table_name = get_tabname();
|
||||
|
||||
if (table_name == "SPP")
|
||||
get_relation()->lfile().put("R0", m.get(SPP_PREZZO));
|
||||
else
|
||||
if (table_name == "PRS")
|
||||
get_relation()->lfile().put("R0", m.get(PRS_PREZZO));
|
||||
else
|
||||
if (table_name == "RSS")
|
||||
get_relation()->lfile().put("R0", m.get(RSS_PREZZO));
|
||||
else
|
||||
if (table_name == "ATR")
|
||||
get_relation()->lfile().put("R0", m.get(ATR_PREZZO));
|
||||
const TString& table_name = get_tabname();
|
||||
TRectype& curr = get_relation()->curr();
|
||||
if (is_table("SPP"))
|
||||
curr.put("R0", m.get(SPP_PREZZO)); else
|
||||
if (is_table("PRS"))
|
||||
curr.put("R0", m.get(PRS_PREZZO)); else
|
||||
if (is_table("RSS"))
|
||||
curr.put("R0", m.get(RSS_PREZZO)); else
|
||||
if (is_table("ATR"))
|
||||
curr.put("R0", m.get(ATR_PREZZO));
|
||||
|
||||
return Tab_application::rewrite(m);
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <checks.h>
|
||||
#include <relapp.h>
|
||||
#include "ve0.h"
|
||||
|
||||
@ -7,40 +6,35 @@ class TGlossario_application : public TRelation_application
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
virtual const char * extra_modules() const {return "dt";}
|
||||
|
||||
protected:
|
||||
virtual const char* extra_modules() const { return "dt"; }
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) { return _msk; }
|
||||
virtual bool changing_mask(int mode) { return FALSE;}
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
|
||||
public:
|
||||
TGlossario_application() : _msk(NULL), _rel(NULL) {}
|
||||
virtual ~TGlossario_application() {}
|
||||
};
|
||||
|
||||
bool TGlossario_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_GOLEM);
|
||||
_msk = new TMask("ve0500a");
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TGlossario_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int ve0500(int argc, char* argv[])
|
||||
{
|
||||
TGlossario_application a;
|
||||
a.run(argc, argv, "Gestione glossario");
|
||||
a.run(argc, argv, TR("Gestione glossario"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
64
ve/ve0600.cpp
Executable file
64
ve/ve0600.cpp
Executable file
@ -0,0 +1,64 @@
|
||||
#include "ve0.h"
|
||||
|
||||
#include <automask.h>
|
||||
#include <modtbapp.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Maschera di gestione tabella CVM:
|
||||
// Condizioni di vendita per categoria e gruppo merceologico
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TCVM_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TCVM_mask() : TAutomask("vetbcvm") {}
|
||||
};
|
||||
|
||||
bool TCVM_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Applicazione per gestione maschere di modulo
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TVE_tab_mod_app : public TTable_module_application
|
||||
{
|
||||
protected:
|
||||
virtual TMask* user_create_mask();
|
||||
|
||||
public:
|
||||
const TString& table_name() const;
|
||||
};
|
||||
|
||||
const TString& TVE_tab_mod_app::table_name() const
|
||||
{
|
||||
TRelation* rel = get_relation();
|
||||
return get_tmp_string() = rel->lfile().name();
|
||||
}
|
||||
|
||||
TMask* TVE_tab_mod_app::user_create_mask()
|
||||
{
|
||||
if (table_name() == "CVM")
|
||||
return new TCVM_mask;
|
||||
return TTable_module_application::user_create_mask();
|
||||
}
|
||||
|
||||
int TVE_tab_mod_app::read(TMask& m)
|
||||
{
|
||||
if (table_name() == "CVM")
|
||||
return ((TCVM_mask&)m).read_mask(*get_realtion());
|
||||
return TTable_module_application::read(m);
|
||||
}
|
||||
|
||||
int ve0600(int argc, char* argv[])
|
||||
{
|
||||
TVE_tab_mod_app a;
|
||||
a.run(argc, argv, TR("Tabelle module vendite"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -244,8 +244,7 @@ protected:
|
||||
virtual void campi_raggruppamento_righe(TToken_string& campi_riga) const;
|
||||
virtual void campi_raggruppamento(TToken_string& campi) const;
|
||||
virtual bool doc_raggruppabile(const TDocumento & doc) const { return doc.raggruppabile(); }
|
||||
virtual bool doc_raggruppabile(const TDocumento & doc_in, const TDocumento & doc_out, TToken_string & campi) const
|
||||
{ return doc_in.raggruppabile(doc_out, campi); }
|
||||
virtual bool doc_raggruppabili(const TDocumento & doc_in, const TDocumento & doc_out, TToken_string & campi) const;
|
||||
|
||||
virtual void add_rows(TRiga_documento & rout, TRiga_documento & rin) { rout += rin; }
|
||||
virtual void create_row(TDocumento& doc_out, const TRiga_documento & rin);
|
||||
|
10
ve/vetbcvm.h
Executable file
10
ve/vetbcvm.h
Executable file
@ -0,0 +1,10 @@
|
||||
#define F_CVM_COD 201
|
||||
#define F_CVM_DES 202
|
||||
#define F_CVM_SHT 203
|
||||
|
||||
#define F_CVM_CODGM 101
|
||||
#define F_CVM_DESGM 102
|
||||
#define F_CVM_GRUPPO 103
|
||||
#define F_CVM_CONTO 104
|
||||
#define F_CVM_SOTTOCONTO 105
|
||||
#define F_CVM_DESCONTO 106
|
107
ve/vetbcvm.uml
Executable file
107
ve/vetbcvm.uml
Executable file
@ -0,0 +1,107 @@
|
||||
#include "vetbcvm.h"
|
||||
|
||||
TOOLBAR "Toolbar" 0 0 0 2
|
||||
#include <relapbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Conti di vendita per categoria e gruppo" 0 2 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 0 "@bCategoria di vendita"
|
||||
END
|
||||
|
||||
STRING F_CVM_COD 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
USE CVE
|
||||
INPUT CODTAB F_CVM_COD
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_CVM_COD CODTAB
|
||||
OUTPUT F_CVM_DES S0
|
||||
CHECKTYPE REQUIRED
|
||||
KEY 1
|
||||
END
|
||||
|
||||
STRING F_CVM_DES 50
|
||||
BEGIN
|
||||
PROMPT 16 1 ""
|
||||
USE CVE KEY 2
|
||||
INPUT S0 F_CVM_DES
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_CVM_COD
|
||||
CHECKTYPE NORMAL
|
||||
KEY 1
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 1 3 "@bGruppi merceologici"
|
||||
END
|
||||
|
||||
SPREADSHEET F_CVM_SHT
|
||||
BEGIN
|
||||
PROMPT 0 4 ""
|
||||
ITEM "Gruppo\nMerc."
|
||||
ITEM "Descrizione\nGruppo merceologico@50"
|
||||
ITEM "Gruppo\nCont."
|
||||
ITEM "Conto\nCont."
|
||||
ITEM "Sottoconto\nCont."
|
||||
ITEM "Descrizione\nConto contabile@50"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Conto" -1 -1 60 6
|
||||
|
||||
GROUPBOX DLG_NULL 58 3
|
||||
BEGIN
|
||||
PROMPT 1 1 "Gruppo Merceologico"
|
||||
END
|
||||
|
||||
STRING F_CVM_CODGM 5
|
||||
BEGIN
|
||||
PROMPT 2 2 "Codice "
|
||||
END
|
||||
|
||||
STRING F_CVM_DESGM 50
|
||||
BEGIN
|
||||
PROMPT 12 2 ""
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 58 4
|
||||
BEGIN
|
||||
PROMPT 1 4 "Conto contabile"
|
||||
END
|
||||
|
||||
NUMBER F_CVM_GRUPPO 3
|
||||
BEGIN
|
||||
PROMPT 2 5 "Gruppo "
|
||||
END
|
||||
|
||||
NUMBER F_CVM_CONTO 3
|
||||
BEGIN
|
||||
PROMPT 16 5 "Conto "
|
||||
END
|
||||
|
||||
NUMBER F_CVM_SOTTOCONTO 6
|
||||
BEGIN
|
||||
PROMPT 30 5 "Sottoconto "
|
||||
USE LF_PCON
|
||||
INPUT GRUPPO F_CVM_GRUPPO
|
||||
INPUT CONTO F_CVM_CONTO
|
||||
INPUT SOTTOCONTO F_CVM_SOTTOCONTO
|
||||
END
|
||||
|
||||
STRING F_CVM_DESCONTO 50
|
||||
BEGIN
|
||||
PROMPT 1 6 "Descrizione"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user