Patch level : 12.0 974
Files correlati : ba0.exe f90.exe d181.des f181.dir/.trr f9ProspIntegr.rep masks f90104.sql Commento : - Modificato pescaggio file docuemnto cartaceo dalla spotlight se esiste. - Modificato ba0 per leggere f90 come eseguibile di campo altrimenti non accede con l'utente.
This commit is contained in:
parent
dcaec40dce
commit
6053f847c0
@ -131,6 +131,9 @@ int TEstrai_mask::estrai()
|
||||
const char tipodoc = get_tipodoc();
|
||||
const bool flagpro = is_provviso();
|
||||
|
||||
TFilename path;
|
||||
f9_app().get_spotlite_path(path);
|
||||
|
||||
// Vero e proprio oggetto estrazione
|
||||
_estrazione = make_unique<TEstrazione>(
|
||||
F9CONF.get_ambiente(), // Codice ambiente
|
||||
@ -139,9 +142,9 @@ int TEstrai_mask::estrai()
|
||||
get_descr(), // Descrizione estrazione
|
||||
F9CONF.get_addr_doc(), // Cartella documenti
|
||||
false, // Estrazione di un escluso
|
||||
path,
|
||||
&dataini, // Data estr. mov dal
|
||||
&dataend, // Data estr. mov al
|
||||
false, //F9CONF.get_has_checkvend(), // Flag in configurazione per aggiungere controllo f.e. in vendite
|
||||
F9CONF.get_has_cartexp() // Flag per estrarre anche i doc. cartacei
|
||||
);
|
||||
|
||||
@ -1433,8 +1436,10 @@ bool TF9_app::estrai_escl_handler(TMask_field&, KEY key)
|
||||
const TString descr = descr_msk().get(DES_TEXT);
|
||||
descr_msk().set(DES_TEXT, "");
|
||||
|
||||
TFilename path;
|
||||
f9_app().get_spotlite_path(path);
|
||||
a._estr_escluso =
|
||||
new TEstrazione(F9CONF.get_ambiente(), a._flagprov_escl, a._tipodoc_escl, descr, F9CONF.get_addr_doc(), true);
|
||||
new TEstrazione(F9CONF.get_ambiente(), a._flagprov_escl, a._tipodoc_escl, descr, F9CONF.get_addr_doc(), true, path);
|
||||
|
||||
// Prendo la riga selezionata (e controllo che sia selezionato qualcosa)
|
||||
bool flag = false;
|
||||
|
@ -49,6 +49,7 @@ class TF9_app : public TSkeleton_application
|
||||
{
|
||||
//friend class TEstrai_mask;
|
||||
friend class TMonitor_mask;
|
||||
friend class TEstrai_mask;
|
||||
friend class TControllo_mask;
|
||||
friend class TApri_estr_msk;
|
||||
friend class TEstrazione;
|
||||
|
@ -335,8 +335,8 @@ class TEstrazione : public TObject
|
||||
ofstream* _error_sql;
|
||||
bool _escluso;
|
||||
const TString _descr;
|
||||
bool _has_checkvend;
|
||||
bool _has_cartacei;
|
||||
TFilename _spotlite_path;
|
||||
|
||||
/** Aggiorna stato estrazione. Utilizzato ad esempio dopo la diagnostica per riportare
|
||||
* il nuovo stato sul db.
|
||||
@ -369,6 +369,7 @@ class TEstrazione : public TObject
|
||||
static bool load_annessi(movimento_t& movimento);
|
||||
// Se il movimento e' di vendita e ha i riferimenti al documento generatore provo a stamparlo con ve, e lo inserisco tra i cartacei F9.
|
||||
static bool stampa_documento(const movimento_t& movimento, TFilename& file);
|
||||
bool grab_pdf_from_spotlite(const movimento_t& movimento, TFilename& file) const;
|
||||
|
||||
public:
|
||||
static bool make_prosp_int_revc(int numreg, TCategorie_doc::annesso& annesso);
|
||||
@ -435,7 +436,7 @@ public:
|
||||
void set_addrcart(const TString& addrcart) { _head.addr_cart = addrcart; }
|
||||
|
||||
TEstrazione(const TString& ambiente, bool flag_prov, char tipodoc, const TString& descr, const TString& addrcart,
|
||||
bool escluso, const TDate* dal = nullptr, const TDate* al = nullptr, bool has_checkvend = false, bool has_cartacei = false);
|
||||
bool escluso, TFilename& spotlite_path, const TDate* dal = nullptr, const TDate* al = nullptr, bool has_cartacei = false);
|
||||
};
|
||||
|
||||
|
||||
|
@ -345,6 +345,37 @@ bool TEstrazione::stampa_documento(const movimento_t& movimento, TFilename& file
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TEstrazione::grab_pdf_from_spotlite(const movimento_t& movimento, TFilename& file) const
|
||||
{
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
mov.put(MOV_NUMREG, movimento.numreg);
|
||||
if (mov.read() == NOERR &&
|
||||
!mov.get(MOV_DPROVV).empty() && !mov.get(MOV_DANNO).empty() && !mov.get(MOV_DCODNUM).empty() && !mov.get(MOV_DNDOC).empty())
|
||||
{
|
||||
const TDocumento doc(mov.get(MOV_DPROVV)[0], mov.get_int(MOV_DANNO), mov.get(MOV_DCODNUM), mov.get_int(MOV_DNDOC));
|
||||
if (doc.ok())
|
||||
{
|
||||
char buffer[34];
|
||||
TString f_pdf; f_pdf << "ve1300_" << mov.get(MOV_DCODNUM) << "_";
|
||||
sprintf_s(buffer, 34, "%010d", mov.get_long(MOV_DNDOC));
|
||||
f_pdf << buffer << "_";
|
||||
sprintf_s(buffer, 34, "%07d", doc.clifor().codice());
|
||||
f_pdf << buffer << ".pdf";
|
||||
TFilename doccart(_spotlite_path);
|
||||
doccart.add(mov.get(MOV_DANNO));
|
||||
doccart.add(prefix().name());
|
||||
doccart.add(f_pdf);
|
||||
if (doccart.exist())
|
||||
{
|
||||
file.cut(0);
|
||||
file = doccart;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TEstrazione::make_prosp_int_revc(const int numreg, TCategorie_doc::annesso& annesso)
|
||||
{
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
@ -805,7 +836,7 @@ const char* TEstrazione::diagnostica_mov()
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << it->numreg;
|
||||
if (filecart.mov2doc(reg, file) && file.exist() || stampa_documento(mov_i, file) && file.exist())
|
||||
if (filecart.mov2doc(reg, file) && file.exist() || grab_pdf_from_spotlite(mov_i, file) && file.exist())
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
}
|
||||
@ -1078,8 +1109,8 @@ void TEstrazione::set_dates()
|
||||
}
|
||||
|
||||
TEstrazione::TEstrazione(const TString& ambiente, const bool flag_prov, const char tipodoc, const TString& descr,
|
||||
const TString& addrcart, const bool escluso, const TDate* const dal, const TDate* const al, const bool has_checkvend, const bool has_cartacei)
|
||||
: _descr(descr), _has_checkvend(has_checkvend), _has_cartacei(has_cartacei)
|
||||
const TString& addrcart, const bool escluso, TFilename& spotlite_path, const TDate* const dal, const TDate* const al, const bool has_cartacei)
|
||||
: _descr(descr), _has_cartacei(has_cartacei), _spotlite_path(spotlite_path)
|
||||
{
|
||||
_head.cod_soc = ambiente;
|
||||
_head.flag_prov = flag_prov;
|
||||
|
Loading…
x
Reference in New Issue
Block a user