Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : prima stesura della esportazione a terminalini di cartellini e storico git-svn-id: svn://10.65.10.50/branches/R_10_00@22197 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
eeea9031a3
commit
4a30114a85
@ -597,7 +597,88 @@ void TFile2Txt::genera_decodart_txt()
|
|||||||
|
|
||||||
void TFile2Txt::genera_attrezzature_txt()
|
void TFile2Txt::genera_attrezzature_txt()
|
||||||
{
|
{
|
||||||
|
//esporta le attrezzature (tabella &HAATT)
|
||||||
TEsporta_attrezzature_recordset attrezzature;
|
TEsporta_attrezzature_recordset attrezzature;
|
||||||
|
|
||||||
|
//esporta solo le attrezzature legate ad un cliente (quelle con I0=0 non esistono più o sono in sede Hardy)
|
||||||
|
TString query;
|
||||||
|
query << "USE &ATT";
|
||||||
|
query << "\nSELECT I0>0";
|
||||||
|
|
||||||
|
TISAM_recordset archivio_attr(query);
|
||||||
|
const long archivio_attr_items = archivio_attr.items();
|
||||||
|
|
||||||
|
TProgind progind_att(archivio_attr_items, "Attrezzature...", false, true);
|
||||||
|
for (bool ok = archivio_attr.move_first(); ok; ok = archivio_attr.move_next())
|
||||||
|
{
|
||||||
|
progind_att.addstatus(1);
|
||||||
|
|
||||||
|
attrezzature.new_rec("");
|
||||||
|
|
||||||
|
//in base al codice cliente stabilisce quale è il codice agente
|
||||||
|
const long codcf = archivio_attr.get("I0").as_int();
|
||||||
|
attrezzature.set("CodiceTerminale", hd_find_codag(codcf));
|
||||||
|
attrezzature.set("CodiceArticolo", archivio_attr.get("CODTAB[1,5]"));
|
||||||
|
attrezzature.set("Progressivo", archivio_attr.get("CODTAB[6,12]").as_int());
|
||||||
|
attrezzature.set("Matricola", archivio_attr.get("S0[6,20]"));
|
||||||
|
attrezzature.set("DescrAttrezz", archivio_attr.get("S3"));
|
||||||
|
attrezzature.set("CodiceCliente", codcf);
|
||||||
|
attrezzature.set("CodiceSedeCliente", archivio_attr.get("I1").as_int());
|
||||||
|
//occhio alle date
|
||||||
|
TDate data_ass = archivio_attr.get("D0").as_date();
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename output_path_att = genera_path("attrezzature");
|
||||||
|
attrezzature.save_as(output_path_att, fmt_text);
|
||||||
|
|
||||||
|
|
||||||
|
//esporta lo storico attrezzature (tabella &HAHIS)
|
||||||
|
TEsporta_storico_attrezzature_recordset storico;
|
||||||
|
|
||||||
|
//deve esportare solo lo storico delle attrezzature legate ad un cliente non nullo e relative al cliente stesso..
|
||||||
|
//..escludendo quindi lo storico dell'attrezzatura che non compete al cliente che l'ha attualmente in uso
|
||||||
|
query.cut(0);
|
||||||
|
query << "USE &HAHIS";
|
||||||
|
query << "\nSELECT (401@->I0>0)&&(401@->I0=I0)";
|
||||||
|
query << "\nJOIN &HAATT ALIAS 401 INTO CODTAB=CODTAB[1,12]";
|
||||||
|
|
||||||
|
TISAM_recordset archivio_storico(query);
|
||||||
|
const long archivio_storico_items = archivio_storico.items();
|
||||||
|
|
||||||
|
TProgind progind_sto(archivio_storico_items, "Storico interventi...", false, true);
|
||||||
|
for (bool ok = archivio_storico.move_first(); ok; ok = archivio_storico.move_next())
|
||||||
|
{
|
||||||
|
progind_sto.addstatus(1);
|
||||||
|
|
||||||
|
storico.new_rec("");
|
||||||
|
|
||||||
|
const long codcf = archivio_storico.get("I0").as_int();
|
||||||
|
storico.set("CodiceTerminale", hd_find_codag(codcf));
|
||||||
|
storico.set("CodiceArticolo", archivio_storico.get("CODTAB[1,5]"));
|
||||||
|
storico.set("Progressivo", archivio_storico.get("CODTAB[6,12]").as_int());
|
||||||
|
storico.set("ProgrIntervento", archivio_storico.get("CODTAB[13,17]").as_int());
|
||||||
|
TDate data_int = archivio_storico.get("D0").as_date();
|
||||||
|
storico.set("DataIntervento", hd_format_date8(data_int));
|
||||||
|
storico.set("TipoIntervento", archivio_storico.get("S7[1,1]"));
|
||||||
|
storico.set("DescrIntervento", archivio_storico.get("S0"));
|
||||||
|
storico.set("CodArtIntervento", archivio_storico.get("S3[1,5]"));
|
||||||
|
storico.set("UnitaMisura", archivio_storico.get("S6[1,2]"));
|
||||||
|
real qta = archivio_storico.get("R0").as_real();
|
||||||
|
qta *= CENTO;
|
||||||
|
qta.round();
|
||||||
|
storico.set("Quantita", qta);
|
||||||
|
real importo = archivio_storico.get("R1").as_real();
|
||||||
|
importo *= CENTO;
|
||||||
|
importo.round();
|
||||||
|
storico.set("Importo", importo);
|
||||||
|
storico.set("ChiusuraComodato", archivio_storico.get("B0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename output_path_sto = genera_path("storico");
|
||||||
|
storico.save_as(output_path_sto, fmt_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
33
ha/halib.cpp
33
ha/halib.cpp
@ -329,15 +329,36 @@ TEsporta_attrezzature_recordset::TEsporta_attrezzature_recordset(int rec_length)
|
|||||||
: THardy_recordset(rec_length)
|
: THardy_recordset(rec_length)
|
||||||
{
|
{
|
||||||
add_field("CodiceTerminale", T_N, 1, 3);
|
add_field("CodiceTerminale", T_N, 1, 3);
|
||||||
add_field("CodiceCliente", T_N, 4, 6);
|
add_field("CodiceArticolo", T_X, 4, 5);
|
||||||
add_field("CodiceArticolo", T_X, 10, 5);
|
add_field("Progressivo", T_N, 9, 7);
|
||||||
add_field("MatricolaAttrezz", T_X, 15, 12);
|
add_field("Matricola", T_X, 16, 15);
|
||||||
add_field("DescrAttrezz", T_X, 27, 30);
|
add_field("DescrAttrezz", T_X, 31, 50);
|
||||||
add_field("DataConsegna", T_X, 57, 6);
|
add_field("CodiceCliente", T_N, 81, 6);
|
||||||
add_field("Quantita", T_N, 63, 7);
|
add_field("CodiceSedeCliente",T_N, 87, 3);
|
||||||
|
add_field("DataAssegnamento", T_X, 90, 8);
|
||||||
|
add_field("DataFabbricazione",T_X, 98, 8);
|
||||||
add_eol_field();
|
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
|
//Pagamenti
|
||||||
//---------------
|
//---------------
|
||||||
|
10
ha/halib.h
10
ha/halib.h
@ -200,7 +200,15 @@ public:
|
|||||||
class TEsporta_attrezzature_recordset : public THardy_recordset
|
class TEsporta_attrezzature_recordset : public THardy_recordset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TEsporta_attrezzature_recordset(int rec_length = 71);
|
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 ()
|
//Pagamenti ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user