Patch level :4.0 500
Files correlati :ca3 & friends Ricompilazione Demo : [ ] Commento :completato ca3800 (bilancio di commessa); spostato il prg x generare movana casuali in ca3400;aggiunto ca3900 (stima ricavi di competenza) anche a menu, ma da completare git-svn-id: svn://10.65.10.50/trunk@14348 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8ac4f47092
commit
db50207716
@ -9,12 +9,12 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
case 1: ca3200(argc, argv); break; // stampa mastrini
|
case 1: ca3200(argc, argv); break; // stampa mastrini
|
||||||
case 2: ca3300(argc, argv); break; // stampa bilancio
|
case 2: ca3300(argc, argv); break; // stampa bilancio
|
||||||
//case 3: ca3400(argc, argv); break; // stampa conti per CdC/Commessa/Fase
|
case 3: ca3400(argc, argv); break; // generazione movimenti perfetti ma casuali
|
||||||
//case 4: ca3500(argc, argv); break; // stampa scheda CdC/Commessa/Fase
|
//case 4: ca3500(argc, argv); break;
|
||||||
case 5: ca3600(argc, argv); break; // stampa pagato per CdC/Commessa/Fase
|
case 5: ca3600(argc, argv); break; // stampa pagato per CdC/Commessa/Fase
|
||||||
case 6: ca3700(argc, argv); break; //stampa rendiconto
|
case 6: ca3700(argc, argv); break; //stampa rendiconto
|
||||||
case 7: ca3800(argc, argv); break; //stampa bilancio di commessa per esercizio
|
case 7: ca3800(argc, argv); break; //stampa bilancio di commessa per esercizio
|
||||||
case 8: ca3900(argc, argv); break; // generazione movimenti perfetti ma casuali
|
case 8: ca3900(argc, argv); break; // stampa stima ricavi
|
||||||
default: ca3100(argc, argv); break; // stampa movimenti
|
default: ca3100(argc, argv); break; // stampa movimenti
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
|
2
ca/ca3.h
2
ca/ca3.h
@ -4,7 +4,7 @@
|
|||||||
int ca3100(int argc, char* argv[]);
|
int ca3100(int argc, char* argv[]);
|
||||||
int ca3200(int argc, char* argv[]);
|
int ca3200(int argc, char* argv[]);
|
||||||
int ca3300(int argc, char* argv[]);
|
int ca3300(int argc, char* argv[]);
|
||||||
//int ca3400(int argc, char* argv[]);
|
int ca3400(int argc, char* argv[]);
|
||||||
//int ca3500(int argc, char* argv[]);
|
//int ca3500(int argc, char* argv[]);
|
||||||
int ca3600(int argc, char* argv[]);
|
int ca3600(int argc, char* argv[]);
|
||||||
int ca3700(int argc, char* argv[]);
|
int ca3700(int argc, char* argv[]);
|
||||||
|
298
ca/ca3400.cpp
Executable file
298
ca/ca3400.cpp
Executable file
@ -0,0 +1,298 @@
|
|||||||
|
#include <applicat.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
|
||||||
|
#include <causali.h>
|
||||||
|
#include <pconti.h>
|
||||||
|
|
||||||
|
#include "cdc.h"
|
||||||
|
#include "fasi.h"
|
||||||
|
#include "movana.h"
|
||||||
|
#include "pconana.h"
|
||||||
|
#include "rmovana.h"
|
||||||
|
|
||||||
|
#include "ca3.h"
|
||||||
|
#include "calib01.h"
|
||||||
|
#include "../cg/cglib01.h"
|
||||||
|
|
||||||
|
class TCode_generator
|
||||||
|
{
|
||||||
|
TRelation* _rel;
|
||||||
|
TCursor* _cur;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TRecnotype items() const { return _cur->items(); }
|
||||||
|
const TString& code();
|
||||||
|
|
||||||
|
TCode_generator(int logicnum);
|
||||||
|
~TCode_generator();
|
||||||
|
};
|
||||||
|
|
||||||
|
const TString& TCode_generator::code()
|
||||||
|
{
|
||||||
|
const TRecnotype i = items();
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
*_cur = rand() % i;
|
||||||
|
const TRectype& curr = _rel->curr();
|
||||||
|
const int logicnum = curr.num();
|
||||||
|
switch (logicnum)
|
||||||
|
{
|
||||||
|
case LF_CAUSALI:
|
||||||
|
return curr.get(CAU_CODCAUS);
|
||||||
|
case LF_CDC:
|
||||||
|
return curr.get(CDC_CODCOSTO);
|
||||||
|
case LF_COMMESSE:
|
||||||
|
return curr.get("CODCMS");
|
||||||
|
case LF_FASI:
|
||||||
|
return curr.get(FASI_CODFASE);
|
||||||
|
case LF_PCON:
|
||||||
|
{
|
||||||
|
TString& tmp = get_tmp_string(12);
|
||||||
|
tmp.format("%03d%03d%06ld",
|
||||||
|
curr.get_int(PCN_GRUPPO), curr.get_int(PCN_CONTO), curr.get_long(PCN_SOTTOCONTO));
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
case LF_PCONANA:
|
||||||
|
return curr.get(PCONANA_CODCONTO);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return EMPTY_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TCode_generator::TCode_generator(int logicnum)
|
||||||
|
{
|
||||||
|
TWait_cursor hourglass;
|
||||||
|
TString filter;
|
||||||
|
|
||||||
|
if (logicnum <= 0)
|
||||||
|
{
|
||||||
|
TConfig& cfg = ca_config();
|
||||||
|
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||||
|
logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (logicnum)
|
||||||
|
{
|
||||||
|
case LF_CAUSALI:
|
||||||
|
filter = "MOVIND=\"X\"";
|
||||||
|
break;
|
||||||
|
case LF_PCON:
|
||||||
|
filter = "SOTTOCONTO!=''";
|
||||||
|
break;
|
||||||
|
case LF_PCONANA:
|
||||||
|
{
|
||||||
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
||||||
|
const int min_len = info.total_len(-1);
|
||||||
|
filter << "STR(NUM(LEN(CODCONTO))>" << min_len << ')';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_rel = new TRelation(logicnum);
|
||||||
|
_cur = new TCursor(_rel, filter);
|
||||||
|
const TRecnotype conti = _cur->items();
|
||||||
|
_cur->freeze();
|
||||||
|
}
|
||||||
|
|
||||||
|
TCode_generator::~TCode_generator()
|
||||||
|
{
|
||||||
|
delete _cur;
|
||||||
|
delete _rel;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// APPLICAZIONE
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
class TRandom_ca : public TSkeleton_application
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
bool chiedi_quanti(int& mov, bool& ric);
|
||||||
|
void kill_bill();
|
||||||
|
void genera(int quanti);
|
||||||
|
void genera_riclass();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void riclassify(const TString& conto);
|
||||||
|
virtual void main_loop();
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TRandom_ca::chiedi_quanti(int& mov, bool& ric)
|
||||||
|
{
|
||||||
|
TMask mask("Movimenti casuali ma perfetti", 1, 60, 6);
|
||||||
|
|
||||||
|
TReal_field& add_number (short id, int page, const char* prompt, int x, int y, int dim, const char* flags = "", int ndec = 0);
|
||||||
|
mask.add_number(101, 0, "Numero di movimenti ", 1, 1, 4, "U");
|
||||||
|
mask.add_boolean(102, 0, "Genera riclassificazioni", 1, 2);
|
||||||
|
mask.add_static (DLG_NULL, 0, "@bAttenzione: verranno distrutti movimenti e saldi", 1, 3);
|
||||||
|
mask.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
||||||
|
mask.add_button(DLG_QUIT, 0, "", -22, -1, 10, 2);
|
||||||
|
mask.set(101, 100);
|
||||||
|
const bool ok = mask.run() != K_QUIT;
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
mov = (mask.get_int(101)+1)/2;
|
||||||
|
ric = mask.get_bool(102);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRandom_ca::kill_bill()
|
||||||
|
{
|
||||||
|
const int lnum[] = { LF_MOVANA, LF_RMOVANA, LF_SALDANA, 0 };
|
||||||
|
for (int i = 0; lnum[i]; i++)
|
||||||
|
{
|
||||||
|
TSystemisamfile f(lnum[i]);
|
||||||
|
f.zap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRandom_ca::riclassify(const TString& conto)
|
||||||
|
{
|
||||||
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
||||||
|
const int min_len = info.total_len(-1);
|
||||||
|
if (conto.len() > min_len)
|
||||||
|
{
|
||||||
|
TRecord_array ric(conto, LF_PANAPDC);
|
||||||
|
|
||||||
|
TCode_generator conti(LF_PCON);
|
||||||
|
const int righe = rand() % 4 + 1;
|
||||||
|
for (int i = 1; i <= righe; i++)
|
||||||
|
{
|
||||||
|
TRectype& row = ric.row(i, true);
|
||||||
|
const TString& c = conti.code();
|
||||||
|
row.put(PCN_GRUPPO, c.mid(0, 3));
|
||||||
|
row.put(PCN_CONTO, c.mid(3, 3));
|
||||||
|
row.put(PCN_SOTTOCONTO, c.mid(6, 6));
|
||||||
|
}
|
||||||
|
ric.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool riclass_callback(const TRelation& rel, void* jolly)
|
||||||
|
{
|
||||||
|
TRandom_ca* myself = (TRandom_ca*)jolly;
|
||||||
|
const TString80 conto = rel.curr().get(PCONANA_CODCONTO);
|
||||||
|
myself->riclassify(conto);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRandom_ca::genera_riclass()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
TSystemisamfile f(LF_PANAPDC);
|
||||||
|
f.zap();
|
||||||
|
}
|
||||||
|
|
||||||
|
TRelation rel(LF_PCONANA);
|
||||||
|
TCursor cur(&rel);
|
||||||
|
cur.scan(riclass_callback, this, "Generazione riclassificazioni");
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRandom_ca::genera(int quanti)
|
||||||
|
{
|
||||||
|
TEsercizi_contabili esc;
|
||||||
|
|
||||||
|
TCode_generator conti(0);
|
||||||
|
TCode_generator commesse(LF_COMMESSE);
|
||||||
|
TCode_generator fasi(LF_FASI);
|
||||||
|
TCode_generator costi(LF_CDC);
|
||||||
|
TCode_generator causali(LF_CAUSALI);
|
||||||
|
|
||||||
|
TLocalisamfile fmov(LF_MOVANA);
|
||||||
|
TProgind pi(quanti, "Generazione movimenti", FALSE, TRUE);
|
||||||
|
for (int m = 0; m < quanti; m++)
|
||||||
|
{
|
||||||
|
pi.addstatus(1);
|
||||||
|
TAnal_mov mov;
|
||||||
|
|
||||||
|
TDate data(TODAY); data -= rand()%365;
|
||||||
|
mov.put(MOVANA_DATAREG, data);
|
||||||
|
mov.put(MOVANA_DATACOMP, data-1L);
|
||||||
|
mov.put(MOVANA_DATADOC, data-2L);
|
||||||
|
mov.put(MOVANA_ANNOES, esc.date2esc(data));
|
||||||
|
mov.put(MOVANA_DESCR, "Movimento random preventivo");
|
||||||
|
mov.put(MOVANA_TIPOMOV, "P");
|
||||||
|
mov.put(MOVANA_CODCAUS, causali.code());
|
||||||
|
|
||||||
|
const int rows = rand()%10+1;
|
||||||
|
TImporto tot;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < rows; i++)
|
||||||
|
{
|
||||||
|
TRectype& rmov = mov.new_row();
|
||||||
|
TString80 descr; descr.format("Riga casuale %d", i+1);
|
||||||
|
rmov.put(RMOVANA_DESCR, descr);
|
||||||
|
rmov.put(RMOVANA_CODCONTO, conti.code());
|
||||||
|
rmov.put(RMOVANA_CODCMS, commesse.code());
|
||||||
|
rmov.put(RMOVANA_CODFASE, fasi.code());
|
||||||
|
rmov.put(RMOVANA_CODCCOSTO, costi.code());
|
||||||
|
|
||||||
|
const TImporto imp(i & 0x1 ? 'A' : 'D', real(10*(rand()%1000+1)));
|
||||||
|
rmov.put(RMOVANA_SEZIONE, imp.sezione());
|
||||||
|
rmov.put(RMOVANA_IMPORTO, imp.valore());
|
||||||
|
tot += imp;
|
||||||
|
}
|
||||||
|
|
||||||
|
tot.normalize();
|
||||||
|
mov.put(MOVANA_SEZIONE, tot.sezione());
|
||||||
|
mov.put(MOVANA_TOTDOC, tot.valore());
|
||||||
|
|
||||||
|
mov.write(fmov);
|
||||||
|
|
||||||
|
// Consuntivo
|
||||||
|
mov.put(MOVANA_NUMREG, mov.get_long(MOVANA_NUMREG)+1);
|
||||||
|
data += rand()%30+30;
|
||||||
|
mov.put(MOVANA_DATAREG, data);
|
||||||
|
mov.put(MOVANA_DATACOMP, data-1L);
|
||||||
|
mov.put(MOVANA_DATADOC, data-2L);
|
||||||
|
mov.put(MOVANA_ANNOES, esc.date2esc(data));
|
||||||
|
mov.put(MOVANA_DESCR, "Movimento random consuntivo");
|
||||||
|
mov.put(MOVANA_TIPOMOV, "");
|
||||||
|
|
||||||
|
tot.set('D', ZERO);
|
||||||
|
for (i = 1; i <= rows; i++)
|
||||||
|
{
|
||||||
|
TRectype& rmov = mov.body()[i];
|
||||||
|
real imp = rmov.get(RMOVANA_IMPORTO);
|
||||||
|
imp += real((rand()%100)-50);
|
||||||
|
rmov.put(RMOVANA_IMPORTO, imp);
|
||||||
|
tot += TImporto(rmov.get_char(RMOVANA_SEZIONE), imp);
|
||||||
|
}
|
||||||
|
tot.normalize();
|
||||||
|
mov.put(MOVANA_SEZIONE, tot.sezione());
|
||||||
|
mov.put(MOVANA_TOTDOC, tot.valore());
|
||||||
|
|
||||||
|
mov.write(fmov);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRandom_ca::main_loop()
|
||||||
|
{
|
||||||
|
int quanti = 100;
|
||||||
|
bool ric = false;
|
||||||
|
if (chiedi_quanti(quanti, ric))
|
||||||
|
{
|
||||||
|
if (quanti > 0)
|
||||||
|
{
|
||||||
|
kill_bill();
|
||||||
|
genera(quanti);
|
||||||
|
}
|
||||||
|
if (ric)
|
||||||
|
genera_riclass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int ca3400(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TRandom_ca a;
|
||||||
|
a.run(argc, argv, TR("Movimenti casuali ma perfetti"));
|
||||||
|
return 0;
|
||||||
|
}
|
159
ca/ca3800.cpp
159
ca/ca3800.cpp
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "ca3.h"
|
#include "ca3.h"
|
||||||
#include "ca3800.h"
|
#include "ca3800.h"
|
||||||
|
#include "ca3883.h"
|
||||||
#include "calib01.h"
|
#include "calib01.h"
|
||||||
#include "calib02.h"
|
#include "calib02.h"
|
||||||
#include "commesse.h"
|
#include "commesse.h"
|
||||||
@ -135,105 +136,8 @@ TPrint_bilancio_cms_mask::TPrint_bilancio_cms_mask()
|
|||||||
set_handlers();
|
set_handlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
|
||||||
// CACHE INDICATORI BILANCIO
|
|
||||||
///////////////////////////////////////////////////////////////
|
|
||||||
const TFixed_string CMS_DEL_CAZZO("@@@@@@@@@@@@@@@@@@@@");
|
const TFixed_string CMS_DEL_CAZZO("@@@@@@@@@@@@@@@@@@@@");
|
||||||
|
|
||||||
|
|
||||||
class TIndbil_cache : public TCache
|
|
||||||
{
|
|
||||||
bool _usepdcc;
|
|
||||||
TString80 _prefix;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual TObject* key2obj(const char* key);
|
|
||||||
|
|
||||||
public:
|
|
||||||
int get_indbil(const TString& conto, TString& conto_anale);
|
|
||||||
void set_prefix(const char* prefix);
|
|
||||||
int get_prefix_length() const { return _prefix.len(); }
|
|
||||||
TIndbil_cache();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
TObject* TIndbil_cache::key2obj(const char* key)
|
|
||||||
{
|
|
||||||
TString80 conto = key;
|
|
||||||
if (_usepdcc && conto.len() == 12 && real::is_natural(conto))
|
|
||||||
{
|
|
||||||
TLocalisamfile panapdc(LF_PANAPDC);
|
|
||||||
panapdc.setkey(2);
|
|
||||||
const int gr = atoi(conto.left(3));
|
|
||||||
const int co = atoi(conto.mid(3,3));
|
|
||||||
const long so = atol(conto.mid(6,6));
|
|
||||||
|
|
||||||
TRectype& panapdrec = panapdc.curr();
|
|
||||||
for (int i = 2; i >= 0; i--)
|
|
||||||
{
|
|
||||||
panapdrec.zero();
|
|
||||||
panapdrec.put(PANAPDC_GRUPPO, gr);
|
|
||||||
if (i > 0)
|
|
||||||
panapdrec.put(PANAPDC_CONTO, co);
|
|
||||||
if (i == 2)
|
|
||||||
panapdrec.put(PANAPDC_SOTTOCONTO, so);
|
|
||||||
|
|
||||||
//occhio al prefisso!
|
|
||||||
panapdrec.put(PANAPDC_CODCONTO, _prefix);
|
|
||||||
|
|
||||||
if (panapdc.read(_isgteq) == NOERR)
|
|
||||||
{
|
|
||||||
bool found = panapdrec.get_int(PANAPDC_GRUPPO) == gr;
|
|
||||||
if (found)
|
|
||||||
found = panapdrec.get_int(PANAPDC_CONTO) == (i > 0 ? co : 0);
|
|
||||||
if (found)
|
|
||||||
found = panapdrec.get_long(PANAPDC_SOTTOCONTO) == (i > 1 ? so : 0L);
|
|
||||||
if (found && _prefix.full())
|
|
||||||
found = panapdrec.get(PANAPDC_CODCONTO).starts_with(_prefix);
|
|
||||||
|
|
||||||
if (found)
|
|
||||||
{
|
|
||||||
conto = panapdrec.get(PANAPDC_CODCONTO);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//se non trova il corrispondente conto analitico azzera il conto per il prossimo giro
|
|
||||||
if (i < 0)
|
|
||||||
conto.cut(0);
|
|
||||||
}
|
|
||||||
//conto analitico
|
|
||||||
TAnal_bill bill(conto);
|
|
||||||
int indbil = bill.indicatore_bilancio();
|
|
||||||
TToken_string* ib = new TToken_string;
|
|
||||||
*ib << indbil;
|
|
||||||
ib->add(conto);
|
|
||||||
return ib;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TIndbil_cache::get_indbil(const TString& conto, TString& conto_anale)
|
|
||||||
{
|
|
||||||
TToken_string* ib = (TToken_string*)objptr(conto);
|
|
||||||
if (ib != NULL)
|
|
||||||
ib->get(1, conto_anale);
|
|
||||||
return ib ? ib->get_int(0) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TIndbil_cache::set_prefix(const char* prefix)
|
|
||||||
{
|
|
||||||
if (_prefix != prefix)
|
|
||||||
{
|
|
||||||
_prefix = prefix;
|
|
||||||
destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TIndbil_cache::TIndbil_cache()
|
|
||||||
{
|
|
||||||
TConfig& cfg = ca_config();
|
|
||||||
_usepdcc = cfg.get_bool("UsePdcc");
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// RECORDSET
|
// RECORDSET
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
@ -243,6 +147,7 @@ class TPrint_bilancio_cms_recordset : public TRecordset
|
|||||||
TRecnotype _curr;
|
TRecnotype _curr;
|
||||||
TArray _colonne;
|
TArray _colonne;
|
||||||
TIndbil_cache _indicatori;
|
TIndbil_cache _indicatori;
|
||||||
|
TEsercizi_contabili _esc;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _anno;
|
int _anno;
|
||||||
@ -267,7 +172,7 @@ protected:
|
|||||||
const int indbil, const TRecordset& saldana, const bool inverti = false) const;
|
const int indbil, const TRecordset& saldana, const bool inverti = false) const;
|
||||||
TAssoc_array& get_row(TAssoc_array& cms, const char* chiave,
|
TAssoc_array& get_row(TAssoc_array& cms, const char* chiave,
|
||||||
const int indice, const TString& codcms, const TString& fase,
|
const int indice, const TString& codcms, const TString& fase,
|
||||||
const TString& descrizione, const real& avanzamento);
|
const TString& descrizione);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void set_filter(const TPrint_bilancio_cms_mask& msk);
|
virtual void set_filter(const TPrint_bilancio_cms_mask& msk);
|
||||||
@ -364,7 +269,7 @@ void TPrint_bilancio_cms_recordset::aggiorna_importo(TAssoc_array& riga_array,
|
|||||||
|
|
||||||
TAssoc_array& TPrint_bilancio_cms_recordset::get_row(TAssoc_array& cms, const char* chiave,
|
TAssoc_array& TPrint_bilancio_cms_recordset::get_row(TAssoc_array& cms, const char* chiave,
|
||||||
const int indice, const TString& codcms, const TString& fase,
|
const int indice, const TString& codcms, const TString& fase,
|
||||||
const TString& descrizione, const real& avanzamento)
|
const TString& descrizione)
|
||||||
{
|
{
|
||||||
//cerca se la commessa (e l'eventuale fase) esistono gia' nell'assocarray delle commesse
|
//cerca se la commessa (e l'eventuale fase) esistono gia' nell'assocarray delle commesse
|
||||||
TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave);
|
TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave);
|
||||||
@ -380,8 +285,6 @@ TAssoc_array& TPrint_bilancio_cms_recordset::get_row(TAssoc_array& cms, const ch
|
|||||||
riga_array->add("CODCMS", codcms);
|
riga_array->add("CODCMS", codcms);
|
||||||
riga_array->add("FASE", fase);
|
riga_array->add("FASE", fase);
|
||||||
riga_array->add("DESCRIZ", descrizione);
|
riga_array->add("DESCRIZ", descrizione);
|
||||||
const TString str_avanz = avanzamento.string();
|
|
||||||
riga_array->add("AVANZAMENTO", str_avanz);
|
|
||||||
|
|
||||||
//aggiunge la riga all'array-ino
|
//aggiunge la riga all'array-ino
|
||||||
cms.add(chiave, riga_array);
|
cms.add(chiave, riga_array);
|
||||||
@ -447,23 +350,6 @@ void TPrint_bilancio_cms_recordset::requery()
|
|||||||
if (dataini >= datainiesc)
|
if (dataini >= datainiesc)
|
||||||
indice++;
|
indice++;
|
||||||
|
|
||||||
//Calcola lo stato di avanzamento della commessa
|
|
||||||
real avanzamento;
|
|
||||||
//Si prende SOLO la Fine Esercizio come riferimento di avanzamento (in realta' si..
|
|
||||||
//..potrebbe usare today al posto di datafinesc se si volesse la situazione ad oggi,..
|
|
||||||
//..ma i calcoli degli importi sarebbero da rivedere). Quindi:
|
|
||||||
//se la commessa finisce prima della fine dell'esercizio
|
|
||||||
if (datafine < datafinesc)
|
|
||||||
avanzamento = CENTO;
|
|
||||||
//se invece prosegue anche dopo la fine dell'esercizio...
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const long time_gone = datafinesc - dataini;
|
|
||||||
const long durata_cms = datafine - dataini;
|
|
||||||
avanzamento = ((real)(time_gone * CENTO) / durata_cms);
|
|
||||||
avanzamento.round(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
TString80 chiave = codcms;
|
TString80 chiave = codcms;
|
||||||
if (_use_fasi)
|
if (_use_fasi)
|
||||||
chiave << '|' << fase;
|
chiave << '|' << fase;
|
||||||
@ -471,7 +357,7 @@ void TPrint_bilancio_cms_recordset::requery()
|
|||||||
//riempie le righe degli array da mandare poi in stampa
|
//riempie le righe degli array da mandare poi in stampa
|
||||||
//dapprima le righe normali..
|
//dapprima le righe normali..
|
||||||
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase,
|
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase,
|
||||||
rec_commesse.get(COMMESSE_DESCRIZ), avanzamento);
|
rec_commesse.get(COMMESSE_DESCRIZ));
|
||||||
//aggiunge gli importi e normalizza
|
//aggiunge gli importi e normalizza
|
||||||
TString80 gruppo, conto;
|
TString80 gruppo, conto;
|
||||||
parse_bill(conto_anale, gruppo, conto);
|
parse_bill(conto_anale, gruppo, conto);
|
||||||
@ -491,7 +377,7 @@ void TPrint_bilancio_cms_recordset::requery()
|
|||||||
TString cazzo_descr = "DETRAZIONE PER COMPETENZA ";
|
TString cazzo_descr = "DETRAZIONE PER COMPETENZA ";
|
||||||
cazzo_descr << (_anno - 1);
|
cazzo_descr << (_anno - 1);
|
||||||
TAssoc_array& riga_array = get_row(cms[indice], CMS_DEL_CAZZO, indice, cazzo_cod,
|
TAssoc_array& riga_array = get_row(cms[indice], CMS_DEL_CAZZO, indice, cazzo_cod,
|
||||||
EMPTY_STRING, cazzo_descr, CENTO);
|
EMPTY_STRING, cazzo_descr);
|
||||||
aggiorna_importo(riga_array, gruppo, indbil, saldana, true);
|
aggiorna_importo(riga_array, gruppo, indbil, saldana, true);
|
||||||
aggiorna_importo(riga_array, conto, indbil, saldana, true);
|
aggiorna_importo(riga_array, conto, indbil, saldana, true);
|
||||||
}
|
}
|
||||||
@ -545,6 +431,39 @@ const TVariant& TPrint_bilancio_cms_recordset::get(const char* column_name) cons
|
|||||||
var.set(_tipostima == 'T' ? "T" : "C");
|
var.set(_tipostima == 'T' ? "T" : "C");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (strcmp(column_name, "AVANZAMENTO") == 0)
|
||||||
|
{
|
||||||
|
//Calcola lo stato di avanzamento della commessa
|
||||||
|
real avanzamento;
|
||||||
|
if (_tipostima == 'T')
|
||||||
|
{
|
||||||
|
const TDate& datafinesc = _esc[_anno].fine();
|
||||||
|
const TString& codcms = get("CODCMS").as_string();
|
||||||
|
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
|
||||||
|
|
||||||
|
const TDate dataini = rec_commesse.get(COMMESSE_DATAINIZIO);
|
||||||
|
const TDate datafine = rec_commesse.get(COMMESSE_DATAFINE);
|
||||||
|
//Si prende SOLO la Fine Esercizio come riferimento di avanzamento (in realta' si..
|
||||||
|
//..potrebbe usare today al posto di datafinesc se si volesse la situazione ad oggi,..
|
||||||
|
//..ma i calcoli degli importi sarebbero da rivedere). Quindi:
|
||||||
|
//se la commessa finisce prima della fine dell'esercizio
|
||||||
|
if (datafine < datafinesc)
|
||||||
|
avanzamento = CENTO;
|
||||||
|
//se invece prosegue anche dopo la fine dell'esercizio...
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const long time_gone = datafinesc - dataini;
|
||||||
|
const long durata_cms = datafine - dataini;
|
||||||
|
avanzamento = ((real)(time_gone * CENTO) / durata_cms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
var.set(avanzamento);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
|
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
|
||||||
const TString* val = (TString*)riga.objptr(column_name);
|
const TString* val = (TString*)riga.objptr(column_name);
|
||||||
|
@ -125,7 +125,7 @@ MESSAGE RESET,F3.108</prescript>
|
|||||||
</field>
|
</field>
|
||||||
<field x="54" type="Numero" align="right" width="3" pattern="1">
|
<field x="54" type="Numero" align="right" width="3" pattern="1">
|
||||||
<font italic="1" face="Arial Narrow" size="8" />
|
<font italic="1" face="Arial Narrow" size="8" />
|
||||||
<source>AVANZAMENTO</source>
|
<source>ROUND(AVANZAMENTO;0)</source>
|
||||||
</field>
|
</field>
|
||||||
<field x="167" type="Testo" align="center" width="2" pattern="1" text="%" />
|
<field x="167" type="Testo" align="center" width="2" pattern="1" text="%" />
|
||||||
<field x="58" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@">
|
<field x="58" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@">
|
||||||
|
81
ca/ca3883.cpp
Executable file
81
ca/ca3883.cpp
Executable file
@ -0,0 +1,81 @@
|
|||||||
|
#include "calib01.h"
|
||||||
|
#include "calib02.h"
|
||||||
|
#include "ca3883.h"
|
||||||
|
#include "panapdc.h"
|
||||||
|
|
||||||
|
TObject* TIndbil_cache::key2obj(const char* key)
|
||||||
|
{
|
||||||
|
TString80 conto = key;
|
||||||
|
if (_usepdcc && conto.len() == 12 && real::is_natural(conto))
|
||||||
|
{
|
||||||
|
TLocalisamfile panapdc(LF_PANAPDC);
|
||||||
|
panapdc.setkey(2);
|
||||||
|
const int gr = atoi(conto.left(3));
|
||||||
|
const int co = atoi(conto.mid(3,3));
|
||||||
|
const long so = atol(conto.mid(6,6));
|
||||||
|
|
||||||
|
TRectype& panapdrec = panapdc.curr();
|
||||||
|
for (int i = 2; i >= 0; i--)
|
||||||
|
{
|
||||||
|
panapdrec.zero();
|
||||||
|
panapdrec.put(PANAPDC_GRUPPO, gr);
|
||||||
|
if (i > 0)
|
||||||
|
panapdrec.put(PANAPDC_CONTO, co);
|
||||||
|
if (i == 2)
|
||||||
|
panapdrec.put(PANAPDC_SOTTOCONTO, so);
|
||||||
|
|
||||||
|
//occhio al prefisso!
|
||||||
|
panapdrec.put(PANAPDC_CODCONTO, _prefix);
|
||||||
|
|
||||||
|
if (panapdc.read(_isgteq) == NOERR)
|
||||||
|
{
|
||||||
|
bool found = panapdrec.get_int(PANAPDC_GRUPPO) == gr;
|
||||||
|
if (found)
|
||||||
|
found = panapdrec.get_int(PANAPDC_CONTO) == (i > 0 ? co : 0);
|
||||||
|
if (found)
|
||||||
|
found = panapdrec.get_long(PANAPDC_SOTTOCONTO) == (i > 1 ? so : 0L);
|
||||||
|
if (found && _prefix.full())
|
||||||
|
found = panapdrec.get(PANAPDC_CODCONTO).starts_with(_prefix);
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
conto = panapdrec.get(PANAPDC_CODCONTO);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//se non trova il corrispondente conto analitico azzera il conto per il prossimo giro
|
||||||
|
if (i < 0)
|
||||||
|
conto.cut(0);
|
||||||
|
}
|
||||||
|
//conto analitico
|
||||||
|
TAnal_bill bill(conto);
|
||||||
|
int indbil = bill.indicatore_bilancio();
|
||||||
|
TToken_string* ib = new TToken_string;
|
||||||
|
*ib << indbil;
|
||||||
|
ib->add(conto);
|
||||||
|
return ib;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TIndbil_cache::get_indbil(const TString& conto, TString& conto_anale)
|
||||||
|
{
|
||||||
|
TToken_string* ib = (TToken_string*)objptr(conto);
|
||||||
|
if (ib != NULL)
|
||||||
|
ib->get(1, conto_anale);
|
||||||
|
return ib ? ib->get_int(0) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TIndbil_cache::set_prefix(const char* prefix)
|
||||||
|
{
|
||||||
|
if (_prefix != prefix)
|
||||||
|
{
|
||||||
|
_prefix = prefix;
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TIndbil_cache::TIndbil_cache()
|
||||||
|
{
|
||||||
|
TConfig& cfg = ca_config();
|
||||||
|
_usepdcc = cfg.get_bool("UsePdcc");
|
||||||
|
}
|
22
ca/ca3883.h
Executable file
22
ca/ca3883.h
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#include <assoc.h>
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
// CACHE INDICATORI BILANCIO
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
//simpatica classe utile per smanettare con piani dei conti contabili ed analitici, riclassificazioni,..
|
||||||
|
//..indicatori di bilancio e roba simile!
|
||||||
|
//ACHTUNG! potrebbe fallire se uno ha conti analitici puri lunghi 12 caratteri e solo numerici
|
||||||
|
class TIndbil_cache : public TCache
|
||||||
|
{
|
||||||
|
bool _usepdcc;
|
||||||
|
TString80 _prefix;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual TObject* key2obj(const char* key);
|
||||||
|
|
||||||
|
public:
|
||||||
|
int get_indbil(const TString& conto, TString& conto_anale);
|
||||||
|
void set_prefix(const char* prefix);
|
||||||
|
int get_prefix_length() const { return _prefix.len(); }
|
||||||
|
TIndbil_cache();
|
||||||
|
|
||||||
|
};
|
718
ca/ca3900.cpp
718
ca/ca3900.cpp
@ -1,298 +1,504 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <mask.h>
|
#include <execp.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <urldefid.h>
|
#include <reprint.h>
|
||||||
|
|
||||||
#include <causali.h>
|
|
||||||
#include <pconti.h>
|
|
||||||
|
|
||||||
#include "cdc.h"
|
|
||||||
#include "fasi.h"
|
|
||||||
#include "movana.h"
|
|
||||||
#include "pconana.h"
|
|
||||||
#include "rmovana.h"
|
|
||||||
|
|
||||||
#include "ca3.h"
|
|
||||||
#include "calib01.h"
|
|
||||||
#include "../cg/cglib01.h"
|
#include "../cg/cglib01.h"
|
||||||
|
|
||||||
class TCode_generator
|
#include "ca3.h"
|
||||||
|
#include "ca3883.h"
|
||||||
|
#include "ca3900.h"
|
||||||
|
#include "calib01.h"
|
||||||
|
#include "calib02.h"
|
||||||
|
#include "commesse.h"
|
||||||
|
#include "panapdc.h"
|
||||||
|
#include "pconana.h"
|
||||||
|
#include "saldana.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// MASCHERA
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
class TPrint_stima_ricavi_mask : public TAnal_report_mask
|
||||||
{
|
{
|
||||||
TRelation* _rel;
|
protected:
|
||||||
TCursor* _cur;
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
const TString& get_report_class() const;
|
||||||
|
bool test_compatible_report();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TRecnotype items() const { return _cur->items(); }
|
TPrint_stima_ricavi_mask();
|
||||||
const TString& code();
|
virtual ~TPrint_stima_ricavi_mask() {}
|
||||||
|
|
||||||
TCode_generator(int logicnum);
|
|
||||||
~TCode_generator();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const TString& TCode_generator::code()
|
const TString& TPrint_stima_ricavi_mask::get_report_class() const
|
||||||
{
|
{
|
||||||
const TRecnotype i = items();
|
TString& classe = get_tmp_string();
|
||||||
if (i > 0)
|
classe = "ca3900a";
|
||||||
{
|
return classe;
|
||||||
*_cur = rand() % i;
|
|
||||||
const TRectype& curr = _rel->curr();
|
|
||||||
const int logicnum = curr.num();
|
|
||||||
switch (logicnum)
|
|
||||||
{
|
|
||||||
case LF_CAUSALI:
|
|
||||||
return curr.get(CAU_CODCAUS);
|
|
||||||
case LF_CDC:
|
|
||||||
return curr.get(CDC_CODCOSTO);
|
|
||||||
case LF_COMMESSE:
|
|
||||||
return curr.get("CODCMS");
|
|
||||||
case LF_FASI:
|
|
||||||
return curr.get(FASI_CODFASE);
|
|
||||||
case LF_PCON:
|
|
||||||
{
|
|
||||||
TString& tmp = get_tmp_string(12);
|
|
||||||
tmp.format("%03d%03d%06ld",
|
|
||||||
curr.get_int(PCN_GRUPPO), curr.get_int(PCN_CONTO), curr.get_long(PCN_SOTTOCONTO));
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
case LF_PCONANA:
|
|
||||||
return curr.get(PCONANA_CODCONTO);
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return EMPTY_STRING;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPrint_stima_ricavi_mask::test_compatible_report()
|
||||||
TCode_generator::TCode_generator(int logicnum)
|
|
||||||
{
|
{
|
||||||
TWait_cursor hourglass;
|
const TString& cls = get_report_class();
|
||||||
TString filter;
|
const TString& name = get(F_REPORT);
|
||||||
|
bool ok = name.not_empty();
|
||||||
if (logicnum <= 0)
|
if (ok)
|
||||||
{
|
{
|
||||||
TConfig& cfg = ca_config();
|
TReport rep;
|
||||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
ok = rep.load(name);
|
||||||
logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
if (ok)
|
||||||
}
|
|
||||||
|
|
||||||
switch (logicnum)
|
|
||||||
{
|
|
||||||
case LF_CAUSALI:
|
|
||||||
filter = "MOVIND=\"X\"";
|
|
||||||
break;
|
|
||||||
case LF_PCON:
|
|
||||||
filter = "SOTTOCONTO!=''";
|
|
||||||
break;
|
|
||||||
case LF_PCONANA:
|
|
||||||
{
|
{
|
||||||
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
const TString& classe = rep.get_class();
|
||||||
const int min_len = info.total_len(-1);
|
ok = classe == cls;
|
||||||
filter << "STR(NUM(LEN(CODCONTO))>" << min_len << ')';
|
}
|
||||||
|
}
|
||||||
|
if (!ok)
|
||||||
|
{
|
||||||
|
set(F_REPORT, cls);
|
||||||
|
TFilename path = cls;
|
||||||
|
path.ext("rep");
|
||||||
|
ok = path.custom_path();
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TPrint_stima_ricavi_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
switch (o.dlg())
|
||||||
|
{
|
||||||
|
case F_REPORT:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
const TString8 lib = get_report_class();
|
||||||
|
TFilename path = o.get();
|
||||||
|
if (select_custom_file(path, "rep", lib))
|
||||||
|
{
|
||||||
|
path = path.name();
|
||||||
|
path.ext("");
|
||||||
|
o.set(path);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if (e == fe_close)
|
||||||
|
{
|
||||||
|
if (!test_compatible_report())
|
||||||
|
return error_box(TR("Impossibile trovare un report compatibile"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return TAnal_report_mask::on_field_event(o, e, jolly);
|
||||||
_rel = new TRelation(logicnum);
|
|
||||||
_cur = new TCursor(_rel, filter);
|
|
||||||
const TRecnotype conti = _cur->items();
|
|
||||||
_cur->freeze();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TCode_generator::~TCode_generator()
|
|
||||||
|
TPrint_stima_ricavi_mask::TPrint_stima_ricavi_mask()
|
||||||
|
:TAnal_report_mask("ca3900")
|
||||||
{
|
{
|
||||||
delete _cur;
|
TConfig& cfg = ca_config();
|
||||||
delete _rel;
|
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||||
|
|
||||||
|
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
||||||
|
const int pconana_levels = pconana_info.levels();
|
||||||
|
|
||||||
|
int prefix = cfg.get_int("PdcPrefix");
|
||||||
|
if (prefix >= pconana_levels)
|
||||||
|
prefix = pconana_levels-1;
|
||||||
|
|
||||||
|
// Controllo se voglio (e posso) usare il conto analitico come prefisso di quello contabile
|
||||||
|
if (use_pdcc && prefix > 0)
|
||||||
|
{
|
||||||
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
||||||
|
const int levels = info.levels();
|
||||||
|
if (levels >= 2 && prefix < levels && esistono_riclassificazioni())
|
||||||
|
{
|
||||||
|
ca_create_fields(*this, 0, LF_PCONANA, 1, 13, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO);
|
||||||
|
|
||||||
|
// Nascondi i campi che non fanno parte del prefisso
|
||||||
|
for (int i = 0; i < levels; i++)
|
||||||
|
{
|
||||||
|
if (i < prefix)
|
||||||
|
{
|
||||||
|
field(F_PRE1 + i).check_type(CHECK_REQUIRED);
|
||||||
|
field(F_PRE1 + i).set_group(6);
|
||||||
|
field(F_PREDES1 + i).set_group(6);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
field(F_PRE1 + i).hide();
|
||||||
|
field(F_PREDES1 + i).hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// setta gli handlers a tutti i campi generati della maschera;senza questa chiamata la on_field_event
|
||||||
|
// non puo' funzionare sui campi generati!!!
|
||||||
|
set_handlers();
|
||||||
|
}
|
||||||
|
|
||||||
|
const TFixed_string CMS_DELLA_MINCHIA("@@@@@@@@@@@@@@@@@@@@");
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
// RECORDSET
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
class TPrint_stima_ricavi_recordset : public TRecordset
|
||||||
|
{
|
||||||
|
TArray _righe;
|
||||||
|
TRecnotype _curr;
|
||||||
|
TArray _colonne;
|
||||||
|
TIndbil_cache _indicatori;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int _anno;
|
||||||
|
bool _vitaintera, _use_fasi;
|
||||||
|
char _tipostima;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual TRecnotype items() const { return _righe.items(); }
|
||||||
|
virtual bool move_to(TRecnotype pos);
|
||||||
|
virtual TRecnotype current_row() const { return _curr; }
|
||||||
|
virtual void requery();
|
||||||
|
virtual const TString& query_text() const { return EMPTY_STRING; }
|
||||||
|
virtual unsigned int columns() const { return _colonne.items(); }
|
||||||
|
virtual const TRecordset_column_info& column_info(unsigned int column) const { return (TRecordset_column_info&) _colonne[column]; }
|
||||||
|
virtual const TVariant& get(unsigned int column) const;
|
||||||
|
virtual const TVariant& get(const char* column_name) const;
|
||||||
|
|
||||||
|
void parse_bill(const TString& bill, TString& gruppo, TString& conto) const;
|
||||||
|
int estrai_saldi(const TRecordset& saldana, const int indbil,
|
||||||
|
TImporto& saldo, TImporto& saldop) const;
|
||||||
|
void aggiorna_importo(TAssoc_array& riga_array, const TString& livello,
|
||||||
|
const int indbil, const TRecordset& saldana, const bool inverti = false) const;
|
||||||
|
TAssoc_array& get_row(TAssoc_array& cms, const char* chiave,
|
||||||
|
const int indice, const TString& codcms, const TString& descrizione);
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void set_filter(const TPrint_stima_ricavi_mask& msk);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool TPrint_stima_ricavi_recordset::move_to(TRecnotype pos)
|
||||||
|
{
|
||||||
|
_curr = pos;
|
||||||
|
return pos >= 0 && pos < items();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TPrint_stima_ricavi_recordset::parse_bill(const TString& bill, TString& gruppo, TString& conto) const
|
||||||
|
{
|
||||||
|
TConfig& cfg = ca_config();
|
||||||
|
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
||||||
|
const int pconana_levels = pconana_info.levels();
|
||||||
|
const int prefix = cfg.get_int("PdcPrefix")-1;
|
||||||
|
|
||||||
|
//lunghezza dell'eventuale prefisso di gruppo e conto
|
||||||
|
const int prefix_len = (prefix >= 0) ? pconana_info.total_len(prefix) : 0;
|
||||||
|
const int gruppo_len = pconana_info.len(prefix + 1);
|
||||||
|
const int conto_len = pconana_info.len(prefix + 2);
|
||||||
|
|
||||||
|
//stringhe con gruppo e conto da mettere nel record dell'assoc_array
|
||||||
|
gruppo = bill.mid(prefix_len, gruppo_len);
|
||||||
|
conto = bill.mid(prefix_len, gruppo_len + conto_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int TPrint_stima_ricavi_recordset::estrai_saldi(const TRecordset& saldana, const int indbil,
|
||||||
|
TImporto& saldo, TImporto& saldop) const
|
||||||
|
{
|
||||||
|
int flag = 0;
|
||||||
|
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
|
||||||
|
saldana.get(SALDANA_SALDO).as_real());
|
||||||
|
saldo = imp_saldo;
|
||||||
|
flag |= saldo.is_zero() ? 0 : 1;
|
||||||
|
|
||||||
|
const TImporto imp_saldop(saldana.get(SALDANA_SEZIONEP).as_string()[0],
|
||||||
|
saldana.get(SALDANA_SALDOP).as_real());
|
||||||
|
const TImporto imp_saldov(saldana.get(SALDANA_SEZIONEV).as_string()[0],
|
||||||
|
saldana.get(SALDANA_SALDOV).as_real());
|
||||||
|
saldop = imp_saldop;
|
||||||
|
saldop += imp_saldov;
|
||||||
|
flag |= saldop.is_zero() ? 0 : 2;
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPrint_stima_ricavi_recordset::aggiorna_importo(TAssoc_array& riga_array,
|
||||||
|
const TString& livello, const int indbil, const TRecordset& saldana, const bool inverti) const
|
||||||
|
{
|
||||||
|
TString* str_imp = (TString*)riga_array.objptr(livello);
|
||||||
|
if (str_imp == NULL)
|
||||||
|
{
|
||||||
|
str_imp = new TString;
|
||||||
|
riga_array.add(livello, str_imp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//dare o avere?
|
||||||
|
const char sezione = indbil == 3 ? 'D' : 'A';
|
||||||
|
TImporto imp(sezione, real(*str_imp));
|
||||||
|
|
||||||
|
//ci sono tutti i tipi di saldo, ma solo quelli che rientrano nei parametri iniziali..
|
||||||
|
//..verranno considerati (_tipostima,indbil)
|
||||||
|
TImporto imp_saldo, imp_saldop;
|
||||||
|
estrai_saldi(saldana, indbil, imp_saldo, imp_saldop);
|
||||||
|
|
||||||
|
if (inverti) // Devo sottrarre l'importo = gli scambio la sezione
|
||||||
|
{
|
||||||
|
imp_saldo.swap_section();
|
||||||
|
imp_saldop.swap_section();
|
||||||
|
}
|
||||||
|
imp += imp_saldo;
|
||||||
|
imp += imp_saldop;
|
||||||
|
|
||||||
|
imp.normalize(sezione);
|
||||||
|
*str_imp = imp.valore().string();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TAssoc_array& TPrint_stima_ricavi_recordset::get_row(TAssoc_array& cms, const char* chiave,
|
||||||
|
const int indice, const TString& codcms,
|
||||||
|
const TString& descrizione)
|
||||||
|
{
|
||||||
|
//cerca se la commessa (e l'eventuale fase) esistono gia' nell'assocarray delle commesse
|
||||||
|
TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave);
|
||||||
|
//se non esiste la crea!
|
||||||
|
if (riga_array == NULL)
|
||||||
|
{
|
||||||
|
riga_array = new TAssoc_array;
|
||||||
|
|
||||||
|
TString4 str_indice; //l'indice va stringato per l'assoc_array
|
||||||
|
str_indice << indice;
|
||||||
|
|
||||||
|
riga_array->add("LEVEL", str_indice);
|
||||||
|
riga_array->add("CODCMS", codcms);
|
||||||
|
riga_array->add("DESCRIZ", descrizione);
|
||||||
|
|
||||||
|
//aggiunge la riga all'array-ino
|
||||||
|
cms.add(chiave, riga_array);
|
||||||
|
}
|
||||||
|
return *riga_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void TPrint_stima_ricavi_recordset::requery()
|
||||||
|
{
|
||||||
|
//prende le date di inizio e fine dell'eserizio selezionato sulla maschera
|
||||||
|
TEsercizi_contabili esc;
|
||||||
|
TDate datainiesc, datafinesc;
|
||||||
|
esc.code2range(_anno, datainiesc, datafinesc);
|
||||||
|
|
||||||
|
//deve procedere al confronto tra le date inizio-fine esercizio e quelle inizio-fine commessa..
|
||||||
|
//..per spostare il record in esame nell'array corretto
|
||||||
|
TAssoc_array cms[4];
|
||||||
|
|
||||||
|
TString query;
|
||||||
|
query = "USE SALDANA";
|
||||||
|
query << "\nTO ANNO=" << _anno;
|
||||||
|
|
||||||
|
TISAM_recordset saldana(query);
|
||||||
|
|
||||||
|
const long saldana_items = saldana.items();
|
||||||
|
|
||||||
|
TProgind pi(saldana_items, "Scansione saldi...", true, true);
|
||||||
|
|
||||||
|
for (bool ok = saldana.move_first(); ok; ok = saldana.move_next())
|
||||||
|
{
|
||||||
|
//progind tanto per gradire
|
||||||
|
pi.addstatus(1);
|
||||||
|
if (pi.iscancelled())
|
||||||
|
break;
|
||||||
|
|
||||||
|
const TString& codconto = saldana.get(SALDANA_CONTO).as_string();
|
||||||
|
//trova l'indicatore di bilancio
|
||||||
|
TString80 conto_anale;
|
||||||
|
const int indbil = _indicatori.get_indbil(codconto, conto_anale);
|
||||||
|
//solo i Costi(3) ed i Ricavi(4) devono essere considerati per la stampa
|
||||||
|
if (indbil == 3 || indbil == 4)
|
||||||
|
{
|
||||||
|
TImporto saldo, saldop;
|
||||||
|
//che tipo di saldi considera?
|
||||||
|
const int flag = estrai_saldi(saldana, indbil, saldo, saldop);
|
||||||
|
if (flag != 0)
|
||||||
|
{
|
||||||
|
const TString& codcms = saldana.get(SALDANA_COMMESSA).as_string();
|
||||||
|
const TString& fase = saldana.get(SALDANA_FASE).as_string();
|
||||||
|
|
||||||
|
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
|
||||||
|
|
||||||
|
const TDate dataini = rec_commesse.get(COMMESSE_DATAINIZIO);
|
||||||
|
const TDate datafine = rec_commesse.get(COMMESSE_DATAFINE);
|
||||||
|
//e' inutile considerare le commesse terminate prima dell'esercizio selezionato..
|
||||||
|
//..cioe' nel passato oppure che iniziano nel futuro!
|
||||||
|
if (datafine >= datainiesc && dataini <= datafinesc)
|
||||||
|
{
|
||||||
|
int indice = datafine <= datafinesc ? 0 : 2;
|
||||||
|
if (dataini >= datainiesc)
|
||||||
|
indice++;
|
||||||
|
|
||||||
|
TString80 chiave = codcms;
|
||||||
|
|
||||||
|
//riempie le righe degli array da mandare poi in stampa
|
||||||
|
//dapprima le righe normali..
|
||||||
|
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms,
|
||||||
|
rec_commesse.get(COMMESSE_DESCRIZ));
|
||||||
|
//aggiunge gli importi e normalizza
|
||||||
|
TString80 gruppo, conto;
|
||||||
|
parse_bill(conto_anale, gruppo, conto);
|
||||||
|
aggiorna_importo(riga_array, gruppo, indbil, saldana);
|
||||||
|
//***** aggiorna_importo(riga_array, conto, indbil, saldana);
|
||||||
|
|
||||||
|
//..poi le righe speciali,che esistono solo se la commessa e' iniziata prima dell'anno
|
||||||
|
//selezionato,quindi se l'indice e' 0 o 2
|
||||||
|
if (indice %2 == 0)
|
||||||
|
{
|
||||||
|
//aggiorna il record speciale con la somma dei saldi con anno anteriore a quello..
|
||||||
|
//..selezionato sulla maschera (CRPA request)
|
||||||
|
const int anno = saldana.get(SALDANA_ANNO).as_int();
|
||||||
|
if (anno < _anno)
|
||||||
|
{
|
||||||
|
TString cazzo_cod; cazzo_cod.format("DETR_%02d", _anno - 1);
|
||||||
|
TString cazzo_descr = "DETRAZIONE PER COMPETENZA ";
|
||||||
|
cazzo_descr << (_anno - 1);
|
||||||
|
TAssoc_array& riga_array = get_row(cms[indice], CMS_DELLA_MINCHIA, indice, cazzo_cod,
|
||||||
|
cazzo_descr);
|
||||||
|
aggiorna_importo(riga_array, gruppo, indbil, saldana, true);
|
||||||
|
//***** aggiorna_importo(riga_array, conto, indbil, saldana, true);
|
||||||
|
}
|
||||||
|
} //if(indice...
|
||||||
|
|
||||||
|
} //if (datafine >= datainiesc &&...
|
||||||
|
} //if (saldop != ZERO..
|
||||||
|
} //if (indbil == 3 ||...
|
||||||
|
|
||||||
|
}
|
||||||
|
//merging dei 4 arrayini cms nell'arrayone _righe da mandare in stampa
|
||||||
|
_righe.destroy();
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
TAssoc_array& a = cms[i];
|
||||||
|
TObject* cazzo_cms = NULL;
|
||||||
|
|
||||||
|
FOR_EACH_ASSOC_OBJECT(a, h, k, r)
|
||||||
|
{
|
||||||
|
TObject* obj = h->remove_obj();
|
||||||
|
if (strcmp(k, CMS_DELLA_MINCHIA) == 0)
|
||||||
|
cazzo_cms = obj;
|
||||||
|
else
|
||||||
|
_righe.add(obj); // Copia nella destinazione la riga corrente e la toglie dall'originale
|
||||||
|
}
|
||||||
|
if (cazzo_cms != NULL)
|
||||||
|
_righe.add(cazzo_cms);
|
||||||
|
} //for(int...
|
||||||
|
}
|
||||||
|
|
||||||
|
const TVariant& TPrint_stima_ricavi_recordset::get(unsigned int column) const
|
||||||
|
{
|
||||||
|
return NULL_VARIANT;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TVariant& TPrint_stima_ricavi_recordset::get(const char* column_name) const
|
||||||
|
{
|
||||||
|
if (_curr >= 0 && _curr < items())
|
||||||
|
{
|
||||||
|
if (*column_name == '#')
|
||||||
|
column_name++;
|
||||||
|
|
||||||
|
TVariant& var = get_tmp_var();
|
||||||
|
if (strcmp(column_name, "ANNO") == 0)
|
||||||
|
{
|
||||||
|
var.set(_anno);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
|
||||||
|
const TString* val = (TString*)riga.objptr(column_name);
|
||||||
|
if (val)
|
||||||
|
var.set(*val);
|
||||||
|
else
|
||||||
|
var.set_null();
|
||||||
|
}
|
||||||
|
return var;
|
||||||
|
}
|
||||||
|
return NULL_VARIANT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TPrint_stima_ricavi_recordset::set_filter(const TPrint_stima_ricavi_mask& msk)
|
||||||
|
{
|
||||||
|
//tira su un po' di parametri dalla maschera...
|
||||||
|
_anno = msk.get_int(F_ESERCIZIO);
|
||||||
|
//prende anche il prefix
|
||||||
|
TString80 prefix;
|
||||||
|
for (short id = F_PRE1; id <= F_PRE3 && msk.id2pos(id) > 0; id++)
|
||||||
|
prefix << msk.get(id);
|
||||||
|
|
||||||
|
_indicatori.set_prefix(prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// REPORT
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
class TPrint_stima_ricavi_rep : public TAnal_report
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual bool set_recordset();
|
||||||
|
virtual bool get_usr_val(const TString& name, TVariant& var) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void set_filter(const TPrint_stima_ricavi_mask& msk);
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TPrint_stima_ricavi_rep::get_usr_val(const TString& name, TVariant& var) const
|
||||||
|
{
|
||||||
|
return TAnal_report::get_usr_val(name, var);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TPrint_stima_ricavi_rep::set_recordset()
|
||||||
|
{
|
||||||
|
TPrint_stima_ricavi_recordset* rs = new TPrint_stima_ricavi_recordset();
|
||||||
|
return TAnal_report::set_recordset(rs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPrint_stima_ricavi_rep::set_filter(const TPrint_stima_ricavi_mask& msk)
|
||||||
|
{
|
||||||
|
TPrint_stima_ricavi_recordset* recset = new TPrint_stima_ricavi_recordset();
|
||||||
|
|
||||||
|
recset->set_filter(msk);
|
||||||
|
TAnal_report::set_recordset(recset);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
// APPLICAZIONE
|
// APPLICAZIONE
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
class TRandom_ca : public TSkeleton_application
|
class TPrint_stima_ricavi : public TSkeleton_application
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
bool chiedi_quanti(int& mov, bool& ric);
|
|
||||||
void kill_bill();
|
|
||||||
void genera(int quanti);
|
|
||||||
void genera_riclass();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void riclassify(const TString& conto);
|
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TRandom_ca::chiedi_quanti(int& mov, bool& ric)
|
void TPrint_stima_ricavi::main_loop()
|
||||||
{
|
{
|
||||||
TMask mask("Movimenti casuali ma perfetti", 1, 60, 6);
|
TPrint_stima_ricavi_mask mask;
|
||||||
|
while (mask.run() == K_ENTER)
|
||||||
TReal_field& add_number (short id, int page, const char* prompt, int x, int y, int dim, const char* flags = "", int ndec = 0);
|
|
||||||
mask.add_number(101, 0, "Numero di movimenti ", 1, 1, 4, "U");
|
|
||||||
mask.add_boolean(102, 0, "Genera riclassificazioni", 1, 2);
|
|
||||||
mask.add_static (DLG_NULL, 0, "@bAttenzione: verranno distrutti movimenti e saldi", 1, 3);
|
|
||||||
mask.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
|
||||||
mask.add_button(DLG_QUIT, 0, "", -22, -1, 10, 2);
|
|
||||||
mask.set(101, 100);
|
|
||||||
const bool ok = mask.run() != K_QUIT;
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
mov = (mask.get_int(101)+1)/2;
|
//report e book dei report
|
||||||
ric = mask.get_bool(102);
|
TReport_book book;
|
||||||
}
|
TString path = mask.get(F_REPORT);
|
||||||
|
if (path.empty())
|
||||||
|
path = "ca3900a";
|
||||||
|
TPrint_stima_ricavi_rep rep;
|
||||||
|
rep.load(path);
|
||||||
|
|
||||||
return ok;
|
rep.set_filter(mask);
|
||||||
}
|
book.add(rep);
|
||||||
|
book.print_or_preview();
|
||||||
void TRandom_ca::kill_bill()
|
}
|
||||||
{
|
|
||||||
const int lnum[] = { LF_MOVANA, LF_RMOVANA, LF_SALDANA, 0 };
|
|
||||||
for (int i = 0; lnum[i]; i++)
|
|
||||||
{
|
|
||||||
TSystemisamfile f(lnum[i]);
|
|
||||||
f.zap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TRandom_ca::riclassify(const TString& conto)
|
|
||||||
{
|
|
||||||
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
||||||
const int min_len = info.total_len(-1);
|
|
||||||
if (conto.len() > min_len)
|
|
||||||
{
|
|
||||||
TRecord_array ric(conto, LF_PANAPDC);
|
|
||||||
|
|
||||||
TCode_generator conti(LF_PCON);
|
|
||||||
const int righe = rand() % 4 + 1;
|
|
||||||
for (int i = 1; i <= righe; i++)
|
|
||||||
{
|
|
||||||
TRectype& row = ric.row(i, true);
|
|
||||||
const TString& c = conti.code();
|
|
||||||
row.put(PCN_GRUPPO, c.mid(0, 3));
|
|
||||||
row.put(PCN_CONTO, c.mid(3, 3));
|
|
||||||
row.put(PCN_SOTTOCONTO, c.mid(6, 6));
|
|
||||||
}
|
|
||||||
ric.write();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool riclass_callback(const TRelation& rel, void* jolly)
|
|
||||||
{
|
|
||||||
TRandom_ca* myself = (TRandom_ca*)jolly;
|
|
||||||
const TString80 conto = rel.curr().get(PCONANA_CODCONTO);
|
|
||||||
myself->riclassify(conto);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TRandom_ca::genera_riclass()
|
|
||||||
{
|
|
||||||
{
|
|
||||||
TSystemisamfile f(LF_PANAPDC);
|
|
||||||
f.zap();
|
|
||||||
}
|
|
||||||
|
|
||||||
TRelation rel(LF_PCONANA);
|
|
||||||
TCursor cur(&rel);
|
|
||||||
cur.scan(riclass_callback, this, "Generazione riclassificazioni");
|
|
||||||
}
|
|
||||||
|
|
||||||
void TRandom_ca::genera(int quanti)
|
|
||||||
{
|
|
||||||
TEsercizi_contabili esc;
|
|
||||||
|
|
||||||
TCode_generator conti(0);
|
|
||||||
TCode_generator commesse(LF_COMMESSE);
|
|
||||||
TCode_generator fasi(LF_FASI);
|
|
||||||
TCode_generator costi(LF_CDC);
|
|
||||||
TCode_generator causali(LF_CAUSALI);
|
|
||||||
|
|
||||||
TLocalisamfile fmov(LF_MOVANA);
|
|
||||||
TProgind pi(quanti, "Generazione movimenti", FALSE, TRUE);
|
|
||||||
for (int m = 0; m < quanti; m++)
|
|
||||||
{
|
|
||||||
pi.addstatus(1);
|
|
||||||
TAnal_mov mov;
|
|
||||||
|
|
||||||
TDate data(TODAY); data -= rand()%365;
|
|
||||||
mov.put(MOVANA_DATAREG, data);
|
|
||||||
mov.put(MOVANA_DATACOMP, data-1L);
|
|
||||||
mov.put(MOVANA_DATADOC, data-2L);
|
|
||||||
mov.put(MOVANA_ANNOES, esc.date2esc(data));
|
|
||||||
mov.put(MOVANA_DESCR, "Movimento random preventivo");
|
|
||||||
mov.put(MOVANA_TIPOMOV, "P");
|
|
||||||
mov.put(MOVANA_CODCAUS, causali.code());
|
|
||||||
|
|
||||||
const int rows = rand()%10+1;
|
|
||||||
TImporto tot;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < rows; i++)
|
|
||||||
{
|
|
||||||
TRectype& rmov = mov.new_row();
|
|
||||||
TString80 descr; descr.format("Riga casuale %d", i+1);
|
|
||||||
rmov.put(RMOVANA_DESCR, descr);
|
|
||||||
rmov.put(RMOVANA_CODCONTO, conti.code());
|
|
||||||
rmov.put(RMOVANA_CODCMS, commesse.code());
|
|
||||||
rmov.put(RMOVANA_CODFASE, fasi.code());
|
|
||||||
rmov.put(RMOVANA_CODCCOSTO, costi.code());
|
|
||||||
|
|
||||||
const TImporto imp(i & 0x1 ? 'A' : 'D', real(10*(rand()%1000+1)));
|
|
||||||
rmov.put(RMOVANA_SEZIONE, imp.sezione());
|
|
||||||
rmov.put(RMOVANA_IMPORTO, imp.valore());
|
|
||||||
tot += imp;
|
|
||||||
}
|
|
||||||
|
|
||||||
tot.normalize();
|
|
||||||
mov.put(MOVANA_SEZIONE, tot.sezione());
|
|
||||||
mov.put(MOVANA_TOTDOC, tot.valore());
|
|
||||||
|
|
||||||
mov.write(fmov);
|
|
||||||
|
|
||||||
// Consuntivo
|
|
||||||
mov.put(MOVANA_NUMREG, mov.get_long(MOVANA_NUMREG)+1);
|
|
||||||
data += rand()%30+30;
|
|
||||||
mov.put(MOVANA_DATAREG, data);
|
|
||||||
mov.put(MOVANA_DATACOMP, data-1L);
|
|
||||||
mov.put(MOVANA_DATADOC, data-2L);
|
|
||||||
mov.put(MOVANA_ANNOES, esc.date2esc(data));
|
|
||||||
mov.put(MOVANA_DESCR, "Movimento random consuntivo");
|
|
||||||
mov.put(MOVANA_TIPOMOV, "");
|
|
||||||
|
|
||||||
tot.set('D', ZERO);
|
|
||||||
for (i = 1; i <= rows; i++)
|
|
||||||
{
|
|
||||||
TRectype& rmov = mov.body()[i];
|
|
||||||
real imp = rmov.get(RMOVANA_IMPORTO);
|
|
||||||
imp += real((rand()%100)-50);
|
|
||||||
rmov.put(RMOVANA_IMPORTO, imp);
|
|
||||||
tot += TImporto(rmov.get_char(RMOVANA_SEZIONE), imp);
|
|
||||||
}
|
|
||||||
tot.normalize();
|
|
||||||
mov.put(MOVANA_SEZIONE, tot.sezione());
|
|
||||||
mov.put(MOVANA_TOTDOC, tot.valore());
|
|
||||||
|
|
||||||
mov.write(fmov);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TRandom_ca::main_loop()
|
|
||||||
{
|
|
||||||
int quanti = 100;
|
|
||||||
bool ric = false;
|
|
||||||
if (chiedi_quanti(quanti, ric))
|
|
||||||
{
|
|
||||||
if (quanti > 0)
|
|
||||||
{
|
|
||||||
kill_bill();
|
|
||||||
genera(quanti);
|
|
||||||
}
|
|
||||||
if (ric)
|
|
||||||
genera_riclass();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ca3900(int argc, char* argv[])
|
int ca3900(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TRandom_ca a;
|
TPrint_stima_ricavi a;
|
||||||
a.run(argc, argv, TR("Movimenti casuali ma perfetti"));
|
a.run(argc, argv, TR("Stampa stima ricavi di competenza"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
23
ca/ca3900.h
Executable file
23
ca/ca3900.h
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef __CA3900_H
|
||||||
|
#define __CA3900_H
|
||||||
|
|
||||||
|
#define F_DITTA 101
|
||||||
|
#define F_RAGSOC 102
|
||||||
|
#define F_DATASTAMPA 103
|
||||||
|
#define F_ESERCIZIO 104
|
||||||
|
#define F_REPORT 105
|
||||||
|
#define F_INIZIO_ES 106
|
||||||
|
#define F_FINE_ES 107
|
||||||
|
|
||||||
|
//campi generati dai piani dei conti
|
||||||
|
#define F_PRE0 320
|
||||||
|
#define F_PRE1 321
|
||||||
|
#define F_PRE2 322
|
||||||
|
#define F_PRE3 323
|
||||||
|
#define F_PREDES0 324
|
||||||
|
#define F_PREDES1 325
|
||||||
|
#define F_PREDES2 326
|
||||||
|
#define F_PREDES3 327
|
||||||
|
|
||||||
|
#endif // __CA3900_H
|
||||||
|
|
88
ca/ca3900.uml
Executable file
88
ca/ca3900.uml
Executable file
@ -0,0 +1,88 @@
|
|||||||
|
#include "ca3900.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 -3 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_PRINT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 "~Stampa"
|
||||||
|
MESSAGE EXIT,K_ENTER
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Stima ricavi di competenza" -1 -1 0 -3
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 76 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 0 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_DITTA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Ditta "
|
||||||
|
FLAGS "DF"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 2 ""
|
||||||
|
USE LF_NDITTE
|
||||||
|
INPUT CODDITTA F_DITTA
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_ESERCIZIO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Esercizio "
|
||||||
|
FLAGS "AZ"
|
||||||
|
USE ESC
|
||||||
|
INPUT CODTAB F_ESERCIZIO
|
||||||
|
DISPLAY "Codice esercizio" CODTAB
|
||||||
|
DISPLAY "Inizio esercizio" D0
|
||||||
|
DISPLAY "Fine esercizio" D1
|
||||||
|
OUTPUT F_ESERCIZIO CODTAB
|
||||||
|
OUTPUT F_INIZIO_ES D0
|
||||||
|
OUTPUT F_FINE_ES D1
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_INIZIO_ES
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 3 "Inizio "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_FINE_ES
|
||||||
|
BEGIN
|
||||||
|
PROMPT 44 3 "Fine "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATASTAMPA
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Data stampa "
|
||||||
|
FLAGS "A"
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX F_PRE0 76 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 0 12 "@bPrefisso del piano dei conti analitico:"
|
||||||
|
GROUP 6
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_REPORT 256 64
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 20 "Report "
|
||||||
|
FLAGS "B"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
271
ca/ca3900a.rep
Executable file
271
ca/ca3900a.rep
Executable file
@ -0,0 +1,271 @@
|
|||||||
|
|
||||||
|
<report libraries="ve1300" name="ca3900a" orientation="2" lpi="6" class="ca3900a">
|
||||||
|
<description>Stima ricavi di competenza CA</description>
|
||||||
|
<font face="Arial Narrow" size="8" />
|
||||||
|
<section type="Head">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<field x="1" type="Stringa" width="50" pattern="1">
|
||||||
|
<source>#SYSTEM.RAGSOC</source>
|
||||||
|
</field>
|
||||||
|
<field x="80" type="Data" width="12" pattern="1">
|
||||||
|
<source>#SYSTEM.DATE</source>
|
||||||
|
</field>
|
||||||
|
<field x="165" type="Numero" align="right" width="3" pattern="1">
|
||||||
|
<source>#REPORT.PAGE</source>
|
||||||
|
</field>
|
||||||
|
<field border="2" x="1" y="1.5" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field x="66.5" y="2" type="Testo" align="center" width="8" pattern="1" text="COSTI" />
|
||||||
|
<field x="110" y="2" type="Testo" align="center" width="20" pattern="1" text="RICAVI" />
|
||||||
|
<field x="155" y="2.25" type="Testo" align="right" width="8" pattern="1" text="Margine" />
|
||||||
|
<field x="54" y="3" type="Testo" align="right" width="8" pattern="1" text="Budget" />
|
||||||
|
<field x="64" y="3" type="Testo" align="right" width="12" pattern="1" text="Maturati" />
|
||||||
|
<field x="78" y="3" type="Testo" align="right" width="12" pattern="1" text="Avanzamento" />
|
||||||
|
<field x="91" y="3" type="Testo" align="right" width="12" pattern="1" text="Budget" />
|
||||||
|
<field x="105" y="3" type="Testo" align="right" width="12" pattern="1" text="Competenza" />
|
||||||
|
<field x="119" y="3" type="Testo" align="right" width="12" pattern="1" text="Accertato" />
|
||||||
|
<field x="133" y="3" type="Testo" align="right" width="12" pattern="1" text="Integrazione" />
|
||||||
|
<field x="153" y="3" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " />
|
||||||
|
<field border="1" x="1" y="4" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field x="1" y="3" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
|
||||||
|
</section>
|
||||||
|
<section type="Head" level="1" height="4">
|
||||||
|
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
|
||||||
|
MESSAGE RESET,F1.102
|
||||||
|
MESSAGE RESET,F1.103
|
||||||
|
MESSAGE RESET,F1.104
|
||||||
|
MESSAGE RESET,F1.105
|
||||||
|
MESSAGE RESET,F1.106
|
||||||
|
MESSAGE RESET,F1.107
|
||||||
|
MESSAGE RESET,F1.108</prescript>
|
||||||
|
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="STIMA RICAVI DI COMPETENZA">
|
||||||
|
<font face="Courier New" bold="1" size="16" />
|
||||||
|
</field>
|
||||||
|
<field border="2" x="1" y="3.5" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
</section>
|
||||||
|
<section type="Head" level="2" height="1.5" page_break="1">
|
||||||
|
<groupby>LEVEL C; 2</groupby>
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2.101
|
||||||
|
MESSAGE RESET,F2.102
|
||||||
|
MESSAGE RESET,F2.103
|
||||||
|
MESSAGE RESET,F2.104
|
||||||
|
MESSAGE RESET,F2.105
|
||||||
|
MESSAGE RESET,F2.106
|
||||||
|
MESSAGE RESET,F2.107
|
||||||
|
MESSAGE RESET,F2.108</prescript>
|
||||||
|
<field x="1" type="Array" bg_color="#C0C0C0" width="22">
|
||||||
|
<source>LEVEL</source>
|
||||||
|
<list>
|
||||||
|
<li Value="Commesse terminate nel" Code="0" />
|
||||||
|
<li Value="Commesse terminate nel" Code="1" />
|
||||||
|
<li Value="Commesse in corso entro fine" Code="2" />
|
||||||
|
<li Value="Commesse in corso entro fine" Code="3" />
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||||
|
<source>ANNO</source>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="1" y="1.25" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1">
|
||||||
|
<source>LEVEL</source>
|
||||||
|
<postscript description="H2.101 POSTSCRIPT">MESSAGE COPY,F2.101</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="29" type="Numero" hidden="1" align="right" width="4" id="102" pattern="1">
|
||||||
|
<source>ANNO</source>
|
||||||
|
<postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Head" level="3" height="1.5">
|
||||||
|
<groupby>LEVEL</groupby>
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<prescript description="H3 PRESCRIPT">MESSAGE RESET,F3.101
|
||||||
|
MESSAGE RESET,F3.102
|
||||||
|
MESSAGE RESET,F3.103
|
||||||
|
MESSAGE RESET,F3.104
|
||||||
|
MESSAGE RESET,F3.105
|
||||||
|
MESSAGE RESET,F3.106
|
||||||
|
MESSAGE RESET,F3.107
|
||||||
|
MESSAGE RESET,F3.108</prescript>
|
||||||
|
<field x="3" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
|
||||||
|
<source>LEVEL</source>
|
||||||
|
<list>
|
||||||
|
<li Value="Commesse avviate in esercizi precedenti" Code="0" />
|
||||||
|
<li Value="Commesse avviate nell'esercizio selezionato" Code="1" />
|
||||||
|
<li Value="Commesse avviate in esercizi precedenti" Code="2" />
|
||||||
|
<li Value="Commesse avviate nell'esercizio selezionato" Code="3" />
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field border="1" x="2" y="1.25" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1">
|
||||||
|
<source>LEVEL</source>
|
||||||
|
<postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Body" />
|
||||||
|
<section type="Body" level="1">
|
||||||
|
<field x="1" type="Stringa" width="16" pattern="1">
|
||||||
|
<source>CODCMS</source>
|
||||||
|
</field>
|
||||||
|
<field x="17" type="Stringa" dynamic_height="1" width="30" height="2" pattern="1">
|
||||||
|
<source>DESCRIZ</source>
|
||||||
|
</field>
|
||||||
|
<field x="160" type="Testo" align="center" width="2" pattern="1" text="%" />
|
||||||
|
<field x="48" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#COS_BDG</source>
|
||||||
|
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F3.101</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="62" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#COS_MAT</source>
|
||||||
|
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F3.102</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="80" type="Numero" align="right" width="6" id="103" pattern="1" text="###,@@">
|
||||||
|
<source>#102F;#101*100</source>
|
||||||
|
</field>
|
||||||
|
<field x="89" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#RIC_BDG</source>
|
||||||
|
<postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F3.104</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="103" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#103*#104F;100</source>
|
||||||
|
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F3.105</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="117" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#RIC_MAT</source>
|
||||||
|
<postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F3.106</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="131" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#105-#106</source>
|
||||||
|
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F3.107</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="147" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#102-#106</source>
|
||||||
|
<postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F3.108</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="162" type="Numero" align="right" width="5" id="109" pattern="1">
|
||||||
|
<font italic="1" face="Arial Narrow" size="8" />
|
||||||
|
<prescript description="B1.109 PRESCRIPT">#105 @
|
||||||
|
0
|
||||||
|
=
|
||||||
|
IF
|
||||||
|
0
|
||||||
|
ELSE
|
||||||
|
#108 @
|
||||||
|
#105 @
|
||||||
|
F;
|
||||||
|
100
|
||||||
|
*
|
||||||
|
0
|
||||||
|
ROUND
|
||||||
|
THEN
|
||||||
|
#THIS !</prescript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Foot" />
|
||||||
|
<section type="Foot" level="1" height="3">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<field border="2" x="1" y="0.75" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field x="1" y="1.5" type="Testo" fg_color="#FFFFFF" bg_color="#000000" width="25" height="1.5" text="TOTALI GENERALI " />
|
||||||
|
<field x="48" y="1.5" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@" />
|
||||||
|
<field x="62" y="1.5" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@" />
|
||||||
|
<field x="80" y="1.5" type="Numero" align="right" width="6" id="103" pattern="1" text="###,@@">
|
||||||
|
<source>#102F;#101*100</source>
|
||||||
|
</field>
|
||||||
|
<field x="89" y="1.5" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@" />
|
||||||
|
<field x="103" y="1.5" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@" />
|
||||||
|
<field x="117" y="1.5" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@" />
|
||||||
|
<field x="131" y="1.5" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@" />
|
||||||
|
<field x="149" y="1.5" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@" />
|
||||||
|
</section>
|
||||||
|
<section type="Foot" level="2" height="2.5">
|
||||||
|
<font italic="1" face="Courier New" bold="1" size="8" />
|
||||||
|
<field border="1" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field x="1" y="1" type="Array" bg_color="#C0C0C0" width="28">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<source>H2.101</source>
|
||||||
|
<list>
|
||||||
|
<li Value="TOTALI Commesse terminate nel" Code="0" />
|
||||||
|
<li Value="TOTALI Commesse terminate nel" Code="1" />
|
||||||
|
<li Value="TOTALI Commesse in corso entro fine" Code="2" />
|
||||||
|
<li Value="TOTALI Commesse in corso entro fine" Code="3" />
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<source>H2.102</source>
|
||||||
|
</field>
|
||||||
|
<field y="1" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" />
|
||||||
|
<field x="48" y="1" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="35" y="1" type="Numero" hidden="1" align="right" width="4" id="102" pattern="1">
|
||||||
|
<postscript description="F2.102 POSTSCRIPT">MESSAGE COPY,F2.101</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="62" y="1" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="80" y="1" type="Numero" align="right" width="6" id="103" pattern="1" text="###,@@">
|
||||||
|
<source>#102F;#101*100</source>
|
||||||
|
</field>
|
||||||
|
<field x="89" y="1" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.104 POSTSCRIPT">MESSAGE ADD,F1.104</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="103" y="1" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.105 POSTSCRIPT">MESSAGE ADD,F1.105</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="117" y="1" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.106 POSTSCRIPT">MESSAGE ADD,F1.106</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="131" y="1" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.107 POSTSCRIPT">MESSAGE ADD,F1.107</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="149" y="1" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<postscript description="F2.108 POSTSCRIPT">MESSAGE ADD,F1.108</postscript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Foot" level="3" height="2">
|
||||||
|
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||||
|
<field border="1" x="2" y="0.25" type="Linea" width="169" height="0" pattern="1" />
|
||||||
|
<field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
|
||||||
|
<source>H3.101</source>
|
||||||
|
<list>
|
||||||
|
<li Value="TOTALI Commesse avviate in esercizi precedenti" Code="0" />
|
||||||
|
<li Value="TOTALI Commesse avviate nell'esercizio selezionato" Code="1" />
|
||||||
|
<li Value="TOTALI Commesse avviate in esercizi precedenti" Code="2" />
|
||||||
|
<li Value="TOTALI Commesse avviate nell'esercizio selezionato" Code="3" />
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
<field y="0.5" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" />
|
||||||
|
<field x="48" y="0.5" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.101 POSTSCRIPT">MESSAGE ADD,F2.101</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="62" y="0.5" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.102 POSTSCRIPT">MESSAGE ADD,F2.102</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="80" y="0.5" type="Numero" align="right" width="6" id="103" pattern="1" text="###,@@">
|
||||||
|
<source>#102F;#101*100</source>
|
||||||
|
</field>
|
||||||
|
<field x="89" y="0.5" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.104 POSTSCRIPT">MESSAGE ADD,F2.104</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="103" y="0.5" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.105 POSTSCRIPT">MESSAGE ADD,F2.105</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="117" y="0.5" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.106 POSTSCRIPT">MESSAGE ADD,F2.106</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="131" y="0.5" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.107 POSTSCRIPT">MESSAGE ADD,F2.107</postscript>
|
||||||
|
</field>
|
||||||
|
<field x="149" y="0.5" type="Valuta" align="right" width="13" id="108" pattern="1" text="###.###.###,@@">
|
||||||
|
<postscript description="F3.108 POSTSCRIPT">MESSAGE ADD,F2.108</postscript>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<sql>USE SALDANA</sql>
|
||||||
|
</report>
|
@ -65,6 +65,7 @@ Item_04 = "Bilancio", "ca3 -2", "F"
|
|||||||
Item_05 = "Pagato", "ca3 -5", "F"
|
Item_05 = "Pagato", "ca3 -5", "F"
|
||||||
Item_06 = "Rendiconto", "ca3 -6", "F"
|
Item_06 = "Rendiconto", "ca3 -6", "F"
|
||||||
Item_07 = "Bilancio di commessa", "ca3 -7", "F"
|
Item_07 = "Bilancio di commessa", "ca3 -7", "F"
|
||||||
|
Item_08 = "Stima ricavi di competenza", "ca3 -8", "F"
|
||||||
|
|
||||||
[CAMENU_050]
|
[CAMENU_050]
|
||||||
Caption = "Servizi"
|
Caption = "Servizi"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user