Corretta gestione valuta e abbuoni e banche
git-svn-id: svn://10.65.10.50/trunk@1891 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4fe9b183f5
commit
42605b0e11
@ -66,7 +66,6 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
{
|
||||
m->set_handler(F_DATADOC, doc_handler);
|
||||
m->set_handler(F_NUMDOC, doc_handler);
|
||||
// m->set_handler(F_NUMRIF, numrif_handler);
|
||||
m->set_handler(F_DATA74TER, data74ter_handler);
|
||||
m->set_handler(F_PROTIVA, protiva_handler);
|
||||
m->set_handler(F_CLIENTE, clifo_handler);
|
||||
|
@ -722,7 +722,7 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
|
||||
}
|
||||
app().calcola_saldo();
|
||||
break;
|
||||
case K_INS:
|
||||
case K_CTRL+K_INS: // Post inserimento
|
||||
if (app().is_pagamento())
|
||||
{
|
||||
const char tipo = app().curr_mask().get(S_TIPORIGA)[0];
|
||||
@ -740,6 +740,7 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
|
||||
if (row_type(row) != 'K')
|
||||
{
|
||||
cg.swap_rows(r, i);
|
||||
cg.force_update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1673,12 +1674,21 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
|
||||
const TString& valuta = clifo.get(CLI_CODVAL);
|
||||
if (valuta.not_empty())
|
||||
m.set(S_VALUTA, valuta, TRUE);
|
||||
}
|
||||
|
||||
if (clifo.get(CLI_CODCAB).not_empty())
|
||||
{
|
||||
m.set(FS_VSABI, clifo.get(CLI_CODABI));
|
||||
m.set(FS_VSCAB, clifo.get(CLI_CODCAB));
|
||||
m.send_key(K_TAB, FS_VSCAB);
|
||||
}
|
||||
m.set(FS_VSABI, clifo.get(CLI_CODABI));
|
||||
m.set(FS_VSCAB, clifo.get(CLI_CODCAB));
|
||||
m.send_key(K_TAB, FS_VSCAB);
|
||||
m.set(FS_AGENTE, cliforel.curr(LF_CFVEN).get(CLI_CODAG), TRUE);
|
||||
m.send_key(K_TAB, FS_AGENTE);
|
||||
|
||||
const TString& agente = cliforel.curr(LF_CFVEN).get(CLI_CODAG);
|
||||
if (agente.not_empty())
|
||||
{
|
||||
m.set(FS_AGENTE, agente, TRUE);
|
||||
m.send_key(K_TAB, FS_AGENTE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ bool TPrimanota_application::read_scadenze(TMask& m)
|
||||
ps.disable_cell(0,-1);
|
||||
|
||||
if (scad_locked)
|
||||
{
|
||||
{
|
||||
m.disable(-1); // Disabilita cliente
|
||||
m.disable(-2); // Disabilita fornitore
|
||||
m.disable(-3); // Disabilita cambio
|
||||
@ -458,8 +458,19 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
||||
partita.put(PART_SEZ, sezione);
|
||||
partita.put(PART_CODVAL, codval);
|
||||
partita.put(PART_CAMBIO, cambio);
|
||||
partita.put(PART_IMPORTO, pag.imponibile()+pag.imposta());
|
||||
partita.put(PART_IMPOSTA, pag.imposta());
|
||||
|
||||
if (partita.in_valuta())
|
||||
{
|
||||
partita.put(PART_IMPORTO, m.get(F_IMPONIBILI));
|
||||
partita.put(PART_IMPORTOVAL, pag.imponibile());
|
||||
partita.zero(PART_IMPOSTA);
|
||||
}
|
||||
else
|
||||
{
|
||||
partita.put(PART_IMPORTO, pag.imponibile()+pag.imposta());
|
||||
partita.zero(PART_IMPORTOVAL);
|
||||
partita.put(PART_IMPOSTA, pag.imposta());
|
||||
}
|
||||
partita.put(PART_SPESE, pag.spese());
|
||||
|
||||
TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET);
|
||||
@ -483,10 +494,10 @@ 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(5));
|
||||
scadenza.put(SCAD_CODCABPR, row.get(6));
|
||||
scadenza.put(SCAD_CODABI, row.get(7));
|
||||
scadenza.put(SCAD_CODCAB, row.get(8));
|
||||
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_CODAG, agente);
|
||||
}
|
||||
@ -498,7 +509,7 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
||||
const int primafatt = oldgame->prima_fattura(nreg);
|
||||
if (primafatt > 0)
|
||||
{
|
||||
if (*oldgame != *newgame)
|
||||
if (newgame == NULL || *oldgame != *newgame)
|
||||
{
|
||||
bool sposta = newgame != NULL;
|
||||
if (sposta)
|
||||
@ -510,7 +521,10 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
||||
if (sposta)
|
||||
oldgame->sposta_riga(primafatt, *newgame);
|
||||
else
|
||||
{
|
||||
oldgame->scollega_pagamenti(primafatt);
|
||||
oldgame->rimuovi_riga(primafatt);
|
||||
}
|
||||
oldgame->rewrite();
|
||||
}
|
||||
else
|
||||
|
@ -1064,7 +1064,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
if (deleting != riga_contabile)
|
||||
{
|
||||
// Sottrae l'abbuono con la sezione invertita dalla riga contabile
|
||||
add_cgs_imp(riga_contabile, old_abbuono);
|
||||
add_cgs_imp(riga_contabile-1, old_abbuono);
|
||||
}
|
||||
}
|
||||
if (new_ap != ' ') // Se ci sono abbuoni
|
||||
@ -1082,7 +1082,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
if (deleting != riga_contabile)
|
||||
{
|
||||
// Aggiunge l'abbuono con la sezione invertita
|
||||
sub_cgs_imp(riga_contabile, new_abbuono);
|
||||
sub_cgs_imp(riga_contabile-1, new_abbuono);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1109,7 +1109,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
if (deleting != riga_contabile)
|
||||
{
|
||||
// Aggiunge la differenza con la sezione invertita
|
||||
sub_cgs_imp(riga_contabile, grow_diffcam);
|
||||
sub_cgs_imp(riga_contabile-1, grow_diffcam);
|
||||
}
|
||||
}
|
||||
} // if (deleting != 0)
|
||||
|
@ -73,7 +73,7 @@ END
|
||||
|
||||
NUMBER 108 5
|
||||
BEGIN
|
||||
PROMPT 27 8 "Ns. Banca CAB "
|
||||
PROMPT 27 7 "Ns. Banca CAB "
|
||||
FLAGS "Z"
|
||||
COPY ALL 107
|
||||
CHECKTYPE NORMAL
|
||||
|
@ -601,7 +601,7 @@ bool TPartita::write(bool re) const
|
||||
{
|
||||
TRiga_partite& row = riga(r);
|
||||
row.put(PART_GRUPPOCL, conto().gruppo());
|
||||
row.put(PART_GRUPPOCL, conto().conto());
|
||||
row.put(PART_CONTOCL, conto().conto());
|
||||
}
|
||||
}
|
||||
int err = _part.write(re);
|
||||
@ -1027,7 +1027,7 @@ void TPartita::sposta_riga(int r, TPartita& part)
|
||||
// Sposta i pagamenti della riga r, dalla rata s compresa in poi, sui non assegnati
|
||||
void TPartita::scollega_pagamenti(int r, int s)
|
||||
{
|
||||
CHECKD(s >= 0, "Impossibile scollegare la rata ", s);
|
||||
CHECKD(s > 0, "Impossibile scollegare la rata ", s);
|
||||
|
||||
const TRiga_partite& row = riga(r);
|
||||
for (int i = row.rate(); i >= s; i--)
|
||||
|
@ -199,7 +199,7 @@ public:
|
||||
// assegna riga e figli ad altra partita
|
||||
void sposta_riga(int r, TPartita& part);
|
||||
// de-assegna tutti i pagamenti di una riga e li distrugge
|
||||
void scollega_pagamenti(int riga, int rata = 0);
|
||||
void scollega_pagamenti(int riga, int rata = 1);
|
||||
|
||||
int succ(int r) const { return _part.succ_row(r); }
|
||||
int pred(int r) const { return _part.pred_row(r); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user