From 01f6871d6b5327af48b0ad87cfda64e96ea100c9 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 7 Nov 1995 10:03:02 +0000 Subject: [PATCH] Corretta gestione ulteriori classificazioni git-svn-id: svn://10.65.10.50/trunk@2098 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg21rata.uml | 8 +++++--- cg/pagament.cpp | 25 ++++++++++++++++++------- cg/saldacon.cpp | 21 +++++++++++++++++++++ cg/saldacon.h | 11 +++++++++++ 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/cg/cg21rata.uml b/cg/cg21rata.uml index 5bb873b33..68b54b4d5 100755 --- a/cg/cg21rata.uml +++ b/cg/cg21rata.uml @@ -37,6 +37,7 @@ BEGIN PROMPT 1 5 "Tipo pagamento " SHEET "Codice|Tipo pagamento@32" INPUT 105 + ITEM " |Altro pagamento" ITEM "1|Rimessa diretta o contanti" ITEM "2|Tratta" ITEM "3|Ricevuta Bancaria" @@ -44,14 +45,15 @@ BEGIN ITEM "5|Paghero'" ITEM "6|Lettera di credito" ITEM "7|Tratta accettata" - ITEM "8|Altro pagamento" + ITEM "8|Rapporti interban. diretti" + ITEM "9|Bonifici" OUTPUT 105 OUTPUT 107 END STRING 106 1 BEGIN - PROMPT 1 6 "Ulter. class. " + PROMPT 21 5 "Ulter. class. " USE %CLR INPUT CODTAB[1,1] 105 SELECT INPUT CODTAB[2,2] 106 @@ -62,7 +64,7 @@ BEGIN CHECKTYPE NORMAL END -STRING 107 32 +STRING 107 50 32 BEGIN PROMPT 1 6 "Descrizione " FLAGS "D" diff --git a/cg/pagament.cpp b/cg/pagament.cpp index 51b331517..37259ca70 100755 --- a/cg/pagament.cpp +++ b/cg/pagament.cpp @@ -1,3 +1,4 @@ +#include #include #include "pagament.h" @@ -599,7 +600,7 @@ const char* TPagamento::desc_tipo(int tipo, char ulc) const { case 1: o = "Rimessa diretta o contanti"; break; case 2: o = "Tratta"; break; - case 3: o = "Ricevuta bancaria"; break; + case 3: o = "Ricevuta Bancaria"; break; case 4: o = "Cessione"; break; case 5: o = "Paghero'"; break; case 6: o = "Lettera di credito"; break; @@ -1231,7 +1232,9 @@ int TPagamento::remove(TTable& r) } void TPagamento::set_rate_auto() -{ +{ + main_app().begin_wait(); + // vedi rate esistenti e tipo prima rata // deve fare riferimento ad un tipo pagamento esistente // e sensato @@ -1278,6 +1281,8 @@ void TPagamento::set_rate_auto() // prima rata if (_tpr > 0 && _tpr < 4) set_imprata(0, tpay_rata(0) + _secndr); + + main_app().end_wait(); } @@ -1336,7 +1341,9 @@ void TPagamento::set_total(const real& imponibile, const real& imposta, const re void TPagamento::set_sheet(TSheet_field& sf, int sscad) -{ +{ + main_app().begin_wait(); + if (_inited && _rate.items() > 0) { const bool in_valuta = _cambio != 1.0; @@ -1369,16 +1376,19 @@ void TPagamento::set_sheet(TSheet_field& sf, int sscad) ts.add(paid ? "X" : "", 11); // 11 - Pagaya } - // destroy remaining - while (sf.items() > i) - sf.destroy(sf.items()-1); + // destroy remaining but avoid screen update by now + TString_array& arr = sf.rows_array(); + for (int d = arr.items()-1; d >= i; d--) + arr.destroy(d); sf.enable_column(2, in_valuta); } else if (_rate.items() > 0) // not inited: set edit sheet { - if (sf.items() > 0) sf.destroy(); + TString_array& arr = sf.rows_array(); + arr.destroy(); // Avoid screen update by now + for (int i = 0, scr = 0; i < n_rate(); i++) { TToken_string& s = sf.row(-1); @@ -1430,6 +1440,7 @@ void TPagamento::set_sheet(TSheet_field& sf, int sscad) } sf.force_update(); + main_app().end_wait(); } TPagamento::TPagamento(const char* codtab, const char* data) : diff --git a/cg/saldacon.cpp b/cg/saldacon.cpp index c3dbefe29..f34563eef 100755 --- a/cg/saldacon.cpp +++ b/cg/saldacon.cpp @@ -600,6 +600,9 @@ int TRiga_partite::rata_con_abbuoni_diffcam() const // TPartita /////////////////////////////////////////////////////////// +char TPartita::_cli_align = 'L'; +char TPartita::_for_align = 'L'; + TPartita::TPartita(const TBill& clifo, int anno, const char* num) : _part(LF_PARTITE, PART_NRIGA), _unassigned(LF_PAGSCA, "NRIGP") { @@ -641,6 +644,24 @@ int TPartita::compare(const TSortable& s) const return strcmp(key, par); } +void TPartita::modifica_allineamento(char ac, char af) +{ + CHECK(ac == 'L' || ac == 'R', "Allineamento clienti errato"); + _cli_align = ac; + CHECK(af == 'L' || af == 'R', "Allineamento fornitori errato"); + _for_align = af; +} + +// Ritorna l'allineamento corrente del numero partita +// L = Sinistra, R = Destra, ' ' = indeterminato +char TPartita::allineamento_corrente() const +{ + char all = numero()[0] == ' ' ? 'R' : 'L'; + if (all == 'L' && numero()[6] != ' ') + all = ' '; + return all; +} + // Costruisce le righe della partita bool TPartita::read(const TBill& clifo, int year, const char* num) { diff --git a/cg/saldacon.h b/cg/saldacon.h index 1e3adeff4..f4487fd12 100755 --- a/cg/saldacon.h +++ b/cg/saldacon.h @@ -183,9 +183,12 @@ class TPartita : public TSortable TBill _conto; int _anno; TString16 _num; + char _align; // current _num alignment TRecord_array _part; TRecord_array _unassigned; + + static char _cli_align, _for_align; // default _num alignment protected: const char* build_key(TString& key) const; @@ -246,6 +249,14 @@ public: char& new_ap, TImporto& new_abb, TImporto& new_diffcam, bool update); bool modifica_pagamento(const TRectype& new_pag); + + static void modifica_allineamento(char a_cli, char a_for); + static char allineamento_clienti() { return _cli_align; } + static char allineamento_fornitori() { return _for_align; } + + bool allinea(); + char allineamento_iniziale() const { return _align; } + char allineamento_corrente() const; TPartita(const TBill& clifo, int anno, const char* num); TPartita(const TRectype& part);