Partch 424Patch level : 12.0 424

Files correlati     : ca0.ex ca0800a.msk ca1.exe ca1800a.msk ca2.exe ca2100a.uml
ca3.exe ca3200.msk ca3200b.rep ca3300.msk ca3700.msk ca3700a.rep ca3700b.rep ca3800a.rep ca3800b.rep ca3800c.rep ca3900.msk ca3900a.rep ca39

Disabilitato il Flag di IVA per cassa se è un reverse charge.


git-svn-id: svn://10.65.10.50/branches/R_10_00@23991 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2017-07-24 17:24:41 +00:00
parent c2574f0e21
commit 252db5bd07
34 changed files with 6754 additions and 4810 deletions

View File

@ -1,413 +1,418 @@
// gestione files Contabilita' Analitica: COMMESSE
#include <execp.h>
#include <recset.h>
#include <relapp.h>
#include "calib01.h"
#include "ca0600a.h"
#include "commesse.h"
#include "cfcms.h"
////////////////////////////////////////////////////////////////////////
//MASCHERA
////////////////////////////////////////////////////////////////////////
class TCms_anal_msk : public TSimple_anal_msk
{
protected:
virtual int get_logicnum() const { return LF_COMMESSE; }
public:
TCms_anal_msk();
};
TCms_anal_msk::TCms_anal_msk()
{
read("ca0600a");
ca_create_fields(*this, 2, LF_CDC, 1, 1, F_CMS_CDC1, F_CMS_CDCDES1, 0x0, COMMESSE_CODCOSTO);
const bool use_pdcc = ca_config().get_bool("UsePdcc");
const int nfields = ca_create_fields(*this, 3, use_pdcc ? LF_PCON : LF_PCONANA, 2, 2, F_CMSPDA1, F_CMSDES1, 0x0, COMMESSE_CODCONTO);
int from = 1;
for (int i = 0; i < nfields; i++)
{
TEdit_field & e = efield(F_CMSPDA1 + i);
e.check_type(CHECK_NORMAL);
TFieldref * fr = (TFieldref *) e.field();
if (fr != NULL)
{
fr->set_from(from);
if (i < 2)
from += 3;
else
from += 6;
fr->set_to(from - 1);
}
}
}
////////////////////////////////////////////////////////////////////////
//APPLICAZIONE
////////////////////////////////////////////////////////////////////////
// applicazione per la gestione delle commesse
class TCms_app : public TAnal_app
{
int _maxlev;
bool _has_filter;
protected:
void fin2row(const TMask& m);
void for2row(const TMask& m);
void row2fin(const TMask& m);
void row2for(const TMask& m);
virtual int read(TMask& m);
virtual int write(const TMask& m);
virtual int rewrite(const TMask& m);
virtual bool remove();
virtual void ini2mask(TConfig& ini, TMask&m, bool query);
virtual void mask2ini(const TMask& m, TConfig& ini);
virtual bool filtered() const;
virtual void init_modify_mode(TMask& mask);
virtual void init_insert_mode(TMask& mask);
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TCms_anal_msk; }
virtual bool user_create();
};
void TCms_app::fin2row(const TMask& m)
{
const TRelation * r = get_relation();
TToken_string key;
key.add(r->curr().get(COMMESSE_CODCMS));
key.add("C");
TRecord_array fins(key, LF_CFCMS);
const int items = fins.rows();
TSheet_field & s = m.sfield(F_CMS_FINAN);
s.destroy();
for (int i = 1; i <= items; i++)
{
const TRectype & rec = fins[i];
TToken_string & str = s.row(i - 1);
str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFIN));
str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFIN));
str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFIN));
str.add(rec.get(CFCMS_CIG), s.cid2index(F_CMS_CIGFIN));
str.add(rec.get(CFCMS_PERCFIN), s.cid2index(F_CMS_PERCFINFIN));
str.add(rec.get(CFCMS_DESCR), s.cid2index(F_CMS_DESCRFIN));
s.check_row(i - 1);
}
s.force_update();
}
void TCms_app::for2row(const TMask& m)
{
const TRelation * r = get_relation();
TToken_string key;
key.add(r->curr().get(COMMESSE_CODCMS));
key.add("F");
TRecord_array fors(key, LF_CFCMS);
const int items = fors.rows();
TSheet_field & s = m.sfield(F_CMS_FORN);
s.destroy();
for (int i = 1; i <= items; i++)
{
const TRectype & rec = fors[i];
TToken_string & str = s.row(i - 1);
str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFOR));
str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFOR));
str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFOR));
str.add(rec.get(CFCMS_CIG), s.cid2index(F_CMS_CUPFOR));
s.check_row(i - 1);
}
s.force_update();
}
int TCms_app::read(TMask& m)
{
int err = TAnal_app::read(m);
if (err == NOERR)
{
fin2row(m);
for2row(m);
}
return err;
}
void TCms_app::row2fin(const TMask& m)
{
TRelation * r = get_relation();
TToken_string key;
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("C");
TRecord_array fins(key, LF_CFCMS);
TSheet_field & s = m.sfield(F_CMS_FINAN);
const int items = s.items();
fins.destroy_rows();
for (int i = 0; i < items; i++)
{
TRectype & rec = fins.row(i + 1, true);
TToken_string & str = s.row(i);
rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFIN)));
rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFIN)));
rec.put(CFCMS_CUP, str.get(s.cid2index(F_CMS_CUPFIN)));
rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFIN)));
rec.put(CFCMS_PERCFIN, str.get(s.cid2index(F_CMS_PERCFINFIN)));
rec.put(CFCMS_DESCR, str.get(s.cid2index(F_CMS_DESCRFIN)));
}
fins.write(true);
}
void TCms_app::row2for(const TMask& m)
{
TRelation * r = get_relation();
TToken_string key;
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("F");
TRecord_array fors(key, LF_CFCMS);
TSheet_field & s = m.sfield(F_CMS_FORN);
const int items = s.items();
fors.destroy_rows();
for (int i = 0; i < items; i++)
{
TRectype & rec = fors.row(i + 1, true);
TToken_string & str = s.row(i);
rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFOR)));
rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFOR)));
rec.put(CFCMS_CUP, str.get(s.cid2index(F_CMS_CUPFOR)));
rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFOR)));
}
fors.write(true);
}
int TCms_app::write(const TMask& m)
{
TRelation * r = get_relation();
m.autosave(*r);
int err = TAnal_app::write(m);
if (err == NOERR)
{
row2fin(m);
row2for(m);
}
return err;
}
int TCms_app::rewrite(const TMask& m)
{
TRelation * r = get_relation();
m.autosave(*r);
int err = TAnal_app::rewrite(m);
if (err == NOERR)
{
row2fin(m);
row2for(m);
}
return err;
}
bool TCms_app::remove()
{
int err = TAnal_app::remove();
if (err == NOERR)
{
TRelation * r = get_relation();
TToken_string key;
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("C");
TRecord_array fins(key, LF_CFCMS);
err = fins.remove();
if (err == NOERR)
{
key.cut(0);
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("F");
TRecord_array fors(key, LF_CFCMS);
err = fors.remove();
}
}
return err == NOERR;
}
void TCms_app::ini2mask(TConfig& ini, TMask& m, bool query)
{
TString p;
const TRelation * r = get_relation();
TAnal_app::ini2mask(ini, m, query);
if (!query)
{
int i;
p << LF_CFCMS << ",C";
TSheet_field & si = m.sfield(F_CMS_FINAN);
for (i = 0; ; i++)
{
TString para(p); para << "," << i + 1;
const long codcf = ini.get_long(CFCMS_CODCF, para);
if (codcf == 0L)
break;
TToken_string & row = si.row(i);
row.add(codcf, si.cid2index(F_CMS_CODFIN));
row.add(ini.get(CFCMS_NRIGABAN, para), si.cid2index(F_CMS_NRIGABANFIN));
row.add(ini.get(CFCMS_CUP, para), si.cid2index(F_CMS_CUPFIN));
row.add(ini.get(CFCMS_CIG, para), si.cid2index(F_CMS_CIGFIN));
row.add(ini.get(CFCMS_PERCFIN, para), si.cid2index(F_CMS_PERCFINFIN));
row.add(ini.get(CFCMS_DESCR, para), si.cid2index(F_CMS_DESCRFIN));
si.update_mask(i - 1);
}
si.force_update();
p.cut(0);
p << LF_CFCMS << ",F";
TSheet_field & so = m.sfield(F_CMS_FORN);
for (i = 0; ; i++)
{
TString para(p); para << "," << i + 1;
const long codcf = ini.get_long(CFCMS_CODCF, para);
if (codcf == 0L)
break;
TToken_string & row = so.row(i);
row.add(codcf, so.cid2index(F_CMS_CODFOR));
row.add(ini.get(CFCMS_NRIGABAN, para), so.cid2index(F_CMS_NRIGABANFOR));
row.add(ini.get(CFCMS_CUP, para), so.cid2index(F_CMS_CUPFOR));
row.add(ini.get(CFCMS_CIG, para), so.cid2index(F_CMS_CIGFOR));
so.update_mask(i - 1);
}
so.force_update();
}
}
void TCms_app::mask2ini(const TMask& m, TConfig& ini)
{
TString p;
const TRelation * r = get_relation();
TAnal_app::mask2ini(m, ini);
p << LF_CFCMS << ",C";
TSheet_field & si = m.sfield(F_CMS_FINAN);
int items = si.items();
for (int i = 0; i < items; i++)
{
TString para(p); para << "," << i + 1;
TToken_string & row = si.row(i);
ini.set(CFCMS_CODCF, row.get(si.cid2index(F_CMS_CODFIN)), para);
ini.set(CFCMS_NRIGABAN, row.get(si.cid2index(F_CMS_NRIGABANFIN)), para);
ini.set(CFCMS_CUP, row.get(si.cid2index(F_CMS_CUPFIN)), para);
ini.set(CFCMS_CIG, row.get(si.cid2index(F_CMS_CIGFIN)), para);
ini.set(CFCMS_PERCFIN, row.get(si.cid2index(F_CMS_PERCFINFIN)), para);
ini.set(CFCMS_DESCR, row.get(si.cid2index(F_CMS_DESCRFIN)), para);
}
p.cut(0);
p << LF_CFCMS << ",F";
TSheet_field & so = m.sfield(F_CMS_FORN);
items = so.items();
for (int i = 0; i < items; i++)
{
TString para(p); para << "," << i + 1;
TToken_string & row = so.row(i);
ini.set(CFCMS_CODCF, row.get(so.cid2index(F_CMS_CODFOR)), para);
ini.set(CFCMS_NRIGABAN, row.get(so.cid2index(F_CMS_NRIGABANFOR)), para);
ini.set(CFCMS_CUP, row.get(so.cid2index(F_CMS_CUPFOR)), para);
ini.set(CFCMS_CIG, row.get(so.cid2index(F_CMS_CIGFOR)), para);
}
}
bool TCms_app::filtered() const
{
if (_has_filter)
return true;
return TAnal_app::filtered();
}
//non si può eliminare una commessa se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente
bool TCms_app::protected_record(TRectype& record)
{
TString query;
query << "USE SALDANA\nSELECT COMMESSA==#COMMESSA\nFROM ANNO=#ANNO\n";
const TString commessa = record.get(COMMESSE_CODCMS);
const TDate today(TODAY);
const long anno = today.year();
TISAM_recordset saldana_recset(query);
saldana_recset.set_var("#COMMESSA", TVariant(commessa));
saldana_recset.set_var("#ANNO", TVariant(anno - 1));
const long items = saldana_recset.items();
return items > 0;
}
void TCms_app::init_modify_mode(TMask& mask)
{
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1 , 1);
mask.enable(-1, mask.get(id).not_empty());
TAnal_app::init_modify_mode(mask);
}
void TCms_app::init_insert_mode(TMask& mask)
{
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1, 1);
mask.enable(-1, mask.get(id).not_empty());
TAnal_app::init_insert_mode(mask);
}
bool TCms_app::user_create()
{
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_COMMESSE);
_maxlev = mci.levels();
if (_maxlev <= 0)
return error_box(TR("Le commesse non sono state configurate"));
//eventuali filtri per utente
_has_filter = cache().get("%AUC", user(), "S0").full();
return TAnal_app::user_create();
}
int ca0600(int argc, char* argv[])
{
TCms_app a;
a.run(argc, argv, TR("Commesse"));
return 0;
}
// gestione files Contabilita' Analitica: COMMESSE
#include <execp.h>
#include <recset.h>
#include <relapp.h>
#include "calib01.h"
#include "ca0600a.h"
#include "commesse.h"
#include "cfcms.h"
////////////////////////////////////////////////////////////////////////
//MASCHERA
////////////////////////////////////////////////////////////////////////
class TCms_anal_msk : public TSimple_anal_msk
{
protected:
virtual int get_logicnum() const { return LF_COMMESSE; }
public:
TCms_anal_msk();
};
TCms_anal_msk::TCms_anal_msk()
{
read("ca0600a");
ca_create_fields(*this, 2, LF_CDC, 1, 1, F_CMS_CDC1, F_CMS_CDCDES1, 0x0, COMMESSE_CODCOSTO);
const bool use_pdcc = ca_config().get_bool("UsePdcc");
const int nfields = ca_create_fields(*this, 3, use_pdcc ? LF_PCON : LF_PCONANA, 2, 2, F_CMSPDA1, F_CMSDES1, 0x0, COMMESSE_CODCONTO);
int from = 1;
for (int i = 0; i < nfields; i++)
{
TEdit_field & e = efield(F_CMSPDA1 + i);
e.check_type(CHECK_NORMAL);
TFieldref * fr = (TFieldref *) e.field();
if (fr != NULL)
{
fr->set_from(from);
if (i < 2)
from += 3;
else
from += 6;
fr->set_to(from - 1);
}
}
}
////////////////////////////////////////////////////////////////////////
//APPLICAZIONE
////////////////////////////////////////////////////////////////////////
// applicazione per la gestione delle commesse
class TCms_app : public TAnal_app
{
int _maxlev;
bool _has_filter;
protected:
void fin2row(const TMask& m);
void for2row(const TMask& m);
void row2fin(const TMask& m);
void row2for(const TMask& m);
virtual int read(TMask& m);
virtual int write(const TMask& m);
virtual int rewrite(const TMask& m);
virtual bool remove();
virtual void ini2mask(TConfig& ini, TMask&m, bool query);
virtual void mask2ini(const TMask& m, TConfig& ini);
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool filtered() const;
virtual void init_modify_mode(TMask& mask);
virtual void init_insert_mode(TMask& mask);
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TCms_anal_msk; }
virtual bool user_create();
public:
TCms_app() {}
};
void TCms_app::fin2row(const TMask& m)
{
const TRelation * r = get_relation();
TToken_string key;
key.add(r->curr().get(COMMESSE_CODCMS));
key.add("C");
TRecord_array fins(key, LF_CFCMS);
const int items = fins.rows();
TSheet_field & s = m.sfield(F_CMS_FINAN);
s.destroy();
for (int i = 1; i <= items; i++)
{
const TRectype & rec = fins[i];
TToken_string & str = s.row(i - 1);
str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFIN));
str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFIN));
str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFIN));
str.add(rec.get(CFCMS_CIG), s.cid2index(F_CMS_CIGFIN));
str.add(rec.get(CFCMS_PERCFIN), s.cid2index(F_CMS_PERCFINFIN));
str.add(rec.get(CFCMS_DESCR), s.cid2index(F_CMS_DESCRFIN));
s.check_row(i - 1);
}
s.force_update();
}
void TCms_app::for2row(const TMask& m)
{
const TRelation * r = get_relation();
TToken_string key;
key.add(r->curr().get(COMMESSE_CODCMS));
key.add("F");
TRecord_array fors(key, LF_CFCMS);
const int items = fors.rows();
TSheet_field & s = m.sfield(F_CMS_FORN);
s.destroy();
for (int i = 1; i <= items; i++)
{
const TRectype & rec = fors[i];
TToken_string & str = s.row(i - 1);
str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFOR));
str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFOR));
str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFOR));
str.add(rec.get(CFCMS_CIG), s.cid2index(F_CMS_CUPFOR));
s.check_row(i - 1);
}
s.force_update();
}
int TCms_app::read(TMask& m)
{
int err = TAnal_app::read(m);
if (err == NOERR)
{
fin2row(m);
for2row(m);
}
return err;
}
void TCms_app::row2fin(const TMask& m)
{
TRelation * r = get_relation();
TToken_string key;
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("C");
TRecord_array fins(key, LF_CFCMS);
TSheet_field & s = m.sfield(F_CMS_FINAN);
const int items = s.items();
fins.destroy_rows();
for (int i = 0; i < items; i++)
{
TRectype & rec = fins.row(i + 1, true);
TToken_string & str = s.row(i);
rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFIN)));
rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFIN)));
rec.put(CFCMS_CUP, str.get(s.cid2index(F_CMS_CUPFIN)));
rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFIN)));
rec.put(CFCMS_PERCFIN, str.get(s.cid2index(F_CMS_PERCFINFIN)));
rec.put(CFCMS_DESCR, str.get(s.cid2index(F_CMS_DESCRFIN)));
}
fins.write(true);
}
void TCms_app::row2for(const TMask& m)
{
TRelation * r = get_relation();
TToken_string key;
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("F");
TRecord_array fors(key, LF_CFCMS);
TSheet_field & s = m.sfield(F_CMS_FORN);
const int items = s.items();
fors.destroy_rows();
for (int i = 0; i < items; i++)
{
TRectype & rec = fors.row(i + 1, true);
TToken_string & str = s.row(i);
rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFOR)));
rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFOR)));
rec.put(CFCMS_CUP, str.get(s.cid2index(F_CMS_CUPFOR)));
rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFOR)));
}
fors.write(true);
}
int TCms_app::write(const TMask& m)
{
TRelation * r = get_relation();
m.autosave(*r);
int err = TAnal_app::write(m);
if (err == NOERR)
{
row2fin(m);
row2for(m);
}
return err;
}
int TCms_app::rewrite(const TMask& m)
{
TRelation * r = get_relation();
m.autosave(*r);
int err = TAnal_app::rewrite(m);
if (err == NOERR)
{
row2fin(m);
row2for(m);
}
return err;
}
bool TCms_app::remove()
{
int err = TAnal_app::remove();
if (err == NOERR)
{
TRelation * r = get_relation();
TToken_string key;
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("C");
TRecord_array fins(key, LF_CFCMS);
err = fins.remove();
if (err == NOERR)
{
key.cut(0);
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("F");
TRecord_array fors(key, LF_CFCMS);
err = fors.remove();
}
}
return err == NOERR;
}
void TCms_app::ini2mask(TConfig& ini, TMask& m, bool query)
{
TString p;
const TRelation * r = get_relation();
TAnal_app::ini2mask(ini, m, query);
if (!query)
{
int i;
p << LF_CFCMS << ",C";
TSheet_field & si = m.sfield(F_CMS_FINAN);
for (i = 0; ; i++)
{
TString para(p); para << "," << i + 1;
const long codcf = ini.get_long(CFCMS_CODCF, para);
if (codcf == 0L)
break;
TToken_string & row = si.row(i);
row.add(codcf, si.cid2index(F_CMS_CODFIN));
row.add(ini.get(CFCMS_NRIGABAN, para), si.cid2index(F_CMS_NRIGABANFIN));
row.add(ini.get(CFCMS_CUP, para), si.cid2index(F_CMS_CUPFIN));
row.add(ini.get(CFCMS_CIG, para), si.cid2index(F_CMS_CIGFIN));
row.add(ini.get(CFCMS_PERCFIN, para), si.cid2index(F_CMS_PERCFINFIN));
row.add(ini.get(CFCMS_DESCR, para), si.cid2index(F_CMS_DESCRFIN));
si.update_mask(i - 1);
}
si.force_update();
p.cut(0);
p << LF_CFCMS << ",F";
TSheet_field & so = m.sfield(F_CMS_FORN);
for (i = 0; ; i++)
{
TString para(p); para << "," << i + 1;
const long codcf = ini.get_long(CFCMS_CODCF, para);
if (codcf == 0L)
break;
TToken_string & row = so.row(i);
row.add(codcf, so.cid2index(F_CMS_CODFOR));
row.add(ini.get(CFCMS_NRIGABAN, para), so.cid2index(F_CMS_NRIGABANFOR));
row.add(ini.get(CFCMS_CUP, para), so.cid2index(F_CMS_CUPFOR));
row.add(ini.get(CFCMS_CIG, para), so.cid2index(F_CMS_CIGFOR));
so.update_mask(i - 1);
}
so.force_update();
}
}
void TCms_app::mask2ini(const TMask& m, TConfig& ini)
{
TString p;
const TRelation * r = get_relation();
TAnal_app::mask2ini(m, ini);
p << LF_CFCMS << ",C";
TSheet_field & si = m.sfield(F_CMS_FINAN);
int items = si.items();
for (int i = 0; i < items; i++)
{
TString para(p); para << "," << i + 1;
TToken_string & row = si.row(i);
ini.set(CFCMS_CODCF, row.get(si.cid2index(F_CMS_CODFIN)), para);
ini.set(CFCMS_NRIGABAN, row.get(si.cid2index(F_CMS_NRIGABANFIN)), para);
ini.set(CFCMS_CUP, row.get(si.cid2index(F_CMS_CUPFIN)), para);
ini.set(CFCMS_CIG, row.get(si.cid2index(F_CMS_CIGFIN)), para);
ini.set(CFCMS_PERCFIN, row.get(si.cid2index(F_CMS_PERCFINFIN)), para);
ini.set(CFCMS_DESCR, row.get(si.cid2index(F_CMS_DESCRFIN)), para);
}
p.cut(0);
p << LF_CFCMS << ",F";
TSheet_field & so = m.sfield(F_CMS_FORN);
items = so.items();
for (int i = 0; i < items; i++)
{
TString para(p); para << "," << i + 1;
TToken_string & row = so.row(i);
ini.set(CFCMS_CODCF, row.get(so.cid2index(F_CMS_CODFOR)), para);
ini.set(CFCMS_NRIGABAN, row.get(so.cid2index(F_CMS_NRIGABANFOR)), para);
ini.set(CFCMS_CUP, row.get(so.cid2index(F_CMS_CUPFOR)), para);
ini.set(CFCMS_CIG, row.get(so.cid2index(F_CMS_CIGFOR)), para);
}
}
bool TCms_app::filtered() const
{
if (_has_filter)
return true;
return TAnal_app::filtered();
}
//non si può eliminare una commessa se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente
bool TCms_app::protected_record(TRectype& record)
{
TString query;
query << "USE SALDANA\nSELECT COMMESSA==#COMMESSA\nFROM ANNO=#ANNO\n";
const TString commessa = record.get(COMMESSE_CODCMS);
const TDate today(TODAY);
const long anno = today.year();
TISAM_recordset saldana_recset(query);
saldana_recset.set_var("#COMMESSA", TVariant(commessa));
saldana_recset.set_var("#ANNO", TVariant(anno - 1));
const long items = saldana_recset.items();
return items > 0;
}
void TCms_app::init_modify_mode(TMask& mask)
{
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1 , 1);
mask.enable(-1, mask.get(id).not_empty());
TAnal_app::init_modify_mode(mask);
}
void TCms_app::init_insert_mode(TMask& mask)
{
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1, 1);
mask.enable(-1, mask.get(id).not_empty());
TAnal_app::init_insert_mode(mask);
}
bool TCms_app::user_create()
{
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_COMMESSE);
_maxlev = mci.levels();
if (_maxlev <= 0)
return error_box(TR("Le commesse non sono state configurate"));
//eventuali filtri per utente
_has_filter = cache().get("%AUC", user(), "S0").full();
return TAnal_app::user_create();
}
int ca0600(int argc, char* argv[])
{
TCms_app a;
a.run(argc, argv, TR("Commesse"));
return 0;
}

View File

