From 67df99e22ffe01d1d70f3560fe7d1f42fb6a6b92 Mon Sep 17 00:00:00 2001 From: luca Date: Wed, 18 Nov 2009 09:54:04 +0000 Subject: [PATCH] Patch level :10.0 530 Files correlati : Ricompilazione Demo : [ ] Commento : 0001504: bilancio a sezioni contrapposte Descrizione sulla stampa del bilancio a sezioni contrapposte delle commesse: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit l'esposizione dovrà partire dal conto economico, la dicitura bilancio dovrà essere sostituita con conto economico o situazione conto economico; per quello che riguarda gli eventuali conti non patrimoniali la sezione dovrà chiamarsi riepilogo conti patrimoniali, dovrà contenere dei totali di sezione ed eventualmente un delta risultante dalla somma algebrica di attività e passività. git-svn-id: svn://10.65.10.50/trunk@19645 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ca/ca3300.cpp | 30 +++++++++++++++---------- ca/ca3300.h | 1 + ca/ca3300.uml | 5 +++++ ca/ca3300c.rep | 15 ++++++++----- ca/ca3300d.rep | 60 ++++++++++++++++++++++++++------------------------ 5 files changed, 65 insertions(+), 46 deletions(-) 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 +