Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Generazione record per tutta la gerarchia di subagenti, agenti e capozona git-svn-id: svn://10.65.10.50/branches/R_10_00@22471 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5f6c357ce3
commit
86f42becf9
@ -8,9 +8,12 @@
|
||||
#include <pagsca.h>
|
||||
#include <partite.h>
|
||||
#include <scadenze.h>
|
||||
#include "../mg/umart.h"
|
||||
|
||||
|
||||
#include "halib.h"
|
||||
#include "ha1250.h"
|
||||
|
||||
#include <mov.h>
|
||||
|
||||
|
||||
class THardy_config : public TConfig
|
||||
@ -519,7 +522,6 @@ void TIni2Txt::main_loop()
|
||||
//prodotti
|
||||
if (ini_paragraphs.find("47") >= 0)
|
||||
genera_prodotto_var_txt(input_ini_file);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,6 @@ bool TFile2Txt::genera_nomi_output(const char* nome, TFilename& txt, TFilename&
|
||||
return txt.exist();
|
||||
}
|
||||
|
||||
|
||||
bool TFile2Txt::salva_recordset(TRecordset& recset, const char* nome) const
|
||||
{
|
||||
TFilename txt_path, tmp_path;
|
||||
@ -185,6 +184,8 @@ bool TFile2Txt::genera_agenti_txt()
|
||||
agenti.set("CodiceTerminale", codage);
|
||||
agenti.set(AGE_CODAGE, codage);
|
||||
agenti.set(AGE_RAGSOC, archivio_agenti.get(AGE_RAGSOC));
|
||||
|
||||
agenti.duplica_capi_zona();
|
||||
}
|
||||
|
||||
return salva_recordset(agenti, "agenti");
|
||||
@ -255,8 +256,7 @@ bool TFile2Txt::genera_clienti_txt(const long da_codcli)
|
||||
|
||||
//il codice terminale è il codagente legato al cliente (codice agente lungo 5, codice terminale lungo 3)
|
||||
const TString8 codage = archivio_clienti.get("CFVEN.CODAG").as_string();
|
||||
const TString4 codterm = codage.right(3);
|
||||
clienti.set("CodiceTerminale", codterm);
|
||||
clienti.set("CodiceTerminale", codage.right(3));
|
||||
|
||||
const long codcf = archivio_clienti.get(CLI_CODCF).as_int();
|
||||
clienti.set("CodiceCliente", codcf);
|
||||
@ -355,6 +355,7 @@ bool TFile2Txt::genera_clienti_txt(const long da_codcli)
|
||||
s='S';
|
||||
clienti.set("NoConsegna", TVariant(s));*/
|
||||
|
||||
clienti.duplica_capi_zona();
|
||||
} //for (bool ok = archivio_clienti.move_first()...
|
||||
|
||||
return salva_recordset(clienti, "clienti");
|
||||
@ -420,6 +421,8 @@ bool TFile2Txt::genera_sospesi_txt(const long da_codcli)
|
||||
cod_partita << anno << "-" << numpart;
|
||||
sospesi.set("Partita", cod_partita);
|
||||
sospesi.set("TipoDocumento", "F");
|
||||
|
||||
sospesi.duplica_capi_zona();
|
||||
}
|
||||
}
|
||||
|
||||
@ -435,8 +438,7 @@ bool TFile2Txt::genera_righelistini_txt()
|
||||
const long agenti_items = agenti.items();
|
||||
for (bool ok = agenti.move_first(); ok; ok = agenti.move_next())
|
||||
{
|
||||
TString8 codage = agenti.get(AGE_CODAGE).as_string();
|
||||
codage = codage.right(3);
|
||||
const TString4 codage = agenti.get(AGE_CODAGE).as_string().right(3);
|
||||
|
||||
TString query;
|
||||
query << "USE RCONDV";
|
||||
@ -473,6 +475,8 @@ bool TFile2Txt::genera_righelistini_txt()
|
||||
|
||||
const TString& str_sconto = archivio_rcondv.get(RCONDV_SCONTO).as_string();
|
||||
righe_listini.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
||||
|
||||
righe_listini.duplica_capi_zona();
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,6 +524,8 @@ bool TFile2Txt::genera_contratti_txt()
|
||||
const TDate dataini = archivio_rcondv.get("CONDV.VALIN").as_date();
|
||||
righe_contratti.set(CONDV_VALIN, hd_format_date8(dataini));
|
||||
righe_contratti.set(CONDV_VALFIN, hd_format_date8(datafine));
|
||||
|
||||
righe_contratti.duplica_capi_zona();
|
||||
}
|
||||
|
||||
return salva_recordset(righe_contratti, "particolari");
|
||||
@ -596,14 +602,9 @@ bool TFile2Txt::genera_prodotti_txt()
|
||||
bool TFile2Txt::genera_barcode_txt()
|
||||
{
|
||||
TEsporta_barcode_recordset barcode;
|
||||
|
||||
TString query;
|
||||
query << "USE CODCORR";
|
||||
query << "\nSELECT (TIPO=#TIPO)";
|
||||
|
||||
TISAM_recordset archivio_codcorr(query);
|
||||
TConfig config(CONFIG_DITTA, "ha");
|
||||
const TString& tipo = config.get("TipoBarcode");
|
||||
|
||||
TISAM_recordset archivio_codcorr("USE CODCORR SELECT (TIPO=#TIPO)");
|
||||
const TString& tipo = ini_get_string(CONFIG_DITTA, "ha", "TipoBarcode");
|
||||
archivio_codcorr.set_var("#TIPO", tipo);
|
||||
const long archivio_codcorr_items = archivio_codcorr.items();
|
||||
|
||||
@ -613,11 +614,8 @@ bool TFile2Txt::genera_barcode_txt()
|
||||
progind.addstatus(1);
|
||||
|
||||
barcode.new_rec("");
|
||||
|
||||
const TString& codice_a_barre = archivio_codcorr.get(CODCORR_CODARTALT).as_string();
|
||||
barcode.set(CODCORR_CODARTALT, codice_a_barre);
|
||||
const TString& codice_art = archivio_codcorr.get(CODCORR_CODART).as_string();
|
||||
barcode.set(CODCORR_CODART, codice_art);
|
||||
barcode.set(CODCORR_CODARTALT, archivio_codcorr.get(CODCORR_CODARTALT));
|
||||
barcode.set(CODCORR_CODART, archivio_codcorr.get(CODCORR_CODART));
|
||||
}
|
||||
|
||||
return salva_recordset(barcode, "barcode");
|
||||
@ -684,6 +682,8 @@ bool TFile2Txt::genera_attrezzature_txt()
|
||||
attrezzature.set("DataAssegnamento", hd_format_date8(data_ass));
|
||||
TDate data_fabb = archivio_attr.get("D1").as_date();
|
||||
attrezzature.set("DataFabbricazione", hd_format_date8(data_fabb));
|
||||
|
||||
attrezzature.duplica_capi_zona();
|
||||
}
|
||||
|
||||
salva_recordset(attrezzature, "attrezzature");
|
||||
@ -729,6 +729,8 @@ bool TFile2Txt::genera_attrezzature_txt()
|
||||
importo.round();
|
||||
storico.set("Importo", importo);
|
||||
storico.set("ChiusuraComodato", archivio_storico.get("B0"));
|
||||
|
||||
storico.duplica_capi_zona();
|
||||
}
|
||||
|
||||
return salva_recordset(storico, "storico");
|
||||
@ -835,6 +837,7 @@ bool TFile2Txt::genera_carico_txt(const TMask& mask)
|
||||
qta.round();
|
||||
carico.set("QuantitaCaricata", qta);
|
||||
carico.set("CodiceLotto", archivio_rdoc.get(RDOC_LIVELLO));
|
||||
carico.duplica_capi_zona();
|
||||
}
|
||||
|
||||
return accoda_recordset(carico, "carico");
|
||||
@ -880,6 +883,7 @@ bool TFile2Txt::genera_ripristino_txt(const TMask& mask)
|
||||
qta.round();
|
||||
ripristino.set("QuantitaCaricata", qta);
|
||||
ripristino.set("CodiceLotto", archivio_mag.get(MAG_LIVELLO));
|
||||
ripristino.duplica_capi_zona();
|
||||
}
|
||||
|
||||
return salva_recordset(ripristino, "carico");
|
||||
|
347
ha/ha1250.cpp
347
ha/ha1250.cpp
@ -2,6 +2,7 @@
|
||||
#include <config.h>
|
||||
#include <execp.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
#include <relation.h>
|
||||
#include <utility.h>
|
||||
|
||||
@ -226,4 +227,348 @@ bool THardy_transaction::create()
|
||||
*/
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Recordset specifici per i dati da trasferire OUTPUT
|
||||
/////////////////////////////////////////////////////////////
|
||||
//questo serve solo per l'ultima riga con il return (\r\n)
|
||||
void THardy_recordset::add_eol_field()
|
||||
{
|
||||
create_field("ACapo", -1, 2, _alfafld, false, TVariant("\r\n"));
|
||||
}
|
||||
|
||||
//questo è il metodo magico che vale per tutti
|
||||
void THardy_recordset::add_field(const char* name, const char* tipo, int pos, int len)
|
||||
{
|
||||
const TFixed_string str_tipo(tipo);
|
||||
if (str_tipo.ends_with("N"))
|
||||
{
|
||||
create_field(name, pos-1, len, _intzerofld);
|
||||
return;
|
||||
}
|
||||
create_field(name, pos-1, len, _alfafld);
|
||||
}
|
||||
|
||||
void THardy_recordset::add_trc_field(const char* tr, const char* name, const char* tipo, int pos, int len)
|
||||
{
|
||||
CHECK(tr && strlen(tr) == 2, "Lunghezza tipo record errata!!");
|
||||
TString80 trc_name;
|
||||
trc_name << tr << '.' << name;
|
||||
add_field(trc_name, tipo, pos, len);
|
||||
}
|
||||
|
||||
void THardy_recordset::insert_field(const char* name, const char* tipo, int pos, int len)
|
||||
{
|
||||
if (pos >= 1)
|
||||
{
|
||||
TArray& trc = (TArray&)*_trc.first_item();
|
||||
FOR_EACH_ARRAY_ITEM(trc, r, itm)
|
||||
{
|
||||
TAS400_column_info& fld = (TAS400_column_info&)*itm;
|
||||
if (fld._pos+1 >= pos)
|
||||
{
|
||||
fld._pos += len;
|
||||
}
|
||||
}
|
||||
}
|
||||
add_field(name, tipo, pos, len);
|
||||
}
|
||||
|
||||
void THardy_recordset::duplica_capi_zona()
|
||||
{
|
||||
TString8 ct = get("CodiceTerminale").as_string();
|
||||
while (ct.full())
|
||||
{
|
||||
ct.right_just(5, '0');
|
||||
ct = cache().get(LF_AGENTI, ct, AGE_CODCAPO).right(3);
|
||||
if (ct.full())
|
||||
{
|
||||
const TToken_string& r = row(items()-1);
|
||||
new_rec(r);
|
||||
set("CodiceTerminale", ct);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//al costruttore viene passato come parametro la lunghezza del tracciato
|
||||
THardy_recordset::THardy_recordset(const int rec_lenght) : TAS400_recordset("AS400()")
|
||||
{
|
||||
TString16 query;
|
||||
query << "AS400(" << rec_lenght << ")";
|
||||
TFilename cazzone;
|
||||
parse_query(query, cazzone);
|
||||
}
|
||||
|
||||
|
||||
//Agenti
|
||||
//-------
|
||||
TEsporta_agenti_recordset::TEsporta_agenti_recordset()
|
||||
: THardy_recordset(77)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field(AGE_CODAGE, T_N, 4, 3); //x
|
||||
add_field("NonUsato", T_X, 7, 6);
|
||||
add_field("Targa", T_X, 13, 8);
|
||||
add_field("nDDT", T_N, 21, 5);
|
||||
add_field("nFATT", T_N, 26, 5);
|
||||
add_field("nBOLLA", T_N, 31, 5);
|
||||
add_field(AGE_RAGSOC, T_X, 36, 30); //x
|
||||
add_field("nORD", T_N, 66, 5);
|
||||
add_field("nSAGIT", T_N, 71, 5);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
//Clienti
|
||||
//-------
|
||||
|
||||
void TEsporta_clienti_recordset::set_fatt(const char* fld_name, const TVariant& value, const bool is_fatt)
|
||||
{
|
||||
TString80 new_fld_name = fld_name;
|
||||
if (is_fatt)
|
||||
new_fld_name << "Fatt";
|
||||
|
||||
THardy_recordset::set(new_fld_name, value);
|
||||
}
|
||||
|
||||
TEsporta_clienti_recordset::TEsporta_clienti_recordset(int recsize) : THardy_recordset(recsize)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field("CodiceCliente", T_N, 4, 6); //x
|
||||
add_field("RagioneSociale", T_X, 10, 34); //x
|
||||
add_field("Indirizzo", T_X, 44, 34); //x
|
||||
add_field("Localita", T_X, 78, 20); //x
|
||||
add_field("CAP", T_X, 98, 5); //x
|
||||
add_field("Provincia", T_X, 103, 2); //x
|
||||
add_field("PartitaIVA", T_X, 105, 11); //x
|
||||
add_field("CodiceFiscale", T_X, 116, 16); //x
|
||||
add_field("RagioneSocialeFatt", T_X, 132, 34); //x da qui i dati di codalleg
|
||||
add_field("IndirizzoFatt", T_X, 166, 34); //x
|
||||
add_field("LocalitaFatt", T_X, 200, 20); //x
|
||||
add_field("CAPFatt", T_X, 220, 5); //x
|
||||
add_field("ProvinciaFatt", T_X, 225, 2); //x
|
||||
add_field("PartitaIVAFatt", T_X, 227, 11); //x
|
||||
add_field("CodiceFiscaleFatt", T_X, 238, 16); //x //fine dati di codalleg
|
||||
add_field("CodicePagamento", T_X, 254, 2); //x
|
||||
add_field("CodiceListino", T_X, 256, 3); //x
|
||||
add_field("CodicePromozione", T_X, 259, 3);
|
||||
add_field("ScontoFineFattura", T_2Nv2N,262, 4); //x
|
||||
add_field("Giro01", T_N, 266, 3);
|
||||
add_field("Giro02", T_N, 269, 3);
|
||||
add_field("Giro03", T_N, 272, 3);
|
||||
add_field("Giro04", T_N, 275, 3);
|
||||
add_field("Giro05", T_N, 278, 3);
|
||||
add_field("Giro06", T_N, 281, 3);
|
||||
add_field("NumeroTelefono", T_X, 284, 10); //x
|
||||
add_field("EsenteIVA", T_X, 294, 2); //x
|
||||
add_field("TipoDoc", T_X, 296, 1);
|
||||
add_field("NoConsegna", T_X, 297, 1); //x
|
||||
add_field("Fido", T_Nv2N, 298, 8); //x
|
||||
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni clienti
|
||||
TEsporta_clientiVAR_recordset::TEsporta_clientiVAR_recordset()
|
||||
: TEsporta_clienti_recordset(308)
|
||||
{
|
||||
insert_field("Segno", T_X, 4, 1); //x
|
||||
}
|
||||
|
||||
//Prodotti
|
||||
//--------
|
||||
TEsporta_prodotti_recordset::TEsporta_prodotti_recordset(int rec_length)
|
||||
: THardy_recordset(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(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); //x prodotto da controllare (tazzine)
|
||||
add_field("PrezzoMinimo", T_Nv3N, 57, 7);
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni prodotti
|
||||
TEsporta_prodottiVAR_recordset::TEsporta_prodottiVAR_recordset()
|
||||
: TEsporta_prodotti_recordset(66)
|
||||
{
|
||||
insert_field("Segno", T_X, 1, 1); //x
|
||||
}
|
||||
|
||||
//Linee
|
||||
//-----
|
||||
TEsporta_linee_recordset::TEsporta_linee_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("Fascia", T_X, 1, 1);
|
||||
add_field("Descrizione", T_X, 2, 50);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Righe Listini
|
||||
//-------------
|
||||
TEsporta_listini_recordset::TEsporta_listini_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field(RCONDV_COD, T_X, 4, 3); //x
|
||||
add_field(RCONDV_CODRIGA, T_X, 7, 5); //x
|
||||
add_field(RCONDV_PREZZO, T_Nv3N, 12, 7); //x
|
||||
add_field(RCONDV_SCONTO, T_2Nv2N,19, 4); //x
|
||||
add_field("Sconto2", T_2Nv2N,23, 4);
|
||||
add_field("Sconto3", T_2Nv2N,27, 4);
|
||||
add_field("CasaMandante", T_NS, 31, 6);
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni listini
|
||||
TEsporta_listiniVAR_recordset::TEsporta_listiniVAR_recordset()
|
||||
: TEsporta_listini_recordset(39)
|
||||
{
|
||||
insert_field("Segno", T_X, 4, 1); //x
|
||||
}
|
||||
|
||||
|
||||
//Offerte
|
||||
//-------
|
||||
TEsporta_offerte_recordset::TEsporta_offerte_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field(CONDV_COD, T_X, 1, 3);
|
||||
add_field(CONDV_COD, T_X, 4, 3);
|
||||
add_field(CONDV_VALIN, T_X, 7, 8);
|
||||
add_field(CONDV_VALFIN, T_X, 15, 8);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Righe Contratti
|
||||
//---------------
|
||||
TEsporta_contratti_recordset::TEsporta_contratti_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field(CONDV_CODCF, T_N, 4, 6); //x
|
||||
add_field(RCONDV_CODRIGA, T_X, 10, 5); //x
|
||||
add_field(RCONDV_PREZZO, T_Nv3N, 15, 7); //x
|
||||
add_field(RCONDV_SCONTO, T_2Nv2N,22, 4); //x
|
||||
add_field("Sconto2", T_2Nv2N,26, 4);
|
||||
add_field("Sconto3", T_2Nv2N,30, 4);
|
||||
add_field(CONDV_VALIN, T_X, 34, 8); //x
|
||||
add_field(CONDV_VALFIN, T_X, 42, 8); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Rdoc (Carico) è una riga di un documento o un movimento di magazzino nel caso del ripristino
|
||||
//-------------
|
||||
TEsporta_carico_recordset::TEsporta_carico_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field("CodiceArticolo", T_X, 4, 5); //x
|
||||
add_field("QuantitaCaricata",T_Nv2N,9, 7); //x
|
||||
add_field("CodiceLotto", T_X, 16, 10);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//Sospesi
|
||||
//-------
|
||||
TEsporta_sospesi_recordset::TEsporta_sospesi_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field("CodiceCliente", T_N, 4, 6); //x
|
||||
add_field("NumeroFattura", T_X, 10, 12); //x
|
||||
add_field("DataFattura", T_X, 22, 6); //x
|
||||
add_field("ImportoResiduo", T_Nv2N, 28, 9); //x
|
||||
add_field("ImpOriginalDoc", T_N, 37, 9); //x
|
||||
add_field("DataScadenza", T_X, 46, 6); //x
|
||||
add_field("Partita", T_X, 52, 15); //x
|
||||
add_field("TipoDocumento", T_X, 67, 1); //x
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni sospesi
|
||||
TEsporta_sospesiVAR_recordset::TEsporta_sospesiVAR_recordset()
|
||||
: TEsporta_sospesi_recordset(70)
|
||||
{
|
||||
insert_field("Segno", T_X, 4, 1); //x
|
||||
}
|
||||
|
||||
|
||||
//Decodart ()
|
||||
//---------------
|
||||
TEsporta_decodart_recordset::TEsporta_decodart_recordset()
|
||||
: THardy_recordset(49)
|
||||
{
|
||||
add_field(CODCORR_CODART, T_X, 1, 5); //x
|
||||
add_field(CODCORR_CODCF, T_N, 6, 6); //x
|
||||
add_field(CODCORR_CODARTALT, T_X, 12, 6); //x
|
||||
add_field(CODCORR_DESCR, T_X, 18,30); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Barcode
|
||||
//---------------
|
||||
TEsporta_barcode_recordset::TEsporta_barcode_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field(CODCORR_CODARTALT, T_X, 1, 20); //x
|
||||
add_field(CODCORR_CODART, T_X, 21, 5); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Attrezzature
|
||||
//---------------
|
||||
TEsporta_attrezzature_recordset::TEsporta_attrezzature_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3);
|
||||
add_field("CodiceArticolo", T_X, 4, 5);
|
||||
add_field("Progressivo", T_N, 9, 7);
|
||||
add_field("Matricola", T_X, 16, 15);
|
||||
add_field("DescrAttrezz", T_X, 31, 50);
|
||||
add_field("CodiceCliente", T_N, 81, 6);
|
||||
add_field("CodiceSedeCliente",T_N, 87, 3);
|
||||
add_field("DataAssegnamento", T_X, 90, 8);
|
||||
add_field("DataFabbricazione",T_X, 98, 8);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//Storico Attrezzature
|
||||
//--------------------
|
||||
TEsporta_storico_attrezzature_recordset::TEsporta_storico_attrezzature_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3);
|
||||
add_field("CodiceArticolo", T_X, 4, 5);
|
||||
add_field("Progressivo", T_N, 9, 7);
|
||||
add_field("ProgrIntervento", T_N, 16, 5);
|
||||
add_field("DataIntervento", T_X, 21, 8);
|
||||
add_field("TipoIntervento", T_X, 29, 1);
|
||||
add_field("DescrIntervento", T_X, 30, 50);
|
||||
add_field("CodArtIntervento", T_X, 80, 5);
|
||||
add_field("UnitaMisura", T_X, 85, 2);
|
||||
add_field("Quantita", T_Nv2N,87, 7);
|
||||
add_field("Importo", T_Nv2N,94, 9);
|
||||
add_field("ChiusuraComodato", T_X, 103, 1);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//Pagamenti
|
||||
//---------------
|
||||
TEsporta_pagamenti_recordset::TEsporta_pagamenti_recordset()
|
||||
: THardy_recordset(27)
|
||||
{
|
||||
add_field("CodicePagamento", T_X, 1, 2); //x
|
||||
add_field("DescrPagamento", T_X, 3, 20); //x
|
||||
add_field("GiorniScadenza", T_N, 23, 3); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
193
ha/ha1250.h
193
ha/ha1250.h
@ -1,6 +1,18 @@
|
||||
#ifndef __HA1250_H
|
||||
#define __HA1250_H
|
||||
|
||||
#include <applicat.h>
|
||||
#include <mask.h>
|
||||
#include <reputils.h>
|
||||
#include <textset.h>
|
||||
|
||||
#include "../mg/anamag.h"
|
||||
#include "../mg/codcorr.h"
|
||||
#include "../mg/rmovmag.h"
|
||||
#include "../mg/umart.h"
|
||||
#include "../pr/agenti.h"
|
||||
#include "../ve/condv.h"
|
||||
#include "../ve/rcondv.h"
|
||||
|
||||
class THardy_transaction : public TSkeleton_application
|
||||
{
|
||||
@ -23,4 +35,183 @@ protected:
|
||||
public:
|
||||
virtual void main_loop();
|
||||
virtual bool create();
|
||||
};
|
||||
};
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Hardy_recordset: serve per l'OUTPUT
|
||||
//------------------------------------------------------------
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Recordset specifici per i dati da trasferire
|
||||
/////////////////////////////////////////////////////////////
|
||||
//classe generica per poter aggiungere pedissequamente i campi seguendo le tracce sulla documentazione
|
||||
//tipologie di campo secondo il ricevente
|
||||
#define T_N "N"
|
||||
#define T_2N "2N"
|
||||
#define T_Nv2N "N,2N"
|
||||
#define T_Nv3N "N,3N"
|
||||
#define T_2Nv2N "2N,2N"
|
||||
#define T_X "X"
|
||||
#define T_NS "NS"
|
||||
|
||||
class THardy_recordset : public TAS400_recordset
|
||||
{
|
||||
protected:
|
||||
//esportazione
|
||||
void add_field(const char* name, const char* tipo, int pos, int len);
|
||||
void insert_field(const char* name, const char* tipo, int pos, int len);
|
||||
void add_eol_field();
|
||||
//importazione
|
||||
void add_trc_field(const char* tr, const char* name, const char* tipo, int pos, int len);
|
||||
|
||||
public:
|
||||
void duplica_capi_zona();
|
||||
THardy_recordset(const int rec_length);
|
||||
};
|
||||
|
||||
|
||||
//Agenti
|
||||
//-------
|
||||
class TEsporta_agenti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_agenti_recordset();
|
||||
};
|
||||
|
||||
|
||||
//Clienti (clifo + cfven)
|
||||
//-----------------------
|
||||
class TEsporta_clienti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
void set_fatt(const char* fld_name, const TVariant& value, const bool is_fatt);
|
||||
TEsporta_clienti_recordset(int recsize = 307);
|
||||
};
|
||||
//..e variazioni clienti!
|
||||
class TEsporta_clientiVAR_recordset : public TEsporta_clienti_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_clientiVAR_recordset();
|
||||
};
|
||||
|
||||
|
||||
//Sospesi ()
|
||||
//-----------------------
|
||||
class TEsporta_sospesi_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_sospesi_recordset(int rec_length = 69);
|
||||
};
|
||||
//..e variazioni sospesi!
|
||||
class TEsporta_sospesiVAR_recordset : public TEsporta_sospesi_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_sospesiVAR_recordset();
|
||||
};
|
||||
|
||||
//Listini (condv + rcondv)
|
||||
//------------------------
|
||||
class TEsporta_listini_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_listini_recordset(int rec_length = 38);
|
||||
};
|
||||
//..e variazioni listini
|
||||
class TEsporta_listiniVAR_recordset : public TEsporta_listini_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_listiniVAR_recordset();
|
||||
};
|
||||
|
||||
//Contratti (Particolari) (condv + rcondv)
|
||||
//----------------------------------------
|
||||
class TEsporta_contratti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_contratti_recordset(int rec_length = 51);
|
||||
};
|
||||
|
||||
//Offerte (Promo) (condv + rcondv)
|
||||
//----------------------------------------
|
||||
class TEsporta_offerte_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_offerte_recordset(int rec_length = 24);
|
||||
};
|
||||
|
||||
//Prodotti (anamag + umart)
|
||||
//-------------------------
|
||||
class TEsporta_prodotti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_prodotti_recordset(int rec_length = 65);
|
||||
};
|
||||
//..e variazioni prodotti
|
||||
class TEsporta_prodottiVAR_recordset : public TEsporta_prodotti_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_prodottiVAR_recordset();
|
||||
};
|
||||
|
||||
|
||||
//Linee
|
||||
//-----
|
||||
class TEsporta_linee_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_linee_recordset(int rec_length = 53);
|
||||
};
|
||||
|
||||
|
||||
//Carico (rdoc di carico)
|
||||
//-----------------------
|
||||
class TEsporta_carico_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_carico_recordset(int rec_length = 27);
|
||||
};
|
||||
|
||||
|
||||
//Decodart ()
|
||||
//----------------
|
||||
class TEsporta_decodart_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_decodart_recordset();
|
||||
};
|
||||
|
||||
//Barcode ()
|
||||
//---------------
|
||||
class TEsporta_barcode_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_barcode_recordset(int rec_length = 27);
|
||||
};
|
||||
|
||||
//Attrezzature ()
|
||||
//----------------
|
||||
class TEsporta_attrezzature_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_attrezzature_recordset(int rec_length = 107);
|
||||
};
|
||||
|
||||
//Storico Attrezzature ()
|
||||
//-----------------------
|
||||
class TEsporta_storico_attrezzature_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_storico_attrezzature_recordset(int rec_length = 105);
|
||||
};
|
||||
|
||||
//Pagamenti ()
|
||||
//-----------------
|
||||
class TEsporta_pagamenti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_pagamenti_recordset();
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
331
ha/halib.cpp
331
ha/halib.cpp
@ -48,337 +48,6 @@ TContratto_premi::TContratto_premi(const TRectype& rec_doc)
|
||||
: TDocumento(rec_doc)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Recordset specifici per i dati da trasferire OUTPUT
|
||||
/////////////////////////////////////////////////////////////
|
||||
//questo serve solo per l'ultima riga con il return (\r\n)
|
||||
void THardy_recordset::add_eol_field()
|
||||
{
|
||||
create_field("ACapo", -1, 2, _alfafld, false, TVariant("\r\n"));
|
||||
}
|
||||
|
||||
//questo è il metodo magico che vale per tutti
|
||||
void THardy_recordset::add_field(const char* name, const char* tipo, int pos, int len)
|
||||
{
|
||||
const TFixed_string str_tipo(tipo);
|
||||
if (str_tipo.ends_with("N"))
|
||||
{
|
||||
create_field(name, pos-1, len, _intzerofld);
|
||||
return;
|
||||
}
|
||||
create_field(name, pos-1, len, _alfafld);
|
||||
}
|
||||
|
||||
void THardy_recordset::add_trc_field(const char* tr, const char* name, const char* tipo, int pos, int len)
|
||||
{
|
||||
CHECK(tr && strlen(tr) == 2, "Lunghezza tipo record errata!!");
|
||||
TString80 trc_name;
|
||||
trc_name << tr << '.' << name;
|
||||
add_field(trc_name, tipo, pos, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void THardy_recordset::insert_field(const char* name, const char* tipo, int pos, int len)
|
||||
{
|
||||
if (pos >= 1)
|
||||
{
|
||||
TArray& trc = (TArray&)*_trc.first_item();
|
||||
FOR_EACH_ARRAY_ITEM(trc, r, itm)
|
||||
{
|
||||
TAS400_column_info& fld = (TAS400_column_info&)*itm;
|
||||
if (fld._pos+1 >= pos)
|
||||
{
|
||||
fld._pos += len;
|
||||
}
|
||||
}
|
||||
}
|
||||
add_field(name, tipo, pos, len);
|
||||
}
|
||||
|
||||
//al costruttore viene passato come parametro la lunghezza del tracciato
|
||||
THardy_recordset::THardy_recordset(const int rec_lenght) : TAS400_recordset("AS400()")
|
||||
{
|
||||
TString16 query;
|
||||
query << "AS400(" << rec_lenght << ")";
|
||||
TFilename cazzone;
|
||||
parse_query(query, cazzone);
|
||||
}
|
||||
|
||||
|
||||
//Agenti
|
||||
//-------
|
||||
TEsporta_agenti_recordset::TEsporta_agenti_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field(AGE_CODAGE, T_N, 4, 3); //x
|
||||
add_field("NonUsato", T_X, 7, 6);
|
||||
add_field("Targa", T_X, 13, 8);
|
||||
add_field("nDDT", T_N, 21, 5);
|
||||
add_field("nFATT", T_N, 26, 5);
|
||||
add_field("nBOLLA", T_N, 31, 5);
|
||||
add_field(AGE_RAGSOC, T_X, 36, 30); //x
|
||||
add_field("nORD", T_N, 66, 5);
|
||||
add_field("nSAGIT", T_N, 71, 5);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
//Clienti
|
||||
//-------
|
||||
|
||||
void TEsporta_clienti_recordset::set_fatt(const char* fld_name, const TVariant& value, const bool is_fatt)
|
||||
{
|
||||
TString80 new_fld_name = fld_name;
|
||||
if (is_fatt)
|
||||
new_fld_name << "Fatt";
|
||||
|
||||
THardy_recordset::set(new_fld_name, value);
|
||||
}
|
||||
|
||||
TEsporta_clienti_recordset::TEsporta_clienti_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field("CodiceCliente", T_N, 4, 6); //x
|
||||
add_field("RagioneSociale", T_X, 10, 34); //x
|
||||
add_field("Indirizzo", T_X, 44, 34); //x
|
||||
add_field("Localita", T_X, 78, 20); //x
|
||||
add_field("CAP", T_X, 98, 5); //x
|
||||
add_field("Provincia", T_X, 103, 2); //x
|
||||
add_field("PartitaIVA", T_X, 105, 11); //x
|
||||
add_field("CodiceFiscale", T_X, 116, 16); //x
|
||||
add_field("RagioneSocialeFatt", T_X, 132, 34); //x da qui i dati di codalleg
|
||||
add_field("IndirizzoFatt", T_X, 166, 34); //x
|
||||
add_field("LocalitaFatt", T_X, 200, 20); //x
|
||||
add_field("CAPFatt", T_X, 220, 5); //x
|
||||
add_field("ProvinciaFatt", T_X, 225, 2); //x
|
||||
add_field("PartitaIVAFatt", T_X, 227, 11); //x
|
||||
add_field("CodiceFiscaleFatt", T_X, 238, 16); //x //fine dati di codalleg
|
||||
add_field("CodicePagamento", T_X, 254, 2); //x
|
||||
add_field("CodiceListino", T_X, 256, 3); //x
|
||||
add_field("CodicePromozione", T_X, 259, 3);
|
||||
add_field("ScontoFineFattura", T_2Nv2N,262, 4); //x
|
||||
add_field("Giro01", T_N, 266, 3);
|
||||
add_field("Giro02", T_N, 269, 3);
|
||||
add_field("Giro03", T_N, 272, 3);
|
||||
add_field("Giro04", T_N, 275, 3);
|
||||
add_field("Giro05", T_N, 278, 3);
|
||||
add_field("Giro06", T_N, 281, 3);
|
||||
add_field("NumeroTelefono", T_X, 284, 10); //x
|
||||
add_field("EsenteIVA", T_X, 294, 2); //x
|
||||
add_field("TipoDoc", T_X, 296, 1);
|
||||
add_field("NoConsegna", T_X, 297, 1); //x
|
||||
add_field("Fido", T_Nv2N, 298, 8); //x
|
||||
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni clienti
|
||||
TEsporta_clientiVAR_recordset::TEsporta_clientiVAR_recordset()
|
||||
: TEsporta_clienti_recordset(308)
|
||||
{
|
||||
insert_field("Segno", T_X, 4, 1); //x
|
||||
}
|
||||
|
||||
//Prodotti
|
||||
//--------
|
||||
TEsporta_prodotti_recordset::TEsporta_prodotti_recordset(int rec_length)
|
||||
: THardy_recordset(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(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); //x prodotto da controllare (tazzine)
|
||||
add_field("PrezzoMinimo", T_Nv3N, 57, 7);
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni prodotti
|
||||
TEsporta_prodottiVAR_recordset::TEsporta_prodottiVAR_recordset()
|
||||
: TEsporta_prodotti_recordset(66)
|
||||
{
|
||||
insert_field("Segno", T_X, 1, 1); //x
|
||||
}
|
||||
|
||||
//Linee
|
||||
//-----
|
||||
TEsporta_linee_recordset::TEsporta_linee_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("Fascia", T_X, 1, 1);
|
||||
add_field("Descrizione", T_X, 2, 50);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Righe Listini
|
||||
//-------------
|
||||
TEsporta_listini_recordset::TEsporta_listini_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field(RCONDV_COD, T_X, 4, 3); //x
|
||||
add_field(RCONDV_CODRIGA, T_X, 7, 5); //x
|
||||
add_field(RCONDV_PREZZO, T_Nv3N, 12, 7); //x
|
||||
add_field(RCONDV_SCONTO, T_2Nv2N,19, 4); //x
|
||||
add_field("Sconto2", T_2Nv2N,23, 4);
|
||||
add_field("Sconto3", T_2Nv2N,27, 4);
|
||||
add_field("CasaMandante", T_NS, 31, 6);
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni listini
|
||||
TEsporta_listiniVAR_recordset::TEsporta_listiniVAR_recordset()
|
||||
: TEsporta_listini_recordset(39)
|
||||
{
|
||||
insert_field("Segno", T_X, 4, 1); //x
|
||||
}
|
||||
|
||||
|
||||
//Offerte
|
||||
//-------
|
||||
TEsporta_offerte_recordset::TEsporta_offerte_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field(CONDV_COD, T_X, 1, 3);
|
||||
add_field(CONDV_COD, T_X, 4, 3);
|
||||
add_field(CONDV_VALIN, T_X, 7, 8);
|
||||
add_field(CONDV_VALFIN, T_X, 15, 8);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Righe Contratti
|
||||
//---------------
|
||||
TEsporta_contratti_recordset::TEsporta_contratti_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field(CONDV_CODCF, T_N, 4, 6); //x
|
||||
add_field(RCONDV_CODRIGA, T_X, 10, 5); //x
|
||||
add_field(RCONDV_PREZZO, T_Nv3N, 15, 7); //x
|
||||
add_field(RCONDV_SCONTO, T_2Nv2N,22, 4); //x
|
||||
add_field("Sconto2", T_2Nv2N,26, 4);
|
||||
add_field("Sconto3", T_2Nv2N,30, 4);
|
||||
add_field(CONDV_VALIN, T_X, 34, 8); //x
|
||||
add_field(CONDV_VALFIN, T_X, 42, 8); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Rdoc (Carico) è una riga di un documento o un movimento di magazzino nel caso del ripristino
|
||||
//-------------
|
||||
TEsporta_carico_recordset::TEsporta_carico_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field("CodiceArticolo", T_X, 4, 5); //x
|
||||
add_field("QuantitaCaricata",T_Nv2N,9, 7); //x
|
||||
add_field("CodiceLotto", T_X, 16, 10);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//Sospesi
|
||||
//-------
|
||||
TEsporta_sospesi_recordset::TEsporta_sospesi_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3); //x
|
||||
add_field("CodiceCliente", T_N, 4, 6); //x
|
||||
add_field("NumeroFattura", T_X, 10, 12); //x
|
||||
add_field("DataFattura", T_X, 22, 6); //x
|
||||
add_field("ImportoResiduo", T_Nv2N, 28, 9); //x
|
||||
add_field("ImpOriginalDoc", T_N, 37, 9); //x
|
||||
add_field("DataScadenza", T_X, 46, 6); //x
|
||||
add_field("Partita", T_X, 52, 15); //x
|
||||
add_field("TipoDocumento", T_X, 67, 1); //x
|
||||
add_eol_field();
|
||||
}
|
||||
//..e variazioni sospesi
|
||||
TEsporta_sospesiVAR_recordset::TEsporta_sospesiVAR_recordset()
|
||||
: TEsporta_sospesi_recordset(70)
|
||||
{
|
||||
insert_field("Segno", T_X, 4, 1); //x
|
||||
}
|
||||
|
||||
|
||||
//Decodart ()
|
||||
//---------------
|
||||
TEsporta_decodart_recordset::TEsporta_decodart_recordset()
|
||||
: THardy_recordset(49)
|
||||
{
|
||||
add_field(CODCORR_CODART, T_X, 1, 5); //x
|
||||
add_field(CODCORR_CODCF, T_N, 6, 6); //x
|
||||
add_field(CODCORR_CODARTALT, T_X, 12, 6); //x
|
||||
add_field(CODCORR_DESCR, T_X, 18,30); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Barcode
|
||||
//---------------
|
||||
TEsporta_barcode_recordset::TEsporta_barcode_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field(CODCORR_CODARTALT, T_X, 1, 20); //x
|
||||
add_field(CODCORR_CODART, T_X, 21, 5); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
|
||||
//Attrezzature
|
||||
//---------------
|
||||
TEsporta_attrezzature_recordset::TEsporta_attrezzature_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3);
|
||||
add_field("CodiceArticolo", T_X, 4, 5);
|
||||
add_field("Progressivo", T_N, 9, 7);
|
||||
add_field("Matricola", T_X, 16, 15);
|
||||
add_field("DescrAttrezz", T_X, 31, 50);
|
||||
add_field("CodiceCliente", T_N, 81, 6);
|
||||
add_field("CodiceSedeCliente",T_N, 87, 3);
|
||||
add_field("DataAssegnamento", T_X, 90, 8);
|
||||
add_field("DataFabbricazione",T_X, 98, 8);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//Storico Attrezzature
|
||||
//--------------------
|
||||
TEsporta_storico_attrezzature_recordset::TEsporta_storico_attrezzature_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodiceTerminale", T_N, 1, 3);
|
||||
add_field("CodiceArticolo", T_X, 4, 5);
|
||||
add_field("Progressivo", T_N, 9, 7);
|
||||
add_field("ProgrIntervento", T_N, 16, 5);
|
||||
add_field("DataIntervento", T_X, 21, 8);
|
||||
add_field("TipoIntervento", T_X, 29, 1);
|
||||
add_field("DescrIntervento", T_X, 30, 50);
|
||||
add_field("CodArtIntervento", T_X, 80, 5);
|
||||
add_field("UnitaMisura", T_X, 85, 2);
|
||||
add_field("Quantita", T_Nv2N,87, 7);
|
||||
add_field("Importo", T_Nv2N,94, 9);
|
||||
add_field("ChiusuraComodato", T_X, 103, 1);
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
//Pagamenti
|
||||
//---------------
|
||||
TEsporta_pagamenti_recordset::TEsporta_pagamenti_recordset(int rec_length)
|
||||
: THardy_recordset(rec_length)
|
||||
{
|
||||
add_field("CodicePagamento", T_X, 1, 2); //x
|
||||
add_field("DescrPagamento", T_X, 3, 20); //x
|
||||
add_field("GiorniScadenza", T_N, 23, 3); //x
|
||||
add_eol_field();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCodArtEsselunga_cache
|
||||
///////////////////////////////////////////////////////////
|
||||
|
191
ha/halib.h
191
ha/halib.h
@ -1,16 +1,10 @@
|
||||
#ifndef __TEXTSET_H
|
||||
#include <textset.h>
|
||||
#endif __TEXTSET_H
|
||||
#ifndef __HALIB_H
|
||||
#define __HALIB_H
|
||||
|
||||
#ifndef __VELIB_H
|
||||
#include "../ve/velib.h"
|
||||
#endif
|
||||
|
||||
#include "../mg/rmovmag.h"
|
||||
#include "../pr/agenti.h"
|
||||
#include "../ve/condv.h"
|
||||
#include "../ve/rcondv.h"
|
||||
|
||||
//definizioni delle righe dei contratti premio Hardy (da includere nei .cpp)
|
||||
#define HARDY_TIPORIGA_MERCE "H01"
|
||||
#define HARDY_TIPORIGA_SOMMA "H02"
|
||||
@ -43,183 +37,6 @@ public:
|
||||
TContratto_premi(const TRectype& rec_doc);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Recordset specifici per i dati da trasferire
|
||||
/////////////////////////////////////////////////////////////
|
||||
//classe generica per poter aggiungere pedissequamente i campi seguendo le tracce sulla documentazione
|
||||
//tipologie di campo secondo il ricevente
|
||||
#define T_N "N"
|
||||
#define T_2N "2N"
|
||||
#define T_Nv2N "N,2N"
|
||||
#define T_Nv3N "N,3N"
|
||||
#define T_2Nv2N "2N,2N"
|
||||
#define T_X "X"
|
||||
#define T_NS "NS"
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Hardy_recordset: serve per l'OUTPUT
|
||||
//------------------------------------------------------------
|
||||
|
||||
class THardy_recordset : public TAS400_recordset
|
||||
{
|
||||
protected:
|
||||
//esportazione
|
||||
void add_field(const char* name, const char* tipo, int pos, int len);
|
||||
void insert_field(const char* name, const char* tipo, int pos, int len);
|
||||
void add_eol_field();
|
||||
//importazione
|
||||
void add_trc_field(const char* tr, const char* name, const char* tipo, int pos, int len);
|
||||
|
||||
public:
|
||||
THardy_recordset(const int rec_length);
|
||||
};
|
||||
|
||||
|
||||
//Agenti
|
||||
//-------
|
||||
class TEsporta_agenti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_agenti_recordset(int rec_length = 77);
|
||||
};
|
||||
|
||||
|
||||
//Clienti (clifo + cfven)
|
||||
//-----------------------
|
||||
class TEsporta_clienti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
void set_fatt(const char* fld_name, const TVariant& value, const bool is_fatt);
|
||||
TEsporta_clienti_recordset(int rec_length = 307);
|
||||
};
|
||||
//..e variazioni clienti!
|
||||
class TEsporta_clientiVAR_recordset : public TEsporta_clienti_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_clientiVAR_recordset();
|
||||
};
|
||||
|
||||
|
||||
//Sospesi ()
|
||||
//-----------------------
|
||||
class TEsporta_sospesi_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_sospesi_recordset(int rec_length = 69);
|
||||
};
|
||||
//..e variazioni sospesi!
|
||||
class TEsporta_sospesiVAR_recordset : public TEsporta_sospesi_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_sospesiVAR_recordset();
|
||||
};
|
||||
|
||||
//Listini (condv + rcondv)
|
||||
//------------------------
|
||||
class TEsporta_listini_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_listini_recordset(int rec_length = 38);
|
||||
};
|
||||
//..e variazioni listini
|
||||
class TEsporta_listiniVAR_recordset : public TEsporta_listini_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_listiniVAR_recordset();
|
||||
};
|
||||
|
||||
//Contratti (Particolari) (condv + rcondv)
|
||||
//----------------------------------------
|
||||
class TEsporta_contratti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_contratti_recordset(int rec_length = 51);
|
||||
};
|
||||
|
||||
//Offerte (Promo) (condv + rcondv)
|
||||
//----------------------------------------
|
||||
class TEsporta_offerte_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_offerte_recordset(int rec_length = 24);
|
||||
};
|
||||
|
||||
//Prodotti (anamag + umart)
|
||||
//-------------------------
|
||||
class TEsporta_prodotti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_prodotti_recordset(int rec_length = 65);
|
||||
};
|
||||
//..e variazioni prodotti
|
||||
class TEsporta_prodottiVAR_recordset : public TEsporta_prodotti_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_prodottiVAR_recordset();
|
||||
};
|
||||
|
||||
|
||||
//Linee
|
||||
//-----
|
||||
class TEsporta_linee_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_linee_recordset(int rec_length = 53);
|
||||
};
|
||||
|
||||
|
||||
//Carico (rdoc di carico)
|
||||
//-----------------------
|
||||
class TEsporta_carico_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_carico_recordset(int rec_length = 27);
|
||||
};
|
||||
|
||||
|
||||
//Decodart ()
|
||||
//----------------
|
||||
class TEsporta_decodart_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_decodart_recordset();
|
||||
};
|
||||
|
||||
//Barcode ()
|
||||
//---------------
|
||||
class TEsporta_barcode_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_barcode_recordset(int rec_length = 27);
|
||||
};
|
||||
|
||||
//Attrezzature ()
|
||||
//----------------
|
||||
class TEsporta_attrezzature_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_attrezzature_recordset(int rec_length = 107);
|
||||
};
|
||||
|
||||
//Storico Attrezzature ()
|
||||
//-----------------------
|
||||
class TEsporta_storico_attrezzature_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_storico_attrezzature_recordset(int rec_length = 105);
|
||||
};
|
||||
|
||||
//Pagamenti ()
|
||||
//-----------------
|
||||
class TEsporta_pagamenti_recordset : public THardy_recordset
|
||||
{
|
||||
public:
|
||||
TEsporta_pagamenti_recordset(int rec_length = 27);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCodArtEsselunga_cache
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -245,4 +62,6 @@ const TDate upload_format_date6(const TString& str_data);
|
||||
long hd_key2cli(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);
|
||||
const TString& hd_get_next_att_key(const TString& codart);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user