Aggiornato uso della TRelapp::get_next_key e tolte migliaia di #include
git-svn-id: svn://10.65.10.50/trunk@6595 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fdbdc4c011
commit
2e968de2c9
11
ve/sconti.h
11
ve/sconti.h
@ -1,20 +1,17 @@
|
||||
#ifndef __SCONTI_H
|
||||
#define __SCONTI_H
|
||||
|
||||
#ifndef __REAL_H
|
||||
#include <real.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TCLIFOR_H
|
||||
#include "clifor.h"
|
||||
#endif
|
||||
|
||||
#ifndef __VELIB_H
|
||||
#include "velib.h"
|
||||
class TMask;
|
||||
class TDocumento_mask;
|
||||
#endif
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#include <config.h>
|
||||
class TConfig;
|
||||
#endif
|
||||
|
||||
class TCond_vendita : public TObject
|
||||
@ -73,7 +70,7 @@ public:
|
||||
|
||||
TCond_vendita(TCli_for * clifo = NULL, TConfig * _ditta = NULL, TDocumento_mask * testa = NULL, TMask * riga = NULL,
|
||||
TLocalisamfile * anamag = NULL, TLocalisamfile * umart = NULL);
|
||||
~TCond_vendita() {}
|
||||
virtual ~TCond_vendita() {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,10 +1,7 @@
|
||||
#include <xvt.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "ve0.h"
|
||||
|
||||
#define usage "Errore - Utilizzo: %s -{0|1|2}"
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
int rt = -1;
|
||||
@ -12,9 +9,6 @@ int main( int argc, char** argv )
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 1:
|
||||
rt = ve0100( argc, argv );
|
||||
break;
|
||||
case 2:
|
||||
rt = ve0200( argc, argv );
|
||||
break;
|
||||
@ -22,7 +16,7 @@ int main( int argc, char** argv )
|
||||
rt = ve0300( argc, argv );
|
||||
break;
|
||||
default:
|
||||
error_box( usage, argv[0] );
|
||||
rt = ve0100( argc, argv );
|
||||
break;
|
||||
}
|
||||
exit(0);
|
||||
|
@ -664,10 +664,9 @@ TMask* TMotore_application::get_mask( int mode )
|
||||
}
|
||||
}
|
||||
|
||||
const char* TMotore_application::get_next_key( )
|
||||
{
|
||||
TMask& m = curr_mask( );
|
||||
//const TString16 value = m.get( F_CODNUM );
|
||||
bool TMotore_application::get_next_key(TToken_string& key)
|
||||
{
|
||||
TMask& m = curr_mask();
|
||||
|
||||
// Se per questa numerazione h abilitata le numerazione automatica
|
||||
if( _cod_num->auto_num())
|
||||
@ -677,9 +676,9 @@ const char* TMotore_application::get_next_key( )
|
||||
doc.put("CODNUM", _cod_num->codice());
|
||||
doc.put("ANNO", m.get(F_ANNO));
|
||||
doc.put("PROVV", m.get(F_PROVV));
|
||||
|
||||
TRectype cmp_rec(doc.curr()); // record campione
|
||||
|
||||
|
||||
const TRectype cmp_rec(doc.curr()); // record campione
|
||||
|
||||
doc.put( "NDOC", 9999999L );
|
||||
if (doc.read(_isgreat) == NOERR)
|
||||
doc.prev();
|
||||
@ -687,10 +686,9 @@ const char* TMotore_application::get_next_key( )
|
||||
doc.last();
|
||||
|
||||
const long num = ((doc.curr() == cmp_rec) ? doc.get_long( "NDOC" ) : 0) + 1;
|
||||
|
||||
return (format( "%d|%d", F_NDOC, num));
|
||||
key.format( "%d|%d", F_NDOC, num);
|
||||
}
|
||||
return "";
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int TMotore_application::read( TMask& m )
|
||||
|
10
ve/ve0100.h
10
ve/ve0100.h
@ -3,10 +3,6 @@
|
||||
|
||||
#define CHANGE_MESSAGE "Sono state effettuate modifiche alla configurazione.\nPrima di eseguire la gestione documenti occorre rigenerare le maschere.\nDesideri farlo ora ?"
|
||||
|
||||
#ifndef __CHECKS_H
|
||||
#include <checks.h>
|
||||
#endif
|
||||
|
||||
#ifndef __RELAPP_H
|
||||
#include <relapp.h>
|
||||
#endif
|
||||
@ -14,10 +10,10 @@
|
||||
#ifndef __VELIB_H
|
||||
#include "velib.h"
|
||||
#endif
|
||||
|
||||
// Definizione della classe dell'applicazione motore
|
||||
class TMotore_application : public TRelation_application
|
||||
{
|
||||
|
||||
TArray _file; // Tutti i fiels da usare
|
||||
|
||||
TDocumento * _doc;
|
||||
@ -25,7 +21,7 @@ class TMotore_application : public TRelation_application
|
||||
|
||||
// Puntatore al profilo del documento caricato
|
||||
TConfig * _pro;
|
||||
TConfig * _config_ditta;
|
||||
TConfig * _config_ditta;
|
||||
|
||||
// Puntatore alla maschera di ricerca
|
||||
TMask * _msk;
|
||||
@ -109,7 +105,7 @@ protected:
|
||||
void ini2mask(TConfig& ini, TMask& m, bool query);
|
||||
public:
|
||||
virtual TRelation* get_relation( ) const { return _rel;}
|
||||
virtual const char* get_next_key( );
|
||||
virtual bool get_next_key(TToken_string& key);
|
||||
|
||||
// Funzioni di accesso alle variabili private
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
#include <rectypes.h>
|
||||
#include <relation.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <relation.h>
|
||||
|
||||
#include "velib.h"
|
||||
#include "ve0100b.h"
|
||||
|
||||
int numerazione_definitiva(TDocumento& doc)
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
#ifndef __VE0100B_H
|
||||
#define __VE0100B_H
|
||||
|
||||
#ifndef __VELIB_H
|
||||
#include "velib.h"
|
||||
class TDocumento;
|
||||
#endif
|
||||
|
||||
int numerazione_definitiva(TDocumento &); // prototipo della funzione di rinumerazione definitiva dei documenti
|
||||
|
@ -1,48 +1,15 @@
|
||||
// Handler di MarcoclaD sui campi delle maschere
|
||||
|
||||
#ifndef __CHECKS_H
|
||||
#include <checks.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MASK_H
|
||||
#include <mask.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MASKFLD_H
|
||||
#include <maskfld.h>
|
||||
#endif
|
||||
|
||||
#ifndef __KEYS_H
|
||||
#include <keys.h>
|
||||
#endif
|
||||
|
||||
#ifndef __STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifndef __VEUML_H
|
||||
#include "veuml.h"
|
||||
#endif
|
||||
|
||||
#ifndef __VEUML1_H
|
||||
#include "veuml1.h"
|
||||
#endif
|
||||
|
||||
#ifndef __VE0100_H
|
||||
#include "ve0100.h"
|
||||
#endif
|
||||
|
||||
#ifndef __VE0100C_H
|
||||
#include "ve0100c.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PAGAMENT_H
|
||||
#include "..\cg\cgpagame.h"
|
||||
#endif
|
||||
|
||||
#ifndef __SCONTI_H
|
||||
#include "sconti.h"
|
||||
#endif
|
||||
|
||||
bool ora_hndl( TMask_field& field, KEY key )
|
||||
|
||||
|
@ -2,11 +2,7 @@
|
||||
#include <config.h>
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <relation.h>
|
||||
#include <expr.h>
|
||||
#include <tabutil.h>
|
||||
#include <printer.h>
|
||||
#include <utility.h>
|
||||
#include <urldefid.h>
|
||||
#include <progind.h>
|
||||
|
||||
@ -20,6 +16,7 @@
|
||||
|
||||
#define LISTADOC "listadoc"
|
||||
#define FAKETOTFLD 9999
|
||||
|
||||
#define Usage "Usage: ve1 -0 {[codnum anno {D|P} dalnum alnum {D|P} [ncopie]] | [L]}"
|
||||
|
||||
// Queste classi (TDocisamfile e TRDocisamfile) servono nel costruttore di TDocumento_form
|
||||
@ -1076,17 +1073,13 @@ bool TStampaDoc_application::date2num_handler(TMask_field& f, KEY key)
|
||||
|
||||
bool TStampaDoc_application::range_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
int rt = TRUE;
|
||||
TMask& m = f.mask();
|
||||
bool rt = TRUE;
|
||||
if (key == K_TAB && f.focusdirty())
|
||||
{
|
||||
const long lim_sup = atol(f.get());
|
||||
const long lim_inf = m.get_long(F_DA_NDOC);
|
||||
const long lim_inf = f.mask().get_long(F_DA_NDOC);
|
||||
if (lim_sup < lim_inf)
|
||||
{
|
||||
f.error_box("Il limite superiore deve essere maggiore del limite inferiore");
|
||||
rt = FALSE;
|
||||
}
|
||||
rt = f.error_box("Il limite superiore deve essere maggiore del limite inferiore");
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Gestione sconti di Riga/Incondizionati/Documenti
|
||||
#include <relapp.h>
|
||||
#include <config.h>
|
||||
#include <tabutil.h>
|
||||
#include <recarray.h>
|
||||
#include <relapp.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "ve2100.h"
|
||||
|
||||
|
@ -9,7 +9,8 @@
|
||||
#include "ve2300x.h" // include anche il file dei campi della maschera delle righe
|
||||
#include "veconf.h"
|
||||
|
||||
#define RCONDVEN_APP "ve2 -2 " // nome dell'applicazione di gestione delle righe
|
||||
// nome dell'applicazione di gestione delle righe
|
||||
#define RCONDVEN_APP "ve2 -2 "
|
||||
|
||||
static void key_hide(TMask & m, short id, int key = 1)
|
||||
{
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include <relapp.h>
|
||||
#include <tabutil.h>
|
||||
#include <config.h>
|
||||
#include <recarray.h>
|
||||
#include <relapp.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "velib.h"
|
||||
#include "ve2300.h"
|
||||
#include "veconf.h"
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include <relapp.h>
|
||||
#include <tabutil.h>
|
||||
#include <checks.h>
|
||||
#include <defmask.h>
|
||||
#include <modaut.h>
|
||||
#include <relapp.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "velib.h"
|
||||
|
||||
#include "..\cg\cglib01.h"
|
||||
#include "..\mg\mglib.h"
|
||||
#include "..\mg\stomag.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <sheet.h>
|
||||
#include <stack.h>
|
||||
#include <tabutil.h>
|
||||
#include <urldefid.h>
|
||||
#include <viswin.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <direct.h>
|
||||
|
||||
#include <applicat.h>
|
||||
#include <archives.h>
|
||||
#include <assoc.h>
|
||||
@ -59,7 +60,7 @@ void TDeletedoc_app::backup_delete_doc()
|
||||
TRecnotype total = 0;
|
||||
TDocumento documento;
|
||||
|
||||
TIsamfile doc(LF_DOC,FALSE);
|
||||
TIsamfile doc(LF_DOC);
|
||||
TLocalisamfile rdoc(LF_RIGHEDOC);
|
||||
|
||||
doc.open();
|
||||
@ -136,14 +137,14 @@ void TDeletedoc_app::backup_delete_doc()
|
||||
}
|
||||
else
|
||||
error_box("Errore %d scrivendo sui files temporanei."
|
||||
" La cancellazione dei documenti chiuse non verra' effettuata.",err);
|
||||
" La cancellazione dei documenti chiusi non verra' effettuata.",err);
|
||||
delete_tmp_files(); // Physical remove of tmp files
|
||||
doc.close();
|
||||
}
|
||||
|
||||
void TDeletedoc_app::restore_doc()
|
||||
{
|
||||
TIsamfile doc(LF_DOC,FALSE);
|
||||
TIsamfile doc(LF_DOC);
|
||||
TLocalisamfile rdoc(LF_RIGHEDOC);
|
||||
|
||||
doc.open();
|
||||
|
10
ve/velib.h
10
ve/velib.h
@ -482,9 +482,9 @@ class TDocumento : public TMultiple_rectype // velib03
|
||||
static TString16 _codiva_spese;
|
||||
static TString16 _codiva_bolli;
|
||||
char _stato_originale;
|
||||
static bool _has_mag;
|
||||
static bool _has_stat_ven;
|
||||
static bool _has_provv;
|
||||
static short _has_mag;
|
||||
static short _has_stat_ven;
|
||||
static short _has_provv;
|
||||
int _liv_len[4];
|
||||
|
||||
TCond_vendita * _condv;
|
||||
@ -513,8 +513,8 @@ protected:
|
||||
void update_tabella_iva();
|
||||
void dirty_tabella_iva() { _tabella_iva.destroy();}
|
||||
static void test_firm();
|
||||
inline const TString16 & codiva_spese() const ;
|
||||
inline const TString16 & codiva_bolli() const ;
|
||||
inline const TString& codiva_spese() const ;
|
||||
inline const TString& codiva_bolli() const ;
|
||||
void check_modules();
|
||||
|
||||
public:
|
||||
|
@ -1,9 +1,8 @@
|
||||
#include <defmask.h>
|
||||
#include "velib.h"
|
||||
#include "vepriv.h"
|
||||
|
||||
#ifndef __TABUTIL_H
|
||||
#include <tabutil.h>
|
||||
#endif
|
||||
|
||||
#ifndef __VERIG_H
|
||||
#include "verig.h"
|
||||
@ -17,10 +16,6 @@
|
||||
#include "veini.h"
|
||||
#endif
|
||||
|
||||
#ifndef __URLDEFID_H
|
||||
#include <urldefid.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SCONTI_H
|
||||
#include "sconti.h"
|
||||
#endif
|
||||
@ -673,7 +668,7 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st
|
||||
expr.setvar(j, f.read(riga));
|
||||
}
|
||||
expr.set_row(&riga);
|
||||
somma += (real)expr;
|
||||
somma += (const real&)expr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,11 @@
|
||||
#include <prefix.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "velib.h"
|
||||
#include "vepriv.h"
|
||||
|
||||
#ifndef __PREFIX_H
|
||||
#include <prefix.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TABUTIL_H
|
||||
#include <tabutil.h>
|
||||
#endif
|
||||
|
||||
#ifndef __VERIG_H
|
||||
#include "verig.h"
|
||||
#endif
|
||||
|
||||
#ifndef __SCONTI_H
|
||||
#include "sconti.h"
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Tipo riga di un documento
|
||||
|
@ -1,27 +1,17 @@
|
||||
#include <applicat.h>
|
||||
#include <tabutil.h>
|
||||
#include <prefix.h>
|
||||
//#include <utility.h>
|
||||
|
||||
#include "velib.h"
|
||||
#include "vepriv.h"
|
||||
|
||||
#include <clifo.h>
|
||||
|
||||
#ifndef __APPLICAT_H
|
||||
#include <applicat.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PREFIX_H
|
||||
#include <prefix.h>
|
||||
#endif
|
||||
|
||||
#ifndef __VEUML_H
|
||||
#include "veuml.h"
|
||||
#endif
|
||||
|
||||
#ifndef __TABUTIL_H
|
||||
#include <tabutil.h>
|
||||
#endif
|
||||
|
||||
#ifndef __UTILITY_H
|
||||
#include <utility.h>
|
||||
#endif
|
||||
|
||||
#ifndef __VEINI_H
|
||||
#include "veini.h"
|
||||
#endif
|
||||
@ -282,9 +272,9 @@ TString16 TDocumento::_codiva_spese;
|
||||
TString16 TDocumento::_codiva_bolli;
|
||||
HIDDEN TStats_agg _st_agg;
|
||||
HIDDEN TAssoc_array _docs_to_agg;
|
||||
bool TDocumento::_has_mag = 3;
|
||||
bool TDocumento::_has_stat_ven = 3;
|
||||
bool TDocumento::_has_provv = 3;
|
||||
short TDocumento::_has_mag = 3;
|
||||
short TDocumento::_has_stat_ven = 3;
|
||||
short TDocumento::_has_provv = 3;
|
||||
|
||||
TDocumento::TDocumento()
|
||||
: TMultiple_rectype(LF_DOC), _condv(NULL),
|
||||
@ -360,10 +350,10 @@ TDocumento::~TDocumento()
|
||||
if (_esenzione != NULL) delete _esenzione;
|
||||
}
|
||||
|
||||
inline const TString16 & TDocumento::codiva_spese() const
|
||||
inline const TString& TDocumento::codiva_spese() const
|
||||
{ ((TDocumento *)this)->test_firm(); return _codiva_spese;}
|
||||
|
||||
inline const TString16 & TDocumento::codiva_bolli() const
|
||||
inline const TString& TDocumento::codiva_bolli() const
|
||||
{ ((TDocumento *)this)->test_firm(); return _codiva_bolli;}
|
||||
|
||||
|
||||
@ -445,7 +435,8 @@ real TDocumento::bolli(real & imp, int ndec, TTipo_importo t) const
|
||||
static TArray imp_bolli;
|
||||
static int nscagl;
|
||||
TLocalisamfile clifo(LF_CLIFO);
|
||||
bool estero = 2;
|
||||
|
||||
short estero = 2;
|
||||
|
||||
if (get_bool("ADDBOLLI"))
|
||||
{
|
||||
@ -781,7 +772,8 @@ void TDocumento::set_riga_esenzione()
|
||||
}
|
||||
if (_esenzione == NULL)
|
||||
_esenzione = new TRiga_documento(this, _tipo_riga_es);
|
||||
TString d(256); d.format("Fattura non imponibile come da vostra dichiarazion");
|
||||
TString d(256);
|
||||
d = "Fattura non imponibile come da vostra dichiarazion";
|
||||
|
||||
_esenzione->put( "DESCR", d);
|
||||
|
||||
@ -907,9 +899,11 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
||||
mov.put(MOVMAG_CODCONT, get("CODCONT"));
|
||||
mov.put(MOVMAG_CODCAMP, get("CODCAMP"));
|
||||
mov.put(MOVMAG_CODCAUS, get("CAUSMAG"));
|
||||
mov.put(MOVMAG_DESCR, format("%s n.ro %ld del %s", (const char *) tipo().get("S1"), numdoc, (const char *) d.string()));
|
||||
mov.put(MOVMAG_TIPOCF, get("TIPOCF"));
|
||||
mov.put(MOVMAG_CODCF, get("CODCF"));
|
||||
TString80 descr;
|
||||
descr.format("%s n.ro %ld del %s", (const char *)tipo().get("S1"), numdoc, (const char *)d.string());
|
||||
mov.put(MOVMAG_DESCR, descr);
|
||||
|
||||
int j = 1;
|
||||
|
||||
@ -1282,8 +1276,9 @@ void TDocumento::set_fields(TAuto_variable_rectype & rec)
|
||||
|
||||
add_field(new TDocumento_variable_field(work_tot_doc, netto_exp));
|
||||
|
||||
TExpr_documento tot_exp(format("%s + _BOLLI(%s)", (const char *) work_tot_doc,
|
||||
(const char *) work_tot_doc), _numexpr, this);
|
||||
TString80 descr;
|
||||
descr.format("%s + _BOLLI(%s)", (const char*)work_tot_doc, (const char *)work_tot_doc);
|
||||
TExpr_documento tot_exp(descr, _numexpr, this);
|
||||
|
||||
add_field(new TDocumento_variable_field(f->name(), tot_exp));
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
#include "velib.h"
|
||||
|
||||
#ifndef __TABUTIL_H
|
||||
#include <tabutil.h>
|
||||
#endif
|
||||
|
||||
#include "velib.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// TCodice_numerazione
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifndef __VEPRIV_H
|
||||
#define __VEPRIV_H
|
||||
|
||||
#ifndef __MASK_H
|
||||
#include <mask.h>
|
||||
#endif
|
||||
|
||||
enum _formule {_somma, _bolli, _bolli_int, _spinc, _prezzo, _importo, _imponibile, _sconto, _iva, _provv, _tipo, _imponibili, _imposte, _totprovv};
|
||||
enum TTipo_calcolo { _nessun_calcolo, _qtaprezzo, _valore, _percentuale, _scontoimp, _scontoperc};
|
||||
@ -15,3 +21,5 @@ bool codart_handler(TMask_field& f, KEY key);
|
||||
bool umart_handler(TMask_field& f, KEY key);
|
||||
bool descr_handler(TMask_field& f, KEY key);
|
||||
bool qta_handler(TMask_field& f, KEY key);
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user