Magnifica gestione pagamenti

git-svn-id: svn://10.65.10.50/trunk@1925 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-10-06 13:24:49 +00:00
parent faaecf5c85
commit 34ad90a94e
3 changed files with 20 additions and 15 deletions

View File

@ -274,8 +274,9 @@ bool TPrimanota_application::sub_cgs_imp(int n, const TImporto& imp)
{ {
TImporto tot; TImporto tot;
tot = cgs().row(n); tot = cgs().row(n);
tot -= imp; tot -= imp;
set_cgs_imp(n, tot.normalize()); tot.normalize();
set_cgs_imp(n, tot);
return tot.is_zero(); return tot.is_zero();
} }
@ -742,8 +743,9 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
if (s < 0) if (s < 0)
{ {
TConto cassa; app().causale().bill(2, cassa); TConto cassa; app().causale().bill(2, cassa);
const TString desc(app().causale().desc_agg(2));
growth.swap_section(); growth.normalize(); growth.swap_section(); growth.normalize();
app().set_cgs_row(s, growth, cassa, app().causale().desc_agg(2), 'L'); app().set_cgs_row(s, growth, cassa, desc, 'L');
} }
else else
app().sub_cgs_imp(s, growth); app().sub_cgs_imp(s, growth);
@ -759,7 +761,7 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
case K_CTRL+K_INS: // Post inserimento case K_CTRL+K_INS: // Post inserimento
if (app().is_pagamento()) if (app().is_pagamento())
{ {
const char tipo = app().curr_mask().get(S_TIPORIGA)[0]; const char tipo = cg.mask().get(S_TIPORIGA)[0];
if (tipo == 'K' || tipo == 'G') if (tipo == 'K' || tipo == 'G')
{ {
const int k = tipo == 'K' ? 1 : 10; const int k = tipo == 'K' ? 1 : 10;

View File

@ -638,7 +638,8 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
if (riga < 0) if (riga < 0)
{ {
TBill conto_rit; causale().bill(11, conto_rit); TBill conto_rit; causale().bill(11, conto_rit);
set_cgs_row(riga, grow_ritenute, conto_rit, causale().desc_agg(11), 'F'); const TString desc(causale().desc_agg(11));
set_cgs_row(riga, grow_ritenute, conto_rit, desc, 'F');
} }
else else
{ {
@ -680,7 +681,8 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
{ {
const int rc = new_ap == 'A' ? 9 : 8; const int rc = new_ap == 'A' ? 9 : 8;
TBill conto_abb; causale().bill(rc, conto_abb); TBill conto_abb; causale().bill(rc, conto_abb);
app().set_cgs_row(riga_abb, new_abbuono, conto_abb, causale().desc_agg(rc), new_ap); const TString desc(causale().desc_agg(rc));
app().set_cgs_row(riga_abb, new_abbuono, conto_abb, desc, new_ap);
} }
else else
add_cgs_imp(riga_abb, new_abbuono); add_cgs_imp(riga_abb, new_abbuono);
@ -688,7 +690,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
if (deleting != riga_contabile) if (deleting != riga_contabile)
{ {
// Aggiunge l'abbuono con la sezione invertita // Aggiunge l'abbuono con la sezione invertita
sub_cgs_imp(riga_contabile-1, new_abbuono); sub_cgs_imp(riga_contabile-1, new_abbuono);
} }
} }
} }
@ -704,7 +706,8 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
if (riga_diffcam < 0) if (riga_diffcam < 0)
{ {
TBill conto_diffcam; causale().bill(12, conto_diffcam); TBill conto_diffcam; causale().bill(12, conto_diffcam);
set_cgs_row(riga_diffcam, grow_diffcam, conto_diffcam, causale().desc_agg(12), 'C'); const TString desc(causale().desc_agg(12));
set_cgs_row(riga_diffcam, grow_diffcam, conto_diffcam, desc, 'C');
} }
else else
{ {

View File

@ -76,14 +76,14 @@ public:
bool ratapagata(int n) const { return _rata_sfield(n,6)[0] > ' ';} bool ratapagata(int n) const { return _rata_sfield(n,6)[0] > ' ';}
real tlit_rata(int n) const { return _rata_rfield(n,7);} real tlit_rata(int n) const { return _rata_rfield(n,7);}
char inizio_scadenza() const { return _inscad; } char inizio_scadenza() const { return _inscad; }
bool mese_commerciale() const { return _mcomm; } bool mese_commerciale() const { return _mcomm; }
bool rate_differenziate() const { return _rdiff; } bool rate_differenziate() const { return _rdiff; }
int tipo_prima_rata() const { return _tpr; } int tipo_prima_rata() const { return _tpr; }
int decs() const { return _round; } int decs() const { return _round; }
const TString& name() const { return _name; } const TString& name() const { return _name; }
const TString& code() const { return _code; } const TString& code() const { return _code; }
const char* desc_tpr() const; const char* desc_tpr() const;
const char* desc_tipo(int) const; const char* desc_tipo(int) const;