Patch level : 2.2

Files correlati     : ve0 ve1
Ricompilazione Demo : [ ]
Commento            :
Corretta gestioni campo prezzo delle spese/prestazioni in modo da gestire
correttamente R10 o R0 in assenza del primo
Corretta gestione handlers, che bloccava gli occasionali


git-svn-id: svn://10.65.10.50/trunk@13682 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2006-01-09 18:32:38 +00:00
parent 3e3e08ef49
commit 8c6cce1557
6 changed files with 31 additions and 23 deletions

View File

@ -109,9 +109,6 @@ class TDocumento_variable_field : public TVariable_field
class TSpesa_prest : public TRectype // velib01
{
protected:
public:
TObject* dup() const { return new TSpesa_prest(codice()); }
@ -120,11 +117,11 @@ public:
const TString& codice() const { return get("CODTAB");}
const TString& descrizione() const { return get("S0"); }
const TString& field_perc() const { return get("S5"); }
const TString& field_perc() const { return get("S5"); } // Solo spese
const TString& revenue() const { return get("S5"); } // Solo atrezzature
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("R10"); }
const TString& cod_iva() const; // S3
real prezzo() const; // R10 o R0
real qta() const { return get_real("R1"); }
real perc() const { return get_real("R2"); }
char tipo() const { return get_char("S6"); }
@ -172,8 +169,8 @@ enum TTipo_formula { _documento, _riga };
class TFormula_documento : public TRectype // velib01
{
TString16 _tab;
TExpr_documento * _expr;
TString4 _tab;
TExpr_documento* _expr;
protected:
int read(const char* codice, const char* expr = NULL, bool numexpr = true);
@ -359,7 +356,7 @@ class TTipo_riga_documento : public TRectype // velib02
TToken_string _formule;
TString_array _defaults;
TString16 _imponibile;
TString16 _imponibile, _field_imposta;
TString16 _quant;
TString16 _quantevasa;
TString16 _qtares;
@ -388,6 +385,7 @@ public:
char tipo() const { return get_char("S7"); }
const TString& imponibile() const { return _imponibile;}
const TString& imposta() const { return _field_imposta;}
const TString& quant() const { return _quant;}
const TString& quantevasa() const { return _quantevasa;}
const TString& field_qta() const { return _field_qta;}
@ -589,8 +587,8 @@ class TDocumento : public TMultiple_rectype // velib03
static TAssoc_array _tipi;
static TAssoc_array _numerazioni;
static long _firm;
static TString16 _codiva_spese;
static TString16 _codiva_bolli;
static TString4 _codiva_spese;
static TString4 _codiva_bolli;
static short _has_mag;
static short _has_stat_ven;
static short _has_provv;

View File

@ -126,6 +126,23 @@ int TSpesa_prest::read(const char* codice)
return empty() ? _iskeynotfound : NOERR;
}
const TString& TSpesa_prest::cod_iva() const
{
// La parte seguente di s3 e' utilizzata dalle atrezzature per altri campi
TString& tmp = get_tmp_string();
tmp = get("S3").left(4);
tmp.trim();
return tmp;
}
real TSpesa_prest::prezzo() const
{
real r = get("R10"); // Prezzo con tanti decimali
if (r.is_zero())
r = get_real("R0"); // Prezzo con pochi decimali
return r;
}
bool scontoexpr2perc(const char * exp, bool signal , TString & goodexp, real & val_perc )
{
bool valid = TRUE;

View File

@ -370,7 +370,6 @@ TRectype & TRiga_documento::operator =(const char * r)
return *this;
}
// Ritorna TRUE se le due righe del documento possono essere sommate
void TRiga_documento::cost2revenue()
{
if (is_attrezzatura() || is_risorsa())
@ -388,6 +387,7 @@ void TRiga_documento::cost2revenue()
}
}
// Ritorna TRUE se le due righe del documento possono essere sommate
bool TRiga_documento::raggruppabile(const TRiga_documento& r, TToken_string& campi) const
{
bool ok = TRUE;

View File

@ -2281,7 +2281,7 @@ real TDocumento::calc_conai_qta(int type)
TArticolo_giacenza * art = r.articolo();
if (art != NULL)
{
const TString16 um = r.get(RDOC_UMQTA);
const TString4 um = r.get(RDOC_UMQTA);
const real row_qta = art->convert_to_um(r.get_real(RDOC_QTA), NULL, um);
qta += row_qta*art->get_real(__conai_art_names[type]);

View File

@ -818,11 +818,6 @@ TFormula_documento::TFormula_documento(const TRectype& rec)
_expr = new TExpr_documento(expr_string(), et);
}
TObject* TFormula_documento::dup() const
{
return new TFormula_documento(*this);
}
TFormula_documento::~TFormula_documento()
{
if (_expr)

View File

@ -87,10 +87,9 @@ TDocumento_mask::TDocumento_mask(const char* td)
listbox.replace_items(keys, descrs);
// Controlla se deve generare la pagina di analitica
if (dongle().active(CAAUT) || dongle().active(CMAUT))
if (dongle().active(CAAUT) || dongle().active(CMAUT))
insert_anal_page();
configura_sheet(*_sheet);
((TVariable_sheet_field*)_sheet)->set_getmask( ss_getmask );
@ -101,11 +100,10 @@ TDocumento_mask::TDocumento_mask(const char* td)
}
int i;
for (i = fields() - 1; i >= 0; i--)
{
TMask_field & f = fld(i);
if (f.is_editable())
if (f.is_operable())
f.set_handler(universal_handler);
}