Patch level : ve0.exe ve6.exe
Files correlati : Ricompilazione Demo : [ ] Commento : GF20112 Quando un documento viene contabilizzato per la seconda volta SENZA aver cancellato il movimento preesistente, il programma giustamente sovrascrive il movimento di prima nota, ma non sistema correttamente i saldi. git-svn-id: svn://10.65.10.50/trunk@11664 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
86bd2efaf6
commit
08b4f24e64
@ -444,9 +444,9 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
|||||||
|
|
||||||
if (stricmp(key, RDOC_DESCR) == 0) // Trattamento speciale per la descrizione
|
if (stricmp(key, RDOC_DESCR) == 0) // Trattamento speciale per la descrizione
|
||||||
{
|
{
|
||||||
const TString s(esc(val));
|
TString s = esc(val); s.rtrim();
|
||||||
int split_pos = s.find('\n');
|
int split_pos = s.find('\n');
|
||||||
const int descr_len = rec.length("DESCR");
|
const int descr_len = rec.length(RDOC_DESCR);
|
||||||
if (split_pos < 0 && s.len() > descr_len)
|
if (split_pos < 0 && s.len() > descr_len)
|
||||||
split_pos = descr_len;
|
split_pos = descr_len;
|
||||||
if (split_pos > descr_len)
|
if (split_pos > descr_len)
|
||||||
@ -454,13 +454,13 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
|||||||
if (split_pos > 0)
|
if (split_pos > 0)
|
||||||
{
|
{
|
||||||
rec.put(RDOC_DESCR, s.left(split_pos));
|
rec.put(RDOC_DESCR, s.left(split_pos));
|
||||||
rec.put(RDOC_DESCLUNGA, "X");
|
rec.put(RDOC_DESCLUNGA, "X");
|
||||||
rec.put(RDOC_DESCEST, s.mid(split_pos));
|
rec.put(RDOC_DESCEST, s.mid(split_pos));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rec.put(RDOC_DESCR, s);
|
rec.put(RDOC_DESCR, s);
|
||||||
rec.put(RDOC_DESCLUNGA, "");
|
rec.zero(RDOC_DESCLUNGA);
|
||||||
rec.zero(RDOC_DESCEST);
|
rec.zero(RDOC_DESCEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,14 +894,14 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
if (code == "_DESCRIGA")
|
if (code == "_DESCRIGA")
|
||||||
{
|
{
|
||||||
// Messaggio per reperire la descrizione estesa sulle righe del documento
|
// Messaggio per reperire la descrizione estesa sulle righe del documento
|
||||||
TLocalisamfile &rdoc= (cursor())->file(LF_RIGHEDOC);
|
const TRectype &rdoc= cursor()->curr(LF_RIGHEDOC);
|
||||||
TString descrizione = rdoc.get("DESCR");
|
TString descrizione = rdoc.get(RDOC_DESCR);
|
||||||
const bool desclunga = rdoc.get_bool("DESCLUNGA");
|
const bool desclunga = rdoc.get_bool(RDOC_DESCLUNGA);
|
||||||
if (desclunga)
|
if (desclunga)
|
||||||
{
|
{
|
||||||
const TString & dest = rdoc.get("DESCEST");
|
const TString& dest = rdoc.get(RDOC_DESCEST);
|
||||||
|
if (!dest.blank())
|
||||||
descrizione << dest;
|
descrizione << dest;
|
||||||
}
|
}
|
||||||
int nfields = s.items();
|
int nfields = s.items();
|
||||||
for (int j = 1; j < nfields; j++)
|
for (int j = 1; j < nfields; j++)
|
||||||
@ -909,8 +909,8 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
const TString & fld = s.get(j);
|
const TString & fld = s.get(j);
|
||||||
TForm_item & f = cf.find_field(fld);
|
TForm_item & f = cf.find_field(fld);
|
||||||
const TString & val = f.get();
|
const TString & val = f.get();
|
||||||
if (val.not_empty())
|
if (!val.blank())
|
||||||
descrizione << " " << val;
|
descrizione << ' ' << val;
|
||||||
}
|
}
|
||||||
cf.set(descrizione);
|
cf.set(descrizione);
|
||||||
TParagraph_string p(descrizione, cf.width());
|
TParagraph_string p(descrizione, cf.width());
|
||||||
|
@ -795,9 +795,8 @@ void TRiga_documento::autosave(TSheet_field & f)
|
|||||||
for (int l = 0; l<4 ; l++)
|
for (int l = 0; l<4 ; l++)
|
||||||
doc().livelli().pack_grpcode(liv,row.get(f.cid2index(FR_LIV1+l)),l+1);
|
doc().livelli().pack_grpcode(liv,row.get(f.cid2index(FR_LIV1+l)),l+1);
|
||||||
put( RDOC_LIVELLO, liv); // da modificare
|
put( RDOC_LIVELLO, liv); // da modificare
|
||||||
TString s(row.get(f.cid2index(FR_DESCR)));
|
TString s = row.get(f.cid2index(FR_DESCR)); s.rtrim();
|
||||||
int split_pos = s.find('\n');
|
int split_pos = s.find('\n');
|
||||||
|
|
||||||
const int descr_len = length(RDOC_DESCR);
|
const int descr_len = length(RDOC_DESCR);
|
||||||
if (split_pos < 0 && s.len() > descr_len)
|
if (split_pos < 0 && s.len() > descr_len)
|
||||||
split_pos = descr_len;
|
split_pos = descr_len;
|
||||||
@ -806,8 +805,9 @@ void TRiga_documento::autosave(TSheet_field & f)
|
|||||||
if (split_pos > 0)
|
if (split_pos > 0)
|
||||||
{
|
{
|
||||||
put(RDOC_DESCR, s.left(split_pos));
|
put(RDOC_DESCR, s.left(split_pos));
|
||||||
|
const TString& dest = s.mid(split_pos);
|
||||||
put(RDOC_DESCLUNGA, "X");
|
put(RDOC_DESCLUNGA, "X");
|
||||||
put(RDOC_DESCEST, s.mid(split_pos));
|
put(RDOC_DESCEST, dest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -880,9 +880,9 @@ void TRiga_documento::autoload(TSheet_field & f)
|
|||||||
|
|
||||||
for (int l = 0; l<4 ; l++)
|
for (int l = 0; l<4 ; l++)
|
||||||
row.add(doc().livelli().unpack_grpcode(liv,l+1), f.cid2index(FR_LIV1+l ));
|
row.add(doc().livelli().unpack_grpcode(liv,l+1), f.cid2index(FR_LIV1+l ));
|
||||||
TString s(1024); s = get(RDOC_DESCR);
|
TString s = get(RDOC_DESCR);
|
||||||
if (get_bool(RDOC_DESCLUNGA))
|
if (get_bool(RDOC_DESCLUNGA))
|
||||||
s << get("DESCEST");
|
s << get(RDOC_DESCEST);
|
||||||
row.add(s, f.cid2index(FR_DESCR ));
|
row.add(s, f.cid2index(FR_DESCR ));
|
||||||
row.add( get( RDOC_UMQTA ), f.cid2index(FR_UMQTA ));
|
row.add( get( RDOC_UMQTA ), f.cid2index(FR_UMQTA ));
|
||||||
row.add( get( RDOC_PREZZO ), f.cid2index(FR_PREZZO ));
|
row.add( get( RDOC_PREZZO ), f.cid2index(FR_PREZZO ));
|
||||||
|
@ -774,10 +774,9 @@ void TDocumento::set_riga_esenzione()
|
|||||||
(const char *) v_esenzione, (const char *) v_data_esenzione,
|
(const char *) v_esenzione, (const char *) v_data_esenzione,
|
||||||
(const char *) n_registrazione, (const char *) n_data_registrazione);
|
(const char *) n_registrazione, (const char *) n_data_registrazione);
|
||||||
|
|
||||||
_esenzione->put( "DESCR", d.left(50));
|
_esenzione->put(RDOC_DESCR, d.left(50));
|
||||||
|
_esenzione->put(RDOC_DESCLUNGA, "X");
|
||||||
_esenzione->put("DESCLUNGA", "X");
|
_esenzione->put(RDOC_DESCEST, d.mid(50));
|
||||||
_esenzione->put("DESCEST", d.mid(50));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,25 +86,24 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setta la descrizione se vuota
|
// Setta la descrizione se vuota
|
||||||
if (rout.get("DESCR").empty())
|
if (rout.get(RDOC_DESCR).empty())
|
||||||
rout.put("DESCR", riferimento);
|
rout.put(RDOC_DESCR, riferimento);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Altrimenti aggiungi il riferimento al memo
|
// Altrimenti aggiungi il riferimento al memo
|
||||||
TString memo(1024);
|
TString memo(1024);
|
||||||
memo = rout.get("DESCEST");
|
memo = rout.get(RDOC_DESCEST);
|
||||||
if (memo.empty())
|
if (memo.empty())
|
||||||
{
|
{
|
||||||
TString80 rif(rout.get("DESCR"));
|
TString80 rif(rout.get(RDOC_DESCR));
|
||||||
|
|
||||||
rif << '\n';
|
rif << '\n';
|
||||||
rout.put("DESCR", rif);
|
rout.put(RDOC_DESCR, rif);
|
||||||
rout.put("DESCLUNGA", "X");
|
rout.put(RDOC_DESCLUNGA, "X");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
memo << '\n';
|
memo << '\n';
|
||||||
memo << riferimento;
|
memo << riferimento;
|
||||||
rout.put("DESCEST", memo);
|
rout.put(RDOC_DESCEST, memo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2740,14 +2740,15 @@ error_type TContabilizzazione::write_all(TDocumento& doc, TMovimentoPN_VE & movi
|
|||||||
// basta solo ritornare qualcosa di != da no_error, per evitare le operazioni successive
|
// basta solo ritornare qualcosa di != da no_error, per evitare le operazioni successive
|
||||||
// a write_all
|
// a write_all
|
||||||
TRectype& head = movimento.curr();
|
TRectype& head = movimento.curr();
|
||||||
long numreg = head.get_long(MOV_NUMREG);
|
const long numreg = head.get_long(MOV_NUMREG);
|
||||||
if (test_swap())
|
if (test_swap())
|
||||||
{
|
{
|
||||||
const real totdoc = -head.get_real(MOV_TOTDOC);
|
const real totdoc = -head.get_real(MOV_TOTDOC);
|
||||||
const real totdocval = -head.get_real(MOV_TOTDOCVAL);
|
|
||||||
|
|
||||||
head.put(MOV_TOTDOC, totdoc);
|
head.put(MOV_TOTDOC, totdoc);
|
||||||
// head.put(MOV_TOTDOCVAL, totdocval); // Non cambio segno! :-( LL700285
|
|
||||||
|
// Non cambio segno! :-( LL700285
|
||||||
|
// const real totdocval = -head.get_real(MOV_TOTDOCVAL);
|
||||||
|
// head.put(MOV_TOTDOCVAL, totdocval);
|
||||||
|
|
||||||
const int items = movimento.iva_items();
|
const int items = movimento.iva_items();
|
||||||
for (int i = items - 1 ; i >= 0; i--)
|
for (int i = items - 1 ; i >= 0; i--)
|
||||||
@ -3447,7 +3448,7 @@ void TContabilizzazione::aggiorna_saldi(TSaldo_agg& saldo, TMovimentoPN& mv, boo
|
|||||||
{
|
{
|
||||||
const TRectype& mov = mv.curr();
|
const TRectype& mov = mv.curr();
|
||||||
const TDate datareg = mov.get(MOV_DATAREG);
|
const TDate datareg = mov.get(MOV_DATAREG);
|
||||||
const TString8 codcaus = mov.get(MOV_CODCAUS);
|
const TString4 codcaus = mov.get(MOV_CODCAUS);
|
||||||
|
|
||||||
tiposal tsal = normale;
|
tiposal tsal = normale;
|
||||||
if (codcaus != _caus->codice()) // Should never happen, but ...
|
if (codcaus != _caus->codice()) // Should never happen, but ...
|
||||||
@ -3458,8 +3459,8 @@ void TContabilizzazione::aggiorna_saldi(TSaldo_agg& saldo, TMovimentoPN& mv, boo
|
|||||||
else
|
else
|
||||||
tsal = _caus->apertura() ? apertura : (_caus->chiusura() ? chiusura : normale);
|
tsal = _caus->apertura() ? apertura : (_caus->chiusura() ? chiusura : normale);
|
||||||
|
|
||||||
if (save)
|
// if (save) saldo.reset(); // Bella ca%%ata: distrugge i saldi del vecchio movimento!
|
||||||
saldo.reset(); // Inizializza saldi
|
|
||||||
saldo.set_movprovv(FALSE);
|
saldo.set_movprovv(FALSE);
|
||||||
saldo.set_tipo_saldo(tsal);
|
saldo.set_tipo_saldo(tsal);
|
||||||
saldo.set_anno_es(mov.get_int(MOV_ANNOES));
|
saldo.set_anno_es(mov.get_int(MOV_ANNOES));
|
||||||
@ -3472,7 +3473,7 @@ void TContabilizzazione::aggiorna_saldi(TSaldo_agg& saldo, TMovimentoPN& mv, boo
|
|||||||
{
|
{
|
||||||
const TRectype& r = mv.cg(i);
|
const TRectype& r = mv.cg(i);
|
||||||
TBill conto; conto.get(r);
|
TBill conto; conto.get(r);
|
||||||
TImporto import(r.get_char("SEZIONE"), r.get_real("IMPORTO"));
|
TImporto import(r.get_char(RMV_SEZIONE), r.get_real(RMV_IMPORTO));
|
||||||
saldo.aggiorna(conto, import, save);
|
saldo.aggiorna(conto, import, save);
|
||||||
}
|
}
|
||||||
if (save)
|
if (save)
|
||||||
|
@ -317,25 +317,25 @@ bool TConsegna_ordini::elabora(TLista_documenti& doc_in, TLista_documenti& doc_o
|
|||||||
|
|
||||||
|
|
||||||
// Setta la descrizione se vuota
|
// Setta la descrizione se vuota
|
||||||
if (rout.get("DESCR").empty())
|
if (rout.get(RDOC_DESCR).empty())
|
||||||
rout.put("DESCR", riferimento);
|
rout.put(RDOC_DESCR, riferimento);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Altrimenti aggiungi il riferimento al memo
|
// Altrimenti aggiungi il riferimento al memo
|
||||||
TString memo(1024);
|
TString memo(1024);
|
||||||
memo = rout.get("DESCEST");
|
memo = rout.get(RDOC_DESCEST);
|
||||||
if (memo.empty())
|
if (memo.empty())
|
||||||
{
|
{
|
||||||
TString80 rif(rout.get("DESCR"));
|
TString80 rif(rout.get(RDOC_DESCR));
|
||||||
|
|
||||||
rif << '\n';
|
rif << '\n';
|
||||||
rout.put("DESCR", rif);
|
rout.put(RDOC_DESCR, rif);
|
||||||
rout.put("DESCLUNGA", "X");
|
rout.put(RDOC_DESCLUNGA, "X");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
memo << '\n';
|
memo << '\n';
|
||||||
memo << riferimento;
|
memo << riferimento;
|
||||||
rout.put("DESCEST", memo);
|
rout.put(RDOC_DESCEST, memo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -676,7 +676,7 @@ bool codart_handler(TMask_field& f, KEY key )
|
|||||||
new_row.put(RDOC_CODARTMAG, r.articolo());
|
new_row.put(RDOC_CODARTMAG, r.articolo());
|
||||||
new_row.put(RDOC_LIVELLO, r.giacenza());
|
new_row.put(RDOC_LIVELLO, r.giacenza());
|
||||||
new_row.zero(RDOC_DESCR);
|
new_row.zero(RDOC_DESCR);
|
||||||
new_row.put(RDOC_DESCLUNGA, "X");
|
new_row.zero(RDOC_DESCLUNGA);
|
||||||
new_row.zero(RDOC_DESCEST);
|
new_row.zero(RDOC_DESCEST);
|
||||||
new_row.put(RDOC_CHECKED, "");
|
new_row.put(RDOC_CHECKED, "");
|
||||||
new_row.put(RDOC_UMQTA, r.um());
|
new_row.put(RDOC_UMQTA, r.um());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user