@ -1,136 +1,138 @@
// gestione files Contabilita' Analitica: FASI
#include <execp.h>
#include <recset.h>
#include <relapp.h>
#include "calib01.h"
#include "calibmsk.h"
#include "ca0700a.h"
#include "fasi.h"
////////////////////////////////////////////////////////////////////////
//MASCHERA
////////////////////////////////////////////////////////////////////////
class TFsc_anal_msk : public TSimple_anal_msk
{
protected:
virtual int get_logicnum() const { return LF_FASI; }
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TFsc_anal_msk();
};
bool TFsc_anal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
const short id = o.dlg();
if (id > F_KEY4 && id <= F_KEY4+4)
{
const int level = id - F_KEY4 - 1;
return ca_test_multilevel_field(efield(id), level);
}
return TSimple_anal_msk::on_field_event(o, e, jolly);
}
TFsc_anal_msk::TFsc_anal_msk()
{
read("ca0700a");
const bool use_pdcc = ca_config().get_bool("UsePdcc");
const int nfields = ca_create_fields(*this, 0, use_pdcc ? LF_PCON : LF_PCONANA, 2 + compute_offset(), 8, F_FSCPDA1, F_FSCDES1, 0x0, FASI_CODCONTO);
int from = 1;
for (int i = 0; i < nfields; i++)
{
TEdit_field & e = efield(F_FSCPDA1 + i);
e.check_type(CHECK_NORMAL);
TFieldref * fr = (TFieldref *) e.field();
if (fr != NULL)
{
fr->set_from(from);
if (i < 2)
from += 3;
else
from += 6;
fr->set_to(from - 1);
}
}
}
////////////////////////////////////////////////////////////////////////
//APPLICAZIONE
////////////////////////////////////////////////////////////////////////
// applicazione per la gestione delle fasi
class TFsc_app : public TAnal_app
{
bool _has_filter;
protected:
virtual bool filtered() const;
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TFsc_anal_msk; }
virtual bool user_create();
};
bool TFsc_app::filtered() const
{
if (_has_filter)
return true;
return TAnal_app::filtered();
}
//non si può eliminare una fase se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente
bool TFsc_app::protected_record(TRectype& record)
{
TString query;
query << "USE SALDANA\nSELECT (FASE==#FASE)";
//controlla se le fasi sono figlie delle commesse o dei centri di costo o semplici figlie di nessuno
const TString& fath_fasi = ca_config().get("FathFasi");
if (fath_fasi == "CMS")
query << "&&(COMMESSA==#COMMESSA)";
if (fath_fasi == "CDC")
query << "&&(COSTO==#COSTO)";
query << "\nFROM ANNO=#ANNO";
const TString fase = record.get(FASI_CODFASE);
const TDate today(TODAY);
const long anno = today.year();
const TString codcmsfas = record.get(FASI_CODCMSFAS);
TISAM_recordset saldana_recset(query);
saldana_recset.set_var("#FASE", TVariant(fase));
saldana_recset.set_var("#ANNO", TVariant(anno - 1));
if (fath_fasi == "CMS")
saldana_recset.set_var("#COMMESSA", TVariant(codcmsfas));
if (fath_fasi == "CDC")
saldana_recset.set_var("#COSTO", TVariant(codcmsfas));
const long items = saldana_recset.items();
return items > 0;
}
bool TFsc_app::user_create()
{
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_FASI);
if (mci.levels() <= 0)
return error_box(TR("Le fasi non sono state configurate"));
//eventuali filtri per utente
_has_filter = cache().get("%AUC", user(), "S2").full();
return TAnal_app::user_create();
}
int ca0700(int argc, char* argv[])
{
TFsc_app a;
a.run(argc, argv, TR("Fasi"));
return 0;
}
// gestione files Contabilita' Analitica: FASI
#include <execp.h>
#include <recset.h>
#include <relapp.h>
#include "calib01.h"
#include "calibmsk.h"
#include "ca0700a.h"
#include "fasi.h"
////////////////////////////////////////////////////////////////////////
//MASCHERA
////////////////////////////////////////////////////////////////////////
class TFsc_anal_msk : public TSimple_anal_msk
{
protected:
virtual int get_logicnum() const { return LF_FASI; }
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TFsc_anal_msk();
};
bool TFsc_anal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
const short id = o.dlg();
if (id > F_KEY4 && id <= F_KEY4+4)
{
const int level = id - F_KEY4 - 1;
return ca_test_multilevel_field(efield(id), level);
}
return TSimple_anal_msk::on_field_event(o, e, jolly);
}
TFsc_anal_msk::TFsc_anal_msk()
{
read("ca0700a");
const bool use_pdcc = ca_config().get_bool("UsePdcc");
const int nfields = ca_create_fields(*this, 0, use_pdcc ? LF_PCON : LF_PCONANA, 2 + compute_offset(), 8, F_FSCPDA1, F_FSCDES1, 0x0, FASI_CODCONTO);
int from = 1;
for (int i = 0; i < nfields; i++)
{
TEdit_field & e = efield(F_FSCPDA1 + i);
e.check_type(CHECK_NORMAL);
TFieldref * fr = (TFieldref *) e.field();
if (fr != NULL)
{
fr->set_from(from);
if (i < 2)
from += 3;
else
from += 6;
fr->set_to(from - 1);
}
}
}
////////////////////////////////////////////////////////////////////////
//APPLICAZIONE
////////////////////////////////////////////////////////////////////////
// applicazione per la gestione delle fasi
class TFsc_app : public TAnal_app
{
bool _has_filter;
protected:
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool filtered() const;
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TFsc_anal_msk; }
virtual bool user_create();
};
bool TFsc_app::filtered() const
{
if (_has_filter)
return true;
return TAnal_app::filtered();
}
//non si può eliminare una fase se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente
bool TFsc_app::protected_record(TRectype& record)
{
TString query;
query << "USE SALDANA\nSELECT (FASE==#FASE)";
//controlla se le fasi sono figlie delle commesse o dei centri di costo o semplici figlie di nessuno
const TString& fath_fasi = ca_config().get("FathFasi");
if (fath_fasi == "CMS")
query << "&&(COMMESSA==#COMMESSA)";
if (fath_fasi == "CDC")
query << "&&(COSTO==#COSTO)";
query << "\nFROM ANNO=#ANNO";
const TString fase = record.get(FASI_CODFASE);
const TDate today(TODAY);
const long anno = today.year();
const TString codcmsfas = record.get(FASI_CODCMSFAS);
TISAM_recordset saldana_recset(query);
saldana_recset.set_var("#FASE", TVariant(fase));
saldana_recset.set_var("#ANNO", TVariant(anno - 1));
if (fath_fasi == "CMS")
saldana_recset.set_var("#COMMESSA", TVariant(codcmsfas));
if (fath_fasi == "CDC")
saldana_recset.set_var("#COSTO", TVariant(codcmsfas));
const long items = saldana_recset.items();
return items > 0;
}
bool TFsc_app::user_create()
{
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_FASI);
if (mci.levels() <= 0)
return error_box(TR("Le fasi non sono state configurate"));
//eventuali filtri per utente
_has_filter = cache().get("%AUC", user(), "S2").full();
return TAnal_app::user_create();
}
int ca0700(int argc, char* argv[])
{
TFsc_app a;
a.run(argc, argv, TR("Fasi"));
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,423 +1,425 @@
#include "ca0800a.h"
TOOLBAR "topbar" 0 0 0 2
#include <relapbar.h>
ENDPAGE
PAGE "Ripartizioni" 0 0 0 2
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 0 ""
END
RADIOBUTTON F_TIPO 1 76
BEGIN
PROMPT 2 0 ""
FLAGS "ZP"
ITEM "I|Interattiva"
MESSAGE SHOW,1@|HIDE,2@
ITEM "B|Batch"
MESSAGE SHOW,2@|HIDE,1@
ITEM "P|Pareggio"
MESSAGE SHOW,1@|HIDE,2@
FIELD TIPO
KEY 1
END
STRING F_CODICE_I 8
BEGIN
PROMPT 2 2 "Codice "
FLAGS "Z"
USE LF_RIP
INPUT TIPO F_TIPO SELECT
INPUT CODICE F_CODICE_I
DISPLAY "Codice@8" CODICE
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODICE_I CODICE
OUTPUT F_DESCRIZ_I DESCRIZ
CHECKTYPE REQUIRED
FIELD CODICE
KEY 1
GROUP 1
END
STRING F_CODICE_B 8
BEGIN
PROMPT 2 2 "Codice "
FLAGS "Z"
USE LF_RIP
INPUT TIPO "B"
INPUT CODICE F_CODICE_B
DISPLAY "Codice@8 " CODICE
DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Fase@10" CODFASE
OUTPUT F_CODICE_B CODICE
OUTPUT F_DESCRIZ_B DESCRIZ
CHECKTYPE REQUIRED
FIELD CODICE
KEY 1
GROUP 2
END
STRING F_DESCRIZ_I 50
BEGIN
PROMPT 24 2 ""
USE LF_RIP KEY 2
INPUT TIPO "I"
INPUT DESCRIZ F_DESCRIZ_I
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice " CODICE
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" CONTO
COPY OUTPUT F_CODICE_I
FIELD DESCRIZ
KEY 2
GROUP 1
END
STRING F_DESCRIZ_B 50
BEGIN
PROMPT 24 2 ""
COPY USE F_DESCRIZ_I
INPUT TIPO "B"
INPUT DESCRIZ F_DESCRIZ_B
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice " CODICE
DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS
DISPLAY "Fase@10" CODFASE
COPY OUTPUT F_CODICE_B
FIELD DESCRIZ
KEY 2
GROUP 2
END
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 4 "@bConto"
GROUP 1
END
NUMBER F_GRUPPO 3
BEGIN
PROMPT 2 5 "Conto "
USE LF_PCON
INPUT GRUPPO F_GRUPPO
INPUT CONTO F_CONTO
INPUT SOTTOCONTO F_SOTTOCONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPO GRUPPO
OUTPUT F_CONTO CONTO
OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_DESCR DESCR
CHECKTYPE REQUIRED
FIELD GRUPPO
GROUP 1
END
NUMBER F_CONTO 3
BEGIN
PROMPT 22 5 ""
COPY ALL F_GRUPPO
FIELD CONTO
CHECKTYPE NORMAL
GROUP 1
END
NUMBER F_SOTTOCONTO 6
BEGIN
PROMPT 30 5 ""
COPY ALL F_GRUPPO
FIELD SOTTOCONTO
CHECKTYPE NORMAL
GROUP 1
END
STRING F_DESCR 50
BEGIN
PROMPT 2 6 "Descrizione "
USE LF_PCON KEY 2
INPUT DESCR F_DESCR
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_GRUPPO
CHECKTYPE REQUIRED
GROUP 1
END
NUMBER F_ANNOES 4
BEGIN
PROMPT 2 8 "Esercizio "
USE ESC
INPUT CODTAB F_ANNOES
DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNOES CODTAB
FIELD ANNOES
CHECKTYPE NORMAL
END
LIST F_INDBIL 16
BEGIN
PROMPT 20 8 "Indicatore di bilancio "
ITEM "0|0. Non definito"
ITEM "1|1. Attivita'"
ITEM "2|2. Passivita'"
ITEM "3|3. Costi"
ITEM "4|4. Ricavi"
FIELD INDBIL
END
LIST F_CLASSEMOV 25
BEGIN
PROMPT 2 9 "Classe movimento "
ITEM "0|Tutti"
ITEM "1|Normali e Temporanei"
ITEM "2|Preventivi e Variazioni"
FIELD CLASSEMOV
GROUP 2
END
ENDPAGE
PAGE "Righe" -1 -1 78 22
RADIOBUTTON F_TIPORIP 1 78
BEGIN
PROMPT 1 0 "Ripartizione"
FLAGS "Z"
ITEM "0|Percentuale"
ITEM "1|Costo\Ricavo"
ITEM "2|Parti"
FIELD TIPORIP
END
NUMBER F_TOTRIP 15 5
BEGIN
PROMPT 2 3 "Totale "
FIELD TOTRIP
END
NUMBER F_SOMMA 15 5
BEGIN
PROMPT 27 3 "Somma "
FLAGS "D"
END
NUMBER F_DIFFERENZA 15 5
BEGIN
PROMPT 51 3 "Differenza "
FLAGS "D"
END
SPREADSHEET F_SHEET 80 -3
BEGIN
PROMPT 0 4 ""
ITEM "Ripartiz.@15F"
ITEM "Cdc1"
ITEM "Cdc2"
ITEM "Cdc3"
ITEM "Cdc4"
ITEM "Cms1"
ITEM "Cms2"
ITEM "Cms3"
ITEM "Cms4"
ITEM "Fas1"
ITEM "Fas2"
ITEM "Fas3"
ITEM "Fas4"
ITEM "Con1"
ITEM "Con2"
ITEM "Con3"
ITEM "Con4"
ITEM "Articolo@20"
END
BUTTON F_GENFASI 60 2
BEGIN
PROMPT -11 -1 "Ripartire la commessa d'origine tra le sue fasi"
END
ENDPAGE
ENDMASK
PAGE "Sheet" -1 -1 78 19
NUMBER 101 15 5
BEGIN
PROMPT 1 0 "% Ripartizione "
FLAGS "U"
FIELD RIPARTO
MESSAGE COPY,201
END
NUMBER 201 15 5
BEGIN
PROMPT 1 0 "Numero parti "
FLAGS "U"
FIELD RIPARTO
MESSAGE COPY,101
END
STRING 102 20
BEGIN
PROMPT 1 1 "Cdc1 "
USE LF_CDC
GROUP 1
END
STRING 103 20
BEGIN
PROMPT 1 2 "Cdc2 "
COPY USE 102
GROUP 1
END
STRING 104 20
BEGIN
PROMPT 1 3 "Cdc3 "
COPY USE 102
GROUP 1
END
STRING 105 20
BEGIN
PROMPT 1 4 "Cdc4 "
COPY USE 102
GROUP 1
END
STRING 106 20
BEGIN
PROMPT 1 5 "Cms1 "
USE LF_COMMESSE
GROUP 1
END
STRING 107 20
BEGIN
PROMPT 1 6 "Cms2 "
COPY USE 106
GROUP 1
END
STRING 108 20
BEGIN
PROMPT 1 7 "Cms3 "
COPY USE 106
GROUP 1
END
STRING 109 20
BEGIN
PROMPT 1 8 "Cms4 "
COPY USE 106
GROUP 1
END
STRING 110 20
BEGIN
PROMPT 1 9 "Fas1 "
USE LF_FASI
GROUP 1
END
STRING 111 10
BEGIN
PROMPT 1 10 "Fas2 "
COPY USE 110
GROUP 1
END
STRING 112 10
BEGIN
PROMPT 1 11 "Fas3 "
COPY USE 110
GROUP 1
END
STRING 113 10
BEGIN
PROMPT 1 12 "Fas4 "
COPY USE 110
GROUP 1
END
STRING 114 20
BEGIN
PROMPT 1 14 "Gruppo "
USE LF_PCON
GROUP 1
END
STRING 115 20
BEGIN
PROMPT 27 14 "Conto "
COPY USE 114
GROUP 1
END
STRING 116 20
BEGIN
PROMPT 46 14 "Sottoconto "
COPY USE 114
GROUP 1
END
STRING 117 20
BEGIN
PROMPT 1 15 "Sottoconticino "
COPY USE 114
GROUP 1
END
STRING 118 20
BEGIN
PROMPT 1 16 "Articolo "
USE LF_ANAMAG
INPUT CODART 118
DISPLAY "Codice@20" CODART
DISPLAY "Descrizione@50" DESCR
OUTPUT 118 CODART
CHECKTYPE NORMAL
ADD RUN ve2 -3
FIELD CODART
END
ENDPAGE
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
#include "ca0800a.h"
TOOLBAR "topbar" 0 0 0 2
#include <relapbar.h>
ENDPAGE
PAGE "Ripartizioni" 0 0 0 2
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 0 ""
END
RADIOBUTTON F_TIPO 1 76
BEGIN
PROMPT 2 0 ""
FLAGS "ZP"
ITEM "I|Interattiva"
MESSAGE SHOW,1@|HIDE,2@
ITEM "B|Batch"
MESSAGE SHOW,2@|HIDE,1@
ITEM "P|Pareggio"
MESSAGE SHOW,1@|HIDE,2@
FIELD TIPO
KEY 1
END
STRING F_CODICE_I 8
BEGIN
PROMPT 2 2 "Codice "
FLAGS "Z"
USE LF_RIP
INPUT TIPO F_TIPO SELECT
INPUT CODICE F_CODICE_I
DISPLAY "Codice@8" CODICE
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODICE_I CODICE
OUTPUT F_DESCRIZ_I DESCRIZ
CHECKTYPE REQUIRED
FIELD CODICE
KEY 1
GROUP 1
END
STRING F_CODICE_B 8
BEGIN
PROMPT 2 2 "Codice "
FLAGS "Z"
USE LF_RIP
INPUT TIPO "B"
INPUT CODICE F_CODICE_B
DISPLAY "Codice@8 " CODICE
DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Fase@10" CODFASE
OUTPUT F_CODICE_B CODICE
OUTPUT F_DESCRIZ_B DESCRIZ
CHECKTYPE REQUIRED
FIELD CODICE
KEY 1
GROUP 2
END
STRING F_DESCRIZ_I 50
BEGIN
PROMPT 24 2 ""
USE LF_RIP KEY 2
INPUT TIPO "I"
INPUT DESCRIZ F_DESCRIZ_I
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice " CODICE
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" CONTO
COPY OUTPUT F_CODICE_I
FIELD DESCRIZ
KEY 2
GROUP 1
END
STRING F_DESCRIZ_B 50
BEGIN
PROMPT 24 2 ""
COPY USE F_DESCRIZ_I
INPUT TIPO "B"
INPUT DESCRIZ F_DESCRIZ_B
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice " CODICE
DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS
DISPLAY "Fase@10" CODFASE
COPY OUTPUT F_CODICE_B
FIELD DESCRIZ
KEY 2
GROUP 2
END
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 4 "@bConto"
GROUP 1
END
NUMBER F_GRUPPO 3
BEGIN
PROMPT 2 5 "Conto "
USE LF_PCON
INPUT GRUPPO F_GRUPPO
INPUT CONTO F_CONTO
INPUT SOTTOCONTO F_SOTTOCONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPO GRUPPO
OUTPUT F_CONTO CONTO
OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_DESCR DESCR
CHECKTYPE REQUIRED
FIELD GRUPPO
GROUP 1
END
NUMBER F_CONTO 3
BEGIN
PROMPT 22 5 ""
COPY ALL F_GRUPPO
FIELD CONTO
CHECKTYPE NORMAL
GROUP 1
END
NUMBER F_SOTTOCONTO 6
BEGIN
PROMPT 30 5 ""
COPY ALL F_GRUPPO
FIELD SOTTOCONTO
CHECKTYPE NORMAL
GROUP 1
END
STRING F_DESCR 50
BEGIN
PROMPT 2 6 "Descrizione "
USE LF_PCON KEY 2
INPUT DESCR F_DESCR
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_GRUPPO
CHECKTYPE REQUIRED
GROUP 1
END
NUMBER F_ANNOES 4
BEGIN
PROMPT 2 8 "Esercizio "
USE ESC
INPUT CODTAB F_ANNOES
DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNOES CODTAB
FIELD ANNOES
CHECKTYPE NORMAL
END
LIST F_INDBIL 16
BEGIN
PROMPT 20 8 "Indicatore di bilancio "
ITEM "0|0. Non definito"
ITEM "1|1. Attivita'"
ITEM "2|2. Passivita'"
ITEM "3|3. Costi"
ITEM "4|4. Ricavi"
FIELD INDBIL
END
LIST F_CLASSEMOV 25
BEGIN
PROMPT 2 9 "Classe movimento "
ITEM "0|Tutti"
ITEM "1|Normali e Temporanei"
ITEM "2|Preventivi e Variazioni"
FIELD CLASSEMOV
GROUP 2
END
ENDPAGE
PAGE "Righe" -1 -1 78 22
RADIOBUTTON F_TIPORIP 1 78
BEGIN
PROMPT 1 0 "Ripartizione"
FLAGS "Z"
ITEM "0|Percentuale"
ITEM "1|Costo\Ricavo"
ITEM "2|Parti"
FIELD TIPORIP
END
NUMBER F_TOTRIP 15 5
BEGIN
PROMPT 2 3 "Totale "
FIELD TOTRIP
END
NUMBER F_SOMMA 15 5
BEGIN
PROMPT 27 3 "Somma "
FLAGS "D"
END
NUMBER F_DIFFERENZA 15 5
BEGIN
PROMPT 51 3 "Differenza "
FLAGS "D"
END
SPREADSHEET F_SHEET 80 -3
BEGIN
PROMPT 0 4 ""
ITEM "Ripartiz.@15F"
ITEM "Cdc1"
ITEM "Cdc2"
ITEM "Cdc3"
ITEM "Cdc4"
ITEM "Cms1"
ITEM "Cms2"
ITEM "Cms3"
ITEM "Cms4"
ITEM "Fas1"
ITEM "Fas2"
ITEM "Fas3"
ITEM "Fas4"
ITEM "Con1"
ITEM "Con2"
ITEM "Con3"
ITEM "Con4"
ITEM "Articolo@20"
END
BUTTON F_GENFASI 60 2
BEGIN
PROMPT -11 -1 "Ripartire la commessa d'origine tra le sue fasi"
END
ENDPAGE
ENDMASK
PAGE "Sheet" -1 -1 78 19
NUMBER 101 15 5
BEGIN
PROMPT 1 0 "% Ripartizione "
FLAGS "U"
FIELD RIPARTO
MESSAGE COPY,201
END
NUMBER 201 15 5
BEGIN
PROMPT 1 0 "Numero parti "
FLAGS "U"
FIELD RIPARTO
MESSAGE COPY,101
END
STRING 102 20
BEGIN
PROMPT 1 1 "Cdc1 "
USE LF_CDC
GROUP 1
END
STRING 103 20
BEGIN
PROMPT 1 2 "Cdc2 "
COPY USE 102
GROUP 1
END
STRING 104 20
BEGIN
PROMPT 1 3 "Cdc3 "
COPY USE 102
GROUP 1
END
STRING 105 20
BEGIN
PROMPT 1 4 "Cdc4 "
COPY USE 102
GROUP 1
END
STRING 106 20
BEGIN
PROMPT 1 5 "Cms1 "
USE LF_COMMESSE
GROUP 1
END
STRING 107 20
BEGIN
PROMPT 1 6 "Cms2 "
COPY USE 106
GROUP 1
END
STRING 108 20
BEGIN
PROMPT 1 7 "Cms3 "
COPY USE 106
GROUP 1
END
STRING 109 20
BEGIN
PROMPT 1 8 "Cms4 "
COPY USE 106
GROUP 1
END
STRING 110 20
BEGIN
PROMPT 1 9 "Fas1 "
USE LF_FASI
GROUP 1
END
STRING 111 10
BEGIN
PROMPT 1 10 "Fas2 "
COPY USE 110
GROUP 1
END
STRING 112 10
BEGIN
PROMPT 1 11 "Fas3 "
COPY USE 110
GROUP 1
END
STRING 113 10
BEGIN
PROMPT 1 12 "Fas4 "
COPY USE 110
GROUP 1
END
STRING 114 20
BEGIN
PROMPT 1 14 "Gruppo "
USE LF_PCON
GROUP 1
END
STRING 115 20
BEGIN
PROMPT 27 14 "Conto "
COPY USE 114
GROUP 1
END
STRING 116 20
BEGIN
PROMPT 46 14 "Sottoconto "
COPY USE 114
GROUP 1
END
STRING 117 20
BEGIN
PROMPT 1 15 "Sottoconticino "
COPY USE 114
GROUP 1
END
STRING 118 20
BEGIN
PROMPT 1 16 "Articolo "
USE LF_ANAMAG
INPUT CODART 118
DISPLAY "Codice@20" CODART
DISPLAY "Descrizione@50" DESCR
OUTPUT 118 CODART
OUTPUT 260 DESCR
CHECKTYPE NORMAL
ADD RUN ve2 -3
FIELD CODART
MODULE CI
END
ENDPAGE
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -1,412 +1,421 @@
#include <applicat.h>
#include <automask.h>
#include <defmask.h>
#include <dongle.h>
#include <modaut.h>
#include <progind.h>
#include <recset.h>
#include <reprint.h>
#include <textset.h>
#include <utility.h>
#include "rmovana.h"
#include "calib01.h"
#include "calib02.h"
#include "ca1800a.h"
////////////////////////////////////////////////////////
// MASCHERA
////////////////////////////////////////////////////////
class TPrint_contixcms_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TPrint_contixcms_mask();
};
TPrint_contixcms_mask::TPrint_contixcms_mask() : TAutomask("ca1800a")
{
const bool has_ca = dongle().active(CAAUT);
//se la chiave ha CA mostra i campi gruppo 2 (codice e descrizione commessa)..
if (has_ca)
{
hide(-1);
show(-2);
//se le fasi sono figlie di nessuno può visualizzare il gruppo 3 (da fase a fase)
TConfig& cfg = ca_config();
const TString& fath_fasi = cfg.get("FathFasi");
if (fath_fasi.empty())
show(-3);
else
hide(-3);
}
else //..se invece ha CM mostra i campi gruppo 1 (da cms a cms) e gruppo 3 (da fase a fase)
{
hide(-2);
show(-1);
show(-3);
}
}
bool TPrint_contixcms_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch(o.dlg())
{
case DLG_PRINT:
if (e == fe_button)
{
main_app().print();
return false;
}
break;
case DLG_PREVIEW:
if (e == fe_button)
{
main_app().preview();
return false;
}
break;
default:
break;
}
return true;
}
////////////////////////////////////////////////////////
// REPORT
////////////////////////////////////////////////////////
class TPrint_contixcms_report : public TAnal_report
{
protected:
virtual bool use_mask() { return false; }
public:
TPrint_contixcms_report() {}
};
////////////////////////////////////////////////////////
// RECORDSET
////////////////////////////////////////////////////////
class TPrint_contixcms_recordset : public TAS400_recordset
{
protected:
long trova_riga(const TString& key);
public:
bool aggiungi_riga(TISAM_recordset& recset);
TPrint_contixcms_recordset();
};
TPrint_contixcms_recordset::TPrint_contixcms_recordset()
: TAS400_recordset("AS400(80)")
{
create_field(RMOVANA_CODCMS, -1, 20, _alfafld, true);
create_field(RMOVANA_CODFASE, -1, 10, _alfafld, false);
create_field(RMOVANA_CODCONTO, -1, 12, _alfafld, true);
create_field("INDBIL", -1, 1, _intfld, true);
create_field(RMOVANA_DATACOMP, -1, 8, _datefld, true);
create_field(RMOVANA_IMPORTO, -1, 18, _realfld, true);
create_field(RMOVANA_SEZIONE, -1, 1, _alfafld, true);
}
//cerca se una riga con chiave key esiste già
long TPrint_contixcms_recordset::trova_riga(const TString& key)
{
long first = 0;
long last = items() - 1;
long riga = -1;
TString80 guess_key;
while(first <= last)
{
const long guess = (first + last) / 2;
move_to(guess);
guess_key = get(RMOVANA_CODCMS).as_string(); //commessa
guess_key.left_just(20);
guess_key << get(RMOVANA_CODCONTO).as_string(); //conto
const int diff = guess_key.compare(key);
if (diff == 0)
{
riga = guess;
break;
}
if (diff > 0)
{
last = guess - 1;
}
else
{
first = guess + 1;
}
}
return riga;
}
//funzione di ordinamento per il campo codcms/codconto
//sono 2 stringhe
static int compare_cms_conto(const TObject** o1, const TObject** o2)
{
TString& s1 = *(TString*)*o1;
TString& s2 = *(TString*)*o2;
const TString& cms1 = s1.left(20);
const TString& cms2 = s2.left(20);
int cmp = cms1.compare(cms2);
if (cmp == 0)
{
const TString& cnt1 = s1.mid(30, 12);
const TString& cnt2 = s2.mid(30, 12);
cmp = cnt1.compare(cnt2);
}
return cmp;
}
//metodo per aggiungere righe al recordset da stampare
bool TPrint_contixcms_recordset::aggiungi_riga(TISAM_recordset& recset)
{
//raccatta i dati che servono alla riga da stampare prendendoli dal record corrente del..
//..recordset in esame riempito dalla query iniziale
const TString& codcms = recset.get(RMOVANA_CODCMS).as_string();
const TString& codfase = recset.get(RMOVANA_CODFASE).as_string();
const TString& codconto = recset.get(RMOVANA_CODCONTO).as_string();
TAnal_bill zio(codconto);
const TIndbil ib = zio.indicatore_bilancio();
//solo i conti di tipo costo/ricavo possono essere considerati (no attività/passività o non definiti)
if (ib == ib_costi || ib == ib_ricavi)
{
const TDate& datacomp = recset.get(RMOVANA_DATACOMP).as_date();
const real curr_valore = recset.get(RMOVANA_IMPORTO).as_real();
const char curr_sezione = recset.get(RMOVANA_SEZIONE).as_string()[0];
TImporto curr_imp(curr_sezione, curr_valore); //importo riga correntemente in esame
//chiave della riga (solo su commessa e conto!; la fase è solo un filtro in input)
TString80 key;
key = codcms;
key.left_just(20);
key << codconto;
//cerca se per caso la riga non esista già con questa chiave
long numriga = trova_riga(key);
//se la riga con la chiave key non esiste nel printrecordset la aggiunge
if (numriga < 0)
{
new_rec("");
set(RMOVANA_CODCMS, TVariant(codcms));
set(RMOVANA_CODFASE, TVariant(codfase));
set(RMOVANA_CODCONTO, TVariant(codconto));
set("INDBIL", TVariant(long(ib)));
set(RMOVANA_DATACOMP, TVariant(datacomp));
//deve ordinare il recordset
sort(compare_cms_conto);
//dopo che la riga è stata aggiunta riesegue la trova_riga in modo da ottenere il numero di riga
numriga = trova_riga(key);
}
//importo riga con indice numriga
const char tot_sezione = get(RMOVANA_SEZIONE).as_string()[0];
const real tot_valore = get(RMOVANA_IMPORTO).as_real();
TImporto tot_imp(tot_sezione, tot_valore);
//aggiunge l'importo alla riga (nuova o vecchia)
tot_imp += curr_imp;
//normalizza e risalva il valore aggiornato sulla riga
tot_imp.normalize();
TString4 str_sez;
str_sez << tot_imp.sezione();
set(RMOVANA_SEZIONE, str_sez);
set(RMOVANA_IMPORTO, tot_imp.valore());
}
return true;
}
////////////////////////////////////////////////////////
// APPLICAZIONE
////////////////////////////////////////////////////////
class TPrint_contixcms : public TSkeleton_application
{
TPrint_contixcms_mask* _mask;
bool _has_ca;
protected:
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool create();
virtual void print();
virtual void preview();
virtual void print_or_preview(const bool stampa);
TPrint_contixcms_recordset* elabora() const;
public:
virtual void main_loop();
};
//metodo di alto livello per la gestione dell'elaborazione
TPrint_contixcms_recordset* TPrint_contixcms::elabora() const
{
//creazione dell'as400 recordset che verra' riempito dai record del recordset righe
TPrint_contixcms_recordset* printset = new TPrint_contixcms_recordset();
//creazione della query per la creazione del recordset
TString query;
query << "USE RMOVANA KEY 3\n";
if (_has_ca)
query << "SELECT (BETWEEN(CODCMS,#CODCMS,#CODCMS))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))\n";
else
query << "SELECT (BETWEEN(CODCMS,#DACODCMS,#ACODCMS))&&(BETWEEN(CODFASE,#DACODFASE,#ACODFASE))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))\n";
query << "FROM DATACOMP=#DADATA\n";
query << "TO DATACOMP=#ADATA";
TISAM_recordset recset(query);
if (_has_ca)
recset.set_var("#CODCMS", TVariant(_mask->get(F_CODCMS)));
else
{
recset.set_var("#DACODCMS", TVariant(_mask->get(F_DACODCMS)));
recset.set_var("#ACODCMS", TVariant(_mask->get(F_ACODCMS)));
recset.set_var("#DACODFASE", TVariant(_mask->get(F_DACODFASE)));
recset.set_var("#ACODFASE", TVariant(_mask->get(F_ACODFASE)));
}
//per il conto va gestito il fatto che il conto è contabile e non analitico ed è 0-filled
TString contone;
int gruppo = _mask->get_int(F_GRUPPOINI);
int conto = _mask->get_int(F_CONTOINI);
long sottoconto = _mask->get_long(F_SOTTOCINI);
contone.format("%03d%03d%06ld", gruppo, conto, sottoconto);
recset.set_var("#DACODCONTO", contone);
gruppo = _mask->get_int(F_GRUPPOFIN);
if (gruppo == 0)
gruppo = 999;
conto = _mask->get_int(F_CONTOFIN);
if (conto == 0)
conto = 999;
sottoconto = _mask->get_long(F_SOTTOCFIN);
if (sottoconto == 0)
sottoconto = 999999L;
contone.format("%03d%03d%06ld", gruppo, conto, sottoconto);
recset.set_var("#ACODCONTO", contone);
//e alla fine le decisivissime date (che sono l'intervallo di scelta più importante)
recset.set_var("#DADATA", _mask->get_date(F_DATAINI));
recset.set_var("#ADATA", _mask->get_date(F_DATAFIN));
//se ci sono record che soddisfano le pesanti richieste dell'utonto...
const long recset_items = recset.items();
if (recset_items > 0)
{
//E crea pure la progind..
TProgind pi(recset_items, TR("Elaborazione dati per la stampa..."), true, true);
//Scansione del recordset trovato
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
{
if (!pi.addstatus(1))
break;
//scrive sul CSV i campi che servono al report
printset->aggiungi_riga(recset);
}
}
return printset;
}
//fantastico metodo per gestire stampa o anteprima
void TPrint_contixcms::print_or_preview(const bool stampa)
{
if (_mask->check_fields())
{
//l'utonto può scegliere che report usare (personalizzato!)
TString rep_name = _mask->get(F_REPORT);
//se il rep non è selezionato usa quello standard
if (rep_name.empty())
rep_name << "ca1800a.rep";
TPrint_contixcms_report rep;
rep.load(rep_name);
//metodo per la generazione del recordset che contiene tutti i dati da stampare
//insomma, il vero programma!
TPrint_contixcms_recordset* printset = elabora();
//appioppa il recordset al report
rep.set_recordset(printset);
//setta i valori della maschera sul report (dopo la set_recordset, sennò..
//..sarebbero sovrascritti dalla set_recordset)
rep.mask2report(*_mask);
//se l'utonto vuole il dettaglio sottocontesco
if (_mask->get_bool(F_HIDESOTT))
rep.section('B', 1).hide();
TReport_book book;
book.add(rep);
if (stampa)
book.print();
else
book.preview();
}
}
void TPrint_contixcms::print()
{
print_or_preview(true);
}
void TPrint_contixcms::preview()
{
print_or_preview(false);
}
void TPrint_contixcms::main_loop()
{
_mask = new TPrint_contixcms_mask;
_mask->run();
delete _mask;
_mask = NULL;
}
bool TPrint_contixcms::create()
{
//controlla se la chiave ha il modulo CA (e non solo CM) NON è ammesso CA E CM
_has_ca = dongle().active(CAAUT);
//in tal caso il programma è utilizzabile solo se si ha il piano dei conti contabile..
if (_has_ca)
{
TConfig& cfg = ca_config();
const bool usepdcc = cfg.get_bool("UsePdcc");
if (!usepdcc)
return error_box(TR("Il programma non è utilizzabile con la corrente configurazione CA!"));
}
return TSkeleton_application::create();
}
int ca1800(int argc, char* argv[])
{
TPrint_contixcms a;
a.run(argc, argv, TR("Stampa conti per commessa"));
return 0;
#include <applicat.h>
#include <automask.h>
#include <defmask.h>
#include <dongle.h>
#include <modaut.h>
#include <progind.h>
#include <recset.h>
#include <reprint.h>
#include <textset.h>
#include <utility.h>
#include "movana.h"
#include "rmovana.h"
#include "calib01.h"
#include "calib02.h"
#include "ca1800a.h"
////////////////////////////////////////////////////////
// MASCHERA
////////////////////////////////////////////////////////
class TPrint_contixcms_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TPrint_contixcms_mask();
};
TPrint_contixcms_mask::TPrint_contixcms_mask() : TAutomask("ca1800a")
{
const bool has_ca = dongle().active(CAAUT);
//se la chiave ha CA mostra i campi gruppo 2 (codice e descrizione commessa)..
if (has_ca)
{
hide(-1);
show(-2);
//se le fasi sono figlie di nessuno può visualizzare il gruppo 3 (da fase a fase)
TConfig& cfg = ca_config();
const TString& fath_fasi = cfg.get("FathFasi");
if (fath_fasi.empty())
show(-3);
else
hide(-3);
}
else //..se invece ha CM mostra i campi gruppo 1 (da cms a cms) e gruppo 3 (da fase a fase)
{
hide(-2);
show(-1);
show(-3);
}
}
bool TPrint_contixcms_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch(o.dlg())
{
case DLG_PRINT:
if (e == fe_button)
{
main_app().print();
return false;
}
break;
case DLG_PREVIEW:
if (e == fe_button)
{
main_app().preview();
return false;
}
break;
default:
break;
}
return true;
}
////////////////////////////////////////////////////////
// REPORT
////////////////////////////////////////////////////////
class TPrint_contixcms_report : public TAnal_report
{
protected:
virtual bool use_mask() { return false; }
public:
TPrint_contixcms_report() {}
};
////////////////////////////////////////////////////////
// RECORDSET
////////////////////////////////////////////////////////
class TPrint_contixcms_recordset : public TAS400_recordset
{
protected:
long trova_riga(const TString& key);
public:
bool aggiungi_riga(TISAM_recordset& recset);
TPrint_contixcms_recordset();
};
TPrint_contixcms_recordset::TPrint_contixcms_recordset()
: TAS400_recordset("AS400(80)")
{
create_field(RMOVANA_CODCMS, -1, 20, _alfafld, true);
create_field(RMOVANA_CODFASE, -1, 10, _alfafld, false);
create_field(RMOVANA_CODCONTO, -1, 12, _alfafld, true);
create_field("INDBIL", -1, 1, _intfld, true);
create_field(RMOVANA_DATACOMP, -1, 8, _datefld, true);
create_field(RMOVANA_IMPORTO, -1, 18, _realfld, true);
create_field(RMOVANA_SEZIONE, -1, 1, _alfafld, true);
}
//cerca se una riga con chiave key esiste già
long TPrint_contixcms_recordset::trova_riga(const TString& key)
{
long first = 0;
long last = items() - 1;
long riga = -1;
TString80 guess_key;
while(first <= last)
{
const long guess = (first + last) / 2;
move_to(guess);
guess_key = get(RMOVANA_CODCMS).as_string(); //commessa
guess_key.left_just(20);
guess_key << get(RMOVANA_CODCONTO).as_string(); //conto
const int diff = guess_key.compare(key);
if (diff == 0)
{
riga = guess;
break;
}
if (diff > 0)
{
last = guess - 1;
}
else
{
first = guess + 1;
}
}
return riga;
}
//funzione di ordinamento per il campo codcms/codconto
//sono 2 stringhe
static int compare_cms_conto(const TObject** o1, const TObject** o2)
{
TString& s1 = *(TString*)*o1;
TString& s2 = *(TString*)*o2;
const TString& cms1 = s1.left(20);
const TString& cms2 = s2.left(20);
int cmp = cms1.compare(cms2);
if (cmp == 0)
{
const TString& cnt1 = s1.mid(30, 12);
const TString& cnt2 = s2.mid(30, 12);
cmp = cnt1.compare(cnt2);
}
return cmp;
}
//metodo per aggiungere righe al recordset da stampare
bool TPrint_contixcms_recordset::aggiungi_riga(TISAM_recordset& recset)
{
//raccatta i dati che servono alla riga da stampare prendendoli dal record corrente del..
//..recordset in esame riempito dalla query iniziale
const TString& codcms = recset.get(RMOVANA_CODCMS).as_string();
const TString& codfase = recset.get(RMOVANA_CODFASE).as_string();
const TString& codconto = recset.get(RMOVANA_CODCONTO).as_string();
TAnal_bill zio(codconto);
const TIndbil ib = zio.indicatore_bilancio();
//solo i conti di tipo costo/ricavo possono essere considerati (no attività/passività o non definiti)
if (ib == ib_costi || ib == ib_ricavi)
{
const TDate& datacomp = recset.get(RMOVANA_DATACOMP).as_date();
const real curr_valore = recset.get(RMOVANA_IMPORTO).as_real();
const char curr_sezione = recset.get(RMOVANA_SEZIONE).as_string()[0];
TImporto curr_imp(curr_sezione, curr_valore); //importo riga correntemente in esame
//chiave della riga (solo su commessa e conto!; la fase è solo un filtro in input)
TString80 key;
key = codcms;
key.left_just(20);
key << codconto;
//cerca se per caso la riga non esista già con questa chiave
long numriga = trova_riga(key);
//se la riga con la chiave key non esiste nel printrecordset la aggiunge
if (numriga < 0)
{
new_rec("");
set(RMOVANA_CODCMS, TVariant(codcms));
set(RMOVANA_CODFASE, TVariant(codfase));
set(RMOVANA_CODCONTO, TVariant(codconto));
set("INDBIL", TVariant(long(ib)));
set(RMOVANA_DATACOMP, TVariant(datacomp));
//deve ordinare il recordset
sort(compare_cms_conto);
//dopo che la riga è stata aggiunta riesegue la trova_riga in modo da ottenere il numero di riga
numriga = trova_riga(key);
}
//importo riga con indice numriga
const char tot_sezione = get(RMOVANA_SEZIONE).as_string()[0];
const real tot_valore = get(RMOVANA_IMPORTO).as_real();
TImporto tot_imp(tot_sezione, tot_valore);
//aggiunge l'importo alla riga (nuova o vecchia)
tot_imp += curr_imp;
//normalizza e risalva il valore aggiornato sulla riga
tot_imp.normalize();
TString4 str_sez;
str_sez << tot_imp.sezione();
set(RMOVANA_SEZIONE, str_sez);
set(RMOVANA_IMPORTO, tot_imp.valore());
}
return true;
}
////////////////////////////////////////////////////////
// APPLICAZIONE
////////////////////////////////////////////////////////
class TPrint_contixcms : public TSkeleton_application
{
TPrint_contixcms_mask* _mask;
bool _has_ca;
protected:
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool create();
virtual void print();
virtual void preview();
virtual void print_or_preview(const bool stampa);
TPrint_contixcms_recordset* elabora() const;
public:
virtual void main_loop();
};
//metodo di alto livello per la gestione dell'elaborazione
TPrint_contixcms_recordset* TPrint_contixcms::elabora() const
{
//creazione dell'as400 recordset che verra' riempito dai record del recordset righe
TPrint_contixcms_recordset* printset = new TPrint_contixcms_recordset();
//creazione della query per la creazione del recordset
TString query;
query << "USE RMOVANA KEY 3\n";
if (_has_ca)
query << "SELECT (BETWEEN(CODCMS,#CODCMS,#CODCMS))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))";
else
query << "SELECT (BETWEEN(CODCMS,#DACODCMS,#ACODCMS))&&(BETWEEN(CODFASE,#DACODFASE,#ACODFASE))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))";
const TString4 tipomov = _mask->get(F_TIPOMOV);
if (tipomov.full())
query << "&&(" << LF_MOVANA << "->" << MOVANA_TIPOMOV << (tipomov == "N" ? "==" : "!=") << "\"\")";
query << "\n";
if (tipomov.full())
query << "JOIN MOVANA INTO NUMREG==NUMREG\n";
query << "FROM DATACOMP=#DADATA\n";
query << "TO DATACOMP=#ADATA";
TISAM_recordset recset(query);
if (_has_ca)
recset.set_var("#CODCMS", TVariant(_mask->get(F_CODCMS)));
else
{
recset.set_var("#DACODCMS", TVariant(_mask->get(F_DACODCMS)));
recset.set_var("#ACODCMS", TVariant(_mask->get(F_ACODCMS)));
recset.set_var("#DACODFASE", TVariant(_mask->get(F_DACODFASE)));
recset.set_var("#ACODFASE", TVariant(_mask->get(F_ACODFASE)));
}
//per il conto va gestito il fatto che il conto è contabile e non analitico ed è 0-filled
TString contone;
int gruppo = _mask->get_int(F_GRUPPOINI);
int conto = _mask->get_int(F_CONTOINI);
long sottoconto = _mask->get_long(F_SOTTOCINI);
contone.format("%03d%03d%06ld", gruppo, conto, sottoconto);
recset.set_var("#DACODCONTO", contone);
gruppo = _mask->get_int(F_GRUPPOFIN);
if (gruppo == 0)
gruppo = 999;
conto = _mask->get_int(F_CONTOFIN);
if (conto == 0)
conto = 999;
sottoconto = _mask->get_long(F_SOTTOCFIN);
if (sottoconto == 0)
sottoconto = 999999L;
contone.format("%03d%03d%06ld", gruppo, conto, sottoconto);
recset.set_var("#ACODCONTO", contone);
//e alla fine le decisivissime date (che sono l'intervallo di scelta più importante)
recset.set_var("#DADATA", _mask->get_date(F_DATAINI));
recset.set_var("#ADATA", _mask->get_date(F_DATAFIN));
//se ci sono record che soddisfano le pesanti richieste dell'utonto...
const long recset_items = recset.items();
if (recset_items > 0)
{
//E crea pure la progind..
TProgind pi(recset_items, TR("Elaborazione dati per la stampa..."), true, true);
//Scansione del recordset trovato
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
{
if (!pi.addstatus(1))
break;
//scrive sul CSV i campi che servono al report
printset->aggiungi_riga(recset);
}
}
return printset;
}
//fantastico metodo per gestire stampa o anteprima
void TPrint_contixcms::print_or_preview(const bool stampa)
{
if (_mask->check_fields())
{
//l'utonto può scegliere che report usare (personalizzato!)
TString rep_name = _mask->get(F_REPORT);
//se il rep non è selezionato usa quello standard
if (rep_name.empty())
rep_name << "ca1800a.rep";
TPrint_contixcms_report rep;
rep.load(rep_name);
//metodo per la generazione del recordset che contiene tutti i dati da stampare
//insomma, il vero programma!
TPrint_contixcms_recordset* printset = elabora();
//appioppa il recordset al report
rep.set_recordset(printset);
//setta i valori della maschera sul report (dopo la set_recordset, sennò..
//..sarebbero sovrascritti dalla set_recordset)
rep.mask2report(*_mask);
//se l'utonto vuole il dettaglio sottocontesco
if (_mask->get_bool(F_HIDESOTT))
rep.section('B', 1).hide();
TReport_book book;
book.add(rep);
if (stampa)
book.print();
else
book.preview();
}
}
void TPrint_contixcms::print()
{
print_or_preview(true);
}
void TPrint_contixcms::preview()
{
print_or_preview(false);
}
void TPrint_contixcms::main_loop()
{
_mask = new TPrint_contixcms_mask;
_mask->run();
delete _mask;
_mask = NULL;
}
bool TPrint_contixcms::create()
{
//controlla se la chiave ha il modulo CA (e non solo CM) NON è ammesso CA E CM
_has_ca = dongle().active(CAAUT);
//in tal caso il programma è utilizzabile solo se si ha il piano dei conti contabile..
if (_has_ca)
{
TConfig& cfg = ca_config();
const bool usepdcc = cfg.get_bool("UsePdcc");
if (!usepdcc)
return error_box(TR("Il programma non è utilizzabile con la corrente configurazione CA!"));
}
return TSkeleton_application::create();
}
int ca1800(int argc, char* argv[])
{
TPrint_contixcms a;
a.run(argc, argv, TR("Stampa conti per commessa"));
return 0;
}

