Aggiunto metodo TRiga_documento::tipo_valido() per sapere se il tipo di
riga non e' vuoto. Corretto errore su bolli() e sul settaggio del tipo di riga in caso di descrizione di riferimento. git-svn-id: svn://10.65.10.50/trunk@3829 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4e9575b1a5
commit
e7a8be7908
@ -620,7 +620,8 @@ real TDocumento::bolli(real & imp, int ndec, bool netto) const
|
||||
for (int i = 0; i < nscagl - 1; i++)
|
||||
if ((real &) sca_bolli[i] >= imp)
|
||||
break;
|
||||
tot_bolli += (real &) imp_bolli[i];
|
||||
if (imp_bolli.items() > 0)
|
||||
tot_bolli += (real &) imp_bolli[i];
|
||||
}
|
||||
break;
|
||||
case _tratta:
|
||||
@ -1344,7 +1345,7 @@ bool TRiga_documento::sola_descrizione() const
|
||||
void TRiga_documento::forza_sola_descrizione()
|
||||
{
|
||||
// In realta' il test serve anche a caricare la lista dei tipi riga!
|
||||
if (tipo().tipo() != 'D')
|
||||
if (!tipo_valido() || tipo().tipo() != 'D')
|
||||
{
|
||||
_tipi.restart();
|
||||
for (const TObject* o = _tipi.get(); o; o = _tipi.get())
|
||||
@ -1552,28 +1553,31 @@ void TRiga_documento::dirty_fields(bool dirty_document)
|
||||
bool TRiga_documento::doc_dependent() const
|
||||
|
||||
{
|
||||
const char tipor = tipo().tipo();
|
||||
|
||||
if (tipor == 'S')
|
||||
return spesa().tipo() == 'P';
|
||||
else
|
||||
if (tipor == 'C')
|
||||
return get("SCONTO").not_empty();
|
||||
if (tipo_valido())
|
||||
{
|
||||
const char tipor = tipo().tipo();
|
||||
|
||||
if (tipor == 'S')
|
||||
return spesa().tipo() == 'P';
|
||||
else
|
||||
if (tipor == 'C')
|
||||
return get("SCONTO").not_empty();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TRiga_documento::put_str(const char* fieldname, const char* val)
|
||||
{
|
||||
if (strcmp(fieldname, "TIPORIGA") == 0 && TRectype::get("TIPORIGA") != val)
|
||||
TString v(val);
|
||||
if (strcmp(fieldname, "TIPORIGA") == 0 && TRectype::get("TIPORIGA") != v)
|
||||
{
|
||||
TAuto_variable_rectype::put_str(fieldname, val);
|
||||
TAuto_variable_rectype::put_str(fieldname, v);
|
||||
reset_fields(*this);
|
||||
set_fields(*this);
|
||||
}
|
||||
else
|
||||
{
|
||||
TAuto_variable_rectype::put_str(fieldname, val);
|
||||
TAuto_variable_rectype::put_str(fieldname, v);
|
||||
dirty_fields();
|
||||
}
|
||||
}
|
||||
|
@ -280,6 +280,7 @@ public:
|
||||
static const TIVA & iva(const char * codice);
|
||||
const TIVA & iva() const {const TString16 cod(get("CODIVA")); return iva(cod);}
|
||||
|
||||
const bool tipo_valido() const { return get("TIPORIGA").not_empty(); }
|
||||
void set_tipo(const char * tipo) { put("TIPORIGA", tipo);}
|
||||
bool sola_descrizione() const;
|
||||
void forza_sola_descrizione();
|
||||
|
Loading…
x
Reference in New Issue
Block a user