9e26e4d527
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 1010 git-svn-id: svn://10.65.10.50/trunk@16373 c028cbd2-c16b-5b4b-a496-9718f37d4682
89 lines
2.1 KiB
C++
Executable File
89 lines
2.1 KiB
C++
Executable File
#include <applicat.h>
|
|
#include <reputils.h>
|
|
#include <recset.h>
|
|
#include <reprint.h>
|
|
#include <progind.h>
|
|
#include <defmask.h>
|
|
|
|
#include "velib.h"
|
|
|
|
#include <doc.h>
|
|
#include <rdoc.h>
|
|
|
|
class TRecupera_doc : public TSkeleton_application
|
|
{
|
|
protected:
|
|
virtual void main_loop();
|
|
void recupera(bool create);
|
|
};
|
|
|
|
void TRecupera_doc::recupera(bool create)
|
|
{
|
|
TLog_report log(TR("Recupero testate documento"));
|
|
|
|
TISAM_recordset rdoc("USE RDOC SELECT NRIGA=1");
|
|
TLocalisamfile doc(LF_DOC);
|
|
|
|
TString msg;
|
|
|
|
long tot = 0;
|
|
TProgind pi(rdoc.items(), TR("Scansione righe documento..."), true, true);
|
|
for (bool ok = rdoc.move_first(); ok; ok = rdoc.move_next())
|
|
{
|
|
if (!pi.addstatus(1))
|
|
break;
|
|
|
|
const TString4 codnum = rdoc.get(RDOC_CODNUM).as_string();
|
|
|
|
doc.put(DOC_PROVV, rdoc.get(RDOC_PROVV).as_string());
|
|
doc.put(DOC_ANNO, rdoc.get(RDOC_ANNO).as_string());
|
|
doc.put(DOC_CODNUM, codnum);
|
|
doc.put(DOC_NDOC, rdoc.get(RDOC_NDOC).as_string());
|
|
if (doc.read() != NOERR)
|
|
{
|
|
if (create)
|
|
{
|
|
const TCodice_numerazione numerazione(codnum);
|
|
const TString& codtipo = numerazione.tipo_doc(0);
|
|
const TTipo_documento tipodoc(codtipo);
|
|
|
|
doc.put(DOC_PROVV, rdoc.get(RDOC_PROVV).as_string());
|
|
doc.put(DOC_ANNO, rdoc.get(RDOC_ANNO).as_string());
|
|
doc.put(DOC_CODNUM, codnum);
|
|
doc.put(DOC_NDOC, rdoc.get(RDOC_NDOC).as_string());
|
|
doc.put(DOC_STATO, 1);
|
|
doc.put(DOC_TIPOCF, tipodoc.tipocf());
|
|
doc.put(DOC_CODCF, 999999);
|
|
doc.put(DOC_TIPODOC, codtipo);
|
|
doc.put(DOC_DATADOC, "31-12-2006");
|
|
doc.write();
|
|
}
|
|
log.log(0, doc.curr().build_key());
|
|
tot++;
|
|
}
|
|
}
|
|
|
|
if (create)
|
|
message_box("%ld testate create", tot);
|
|
else
|
|
warning_box("%ld documenti senza testata", tot);
|
|
|
|
TReport_book book;
|
|
book.add(log);
|
|
book.preview();
|
|
}
|
|
|
|
void TRecupera_doc::main_loop()
|
|
{
|
|
TMask m("ve5600a");
|
|
while (m.run() != K_QUIT)
|
|
recupera(m.get_bool(101));
|
|
}
|
|
|
|
int ve5600(int argc, char* argv[])
|
|
{
|
|
TRecupera_doc a;
|
|
a.run(argc, argv, "Recupero testate documenti");
|
|
return 0;
|
|
}
|