View File

@ -1,34 +1,35 @@
// campi per la maschera ca1800a
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_ANNO 103
#define F_DATAINI 104
#define F_DATAFIN 105
#define F_DACODCMS 106
#define F_DADESCMS 107
#define F_ACODCMS 108
#define F_ADESCMS 109
#define F_DACODFASE 110
#define F_DADESFASE 111
#define F_ACODFASE 112
#define F_ADESFASE 113
#define F_CODCMS 114
#define F_DESCMS 115
#define F_GRUPPOINI 118
#define F_CONTOINI 119
#define F_SOTTOCINI 120
#define F_DESCRINI 121
#define F_GRUPPOFIN 122
#define F_CONTOFIN 123
#define F_SOTTOCFIN 124
#define F_DESCRFIN 125
#define F_HIDESOTT 130
#define F_REPORT 131
// campi per la maschera ca1800a
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_ANNO 103
#define F_DATAINI 104
#define F_DATAFIN 105
#define F_DACODCMS 106
#define F_DADESCMS 107
#define F_ACODCMS 108
#define F_ADESCMS 109
#define F_DACODFASE 110
#define F_DADESFASE 111
#define F_ACODFASE 112
#define F_ADESFASE 113
#define F_CODCMS 114
#define F_DESCMS 115
#define F_GRUPPOINI 118
#define F_CONTOINI 119
#define F_SOTTOCINI 120
#define F_DESCRINI 121
#define F_GRUPPOFIN 122
#define F_CONTOFIN 123
#define F_SOTTOCFIN 124
#define F_DESCRFIN 125
#define F_TIPOMOV 126
#define F_HIDESOTT 130
#define F_REPORT 131

View File

@ -1,361 +1,369 @@
#include "ca1800a.h"
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_PREVIEW 2 2
BEGIN
PROMPT 1 1 "~Anteprima"
PICTURE TOOL_PREVIEW
END
#include <printbar.h>
ENDPAGE
PAGE "Conti per CDC/Commessa" 0 2 0 0
GROUPBOX DLG_NULL 79 3
BEGIN
PROMPT 1 0 "@bDitta"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Codice "
FLAGS "DF"
USE LF_NDITTE
INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale@50" RAGSOC
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE REQUIRED
END
STRING F_RAGSOC 50
BEGIN
PROMPT 17 1 "Rag. Soc. "
FLAGS "D"
END
GROUPBOX DLG_NULL 79 4
BEGIN
PROMPT 1 3 "@bPeriodo"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 2 4 "Codice esercizio "
HELP "Codice esercizio per cui si vuole la lista"
USE ESC
INPUT CODTAB F_ANNO
DISPLAY "Codice" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNO CODTAB
OUTPUT F_DATAINI D0
OUTPUT F_DATAFIN D1
FLAGS "RZ"
ADD RUN cg0 -5 esc
CHECKTYPE NORMAL
WARNING "Codice esercizio assente"
FIELD #ANNO
END
DATE F_DATAINI
BEGIN
PROMPT 2 5 "Dalla data "
FIELD #DATAINI
END
DATE F_DATAFIN
BEGIN
PROMPT 50 5 "alla data "
VALIDATE DATE_CMP_FUNC >= F_DATAINI
WARNING "La data finale deve essere succeviva a quella iniziale"
FIELD #DATAFIN
END
GROUPBOX DLG_NULL 79 4
BEGIN
PROMPT 1 7 "@bSelezione commesse"
END
STRING F_DACODCMS 20
BEGIN
PROMPT 2 8 "Da "
FLAGS "UZ"
USE COMMESSE
INPUT CODCMS F_DACODCMS
DISPLAY "Codice@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_DACODCMS CODCMS
OUTPUT F_DADESCMS DESCRIZ
CHECKTYPE SEARCH
FIELD #DACODCMS
GROUP 1
END
STRING F_DADESCMS 50 48
BEGIN
PROMPT 29 8 ""
USE COMMESSE KEY 2
INPUT DESCRIZ F_DADESCMS
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice@20" CODCMS
COPY OUTPUT F_DACODCMS
CHECKTYPE NORMAL
GROUP 1
END
STRING F_ACODCMS 20
BEGIN
PROMPT 2 9 "A "
FLAGS "UZ"
COPY USE F_DACODCMS
INPUT CODCMS F_ACODCMS
COPY DISPLAY F_DACODCMS
OUTPUT F_ACODCMS CODCMS
OUTPUT F_ADESCMS DESCRIZ
CHECKTYPE SEARCH
FIELD #ACODCMS
GROUP 1
END
STRING F_ADESCMS 50 48
BEGIN
PROMPT 29 9 ""
COPY USE F_DADESCMS
INPUT DESCRIZ F_ADESCMS
COPY DISPLAY F_DADESCMS
COPY OUTPUT F_ACODCMS
CHECKTYPE NORMAL
GROUP 1
END
//campo solo per CA
STRING F_CODCMS 20
BEGIN
PROMPT 2 8 ""
FLAGS "UZ"
USE COMMESSE
INPUT CODCMS F_CODCMS
DISPLAY "Codice@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODCMS CODCMS
OUTPUT F_DESCMS DESCRIZ
CHECKTYPE SEARCH
FIELD #CODCMS
GROUP 2
END
//campo solo per CA
STRING F_DESCMS 50 48
BEGIN
PROMPT 29 8 ""
USE COMMESSE KEY 2
INPUT DESCRIZ F_DESCMS
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice@20" CODCMS
COPY OUTPUT F_CODCMS
CHECKTYPE NORMAL
GROUP 2
END
//campo solo per CA
TEXT DLG_NULL
BEGIN
PROMPT 2 9 "Non selezionare alcuna commessa per stamparle tutte"
GROUP 2
END
GROUPBOX DLG_NULL 79 4
BEGIN
PROMPT 1 11 "@bSelezione fasi"
GROUP 3
END
STRING F_DACODFASE 10
BEGIN
PROMPT 2 12 "Da "
FLAGS "UZ"
USE FASI
INPUT CODFASE F_DACODFASE
DISPLAY "Codice@20" CODFASE
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_DACODFASE CODFASE
OUTPUT F_DADESFASE DESCRIZ
CHECKTYPE SEARCH
FIELD #DACODFASE
GROUP 3
END
STRING F_DADESFASE 50
BEGIN
PROMPT 19 12 ""
USE FASI KEY 2
INPUT DESCRIZ F_DADESFASE
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice@20" CODFASE
COPY OUTPUT F_DACODFASE
CHECKTYPE NORMAL
GROUP 3
END
STRING F_ACODFASE 10
BEGIN
PROMPT 2 13 "A "
FLAGS "UZ"
COPY USE F_DACODFASE
INPUT CODFASE F_ACODFASE
COPY DISPLAY F_DACODFASE
OUTPUT F_ACODFASE CODFASE
OUTPUT F_ADESFASE DESCRIZ
CHECKTYPE SEARCH
FIELD #ACODFASE
GROUP 3
END
STRING F_ADESFASE 50
BEGIN
PROMPT 19 13 ""
COPY USE F_DADESFASE
INPUT DESCRIZ F_ADESFASE
COPY DISPLAY F_DADESFASE
COPY OUTPUT F_ACODFASE
CHECKTYPE NORMAL
GROUP 3
END
GROUPBOX DLG_NULL 79 6
BEGIN
PROMPT 1 15 "@bSelezione conti (solo conti di costo/ricavo)"
END
NUMBER F_GRUPPOINI 3
BEGIN
PROMPT 2 16 "Da Gruppo - Conto - Sottoconto "
END
NUMBER F_CONTOINI 3
BEGIN
PROMPT 39 16 ""
USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="")
INPUT GRUPPO F_GRUPPOINI
INPUT CONTO F_CONTOINI
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
DISPLAY "Tipo" TMCF
OUTPUT F_GRUPPOINI GRUPPO
OUTPUT F_CONTOINI CONTO
OUTPUT F_DESCRINI DESCR
CHECKTYPE NORMAL
WARNING "Conto inesistente o mancante"
VALIDATE REQIF_FUNC 1 F_SOTTOCINI
END
NUMBER F_SOTTOCINI 6
BEGIN
PROMPT 46 16 ""
USE LF_PCON SELECT SOTTOCONTO!=""
INPUT GRUPPO F_GRUPPOINI
INPUT CONTO F_CONTOINI
INPUT SOTTOCONTO F_SOTTOCINI
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPOINI GRUPPO
OUTPUT F_CONTOINI CONTO
OUTPUT F_SOTTOCINI SOTTOCONTO
OUTPUT F_DESCRINI DESCR
CHECKTYPE SEARCH
//ADD RUN cg0 -0
END
STRING F_DESCRINI 50
BEGIN
PROMPT 2 17 "Descrizione "
USE LF_PCON KEY 2
INPUT DESCR F_DESCRINI
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_SOTTOCINI
CHECKTYPE NORMAL
//ADD RUN cg0 -0
END
NUMBER F_GRUPPOFIN 3
BEGIN
PROMPT 2 18 "A Gruppo - Conto - Sottoconto "
END
NUMBER F_CONTOFIN 3
BEGIN
PROMPT 39 18 ""
USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="")
INPUT GRUPPO F_GRUPPOFIN
INPUT CONTO F_CONTOFIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
DISPLAY "Tipo" TMCF
OUTPUT F_GRUPPOFIN GRUPPO
OUTPUT F_CONTOFIN CONTO
OUTPUT F_DESCRFIN DESCR
CHECKTYPE NORMAL
VALIDATE REQIF_FUNC 1 F_SOTTOCFIN
WARNING "Conto inesistente o mancante"
END
NUMBER F_SOTTOCFIN 6
BEGIN
PROMPT 46 18 ""
USE LF_PCON SELECT SOTTOCONTO!=""
INPUT GRUPPO F_GRUPPOFIN
INPUT CONTO F_CONTOFIN
INPUT SOTTOCONTO F_SOTTOCFIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPOFIN GRUPPO
OUTPUT F_CONTOFIN CONTO
OUTPUT F_SOTTOCFIN SOTTOCONTO
OUTPUT F_DESCRFIN DESCR
CHECKTYPE SEARCH
WARNING "Sottoconto inesistente o mancante"
//ADD RUN cg0 -0
END
STRING F_DESCRFIN 50
BEGIN
PROMPT 2 19 "Descrizione "
USE LF_PCON KEY 2
CHECKTYPE NORMAL
INPUT DESCR F_DESCRFIN
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_SOTTOCFIN
//ADD RUN cg0 -0
END
BOOLEAN F_HIDESOTT
BEGIN
PROMPT 1 21 "Nascondi sottoconti"
END
STRING F_REPORT 50
BEGIN
PROMPT 1 22 "Report personalizzato "
RSELECT ""
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK
#include "ca1800a.h"
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_PREVIEW 2 2
BEGIN
PROMPT 1 1 "~Anteprima"
PICTURE TOOL_PREVIEW
END
#include <printbar.h>
ENDPAGE
PAGE "Conti per CDC/Commessa" 0 2 0 0
GROUPBOX DLG_NULL 79 3
BEGIN
PROMPT 1 0 "@bDitta"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Codice "
FLAGS "DF"
USE LF_NDITTE
INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale@50" RAGSOC
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE REQUIRED
END
STRING F_RAGSOC 50
BEGIN
PROMPT 17 1 "Rag. Soc. "
FLAGS "D"
END
GROUPBOX DLG_NULL 79 4
BEGIN
PROMPT 1 3 "@bPeriodo"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 2 4 "Codice esercizio "
HELP "Codice esercizio per cui si vuole la lista"
USE ESC
INPUT CODTAB F_ANNO
DISPLAY "Codice" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNO CODTAB
OUTPUT F_DATAINI D0
OUTPUT F_DATAFIN D1
FLAGS "RZ"
ADD RUN cg0 -5 esc
CHECKTYPE NORMAL
WARNING "Codice esercizio assente"
FIELD #ANNO
END
DATE F_DATAINI
BEGIN
PROMPT 2 5 "Dalla data "
FIELD #DATAINI
END
DATE F_DATAFIN
BEGIN
PROMPT 50 5 "alla data "
VALIDATE DATE_CMP_FUNC >= F_DATAINI
WARNING "La data finale deve essere succeviva a quella iniziale"
FIELD #DATAFIN
END
GROUPBOX DLG_NULL 79 4
BEGIN
PROMPT 1 7 "@bSelezione commesse"
END
STRING F_DACODCMS 20
BEGIN
PROMPT 2 8 "Da "
FLAGS "UZ"
USE COMMESSE
INPUT CODCMS F_DACODCMS
DISPLAY "Codice@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_DACODCMS CODCMS
OUTPUT F_DADESCMS DESCRIZ
CHECKTYPE SEARCH
FIELD #DACODCMS
GROUP 1
END
STRING F_DADESCMS 50 48
BEGIN
PROMPT 29 8 ""
USE COMMESSE KEY 2
INPUT DESCRIZ F_DADESCMS
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice@20" CODCMS
COPY OUTPUT F_DACODCMS
CHECKTYPE NORMAL
GROUP 1
END
STRING F_ACODCMS 20
BEGIN
PROMPT 2 9 "A "
FLAGS "UZ"
COPY USE F_DACODCMS
INPUT CODCMS F_ACODCMS
COPY DISPLAY F_DACODCMS
OUTPUT F_ACODCMS CODCMS
OUTPUT F_ADESCMS DESCRIZ
CHECKTYPE SEARCH
FIELD #ACODCMS
GROUP 1
END
STRING F_ADESCMS 50 48
BEGIN
PROMPT 29 9 ""
COPY USE F_DADESCMS
INPUT DESCRIZ F_ADESCMS
COPY DISPLAY F_DADESCMS
COPY OUTPUT F_ACODCMS
CHECKTYPE NORMAL
GROUP 1
END
//campo solo per CA
STRING F_CODCMS 20
BEGIN
PROMPT 2 8 ""
FLAGS "UZ"
USE COMMESSE
INPUT CODCMS F_CODCMS
DISPLAY "Codice@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODCMS CODCMS
OUTPUT F_DESCMS DESCRIZ
CHECKTYPE SEARCH
FIELD #CODCMS
GROUP 2
END
//campo solo per CA
STRING F_DESCMS 50 48
BEGIN
PROMPT 29 8 ""
USE COMMESSE KEY 2
INPUT DESCRIZ F_DESCMS
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice@20" CODCMS
COPY OUTPUT F_CODCMS
CHECKTYPE NORMAL
GROUP 2
END
//campo solo per CA
TEXT DLG_NULL
BEGIN
PROMPT 2 9 "Non selezionare alcuna commessa per stamparle tutte"
GROUP 2
END
GROUPBOX DLG_NULL 79 4
BEGIN
PROMPT 1 11 "@bSelezione fasi"
GROUP 3
END
STRING F_DACODFASE 10
BEGIN
PROMPT 2 12 "Da "
FLAGS "UZ"
USE FASI
INPUT CODFASE F_DACODFASE
DISPLAY "Codice@20" CODFASE
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_DACODFASE CODFASE
OUTPUT F_DADESFASE DESCRIZ
CHECKTYPE SEARCH
FIELD #DACODFASE
GROUP 3
END
STRING F_DADESFASE 50
BEGIN
PROMPT 19 12 ""
USE FASI KEY 2
INPUT DESCRIZ F_DADESFASE
DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice@20" CODFASE
COPY OUTPUT F_DACODFASE
CHECKTYPE NORMAL
GROUP 3
END
STRING F_ACODFASE 10
BEGIN
PROMPT 2 13 "A "
FLAGS "UZ"
COPY USE F_DACODFASE
INPUT CODFASE F_ACODFASE
COPY DISPLAY F_DACODFASE
OUTPUT F_ACODFASE CODFASE
OUTPUT F_ADESFASE DESCRIZ
CHECKTYPE SEARCH
FIELD #ACODFASE
GROUP 3
END
STRING F_ADESFASE 50
BEGIN
PROMPT 19 13 ""
COPY USE F_DADESFASE
INPUT DESCRIZ F_ADESFASE
COPY DISPLAY F_DADESFASE
COPY OUTPUT F_ACODFASE
CHECKTYPE NORMAL
GROUP 3
END
GROUPBOX DLG_NULL 79 6
BEGIN
PROMPT 1 15 "@bSelezione conti (solo conti di costo/ricavo)"
END
NUMBER F_GRUPPOINI 3
BEGIN
PROMPT 2 16 "Da Gruppo - Conto - Sottoconto "
END
NUMBER F_CONTOINI 3
BEGIN
PROMPT 39 16 ""
USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="")
INPUT GRUPPO F_GRUPPOINI
INPUT CONTO F_CONTOINI
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
DISPLAY "Tipo" TMCF
OUTPUT F_GRUPPOINI GRUPPO
OUTPUT F_CONTOINI CONTO
OUTPUT F_DESCRINI DESCR
CHECKTYPE NORMAL
WARNING "Conto inesistente o mancante"
VALIDATE REQIF_FUNC 1 F_SOTTOCINI
END
NUMBER F_SOTTOCINI 6
BEGIN
PROMPT 46 16 ""
USE LF_PCON SELECT SOTTOCONTO!=""
INPUT GRUPPO F_GRUPPOINI
INPUT CONTO F_CONTOINI
INPUT SOTTOCONTO F_SOTTOCINI
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPOINI GRUPPO
OUTPUT F_CONTOINI CONTO
OUTPUT F_SOTTOCINI SOTTOCONTO
OUTPUT F_DESCRINI DESCR
CHECKTYPE SEARCH
//ADD RUN cg0 -0
END
STRING F_DESCRINI 50
BEGIN
PROMPT 2 17 "Descrizione "
USE LF_PCON KEY 2
INPUT DESCR F_DESCRINI
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_SOTTOCINI
CHECKTYPE NORMAL
//ADD RUN cg0 -0
END
NUMBER F_GRUPPOFIN 3
BEGIN
PROMPT 2 18 "A Gruppo - Conto - Sottoconto "
END
NUMBER F_CONTOFIN 3
BEGIN
PROMPT 39 18 ""
USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="")
INPUT GRUPPO F_GRUPPOFIN
INPUT CONTO F_CONTOFIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
DISPLAY "Tipo" TMCF
OUTPUT F_GRUPPOFIN GRUPPO
OUTPUT F_CONTOFIN CONTO
OUTPUT F_DESCRFIN DESCR
CHECKTYPE NORMAL
VALIDATE REQIF_FUNC 1 F_SOTTOCFIN
WARNING "Conto inesistente o mancante"
END
NUMBER F_SOTTOCFIN 6
BEGIN
PROMPT 46 18 ""
USE LF_PCON SELECT SOTTOCONTO!=""
INPUT GRUPPO F_GRUPPOFIN
INPUT CONTO F_CONTOFIN
INPUT SOTTOCONTO F_SOTTOCFIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPOFIN GRUPPO
OUTPUT F_CONTOFIN CONTO
OUTPUT F_SOTTOCFIN SOTTOCONTO
OUTPUT F_DESCRFIN DESCR
CHECKTYPE SEARCH
WARNING "Sottoconto inesistente o mancante"
//ADD RUN cg0 -0
END
STRING F_DESCRFIN 50
BEGIN
PROMPT 2 19 "Descrizione "
USE LF_PCON KEY 2
CHECKTYPE NORMAL
INPUT DESCR F_DESCRFIN
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_SOTTOCFIN
//ADD RUN cg0 -0
END
BOOLEAN F_HIDESOTT
BEGIN
PROMPT 1 21 "Nascondi sottoconti"
END
LIST F_TIPOMOV 24
BEGIN
PROMPT 32 21 "Selezione movimenti "
ITEM " |Qualsiasi"
ITEM "N|Normale"
ITEM "P|Preventivo e variazione"
END
STRING F_REPORT 50
BEGIN
PROMPT 1 22 "Report personalizzato "
RSELECT ""
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK

View File

