Patch level : 12.0 1016
Files correlati : ve0.exe ve1.exe ve5.exe ve6.exe Commento : Aggiunta la possibilità di caricare un campo delle righe documento con i valori di un campo delle righe di riferimento. Modificata l'autoevasione in modo che venga eseguito solo negli stati validi per la modifica. Interno: Per recuperare i valori bisogna definire nel profilo riga ducumento e profilo documento due variabili : RIF_FLD_ROW per i valori da recuperare dichiarato come TRecfield cioè campo virtuale es. RG1:RIFFLEX RIF_FLD_UPDATE_ROW per il capop da aggiornare dichiarato come campo normale es. RIFFLEX Se invece voglio caricare la maschera di inserimento invece di definire RIF_FLD_UPDATE_ROW bisogna definire un handler di riga sul capo da caricare con codice 9.
This commit is contained in:
parent
60b67a65b0
commit
50e9804de6
@ -72,6 +72,9 @@ class TSelect_color_mask;
|
||||
#define TIPO_SPESE_RIMBORSO "R"
|
||||
#define TIPO_SPESE_TRASPORTO "T"
|
||||
|
||||
#define RIF_FLD_ROW "RIF_FLD_ROW"
|
||||
#define RIF_FLD_UPDATE_ROW "RIF_FLD_UPDATE_ROW"
|
||||
|
||||
#define MAX_IVA_SLICES 5
|
||||
|
||||
class TDocumento;
|
||||
@ -737,6 +740,8 @@ public:
|
||||
const TDate get_property_date(const char * paragraph, const char * property_name, const char * defval = "", int idx = -1) const;
|
||||
const real get_property_real(const char * paragraph, const char * property_name, const char * defval = "", int idx = -1) const;
|
||||
|
||||
const TString & retrieve_original_row_field();
|
||||
|
||||
TRiga_documento(TDocumento* doc, const char* tipo = NULL);
|
||||
TRiga_documento(const TRiga_documento & row);
|
||||
virtual ~TRiga_documento() {}
|
||||
|
@ -1895,3 +1895,32 @@ const real TRiga_documento::get_property_real(const char * paragraph, const char
|
||||
r = doc().tipo().get_property_real(paragraph, property_name, defval, idx);
|
||||
return r;
|
||||
}
|
||||
|
||||
const TString & TRiga_documento::retrieve_original_row_field()
|
||||
{
|
||||
TString & val = get_tmp_string(4096);
|
||||
|
||||
TToken_string refs(get(RDOC_ORIGINAL_ROWS), ',');
|
||||
TString_array row_refs;
|
||||
|
||||
if (refs.full())
|
||||
row_refs.tok2arr(refs);
|
||||
else
|
||||
{
|
||||
val = get_original_rdoc_key();
|
||||
row_refs.add(val);
|
||||
val.cut(0);
|
||||
}
|
||||
FOR_EACH_ARRAY_ROW(row_refs, r, row_ref)
|
||||
{
|
||||
const TRectype& orig_row = cache().get(LF_RIGHEDOC, *row_ref); // ORC | 2020 | D | 3 | 8
|
||||
const TString & rif_fld = get_property_str("", RIF_FLD_ROW);
|
||||
TRecfield riffld((TRectype &)orig_row, rif_fld);
|
||||
const TString rifval = (const char *)riffld;
|
||||
|
||||
if (val.full())
|
||||
val << " - ";
|
||||
val << rifval;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
@ -1578,7 +1578,12 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
||||
myself.update_row_auto_qta(i, rdoc->quantita());
|
||||
myself.auto_evasione();
|
||||
}
|
||||
|
||||
FOR_EACH_SELF_PHYSICAL_RDOC(i, rdoc)
|
||||
{
|
||||
const TString & row_field = rdoc->get_property_str("", RIF_FLD_UPDATE_ROW);
|
||||
if (row_field.full())
|
||||
rdoc->put(row_field, rdoc->retrieve_original_row_field());
|
||||
}
|
||||
err = TMultiple_rectype::write_rewrite(f, re);
|
||||
|
||||
if (!doc_bloccato && err == NOERR)
|
||||
@ -3573,7 +3578,7 @@ void TDocumento::update_row_auto_qta(int nrow, real & qta, bool plus, bool inser
|
||||
|
||||
void TDocumento::auto_evasione(const int nrow)
|
||||
{
|
||||
if (tipo().auto_evasione())
|
||||
if (tipo().auto_evasione() && tipo().stati_iniziali_modifica().find(stato()) >= 0)
|
||||
{
|
||||
// TLista_documenti docs;
|
||||
TConsegna_ordini e(tipo().auto_evasione_elab());
|
||||
|
@ -289,7 +289,7 @@ TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec)
|
||||
_parm.qta_lit = 3; _parm.qta_val = 3;
|
||||
}
|
||||
|
||||
const TString & TDocumentoEsteso::get_dest_sdi()
|
||||
const TString & TDocumentoEsteso::get_dest_sdi() const
|
||||
{
|
||||
TString & codsdi = get_tmp_string(16);
|
||||
TString & pec = get_tmp_string(256);
|
||||
@ -299,7 +299,7 @@ const TString & TDocumentoEsteso::get_dest_sdi()
|
||||
return pec.full() ? pec : codsdi;
|
||||
}
|
||||
|
||||
bool TDocumentoEsteso::get_coddest(TString& coddest, TString& pec)
|
||||
bool TDocumentoEsteso::get_coddest(TString& coddest, TString& pec) const
|
||||
{
|
||||
const TCli_for & clifo = clifor();
|
||||
|
||||
@ -401,21 +401,23 @@ void TDocumentoEsteso::set_riga_tic()
|
||||
}
|
||||
if (get_int(DOC_ANNO) >= 2013 && is_fattura())
|
||||
{
|
||||
FOR_EACH_PHYSICAL_RDOC(*this, r, rdoc) if (!rdoc->is_descrizione())
|
||||
{
|
||||
const TString& cod = rdoc->get(RDOC_CODIVA);
|
||||
if (cod.full() && !rdoc->imponibile().is_zero())
|
||||
FOR_EACH_PHYSICAL_RDOC(*this, r, rdoc)
|
||||
if (!rdoc->is_descrizione())
|
||||
{
|
||||
const TCodiceIVA iva(cod);
|
||||
TString4 tic; tic.format("%04d", iva.get_int("I1"));
|
||||
if (tic != "0000")
|
||||
const TString& cod = rdoc->get(RDOC_CODIVA);
|
||||
|
||||
if (cod.full() && !rdoc->imponibile().is_zero())
|
||||
{
|
||||
_tic = new TRiga_documento(this, "05");
|
||||
_tic->put(RDOC_DESCR, cache().get("%TIC", tic, "S0"));
|
||||
break;
|
||||
const TCodiceIVA iva(cod);
|
||||
TString4 tic; tic.format("%04d", iva.get_int("I1"));
|
||||
if (tic != "0000")
|
||||
{
|
||||
_tic = new TRiga_documento(this, "05");
|
||||
_tic->put(RDOC_DESCR, cache().get("%TIC", tic, "S0"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,9 +81,9 @@ public:
|
||||
|
||||
// funzioni per fp
|
||||
// Ritorna cod sdi, pec o vuoto. Chiama get_coddest()
|
||||
const TString & get_dest_sdi();
|
||||
const TString & get_dest_sdi() const;
|
||||
// Valorizza codice sdi e pec in base alle configurazioni del monitor
|
||||
bool get_coddest(TString& coddest, TString& pec);
|
||||
bool get_coddest(TString& coddest, TString& pec) const;
|
||||
// Ritorna riferimento sdi
|
||||
const TString & get_rif_sdi();
|
||||
// Ritorna tipo documento sdi
|
||||
|
@ -3669,24 +3669,9 @@ bool multi_row_rif_handler(TMask_field& f, KEY key)
|
||||
TSheet_field& sh = *row_mask.get_sheet();
|
||||
TDocumento_mask& mask = (TDocumento_mask &)sh.mask();
|
||||
const int current_doc_row = sh.selected() + 1;
|
||||
TRiga_documento & row = mask.doc()[current_doc_row];
|
||||
TToken_string refs(row.get(RDOC_ORIGINAL_ROWS), ',');
|
||||
TString_array row_refs;
|
||||
TString val;
|
||||
|
||||
row_refs.tok2arr(refs);
|
||||
FOR_EACH_ARRAY_ROW(row_refs, r, row_ref)
|
||||
{
|
||||
const TRectype& orig_row = cache().get(LF_RIGHEDOC, *row_ref); // ORC | 2020 | D | 3 | 8
|
||||
const TString & rif_fld = row.get_property_str("", "RIF_FLD_ROW");
|
||||
TRecfield riffld((TRectype &)orig_row, rif_fld);
|
||||
const TString rifval = (const char *)riffld;
|
||||
|
||||
if (val.full())
|
||||
val << " - ";
|
||||
val << rifval;
|
||||
}
|
||||
f.set(val);
|
||||
TRiga_documento & row = mask.doc()[current_doc_row];
|
||||
|
||||
f.set(row.retrieve_original_row_field());
|
||||
}
|
||||
return true;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user