Patch level : 10.0 patch 394
Files correlati : lv2 Ricompilazione Demo : [ ] Commento : Corretto salvataggio del riferimento al contratto. alla data di prevista consegna e alla causale sulle righe documento git-svn-id: svn://10.65.10.50/trunk@19151 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
278f903132
commit
6246c412bb
@ -2,8 +2,13 @@
|
|||||||
#include <textset.h>
|
#include <textset.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
|
#include "lvlib.h"
|
||||||
#include "../ve/velib.h"
|
#include "../ve/velib.h"
|
||||||
|
|
||||||
|
#include "lvcondv.h"
|
||||||
|
#include "lvrcondv.h"
|
||||||
|
#include "lvrconsplan.h"
|
||||||
|
|
||||||
#include "lv2600a.h"
|
#include "lv2600a.h"
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@ -84,6 +89,8 @@ TObject* TAcquisizione_cache::key2obj(const char* key)
|
|||||||
TToken_string chiave(key);
|
TToken_string chiave(key);
|
||||||
const TDate datadoc = chiave.get();
|
const TDate datadoc = chiave.get();
|
||||||
const TDate datagen(TODAY);
|
const TDate datagen(TODAY);
|
||||||
|
TDate adata = datagen;
|
||||||
|
adata.set_month(datagen.month() + 1);
|
||||||
const long codcf = chiave.get_long();
|
const long codcf = chiave.get_long();
|
||||||
|
|
||||||
TString query = "USE DOC KEY 2\n";
|
TString query = "USE DOC KEY 2\n";
|
||||||
@ -92,19 +99,32 @@ TObject* TAcquisizione_cache::key2obj(const char* key)
|
|||||||
query << "TO TIPOCF=C CODCF=" << codcf << " PROVV=D ANNO=" << datadoc.year() << " DATADOC=" << datadoc << " CODNUM=" << _codnum << "\n";
|
query << "TO TIPOCF=C CODCF=" << codcf << " PROVV=D ANNO=" << datadoc.year() << " DATADOC=" << datadoc << " CODNUM=" << _codnum << "\n";
|
||||||
TISAM_recordset rset(query);
|
TISAM_recordset rset(query);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TDocumento* doc = NULL;
|
TDocumento* doc = NULL;
|
||||||
|
|
||||||
if (rset.move_first())
|
if (rset.move_first())
|
||||||
doc = new TDocumento(rset.cursor()->curr());
|
doc = new TDocumento(rset.cursor()->curr());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
TLaundry_contract cont(codcf, 0, datadoc);
|
||||||
|
const TString8 codcont = cont.get(LVCONDV_CODCONT);
|
||||||
|
|
||||||
|
TString query1 = "USE LVRCONSPLAN KEY 3\n";
|
||||||
|
query1 << "FROM CODCF=" << codcf << " CODCONT=" << codcont << " DTCONS=" << datagen << "\n";
|
||||||
|
query1 << "TO CODCF=" << codcf << " CODCONT=" << codcont << " DTCONS=" << adata << "\n";
|
||||||
|
TISAM_recordset consegne(query1);
|
||||||
|
consegne.move_first();
|
||||||
|
|
||||||
doc = new TDocumento('D',datadoc.year(),_codnum,0);
|
doc = new TDocumento('D',datadoc.year(),_codnum,0);
|
||||||
doc->put(DOC_TIPODOC, _tipodoc);
|
doc->put(DOC_TIPODOC, _tipodoc);
|
||||||
doc->put(DOC_STATO, _stato);
|
doc->put(DOC_STATO, _stato);
|
||||||
doc->put(DOC_DATADOC, datadoc);
|
doc->put(DOC_DATADOC, datadoc);
|
||||||
doc->put(DOC_TIPOCF, 'C');
|
doc->put(DOC_TIPOCF, 'C');
|
||||||
doc->put(DOC_CODCF, codcf);
|
doc->put(DOC_CODCF, codcf);
|
||||||
|
doc->put(DOC_CODCONT, codcont);
|
||||||
doc->put("DATAGEN", datagen);
|
doc->put("DATAGEN", datagen);
|
||||||
|
doc->put("DATAPRCO", consegne.get(LVRCONSPLAN_DTCONS).as_date());
|
||||||
}
|
}
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
@ -293,11 +313,13 @@ void TAcquisizione_lavanderie_app::elabora_file(const TString& file, bool new_fi
|
|||||||
rdoc.put(RDOC_DESCR, anamag.get(ANAMAG_DESCR));
|
rdoc.put(RDOC_DESCR, anamag.get(ANAMAG_DESCR));
|
||||||
rdoc.put(RDOC_CODARTMAG, codart);
|
rdoc.put(RDOC_CODARTMAG, codart);
|
||||||
rdoc.put(RDOC_CHECKED, 'X');
|
rdoc.put(RDOC_CHECKED, 'X');
|
||||||
|
rdoc.put(RDOC_CODAGG1, ini_get_string(CONFIG_DITTA, "lv", "CAUSLAV"));
|
||||||
rdoc.put(RDOC_QTAGG1, qta);
|
rdoc.put(RDOC_QTAGG1, qta);
|
||||||
rdoc.put(RDOC_QTA, rotti);
|
rdoc.put(RDOC_QTA, rotti);
|
||||||
}
|
}
|
||||||
new_file = false;
|
new_file = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ca.empty())
|
if (ca.empty())
|
||||||
{
|
{
|
||||||
warning_box(TR("ATTENZIONE: il file importato non ha generato nessun documento; controllare che il tracciato record sia coerente"));
|
warning_box(TR("ATTENZIONE: il file importato non ha generato nessun documento; controllare che il tracciato record sia coerente"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user