@ -11,6 +11,10 @@
#include "calib01.h"
#include "../cg/cglib01.h"
#include "../ve/velib.h"
#include "../mg/umart.h"
#include <rdoc.h>
#include <causali.h>
#include <mov.h>
@ -93,9 +97,14 @@ protected:
void write_rows(const TMask& m);
void read_rows(const TMask& m);
void write_doc(const TMask& m);
void remove_doc();
virtual bool protected_record(TRectype& rec);
virtual int write(const TMask& m);
virtual int rewrite(const TMask& m);
virtual bool remove();
virtual int read(TMask& m);
virtual void ini2sheet(TConfig& ini, TSheet_field& sheet);
@ -193,9 +202,17 @@ TToken_string& TMovanal_msk::get_rip_row(const TRectype& rrip)
rmov.put(RMOVANA_CODCMS, keyrip.get());
rmov.put(RMOVANA_CODFASE, keyrip.get());
rmov.put(RMOVANA_CODCONTO, keyrip.get());
if (ci)
TToken_string& row = rec2row(rmov, -1);
if (ci)
{
rmov.put(RMOVANA_CODART, keyrip.get());
TToken_string& row = rec2row(rmov, -1);
TArticolo & art = cached_article(rmov.get(RMOVANA_CODART));
row.add(art.get(ANAMAG_DESCR), sheet.cid2index(S_DESCART));
}
return row;
}
@ -205,14 +222,15 @@ void TMovanal_msk::split_cg_row(const TRectype& row, const TAnal_ripartizioni_ba
TGeneric_distrib distrib(row.get_real(RMV_IMPORTO), TCurrency::get_firm_dec());
// Calcolo tutte le percentuali da ripartire
for (int i = 1; i <= rrip.rows(); i++)
int i;
for (i = 1; i <= rrip.rows(); i++)
{
const real quota = rrip[i].get_real(RRIP_RIPARTO);
distrib.add(quota);
}
TString80 desc; // Variabile di appoggio per descrizione riga
for (int i = 1; i <= rrip.rows(); i++)
for (i = 1; i <= rrip.rows(); i++)
{
TToken_string& riga = get_rip_row(rrip[i]); // Cerca o crea la riga cui sommare la quota
TImporto impriga; row2imp(riga, impriga); // Legge l'importo della riga
@ -380,6 +398,7 @@ void TMovanal_msk::load_cg_row(const TRectype& row)
str = row.get(RMV_CONTO); str.right_just(3, '0'); riga.add(str, pos-1);
str = row.get(RMV_SOTTOCONTO); str.right_just(6, '0'); riga.add(str, pos);
}
sheet.check_row(sheet.items() - 1);
} //else di rrip_items > 0...
} //if(zio.is_analitico(...
}
@ -672,8 +691,28 @@ bool TMovanal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
else
o.set(datacomp.string()); //se la data fine competenza viene lasciata vuota -> e' uguale alla datacomp
}
break;
case F_CODCAUS:
if ((e== fe_init || e == fe_modify) && !query_mode())
{
TSheet_field & s = sfield(F_RIGHE);
const TRectype & caus = cache().get(LF_CAUSALI, (const char *) o.get());
s.enable_column(s.cid2index(S_CODART), caus.get_bool(CAU_MOVCGIND));
s.enable_column(s.cid2index(S_DESCART), caus.get_bool(CAU_MOVCGIND));
if (!caus.get_bool(CAU_MOVCGIND))
{
for (int r = 0; r < s.items(); r++ )
{
TToken_string & row = s.row(r);
row.add("", s.cid2index(S_CODART));
row.add("", s.cid2index(S_DESCART));
}
}
s.force_update();
}
break;
case DLG_USER:
if (e == fe_button)
display_rmov_comp();
@ -818,8 +857,25 @@ bool TMovanal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
const bool vuoto = o.empty();
enable(-5, vuoto);
if (!vuoto)
{
TSheet_field & s = sfield(F_RIGHE);
const TRectype & caus = cache().get(LF_CAUSALI, o.mask().get(F_CODCAUS));
s.enable_column(s.cid2index(S_CODART), caus.get_bool(CAU_MOVCGIND));
s.enable_column(s.cid2index(S_DESCART), caus.get_bool(CAU_MOVCGIND));
if (!caus.get_bool(CAU_MOVCGIND))
{
for (int r = 0; r < s.items(); r++ )
{
TToken_string & row = s.row(r);
row.add("", s.cid2index(S_CODART));
row.add("", s.cid2index(S_DESCART));
}
}
load_cg_mov();
}
}
break;
case F_BLOCCATO:
if (e == fe_modify)
@ -939,7 +995,7 @@ TToken_string& TMovanal_msk::rec2row(const TRectype& rec, int r) const
row.add(fr->read(rec), idx);
}
}
sheet.check_row(r);
return row;
}
@ -1078,9 +1134,10 @@ int TMovanal_msk::create_sheet_fields(int lf, int& y, short& dlg, bool required)
{
TSheet_field& sf = sfield(F_RIGHE);
TMask& sm = sf.sheet_mask();
const int h = ca_create_fields(sm, 0, lf, 1, y, dlg, dlg+50);
const bool pcon = lf == LF_PCON || lf == LF_PCONANA;
const int h = ca_create_fields(sm, 0, lf, 1, y, dlg, dlg+50, 0x0, NULL, 0, pcon);
for (int i = 0; i < h; i++)
for (int i = 0; i < h + pcon; i++)
{
TEdit_field& fld = sm.efield(dlg+i);
int logic = lf;
@ -1098,14 +1155,17 @@ int TMovanal_msk::create_sheet_fields(int lf, int& y, short& dlg, bool required)
if (logic == LF_PCON)
{
const TFieldref* f = fld.field();
const TString& fieldname = f->name();
if (f != NULL)
{
const TString& fieldname = f->name();
if (fieldname == "GRUPPO")
fld.set_field("CODCONTO[1,3]"); else
if (fieldname == "CONTO")
fld.set_field("CODCONTO[4,6]"); else
if (fieldname == "SOTTOCONTO")
fld.set_field("CODCONTO[7,12]");
if (fieldname == "GRUPPO")
fld.set_field("CODCONTO[1,3]"); else
if (fieldname == "CONTO")
fld.set_field("CODCONTO[4,6]"); else
if (fieldname == "SOTTOCONTO")
fld.set_field("CODCONTO[7,12]");
}
}
else
{
@ -1118,13 +1178,17 @@ int TMovanal_msk::create_sheet_fields(int lf, int& y, short& dlg, bool required)
default : fieldname = RMOVANA_CODCONTO; break;
}
TFieldref* f = (TFieldref*)fld.field();
if (f != NULL)
f->set_name(fieldname);
}
fld.check_type(required ? CHECK_REQUIRED : CHECK_NORMAL);
TEdit_field& dfld = sm.efield(dlg+50+i);
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output!
if (i < h)
{
TEdit_field& dfld = sm.efield(pcon && i == h - 1 ? dlg + h: dlg+50+i);
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output!
}
}
y += h+1;
@ -1145,7 +1209,7 @@ void TMovanal_msk::create_sheet()
TConfig& ini = ca_config();
const bool fsc_req = ini.get_bool("FscRequired");
int y = 4;
int y = 3;
short dlg = S_CDC1+100; // id del primo campo da generare
_cdc_start = _cdc_end = -1;
_cms_start = _cms_end = -1;
@ -1245,6 +1309,162 @@ bool TMovanal_app::get_next_key(TToken_string& key)
return true;
}
void TMovanal_app::write_doc(const TMask& m)
{
const TRectype & caus = cache().get(LF_CAUSALI, (const char *) m.get(F_CODCAUS));
if (caus.get_bool(CAU_MOVCGIND))
{
TAnal_mov& movana = (TAnal_mov&)_rel->curr();
long ndoc = movana.get_long(MOVANA_DNDOC);
const TDate datadoc = movana.get_date(MOVANA_DATAREG);
if (ndoc == 0L)
{
movana.put(MOVANA_DPROVV, "D");
movana.put(MOVANA_DATADOC, datadoc);
movana.put(MOVANA_DCODNUM, ini_get_string(CONFIG_DITTA, "CI", "NumCGInd"));
movana.put(MOVANA_DANNO, datadoc.year());
}
const char provv = movana.get_char(MOVANA_DPROVV);
const int anno = movana.get_int(MOVANA_DANNO);
const TString8 codnum(movana.get(MOVANA_DCODNUM));
TDocumento doc(provv, anno, codnum, ndoc);
doc.put(DOC_PROVV, provv);
doc.put(DOC_ANNO, anno);
doc.put(DOC_CODNUM, codnum);
doc.put(DOC_NDOC, ndoc);
const long codcf = m.get_long(F_CODCF);
if (codcf > 0L)
{
doc.put(DOC_TIPOCF, m.get(F_TIPOCF));
doc.put(DOC_CODCF, codcf);
}
doc.put(DOC_DATADOC, datadoc);
doc.put(DOC_DATADOCRIF, movana.get_date(MOVANA_DATADOC));
doc.put(DOC_NUMDOCRIF, movana.get_date(MOVANA_NUMDOC));
doc.put(DOC_DATACOMP, movana.get_date(MOVANA_DATACOMP));
doc.put(DOC_DATAFCOMP, movana.get_date(MOVANA_DATAFCOMP));
doc.put(DOC_TIPODOC, ini_get_string(CONFIG_DITTA, "CI", "TipCGInd"));
if (ndoc == 0L)
doc.put(DOC_STATO, "1");
doc.destroy_rows();
const int rows = movana.body().rows();
for (int r = 1; r <= rows; r++)
{
const TRectype & rmovana = movana.body().row(r);
TRiga_documento & rdoc = doc.new_row("01");
const TString codart(rmovana.get(RMOVANA_CODART));
real valore(rmovana.get(RMOVANA_IMPORTO));
if (rmovana.get(RMOVANA_SEZIONE) == "A")
valore = -valore;
real prezzo = valore;
rdoc.put(RDOC_CODART, codart);
rdoc.put(RDOC_CODARTMAG, codart);
rdoc.put(RDOC_CHECKED, "X");
if (codart.full())
{
const TArticolo & art = cached_article(codart);
rdoc.put(RDOC_DESCR, rmovana.get(RMOVANA_DESCR).full() ? rmovana.get(RMOVANA_DESCR) : art.get(ANAMAG_DESCR));
rdoc.put(RDOC_UMQTA, art.first_um());
prezzo = art.um()[1].get_real(UMART_PREZZO);
if (prezzo.is_zero())
prezzo = valore;
}
if (r == 1)
{
doc.put(DOC_CODCMS, rmovana.get(RMOVANA_CODCMS));
doc.put(DOC_FASCMS, rmovana.get(RMOVANA_CODFASE));
doc.put(DOC_CODCOSTO, rmovana.get(RMOVANA_CODCCOSTO));
}
rdoc.put(RDOC_CODCMS, rmovana.get(RMOVANA_CODCMS));
rdoc.put(RDOC_FASCMS, rmovana.get(RMOVANA_CODFASE));
rdoc.put(RDOC_CODCOSTO, rmovana.get(RMOVANA_CODCCOSTO));
real qta = valore / prezzo;
qta.round(5);
rdoc.put(RDOC_QTA, qta);
rdoc.put(RDOC_PREZZO, prezzo);
rdoc.put(RDOC_CODIVA, ini_get_string(CONFIG_DITTA, "CI", "IVACGInd"));
}
const int err = doc.write(true);
ndoc = doc.get_long(DOC_NDOC);
movana.put(MOVANA_DNDOC, ndoc);
if (err == NOERR)
{
TFilename ininame; ininame.temp();
{
TConfig ini(ininame, "Transaction");
ini.set("Action", "Modify");
TString8 para;
para.format("%d", LF_DOC);
ini.set_paragraph(para);
ini.set(DOC_PROVV, doc.get(DOC_PROVV));
ini.set(DOC_ANNO, doc.get(DOC_ANNO));
ini.set(DOC_CODNUM, doc.get(DOC_CODNUM));
ini.set(DOC_NDOC, doc.get(DOC_NDOC));
}
TString appname("ve0 -0"); appname << " /i" << ininame;
TExternal_app app(appname);
const bool ok = app.run() == 0;
if (ininame.exist())
::remove(ininame);
}
else
error_box(FR("Errore %d in scrittura del documenton.ro %ld"), err, ndoc);
}
}
void TMovanal_app::remove_doc()
{
const TRectype & caus = cache().get(LF_CAUSALI, (const char *) _msk->get(F_CODCAUS));
if (caus.get_bool(CAU_MOVCGIND))
{
TRectype & movana = _rel->lfile().curr();
long ndoc = movana.get_long(MOVANA_DNDOC);
if (ndoc > 0L)
{
char provv = movana.get_char(MOVANA_DPROVV);
int anno = movana.get_int(MOVANA_DANNO);
TString8 codnum(movana.get(MOVANA_DCODNUM));
TDocumento doc(provv, anno, codnum, ndoc);
if (ndoc == doc.get_long(DOC_NDOC))
{
const int err = doc.remove();
if (err == NOERR)
message_box(FR("Cancellato il documento n.ro %ld "), ndoc);
else
error_box(FR("Errore %d in eliminazione del documenton.ro %ld"), err, ndoc);
}
}
}
}
void TMovanal_app::write_rows(const TMask& m)
{
TAnal_mov& mov = (TAnal_mov&)_rel->curr();
@ -1316,24 +1536,61 @@ bool TMovanal_app::protected_record(TRectype& rec)
int TMovanal_app::write(const TMask& m)
{
m.autosave(*_rel);
bool ci = has_module(CIAUT);
m.autosave(*_rel);
if (_rel->lfile().get_long(MOVANA_DNDOC) == 0)
{
const TString key = _rel->lfile().get(MOVANA_NUMREGCG);
const TRectype & rec = cache().get(LF_MOV, key);
_rel->lfile().put(MOVANA_DPROVV, rec.get(MOV_DPROVV));
_rel->lfile().put(MOVANA_DANNO, rec.get(MOV_DANNO));
_rel->lfile().put(MOVANA_DCODNUM, rec.get(MOV_DCODNUM));
_rel->lfile().put(MOVANA_DNDOC, rec.get(MOV_DNDOC));
}
write_rows(m);
const int err = _rel->write();
if (err == NOERR)
if (ci)
write_doc(m);
const int err = _rel->write();
if (ci && err == NOERR)
link_ci(m);
return err;
}
int TMovanal_app::rewrite(const TMask& m)
{
bool ci = has_module(CIAUT);
m.autosave(*_rel);
if (_rel->lfile().get_long(MOVANA_DNDOC) == 0)
{
const TString key = _rel->lfile().get(MOVANA_NUMREGCG);
const TRectype & rec = cache().get(LF_MOV, key);
_rel->lfile().put(MOVANA_DPROVV, rec.get(MOV_DPROVV));
_rel->lfile().put(MOVANA_DANNO, rec.get(MOV_DANNO));
_rel->lfile().put(MOVANA_DCODNUM, rec.get(MOV_DCODNUM));
_rel->lfile().put(MOVANA_DNDOC,
rec.get(MOV_DNDOC));
}
write_rows(m);
if (ci)
write_doc(m);
const int err = _rel->rewrite();
if (err == NOERR)
if (ci && err == NOERR)
link_ci(m);
return err;
}
bool TMovanal_app::remove()
{
bool ci = has_module(CIAUT);
if (ci)
remove_doc();
return TRelation_application::remove();
}
int TMovanal_app::read(TMask& m)
{
const int err = TRelation_application::read(m);

View File

@ -1,55 +1,56 @@
#define F_NUMREG 201
#define F_ANNOES 202
#define F_DESCR 203
#define F_DATAREG 204
#define F_DATACOMP 205
#define F_DATADOC 206
#define F_AUTOFCOMP 207
#define F_TIPODOC 209
#define F_SEZIONE 210
#define F_TOTDOC 211
#define F_NUMREGCG 212
#define F_CODCAUS 213
#define F_DESCAUS 214
#define F_DARE 215
#define F_AVERE 216
#define F_BLOCCATO 217
#define F_TIPO 218
#define F_NUMDOC 219
#define F_RESET 220
#define F_TIPOCF 221
#define F_CODCF 222
#define F_RAGSOCCF 223
#define F_DATAFCOMP 224
#define F_NUMREG2 301
#define F_ANNOES2 302
#define F_DATAREG2 303
#define F_DESCR2 304
#define F_RIGHE 400
#define S_DARE 101
#define S_AVERE 102
#define S_DESCR 103
#define S_CDC1 104
#define S_CDC2 105
#define S_CDC3 106
#define S_CDC4 107
#define S_CMS1 108
#define S_CMS2 109
#define S_CMS3 110
#define S_CMS4 111
#define S_FAS1 112
#define S_FAS2 113
#define S_FAS3 114
#define S_FAS4 115
#define S_CON1 116
#define S_CON2 117
#define S_CON3 118
#define S_CON4 119
#define S_CODART 120
#define S_DESCART 121
#define S_CDC_ORI 122
#define S_CMS_ORI 123
#define S_FAS_ORI 124
#define S_CON_ORI 125
#define F_NUMREG 201
#define F_ANNOES 202
#define F_DESCR 203
#define F_DATAREG 204
#define F_DATACOMP 205
#define F_DATADOC 206
#define F_AUTOFCOMP 207
#define F_TIPODOC 209
#define F_SEZIONE 210
#define F_TOTDOC 211
#define F_NUMREGCG 212
#define F_CODCAUS 213
#define F_DESCAUS 214
#define F_DARE 215
#define F_AVERE 216
#define F_BLOCCATO 217
#define F_TIPO 218
#define F_NUMDOC 219
#define F_RESET 220
#define F_TIPOCF 221
#define F_CODCF 222
#define F_RAGSOCCF 223
#define F_DATAFCOMP 224
#define F_NUMREG2 301
#define F_ANNOES2 302
#define F_DATAREG2 303
#define F_DESCR2 304
#define F_RIGHE 400
#define S_DARE 101
#define S_AVERE 102
#define S_DESCR 103
#define S_CDC1 104
#define S_CDC2 105
#define S_CDC3 106
#define S_CDC4 107
#define S_CMS1 108
#define S_CMS2 109
#define S_CMS3 110
#define S_CMS4 111
#define S_FAS1 112
#define S_FAS2 113
#define S_FAS3 114
#define S_FAS4 115
#define S_CON1 116
#define S_CON2 117
#define S_CON3 118
#define S_CON4 119
#define S_DES_CON 120
#define S_CODART 121
#define S_DESCART 122
#define S_CDC_ORI 123
#define S_CMS_ORI 124
#define S_FAS_ORI 125
#define S_CON_ORI 126

File diff suppressed because it is too large Load Diff

View File

@ -1,214 +1,218 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3100a" lpi="8" class="ca3100b">
<description>Movimenti CA per numero registrazione</description>
<font face="Courier New" size="8" />
<section type="Head">
<font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="10" />
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="76" type="Data" width="10" pattern="1">
<source>#SYSTEM.DATE</source>
</field>
<field x="157" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
<field x="10" y="1.25" type="Testo" width="12" pattern="1" text="Dal numero" />
<field x="22" y="1.25" type="Numero" width="12" pattern="1">
<font face="Courier New" bold="1" size="8" />
<source>#DANUMREG</source>
</field>
<field x="40" y="1.25" type="Testo" width="12" pattern="1" text="Al numero" />
<field x="52" y="1.25" type="Numero" width="12" pattern="1">
<font face="Courier New" bold="1" size="8" />
<source>#ANUMREG</source>
</field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" />
<field x="1.5" y="3" type="Testo" align="center" width="7" pattern="1" text="N.Reg." />
<field x="33.5" y="3" type="Testo" align="center" width="10" pattern="1" text="Data Doc." />
<field x="45.5" y="3" type="Testo" align="center" width="8" pattern="1" text="N.Reg.CG" />
<field x="55" y="3" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="62" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Doc." />
<field x="69" y="3" type="Testo" align="center" width="11" pattern="1" text="Descrizione" />
<field x="95" y="3" type="Testo" align="center" width="7" pattern="1" text="Causale" />
<field x="125" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Mov." />
<field x="133" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Dare" />
<field x="147" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Avere" />
<field border="2" x="1" y="4" type="Linea" width="161" height="0" pattern="1" />
<field x="10" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
<field x="22" y="3" type="Testo" width="10" id="122" pattern="1" text="Data Comp." />
</section>
<section type="Head" level="1" height="3">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<font face="Courier New" bold="1" size="16" />
</field>
</section>
<section type="Head" level="2">
<groupby>NUMREG</groupby>
<field x="1" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
<source>MOVANA.NUMREG</source>
</field>
<field x="34" y="1" type="Data" width="10" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
<source>MOVANA.NUMREGCG</source>
</field>
<field x="56" y="1" type="Stringa" width="7" pattern="1">
<source>MOVANA.NUMDOC</source>
</field>
<field x="64" y="1" type="Stringa" width="4" pattern="1">
<source>MOVANA.TIPODOC</source>
</field>
<field x="69" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>MOVANA.DESCR</source>
</field>
<field x="95" y="1" type="Stringa" width="3" pattern="1">
<source>MOVANA.CODCAUS</source>
</field>
<field x="99" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<prescript description="H2.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript>
</field>
<field x="127" y="1" type="Stringa" width="1" pattern="1">
<source>MOVANA.TIPOMOV</source>
</field>
<field x="131" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="146" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
<field x="61" y="3" type="Testo" width="13" pattern="1" text="Fase" />
<field x="75" y="3" type="Testo" width="23" pattern="1" text="Conto" />
<field x="99" y="3" type="Testo" width="25" pattern="1" text="Descrizione" />
<field x="131.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Dare" />
<field x="146.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Avere" />
<field border="1" x="8.18" y="4" type="Linea" width="154" height="0" pattern="1" />
<field x="-9.88" y="1" type="Data" width="10" id="121" pattern="1">
<source>DATAREG</source>
</field>
<field x="10" y="1" type="Data" width="10" id="121" pattern="1">
<source>MOVANA.DATAREG</source>
</field>
<field x="22" y="1" type="Data" align="right" width="10" id="122" pattern="1">
<source>MOVANA.DATACOMP</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<prescript description="B1 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="9" type="Numero" align="right" width="3" pattern="1">
<source>NUMRIG</source>
</field>
<field x="13" type="Stringa" width="23" pattern="1">
<source>CODCCOSTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript>
</field>
<field x="37" type="Stringa" width="23" pattern="1">
<source>CODCMS</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript>
</field>
<field x="61" type="Stringa" width="13" pattern="1">
<source>CODFASE</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field>
<field x="75" type="Stringa" width="23" pattern="1">
<source>CODCONTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="99" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>DESCR</source>
</field>
<field x="131" type="Valuta" align="right" width="15" id="101" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
</field>
<field x="146" type="Valuta" align="right" width="15" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
</field>
</section>
<section type="Foot" height="1" />
<section type="Foot" level="1">
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="131" y="1.5" type="Valuta" align="right" width="15" id="101" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="146" y="1.5" type="Valuta" align="right" width="15" id="102" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
</section>
<section type="Foot" level="2" />
<sql>USE RMOVANA
JOIN MOVANA INTO NUMREG==NUMREG</sql>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )
VARIABLE _X1 \ coordinate del campo F1
VARIABLE _Y1
VARIABLE _X2 \ coordinate del campo F2
VARIABLE _Y2
2DUP \ duplica i campi F1 F2 sullo stack
GET_POS \ prende le coordinate del campo F2
_Y2 ! \ e le mette in _Y2 e _X2
_X2 !
GET_POS \ prende le coordinate del campo F1
_Y1 ! \ e le mette in _Y1 e _X1
_X1 !
_X1 @ \ legge le coordinate di F1
_Y1 @
ROT
SET_POS \ mette le coord in F2
_X2 @
_Y2 @
ROT
SET_POS
;
</prescript>
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3100a" lpi="8" class="ca3100b">
<description>Movimenti CA per numero registrazione</description>
<font face="Courier New" size="8" />
<section type="Head" pattern="1">
<font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="10" />
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="76" type="Data" width="10" pattern="1">
<source>#SYSTEM.DATE</source>
</field>
<field x="157" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
<field x="10" y="1.25" type="Testo" width="12" pattern="1" text="Dal numero" />
<field x="22" y="1.25" type="Numero" align="right" width="12" pattern="1" hide_zero="1">
<font face="Courier New" bold="1" size="8" />
<source>#DANUMREG</source>
</field>
<field x="40" y="1.25" type="Testo" width="12" pattern="1" text="Al numero" />
<field x="52" y="1.25" type="Numero" align="right" width="12" pattern="1" hide_zero="1">
<font face="Courier New" bold="1" size="8" />
<source>#ANUMREG</source>
</field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" />
<field x="1.5" y="3" type="Testo" align="center" width="7" pattern="1" text="N.Reg." />
<field x="33.5" y="3" type="Testo" align="center" width="11" pattern="1" text="Fine Comp." />
<field x="45.5" y="3" type="Testo" align="center" width="8" pattern="1" text="N.Reg.CG" />
<field x="55" y="3" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="62" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Doc." />
<field x="69" y="3" type="Testo" align="center" width="11" pattern="1" text="Descrizione" />
<field x="95" y="3" type="Testo" align="center" width="7" pattern="1" text="Causale" />
<field x="125" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Mov." />
<field x="133" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Dare" />
<field x="147" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Avere" />
<field x="33.5" y="4" type="Testo" align="center" width="11" pattern="1" text="Data Doc." />
<field border="2" x="1" y="5" type="Linea" width="161" height="0" pattern="1" />
<field x="10" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
<field x="22" y="3" type="Testo" width="11" id="122" pattern="1" text="Data Comp." />
</section>
<section type="Head" level="1" height="3" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" pattern="2" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<font face="Courier New" bold="1" size="16" />
</field>
</section>
<section type="Head" level="2" pattern="1">
<groupby>NUMREG</groupby>
<field x="1" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
<source>MOVANA.NUMREG</source>
</field>
<field x="34" y="1" type="Data" width="11" pattern="1">
<source>MOVANA.DATAFCOMP</source>
</field>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
<source>MOVANA.NUMREGCG</source>
</field>
<field x="56" y="1" type="Stringa" width="7" pattern="1">
<source>MOVANA.NUMDOC</source>
</field>
<field x="64" y="1" type="Stringa" width="4" pattern="1">
<source>MOVANA.TIPODOC</source>
</field>
<field x="69" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>MOVANA.DESCR</source>
</field>
<field x="95" y="1" type="Stringa" width="3" pattern="1">
<source>MOVANA.CODCAUS</source>
</field>
<field x="99" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<prescript description="H2.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript>
</field>
<field x="127" y="1" type="Stringa" width="1" pattern="1">
<source>MOVANA.TIPOMOV</source>
</field>
<field x="131" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="146" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="34" y="2" type="Data" width="11" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
<field x="61" y="3" type="Testo" width="13" pattern="1" text="Fase" />
<field x="75" y="3" type="Testo" width="23" pattern="1" text="Conto" />
<field x="99" y="3" type="Testo" width="25" pattern="1" text="Descrizione" />
<field x="131.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Dare" />
<field x="146.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Avere" />
<field border="1" x="8.18" y="4" type="Linea" width="154" height="0" pattern="1" />
<field x="-9.88" y="1" type="Data" width="10" id="121" pattern="1">
<source>DATAREG</source>
</field>
<field x="10" y="1" type="Data" width="10" id="121" pattern="1">
<source>MOVANA.DATAREG</source>
</field>
<field x="22" y="1" type="Data" align="right" width="11" id="122" pattern="1">
<source>MOVANA.DATACOMP</source>
</field>
</section>
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<prescript description="B1 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="9" type="Numero" align="right" width="3" pattern="1">
<source>NUMRIG</source>
</field>
<field x="13" type="Stringa" width="23" pattern="1">
<source>CODCCOSTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript>
</field>
<field x="37" type="Stringa" width="23" pattern="1">
<source>CODCMS</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript>
</field>
<field x="61" type="Stringa" width="13" pattern="1">
<source>CODFASE</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field>
<field x="75" type="Stringa" width="23" pattern="1">
<source>CODCONTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="99" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>DESCR</source>
</field>
<field x="131" type="Valuta" align="right" width="15" id="101" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
</field>
<field x="146" type="Valuta" align="right" width="15" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
</field>
</section>
<section type="Foot" height="1" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="131" y="1.5" type="Valuta" align="right" width="15" id="101" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="146" y="1.5" type="Valuta" align="right" width="15" id="102" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
</section>
<section type="Foot" level="2" pattern="1" />
<sql>USE RMOVANA
JOIN MOVANA INTO NUMREG==NUMREG</sql>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )
VARIABLE _X1 \ coordinate del campo F1
VARIABLE _Y1
VARIABLE _X2 \ coordinate del campo F2
VARIABLE _Y2
2DUP \ duplica i campi F1 F2 sullo stack
GET_POS \ prende le coordinate del campo F2
_Y2 ! \ e le mette in _Y2 e _X2
_X2 !
GET_POS \ prende le coordinate del campo F1
_Y1 ! \ e le mette in _Y1 e _X1
_X1 !
_X1 @ \ legge le coordinate di F1
_Y1 @
ROT
SET_POS \ mette le coord in F2
_X2 @
_Y2 @
ROT
SET_POS
;
</prescript>
</report>

View File

