Patch level : 12.0 1208
Files correlati : cg2.exe ve0.exe bagn011.uml Commento: Aggiunta classe annesso ai file cartacei
This commit is contained in:
parent
8ef1caff6f
commit
47583142ea
@ -1029,6 +1029,7 @@ public:
|
||||
|
||||
void update_prices();
|
||||
void update_descriptions();
|
||||
TCausale * get_caus_cont(int year = 0) const;
|
||||
|
||||
TDocumento ();
|
||||
TDocumento (const TDocumento& d);
|
||||
@ -1273,6 +1274,8 @@ public:
|
||||
void sel_color();
|
||||
bool gestione_note_per_articolo() const;
|
||||
|
||||
void update_cartacei();
|
||||
|
||||
TDocumento_mask(const char* tipodoc);
|
||||
virtual ~TDocumento_mask();
|
||||
};
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "../db/dblib.h"
|
||||
#include "../pr/prlib.h"
|
||||
#include "../li/letint.h"
|
||||
#include "../f9/f9lib.h"
|
||||
|
||||
#ifdef LIVE_STATISTICS
|
||||
#include "../sv/svlib01.h"
|
||||
@ -3701,8 +3702,6 @@ real TDocumento::qta_bloccata_auto_evasione(const int nrow)
|
||||
const TString codnum = key.get(0);
|
||||
TDocumento d(provv, anno, codnum, num);
|
||||
|
||||
|
||||
|
||||
if (d.stato() >= stato_evaso)
|
||||
qta_bloccata += qtas.get_real(pos);
|
||||
pos++;
|
||||
@ -3929,3 +3928,66 @@ void TDocumento::update_descriptions()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TCausale * TDocumento::get_caus_cont(int year) const
|
||||
{
|
||||
TString4 codcaus = tipo().causale();
|
||||
TToken_string key;
|
||||
const TString fld_cms_cont = ini_get_string(CONFIG_DITTA, "CMSCNTFIELD", "ve");
|
||||
TCausale * causale = nullptr;
|
||||
|
||||
if (year == 0)
|
||||
year = get_date(DOC_DATADOC).year();
|
||||
if (main_app().has_module(F9AUT, CHK_DONGLE))
|
||||
{
|
||||
const TString & tipodocsdi = get(DOC_TIPODOCSDI);
|
||||
|
||||
if (tipodocsdi.full())
|
||||
{
|
||||
const TString & tipodoc_cont = cached_causale(codcaus, year).tipodoc();
|
||||
|
||||
#ifdef NEW_FP
|
||||
TClasse_doc * classe = categorie_doc().tipo2class(tipodocsdi, tipodoc_cont);
|
||||
|
||||
if (classe != nullptr)
|
||||
|
||||
codcaus = classe->caus_cont();
|
||||
#else
|
||||
codcaus = categorie_doc().tipo2caus_cont(tipodocsdi, tipodoc_cont);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (codcaus.blank() && fld_cms_cont.full())
|
||||
{
|
||||
const TString& cms = commessa_principale();
|
||||
|
||||
if (cms.full())
|
||||
{
|
||||
key.add(cms);
|
||||
|
||||
const TString16 fld_val = cache().get(LF_COMMESSE, key, fld_cms_cont);
|
||||
|
||||
if (fld_val.full())
|
||||
{
|
||||
key = "CTCMS";
|
||||
key.add(tipo().codice());
|
||||
key.add(fld_val);
|
||||
codcaus = cache().get(LF_MULTIREL, key, "DATA");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (codcaus.blank())
|
||||
{
|
||||
key = get(DOC_TIPOCF); key.add(get(DOC_CODCF));
|
||||
const TRectype& cfven = cache().get(LF_CFVEN, key);
|
||||
|
||||
codcaus = cfven.get(is_nota_credito() ? CFV_CODCAUSNC : CFV_CODCAUS);
|
||||
|
||||
if (codcaus.blank())
|
||||
codcaus = tipo().causale(); // Istanzia la causale del documento corrente...
|
||||
}
|
||||
if (codcaus.full())
|
||||
causale = (TCausale *)&cached_causale(codcaus, year);
|
||||
return causale;
|
||||
}
|
||||
|
@ -1056,6 +1056,8 @@ long TContabilizzazione::doc_contabilized(const TDocumento& doc, bool anticipo)
|
||||
|
||||
TCausale* TContabilizzazione::get_caus(const TDocumento& doc, const int year) const
|
||||
{
|
||||
return doc.get_caus_cont(year);
|
||||
/*
|
||||
TString4 codcaus;
|
||||
TToken_string key;
|
||||
static TCategorie_doc __cats;
|
||||
@ -1110,6 +1112,7 @@ TCausale* TContabilizzazione::get_caus(const TDocumento& doc, const int year) co
|
||||
_caus = (TCausale *) &cached_causale(codcaus, year);
|
||||
|
||||
return _caus;
|
||||
*/
|
||||
}
|
||||
|
||||
error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
||||
|
@ -350,7 +350,7 @@ const TString & TDocumentoEsteso::tipo_doc_sdi() const
|
||||
TString & tipo_doc_sdi = get_tmp_string(16);
|
||||
|
||||
tipo_doc_sdi = get(DOC_TIPODOCSDI);
|
||||
// Controlli da fare per clienti a cui si fotte la conversione e mi trovo dati sporchi nella colonna
|
||||
// Controlli da fare per clienti a cui si fotte la conversione e mi trovo dati sporchi nella colonna !!!! ma che cazzata !!!!
|
||||
if (tipo_doc_sdi.len() == 4 && tipo_doc_sdi.starts_with("TD"))
|
||||
return tipo_doc_sdi;
|
||||
return tipo().tipo_doc_sdi();
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <utility.h>
|
||||
|
||||
#include "../db/dblib.h"
|
||||
#include "../f9/f9lib.h"
|
||||
#include "velib04.h"
|
||||
#include "vepriv.h"
|
||||
#include "verig.h"
|
||||
@ -150,6 +151,7 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
set_field_handler( F_NUMDOCRIF, datadocrif_handler);
|
||||
set_field_handler( F_DATADOCRIF, datadocrif_handler);
|
||||
set_field_handler( F_LIQDIFF, liqdiff_handler);
|
||||
set_field_handler(F_TIPO_SDI, tipodocsdi_handler);
|
||||
set_field_handler( F_SHEET, sheet_handler);
|
||||
set_handler( DLG_ELABORA, elabora_handler );
|
||||
set_handler( DLG_PRINT, print_handler );
|
||||
@ -4605,6 +4607,33 @@ bool TDocumento_mask::gestione_note_per_articolo() const
|
||||
return id2pos(F_NAR) > 0;
|
||||
}
|
||||
|
||||
void TDocumento_mask::update_cartacei()
|
||||
{
|
||||
TGolem_field * g = (TGolem_field *)find_by_id(DLG_CARTACEI);
|
||||
TString catdoc;
|
||||
|
||||
if (g != nullptr)
|
||||
{
|
||||
TDocumento& curr_doc = doc();
|
||||
const TCausale * c = curr_doc.get_caus_cont();
|
||||
|
||||
if (c != nullptr)
|
||||
{
|
||||
if (c->iva() != nessuna_iva)
|
||||
{
|
||||
const TString& tipodoc = c->tipo_doc();
|
||||
TClasse_doc * cat = categorie_doc().find_causcont(c->codice()); // Cerco se ho un record che abbia specificata quella caus. contabile
|
||||
|
||||
if (cat == nullptr)
|
||||
cat = categorie_doc().find_tipodoc(tipodoc);
|
||||
if (cat != nullptr)
|
||||
catdoc = cat->catdoc();
|
||||
}
|
||||
}
|
||||
g->set_catdoc(catdoc);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Gestione lettore codice a barre
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -2994,6 +2994,7 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
mask.mask2doc();
|
||||
doc.zero(DOC_SPESEUPD);
|
||||
doc.update_spese_aut(spese, false, &mask.sfield(F_SHEET));
|
||||
mask.update_cartacei();
|
||||
}
|
||||
}
|
||||
if ((main_app().has_module(CTAUT, CHK_DONGLE) || main_app().has_module(PAAUT, CHK_DONGLE)) && (key == K_TAB && f.focusdirty()))
|
||||
@ -3656,6 +3657,7 @@ bool nar_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool multi_row_rif_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (f.initial_check(key) && f.get().blank())
|
||||
@ -3678,3 +3680,15 @@ bool multi_row_rif_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool tipodocsdi_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (f.list_initial_check(key) || f.list_running_check(key))
|
||||
{
|
||||
TDocumento_mask& mask = (TDocumento_mask &)f.mask();
|
||||
|
||||
mask.mask2doc();
|
||||
mask.update_cartacei();
|
||||
}
|
||||
return true;
|
||||
}
|
@ -51,6 +51,7 @@ bool nar_handler(TMask_field& f, KEY key);
|
||||
bool subappalto_hndl(TMask_field& f, KEY key);
|
||||
bool reportba8_hndl(TMask_field& f, KEY key);
|
||||
bool multi_row_rif_handler(TMask_field& f, KEY key);
|
||||
bool tipodocsdi_handler(TMask_field& f, KEY key);
|
||||
|
||||
bool is_tipodoc_ok(const TString & tipodoc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user