ve0100.cpp Aggiunto supporto per il caricamento delle righe da .ini
ve0100.h Aggiunto metodo mask2ini ve0100c.cpp Corretto #include errato di cgpagame.h velib.h Reso pubblico il metodo TTipo_riga_documento::read velib02.cpp Sostituito "TIPORIGA" con RDOC_TIPORIGA git-svn-id: svn://10.65.10.50/trunk@5866 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b147bb60ed
commit
22328a76d7
@ -18,12 +18,12 @@
|
||||
|
||||
void TMotore_application::init_query_mode( TMask& m )
|
||||
{
|
||||
_msk->set( F_CODNUM, _codnum);
|
||||
_msk->field(F_CODNUM).set_focusdirty(TRUE);
|
||||
_msk->field(F_CODNUM).on_key(K_TAB);
|
||||
_msk->field(F_CODNUM).set_dirty(FALSE);
|
||||
|
||||
_msk->set( F_TIPODOC, _tipodoc, TRUE);
|
||||
_msk->set( F_CODNUM, _codnum);
|
||||
_msk->field(F_CODNUM).set_focusdirty(TRUE);
|
||||
_msk->field(F_CODNUM).on_key(K_TAB);
|
||||
_msk->field(F_CODNUM).set_dirty(FALSE);
|
||||
|
||||
_msk->set( F_TIPODOC, _tipodoc, TRUE);
|
||||
}
|
||||
|
||||
void TMotore_application::init_insert_mode( TMask& m )
|
||||
@ -117,7 +117,7 @@ TMask * TMotore_application::ss_getmask( int numriga, TMask& fullmask)
|
||||
return ((TTipo_riga_documento &)riga.tipo()).mask();
|
||||
}
|
||||
else
|
||||
return & fullmask;
|
||||
return &fullmask;
|
||||
}
|
||||
|
||||
void TMotore_application::user_set_handler( int fieldid, int index, TMask* m )
|
||||
@ -674,7 +674,7 @@ const char* TMotore_application::get_next_key( )
|
||||
return key;
|
||||
}
|
||||
|
||||
int TMotore_application::read( TMask& m )
|
||||
int TMotore_application::read(TMask& m)
|
||||
{
|
||||
// m.autoload(*_rel);
|
||||
TRelation_application::read(m);
|
||||
@ -690,9 +690,8 @@ int TMotore_application::read( TMask& m )
|
||||
for (int i = 1; i <= rows; i++)
|
||||
{
|
||||
f.insert(-1, FALSE);
|
||||
TToken_string & r = f.row(i -1);
|
||||
TToken_string & r = f.row(i-1);
|
||||
TRiga_documento & rec = (*_doc)[i];
|
||||
|
||||
rec.autoload(f);
|
||||
f.check_row(i - 1);
|
||||
}
|
||||
@ -715,6 +714,45 @@ int TMotore_application::rewrite( const TMask& m ) // C 90
|
||||
return TRelation_application::rewrite(m);
|
||||
}
|
||||
|
||||
// Riempie lo sheet con le righe documento specificate nel .ini
|
||||
void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
||||
{
|
||||
TRelation_application::ini2mask(ini, msk, query); // Default processing
|
||||
if (query)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
TSheet_field& f = msk.sfield(F_SHEET);
|
||||
TTipo_riga_documento tr;
|
||||
|
||||
// Scorre tutti i pragrafi delle righe documento
|
||||
for (int i = 1; ini.set_paragraph(format("%d,%d", LF_RIGHEDOC, i)); i++)
|
||||
{
|
||||
// Considera solo i tipi riga validi
|
||||
const TString16 tipo = ini.get(RDOC_TIPORIGA);
|
||||
if (tr.read(tipo) == NOERR)
|
||||
{
|
||||
// Crea una nuova riga documento
|
||||
TRiga_documento& rec = _doc->new_row(tipo);
|
||||
// Riempie i campi della nuova riga
|
||||
TAssoc_array& var = ini.list_variables();
|
||||
FOR_EACH_ASSOC_STRING(var, obj, key, val)
|
||||
{
|
||||
if (stricmp(key, RDOC_NRIGA) != 0) // Ignora il numero riga
|
||||
rec.put(key, val);
|
||||
}
|
||||
// solo la insert chiama la post_insert necessaria alla disabilitazione verifichiamo
|
||||
// l'autoload ??
|
||||
// f.insert(-1, FALSE);
|
||||
// Aggiunge la riga allo sheet
|
||||
rec.autoload(f);
|
||||
f.check_row(rec.numero()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TMotore_application::open_files(int logicnum, ...)
|
||||
{
|
||||
|
@ -65,6 +65,7 @@ class TMotore_application : public TRelation_application
|
||||
virtual int read( TMask& m );
|
||||
virtual int write( const TMask& m );
|
||||
virtual int rewrite( const TMask& m );
|
||||
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
||||
|
||||
// Funzioni da associare ad ogni procedura
|
||||
int user_function( int index );
|
||||
@ -105,8 +106,8 @@ protected:
|
||||
void configura_sheet( TSheet_field& sheet, TConfig& config );
|
||||
|
||||
public:
|
||||
|
||||
virtual TRelation* get_relation( ) const { return _rel;}
|
||||
virtual const char* get_next_key( );
|
||||
|
||||
// Funzioni di accesso alle variabili private
|
||||
|
||||
@ -129,10 +130,8 @@ public:
|
||||
TSheet_field & ss( ) const { return *_sheet; }
|
||||
TMotore_application( ) { _pro = NULL; }
|
||||
virtual ~TMotore_application( ) { if ( _pro ) delete _pro; }
|
||||
virtual const char* get_next_key( );
|
||||
|
||||
};
|
||||
|
||||
inline TMotore_application & app() { return (TMotore_application &) main_app(); }
|
||||
inline TMotore_application& app() { return (TMotore_application &) main_app(); }
|
||||
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef __PAGAMENT_H
|
||||
#include "..\cg\pagament.h"
|
||||
#include "..\cg\cgpagame.h"
|
||||
#endif
|
||||
|
||||
#ifndef __SCONTI_H
|
||||
|
10
ve/velib.h
10
ve/velib.h
@ -316,7 +316,6 @@ class TTipo_riga_documento : public TRectype // velib02
|
||||
|
||||
protected:
|
||||
void read_formule();
|
||||
int read(const char* tiporig);
|
||||
|
||||
public:
|
||||
TObject* dup() const { return new TTipo_riga_documento(codice()); }
|
||||
@ -326,16 +325,17 @@ public:
|
||||
const TString& mask_name() const { return profile_name();}
|
||||
const TString& codice() const { return get("CODTAB");}
|
||||
bool mask_loaded() const { return _mask != NULL; }
|
||||
TVariable_mask * mask();
|
||||
TVariable_mask* mask();
|
||||
|
||||
const TString& descrizione() const { return get("S0"); }
|
||||
char tipo() const { return get_char("S7"); }
|
||||
const TString& imponibile() const { return _imponibile;}
|
||||
const TString& provv() const { return _provv;}
|
||||
|
||||
TFormula_documento * first_formula() { return succ_formula(TRUE); }
|
||||
TFormula_documento * succ_formula(bool restart = FALSE);
|
||||
TFormula_documento* first_formula() { return succ_formula(TRUE); }
|
||||
TFormula_documento* succ_formula(bool restart = FALSE);
|
||||
|
||||
int read(const char* tiporig);
|
||||
TTipo_riga_documento(const char* tiporig = NULL);
|
||||
TTipo_riga_documento(const TRectype& rec);
|
||||
virtual ~TTipo_riga_documento();
|
||||
@ -370,7 +370,7 @@ public:
|
||||
bool is_merce() const { return tipo().tipo() == 'M';}
|
||||
bool is_spese() const { return tipo().tipo() == 'S';}
|
||||
bool is_prestazione() const { return tipo().tipo() == 'P';}
|
||||
bool is_sconto() const {return tipo().tipo() == 'C';}
|
||||
bool is_sconto() const {return tipo().tipo() == 'C';}
|
||||
bool is_sconto_perc() const { return get(RDOC_SCONTO).not_empty();}
|
||||
bool is_omaggio() const { return tipo().tipo() == 'O';}
|
||||
bool is_descrizione() const { return tipo().tipo() == 'D';}
|
||||
|
@ -557,11 +557,11 @@ bool TRiga_documento::doc_dependent() const
|
||||
|
||||
void TRiga_documento::put_str(const char* fieldname, const char* val)
|
||||
{
|
||||
if (strcmp(fieldname, "TIPORIGA") == 0)
|
||||
if (strcmp(fieldname, RDOC_TIPORIGA) == 0)
|
||||
{
|
||||
const TString v(val);
|
||||
const TString16 v(val);
|
||||
|
||||
if (TRectype::get("TIPORIGA") != v)
|
||||
if (TRectype::get(RDOC_TIPORIGA) != v)
|
||||
{
|
||||
TAuto_variable_rectype::put_str(fieldname, v);
|
||||
reset_fields(*this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user