Patch level : 10.0 902
Files correlati : ci0.exe ci2.exe Ricompilazione Demo : [ ] Commento : Importazione ora da TeamSystem git-svn-id: svn://10.65.10.50/branches/R_10_00@21587 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
62c6a44421
commit
e5b28ab849
@ -168,8 +168,8 @@ void TDisp_risoatt_msk::riempi_sheet()
|
|||||||
TDate d(drakey.mid(17, 8));
|
TDate d(drakey.mid(17, 8));
|
||||||
riga.add(d.string(), sheet.cid2index(S_DATA));
|
riga.add(d.string(), sheet.cid2index(S_DATA));
|
||||||
riga.add(drakey.right(2), sheet.cid2index(S_TPORA));
|
riga.add(drakey.right(2), sheet.cid2index(S_TPORA));
|
||||||
riga.add(disp.ore_prev(), sheet.cid2index(S_OREPREV));
|
riga.add(disp.ore_prev().string(), sheet.cid2index(S_OREPREV));
|
||||||
riga.add(disp.ore_cons(), sheet.cid2index(S_ORECONS));
|
riga.add(disp.ore_cons().string(), sheet.cid2index(S_ORECONS));
|
||||||
sheet.check_row(sheet.items() - 1);
|
sheet.check_row(sheet.items() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,8 +265,8 @@ void TDisp_risoatt_msk::registra()
|
|||||||
key << add_field_to_tab_key(riga, S_DATA);
|
key << add_field_to_tab_key(riga, S_DATA);
|
||||||
key << add_field_to_tab_key(riga, S_TPORA);
|
key << add_field_to_tab_key(riga, S_TPORA);
|
||||||
const TString80 descr = risorsa ? riga.get(sheet.cid2index(S_DESRIS)) : riga.get(sheet.cid2index(S_DESATT));
|
const TString80 descr = risorsa ? riga.get(sheet.cid2index(S_DESRIS)) : riga.get(sheet.cid2index(S_DESATT));
|
||||||
const int oreprev = riga.get_int(sheet.cid2index(S_OREPREV));
|
const real oreprev(riga.get(sheet.cid2index(S_OREPREV)));
|
||||||
const int orecons = riga.get_int(sheet.cid2index(S_ORECONS));
|
const real orecons(riga.get(sheet.cid2index(S_ORECONS)));
|
||||||
|
|
||||||
tab.put("CODTAB", key);
|
tab.put("CODTAB", key);
|
||||||
int err = tab.read();
|
int err = tab.read();
|
||||||
@ -276,8 +276,8 @@ void TDisp_risoatt_msk::registra()
|
|||||||
tab.remove();
|
tab.remove();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tab.put("I0", oreprev);
|
tab.put("R0", oreprev);
|
||||||
tab.put("I1", orecons);
|
tab.put("R1", orecons);
|
||||||
tab.rewrite();
|
tab.rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,8 +286,8 @@ void TDisp_risoatt_msk::registra()
|
|||||||
tab.zero();
|
tab.zero();
|
||||||
tab.put("CODTAB", key);
|
tab.put("CODTAB", key);
|
||||||
tab.put("D0", riga.get(sheet.cid2index(S_DATA)));
|
tab.put("D0", riga.get(sheet.cid2index(S_DATA)));
|
||||||
tab.put("I0", oreprev);
|
tab.put("R0", oreprev);
|
||||||
tab.put("I1", orecons);
|
tab.put("R1", orecons);
|
||||||
tab.write();
|
tab.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,8 +137,8 @@ BEGIN
|
|||||||
ITEM "Codice@16"
|
ITEM "Codice@16"
|
||||||
ITEM "Data@10"
|
ITEM "Data@10"
|
||||||
ITEM "Tipo\nOra@5"
|
ITEM "Tipo\nOra@5"
|
||||||
ITEM "Ore\npreventivo@12"
|
ITEM "Ore\npreventivo"
|
||||||
ITEM "Ore\nconsuntivo@12"
|
ITEM "Ore\nconsuntivo"
|
||||||
ITEM "Descrizione@50"
|
ITEM "Descrizione@50"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -227,12 +227,12 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER S_OREPREV 6
|
NUMBER S_OREPREV 7 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 30 8 "Ore a Preventivo "
|
PROMPT 30 8 "Ore a Preventivo "
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER S_ORECONS 6
|
NUMBER S_ORECONS 7 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 55 8 "a Consuntivo "
|
PROMPT 55 8 "a Consuntivo "
|
||||||
END
|
END
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
//Classe TDef_risoatt_msk
|
//Classe TDef_risoatt_msk
|
||||||
class TDef_risoatt_msk : public TAutomask
|
class TDef_risoatt_msk : public TAutomask
|
||||||
{
|
{
|
||||||
int _qtaore;
|
|
||||||
short _cdc_sid, _cdc_lid;
|
short _cdc_sid, _cdc_lid;
|
||||||
short _cms_sid, _cms_lid;
|
short _cms_sid, _cms_lid;
|
||||||
short _fase_sid, _fase_lid;
|
short _fase_sid, _fase_lid;
|
||||||
@ -335,10 +334,7 @@ void TDef_risoatt_msk::azzera_riga(TSheet_field& sheet)
|
|||||||
const int nriga = sheet.selected();
|
const int nriga = sheet.selected();
|
||||||
TToken_string& row = sheet.row(nriga);
|
TToken_string& row = sheet.row(nriga);
|
||||||
|
|
||||||
row.add(0, sheet.cid2index(S_QTAORE));
|
|
||||||
|
|
||||||
TMask& msk = sheet.sheet_mask();
|
TMask& msk = sheet.sheet_mask();
|
||||||
_qtaore = msk.get_int(S_QTAORE);
|
|
||||||
msk.set(S_DEL, "X");
|
msk.set(S_DEL, "X");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +373,7 @@ void TDef_risoatt_msk::registra()
|
|||||||
TString80 codcosto;
|
TString80 codcosto;
|
||||||
TString80 codcms;
|
TString80 codcms;
|
||||||
TString80 codfase;
|
TString80 codfase;
|
||||||
const int qtaore = riga.get_int(sheet.cid2index(S_QTAORE));
|
const real qtaore(riga.get(sheet.cid2index(S_QTAORE)));
|
||||||
const real costo(riga.get(sheet.cid2index(S_COSTO)));
|
const real costo(riga.get(sheet.cid2index(S_COSTO)));
|
||||||
|
|
||||||
get_row_anal_fields(riga, codcosto, codcms, codfase);
|
get_row_anal_fields(riga, codcosto, codcms, codfase);
|
||||||
@ -459,19 +455,12 @@ bool TDef_risoatt_msk::on_field_event(TOperable_field& f, TField_event e, long j
|
|||||||
{
|
{
|
||||||
TSheet_field& sheet = sfield(F_SHEET);
|
TSheet_field& sheet = sfield(F_SHEET);
|
||||||
TMask& msk = sheet.sheet_mask();
|
TMask& msk = sheet.sheet_mask();
|
||||||
const int qtaore = msk.get_int(S_QTAORE);
|
|
||||||
|
|
||||||
if(sheet.selected() == sheet.items() - 1)
|
if (sheet.selected() == sheet.items() - 1)
|
||||||
{
|
{
|
||||||
sheet.destroy(sheet.items() - 1);
|
sheet.destroy(sheet.items() - 1);
|
||||||
sheet.force_update();
|
sheet.force_update();
|
||||||
}
|
}
|
||||||
else if(_qtaore > 0)
|
|
||||||
{
|
|
||||||
TToken_string& row = sheet.row(sheet.selected());
|
|
||||||
row.add(_qtaore, sheet.cid2index(S_QTAORE));
|
|
||||||
_qtaore = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_ANNO:
|
case F_ANNO:
|
||||||
@ -677,7 +666,6 @@ TDef_risoatt_msk::TDef_risoatt_msk()
|
|||||||
else
|
else
|
||||||
s.delete_column(id);
|
s.delete_column(id);
|
||||||
}
|
}
|
||||||
_qtaore = 0;
|
|
||||||
_dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS", "G");
|
_dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS", "G");
|
||||||
|
|
||||||
if (_dett == "A")
|
if (_dett == "A")
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
//Classe TRilevamento_prev_msk
|
//Classe TRilevamento_prev_msk
|
||||||
class TRilevamento_prev_msk : public TAutomask
|
class TRilevamento_prev_msk : public TAutomask
|
||||||
{
|
{
|
||||||
int _qtaore;
|
|
||||||
short _cdc_sid, _cdc_lid;
|
short _cdc_sid, _cdc_lid;
|
||||||
short _cms_sid, _cms_lid;
|
short _cms_sid, _cms_lid;
|
||||||
short _fase_sid, _fase_lid;
|
short _fase_sid, _fase_lid;
|
||||||
@ -566,7 +565,7 @@ void TRilevamento_prev_msk::registra()
|
|||||||
TString80 codcosto;
|
TString80 codcosto;
|
||||||
TString80 codcms;
|
TString80 codcms;
|
||||||
TString80 codfase;
|
TString80 codfase;
|
||||||
const int qtaore = riga.get_int(sheet.cid2index(S_QTAORE));
|
const real qtaore(riga.get(sheet.cid2index(S_QTAORE)));
|
||||||
const TString8 codlist = riga.get(sheet.cid2index(S_CODLIST));
|
const TString8 codlist = riga.get(sheet.cid2index(S_CODLIST));
|
||||||
const real costo(riga.get(sheet.cid2index(S_COSTO)));
|
const real costo(riga.get(sheet.cid2index(S_COSTO)));
|
||||||
|
|
||||||
@ -910,7 +909,6 @@ TRilevamento_prev_msk::TRilevamento_prev_msk()
|
|||||||
else
|
else
|
||||||
s.delete_column(id);
|
s.delete_column(id);
|
||||||
}
|
}
|
||||||
_qtaore = 0;
|
|
||||||
_numpr = ini_get_string(CONFIG_DITTA, "ci", "CODNUMPR");
|
_numpr = ini_get_string(CONFIG_DITTA, "ci", "CODNUMPR");
|
||||||
_tipopr = ini_get_string(CONFIG_DITTA, "ci", "TIPODOCPR");
|
_tipopr = ini_get_string(CONFIG_DITTA, "ci", "TIPODOCPR");
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ BEGIN
|
|||||||
ITEM "CDC10"
|
ITEM "CDC10"
|
||||||
ITEM "CDC11"
|
ITEM "CDC11"
|
||||||
ITEM "CDC12"
|
ITEM "CDC12"
|
||||||
ITEM "Ore@5"
|
ITEM "Ore@7"
|
||||||
ITEM "Listino"
|
ITEM "Listino"
|
||||||
ITEM "Costo@10"
|
ITEM "Costo@10"
|
||||||
ITEM "Descrizione@50"
|
ITEM "Descrizione@50"
|
||||||
@ -305,7 +305,7 @@ BEGIN
|
|||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER S_QTAORE 6
|
NUMBER S_QTAORE 7 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 11 "Ore "
|
PROMPT 2 11 "Ore "
|
||||||
END
|
END
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
//Classe TRilevamento_cons_msk
|
//Classe TRilevamento_cons_msk
|
||||||
class TRilevamento_cons_msk : public TAutomask
|
class TRilevamento_cons_msk : public TAutomask
|
||||||
{
|
{
|
||||||
int _qtaore;
|
|
||||||
short _cdc_sid, _cdc_lid;
|
short _cdc_sid, _cdc_lid;
|
||||||
short _cms_sid, _cms_lid;
|
short _cms_sid, _cms_lid;
|
||||||
short _fase_sid, _fase_lid;
|
short _fase_sid, _fase_lid;
|
||||||
@ -601,7 +600,7 @@ void TRilevamento_cons_msk::update_disp()
|
|||||||
real oredisp;
|
real oredisp;
|
||||||
|
|
||||||
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
||||||
oredisp += def.cursor()->curr().get_real(RILORE_QTAORE);
|
oredisp += def.cursor()->curr().get_real("R1");
|
||||||
set(F_OREDIS, oredisp);
|
set(F_OREDIS, oredisp);
|
||||||
_oredisp.add(chiave, oredisp);
|
_oredisp.add(chiave, oredisp);
|
||||||
}
|
}
|
||||||
@ -700,7 +699,7 @@ void TRilevamento_cons_msk::update_prev()
|
|||||||
real oreprev;
|
real oreprev;
|
||||||
|
|
||||||
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
||||||
oreprev += def.cursor()->curr().get_int(RILORE_QTAORE);
|
oreprev += def.cursor()->curr().get_real(RILORE_QTAORE);
|
||||||
row.add(oreprev.string(), sf.cid2index(S_OREPREV));
|
row.add(oreprev.string(), sf.cid2index(S_OREPREV));
|
||||||
sf.force_update(r);
|
sf.force_update(r);
|
||||||
_oreprev.add(chiave, oreprev);
|
_oreprev.add(chiave, oreprev);
|
||||||
@ -857,7 +856,7 @@ void TRilevamento_cons_msk::registra()
|
|||||||
const char tipora = riga.get_char(sheet.cid2index(S_RISOATT));
|
const char tipora = riga.get_char(sheet.cid2index(S_RISOATT));
|
||||||
const TString16 codice = tipora == 'R' ? riga.get(sheet.cid2index(S_CODRIS)) : riga.get(sheet.cid2index(S_CODATT));
|
const TString16 codice = tipora == 'R' ? riga.get(sheet.cid2index(S_CODRIS)) : riga.get(sheet.cid2index(S_CODATT));
|
||||||
const TString4 tpora = riga.get(sheet.cid2index(S_TPORA));
|
const TString4 tpora = riga.get(sheet.cid2index(S_TPORA));
|
||||||
const int qtaore = riga.get_int(sheet.cid2index(S_QTAORE));
|
const real qtaore(riga.get(sheet.cid2index(S_QTAORE)));
|
||||||
const long id = riga.get_long(sheet.cid2index(S_ID));
|
const long id = riga.get_long(sheet.cid2index(S_ID));
|
||||||
const TString8 codlist = riga.get(sheet.cid2index(S_CODLIST));
|
const TString8 codlist = riga.get(sheet.cid2index(S_CODLIST));
|
||||||
const real costo(riga.get(sheet.cid2index(S_COSTO)));
|
const real costo(riga.get(sheet.cid2index(S_COSTO)));
|
||||||
@ -1260,7 +1259,6 @@ TRilevamento_cons_msk::TRilevamento_cons_msk()
|
|||||||
else
|
else
|
||||||
s.delete_column(id);
|
s.delete_column(id);
|
||||||
}
|
}
|
||||||
_qtaore = 0;
|
|
||||||
const TString4 dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS");
|
const TString4 dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS");
|
||||||
TSheet_field & sc = sfield(F_CALENDARIO);
|
TSheet_field & sc = sfield(F_CALENDARIO);
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ BEGIN
|
|||||||
ITEM "CDC10"
|
ITEM "CDC10"
|
||||||
ITEM "CDC11"
|
ITEM "CDC11"
|
||||||
ITEM "CDC12"
|
ITEM "CDC12"
|
||||||
ITEM "Ore@5"
|
ITEM "Ore@7"
|
||||||
ITEM "Listino"
|
ITEM "Listino"
|
||||||
ITEM "Costo@6"
|
ITEM "Costo@6"
|
||||||
ITEM "Ore Prev."
|
ITEM "Ore Prev."
|
||||||
@ -327,7 +327,7 @@ BEGIN
|
|||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER S_QTAORE 6
|
NUMBER S_QTAORE 7 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 11 "Quantitŕ ore "
|
PROMPT 2 11 "Quantitŕ ore "
|
||||||
END
|
END
|
||||||
|
269
ci/ci2300.cpp
269
ci/ci2300.cpp
@ -3,9 +3,11 @@
|
|||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <recset.h>
|
#include <recset.h>
|
||||||
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <textset.h>
|
#include <textset.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
#include <reputils.h>
|
||||||
|
|
||||||
#include <doc.h>
|
#include <doc.h>
|
||||||
|
|
||||||
@ -15,19 +17,31 @@
|
|||||||
#include "rilore.h"
|
#include "rilore.h"
|
||||||
#include "../ca/calib01.h"
|
#include "../ca/calib01.h"
|
||||||
#include "../ve/velib.h"
|
#include "../ve/velib.h"
|
||||||
|
#define OREORD "OREORD"
|
||||||
|
#define CODGIU "CODGIU"
|
||||||
|
#define OREGIU "OREGIU"
|
||||||
|
|
||||||
#define T_N "N"
|
#define T_N "N"
|
||||||
#define T_X "X"
|
#define T_X "X"
|
||||||
|
|
||||||
class TImporta_recordset : public TAS400_recordset
|
//Classe TImporta_fat_rec
|
||||||
|
class TImporta_rilore_rec : public TAS400_recordset
|
||||||
{
|
{
|
||||||
public:
|
protected:
|
||||||
|
virtual TRecnotype new_rec(const char* trc);
|
||||||
void add_field(const char* name, const char* tipo, int pos, int len);
|
void add_field(const char* name, const char* tipo, int pos, int len);
|
||||||
TImporta_recordset(const int rec_length);
|
|
||||||
|
public:
|
||||||
|
TImporta_rilore_rec(TFilename& filename);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////
|
||||||
|
// Recordset specifici per i dati da trasferire INPUT
|
||||||
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//ADD_FIELD: aggiunge i campi al recordset
|
//ADD_FIELD: aggiunge i campi al recordset
|
||||||
void TImporta_recordset::add_field(const char* name, const char* tipo, int pos, int len)
|
|
||||||
|
void TImporta_rilore_rec::add_field(const char* name, const char* tipo, int pos, int len)
|
||||||
{
|
{
|
||||||
//CHECK(name[1]=='.', "Campo orfano di tracciato");
|
//CHECK(name[1]=='.', "Campo orfano di tracciato");
|
||||||
const TFixed_string str_tipo(tipo);
|
const TFixed_string str_tipo(tipo);
|
||||||
@ -37,50 +51,24 @@ void TImporta_recordset::add_field(const char* name, const char* tipo, int pos,
|
|||||||
create_field(name, -1, len, ft);
|
create_field(name, -1, len, ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
//costruttore
|
|
||||||
TImporta_recordset::TImporta_recordset(const int rec_lenght)
|
|
||||||
: TAS400_recordset("AS400()")
|
|
||||||
{
|
|
||||||
TString16 query;
|
|
||||||
query << "AS400(" << rec_lenght << ")";
|
|
||||||
TFilename cazzone;
|
|
||||||
parse_query(query, cazzone);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Classe TImporta_fat_rec
|
|
||||||
class TImporta_rilore_rec : public TImporta_recordset
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
virtual TRecnotype new_rec(const char* trc);
|
|
||||||
|
|
||||||
public:
|
|
||||||
TImporta_rilore_rec(const TFilename& filename);
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////
|
|
||||||
// Recordset specifici per i dati da trasferire INPUT
|
|
||||||
/////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
TRecnotype TImporta_rilore_rec::new_rec(const char* trc)
|
TRecnotype TImporta_rilore_rec::new_rec(const char* trc)
|
||||||
{
|
{
|
||||||
if (trc && *trc > ' ')
|
if (trc && *trc > ' ')
|
||||||
{
|
{
|
||||||
TString rec; rec << trc << "\r\n";
|
TString rec; rec << trc;
|
||||||
return TText_recordset::new_rec(rec);
|
return TText_recordset::new_rec(rec);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//questo invece è il metodo magico che vale per il caricamento da file esterno
|
//questo invece è il metodo magico che vale per il caricamento da file esterno
|
||||||
TImporta_rilore_rec::TImporta_rilore_rec(const TFilename& filename)
|
TImporta_rilore_rec::TImporta_rilore_rec(TFilename& filename)
|
||||||
: TImporta_recordset(1707)
|
: TAS400_recordset(TString("AS400(1707)") << filename)
|
||||||
{
|
{
|
||||||
TFilename cazzone;
|
|
||||||
parse_query("AS400(1707)", cazzone);
|
|
||||||
|
|
||||||
add_field("CODAZI", T_N, -1, 4);
|
add_field("CODAZI", T_N, -1, 4);
|
||||||
add_field("CODFIL", T_N, -1, 2);
|
add_field("CODFIL", T_N, -1, 2);
|
||||||
add_field("MATR", T_N, -1, 9);
|
add_field("MATR", T_X, -1, 9);
|
||||||
add_field("COGNOME", T_X, -1, 34);
|
add_field("COGNOME", T_X, -1, 34);
|
||||||
add_field("NOME", T_X, -1, 34);
|
add_field("NOME", T_X, -1, 34);
|
||||||
add_field("DADATA", T_X, -1, 6);
|
add_field("DADATA", T_X, -1, 6);
|
||||||
@ -530,127 +518,101 @@ TImporta_rilore_rec::TImporta_rilore_rec(const TFilename& filename)
|
|||||||
//Classe TRilevamento_imp_msk
|
//Classe TRilevamento_imp_msk
|
||||||
class TImporta_rilore_msk : public TAutomask
|
class TImporta_rilore_msk : public TAutomask
|
||||||
{
|
{
|
||||||
|
TAssoc_array _matricole;
|
||||||
|
TAssoc_array _ore;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const real proponi_costo(TToken_string& riga);
|
|
||||||
|
|
||||||
void importa();
|
void importa();
|
||||||
|
|
||||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
TAssoc_array & matricole() {return _matricole;}
|
||||||
|
TAssoc_array & ore() {return _ore;}
|
||||||
|
|
||||||
TImporta_rilore_msk();
|
TImporta_rilore_msk();
|
||||||
};
|
};
|
||||||
|
|
||||||
const real TImporta_rilore_msk::proponi_costo(TToken_string& riga)
|
|
||||||
{
|
|
||||||
/*real costo = ZERO;
|
|
||||||
TSheet_field& sheet = sfield(F_SHEET);
|
|
||||||
const char tipo = riga.get_char(sheet.cid2index(S_RISOATT));
|
|
||||||
TString80 codice;
|
|
||||||
switch(tipo)
|
|
||||||
{
|
|
||||||
case 'R': codice = riga.get(sheet.cid2index(S_CODRIS)); break;
|
|
||||||
case 'A': codice = riga.get(sheet.cid2index(S_CODATT)); break;
|
|
||||||
default : break;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int anno = get_int(F_ANNO);
|
|
||||||
const TString4 mese = get(F_MESE);
|
|
||||||
const TString4 tpora = riga.get(sheet.cid2index(S_TPORA));
|
|
||||||
|
|
||||||
const TRisoatt_key chiave(tipo, codice, anno, mese, tpora);
|
|
||||||
const TRectype & roa = cache().get("&ROA", chiave);
|
|
||||||
|
|
||||||
if(!roa.empty())
|
|
||||||
costo = roa.get_real("R1");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TString8 tmp; tmp << anno << mese;
|
|
||||||
const long anme = atol(tmp);
|
|
||||||
TString query;
|
|
||||||
query << "USE &ROA\n"
|
|
||||||
<< "SELECT I0<" << anme << "\n"
|
|
||||||
<< "FROM CODTAB=" << tipo << codice.left_just(16) << "\n"
|
|
||||||
<< "TO CODTAB=" << tipo << codice.left_just(16) << "\n"
|
|
||||||
<< "BY I0\n";
|
|
||||||
TISAM_recordset rec(query);
|
|
||||||
|
|
||||||
if(rec.move_last())
|
|
||||||
costo = rec.cursor()->curr().get_real("R1");
|
|
||||||
}
|
|
||||||
return costo;*/
|
|
||||||
return ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TImporta_rilore_msk::importa()
|
void TImporta_rilore_msk::importa()
|
||||||
{
|
{
|
||||||
TFilename file = get(F_FILE);
|
TFilename file = get(F_FILE);
|
||||||
|
|
||||||
TImporta_rilore_rec recordset(file);
|
TImporta_rilore_rec recordset(file);
|
||||||
|
|
||||||
TLocalisamfile rilore(LF_RILORE);
|
TModule_table tab("&DRA");
|
||||||
|
|
||||||
TString8 data = recordset.get("DADATA").as_string();
|
TString matricola;
|
||||||
TString4 anno = "20"; anno << data.right(2);
|
TString16 codice;
|
||||||
const TDate dadata(atoi(data.left(2)), atoi(data.mid(2, 2)), atoi(anno));
|
TString80 key;
|
||||||
|
TString16 fieldname;
|
||||||
|
TString tpora;
|
||||||
|
real oreril;
|
||||||
|
|
||||||
data = recordset.get("ADATA").as_string();
|
TProgind pi(recordset.items(), TR("Importazione ore"), true, true);
|
||||||
anno = "20"; anno << data.right(2);
|
TLog_report log(TR("Importazione ore"));
|
||||||
|
|
||||||
const TDate adata(atoi(data.left(2)), atoi(data.mid(2, 2)), atoi(anno));
|
for (bool ok = recordset.move_first(); ok && !pi.iscancelled() ; ok = recordset.move_next())
|
||||||
|
{
|
||||||
|
pi.addstatus(1L);
|
||||||
|
matricola = recordset.get("MATR").as_string();
|
||||||
|
const TString16 s = recordset.get("DADATA").as_string();
|
||||||
|
TDate data(atoi(s.left(2)), atoi(s.mid(2, 2)), 2000 + atoi(s.right(2)));
|
||||||
|
|
||||||
for(int i = 1; i <= 31; i++)
|
if (matricole().is_key(matricola))
|
||||||
{
|
{
|
||||||
int tmp = i - 1;
|
codice = (TString &) matricole()[matricola];
|
||||||
TDate dt = dadata + tmp;
|
codice.rpad(16);
|
||||||
if(dt <= adata)
|
int err = NOERR;
|
||||||
{
|
|
||||||
rilore.put(RILORE_TIPO, 'C');
|
|
||||||
rilore.put(RILORE_TIPORA, 'A');
|
|
||||||
rilore.put(RILORE_CODICE, recordset.get("MATR").as_string());
|
|
||||||
rilore.put(RILORE_ANNO, dt.year());
|
|
||||||
rilore.put(RILORE_MESE, dt.month());
|
|
||||||
rilore.put(RILORE_GIORNO, dt.day());
|
|
||||||
|
|
||||||
TString4 giorno;
|
|
||||||
if(i < 10)
|
|
||||||
giorno << '0';
|
|
||||||
giorno << i;
|
|
||||||
|
|
||||||
TString16 campo = giorno; campo << "_OREORD";
|
for(int i = 1; i <= 31; i++)
|
||||||
const int oreord = recordset.get(campo).as_int();
|
{
|
||||||
|
key = "R";
|
||||||
|
tpora = "0000";
|
||||||
|
if (ore().is_key(tpora))
|
||||||
|
tpora = (TString &) ore()[tpora];
|
||||||
|
|
||||||
|
key << codice << data.string(ANSI) << tpora; // cambiare
|
||||||
|
tab.put("CODTAB", key);
|
||||||
|
tab.put("D0", data);
|
||||||
|
fieldname.format("%02d_%s", i, OREORD);
|
||||||
|
oreril = recordset.get(fieldname).as_real() / CENTO;
|
||||||
|
if (oreril > ZERO)
|
||||||
|
{
|
||||||
|
tab.put("R1", oreril);
|
||||||
|
err = tab.write_rewrite();
|
||||||
|
if (err != NOERR)
|
||||||
|
log.log(2, format(FR("Errore di scrittura %d : Codice %s data %s ore normali"), err, (const char *) codice, (const char *) data.string()));
|
||||||
|
}
|
||||||
|
for (int t = 1; t <= 6; t++)
|
||||||
|
{
|
||||||
|
fieldname.format("%02d_%s%1d", i, CODGIU, t);
|
||||||
|
tpora = recordset.get(fieldname).as_string();
|
||||||
|
if (ore().is_key(tpora))
|
||||||
|
{
|
||||||
|
tpora = (TString &) ore()[tpora];
|
||||||
|
fieldname.format("%02d_%s%1d", i, OREGIU, t);
|
||||||
|
oreril = recordset.get(fieldname).as_real() / CENTO;
|
||||||
|
|
||||||
rilore.put(RILORE_TPORA, 1); //ore ordinarie, da decodificare
|
if (tpora.full() && oreril > ZERO)
|
||||||
rilore.put(RILORE_QTAORE, oreord);
|
{
|
||||||
|
key = "R";
|
||||||
rilore.rewrite_write();
|
key << codice << data.string(ANSI) << tpora;
|
||||||
|
tab.put("CODTAB", key);
|
||||||
for(int j = 1; j <= 6; j++)
|
tab.put("D0", data);
|
||||||
{
|
tab.put("R1", oreril);
|
||||||
rilore.put(RILORE_TIPO, 'C');
|
err = tab.write_rewrite();
|
||||||
rilore.put(RILORE_TIPORA, 'A');
|
if (err != NOERR)
|
||||||
rilore.put(RILORE_CODICE, recordset.get("MATR").as_string());
|
log.log(2, format(FR("Errore di scrittura %d : Codice %s data %s ore %s"), err, (const char *) codice, (const char *) data.string(), (const char *) tpora));
|
||||||
rilore.put(RILORE_ANNO, dt.year());
|
}
|
||||||
rilore.put(RILORE_MESE, dt.month());
|
}
|
||||||
rilore.put(RILORE_GIORNO, dt.day());
|
}
|
||||||
|
++data;
|
||||||
campo.cut(0);
|
}
|
||||||
campo << giorno << "_CODGIU" << j;
|
}
|
||||||
const int codgiu = recordset.get(campo).as_int();
|
else
|
||||||
|
log.log(2, format(FR("Ma tricola % s assente"), (const char *) matricola));
|
||||||
campo.cut(0);
|
}
|
||||||
campo << giorno << "_OREGIU" << j;
|
log.print_or_preview();
|
||||||
const int oregiu = recordset.get(campo).as_int();
|
|
||||||
|
|
||||||
if(oregiu > 0)
|
|
||||||
{
|
|
||||||
rilore.put(RILORE_TPORA, codgiu);
|
|
||||||
rilore.put(RILORE_QTAORE, oregiu);
|
|
||||||
rilore.rewrite_write();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//ON_FIELD_EVENT: metodo che gestisce gli eventi sui vari campi della maschera
|
//ON_FIELD_EVENT: metodo che gestisce gli eventi sui vari campi della maschera
|
||||||
@ -685,12 +647,49 @@ TImporta_rilore_msk::TImporta_rilore_msk()
|
|||||||
class TImporta_rilore__app : public TSkeleton_application
|
class TImporta_rilore__app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static bool scan_rss(const TRelation & rel, void *pJolly)
|
||||||
|
{
|
||||||
|
TImporta_rilore_msk & mask = *((TImporta_rilore_msk *)pJolly);
|
||||||
|
TString80 matricola = rel.curr().get("S3");
|
||||||
|
|
||||||
|
matricola = matricola.mid(20,20);
|
||||||
|
matricola = matricola.trim();
|
||||||
|
if (matricola.full())
|
||||||
|
{
|
||||||
|
const TString16 codice = rel.curr().get("CODTAB");
|
||||||
|
|
||||||
|
mask.matricole().add(matricola, codice);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
static bool scan_ore(const TRelation & rel, void *pJolly)
|
||||||
|
{
|
||||||
|
TImporta_rilore_msk & mask = *((TImporta_rilore_msk *)pJolly);
|
||||||
|
TString80 cod_est = rel.curr().get("S1");
|
||||||
|
|
||||||
|
if (cod_est.full())
|
||||||
|
{
|
||||||
|
const TString16 codice = rel.curr().get("CODTAB");
|
||||||
|
|
||||||
|
mask.ore().add(cod_est, codice);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void TImporta_rilore__app::main_loop()
|
void TImporta_rilore__app::main_loop()
|
||||||
{
|
{
|
||||||
TImporta_rilore_msk msk;
|
TImporta_rilore_msk msk;
|
||||||
|
TRelation rrss("RSS");
|
||||||
|
TCursor crss(&rrss);
|
||||||
|
|
||||||
|
crss.scan(scan_rss, (void *) &msk);
|
||||||
|
TRelation rore("&ORE");
|
||||||
|
TCursor core(&rore);
|
||||||
|
|
||||||
|
core.scan(scan_ore, (void *) &msk);
|
||||||
while (msk.run() != K_QUIT) ;
|
while (msk.run() != K_QUIT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,17 +12,16 @@ STRING DLG_PROFILE 50
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 9 -12 "Profilo "
|
PROMPT 9 -12 "Profilo "
|
||||||
PSELECT
|
PSELECT
|
||||||
FLAGS "H"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 3
|
GROUPBOX DLG_NULL 78 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "@bOrigine dati"
|
PROMPT 1 1 "@bSorgente"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_FILE 64
|
STRING F_FILE 64
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Nome "
|
PROMPT 2 2 "File "
|
||||||
FSELECT "*.*"
|
FSELECT "*.*"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
FIELD FILE
|
FIELD FILE
|
||||||
|
@ -665,15 +665,15 @@ void TDisp_risoatt::set_id(long id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//VALUNI: metodo che restituisce il valore unitario contenuto nella tabella di modulo
|
//VALUNI: metodo che restituisce il valore unitario contenuto nella tabella di modulo
|
||||||
const int TDisp_risoatt::ore_prev() const
|
const real TDisp_risoatt::ore_prev() const
|
||||||
{
|
{
|
||||||
return get_int("I0");
|
return get_real("R0");
|
||||||
}
|
}
|
||||||
|
|
||||||
//VALUNI: metodo che restituisce il valore unitario contenuto nella tabella di modulo
|
//VALUNI: metodo che restituisce il valore unitario contenuto nella tabella di modulo
|
||||||
const int TDisp_risoatt::ore_cons() const
|
const real TDisp_risoatt::ore_cons() const
|
||||||
{
|
{
|
||||||
return get_int("I1");
|
return get_real("R1");
|
||||||
}
|
}
|
||||||
|
|
||||||
//costruttore
|
//costruttore
|
||||||
|
@ -212,8 +212,8 @@ public:
|
|||||||
|
|
||||||
const TString& chiave() const;
|
const TString& chiave() const;
|
||||||
const long id() const;
|
const long id() const;
|
||||||
const int ore_prev() const;
|
const real ore_prev() const;
|
||||||
const int ore_cons() const;
|
const real ore_cons() const;
|
||||||
|
|
||||||
void set_id(long id);
|
void set_id(long id);
|
||||||
//costruttore
|
//costruttore
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
//campi maschera citbore (Tabella Tipologia Ore)
|
//campi maschera citbore (Tabella Tipologia Ore)
|
||||||
#define F_COD_ORA 101
|
#define F_COD_ORA 101
|
||||||
#define F_DES_ORA 102
|
#define F_DES_ORA 102
|
||||||
|
#define F_COD_EST 103
|
||||||
|
@ -13,7 +13,7 @@ END
|
|||||||
|
|
||||||
STRING F_COD_ORA 2
|
STRING F_COD_ORA 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 "Codice "
|
PROMPT 2 2 "Codice "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE &ORE
|
USE &ORE
|
||||||
INPUT CODTAB F_COD_ORA
|
INPUT CODTAB F_COD_ORA
|
||||||
@ -28,7 +28,7 @@ END
|
|||||||
|
|
||||||
STRING F_DES_ORA 50
|
STRING F_DES_ORA 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Descrizione "
|
PROMPT 2 3 "Descrizione "
|
||||||
USE &ORE KEY 2
|
USE &ORE KEY 2
|
||||||
INPUT CODTAB F_COD_ORA
|
INPUT CODTAB F_COD_ORA
|
||||||
DISPLAY "Descrizione@50" S0
|
DISPLAY "Descrizione@50" S0
|
||||||
@ -39,6 +39,13 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING F_COD_EST 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Codice esterno "
|
||||||
|
FLAGS "U"
|
||||||
|
FIELD S1
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
@ -1,3 +1,3 @@
|
|||||||
125
|
125
|
||||||
0
|
0
|
||||||
$rilore|||168|0|Rilevamento Ore|||
|
$rilore|||171|0|Rilevamento Ore|||
|
||||||
|
@ -13,7 +13,7 @@ CODCMS|1|20|0|Codice Commessa
|
|||||||
CODFASE|1|10|0|Codice Fase
|
CODFASE|1|10|0|Codice Fase
|
||||||
DADATA|5|8|0|Data Inizio
|
DADATA|5|8|0|Data Inizio
|
||||||
ADATA|5|8|0|Data Fine
|
ADATA|5|8|0|Data Fine
|
||||||
QTAORE|2|4|0|Quantita' ora
|
QTAORE|4|7|2|Quantita' ora
|
||||||
CODLIST|1|4|0|Codice Listino
|
CODLIST|1|4|0|Codice Listino
|
||||||
COSTO|4|10|2|Costo Unitario
|
COSTO|4|10|2|Costo Unitario
|
||||||
PROVV|1|1|0|Chiave doc - PROVV
|
PROVV|1|1|0|Chiave doc - PROVV
|
||||||
|
Loading…
x
Reference in New Issue
Block a user