Patch level :2.2
Files correlati :ve7.exe Ricompilazione Demo : [ ] Commento :riporti dalla 2.1 git-svn-id: svn://10.65.10.50/trunk@12832 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
193cb84dce
commit
b52a47b78e
@ -7,6 +7,8 @@
|
||||
#include <recarray.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "velib.h"
|
||||
|
||||
#include "ve7.h"
|
||||
#include "ve7600a.h"
|
||||
|
||||
@ -95,13 +97,21 @@ void TRDoc2JBI::main_loop()
|
||||
|
||||
bool TRDoc2JBI::insert_tab(TExternisamfile& filetab, const char* tipo, const char* codice, const char* descri)
|
||||
{
|
||||
filetab.zero();
|
||||
filetab.put("TIPO", tipo);
|
||||
filetab.put("CODICE", codice);
|
||||
filetab.put("DESCRI", descri);
|
||||
int err = filetab.write();
|
||||
if (err == _isdupkey)
|
||||
err = NOERR;
|
||||
int err = NOERR;
|
||||
TString codstr(codice);
|
||||
if (codstr.not_empty())
|
||||
{
|
||||
filetab.zero();
|
||||
filetab.put("TIPO", tipo);
|
||||
filetab.put("CODICE", codice);
|
||||
|
||||
TString descstr(descri);
|
||||
if (descstr.not_empty())
|
||||
filetab.put("DESCRI", descri);
|
||||
else
|
||||
filetab.put("DESCRI", "manca descrizione");
|
||||
err = filetab.write();
|
||||
}
|
||||
return (err == NOERR);
|
||||
}
|
||||
|
||||
@ -116,7 +126,6 @@ void TRDoc2JBI::transfer()
|
||||
TString expr;
|
||||
const int anno = m.get_int(F_ANNO);
|
||||
_config->set("ANNO", anno, "PARAMETRI");
|
||||
//expr << "(" << RDOC_CODARTMAG << " != \"\")";
|
||||
expr.format("33->TIPOCF==\"C\"");
|
||||
TRectype da(LF_RIGHEDOC);
|
||||
da.zero();
|
||||
@ -157,6 +166,7 @@ void TRDoc2JBI::transfer()
|
||||
int err = NOERR;
|
||||
for (cur=0; cur.pos()<items && !p.iscancelled() && err==NOERR; ++(cur))
|
||||
{
|
||||
TDocumento* doc = new TDocumento(cur.curr(LF_DOC));
|
||||
p.addstatus(1);
|
||||
const TRectype& rec_tipodoc = cur.curr(-ALIAS_TIP);
|
||||
const int tipodoc = rec_tipodoc.get_int("I1");
|
||||
@ -228,16 +238,18 @@ void TRDoc2JBI::transfer()
|
||||
filerdoc.put("SCONTATO", importo);
|
||||
update_tab(filetab, filerdoc.curr());
|
||||
err = filerdoc.write();
|
||||
|
||||
}
|
||||
}
|
||||
if (err != NOERR)
|
||||
error_box("Errore %d in scrittura file dbf. Elaborazione non terminata.", err);
|
||||
delete doc;
|
||||
}
|
||||
}
|
||||
|
||||
void TRDoc2JBI::update_tab(TExternisamfile& filetab, const TRectype rectab)
|
||||
{
|
||||
// TIP tipo documento
|
||||
TString codice;;
|
||||
TString80 descr = cache().get("%TIP", rectab.get("TIPODOC"), "S0");
|
||||
insert_tab(filetab, "TIP", rectab.get("TIPODOC"), descr);
|
||||
// AGE agente
|
||||
@ -247,28 +259,32 @@ void TRDoc2JBI::update_tab(TExternisamfile& filetab, const TRectype rectab)
|
||||
descr = cache().get("%CVE", rectab.get("CATMERCLI"), "S0");
|
||||
insert_tab(filetab, "CVE", rectab.get("CATMERCLI"), descr);
|
||||
// CLI cliente
|
||||
descr = cache().get(LF_CLIFO, rectab.get("CODCLI"), CLI_RAGSOC);
|
||||
insert_tab(filetab, "CLI", rectab.get("CODCLI"), descr);
|
||||
codice = "C|";
|
||||
long codcli = rectab.get_long("CODCLI");
|
||||
codice.format("C|%06d", codcli);
|
||||
descr = cache().get(LF_CLIFO, codice, CLI_RAGSOC);
|
||||
codice.format("%06d", codcli);
|
||||
insert_tab(filetab, "CLI", codice, descr);
|
||||
// GRM gruppo merc.
|
||||
descr = cache().get("%GRM", rectab.get("GRUPPO"), "S0");
|
||||
descr = cache().get("GMC", rectab.get("GRUPPO"), "S0");
|
||||
insert_tab(filetab, "GRM", rectab.get("GRUPPO"), descr);
|
||||
// SGM sottogruppo merceol.
|
||||
descr = cache().get("%GRM", rectab.get("SOTTOGR"), "S0");
|
||||
descr = cache().get("GMC", rectab.get("SOTTOGR"), "S0");
|
||||
insert_tab(filetab, "SGM", rectab.get("SOTTOGR"), descr);
|
||||
// ART codart
|
||||
descr = cache().get(LF_ANAMAG, rectab.get("CODART"), ANAMAG_DESCR);
|
||||
insert_tab(filetab, "ART", rectab.get("CODART"), descr);
|
||||
// ZON zona
|
||||
descr = cache().get("%ZON", rectab.get("ZONA"), "S0");
|
||||
descr = cache().get("ZON", rectab.get("ZONA"), "S0");
|
||||
insert_tab(filetab, "ZON", rectab.get("ZONA"), descr);
|
||||
// RGI regioni
|
||||
descr = cache().get("%RGI", rectab.get("REGIONE"), "S0");
|
||||
insert_tab(filetab, "RGI", rectab.get("REGIONE"), descr);
|
||||
// MAG mag
|
||||
descr = cache().get("%MAG", rectab.get("CODMAG"), "S0");
|
||||
descr = cache().get("MAG", rectab.get("CODMAG"), "S0");
|
||||
insert_tab(filetab, "MAG", rectab.get("CODMAG"), descr);
|
||||
// DEP dep
|
||||
descr = cache().get("%MAG", rectab.get("CODDEP"), "S0");
|
||||
descr = cache().get("MAG", rectab.get("CODDEP"), "S0");
|
||||
insert_tab(filetab, "DEP", rectab.get("CODDEP"), descr);
|
||||
}
|
||||
|
||||
@ -277,4 +293,4 @@ int ve7600(int argc, char** argv)
|
||||
TRDoc2JBI app;
|
||||
app.run(argc, argv, "Trasferimento JBI");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user