Patch level : 10.0 patch 415
Files correlati : lv2 Ricompilazione Demo : [ ] Commento : Eliminati report per evitare errori durante l'esecuzione (???) git-svn-id: svn://10.65.10.50/trunk@19206 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
847fe54258
commit
55027b4d99
@ -48,8 +48,8 @@ class TGenera_documenti_app : public TSkeleton_application
|
||||
|
||||
private:
|
||||
//Metodi per la generazione dei documenti
|
||||
bool crea_documento(const TISAM_recordset& plan, TLog_report& rep);
|
||||
void crea_riga(const TString& codart, const char modpas, const int tplis, const bool tmp, const bool prinbo,TDocumento& doc, TLog_report& rep);
|
||||
bool crea_documento(const TISAM_recordset& plan);
|
||||
void crea_riga(const TString& codart, const char modpas, const int tplis, const bool tmp, const bool prinbo,TDocumento& doc);
|
||||
//Metodi per il recupero di codnum, tpdoc, stato
|
||||
bool numerazione_ddt(TString& codnum, TString& tpdoc, TString& statoi, TString& statof) const;
|
||||
bool numerazione_drit(const int cod, TString& codnum, TString& tpdoc, TString& statoi, TString& statof) const;
|
||||
@ -63,7 +63,7 @@ private:
|
||||
//Metodo per il calcolo delle quantità in bolla
|
||||
void calcolo_quantita(const TDocumento& doc, const char ritoant);
|
||||
//Metodi aggiornare il conguaglio sui contratti
|
||||
void aggiorna_conguaglio(const long codcli, const long codcont, const TString& codart, const real arr) const;
|
||||
void aggiorna_conguaglio(TRectype& rcondv, const real arr) const;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -111,7 +111,7 @@ bool TGenera_documenti_app::destroy()
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
//CREA_DOCUMENTO: metodo che crea un nuovo documento di trasporto dai dati salvati
|
||||
bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_report& rep)
|
||||
bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan)
|
||||
{
|
||||
//recupero i dati di interesse dalla maschera
|
||||
const TDate datagen(TODAY);
|
||||
@ -159,7 +159,7 @@ bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_rep
|
||||
//creo il documento corretto riempiendo i campi che già conosco
|
||||
TDocumento doc('D',anno,codnum,0);
|
||||
doc.put(DOC_TIPODOC, tpdoc);
|
||||
doc.write();
|
||||
//doc.write();
|
||||
|
||||
//calcola tutte le quantità riportate sui documenti di ritiro, sui documenti di anticipo e sulle bolle di consegna
|
||||
//...eventualmente modificate a mano
|
||||
@ -197,7 +197,7 @@ bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_rep
|
||||
|
||||
FOR_EACH_ASSOC_OBJECT(_quantita,h,codart,obj)
|
||||
{
|
||||
crea_riga(codart, modpas, tplis, false, prinbo, doc, rep);
|
||||
crea_riga(codart, modpas, tplis, false, prinbo, doc);
|
||||
|
||||
/*const TDate dadata = rcont.get(LVRCONDV_INDTTMP).as_date();
|
||||
const TDate adata = rcont.get(LVRCONDV_FIDTTMP).as_date();
|
||||
@ -206,7 +206,7 @@ bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_rep
|
||||
}
|
||||
|
||||
if (doc.rows() > 0)
|
||||
err = doc.rewrite();
|
||||
err = doc.write();
|
||||
else
|
||||
doc.remove();
|
||||
|
||||
@ -224,7 +224,7 @@ bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_rep
|
||||
}
|
||||
|
||||
//CREA_RIGA: questa funzione crea una riga merce per una bolla di consegna
|
||||
void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas, const int tplis, const bool tmp, const bool prinbo, TDocumento& doc, TLog_report& rep)
|
||||
void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas, const int tplis, const bool tmp, const bool prinbo, TDocumento& doc)
|
||||
{
|
||||
const int perarr = _configlv->get_int("Perarr");
|
||||
|
||||
@ -298,7 +298,7 @@ void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas,
|
||||
rdoc.put(RDOC_CODAGG1, causale); //causale presa dalla configurazione
|
||||
|
||||
//aggiorno il conguaglio sulla riga del contratto
|
||||
aggiorna_conguaglio(codcli, codcont, codart, quantita_arr - quantita_noarr);
|
||||
aggiorna_conguaglio((TRectype&)rcont, quantita_arr - quantita_noarr);
|
||||
|
||||
//elaborazione sul prezzo da utilizzare
|
||||
real prezzo;
|
||||
@ -388,17 +388,6 @@ void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas,
|
||||
|
||||
rdoc.put(RDOC_CODMAG, magazzino);
|
||||
rdoc.put(RDOC_CODMAGC, magazzinoc);
|
||||
|
||||
//se il record di riga contratto è vuoto aggiorno il log
|
||||
if (rcont.empty())
|
||||
{
|
||||
TString str;
|
||||
str << "L'articolo " << codart << " inserito nel documento " << doc.get(DOC_CODNUM) << "-" << doc.get(DOC_TIPODOC)
|
||||
<< " numero " << doc.get(DOC_NDOC) << " in quantità " << quantita_arr
|
||||
<< "non è prsente sul contratto del cliente " << codcli;
|
||||
rep.log(1, str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
@ -747,17 +736,11 @@ void TGenera_documenti_app::calcolo_quantita(const TDocumento& doc, const char r
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
//AGGIORNA_CONGUAGLIO: questa funzione aggiorna il parametro conguaglio sulla riga del contratto
|
||||
void TGenera_documenti_app::aggiorna_conguaglio(const long codcli, const long codcont, const TString& codart, const real arr) const
|
||||
void TGenera_documenti_app::aggiorna_conguaglio(TRectype& rcondv, const real arr) const
|
||||
{
|
||||
TLocalisamfile rcondv(LF_LVRCONDV);
|
||||
rcondv.put(LVRCONDV_CODCF,codcli);
|
||||
rcondv.put(LVRCONDV_CODCONT,codcont);
|
||||
rcondv.put(LVRCONDV_CODART,codart);
|
||||
if (rcondv.read() == NOERR)
|
||||
{
|
||||
rcondv.put(LVRCONDV_QTACONG,arr);
|
||||
rcondv.rewrite();
|
||||
}
|
||||
TLocalisamfile rcont(LF_LVRCONDV);
|
||||
rcondv.put(LVRCONDV_QTACONG,arr);
|
||||
rcondv.rewrite(rcont);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@ -783,9 +766,6 @@ bool TGenera_documenti_app::transfer()
|
||||
TString4 statof;
|
||||
// bool err;
|
||||
|
||||
TLog_report rep("Articoli non in contratto");
|
||||
rep.kill_duplicates();
|
||||
|
||||
numerazione_drit(0, codnum, tpdoc, statoi, statof);
|
||||
|
||||
//instanzio un recordset che contiene tutti i documenti di interesse
|
||||
@ -849,16 +829,11 @@ bool TGenera_documenti_app::transfer()
|
||||
{
|
||||
_quantita.destroy();
|
||||
_quantita_ritirata.destroy();
|
||||
crea_documento(plan, rep);
|
||||
crea_documento(plan);
|
||||
}
|
||||
}
|
||||
|
||||
TReport_book buc;
|
||||
buc.add(rep);
|
||||
if (buc.pages() > 0)
|
||||
buc.preview();
|
||||
else
|
||||
message_box(TR("Generazione terminata"));
|
||||
message_box(TR("Generazione terminata"));
|
||||
return true;
|
||||
}
|
||||
void TGenera_documenti_app::main_loop()
|
||||
|
@ -127,7 +127,7 @@ TObject* TAcquisizione_cache::key2obj(const char* key)
|
||||
doc->put("DATACON", datadoc); //data conteggio
|
||||
doc->put("DATAGEN", datagen); //data generazione del documento
|
||||
doc->put("DATAPRCO", dataprco); //data prevista consegna
|
||||
doc->write(); // Scrivo subito per prenotare il numero documento
|
||||
//doc->write(); // Scrivo subito per prenotare il numero documento
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
@ -164,7 +164,7 @@ protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
|
||||
void elabora_file(const TString& file, bool new_file, TLog_report &rep);
|
||||
void elabora_file(const TString& file, bool new_file);
|
||||
|
||||
|
||||
public:
|
||||
@ -192,7 +192,7 @@ bool TAcquisizione_lavanderie_app::destroy()
|
||||
}
|
||||
|
||||
//ELABORA_FILE: metodo che effettivamente fa l'elaborazione del file, creando i documenti
|
||||
void TAcquisizione_lavanderie_app::elabora_file(const TString& file, bool new_file, TLog_report &rep)
|
||||
void TAcquisizione_lavanderie_app::elabora_file(const TString& file, bool new_file)
|
||||
{
|
||||
TAcquisizione_cache ca;
|
||||
|
||||
@ -277,16 +277,6 @@ void TAcquisizione_lavanderie_app::elabora_file(const TString& file, bool new_fi
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!doc.get_date("DATAPRCO").ok())
|
||||
{
|
||||
TString msg;
|
||||
msg << TR("Il documento ") << doc.get(DOC_NDOC) << TR(" del ") << doc.get(DOC_DATADOC)
|
||||
<< TR(" del cliente ") << codcf << TR(" non ha data di prevista consegna.");
|
||||
rep.log(1,msg);
|
||||
}
|
||||
}
|
||||
|
||||
//se voglio sovrascrivere i file, e non l'ho mai cancellato, allora svuotalo effettivamente
|
||||
const TString8 numdoc = doc.get(DOC_NDOC);
|
||||
@ -364,9 +354,6 @@ bool TAcquisizione_lavanderie_app::transfer()
|
||||
const TString& path = _msk->get(F_PATH);
|
||||
TSheet_field& sheet = _msk->sfield(F_SHEET_NAME);
|
||||
TFilename file;
|
||||
|
||||
TLog_report logrep("Aquisizione da contapezzi");
|
||||
logrep.kill_duplicates(true);
|
||||
|
||||
//per ogni riga dello sheet, leggo il suo contenuto, se contiene dei caratteri jolly
|
||||
//preparo la lista dei file che soddisfano la maschera in quella directory e li elaboro
|
||||
@ -389,19 +376,14 @@ bool TAcquisizione_lavanderie_app::transfer()
|
||||
list_files(file, lista_file);
|
||||
|
||||
FOR_EACH_ARRAY_ROW(lista_file, r2, row2)
|
||||
elabora_file(*row2, true, logrep);
|
||||
elabora_file(*row2, true);
|
||||
}
|
||||
else
|
||||
elabora_file(file, true, logrep);
|
||||
elabora_file(file, true);
|
||||
}
|
||||
}
|
||||
|
||||
TReport_book buc;
|
||||
buc.add(logrep);
|
||||
if (buc.pages() > 0)
|
||||
buc.preview();
|
||||
else
|
||||
message_box(TR("Generazione terminata"));
|
||||
message_box(TR("Generazione terminata"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user