Continua imperterrita la saga del saldaconto

git-svn-id: svn://10.65.10.50/trunk@2042 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-10-30 10:17:14 +00:00
parent 225ba7bab4
commit f9191c118f
8 changed files with 39 additions and 14 deletions

View File

@ -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

View File

@ -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);

View File

@ -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());
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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

View File

@ -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() > ' ')

View File

@ -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);
};