Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : comincia a stampare qualcosa anche per commessa cdc git-svn-id: svn://10.65.10.50/branches/R_10_00@21681 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
38850dc3a5
commit
f93632a43c
@ -11,7 +11,7 @@
|
|||||||
#include "../ca/commesse.h"
|
#include "../ca/commesse.h"
|
||||||
|
|
||||||
#include "rilore.h"
|
#include "rilore.h"
|
||||||
#include "cilib.h"
|
#include "ci1350.h"
|
||||||
#include "ci1300a.h"
|
#include "ci1300a.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -52,11 +52,6 @@ protected:
|
|||||||
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);
|
||||||
|
|
||||||
void format_report(TReport& rep) const;
|
void format_report(TReport& rep) const;
|
||||||
//bool is_ferial_day(const TDate& data) const;
|
|
||||||
//long calcola_giorni_lavorativi(const TDate& dataini, const TDate& datafine) const;
|
|
||||||
long calcola_giorni_lavorativi_cms(const TDate& ini_cms, const TDate& fine_cms,
|
|
||||||
const TDate& dataini, const TDate& datafine,
|
|
||||||
TDate& inizio_lav, TDate& fine_lav) const;
|
|
||||||
void elabora_risorsa(const TString& curr_risorsa, TReport& rep) const;
|
void elabora_risorsa(const TString& curr_risorsa, TReport& rep) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -75,37 +70,8 @@ bool TRil_ore_ris_mask::on_field_event(TOperable_field& o, TField_event e, long
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
long TRil_ore_ris_mask::calcola_giorni_lavorativi_cms(const TDate& ini_cms, const TDate& fine_cms,
|
|
||||||
const TDate& dataini, const TDate& datafine,
|
|
||||||
TDate& inizio_lav, TDate& fine_lav) const
|
|
||||||
{
|
|
||||||
//date del mese
|
|
||||||
const int anno = get_int(F_ANNO);
|
|
||||||
const int mese = get_int(F_MESE);
|
|
||||||
TDate ini_mese(1, mese, anno);
|
|
||||||
TDate fine_mese = ini_mese;
|
|
||||||
fine_mese.set_end_month();
|
|
||||||
|
|
||||||
//se la commessa non "interseca" il mese selezionato -> finisce qui
|
|
||||||
if (fine_cms < ini_mese || ini_cms > fine_mese)
|
|
||||||
return 0;
|
|
||||||
//se le date limite lavorative non "intersecano" il mese selezionato -> finisce qui
|
|
||||||
if (datafine < ini_mese || dataini > fine_mese)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
//se è arrivato fin qui -> c'è qualcosa da considerare
|
|
||||||
//vanno prese la massima data inizio e la minima data fine
|
|
||||||
inizio_lav = fnc_max(ini_mese, ini_cms);
|
|
||||||
fine_lav = fnc_min(fine_mese, fine_cms);
|
|
||||||
|
|
||||||
//e qui si parrà l'ultima stilla di nobilitate! deve eliminare i giorni festivi dal mucchio!
|
|
||||||
return ci_calcola_giorni_lavorativi(inizio_lav, fine_lav);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TRil_ore_ris_mask::elabora_risorsa(const TString& curr_risorsa, TReport& rep) const
|
void TRil_ore_ris_mask::elabora_risorsa(const TString& curr_risorsa, TReport& rep) const
|
||||||
{
|
{
|
||||||
//memorizza la risorsa in esame perchè gli serve alla fine del metodo
|
|
||||||
const TString8 risorsa = curr_risorsa;
|
|
||||||
//creare un assoc_array con chiave TToken_string cms-sede-fase(1) o sede-cms-fase(2) in base ai parametri..
|
//creare un assoc_array con chiave TToken_string cms-sede-fase(1) o sede-cms-fase(2) in base ai parametri..
|
||||||
//..indicati sulla maschera
|
//..indicati sulla maschera
|
||||||
const int tipo_ordinamento = get_int(F_ORDINAMENTO);
|
const int tipo_ordinamento = get_int(F_ORDINAMENTO);
|
||||||
@ -115,9 +81,9 @@ void TRil_ore_ris_mask::elabora_risorsa(const TString& curr_risorsa, TReport& re
|
|||||||
|
|
||||||
const TVariant tiporisorsa = get(F_RISOATT);
|
const TVariant tiporisorsa = get(F_RISOATT);
|
||||||
|
|
||||||
//query sul file delle ore in chiave 3: TIPO+TIPORA+CODICE+ANNO+MESE+...
|
//query sul file delle ore in chiave 3: TIPO+TIPORA+CODICE+.....frega niente altro
|
||||||
TString query;
|
TString query;
|
||||||
query << "USE RILORE KEY 5";
|
query << "USE RILORE KEY 3";
|
||||||
query << "\nFROM TIPO=#TIPO TIPORA=#TPRA CODICE=#CODICE";
|
query << "\nFROM TIPO=#TIPO TIPORA=#TPRA CODICE=#CODICE";
|
||||||
query << "\nTO TIPO=#TIPO TIPORA=#TPRA CODICE=#CODICE";
|
query << "\nTO TIPO=#TIPO TIPORA=#TPRA CODICE=#CODICE";
|
||||||
|
|
||||||
@ -163,7 +129,9 @@ void TRil_ore_ris_mask::elabora_risorsa(const TString& curr_risorsa, TReport& re
|
|||||||
//metodo semidivino per calcolare, dati l'anno ed il il mese selezionati, la commessa corrente, le date inizio e fine,..
|
//metodo semidivino per calcolare, dati l'anno ed il il mese selezionati, la commessa corrente, le date inizio e fine,..
|
||||||
//..quanti sono i giorni di lavoro lavorativi per suddividere la quantità di ore
|
//..quanti sono i giorni di lavoro lavorativi per suddividere la quantità di ore
|
||||||
TDate ini_lav, fine_lav;
|
TDate ini_lav, fine_lav;
|
||||||
const long giorni_lavorativi_cms = calcola_giorni_lavorativi_cms(ini_cms, fine_cms, dataini, datafine, ini_lav, fine_lav);
|
const int anno = get_int(F_ANNO);
|
||||||
|
const int mese = get_int(F_MESE);
|
||||||
|
const long giorni_lavorativi_cms = ci_calcola_giorni_lavorativi_cms(anno, mese, ini_cms, fine_cms, dataini, datafine, ini_lav, fine_lav);
|
||||||
|
|
||||||
//adesso deve riproporzionare il monte ore sul record sul mese selezionato (fa tutto il lavoro se ci sono giorni..
|
//adesso deve riproporzionare il monte ore sul record sul mese selezionato (fa tutto il lavoro se ci sono giorni..
|
||||||
//..lavorativi sulla commessa in questione)
|
//..lavorativi sulla commessa in questione)
|
||||||
@ -227,59 +195,14 @@ void TRil_ore_ris_mask::elabora_risorsa(const TString& curr_risorsa, TReport& re
|
|||||||
//..csv_recordset e poi sbatte quest'ultimo (ordinato) nel report
|
//..csv_recordset e poi sbatte quest'ultimo (ordinato) nel report
|
||||||
TRil_ore_ris_recordset* righe_da_stampare = new TRil_ore_ris_recordset;
|
TRil_ore_ris_recordset* righe_da_stampare = new TRil_ore_ris_recordset;
|
||||||
|
|
||||||
FOR_EACH_ASSOC_OBJECT(righe, obj, key, itm)
|
ci_fill_recset_from_ass(righe, *righe_da_stampare);
|
||||||
{
|
|
||||||
TToken_string& record_ass = (TToken_string&)*itm;
|
|
||||||
real totale_c = record_ass.get(32);
|
|
||||||
totale_c.round(1);
|
|
||||||
TGeneric_distrib esso(totale_c, 1);
|
|
||||||
|
|
||||||
for (int j = 1; j <= 31; j++)
|
|
||||||
{
|
|
||||||
real ore = record_ass.get(j);
|
|
||||||
esso.add(ore);
|
|
||||||
}
|
|
||||||
|
|
||||||
//chiave della riga (Cms-CdC-Fase o CdC-Cms-Fase)
|
|
||||||
TToken_string linea;
|
|
||||||
TToken_string chiave = key;
|
|
||||||
FOR_EACH_TOKEN(chiave, tok)
|
|
||||||
{
|
|
||||||
if (*tok > ' ')
|
|
||||||
{
|
|
||||||
if (!linea.empty())
|
|
||||||
linea << " -- ";
|
|
||||||
linea << tok;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Totale preventivo
|
|
||||||
real totale_p = record_ass.get(0);
|
|
||||||
totale_p.round(1);
|
|
||||||
linea.add(totale_p.string());
|
|
||||||
|
|
||||||
// Totale consuntivo
|
|
||||||
for (int k = 1; k <= 31; k++)
|
|
||||||
{
|
|
||||||
const real ore_giorno = esso.get();
|
|
||||||
const char* str_ore = ore_giorno.string();
|
|
||||||
linea.add(str_ore, k+1);
|
|
||||||
}
|
|
||||||
|
|
||||||
linea.add(totale_c.string());
|
|
||||||
|
|
||||||
//aggiunge la riga tokenstringata al csv_recordset
|
|
||||||
righe_da_stampare->new_rec(linea);
|
|
||||||
}
|
|
||||||
//ordina il recordset per chiave
|
|
||||||
righe_da_stampare->sort();
|
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
righe_da_stampare->save_as_text("C:/temp/cazzone.txt");
|
righe_da_stampare->save_as_text("C:/temp/cazzone.txt");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//deve settare almeno un campo manualmente perche' funzioni la mask2report
|
//deve settare almeno un campo manualmente perche' funzioni la mask2report
|
||||||
righe_da_stampare->set_var("#CODRIS", TVariant(risorsa), true);
|
righe_da_stampare->set_var("#CODRIS", TVariant(curr_risorsa), true);
|
||||||
|
|
||||||
//setta il recordset ordinato al report
|
//setta il recordset ordinato al report
|
||||||
rep.set_recordset(righe_da_stampare);
|
rep.set_recordset(righe_da_stampare);
|
||||||
@ -363,7 +286,7 @@ void TRil_ore_ris_mask::elabora() const
|
|||||||
if (!pi.addstatus(1))
|
if (!pi.addstatus(1))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const TString& curr_risorsa = recset_ris_att.cursor()->curr().get("CODTAB");
|
const TString80 curr_risorsa = recset_ris_att.cursor()->curr().get("CODTAB");
|
||||||
|
|
||||||
elabora_risorsa(curr_risorsa, rep);
|
elabora_risorsa(curr_risorsa, rep);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<report name="ci1300a" orientation="2" lpi="6">
|
<report name="ci1300a" orientation="2" lpi="6">
|
||||||
<description>Rilevazione ore mensili per Risorsa</description>
|
<description>Rilevazione ore mensili per Risorsa - Attrezzatura</description>
|
||||||
<font face="Arial" size="8" />
|
<font face="Arial" size="8" />
|
||||||
<section type="Head" pattern="1">
|
<section type="Head" pattern="1">
|
||||||
<field x="21" y="1" type="Testo" align="center" width="8" height="2" pattern="1" text="Totale preventivo">
|
<field x="21" y="1" type="Testo" align="center" width="8" height="2" pattern="1" text="Totale preventivo">
|
||||||
@ -258,7 +258,7 @@
|
|||||||
<section type="Foot" pattern="1" />
|
<section type="Foot" pattern="1" />
|
||||||
<section type="Foot" level="1" pattern="1">
|
<section type="Foot" level="1" pattern="1">
|
||||||
<font face="Arial Narrow" bold="1" size="8" />
|
<font face="Arial Narrow" bold="1" size="8" />
|
||||||
<field x="13" y="0.5" type="Testo" bg_color="#C0C0C0" width="8" pattern="2" text="Totali">
|
<field border="1" x="1" y="0.5" type="Testo" align="right" bg_color="#C0C0C0" width="20" pattern="2" text="Totali">
|
||||||
<font face="Arial" bold="1" size="8" />
|
<font face="Arial" bold="1" size="8" />
|
||||||
</field>
|
</field>
|
||||||
<field border="1" x="22" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="7" id="100" pattern="2" text="###@,@@" />
|
<field border="1" x="22" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="7" id="100" pattern="2" text="###@,@@" />
|
||||||
|
102
ci/ci1350.cpp
Executable file
102
ci/ci1350.cpp
Executable file
@ -0,0 +1,102 @@
|
|||||||
|
#include "ci1350.h"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Metodi liberi per determinare giorni lavorativi e feriali (nati per ci1300 ci1400)
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool ci_is_ferial_day(const TDate& data)
|
||||||
|
{
|
||||||
|
return data.wday() < 6 && !data.is_holiday();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long ci_calcola_giorni_lavorativi(const TDate& dataini, const TDate& datafine)
|
||||||
|
{
|
||||||
|
long num_giorni_lav = datafine - dataini + 1;
|
||||||
|
//e qui si parrà l'ultima stilla di nobilitate! deve eliminare i giorni festivi dal mucchio!
|
||||||
|
if (num_giorni_lav > 1)
|
||||||
|
{
|
||||||
|
for (TDate data = dataini; data <= datafine; ++data)
|
||||||
|
{
|
||||||
|
if (!ci_is_ferial_day(data))
|
||||||
|
num_giorni_lav--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return num_giorni_lav;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long ci_calcola_giorni_lavorativi_cms(const int anno, const int mese, const TDate& ini_cms, const TDate& fine_cms,
|
||||||
|
const TDate& dataini, const TDate& datafine, TDate& inizio_lav, TDate& fine_lav)
|
||||||
|
{
|
||||||
|
//date del mese
|
||||||
|
TDate ini_mese(1, mese, anno);
|
||||||
|
TDate fine_mese = ini_mese;
|
||||||
|
fine_mese.set_end_month();
|
||||||
|
|
||||||
|
//se la commessa non "interseca" il mese selezionato -> finisce qui
|
||||||
|
if (fine_cms < ini_mese || ini_cms > fine_mese)
|
||||||
|
return 0;
|
||||||
|
//se le date limite lavorative non "intersecano" il mese selezionato -> finisce qui
|
||||||
|
if (datafine < ini_mese || dataini > fine_mese)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
//se è arrivato fin qui -> c'è qualcosa da considerare
|
||||||
|
//vanno prese la massima data inizio e la minima data fine
|
||||||
|
inizio_lav = fnc_max(ini_mese, ini_cms);
|
||||||
|
fine_lav = fnc_min(fine_mese, fine_cms);
|
||||||
|
|
||||||
|
//e qui si parrà l'ultima stilla di nobilitate! deve eliminare i giorni festivi dal mucchio!
|
||||||
|
return ci_calcola_giorni_lavorativi(inizio_lav, fine_lav);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ci_fill_recset_from_ass(TAssoc_array& ass, TCSV_recordset& recset)
|
||||||
|
{
|
||||||
|
FOR_EACH_ASSOC_OBJECT(ass, obj, key, itm)
|
||||||
|
{
|
||||||
|
TToken_string& record_ass = (TToken_string&)*itm;
|
||||||
|
real totale_c = record_ass.get(32);
|
||||||
|
totale_c.round(1);
|
||||||
|
TGeneric_distrib esso(totale_c, 1);
|
||||||
|
|
||||||
|
for (int j = 1; j <= 31; j++)
|
||||||
|
{
|
||||||
|
real ore = record_ass.get(j);
|
||||||
|
esso.add(ore);
|
||||||
|
}
|
||||||
|
|
||||||
|
//chiave della riga (Cms-CdC-Fase o CdC-Cms-Fase)
|
||||||
|
TToken_string linea;
|
||||||
|
TToken_string chiave = key;
|
||||||
|
FOR_EACH_TOKEN(chiave, tok)
|
||||||
|
{
|
||||||
|
if (*tok > ' ')
|
||||||
|
{
|
||||||
|
if (!linea.empty())
|
||||||
|
linea << " -- ";
|
||||||
|
linea << tok;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Totale preventivo
|
||||||
|
real totale_p = record_ass.get(0);
|
||||||
|
totale_p.round(1);
|
||||||
|
linea.add(totale_p.string());
|
||||||
|
|
||||||
|
// Totale consuntivo
|
||||||
|
for (int k = 1; k <= 31; k++)
|
||||||
|
{
|
||||||
|
const real ore_giorno = esso.get();
|
||||||
|
const char* str_ore = ore_giorno.string();
|
||||||
|
linea.add(str_ore, k+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
linea.add(totale_c.string());
|
||||||
|
|
||||||
|
//aggiunge la riga tokenstringata al csv_recordset
|
||||||
|
recset.new_rec(linea);
|
||||||
|
}
|
||||||
|
//ordina il recordset per chiave
|
||||||
|
recset.sort();
|
||||||
|
}
|
19
ci/ci1350.h
Executable file
19
ci/ci1350.h
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef __CI1350_H
|
||||||
|
#define __CI1350_H
|
||||||
|
|
||||||
|
#include <assoc.h>
|
||||||
|
#include <date.h>
|
||||||
|
#include <textset.h>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Metodi liberi per determinare giorni lavorativi e feriali (nati per ci1300 ci1400)
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool ci_is_ferial_day(const TDate& data);
|
||||||
|
long ci_calcola_giorni_lavorativi(const TDate& dataini, const TDate& datafine);
|
||||||
|
long ci_calcola_giorni_lavorativi_cms(const int anno, const int mese, const TDate& ini_cms, const TDate& fine_cms,
|
||||||
|
const TDate& dataini, const TDate& datafine, TDate& inizio_lav, TDate& fine_lav);
|
||||||
|
|
||||||
|
void ci_fill_recset_from_ass(TAssoc_array& ass, TCSV_recordset& recset);
|
||||||
|
|
||||||
|
#endif
|
153
ci/ci1400.cpp
153
ci/ci1400.cpp
@ -10,7 +10,7 @@
|
|||||||
#include "../ca/commesse.h"
|
#include "../ca/commesse.h"
|
||||||
|
|
||||||
#include "rilore.h"
|
#include "rilore.h"
|
||||||
#include "cilib.h"
|
#include "ci1350.h"
|
||||||
#include "ci1400a.h"
|
#include "ci1400a.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -53,8 +53,8 @@ protected:
|
|||||||
void format_report(TReport& rep) const;
|
void format_report(TReport& rep) const;
|
||||||
/*long calcola_giorni_lavorativi_cms(const TDate& ini_cms, const TDate& fine_cms,
|
/*long calcola_giorni_lavorativi_cms(const TDate& ini_cms, const TDate& fine_cms,
|
||||||
const TDate& dataini, const TDate& datafine,
|
const TDate& dataini, const TDate& datafine,
|
||||||
TDate& inizio_lav, TDate& fine_lav) const;
|
TDate& inizio_lav, TDate& fine_lav) const;*/
|
||||||
void elabora_risorsa(const TString& curr_risorsa, TReport& rep) const;*/
|
bool elabora_commessa(const TString& curr_commessa, TReport& rep) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void elabora() const;
|
void elabora() const;
|
||||||
@ -73,6 +73,149 @@ bool TRil_ore_cms_mask::on_field_event(TOperable_field& o, TField_event e, long
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool TRil_ore_cms_mask::elabora_commessa(const TString& curr_commessa, TReport& rep) const
|
||||||
|
{
|
||||||
|
const TVariant tipo_cms_cdc = get(F_CMSOCDC);
|
||||||
|
|
||||||
|
//date del mese
|
||||||
|
const int anno = get_int(F_ANNO);
|
||||||
|
const int mese = get_int(F_MESE);
|
||||||
|
TDate ini_mese(1, mese, anno);
|
||||||
|
TDate fine_mese = ini_mese;
|
||||||
|
fine_mese.set_end_month();
|
||||||
|
|
||||||
|
TDate ini_cms, fine_cms;
|
||||||
|
|
||||||
|
//creare un assoc_array con chiave TToken_string risorsa/attr. in base ai parametri..
|
||||||
|
//..indicati sulla maschera
|
||||||
|
//il contenuto dell'assoc_array sarà: tot_Prev - 31 valori giornalieri Consuntivi - tot_Consuntivo
|
||||||
|
TAssoc_array righe;
|
||||||
|
|
||||||
|
//query sul file delle ore in chiave 4 o 5, in base alla scelta di Cdc(4) o Cms(5): TIPO+CODCOSTO+... o TIPO+CODCMS+...
|
||||||
|
TString query;
|
||||||
|
|
||||||
|
if (tipo_cms_cdc.as_string() == "C")
|
||||||
|
{
|
||||||
|
const TRectype& rec_cms = cache().get(LF_COMMESSE, curr_commessa);
|
||||||
|
const int durata_cms = ca_durata_commessa(rec_cms, ini_cms, fine_cms);
|
||||||
|
|
||||||
|
//se la commessa non "interseca" il mese selezionato -> finisce qui
|
||||||
|
if (fine_cms < ini_mese || ini_cms > fine_mese)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
query << "USE RILORE KEY 5";
|
||||||
|
query << "\nFROM TIPO=#TIPO CODCMS=#CODICE";
|
||||||
|
query << "\nTO TIPO=#TIPO CODCMS=#CODICE";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ini_cms = ini_mese;
|
||||||
|
fine_cms = fine_mese;
|
||||||
|
|
||||||
|
query << "USE RILORE KEY 4";
|
||||||
|
query << "\nFROM TIPO=#TIPO CODCOSTO=#CODICE";
|
||||||
|
query << "\nTO TIPO=#TIPO CODCOSTO=#CODICE";
|
||||||
|
}
|
||||||
|
|
||||||
|
TISAM_recordset rilore_recset(query);
|
||||||
|
rilore_recset.set_var("#CODICE", curr_commessa);
|
||||||
|
|
||||||
|
//un giro con le ore a 'P'reventivo, uno con quelle a 'C'onsuntivo
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
const TVariant tipo = i == 0 ? "P" : "C";
|
||||||
|
rilore_recset.set_var("#TIPO", tipo);
|
||||||
|
|
||||||
|
const long rilore_recset_items = rilore_recset.items();
|
||||||
|
|
||||||
|
for (bool ok = rilore_recset.move_first(); ok; ok = rilore_recset.move_next())
|
||||||
|
{
|
||||||
|
const TString16 risorsa = rilore_recset.get(RILORE_CODICE).as_string();
|
||||||
|
const char tipo_ris_att = rilore_recset.get(RILORE_TIPORA).as_string()[0];
|
||||||
|
|
||||||
|
//date limite qta ore sul record del file LF_RILORE
|
||||||
|
TDate dataini = rilore_recset.get(RILORE_DADATA).as_date();
|
||||||
|
TDate datafine = rilore_recset.get(RILORE_ADATA).as_date();
|
||||||
|
|
||||||
|
//adatta le date alla commessa se quest'ultima è contenuta nell'intervallo (può essere più breve..
|
||||||
|
//..dell'intervallo selezionato, oppure sovrapporsi solo parzialmente)
|
||||||
|
if (fine_cms < datafine)
|
||||||
|
datafine = fine_cms;
|
||||||
|
if (ini_cms > dataini)
|
||||||
|
dataini = ini_cms;
|
||||||
|
//se la commessa fosse tutta nel futuro o nel passato -> lascia perdere
|
||||||
|
const long giorni_lavorativi = ci_calcola_giorni_lavorativi(dataini, datafine);
|
||||||
|
if (giorni_lavorativi <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
TDate ini_lav, fine_lav;
|
||||||
|
const long giorni_lavorativi_cms = ci_calcola_giorni_lavorativi_cms(anno, mese, ini_cms, fine_cms, dataini, datafine, ini_lav, fine_lav);
|
||||||
|
|
||||||
|
if (giorni_lavorativi_cms > 0)
|
||||||
|
{
|
||||||
|
const real tot_ore = rilore_recset.get(RILORE_QTAORE).as_real();
|
||||||
|
const real tot_ore_uso_risorsa_nel_mese_per_cms = tot_ore * giorni_lavorativi_cms / giorni_lavorativi;
|
||||||
|
|
||||||
|
TToken_string key;
|
||||||
|
key << tipo_ris_att;
|
||||||
|
key.add(risorsa);
|
||||||
|
|
||||||
|
TToken_string* record = (TToken_string*)righe.objptr(key);
|
||||||
|
if (record == NULL)
|
||||||
|
{
|
||||||
|
record = new TToken_string;
|
||||||
|
righe.add(key, record);
|
||||||
|
}
|
||||||
|
if (i == 0) //'P'reventivo (aggiorna solo il totale)
|
||||||
|
{
|
||||||
|
real prev = record->get(0);
|
||||||
|
prev += tot_ore_uso_risorsa_nel_mese_per_cms;
|
||||||
|
record->add(prev.string(), 0);
|
||||||
|
}
|
||||||
|
else //'C'onsuntivo (aggiorna tutte le caselle dei giorni lavorativi)
|
||||||
|
{
|
||||||
|
const real ore_al_giorno = tot_ore / giorni_lavorativi;
|
||||||
|
for (TDate data = ini_lav; data <= fine_lav; ++data)
|
||||||
|
{
|
||||||
|
if (giorni_lavorativi == 1 || ci_is_ferial_day(data))
|
||||||
|
{
|
||||||
|
real prev = record->get(data.day());
|
||||||
|
prev += ore_al_giorno;
|
||||||
|
record->add(prev.string(), data.day());
|
||||||
|
real tot = record->get(32);
|
||||||
|
tot += ore_al_giorno;
|
||||||
|
record->add(tot.string(), 32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //if(i==0)..
|
||||||
|
|
||||||
|
} //if (giorni_lavorativi_cms > 0)..
|
||||||
|
} //for (bool ok = rilore_recset.move_first()...
|
||||||
|
} //for (int i = 0; i < 2; i++)..
|
||||||
|
|
||||||
|
//finita l'elaborazione che ha riempito l'assoc_array, asegna il medesimo ad un..
|
||||||
|
//..csv_recordset e poi sbatte quest'ultimo (ordinato) nel report
|
||||||
|
TRil_ore_cms_recordset* righe_da_stampare = new TRil_ore_cms_recordset;
|
||||||
|
|
||||||
|
ci_fill_recset_from_ass(righe, *righe_da_stampare);
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
righe_da_stampare->save_as_text("C:/temp/culone.txt");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//deve settare almeno un campo manualmente perche' funzioni la mask2report
|
||||||
|
righe_da_stampare->set_var("#CODCMSCDC", TVariant(curr_commessa), true);
|
||||||
|
|
||||||
|
//setta il recordset ordinato al report
|
||||||
|
rep.set_recordset(righe_da_stampare);
|
||||||
|
|
||||||
|
//tenta la mask2report per far apparire sul report i campi di selezione della maschera
|
||||||
|
rep.mask2report(*this);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TRil_ore_cms_mask::format_report(TReport& rep) const
|
void TRil_ore_cms_mask::format_report(TReport& rep) const
|
||||||
{
|
{
|
||||||
//maggico giro per formattare la testata del calendario di pagina nel report
|
//maggico giro per formattare la testata del calendario di pagina nel report
|
||||||
@ -150,9 +293,9 @@ void TRil_ore_cms_mask::elabora() const
|
|||||||
if (!pi.addstatus(1))
|
if (!pi.addstatus(1))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const TString& curr_commessa = recset_cms_cdc.cursor()->curr().get(code_name);
|
const TString80 curr_commessa = recset_cms_cdc.cursor()->curr().get(code_name);
|
||||||
|
|
||||||
//elabora_commessa(curr_commessa, rep);
|
elabora_commessa(curr_commessa, rep);
|
||||||
|
|
||||||
book.add(rep);
|
book.add(rep);
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,3 @@
|
|||||||
|
|
||||||
#define F_ANNO 211
|
#define F_ANNO 211
|
||||||
#define F_MESE 212
|
#define F_MESE 212
|
||||||
#define F_ORDINAMENTO 213
|
|
||||||
#define F_SHOW_FASI 214
|
|
288
ci/ci1400a.rep
Executable file
288
ci/ci1400a.rep
Executable file
@ -0,0 +1,288 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<report name="ci1400a" orientation="2" lpi="6">
|
||||||
|
<description>Rilevazione ore mensili per Commessa - CdC</description>
|
||||||
|
<font face="Arial" size="8" />
|
||||||
|
<section type="Head" pattern="1">
|
||||||
|
<field x="21" y="1" type="Testo" align="center" width="8" height="2" pattern="1" text="Totale preventivo">
|
||||||
|
<font face="Arial Narrow" bold="1" size="8" />
|
||||||
|
</field>
|
||||||
|
<field x="155" y="1" type="Testo" align="center" width="8" height="2" pattern="1" text="Totale consuntivo">
|
||||||
|
<font face="Arial Narrow" bold="1" size="8" />
|
||||||
|
</field>
|
||||||
|
<field border="1" x="30" y="1" type="Stringa" align="center" width="4" height="2" id="101" pattern="2" />
|
||||||
|
<field border="1" x="34" y="1" type="Stringa" align="center" width="4" height="2" id="102" pattern="2" />
|
||||||
|
<field border="1" x="38" y="1" type="Stringa" align="center" width="4" height="2" id="103" pattern="2" />
|
||||||
|
<field border="1" x="42" y="1" type="Stringa" align="center" width="4" height="2" id="104" pattern="2" />
|
||||||
|
<field border="1" x="46" y="1" type="Stringa" align="center" width="4" height="2" id="105" pattern="2" />
|
||||||
|
<field border="1" x="50" y="1" type="Stringa" align="center" width="4" height="2" id="106" pattern="2" />
|
||||||
|
<field border="1" x="54" y="1" type="Stringa" align="center" width="4" height="2" id="107" pattern="2" />
|
||||||
|
<field border="1" x="58" y="1" type="Stringa" align="center" width="4" height="2" id="108" pattern="2" />
|
||||||
|
<field border="1" x="62" y="1" type="Stringa" align="center" width="4" height="2" id="109" pattern="2" />
|
||||||
|
<field border="1" x="66" y="1" type="Stringa" align="center" width="4" height="2" id="110" pattern="2" />
|
||||||
|
<field border="1" x="70" y="1" type="Stringa" align="center" width="4" height="2" id="111" pattern="2" />
|
||||||
|
<field border="1" x="74" y="1" type="Stringa" align="center" width="4" height="2" id="112" pattern="2" />
|
||||||
|
<field border="1" x="78" y="1" type="Stringa" align="center" width="4" height="2" id="113" pattern="2" />
|
||||||
|
<field border="1" x="82" y="1" type="Stringa" align="center" width="4" height="2" id="114" pattern="2" />
|
||||||
|
<field border="1" x="86" y="1" type="Stringa" align="center" width="4" height="2" id="115" pattern="2" />
|
||||||
|
<field border="1" x="90" y="1" type="Stringa" align="center" width="4" height="2" id="116" pattern="2" />
|
||||||
|
<field border="1" x="94" y="1" type="Stringa" align="center" width="4" height="2" id="117" pattern="2" />
|
||||||
|
<field border="1" x="98" y="1" type="Stringa" align="center" width="4" height="2" id="118" pattern="2" />
|
||||||
|
<field border="1" x="102" y="1" type="Stringa" align="center" width="4" height="2" id="119" pattern="2" />
|
||||||
|
<field border="1" x="106" y="1" type="Stringa" align="center" width="4" height="2" id="120" pattern="2" />
|
||||||
|
<field border="1" x="110" y="1" type="Stringa" align="center" width="4" height="2" id="121" pattern="2" />
|
||||||
|
<field border="1" x="114" y="1" type="Stringa" align="center" width="4" height="2" id="122" pattern="2" />
|
||||||
|
<field border="1" x="118" y="1" type="Stringa" align="center" width="4" height="2" id="123" pattern="2" />
|
||||||
|
<field border="1" x="122" y="1" type="Stringa" align="center" width="4" height="2" id="124" pattern="2" />
|
||||||
|
<field border="1" x="126" y="1" type="Stringa" align="center" width="4" height="2" id="125" pattern="2" />
|
||||||
|
<field border="1" x="130" y="1" type="Stringa" align="center" width="4" height="2" id="126" pattern="2" />
|
||||||
|
<field border="1" x="134" y="1" type="Stringa" align="center" width="4" height="2" id="127" pattern="2" />
|
||||||
|
<field border="1" x="138" y="1" type="Stringa" align="center" width="4" height="2" id="128" pattern="2" />
|
||||||
|
<field border="1" x="142" y="1" type="Stringa" align="center" width="4" height="2" id="129" pattern="2" />
|
||||||
|
<field border="1" x="146" y="1" type="Stringa" align="center" width="4" height="2" id="130" pattern="2" />
|
||||||
|
<field border="1" x="150" y="1" type="Stringa" align="center" width="4" height="2" id="131" pattern="2" />
|
||||||
|
</section>
|
||||||
|
<section type="Head" level="1" pattern="1">
|
||||||
|
<font face="Arial" size="10" />
|
||||||
|
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1</prescript>
|
||||||
|
<field border="1" radius="50" x="39" y="0.5" type="Array" valign="center" align="center" shade_offset="50" width="80" height="3" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="14" />
|
||||||
|
<source>#CMSOCDC</source>
|
||||||
|
<list>
|
||||||
|
<li Value="Rilevazione ore mensili Commessa" Code="C" />
|
||||||
|
<li Value="Rilevazione ore mensili Centro di Costo" Code="S" />
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field x="10" y="1" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="10" pattern="1" />
|
||||||
|
<field x="2" y="4.5" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="8" pattern="2" text="Anno:" />
|
||||||
|
<field x="10" y="4.5" type="Numero" align="right" bg_color="#400040" txt_color="#FFFFFF" width="5" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="10" />
|
||||||
|
<source>#ANNO</source>
|
||||||
|
</field>
|
||||||
|
<field x="15" y="4.5" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="3" pattern="2" />
|
||||||
|
<field x="18" y="4.5" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="8" pattern="2" text="Mese:" />
|
||||||
|
<field x="26" y="4.5" type="Array" align="right" bg_color="#400040" txt_color="#FFFFFF" width="12" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="10" />
|
||||||
|
<source>#MESE</source>
|
||||||
|
<list>
|
||||||
|
<li Value="Gennaio" Code="01" />
|
||||||
|
<li Value="Febbraio" Code="02" />
|
||||||
|
<li Value="Marzo" Code="03" />
|
||||||
|
<li Value="Aprile" Code="04" />
|
||||||
|
<li Value="Maggio" Code="05" />
|
||||||
|
<li Value="Giugno" Code="06" />
|
||||||
|
<li Value="Luglio" Code="07" />
|
||||||
|
<li Value="Agosto" Code="08" />
|
||||||
|
<li Value="Settembre" Code="09" />
|
||||||
|
<li Value="Ottobre" Code="10" />
|
||||||
|
<li Value="Novembre" Code="11" />
|
||||||
|
<li Value="Dicembre" Code="12" />
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field x="38" y="4.5" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="8" pattern="2" />
|
||||||
|
<field x="46" y="4.5" type="Array" bg_color="#400040" txt_color="#FFFFFF" width="17" pattern="2">
|
||||||
|
<source>#CMSOCDC</source>
|
||||||
|
<list>
|
||||||
|
<li Value="Commessa:" Code="C">MESSAGE HIDE,H1.92|SHOW,H1.91</li>
|
||||||
|
<li Value="Centro di costo:" Code="S">MESSAGE HIDE,H1.91|SHOW,H1.92</li>
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field x="133" y="4.5" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="15" pattern="2" text="Data stampa:" />
|
||||||
|
<field x="148" y="4.5" type="Data" bg_color="#400040" txt_color="#FFFFFF" width="12" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="10" />
|
||||||
|
<source>#SYSTEM.DATE</source>
|
||||||
|
</field>
|
||||||
|
<field x="158" y="4.5" type="Testo" bg_color="#400040" txt_color="#FFFFFF" width="4" pattern="2" />
|
||||||
|
<field border="2" x="1" y="6" type="Linea" width="162" height="0" pattern="1" />
|
||||||
|
<field x="63" y="4.5" type="Stringa" bg_color="#400040" txt_color="#FFFFFF" width="20" id="90" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="10" />
|
||||||
|
<source>#CODCMSCDC</source>
|
||||||
|
</field>
|
||||||
|
<field x="83" y="4.5" type="Stringa" bg_color="#400040" txt_color="#FFFFFF" width="50" id="91" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="10" />
|
||||||
|
<prescript description="H1.91 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#90,DESCRIZ</prescript>
|
||||||
|
</field>
|
||||||
|
<field x="83" y="4.5" type="Stringa" bg_color="#400040" txt_color="#FFFFFF" width="50" id="92" pattern="2">
|
||||||
|
<font face="Arial" bold="1" size="10" />
|
||||||
|
<prescript description="H1.92 PRESCRIPT">MESSAGE ISAMREAD,CDC,CODCOSTO=#90,DESCRIZ</prescript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Body" pattern="1" />
|
||||||
|
<section type="Body" level="1" pattern="1">
|
||||||
|
<font face="Arial Narrow" size="8" />
|
||||||
|
<field border="1" x="1" type="Stringa" dynamic_height="1" width="20" height="2" pattern="1">
|
||||||
|
<source>A</source>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="22" type="Numero" align="right" width="7" pattern="1" text="###@,@@">
|
||||||
|
<source>B</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.100</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="30" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>C</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.101</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="34" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>D</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.102</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="38" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>E</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.103</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="42" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>F</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.104</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="46" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>G</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.105</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="50" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>H</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.106</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="54" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>I</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.107</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="58" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>J</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.108</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="62" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>K</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.109</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="66" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>L</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.110</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="70" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>M</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.111</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="74" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>N</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.112</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="78" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>O</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.113</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="82" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>P</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.114</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="86" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>Q</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.115</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="90" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>R</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.116</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="94" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>S</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.117</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="98" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>T</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.118</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="102" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>U</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.119</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="106" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>V</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.120</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="110" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>W</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.121</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="114" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>X</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.122</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="118" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>Y</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.123</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="122" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>Z</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.124</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="126" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AA</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.125</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="130" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AB</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.126</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="134" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AC</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.127</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="138" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AD</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.128</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="142" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AE</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.129</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="146" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AF</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.130</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="150" type="Numero" align="right" width="4" pattern="1" hide_zero="1" text="#@,@@">
|
||||||
|
<source>AG</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.131</prescript>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="155" type="Numero" align="right" width="6" pattern="1" text="##@,@@">
|
||||||
|
<source>AH</source>
|
||||||
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F1.132</prescript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Foot" pattern="1" />
|
||||||
|
<section type="Foot" level="1" pattern="1">
|
||||||
|
<font face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<field border="1" x="1" y="0.5" type="Testo" align="right" bg_color="#C0C0C0" width="20" pattern="2" text="Totali">
|
||||||
|
<font face="Arial" bold="1" size="8" />
|
||||||
|
</field>
|
||||||
|
<field border="1" x="22" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="7" id="100" pattern="2" text="###@,@@" />
|
||||||
|
<field border="1" x="30" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="101" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="34" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="102" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="38" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="103" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="42" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="104" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="46" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="105" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="50" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="106" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="54" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="107" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="58" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="108" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="62" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="109" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="66" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="110" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="70" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="111" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="74" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="112" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="78" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="113" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="82" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="114" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="86" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="115" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="90" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="116" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="94" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="117" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="98" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="118" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="102" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="119" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="106" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="120" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="110" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="121" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="114" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="122" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="118" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="123" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="122" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="124" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="126" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="125" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="130" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="126" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="134" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="127" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="138" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="128" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="142" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="129" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="146" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="130" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="150" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="4" id="131" pattern="2" hide_zero="1" text="#@,@@" />
|
||||||
|
<field border="1" x="155" y="0.5" type="Numero" align="right" bg_color="#C0C0C0" width="6" id="132" pattern="2" text="##@,@@" />
|
||||||
|
</section>
|
||||||
|
</report>
|
@ -142,12 +142,6 @@ BEGIN
|
|||||||
FIELD #MESE
|
FIELD #MESE
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_SHOW_FASI
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 9 "Dettaglio per fase"
|
|
||||||
FIELD #SHOW_FASI
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
@ -648,7 +648,7 @@ void TRilevamento_cons_msk::update_prev()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TString query;
|
TString query;
|
||||||
query << "USE " << LF_RILORE << " KEY 5\n"
|
query << "USE " << LF_RILORE << " KEY 2\n"
|
||||||
<< "FROM " << RILORE_TIPO "=\"P\""
|
<< "FROM " << RILORE_TIPO "=\"P\""
|
||||||
<< " " << RILORE_ANNO << "=" << _anno << " "
|
<< " " << RILORE_ANNO << "=" << _anno << " "
|
||||||
<< RILORE_MESE << "=" << _mese << " "
|
<< RILORE_MESE << "=" << _mese << " "
|
||||||
|
27
ci/cilib.cpp
27
ci/cilib.cpp
@ -908,30 +908,3 @@ void TDoc_cache::discarding(const THash_object* obj)
|
|||||||
else
|
else
|
||||||
doc.rewrite();
|
doc.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Metodi liberi per determinare giorni lavorativi e feriali (nati per ci1300 ci1400)
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
bool ci_is_ferial_day(const TDate& data)
|
|
||||||
{
|
|
||||||
return data.wday() < 6 && !data.is_holiday();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
long ci_calcola_giorni_lavorativi(const TDate& dataini, const TDate& datafine)
|
|
||||||
{
|
|
||||||
long num_giorni_lav = datafine - dataini + 1;
|
|
||||||
//e qui si parrà l'ultima stilla di nobilitate! deve eliminare i giorni festivi dal mucchio!
|
|
||||||
if (num_giorni_lav > 1)
|
|
||||||
{
|
|
||||||
for (TDate data = dataini; data <= datafine; ++data)
|
|
||||||
{
|
|
||||||
if (!ci_is_ferial_day(data))
|
|
||||||
num_giorni_lav--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return num_giorni_lav;
|
|
||||||
}
|
|
@ -267,11 +267,4 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Metodi liberi per determinare giorni lavorativi e feriali (nati per ci1300 ci1400)
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
bool ci_is_ferial_day(const TDate& data);
|
|
||||||
long ci_calcola_giorni_lavorativi(const TDate& dataini, const TDate& datafine);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,4 +28,4 @@ TIPO+ID|
|
|||||||
TIPO+ANNO+MESE+GIORNO+TIPORA+CODICE+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
TIPO+ANNO+MESE+GIORNO+TIPORA+CODICE+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
||||||
TIPO+TIPORA+CODICE+ANNO+MESE+GIORNO+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
TIPO+TIPORA+CODICE+ANNO+MESE+GIORNO+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
||||||
TIPO+CODCOSTO+CODCMS+CODFASE|X
|
TIPO+CODCOSTO+CODCMS+CODFASE|X
|
||||||
TIPO+TIPORA+CODICE+TPORA+CODCOSTO+CODCMS+CODFASE+ANNO+MESE+GIORNO|X
|
TIPO+CODCMS+CODCOSTO+CODFASE|X
|
||||||
|
Loading…
x
Reference in New Issue
Block a user