diff --git a/ca/ca3300.cpp b/ca/ca3300.cpp index 94120d16a..b3f2c44fb 100755 --- a/ca/ca3300.cpp +++ b/ca/ca3300.cpp @@ -504,6 +504,7 @@ class TRecordset_sezioni_contrapposte : public TRecordset bool _movimentati, _nonnulli; TString _daconto, _aconto; TString4 _tipostampa; + bool _print_ap; TArray _attivita, _passivita, _costi, _ricavi; // Elenco di saldi contrapposti TRecnotype _pos; @@ -533,13 +534,13 @@ public: void set_filter(char piano, const char* costo, const char* commessa, const char* fase, const TDate& dal, const TDate& al, word tipimov, bool movimentati, bool nonnulli, - const TString& daconto, const TString& aconto); + bool print_ap, const TString& daconto, const TString& aconto); char tipo_piano() const { return _tipo_piano; } TRecordset_sezioni_contrapposte(char tipo_piano) : _tipo_piano(tipo_piano) { } }; TRecnotype TRecordset_sezioni_contrapposte::items_ap() const -{ return max(_attivita.items(), _passivita.items()); } +{ return _print_ap ? max(_attivita.items(), _passivita.items()) : 0; } TRecnotype TRecordset_sezioni_contrapposte::items_cr() const { return max(_costi.items(), _ricavi.items()); } @@ -557,7 +558,7 @@ bool TRecordset_sezioni_contrapposte::move_to(TRecnotype pos) void TRecordset_sezioni_contrapposte::set_filter(char piano, const char* costo, const char* commessa, const char* fase, const TDate& dal, const TDate& al, word tipimov, bool movimentati, - bool nonnulli, const TString& daconto, const TString& aconto) + bool nonnulli, bool print_ap, const TString& daconto, const TString& aconto) { _tipo_piano = piano; @@ -578,6 +579,7 @@ void TRecordset_sezioni_contrapposte::set_filter(char piano, const char* costo, _movimentati = movimentati; _nonnulli = nonnulli; + _print_ap = print_ap; _filter.reset(); _filter.set_costo(costo); @@ -879,25 +881,28 @@ const TVariant& TRecordset_sezioni_contrapposte::get(const char* field) const else { if (fld == "SEZIONE") - return get_tmp_var() = _pos < items_ap() ? "AP" : "CR"; + { + return get_tmp_var() = _pos < items_cr() ? "CR" : "AP"; + + } const bool left = fld.starts_with("LEFT:"); - if (_pos < items_ap()) + if (_pos < items_cr()) { if (left) - return get_fld(_attivita, _pos, field+5); + return get_fld(_costi, _pos, field+5); else - return get_fld(_passivita, _pos, field+6); + return get_fld(_ricavi, _pos, field+6); } else { - const TRecnotype pos = _pos - items_ap(); - if (pos < items_cr()) + const TRecnotype pos = _pos - items_cr(); + if (pos < items_ap()) { if (left) - return get_fld(_costi, pos, field+5); + return get_fld(_attivita, pos, field+5); else - return get_fld(_ricavi, pos, field+6); + return get_fld(_passivita, pos, field+6); } } return get_tmp_var() = EMPTY_STRING; @@ -968,6 +973,7 @@ void TReport_bilancio_sezioni_contrapposte::set_filter(const TMask& m, int row) const bool movimentati = m.get_int(F_STAMPAV) == 1; const bool nonnulli = m.get_int(F_STAMPAV) == 2; + const bool print_ap = m.get_bool(F_PRINT_CONTO_ECON); TSheet_field& sf = m.sfield(F_RIGHE); TMask& sm = sf.sheet_mask(); @@ -990,7 +996,7 @@ void TReport_bilancio_sezioni_contrapposte::set_filter(const TMask& m, int row) } TRecordset_sezioni_contrapposte* recset = new TRecordset_sezioni_contrapposte(tipo); - recset->set_filter(tipo, costo, commessa, fase, dal, al, tipimov, movimentati, nonnulli, daconto, aconto); + recset->set_filter(tipo, costo, commessa, fase, dal, al, tipimov, movimentati, nonnulli, print_ap, daconto, aconto); TAnal_report::set_recordset(recset); }; diff --git a/ca/ca3300.h b/ca/ca3300.h index 6e89c998d..5a9ee6349 100755 --- a/ca/ca3300.h +++ b/ca/ca3300.h @@ -13,6 +13,7 @@ #define F_DATADA 312 #define F_DATAA 313 #define F_TIPOSTAMPA 314 +#define F_PRINT_CONTO_ECON 315 //campi generati dai piani dei conti #define F_PIANO 319 diff --git a/ca/ca3300.uml b/ca/ca3300.uml index 45c5ac8a4..d34cb27ac 100755 --- a/ca/ca3300.uml +++ b/ca/ca3300.uml @@ -115,6 +115,11 @@ BEGIN GROUP 4 END +BOOLEAN F_PRINT_CONTO_ECON +BEGIN + PROMPT 2 9 "Stampa situazione conto economico" +END + SPREADSHEET F_RIGHE -1 -1 BEGIN PROMPT 0 11 "" diff --git a/ca/ca3300c.rep b/ca/ca3300c.rep index 6fc331214..d2c6ba101 100755 --- a/ca/ca3300c.rep +++ b/ca/ca3300c.rep @@ -7,6 +7,8 @@ + + @@ -16,10 +18,10 @@
- + - + #TIPOSTAMPA @@ -92,13 +94,16 @@
SEZIONE - + + IF(SEZIONE=="AP","SITUAZIONE CONTO ECONOMICO","SITUAZIONE CONTI PATRIMONIALI") + + IF(SEZIONE=="AP","ATTIVITA'","COSTI") - + IF(SEZIONE=="AP","PASSIVITA'","RICAVI") - +
diff --git a/ca/ca3300d.rep b/ca/ca3300d.rep index 70a3475b4..3f7895e11 100755 --- a/ca/ca3300d.rep +++ b/ca/ca3300d.rep @@ -15,10 +15,10 @@
- + - + #TIPOSTAMPA @@ -81,25 +81,20 @@ SEZIONE MESSAGE RESET,F2 - + + IF(SEZIONE=="AP","SITUAZIONE CONTO ECONOMICO","SITUAZIONE CONTI PATRIMONIALI") + + + IF(SEZIONE=="AP","ATTIVITA'","COSTI") - "SEZIONE" @ -"AP" = IF - "PERDITA" "F2.405" ! -ELSE - "UTILE" "F2.405" ! -THEN - + IF(SEZIONE=="AP","PASSIVITA'","RICAVI") - "SEZIONE" @ -"AP" = IF - "UTILE" "F2.408" ! -ELSE - "PERDITA" "F2.408" ! -THEN - +
@@ -218,27 +213,34 @@ THEN +