cg0500.cpp Aggiustata indentazione

cg2100k.uml  Messo acceleratore sul tasto azzera
cg2102.cpp   Corretto handler della descrizione
cg2106.cpp   Corretto test sul prorata


git-svn-id: svn://10.65.10.50/trunk@4799 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-07-02 15:12:50 +00:00
parent 6aacb7e366
commit 0c40176cc3
4 changed files with 19 additions and 25 deletions

View File

@ -751,25 +751,22 @@ int TCaus_app::re_write(const TMask& m, bool re)
for (int i = 0; i < ss().items(); i++) for (int i = 0; i < ss().items(); i++)
{ {
TToken_string &riga = ss().row(i); TToken_string &riga = ss().row(i);
const char sezione = riga.get_char(1); const int g = riga.get_int();
const char tipo_cf = riga.get_char();
const int g = riga.get_int();
if (g > 0) if (g > 0)
{ {
const int row = i + 1 ; TRectype & r = _rcaus_rec->row(i+1, TRUE);
TRectype & r = _rcaus_rec->row(row, TRUE); const char sezione = riga.get_char(1);
const int c = riga.get_int(); const char tipo_cf = riga.get_char();
const long s = riga.get_long(); const int c = riga.get_int();
const long s = riga.get_long();
riga.get(); // Salta descrizione conto riga.get(); // Salta descrizione conto
const TString80 coddesc(riga.get()); const TString80 coddesc(riga.get());
r.put (RCA_CODDESC, coddesc);
r.put (RCA_SEZIONE, sezione); r.put (RCA_SEZIONE, sezione);
r.put (RCA_TIPOCF, tipo_cf); r.put (RCA_TIPOCF, tipo_cf);
r.put (RCA_GRUPPO , g); r.put (RCA_GRUPPO, g);
r.put (RCA_CONTO , c); r.put (RCA_CONTO, c);
r.put (RCA_SOTTOCONTO, s); r.put (RCA_SOTTOCONTO, s);
r.put (RCA_CODDESC, coddesc);
} }
} }
return _rcaus_rec->write(re); return _rcaus_rec->write(re);

View File

@ -9,7 +9,7 @@ END
BUTTON 102 10 2 BUTTON 102 10 2
BEGIN BEGIN
PROMPT -13 -1 "Azzera" PROMPT -13 -1 "~Azzera"
END END
BUTTON DLG_CANCEL 10 2 BUTTON DLG_CANCEL 10 2

View File

@ -962,7 +962,7 @@ bool TPrimanota_application::descr_handler(TMask_field& f, KEY k)
{ {
TSheet_field& cg = app().cgs(); TSheet_field& cg = app().cgs();
const TString80 old = cg.row(first).get(8); const TString80 old = cg.row(first).get(8);
if (old.blank) if (old.blank())
{ {
cg.row(first).add(f.get(), 8); cg.row(first).add(f.get(), 8);
cg.force_update(first); cg.force_update(first);

View File

@ -292,7 +292,7 @@ void TPrimanota_application::set_colors()
bool TPrimanota_application::test_prorata() bool TPrimanota_application::test_prorata()
{ {
if (iva() != iva_acquisti || !cgs().shown()) if (iva() != iva_acquisti || !cgs().shown() || _as400)
return TRUE; return TRUE;
bool esistono_righe_senza_tipo_detrazione = FALSE; bool esistono_righe_senza_tipo_detrazione = FALSE;
@ -301,7 +301,8 @@ bool TPrimanota_application::test_prorata()
for (int r = 0; r < righe_iva.items(); r++) for (int r = 0; r < righe_iva.items(); r++)
{ {
TToken_string& row = righe_iva.row(r); TToken_string& row = righe_iva.row(r);
if (!row.empty_items()) const real imposta = row.get(3);
if (!imposta.is_zero())
{ {
const int tipodet = row.get_int(2); const int tipodet = row.get_int(2);
if (tipodet == 0) if (tipodet == 0)
@ -310,20 +311,17 @@ bool TPrimanota_application::test_prorata()
break; break;
} }
} }
else
break;
} }
bool ok = TRUE; bool ok = TRUE;
if (esistono_righe_senza_tipo_detrazione) if (esistono_righe_senza_tipo_detrazione)
{ {
const bool prorata100 = causale().reg().prorata() >= 100.0; const bool prorata100 = causale().reg().prorata() >= 100.0;
const bool esistono_righe_iva_detraibile = type2pos('D') >= 0; const bool esiste_riga_iva_detraibile = type2pos('D') >= 0;
if (prorata100) if (prorata100)
ok = !esistono_righe_iva_detraibile; ok = !esiste_riga_iva_detraibile;
else else
ok = esistono_righe_iva_detraibile; ok = esiste_riga_iva_detraibile;
} }
return ok; return ok;
@ -331,11 +329,11 @@ bool TPrimanota_application::test_prorata()
bool TPrimanota_application::aggiusta_prorata() bool TPrimanota_application::aggiusta_prorata()
{ {
TWait_cursor hourglass;
if (test_prorata()) if (test_prorata())
return FALSE; return FALSE;
begin_wait();
TRegistro& reg = causale().reg(); TRegistro& reg = causale().reg();
const real prorata_attuale = reg.prorata(); const real prorata_attuale = reg.prorata();
const real vecchio_prorata = prorata_attuale < 100.0 ? 100.0 : 0.0; const real vecchio_prorata = prorata_attuale < 100.0 ? 100.0 : 0.0;
@ -364,7 +362,6 @@ bool TPrimanota_application::aggiusta_prorata()
break; break;
} }
end_wait();
return TRUE; return TRUE;
} }