@ -1,225 +1,229 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3100b" lpi="8" class="ca3100b">
<description>Movimenti CA per data</description>
<font face="Courier New" size="8" />
<section type="Head">
<font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="10" />
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="76" type="Data" width="12" pattern="1">
<source>#SYSTEM.DATE</source>
</field>
<field x="157" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
<field x="10" y="1.25" type="Testo" width="12" pattern="1" text="Dalla data" />
<field x="22" y="1.25" type="Data" width="12" pattern="1">
<font face="Courier New" bold="1" size="8" />
<source>#DADATA</source>
</field>
<field x="40" y="1.25" type="Testo" width="12" pattern="1" text="Alla data" />
<field x="52" y="1.25" type="Data" width="12" pattern="1">
<font face="Courier New" bold="1" size="8" />
<source>#ADATA</source>
</field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" />
<field x="13" y="3" type="Testo" align="center" width="7" pattern="1" text="N.Reg." />
<field x="33" y="3" type="Testo" align="center" width="10" pattern="1" text="Data Doc." />
<field x="45" y="3" type="Testo" align="center" width="8" pattern="1" text="N.Reg.CG" />
<field x="55" y="3" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="62" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Doc." />
<field x="69" y="3" type="Testo" align="center" width="11" pattern="1" text="Descrizione" />
<field x="95" y="3" type="Testo" align="center" width="7" pattern="1" text="Causale" />
<field x="124" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Mov." />
<field x="131" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Dare" />
<field x="146" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Avere" />
<field border="2" x="1" y="4" type="Linea" width="161" height="0" pattern="1" />
<field x="1" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
<field x="22" y="3" type="Testo" width="10" id="122" pattern="1" text="Data Comp." />
</section>
<section type="Head" level="1" height="3">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<font face="Courier New" bold="1" size="16" />
</field>
</section>
<section type="Head" level="2">
<groupby>IF (#ANNO &#3E; 0,MOVANA.DATACOMP,MOVANA.DATAREG)</groupby>
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2.131
MESSAGE RESET,F2.132</prescript>
</section>
<section type="Head" level="3">
<groupby>NUMREG</groupby>
<field x="13" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
<source>MOVANA.NUMREG</source>
</field>
<field x="34" y="1" type="Data" width="10" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
<source>MOVANA.NUMREGCG</source>
</field>
<field x="56" y="1" type="Stringa" width="7" pattern="1">
<source>MOVANA.NUMDOC</source>
</field>
<field x="64" y="1" type="Stringa" width="4" pattern="1">
<source>MOVANA.TIPODOC</source>
</field>
<field x="69" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>MOVANA.DESCR</source>
</field>
<field x="95" y="1" type="Stringa" width="3" pattern="1">
<source>MOVANA.CODCAUS</source>
</field>
<field x="99" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<prescript description="H3.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript>
</field>
<field x="127" y="1" type="Stringa" width="1" pattern="1">
<source>MOVANA.TIPOMOV</source>
</field>
<field x="131" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="146" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
<field x="61" y="3" type="Testo" width="13" pattern="1" text="Fase" />
<field x="75" y="3" type="Testo" width="23" pattern="1" text="Conto" />
<field x="99" y="3" type="Testo" width="25" pattern="1" text="Descrizione" />
<field x="131.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Dare" />
<field x="146.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Avere" />
<field border="1" x="8.18" y="4" type="Linea" width="154" height="0" pattern="1" />
<field x="1" y="1" type="Data" width="10" id="121" pattern="1">
<source>MOVANA.DATAREG</source>
</field>
<field x="22" y="1" type="Data" align="right" width="10" id="122" pattern="1">
<source>MOVANA.DATACOMP</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<prescript description="B1 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="9" type="Numero" align="right" width="3" pattern="1">
<source>NUMRIG</source>
</field>
<field x="13" type="Stringa" width="23" pattern="1">
<source>CODCCOSTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript>
</field>
<field x="37" type="Stringa" width="23" pattern="1">
<source>CODCMS</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript>
</field>
<field x="61" type="Stringa" width="13" pattern="1">
<source>CODFASE</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field>
<field x="75" type="Stringa" width="23" pattern="1">
<source>CODCONTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="99" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>DESCR</source>
</field>
<field x="131" type="Valuta" align="right" width="15" id="101" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101
MESSAGE ADD,F2.131</postscript>
</field>
<field x="146" type="Valuta" align="right" width="15" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102
MESSAGE ADD,F2.132</postscript>
</field>
</section>
<section type="Foot" height="1" />
<section type="Foot" level="1">
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="131" y="1.5" type="Valuta" align="right" width="15" id="101" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="146" y="1.5" type="Valuta" align="right" width="15" id="102" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
</section>
<section type="Foot" level="2">
<field border="1" x="2" y="1" type="Linea" width="160" height="0" pattern="1" />
<field x="110" y="1.5" type="Testo" width="20" pattern="1" text="Totale giornaliero:" />
<field x="131" y="1.25" type="Valuta" align="right" width="15" id="131" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="146" y="1.25" type="Valuta" align="right" width="15" id="132" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="3" />
<sql>USE RMOVANA
JOIN MOVANA INTO NUMREG==NUMREG
BY MOVANA-&#3E;#DATAORD</sql>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )
VARIABLE _X1 \ coordinate del campo F1
VARIABLE _Y1
VARIABLE _X2 \ coordinate del campo F2
VARIABLE _Y2
2DUP \ duplica i campi F1 F2 sullo stack
GET_POS \ prende le coordinate del campo F2
_Y2 ! \ e le mette in _Y2 e _X2
_X2 !
GET_POS \ prende le coordinate del campo F1
_Y1 ! \ e le mette in _Y1 e _X1
_X1 !
_X1 @ \ legge le coordinate di F1
_Y1 @
ROT
SET_POS \ mette le coord in F2
_X2 @
_Y2 @
ROT
SET_POS
;
</prescript>
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3100b" lpi="8" class="ca3100b">
<description>Movimenti CA per data</description>
<font face="Courier New" size="8" />
<section type="Head" pattern="1">
<font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="10" />
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="76" type="Data" width="12" pattern="1">
<source>#SYSTEM.DATE</source>
</field>
<field x="157" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
<field x="10" y="1.25" type="Testo" width="12" pattern="1" text="Dalla data" />
<field x="22" y="1.25" type="Data" width="12" pattern="1">
<font face="Courier New" bold="1" size="8" />
<source>#DADATA</source>
</field>
<field x="40" y="1.25" type="Testo" width="12" pattern="1" text="Alla data" />
<field x="52" y="1.25" type="Data" width="12" pattern="1">
<font face="Courier New" bold="1" size="8" />
<source>#ADATA</source>
</field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" />
<field x="13" y="3" type="Testo" align="center" width="7" pattern="1" text="N.Reg." />
<field x="33" y="3" type="Testo" align="center" width="11" pattern="1" text="Fine Comp." />
<field x="45" y="3" type="Testo" align="center" width="8" pattern="1" text="N.Reg.CG" />
<field x="55" y="3" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="62" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Doc." />
<field x="69" y="3" type="Testo" align="center" width="11" pattern="1" text="Descrizione" />
<field x="95" y="3" type="Testo" align="center" width="7" pattern="1" text="Causale" />
<field x="124" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Mov." />
<field x="131" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Dare" />
<field x="146" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Avere" />
<field x="33" y="4" type="Testo" align="center" width="11" pattern="1" text="Data Doc." />
<field border="2" x="1" y="5" type="Linea" width="161" height="0" pattern="1" />
<field x="1" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
<field x="22" y="3" type="Testo" width="11" id="122" pattern="1" text="Data Comp." />
</section>
<section type="Head" level="1" height="3" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" pattern="2" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<font face="Courier New" bold="1" size="16" />
</field>
</section>
<section type="Head" level="2" pattern="1">
<groupby>IF (#ANNO &#3E; 0,MOVANA.DATACOMP,MOVANA.DATAREG)</groupby>
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2.131
MESSAGE RESET,F2.132</prescript>
</section>
<section type="Head" level="3" pattern="1">
<groupby>NUMREG</groupby>
<field x="13" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
<source>MOVANA.NUMREG</source>
</field>
<field x="34" y="1" type="Data" width="11" pattern="1">
<source>MOVANA.DATAFCOMP</source>
</field>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
<source>MOVANA.NUMREGCG</source>
</field>
<field x="56" y="1" type="Stringa" width="7" pattern="1">
<source>MOVANA.NUMDOC</source>
</field>
<field x="64" y="1" type="Stringa" width="4" pattern="1">
<source>MOVANA.TIPODOC</source>
</field>
<field x="69" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>MOVANA.DESCR</source>
</field>
<field x="95" y="1" type="Stringa" width="3" pattern="1">
<source>MOVANA.CODCAUS</source>
</field>
<field x="99" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<prescript description="H3.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript>
</field>
<field x="127" y="1" type="Stringa" width="1" pattern="1">
<source>MOVANA.TIPOMOV</source>
</field>
<field x="131" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="146" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>MOVANA.TOTDOC</source>
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
</field>
<field x="34" y="2" type="Data" width="11" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
<field x="61" y="3" type="Testo" width="13" pattern="1" text="Fase" />
<field x="75" y="3" type="Testo" width="23" pattern="1" text="Conto" />
<field x="99" y="3" type="Testo" width="25" pattern="1" text="Descrizione" />
<field x="131.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Dare" />
<field x="146.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Avere" />
<field border="1" x="8.18" y="4" type="Linea" width="154" height="0" pattern="1" />
<field x="1" y="1" type="Data" width="10" id="121" pattern="1">
<source>MOVANA.DATAREG</source>
</field>
<field x="22" y="1" type="Data" align="right" width="11" id="122" pattern="1">
<source>MOVANA.DATACOMP</source>
</field>
</section>
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<prescript description="B1 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
121 122 SCAMBIA_CAMPI
THEN
;</prescript>
<field x="9" type="Numero" align="right" width="3" pattern="1">
<source>NUMRIG</source>
</field>
<field x="13" type="Stringa" width="23" pattern="1">
<source>CODCCOSTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript>
</field>
<field x="37" type="Stringa" width="23" pattern="1">
<source>CODCMS</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript>
</field>
<field x="61" type="Stringa" width="13" pattern="1">
<source>CODFASE</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field>
<field x="75" type="Stringa" width="23" pattern="1">
<source>CODCONTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="99" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>DESCR</source>
</field>
<field x="131" type="Valuta" align="right" width="15" id="101" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101
MESSAGE ADD,F2.131</postscript>
</field>
<field x="146" type="Valuta" align="right" width="15" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
THEN
</prescript>
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102
MESSAGE ADD,F2.132</postscript>
</field>
</section>
<section type="Foot" height="1" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="131" y="1.5" type="Valuta" align="right" width="15" id="101" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
<field x="146" y="1.5" type="Valuta" align="right" width="15" id="102" pattern="1" text="###.###.###,@@">
<font face="Courier New" bold="1" size="8" />
</field>
</section>
<section type="Foot" level="2" pattern="1">
<field border="1" x="2" y="1" type="Linea" width="160" height="0" pattern="1" />
<field x="110" y="1.5" type="Testo" width="20" pattern="1" text="Totale giornaliero:" />
<field x="131" y="1.25" type="Valuta" align="right" width="15" id="131" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="146" y="1.25" type="Valuta" align="right" width="15" id="132" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="3" pattern="1" />
<sql>USE RMOVANA
JOIN MOVANA INTO NUMREG==NUMREG
BY MOVANA-&#3E;#DATAORD</sql>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )
VARIABLE _X1 \ coordinate del campo F1
VARIABLE _Y1
VARIABLE _X2 \ coordinate del campo F2
VARIABLE _Y2
2DUP \ duplica i campi F1 F2 sullo stack
GET_POS \ prende le coordinate del campo F2
_Y2 ! \ e le mette in _Y2 e _X2
_X2 !
GET_POS \ prende le coordinate del campo F1
_Y1 ! \ e le mette in _Y1 e _X1
_X1 !
_X1 @ \ legge le coordinate di F1
_Y1 @
ROT
SET_POS \ mette le coord in F2
_X2 @
_Y2 @
ROT
SET_POS
;
</prescript>
</report>

File diff suppressed because it is too large Load Diff

View File

@ -1,44 +1,45 @@
#ifndef __CA3200_H
#define __CA3200_H
//pag. stampa mastrini
#define F_CODDITTA 201
#define F_RAGSOC 202
#define F_DATASTAMPA 203
#define F_ANNO 204
#define F_REPORT 205
//campi generati dal pdc
#define F_CDC1_INI 206
#define F_CDC4_INI 209
#define F_CDC1_FIN 216
#define F_CDC4_FIN 219
#define F_DES1_INI 226
#define F_DES4_INI 229
#define F_DES1_FIN 236
#define F_DES4_FIN 239
//campi sulla maschera
#define F_DATAINI 250
#define F_DATAFIN 251
#define F_TIPOCONTI 252
#define F_TIPIMOV 253
//sheet di pagina 2
#define F_RIGHE 260
#define S_CDC1 101
#define S_CDC2 102
#define S_CDC3 103
#define S_CDC4 104
#define S_CDC5 105
#define S_CDC6 106
#define S_CDC7 107
#define S_CDC8 108
#define S_CDC9 109
#define S_CDC10 110
#define S_CDC11 111
#define S_CDC12 112
#endif // __CA3200_H
#ifndef __CA3200_H
#define __CA3200_H
//pag. stampa mastrini
#define F_CODDITTA 201
#define F_RAGSOC 202
#define F_DATASTAMPA 203
#define F_ANNO 204
#define F_REPORT 205
//campi generati dal pdc
#define F_CDC1_INI 206
#define F_CDC4_INI 209
#define F_CDC1_FIN 216
#define F_CDC4_FIN 219
#define F_DES1_INI 226
#define F_DES4_INI 229
#define F_DES1_FIN 236
#define F_DES4_FIN 239
//campi sulla maschera
#define F_DATAINI 250
#define F_DATAFIN 251
#define F_TIPOCONTI 252
#define F_TIPIMOV 253
#define F_PERCONTO 254
//sheet di pagina 2
#define F_RIGHE 260
#define S_CDC1 101
#define S_CDC2 102
#define S_CDC3 103
#define S_CDC4 104
#define S_CDC5 105
#define S_CDC6 106
#define S_CDC7 107
#define S_CDC8 108
#define S_CDC9 109
#define S_CDC10 110
#define S_CDC11 111
#define S_CDC12 112
#endif // __CA3200_H

View File

@ -1,263 +1,268 @@
#include "ca3200.h"
#include "camask.h"
TOOLBAR "topbar" 0 0 0 2
#include <aprintbar.h>
ENDPAGE
TOOLBAR "bottombar" 0 -2 0 1
STRING F_REPORT 256 66
BEGIN
PROMPT 1 -2 "Report "
FLAGS "B"
CHECKTYPE REQUIRED
END
STRING DLG_PROFILE 50
BEGIN
PROMPT 1 -1 "Profilo "
PSELECT
END
ENDPAGE
PAGE "Selezioni" 0 0 0 2
GROUPBOX DLG_NULL 78 3
BEGIN
PROMPT 1 0 "@bDitta"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Ditta "
FLAGS "FRD"
USE LF_NDITTE KEY 1
CHECKTYPE REQUIRED
INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale @50" RAGSOC
OUTPUT F_CODDITTA CODDITTA
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 19 1 ""
FLAGS "D"
END
DATE F_DATASTAMPA
BEGIN
PROMPT 2 3 "Data di stampa "
FLAGS "A"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 52 3 "Esercizio "
USE ESC
INPUT CODTAB F_ANNO
DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNO CODTAB
CHECKTYPE NORMAL
CHECKTYPE NORMAL
FLAGS "RZ"
ADD NONE
END
GROUPBOX DLG_NULL 78 6
BEGIN
PROMPT 1 5 "@bOpzioni stampa"
END
TEXT 96
BEGIN
PROMPT 2 6 "Dalla data competenza "
END
TEXT 97
BEGIN
PROMPT 40 6 "Alla data competenza "
END
DATE F_DATAINI
BEGIN
PROMPT 26 6 ""
END
DATE F_DATAFIN
BEGIN
PROMPT 62 6 ""
END
LIST F_TIPOCONTI 24
BEGIN
PROMPT 2 8 "Selezione conti "
ITEM "1|Movimentati nel periodo"
ITEM "2|Con saldo diverso da 0"
ITEM "3|Tutti"
END
LIST F_TIPIMOV 24
BEGIN
PROMPT 2 9 "Selezione movimenti "
ITEM " |Qualsiasi"
ITEM "N|Normale"
ITEM "P|Preventivo e variazione"
END
SPREADSHEET F_RIGHE -1 -1
BEGIN
PROMPT 0 11 ""
ITEM "Cdc1"
ITEM "Cdc2"
ITEM "Cdc3"
ITEM "Cdc4"
ITEM "Cdc5"
ITEM "Cdc6"
ITEM "Cdc7"
ITEM "Cdc8"
ITEM "Cdc9"
ITEM "Cdc10"
ITEM "Cdc11"
ITEM "Cdc12"
END
ENDPAGE
PAGE "Conti" -1 -1 78 20
GROUPBOX DLG_NULL 76 6
BEGIN
PROMPT 1 3 "@bDa:"
END
GROUPBOX DLG_NULL 76 6
BEGIN
PROMPT 1 9 "@bA:"
END
ENDPAGE
ENDMASK
PAGE "Riga" -1 -1 78 19
STRING S_CDC1 20
BEGIN
PROMPT 1 2 "Cdc1"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC2 20
BEGIN
PROMPT 21 2 "Cdc2"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC3 20
BEGIN
PROMPT 41 2 "Cdc3"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC4 20
BEGIN
PROMPT 61 2 "Cdc4"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC5 20
BEGIN
PROMPT 1 3 "Cdc5"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC6 20
BEGIN
PROMPT 21 3 "Cdc6"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC7 20
BEGIN
PROMPT 41 3 "Cdc7"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC8 20
BEGIN
PROMPT 61 3 "Cdc8"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC9 20
BEGIN
PROMPT 1 4 "Cdc9"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC10 20
BEGIN
PROMPT 21 4 "Cdc10"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC11 20
BEGIN
PROMPT 41 4 "Cdc11"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC12 20
BEGIN
PROMPT 61 4 "Cdc12"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK
#include "ca3200.h"
#include "camask.h"
TOOLBAR "topbar" 0 0 0 2
#include <aprintbar.h>
ENDPAGE
TOOLBAR "bottombar" 0 -2 0 1
STRING F_REPORT 256 66
BEGIN
PROMPT 1 -2 "Report "
FLAGS "B"
CHECKTYPE REQUIRED
END
STRING DLG_PROFILE 50
BEGIN
PROMPT 1 -1 "Profilo "
PSELECT
END
ENDPAGE
PAGE "Selezioni" 0 0 0 2
GROUPBOX DLG_NULL 78 3
BEGIN
PROMPT 1 0 "@bDitta"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Ditta "
FLAGS "FRD"
USE LF_NDITTE KEY 1
CHECKTYPE REQUIRED
INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale @50" RAGSOC
OUTPUT F_CODDITTA CODDITTA
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 19 1 ""
FLAGS "D"
END
DATE F_DATASTAMPA
BEGIN
PROMPT 2 3 "Data di stampa "
FLAGS "A"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 52 3 "Esercizio "
USE ESC
INPUT CODTAB F_ANNO
DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNO CODTAB
CHECKTYPE NORMAL
CHECKTYPE NORMAL
FLAGS "RZ"
ADD NONE
END
GROUPBOX DLG_NULL 78 7
BEGIN
PROMPT 1 5 "@bOpzioni stampa"
END
TEXT 96
BEGIN
PROMPT 2 6 "Dalla data competenza "
END
TEXT 97
BEGIN
PROMPT 40 6 "Alla data competenza "
END
DATE F_DATAINI
BEGIN
PROMPT 26 6 ""
END
DATE F_DATAFIN
BEGIN
PROMPT 62 6 ""
END
LIST F_TIPOCONTI 24
BEGIN
PROMPT 2 8 "Selezione conti "
ITEM "1|Movimentati nel periodo"
ITEM "2|Con saldo diverso da 0"
ITEM "3|Tutti"
END
LIST F_TIPIMOV 24
BEGIN
PROMPT 2 9 "Selezione movimenti "
ITEM " |Qualsiasi"
ITEM "N|Normale"
ITEM "P|Preventivo e variazione"
END
BOOLEAN F_PERCONTO
BEGIN
PROMPT 2 10 "Non suddivisi per Commessa/CDC "
END
SPREADSHEET F_RIGHE -1 -1
BEGIN
PROMPT 0 12 ""
ITEM "Cdc1"
ITEM "Cdc2"
ITEM "Cdc3"
ITEM "Cdc4"
ITEM "Cdc5"
ITEM "Cdc6"
ITEM "Cdc7"
ITEM "Cdc8"
ITEM "Cdc9"
ITEM "Cdc10"
ITEM "Cdc11"
ITEM "Cdc12"
END
ENDPAGE
PAGE "Conti" -1 -1 78 20
GROUPBOX DLG_NULL 76 6
BEGIN
PROMPT 1 3 "@bDa:"
END
GROUPBOX DLG_NULL 76 6
BEGIN
PROMPT 1 9 "@bA:"
END
ENDPAGE
ENDMASK
PAGE "Riga" -1 -1 78 19
STRING S_CDC1 20
BEGIN
PROMPT 1 2 "Cdc1"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC2 20
BEGIN
PROMPT 21 2 "Cdc2"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC3 20
BEGIN
PROMPT 41 2 "Cdc3"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC4 20
BEGIN
PROMPT 61 2 "Cdc4"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC5 20
BEGIN
PROMPT 1 3 "Cdc5"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC6 20
BEGIN
PROMPT 21 3 "Cdc6"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC7 20
BEGIN
PROMPT 41 3 "Cdc7"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC8 20
BEGIN
PROMPT 61 3 "Cdc8"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC9 20
BEGIN
PROMPT 1 4 "Cdc9"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC10 20
BEGIN
PROMPT 21 4 "Cdc10"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC11 20
BEGIN
PROMPT 41 4 "Cdc11"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC12 20
BEGIN
PROMPT 61 4 "Cdc12"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

286
src/ca/ca3200b.rep Normal file
View File

@ -0,0 +1,286 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3200b" orientation="2" lpi="8" class="ca3200a">
<description>Mastrini CA per conto</description>
<font face="Courier New" size="8" />
<section type="Head" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" />
</section>
<section type="Head" level="1" pattern="1">
<font face="Arial" size="9" />
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" y="0.5" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="4" pattern="2" text="MASTRINI DI CONTABILITA' ANALITICA">
<font face="Arial" bold="1" size="14" />
</field>
<field x="1" y="5.5" type="Stringa" width="50" pattern="1">
<font face="Arial" bold="1" size="9" />
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="80" y="5.5" type="Data" width="10" pattern="1">
<font face="Arial" bold="1" size="9" />
<source>#SYSTEM.DATE</source>
</field>
<field x="1" y="7" type="Testo" width="18" pattern="1" text="Centro di Costo:" />
<field x="20" y="7" type="Stringa" width="23" pattern="1">
<font face="Arial" bold="1" size="9" />
<source>#COSTO</source>
<prescript description="H1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript>
</field>
<field x="44" y="7" type="Stringa" width="50" pattern="1">
<font face="Arial" bold="1" size="9" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,CDC,CODCOSTO=RMOVANA.CODCCOSTO,DESCRIZ</prescript>
</field>
<field x="1" y="8.5" type="Testo" width="9" pattern="1" text="Commessa:" />
<field x="20" y="8.5" type="Stringa" width="23" pattern="1">
<font face="Arial" bold="1" size="9" />
<source>#COMMESSA</source>
<prescript description="H1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript>
</field>
<field x="44" y="8.5" type="Stringa" width="50" pattern="1">
<font face="Arial" bold="1" size="9" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=RMOVANA.CODCMS,DESCRIZ</prescript>
</field>
<field x="1" y="10" type="Testo" width="5" pattern="1" text="Fase:" />
<field x="20" y="10" type="Stringa" width="13" pattern="1">
<font face="Arial" bold="1" size="9" />
<source>#FASE</source>
<prescript description="H1.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field>
<field x="44" y="10" type="Stringa" width="50" pattern="1">
<font face="Arial" bold="1" size="9" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,FASI,CODFASE=RMOVANA.CODFASE,DESCRIZ</prescript>
</field>
<field border="2" x="1" y="11.5" type="Linea" width="167" height="0" pattern="1" />
</section>
<section repeat="1" type="Head" level="2" height="5" pattern="1">
<groupby>CODCONTO</groupby>
<font italic="1" face="Arial" size="8" />
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2.101
MESSAGE RESET,F2.102
MESSAGE RESET,F2.201
MESSAGE RESET,F2.202
</prescript>
<field y="0.5" type="Testo" width="6" pattern="1" text="Conto:">
<font italic="1" face="Arial" bold="1" size="8" />
</field>
<field x="7" y="0.5" type="Stringa" width="23" pattern="1">
<font italic="1" face="Arial" bold="1" size="8" />
<source>CODCONTO</source>
<prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="31" y="0.5" type="Stringa" width="50" pattern="1">
<font italic="1" face="Arial" bold="1" size="8" />
<source>CODCONTO</source>
<prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field>
<field x="10" y="2" type="Testo" align="center" width="10" pattern="1" text="N.Reg. &#2F; Riga" />
<field x="22" y="2" type="Testo" width="11" pattern="1" text="Descrizione" />
<field x="41" y="2" type="Testo" width="8" pattern="1" text="N.Reg.CG" />
<field x="50" y="2" type="Testo" align="center" width="10" pattern="1" text="Data Doc." />
<field x="61" y="2" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="68" y="2" type="Testo" width="7" pattern="1" text="Causale" />
<field x="102" y="2" type="Testo" align="right" width="4" pattern="1" text="Dare" />
<field x="115" y="2" type="Testo" align="right" width="5" pattern="1" text="Avere" />
<field x="120" y="2" type="Testo" align="right" width="14" pattern="1" text="Saldo" />
<field x="137" y="2" type="Testo" width="30" pattern="1" text="Tipo&#2F;Codice&#2F;Ragsoc. Cli.&#2F;Forn." />
<field border="1" x="1" y="3" type="Linea" width="168" height="0" pattern="1" />
<field x="66" y="3.5" type="Testo" width="25" pattern="1" text="Progressivo precedente" />
<field x="1" y="2" type="Testo" align="center" width="10" id="121" pattern="1" text="Data" />
<field x="91" y="3.5" type="Valuta" align="right" width="13" id="201" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>SALDOINI:DARE</source>
<postscript description="H2.201 POSTSCRIPT">MESSAGE COPY,B1.103
</postscript>
</field>
<field x="107" y="3.5" type="Valuta" align="right" width="13" id="202" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>SALDOINI:AVERE</source>
<prescript description="H2.202 PRESCRIPT">#THIS @
DUP
0 &#3E; IF
-1 *
"B1.103" +!
ELSE
DROP
THEN</prescript>
</field>
</section>
<section type="Head" level="3" pattern="1">
<groupby>DATACOMP</groupby>
<prescript description="H3 PRESCRIPT">MESSAGE RESET,F3.103</prescript>
</section>
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<condition>NUMREG != 0</condition>
<font face="Arial" size="8" />
<field x="1" type="Data" width="10" pattern="1">
<source>DATACOMP</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE COPY,F3.131</postscript>
</field>
<field x="11.5" type="Numero" align="right" link="107.NUMREG" width="6" pattern="1">
<source>NUMREG</source>
</field>
<field x="17.5" type="Testo" align="center" width="1" pattern="1" text="&#2F;" />
<field x="18.5" type="Numero" align="right" width="3" pattern="1">
<source>NUMRIG</source>
</field>
<field x="22" type="Stringa" dynamic_height="1" width="20" height="2" pattern="1">
<font face="Arial Narrow" size="8" />
<source>DESCR</source>
</field>
<field x="43" type="Numero" align="right" link="23.NUMREG" width="6" pattern="1">
<source>MOVANA.NUMREGCG</source>
</field>
<field x="50" type="Data" width="10" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="61" type="Stringa" align="right" width="6" pattern="1">
<source>MOVANA.NUMDOC</source>
</field>
<field x="68" type="Stringa" width="3" pattern="1">
<source>MOVANA.CODCAUS</source>
</field>
<field x="72" type="Stringa" dynamic_height="1" width="20" height="2" pattern="1">
<font face="Arial Narrow" size="8" />
<prescript description="B1.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript>
</field>
<field x="93" type="Valuta" align="right" width="13" id="101" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @
"A" =
IF
0 #THIS !
ELSE
#THIS @
"B1.103"
+!
THEN
</prescript>
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F2.101
</postscript>
</field>
<field x="107" type="Valuta" align="right" width="13" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPORTO</source>
<prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @
"D" =
IF
0 #THIS !
ELSE
#THIS @
-1 *
"B1.103"
+!
THEN
</prescript>
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F2.102
</postscript>
</field>
<field x="121" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="B1.103 POSTSCRIPT">MESSAGE COPY,F3.103</postscript>
</field>
<field x="136.5" type="Stringa" width="1" id="104" pattern="1">
<source>MOV.TIPO</source>
</field>
<field x="137.5" type="Numero" align="right" width="6" id="105" pattern="1" hide_zero="1">
<source>MOV.CODCF</source>
</field>
<field x="144" type="Stringa" dynamic_height="1" width="20" height="2" id="106" pattern="1">
<font face="Arial Narrow" size="8" />
<prescript description="B1.106 PRESCRIPT">MESSAGE ISAMREAD,CLIFO,TIPOCF=#104!CODCF=#105,RAGSOC</prescript>
</field>
</section>
<section type="Foot" pattern="1">
<font face="Arial" size="8" />
<field border="2" x="1" y="0.5" type="Linea" width="167" height="0" pattern="1" />
<field x="143" y="1" type="Testo" width="5" pattern="1" text="Pag." />
<field x="149" y="1" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
</section>
<section type="Foot" level="1" pattern="1">
<field border="1" x="1" y="0.5" type="Linea" width="168" height="0" pattern="1" />
<field x="74" y="1" type="Testo" width="20" pattern="1" text="TOTALI COMMESSA">
<font face="Arial" bold="1" size="9" />
</field>
<field x="92" y="1" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="9" />
</field>
<field x="106" y="1" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="9" />
</field>
<field x="120" y="1" type="Valuta" align="right" width="14" id="103" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="9" />
<source>#101-#102</source>
</field>
</section>
<section type="Foot" level="2" height="3.5" pattern="1">
<field border="1" x="1" y="0.25" type="Linea" width="168" height="0" pattern="1" />
<field x="72" y="0.5" type="Testo" width="22" pattern="1" text="Totali periodo:">
<font face="Arial" bold="1" size="8" />
</field>
<field x="72" y="1.75" type="Testo" width="22" pattern="1" text="Totali progressivi:">
<font face="Arial" bold="1" size="8" />
</field>
<field x="93" y="0.5" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="8" />
<postscript description="F2.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
</field>
<field x="107" y="0.5" type="Valuta" align="right" width="13" id="102" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="8" />
<postscript description="F2.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
</field>
<field x="93" y="1.75" type="Valuta" align="right" width="13" id="201" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="8" />
<source>#101+#H2.201</source>
</field>
<field x="107" y="1.75" type="Valuta" align="right" width="13" id="202" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="8" />
<source>#102+#H2.202</source>
</field>
<field x="121" y="1.75" type="Valuta" align="right" width="13" id="203" pattern="1" text="###.###.###,@@">
<font face="Arial" bold="1" size="8" />
<source>#201-#202</source>
</field>
</section>
<section type="Foot" level="3" pattern="1">
<condition>#103 != 0</condition>
<font italic="1" face="Arial" size="8" />
<field x="135" y="0.5" type="Testo" width="2" pattern="1" text="al">
<font italic="1" face="Arial Black" size="7" />
</field>
<field x="119" y="0.5" type="Valuta" align="right" width="15" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<font italic="1" face="Arial" bold="1" size="8" />
</field>
<field x="137" y="0.5" type="Data" valign="center" width="11" id="131" pattern="1">
<font italic="1" face="Arial" size="7" />
</field>
</section>
<sql>USE RMOVANA KEY 2
JOIN MOVANA INTO NUMREG==NUMREG
JOIN MOV TO MOVANA INTO NUMREG==NUMREGCG</sql>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )
VARIABLE _X1 \ coordinate del campo F1
VARIABLE _Y1
VARIABLE _X2 \ coordinate del campo F2
VARIABLE _Y2
2DUP \ duplica i campi F1 F2 sullo stack
GET_POS \ prende le coordinate del campo F2
_Y2 ! \ e le mette in _Y2 e _X2
_X2 !
GET_POS \ prende le coordinate del campo F1
_Y1 ! \ e le mette in _Y1 e _X1
_X1 !
_X1 @ \ legge le coordinate di F1
_Y1 @
ROT
SET_POS \ mette le coord in F2
_X2 @
_Y2 @
ROT
SET_POS
;
</prescript>
</report>

View File

@ -6,9 +6,11 @@
#include "cdc.h"
#include "commesse.h"
#include "fasi.h"
#include "movana.h"
#include "pconana.h"
#include "rmovana.h"
#include "pconana.h"
#include "saldana.h"
#include "../cg/cglib01.h"
#include "ca3.h"
@ -30,6 +32,7 @@ protected:
public:
TPrint_bilancio_ca_mask();
virtual ~TPrint_bilancio_ca_mask() {}
};
const TString& TPrint_bilancio_ca_mask::get_report_class() const
@ -411,6 +414,7 @@ class TRecordset_sezioni_contrapposte : public TRecordset
{
char _tipo_piano;
TAnal_bill _filter;
TArray _cdc_cms_fas;
TDate _da_data, _a_data;
word _tipimov;
bool _movimentati, _nonnulli;
@ -539,26 +543,176 @@ void TRecordset_sezioni_contrapposte::add_conto(int indbil, const TString& b)
TAnal_bill bill(_filter);
bill.set_conto(b);
if ((_tipimov & _saldanal_qualsiasi) == _saldanal_qualsiasi) // Bilancio a sezioni contrapposte di raffronto
TString query;
TString select;
query = "USE "; query << LF_SALDANA << " KEY 2\n";
if (_filter.costo().full() || _filter.commessa().full() || _filter.fase().full())
{
const TSaldanal& sp = ca_saldo(bill, _da_data, _a_data, _saldanal_preventivi);
const TSaldanal& sc = ca_saldo(bill, _da_data, _a_data, _saldanal_consuntivo);
if (!sp._fin.is_zero() || !sc._fin.is_zero())
TString select;
if (_filter.costo().full())
{
TArray& a = conti(indbil);
TImporto s = sp._fin; s -= sc._fin; s.normalize();
add_conto(b, s, sp._fin, sc._fin, a);
int len = _filter.costo().len();
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_CDC);
const int max = mci.levels();
for (int i = 0; i < max; i++)
if (len <= mci.total_len(i))
{
len = mci.total_len(i);
break;
}
select << "(TRIM(" << SALDANA_COSTO << "[1," << len << "])==\"" << _filter.costo() << "\") ";
}
if (_filter.commessa().full())
{
int len = _filter.commessa().len();
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_COMMESSE);
const int max = mci.levels();
for (int i = 0; i < max; i++)
if (len <= mci.total_len(i))
{
len = mci.total_len(i);
break;
}
select << (select.full() ? "&&" : "") << "(TRIM(" << SALDANA_COMMESSA << "[1," << len << "])==\"" << _filter.commessa() << "\") ";
}
if (_filter.fase().full())
{
int len = _filter.fase().len();
int start = 0;
int offset = 0;
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_FASI);
const int max = mci.levels();
if (mci.parent() != 0)
{
const TMultilevel_code_info& parinfo = ca_multilevel_code_info(mci.parent());
start = parinfo.levels();
offset = parinfo.total_len(parinfo.levels() -1);
}
for (int i = start; i < max; i++)
{
if (len <= mci.total_len(i) - offset)
{
len = mci.total_len(i) - offset;
break;
}
}
select << (select.full() ? "&&" : "") << "(TRIM(" << SALDANA_FASE << "[1," << len << "])==\"" << _filter.fase() << "\") ";
}
if (select.full())
query << "SELECT " << select;
query << "\nFROM " << SALDANA_CONTO << "='" << b << "' ";
if (_da_data.ok())
query << SALDANA_ANNO << "='" << _da_data.year() << "'";
query << "\nTO " << SALDANA_CONTO << "='" << b << "' ";
if (_a_data.ok())
query << SALDANA_ANNO << "='" << _a_data.year() << "'";
query << "\n";
TISAM_recordset sal(query);
TAssoc_array codes;
TToken_string code;
for (bool ok = sal.move_first(); ok; ok =sal.move_next())
{
code.cut(0);
code.add(sal.get(SALDANA_COSTO).as_string());
code.add(sal.get(SALDANA_COMMESSA).as_string());
code.add(sal.get(SALDANA_FASE).as_string());
if (codes.objptr(code) == NULL)
codes.add(code, code);
}
if ((_tipimov & _saldanal_qualsiasi) == _saldanal_qualsiasi) // Bilancio a sezioni contrapposte di raffronto
{
TSaldanal sp;
TSaldanal sc;
FOR_EACH_ASSOC_OBJECT(codes, obj, key, item)
{
TToken_string code(key);
TString c(code.get());
bill.set_costo(c.blank() ? "~" : c);
c = code.get();
bill.set_commessa(c.blank() ? "~" : c);
c = code.get();
bill.set_fase(c.blank() ? "~" : c);
const TSaldanal& wsp = ca_saldo(bill, _da_data, _a_data, _saldanal_preventivi);
const TSaldanal& wsc = ca_saldo(bill, _da_data, _a_data, _saldanal_consuntivo);
sp += wsp;
sc += wsc;
}
if (!sp._fin.is_zero() || !sc._fin.is_zero())
{
TArray& a = conti(indbil);
TImporto s = sp._fin; s -= sc._fin; s.normalize();
add_conto(b, s, sp._fin, sc._fin, a);
}
}
else
{
TSaldanal sa;
FOR_EACH_ASSOC_OBJECT(codes, obj, key, item)
{
TToken_string code(key);
TString c(code.get());
bill.set_costo(c.blank() ? "~" : c);
c = code.get();
bill.set_commessa(c.blank() ? "~" : c);
c = code.get();
bill.set_fase(c.blank() ? "~" : c);
const TSaldanal& wsa = ca_saldo(bill, _da_data, _a_data, _tipimov);
sa += wsa;
}
if (!sa._fin.is_zero())
{
const TImporto zero;
TArray& a = conti(indbil);
add_conto(b, sa._fin, zero, zero, a);
}
}
}
else
{
const TSaldanal& sa = ca_saldo(bill, _da_data, _a_data, _tipimov);
if (!sa._fin.is_zero())
if ((_tipimov & _saldanal_qualsiasi) == _saldanal_qualsiasi) // Bilancio a sezioni contrapposte di raffronto
{
const TImporto zero;
TArray& a = conti(indbil);
add_conto(b, sa._fin, zero, zero, a);
}
const TSaldanal sp = ca_saldo(bill, _da_data, _a_data, _saldanal_preventivi);
const TSaldanal sc = ca_saldo(bill, _da_data, _a_data, _saldanal_consuntivo);
if (!sp._fin.is_zero() || !sc._fin.is_zero())
{
TArray& a = conti(indbil);
TImporto s = sp._fin; s -= sc._fin; s.normalize();
add_conto(b, s, sp._fin, sc._fin, a);
}
}
else
{
const TSaldanal sa = ca_saldo(bill, _da_data, _a_data, _tipimov);
if (!sa._fin.is_zero())
{
const TImporto zero;
TArray& a = conti(indbil);
add_conto(b, sa._fin, zero, zero, a);
}
}
}
}
}
@ -968,7 +1122,7 @@ class TPrint_bilancio_ca : public TSkeleton_application
TPrint_bilancio_ca_mask* _mask;
protected:
virtual const char * extra_modules() const { return "cm"; } // funziona anche con autorizzazione CM
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
bool commessa_buona(const TRectype& cms, const TDate& dadata, const TDate& adata) const;
bool buon_cdc(const TRectype& cdc, const TDate& dadata, const TDate& adata) const;
@ -1055,9 +1209,12 @@ bool TPrint_bilancio_ca::commessa_buona(const TRectype& cms, const TDate& dadata
TString query;
query = "USE RMOVANA KEY 4\nBY CODCMS DATACOMP\n";
query << "FROM CODCMS=#CMS\nTO CODCMS=#CMS";
query << "FROM CODCMS=#CMS\nTO CODCMS=#CMS1";
TISAM_recordset rmovana(query);
rmovana.set_var("#CMS", cms.get(COMMESSE_CODCMS));
TString codcms(cms.get(COMMESSE_CODCMS));
rmovana.set_var("#CMS", codcms);
codcms << "ZZZ";
rmovana.set_var("#CMS1", codcms);
if (!rmovana.move_first())
return false; // Ignora commesse non movimentate

View File

@ -21,7 +21,7 @@ END
ENDPAGE
PAGE "Stampa bilancio" 0 2 0 0
PAGE "Stampa bilancio" 0 0 0 2
GROUPBOX DLG_NULL 78 3
BEGIN

View File

@ -4,11 +4,15 @@
#include <progind.h>
#include <reprint.h>
#include <reputils.h>
#include <textset.h>
#include <utility.h>
#include <doc.h>
#include <rdoc.h>
#include <partite.h>
#include "../cg/cg2103.h"
#include "../cg/cglib01.h"
#include "../ve/velib04.h"
#include "..\cg\cgsaldac.h"
#include "cdc.h"
#include "commesse.h"
@ -23,6 +27,26 @@
#include "calib01.h"
#include "calib02.h"
#define REND_CODCMS "CODCMS"
#define REND_CODCOSTO "CODCOSTO"
#define REND_CODFASE "CODFASE"
#define REND_CODCONTO "CODCONTO"
#define REND_IMPEGNATO "IMPEGNATO"
#define REND_FATTURATO "FATTURATO"
#define REND_MATURATO "MATURATO"
#define REND_PAGATO "PAGATO"
#define REND_ORDCONT "ORDCONT"
#define REND_CONTO "CONTO"
#define RIEP_CODCMS "CODCMS"
#define RIEP_CODCOSTO "CODCOSTO"
#define RIEP_CODFASE "CODFASE"
#define RIEP_CODCONTO "CODCONTO"
#define RIEP_DATA "DATA"
#define RIEP_ORDCONT "ORDCONT"
#define RIEP_DESCONTO "DESCONTO"
#define RIEP_BUDGET "BUDGET"
////////////////////////////////////////////////////////
// MASCHERA
////////////////////////////////////////////////////////
@ -333,6 +357,7 @@ class TPrint_rendiconto_ca_recordset : public TISAM_recordset
TString_array _num_fdr;
TString_array _num_par;
TRiclass _ricl;
TDate _pagato_al;
protected:
int _anno;
@ -354,11 +379,14 @@ protected:
void crea_righe_da_rdoc(TLocalisamfile& tmp, const TPrint_rendiconto_ca_mask& msk, TLog_report& log);
void crea_trr(const TFilename& trr) const;
void calc_pagato(TRectype& tmprec, const TRectype& rmovana, const TRectype& movana, const TDocumento * doc, bool fatturato, int indbil);
void scrive_riga(TLocalisamfile& tmp, const TRectype& rmovana, const TRectype& movana, const TDocumento* doc,
TLog_report& log);
void scrive_riga_speciale(TLocalisamfile& tmp, const TDocumento* doc, const TString_array& special_docs);
int sort_indbil(int indbil) const;
bool test_swap(TCausale& caus, bool ritsoc) const;
real totale_documento(const TRectype& mov) const;
const TString& riclassifica(const TBill& zio, TRectype& tmpcurr) const;
const TString& riclassifica(const TString& contone, TRectype& tmpcurr) const;
bool is_causale_rateo_risconto(const char* codcaus) const;
@ -373,7 +401,8 @@ public:
real get_budget_print(const TString& conto, char tipo) const; //per la stampa
void get_budget_export(const TString& codcdc, const TString& codcms, const TString& codfase,
TImporto& att, TImporto& pas, TImporto& cos, TImporto& ric) const; //per l'esportazione
real get_budget_batch(const TString& codcdc, const TString& codcms, const TString& codfase,
const TString& conto, char tipo) const; // per l'elaborazione batch
TPrint_rendiconto_ca_recordset(const TString& sql);
~TPrint_rendiconto_ca_recordset();
@ -516,6 +545,44 @@ void TPrint_rendiconto_ca_recordset::get_budget_export(const TString& codcdc, co
ric.normalize('A');
}
real TPrint_rendiconto_ca_recordset::get_budget_batch(const TString& codcdc, const TString& codcms, const TString& codfase,
const TString& conto, char tipo) const
{
//data del cazzo che però serve per costruire il conto analitico
const TDate null_date;
//ecco il conto analitico...
TAnal_bill zio(conto, codcdc, codcms, codfase);
//..adesso si necessita del saldo del conto analitico appena creato..
word tipo_movimento = 0;
switch (tipo)
{
case 'P': tipo_movimento |= _saldanal_preventivo; break;
case 'V': tipo_movimento |= _saldanal_variazione; break;
default: tipo_movimento |= _saldanal_consuntivo; break;
}
if (_riclassificato)
tipo_movimento |= _saldanal_riclassify;
//..ecco quindi il saldo..
const TSaldanal& saldo = ca_saldo(zio, null_date, null_date, tipo_movimento);
//..che deve essere normalizzato in base alla sua sezione ed all'indicatore di bilancio del conto
TImporto imp = saldo._fin;
switch (zio.indicatore_bilancio())
{
case 1:
case 3:
imp.normalize('D');
break;
case 2:
case 4:
imp.normalize('A');
break;
default:
break;
}
return imp.valore();
}
//sconvolgente metodo per la normalizzazione dei conti
real TPrint_rendiconto_ca_recordset::get_budget_print(const TString& conto, char tipo) const
{
@ -692,6 +759,35 @@ const TString& TPrint_rendiconto_ca_recordset::riclassifica(const TBill& zio, TR
return get_tmp_string() = conto_riclassificato;
}
bool TPrint_rendiconto_ca_recordset::test_swap(TCausale& caus, bool ritsoc) const
{
const char sez = ritsoc ? caus.sezione_ritsoc() : caus.sezione_clifo();
const bool s = (caus.iva() == iva_vendite) ^ (sez == 'D');
return s;
}
real TPrint_rendiconto_ca_recordset::totale_documento(const TRectype& mov) const
{
real tot = mov.get_real(MOV_TOTDOC); // Legge totale
const real ritfis = mov.get_real(MOV_RITFIS);
tot += ritfis; // Somma ritenute fiscali
const real ritsoc = mov.get_real(MOV_RITSOC);
if (!ritsoc.is_zero())
{
TCausale caus(mov.get(MOV_CODCAUS));
const bool swapt = test_swap(caus, false); // Totale invertito ?
const bool swaps = test_swap(caus, true); // Ritenute sociali invertite ?
if (swapt ^ swaps) // Somma ritenute sociali con segno
tot -= ritsoc;
else
tot += ritsoc;
}
return tot;
}
const TString& TPrint_rendiconto_ca_recordset::riclassifica(const TString& contone, TRectype& tmpcurr) const
{
CHECK(contone.len() == 12, "Conto di lunghezza assurda");
@ -756,6 +852,141 @@ int TPrint_rendiconto_ca_recordset::ricava_tipo_documento (const TDocumento& doc
return tipo_documento;
}
void TPrint_rendiconto_ca_recordset::calc_pagato(TRectype& tmprec, const TRectype& rmovana, const TRectype& movana, const TDocumento * doc, bool fatturato, int indbil)
{
const long nregcg = movana.get_long(MOVANA_NUMREGCG);
real pagato;
char sezione_normale = ' ';
if (nregcg > 0L)
{
TToken_string cms_cdc_fsc_to_calc;
cms_cdc_fsc_to_calc.add(rmovana.get(RMOVANA_CODCMS));
cms_cdc_fsc_to_calc.add(rmovana.get(RMOVANA_CODCCOSTO));
cms_cdc_fsc_to_calc.add(rmovana.get(RMOVANA_CODFASE));
cms_cdc_fsc_to_calc.add(rmovana.get(RMOVANA_CODCONTO));
const TAnal_mov anal_mov(movana);
const TRectype & head = cache().get(LF_MOV, nregcg);
const TCausale & caus = cached_causale(head.get(MOV_CODCAUS), head.get_date(MOV_DATACOMP).year());
const TipoIVA tipoiva = caus.iva(); //tipo iva legato alla causale (codcaus e' letto ad inizio procedura)
TRecord_array& anal_rows = anal_mov.body();
real totdoc_cms;
real totdoc, totdoc_netto;
TPartite_array arr;
arr.add_numreg(nregcg);
if (arr.items() > 0)
{
TAssoc_array commesse;
const TRectype& movfat = cache().get(LF_MOV, nregcg);
if (tipoiva == iva_vendite)
sezione_normale = 'A';
else
if (tipoiva == iva_acquisti)
sezione_normale = 'D';
else
if (caus.tipomov() > 0 && caus.tipomov() < 3) //solo causali Fattura e Nota di Credito!
{
if (caus.sezione_clifo() == 'D')
sezione_normale = 'A';
else
sezione_normale = 'D';
}
if (sezione_normale > ' ')
{
totdoc = totale_documento(movfat); //tot doc con ritenute fiscali + ritenute sociali (da stampare)
//Movimenti CON SALDACONTO
//se movimento IVA..
//trova le RMOVANA del MOVANA corrente che hanno il conto = a quello della i-esima rigaiva
for (int k = 1; k <= anal_rows.rows(); k++) //scansiona righe analitiche..
{
TToken_string cms_cdc_fsc;
TImporto importo(anal_rows[k].get_char(RMOVANA_SEZIONE), anal_rows[k].get_real(RMOVANA_IMPORTO));
importo.normalize(sezione_normale);
cms_cdc_fsc.add(anal_rows[k].get(RMOVANA_CODCMS));
cms_cdc_fsc.add(anal_rows[k].get(RMOVANA_CODCCOSTO));
cms_cdc_fsc.add(anal_rows[k].get(RMOVANA_CODFASE));
cms_cdc_fsc.add(anal_rows[k].get(RMOVANA_CODCONTO));
real* imp = (real*)commesse.objptr(cms_cdc_fsc);
//aggiunge un elemento all'assoc_array...
if (imp == NULL)
commesse.add(cms_cdc_fsc, imp = new real);
*imp += importo.valore();
totdoc_cms += importo.valore();
}
totdoc_netto = movfat.get_real(MOV_TOTDOC); //questo si usa solo per il calcolo del residuo
//parte comune a movimenti IVA e non (vengono anche qui considerate le ritenute fiscali
//e sociali perche' possono essere state inserite direttamente nella partita e non nel movimento
//(quindi non si puo' in questo caso applicare la totale_documento()
//Le ritenute fiscali vanno sempre sommate..
TRiga_partite * riga_fatt = arr.mov2rig(nregcg, 1);
if (riga_fatt != NULL)
{
TImporto tot = riga_fatt->calcola_pagato_al(false, _pagato_al, _pagato_al, _pagato_al, 0x15);
tot.normalize(sezione_normale);
const real totpagato = tot.valore();
const real percentuale = totpagato / totdoc;
//calcolo del residuo (solo movimenti saldacontati)
//mi servono,dalla riga partita che viene passata,i valori dei campi per la chiave del
//file delle scadenze
TGeneric_distrib distributore(totdoc_cms * percentuale, TCurrency::get_firm_dec());
{
FOR_EACH_ASSOC_OBJECT(commesse, h, k, imp)
{
const real& impcms = *(real*)imp;
distributore.add(impcms);
}
}
FOR_EACH_ASSOC_OBJECT(commesse, h, k, imp)
{
const real& impcms = *(real*)imp;
const real imppag = distributore.get();
if (cms_cdc_fsc_to_calc == k)
pagato += imppag;
} //FOR_EACH_...
}
}
else
if (fatturato)
{
TImporto importo(rmovana.get_char(RMOVANA_SEZIONE), rmovana.get_real(RMOVANA_IMPORTO));
const TString c = rmovana.get(RMOVANA_CODCONTO);
TBill conto(atoi(c.left(3)), atoi(c.mid(3,3)), atol(c.right(6)));
const int indbil = conto.indicatore_bilancio();
sezione_normale = indbil == 1 || indbil == 3 ? 'D' : 'A';
importo.normalize(sezione_normale);
pagato = importo.valore();
}
TImporto p(sezione_normale, pagato);
if (indbil == 1 || indbil == 3) //attivita' e costi sono in DARE
sezione_normale = 'D';
else //passivita' e ricavi sono in AVERE
sezione_normale = 'A';
p.normalize(sezione_normale);
pagato = p.valore();
}
}
tmprec.put(REND_PAGATO, pagato);
}
//compila i campi del file temporaneo che sara' poi stampato
void TPrint_rendiconto_ca_recordset::scrive_riga(TLocalisamfile& tmp, const TRectype& rmovana, const TRectype& movana,
const TDocumento* doc, TLog_report& log)
@ -822,13 +1053,7 @@ void TPrint_rendiconto_ca_recordset::scrive_riga(TLocalisamfile& tmp, const TRec
//---- DOC D'ORIGINE DELL' ANALMOV ----//
//tipo movimento CONSUNTIVO (o TEMPORANEO); per i movimenti di budget (P o V) vedi l'else
const char tipomov = movana.get_char(MOVANA_TIPOMOV);
#ifdef DBG
const long movana_numreg = movana.get_long(MOVANA_NUMREG);
if (movana_numreg == 19571)
const int cazzone = 1;
#endif
//serve un documento da cui ricavare i parametri di stampa
//serve un documento da cui ricavare i parametri di stampa
TDocumento* original_doc = (TDocumento*)doc;
bool should_delete = false;
if (original_doc == NULL && movana.get_long(MOVANA_DNDOC) > 0)
@ -1092,11 +1317,11 @@ F=IMF*/
//riempie i record del file temporaneo nel caso di rmovana con documento di origine
if (selettore & FATTURATO)
tmpcurr.put("FATTURATO", imp.valore());
tmpcurr.put(REND_FATTURATO, imp.valore());
if (selettore & MATURATO)
tmpcurr.put("MATURATO", imp.valore());
tmpcurr.put(REND_MATURATO, imp.valore());
if (selettore & IMPEGNATO)
tmpcurr.put("IMPEGNATO", imp.valore());
tmpcurr.put(REND_IMPEGNATO, imp.valore());
//campi comuni a rmovana e rdoc senza particolari operazioni
TString descr = movana.get(MOVANA_DESCR);
@ -1106,6 +1331,9 @@ F=IMF*/
descr.ltrim(pos+1);
descr.trim();
}
// calcolo pagato
calc_pagato(tmpcurr, rmovana, movana, original_doc, (selettore & FATTURATO) > 0, indbil);
//----Scrittura Conti sul file----//
//Scrittura dei conti (i valori delle variabili sono stati settati nella parte iniziale del metodo)
@ -1308,12 +1536,12 @@ void TPrint_rendiconto_ca_recordset::scrive_riga_speciale(TLocalisamfile& tmp, c
imp.normalize(sezione_normale);
//i documenti speciali vanno SOLO in FATTURATO
tmpcurr.put("FATTURATO", imp.valore());
tmpcurr.put(REND_FATTURATO, imp.valore());
}
else //if(codcaus.full()
{
//i documenti speciali vanno SOLO in FATTURATO
tmpcurr.put("FATTURATO", importo);
tmpcurr.put(REND_FATTURATO, importo);
}
tmp.write();
@ -1681,7 +1909,7 @@ void TPrint_rendiconto_ca_recordset::crea_trr(const TFilename& trr) const
{
ofstream of(trr);
of << 1000 << endl;
of << 22 << endl;
of << 23 << endl;
of << "ORDCONT|1|1|0|Ordinatore in base a indicatore di bilancio" << endl;
of << "CONTO|1|20|0|Conto analitico" << endl;
of << "DATA|5|8|0|Data movimento o documento" << endl;
@ -1702,6 +1930,7 @@ void TPrint_rendiconto_ca_recordset::crea_trr(const TFilename& trr) const
of << "FATTURATO|4|18|5|Fatturato" << endl;
of << "MATURATO|4|18|5|Maturato" << endl;
of << "IMPEGNATO|4|18|5|Impegnato" << endl;
of << "PAGATO|4|18|5|Pagato" << endl;
of << "CONTOCG|1|12|0|Conto contabile" << endl;
of << "HIDDEN|8|1|0|Record nascosto" << endl;
of << 3 << endl;
@ -1784,9 +2013,16 @@ void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask&
_implode_rows = msk.get_bool(F_IMPLODE_ROWS);
//c'e' un fottuto range di date? oppure si va a vita intera?
TDate dal, al;
_dadata = msk.get_date(F_DATAINI);
_adata = msk.get_date(F_DATAFIN);
_adata = _pagato_al = msk.get_date(F_DATAFIN);
_vitaintera = msk.get_bool(F_VITAINTERA);
calcola_date_da_maschera(msk, dal, al);
if (!_pagato_al.ok())
_pagato_al = al;
if (!_pagato_al.ok())
_pagato_al = eotime;
//metodi per riempire il file da cui generare il report
//dati estratti dalle righe movimenti di contabilita' analitica
@ -1846,8 +2082,10 @@ protected:
virtual void print();
void esporta_csv_row(ostream& file_to_date, const int first_level, const TString& cod_cms_cdc,
const real importi[5][4], real importi_totali[5][4]);
void esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const int r);
void esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const int r, TReport_book book, bool reset);
void incrementa(TToken_string& riga, const int col, const real& valore) const;
void crea_trr(const TFilename& trr) const;
void export_rendiconto();
public:
const TMultilevel_code_info& get_first_level() const;
@ -1937,7 +2175,7 @@ void TPrint_rendiconto_ca::esporta_csv_row(ostream& file_to_date, const int firs
}
//metodo di alto livello per l'esportazione dei dati di totale in un file per excel
void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const int r)
void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const int r, TReport_book book, bool reset)
{
//primo livello di configurazione
const int first_level = get_first_level().logic();
@ -1950,6 +2188,10 @@ void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, co
path.lower();
path.add("rendiconto.xls");
ofstream file_to_date(path, ios::app);
TFilename paths = _msk->get(F_PATH);
paths.lower();
paths.add("rend.xls");
ofstream file_to_print(paths, reset ? ios::trunc : ios::app);
const bool invert_cosric = _msk->get_bool(F_REV_COSRIC);
@ -1985,7 +2227,10 @@ void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, co
//lo schema è questo: budget\impegnato\maturato\fatturato\da impegnare\da maturare\da fatturare
//controlla se last_codice sia pieno per non aggiungere una inutile riga di zeri all'inizio
if (last_codice.full())
{
esporta_csv_row(file_to_date, first_level, last_codice, importi, importi_totali);
esporta_csv_row(file_to_print, first_level, last_codice, importi, importi_totali);
}
memset(importi, 0, sizeof(importi)); //Allah! Azzeratore dell'array con i totali per commessa (o cdc)
last_codice = curr_codice; //memorizza il cambio codice (cms/cdc)
@ -2010,9 +2255,9 @@ void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, co
const bool hidden = rendy.get("HIDDEN").as_bool();
if (!hidden)
{
const real impegnato = rendy.get("IMPEGNATO").as_real();
const real fatturato = rendy.get("FATTURATO").as_real();
const real maturato = rendy.get("MATURATO").as_real();
const real impegnato = rendy.get(REND_IMPEGNATO).as_real();
const real fatturato = rendy.get(REND_FATTURATO).as_real();
const real maturato = rendy.get(REND_MATURATO).as_real();
//occhio all'inversione ricavi/costi, che causa il ribaltamento del significato di ordcont
int indbil = rendy.get("ORDCONT").as_int();
@ -2032,6 +2277,7 @@ void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, co
{
//SCRIVE L'ULTIMA RIGA RELATIVA A CMS/CDC SUL FILE DA ESPORTARE
esporta_csv_row(file_to_date, first_level, last_codice, importi, importi_totali);
esporta_csv_row(file_to_print, first_level, last_codice, importi, importi_totali);
//AGGIUNGE L'EVENTUALE RIGA DEI TOTALI
TToken_string str_tot = _msk->sfield(F_RIGHE).row(r);
@ -2050,7 +2296,6 @@ void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, co
file_to_date << endl << endl;
}
} //if(last_codice.full())
}
//metodo per accattarsi o' primo livello della configurazione CA
@ -2061,12 +2306,282 @@ const TMultilevel_code_info& TPrint_rendiconto_ca::get_first_level() const
return ca_multilevel_code_info(logic);
}
void TPrint_rendiconto_ca::crea_trr(const TFilename& trr) const
{
ofstream of(trr);
of << 1000 << endl;
of << 12 << endl;
of << "CODCMS|1|20|0|Codice commessa" << endl;
of << "CODCOSTO|1|20|0|Codice centro di costo" << endl;
of << "CODFASE|1|20|0|Codice fase (eventualmente legato a CODCMS)" << endl;
of << "ORDCONT|1|1|0|Ordinatore in base a indicatore di bilancio" << endl;
of << "CODCONTO|1|20|0|Conto analitico" << endl;
of << "DATA|5|8|0|Data" << endl;
of << "DESCONTO|1|50|0|Descrizione conto" << endl;
of << "BUDGET|4|18|5|Preventivo" << endl;
of << "FATTURATO|4|18|5|Fatturato" << endl;
of << "MATURATO|4|18|5|Maturato" << endl;
of << "IMPEGNATO|4|18|5|Impegnato" << endl;
of << "PAGATO|4|18|5|Pagato" << endl;
of << 1 << endl;
of << "CODCMS+CODCOSTO+CODFASE+ORDCONT+CONTO+DATA" << endl;
}
void TPrint_rendiconto_ca::export_rendiconto()
{
TFilename dir(argv(2) + 2);
TFilename pubdir(argv(3) + 2);
TDate oggi(TODAY);
const long firm = atol(argv(5));
const long oldfirm = prefix().get_codditta();
if (firm > 0L)
prefix().set_codditta(firm);
dir.add(format("%04d", oggi.year()));
if (!dir.exist())
make_dir(dir);
dir.add(format("%02d", oggi.month()));
if (!dir.exist())
make_dir(dir);
dir.add(format("%02d", oggi.day()));
if (!dir.exist())
make_dir(dir);
int profile = atoi(argv(4));
_msk->load_profile(profile);
dir.add(format("%03d", profile));
if (!dir.exist())
make_dir(dir);
TSheet_field& sheet = _msk->sfield(F_RIGHE); sheet.destroy();
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
TString repname = _msk->get(F_REPORT);
if (repname.empty())
repname = "ca3700a";
TPrint_rendiconto_ca_rep rep;
rep.load(repname);
//log report con segnalazioni su errori (tipo conti inesistenti o robaccia simile..)
TLog_report log(TR("Errori rilevati"));
log.kill_duplicates();
TString video_string; //stringa che compare nella progind
TEsercizi_contabili esc;
TDate dataini, datafin;
const int anno = _msk->get_int(F_ANNO);
int recset_key = 1;
const bool attive = _msk->get_bool(F_ATTIVA);
if (anno > 0) //se non è stata specificata alcuna dataini, ma è stato specificato un anno di esercizio...
esc.code2range(anno, dataini, datafin);
if (!_msk->field(F_DATAINI).empty())
dataini = _msk->get_date(F_DATAINI);
if (!_msk->field(F_DATAFIN).empty())
datafin = _msk->get_date(F_DATAFIN);
const TMultilevel_code_info& liv1 = get_first_level(); //stabilisce quale è il primo livello (tra CDC e CMS)..
const bool is_cms = liv1.logic() == LF_COMMESSE;
TISAM_recordset set(is_cms ? "USE COMMESSE" : "USE CDC"); //..e di conseguenza scrive la use giusta
TFilename trr; trr.tempdir(); trr.add("rendiconto"); trr.ext("trr"); //file tracciato record
TFilename riepname(dir); riepname.add("rendiconto"); riepname.ext("dbf");
//crea il file .trr in base ai parametri del metodo
crea_trr(trr);
//crea in memoria il nuovo file temporaneo e lo azzera (non si sa mai..)
TExternisamfile riep(riepname, trr, true);
riep.zap();
TProgind pi(set.items(), video_string, true, true);
for (int i = 0; set.move_to(i); i++) //fighissimo metodo per scandire un file in 1 riga!
{
if (!pi.addstatus(1))
break;
TReport_book * book = new TReport_book();
//Filtro sulle date
//DATE VALIDE STRETTAMENTE PER COMMESSE
//per prima cosa controlla se veramente la commessa rientri nei parametri temporali impostati sulla maschera
//Se infatti è completamente al di fuori di tale intervallo, che cavolo la controlla a fare
row = set.get((unsigned int)0).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
if (is_cms)
{
if (attive)
{
const TRectype& rec_commesse = set.cursor()->curr();
if (!ca_commessa_attiva(rec_commesse, dataini, datafin))
continue;
}
else
if (dataini.ok() || datafin.ok())
{
const TRectype& rec_commesse = set.cursor()->curr();
TDate datainicms, datafcomp;
ca_durata_commessa(rec_commesse, datainicms, datafcomp);
if ((dataini.ok() && datafcomp < dataini) || (datafin.ok() && datainicms > datafin))
continue;
}
}
video_string = TR("Scansione");
video_string << " " << row; //completa la stringa da visualizzare sulla progind
pi.set_text(video_string);
for (int l = liv1.levels()-2; l >= 0; l--) //se la struttura è a più livelli costruisce la tokenstring
row.insert("|", liv1.total_len(l));
rep.set_filter(*_msk, 0, recset_key, log); //fa la set filter sulla prima riga (che è quella usata)
//se stampa o anteprima..
book->add(rep);
TPrint_rendiconto_ca_recordset & recset = (TPrint_rendiconto_ca_recordset &) *rep.recordset();
TString80 codcms;
TString80 codcosto;
TString16 codfase;
TString16 codconto;
for (int j = 0; recset.move_to(j); j++) //fighissimo metodo per scandire un file in 1 riga!
{
codcms = recset.get(REND_CODCMS).as_string();
codcosto = recset.get(REND_CODCOSTO).as_string();
codfase = recset.get(REND_CODFASE).as_string();
codconto = recset.get(REND_CONTO).as_string();
riep.put(RIEP_CODCMS, codcms);
riep.put(RIEP_CODCOSTO, codcosto);
riep.put(RIEP_CODFASE, codfase);
riep.put(RIEP_CODCONTO, codconto);
riep.put(RIEP_DATA, oggi);
if (riep.read() != NOERR)
{
riep.zero();
riep.put(RIEP_CODCMS, codcms);
riep.put(RIEP_CODCOSTO, codcosto);
riep.put(RIEP_CODFASE, codfase);
riep.put(RIEP_CODCONTO, codconto);
riep.put(RIEP_DATA, oggi);
riep.put(RIEP_DESCONTO, cache().get(LF_PCONANA, codconto, PCONANA_DESCR));
riep.put(RIEP_ORDCONT, recset.get(REND_ORDCONT).as_int());
real budget = recset.get_budget_batch(codcosto, codcms, codfase, codconto, 'P');
budget += recset.get_budget_batch(codcosto, codcms, codfase, codconto, 'V');
riep.put(RIEP_BUDGET, budget);
riep.write();
}
riep.curr().add(REND_FATTURATO, recset.get(REND_FATTURATO).as_real());
riep.curr().add(REND_MATURATO, recset.get(REND_MATURATO).as_real());
riep.curr().add(REND_IMPEGNATO, recset.get(REND_IMPEGNATO).as_real());
riep.curr().add(REND_PAGATO, recset.get(REND_PAGATO).as_real());
riep.rewrite();
}
TFilename filename(dir);
TString codice(set.get(COMMESSE_CODCMS).as_string());
codice.replace('.', '_');
codice.replace('\\', '_');
codice.replace('/', '_');
filename.add(codice);
filename.ext("pdf");
book->export_pdf(filename, false);
delete book;
book = NULL;
if (filename.exist())
{
TFilename dest(pubdir);
dest.add(codice);
dest.ext("pdf");
fcopy(filename, dest, false, true);
}
}
if (firm > 0L)
prefix().set_codditta(oldfirm);
// if (oggi.is_end_month())
{
TDate del(oggi);
del.addmonth(-1);
del.set_end_month();
const int last = del.day();
TFilename base(argv(2) + 2);
base.add(format("%04d", del.year()));
base.add(format("%02d", del.month()));
for (int d = 1; d < last; d++)
{
TString_array dirs;
TFilename dirsdir(base);
dirsdir.add(format("%02d", d));
if (dirsdir.exist())
{
TFilename mask(dirsdir);
mask.add("*.*");
list_files(mask, dirs);
const int diritems = dirs.items();
for (int i = 0; i < diritems; i ++)
{
TString_array files;
TFilename filesdir(dirsdir);
if (filesdir.exist())
{
filesdir.add(dirs.row(i));
mask = filesdir;
mask.add("*.*");
list_files(mask, files);
const int items = files.items();
for (int j = 0; i < items; j ++)
{
TFilename file(filesdir);
file.add(files.row(j));
file.fremove();
}
remove_file(filesdir);
}
}
}
}
}
}
void TPrint_rendiconto_ca::main_loop()
{
_msk = new TPrint_rendiconto_ca_mask;
TPrint_rendiconto_ca_mask& mask = *_msk;
const int first_level = get_first_level().logic(); //primo livello nella configurazione CA
const int first_level = get_first_level().logic(); //primo livello nella configurazione CA
TString arg(argv(2));
TEsercizi_contabili esc;
arg.lower();
if (arg.starts_with("-b"))
{
export_rendiconto();
return;
}
while (true)
{
//il programma deve cominciare l'eleaborazione solo nel caso di Stampa/Anteprima (K_ENTER) o Esportazione CSV (K_F6)
@ -2159,14 +2674,16 @@ void TPrint_rendiconto_ca::main_loop()
TSheet_field& sheet = mask.sfield(F_RIGHE);
TString video_string; //stringa che compare nella progind
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
TDate dataini, datafin;
const int anno = mask.get_int(F_ANNO);
const bool attive = mask.get_bool(F_ATTIVA);
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
{
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
//si amplia il range di ricerca temporale di 1 anno nel passato perchè i movana..
//..preventivi possono essere stati decisi prima dell'inizio effettivo commessa
TDate dataini, datafin;
const int anno = mask.get_int(F_ANNO);
if (anno > 0) //se non è stata specificata alcuna dataini, ma è stato specificato un anno di esercizio...
{
TEsercizi_contabili esc;
@ -2193,13 +2710,24 @@ void TPrint_rendiconto_ca::main_loop()
//Se infatti è completamente al di fuori di tale intervallo, che cavolo la controlla a fare
row = set.get((unsigned int)0).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
if (is_cms && (dataini.ok() || datafin.ok()))
if (is_cms)
{
const TRectype& rec_commesse = set.cursor()->curr();
TDate datainicms, datafcomp;
ca_durata_commessa(rec_commesse, datainicms, datafcomp);
if ((dataini.ok() && datafcomp < dataini) || (datafin.ok() && datainicms > datafin))
continue;
if (attive)
{
const TRectype& rec_commesse = set.cursor()->curr();
if (!ca_commessa_attiva(rec_commesse, dataini, datafin))
continue;
}
else
if (dataini.ok() || datafin.ok())
{
const TRectype& rec_commesse = set.cursor()->curr();
TDate datainicms, datafcomp;
ca_durata_commessa(rec_commesse, datainicms, datafcomp);
if ((dataini.ok() && datafcomp < dataini) || (datafin.ok() && datainicms > datafin))
continue;
}
}
video_string = TR("Scansione");
@ -2213,7 +2741,7 @@ void TPrint_rendiconto_ca::main_loop()
//se stampa o anteprima..
if (key == K_F6)
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), 0); //esportazione in excel
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), 0, book, i == 0); //esportazione in excel
else
book.add(rep);
}
@ -2227,7 +2755,7 @@ void TPrint_rendiconto_ca::main_loop()
//..temporaneo i cui dati riempiranno il report
//se stampa o anteprima
if (key == K_F6) //esportazione in excel
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), r); //il recordset è del tipo TPrint_rendiconto
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), r, book, r == 0); //il recordset è del tipo TPrint_rendiconto
else
book.add(rep); //aggiunge il report relativo alla cdc/cms corrente al book
}
@ -2236,6 +2764,54 @@ void TPrint_rendiconto_ca::main_loop()
if (log.recordset()->items() > 0)
log.preview();
TReport rep_xls;
path = "ca3700b";
rep_xls.load(path);
if (key == K_F6)
{
TCSV_recordset xls_source("CSV(\"\t\")");
TCSV_recordset * xls_dest = new TCSV_recordset("CSV(\"\t\")");
TFilename paths = _msk->get(F_PATH);
TString val;
paths.lower();
paths.add("rend.xls");
xls_source.load_file(paths);
const TEsercizio & e = esc.esercizio(anno == 0 ? (datafin.ok() ? datafin.year() : dataini.year()) : anno);
const int ncols = xls_source.columns();
for (bool ok = xls_source.move_first(); ok; ok = xls_source.move_next())
{
TString codcms = xls_source.get(0).as_string();
const TRectype & rec = cache().get(LF_COMMESSE, codcms);
bool okc = !rec.empty();
okc &= rec.get_date(COMMESSE_DATAINIZIO) <= e.fine();
if (okc & rec.get_date(COMMESSE_PROROGA).ok())
okc &= rec.get_date(COMMESSE_PROROGA) >= e.inizio();
else
okc &= rec.get_date(COMMESSE_DATAFINE) >= e.inizio();
if (okc)
{
TToken_string riga(512, '\t');
for (int col = 0; col < ncols; col++)
{
val = xls_source.get(col).as_string();
if (col >= 5)
val.replace(',', '.');
riga.add(val, col);
}
xls_dest->new_rec(riga);
}
}
rep_xls.TReport::set_recordset(xls_dest);
book.add(rep_xls);
}
if (key == K_ENTER)
book.print(); //stampa il book dei report
else

