Patch level : 2.2 382

Files correlati     :   ve1.exe ci1.exe
Ricompilazione Demo : [ ]
Commento            :

Aggiunta la variabile TIPOCR =  C|R per definire i documenti come costi o ricavi inipendentemente dal cliente o fornitore


git-svn-id: svn://10.65.10.50/trunk@13859 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2006-03-22 13:54:33 +00:00
parent 1a5ea61eda
commit 8e33ba67ef
3 changed files with 18 additions and 2 deletions

View File

@ -216,6 +216,7 @@ class TTipo_documento : public TRectype // velib03
TString _str_desc_doc, _str_desc_rdoc;
char _tipocf;
char _tipocr;
char _check_qta;
bool _cnt_prezzi, _show_evaded_lines;
@ -288,6 +289,8 @@ public:
bool printable() const { return get("S5").not_empty(); }
bool main_print_profile(TFilename& report) const;
bool additional_print_profile(TFilename& report) const;
bool is_costo() const ;
bool is_ricavo() const ;
TFormula_documento* first_formula() { return succ_formula(true); }
TFormula_documento* succ_formula(bool restart = FALSE);

View File

@ -92,6 +92,16 @@ bool TTipo_documento::additional_print_profile(TFilename& report) const
return ok;
}
bool TTipo_documento::is_costo() const
{
return _tipocr == 'C' || tipocf() == 'F';
}
bool TTipo_documento::is_ricavo() const
{
return _tipocr == 'R' || tipocf() == 'C';
}
const char TTipo_documento::tipocf() const
{
if (_tipocf < ' ')
@ -259,6 +269,7 @@ void TTipo_documento::read_formule()
TConfig prof(profile, "MAIN");
prof.write_protect(); // Altrimenti non si distrugge!!!
_tipocr = prof.get_char("TIPOCR", NULL, -1, ' ');
_formule = prof.get("CAMPICALC");
const TString& calcoli = prof.get("CALCOLI");
if (calcoli == "*")

View File

@ -72,11 +72,13 @@ const TVariant& TDocument_recordset::get(int num, const char* field) const
} else
if (xvt_str_compare_ignoring_case(field, "IS_COSTO") == 0)
{
var = doc.get_char(DOC_TIPOCF)=='F' ? UNO : ZERO;
bool costo = (doc.tipo().is_costo()) || (!doc.tipo().is_ricavo() && doc.get_char(DOC_TIPOCF)=='F');
var = costo ? UNO : ZERO;
} else
if (xvt_str_compare_ignoring_case(field, "IS_RICAVO") == 0)
{
var = doc.get_char(DOC_TIPOCF)=='C' ? UNO : ZERO;
bool ricavo = (doc.tipo().is_ricavo()) || (!doc.tipo().is_costo() && doc.get_char(DOC_TIPOCF)=='C');
var = ricavo ? UNO : ZERO;
}
else
{