Patch level : 2.2 262
Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : Bug 0000562 Implementare la possibilità di avere fino a 5 decimali sulle tabelle spese prestazioni etc git-svn-id: svn://10.65.10.50/trunk@13595 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3e93550834
commit
b8c66892bb
@ -94,6 +94,10 @@ protected:
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
virtual int read(TMask& m);
|
||||
virtual int write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
|
||||
|
||||
public:
|
||||
};
|
||||
@ -156,6 +160,64 @@ 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"));
|
||||
return err;
|
||||
}
|
||||
|
||||
int TVendite_tabapp::write(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));
|
||||
|
||||
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));
|
||||
|
||||
return Tab_application::rewrite(m);
|
||||
}
|
||||
|
||||
int ve0400(int argc, char* argv[])
|
||||
{
|
||||
TVendite_tabapp vta;
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
const TString & um() const { return get("S7"); }
|
||||
const TString& cod_iva() const { return get("S3").left(4); }
|
||||
const TString& revenue() const { return get("S5"); }
|
||||
real prezzo() const { return get_real("R0"); }
|
||||
real prezzo() const { return get_real("R10"); }
|
||||
real qta() const { return get_real("R1"); }
|
||||
real perc() const { return get_real("R2"); }
|
||||
char tipo() const { return get_char("S6"); }
|
||||
|
@ -1073,7 +1073,8 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga)
|
||||
m->field(FR_LIV4).check_type(CHECK_NONE);
|
||||
}
|
||||
else
|
||||
if (tipo_r == RIGA_SPESEDOC || tipo_r == RIGA_PRESTAZIONI)
|
||||
if (tipo_r == RIGA_SPESEDOC || tipo_r == RIGA_PRESTAZIONI ||
|
||||
tipo_r == RIGA_RISORSE || tipo_r == RIGA_ATTREZZATURE)
|
||||
m->set_handler( FR_CODART, sppr_handler );
|
||||
}
|
||||
}
|
||||
|
@ -1377,7 +1377,18 @@ bool sppr_handler( TMask_field& f, KEY key )
|
||||
TEdit_field & e = (TEdit_field &) f;
|
||||
TRelation * r = e.browse()->cursor()->relation();
|
||||
const TString16 cod = r->curr().get("COD");
|
||||
TSpesa_prest sp(NULL, cod == "SPP" ? 'S' : 'P');
|
||||
char tipo = RIGA_SPESEDOC;
|
||||
|
||||
if (cod == "PRS")
|
||||
tipo = RIGA_PRESTAZIONI;
|
||||
else
|
||||
if (cod == "RSS")
|
||||
tipo = RIGA_RISORSE;
|
||||
else
|
||||
if (cod == "ATR")
|
||||
tipo = RIGA_ATTREZZATURE;
|
||||
|
||||
TSpesa_prest sp(NULL, tipo);
|
||||
if (sp.read(row_mask.get(FR_CODART)) == NOERR)
|
||||
{
|
||||
const char tipo = sp.tipo();
|
||||
|
@ -125,7 +125,7 @@ END
|
||||
CURRENCY ATR_PREZZO 15
|
||||
BEGIN
|
||||
PROMPT 2 8 "Prezzo "
|
||||
FIELD R0
|
||||
FIELD R10
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
|
@ -108,7 +108,7 @@ END
|
||||
CURRENCY PRS_PREZZO 15
|
||||
BEGIN
|
||||
PROMPT 2 7 "Prezzo "
|
||||
FIELD R0
|
||||
FIELD R10
|
||||
FLAGS "U"
|
||||
GROUP 1
|
||||
END
|
||||
|
@ -284,7 +284,7 @@ END
|
||||
CURRENCY RSS_PREZZO 15
|
||||
BEGIN
|
||||
PROMPT 1 12 "Prezzo "
|
||||
FIELD R0
|
||||
FIELD R10
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
|
@ -116,7 +116,7 @@ END
|
||||
CURRENCY SPP_PREZZO 15
|
||||
BEGIN
|
||||
PROMPT 2 7 "Prezzo "
|
||||
FIELD R0
|
||||
FIELD R10
|
||||
FLAGS "U"
|
||||
GROUP 1
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user