View File

@ -13,6 +13,7 @@
#define F_IMPLODE_ROWS 259
#define F_VITAINTERA 261
#define F_PATH 262
#define F_ATTIVA 263
//campi generati dai piani dei conti
#define F_PIANO 319

View File

@ -101,6 +101,11 @@ BEGIN
PROMPT 36 9 "Alla data "
END
BOOLEAN F_ATTIVA
BEGIN
PROMPT 60 9 "Solo commesse attive"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 10 "Digitare o selezionare attraverso la ricerca la cartella in cui creare il file rendiconto.xls. E' necessario indicare l'intero percorso!"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3700a" orientation="2" lpi="9" class="ca3700a">
<description>Rendiconto CA</description>
<font face="Courier New" size="8" />
<section type="Head" height="5">
<font face="Courier New" size="7" />
<section type="Head" height="5" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="9" />
@ -22,26 +22,27 @@
</field>
<field border="2" x="1" y="2" type="Linea" width="169" height="0" pattern="1" />
<field x="44" y="2.5" type="Testo" width="23" pattern="1" text="Doc. cliente&#2F;fornitore" />
<field x="117" y="2.5" type="Testo" align="center" width="12" pattern="1" text="Riferimento" />
<field x="102.5" y="2.5" type="Testo" align="center" width="12" pattern="1" text="Riferimento" />
<field x="141" y="2.5" type="Testo" width="25" pattern="1" text="Avanzamento costi&#2F;ricavi" />
<field x="20" y="3.5" type="Testo" width="7" pattern="1" text="N.Reg." />
<field x="27" y="3.5" type="Testo" width="8" pattern="1" text="N.Reg.CG" />
<field x="35" y="3.5" type="Testo" align="center" width="10" pattern="1" text="Data" />
<field x="47" y="3.5" type="Testo" align="center" width="6" pattern="1" text="Numero" />
<field x="53" y="3.5" type="Testo" align="center" width="10" pattern="1" text="Data" />
<field x="65" y="3.5" type="Testo" width="22" pattern="1" text="Descrizione testata" />
<field x="88" y="3.5" type="Testo" width="4" pattern="1" text="Riga" />
<field x="93" y="3.5" type="Testo" width="15" pattern="1" text="Descrizione riga" />
<field x="117" y="3.5" type="Testo" align="center" width="12" pattern="1" text="Ordine&#2F;Bolla" />
<field x="64.5" y="3.5" type="Testo" width="16" pattern="1" text="Descrizione testata" />
<field x="82" y="3.5" type="Testo" width="4" pattern="1" text="Riga" />
<field x="86" y="3.5" type="Testo" width="15" pattern="1" text="Descrizione riga" />
<field x="102.5" y="3.5" type="Testo" align="center" width="12" pattern="1" text="Ordine&#2F;Bolla" />
<field x="118" y="3.5" type="Testo" align="right" width="13" pattern="1" text="Pagato" />
<field x="131" y="3.5" type="Testo" align="right" width="13" pattern="1" text="Fatturato" />
<field x="144" y="3.5" type="Testo" align="right" width="13" pattern="1" text="Maturato" />
<field x="157" y="3.5" type="Testo" align="right" width="13" pattern="1" text="Impegnato" />
<field border="1" x="1" y="4.5" type="Linea" width="169" height="0" pattern="1" />
<field x="1" y="3.5" type="Testo" width="15" id="121" pattern="1" text="Rif. Contabile" />
</section>
<section type="Head" level="1" height="11">
<section type="Head" level="1" height="11" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="RENDICONTO">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" pattern="2" text="RENDICONTO">
<font face="Courier New" bold="1" size="16" />
</field>
<field x="1" y="3" type="Testo" width="18" pattern="1" text="Centro di Costo:" />
@ -55,7 +56,7 @@
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,CDC,CODCOSTO=#COSTO,DESCRIZ</prescript>
</field>
<field x="110" y="3" type="Testo" width="14" pattern="1" text="Anno:" />
<field x="126" y="3" type="Stringa" width="4" pattern="1">
<field x="125" y="3" type="Stringa" width="6" height="1.25" pattern="1">
<font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,ANNO</prescript>
</field>
@ -74,7 +75,7 @@
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DESCRIZ</prescript>
</field>
<field x="110" y="4.5" type="Testo" width="14" pattern="1" text="Data inizio:" />
<field x="126" y="4.5" type="Data" width="10" pattern="1">
<field x="125" y="4.5" type="Data" width="14" height="1.25" pattern="1">
<font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAINIZIO</prescript>
</field>
@ -94,7 +95,7 @@
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,FASI,CODFASE=#FASE,DESCRIZ</prescript>
</field>
<field x="110" y="6" type="Testo" width="14" pattern="1" text="Fine prevista:" />
<field x="126" y="6" type="Data" width="10" pattern="1">
<field x="125" y="6" type="Data" width="14" height="1.25" pattern="1">
<font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAFINE</prescript>
</field>
@ -122,7 +123,7 @@
<prescript description="H1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="110" y="7.5" type="Testo" width="14" pattern="1" text="Fine proroga:" />
<field x="126" y="7.5" type="Data" width="10" pattern="1">
<field x="125" y="7.5" type="Data" width="14" height="1.25" pattern="1">
<font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAPROR</prescript>
</field>
@ -142,27 +143,27 @@
<prescript description="H1.102 PRESCRIPT">MESSAGE ISAMREAD,CLIFO,TIPOCF=C!CODCF=#101,RAGSOC</prescript>
</field>
</section>
<section type="Head" level="2" height="2">
<section type="Head" level="2" height="2" pattern="1">
<groupby>ORDCONT+CONTO</groupby>
<font italic="1" face="Courier New" size="8" />
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2</prescript>
<field x="1" y="0.5" type="Stringa" bg_color="#C0C0C0" width="23">
<field x="1" y="0.5" type="Stringa" bg_color="#C0C0C0" width="23" pattern="2">
<font italic="1" face="Courier New" bold="1" size="8" />
<source>CONTO</source>
<prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field>
<field x="24" y="0.5" type="Stringa" bg_color="#C0C0C0" width="50">
<field x="24" y="0.5" type="Stringa" bg_color="#C0C0C0" width="50" pattern="2">
<font italic="1" face="Courier New" bold="1" size="8" />
<source>CONTO</source>
<prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field>
<field x="74" y="0.5" type="Testo" align="right" bg_color="#C0C0C0" width="66" text="Budget &#3E;&#3E;&#3E;">
<field x="74" y="0.5" type="Testo" align="right" bg_color="#C0C0C0" width="66" pattern="2" text="Budget &#3E;&#3E;&#3E;">
<font face="Courier New" bold="1" size="8" />
</field>
<field y="0.5" type="Numero" hidden="1" align="right" width="1" id="100" pattern="1">
<source>#INDBIL</source>
</field>
<field x="140" y="0.5" type="Valuta" align="right" bg_color="#C0C0C0" width="15" id="700" hide_zero="1" text="###.###.###,@@">
<field x="140" y="0.5" type="Valuta" align="right" bg_color="#C0C0C0" width="15" id="700" pattern="2" hide_zero="1" text="###.###.###,@@">
<font italic="1" face="Courier New" bold="1" size="8" />
<source>#VARIAZIONE</source>
<postscript description="H2.700 POSTSCRIPT">#THIS @ \ prende il proprio valore
@ -174,7 +175,7 @@
+! \ esegue la ADD sul campo di destinazione
</postscript>
</field>
<field x="155" y="0.5" type="Valuta" align="right" bg_color="#C0C0C0" width="15" id="800" hide_zero="1" text="###.###.###,@@">
<field x="155" y="0.5" type="Valuta" align="right" bg_color="#C0C0C0" width="15" id="800" pattern="2" hide_zero="1" text="###.###.###,@@">
<font italic="1" face="Courier New" bold="1" size="8" />
<source>#PREVENTIVO</source>
<postscript description="H2.800 POSTSCRIPT">#THIS @ \ prende il proprio valore
@ -187,7 +188,7 @@
</postscript>
</field>
</section>
<section type="Head" level="3">
<section type="Head" level="3" pattern="1">
<groupby>CODNUM+ANNO+NUMRD</groupby>
<field x="1" type="Stringa" hidden="1" align="right" width="4" pattern="1">
<source>CODNUM</source>
@ -199,8 +200,8 @@
<source>NUMRD</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<condition>HIDDEN!='X'</condition>
<field x="19" y="0.5" type="Numero" align="right" width="7" pattern="1" hide_zero="1">
<source>NUMREG</source>
@ -217,20 +218,23 @@
<field x="54" y="0.5" type="Data" width="10" pattern="1">
<source>DATADOCRIF</source>
</field>
<field x="65" y="0.5" type="Stringa" dynamic_height="1" width="23" height="2" pattern="1">
<field x="64.5" y="0.5" type="Stringa" dynamic_height="1" width="17" height="4" pattern="1">
<font face="Arial Narrow" size="8" />
<source>DESC</source>
</field>
<field x="89" y="0.5" type="Numero" align="right" width="3" pattern="1">
<field x="82" y="0.5" type="Numero" align="right" width="3" pattern="1">
<source>NRIGA</source>
</field>
<field x="93" y="0.5" type="Stringa" dynamic_height="1" width="22" height="2" pattern="1">
<field x="86" y="0.5" type="Stringa" dynamic_height="1" width="16" height="4" pattern="1">
<font face="Arial Narrow" size="8" />
<source>DESCRIGA</source>
</field>
<field x="116" y="0.5" type="Stringa" align="right" dynamic_height="1" width="15" height="20" pattern="1">
<field x="102.5" y="0.5" type="Stringa" align="right" dynamic_height="1" width="15" height="20" pattern="1">
<source>DOCORIG</source>
</field>
<field x="118" y="0.5" type="Valuta" align="right" width="13" pattern="1" text="###.###.###,@@">
<source>PAGATO</source>
</field>
<field x="131" y="0.5" type="Valuta" align="right" width="13" pattern="1" text="###.###.###,@@">
<source>FATTURATO</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
@ -271,7 +275,7 @@
<source>NUMRD</source>
</field>
</section>
<section type="Foot">
<section type="Foot" pattern="1">
<field border="1" x="1" y="0.25" type="Linea" width="169" height="0" pattern="1" />
<field x="1" y="0.75" type="Testo" width="10" pattern="1" text="Commessa" />
<field x="11" y="0.75" type="Stringa" width="20" pattern="1">
@ -292,7 +296,7 @@
<prescript description="F0.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field>
</section>
<section type="Foot" level="1">
<section type="Foot" level="1" pattern="1">
<field border="2" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" />
<field x="90" y="1" type="Testo" width="15" pattern="1" text="ATTIVITA'">
<font italic="1" face="Courier New" bold="1" size="9" />
@ -439,7 +443,7 @@
<source>#304-#804</source>
</field>
</section>
<section type="Foot" level="2" height="4">
<section type="Foot" level="2" height="4" pattern="1">
<field border="1" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" />
<field x="90" y="1" type="Testo" width="42" pattern="1" text="Totale fatturato, maturato, impegnato &#3E;&#3E;&#3E;">
<font face="Courier New" bold="1" size="8" />
@ -491,7 +495,7 @@
<source>#H2.700+#H2.800-#800</source>
</field>
</section>
<section type="Foot" level="3">
<section type="Foot" level="3" pattern="1">
<prescript description="F3 PRESCRIPT">0 #B1.100 !</prescript>
</section>
</report>
</report>

