Corretta stampa dettagliata lista fatture

git-svn-id: svn://10.65.10.50/branches/R_10_00@22773 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-12-21 06:58:13 +00:00
parent 6c3e262edd
commit 7f751da39f
3 changed files with 35 additions and 27 deletions

View File

@ -475,7 +475,7 @@ VALUTA 29 18
BEGIN
KEY "Imponibile 3"
PROMPT 25 6 ""
MESSAGE _RIEPILOGOIVA,1,IMP,0
MESSAGE _RIEPILOGOIVA,31,IMP,0
DRIVENBY 11
END
@ -483,14 +483,14 @@ STRING 30 4
BEGIN
KEY "Codice iva 3"
PROMPT 44 6 ""
MESSAGE _RIEPILOGOIVA,1,COD,0
MESSAGE _RIEPILOGOIVA,31,COD,0
END
VALUTA 31 18
BEGIN
KEY "Imposta 3"
PROMPT 49 6 ""
MESSAGE _RIEPILOGOIVA,1,IVA,1
MESSAGE _RIEPILOGOIVA,31,IVA,1
DRIVENBY 11
END
@ -498,7 +498,7 @@ VALUTA 32 18
BEGIN
KEY "Imponibile 4"
PROMPT 78 6 ""
MESSAGE _RIEPILOGOIVA,1,IMP,0
MESSAGE _RIEPILOGOIVA,31,IMP,0
DRIVENBY 11
END
@ -506,14 +506,14 @@ STRING 33 4
BEGIN
KEY "Codice iva 4"
PROMPT 97 6 ""
MESSAGE _RIEPILOGOIVA,1,COD,0
MESSAGE _RIEPILOGOIVA,31,COD,0
END
VALUTA 34 18
BEGIN
KEY "Imposta 4"
PROMPT 102 6 ""
MESSAGE _RIEPILOGOIVA,1,IVA,1
MESSAGE _RIEPILOGOIVA,31,IVA,1
DRIVENBY 11
END

View File

@ -962,18 +962,26 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
if (s.items() == 4)
{
byte selector = byte(s.get_int()); // il primo parametro e' il selettore del tipo di codice
const byte selector = byte(s.get_int()); // il primo parametro e' il selettore del tipo di codice
if (selector != 0)
{
_doc->summary_filter(selector);
const TString4 what = s.get(); // cosa deve stampare ?
const TString value(_doc->summary_get(what)); // Piglia il valore dalla riga selezionata sulla tabellina
TString80 value = _doc->summary_get(what); // Piglia il valore dalla riga selezionata sulla tabellina
if ((what == "IMP" || what == "IVA") && real::is_null(value))
{
cf.hide();
cf.set("");
}
else
{
cf.show();
cf.set(value);
}
if (s.get_int() == 1) // deve cambiare elemento ?
_doc->summary_set_next();
cf.set(value);
_doc->summary_set_next();
}
}
else
@ -989,8 +997,6 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
// vedi _RIEPILOGOIVA per la spiegazione dei filtri selettivi
const byte sel = (byte)s.get_int();
const real x = sel == 0 ? _doc->imponibile(true) : _doc->tot_imponibili(sel);
cf.set(x.string());
return true;
@ -1161,7 +1167,7 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
{
if (which[0] == '#')
which.ltrim(1); // Toglie il #
const TString16 codnum(cf.section().find_field(atoi(which)).get());
const TString4 codnum(cf.section().find_field(atoi(which)).get());
const real r(cf.get());
real* v = (real*)_doc_totals.objptr(codnum);
@ -1177,15 +1183,14 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
} else
if (what == "ADDTOT")
{
const real r = cf.get();
real r = cf.get();
if (!r.is_zero())
{
TForm_item& tot = cf.find_field(which);
real v = tot.get();
if (_doc->is_nota_credito())
v -= r;
else
v += r;
r = -r;
v += r;
tot.set(v.string());
}
}
@ -1196,13 +1201,13 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
const int index = atoi(which)-1;
if (index < k.items())
{
TString16 codnum(k.row(index));
const TString& codnum = k.row(index);
if (what == "CODICE")
cf.set(codnum);
else
if (what == "TOTALE")
{
real& r = (real&) _doc_totals[codnum];
real& r = (real&)_doc_totals[codnum];
cf.set(r.string());
}
}
@ -1517,7 +1522,7 @@ void TStampaDoc_application::print_selected(KEY k)
arec = darec;
arec.put(DOC_DATADOC, _adata);
cur.setregion(darec,arec);
const bool dettaglio = _selection_mask->get_bool(F_DETTAGLIO);
mainform->find_field('B', odd_page, "H_RIGHE").enable(dettaglio); // Visualizza i dettagli righe se richiesto
mainform->find_field('B', odd_page, "RIGHE").enable(dettaglio);
@ -2080,10 +2085,12 @@ KEY TStampaDoc_application::select()
{
TMask& m = *_selection_mask;
#if 0
m.reset();
if (_is_lista)
reset_choices(m);
#endif
const KEY k = m.run();
if (k != K_QUIT)
{

View File

@ -18,7 +18,6 @@
#include "vepriv.h"
#include "veuml.h"
#include <clifo.h>
#include <cfven.h>
@ -2146,12 +2145,14 @@ void TDocumento::update_tabella_iva(bool solo_imponibili)
const bool doc_al_lordo = tipo().calcolo_lordo();
const int ndec = decimals();
const TRecord_array& righe = body(LF_RIGHEDOC);
// Test di consistenza solitamente inutile, ma fallisce in ve1 -0 L
const int r1 = body(LF_RIGHEDOC).first_row();
if (r1 > 0 && row(r1).get_int(RDOC_NRIGA) != r1)
remove_body(LF_RIGHEDOC); // Forza il caricamento ex-novo delle righe
for (int j = righe.last_row(); j > 0; j = righe.pred_row(j))
FOR_EACH_PHYSICAL_RDOC(*this, j, rowptr)
{
const TRiga_documento& r = row(j);
const TRiga_documento& r = *rowptr;
if (!r.is_sconto() && !r.is_descrizione())
{
const TCodiceIVA & iva = r.iva();