Aggiustate alcune indentazioni della maschera clienti
Corretto ricalcolo saldi git-svn-id: svn://10.65.10.50/trunk@3508 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
882a0ec715
commit
8628b88ca1
706
cg/cg0200a.uml
706
cg/cg0200a.uml
File diff suppressed because it is too large
Load Diff
@ -384,21 +384,28 @@ bool CG4100_App::sort_sal()
|
||||
mov.read();
|
||||
CHECK(mov.good(),"Archivi movimenti e righe inconsistenti");
|
||||
|
||||
scaricato = mov.get_bool(MOV_SCARCON);
|
||||
|
||||
causali.zero();
|
||||
const char* codcaus = mov.get(MOV_CODCAUS);
|
||||
// cerca causale
|
||||
if (*codcaus)
|
||||
|
||||
tsal = normale;
|
||||
if (*codcaus) // cerca causale per determinare il tipoo del saldo
|
||||
{
|
||||
causali.put(CAU_CODCAUS, codcaus);
|
||||
causali.read();
|
||||
CHECK(causali.good(),"Archivi causali e movimenti inconsistenti");
|
||||
if (causali.get(CAU_MOVAP) == "A") tsal = apertura;
|
||||
else if (causali.get(CAU_MOVAP) == "C") tsal = chiusura;
|
||||
const int err = causali.read();
|
||||
if (err == NOERR)
|
||||
{
|
||||
const char ac = causali.get_char(CAU_MOVAP);
|
||||
if (ac == 'A')
|
||||
tsal = apertura;
|
||||
else
|
||||
if (ac == 'C')
|
||||
tsal = chiusura;
|
||||
}
|
||||
}
|
||||
provvis = mov.get(MOV_PROVVIS).not_empty();
|
||||
datareg = mov.get_date(MOV_DATAREG);
|
||||
|
||||
scaricato = mov.get_bool(MOV_SCARCON);
|
||||
provvis = mov.get(MOV_PROVVIS).not_empty();
|
||||
datareg = mov.get_date(MOV_DATAREG);
|
||||
|
||||
sal.reset();
|
||||
sal.set_anno_es(_year);
|
||||
|
@ -10,13 +10,11 @@
|
||||
#include <utility.h>
|
||||
#include "cg4300.h"
|
||||
|
||||
#define CHECK_ROUND(m,x) if(m==13)x.round(ROUND_MILLELIRE)
|
||||
|
||||
// -------------------- QUI comincia l'avventura --------------------------
|
||||
// Datemi un punto di appoggio ******************
|
||||
// e mi ci appoggero' ******************
|
||||
// ----------------------------------------------------- ******************
|
||||
|
||||
|
||||
bool TLiquidazione_app::recalc_all()
|
||||
{
|
||||
_prind = new TProgind(_selected.ones()*2, _printonly ?
|
||||
|
@ -6,9 +6,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <prefix.h>
|
||||
#include <utility.h>
|
||||
#include <saldi.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cglib.h"
|
||||
|
||||
class TContoExt : public TConto
|
||||
@ -64,37 +66,41 @@ void TTab_conti::aggiorna_conto(const TBill& tcon,
|
||||
|
||||
const real i(somma ? importo.valore() : -importo.valore());
|
||||
|
||||
if (movap == apertura)
|
||||
if (provv)
|
||||
{
|
||||
if (importo.sezione() == 'D')
|
||||
tc->saldo() += i;
|
||||
tc->darepro() += i;
|
||||
else
|
||||
tc->saldo() -= i;
|
||||
}
|
||||
else if (movap == chiusura)
|
||||
{
|
||||
if (importo.sezione() == 'D')
|
||||
tc->saldofin() += i;
|
||||
else
|
||||
tc->saldofin() -= i;
|
||||
tc->averepro() += i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (provv)
|
||||
{
|
||||
if (movap == apertura)
|
||||
{
|
||||
if (importo.sezione() == 'D')
|
||||
tc->darepro() += i;
|
||||
tc->saldo() += i;
|
||||
else
|
||||
tc->averepro() += i;
|
||||
}
|
||||
else
|
||||
tc->saldo() -= i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (importo.sezione() == 'D')
|
||||
tc->dare() += i;
|
||||
else
|
||||
tc->avere() += i;
|
||||
}
|
||||
if (movap == chiusura)
|
||||
{
|
||||
if (importo.sezione() == 'D')
|
||||
tc->saldofin() += i;
|
||||
else
|
||||
tc->saldofin() -= i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (importo.sezione() == 'D')
|
||||
tc->dare() += i;
|
||||
else
|
||||
tc->avere() += i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// rimuovo dalla tabella il conto se dare e avere vanno a zero
|
||||
if (!movimentato)
|
||||
@ -225,7 +231,10 @@ void TSaldo_agg::registra()
|
||||
saldi.put(SLD_FLAGSALINI, flag_salini);
|
||||
saldi.put(SLD_SALDO, si);
|
||||
saldi.put(SLD_PDARE, tcon.dare());
|
||||
|
||||
saldi.put(SLD_PAVERE, tcon.avere());
|
||||
saldi.put(SLD_PDAREPRO, tcon.darepro());
|
||||
saldi.put(SLD_PAVEREPRO, tcon.averepro());
|
||||
|
||||
real sf = tcon.saldofin();
|
||||
char flag_salfin = sf < ZERO ? 'A' : 'D';
|
||||
if (flag_salfin == 'A') sf = -sf;
|
||||
@ -233,7 +242,6 @@ void TSaldo_agg::registra()
|
||||
saldi.put(SLD_FLAGSALFIN, flag_salfin);
|
||||
saldi.put(SLD_SALDOFIN, sf);
|
||||
|
||||
saldi.put(SLD_PAVERE, tcon.avere());
|
||||
if (_num_ulmov != 0L) saldi.put(SLD_NUMULTMOV, _num_ulmov);
|
||||
if (_data_ulmov.ok()) saldi.put(SLD_DATAULMOV, _data_ulmov);
|
||||
update = saldi.write() == _isreinsert;
|
||||
@ -279,10 +287,19 @@ void TSaldo_agg::registra()
|
||||
r = saldi.get_real(SLD_PDARE);
|
||||
r += tcon.dare();
|
||||
saldi.put(SLD_PDARE, r);
|
||||
|
||||
r = saldi.get_real(SLD_PAVERE);
|
||||
r += tcon.avere();
|
||||
saldi.put(SLD_PAVERE, r);
|
||||
|
||||
r = saldi.get_real(SLD_PDAREPRO);
|
||||
r += tcon.darepro();
|
||||
saldi.put(SLD_PDAREPRO, r);
|
||||
|
||||
r = saldi.get_real(SLD_PAVEREPRO);
|
||||
r += tcon.averepro();
|
||||
saldi.put(SLD_PAVEREPRO, r);
|
||||
|
||||
const int err = saldi.rewrite();
|
||||
if (err != NOERR)
|
||||
yesnofatal_box("Errore %d nell'aggiornamento del saldo %d %d %ld",
|
||||
@ -345,8 +362,8 @@ void TEsercizi_contabili::check()
|
||||
{
|
||||
#ifdef DBG
|
||||
if (_firm != 0)
|
||||
error_box("Questo programma carinissimo usa gli esercizi, "
|
||||
"ma purtroppo non tiene conto del cambio ditta!");
|
||||
error_box("Questo programma carinissimo usa gli esercizi,\n"
|
||||
"purtroppo non tiene conto del cambio ditta!");
|
||||
#endif
|
||||
update();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user