Patch level : 10.0 834

Files correlati     : ve0.exe
Ricompilazione Demo : [ ]
Commento            :
0001720: 002899 - G84 - riporto dati dal cliente
è tornato l'errore percui cambiando stato al documento vengono riportati i dati anagrafici del cliente, esempio il codice IBAN.


git-svn-id: svn://10.65.10.50/branches/R_10_00@21099 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-11-03 11:59:17 +00:00
parent dac1a8ba94
commit adeda3ca2f
2 changed files with 51 additions and 54 deletions

View File

@ -441,27 +441,27 @@ int TElaborazione::read(const char* cod)
return err;
}
bool TElaborazione::is_document_ok(const TRectype & doc) const
{
bool ok = false;
const TString4 codnum(doc.get(DOC_CODNUM));
const TString4 tipodoc(doc.get(DOC_TIPODOC));
const char stato(doc.get_char(DOC_STATO));
const TString & codnumel = codice_numerazione_iniziale();
bool TElaborazione::is_document_ok(const TRectype & doc) const
{
bool ok = false;
const TString4 codnum(doc.get(DOC_CODNUM));
const TString4 tipodoc(doc.get(DOC_TIPODOC));
const char stato(doc.get_char(DOC_STATO));
const TString& codnumel = codice_numerazione_iniziale();
if (codnumel.blank() || codnum == codnumel)
{
for (int i = 0; !ok && i < TElaborazione::_max_tipi_doc_elab; i++)
{
const TString & tipel = tipo_iniziale(i);
if (tipel.blank())
break;
if (tipodoc == tipel && stato == stato_iniziale(i))
ok = true;
}
}
return ok;
if (codnumel.blank() || codnum == codnumel)
{
for (int i = 0; !ok && i < TElaborazione::_max_tipi_doc_elab; i++)
{
const TString & tipel = tipo_iniziale(i);
if (tipel.blank())
break;
if (tipodoc == tipel && stato == stato_iniziale(i))
ok = true;
}
}
return ok;
}
void TElaborazione::tipi_stati_iniziali(TToken_string& tipi, TToken_string& stati) const
{

View File

@ -1,4 +1,3 @@
#include <automask.h>
#include <colmask.h>
#include <dongle.h>
#include <execp.h>
@ -6,7 +5,6 @@
#include <postman.h>
#include <recset.h>
#include <smartcard.h>
#include <tree.h>
#include <treectrl.h>
#include <urldefid.h>
#include <utility.h>
@ -1108,46 +1106,49 @@ void TDocumento_mask::reset_masks(const TString& tipo_doc)
void TDocumento_mask::doc2mask(bool reload_clifo, bool force_load, bool update)
{
TSheet_field& s = sfield(F_SHEET);
for (int p = fields()-1; p >= 0; p--)
{
TMask_field& f = fld(p);
const TFieldref* fr = f.field();
if (fr)
f.set(fr->read(doc()));
else
f.reset();
{
f.set(fr->read(doc()));
if (f.ghost() && !f.active())
f.on_hit(); // Forza il MESSAGE COPY dei campi di testata come DOC_STATO
}
// else
// f.reset(); // Perché non lascio stare questi campi?
}
if (reload_clifo)
cli2mask(force_load);
else
{
if (force_load)
{
check_field( F_CODCF);
check_field( F_CODINDSP);
if (id2pos(F_IBAN_STATO) > 0)
{
const TString80 iban = doc().get(DOC_IBAN);
set(F_IBAN, iban);
efield(F_IBAN_STATO).validate(K_TAB);
if (iban.not_empty())
{
set(F_IBAN_STATO, iban.left(2));
set(F_IBAN_CHECK, iban.mid(2,2));
set(F_BBAN , iban.mid(4));
set(F_BBAN_CIN , iban.mid(4,1));
set(F_BBAN_ABI , iban.mid(5,5));
set(F_BBAN_CAB , iban.mid(10,5));
set(F_BBAN_CONTO, iban.mid(15,12));
}
}
}
{
check_field(F_CODCF);
check_field(F_CODINDSP);
}
if (id2pos(F_IBAN_STATO) > 0)
{
const TString80 iban = doc().get(DOC_IBAN);
set(F_IBAN, iban);
efield(F_IBAN_STATO).validate(K_TAB);
if (iban.not_empty())
{
set(F_IBAN_STATO, iban.left(2));
set(F_IBAN_CHECK, iban.mid(2,2));
set(F_BBAN , iban.mid(4));
set(F_BBAN_CIN , iban.mid(4,1));
set(F_BBAN_ABI , iban.mid(5,5));
set(F_BBAN_CAB , iban.mid(10,5));
set(F_BBAN_CONTO, iban.mid(15,12));
}
}
}
TSheet_field& s = sfield(F_SHEET);
s.destroy();
const int righe = doc().physical_rows();
s.destroy( );
for (int i = 0; i < righe; i++)
{
TRiga_documento & r = doc()[i + 1];
@ -2025,7 +2026,7 @@ int TLista_elaborazioni::select(TString_array & result, const char * tipo_inizia
read();
_elab->restart();
result.destroy();
for (TElaborazione * el = (TElaborazione *)_elab->get(); el ; el = (TElaborazione *) _elab->get())
for (TElaborazione* el = (TElaborazione*)_elab->get(); el != NULL; el = (TElaborazione*)_elab->get())
{
bool ok = false;
TString ti;
@ -2217,7 +2218,6 @@ bool find_doc(TTree& tree, void* jolly, word flags)
}
real TDocument_tree::select_doc(long numdoc)
{
real val;
if (goto_root())
@ -2232,7 +2232,6 @@ bool add_to_list(TTree& tree, void* jolly, word flags)
if (t.node_selected())
{
TLista_documenti & docs = *((TLista_documenti *) jolly);
docs.add(new TDocumento(t.testata()));
}
return false;
@ -2674,7 +2673,6 @@ bool TElabora_mask::on_field_event(TOperable_field& o, TField_event e, long joll
}
}
break;
case F_ROWS:
if (e == fe_modify && is_running())
{
@ -2903,7 +2901,6 @@ bool TElabora_mask::elabora()
if (ndoc > 0L && !in.find(provv, anno, codnum, ndoc))
{
TDocumento* d = new TDocumento(provv, anno, codnum, ndoc);
in.add(d);
}
if (update_header)