Eliminata riga di contropartita dalle righe contabili
git-svn-id: svn://10.65.10.50/trunk@640 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7950cf97e8
commit
253a7bf2c4
@ -515,12 +515,8 @@ int TPrimanota_application::read(TMask& m)
|
||||
const TRectype& r = _rel->cg(i);
|
||||
riga.cut(0); // Vuota la riga
|
||||
|
||||
const int rcontr = r.get_int("RCONTR") -1;
|
||||
if (rcontr < -1 || rcontr >= _rel->cg_items() || rcontr == i)
|
||||
error_box("La riga %d non puo' avere per contropartita la %d", i+1, rcontr+1);
|
||||
|
||||
const real im(r.get_real("IMPORTO"));
|
||||
const char sezione = toupper(r.get_char("SEZIONE"));
|
||||
const real im(r.get_real("IMPORTO"));
|
||||
|
||||
TImporto import(sezione, im);
|
||||
import.add_to(riga); // Dare/Avere 101-102
|
||||
@ -533,12 +529,9 @@ int TPrimanota_application::read(TMask& m)
|
||||
riga.add(""); // Codice descrizione 108
|
||||
riga.add(r.get("DESCR")); // Descrizione riga 109
|
||||
|
||||
if (rcontr >= 0 && rcontr < _rel->cg_items())
|
||||
{
|
||||
get_conto(_rel->cg(rcontr), conto);
|
||||
riga.add(conto.string(0x3)); // Contropartita 110-114
|
||||
}
|
||||
else riga.add(" | | | | ");
|
||||
conto.set(r.get_int("GRUPPOC"), r.get_int("CONTOC"),
|
||||
r.get_long("SOTTOCONTC"), r.get_char("TIPOCC"));
|
||||
riga.add(conto.string(0x3)); // Contropartita 110-114
|
||||
|
||||
const char tipo = r.get_char("ROWTYPE");
|
||||
riga.add(tipo); // Tipo di riga 115
|
||||
@ -585,10 +578,7 @@ int TPrimanota_application::read(TMask& m)
|
||||
riga.add(imposta.string()); // Imposta 104
|
||||
|
||||
TBill c; get_conto(r, c);
|
||||
if (c.ok())
|
||||
c.add_to(riga, 4, 0x7); // 105-110
|
||||
else
|
||||
riga.add(" | | | | | ");
|
||||
c.add_to(riga, 4, 0x7); // Conto 105-110
|
||||
|
||||
ivas().row(i) = riga;
|
||||
}
|
||||
@ -642,25 +632,13 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
row.get(); // Codice descrizione
|
||||
r.put("DESCR", row.get()); // Descrizione riga
|
||||
|
||||
int rcontr = 0; // Riga contropartita
|
||||
const TBill contro(row, -1, 0x3); // Conto contropartita
|
||||
r.put("TIPOCC", row.get()); // Contropartita
|
||||
r.put("GRUPPOC", row.get());
|
||||
r.put("CONTOC", row.get());
|
||||
r.put("SOTTOCONTC", row.get());
|
||||
row.get(); // Descrizione contropartita
|
||||
|
||||
const char tipo = row.get_char();
|
||||
r.put("ROWTYPE", tipo); // Tipo riga
|
||||
|
||||
if (contro.ok())
|
||||
{
|
||||
if (tipo == 'F' || tipo == 'S') n.swap_section();
|
||||
rcontr = bill2contr(contro, n.sezione())+1;
|
||||
if (rcontr < 1)
|
||||
{
|
||||
rcontr = i == 0 ? 2 : 1;
|
||||
if (!yesno_box("La riga contabile %d non ha una contropartita valida:\n"
|
||||
"si desidera trasformarla nel conto della riga %d", i+1, rcontr))
|
||||
rcontr = 0;
|
||||
}
|
||||
}
|
||||
r.put("RCONTR", rcontr); // Contropartita
|
||||
r.put("ROWTYPE", row.get()); // Tipo riga
|
||||
}
|
||||
}
|
||||
if (_iva == nessuna_iva) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user