date.cpp Sostituzione di TDate y(*this);set_day(1);set_month(1);
con la piu' meglio TDate(1, 1, year()); isam.h Tolti #include inutili maskfld.cpp Migliorato riconoscimento fiel tabelle in ricerca object.h Tolte due righe vuote progind.h Aumentato da 10 a 60 il default della lunghezza della barra tabapp.cpp Fatta meglio la gestione del nome della maschera base tabapp.h Cambiato il metodo get_name validate.cpp Semplificato un messaggio d'errore git-svn-id: svn://10.65.10.50/trunk@5106 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
285a207a12
commit
f30aef235b
@ -389,9 +389,7 @@ int TDate::year() const
|
|||||||
|
|
||||||
int TDate::week() const
|
int TDate::week() const
|
||||||
{
|
{
|
||||||
TDate y(*this);
|
const TDate y(1, 1, year());
|
||||||
y.set_day(1);
|
|
||||||
y.set_month(1);
|
|
||||||
return (int) ((date2julian()-y.date2julian())/7 )+1;
|
return (int) ((date2julian()-y.date2julian())/7 )+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,10 +5,6 @@
|
|||||||
#include <sysfld.h>
|
#include <sysfld.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ARRAY_H
|
|
||||||
#include <array.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ASSOC_H
|
#ifndef __ASSOC_H
|
||||||
#include <assoc.h>
|
#include <assoc.h>
|
||||||
#endif
|
#endif
|
||||||
@ -29,10 +25,6 @@
|
|||||||
#include <date.h>
|
#include <date.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __STRINGS_H
|
|
||||||
#include <strings.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __FILES_H
|
#ifndef __FILES_H
|
||||||
#include <files.h>
|
#include <files.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -2341,7 +2341,7 @@ KEY TBrowse::run()
|
|||||||
if (_insert[0] != 'G')
|
if (_insert[0] != 'G')
|
||||||
{
|
{
|
||||||
const TString& maskname = field().mask().source_file();
|
const TString& maskname = field().mask().source_file();
|
||||||
if (maskname.compare("batb", 4, TRUE) == 0 && field().in_key(0))
|
if (maskname.mid(2,2).compare("tb", 2, TRUE) == 0 && field().in_key(0))
|
||||||
{
|
{
|
||||||
const char* tabname = _cursor->file().name();
|
const char* tabname = _cursor->file().name();
|
||||||
if (maskname.mid(4, 3).compare(tabname, 3, TRUE) == 0)
|
if (maskname.mid(4, 3).compare(tabname, 3, TRUE) == 0)
|
||||||
|
@ -121,8 +121,6 @@ public:
|
|||||||
inline ostream& operator <<(
|
inline ostream& operator <<(
|
||||||
ostream& out, // @parm Indica l'output sul quale stampare l'oggetto
|
ostream& out, // @parm Indica l'output sul quale stampare l'oggetto
|
||||||
const TObject& obj) // @parm Oggetto da stampare
|
const TObject& obj) // @parm Oggetto da stampare
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
obj.print_on(out);
|
obj.print_on(out);
|
||||||
return out;
|
return out;
|
||||||
@ -157,8 +155,6 @@ inline istream& operator >>(
|
|||||||
inline bool operator ==(
|
inline bool operator ==(
|
||||||
const TSortable& a, // @parm Primo oggetto da confrontare
|
const TSortable& a, // @parm Primo oggetto da confrontare
|
||||||
const TSortable& b) // @parm Secondo oggetto da confrontare
|
const TSortable& b) // @parm Secondo oggetto da confrontare
|
||||||
|
|
||||||
|
|
||||||
// @comm Controlla se i due oggetti passati come parametro sono uguali
|
// @comm Controlla se i due oggetti passati come parametro sono uguali
|
||||||
// utilizzando il criterio di comparazione previsto per l'oggetto.
|
// utilizzando il criterio di comparazione previsto per l'oggetto.
|
||||||
{
|
{
|
||||||
|
@ -108,7 +108,7 @@ public:
|
|||||||
void addstatus(long l)
|
void addstatus(long l)
|
||||||
{ setstatus(_status+l); }
|
{ setstatus(_status+l); }
|
||||||
// @cmember Costruttore
|
// @cmember Costruttore
|
||||||
TProgind(long max, const char* txt = NULL, bool cancel = TRUE, bool bar = TRUE, int div = 10);
|
TProgind(long max, const char* txt = NULL, bool cancel = TRUE, bool bar = TRUE, int div = 60);
|
||||||
// @cmember Distruttore
|
// @cmember Distruttore
|
||||||
virtual ~TProgind()
|
virtual ~TProgind()
|
||||||
{}
|
{}
|
||||||
|
@ -57,29 +57,32 @@ bool Tab_application::protected_record(TRectype& rec)
|
|||||||
return rec.get_bool(FPC);
|
return rec.get_bool(FPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
TString Tab_application::mask_name()
|
TString& Tab_application::get_mask_name(TString& t) const
|
||||||
{
|
{
|
||||||
TString16 t(_tabname);
|
t = _tabname;
|
||||||
|
if (t[0] == '%')
|
||||||
if (t[0] == '%') t.ltrim(1);
|
t.ltrim(1);
|
||||||
TString16 m; m << "batb" << t;
|
t.insert("batb", 0);
|
||||||
return m.upper();
|
t.upper();
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TMask* Tab_application::set_mask(TMask* m)
|
||||||
|
|
||||||
TMask * Tab_application::set_mask(TMask * _m)
|
|
||||||
{
|
{
|
||||||
if (_m!=NULL)
|
|
||||||
{
|
|
||||||
// imposta la maschera come maschera della applicazione
|
|
||||||
if (_msk != NULL)
|
if (_msk != NULL)
|
||||||
delete _msk;
|
delete _msk;
|
||||||
_msk=_m;
|
|
||||||
} else {
|
if (m != NULL)
|
||||||
|
{
|
||||||
|
// imposta la maschera come maschera della applicazione
|
||||||
|
_msk = m;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// alloca la maschera standard come maschera della applicazione
|
// alloca la maschera standard come maschera della applicazione
|
||||||
_msk = new TMask((const char *)mask_name()) ;
|
TFilename name;
|
||||||
|
get_mask_name(name);
|
||||||
|
_msk = new TMask(name);
|
||||||
}
|
}
|
||||||
return _msk;
|
return _msk;
|
||||||
}
|
}
|
||||||
@ -93,7 +96,6 @@ bool Tab_application::user_create()
|
|||||||
_tabname.upper();
|
_tabname.upper();
|
||||||
_rel = new TRelation(_tabname);
|
_rel = new TRelation(_tabname);
|
||||||
|
|
||||||
|
|
||||||
set_mask();
|
set_mask();
|
||||||
|
|
||||||
const int campi = _msk->fields();
|
const int campi = _msk->fields();
|
||||||
@ -107,7 +109,9 @@ bool Tab_application::user_create()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TFilename rpt(mask_name()); rpt << ".rpt";
|
TFilename rpt;
|
||||||
|
get_mask_name(rpt);
|
||||||
|
rpt.ext("rpt");
|
||||||
if (fexist(rpt))
|
if (fexist(rpt))
|
||||||
enable_menu_item(M_FILE_PRINT);
|
enable_menu_item(M_FILE_PRINT);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ protected:
|
|||||||
virtual void print();
|
virtual void print();
|
||||||
// Nuovi membri:
|
// Nuovi membri:
|
||||||
// @cmember Ritorna il nome della maschera associata
|
// @cmember Ritorna il nome della maschera associata
|
||||||
virtual TString mask_name();
|
virtual TString& get_mask_name(TString& name) const;
|
||||||
// @cmember imposta la maschera (se non indicata, usa le convenzioni di default) ed eventualmente disalloca quella usata in precedenza
|
// @cmember imposta la maschera (se non indicata, usa le convenzioni di default) ed eventualmente disalloca quella usata in precedenza
|
||||||
virtual TMask* set_mask(TMask* mask = NULL);
|
virtual TMask* set_mask(TMask* mask = NULL);
|
||||||
|
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
|
||||||
#include <expr.h>
|
#include <expr.h>
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <utility.h>
|
#include <prefix.h>
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
|
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
|
||||||
|
|
||||||
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
|
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
|
||||||
HIDDEN const TArray* _parms;
|
HIDDEN const TArray* _parms;
|
||||||
|
|
||||||
@ -281,8 +279,9 @@ HIDDEN bool _xt_pi_val(TMask_field& f, KEY key)
|
|||||||
const int s3 = c.get_int("UFFIVA3");
|
const int s3 = c.get_int("UFFIVA3");
|
||||||
if (pi != s1 && pi != s2 && pi != s3)
|
if (pi != s1 && pi != s2 && pi != s3)
|
||||||
{
|
{
|
||||||
const char* ui = format("%03d", s1);
|
TString16 ui; ui.format("%03d", s1);
|
||||||
if (f.yesno_box("Ufficio IVA della partita IVA non congruente: correggere in %s?", ui))
|
if (f.yesno_box("Ufficio IVA della partita IVA non congruente: correggere in %s?",
|
||||||
|
(const char*)ui))
|
||||||
{
|
{
|
||||||
value.overwrite(ui, 7);
|
value.overwrite(ui, 7);
|
||||||
f.set(value);
|
f.set(value);
|
||||||
@ -464,7 +463,7 @@ HIDDEN bool _mtcheck_val(TMask_field& f, KEY)
|
|||||||
|
|
||||||
TLocalisamfile d(LF_NDITTE);
|
TLocalisamfile d(LF_NDITTE);
|
||||||
d.zero();
|
d.zero();
|
||||||
d.put(NDT_CODDITTA, main_app().get_firm());
|
d.put(NDT_CODDITTA, prefix().get_codditta());
|
||||||
d.read();
|
d.read();
|
||||||
if (d.bad()) return TRUE;
|
if (d.bad()) return TRUE;
|
||||||
if (d.get_char(NDT_FREQVIVA) == 'M') return TRUE;
|
if (d.get_char(NDT_FREQVIVA) == 'M') return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user