Patch level : ha1076
Files correlati : ha0 ha1 Ricompilazione Demo : [ ] Commento : Modifiche richieste da Roberto per ocnto di hardy git-svn-id: svn://10.65.10.50/branches/R_10_00@22411 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8b475bee31
commit
36af44eb2d
24
ha/ha0.cpp
24
ha/ha0.cpp
@ -1,9 +1,7 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "ha0.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2|3|4}"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
|
||||
@ -13,22 +11,12 @@ int main(int argc,char** argv)
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = ha0100(argc, argv) ; break; //gestore tabelle modulo HA
|
||||
break;
|
||||
case 1:
|
||||
rt = ha0200(argc, argv) ; break; //configurazione modulo
|
||||
break;
|
||||
case 2:
|
||||
rt = ha0300(argc, argv) ; break; //gestione contratti premio
|
||||
break;
|
||||
case 3:
|
||||
rt = ha0400(argc,argv) ; break; //elaborazione contratti premio pareggiati
|
||||
break;
|
||||
case 4:
|
||||
rt = ha0500(argc,argv) ; break; //elaborazione documenti (NAC - contratti premio)
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
case 1: rt = ha0200(argc, argv); break; // configurazione modulo
|
||||
case 2: rt = ha0300(argc, argv); break; // gestione contratti premio
|
||||
case 3: rt = ha0400(argc, argv); break; // elaborazione contratti premio pareggiati
|
||||
case 4: rt = ha0500(argc, argv); break; // elaborazione documenti (NAC - contratti premio)
|
||||
case 5: rt = ha0600(argc, argv); break; // gestione codici corrispondenti
|
||||
default: rt = ha0100(argc, argv); break; // gestore tabelle modulo HA
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
1
ha/ha0.h
1
ha/ha0.h
@ -3,3 +3,4 @@ int ha0200(int argc, char* argv[]);
|
||||
int ha0300(int argc, char* argv[]);
|
||||
int ha0400(int argc, char* argv[]);
|
||||
int ha0500(int argc, char* argv[]);
|
||||
int ha0600(int argc, char* argv[]);
|
||||
|
@ -78,14 +78,14 @@ bool THA_table_app::protected_record(TRectype& record)
|
||||
//non si può eliminare una attrezzatura se la medesima ha una storia! rispettiamo gli anziani!
|
||||
if (name == "ATT")
|
||||
{
|
||||
const TString80 codattr = record.get("CODTAB");
|
||||
|
||||
//controlla che l'attrezzatura non abbia record nella tabella della storia attrezzature
|
||||
TString query;
|
||||
query << "USE &HIS";
|
||||
query << "\nFROM CODTAB=#CODATTR";
|
||||
query << "\nTO CODTAB=#CODATTR";
|
||||
|
||||
const TString codattr = record.get("CODTAB");
|
||||
|
||||
TISAM_recordset attr_recset(query);
|
||||
attr_recset.set_var("#CODATTR", codattr);
|
||||
|
||||
@ -148,6 +148,6 @@ void THA_table_app::init_query_insert_mode(TMask& m)
|
||||
int ha0100(int argc, char* argv[])
|
||||
{
|
||||
THA_table_app a;
|
||||
a.run(argc, argv, TR("Tabella Caffe' Hardy"));
|
||||
a.run(argc, argv, TR("Tabella Caffé Hardy"));
|
||||
return 0;
|
||||
}
|
||||
|
23
ha/ha1.cpp
23
ha/ha1.cpp
@ -1,28 +1,15 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "ha1.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2}"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
int rt = -1 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = ha1100(argc, argv) ; break; //generazione .txt da files .ini del postino (file tipo XXXvar.txt)
|
||||
break;
|
||||
case 1:
|
||||
rt = ha1200(argc, argv) ; break; //generazione .txt da anagrafica campo (file tipo XXX.txt)
|
||||
break;
|
||||
case 2:
|
||||
rt = ha1300(argc, argv) ; break; //importazione file da terminalini (file tipo upload.d)
|
||||
break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
case 0: ha1100(argc, argv); break; // generazione .txt da files .ini del postino (file tipo XXXvar.txt)
|
||||
case 1: ha1200(argc, argv); break; // generazione .txt da anagrafica campo (file tipo XXX.txt)
|
||||
case 2: ha1300(argc, argv); break; // importazione file da terminalini (file tipo upload.d)
|
||||
default: break;
|
||||
}
|
||||
return rt;
|
||||
return 0;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ bool TFile2Txt_mask::on_field_event(TOperable_field& o, TField_event e, long jol
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_CARICO:
|
||||
if (e == fe_modify && o.get().full())
|
||||
if ((e == fe_modify || e == fe_init) && o.get().full())
|
||||
{
|
||||
//in base alla configurazione Hardyca completa i campi chiave sulla maschera così che, in caso..
|
||||
//..l'utonto decida di fare una ricerca sui documenti, gli appaiano solo quelli buoni per il trasferimento!
|
||||
@ -67,7 +67,6 @@ TFile2Txt_mask::TFile2Txt_mask() : TAutomask ("ha1200a")
|
||||
///////////////////////////////////////
|
||||
class TFile2Txt : public THardy_transaction
|
||||
{
|
||||
|
||||
protected:
|
||||
virtual void elabora(const TMask& mask, TLog_report& log);
|
||||
virtual TMask* create_mask() const;
|
||||
@ -438,21 +437,27 @@ bool TFile2Txt::genera_righelistini_txt()
|
||||
|
||||
bool TFile2Txt::genera_contratti_txt()
|
||||
{
|
||||
const TDate oggi(TODAY);
|
||||
TEsporta_contratti_recordset righe_contratti;
|
||||
|
||||
TString query;
|
||||
query << "USE RCONDV";
|
||||
query << "\nJOIN CONDV INTO TIPO=TIPO TIPOCF=TIPOCF CODCF=CODCF COD=COD";
|
||||
query << "\nFROM TIPO=C";
|
||||
query << "\nTO TIPO=C";
|
||||
query << "\nJOIN CONDV INTO TIPO=TIPO TIPOCF=TIPOCF CODCF==CODCF COD==COD";
|
||||
query << "\nFROM TIPO=C TIPOCF=C";
|
||||
query << "\nTO TIPO=C TIPOCF=C" ;
|
||||
|
||||
TISAM_recordset archivio_rcondv(query);
|
||||
const long archivio_rcondv_items = archivio_rcondv.items();
|
||||
TProgind progind(archivio_rcondv_items, archivio_rcondv.cursor()->file().name());
|
||||
|
||||
TProgind progind(archivio_rcondv_items, "Contratti...", false, true);
|
||||
for (bool ok = archivio_rcondv.move_first(); ok; ok = archivio_rcondv.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
if (!progind.addstatus(1))
|
||||
break;
|
||||
|
||||
const TDate datafine = archivio_rcondv.get("CONDV.VALFIN").as_date();
|
||||
if (datafine.ok() && datafine < oggi) // Ignora i contratti scatuti
|
||||
continue;
|
||||
|
||||
righe_contratti.new_rec("");
|
||||
|
||||
@ -467,9 +472,8 @@ bool TFile2Txt::genera_contratti_txt()
|
||||
const TString& str_sconto = archivio_rcondv.get(RCONDV_SCONTO).as_string();
|
||||
righe_contratti.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
||||
|
||||
TDate dataini = archivio_rcondv.get("CONDV.VALIN").as_date();
|
||||
const TDate dataini = archivio_rcondv.get("CONDV.VALIN").as_date();
|
||||
righe_contratti.set(CONDV_VALIN, hd_format_date8(dataini));
|
||||
TDate datafine = archivio_rcondv.get("CONDV.VALFIN").as_date();
|
||||
righe_contratti.set(CONDV_VALFIN, hd_format_date8(datafine));
|
||||
}
|
||||
|
||||
@ -522,7 +526,7 @@ bool TFile2Txt::genera_prodotti_txt()
|
||||
TISAM_recordset archivio_anamag(query);
|
||||
const long archivio_anamag_items = archivio_anamag.items();
|
||||
|
||||
TProgind progind(archivio_anamag_items, "Prodotti...", false, true);
|
||||
TProgind progind(archivio_anamag_items, TR("Prodotti..."), false, true);
|
||||
for (bool ok = archivio_anamag.move_first(); ok; ok = archivio_anamag.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
@ -544,6 +548,9 @@ bool TFile2Txt::genera_prodotti_txt()
|
||||
prodotti.set(UMART_UM, archivio_anamag.get("UMART.UM"));
|
||||
const TString& str_sconto = archivio_anamag.get(ANAMAG_SCONTO).as_string();
|
||||
prodotti.set(ANAMAG_SCONTO, hd_find_sconto(str_sconto));
|
||||
|
||||
// Flag di prodotto in omaggio da controllare
|
||||
prodotti.set("Fascia", archivio_anamag.get(ANAMAG_USER4).as_string().left(1));
|
||||
}
|
||||
|
||||
TFilename output_path = genera_path("prodotti");
|
||||
@ -567,7 +574,7 @@ bool TFile2Txt::genera_barcode_txt()
|
||||
archivio_codcorr.set_var("#TIPO", tipo);
|
||||
const long archivio_codcorr_items = archivio_codcorr.items();
|
||||
|
||||
TProgind progind(archivio_codcorr_items, "Barcode...", false, true);
|
||||
TProgind progind(archivio_codcorr_items, TR("Barcode..."), false, true);
|
||||
for (bool ok = archivio_codcorr.move_first(); ok; ok = archivio_codcorr.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
@ -600,7 +607,7 @@ bool TFile2Txt::genera_decodart_txt()
|
||||
TISAM_recordset archivio_codcorr(query);
|
||||
const long archivio_codcorr_items = archivio_codcorr.items();
|
||||
|
||||
TProgind progind(archivio_codcorr_items, "Decodart...", false, true);
|
||||
TProgind progind(archivio_codcorr_items, TR("Decodart..."), false, true);
|
||||
for (bool ok = archivio_codcorr.move_first(); ok; ok = archivio_codcorr.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
@ -633,7 +640,7 @@ bool TFile2Txt::genera_attrezzature_txt()
|
||||
TISAM_recordset archivio_attr(query);
|
||||
const long archivio_attr_items = archivio_attr.items();
|
||||
|
||||
TProgind progind_att(archivio_attr_items, "Attrezzature...", false, true);
|
||||
TProgind progind_att(archivio_attr_items, TR("Attrezzature..."), false, true);
|
||||
for (bool ok = archivio_attr.move_first(); ok; ok = archivio_attr.move_next())
|
||||
{
|
||||
progind_att.addstatus(1);
|
||||
@ -674,7 +681,7 @@ bool TFile2Txt::genera_attrezzature_txt()
|
||||
TISAM_recordset archivio_storico(query);
|
||||
const long archivio_storico_items = archivio_storico.items();
|
||||
|
||||
TProgind progind_sto(archivio_storico_items, "Storico interventi...", false, true);
|
||||
TProgind progind_sto(archivio_storico_items, TR("Storico interventi..."), false, true);
|
||||
for (bool ok = archivio_storico.move_first(); ok; ok = archivio_storico.move_next())
|
||||
{
|
||||
progind_sto.addstatus(1);
|
||||
@ -710,7 +717,6 @@ bool TFile2Txt::genera_attrezzature_txt()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TFile2Txt::genera_tabpag_txt()
|
||||
{
|
||||
TEsporta_pagamenti_recordset tabpag;
|
||||
@ -722,7 +728,7 @@ bool TFile2Txt::genera_tabpag_txt()
|
||||
TISAM_recordset archivio_pagamenti(query);
|
||||
const long archivio_pagamenti_items = archivio_pagamenti.items();
|
||||
|
||||
TProgind progind(archivio_pagamenti_items, "Pagamenti...", false, true);
|
||||
TProgind progind(archivio_pagamenti_items, TR("Pagamenti..."), false, true);
|
||||
for (bool ok = archivio_pagamenti.move_first(); ok; ok = archivio_pagamenti.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
@ -803,7 +809,6 @@ bool TFile2Txt::genera_carico_txt(const TMask& mask)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TFile2Txt::genera_ripristino_txt(const TMask& mask)
|
||||
{
|
||||
TEsporta_carico_recordset ripristino;
|
||||
@ -830,7 +835,7 @@ bool TFile2Txt::genera_ripristino_txt(const TMask& mask)
|
||||
|
||||
const long archivio_mag_items = archivio_mag.items();
|
||||
|
||||
TProgind progind(archivio_mag_items, "Ripristino magazzino...", false, true);
|
||||
TProgind progind(archivio_mag_items, TR("Ripristino magazzino..."), false, true);
|
||||
for (bool ok = archivio_mag.move_first(); ok; ok = archivio_mag.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
@ -857,7 +862,7 @@ bool TFile2Txt::genera_ripristino_txt(const TMask& mask)
|
||||
void TFile2Txt::elabora(const TMask& mask, TLog_report& log)
|
||||
{
|
||||
// a) stoppa il concentratore
|
||||
chiudi_concentratore();
|
||||
// chiudi_concentratore();
|
||||
|
||||
//b) esegue le vere elaborazioni
|
||||
//------------------------------
|
||||
@ -908,14 +913,15 @@ void TFile2Txt::elabora(const TMask& mask, TLog_report& log)
|
||||
if (mask.get_bool(F_INIMAG) && go_on)
|
||||
go_on = genera_ripristino_txt(mask);
|
||||
|
||||
/* Per il momento preferiscono agire manualmente
|
||||
//c) lancia il concentratore in modalità di carico
|
||||
carica_concentratore();
|
||||
|
||||
//d) rilancia il concentratore in modalità di trasmissione
|
||||
trasmetti_concentratore();
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
TMask* TFile2Txt::create_mask() const
|
||||
{
|
||||
TMask* mask = new TFile2Txt_mask;
|
||||
@ -925,16 +931,12 @@ TMask* TFile2Txt::create_mask() const
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
||||
const char* TFile2Txt::fake_trans_file() const
|
||||
{
|
||||
return "157";
|
||||
}
|
||||
|
||||
{ return "157"; }
|
||||
|
||||
int ha1200(int argc, char* argv[])
|
||||
{
|
||||
TFile2Txt a;
|
||||
a.run(argc, argv, "Generazione .txt da archivi");
|
||||
a.run(argc, argv, TR("Generazione .txt da archivi"));
|
||||
return 0;
|
||||
}
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "ha1250.h"
|
||||
|
||||
|
||||
bool THardy_transaction::is_server() const
|
||||
{
|
||||
bool i_am_server = false;
|
||||
@ -16,16 +15,18 @@ bool THardy_transaction::is_server() const
|
||||
if (type == 2)
|
||||
{
|
||||
const TFilename study = config.get("Study");
|
||||
if (xvt_fsys_is_fixed_drive(study))
|
||||
i_am_server = true;
|
||||
i_am_server = xvt_fsys_is_fixed_drive(study) != 0;
|
||||
}
|
||||
return i_am_server;
|
||||
}
|
||||
|
||||
bool THardy_transaction::is_by_postino() const
|
||||
{
|
||||
TFilename trans = argv(2);
|
||||
return (trans.starts_with("/i") || trans.starts_with("-i"));
|
||||
if (argc() < 3)
|
||||
return false;
|
||||
|
||||
const TFixed_string trans(argv(2));
|
||||
return (trans.starts_with("/i", true) || trans.starts_with("-i", true));
|
||||
}
|
||||
|
||||
bool THardy_transaction::wait_for_file(const TFilename& filename) const
|
||||
@ -106,7 +107,7 @@ void THardy_transaction::main_loop()
|
||||
log.log(0, "");
|
||||
|
||||
//sono il server?
|
||||
bool i_am_server = is_server();
|
||||
const bool i_am_server = is_server();
|
||||
|
||||
//sono lanciato dal postino?
|
||||
if (is_by_postino())
|
||||
@ -207,18 +208,18 @@ bool THardy_transaction::create()
|
||||
return error_box(FR("Non esiste la cartella di upload %s!"), (const char*)_input_path);
|
||||
|
||||
if (!_archive_path.exist())
|
||||
return error_box(FR("Non esiste la cartella di archiviazione dei files processati &s!"), (const char*)_archive_path);
|
||||
return error_box(FR("Non esiste la cartella di archiviazione dei files processati %s!"), (const char*)_archive_path);
|
||||
|
||||
/* Controllo inutile
|
||||
if (!_conc_path.exist())
|
||||
return error_box(FR("Non esiste la cartella del concentratore %s!"), (const char*)_conc_path);
|
||||
|
||||
TFilename conc_prog_path = _conc_path;
|
||||
conc_prog_path.add("ProgettoConcentratore.exe");
|
||||
if (!conc_prog_path.exist())
|
||||
return error_box(FR("Il programma concentratore non si trova nella cartella %s!"), (const char*)_conc_path);
|
||||
|
||||
if (!_trans_path.exist())
|
||||
return error_box(FR("Non esiste la cartella di transazione %s!"), (const char*)_trans_path);
|
||||
*/
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
@ -1093,13 +1093,12 @@ void TUpload2Campo::elabora_TF(THardy_upload_recordset& recset, TLog_report& log
|
||||
{
|
||||
case 'V': break;
|
||||
case 'O':
|
||||
{
|
||||
rigadoc.put(RDOC_TIPORIGA, "09");
|
||||
rigadoc.put(RDOC_ADDIVA, "X");
|
||||
}
|
||||
rigadoc.put(RDOC_TIPORIGA, "09");
|
||||
rigadoc.put(RDOC_ADDIVA, "X");
|
||||
break;
|
||||
case 'R': break;
|
||||
case 'S': break;
|
||||
default : break;
|
||||
}
|
||||
|
||||
//serie delle put sulla riga documento; ricordiamo che la chiave della riga viene riempita dalla new_row
|
||||
@ -1144,7 +1143,7 @@ void TUpload2Campo::elabora_TF(THardy_upload_recordset& recset, TLog_report& log
|
||||
for (int s = 0; s < 4; s++)
|
||||
{
|
||||
if (!sconto[s].is_zero())
|
||||
str_sconto << (sconto[s] / CENTO) << '+';
|
||||
str_sconto << real(sconto[s] / CENTO) << '+';
|
||||
}
|
||||
str_sconto.rtrim(1);
|
||||
|
||||
@ -1317,6 +1316,7 @@ void TUpload2Campo::elabora_RC(THardy_upload_recordset& recset, TLog_report& log
|
||||
|
||||
void TUpload2Campo::elabora(const TMask& mask, TLog_report& log)
|
||||
{
|
||||
/* Per il momento preferiscono agire manualmente
|
||||
// a) stoppa il concentratore
|
||||
chiudi_concentratore();
|
||||
|
||||
@ -1328,6 +1328,7 @@ void TUpload2Campo::elabora(const TMask& mask, TLog_report& log)
|
||||
|
||||
// d) esegue le elaborazioni
|
||||
if (carica)
|
||||
*/
|
||||
{
|
||||
//creazione del filename dei files da importare
|
||||
TFilename src_files = _input_path;
|
||||
@ -1456,9 +1457,7 @@ TMask* TUpload2Campo::create_mask() const
|
||||
|
||||
|
||||
const char* TUpload2Campo::fake_trans_file() const
|
||||
{
|
||||
return "164";
|
||||
}
|
||||
{ return "164"; }
|
||||
|
||||
int ha1300(int argc, char* argv[])
|
||||
{
|
||||
|
265
ha/hacnv100.cpp
265
ha/hacnv100.cpp
@ -5,6 +5,7 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <defmask.h>
|
||||
|
||||
#include <progind.h>
|
||||
#include <reprint.h>
|
||||
#include <reputils.h>
|
||||
@ -94,9 +95,14 @@ public:
|
||||
|
||||
class THardy_clienti : public THardy_transfer
|
||||
{
|
||||
TAssoc_array _esselunga;
|
||||
|
||||
private:
|
||||
bool init_esselunga();
|
||||
|
||||
protected:
|
||||
bool is_piva_doppia(const long codcf);
|
||||
int get_next_key_indsped(const char tipocf, const long codcf) const;
|
||||
bool is_piva_doppia(const TString& cli) const;
|
||||
int get_next_key_indsped(const long codcf) const;
|
||||
bool trasferisci_clienti();
|
||||
bool trasferisci_destinazioni();
|
||||
|
||||
@ -133,7 +139,7 @@ public:
|
||||
class THardy_listinicli : public THardy_transfer
|
||||
{
|
||||
protected:
|
||||
int get_next_key_cli(const char tipocf, const long codcf) const;
|
||||
//int get_next_key_cli(const char tipocf, const long codcf) const;
|
||||
public:
|
||||
virtual bool trasferisci();
|
||||
};
|
||||
@ -144,9 +150,7 @@ public:
|
||||
|
||||
bool THardy_pag::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.Pagamenti ";
|
||||
const char* const query = "SELECT * FROM dbo.Pagamenti";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
@ -156,7 +160,7 @@ bool THardy_pag::trasferisci()
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
{
|
||||
rec.zero();
|
||||
table.zero();
|
||||
aggiorna_record(rec, lista_campi);
|
||||
test_write(table);
|
||||
}
|
||||
@ -169,9 +173,7 @@ bool THardy_pag::trasferisci()
|
||||
|
||||
bool THardy_iva::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.AliquoteIVA ";
|
||||
const char* const query = "SELECT * FROM dbo.AliquoteIVA";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
@ -181,7 +183,7 @@ bool THardy_iva::trasferisci()
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
{
|
||||
rec.zero();
|
||||
table.zero();
|
||||
aggiorna_record(rec, lista_campi);
|
||||
test_write(table);
|
||||
}
|
||||
@ -194,9 +196,7 @@ bool THardy_iva::trasferisci()
|
||||
|
||||
bool THardy_catmerc::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.CategorieMerc ";
|
||||
const char* const query = "SELECT * FROM dbo.CategorieMerc";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
@ -252,22 +252,20 @@ bool THardy_ban::trasferisci()
|
||||
|
||||
bool THardy_ban::trasferisci_abi()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.Banche ";
|
||||
const char* const query = "SELECT * FROM dbo.Banche";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "ABI", true);
|
||||
TSystemisamfile table(LF_TABCOM);
|
||||
table.open(_lock);
|
||||
TFast_isamfile table(LF_TABCOM);
|
||||
|
||||
TRectype& rec = table.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
{
|
||||
TString16 codtab = get_str("IdBanca");
|
||||
codtab.lpad(5,'0');
|
||||
rec.zero();
|
||||
table.zero();
|
||||
rec.put("COD", "BAN");
|
||||
rec.put("CODTAB", codtab);
|
||||
aggiorna_record(rec, lista_campi);
|
||||
@ -286,8 +284,8 @@ bool THardy_ban::trasferisci_cab()
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "CAB", true);
|
||||
TSystemisamfile table(LF_TABCOM);
|
||||
table.open(_lock);
|
||||
TFast_isamfile table(LF_TABCOM);
|
||||
|
||||
TRectype& rec = table.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -295,7 +293,7 @@ bool THardy_ban::trasferisci_cab()
|
||||
TString16 codtab = get_str("IdBanca");
|
||||
codtab.lpad(5,'0');
|
||||
codtab << get_str("Cab");
|
||||
rec.zero();
|
||||
table.zero();
|
||||
rec.put("COD", "BAN");
|
||||
rec.put("CODTAB", codtab);
|
||||
aggiorna_record(rec, lista_campi);
|
||||
@ -318,13 +316,13 @@ bool THardy_caucont::trasferisci()
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "CAUCONT", true);
|
||||
TSystemisamfile table(LF_CAUSALI);
|
||||
table.open(_lock);
|
||||
TFast_isamfile table(LF_CAUSALI);
|
||||
|
||||
TRectype& rec = table.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
{
|
||||
rec.zero();
|
||||
table.zero();
|
||||
aggiorna_record(rec, lista_campi);
|
||||
test_write(table);
|
||||
}
|
||||
@ -396,11 +394,11 @@ bool THardy_art::trasferisci()
|
||||
TString_array lista_campi_anamag, lista_campi_umart;
|
||||
ini.list_variables(lista_campi_anamag, true, "ANAMAG", true);
|
||||
ini.list_variables(lista_campi_umart, true, "UMART", true);
|
||||
TSystemisamfile anamag(LF_ANAMAG);
|
||||
anamag.open(_lock);
|
||||
TFast_isamfile anamag(LF_ANAMAG);
|
||||
|
||||
TRectype& rec_anamag = anamag.curr();
|
||||
TSystemisamfile umart(LF_UMART);
|
||||
umart.open(_lock);
|
||||
TFast_isamfile umart(LF_UMART);
|
||||
|
||||
TRectype& rec_umart = umart.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -455,8 +453,8 @@ bool THardy_pcon::trasferisci_gruppi()
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "MASTRI", true);
|
||||
|
||||
TSystemisamfile pcon(LF_PCON);
|
||||
pcon.open(_lock);
|
||||
TFast_isamfile pcon(LF_PCON);
|
||||
|
||||
TRectype& rec = pcon.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -486,8 +484,8 @@ bool THardy_pcon::trasferisci_conti()
|
||||
ini.list_variables(lista_campi_pcon, true, "MASTRI", true);
|
||||
const TString& esclusi = ini.get("PCON", "PARAMETRI");
|
||||
|
||||
TSystemisamfile pcon(LF_PCON);
|
||||
pcon.open(_lock);
|
||||
TFast_isamfile pcon(LF_PCON);
|
||||
|
||||
TRectype& rec_pcon = pcon.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -525,8 +523,8 @@ bool THardy_pcon::trasferisci_sottoconti()
|
||||
ini.list_variables(lista_campi_pcon, true, "CONTI", true);
|
||||
const TString& esclusi = ini.get("PCON", "PARAMETRI");
|
||||
|
||||
TSystemisamfile pcon(LF_PCON);
|
||||
pcon.open(_lock);
|
||||
TFast_isamfile pcon(LF_PCON);
|
||||
|
||||
TRectype& rec_pcon = pcon.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -562,8 +560,31 @@ bool THardy_pcon::trasferisci_sottoconti()
|
||||
// THardy_clienti
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
bool THardy_clienti::init_esselunga()
|
||||
{
|
||||
if (_esselunga.empty())
|
||||
{
|
||||
TISAM_recordset clifo("USE CLIFO KEY 5\n"
|
||||
"SELECT (CODCF>200000)&&(CODCF<300000)\n"
|
||||
"FROM TIPOCF=C\nTO TIPOCF=C");
|
||||
TString16 last_paiv;
|
||||
for (bool ok = clifo.move_first(); ok; ok = clifo.move_next())
|
||||
{
|
||||
const TString& paiv = clifo.get(CLI_PAIV).as_string();
|
||||
if (paiv == last_paiv && paiv.full())
|
||||
_esselunga.add(paiv, NULL);
|
||||
else
|
||||
last_paiv = paiv;
|
||||
}
|
||||
}
|
||||
return !_esselunga.empty();
|
||||
}
|
||||
|
||||
|
||||
bool THardy_clienti::trasferisci()
|
||||
{
|
||||
init_esselunga();
|
||||
|
||||
bool ok = trasferisci_clienti();
|
||||
if (ok)
|
||||
ok = trasferisci_destinazioni();
|
||||
@ -573,22 +594,16 @@ bool THardy_clienti::trasferisci()
|
||||
// trasferisce i clienti
|
||||
bool THardy_clienti::trasferisci_clienti()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.Clienti ";
|
||||
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TRecordset& recset = create_recordset("SELECT * FROM dbo.Clienti");
|
||||
TConfig& ini = config();
|
||||
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "CLIENTI", true);
|
||||
|
||||
TSystemisamfile clienti(LF_CLIFO);
|
||||
clienti.open(_lock);
|
||||
TFast_isamfile clienti(LF_CLIFO);
|
||||
TRectype& rec = clienti.curr();
|
||||
|
||||
TSystemisamfile cfven(LF_CFVEN);
|
||||
cfven.open(_lock);
|
||||
TFast_isamfile cfven(LF_CFVEN);
|
||||
TRectype& cfv_rec = cfven.curr();
|
||||
|
||||
THardy_iterator hi(this);
|
||||
@ -685,35 +700,35 @@ bool THardy_clienti::trasferisci_clienti()
|
||||
|
||||
// verifica se esiste un altro cliente con stessa partita iva (solo tra 200000 e 300000)
|
||||
// per decidere se fare scambio dati tra destinazioni e clienti oppure inserire un indirizzo di spedizione
|
||||
bool THardy_clienti::is_piva_doppia(const long codcf)
|
||||
bool THardy_clienti::is_piva_doppia(const TString& paiv) const
|
||||
{
|
||||
TToken_string tok; tok.add("C"); tok.add(codcf);
|
||||
const TRectype& cli = cache().get(LF_CLIFO, tok);
|
||||
const TString& statopaiv = cli.get(CLI_STATOPAIV);
|
||||
const TString& paiv = cli.get(CLI_PAIV);
|
||||
|
||||
TISAM_recordset clifo("USE CLIFO KEY 5\n"
|
||||
"SELECT (CODCF>200000)&&(CODCF<300000)\n"
|
||||
"FROM TIPOCF='C' STATOPAIV=#STATOPAIV PAIV=#PAIV\n"
|
||||
"TO TIPOCF='C' STATOPAIV=#STATOPAIV PAIV=#PAIV");
|
||||
clifo.set_var("#STATOPAIV", TVariant(statopaiv));
|
||||
clifo.set_var("#PAIV", TVariant(paiv));
|
||||
return (clifo.items() > 1); // Spiegare??????????
|
||||
if (_esselunga.empty())
|
||||
((THardy_clienti*)this)->init_esselunga(); // Should never happen :-)
|
||||
if (paiv.blank())
|
||||
return false;
|
||||
return _esselunga.is_key(paiv);
|
||||
}
|
||||
|
||||
// restituisce il codice indirizzo di spedizione da usare per inserimento record
|
||||
int THardy_clienti::get_next_key_indsped(const char tipocf, const long codcf) const
|
||||
int THardy_clienti::get_next_key_indsped(const long codcf) const
|
||||
{
|
||||
TISAM_recordset indsped("USE INDSPED\nFROM TIPOCF=#TIPO CODCF=#CODE\nTO TIPOCF=#TIPO CODCF=#CODE");
|
||||
TString4 str; str << tipocf;
|
||||
indsped.set_var("#TIPO", TVariant(str));
|
||||
indsped.set_var("#CODE", TVariant(codcf));
|
||||
static long last_codcf = 0;
|
||||
static int last_ind = 0;
|
||||
|
||||
int codind = 1;
|
||||
if (indsped.items() > 0) // La move_last da errore fatale su recordset vuoti!
|
||||
if (codcf != last_codcf)
|
||||
{
|
||||
indsped.move_last();
|
||||
codind += indsped.get("CODIND").as_int();
|
||||
TToken_string key; key << "C|" << codcf;
|
||||
const TRecord_array indsped(key, LF_INDSP);
|
||||
if (indsped.rows() > 0)
|
||||
codind = indsped.last_row()+1;
|
||||
|
||||
last_codcf = codcf;
|
||||
last_ind = codind;
|
||||
}
|
||||
else
|
||||
codind = ++last_ind;
|
||||
|
||||
return codind;
|
||||
}
|
||||
|
||||
@ -722,9 +737,7 @@ int THardy_clienti::get_next_key_indsped(const char tipocf, const long codcf) co
|
||||
// come dati anagrafici del clienti (esempio Esselunga)
|
||||
bool THardy_clienti::trasferisci_destinazioni()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.Destinazioni";
|
||||
const char* const query = "SELECT * FROM dbo.Destinazioni";
|
||||
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
@ -732,10 +745,9 @@ bool THardy_clienti::trasferisci_destinazioni()
|
||||
ini.list_variables(lista_campi, true, "DESTINAZIONI", true);
|
||||
ini.list_variables(lista_campi_indsped, true, "INDSPED", true);
|
||||
|
||||
TSystemisamfile clifo(LF_CLIFO);
|
||||
TSystemisamfile indsped(LF_INDSP);
|
||||
clifo.open(_lock);
|
||||
indsped.open(_lock);
|
||||
TFast_isamfile clifo(LF_CLIFO);
|
||||
TFast_isamfile indsped(LF_INDSP);
|
||||
|
||||
TRectype& rec = clifo.curr();
|
||||
TRectype& rec_indsped = indsped.curr();
|
||||
THardy_iterator hi(this);
|
||||
@ -750,7 +762,9 @@ bool THardy_clienti::trasferisci_destinazioni()
|
||||
bool good = clifo.read() == NOERR;
|
||||
if (good)
|
||||
{
|
||||
if (codcf > 200000 && codcf < 300000 && is_piva_doppia(codcf))
|
||||
const TString16 paiv = rec.get(CLI_PAIV);
|
||||
|
||||
if (codcf > 200000 && codcf < 300000 && is_piva_doppia(paiv))
|
||||
{
|
||||
// cambio dati tra clienti e destinazione
|
||||
|
||||
@ -785,7 +799,7 @@ bool THardy_clienti::trasferisci_destinazioni()
|
||||
else
|
||||
{
|
||||
// inserisco indirizzo di spedizione
|
||||
int codind = get_next_key_indsped('C', codcf);
|
||||
const int codind = get_next_key_indsped(codcf);
|
||||
rec_indsped.zero();
|
||||
rec_indsped.put(IND_TIPOCF, "C");
|
||||
rec_indsped.put(IND_CODCF, codcf);
|
||||
@ -817,24 +831,20 @@ bool THardy_clienti::trasferisci_destinazioni()
|
||||
|
||||
bool THardy_fornitori::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.Fornitori ";
|
||||
|
||||
const char* const query = "SELECT * FROM dbo.Fornitori ";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "FORNITORI", true);
|
||||
|
||||
TSystemisamfile clienti(LF_CLIFO);
|
||||
clienti.open(_lock);
|
||||
TFast_isamfile clienti(LF_CLIFO);
|
||||
TRectype& rec = clienti.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
{
|
||||
const TString& key = get_str("IdConto");
|
||||
const long codcf = hd_key2forn(key);
|
||||
const long codcf = hd_key2for(key);
|
||||
if (codcf > 0)
|
||||
{
|
||||
rec.zero();
|
||||
@ -909,18 +919,14 @@ const TString& THardy_agenti::get_codage(const TString& key) const
|
||||
|
||||
bool THardy_agenti::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.Agenti ";
|
||||
|
||||
const char* const query = "SELECT * FROM dbo.Agenti";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
TConfig& ini = config();
|
||||
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "AGENTI", true);
|
||||
|
||||
TSystemisamfile agenti(LF_AGENTI);
|
||||
agenti.open(_lock);
|
||||
TFast_isamfile agenti(LF_AGENTI);
|
||||
TRectype& rec = agenti.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -965,8 +971,8 @@ bool THardy_listini::trasferisci()
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "LISTINI", true);
|
||||
TSystemisamfile condv(LF_CONDV);
|
||||
condv.open(_lock);
|
||||
TFast_isamfile condv(LF_CONDV);
|
||||
|
||||
TRectype& rec = condv.curr();
|
||||
THardy_iterator hi(this);
|
||||
|
||||
@ -994,8 +1000,8 @@ bool THardy_listini::trasferisci()
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "LISTINID", true);
|
||||
TSystemisamfile rcondv(LF_RCONDV);
|
||||
rcondv.open(_lock);
|
||||
TFast_isamfile rcondv(LF_RCONDV);
|
||||
|
||||
TRectype& rec = rcondv.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -1029,7 +1035,7 @@ bool THardy_listini::trasferisci()
|
||||
// tralasciando le righe con DataFine < data impostata da parametri
|
||||
bool THardy_contratti::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
const char* const query =
|
||||
"SELECT * "
|
||||
"FROM dbo.ContrattiT, dbo.ContrattiR "
|
||||
"WHERE dbo.ContrattiT.KContrattoT=dbo.ContrattiR.KContrattoT "
|
||||
@ -1039,8 +1045,8 @@ bool THardy_contratti::trasferisci()
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "CONTRATTI", true);
|
||||
TSystemisamfile condv(LF_CONDV);
|
||||
condv.open(_lock);
|
||||
TFast_isamfile condv(LF_CONDV);
|
||||
|
||||
TRectype& rec = condv.curr();
|
||||
THardy_iterator hi(this);
|
||||
|
||||
@ -1078,8 +1084,8 @@ bool THardy_contratti::trasferisci()
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi;
|
||||
ini.list_variables(lista_campi, true, "CONTRATTID", true);
|
||||
TSystemisamfile rcondv(LF_RCONDV);
|
||||
rcondv.open(_lock);
|
||||
TFast_isamfile rcondv(LF_RCONDV);
|
||||
|
||||
TRectype& rec = rcondv.curr();
|
||||
THardy_iterator hi(this);
|
||||
while (++hi)
|
||||
@ -1106,6 +1112,7 @@ bool THardy_contratti::trasferisci()
|
||||
}
|
||||
|
||||
// restituisce il codice contratto da usare per l'inserimento in condv
|
||||
/*
|
||||
int THardy_listinicli::get_next_key_cli(const char tipocf, const long codcf) const
|
||||
{
|
||||
TISAM_recordset condv("USE CONDV\nFROM TIPO=#TIPO CATVEN=#CATVEN TIPOCF=#TIPOCF CODCF=#CODCF\nTO TIPO=#TIPO CATVEN=#CATVEN TIPOCF=#TIPOCF CODCF=#CODCF");
|
||||
@ -1125,55 +1132,69 @@ int THardy_listinicli::get_next_key_cli(const char tipocf, const long codcf) con
|
||||
}
|
||||
return cod;
|
||||
}
|
||||
*/
|
||||
|
||||
bool THardy_listinicli::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT * "
|
||||
"FROM dbo.ListiniCF "
|
||||
"ORDER BY dbo.ListiniCF.IdConto, dbo.ListiniCF.IdProdotto ";
|
||||
|
||||
const char* const query = "SELECT * FROM dbo.ListiniCF ORDER BY IdConto, DataFine, IdProdotto ";
|
||||
TRecordset& recset = create_recordset(query);
|
||||
|
||||
TConfig& ini = config();
|
||||
TString_array lista_campi, lista_campi_rcondv;
|
||||
ini.list_variables(lista_campi, true, "LISTINICF", true);
|
||||
ini.list_variables(lista_campi_rcondv, true, "LISTINICF_RIGHE", true);
|
||||
TSystemisamfile condv(LF_CONDV);
|
||||
condv.open(_lock);
|
||||
|
||||
TFast_isamfile condv(LF_CONDV);
|
||||
TRectype& rec = condv.curr();
|
||||
TSystemisamfile rcondv(LF_RCONDV);
|
||||
rcondv.open(_lock);
|
||||
|
||||
TFast_isamfile rcondv(LF_RCONDV);
|
||||
TRectype& rec_rcondv = rcondv.curr();
|
||||
|
||||
THardy_iterator hi(this);
|
||||
|
||||
long curr_cliente = 0;
|
||||
int curr_contratto = 0;
|
||||
TDate curr_datafine;
|
||||
TString4 curr_contratto;
|
||||
|
||||
const TDate oggi(TODAY);
|
||||
|
||||
while (++hi)
|
||||
{
|
||||
const TDate datafine = TDate(get_str("DataFine"));
|
||||
if (datafine >= oggi)
|
||||
const TDate datafine = get_date("DataFine");
|
||||
const long codcf = get_cli("IdConto");
|
||||
if (codcf != curr_cliente || datafine != curr_datafine)
|
||||
{
|
||||
const TString& key = get_str("IdConto");
|
||||
const long codcf = hd_key2cli(key);
|
||||
// scrivo la testata del listino cliente (CONDV C)
|
||||
if (curr_cliente != codcf)
|
||||
if (codcf != curr_cliente)
|
||||
{
|
||||
curr_cliente = codcf;
|
||||
const int cod = get_next_key_cli('C', codcf);
|
||||
rec.put(CONDV_CODCF, codcf);
|
||||
rec.put(CONDV_COD, cod);
|
||||
aggiorna_record(rec, lista_campi);
|
||||
test_write(condv);
|
||||
curr_contratto = "001";
|
||||
}
|
||||
rec_rcondv.put(RCONDV_COD, rec.get(CONDV_COD));
|
||||
rec_rcondv.put(RCONDV_CODCF, rec.get(CONDV_CODCF));
|
||||
aggiorna_record(rec_rcondv, lista_campi_rcondv);
|
||||
test_write(rcondv);
|
||||
else
|
||||
curr_contratto.format("%03d", atoi(curr_contratto)+1);
|
||||
curr_datafine = datafine;
|
||||
|
||||
// Compilo i campi desiderati della testata
|
||||
aggiorna_record(rec, lista_campi);
|
||||
// Mi assicuro che ci siano i campi chiave
|
||||
rec.put(CONDV_TIPO, 'C'); // 'C'ontratto
|
||||
rec.zero(CONDV_CATVEN);
|
||||
rec.put(CONDV_TIPOCF, 'C'); // 'C'liente
|
||||
rec.put(CONDV_CODCF, curr_cliente);
|
||||
rec.put(CONDV_COD, curr_contratto);
|
||||
|
||||
test_write(condv);
|
||||
}
|
||||
|
||||
// Compilo i campi desiderati della riga
|
||||
aggiorna_record(rec_rcondv, lista_campi_rcondv);
|
||||
// Mi assicuro che ci siano i campi chiave
|
||||
rec_rcondv.put(CONDV_TIPO, 'C'); // 'C'ontratto
|
||||
rec_rcondv.zero(CONDV_CATVEN);
|
||||
rec_rcondv.put(CONDV_TIPOCF, 'C'); // 'C'liente
|
||||
rec_rcondv.put(CONDV_CODCF, curr_cliente);
|
||||
rec_rcondv.put(CONDV_COD, curr_contratto);
|
||||
|
||||
test_write(rcondv);
|
||||
}
|
||||
condv.close();
|
||||
rcondv.close();
|
||||
|
@ -433,8 +433,8 @@ CODVAL = _TRADUCI,IdDivisa
|
||||
CAMBIO =
|
||||
CONTROEURO =
|
||||
DATACAM =
|
||||
VALIN =
|
||||
VALFIN =
|
||||
VALIN = DataValidita
|
||||
VALFIN = DataFine
|
||||
IMPLORDI =
|
||||
GESTUM =
|
||||
GESTSCAGL =
|
||||
|
@ -169,7 +169,7 @@ void THardy_movimenti::conto2campo(const TString& hd_tipoc, const TString& hd_ke
|
||||
case 'F':
|
||||
{
|
||||
tipoc = "F";
|
||||
so = hd_key2forn(hd_key);
|
||||
so = hd_key2for(hd_key);
|
||||
TToken_string key(tipoc);
|
||||
key.add(so);
|
||||
const TRectype rec_cf = cache().get(LF_CLIFO, key);
|
||||
|
@ -69,7 +69,7 @@ void THardy_scadenze::conto2billcampo(const TString& hd_tipoc, const TString& hd
|
||||
case 'F':
|
||||
{
|
||||
tipoc = 'F';
|
||||
so = hd_key2forn(hd_key);
|
||||
so = hd_key2for(hd_key);
|
||||
TToken_string key("F");
|
||||
key.add(so);
|
||||
const TRectype rec_cf = cache().get(LF_CLIFO, key);
|
||||
|
@ -156,7 +156,7 @@ void THardy_movmag::conto2campo(const TString& hd_tipoc, const TString& hd_key,
|
||||
case 'F':
|
||||
{
|
||||
tipoc = "F";
|
||||
so = hd_key2forn(hd_key);
|
||||
so = hd_key2for(hd_key);
|
||||
TToken_string key(tipoc);
|
||||
key.add(so);
|
||||
const TRectype rec_cf = cache().get(LF_CLIFO, key);
|
||||
@ -203,6 +203,7 @@ bool THardy_movmag::scrivi_testata(const TRecordset& recset, TMov_mag& mov)
|
||||
mov.put(MOVMAG_DESCR, descr);
|
||||
return true;
|
||||
}
|
||||
|
||||
// legge righe del movmag e le scrive nel TMov_mag
|
||||
bool THardy_movmag::scrivi_righe(TMov_mag& mov)
|
||||
{
|
||||
|
@ -281,6 +281,24 @@ long THardy_transfer::get_long(const char* field) const
|
||||
return recordset().get(field).as_int();
|
||||
}
|
||||
|
||||
TDate THardy_transfer::get_date(const char* field) const
|
||||
{
|
||||
return recordset().get(field).as_date();
|
||||
}
|
||||
|
||||
long THardy_transfer::get_cli(const char* field) const
|
||||
{
|
||||
const TString& key = get_str(field);
|
||||
return hd_key2cli(key);
|
||||
}
|
||||
|
||||
long THardy_transfer::get_for(const char* field) const
|
||||
{
|
||||
const TString& key = get_str(field);
|
||||
return hd_key2for(key);
|
||||
}
|
||||
|
||||
|
||||
const TString& THardy_transfer::decode_value(const char* tab, const TString& cod)
|
||||
{
|
||||
if (cod.full())
|
||||
|
@ -29,10 +29,6 @@ class TProgind;
|
||||
#include <reputils.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CLIFOR_H
|
||||
#include "../ve/clifor.h"
|
||||
#endif
|
||||
|
||||
#include "../ve/velib.h"
|
||||
|
||||
class TCache_th;
|
||||
@ -83,9 +79,13 @@ public:
|
||||
TRecordset& recordset();
|
||||
|
||||
const TString& get_str(const char* campo) const; // Get string from current recordset
|
||||
real get_real(const char* campo) const; // Get real from current recordset
|
||||
real get_real(const char* campo) const; // Get real from current recordset
|
||||
const TString& get_real_str(const char* campo) const; // Get eventually empty string from numeric field
|
||||
long get_long(const char* campo) const;
|
||||
TDate get_date(const char* field) const;
|
||||
|
||||
long get_cli(const char* campo) const; // Legge codice cliente e lo ricodifica per CAMPO
|
||||
long get_for(const char* campo) const; // Legge codice fornitore e lo ricodifica per CAMPO
|
||||
|
||||
bool write_enabled() const { return _write_enabled; }
|
||||
|
||||
|
@ -183,12 +183,12 @@ TEsporta_prodotti_recordset::TEsporta_prodotti_recordset(int rec_length)
|
||||
add_field(ANAMAG_CODART, T_X, 1, 5); //x
|
||||
add_field(ANAMAG_DESCR, T_X, 6, 30); //x
|
||||
add_field(UMART_PREZZO, T_Nv3N, 36, 7); //x
|
||||
add_field(ANAMAG_CODIVA, T_N, 43, 2); //x //attenzione che è una aliquota!
|
||||
add_field(ANAMAG_CODIVA, T_N, 43, 2); //x attenzione che è una aliquota!
|
||||
add_field(UMART_UM, T_X, 45, 2); //x
|
||||
add_field("NONusato", T_X, 47, 1);
|
||||
add_field(ANAMAG_SCONTO, T_2Nv2N,48, 4); //x
|
||||
add_field("ScontoArt2", T_2Nv2N,52, 4);
|
||||
add_field("Fascia", T_X, 56, 1);
|
||||
add_field("Fascia", T_X, 56, 1); //x prodotto da controllare (tazzine)
|
||||
add_field("PrezzoMinimo", T_Nv3N, 57, 7);
|
||||
add_eol_field();
|
||||
}
|
||||
@ -502,7 +502,7 @@ long hd_key2cli(const TString& key)
|
||||
|
||||
// determina codice fornitore campo a partire da codice hardy in base alle regole dettatemi da Robbi
|
||||
|
||||
long hd_key2forn(const TString& key)
|
||||
long hd_key2for(const TString& key)
|
||||
{
|
||||
const long codcf = atol(key.mid(3,6));
|
||||
return codcf;
|
||||
|
@ -242,6 +242,6 @@ const TString& hd_format_date8(const TDate& data);
|
||||
const TString& hd_format_date6(const TDate& data);
|
||||
const TDate upload_format_date6(const TString& str_data);
|
||||
long hd_key2cli(const TString& key);
|
||||
long hd_key2forn(const TString& key);
|
||||
long hd_key2for(const TString& key);
|
||||
void hd_key2conto(const TString& key, int& gr, int& co, long& so);
|
||||
const TString& hd_get_next_att_key(const TString& codart);
|
Loading…
x
Reference in New Issue
Block a user