228
src/ca/ca3700b.rep Normal file
View File

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3700b" orientation="2" lpi="6" class="ca3700a">
<description>Rendiconto CA per esportazione excel</description>
<font face="Arial Narrow" size="7" />
<section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="7" />
<field x="1" type="Testo" valign="center" align="center" width="192" height="2.5" pattern="1" text="Riepilogo Entrate e Costi Esterni">
<font face="Arial Narrow" bold="1" size="16" />
</field>
<field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="70" type="Testo" width="10" pattern="1" text="Data stampa">
<font italic="1" face="Arial Narrow" size="7" />
</field>
<field x="82" type="Data" width="10" pattern="1">
<source>#SYSTEM.DATE</source>
</field>
<field x="186" type="Testo" width="4" pattern="1" text="Pag.">
<font italic="1" face="Arial Narrow" size="7" />
</field>
<field x="190" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
<field border="2" x="1" y="2.5" type="Linea" width="193" height="0" pattern="1" />
<field x="80" y="2.5" type="Testo" align="right" width="10" pattern="1" text="Ricavi" />
<field x="142.5" y="2.5" type="Testo" align="right" width="10" pattern="1" text="Costi" />
<field x="12" y="3" type="Testo" width="25" pattern="1" text="Dscrizione" />
<field x="49" y="4" type="Testo" align="right" width="10" pattern="1" text="Budget" />
<field x="59.5" y="4" type="Testo" align="right" width="10" pattern="1" text="Impegnato" />
<field x="70" y="4" type="Testo" align="right" width="10" pattern="1" text="Maturato" />
<field x="80.5" y="4" type="Testo" align="right" width="10" pattern="1" text="Fatturato" />
<field x="91" y="4" type="Testo" align="right" width="10" pattern="1" text="Da Impegnare" />
<field x="101" y="4" type="Testo" align="right" width="10" pattern="1" text="Da Maturare" />
<field x="111.5" y="4" type="Testo" align="right" width="10" pattern="1" text="Da Fatturare" />
<field x="121.5" y="4" type="Testo" align="right" width="10" pattern="1" text="Budget" />
<field x="132" y="4" type="Testo" align="right" width="10" pattern="1" text="Impegnato" />
<field x="142.5" y="4" type="Testo" align="right" width="10" pattern="1" text="Maturato" />
<field x="153" y="4" type="Testo" align="right" width="10" pattern="1" text="Fatturato" />
<field x="163" y="4" type="Testo" align="right" width="10" pattern="1" text="Da Impegnare" />
<field x="173.5" y="4" type="Testo" align="right" width="10" pattern="1" text="Da Maturare" />
<field x="184" y="4" type="Testo" align="right" width="10" pattern="1" text="Da Fatturare" />
<field x="47.5" y="5" type="Testo" align="center" width="10" pattern="1" text="Data Inizio" />
<field x="59" y="5" type="Testo" align="center" width="10" pattern="1" text="Data Fine" />
<field x="71" y="5" type="Testo" align="center" width="10" pattern="1" text="Data Proroga" />
<field border="1" x="1" y="6.25" type="Linea" width="193" height="0" pattern="1" />
<field x="1" y="3" type="Testo" width="10" id="121" pattern="1" text="Commessa" />
</section>
<section type="Head" level="1" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1</prescript>
</section>
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<field x="1" type="Stringa" width="10" height="2" pattern="1">
<font face="Arial Narrow" bold="1" size="7" />
<source>A</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
""
=
IF
#102
HIDE
ELSE
#102
SHOW
THEN</postscript>
</field>
<field x="48" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>M</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
</field>
<field x="58.5" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>N</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.104</postscript>
</field>
<field x="69" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>O</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.106</postscript>
</field>
<field x="80" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>P</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.108</postscript>
</field>
<field x="90" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>Q</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.110</postscript>
</field>
<field x="100" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>R</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.112</postscript>
</field>
<field x="110" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>T</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.114</postscript>
</field>
<field x="121" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>F</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
</field>
<field x="131.5" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>G</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.103</postscript>
</field>
<field x="142" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>H</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.105</postscript>
</field>
<field x="153" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>I</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.107</postscript>
</field>
<field x="163" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>J</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.109</postscript>
</field>
<field x="173" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>K</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.111</postscript>
</field>
<field x="183" type="Valuta" align="right" width="10" pattern="1" hide_zero="1" text="#########,@@">
<source>L</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F1.113</postscript>
</field>
<field x="48" y="1" type="Data" width="10" pattern="1">
<source>C</source>
</field>
<field x="58.5" y="1" type="Data" width="10" pattern="1">
<source>D</source>
</field>
<field x="69" y="1" type="Data" width="10" pattern="1">
<source>E</source>
</field>
<field x="12" type="Stringa" dynamic_height="1" width="25" height="2" id="102" pattern="1">
<source>B</source>
</field>
</section>
<section type="Foot" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="1" x="1.5" y="0.5" type="Linea" width="193" height="0" pattern="1" />
<field x="12" y="1" type="Testo" width="25" pattern="1" text="TOTALI">
<font face="Arial Narrow" bold="1" size="7" />
</field>
<field x="48" y="1" type="Valuta" align="right" width="10" id="101" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.101 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="48" y="2" type="Valuta" align="right" width="10" id="102" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.102 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="58.5" y="1" type="Valuta" align="right" width="10" id="103" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.103 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="58.5" y="2" type="Valuta" align="right" width="10" id="104" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.104 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="69" y="1" type="Valuta" align="right" width="10" id="105" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.105 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="69" y="2" type="Valuta" align="right" width="10" id="106" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.106 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="80" y="1" type="Valuta" align="right" width="10" id="107" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.107 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="80" y="2" type="Valuta" align="right" width="10" id="108" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.108 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="90" y="1" type="Valuta" align="right" width="10" id="109" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.109 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="90" y="2" type="Valuta" align="right" width="10" id="110" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.110 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="100" y="1" type="Valuta" align="right" width="10" id="111" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.111 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="100" y="2" type="Valuta" align="right" width="10" id="112" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.112 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="110" y="1" type="Valuta" align="right" width="10" id="113" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.113 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="110" y="2" type="Valuta" align="right" width="10" id="114" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.114 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="121" y="1" type="Valuta" align="right" width="10" id="115" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.115 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="121" y="2" type="Valuta" align="right" width="10" id="116" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.116 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="131.5" y="1" type="Valuta" align="right" width="10" id="117" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.117 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="131.5" y="2" type="Valuta" align="right" width="10" id="118" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.118 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="142" y="1" type="Valuta" align="right" width="10" id="119" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.119 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="142" y="2" type="Valuta" align="right" width="10" id="120" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.120 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="153" y="1" type="Valuta" align="right" width="10" id="121" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.121 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="153" y="2" type="Valuta" align="right" width="10" id="122" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.122 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="163" y="1" type="Valuta" align="right" width="10" id="123" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.123 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="163" y="2" type="Valuta" align="right" width="10" id="124" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.124 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="173" y="1" type="Valuta" align="right" width="10" id="125" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.125 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="173" y="2" type="Valuta" align="right" width="10" id="126" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.126 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="183" y="1" type="Valuta" align="right" width="10" id="127" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.127 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
<field x="183" y="2" type="Valuta" align="right" width="10" id="128" pattern="1" hide_zero="1" text="#########,@@">
<postscript description="F1.128 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
</field>
</section>
</report>

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3800a" orientation="2" lpi="6">
<description>Bilancio commessa CA</description>
<font face="Arial Narrow" size="8" />
<section type="Head">
<section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source>
@ -38,21 +38,28 @@
<source>"MARGINE CONTRIBUZIONE"</source>
</field>
</section>
<section type="Head" level="1">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="BILANCIO DI COMMESSA PER ESERCIZIO">
<section type="Head" level="1" pattern="1">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="169" height="2.5" pattern="2" text="BILANCIO DI COMMESSA PER ESERCIZIO">
<font face="Courier New" bold="1" size="16" />
</field>
<field x="7" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
<field x="2" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="42" y="3" type="Stringa" width="4" pattern="1">
<field x="35.5" y="3" type="Stringa" width="4" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>ANNO</source>
</field>
<field x="57" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
<field x="44.5" y="3" type="Testo" width="3" pattern="1" text="Dal">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="72" y="3" type="Array" width="35" pattern="1">
<field x="48" y="3" type="Data" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DAL</source>
</field>
<field x="61.5" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="76.5" y="3" type="Array" width="35" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>TIPOSTIMA</source>
<list>
@ -72,24 +79,40 @@
<li Value="Consuntivi" Code="X" />
</list>
</field>
<field x="7" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<field x="2" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="27" y="4.25" type="Stringa" width="3" pattern="1">
<field x="20.5" y="4.25" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>VITAINTERA</source>
</field>
<field x="57" y="4.25" type="Testo" width="15" pattern="1" text="Fase specificata">
<field x="26" y="4.25" type="Testo" width="12" pattern="1" text="Include inevasi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="72" y="4.25" type="Stringa" width="10" pattern="1">
<field x="38.5" y="4.25" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>INCLUDE_DOCUMENTI</source>
</field>
<field x="44.5" y="4.25" type="Testo" width="3" pattern="1" text="Al">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="48" y="4.25" type="Data" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>AL
</source>
<alt_source>DATAFINE</alt_source>
</field>
<field x="61.5" y="4.25" type="Testo" width="15" pattern="1" text="Fase specificata">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="76.5" y="4.25" type="Stringa" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>FASESPEC</source>
</field>
<field x="93" y="4.25" type="Testo" width="15" pattern="1" text="CdC specificato">
<field x="97.5" y="4.25" type="Testo" width="15" pattern="1" text="CdC specificato">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="105" y="4.25" type="Stringa" width="20" pattern="1">
<field x="109.5" y="4.25" type="Stringa" width="20" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>CDCSPEC</source>
</field>
@ -106,10 +129,10 @@
</field>
<field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" />
</section>
<section type="Head" level="2" height="1.5" page_break="1">
<section type="Head" level="2" height="1.5" page_break="1" pattern="1">
<groupby>(LEVEL&#3C;2)||(LEVEL=4)</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Array" bg_color="#C0C0C0" width="25">
<field x="1" type="Array" bg_color="#C0C0C0" width="25" pattern="2">
<source>LEVEL</source>
<list>
<li Value="Commesse terminate nel" Code="0" />
@ -119,7 +142,7 @@
<li Value="Commesse di supporto del" Code="4" />
</list>
</field>
<field x="26" type="Numero" align="right" bg_color="#C0C0C0" width="6">
<field x="26" type="Numero" align="right" bg_color="#C0C0C0" width="6" pattern="2">
<source>ANNO</source>
</field>
<field border="1" x="1" y="1.25" type="Linea" width="169" height="0" pattern="1" />
@ -132,7 +155,7 @@
<postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
</field>
</section>
<section type="Head" level="3" height="1.5">
<section type="Head" level="3" height="1.5" pattern="1">
<groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="3" type="Array" bg_color="#C0C0C0" width="45" pattern="1">
@ -151,7 +174,7 @@
<postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
</field>
</section>
<section type="Head" level="4" hidden="1">
<section type="Head" level="4" hidden="1" pattern="1">
<condition>(STAMPAFASI != "" )||(STAMPACDC != "")</condition>
<groupby>CODCMS</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -166,8 +189,8 @@
<source>0</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<prescript description="B1 PRESCRIPT">1 #H4.3 \ incrementa il contatore per il numero di righe di fase
+!</prescript>
<field x="1" type="Stringa" width="17" id="1" pattern="1">
@ -248,7 +271,7 @@ THEN
#THIS !</prescript>
</field>
</section>
<section type="Foot">
<section type="Foot" pattern="1">
<field border="1" x="1" y="0.25" type="Linea" width="169" height="0" pattern="1" />
<field x="2" y="0.75" type="Testo" width="25" pattern="1" text="Bilancio di commessa per esercizio">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -258,14 +281,14 @@ THEN
<source>ANNO</source>
</field>
</section>
<section type="Foot" level="1" height="3">
<section type="Foot" level="1" height="3" pattern="1">
<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="36" text="TOTALI GENERALI " />
<field x="1" y="1.5" type="Testo" fg_color="#FFFFFF" bg_color="#000000" width="36" pattern="2" text="TOTALI GENERALI " />
<field x="60.5" y="1.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" />
<field x="74" y="1.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="2" height="4.5">
<section type="Foot" level="2" height="4.5" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" />
<prescript description="F2 PRESCRIPT">#LEVEL @
4 = IF
@ -274,7 +297,7 @@ ELSE
"90@" DISABLE
THEN</prescript>
<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="30">
<field x="1" y="1" type="Array" bg_color="#C0C0C0" width="30" pattern="2">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<source>H2.101</source>
<list>
@ -285,18 +308,18 @@ THEN</prescript>
<li Value="TOTALI Commesse di supporto del" Code="4" />
</list>
</field>
<field x="31" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
<field x="31" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6" pattern="2">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<source>H2.102</source>
</field>
<field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1">
<groups>90</groups>
</field>
<field x="1" y="3.5" deactivated="1" type="Testo" fg_color="#FFFFFF" bg_color="#808080" width="30" text="TOTALI commesse normali relative al">
<field x="1" y="3.5" deactivated="1" type="Testo" fg_color="#FFFFFF" bg_color="#808080" width="30" pattern="2" text="TOTALI commesse normali relative al">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups>
</field>
<field x="31" y="3.5" type="Numero" align="right" fg_color="#FFFFFF" bg_color="#808080" width="6">
<field x="31" y="3.5" type="Numero" align="right" fg_color="#FFFFFF" bg_color="#808080" width="6" pattern="2">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups>
<source>H2.102</source>
@ -317,7 +340,7 @@ MESSAGE RESET,169
</postscript>
</field>
</section>
<section type="Foot" level="3" height="2.5">
<section type="Foot" level="3" height="2.5" pattern="1">
<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="1" y="0.5" type="Array" width="25" height="2" pattern="1">
@ -341,7 +364,7 @@ MESSAGE ADD,F2.369
MESSAGE RESET,169</postscript>
</field>
</section>
<section type="Foot" level="4" height="1">
<section type="Foot" level="4" height="1" pattern="1">
<condition>(#B1.200&#3E;1)&#26;&#26;((STAMPAFASI !="")||(STAMPACDC !=""))&#26;&#26;(#H4.3 &#3E; 0)&#26;&#26;(TIPOSTIMA!='T')&#26;&#26;(FASESPEC=="")</condition>
<font italic="1" face="Arial Narrow" size="8" />
<field x="22" type="Testo" width="15" pattern="1" text="Totali commessa" />
@ -354,4 +377,4 @@ MESSAGE RESET,169</postscript>
</field>
</section>
<sql>USE SALDANA</sql>
</report>
</report>

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3800b" orientation="2" lpi="6">
<description>Bilancio commessa CA riassuntivo per fasi</description>
<font face="Arial Narrow" size="8" />
<section type="Head">
<section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source>
@ -30,17 +30,24 @@
<source>"MARGINE CONTRIBUZIONE"</source>
</field>
</section>
<section type="Head" level="1">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="BILANCIO DI COMMESSA PER ESERCIZIO RAGGRUPPATO PER FASI">
<section type="Head" level="1" pattern="1">
<field border="1" radius="100" x="2" type="Testo" valign="center" align="center" shade_offset="25" width="168" height="2.5" pattern="2" text="BILANCIO DI COMMESSA PER ESERCIZIO RAGGRUPPATO PER FASI">
<font face="Courier New" bold="1" size="16" />
</field>
<field x="7" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
<field x="2" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="60" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
<field x="45" y="3" type="Testo" width="3" pattern="1" text="Dal">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="75" y="3" type="Array" width="35" pattern="1">
<field x="48.5" y="3" type="Data" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DAL</source>
</field>
<field x="65" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="80" y="3" type="Array" width="35" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>TIPOSTIMA</source>
<list>
@ -49,10 +56,10 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list>
</field>
<field x="120" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<field x="134" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="145" y="3" type="Array" width="10" pattern="1">
<field x="159" y="3" type="Array" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source>
<list>
@ -60,10 +67,10 @@
<li Value="Consuntivi" Code="X" />
</list>
</field>
<field x="120" y="4" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
<field x="134" y="4" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="145" y="4" type="Array" width="7" pattern="1">
<field x="159" y="4" type="Array" width="7" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DEPTH</source>
<list>
@ -71,31 +78,46 @@
<li Value="Conto" Code="2" />
</list>
</field>
<field x="7" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<field x="2" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="27" y="4.25" type="Stringa" width="3" pattern="1">
<field x="22" y="4.25" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>VITAINTERA</source>
</field>
<field x="60" y="4.25" type="Testo" width="15" pattern="1" text="Fase">
<field x="26.5" y="4.25" type="Testo" width="12" pattern="1" text="Include inevasi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="39" y="4.25" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>INCLUDE_DOCUMENTI</source>
</field>
<field x="45" y="4.25" type="Testo" width="3" pattern="1" text="Al">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="48.5" y="4.25" type="Data" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>AL</source>
<alt_source>DATAFINE</alt_source>
</field>
<field x="65" y="4.25" type="Testo" width="15" pattern="1" text="Fase">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" />
<field x="75" y="4.25" type="Stringa" width="10" id="1" pattern="1">
<field x="80" y="4.25" type="Stringa" width="10" id="1" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>FASESPEC</source>
<postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript>
</field>
<field x="42" y="3" type="Stringa" width="4" id="2" pattern="1">
<field x="37" y="3" type="Stringa" width="4" id="2" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>ANNO</source>
</field>
</section>
<section type="Head" level="2" height="1.5">
<section type="Head" level="2" height="1.5" pattern="1">
<groupby>(LEVEL&#3C;2)||(LEVEL=4)</groupby>
<font italic="1" face="Arial Narrow" size="8" />
<field x="1" type="Array" bg_color="#C0C0C0" width="25">
<field x="1" type="Array" bg_color="#C0C0C0" width="25" pattern="2">
<source>LEVEL</source>
<list>
<li Value="Commesse terminate nel" Code="0" />
@ -105,7 +127,7 @@
<li Value="Commesse di supporto del" Code="4" />
</list>
</field>
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6">
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6" pattern="2">
<source>ANNO</source>
</field>
<field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1">
@ -117,7 +139,7 @@
<postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
</field>
</section>
<section type="Head" level="3" hidden="1" height="1.5">
<section type="Head" level="3" hidden="1" height="1.5" pattern="1">
<groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" size="8" />
<field x="3" type="Array" bg_color="#C0C0C0" width="45" pattern="1">
@ -136,8 +158,8 @@
<postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
</field>
</section>
<section type="Body" />
<section type="Body" level="1" hidden="1">
<section type="Body" pattern="1" />
<section type="Body" level="1" hidden="1" pattern="1">
<prescript description="B1 PRESCRIPT">1 #H4.3 \ incrementa il contatore per il numero di righe di fase
+!</prescript>
<field x="65.5" type="Testo" align="center" width="2" pattern="1" text="%" />
@ -176,7 +198,7 @@
</field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</section>
<section type="Foot">
<section type="Foot" pattern="1">
<field border="1" x="1" y="0.25" type="Linea" width="169" height="0" pattern="1" />
<field x="2" y="0.75" type="Testo" width="25" pattern="1" text="Bilancio di commessa per esercizio">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -186,11 +208,11 @@
<source>H1.2</source>
</field>
</section>
<section type="Foot" level="1" height="3">
<section type="Foot" level="1" height="3" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field border="2" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" />
<field x="1" y="1" type="Testo" valign="center" fg_color="#FFFFFF" bg_color="#000000" width="20" id="1" text="TOTALI GENERALI " />
<field x="21" y="1" type="Stringa" valign="center" fg_color="#FFFFFF" bg_color="#400040" width="15" id="2">
<field x="1" y="1" type="Testo" valign="center" fg_color="#FFFFFF" bg_color="#000000" width="20" id="1" pattern="2" text="TOTALI GENERALI " />
<field x="21" y="1" type="Stringa" valign="center" fg_color="#FFFFFF" bg_color="#400040" width="15" id="2" pattern="2">
<font italic="1" face="Arial" bold="1" size="8" />
</field>
<field x="36" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" />
@ -198,7 +220,7 @@
<postscript description="F1.169 POSTSCRIPT">MESSAGE RESET,169</postscript>
</field>
</section>
<section type="Foot" level="2" height="4.5">
<section type="Foot" level="2" height="4.5" pattern="1">
<font italic="1" face="Courier New" size="8" />
<prescript description="F2 PRESCRIPT">#LEVEL @
&#09;4 = IF
@ -207,7 +229,7 @@
&#09; "90@" DISABLE
THEN</prescript>
<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="30">
<field x="1" y="1" type="Array" bg_color="#C0C0C0" width="30" pattern="2">
<font italic="1" face="Arial Narrow" size="8" />
<source>H2.101</source>
<list>
@ -218,18 +240,18 @@
<li Value="TOTALI Commesse di supporto del" Code="4" />
</list>
</field>
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6" pattern="2">
<font italic="1" face="Arial Narrow" size="8" />
<source>H2.102</source>
</field>
<field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1">
<groups>90</groups>
</field>
<field x="1" y="3.5" deactivated="1" type="Testo" fg_color="#FFFFFF" bg_color="#808080" width="30" text="TOTALI commesse normali relative al">
<field x="1" y="3.5" deactivated="1" type="Testo" fg_color="#FFFFFF" bg_color="#808080" width="30" pattern="2" text="TOTALI commesse normali relative al">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups>
</field>
<field x="31" y="3.5" type="Numero" align="right" fg_color="#FFFFFF" bg_color="#808080" width="6">
<field x="31" y="3.5" type="Numero" align="right" fg_color="#FFFFFF" bg_color="#808080" width="6" pattern="2">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups>
<source>H2.102</source>
@ -248,7 +270,7 @@
MESSAGE RESET,169</postscript>
</field>
</section>
<section type="Foot" level="3" height="2">
<section type="Foot" level="3" height="2" pattern="1">
<font italic="1" face="Arial Narrow" size="8" />
<field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
<source>H3.101</source>
@ -274,4 +296,4 @@ MESSAGE RESET,169
</field>
</section>
<sql>USE SALDANA</sql>
</report>
</report>

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3800c" orientation="2" lpi="6">
<description>Bilancio commessa CA riassuntivo per CdC</description>
<font face="Arial Narrow" size="8" />
<section type="Head">
<section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source>
@ -30,14 +30,21 @@
<source>"MARGINE CONTRIBUZIONE"</source>
</field>
</section>
<section type="Head" level="1">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="BILANCIO DI COMMESSA PER ESERCIZIO RAGGRUPPATO PER CENTRI DI COSTO">
<section type="Head" level="1" pattern="1">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="169" height="2.5" pattern="2" text="BILANCIO DI COMMESSA PER ESERCIZIO RAGGRUPPATO PER CENTRI DI COSTO">
<font face="Courier New" bold="1" size="16" />
</field>
<field x="7" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
<field x="2" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="60" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
<field x="45" y="3" type="Testo" width="3" pattern="1" text="Dal">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="48.5" y="3" type="Data" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DAL</source>
</field>
<field x="63.5" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="75" y="3" type="Array" width="35" pattern="1">
@ -49,10 +56,10 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list>
</field>
<field x="120" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<field x="134" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="145" y="3" type="Array" width="10" pattern="1">
<field x="159" y="3" type="Array" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source>
<list>
@ -60,10 +67,10 @@
<li Value="Consuntivi" Code="X" />
</list>
</field>
<field x="120" y="4" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
<field x="134" y="4" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="145" y="4" type="Array" width="7" pattern="1">
<field x="159" y="4" type="Array" width="7" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DEPTH</source>
<list>
@ -71,31 +78,46 @@
<li Value="Conto" Code="2" />
</list>
</field>
<field x="7" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<field x="2" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="27" y="4.25" type="Stringa" width="3" pattern="1">
<field x="22" y="4.25" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>VITAINTERA</source>
</field>
<field x="60" y="4.25" type="Testo" width="15" pattern="1" text="Centro di Costo">
<field x="26.5" y="4.25" type="Testo" width="12" pattern="1" text="Include inevasi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="39" y="4.25" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>INCLUDE_DOCUMENTI</source>
</field>
<field x="45" y="4.25" type="Testo" width="3" pattern="1" text="Al">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="48.5" y="4.25" type="Data" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>AL</source>
<alt_source>DATAFINE</alt_source>
</field>
<field x="63.5" y="4.25" type="Testo" width="15" pattern="1" text="Centro di Costo">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" />
<field x="80" y="4.25" type="Stringa" width="10" id="1" pattern="1">
<field x="83.5" y="4.25" type="Stringa" width="10" id="1" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>CDCSPEC</source>
<postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript>
</field>
<field x="42" y="3" type="Stringa" width="4" id="2" pattern="1">
<field x="37" y="3" type="Stringa" width="4" id="2" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>ANNO</source>
</field>
</section>
<section type="Head" level="2" height="1.5">
<section type="Head" level="2" height="1.5" pattern="1">
<groupby>(LEVEL&#3C;2)||(LEVEL=4)</groupby>
<font italic="1" face="Arial Narrow" size="8" />
<field x="1" type="Array" bg_color="#C0C0C0" width="25">
<field x="1" type="Array" bg_color="#C0C0C0" width="25" pattern="2">
<source>LEVEL</source>
<list>
<li Value="Commesse terminate nel" Code="0" />
@ -105,7 +127,7 @@
<li Value="Commesse di supporto del" Code="4" />
</list>
</field>
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6">
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6" pattern="2">
<source>ANNO</source>
</field>
<field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1">
@ -117,7 +139,7 @@
<postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
</field>
</section>
<section type="Head" level="3" hidden="1" height="1.5">
<section type="Head" level="3" hidden="1" height="1.5" pattern="1">
<groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" size="8" />
<field x="3" type="Array" bg_color="#C0C0C0" width="45" pattern="1">
@ -136,8 +158,8 @@
<postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
</field>
</section>
<section type="Body" />
<section type="Body" level="1" hidden="1">
<section type="Body" pattern="1" />
<section type="Body" level="1" hidden="1" pattern="1">
<prescript description="B1 PRESCRIPT">1 #H4.3 \ incrementa il contatore per il numero di righe di cdc
+!</prescript>
<field x="65.5" type="Testo" align="center" width="2" pattern="1" text="%" />
@ -176,7 +198,7 @@
</field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</section>
<section type="Foot">
<section type="Foot" pattern="1">
<field border="1" x="1" y="0.25" type="Linea" width="169" height="0" pattern="1" />
<field x="2" y="0.75" type="Testo" width="25" pattern="1" text="Bilancio di commessa per esercizio">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -186,11 +208,11 @@
<source>H1.2</source>
</field>
</section>
<section type="Foot" level="1" height="3">
<section type="Foot" level="1" height="3" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field border="2" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" />
<field x="1" y="1" type="Testo" valign="center" fg_color="#FFFFFF" bg_color="#000000" width="20" id="1" text="TOTALI GENERALI " />
<field x="21" y="1" type="Stringa" valign="center" fg_color="#FFFFFF" bg_color="#400040" width="15" id="2">
<field x="1" y="1" type="Testo" valign="center" fg_color="#FFFFFF" bg_color="#000000" width="20" id="1" pattern="2" text="TOTALI GENERALI " />
<field x="21" y="1" type="Stringa" valign="center" fg_color="#FFFFFF" bg_color="#400040" width="15" id="2" pattern="2">
<font italic="1" face="Arial" bold="1" size="8" />
</field>
<field x="46.5" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" />
@ -198,7 +220,7 @@
<postscript description="F1.169 POSTSCRIPT">MESSAGE RESET,169</postscript>
</field>
</section>
<section type="Foot" level="2" height="4.5">
<section type="Foot" level="2" height="4.5" pattern="1">
<font italic="1" face="Courier New" size="8" />
<prescript description="F2 PRESCRIPT">#LEVEL @
&#09;4 = IF
@ -207,7 +229,7 @@
&#09; "90@" DISABLE
THEN</prescript>
<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="30">
<field x="1" y="1" type="Array" bg_color="#C0C0C0" width="30" pattern="2">
<font italic="1" face="Arial Narrow" size="8" />
<source>H2.101</source>
<list>
@ -218,18 +240,18 @@ THEN</prescript>
<li Value="TOTALI Commesse di supporto del" Code="4" />
</list>
</field>
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6" pattern="2">
<font italic="1" face="Arial Narrow" size="8" />
<source>H2.102</source>
</field>
<field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1">
<groups>90</groups>
</field>
<field x="1" y="3.5" deactivated="1" type="Testo" fg_color="#FFFFFF" bg_color="#808080" width="30" text="TOTALI commesse normali relative al">
<field x="1" y="3.5" deactivated="1" type="Testo" fg_color="#FFFFFF" bg_color="#808080" width="30" pattern="2" text="TOTALI commesse normali relative al">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups>
</field>
<field x="31" y="3.5" type="Numero" align="right" fg_color="#FFFFFF" bg_color="#808080" width="6">
<field x="31" y="3.5" type="Numero" align="right" fg_color="#FFFFFF" bg_color="#808080" width="6" pattern="2">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups>
<source>H2.102</source>
@ -248,7 +270,7 @@ THEN</prescript>
MESSAGE RESET,169</postscript>
</field>
</section>
<section type="Foot" level="3" height="2">
<section type="Foot" level="3" height="2" pattern="1">
<font italic="1" face="Arial Narrow" size="8" />
<field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
<source>H3.101</source>
@ -274,4 +296,4 @@ MESSAGE RESET,169
</field>
</section>
<sql>USE SALDANA</sql>
</report>
</report>

View File

@ -292,7 +292,8 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in
TAssoc_array& TPrint_saldana_recordset::get_row(TAssoc_array& cms, const char* chiave,
const int indice, const TString& codcms, const TString& fase,
const TString& cdc, const TString& descrizione) const
const TString& cdc, const TString& descrizione,
const TDate& inizio, const TDate& fine, const TDate& proroga) const
{
//cerca se la commessa (e l'eventuale fase) esistono gia' nell'assocarray delle commesse
TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave);
@ -306,13 +307,16 @@ TAssoc_array& TPrint_saldana_recordset::get_row(TAssoc_array& cms, const char* c
riga_array->add("LEVEL", str_indice);
riga_array->add("CODCMS", codcms);
if (_tipo == 8)
if (_tipo == 8 || _tipo == 9)
{
riga_array->add("FASE", fase);
riga_array->add("CDC", cdc);
}
riga_array->add("DESCRIZ", descrizione);
riga_array->add("INIZIO", !inizio.ok() ? EMPTY_STRING : inizio.string(brief));
riga_array->add("FINE", !fine.ok() ? EMPTY_STRING : fine.string(brief));
riga_array->add("PROROGA", !proroga.ok() ? EMPTY_STRING : proroga.string(brief));
//inizializza i campi importo sicuramente presenti (modifica DECISIVA)
//senza questa inizializzazione, nel caso trovasse campi nulli (in realta' 0), il bastardo..
//..anziche' considerarli 0 ci mette l'ultimo valore != che ha in memoria nella stessa posizione..
@ -459,6 +463,7 @@ void TPrint_saldana_recordset::aggiorna_importi(TAssoc_array& riga_array,
}
//saldi normali:Maturato
if (!imp_saldo.is_zero())
{
livello.format("%s_MAT", indbil == 3 ? "COS" : "RIC");
@ -521,8 +526,8 @@ void TPrint_saldana_recordset::ricava_chiave_cdc_fase(const TString& codcms, con
{
//ci sono filtri o raggruppamenti per fase o centro di costo?
chiave = codcms;
//selezione fasi solo su bilancio commessa (_tipo=8)
if (_tipo == 8 && (_tipostampa >= 1 && _tipostampa <= 3))
//selezione fasi solo su bilancio commessa e stima costi ricavi (_tipo=8 e 9)
if ((_tipo == 8 || _tipo == 9) && (_tipostampa >= 1 && _tipostampa <= 3))
{
//se vuole entrambi i livelli di dettaglio occorre sapere chi e' il babbo delle fasi o dei cdc
if (_tipostampa == 3)
@ -653,7 +658,7 @@ void TPrint_saldana_recordset::parse_saldana(TAssoc_array* cms, const TDate& dat
if (_tipo == 9)
{
//non vanno considerati saldi di esercizi futuri a quello scelto!!!
query = "USE SALDANA";
query = crea_query_saldana();
}
TISAM_recordset saldana_set(query);
@ -710,7 +715,10 @@ void TPrint_saldana_recordset::parse_saldana(TAssoc_array* cms, const TDate& dat
if (_tipo == 8)
{
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc,
rec_commesse.get(COMMESSE_DESCRIZ));
rec_commesse.get(COMMESSE_DESCRIZ),
rec_commesse.get_date(COMMESSE_DATAINIZIO),
rec_commesse.get_date(COMMESSE_DATAFINE),
rec_commesse.get_date(COMMESSE_PROROGA));
//aggiunge gli importi e normalizza
aggiorna_importo(riga_array, gruppo, indbil, saldana);
@ -728,9 +736,13 @@ void TPrint_saldana_recordset::parse_saldana(TAssoc_array* cms, const TDate& dat
//stima ricavi ca3900 (_tipo=9)
else
{
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, EMPTY_STRING, EMPTY_STRING,
rec_commesse.get(COMMESSE_DESCRIZ));
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc,
rec_commesse.get(COMMESSE_DESCRIZ),
rec_commesse.get_date(COMMESSE_DATAINIZIO),
rec_commesse.get_date(COMMESSE_DATAFINE),
rec_commesse.get_date(COMMESSE_PROROGA));
//aggiunge gli importi e normalizza
if (anno_saldo > _anno) // gestione saldo nel futuro
{
if (indice > 1) // considera i saldop solo se è una commessa che termina nel futuro!
@ -946,7 +958,7 @@ void TPrint_saldana_recordset::elabora_rmovana(TAssoc_array* cms, const TDate& d
{
//gruppo e conto servono solo per il caso _tipo=8 ma vanno dichiarati e ricavati..
//..qui in modo che siano a disposizione delle commesse del cazzo poco sotto
const char* gruppo = indbil == 3 ? "COSTI" : "RICAVI";
const char* gruppo = _tipo == 8 ? (indbil == 3 ? "COSTI" : "RICAVI") : (indbil == 3 ? "COS_MAT" : "RIC_MAT");
TString80 conto;
parse_bill(conto_anale, conto);
@ -954,7 +966,10 @@ void TPrint_saldana_recordset::elabora_rmovana(TAssoc_array* cms, const TDate& d
const TImporto importo_riga(rmovana.get_char(RMOVANA_SEZIONE), importo);
//riga array da aggiungere agli arrayoni da mandare in stampa
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc,
rec_commesse.get(COMMESSE_DESCRIZ));
rec_commesse.get(COMMESSE_DESCRIZ),
rec_commesse.get_date(COMMESSE_DATAINIZIO),
rec_commesse.get_date(COMMESSE_DATAFINE),
rec_commesse.get_date(COMMESSE_PROROGA));
TRectype saldana(LF_SALDANA);
saldana.put(SALDANA_ANNO, _anno);
@ -994,6 +1009,7 @@ void TPrint_saldana_recordset::elabora_rmovana(TAssoc_array* cms, const TDate& d
}
//aggiunge gli importi e normalizza
aggiorna_importo(riga_array, gruppo, indbil, saldana);
aggiorna_importo(riga_array, conto, indbil, saldana);
}
@ -1394,6 +1410,15 @@ void TPrint_saldana_recordset::create_lines_to_print()
parse_rdoc_fatture(cms, datainiesc, datafinesc);
}
} //if(_tipo==8)...
else
if (_tipo == 9)
{
if (_include_documenti)
{
parse_rdoc_ordini(cms, datainiesc, datafinesc);
parse_rdoc_fatture(cms, datainiesc, datafinesc);
}
}
// 3)
@ -1463,151 +1488,149 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const
}
else
if (strcmp(column_name, "DEPTH") == 0)
{
var.set(_depth);
}
else
if (strcmp(column_name, "DETRCONS") == 0)
{
var.set(_detrazioni_consuntive == true ? "X" : "");
}
else
if (strcmp(column_name, "VITAINTERA") == 0)
{
var.set(_vitaintera == true ? "SI" : "NO");
}
var.set(_depth);
else
if (strcmp(column_name, "STAMPAFASI") == 0)
{
var.set((_tipostampa == 1 || _tipostampa == 3) ? "X" : "");
}
else
if (strcmp(column_name, "FASESPEC") == 0)
{
if (_tipostampa == 1 || _tipostampa == 3 || _tipostampa == 4)
var.set(_fase);
else
var.set(EMPTY_STRING);
}
else
if (strcmp(column_name, "STAMPACDC") == 0)
{
var.set((_tipostampa == 2 || _tipostampa == 3) ? "X" : "");
}
else
if (strcmp(column_name, "CDCSPEC") == 0)
{
if (_tipostampa == 2 || _tipostampa == 3 || _tipostampa == 8)
var.set(_cdc);
else
var.set(EMPTY_STRING);
}
else
if (strcmp(column_name, "DATAINI") == 0)
{
const TString& codcms = get("CODCMS").as_string();
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
var.set(rec_commesse.get(COMMESSE_DATAINIZIO));
}
else
if (strcmp(column_name, "DATAFINE") == 0)
{
const TString& codcms = get("CODCMS").as_string();
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
TDate datafine = rec_commesse.get(COMMESSE_DATAPROR);
if (!datafine.ok())
datafine = rec_commesse.get(COMMESSE_DATAFINE);
var.set(datafine);
}
else
if (strcmp(column_name, "AVANZAMENTO") == 0)
{
//RICAVI
//------
//Calcola lo stato di avanzamento della commessa in caso di stima x Tempo
//In questo caso i ricavihanno una % di avanzamento legata alla durata della commessa (prorogata ecc.)..
//..rispetto al momento della stampa
real avanzamento;
if (_tipostima == 'T')
{
avanzamento = calcola_avanzamento_tempo();
}
else //se stima e' di tipo Costi/Ricavi invece....Allah!!
{
//In caso di stampa Ricavi nei casi _tipostime = 'C' o 'R', l'avanzamento è calcolato in base agli importi.
//Caso 'C': valore_preventivo / totale_preventivo
//Caso 'R': valore_consuntivo / totale_preventivo (!) richiesta specifica Adolfo-Enrichetta 24-03-2011
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
const real val = get("RICAVI").as_real();
if (!val.is_zero())
{
const int indice = get("LEVEL").as_int();
const TString& codcms = get("CODCMS").as_string();
#ifdef DBG
if (codcms == "FP10VB22388OP")
const int cazzone = 1;
#endif
TAssoc_array& riga_tot = get_row((TAssoc_array&)_totali[indice], codcms, indice, codcms, EMPTY_STRING, EMPTY_STRING,
"RICAVI");
const TString* stric = (const TString*)riga_tot.objptr("RICAVI");
if (stric && stric->full())
{
const real totric = *stric;
if (!totric.is_zero())
avanzamento = val * CENTO / totric;
}
}
}
var.set(avanzamento);
}
else //if(strcmp(column_name,AVANZAMENTO...
{
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
if (strncmp(column_name, "RECORD.", 7) == 0)
column_name += 7;
//COSTI
//-----
if (strcmp(column_name, "COS_PERC") == 0)
{
const int indice = get("LEVEL").as_int();
if (indice == 4)
int cazzone = 100;
//la % dei costi, in caso si forzi il maturato (considerare finite le commesse che terminano nell'esercizio selezionato)..
//..viene posta artificialmente pari a 100% nelle sezioni delle commesse che terminano nell'esercizio selezionato (sez. 0 e 1)..
//..e nella sezione delle commesse di supporto (sez. 4). Richiesta Adolfica del 08/03/2011
if (_forza_maturato && (indice <= 1 || indice == 4))
var.set(CENTO);
else
{
const TString* val_bdg = (TString*)riga.objptr("COS_BDG");
if (val_bdg == NULL || real::is_null(*val_bdg))
var.set(CENTO);
else
{
const TString* val_mat = (TString*)riga.objptr("COS_MAT");
if (val_mat == NULL || real::is_null(*val_mat))
var.set(ZERO);
else
{
const real bdg(*val_bdg);
const real mat(*val_mat);
real perc = mat * CENTO / bdg;
perc.round(2);
var.set(perc);
}
}
}
}
else
{
const TString* val = (TString*)riga.objptr(column_name);
if (val)
var.set(*val);
else
var.set_null();
}
}
if (strcmp(column_name, "DETRCONS") == 0)
var.set(_detrazioni_consuntive == true ? "X" : "");
else
if (strcmp(column_name, "VITAINTERA") == 0)
var.set(_vitaintera == true ? "SI" : "NO");
else
if (strcmp(column_name, "INCLUDE_DOCUMENTI") == 0)
var.set(_include_documenti == true ? "SI" : "NO");
else
if (strcmp(column_name, "DAL") == 0)
var.set(_dal);
else
if (strcmp(column_name, "AL") == 0)
var.set(_al);
else
if (strcmp(column_name, "STAMPAFASI") == 0)
var.set((_tipostampa == 1 || _tipostampa == 3) ? "X" : "");
else
if (strcmp(column_name, "FASESPEC") == 0)
{
if (_tipostampa == 1 || _tipostampa == 3 || _tipostampa == 4)
var.set(_fase);
else
var.set(EMPTY_STRING);
}
else
if (strcmp(column_name, "STAMPACDC") == 0)
var.set((_tipostampa == 2 || _tipostampa == 3) ? "X" : "");
else
if (strcmp(column_name, "CDCSPEC") == 0)
{
if (_tipostampa == 2 || _tipostampa == 3 || _tipostampa == 8)
var.set(_cdc);
else
var.set(EMPTY_STRING);
}
else
if (strcmp(column_name, "DATAINI") == 0)
{
const TString& codcms = get("CODCMS").as_string();
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
var.set(rec_commesse.get(COMMESSE_DATAINIZIO));
}
else
if (strcmp(column_name, "DATAFINE") == 0)
{
const TString& codcms = get("CODCMS").as_string();
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
TDate datafine = rec_commesse.get(COMMESSE_DATAPROR);
if (!datafine.ok())
datafine = rec_commesse.get(COMMESSE_DATAFINE);
var.set(datafine);
}
else
if (strcmp(column_name, "AVANZAMENTO") == 0)
{
//RICAVI
//------
//Calcola lo stato di avanzamento della commessa in caso di stima x Tempo
//In questo caso i ricavihanno una % di avanzamento legata alla durata della commessa (prorogata ecc.)..
//..rispetto al momento della stampa
real avanzamento;
if (_tipostima == 'T')
{
avanzamento = calcola_avanzamento_tempo();
}
else //se stima e' di tipo Costi/Ricavi invece....Allah!!
{
//In caso di stampa Ricavi nei casi _tipostime = 'C' o 'R', l'avanzamento è calcolato in base agli importi.
//Caso 'C': valore_preventivo / totale_preventivo
//Caso 'R': valore_consuntivo / totale_preventivo (!) richiesta specifica Adolfo-Enrichetta 24-03-2011
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
const real val = get("RICAVI").as_real();
if (!val.is_zero())
{
const int indice = get("LEVEL").as_int();
const TString& codcms = get("CODCMS").as_string();
TAssoc_array& riga_tot = get_row((TAssoc_array&)_totali[indice], codcms, indice, codcms, EMPTY_STRING, EMPTY_STRING,
"RICAVI");
const TString* stric = (const TString*)riga_tot.objptr("RICAVI");
if (stric && stric->full())
{
const real totric = *stric;
if (!totric.is_zero())
avanzamento = val * CENTO / totric;
}
}
}
if (avanzamento > CENTO)
avanzamento = CENTO;
var.set(avanzamento);
}
else //if(strcmp(column_name,AVANZAMENTO...
{
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
if (strncmp(column_name, "RECORD.", 7) == 0)
column_name += 7;
//COSTI
//-----
if (strcmp(column_name, "COS_PERC") == 0)
{
const int indice = get("LEVEL").as_int();
//la % dei costi, in caso si forzi il maturato (considerare finite le commesse che terminano nell'esercizio selezionato)..
//..viene posta artificialmente pari a 100% nelle sezioni delle commesse che terminano nell'esercizio selezionato (sez. 0 e 1)..
//..e nella sezione delle commesse di supporto (sez. 4). Richiesta Adolfica del 08/03/2011
if (_forza_maturato && (indice <= 1 || indice == 4))
var.set(CENTO);
else
{
const TString* val_bdg = (TString*)riga.objptr("COS_BDG");
if (val_bdg == NULL || real::is_null(*val_bdg))
var.set(CENTO);
else
{
const TString* val_mat = (TString*)riga.objptr("COS_MAT");
if (val_mat == NULL || real::is_null(*val_mat))
var.set(ZERO);
else
{
const real bdg(*val_bdg);
const real mat(*val_mat);
real perc = mat * CENTO / bdg;
perc.round(2);
if (perc > CENTO)
perc = CENTO;
var.set(perc);
}
}
}
}
else
{
const TString* val = (TString*)riga.objptr(column_name);
if (val)
var.set(*val);
else
var.set_null();
}
}
return var;
}
return NULL_VARIANT;
@ -1632,6 +1655,8 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_
{
_tipostima = msk.get(F_TIPOSTIMA)[0];
_vitaintera = msk.get_bool(F_VITAINTERA);
_dal = msk.get_date(F_INIZIO_ES);
_al = msk.get_date(F_FINE_ES);
_include_documenti = msk.get_bool(F_INCLUDE_DOCUMENTI);
_depth = msk.get_int(F_DEPTH);
_tipostampa = msk.get_int(F_TIPOSTAMPA);
@ -1662,8 +1687,30 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_
break;
}
} //if(tipo==8..
else
if (_tipo == 9)
{
_forza_maturato = msk.get_bool(F_FORZA_MATURATO);
_include_documenti = msk.get_bool(F_INCLUDE_DOCUMENTI);
_tipostampa = msk.get_int(F_TIPOSTAMPA);
//in base al tipo di stampa selezionata setta un po' di parametri
switch (_tipostampa)
{
case 1:
_fase = msk.get(F_FASE);
_cdc.cut(0);
break;
case 2:
_cdc = msk.get(F_CDC);
_fase.cut(0);
break;
case 3:
_fase = msk.get(F_FASE);
_cdc = msk.get(F_CDC);
break;
default:
break;
}
}
}

View File

@ -81,9 +81,13 @@ class TPrint_saldana_recordset : public TRecordset
bool _detrazioni_consuntive;
bool _include_documenti;
bool _forza_maturato;
bool _inevasi;
char _tipostima;
TDate _dal;
TDate _al;
protected:
virtual int tipo() const { return _tipo; }
@ -129,7 +133,9 @@ protected:
TAssoc_array& get_row(TAssoc_array& cms, const char* chiave,
const int indice, const TString& codcms, const TString& fase,
const TString& cdc, const TString& descrizione) const;
const TString& cdc, const TString& descrizione = EMPTY_STRING,
const TDate& inizio = NULLDATE, const TDate& fine = NULLDATE,
const TDate& proroga = NULLDATE) const;
public:
virtual void set_filter(const TMask& msk, const TString& curr_sublevel);

View File

@ -65,6 +65,39 @@ BEGIN
PROMPT 2 6 "Considerare finite le commesse che terminano nell'esercizio selezionato"
END
BOOLEAN F_INCLUDE_DOCUMENTI
BEGIN
PROMPT 2 7 "Includere documenti inevasi e/o non contabilizzati"
END
LISTBOX F_TIPOSTAMPA 1 20
BEGIN
PROMPT 2 8 "Stampa"
ITEM "0|Normale"
MESSAGE CLEAR,F_FASE|CLEAR,F_CDC
ITEM "1|Dett.per Fase"
MESSAGE ENABLE,F_FASE|CLEAR,F_CDC
ITEM "2|Dett-per CdC"
MESSAGE CLEAR,F_FASE|ENABLE,F_CDC
ITEM "3|Dett.per Fase e CdC"
MESSAGE ENABLE,F_FASE|ENABLE,F_CDC
END
STRING F_FASE 10
BEGIN
PROMPT 32 8 "Fase"
END
STRING F_CDC 20
BEGIN
PROMPT 56 8 "CdC"
USE LF_CDC
INPUT CODCOSTO F_CDC
DISPLAY "Codice centro di costo" CODCOSTO
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CDC CODCOSTO
END
GROUPBOX F_PRE0 76 5
BEGIN
PROMPT 0 12 "@bPrefisso del piano dei conti analitico:"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3900a" orientation="2" lpi="6" class="ca3900a">
<description>Stima ricavi di competenza CA</description>
<font face="Arial Narrow" size="8" />
<font face="Arial Narrow" size="7" />
<section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1">
@ -19,28 +19,97 @@
<field x="154" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source>
</field>
<field border="2" x="1" y="1.5" type="Linea" width="164" height="0" pattern="1" />
<field x="63.5" y="2" type="Testo" align="center" width="8" pattern="1" text="COSTI" />
<field x="107" y="2" type="Testo" align="center" width="20" pattern="1" text="RICAVI" />
<field x="152" y="2.25" type="Testo" align="right" width="8" pattern="1" text="Margine" />
<field x="51" y="3" type="Testo" align="right" width="8" pattern="1" text="Budget" />
<field x="61" y="3" type="Testo" align="right" width="12" pattern="1" text="Maturati" />
<field x="75" y="3" type="Testo" align="right" width="12" pattern="1" text="Avanzamento" />
<field x="88" y="3" type="Testo" align="right" width="12" pattern="1" text="Budget" />
<field x="102" y="3" type="Testo" align="right" width="12" pattern="1" text="Competenza" />
<field x="116" y="3" type="Testo" align="right" width="12" pattern="1" text="Accertato" />
<field x="130" y="3" type="Testo" align="right" width="12" pattern="1" text="Integrazione" />
<field x="150" y="3" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " />
<field border="1" x="1" y="4" type="Linea" width="164" height="0" pattern="1" />
<field border="2" x="1" y="1.5" type="Linea" width="174" height="0" pattern="1" />
<field x="1" y="1.75" type="Testo" width="12" pattern="1" text="Include inevasi">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="13.5" y="1.75" type="Stringa" width="3" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>INCLUDE_DOCUMENTI</source>
</field>
<field x="19" y="1.75" type="Testo" width="15" pattern="1" text="Fase specificata">
<font italic="1" face="Arial Narrow" size="9" />
<prescript description="H0.0 PRESCRIPT">#FASESPEC @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="34" y="1.75" type="Stringa" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>FASESPEC</source>
<prescript description="H0.0 PRESCRIPT">#FASESPEC @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="43" y="1.75" type="Testo" width="15" pattern="1" text="CdC specificato">
<font italic="1" face="Arial Narrow" size="9" />
<prescript description="H0.0 PRESCRIPT">#CDCSPEC @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="55" y="1.75" type="Stringa" width="20" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>CDCSPEC</source>
<prescript description="H0.0 PRESCRIPT">#CDCSPEC @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="78.5" y="2" type="Testo" align="center" width="8" pattern="1" text="COSTI" />
<field x="119" y="2" type="Testo" align="center" width="20" pattern="1" text="RICAVI" />
<field x="164" y="2.25" type="Testo" align="right" width="8" pattern="1" text="Margine" />
<field x="43" y="3" type="Testo" width="8" pattern="1" text="Inizio" />
<field x="51" y="3" type="Testo" width="8" pattern="1" text="Fine" />
<field x="64" y="3" type="Testo" align="right" width="8" pattern="1" text="Budget" />
<field x="73" y="3" type="Testo" align="right" width="12" pattern="1" text="Maturati" />
<field x="87" y="3" type="Testo" align="right" width="12" pattern="1" text="Avanzamento" />
<field x="100" y="3" type="Testo" align="right" width="12" pattern="1" text="Budget" />
<field x="113" y="3" type="Testo" align="right" width="12" pattern="1" text="Competenza" />
<field x="127" y="3" type="Testo" align="right" width="12" pattern="1" text="Accertato" />
<field x="140" y="3" type="Testo" align="right" width="12" pattern="1" text="Integrazione" />
<field x="160" y="3" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " />
<field border="1" x="1" y="5" type="Linea" width="174" height="0" pattern="1" />
<field x="1" y="4" type="Testo" align="center" width="6" id="5" pattern="1" text="Fase">
<prescript description="H0.5 PRESCRIPT">#STAMPAFASI @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="10" y="4" type="Testo" align="center" width="3" id="6" pattern="1" text="CdC">
<prescript description="H0.6 PRESCRIPT">#STAMPACDC @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="1" y="3" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
</section>
<section type="Head" level="1" height="4" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1
</prescript>
<field border="1" radius="100" x="2" type="Testo" valign="center" align="center" shade_offset="25" width="162" height="2.5" pattern="2" text="STIMA RICAVI DI COMPETENZA">
<field border="1" radius="100" x="2" type="Testo" valign="center" align="center" shade_offset="25" width="172" height="2.5" pattern="2" 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="164" height="0" pattern="1" />
<field border="2" x="1" y="3.5" type="Linea" width="174" height="0" pattern="1" />
<field x="0.96" y="3" type="Numero" hidden="1" align="right" width="4" id="2" pattern="1">
<source>ANNO</source>
</field>
@ -50,7 +119,7 @@
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2
</prescript>
<field border="1" x="1" y="1.25" type="Linea" width="164" height="0" pattern="1" />
<field border="1" x="1" y="1.25" type="Linea" width="174" height="0" pattern="1" />
<field type="Numero" hidden="1" align="right" width="1" id="97" pattern="1">
<source>LEVEL</source>
<postscript description="H2.97 POSTSCRIPT">MESSAGE COPY,F2.97</postscript>
@ -73,7 +142,7 @@
<groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="H3 PRESCRIPT">MESSAGE RESET,F3</prescript>
<field border="1" x="2" y="1.25" type="Linea" width="164" height="0" pattern="1" />
<field border="1" x="2" y="1.25" type="Linea" width="174" height="0" pattern="1" />
<field type="Numero" hidden="1" align="right" width="1" id="97" pattern="1">
<source>LEVEL</source>
<postscript description="H3.97 POSTSCRIPT">MESSAGE COPY,F3.97</postscript>
@ -94,28 +163,54 @@
<field x="1" type="Stringa" width="17" pattern="1">
<source>CODCMS</source>
</field>
<field x="18" type="Stringa" width="27" pattern="1">
<field x="43" type="Stringa" width="8" pattern="1">
<source>DATAINI</source>
</field>
<field x="51" type="Stringa" width="8" pattern="1">
<source>DATAFINE</source>
</field>
<field x="95.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="173.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="18" type="Stringa" dynamic_height="1" width="25" height="2" id="2" pattern="1">
<font face="Arial Narrow" size="7" />
<source>DESCRIZ</source>
</field>
<field x="83" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="164" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="45" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
<field x="1" y="1" type="Stringa" width="9" id="5" pattern="1">
<source>FASE</source>
<prescript description="B1.5 PRESCRIPT">#STAMPAFASI @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="10" y="1" type="Stringa" width="8" id="6" pattern="1">
<source>CDC</source>
<prescript description="B1.6 PRESCRIPT">#STAMPACDC @
EMPTY= IF
#THIS HIDE
ELSE
#THIS SHOW
THEN
</prescript>
</field>
<field x="59" 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="59" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
<field x="72.5" 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="77" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<field x="89.5" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<source>#COS_PERC</source>
</field>
<field x="86" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@">
<field x="97.5" 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="100" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
<field x="111.5" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
<prescript description="B1.105 PRESCRIPT">#103 @
#104 @
*
@ -124,18 +219,18 @@
#THIS !</prescript>
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F3.105</postscript>
</field>
<field x="114" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@">
<field x="125" 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="128" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
<field x="138.5" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
<prescript description="B1.107 PRESCRIPT">#105 @
#106 @
-
#THIS !</prescript>
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F3.107</postscript>
</field>
<field x="144" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
<field x="153.5" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
<prescript description="B1.108 PRESCRIPT">#105 @
#102 @
-
@ -143,7 +238,7 @@
</prescript>
<postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F3.108</postscript>
</field>
<field x="159" type="Numero" align="right" width="5" id="109" pattern="1" text="##@,@@">
<field x="168.5" type="Numero" align="right" width="5" id="109" pattern="1" text="##@,@@">
<font italic="1" face="Arial Narrow" size="8" />
<prescript description="B1.109 PRESCRIPT">#105 @
0
@ -163,7 +258,7 @@ THEN
</field>
</section>
<section type="Foot" pattern="1">
<field border="1" x="1" y="0.25" type="Linea" width="164" height="0" pattern="1" />
<field border="1" x="1" y="0.25" type="Linea" width="174" height="0" pattern="1" />
<field x="2" y="0.5" type="Testo" width="20" pattern="1" text="Stima ricavi di competenza">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
</field>
@ -174,13 +269,13 @@ THEN
</section>
<section type="Foot" level="1" height="3" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field border="2" x="1" y="0.75" type="Linea" width="164" height="0" pattern="1" />
<field border="2" x="1" y="0.75" type="Linea" width="174" height="0" pattern="1" />
<field x="1" y="1.5" type="Testo" fg_color="#FFFFFF" bg_color="#000000" width="25" height="1.5" pattern="2" text="TOTALI GENERALI " />
<field x="83" y="1.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="164" y="1.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="45" y="1.5" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@" />
<field x="59" y="1.5" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@" />
<field x="77" y="1.5" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<field x="95.5" y="1.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="173" y="1.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="58.5" y="1.5" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@" />
<field x="72.5" y="1.5" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@" />
<field x="89.5" y="1.5" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<prescript description="F1.103 PRESCRIPT">#101 @
0 = IF
100
@ -197,12 +292,12 @@ ELSE
THEN
#THIS !</prescript>
</field>
<field x="86" y="1.5" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@" />
<field x="100" y="1.5" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@" />
<field x="114" y="1.5" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@" />
<field x="128" y="1.5" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@" />
<field x="144.5" y="1.5" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@" />
<field x="159" y="1.5" type="Numero" align="right" width="5" id="109" pattern="1">
<field x="98" y="1.5" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@" />
<field x="112" y="1.5" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@" />
<field x="126" y="1.5" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@" />
<field x="140" y="1.5" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@" />
<field x="154.5" y="1.5" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@" />
<field x="168.5" y="1.5" type="Numero" align="right" width="5" id="109" pattern="1">
<prescript description="F1.109 PRESCRIPT">#105 @
0
=
@ -222,11 +317,11 @@ THEN
</section>
<section type="Foot" level="2" height="2.5" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" />
<field border="1" x="1" y="0.5" type="Linea" width="164" height="0" pattern="1" />
<field x="83" y="1" type="Testo" align="center" width="2" pattern="1" text="%">
<field border="1" x="1" y="0.5" type="Linea" width="174" height="0" pattern="1" />
<field x="95" y="1" type="Testo" align="center" width="2" pattern="1" text="%">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
</field>
<field x="164" y="1" type="Testo" align="center" width="2" pattern="1" text="%">
<field x="173.5" y="1" type="Testo" align="center" width="2" pattern="1" text="%">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
</field>
<field y="1" type="Numero" hidden="1" align="right" width="1" id="97" pattern="1" />
@ -245,15 +340,15 @@ THEN
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<source>H2.99</source>
</field>
<field x="45" y="1" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
<field x="58.5" 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="59" y="1" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
<field x="72.5" 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="77" y="1" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<field x="89" y="1" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="F2.103 PRESCRIPT">#101 @
0 = IF
@ -271,27 +366,27 @@ ELSE
THEN
#THIS !</prescript>
</field>
<field x="86" y="1" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@">
<field x="97.5" 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="100" y="1" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
<field x="111.5" 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="114" y="1" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@">
<field x="125.5" 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="128" y="1" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
<field x="139" 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="144" y="1" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
<field x="154" 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>
<field x="159" y="1" type="Numero" align="right" width="5" id="109" pattern="1">
<field x="168.5" y="1" type="Numero" align="right" width="5" id="109" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="F2.109 PRESCRIPT">#105 @
0
@ -312,9 +407,9 @@ THEN
</section>
<section type="Foot" level="3" height="2" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" />
<field border="1" x="2" y="0.25" type="Linea" width="164" height="0" pattern="1" />
<field x="83" y="0.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="164" y="0.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field border="1" x="2" y="0.25" type="Linea" width="174" height="0" pattern="1" />
<field x="95.5" y="0.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field x="173.5" y="0.5" type="Testo" align="center" width="2" pattern="1" text="%" />
<field y="0.5" type="Numero" hidden="1" align="right" width="1" id="97" pattern="1" />
<field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" id="98" pattern="1">
<source>H3.98</source>
@ -326,14 +421,14 @@ THEN
<li Value="TOTALI Commesse di supporto" Code="4" />
</list>
</field>
<field x="45" y="0.5" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@">
<field x="58.5" 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="59" y="0.5" type="Valuta" align="right" width="14" id="102" pattern="1" text="###.###.###,@@">
<field x="72.5" 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="77" y="0.5" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<field x="89.5" y="0.5" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<prescript description="F3.103 PRESCRIPT">#101 @
0 = IF
100
@ -350,22 +445,22 @@ ELSE
THEN
#THIS !</prescript>
</field>
<field x="86" y="0.5" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@">
<field x="97.5" 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="100" y="0.5" type="Valuta" align="right" width="14" id="105" pattern="1" text="###.###.###,@@">
<field x="111.5" 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="114" y="0.5" type="Valuta" align="right" width="14" id="106" pattern="1" text="###.###.###,@@">
<field x="125.5" 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="128" y="0.5" type="Valuta" align="right" width="14" id="107" pattern="1" text="###.###.###,@@">
<field x="139" 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="144" y="0.5" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
<field x="154" y="0.5" type="Valuta" align="right" width="14" id="108" pattern="1" text="###.###.###,@@">
<postscript description="F3.108 POSTSCRIPT">MESSAGE ADD,F2.108</postscript>
</field>
<field x="159" y="0.5" type="Numero" align="right" width="5" id="109" pattern="1">
<field x="168.5" y="0.5" type="Numero" align="right" width="5" id="109" pattern="1">
<prescript description="F3.109 PRESCRIPT">#105 @
0
=
@ -384,4 +479,4 @@ THEN
</field>
</section>
<sql>USE SALDANA</sql>
</report>
</report>

View File

@ -693,7 +693,7 @@ void ca_create_browse1(TEdit_field& kfld, int level, int logic, short key_id, sh
const TFieldref& field = mci.fieldref(i);
const int length = field.to() - field.from();
out << "IN " << field << ' ' << (key_id+i);
if (add_select && field.name() == FASI_CODCMSFAS)
if ((add_select && field.name() == FASI_CODCMSFAS) || i < level)
out << " SE";
out << '\n';
out << "DI \"" << prompt;
@ -794,7 +794,7 @@ void ca_create_browse2(TEdit_field& kfld, int level, int logic, short key_id)
}
int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y,
short key_id, short des_id, unsigned int mode, const char* fieldname, int from )
short key_id, short des_id, unsigned int mode, const char* fieldname, int from, bool desc_in_sh )
{
TWait_cursor hourglass;
const TMultilevel_code_info& mci = ca_multilevel_code_info(logicnum);
@ -831,7 +831,7 @@ int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y,
kfld = &msk.add_number(kid, page, prompt, tab0, y+i, picture.len(), flags);
else
kfld = &msk.add_string(kid, page, prompt, tab0, y+i, picture.len(), flags);
ca_create_browse1(*kfld, i, logicnum, key_id, des_id);
ca_create_browse1(*kfld, i, logicnum, key_id, desc_in_sh && (i == mci.levels() - 1) ? key_id + mci.levels() - i : des_id);
if ((mode & 0x1) != 0 && fieldname == NULL)
kfld->set_key(1);
@ -858,7 +858,7 @@ int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y,
{
for (int i = 0; i < mci.levels(); i++)
{
const short did = des_id+i;
const short did = desc_in_sh && (i == mci.levels() - 1) ? key_id+mci.levels() : des_id+i;
TEdit_field& dfld = msk.add_string(did, page, "", tab1, y+i, 50, "B", 72+tab0-tab1);
ca_create_browse2(dfld, i, logicnum, key_id);
if ((mode & 0x2) != 0 && fieldname == NULL)
@ -1025,7 +1025,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
{
const TString& level = ini.get("Level", NULL, i+1); // Legge il livello 1 o 2
if (level == "CDC" && cdc_fld) // Crea centro di costo
if (level == "CDC" && cdc_fld && *cdc_fld) // Crea centro di costo
{
if (fasinfo.parent() == LF_CDC)
{
@ -1045,7 +1045,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
numero_campi += sh;
}
} else
if (level == "CMS" && cms_fld) // Crea commessa
if (level == "CMS" && cms_fld && *cms_fld) // Crea commessa
{
const int h = ca_multilevel_code_info(LF_COMMESSE).levels();
int sh = 0;
@ -1088,7 +1088,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
}
}
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0 && fase_fld) //Crea fase
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0 && fase_fld && *fase_fld) //Crea fase
{
const int sh = ca_create_fields_compact(m, 0, LF_FASI, x, y++, dlg, dlg + 50);
first_fase = dlg;
@ -1096,7 +1096,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
numero_campi += sh;
}
if (conto_fld) //Crea conto
if (conto_fld && *conto_fld) //Crea conto
{
const bool use_pdcc = ini.get_bool("UsePdcc");
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
@ -1296,7 +1296,7 @@ void ca_put_row_fields(TSheet_field& sheet, const int selected_row,
for (short id = first_fase; id < first_fase + 4; id++)
{
const TMask_field& fld = m.field(id);
if (fld.prompt() != fase_fld)
if(fld.prompt() != fase_fld)
break;
const int len = fld.size();
row.add(cdc.mid(pos, len), sheet.cid2index(id));
@ -1434,6 +1434,19 @@ bool TSimple_anal_msk::test_key_field(short id)
return ca_test_multilevel_field(fld, level);
}
const char * TSimple_anal_msk::get_curr_key() const
{
const TTree_field& fld = tfield(F_TREE);
const TTree& tree = *fld.tree();
TToken_string & curr = get_tmp_string(100);
tree.curr_id(curr);
curr.destroy(1);
curr.destroy(0);
return curr;
}
bool TSimple_anal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
@ -2080,7 +2093,9 @@ bool TAnal_app::user_create()
void TAnal_app::init_query_mode(TMask& mask)
{
TSimple_anal_msk& m = (TSimple_anal_msk&)mask;
for (int i = 0; ; i++)
int i;
for (i = 0; ; i++)
{
const short id = m.get_field_id(i, 1);
if (id <= 0 || m.id2pos(id) < 0)
@ -2095,6 +2110,16 @@ void TAnal_app::init_query_mode(TMask& mask)
d.enable_check();
d.set_field("");
}
TToken_string keys(m.get_curr_key());
for (int j = 0 ; j < i - 1; j++)
{
const short id = m.get_field_id(j, 1);
TEdit_field& e = m.efield(id);
e.set(keys.get(j));
}
m.first_focus(m.get_field_id(0, 1));
}
@ -2110,14 +2135,23 @@ void TAnal_app::init_insert_mode(TMask& mask)
int TAnal_app::write(const TMask& m)
{
const int err = TRelation_application::write(m);
_msk->update_tree_field();
return TRelation_application::write(m);
return err;
}
int TAnal_app::rewrite(const TMask& m)
{
const int err = TRelation_application::rewrite(m);
_msk->update_tree_field();
return TRelation_application::rewrite(m);
return err;
}
bool TAnal_app::remove()
{
bool ok = TRelation_application::remove();
_msk->update_tree_field();
return ok;
}
bool TAnal_app::user_destroy()
@ -3329,4 +3363,14 @@ long ca_durata_commessa(const TRectype& rec_commesse, TDate& dataini, TDate& dat
return datafine - dataini + 1;
}
bool ca_commessa_attiva(const TRectype& rec_commesse, const TDate & from, const TDate & to)
{
bool attiva = true;
TDate inizio;
TDate fine;
ca_durata_commessa(rec_commesse, inizio, fine);
attiva = (!from.ok() || (fine.year() >= from.year()) && (!to.ok() || (inizio.year() <= to.year())));
return attiva;
}

View File

@ -83,12 +83,12 @@ bool ca_filter_record(const TRectype& rec);
bool ca_filter_function(const TRelation* rel);
int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y, short key_id, short des_id,
unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0);
unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0, bool desc_in_sh = false);
int ca_create_fields_compact(TMask& msk, int page, int logicnum, int x, int y,
short key_id, short des_id, unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0);
//CA_CREATE_FIELDS_EXT: crea tutti i campi dell'analitica desiderati in base alla configurazione del modulo
int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
//CA_CREATE_FIELDS_EXT: crea tutti i campi dell'analitica desiderati in base alla configurazione della contabilità analitica
int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
short& first_cdc, short& first_cms, short& first_fase, short& first_conto,
const char* cdc_fld = NULL, const char* cms_fld = NULL, const char* fase_fld = NULL, const char* conto_fld = NULL);
@ -143,6 +143,7 @@ public:
virtual const TToken_string& get_key_value(const TRectype& rec, int k = 1) const;
virtual const TToken_string& get_key_value(int k = 1) const;
virtual const char * get_curr_key() const ;
};
///////////////////////////////////////////////////////////
@ -161,7 +162,10 @@ protected:
virtual bool user_destroy();
virtual int write(const TMask& m);
virtual int rewrite(const TMask& m);
virtual bool remove();
void init_key_fields(TSimple_anal_msk & m) const;
virtual void init_query_insert_mode(TMask& mask) { return init_query_mode(mask);}
virtual void init_query_mode(TMask& mask);
virtual void init_modify_mode(TMask& mask);
virtual void init_insert_mode(TMask& mask);
@ -283,5 +287,6 @@ bool ca_extract_sheet_field(const TSheet_field& sheet, const int row, const int
//metodo per ricavare la durata di una commessa
long ca_durata_commessa(const TRectype& rec_commesse, TDate& dataini, TDate& datafine);
bool ca_commessa_attiva(const TRectype& rec_commesse, const TDate & from, const TDate & to);
#endif

View File

@ -21,9 +21,26 @@ void TSaldanal::copy(const TSaldanal& sa)
_dare = sa._dare;
_avere = sa._avere;
_fin = sa._fin;
_iniind = sa._iniind;
_dareind = sa._dareind;
_avereind = sa._avereind;
_finind = sa._finind;
_movimentato = sa._movimentato;
}
const TSaldanal& TSaldanal::operator+=(const TSaldanal& sa)
{
_ini += sa._ini,
_dare += sa._dare;
_avere += sa._avere;
_fin += sa._fin;
_iniind += sa._iniind;
_dareind += sa._dareind;
_avereind += sa._avereind;
_finind += sa._finind;
_movimentato |= sa._movimentato;
return *this;
}
///////////////////////////////////////////////////////////
// TPconana_recordset
///////////////////////////////////////////////////////////
@ -771,16 +788,16 @@ bool TSaldi_cache::int_saldo_annuale(const TAnal_bill& b, int da_anno, int ad_an
TString query, select;
if (b.costo().full())
select << "(COSTO=='" << b.costo() << "')";
select << "(COSTO=='" << (b.costo() == "~" ? "" : b.costo()) << "')";
if (b.commessa().full())
{
if (select.full()) select << "&&";
select << "(COMMESSA=='" << b.commessa() << "')";
select << "(COMMESSA=='" << (b.commessa() == "~" ? "" : b.commessa()) << "')";
}
if (b.fase().full())
{
if (select.full()) select << "&&";
select << "(FASE=='" << b.fase() << "')";
select << "(FASE=='" << (b.fase() == "~" ? "" : b.fase()) << "')";
}
if (da_anno > 0)
{
@ -903,19 +920,19 @@ bool TSaldi_cache::int_saldo_movimenti(const TAnal_bill& b,
{
if (select.full())
select << "&&";
select << "(CODCCOSTO==\"" << b.costo() << "\")";
select << "(CODCCOSTO==\"" << (b.costo() == "~" ? "" : b.costo()) << "\")";
}
if (b.commessa().full())
{
if (select.full())
select << "&&";
select << "(CODCMS==\"" << b.commessa() << "\")";
select << "(CODCMS==\"" << (b.commessa() == "~" ? "" : b.commessa()) << "\")";
}
if (b.fase().full())
{
if (select.full())
select << "&&";
select << "(CODFASE==\"" << b.fase() << "\")";
select << "(CODFASE==\"" << (b.fase() == "~" ? "" : b.fase()) << "\")";
}
//se il conto dovesse essere vuoto (dio ce ne scampi, ma qualche utonto lo ha fatto nelle tabelle di ripartizione!)..
//..l'eventuale filtro sulle date va fatto nella SELECT

View File

@ -82,12 +82,12 @@ protected:
public:
TObject* dup() const { return new TSaldanal(*this); }
const TSaldanal& operator=(const TSaldanal& sa) { copy(sa); return *this; }
const TSaldanal& operator+=(const TSaldanal& sa);
TSaldanal() : _movimentato(false) { }
TSaldanal(const TSaldanal& sa) { copy(sa); }
};
///////////////////////////////////////////////////////
// Metodi sciolti ma decisivi
///////////////////////////////////////////////////////