diff --git a/cg/cg2100s.uml b/cg/cg2100s.uml index b1f9bad56..d42e8ea4f 100755 --- a/cg/cg2100s.uml +++ b/cg/cg2100s.uml @@ -261,6 +261,7 @@ BEGIN OUTPUT S_CODDESC CODTAB OUTPUT S_DESCAGG S0 CHECKTYPE NORMAL + VALIDATE NOT_EMPTY_CHECK_FIELD END STRING S_DESCAGG 50 diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index d182fce5b..e7a88a428 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -489,12 +489,12 @@ real TPrimanota_application::calcola_saldo() const switch (sbilancio.sign()) { case +1: // Il dare supera l'avere in valore assoluto - m.set(F_DARE, (tdare-tavere).string()); + m.set(F_DARE, real(tdare-tavere).string()); m.reset(F_AVERE); break; case -1: // L'avere supera il dare in valore assoluto m.reset(F_DARE); - m.set(F_AVERE, (tavere-tdare).string()); + m.set(F_AVERE, real(tavere-tdare).string()); break; default: // Sbilancio nullo m.reset(F_DARE); diff --git a/cg/cg2104.cpp b/cg/cg2104.cpp index a8eebc16d..ab9920877 100755 --- a/cg/cg2104.cpp +++ b/cg/cg2104.cpp @@ -499,7 +499,7 @@ void TPrimanota_application::write_scadenze(const TMask& m) } else { - partita.put(PART_IMPORTO, pag.imponibile()+pag.imposta()); + partita.put(PART_IMPORTO, real(pag.imponibile()+pag.imposta())); partita.zero(PART_IMPORTOVAL); partita.put(PART_IMPOSTA, pag.imposta()); } diff --git a/cg/cg2105.cpp b/cg/cg2105.cpp index 27917b575..ea708c829 100755 --- a/cg/cg2105.cpp +++ b/cg/cg2105.cpp @@ -50,11 +50,15 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad, rel.curr() = oldpag; autoload(&rel); // Load current record on mask + const TPartita& p = scad.partita(); + const int nrigp = oldpag.get_int(PAGSCA_NRIGP); + const TRiga_partite& sum = p.riga(nrigp); const TRiga_partite& fatt = scad.riga(); + set(S_NUMDOC, fatt.get(PART_NUMDOC)); // Numero documento set(S_DATADOC, fatt.get(PART_DATADOC)); // Data documento set(S_NUMPROT, fatt.get(PART_PROTIVA)); // Protocollo IVA - set(S_DESCR, fatt.get(PART_DESCR)); // Descrizione documento + set(S_DESCR, sum.get(PART_DESCR)); // Descrizione documento set(S_DATA_SCAD, scad.get(SCAD_DATASCAD)); // Data della scadenza set(S_SEZIONE_SCAD, scad.riga().sezione()); // Sezione della rata @@ -76,9 +80,6 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad, // Attiva campi relativi alla valuta show(-3, in_valuta); - const TPartita& p = scad.partita(); - const int nrigp = oldpag.get_int(PAGSCA_NRIGP); - const TRiga_partite& sum = p.riga(nrigp); const long numreg = sum.get_long(PART_NREG); const int numrig = sum.get_int(PART_NUMRIG); _valuta.get(sum); diff --git a/cg/cglib01.cpp b/cg/cglib01.cpp index c7c93bbd1..a78d21d43 100755 --- a/cg/cglib01.cpp +++ b/cg/cglib01.cpp @@ -403,7 +403,8 @@ bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil long sottoconto; real pdarepro, paverepro; bool esito = FALSE; - TLocalisamfile saldi(LF_SALDI, FALSE); + + TLocalisamfile saldi(LF_SALDI); _saldo_iniziale = ZERO; _saldoiniziale = ZERO; @@ -458,14 +459,20 @@ bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil esito = TRUE; - if (stp_prov == 1) + switch (stp_prov) + { + case 1: _saldo = _saldo_iniziale + _prg_dare - _prg_avere; - - if (stp_prov == 2) + break; + case 2: _saldo = _saldo_iniziale + _prg_dare - _prg_avere + pdarepro - paverepro; - - if (stp_prov == 3) + break; + case 3: _saldo = pdarepro - paverepro; + break; + default: + break; + } } return esito; } diff --git a/cg/pagament.cpp b/cg/pagament.cpp index 08831f338..21d3ad84b 100755 --- a/cg/pagament.cpp +++ b/cg/pagament.cpp @@ -720,7 +720,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified, // aggiungere il resto sulla 1a rata // controlla se rdiff e' compatibile con // i dati e se e' il caso riaggiusta - if (rdiff == 3 && !((remainder % newv.integer()) == ZERO)) + if (rdiff == 3 && (remainder % newv) != 0.0) rdiff = 2; // *** 10/8/95: se uguali e non e' multiplo intero lo teniamo cosi' e poi // *** aggiungiamo alla prima rata utile diff --git a/cg/saldacon.cpp b/cg/saldacon.cpp index 1cacc774f..c3dbefe29 100755 --- a/cg/saldacon.cpp +++ b/cg/saldacon.cpp @@ -606,6 +606,21 @@ TPartita::TPartita(const TBill& clifo, int anno, const char* num) read(clifo, anno, num); } +TPartita::TPartita(const TRectype& r) +: _part(LF_PARTITE, PART_NRIGA), _unassigned(LF_PAGSCA, "NRIGP") +{ + TBill clifo; clifo.get(r); + if (clifo.gruppo() == 0) + { + clifo.set(r.get_int(PART_GRUPPOCL), r.get_int(PART_CONTOCL), + clifo.sottoconto(), clifo.tipo()); + } + + const int anno = r.get_int(PART_ANNO); + const char* num = r.get_str(PART_NUMPART); + read(clifo, anno, num); +} + const char* TPartita::build_key(TString& key) const { if (_conto.tipo() > ' ') diff --git a/cg/saldacon.h b/cg/saldacon.h index 86385042b..1e3adeff4 100755 --- a/cg/saldacon.h +++ b/cg/saldacon.h @@ -248,6 +248,7 @@ public: bool modifica_pagamento(const TRectype& new_pag); TPartita(const TBill& clifo, int anno, const char* num); + TPartita(const TRectype& part); };