Patch level : 10.0 no patch
Files correlati : pd63422.exe Ricompilazione Demo : [ ] Commento : Saldi per commessa e conto Haiblliita git-svn-id: svn://10.65.10.50/branches/R_10_00@21100 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
adeda3ca2f
commit
0101ff1bf1
@ -2769,6 +2769,11 @@ bool ca_ori_present(const TRectype& rec)
|
||||
rec.get(RMOVANA_CODFASEORI).not_empty() || rec.get(RMOVANA_CODCONTORI).not_empty());
|
||||
}
|
||||
|
||||
bool ca_ori_present(const TRecordset & rec)
|
||||
{
|
||||
return (rec.get(RMOVANA_CODCCORI).as_string().not_empty() || rec.get(RMOVANA_CODCMSORI).as_string().not_empty() ||
|
||||
rec.get(RMOVANA_CODFASEORI).as_string().not_empty() || rec.get(RMOVANA_CODCONTORI).as_string().not_empty());
|
||||
}
|
||||
void ca_taglia_campo(TRectype& src, const char* campo_src, TRectype& dst, const char* campo_dst)
|
||||
{
|
||||
ca_copia_campo(src, campo_src, dst, campo_dst);
|
||||
|
@ -17,6 +17,8 @@
|
||||
class TBill;
|
||||
#endif
|
||||
|
||||
class TRecordset ;
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TConfig_anal
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -251,6 +253,7 @@ public:
|
||||
// metodi di implosione movimenti ripartiti!! Serve nel ribaltamento movimenti, stampa rendiconto...
|
||||
bool ca_implode_rows(const TRecord_array& input_rows, TRecord_array& compact_rows);
|
||||
bool ca_ori_present(const TRectype& rec);
|
||||
bool ca_ori_present(const TRecordset & rec);
|
||||
bool ca_can_merge_rows(const TRectype& compact_rec, const TRectype& rec);
|
||||
void ca_taglia_campo(TRectype& src, const char* campo_src, TRectype& dst, const char* campo_dst);
|
||||
void ca_copia_campo(const TRectype& src, const char* campo_src, TRectype& dst, const char* campo_dst);
|
||||
|
@ -171,6 +171,30 @@ const TVariant& TPconana_recordset::get(const char* field) const
|
||||
if (sub_field == "FIN_AVERE")
|
||||
{
|
||||
var = s._fin.sezione() == 'A' ? s._fin.valore() : ZERO;
|
||||
} else
|
||||
if (sub_field == "INI_DARE_IND")
|
||||
{
|
||||
var = s._ini.sezione() == 'D' ? s._iniind.valore() : ZERO;
|
||||
} else
|
||||
if (sub_field == "INI_AVERE_IND")
|
||||
{
|
||||
var = s._ini.sezione() == 'A' ? s._iniind.valore() : ZERO;
|
||||
} else
|
||||
if (sub_field == "MOV_DARE_IND")
|
||||
{
|
||||
var = s._dareind.valore();
|
||||
} else
|
||||
if (sub_field == "MOV_AVERE_IND")
|
||||
{
|
||||
var = s._avereind.valore();
|
||||
} else
|
||||
if (sub_field == "FIN_DARE_IND")
|
||||
{
|
||||
var = s._fin.sezione() == 'D' ? s._finind.valore() : ZERO;
|
||||
} else
|
||||
if (sub_field == "FIN_AVERE_IND")
|
||||
{
|
||||
var = s._fin.sezione() == 'A' ? s._finind.valore() : ZERO;
|
||||
}
|
||||
return var;
|
||||
}
|
||||
@ -801,6 +825,18 @@ bool TSaldi_cache::int_saldo_annuale(const TAnal_bill& b, int da_anno, int ad_an
|
||||
{
|
||||
imp += ca_get_imp(saldini, SALDANA_SEZIONEV, SALDANA_SALDOV);
|
||||
}
|
||||
if (tipo & _saldanal_consuntivo_indiretto)
|
||||
{
|
||||
imp += ca_get_imp(saldini, SALDANA_SEZIONEI, SALDANA_SALDOI);
|
||||
}
|
||||
if (tipo & _saldanal_preventivo_indiretto)
|
||||
{
|
||||
imp += ca_get_imp(saldini, SALDANA_SEZIONEIP, SALDANA_SALDOIP);
|
||||
}
|
||||
if (tipo & _saldanal_variazione_indiretto)
|
||||
{
|
||||
imp += ca_get_imp(saldini, SALDANA_SEZIONEIV, SALDANA_SALDOIV);
|
||||
}
|
||||
if (!imp.is_zero())
|
||||
{
|
||||
if (imp.sezione() == 'D')
|
||||
@ -946,10 +982,19 @@ bool TSaldi_cache::int_saldo_movimenti(const TAnal_bill& b,
|
||||
else
|
||||
s._avere += imp;
|
||||
s._movimentato = true;
|
||||
if (ca_ori_present(rmovana))
|
||||
{
|
||||
if (imp.sezione() == 'D')
|
||||
s._dareind += imp;
|
||||
else
|
||||
s._avereind += imp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s._ini += imp;
|
||||
if (ca_ori_present(rmovana))
|
||||
s._iniind += imp;
|
||||
}
|
||||
}
|
||||
return s._movimentato;
|
||||
@ -1023,7 +1068,10 @@ bool TSaldi_cache::saldi(const TAnal_bill& bill, const TDate& dal, const TDate&
|
||||
s._fin = s._ini;
|
||||
s._fin += s._dare;
|
||||
s._fin += s._avere;
|
||||
s._fin.normalize();
|
||||
s._finind = s._iniind;
|
||||
s._finind += s._dareind;
|
||||
s._finind += s._avereind;
|
||||
s._finind.normalize();
|
||||
|
||||
return s._movimentato;
|
||||
}
|
||||
|
@ -63,11 +63,17 @@ public:
|
||||
#define _saldanal_preventivi 0x6
|
||||
#define _saldanal_qualsiasi 0x7
|
||||
#define _saldanal_ultima_imm 0x8
|
||||
#define _saldanal_riclassify 0x10
|
||||
#define _saldanal_consuntivo_indiretto 0x10
|
||||
#define _saldanal_preventivo_indiretto 0x20
|
||||
#define _saldanal_variazione_indiretto 0x40
|
||||
#define _saldanal_preventivi_indiretto 0x60
|
||||
#define _saldanal_qualsiasi_indiretto 0x70
|
||||
#define _saldanal_riclassify 0x100
|
||||
|
||||
struct TSaldanal : public TObject
|
||||
{
|
||||
TImporto _ini, _dare, _avere, _fin;
|
||||
TImporto _iniind, _dareind, _avereind, _finind;
|
||||
bool _movimentato;
|
||||
|
||||
protected:
|
||||
|
@ -116,7 +116,9 @@ bool TRecordset::save_as_html(const char* path)
|
||||
out << " <caption>" << main_app().title() << "</caption>" << endl;
|
||||
|
||||
const unsigned int cols = columns();
|
||||
if (cols > 0)
|
||||
TAttributes attr;
|
||||
|
||||
if (cols > 0)
|
||||
{
|
||||
out << " <thead>" << endl;
|
||||
for (unsigned int c = 0; c < cols; c++)
|
||||
@ -150,7 +152,12 @@ bool TRecordset::save_as_html(const char* path)
|
||||
str << "<br/>";
|
||||
str << tok;
|
||||
}
|
||||
out << " <th>" << str << "</th>" << endl;
|
||||
if (get_attr(c, attr, true))
|
||||
out << " <th style=\"color : #" << format("%06x", attr.get_foreground() & 0xFFFFFF) << "; background-color : #" << format("%06x", attr.get_background() & 0xFFFFFF) << "\">" ;
|
||||
else
|
||||
out << " <th>";
|
||||
|
||||
out << str << "</th>" << endl;
|
||||
}
|
||||
out << " </tr>" << endl;
|
||||
out << " </thead>" << endl;
|
||||
@ -167,7 +174,6 @@ bool TRecordset::save_as_html(const char* path)
|
||||
for (unsigned int c = 0; c < cols; c++)
|
||||
{
|
||||
const TRecordset_column_info& ci = column_info(c);
|
||||
TAttributes attr;
|
||||
|
||||
if (get_attr(c, attr))
|
||||
out << " <td style=\"color : #" << format("%06x", attr.get_foreground() & 0xFFFFFF) << "; background-color : #" << format("%06x", attr.get_background() & 0xFFFFFF) << "\">" ;
|
||||
|
@ -110,8 +110,8 @@ public: // Absolutely needed methods
|
||||
|
||||
virtual int find_column(const char* column_name) const;
|
||||
virtual const TVariant& get(const char* column_name) const;
|
||||
virtual bool get_attr(int column, TAttributes & attr) const { return false; }
|
||||
bool get_attr(const char* column_name, TAttributes & attr) const { return get_attr(column_name, attr); }
|
||||
virtual bool get_attr(int column, TAttributes & attr, bool header = false) const { return false; }
|
||||
bool get_attr(const char* column_name, TAttributes & attr, bool header = false) const { return get_attr(column_name, attr, header); }
|
||||
virtual const TToken_string& sheet_head() const;
|
||||
|
||||
// mode = 0|1=append 2=update 3=update|append 4=zap before writing
|
||||
|
Loading…
x
Reference in New Issue
Block a user