From ea5f02c9cbeb1fbf8e6e82a65d813ce88fa8a960 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 3 Nov 1995 08:17:08 +0000 Subject: [PATCH] Corretti errori Gabriella git-svn-id: svn://10.65.10.50/trunk@2072 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg0500.cpp | 8 ++++-- cg/cg2100.cpp | 4 +-- cg/cg2100b.uml | 11 +++++--- cg/cg2104.cpp | 73 +++++++++++++++++++++++++------------------------ cg/cg21rata.uml | 69 +++++++++++++++++++++++++++------------------- cg/cg21sld.uml | 1 + cg/pagament.h | 2 +- 7 files changed, 95 insertions(+), 73 deletions(-) diff --git a/cg/cg0500.cpp b/cg/cg0500.cpp index b5b31ebb9..e728962eb 100755 --- a/cg/cg0500.cpp +++ b/cg/cg0500.cpp @@ -383,9 +383,11 @@ bool TCaus_app::tipomov_hndl (TMask_field& f, KEY k) bool TCaus_app::codcausim_hndl (TMask_field& f, KEY k) { if (f.to_check(k)) - { - TString16 causim(f.get()); - TLocalisamfile& caus = app()._rel->lfile(LF_CAUSALI); + { + TEdit_field& e = (TEdit_field&)f; + const TString& causim = e.get(); + + TLocalisamfile& caus = e.browse()->cursor()->file(); caus.zero(); caus.put(CAU_CODCAUS, causim); if (caus.read() == NOERR) diff --git a/cg/cg2100.cpp b/cg/cg2100.cpp index 0187481f2..9e2be18d1 100755 --- a/cg/cg2100.cpp +++ b/cg/cg2100.cpp @@ -428,7 +428,7 @@ void TPrimanota_application::init_mask(TMask& m) if (_iva == nessuna_iva) { - m.enable(-5, _is_saldaconto); // Abilita campi saldaconto + m.show(-5, _is_saldaconto); // Abilita campi saldaconto } else { @@ -872,7 +872,7 @@ int TPrimanota_application::write(const TMask& m) } else { - if (!m.get_bool(F_SOLAIVA)) + if (!m.get_bool(F_SOLAIVA) && !is_saldaconto()) { const TString16 causimm(causale().causale_inc_imm()); if (causimm.not_empty()) diff --git a/cg/cg2100b.uml b/cg/cg2100b.uml index 6ef302861..0c9a3e140 100755 --- a/cg/cg2100b.uml +++ b/cg/cg2100b.uml @@ -176,6 +176,7 @@ END GROUPBOX DLG_NULL 78 5 BEGIN PROMPT 1 10 "Voci per saldaconto" + GROUP 5 END STRING S_VALUTA 3 @@ -184,7 +185,7 @@ BEGIN HELP "Codice della valuta per movimento" FIELD CODVAL FLAGS "UZ" - GROUP 3 + GROUP 3 5 USE %VAL INPUT CODTAB S_VALUTA DISPLAY "Codice" CODTAB @@ -209,7 +210,7 @@ BEGIN OUTPUT S_VALUTA CODTAB[1,3] OUTPUT S_DATACAMBIO D0 OUTPUT S_CAMBIO R10 - GROUP 3 + GROUP 3 5 CHECKTYPE NORMAL END @@ -219,7 +220,7 @@ BEGIN HELP "Cambio della valuta" FIELD CAMBIO FLAGS "RU" - GROUP 3 + GROUP 3 5 PICTURE ".5" CHECKTYPE REQUIRED END @@ -239,7 +240,7 @@ BEGIN PROMPT 44 12 "Totale in valuta " HELP "" PICTURE ".2" - GROUP 3 + GROUP 3 5 VALIDATE REQIF_FUNC 1 F_TOTALE FIELD TOTDOCVAL END @@ -324,6 +325,7 @@ BEGIN PROMPT 1 7 "Totale doc. " PICTURE "." FLAGS "D" + GROUP 5 END NUMBER K_RESIDUO 15 @@ -331,6 +333,7 @@ BEGIN PROMPT 32 7 "Residuo " PICTURE "." FLAGS "D" + GROUP 5 END LIST S_TIPORIGA 1 13 diff --git a/cg/cg2104.cpp b/cg/cg2104.cpp index 505be7f77..411ab587f 100755 --- a/cg/cg2104.cpp +++ b/cg/cg2104.cpp @@ -36,10 +36,10 @@ bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k) TString16 banca; bool doit = TRUE, m_imp = FALSE, m_perc = FALSE, m_pag = FALSE; - bool m_scad = FALSE, m_tipo = FALSE, mod = FALSE; + bool m_scad = FALSE, m_tipo = FALSE, m_ulc = FALSE, mod = FALSE; word ahiahi = P_OK; - TString news(10), newi(15), newp(15), newt(2); + TString news(10), newi(15), newp(15), newt(1), newu(1); bool recalc = msk->get_bool(FS_RECALC); bool mcomm = msk->get_bool(FS_MCOMM); @@ -54,6 +54,7 @@ bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k) newi = ns.get(impos); // Imponibile (lire o valuta) newp = ns.get(3); // Percentuale newt = ns.get(4); // Tipo pagamento + newu = ns.get(5); // Ulteriore classificazione // qui viene il bello, si fa per dire if (news != ts.get(0)) // modificata data scadenza @@ -68,6 +69,9 @@ bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k) } if (newt != ts.get(4)) // modificato tipo pagamento mod = m_tipo = TRUE; + + if (newu != ts.get(5)) // modificata ulteriore classificazione + mod = m_ulc = TRUE; break; case K_DEL: case K_INS: @@ -92,7 +96,8 @@ bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k) (m_perc ? (const char*)newp : (const char*)newi) : NULL), (m_scad ? (const char*)news : NULL), - (m_tipo ? (const char*)newt : NULL), + (m_tipo ? (const char*)newt : NULL), + (m_ulc ? (const char*)newu : NULL), rdiff, mcomm, need_recalc); // see if rdiff changed msk->set(FS_RDIFFER, pag.rate_differenziate() ? "1" : "2"); @@ -215,20 +220,18 @@ bool TPrimanota_application::recalc_handler(TMask_field& f, KEY key) bool TPrimanota_application::nrate_handler(TMask_field& f, KEY key) { - const TMask& m = f.mask(); - if (key == K_TAB && m.is_running() && app().is_saldaconto()) + if (key == K_TAB && f.focusdirty()) { TPagamento* pag = app().pagamento(); - if (pag != NULL) + CHECK(pag != NULL, "Null pagament"); + pag->set_numero_rate(atoi(f.get())); + if (pag->dirty()) { - pag->set_numero_rate(atoi(f.get())); - if (pag->dirty()) - { - TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET); - pag->set_sheet(ps); - } - } - else f.reset(); + TMask& m = f.mask(); + TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET); + pag->set_sheet(ps); + app().pag_rows() = ps.rows_array(); + } } return TRUE; } @@ -239,11 +242,11 @@ bool TPrimanota_application::codcab_handler(TMask_field& f, KEY key) { const TMask& m = f.mask(); const short id = f.dlg() == FS_NSCAB ? FS_NSABI : FS_VSABI; - const int pos = id == FS_NSABI ? 6 : 8; + const int pos = id == FS_NSABI ? 7 : 9; // Posizione codici ABI sullo sheet const TString16 abi = m.get(id); const TString16 cab = m.get(id+1); TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET); - for (int i = ps.items()-1; i >= 0; i--) + for (int i = ps.items()-1; i >= 0; i--) // Setta la banca in tutte le righe { TToken_string& row = ps.row(i); row.add(abi, pos); @@ -421,16 +424,16 @@ bool TPrimanota_application::read_scadenze(TMask& m) pag.set_rata(i-1, importo, ZERO, scad, tipop, ulc, paid); TToken_string& str = ps.row(i-1); - str.add(scadenza.get(SCAD_CODABIPR), 6); - str.add(scadenza.get(SCAD_CODCABPR), 7); - str.add(scadenza.get(SCAD_CODABI), 8); - str.add(scadenza.get(SCAD_CODCAB), 9); + str.add(scadenza.get(SCAD_CODABIPR), 7); + str.add(scadenza.get(SCAD_CODCABPR), 8); + str.add(scadenza.get(SCAD_CODABI), 9); + str.add(scadenza.get(SCAD_CODCAB), 10); if (i == 1) { - m.set(FS_NSABI, str.get(6)); - m.set(FS_NSCAB, str.get(7)); - m.set(FS_VSABI, str.get(8)); - m.set(FS_VSCAB, str.get(9)); + m.set(FS_NSABI, str.get(7)); + m.set(FS_NSCAB, str.get(8)); + m.set(FS_VSABI, str.get(9)); + m.set(FS_VSCAB, str.get(10)); m.set(FS_AGENTE, scadenza.get(SCAD_CODAG)); } } @@ -468,17 +471,17 @@ void TPrimanota_application::write_scadenze(const TMask& m) real imposta(0.0); real spese(0.0); - const TString16 ndoc(m.get(F_NUMDOC)); + const TString ndoc(m.get(F_NUMDOC)); const int tmov = causale().tipomov(); const TDate ddoc(m.get(F_DATADOC)); const TDate dreg(m.get(F_DATAREG)); - const TString16 reg (causale().reg().name()); - const TString80 desc(m.get(F_DESCR)); + const TString reg (causale().reg().name()); + const TString desc(m.get(F_DESCR)); const long protiva = m.get_long(F_PROTIVA); - const TString16 codcaus(causale().codice()); - const TString16 codval (m.get(S_VALUTA)); + const TString codcaus(causale().codice()); + const TString codval (m.get(S_VALUTA)); const real cambio (m.get(S_CAMBIO)); - const TString16 agente (m.get(FS_AGENTE)); + const TString agente (m.get(FS_AGENTE)); const char sezione = get_cgs_imp(0).sezione(); // Dare/Avere const TBill clifo(cgs().row(0), 2, 0x3); @@ -538,12 +541,12 @@ void TPrimanota_application::write_scadenze(const TMask& m) scadenza.zero(SCAD_IMPORTOVAL); } scadenza.put(SCAD_DATASCAD, pag.data_rata(i)); - scadenza.put(SCAD_CODABIPR, row.get(6)); - scadenza.put(SCAD_CODCABPR, row.get(7)); - scadenza.put(SCAD_CODABI, row.get(8)); - scadenza.put(SCAD_CODCAB, row.get(9)); - scadenza.put(SCAD_PAGATA, pag.ratapagata(i)); + scadenza.put(SCAD_CODABIPR, row.get(7)); + scadenza.put(SCAD_CODCABPR, row.get(8)); + scadenza.put(SCAD_CODABI, row.get(9)); + scadenza.put(SCAD_CODCAB, row.get(10)); scadenza.put(SCAD_CODAG, agente); + scadenza.put(SCAD_PAGATA, pag.ratapagata(i)); } } diff --git a/cg/cg21rata.uml b/cg/cg21rata.uml index 927cbe90a..5bb873b33 100755 --- a/cg/cg21rata.uml +++ b/cg/cg21rata.uml @@ -13,7 +13,7 @@ BEGIN CHECKTYPE REQUIRED END -BOOLEAN 111 +BOOLEAN 112 BEGIN PROMPT 41 3 "Pagata" FLAGS "D" @@ -46,36 +46,49 @@ BEGIN ITEM "7|Tratta accettata" ITEM "8|Altro pagamento" OUTPUT 105 - OUTPUT 106 + OUTPUT 107 END -STRING 106 32 +STRING 106 1 +BEGIN + PROMPT 1 6 "Ulter. class. " + USE %CLR + INPUT CODTAB[1,1] 105 SELECT + INPUT CODTAB[2,2] 106 + DISPLAY "Tipo pagamento" CODTAB[1,1] + DISPLAY "Classificazione" CODTAB[2,2] + DISPLAY "Descrizione@50" S0 + OUTPUT 106 CODTAB[2,2] + CHECKTYPE NORMAL +END + +STRING 107 32 BEGIN PROMPT 1 6 "Descrizione " FLAGS "D" END -NUMBER 107 5 +NUMBER 108 5 BEGIN PROMPT 1 7 "Ns. Banca ABI " FLAGS "Z" USE %BAN - INPUT CODTAB[1,5] 107 - INPUT CODTAB[6,10] 108 + INPUT CODTAB[1,5] 108 + INPUT CODTAB[6,10] 109 DISPLAY "ABI@5" CODTAB[1,5] DISPLAY "CAB@5" CODTAB[6,10] DISPLAY "Denominazione@50" S0 - OUTPUT 107 CODTAB[1,5] - OUTPUT 108 CODTAB[6,10] + OUTPUT 108 CODTAB[1,5] + OUTPUT 109 CODTAB[6,10] OUTPUT 126 S0 CHECKTYPE NORMAL END -NUMBER 108 5 +NUMBER 109 5 BEGIN PROMPT 27 7 "Ns. Banca CAB " FLAGS "Z" - COPY ALL 107 + COPY ALL 108 CHECKTYPE NORMAL END @@ -87,39 +100,39 @@ BEGIN DISPLAY "Denominazione@50" S0 DISPLAY "ABI@5" CODTAB[1,5] DISPLAY "CAB@5" CODTAB[6,10] - COPY OUTPUT 107 - CHECKTYPE NORMAL -END - -NUMBER 109 5 -BEGIN - PROMPT 1 9 "Vs. Banca ABI " - FLAGS "Z" - COPY USE 107 - INPUT CODTAB[1,5] 109 - INPUT CODTAB[6,10] 110 - COPY DISPLAY 107 - OUTPUT 109 CODTAB[1,5] - OUTPUT 110 CODTAB[6,10] - OUTPUT 128 S0 + COPY OUTPUT 108 CHECKTYPE NORMAL END NUMBER 110 5 +BEGIN + PROMPT 1 9 "Vs. Banca ABI " + FLAGS "Z" + COPY USE 108 + INPUT CODTAB[1,5] 110 + INPUT CODTAB[6,10] 111 + COPY DISPLAY 108 + OUTPUT 110 CODTAB[1,5] + OUTPUT 111 CODTAB[6,10] + OUTPUT 128 S0 + CHECKTYPE NORMAL +END + +NUMBER 111 5 BEGIN PROMPT 27 9 "Vs. Banca CAB " FLAGS "Z" - COPY ALL 109 + COPY ALL 110 CHECKTYPE NORMAL END STRING 128 50 45 BEGIN PROMPT 1 10 "" - COPY USE 109 + COPY USE 110 INPUT S0 128 COPY DISPLAY 126 - COPY OUTPUT 109 + COPY OUTPUT 110 CHECKTYPE NORMAL END diff --git a/cg/cg21sld.uml b/cg/cg21sld.uml index dad1d31d2..3cb098957 100755 --- a/cg/cg21sld.uml +++ b/cg/cg21sld.uml @@ -166,6 +166,7 @@ BEGIN ITEM "In Valuta@15" ITEM "%@6" ITEM "Tipo" + ITEM "Classif." ITEM "Pagamento@32" ITEM "Ns.ABI" ITEM "Ns.CAB" diff --git a/cg/pagament.h b/cg/pagament.h index bcf5eb53f..b102658b9 100755 --- a/cg/pagament.h +++ b/cg/pagament.h @@ -156,7 +156,7 @@ public: // ritorna TRUE se non si poteva; non occorre che sia inizializzato // con un importo word recalc_rate(int row, bool is_perc_modified, const char* new_value, - const char* scad, const char* typ, int rdiff, + const char* scad, const char* typ, const char* ulc, int rdiff, bool mcomm, bool& need_recalc); // determina la prossima scadenza