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 // gestione files Contabilita' Analitica: COMMESSE
#include <execp.h> #include <execp.h>
#include <recset.h> #include <recset.h>
#include <relapp.h> #include <relapp.h>
#include "calib01.h" #include "calib01.h"
#include "ca0600a.h" #include "ca0600a.h"
#include "commesse.h" #include "commesse.h"
#include "cfcms.h" #include "cfcms.h"
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//MASCHERA //MASCHERA
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
class TCms_anal_msk : public TSimple_anal_msk class TCms_anal_msk : public TSimple_anal_msk
{ {
protected: protected:
virtual int get_logicnum() const { return LF_COMMESSE; } virtual int get_logicnum() const { return LF_COMMESSE; }
public: public:
TCms_anal_msk(); TCms_anal_msk();
}; };
TCms_anal_msk::TCms_anal_msk() TCms_anal_msk::TCms_anal_msk()
{ {
read("ca0600a"); read("ca0600a");
ca_create_fields(*this, 2, LF_CDC, 1, 1, F_CMS_CDC1, F_CMS_CDCDES1, 0x0, COMMESSE_CODCOSTO); 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 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); 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; int from = 1;
for (int i = 0; i < nfields; i++) for (int i = 0; i < nfields; i++)
{ {
TEdit_field & e = efield(F_CMSPDA1 + i); TEdit_field & e = efield(F_CMSPDA1 + i);
e.check_type(CHECK_NORMAL); e.check_type(CHECK_NORMAL);
TFieldref * fr = (TFieldref *) e.field(); TFieldref * fr = (TFieldref *) e.field();
if (fr != NULL) if (fr != NULL)
{ {
fr->set_from(from); fr->set_from(from);
if (i < 2) if (i < 2)
from += 3; from += 3;
else else
from += 6; from += 6;
fr->set_to(from - 1); fr->set_to(from - 1);
} }
} }
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//APPLICAZIONE //APPLICAZIONE
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// applicazione per la gestione delle commesse // applicazione per la gestione delle commesse
class TCms_app : public TAnal_app class TCms_app : public TAnal_app
{ {
int _maxlev; int _maxlev;
bool _has_filter; bool _has_filter;
protected: protected:
void fin2row(const TMask& m); void fin2row(const TMask& m);
void for2row(const TMask& m); void for2row(const TMask& m);
void row2fin(const TMask& m); void row2fin(const TMask& m);
void row2for(const TMask& m); void row2for(const TMask& m);
virtual int read(TMask& m); virtual int read(TMask& m);
virtual int write(const TMask& m); virtual int write(const TMask& m);
virtual int rewrite(const TMask& m); virtual int rewrite(const TMask& m);
virtual bool remove(); virtual bool remove();
virtual void ini2mask(TConfig& ini, TMask&m, bool query); virtual void ini2mask(TConfig& ini, TMask&m, bool query);
virtual void mask2ini(const TMask& m, TConfig& ini); virtual void mask2ini(const TMask& m, TConfig& ini);
virtual bool filtered() const; 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 void init_modify_mode(TMask& mask);
virtual bool protected_record(TRectype& record); virtual void init_insert_mode(TMask& mask);
virtual TSimple_anal_msk* create_mask() const { return new TCms_anal_msk; } virtual bool protected_record(TRectype& record);
virtual bool user_create(); virtual TSimple_anal_msk* create_mask() const { return new TCms_anal_msk; }
}; virtual bool user_create();
void TCms_app::fin2row(const TMask& m) public:
{
const TRelation * r = get_relation(); TCms_app() {}
TToken_string key; };
key.add(r->curr().get(COMMESSE_CODCMS)); void TCms_app::fin2row(const TMask& m)
key.add("C"); {
const TRelation * r = get_relation();
TRecord_array fins(key, LF_CFCMS); TToken_string key;
const int items = fins.rows();
TSheet_field & s = m.sfield(F_CMS_FINAN); key.add(r->curr().get(COMMESSE_CODCMS));
key.add("C");
s.destroy();
for (int i = 1; i <= items; i++) TRecord_array fins(key, LF_CFCMS);
{ const int items = fins.rows();
const TRectype & rec = fins[i]; TSheet_field & s = m.sfield(F_CMS_FINAN);
TToken_string & str = s.row(i - 1);
s.destroy();
for (int i = 1; i <= items; i++)
str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFIN)); {
str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFIN)); const TRectype & rec = fins[i];
str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFIN)); TToken_string & str = s.row(i - 1);
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)); str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFIN));
s.check_row(i - 1); str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFIN));
} str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFIN));
s.force_update(); 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));
void TCms_app::for2row(const TMask& m) s.check_row(i - 1);
{ }
const TRelation * r = get_relation(); s.force_update();
TToken_string key; }
key.add(r->curr().get(COMMESSE_CODCMS)); void TCms_app::for2row(const TMask& m)
key.add("F"); {
const TRelation * r = get_relation();
TRecord_array fors(key, LF_CFCMS); TToken_string key;
const int items = fors.rows();
TSheet_field & s = m.sfield(F_CMS_FORN); key.add(r->curr().get(COMMESSE_CODCMS));
key.add("F");
s.destroy();
for (int i = 1; i <= items; i++) TRecord_array fors(key, LF_CFCMS);
{ const int items = fors.rows();
const TRectype & rec = fors[i]; TSheet_field & s = m.sfield(F_CMS_FORN);
TToken_string & str = s.row(i - 1);
s.destroy();
str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFOR)); for (int i = 1; i <= items; i++)
str.add(rec.get(CFCMS_NRIGABAN), s.cid2index(F_CMS_NRIGABANFOR)); {
str.add(rec.get(CFCMS_CUP), s.cid2index(F_CMS_CUPFOR)); const TRectype & rec = fors[i];
str.add(rec.get(CFCMS_CIG), s.cid2index(F_CMS_CUPFOR)); TToken_string & str = s.row(i - 1);
s.check_row(i - 1);
} str.add(rec.get(CFCMS_CODCF), s.cid2index(F_CMS_CODFOR));
s.force_update(); 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));
int TCms_app::read(TMask& m) s.check_row(i - 1);
{ }
int err = TAnal_app::read(m); s.force_update();
}
if (err == NOERR)
{ int TCms_app::read(TMask& m)
fin2row(m); {
for2row(m); int err = TAnal_app::read(m);
}
return err; if (err == NOERR)
} {
fin2row(m);
void TCms_app::row2fin(const TMask& m) for2row(m);
{ }
TRelation * r = get_relation(); return err;
TToken_string key; }
key.add(r->lfile().get(COMMESSE_CODCMS)); void TCms_app::row2fin(const TMask& m)
key.add("C"); {
TRelation * r = get_relation();
TRecord_array fins(key, LF_CFCMS); TToken_string key;
TSheet_field & s = m.sfield(F_CMS_FINAN);
const int items = s.items(); key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("C");
fins.destroy_rows();
for (int i = 0; i < items; i++) TRecord_array fins(key, LF_CFCMS);
{ TSheet_field & s = m.sfield(F_CMS_FINAN);
TRectype & rec = fins.row(i + 1, true); const int items = s.items();
TToken_string & str = s.row(i);
fins.destroy_rows();
rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFIN))); for (int i = 0; i < items; i++)
rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFIN))); {
rec.put(CFCMS_CUP, str.get(s.cid2index(F_CMS_CUPFIN))); TRectype & rec = fins.row(i + 1, true);
rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFIN))); TToken_string & str = s.row(i);
rec.put(CFCMS_PERCFIN, str.get(s.cid2index(F_CMS_PERCFINFIN)));
rec.put(CFCMS_DESCR, str.get(s.cid2index(F_CMS_DESCRFIN))); rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFIN)));
} rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFIN)));
fins.write(true); 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)));
void TCms_app::row2for(const TMask& m) rec.put(CFCMS_DESCR, str.get(s.cid2index(F_CMS_DESCRFIN)));
{ }
TRelation * r = get_relation(); fins.write(true);
TToken_string key; }
key.add(r->lfile().get(COMMESSE_CODCMS)); void TCms_app::row2for(const TMask& m)
key.add("F"); {
TRelation * r = get_relation();
TRecord_array fors(key, LF_CFCMS); TToken_string key;
TSheet_field & s = m.sfield(F_CMS_FORN);
const int items = s.items(); key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("F");
fors.destroy_rows();
for (int i = 0; i < items; i++) TRecord_array fors(key, LF_CFCMS);
{ TSheet_field & s = m.sfield(F_CMS_FORN);
TRectype & rec = fors.row(i + 1, true); const int items = s.items();
TToken_string & str = s.row(i);
fors.destroy_rows();
rec.put(CFCMS_CODCF, str.get(s.cid2index(F_CMS_CODFOR))); for (int i = 0; i < items; i++)
rec.put(CFCMS_NRIGABAN, str.get(s.cid2index(F_CMS_NRIGABANFOR))); {
rec.put(CFCMS_CUP, str.get(s.cid2index(F_CMS_CUPFOR))); TRectype & rec = fors.row(i + 1, true);
rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFOR))); TToken_string & str = s.row(i);
}
fors.write(true); 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)));
int TCms_app::write(const TMask& m) rec.put(CFCMS_CIG, str.get(s.cid2index(F_CMS_CIGFOR)));
{ }
TRelation * r = get_relation(); fors.write(true);
}
m.autosave(*r);
int err = TAnal_app::write(m); int TCms_app::write(const TMask& m)
if (err == NOERR) {
{ TRelation * r = get_relation();
row2fin(m);
row2for(m); m.autosave(*r);
} int err = TAnal_app::write(m);
return err; if (err == NOERR)
} {
row2fin(m);
int TCms_app::rewrite(const TMask& m) row2for(m);
{ }
TRelation * r = get_relation(); return err;
}
m.autosave(*r);
int err = TAnal_app::rewrite(m); int TCms_app::rewrite(const TMask& m)
if (err == NOERR) {
{ TRelation * r = get_relation();
row2fin(m);
row2for(m); m.autosave(*r);
} int err = TAnal_app::rewrite(m);
return err; if (err == NOERR)
} {
row2fin(m);
bool TCms_app::remove() row2for(m);
{ }
int err = TAnal_app::remove(); return err;
if (err == NOERR) }
{
TRelation * r = get_relation(); bool TCms_app::remove()
TToken_string key; {
int err = TAnal_app::remove();
key.add(r->lfile().get(COMMESSE_CODCMS)); if (err == NOERR)
key.add("C"); {
TRelation * r = get_relation();
TRecord_array fins(key, LF_CFCMS); TToken_string key;
err = fins.remove(); key.add(r->lfile().get(COMMESSE_CODCMS));
if (err == NOERR) key.add("C");
{
key.cut(0); TRecord_array fins(key, LF_CFCMS);
key.add(r->lfile().get(COMMESSE_CODCMS));
key.add("F"); err = fins.remove();
if (err == NOERR)
TRecord_array fors(key, LF_CFCMS); {
err = fors.remove(); key.cut(0);
} key.add(r->lfile().get(COMMESSE_CODCMS));
} key.add("F");
return err == NOERR;
} TRecord_array fors(key, LF_CFCMS);
err = fors.remove();
void TCms_app::ini2mask(TConfig& ini, TMask& m, bool query) }
{ }
TString p; return err == NOERR;
const TRelation * r = get_relation(); }
TAnal_app::ini2mask(ini, m, query); void TCms_app::ini2mask(TConfig& ini, TMask& m, bool query)
{
if (!query) TString p;
{ const TRelation * r = get_relation();
int i;
p << LF_CFCMS << ",C"; TAnal_app::ini2mask(ini, m, query);
TSheet_field & si = m.sfield(F_CMS_FINAN);
if (!query)
for (i = 0; ; i++) {
{ int i;
TString para(p); para << "," << i + 1; p << LF_CFCMS << ",C";
const long codcf = ini.get_long(CFCMS_CODCF, para); TSheet_field & si = m.sfield(F_CMS_FINAN);
if (codcf == 0L)
break; for (i = 0; ; i++)
TToken_string & row = si.row(i); {
TString para(p); para << "," << i + 1;
row.add(codcf, si.cid2index(F_CMS_CODFIN)); const long codcf = ini.get_long(CFCMS_CODCF, para);
row.add(ini.get(CFCMS_NRIGABAN, para), si.cid2index(F_CMS_NRIGABANFIN)); if (codcf == 0L)
row.add(ini.get(CFCMS_CUP, para), si.cid2index(F_CMS_CUPFIN)); break;
row.add(ini.get(CFCMS_CIG, para), si.cid2index(F_CMS_CIGFIN)); TToken_string & row = si.row(i);
row.add(ini.get(CFCMS_PERCFIN, para), si.cid2index(F_CMS_PERCFINFIN));
row.add(ini.get(CFCMS_DESCR, para), si.cid2index(F_CMS_DESCRFIN)); row.add(codcf, si.cid2index(F_CMS_CODFIN));
si.update_mask(i - 1); row.add(ini.get(CFCMS_NRIGABAN, para), si.cid2index(F_CMS_NRIGABANFIN));
} row.add(ini.get(CFCMS_CUP, para), si.cid2index(F_CMS_CUPFIN));
si.force_update(); row.add(ini.get(CFCMS_CIG, para), si.cid2index(F_CMS_CIGFIN));
row.add(ini.get(CFCMS_PERCFIN, para), si.cid2index(F_CMS_PERCFINFIN));
p.cut(0); row.add(ini.get(CFCMS_DESCR, para), si.cid2index(F_CMS_DESCRFIN));
p << LF_CFCMS << ",F"; si.update_mask(i - 1);
}
TSheet_field & so = m.sfield(F_CMS_FORN); si.force_update();
for (i = 0; ; i++) p.cut(0);
{ p << LF_CFCMS << ",F";
TString para(p); para << "," << i + 1;
const long codcf = ini.get_long(CFCMS_CODCF, para); TSheet_field & so = m.sfield(F_CMS_FORN);
if (codcf == 0L)
break; for (i = 0; ; i++)
TToken_string & row = so.row(i); {
TString para(p); para << "," << i + 1;
row.add(codcf, so.cid2index(F_CMS_CODFOR)); const long codcf = ini.get_long(CFCMS_CODCF, para);
row.add(ini.get(CFCMS_NRIGABAN, para), so.cid2index(F_CMS_NRIGABANFOR)); if (codcf == 0L)
row.add(ini.get(CFCMS_CUP, para), so.cid2index(F_CMS_CUPFOR)); break;
row.add(ini.get(CFCMS_CIG, para), so.cid2index(F_CMS_CIGFOR)); TToken_string & row = so.row(i);
so.update_mask(i - 1);
} row.add(codcf, so.cid2index(F_CMS_CODFOR));
so.force_update(); 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);
void TCms_app::mask2ini(const TMask& m, TConfig& ini) }
{ so.force_update();
TString p; }
const TRelation * r = get_relation(); }
TAnal_app::mask2ini(m, ini); void TCms_app::mask2ini(const TMask& m, TConfig& ini)
p << LF_CFCMS << ",C"; {
TSheet_field & si = m.sfield(F_CMS_FINAN); TString p;
int items = si.items(); const TRelation * r = get_relation();
for (int i = 0; i < items; i++) TAnal_app::mask2ini(m, ini);
{ p << LF_CFCMS << ",C";
TString para(p); para << "," << i + 1; TSheet_field & si = m.sfield(F_CMS_FINAN);
TToken_string & row = si.row(i); int items = si.items();
ini.set(CFCMS_CODCF, row.get(si.cid2index(F_CMS_CODFIN)), para); for (int i = 0; i < items; i++)
ini.set(CFCMS_NRIGABAN, row.get(si.cid2index(F_CMS_NRIGABANFIN)), para); {
ini.set(CFCMS_CUP, row.get(si.cid2index(F_CMS_CUPFIN)), para); TString para(p); para << "," << i + 1;
ini.set(CFCMS_CIG, row.get(si.cid2index(F_CMS_CIGFIN)), para); TToken_string & row = si.row(i);
ini.set(CFCMS_PERCFIN, row.get(si.cid2index(F_CMS_PERCFINFIN)), para);
ini.set(CFCMS_DESCR, row.get(si.cid2index(F_CMS_DESCRFIN)), para); 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);
p.cut(0); ini.set(CFCMS_CIG, row.get(si.cid2index(F_CMS_CIGFIN)), para);
p << LF_CFCMS << ",F"; ini.set(CFCMS_PERCFIN, row.get(si.cid2index(F_CMS_PERCFINFIN)), para);
ini.set(CFCMS_DESCR, row.get(si.cid2index(F_CMS_DESCRFIN)), para);
TSheet_field & so = m.sfield(F_CMS_FORN); }
items = so.items(); p.cut(0);
for (int i = 0; i < items; i++) p << LF_CFCMS << ",F";
{
TString para(p); para << "," << i + 1; TSheet_field & so = m.sfield(F_CMS_FORN);
TToken_string & row = so.row(i);
items = so.items();
ini.set(CFCMS_CODCF, row.get(so.cid2index(F_CMS_CODFOR)), para); for (int i = 0; i < items; i++)
ini.set(CFCMS_NRIGABAN, row.get(so.cid2index(F_CMS_NRIGABANFOR)), para); {
ini.set(CFCMS_CUP, row.get(so.cid2index(F_CMS_CUPFOR)), para); TString para(p); para << "," << i + 1;
ini.set(CFCMS_CIG, row.get(so.cid2index(F_CMS_CIGFOR)), para); 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);
bool TCms_app::filtered() const ini.set(CFCMS_CUP, row.get(so.cid2index(F_CMS_CUPFOR)), para);
{ ini.set(CFCMS_CIG, row.get(so.cid2index(F_CMS_CIGFOR)), para);
if (_has_filter) }
return true; }
return TAnal_app::filtered();
} bool TCms_app::filtered() const
{
//non si può eliminare una commessa se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente if (_has_filter)
bool TCms_app::protected_record(TRectype& record) return true;
{ return TAnal_app::filtered();
TString query; }
query << "USE SALDANA\nSELECT COMMESSA==#COMMESSA\nFROM ANNO=#ANNO\n";
const TString commessa = record.get(COMMESSE_CODCMS); //non si può eliminare una commessa se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente
const TDate today(TODAY); bool TCms_app::protected_record(TRectype& record)
const long anno = today.year(); {
TString query;
TISAM_recordset saldana_recset(query); query << "USE SALDANA\nSELECT COMMESSA==#COMMESSA\nFROM ANNO=#ANNO\n";
saldana_recset.set_var("#COMMESSA", TVariant(commessa)); const TString commessa = record.get(COMMESSE_CODCMS);
saldana_recset.set_var("#ANNO", TVariant(anno - 1)); const TDate today(TODAY);
const long anno = today.year();
const long items = saldana_recset.items();
return items > 0; TISAM_recordset saldana_recset(query);
} saldana_recset.set_var("#COMMESSA", TVariant(commessa));
saldana_recset.set_var("#ANNO", TVariant(anno - 1));
void TCms_app::init_modify_mode(TMask& mask)
{ const long items = saldana_recset.items();
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1 , 1); return items > 0;
mask.enable(-1, mask.get(id).not_empty()); }
TAnal_app::init_modify_mode(mask); void TCms_app::init_modify_mode(TMask& mask)
} {
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1 , 1);
void TCms_app::init_insert_mode(TMask& mask) mask.enable(-1, mask.get(id).not_empty());
{
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1, 1); TAnal_app::init_modify_mode(mask);
mask.enable(-1, mask.get(id).not_empty()); }
TAnal_app::init_insert_mode(mask); void TCms_app::init_insert_mode(TMask& mask)
} {
const short id = ((TCms_anal_msk &)mask).get_field_id(_maxlev - 1, 1);
bool TCms_app::user_create() mask.enable(-1, mask.get(id).not_empty());
{
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_COMMESSE); TAnal_app::init_insert_mode(mask);
}
_maxlev = mci.levels();
if (_maxlev <= 0) bool TCms_app::user_create()
return error_box(TR("Le commesse non sono state configurate")); {
const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_COMMESSE);
//eventuali filtri per utente
_has_filter = cache().get("%AUC", user(), "S0").full(); _maxlev = mci.levels();
if (_maxlev <= 0)
return TAnal_app::user_create(); return error_box(TR("Le commesse non sono state configurate"));
}
//eventuali filtri per utente
int ca0600(int argc, char* argv[]) _has_filter = cache().get("%AUC", user(), "S0").full();
{
TCms_app a; return TAnal_app::user_create();
a.run(argc, argv, TR("Commesse")); }
return 0;
} 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 // gestione files Contabilita' Analitica: FASI
#include <execp.h> #include <execp.h>
#include <recset.h> #include <recset.h>
#include <relapp.h> #include <relapp.h>
#include "calib01.h" #include "calib01.h"
#include "calibmsk.h" #include "calibmsk.h"
#include "ca0700a.h" #include "ca0700a.h"
#include "fasi.h" #include "fasi.h"
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//MASCHERA //MASCHERA
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
class TFsc_anal_msk : public TSimple_anal_msk class TFsc_anal_msk : public TSimple_anal_msk
{ {
protected: protected:
virtual int get_logicnum() const { return LF_FASI; } virtual int get_logicnum() const { return LF_FASI; }
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public: public:
TFsc_anal_msk(); TFsc_anal_msk();
}; };
bool TFsc_anal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly) bool TFsc_anal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{ {
const short id = o.dlg(); const short id = o.dlg();
if (id > F_KEY4 && id <= F_KEY4+4) if (id > F_KEY4 && id <= F_KEY4+4)
{ {
const int level = id - F_KEY4 - 1; const int level = id - F_KEY4 - 1;
return ca_test_multilevel_field(efield(id), level); return ca_test_multilevel_field(efield(id), level);
} }
return TSimple_anal_msk::on_field_event(o, e, jolly); return TSimple_anal_msk::on_field_event(o, e, jolly);
} }
TFsc_anal_msk::TFsc_anal_msk() TFsc_anal_msk::TFsc_anal_msk()
{ {
read("ca0700a"); read("ca0700a");
const bool use_pdcc = ca_config().get_bool("UsePdcc"); 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); 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; int from = 1;
for (int i = 0; i < nfields; i++) for (int i = 0; i < nfields; i++)
{ {
TEdit_field & e = efield(F_FSCPDA1 + i); TEdit_field & e = efield(F_FSCPDA1 + i);
e.check_type(CHECK_NORMAL); e.check_type(CHECK_NORMAL);
TFieldref * fr = (TFieldref *) e.field(); TFieldref * fr = (TFieldref *) e.field();
if (fr != NULL) if (fr != NULL)
{ {
fr->set_from(from); fr->set_from(from);
if (i < 2) if (i < 2)
from += 3; from += 3;
else else
from += 6; from += 6;
fr->set_to(from - 1); fr->set_to(from - 1);
} }
} }
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//APPLICAZIONE //APPLICAZIONE
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// applicazione per la gestione delle fasi // applicazione per la gestione delle fasi
class TFsc_app : public TAnal_app class TFsc_app : public TAnal_app
{ {
bool _has_filter; bool _has_filter;
protected: protected:
virtual bool filtered() const; virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TFsc_anal_msk; } virtual bool filtered() const;
virtual bool user_create(); 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) bool TFsc_app::filtered() const
return true; {
return TAnal_app::filtered(); 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)
{ //non si può eliminare una fase se essa appare in un saldo analitico dell'anno in corso o dell'anno precedente
TString query; bool TFsc_app::protected_record(TRectype& record)
query << "USE SALDANA\nSELECT (FASE==#FASE)"; {
//controlla se le fasi sono figlie delle commesse o dei centri di costo o semplici figlie di nessuno TString query;
const TString& fath_fasi = ca_config().get("FathFasi"); query << "USE SALDANA\nSELECT (FASE==#FASE)";
//controlla se le fasi sono figlie delle commesse o dei centri di costo o semplici figlie di nessuno
if (fath_fasi == "CMS") const TString& fath_fasi = ca_config().get("FathFasi");
query << "&&(COMMESSA==#COMMESSA)";
if (fath_fasi == "CMS")
if (fath_fasi == "CDC") query << "&&(COMMESSA==#COMMESSA)";
query << "&&(COSTO==#COSTO)";
if (fath_fasi == "CDC")
query << "\nFROM ANNO=#ANNO"; query << "&&(COSTO==#COSTO)";
const TString fase = record.get(FASI_CODFASE); query << "\nFROM ANNO=#ANNO";
const TDate today(TODAY);
const long anno = today.year(); const TString fase = record.get(FASI_CODFASE);
const TString codcmsfas = record.get(FASI_CODCMSFAS); const TDate today(TODAY);
const long anno = today.year();
TISAM_recordset saldana_recset(query); const TString codcmsfas = record.get(FASI_CODCMSFAS);
saldana_recset.set_var("#FASE", TVariant(fase)); TISAM_recordset saldana_recset(query);
saldana_recset.set_var("#ANNO", TVariant(anno - 1));
if (fath_fasi == "CMS") saldana_recset.set_var("#FASE", TVariant(fase));
saldana_recset.set_var("#COMMESSA", TVariant(codcmsfas)); saldana_recset.set_var("#ANNO", TVariant(anno - 1));
if (fath_fasi == "CDC") if (fath_fasi == "CMS")
saldana_recset.set_var("#COSTO", TVariant(codcmsfas)); saldana_recset.set_var("#COMMESSA", TVariant(codcmsfas));
if (fath_fasi == "CDC")
const long items = saldana_recset.items(); saldana_recset.set_var("#COSTO", TVariant(codcmsfas));
return items > 0;
} 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); bool TFsc_app::user_create()
if (mci.levels() <= 0) {
return error_box(TR("Le fasi non sono state configurate")); const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_FASI);
if (mci.levels() <= 0)
//eventuali filtri per utente return error_box(TR("Le fasi non sono state configurate"));
_has_filter = cache().get("%AUC", user(), "S2").full();
//eventuali filtri per utente
return TAnal_app::user_create(); _has_filter = cache().get("%AUC", user(), "S2").full();
}
return TAnal_app::user_create();
int ca0700(int argc, char* argv[]) }
{
TFsc_app a; int ca0700(int argc, char* argv[])
a.run(argc, argv, TR("Fasi")); {
return 0; 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" #include "ca0800a.h"
TOOLBAR "topbar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
#include <relapbar.h> #include <relapbar.h>
ENDPAGE ENDPAGE
PAGE "Ripartizioni" 0 0 0 2 PAGE "Ripartizioni" 0 0 0 2
GROUPBOX DLG_NULL 78 4 GROUPBOX DLG_NULL 78 4
BEGIN BEGIN
PROMPT 1 0 "" PROMPT 1 0 ""
END END
RADIOBUTTON F_TIPO 1 76 RADIOBUTTON F_TIPO 1 76
BEGIN BEGIN
PROMPT 2 0 "" PROMPT 2 0 ""
FLAGS "ZP" FLAGS "ZP"
ITEM "I|Interattiva" ITEM "I|Interattiva"
MESSAGE SHOW,1@|HIDE,2@ MESSAGE SHOW,1@|HIDE,2@
ITEM "B|Batch" ITEM "B|Batch"
MESSAGE SHOW,2@|HIDE,1@ MESSAGE SHOW,2@|HIDE,1@
ITEM "P|Pareggio" ITEM "P|Pareggio"
MESSAGE SHOW,1@|HIDE,2@ MESSAGE SHOW,1@|HIDE,2@
FIELD TIPO FIELD TIPO
KEY 1 KEY 1
END END
STRING F_CODICE_I 8 STRING F_CODICE_I 8
BEGIN BEGIN
PROMPT 2 2 "Codice " PROMPT 2 2 "Codice "
FLAGS "Z" FLAGS "Z"
USE LF_RIP USE LF_RIP
INPUT TIPO F_TIPO SELECT INPUT TIPO F_TIPO SELECT
INPUT CODICE F_CODICE_I INPUT CODICE F_CODICE_I
DISPLAY "Codice@8" CODICE DISPLAY "Codice@8" CODICE
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCRIZ DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODICE_I CODICE OUTPUT F_CODICE_I CODICE
OUTPUT F_DESCRIZ_I DESCRIZ OUTPUT F_DESCRIZ_I DESCRIZ
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
FIELD CODICE FIELD CODICE
KEY 1 KEY 1
GROUP 1 GROUP 1
END END
STRING F_CODICE_B 8 STRING F_CODICE_B 8
BEGIN BEGIN
PROMPT 2 2 "Codice " PROMPT 2 2 "Codice "
FLAGS "Z" FLAGS "Z"
USE LF_RIP USE LF_RIP
INPUT TIPO "B" INPUT TIPO "B"
INPUT CODICE F_CODICE_B INPUT CODICE F_CODICE_B
DISPLAY "Codice@8 " CODICE DISPLAY "Codice@8 " CODICE
DISPLAY "Costo@20" CODCOSTO DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS DISPLAY "Commessa@20" CODCMS
DISPLAY "Descrizione@50" DESCRIZ DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Fase@10" CODFASE DISPLAY "Fase@10" CODFASE
OUTPUT F_CODICE_B CODICE OUTPUT F_CODICE_B CODICE
OUTPUT F_DESCRIZ_B DESCRIZ OUTPUT F_DESCRIZ_B DESCRIZ
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
FIELD CODICE FIELD CODICE
KEY 1 KEY 1
GROUP 2 GROUP 2
END END
STRING F_DESCRIZ_I 50 STRING F_DESCRIZ_I 50
BEGIN BEGIN
PROMPT 24 2 "" PROMPT 24 2 ""
USE LF_RIP KEY 2 USE LF_RIP KEY 2
INPUT TIPO "I" INPUT TIPO "I"
INPUT DESCRIZ F_DESCRIZ_I INPUT DESCRIZ F_DESCRIZ_I
DISPLAY "Descrizione@50" DESCRIZ DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice " CODICE DISPLAY "Codice " CODICE
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" CONTO DISPLAY "Sottoconto" CONTO
COPY OUTPUT F_CODICE_I COPY OUTPUT F_CODICE_I
FIELD DESCRIZ FIELD DESCRIZ
KEY 2 KEY 2
GROUP 1 GROUP 1
END END
STRING F_DESCRIZ_B 50 STRING F_DESCRIZ_B 50
BEGIN BEGIN
PROMPT 24 2 "" PROMPT 24 2 ""
COPY USE F_DESCRIZ_I COPY USE F_DESCRIZ_I
INPUT TIPO "B" INPUT TIPO "B"
INPUT DESCRIZ F_DESCRIZ_B INPUT DESCRIZ F_DESCRIZ_B
DISPLAY "Descrizione@50" DESCRIZ DISPLAY "Descrizione@50" DESCRIZ
DISPLAY "Codice " CODICE DISPLAY "Codice " CODICE
DISPLAY "Costo@20" CODCOSTO DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS DISPLAY "Commessa@20" CODCMS
DISPLAY "Fase@10" CODFASE DISPLAY "Fase@10" CODFASE
COPY OUTPUT F_CODICE_B COPY OUTPUT F_CODICE_B
FIELD DESCRIZ FIELD DESCRIZ
KEY 2 KEY 2
GROUP 2 GROUP 2
END END
GROUPBOX DLG_NULL 78 4 GROUPBOX DLG_NULL 78 4
BEGIN BEGIN
PROMPT 1 4 "@bConto" PROMPT 1 4 "@bConto"
GROUP 1 GROUP 1
END END
NUMBER F_GRUPPO 3 NUMBER F_GRUPPO 3
BEGIN BEGIN
PROMPT 2 5 "Conto " PROMPT 2 5 "Conto "
USE LF_PCON USE LF_PCON
INPUT GRUPPO F_GRUPPO INPUT GRUPPO F_GRUPPO
INPUT CONTO F_CONTO INPUT CONTO F_CONTO
INPUT SOTTOCONTO F_SOTTOCONTO INPUT SOTTOCONTO F_SOTTOCONTO
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPO GRUPPO OUTPUT F_GRUPPO GRUPPO
OUTPUT F_CONTO CONTO OUTPUT F_CONTO CONTO
OUTPUT F_SOTTOCONTO SOTTOCONTO OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_DESCR DESCR OUTPUT F_DESCR DESCR
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
FIELD GRUPPO FIELD GRUPPO
GROUP 1 GROUP 1
END END
NUMBER F_CONTO 3 NUMBER F_CONTO 3
BEGIN BEGIN
PROMPT 22 5 "" PROMPT 22 5 ""
COPY ALL F_GRUPPO COPY ALL F_GRUPPO
FIELD CONTO FIELD CONTO
CHECKTYPE NORMAL CHECKTYPE NORMAL
GROUP 1 GROUP 1
END END
NUMBER F_SOTTOCONTO 6 NUMBER F_SOTTOCONTO 6
BEGIN BEGIN
PROMPT 30 5 "" PROMPT 30 5 ""
COPY ALL F_GRUPPO COPY ALL F_GRUPPO
FIELD SOTTOCONTO FIELD SOTTOCONTO
CHECKTYPE NORMAL CHECKTYPE NORMAL
GROUP 1 GROUP 1
END END
STRING F_DESCR 50 STRING F_DESCR 50
BEGIN BEGIN
PROMPT 2 6 "Descrizione " PROMPT 2 6 "Descrizione "
USE LF_PCON KEY 2 USE LF_PCON KEY 2
INPUT DESCR F_DESCR INPUT DESCR F_DESCR
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_GRUPPO COPY OUTPUT F_GRUPPO
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
GROUP 1 GROUP 1
END END
NUMBER F_ANNOES 4 NUMBER F_ANNOES 4
BEGIN BEGIN
PROMPT 2 8 "Esercizio " PROMPT 2 8 "Esercizio "
USE ESC USE ESC
INPUT CODTAB F_ANNOES INPUT CODTAB F_ANNOES
DISPLAY "Codice Esercizio" CODTAB DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0 DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1 DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNOES CODTAB OUTPUT F_ANNOES CODTAB
FIELD ANNOES FIELD ANNOES
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
LIST F_INDBIL 16 LIST F_INDBIL 16
BEGIN BEGIN
PROMPT 20 8 "Indicatore di bilancio " PROMPT 20 8 "Indicatore di bilancio "
ITEM "0|0. Non definito" ITEM "0|0. Non definito"
ITEM "1|1. Attivita'" ITEM "1|1. Attivita'"
ITEM "2|2. Passivita'" ITEM "2|2. Passivita'"
ITEM "3|3. Costi" ITEM "3|3. Costi"
ITEM "4|4. Ricavi" ITEM "4|4. Ricavi"
FIELD INDBIL FIELD INDBIL
END END
LIST F_CLASSEMOV 25 LIST F_CLASSEMOV 25
BEGIN BEGIN
PROMPT 2 9 "Classe movimento " PROMPT 2 9 "Classe movimento "
ITEM "0|Tutti" ITEM "0|Tutti"
ITEM "1|Normali e Temporanei" ITEM "1|Normali e Temporanei"
ITEM "2|Preventivi e Variazioni" ITEM "2|Preventivi e Variazioni"
FIELD CLASSEMOV FIELD CLASSEMOV
GROUP 2 GROUP 2
END END
ENDPAGE ENDPAGE
PAGE "Righe" -1 -1 78 22 PAGE "Righe" -1 -1 78 22
RADIOBUTTON F_TIPORIP 1 78 RADIOBUTTON F_TIPORIP 1 78
BEGIN BEGIN
PROMPT 1 0 "Ripartizione" PROMPT 1 0 "Ripartizione"
FLAGS "Z" FLAGS "Z"
ITEM "0|Percentuale" ITEM "0|Percentuale"
ITEM "1|Costo\Ricavo" ITEM "1|Costo\Ricavo"
ITEM "2|Parti" ITEM "2|Parti"
FIELD TIPORIP FIELD TIPORIP
END END
NUMBER F_TOTRIP 15 5 NUMBER F_TOTRIP 15 5
BEGIN BEGIN
PROMPT 2 3 "Totale " PROMPT 2 3 "Totale "
FIELD TOTRIP FIELD TOTRIP
END END
NUMBER F_SOMMA 15 5 NUMBER F_SOMMA 15 5
BEGIN BEGIN
PROMPT 27 3 "Somma " PROMPT 27 3 "Somma "
FLAGS "D" FLAGS "D"
END END
NUMBER F_DIFFERENZA 15 5 NUMBER F_DIFFERENZA 15 5
BEGIN BEGIN
PROMPT 51 3 "Differenza " PROMPT 51 3 "Differenza "
FLAGS "D" FLAGS "D"
END END
SPREADSHEET F_SHEET 80 -3 SPREADSHEET F_SHEET 80 -3
BEGIN BEGIN
PROMPT 0 4 "" PROMPT 0 4 ""
ITEM "Ripartiz.@15F" ITEM "Ripartiz.@15F"
ITEM "Cdc1" ITEM "Cdc1"
ITEM "Cdc2" ITEM "Cdc2"
ITEM "Cdc3" ITEM "Cdc3"
ITEM "Cdc4" ITEM "Cdc4"
ITEM "Cms1" ITEM "Cms1"
ITEM "Cms2" ITEM "Cms2"
ITEM "Cms3" ITEM "Cms3"
ITEM "Cms4" ITEM "Cms4"
ITEM "Fas1" ITEM "Fas1"
ITEM "Fas2" ITEM "Fas2"
ITEM "Fas3" ITEM "Fas3"
ITEM "Fas4" ITEM "Fas4"
ITEM "Con1" ITEM "Con1"
ITEM "Con2" ITEM "Con2"
ITEM "Con3" ITEM "Con3"
ITEM "Con4" ITEM "Con4"
ITEM "Articolo@20" ITEM "Articolo@20"
END END
BUTTON F_GENFASI 60 2 BUTTON F_GENFASI 60 2
BEGIN BEGIN
PROMPT -11 -1 "Ripartire la commessa d'origine tra le sue fasi" PROMPT -11 -1 "Ripartire la commessa d'origine tra le sue fasi"
END END
ENDPAGE ENDPAGE
ENDMASK ENDMASK
PAGE "Sheet" -1 -1 78 19 PAGE "Sheet" -1 -1 78 19
NUMBER 101 15 5 NUMBER 101 15 5
BEGIN BEGIN
PROMPT 1 0 "% Ripartizione " PROMPT 1 0 "% Ripartizione "
FLAGS "U" FLAGS "U"
FIELD RIPARTO FIELD RIPARTO
MESSAGE COPY,201 MESSAGE COPY,201
END END
NUMBER 201 15 5 NUMBER 201 15 5
BEGIN BEGIN
PROMPT 1 0 "Numero parti " PROMPT 1 0 "Numero parti "
FLAGS "U" FLAGS "U"
FIELD RIPARTO FIELD RIPARTO
MESSAGE COPY,101 MESSAGE COPY,101
END END
STRING 102 20 STRING 102 20
BEGIN BEGIN
PROMPT 1 1 "Cdc1 " PROMPT 1 1 "Cdc1 "
USE LF_CDC USE LF_CDC
GROUP 1 GROUP 1
END END
STRING 103 20 STRING 103 20
BEGIN BEGIN
PROMPT 1 2 "Cdc2 " PROMPT 1 2 "Cdc2 "
COPY USE 102 COPY USE 102
GROUP 1 GROUP 1
END END
STRING 104 20 STRING 104 20
BEGIN BEGIN
PROMPT 1 3 "Cdc3 " PROMPT 1 3 "Cdc3 "
COPY USE 102 COPY USE 102
GROUP 1 GROUP 1
END END
STRING 105 20 STRING 105 20
BEGIN BEGIN
PROMPT 1 4 "Cdc4 " PROMPT 1 4 "Cdc4 "
COPY USE 102 COPY USE 102
GROUP 1 GROUP 1
END END
STRING 106 20 STRING 106 20
BEGIN BEGIN
PROMPT 1 5 "Cms1 " PROMPT 1 5 "Cms1 "
USE LF_COMMESSE USE LF_COMMESSE
GROUP 1 GROUP 1
END END
STRING 107 20 STRING 107 20
BEGIN BEGIN
PROMPT 1 6 "Cms2 " PROMPT 1 6 "Cms2 "
COPY USE 106 COPY USE 106
GROUP 1 GROUP 1
END END
STRING 108 20 STRING 108 20
BEGIN BEGIN
PROMPT 1 7 "Cms3 " PROMPT 1 7 "Cms3 "
COPY USE 106 COPY USE 106
GROUP 1 GROUP 1
END END
STRING 109 20 STRING 109 20
BEGIN BEGIN
PROMPT 1 8 "Cms4 " PROMPT 1 8 "Cms4 "
COPY USE 106 COPY USE 106
GROUP 1 GROUP 1
END END
STRING 110 20 STRING 110 20
BEGIN BEGIN
PROMPT 1 9 "Fas1 " PROMPT 1 9 "Fas1 "
USE LF_FASI USE LF_FASI
GROUP 1 GROUP 1
END END
STRING 111 10 STRING 111 10
BEGIN BEGIN
PROMPT 1 10 "Fas2 " PROMPT 1 10 "Fas2 "
COPY USE 110 COPY USE 110
GROUP 1 GROUP 1
END END
STRING 112 10 STRING 112 10
BEGIN BEGIN
PROMPT 1 11 "Fas3 " PROMPT 1 11 "Fas3 "
COPY USE 110 COPY USE 110
GROUP 1 GROUP 1
END END
STRING 113 10 STRING 113 10
BEGIN BEGIN
PROMPT 1 12 "Fas4 " PROMPT 1 12 "Fas4 "
COPY USE 110 COPY USE 110
GROUP 1 GROUP 1
END END
STRING 114 20 STRING 114 20
BEGIN BEGIN
PROMPT 1 14 "Gruppo " PROMPT 1 14 "Gruppo "
USE LF_PCON USE LF_PCON
GROUP 1 GROUP 1
END END
STRING 115 20 STRING 115 20
BEGIN BEGIN
PROMPT 27 14 "Conto " PROMPT 27 14 "Conto "
COPY USE 114 COPY USE 114
GROUP 1 GROUP 1
END END
STRING 116 20 STRING 116 20
BEGIN BEGIN
PROMPT 46 14 "Sottoconto " PROMPT 46 14 "Sottoconto "
COPY USE 114 COPY USE 114
GROUP 1 GROUP 1
END END
STRING 117 20 STRING 117 20
BEGIN BEGIN
PROMPT 1 15 "Sottoconticino " PROMPT 1 15 "Sottoconticino "
COPY USE 114 COPY USE 114
GROUP 1 GROUP 1
END END
STRING 118 20 STRING 118 20
BEGIN BEGIN
PROMPT 1 16 "Articolo " PROMPT 1 16 "Articolo "
USE LF_ANAMAG USE LF_ANAMAG
INPUT CODART 118 INPUT CODART 118
DISPLAY "Codice@20" CODART DISPLAY "Codice@20" CODART
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
OUTPUT 118 CODART OUTPUT 118 CODART
CHECKTYPE NORMAL OUTPUT 260 DESCR
ADD RUN ve2 -3 CHECKTYPE NORMAL
FIELD CODART ADD RUN ve2 -3
END FIELD CODART
MODULE CI
END
ENDPAGE
TOOLBAR "topbar" 0 0 0 2 ENDPAGE
BUTTON DLG_OK 10 2 TOOLBAR "topbar" 0 0 0 2
BEGIN
PROMPT -13 -1 "" BUTTON DLG_OK 10 2
END BEGIN
PROMPT -13 -1 ""
BUTTON DLG_DELREC 10 2 END
BEGIN
PROMPT -23 -1 "" BUTTON DLG_DELREC 10 2
END BEGIN
PROMPT -23 -1 ""
BUTTON DLG_CANCEL 10 2 END
BEGIN
PROMPT -33 -1 "" BUTTON DLG_CANCEL 10 2
END BEGIN
PROMPT -33 -1 ""
ENDPAGE END
ENDPAGE
ENDMASK ENDMASK

View File

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

View File

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

View File

@ -11,6 +11,10 @@
#include "calib01.h" #include "calib01.h"
#include "../cg/cglib01.h" #include "../cg/cglib01.h"
#include "../ve/velib.h"
#include "../mg/umart.h"
#include <rdoc.h>
#include <causali.h> #include <causali.h>
#include <mov.h> #include <mov.h>
@ -93,9 +97,14 @@ protected:
void write_rows(const TMask& m); void write_rows(const TMask& m);
void read_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 bool protected_record(TRectype& rec);
virtual int write(const TMask& m); virtual int write(const TMask& m);
virtual int rewrite(const TMask& m); virtual int rewrite(const TMask& m);
virtual bool remove();
virtual int read(TMask& m); virtual int read(TMask& m);
virtual void ini2sheet(TConfig& ini, TSheet_field& sheet); 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_CODCMS, keyrip.get());
rmov.put(RMOVANA_CODFASE, keyrip.get()); rmov.put(RMOVANA_CODFASE, keyrip.get());
rmov.put(RMOVANA_CODCONTO, keyrip.get()); rmov.put(RMOVANA_CODCONTO, keyrip.get());
if (ci)
TToken_string& row = rec2row(rmov, -1);
if (ci)
{
rmov.put(RMOVANA_CODART, keyrip.get()); 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; 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()); TGeneric_distrib distrib(row.get_real(RMV_IMPORTO), TCurrency::get_firm_dec());
// Calcolo tutte le percentuali da ripartire // 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); const real quota = rrip[i].get_real(RRIP_RIPARTO);
distrib.add(quota); distrib.add(quota);
} }
TString80 desc; // Variabile di appoggio per descrizione riga 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 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 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_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); 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... } //else di rrip_items > 0...
} //if(zio.is_analitico(... } //if(zio.is_analitico(...
} }
@ -672,8 +691,28 @@ bool TMovanal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
else else
o.set(datacomp.string()); //se la data fine competenza viene lasciata vuota -> e' uguale alla datacomp o.set(datacomp.string()); //se la data fine competenza viene lasciata vuota -> e' uguale alla datacomp
} }
break; 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: case DLG_USER:
if (e == fe_button) if (e == fe_button)
display_rmov_comp(); 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(); const bool vuoto = o.empty();
enable(-5, vuoto); enable(-5, vuoto);
if (!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(); load_cg_mov();
} }
}
break; break;
case F_BLOCCATO: case F_BLOCCATO:
if (e == fe_modify) 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); row.add(fr->read(rec), idx);
} }
} }
sheet.check_row(r);
return row; 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); TSheet_field& sf = sfield(F_RIGHE);
TMask& sm = sf.sheet_mask(); 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); TEdit_field& fld = sm.efield(dlg+i);
int logic = lf; 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) if (logic == LF_PCON)
{ {
const TFieldref* f = fld.field(); const TFieldref* f = fld.field();
const TString& fieldname = f->name(); if (f != NULL)
{
const TString& fieldname = f->name();
if (fieldname == "GRUPPO") if (fieldname == "GRUPPO")
fld.set_field("CODCONTO[1,3]"); else fld.set_field("CODCONTO[1,3]"); else
if (fieldname == "CONTO") if (fieldname == "CONTO")
fld.set_field("CODCONTO[4,6]"); else fld.set_field("CODCONTO[4,6]"); else
if (fieldname == "SOTTOCONTO") if (fieldname == "SOTTOCONTO")
fld.set_field("CODCONTO[7,12]"); fld.set_field("CODCONTO[7,12]");
}
} }
else else
{ {
@ -1118,13 +1178,17 @@ int TMovanal_msk::create_sheet_fields(int lf, int& y, short& dlg, bool required)
default : fieldname = RMOVANA_CODCONTO; break; default : fieldname = RMOVANA_CODCONTO; break;
} }
TFieldref* f = (TFieldref*)fld.field(); TFieldref* f = (TFieldref*)fld.field();
if (f != NULL)
f->set_name(fieldname); f->set_name(fieldname);
} }
fld.check_type(required ? CHECK_REQUIRED : CHECK_NORMAL); fld.check_type(required ? CHECK_REQUIRED : CHECK_NORMAL);
TEdit_field& dfld = sm.efield(dlg+50+i); if (i < h)
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output! {
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; y += h+1;
@ -1145,7 +1209,7 @@ void TMovanal_msk::create_sheet()
TConfig& ini = ca_config(); TConfig& ini = ca_config();
const bool fsc_req = ini.get_bool("FscRequired"); 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 short dlg = S_CDC1+100; // id del primo campo da generare
_cdc_start = _cdc_end = -1; _cdc_start = _cdc_end = -1;
_cms_start = _cms_end = -1; _cms_start = _cms_end = -1;
@ -1245,6 +1309,162 @@ bool TMovanal_app::get_next_key(TToken_string& key)
return true; 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) void TMovanal_app::write_rows(const TMask& m)
{ {
TAnal_mov& mov = (TAnal_mov&)_rel->curr(); 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) 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); write_rows(m);
const int err = _rel->write(); if (ci)
if (err == NOERR) write_doc(m);
const int err = _rel->write();
if (ci && err == NOERR)
link_ci(m); link_ci(m);
return err; return err;
} }
int TMovanal_app::rewrite(const TMask& m) int TMovanal_app::rewrite(const TMask& m)
{ {
bool ci = has_module(CIAUT);
m.autosave(*_rel); 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); write_rows(m);
if (ci)
write_doc(m);
const int err = _rel->rewrite(); const int err = _rel->rewrite();
if (err == NOERR) if (ci && err == NOERR)
link_ci(m); link_ci(m);
return err; 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) int TMovanal_app::read(TMask& m)
{ {
const int err = TRelation_application::read(m); const int err = TRelation_application::read(m);

View File

@ -1,55 +1,56 @@
#define F_NUMREG 201 #define F_NUMREG 201
#define F_ANNOES 202 #define F_ANNOES 202
#define F_DESCR 203 #define F_DESCR 203
#define F_DATAREG 204 #define F_DATAREG 204
#define F_DATACOMP 205 #define F_DATACOMP 205
#define F_DATADOC 206 #define F_DATADOC 206
#define F_AUTOFCOMP 207 #define F_AUTOFCOMP 207
#define F_TIPODOC 209 #define F_TIPODOC 209
#define F_SEZIONE 210 #define F_SEZIONE 210
#define F_TOTDOC 211 #define F_TOTDOC 211
#define F_NUMREGCG 212 #define F_NUMREGCG 212
#define F_CODCAUS 213 #define F_CODCAUS 213
#define F_DESCAUS 214 #define F_DESCAUS 214
#define F_DARE 215 #define F_DARE 215
#define F_AVERE 216 #define F_AVERE 216
#define F_BLOCCATO 217 #define F_BLOCCATO 217
#define F_TIPO 218 #define F_TIPO 218
#define F_NUMDOC 219 #define F_NUMDOC 219
#define F_RESET 220 #define F_RESET 220
#define F_TIPOCF 221 #define F_TIPOCF 221
#define F_CODCF 222 #define F_CODCF 222
#define F_RAGSOCCF 223 #define F_RAGSOCCF 223
#define F_DATAFCOMP 224 #define F_DATAFCOMP 224
#define F_NUMREG2 301 #define F_NUMREG2 301
#define F_ANNOES2 302 #define F_ANNOES2 302
#define F_DATAREG2 303 #define F_DATAREG2 303
#define F_DESCR2 304 #define F_DESCR2 304
#define F_RIGHE 400 #define F_RIGHE 400
#define S_DARE 101 #define S_DARE 101
#define S_AVERE 102 #define S_AVERE 102
#define S_DESCR 103 #define S_DESCR 103
#define S_CDC1 104 #define S_CDC1 104
#define S_CDC2 105 #define S_CDC2 105
#define S_CDC3 106 #define S_CDC3 106
#define S_CDC4 107 #define S_CDC4 107
#define S_CMS1 108 #define S_CMS1 108
#define S_CMS2 109 #define S_CMS2 109
#define S_CMS3 110 #define S_CMS3 110
#define S_CMS4 111 #define S_CMS4 111
#define S_FAS1 112 #define S_FAS1 112
#define S_FAS2 113 #define S_FAS2 113
#define S_FAS3 114 #define S_FAS3 114
#define S_FAS4 115 #define S_FAS4 115
#define S_CON1 116 #define S_CON1 116
#define S_CON2 117 #define S_CON2 117
#define S_CON3 118 #define S_CON3 118
#define S_CON4 119 #define S_CON4 119
#define S_CODART 120 #define S_DES_CON 120
#define S_DESCART 121 #define S_CODART 121
#define S_CDC_ORI 122 #define S_DESCART 122
#define S_CMS_ORI 123 #define S_CDC_ORI 123
#define S_FAS_ORI 124 #define S_CMS_ORI 124
#define S_CON_ORI 125 #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" ?> <?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3100a" lpi="8" class="ca3100b"> <report libraries="ve1300" name="ca3100a" lpi="8" class="ca3100b">
<description>Movimenti CA per numero registrazione</description> <description>Movimenti CA per numero registrazione</description>
<font face="Courier New" size="8" /> <font face="Courier New" size="8" />
<section type="Head"> <section type="Head" pattern="1">
<font italic="1" face="Courier New" size="8" /> <font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @ <prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E; 0 &#3E;
IF IF
121 122 SCAMBIA_CAMPI 121 122 SCAMBIA_CAMPI
THEN THEN
;</prescript> ;</prescript>
<field x="1" type="Stringa" width="50" pattern="1"> <field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="10" /> <font italic="1" face="Courier New" bold="1" size="10" />
<source>#SYSTEM.RAGSOC</source> <source>#SYSTEM.RAGSOC</source>
</field> </field>
<field x="76" type="Data" width="10" pattern="1"> <field x="76" type="Data" width="10" pattern="1">
<source>#SYSTEM.DATE</source> <source>#SYSTEM.DATE</source>
</field> </field>
<field x="157" type="Numero" align="right" width="3" pattern="1"> <field x="157" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source> <source>#REPORT.PAGE</source>
</field> </field>
<field x="10" y="1.25" type="Testo" width="12" pattern="1" text="Dal numero" /> <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"> <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" /> <font face="Courier New" bold="1" size="8" />
<source>#DANUMREG</source> <source>#DANUMREG</source>
</field> </field>
<field x="40" y="1.25" type="Testo" width="12" pattern="1" text="Al numero" /> <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"> <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" /> <font face="Courier New" bold="1" size="8" />
<source>#ANUMREG</source> <source>#ANUMREG</source>
</field> </field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" /> <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="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="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="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="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="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="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="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="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="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="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="33.5" y="4" type="Testo" align="center" width="11" pattern="1" text="Data Doc." />
<field x="10" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." /> <field border="2" x="1" y="5" type="Linea" width="161" height="0" pattern="1" />
<field x="22" y="3" type="Testo" width="10" id="122" pattern="1" text="Data Comp." /> <field x="10" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
</section> <field x="22" y="3" type="Testo" width="11" id="122" pattern="1" text="Data Comp." />
<section type="Head" level="1" height="3"> </section>
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101 <section type="Head" level="1" height="3" pattern="1">
MESSAGE RESET,F1.102</prescript> <prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
<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"> MESSAGE RESET,F1.102</prescript>
<font face="Courier New" bold="1" size="16" /> <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">
</field> <font face="Courier New" bold="1" size="16" />
</section> </field>
<section type="Head" level="2"> </section>
<groupby>NUMREG</groupby> <section type="Head" level="2" pattern="1">
<field x="1" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1"> <groupby>NUMREG</groupby>
<source>MOVANA.NUMREG</source> <field x="1" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
</field> <source>MOVANA.NUMREG</source>
<field x="34" y="1" type="Data" width="10" pattern="1"> </field>
<source>MOVANA.DATADOC</source> <field x="34" y="1" type="Data" width="11" pattern="1">
</field> <source>MOVANA.DATAFCOMP</source>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1"> </field>
<source>MOVANA.NUMREGCG</source> <field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
</field> <source>MOVANA.NUMREGCG</source>
<field x="56" y="1" type="Stringa" width="7" pattern="1"> </field>
<source>MOVANA.NUMDOC</source> <field x="56" y="1" type="Stringa" width="7" pattern="1">
</field> <source>MOVANA.NUMDOC</source>
<field x="64" y="1" type="Stringa" width="4" pattern="1"> </field>
<source>MOVANA.TIPODOC</source> <field x="64" y="1" type="Stringa" width="4" pattern="1">
</field> <source>MOVANA.TIPODOC</source>
<field x="69" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1"> </field>
<source>MOVANA.DESCR</source> <field x="69" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
</field> <source>MOVANA.DESCR</source>
<field x="95" y="1" type="Stringa" width="3" pattern="1"> </field>
<source>MOVANA.CODCAUS</source> <field x="95" y="1" type="Stringa" width="3" pattern="1">
</field> <source>MOVANA.CODCAUS</source>
<field x="99" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1"> </field>
<prescript description="H2.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript> <field x="99" y="1" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
</field> <prescript description="H2.0 PRESCRIPT">MESSAGE ISAMREAD,CAUS,CODCAUS=MOVANA.CODCAUS,DESCR</prescript>
<field x="127" y="1" type="Stringa" width="1" pattern="1"> </field>
<source>MOVANA.TIPOMOV</source> <field x="127" y="1" type="Stringa" width="1" pattern="1">
</field> <source>MOVANA.TIPOMOV</source>
<field x="131" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@"> </field>
<source>MOVANA.TOTDOC</source> <field x="131" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @ <source>MOVANA.TOTDOC</source>
"A" = <prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
IF "A" =
0 #THIS ! IF
THEN 0 #THIS !
</prescript> THEN
</field> </prescript>
<field x="146" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@"> </field>
<source>MOVANA.TOTDOC</source> <field x="146" y="1" type="Valuta" align="right" width="15" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @ <source>MOVANA.TOTDOC</source>
"D" = <prescript description="H2.0 PRESCRIPT">"MOVANA.SEZIONE" @
IF "D" =
0 #THIS ! IF
THEN 0 #THIS !
</prescript> THEN
</field> </prescript>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" /> </field>
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" /> <field x="34" y="2" type="Data" width="11" pattern="1">
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" /> <source>MOVANA.DATADOC</source>
<field x="61" y="3" type="Testo" width="13" pattern="1" text="Fase" /> </field>
<field x="75" y="3" type="Testo" width="23" pattern="1" text="Conto" /> <field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="99" y="3" type="Testo" width="25" pattern="1" text="Descrizione" /> <field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="131.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Dare" /> <field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
<field x="146.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Avere" /> <field x="61" y="3" type="Testo" width="13" pattern="1" text="Fase" />
<field border="1" x="8.18" y="4" type="Linea" width="154" height="0" pattern="1" /> <field x="75" y="3" type="Testo" width="23" pattern="1" text="Conto" />
<field x="-9.88" y="1" type="Data" width="10" id="121" pattern="1"> <field x="99" y="3" type="Testo" width="25" pattern="1" text="Descrizione" />
<source>DATAREG</source> <field x="131.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Dare" />
</field> <field x="146.18" y="3" type="Testo" align="center" width="15" pattern="1" text="Avere" />
<field x="10" y="1" type="Data" width="10" id="121" pattern="1"> <field border="1" x="8.18" y="4" type="Linea" width="154" height="0" pattern="1" />
<source>MOVANA.DATAREG</source> <field x="-9.88" y="1" type="Data" width="10" id="121" pattern="1">
</field> <source>DATAREG</source>
<field x="22" y="1" type="Data" align="right" width="10" id="122" pattern="1"> </field>
<source>MOVANA.DATACOMP</source> <field x="10" y="1" type="Data" width="10" id="121" pattern="1">
</field> <source>MOVANA.DATAREG</source>
</section> </field>
<section type="Body" /> <field x="22" y="1" type="Data" align="right" width="11" id="122" pattern="1">
<section type="Body" level="1"> <source>MOVANA.DATACOMP</source>
<prescript description="B1 PRESCRIPT">#ESERCIZIO @ </field>
0 &#3E; </section>
IF <section type="Body" pattern="1" />
121 122 SCAMBIA_CAMPI <section type="Body" level="1" pattern="1">
THEN <prescript description="B1 PRESCRIPT">#ESERCIZIO @
;</prescript> 0 &#3E;
<field x="9" type="Numero" align="right" width="3" pattern="1"> IF
<source>NUMRIG</source> 121 122 SCAMBIA_CAMPI
</field> THEN
<field x="13" type="Stringa" width="23" pattern="1"> ;</prescript>
<source>CODCCOSTO</source> <field x="9" type="Numero" align="right" width="3" pattern="1">
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript> <source>NUMRIG</source>
</field> </field>
<field x="37" type="Stringa" width="23" pattern="1"> <field x="13" type="Stringa" width="23" pattern="1">
<source>CODCMS</source> <source>CODCCOSTO</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript> <prescript description="B1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript>
</field> </field>
<field x="61" type="Stringa" width="13" pattern="1"> <field x="37" type="Stringa" width="23" pattern="1">
<source>CODFASE</source> <source>CODCMS</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_FASE</prescript> <prescript description="B1.0 PRESCRIPT">CA_FORMAT_COMMESSA</prescript>
</field> </field>
<field x="75" type="Stringa" width="23" pattern="1"> <field x="61" type="Stringa" width="13" pattern="1">
<source>CODCONTO</source> <source>CODFASE</source>
<prescript description="B1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript> <prescript description="B1.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field> </field>
<field x="99" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1"> <field x="75" type="Stringa" width="23" pattern="1">
<source>DESCR</source> <source>CODCONTO</source>
</field> <prescript description="B1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
<field x="131" type="Valuta" align="right" width="15" id="101" pattern="1" hide_zero="1" text="###.###.###,@@"> </field>
<source>IMPORTO</source> <field x="99" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @ <source>DESCR</source>
"A" = </field>
IF <field x="131" type="Valuta" align="right" width="15" id="101" pattern="1" hide_zero="1" text="###.###.###,@@">
0 #THIS ! <source>IMPORTO</source>
THEN <prescript description="B1.101 PRESCRIPT">"RMOVANA.SEZIONE" @
</prescript> "A" =
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript> IF
</field> 0 #THIS !
<field x="146" type="Valuta" align="right" width="15" id="102" pattern="1" hide_zero="1" text="###.###.###,@@"> THEN
<source>IMPORTO</source> </prescript>
<prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @ <postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
"D" = </field>
IF <field x="146" type="Valuta" align="right" width="15" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
0 #THIS ! <source>IMPORTO</source>
THEN <prescript description="B1.102 PRESCRIPT">"RMOVANA.SEZIONE" @
</prescript> "D" =
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript> IF
</field> 0 #THIS !
</section> THEN
<section type="Foot" height="1" /> </prescript>
<section type="Foot" level="1"> <postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" /> </field>
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:"> </section>
<font face="Courier New" bold="1" size="8" /> <section type="Foot" height="1" pattern="1" />
</field> <section type="Foot" level="1" pattern="1">
<field x="131" y="1.5" type="Valuta" align="right" width="15" id="101" pattern="1" text="###.###.###,@@"> <field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<font face="Courier New" bold="1" size="8" /> <field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
</field> <font face="Courier New" bold="1" size="8" />
<field x="146" y="1.5" type="Valuta" align="right" width="15" id="102" pattern="1" text="###.###.###,@@"> </field>
<font face="Courier New" bold="1" size="8" /> <field x="131" y="1.5" type="Valuta" align="right" width="15" id="101" pattern="1" text="###.###.###,@@">
</field> <font face="Courier New" bold="1" size="8" />
</section> </field>
<section type="Foot" level="2" /> <field x="146" y="1.5" type="Valuta" align="right" width="15" id="102" pattern="1" text="###.###.###,@@">
<sql>USE RMOVANA <font face="Courier New" bold="1" size="8" />
JOIN MOVANA INTO NUMREG==NUMREG</sql> </field>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- ) </section>
VARIABLE _X1 \ coordinate del campo F1 <section type="Foot" level="2" pattern="1" />
VARIABLE _Y1 <sql>USE RMOVANA
VARIABLE _X2 \ coordinate del campo F2 JOIN MOVANA INTO NUMREG==NUMREG</sql>
VARIABLE _Y2 <prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )
VARIABLE _X1 \ coordinate del campo F1
2DUP \ duplica i campi F1 F2 sullo stack VARIABLE _Y1
GET_POS \ prende le coordinate del campo F2 VARIABLE _X2 \ coordinate del campo F2
_Y2 ! \ e le mette in _Y2 e _X2 VARIABLE _Y2
_X2 !
GET_POS \ prende le coordinate del campo F1 2DUP \ duplica i campi F1 F2 sullo stack
_Y1 ! \ e le mette in _Y1 e _X1 GET_POS \ prende le coordinate del campo F2
_X1 ! _Y2 ! \ e le mette in _Y2 e _X2
_X2 !
_X1 @ \ legge le coordinate di F1 GET_POS \ prende le coordinate del campo F1
_Y1 @ _Y1 ! \ e le mette in _Y1 e _X1
ROT _X1 !
SET_POS \ mette le coord in F2
_X1 @ \ legge le coordinate di F1
_X2 @ _Y1 @
_Y2 @ ROT
ROT SET_POS \ mette le coord in F2
SET_POS
; _X2 @
_Y2 @
</prescript> ROT
SET_POS
;
</prescript>
</report> </report>

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -1,263 +1,268 @@
#include "ca3200.h" #include "ca3200.h"
#include "camask.h" #include "camask.h"
TOOLBAR "topbar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
#include <aprintbar.h> #include <aprintbar.h>
ENDPAGE ENDPAGE
TOOLBAR "bottombar" 0 -2 0 1 TOOLBAR "bottombar" 0 -2 0 1
STRING F_REPORT 256 66 STRING F_REPORT 256 66
BEGIN BEGIN
PROMPT 1 -2 "Report " PROMPT 1 -2 "Report "
FLAGS "B" FLAGS "B"
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END
STRING DLG_PROFILE 50 STRING DLG_PROFILE 50
BEGIN BEGIN
PROMPT 1 -1 "Profilo " PROMPT 1 -1 "Profilo "
PSELECT PSELECT
END END
ENDPAGE ENDPAGE
PAGE "Selezioni" 0 0 0 2 PAGE "Selezioni" 0 0 0 2
GROUPBOX DLG_NULL 78 3 GROUPBOX DLG_NULL 78 3
BEGIN BEGIN
PROMPT 1 0 "@bDitta" PROMPT 1 0 "@bDitta"
END END
NUMBER F_CODDITTA 5 NUMBER F_CODDITTA 5
BEGIN BEGIN
PROMPT 2 1 "Ditta " PROMPT 2 1 "Ditta "
FLAGS "FRD" FLAGS "FRD"
USE LF_NDITTE KEY 1 USE LF_NDITTE KEY 1
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
INPUT CODDITTA F_CODDITTA INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale @50" RAGSOC DISPLAY "Ragione sociale @50" RAGSOC
OUTPUT F_CODDITTA CODDITTA OUTPUT F_CODDITTA CODDITTA
OUTPUT F_RAGSOC RAGSOC OUTPUT F_RAGSOC RAGSOC
END END
STRING F_RAGSOC 50 STRING F_RAGSOC 50
BEGIN BEGIN
PROMPT 19 1 "" PROMPT 19 1 ""
FLAGS "D" FLAGS "D"
END END
DATE F_DATASTAMPA DATE F_DATASTAMPA
BEGIN BEGIN
PROMPT 2 3 "Data di stampa " PROMPT 2 3 "Data di stampa "
FLAGS "A" FLAGS "A"
END END
NUMBER F_ANNO 4 NUMBER F_ANNO 4
BEGIN BEGIN
PROMPT 52 3 "Esercizio " PROMPT 52 3 "Esercizio "
USE ESC USE ESC
INPUT CODTAB F_ANNO INPUT CODTAB F_ANNO
DISPLAY "Codice Esercizio" CODTAB DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0 DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1 DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNO CODTAB OUTPUT F_ANNO CODTAB
CHECKTYPE NORMAL CHECKTYPE NORMAL
CHECKTYPE NORMAL CHECKTYPE NORMAL
FLAGS "RZ" FLAGS "RZ"
ADD NONE ADD NONE
END END
GROUPBOX DLG_NULL 78 6 GROUPBOX DLG_NULL 78 7
BEGIN BEGIN
PROMPT 1 5 "@bOpzioni stampa" PROMPT 1 5 "@bOpzioni stampa"
END END
TEXT 96 TEXT 96
BEGIN BEGIN
PROMPT 2 6 "Dalla data competenza " PROMPT 2 6 "Dalla data competenza "
END END
TEXT 97 TEXT 97
BEGIN BEGIN
PROMPT 40 6 "Alla data competenza " PROMPT 40 6 "Alla data competenza "
END END
DATE F_DATAINI DATE F_DATAINI
BEGIN BEGIN
PROMPT 26 6 "" PROMPT 26 6 ""
END END
DATE F_DATAFIN DATE F_DATAFIN
BEGIN BEGIN
PROMPT 62 6 "" PROMPT 62 6 ""
END END
LIST F_TIPOCONTI 24 LIST F_TIPOCONTI 24
BEGIN BEGIN
PROMPT 2 8 "Selezione conti " PROMPT 2 8 "Selezione conti "
ITEM "1|Movimentati nel periodo" ITEM "1|Movimentati nel periodo"
ITEM "2|Con saldo diverso da 0" ITEM "2|Con saldo diverso da 0"
ITEM "3|Tutti" ITEM "3|Tutti"
END END
LIST F_TIPIMOV 24 LIST F_TIPIMOV 24
BEGIN BEGIN
PROMPT 2 9 "Selezione movimenti " PROMPT 2 9 "Selezione movimenti "
ITEM " |Qualsiasi" ITEM " |Qualsiasi"
ITEM "N|Normale" ITEM "N|Normale"
ITEM "P|Preventivo e variazione" ITEM "P|Preventivo e variazione"
END END
SPREADSHEET F_RIGHE -1 -1 BOOLEAN F_PERCONTO
BEGIN BEGIN
PROMPT 0 11 "" PROMPT 2 10 "Non suddivisi per Commessa/CDC "
ITEM "Cdc1" END
ITEM "Cdc2"
ITEM "Cdc3" SPREADSHEET F_RIGHE -1 -1
ITEM "Cdc4" BEGIN
ITEM "Cdc5" PROMPT 0 12 ""
ITEM "Cdc6" ITEM "Cdc1"
ITEM "Cdc7" ITEM "Cdc2"
ITEM "Cdc8" ITEM "Cdc3"
ITEM "Cdc9" ITEM "Cdc4"
ITEM "Cdc10" ITEM "Cdc5"
ITEM "Cdc11" ITEM "Cdc6"
ITEM "Cdc12" ITEM "Cdc7"
END ITEM "Cdc8"
ITEM "Cdc9"
ENDPAGE ITEM "Cdc10"
ITEM "Cdc11"
PAGE "Conti" -1 -1 78 20 ITEM "Cdc12"
END
GROUPBOX DLG_NULL 76 6
BEGIN ENDPAGE
PROMPT 1 3 "@bDa:"
END PAGE "Conti" -1 -1 78 20
GROUPBOX DLG_NULL 76 6 GROUPBOX DLG_NULL 76 6
BEGIN BEGIN
PROMPT 1 9 "@bA:" PROMPT 1 3 "@bDa:"
END END
ENDPAGE GROUPBOX DLG_NULL 76 6
BEGIN
ENDMASK PROMPT 1 9 "@bA:"
END
PAGE "Riga" -1 -1 78 19
ENDPAGE
STRING S_CDC1 20
BEGIN ENDMASK
PROMPT 1 2 "Cdc1"
FLAGS "B" PAGE "Riga" -1 -1 78 19
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC1 20
END BEGIN
PROMPT 1 2 "Cdc1"
STRING S_CDC2 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 21 2 "Cdc2" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC2 20
END BEGIN
PROMPT 21 2 "Cdc2"
STRING S_CDC3 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 41 2 "Cdc3" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC3 20
END BEGIN
PROMPT 41 2 "Cdc3"
STRING S_CDC4 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 61 2 "Cdc4" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC4 20
END BEGIN
PROMPT 61 2 "Cdc4"
STRING S_CDC5 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 1 3 "Cdc5" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC5 20
END BEGIN
PROMPT 1 3 "Cdc5"
STRING S_CDC6 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 21 3 "Cdc6" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC6 20
END BEGIN
PROMPT 21 3 "Cdc6"
STRING S_CDC7 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 41 3 "Cdc7" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC7 20
END BEGIN
PROMPT 41 3 "Cdc7"
STRING S_CDC8 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 61 3 "Cdc8" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC8 20
END BEGIN
PROMPT 61 3 "Cdc8"
STRING S_CDC9 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 1 4 "Cdc9" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC9 20
END BEGIN
PROMPT 1 4 "Cdc9"
STRING S_CDC10 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 21 4 "Cdc10" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC10 20
END BEGIN
PROMPT 21 4 "Cdc10"
STRING S_CDC11 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 41 4 "Cdc11" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC11 20
END BEGIN
PROMPT 41 4 "Cdc11"
STRING S_CDC12 20 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT 61 4 "Cdc12" GROUP 1
FLAGS "B" END
CHECKTYPE NORMAL
GROUP 1 STRING S_CDC12 20
END BEGIN
PROMPT 61 4 "Cdc12"
BUTTON DLG_OK 10 2 FLAGS "B"
BEGIN CHECKTYPE NORMAL
PROMPT -13 -1 "" GROUP 1
END END
BUTTON DLG_DELREC 10 2 BUTTON DLG_OK 10 2
BEGIN BEGIN
PROMPT -23 -1 "" PROMPT -13 -1 ""
END END
BUTTON DLG_CANCEL 10 2 BUTTON DLG_DELREC 10 2
BEGIN BEGIN
PROMPT -33 -1 "" PROMPT -23 -1 ""
END END
ENDPAGE BUTTON DLG_CANCEL 10 2
BEGIN
ENDMASK 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 "cdc.h"
#include "commesse.h" #include "commesse.h"
#include "fasi.h"
#include "movana.h" #include "movana.h"
#include "pconana.h"
#include "rmovana.h" #include "rmovana.h"
#include "pconana.h"
#include "saldana.h"
#include "../cg/cglib01.h" #include "../cg/cglib01.h"
#include "ca3.h" #include "ca3.h"
@ -30,6 +32,7 @@ protected:
public: public:
TPrint_bilancio_ca_mask(); TPrint_bilancio_ca_mask();
virtual ~TPrint_bilancio_ca_mask() {}
}; };
const TString& TPrint_bilancio_ca_mask::get_report_class() const const TString& TPrint_bilancio_ca_mask::get_report_class() const
@ -411,6 +414,7 @@ class TRecordset_sezioni_contrapposte : public TRecordset
{ {
char _tipo_piano; char _tipo_piano;
TAnal_bill _filter; TAnal_bill _filter;
TArray _cdc_cms_fas;
TDate _da_data, _a_data; TDate _da_data, _a_data;
word _tipimov; word _tipimov;
bool _movimentati, _nonnulli; bool _movimentati, _nonnulli;
@ -539,26 +543,176 @@ void TRecordset_sezioni_contrapposte::add_conto(int indbil, const TString& b)
TAnal_bill bill(_filter); TAnal_bill bill(_filter);
bill.set_conto(b); 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); TString select;
const TSaldanal& sc = ca_saldo(bill, _da_data, _a_data, _saldanal_consuntivo);
if (!sp._fin.is_zero() || !sc._fin.is_zero()) if (_filter.costo().full())
{ {
TArray& a = conti(indbil); int len = _filter.costo().len();
TImporto s = sp._fin; s -= sc._fin; s.normalize(); const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_CDC);
add_conto(b, s, sp._fin, sc._fin, a); 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 else
{ {
const TSaldanal& sa = ca_saldo(bill, _da_data, _a_data, _tipimov); if ((_tipimov & _saldanal_qualsiasi) == _saldanal_qualsiasi) // Bilancio a sezioni contrapposte di raffronto
if (!sa._fin.is_zero())
{ {
const TImporto zero; const TSaldanal sp = ca_saldo(bill, _da_data, _a_data, _saldanal_preventivi);
TArray& a = conti(indbil); const TSaldanal sc = ca_saldo(bill, _da_data, _a_data, _saldanal_consuntivo);
add_conto(b, sa._fin, zero, zero, a);
} 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; TPrint_bilancio_ca_mask* _mask;
protected: 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 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; 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; TString query;
query = "USE RMOVANA KEY 4\nBY CODCMS DATACOMP\n"; 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); 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()) if (!rmovana.move_first())
return false; // Ignora commesse non movimentate return false; // Ignora commesse non movimentate

View File

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

View File

@ -4,11 +4,15 @@
#include <progind.h> #include <progind.h>
#include <reprint.h> #include <reprint.h>
#include <reputils.h> #include <reputils.h>
#include <textset.h>
#include <utility.h>
#include <doc.h> #include <doc.h>
#include <rdoc.h> #include <rdoc.h>
#include <partite.h>
#include "../cg/cg2103.h" #include "../cg/cg2103.h"
#include "../cg/cglib01.h" #include "../cg/cglib01.h"
#include "../ve/velib04.h" #include "../ve/velib04.h"
#include "..\cg\cgsaldac.h"
#include "cdc.h" #include "cdc.h"
#include "commesse.h" #include "commesse.h"
@ -23,6 +27,26 @@
#include "calib01.h" #include "calib01.h"
#include "calib02.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 // MASCHERA
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
@ -333,6 +357,7 @@ class TPrint_rendiconto_ca_recordset : public TISAM_recordset
TString_array _num_fdr; TString_array _num_fdr;
TString_array _num_par; TString_array _num_par;
TRiclass _ricl; TRiclass _ricl;
TDate _pagato_al;
protected: protected:
int _anno; 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_righe_da_rdoc(TLocalisamfile& tmp, const TPrint_rendiconto_ca_mask& msk, TLog_report& log);
void crea_trr(const TFilename& trr) const; 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, void scrive_riga(TLocalisamfile& tmp, const TRectype& rmovana, const TRectype& movana, const TDocumento* doc,
TLog_report& log); TLog_report& log);
void scrive_riga_speciale(TLocalisamfile& tmp, const TDocumento* doc, const TString_array& special_docs); void scrive_riga_speciale(TLocalisamfile& tmp, const TDocumento* doc, const TString_array& special_docs);
int sort_indbil(int indbil) const; 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 TBill& zio, TRectype& tmpcurr) const;
const TString& riclassifica(const TString& contone, TRectype& tmpcurr) const; const TString& riclassifica(const TString& contone, TRectype& tmpcurr) const;
bool is_causale_rateo_risconto(const char* codcaus) 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 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, 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 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(const TString& sql);
~TPrint_rendiconto_ca_recordset(); ~TPrint_rendiconto_ca_recordset();
@ -516,6 +545,44 @@ void TPrint_rendiconto_ca_recordset::get_budget_export(const TString& codcdc, co
ric.normalize('A'); 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 //sconvolgente metodo per la normalizzazione dei conti
real TPrint_rendiconto_ca_recordset::get_budget_print(const TString& conto, char tipo) const 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; 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 const TString& TPrint_rendiconto_ca_recordset::riclassifica(const TString& contone, TRectype& tmpcurr) const
{ {
CHECK(contone.len() == 12, "Conto di lunghezza assurda"); 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; 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 //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, void TPrint_rendiconto_ca_recordset::scrive_riga(TLocalisamfile& tmp, const TRectype& rmovana, const TRectype& movana,
const TDocumento* doc, TLog_report& log) 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 ----// //---- DOC D'ORIGINE DELL' ANALMOV ----//
//tipo movimento CONSUNTIVO (o TEMPORANEO); per i movimenti di budget (P o V) vedi l'else //tipo movimento CONSUNTIVO (o TEMPORANEO); per i movimenti di budget (P o V) vedi l'else
const char tipomov = movana.get_char(MOVANA_TIPOMOV); const char tipomov = movana.get_char(MOVANA_TIPOMOV);
#ifdef DBG //serve un documento da cui ricavare i parametri di stampa
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
TDocumento* original_doc = (TDocumento*)doc; TDocumento* original_doc = (TDocumento*)doc;
bool should_delete = false; bool should_delete = false;
if (original_doc == NULL && movana.get_long(MOVANA_DNDOC) > 0) 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 //riempie i record del file temporaneo nel caso di rmovana con documento di origine
if (selettore & FATTURATO) if (selettore & FATTURATO)
tmpcurr.put("FATTURATO", imp.valore()); tmpcurr.put(REND_FATTURATO, imp.valore());
if (selettore & MATURATO) if (selettore & MATURATO)
tmpcurr.put("MATURATO", imp.valore()); tmpcurr.put(REND_MATURATO, imp.valore());
if (selettore & IMPEGNATO) if (selettore & IMPEGNATO)
tmpcurr.put("IMPEGNATO", imp.valore()); tmpcurr.put(REND_IMPEGNATO, imp.valore());
//campi comuni a rmovana e rdoc senza particolari operazioni //campi comuni a rmovana e rdoc senza particolari operazioni
TString descr = movana.get(MOVANA_DESCR); TString descr = movana.get(MOVANA_DESCR);
@ -1106,6 +1331,9 @@ F=IMF*/
descr.ltrim(pos+1); descr.ltrim(pos+1);
descr.trim(); descr.trim();
} }
// calcolo pagato
calc_pagato(tmpcurr, rmovana, movana, original_doc, (selettore & FATTURATO) > 0, indbil);
//----Scrittura Conti sul file----// //----Scrittura Conti sul file----//
//Scrittura dei conti (i valori delle variabili sono stati settati nella parte iniziale del metodo) //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); imp.normalize(sezione_normale);
//i documenti speciali vanno SOLO in FATTURATO //i documenti speciali vanno SOLO in FATTURATO
tmpcurr.put("FATTURATO", imp.valore()); tmpcurr.put(REND_FATTURATO, imp.valore());
} }
else //if(codcaus.full() else //if(codcaus.full()
{ {
//i documenti speciali vanno SOLO in FATTURATO //i documenti speciali vanno SOLO in FATTURATO
tmpcurr.put("FATTURATO", importo); tmpcurr.put(REND_FATTURATO, importo);
} }
tmp.write(); tmp.write();
@ -1681,7 +1909,7 @@ void TPrint_rendiconto_ca_recordset::crea_trr(const TFilename& trr) const
{ {
ofstream of(trr); ofstream of(trr);
of << 1000 << endl; of << 1000 << endl;
of << 22 << endl; of << 23 << endl;
of << "ORDCONT|1|1|0|Ordinatore in base a indicatore di bilancio" << endl; of << "ORDCONT|1|1|0|Ordinatore in base a indicatore di bilancio" << endl;
of << "CONTO|1|20|0|Conto analitico" << endl; of << "CONTO|1|20|0|Conto analitico" << endl;
of << "DATA|5|8|0|Data movimento o documento" << 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 << "FATTURATO|4|18|5|Fatturato" << endl;
of << "MATURATO|4|18|5|Maturato" << endl; of << "MATURATO|4|18|5|Maturato" << endl;
of << "IMPEGNATO|4|18|5|Impegnato" << endl; of << "IMPEGNATO|4|18|5|Impegnato" << endl;
of << "PAGATO|4|18|5|Pagato" << endl;
of << "CONTOCG|1|12|0|Conto contabile" << endl; of << "CONTOCG|1|12|0|Conto contabile" << endl;
of << "HIDDEN|8|1|0|Record nascosto" << endl; of << "HIDDEN|8|1|0|Record nascosto" << endl;
of << 3 << 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); _implode_rows = msk.get_bool(F_IMPLODE_ROWS);
//c'e' un fottuto range di date? oppure si va a vita intera? //c'e' un fottuto range di date? oppure si va a vita intera?
TDate dal, al;
_dadata = msk.get_date(F_DATAINI); _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); _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 //metodi per riempire il file da cui generare il report
//dati estratti dalle righe movimenti di contabilita' analitica //dati estratti dalle righe movimenti di contabilita' analitica
@ -1846,8 +2082,10 @@ protected:
virtual void print(); virtual void print();
void esporta_csv_row(ostream& file_to_date, const int first_level, const TString& cod_cms_cdc, 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]); 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 incrementa(TToken_string& riga, const int col, const real& valore) const;
void crea_trr(const TFilename& trr) const;
void export_rendiconto();
public: public:
const TMultilevel_code_info& get_first_level() const; 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 //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 //primo livello di configurazione
const int first_level = get_first_level().logic(); 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.lower();
path.add("rendiconto.xls"); path.add("rendiconto.xls");
ofstream file_to_date(path, ios::app); 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); 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 //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 //controlla se last_codice sia pieno per non aggiungere una inutile riga di zeri all'inizio
if (last_codice.full()) if (last_codice.full())
{
esporta_csv_row(file_to_date, first_level, last_codice, importi, importi_totali); 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) 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) 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(); const bool hidden = rendy.get("HIDDEN").as_bool();
if (!hidden) if (!hidden)
{ {
const real impegnato = rendy.get("IMPEGNATO").as_real(); const real impegnato = rendy.get(REND_IMPEGNATO).as_real();
const real fatturato = rendy.get("FATTURATO").as_real(); const real fatturato = rendy.get(REND_FATTURATO).as_real();
const real maturato = rendy.get("MATURATO").as_real(); const real maturato = rendy.get(REND_MATURATO).as_real();
//occhio all'inversione ricavi/costi, che causa il ribaltamento del significato di ordcont //occhio all'inversione ricavi/costi, che causa il ribaltamento del significato di ordcont
int indbil = rendy.get("ORDCONT").as_int(); 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 //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_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 //AGGIUNGE L'EVENTUALE RIGA DEI TOTALI
TToken_string str_tot = _msk->sfield(F_RIGHE).row(r); 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; file_to_date << endl << endl;
} }
} //if(last_codice.full()) } //if(last_codice.full())
} }
//metodo per accattarsi o' primo livello della configurazione CA //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); 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() void TPrint_rendiconto_ca::main_loop()
{ {
_msk = new TPrint_rendiconto_ca_mask; _msk = new TPrint_rendiconto_ca_mask;
TPrint_rendiconto_ca_mask& mask = *_msk; 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) while (true)
{ {
//il programma deve cominciare l'eleaborazione solo nel caso di Stampa/Anteprima (K_ENTER) o Esportazione CSV (K_F6) //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); TSheet_field& sheet = mask.sfield(F_RIGHE);
TString video_string; //stringa che compare nella progind 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 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.. //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 //..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... if (anno > 0) //se non è stata specificata alcuna dataini, ma è stato specificato un anno di esercizio...
{ {
TEsercizi_contabili esc; 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 //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) 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(); if (attive)
TDate datainicms, datafcomp; {
ca_durata_commessa(rec_commesse, datainicms, datafcomp); const TRectype& rec_commesse = set.cursor()->curr();
if ((dataini.ok() && datafcomp < dataini) || (datafin.ok() && datainicms > datafin))
continue; 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 = TR("Scansione");
@ -2213,7 +2741,7 @@ void TPrint_rendiconto_ca::main_loop()
//se stampa o anteprima.. //se stampa o anteprima..
if (key == K_F6) 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 else
book.add(rep); book.add(rep);
} }
@ -2227,7 +2755,7 @@ void TPrint_rendiconto_ca::main_loop()
//..temporaneo i cui dati riempiranno il report //..temporaneo i cui dati riempiranno il report
//se stampa o anteprima //se stampa o anteprima
if (key == K_F6) //esportazione in excel 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 else
book.add(rep); //aggiunge il report relativo alla cdc/cms corrente al book 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) if (log.recordset()->items() > 0)
log.preview(); 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) if (key == K_ENTER)
book.print(); //stampa il book dei report book.print(); //stampa il book dei report
else else

View File

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

View File

@ -101,6 +101,11 @@ BEGIN
PROMPT 36 9 "Alla data " PROMPT 36 9 "Alla data "
END END
BOOLEAN F_ATTIVA
BEGIN
PROMPT 60 9 "Solo commesse attive"
END
TEXT DLG_NULL TEXT DLG_NULL
BEGIN 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!" 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" ?> <?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3700a" orientation="2" lpi="9" class="ca3700a"> <report libraries="ve1300" name="ca3700a" orientation="2" lpi="9" class="ca3700a">
<description>Rendiconto CA</description> <description>Rendiconto CA</description>
<font face="Courier New" size="8" /> <font face="Courier New" size="7" />
<section type="Head" height="5"> <section type="Head" height="5" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" /> <font italic="1" face="Courier New" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1"> <field x="1" type="Stringa" width="50" pattern="1">
<font italic="1" face="Courier New" bold="1" size="9" /> <font italic="1" face="Courier New" bold="1" size="9" />
@ -22,26 +22,27 @@
</field> </field>
<field border="2" x="1" y="2" type="Linea" width="169" height="0" pattern="1" /> <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="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="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="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="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="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="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="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="64.5" y="3.5" type="Testo" width="16" pattern="1" text="Descrizione testata" />
<field x="88" y="3.5" type="Testo" width="4" pattern="1" text="Riga" /> <field x="82" 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="86" 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="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="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="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 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 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" /> <field x="1" y="3.5" type="Testo" width="15" id="121" pattern="1" text="Rif. Contabile" />
</section> </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> <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" /> <font face="Courier New" bold="1" size="16" />
</field> </field>
<field x="1" y="3" type="Testo" width="18" pattern="1" text="Centro di Costo:" /> <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> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,CDC,CODCOSTO=#COSTO,DESCRIZ</prescript>
</field> </field>
<field x="110" y="3" type="Testo" width="14" pattern="1" text="Anno:" /> <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" /> <font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,ANNO</prescript> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,ANNO</prescript>
</field> </field>
@ -74,7 +75,7 @@
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DESCRIZ</prescript> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DESCRIZ</prescript>
</field> </field>
<field x="110" y="4.5" type="Testo" width="14" pattern="1" text="Data inizio:" /> <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" /> <font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAINIZIO</prescript> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAINIZIO</prescript>
</field> </field>
@ -94,7 +95,7 @@
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,FASI,CODFASE=#FASE,DESCRIZ</prescript> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,FASI,CODFASE=#FASE,DESCRIZ</prescript>
</field> </field>
<field x="110" y="6" type="Testo" width="14" pattern="1" text="Fine prevista:" /> <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" /> <font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAFINE</prescript> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAFINE</prescript>
</field> </field>
@ -122,7 +123,7 @@
<prescript description="H1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript> <prescript description="H1.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field> </field>
<field x="110" y="7.5" type="Testo" width="14" pattern="1" text="Fine proroga:" /> <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" /> <font face="Courier New" bold="1" size="8" />
<prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAPROR</prescript> <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DATAPROR</prescript>
</field> </field>
@ -142,27 +143,27 @@
<prescript description="H1.102 PRESCRIPT">MESSAGE ISAMREAD,CLIFO,TIPOCF=C!CODCF=#101,RAGSOC</prescript> <prescript description="H1.102 PRESCRIPT">MESSAGE ISAMREAD,CLIFO,TIPOCF=C!CODCF=#101,RAGSOC</prescript>
</field> </field>
</section> </section>
<section type="Head" level="2" height="2"> <section type="Head" level="2" height="2" pattern="1">
<groupby>ORDCONT+CONTO</groupby> <groupby>ORDCONT+CONTO</groupby>
<font italic="1" face="Courier New" size="8" /> <font italic="1" face="Courier New" size="8" />
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2</prescript> <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" /> <font italic="1" face="Courier New" bold="1" size="8" />
<source>CONTO</source> <source>CONTO</source>
<prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO</prescript> <prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO</prescript>
</field> </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" /> <font italic="1" face="Courier New" bold="1" size="8" />
<source>CONTO</source> <source>CONTO</source>
<prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript> <prescript description="H2.0 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field> </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" /> <font face="Courier New" bold="1" size="8" />
</field> </field>
<field y="0.5" type="Numero" hidden="1" align="right" width="1" id="100" pattern="1"> <field y="0.5" type="Numero" hidden="1" align="right" width="1" id="100" pattern="1">
<source>#INDBIL</source> <source>#INDBIL</source>
</field> </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" /> <font italic="1" face="Courier New" bold="1" size="8" />
<source>#VARIAZIONE</source> <source>#VARIAZIONE</source>
<postscript description="H2.700 POSTSCRIPT">#THIS @ \ prende il proprio valore <postscript description="H2.700 POSTSCRIPT">#THIS @ \ prende il proprio valore
@ -174,7 +175,7 @@
+! \ esegue la ADD sul campo di destinazione +! \ esegue la ADD sul campo di destinazione
</postscript> </postscript>
</field> </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" /> <font italic="1" face="Courier New" bold="1" size="8" />
<source>#PREVENTIVO</source> <source>#PREVENTIVO</source>
<postscript description="H2.800 POSTSCRIPT">#THIS @ \ prende il proprio valore <postscript description="H2.800 POSTSCRIPT">#THIS @ \ prende il proprio valore
@ -187,7 +188,7 @@
</postscript> </postscript>
</field> </field>
</section> </section>
<section type="Head" level="3"> <section type="Head" level="3" pattern="1">
<groupby>CODNUM+ANNO+NUMRD</groupby> <groupby>CODNUM+ANNO+NUMRD</groupby>
<field x="1" type="Stringa" hidden="1" align="right" width="4" pattern="1"> <field x="1" type="Stringa" hidden="1" align="right" width="4" pattern="1">
<source>CODNUM</source> <source>CODNUM</source>
@ -199,8 +200,8 @@
<source>NUMRD</source> <source>NUMRD</source>
</field> </field>
</section> </section>
<section type="Body" /> <section type="Body" pattern="1" />
<section type="Body" level="1"> <section type="Body" level="1" pattern="1">
<condition>HIDDEN!='X'</condition> <condition>HIDDEN!='X'</condition>
<field x="19" y="0.5" type="Numero" align="right" width="7" pattern="1" hide_zero="1"> <field x="19" y="0.5" type="Numero" align="right" width="7" pattern="1" hide_zero="1">
<source>NUMREG</source> <source>NUMREG</source>
@ -217,20 +218,23 @@
<field x="54" y="0.5" type="Data" width="10" pattern="1"> <field x="54" y="0.5" type="Data" width="10" pattern="1">
<source>DATADOCRIF</source> <source>DATADOCRIF</source>
</field> </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" /> <font face="Arial Narrow" size="8" />
<source>DESC</source> <source>DESC</source>
</field> </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> <source>NRIGA</source>
</field> </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" /> <font face="Arial Narrow" size="8" />
<source>DESCRIGA</source> <source>DESCRIGA</source>
</field> </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> <source>DOCORIG</source>
</field> </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="###.###.###,@@"> <field x="131" y="0.5" type="Valuta" align="right" width="13" pattern="1" text="###.###.###,@@">
<source>FATTURATO</source> <source>FATTURATO</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F2.400</postscript> <postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F2.400</postscript>
@ -271,7 +275,7 @@
<source>NUMRD</source> <source>NUMRD</source>
</field> </field>
</section> </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 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="1" y="0.75" type="Testo" width="10" pattern="1" text="Commessa" />
<field x="11" y="0.75" type="Stringa" width="20" pattern="1"> <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> <prescript description="F0.0 PRESCRIPT">CA_FORMAT_FASE</prescript>
</field> </field>
</section> </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 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'"> <field x="90" y="1" type="Testo" width="15" pattern="1" text="ATTIVITA'">
<font italic="1" face="Courier New" bold="1" size="9" /> <font italic="1" face="Courier New" bold="1" size="9" />
@ -439,7 +443,7 @@
<source>#304-#804</source> <source>#304-#804</source>
</field> </field>
</section> </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 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;"> <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" /> <font face="Courier New" bold="1" size="8" />
@ -491,7 +495,7 @@
<source>#H2.700+#H2.800-#800</source> <source>#H2.700+#H2.800-#800</source>
</field> </field>
</section> </section>
<section type="Foot" level="3"> <section type="Foot" level="3" pattern="1">
<prescript description="F3 PRESCRIPT">0 #B1.100 !</prescript> <prescript description="F3 PRESCRIPT">0 #B1.100 !</prescript>
</section> </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"> <report libraries="ve1300" name="ca3800a" orientation="2" lpi="6">
<description>Bilancio commessa CA</description> <description>Bilancio commessa CA</description>
<font face="Arial Narrow" size="8" /> <font face="Arial Narrow" size="8" />
<section type="Head"> <section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1"> <field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source> <source>#SYSTEM.RAGSOC</source>
@ -38,21 +38,28 @@
<source>"MARGINE CONTRIBUZIONE"</source> <source>"MARGINE CONTRIBUZIONE"</source>
</field> </field>
</section> </section>
<section type="Head" level="1"> <section type="Head" level="1" pattern="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"> <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" /> <font face="Courier New" bold="1" size="16" />
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>ANNO</source> <source>ANNO</source>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>TIPOSTIMA</source> <source>TIPOSTIMA</source>
<list> <list>
@ -72,24 +79,40 @@
<li Value="Consuntivi" Code="X" /> <li Value="Consuntivi" Code="X" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>VITAINTERA</source> <source>VITAINTERA</source>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>FASESPEC</source> <source>FASESPEC</source>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>CDCSPEC</source> <source>CDCSPEC</source>
</field> </field>
@ -106,10 +129,10 @@
</field> </field>
<field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" /> <field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" />
</section> </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> <groupby>(LEVEL&#3C;2)||(LEVEL=4)</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <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> <source>LEVEL</source>
<list> <list>
<li Value="Commesse terminate nel" Code="0" /> <li Value="Commesse terminate nel" Code="0" />
@ -119,7 +142,7 @@
<li Value="Commesse di supporto del" Code="4" /> <li Value="Commesse di supporto del" Code="4" />
</list> </list>
</field> </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> <source>ANNO</source>
</field> </field>
<field border="1" x="1" y="1.25" type="Linea" width="169" height="0" pattern="1" /> <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> <postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
</field> </field>
</section> </section>
<section type="Head" level="3" height="1.5"> <section type="Head" level="3" height="1.5" pattern="1">
<groupby>LEVEL</groupby> <groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="3" type="Array" bg_color="#C0C0C0" width="45" pattern="1"> <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> <postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
</field> </field>
</section> </section>
<section type="Head" level="4" hidden="1"> <section type="Head" level="4" hidden="1" pattern="1">
<condition>(STAMPAFASI != "" )||(STAMPACDC != "")</condition> <condition>(STAMPAFASI != "" )||(STAMPACDC != "")</condition>
<groupby>CODCMS</groupby> <groupby>CODCMS</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -166,8 +189,8 @@
<source>0</source> <source>0</source>
</field> </field>
</section> </section>
<section type="Body" /> <section type="Body" pattern="1" />
<section type="Body" level="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 description="B1 PRESCRIPT">1 #H4.3 \ incrementa il contatore per il numero di righe di fase
+!</prescript> +!</prescript>
<field x="1" type="Stringa" width="17" id="1" pattern="1"> <field x="1" type="Stringa" width="17" id="1" pattern="1">
@ -248,7 +271,7 @@ THEN
#THIS !</prescript> #THIS !</prescript>
</field> </field>
</section> </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 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"> <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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -258,14 +281,14 @@ THEN
<source>ANNO</source> <source>ANNO</source>
</field> </field>
</section> </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" /> <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 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="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="###.###.###,@@" /> <field x="74" y="1.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@" />
</section> </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" /> <font italic="1" face="Courier New" bold="1" size="8" />
<prescript description="F2 PRESCRIPT">#LEVEL @ <prescript description="F2 PRESCRIPT">#LEVEL @
4 = IF 4 = IF
@ -274,7 +297,7 @@ ELSE
"90@" DISABLE "90@" DISABLE
THEN</prescript> THEN</prescript>
<field border="1" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" /> <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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<source>H2.101</source> <source>H2.101</source>
<list> <list>
@ -285,18 +308,18 @@ THEN</prescript>
<li Value="TOTALI Commesse di supporto del" Code="4" /> <li Value="TOTALI Commesse di supporto del" Code="4" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<source>H2.102</source> <source>H2.102</source>
</field> </field>
<field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1"> <field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1">
<groups>90</groups> <groups>90</groups>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups> <groups>90</groups>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups> <groups>90</groups>
<source>H2.102</source> <source>H2.102</source>
@ -317,7 +340,7 @@ MESSAGE RESET,169
</postscript> </postscript>
</field> </field>
</section> </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" /> <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 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"> <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> MESSAGE RESET,169</postscript>
</field> </field>
</section> </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> <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" /> <font italic="1" face="Arial Narrow" size="8" />
<field x="22" type="Testo" width="15" pattern="1" text="Totali commessa" /> <field x="22" type="Testo" width="15" pattern="1" text="Totali commessa" />
@ -354,4 +377,4 @@ MESSAGE RESET,169</postscript>
</field> </field>
</section> </section>
<sql>USE SALDANA</sql> <sql>USE SALDANA</sql>
</report> </report>

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3800b" orientation="2" lpi="6"> <report libraries="ve1300" name="ca3800b" orientation="2" lpi="6">
<description>Bilancio commessa CA riassuntivo per fasi</description> <description>Bilancio commessa CA riassuntivo per fasi</description>
<font face="Arial Narrow" size="8" /> <font face="Arial Narrow" size="8" />
<section type="Head"> <section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1"> <field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source> <source>#SYSTEM.RAGSOC</source>
@ -30,17 +30,24 @@
<source>"MARGINE CONTRIBUZIONE"</source> <source>"MARGINE CONTRIBUZIONE"</source>
</field> </field>
</section> </section>
<section type="Head" level="1"> <section type="Head" level="1" pattern="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"> <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" /> <font face="Courier New" bold="1" size="16" />
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>TIPOSTIMA</source> <source>TIPOSTIMA</source>
<list> <list>
@ -49,10 +56,10 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" /> <li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source> <source>DETRCONS</source>
<list> <list>
@ -60,10 +67,10 @@
<li Value="Consuntivi" Code="X" /> <li Value="Consuntivi" Code="X" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>DEPTH</source> <source>DEPTH</source>
<list> <list>
@ -71,31 +78,46 @@
<li Value="Conto" Code="2" /> <li Value="Conto" Code="2" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>VITAINTERA</source> <source>VITAINTERA</source>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </field>
<field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" /> <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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>FASESPEC</source> <source>FASESPEC</source>
<postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript> <postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript>
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>ANNO</source> <source>ANNO</source>
</field> </field>
</section> </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> <groupby>(LEVEL&#3C;2)||(LEVEL=4)</groupby>
<font italic="1" face="Arial Narrow" size="8" /> <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> <source>LEVEL</source>
<list> <list>
<li Value="Commesse terminate nel" Code="0" /> <li Value="Commesse terminate nel" Code="0" />
@ -105,7 +127,7 @@
<li Value="Commesse di supporto del" Code="4" /> <li Value="Commesse di supporto del" Code="4" />
</list> </list>
</field> </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> <source>ANNO</source>
</field> </field>
<field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1"> <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> <postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
</field> </field>
</section> </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> <groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" size="8" /> <font italic="1" face="Arial Narrow" size="8" />
<field x="3" type="Array" bg_color="#C0C0C0" width="45" pattern="1"> <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> <postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
</field> </field>
</section> </section>
<section type="Body" /> <section type="Body" pattern="1" />
<section type="Body" level="1" hidden="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 description="B1 PRESCRIPT">1 #H4.3 \ incrementa il contatore per il numero di righe di fase
+!</prescript> +!</prescript>
<field x="65.5" type="Testo" align="center" width="2" pattern="1" text="%" /> <field x="65.5" type="Testo" align="center" width="2" pattern="1" text="%" />
@ -176,7 +198,7 @@
</field> </field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" /> <field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</section> </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 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"> <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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -186,11 +208,11 @@
<source>H1.2</source> <source>H1.2</source>
</field> </field>
</section> </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" /> <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 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="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"> <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" /> <font italic="1" face="Arial" bold="1" size="8" />
</field> </field>
<field x="36" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> <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> <postscript description="F1.169 POSTSCRIPT">MESSAGE RESET,169</postscript>
</field> </field>
</section> </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" /> <font italic="1" face="Courier New" size="8" />
<prescript description="F2 PRESCRIPT">#LEVEL @ <prescript description="F2 PRESCRIPT">#LEVEL @
&#09;4 = IF &#09;4 = IF
@ -207,7 +229,7 @@
&#09; "90@" DISABLE &#09; "90@" DISABLE
THEN</prescript> THEN</prescript>
<field border="1" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" /> <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" /> <font italic="1" face="Arial Narrow" size="8" />
<source>H2.101</source> <source>H2.101</source>
<list> <list>
@ -218,18 +240,18 @@
<li Value="TOTALI Commesse di supporto del" Code="4" /> <li Value="TOTALI Commesse di supporto del" Code="4" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="8" />
<source>H2.102</source> <source>H2.102</source>
</field> </field>
<field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1"> <field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1">
<groups>90</groups> <groups>90</groups>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups> <groups>90</groups>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups> <groups>90</groups>
<source>H2.102</source> <source>H2.102</source>
@ -248,7 +270,7 @@
MESSAGE RESET,169</postscript> MESSAGE RESET,169</postscript>
</field> </field>
</section> </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" /> <font italic="1" face="Arial Narrow" size="8" />
<field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1"> <field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
<source>H3.101</source> <source>H3.101</source>
@ -274,4 +296,4 @@ MESSAGE RESET,169
</field> </field>
</section> </section>
<sql>USE SALDANA</sql> <sql>USE SALDANA</sql>
</report> </report>

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3800c" orientation="2" lpi="6"> <report libraries="ve1300" name="ca3800c" orientation="2" lpi="6">
<description>Bilancio commessa CA riassuntivo per CdC</description> <description>Bilancio commessa CA riassuntivo per CdC</description>
<font face="Arial Narrow" size="8" /> <font face="Arial Narrow" size="8" />
<section type="Head"> <section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1"> <field x="1" type="Stringa" width="50" pattern="1">
<source>#SYSTEM.RAGSOC</source> <source>#SYSTEM.RAGSOC</source>
@ -30,14 +30,21 @@
<source>"MARGINE CONTRIBUZIONE"</source> <source>"MARGINE CONTRIBUZIONE"</source>
</field> </field>
</section> </section>
<section type="Head" level="1"> <section type="Head" level="1" pattern="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"> <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" /> <font face="Courier New" bold="1" size="16" />
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </field>
<field x="75" y="3" type="Array" width="35" pattern="1"> <field x="75" y="3" type="Array" width="35" pattern="1">
@ -49,10 +56,10 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" /> <li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source> <source>DETRCONS</source>
<list> <list>
@ -60,10 +67,10 @@
<li Value="Consuntivi" Code="X" /> <li Value="Consuntivi" Code="X" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>DEPTH</source> <source>DEPTH</source>
<list> <list>
@ -71,31 +78,46 @@
<li Value="Conto" Code="2" /> <li Value="Conto" Code="2" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>VITAINTERA</source> <source>VITAINTERA</source>
</field> </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" /> <font italic="1" face="Arial Narrow" size="9" />
</field> </field>
<field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" /> <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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>CDCSPEC</source> <source>CDCSPEC</source>
<postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript> <postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript>
</field> </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" /> <font face="Arial Narrow" bold="1" size="9" />
<source>ANNO</source> <source>ANNO</source>
</field> </field>
</section> </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> <groupby>(LEVEL&#3C;2)||(LEVEL=4)</groupby>
<font italic="1" face="Arial Narrow" size="8" /> <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> <source>LEVEL</source>
<list> <list>
<li Value="Commesse terminate nel" Code="0" /> <li Value="Commesse terminate nel" Code="0" />
@ -105,7 +127,7 @@
<li Value="Commesse di supporto del" Code="4" /> <li Value="Commesse di supporto del" Code="4" />
</list> </list>
</field> </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> <source>ANNO</source>
</field> </field>
<field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1"> <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> <postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript>
</field> </field>
</section> </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> <groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" size="8" /> <font italic="1" face="Arial Narrow" size="8" />
<field x="3" type="Array" bg_color="#C0C0C0" width="45" pattern="1"> <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> <postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript>
</field> </field>
</section> </section>
<section type="Body" /> <section type="Body" pattern="1" />
<section type="Body" level="1" hidden="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 description="B1 PRESCRIPT">1 #H4.3 \ incrementa il contatore per il numero di righe di cdc
+!</prescript> +!</prescript>
<field x="65.5" type="Testo" align="center" width="2" pattern="1" text="%" /> <field x="65.5" type="Testo" align="center" width="2" pattern="1" text="%" />
@ -176,7 +198,7 @@
</field> </field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" /> <field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</section> </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 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"> <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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
@ -186,11 +208,11 @@
<source>H1.2</source> <source>H1.2</source>
</field> </field>
</section> </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" /> <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 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="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"> <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" /> <font italic="1" face="Arial" bold="1" size="8" />
</field> </field>
<field x="46.5" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> <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> <postscript description="F1.169 POSTSCRIPT">MESSAGE RESET,169</postscript>
</field> </field>
</section> </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" /> <font italic="1" face="Courier New" size="8" />
<prescript description="F2 PRESCRIPT">#LEVEL @ <prescript description="F2 PRESCRIPT">#LEVEL @
&#09;4 = IF &#09;4 = IF
@ -207,7 +229,7 @@
&#09; "90@" DISABLE &#09; "90@" DISABLE
THEN</prescript> THEN</prescript>
<field border="1" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" /> <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" /> <font italic="1" face="Arial Narrow" size="8" />
<source>H2.101</source> <source>H2.101</source>
<list> <list>
@ -218,18 +240,18 @@ THEN</prescript>
<li Value="TOTALI Commesse di supporto del" Code="4" /> <li Value="TOTALI Commesse di supporto del" Code="4" />
</list> </list>
</field> </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" /> <font italic="1" face="Arial Narrow" size="8" />
<source>H2.102</source> <source>H2.102</source>
</field> </field>
<field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1"> <field border="1" x="1" y="3.25" deactivated="1" type="Linea" width="169" height="0" pattern="1">
<groups>90</groups> <groups>90</groups>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups> <groups>90</groups>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<groups>90</groups> <groups>90</groups>
<source>H2.102</source> <source>H2.102</source>
@ -248,7 +270,7 @@ THEN</prescript>
MESSAGE RESET,169</postscript> MESSAGE RESET,169</postscript>
</field> </field>
</section> </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" /> <font italic="1" face="Arial Narrow" size="8" />
<field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1"> <field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
<source>H3.101</source> <source>H3.101</source>
@ -274,4 +296,4 @@ MESSAGE RESET,169
</field> </field>
</section> </section>
<sql>USE SALDANA</sql> <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, TAssoc_array& TPrint_saldana_recordset::get_row(TAssoc_array& cms, const char* chiave,
const int indice, const TString& codcms, const TString& fase, const int indice, const TString& codcms, const TString& fase,
const TString& 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 //cerca se la commessa (e l'eventuale fase) esistono gia' nell'assocarray delle commesse
TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave); TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave);
@ -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("LEVEL", str_indice);
riga_array->add("CODCMS", codcms); riga_array->add("CODCMS", codcms);
if (_tipo == 8) if (_tipo == 8 || _tipo == 9)
{ {
riga_array->add("FASE", fase); riga_array->add("FASE", fase);
riga_array->add("CDC", cdc); riga_array->add("CDC", cdc);
} }
riga_array->add("DESCRIZ", descrizione); 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) //inizializza i campi importo sicuramente presenti (modifica DECISIVA)
//senza questa inizializzazione, nel caso trovasse campi nulli (in realta' 0), il bastardo.. //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.. //..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 //saldi normali:Maturato
if (!imp_saldo.is_zero()) if (!imp_saldo.is_zero())
{ {
livello.format("%s_MAT", indbil == 3 ? "COS" : "RIC"); 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? //ci sono filtri o raggruppamenti per fase o centro di costo?
chiave = codcms; chiave = codcms;
//selezione fasi solo su bilancio commessa (_tipo=8) //selezione fasi solo su bilancio commessa e stima costi ricavi (_tipo=8 e 9)
if (_tipo == 8 && (_tipostampa >= 1 && _tipostampa <= 3)) 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 //se vuole entrambi i livelli di dettaglio occorre sapere chi e' il babbo delle fasi o dei cdc
if (_tipostampa == 3) if (_tipostampa == 3)
@ -653,7 +658,7 @@ void TPrint_saldana_recordset::parse_saldana(TAssoc_array* cms, const TDate& dat
if (_tipo == 9) if (_tipo == 9)
{ {
//non vanno considerati saldi di esercizi futuri a quello scelto!!! //non vanno considerati saldi di esercizi futuri a quello scelto!!!
query = "USE SALDANA"; query = crea_query_saldana();
} }
TISAM_recordset saldana_set(query); TISAM_recordset saldana_set(query);
@ -710,7 +715,10 @@ void TPrint_saldana_recordset::parse_saldana(TAssoc_array* cms, const TDate& dat
if (_tipo == 8) if (_tipo == 8)
{ {
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc, 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 //aggiunge gli importi e normalizza
aggiorna_importo(riga_array, gruppo, indbil, saldana); 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) //stima ricavi ca3900 (_tipo=9)
else else
{ {
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, EMPTY_STRING, EMPTY_STRING, 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 //aggiunge gli importi e normalizza
if (anno_saldo > _anno) // gestione saldo nel futuro if (anno_saldo > _anno) // gestione saldo nel futuro
{ {
if (indice > 1) // considera i saldop solo se è una commessa che termina 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.. //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 //..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; TString80 conto;
parse_bill(conto_anale, 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); const TImporto importo_riga(rmovana.get_char(RMOVANA_SEZIONE), importo);
//riga array da aggiungere agli arrayoni da mandare in stampa //riga array da aggiungere agli arrayoni da mandare in stampa
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc, 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); TRectype saldana(LF_SALDANA);
saldana.put(SALDANA_ANNO, _anno); 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 //aggiunge gli importi e normalizza
aggiorna_importo(riga_array, gruppo, indbil, saldana); aggiorna_importo(riga_array, gruppo, indbil, saldana);
aggiorna_importo(riga_array, conto, 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); parse_rdoc_fatture(cms, datainiesc, datafinesc);
} }
} //if(_tipo==8)... } //if(_tipo==8)...
else
if (_tipo == 9)
{
if (_include_documenti)
{
parse_rdoc_ordini(cms, datainiesc, datafinesc);
parse_rdoc_fatture(cms, datainiesc, datafinesc);
}
}
// 3) // 3)
@ -1463,151 +1488,149 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const
} }
else else
if (strcmp(column_name, "DEPTH") == 0) if (strcmp(column_name, "DEPTH") == 0)
{ var.set(_depth);
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");
}
else else
if (strcmp(column_name, "STAMPAFASI") == 0) if (strcmp(column_name, "DETRCONS") == 0)
{ var.set(_detrazioni_consuntive == true ? "X" : "");
var.set((_tipostampa == 1 || _tipostampa == 3) ? "X" : ""); else
} if (strcmp(column_name, "VITAINTERA") == 0)
else var.set(_vitaintera == true ? "SI" : "NO");
if (strcmp(column_name, "FASESPEC") == 0) else
{ if (strcmp(column_name, "INCLUDE_DOCUMENTI") == 0)
if (_tipostampa == 1 || _tipostampa == 3 || _tipostampa == 4) var.set(_include_documenti == true ? "SI" : "NO");
var.set(_fase); else
else if (strcmp(column_name, "DAL") == 0)
var.set(EMPTY_STRING); var.set(_dal);
} else
else if (strcmp(column_name, "AL") == 0)
if (strcmp(column_name, "STAMPACDC") == 0) var.set(_al);
{ else
var.set((_tipostampa == 2 || _tipostampa == 3) ? "X" : ""); if (strcmp(column_name, "STAMPAFASI") == 0)
} var.set((_tipostampa == 1 || _tipostampa == 3) ? "X" : "");
else else
if (strcmp(column_name, "CDCSPEC") == 0) if (strcmp(column_name, "FASESPEC") == 0)
{ {
if (_tipostampa == 2 || _tipostampa == 3 || _tipostampa == 8) if (_tipostampa == 1 || _tipostampa == 3 || _tipostampa == 4)
var.set(_cdc); var.set(_fase);
else else
var.set(EMPTY_STRING); var.set(EMPTY_STRING);
} }
else else
if (strcmp(column_name, "DATAINI") == 0) if (strcmp(column_name, "STAMPACDC") == 0)
{ var.set((_tipostampa == 2 || _tipostampa == 3) ? "X" : "");
const TString& codcms = get("CODCMS").as_string(); else
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms); if (strcmp(column_name, "CDCSPEC") == 0)
var.set(rec_commesse.get(COMMESSE_DATAINIZIO)); {
} if (_tipostampa == 2 || _tipostampa == 3 || _tipostampa == 8)
else var.set(_cdc);
if (strcmp(column_name, "DATAFINE") == 0) else
{ var.set(EMPTY_STRING);
const TString& codcms = get("CODCMS").as_string(); }
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms); else
TDate datafine = rec_commesse.get(COMMESSE_DATAPROR); if (strcmp(column_name, "DATAINI") == 0)
if (!datafine.ok()) {
datafine = rec_commesse.get(COMMESSE_DATAFINE); const TString& codcms = get("CODCMS").as_string();
var.set(datafine); const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
} var.set(rec_commesse.get(COMMESSE_DATAINIZIO));
else }
if (strcmp(column_name, "AVANZAMENTO") == 0) else
{ if (strcmp(column_name, "DATAFINE") == 0)
//RICAVI {
//------ const TString& codcms = get("CODCMS").as_string();
//Calcola lo stato di avanzamento della commessa in caso di stima x Tempo const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
//In questo caso i ricavihanno una % di avanzamento legata alla durata della commessa (prorogata ecc.).. TDate datafine = rec_commesse.get(COMMESSE_DATAPROR);
//..rispetto al momento della stampa if (!datafine.ok())
real avanzamento; datafine = rec_commesse.get(COMMESSE_DATAFINE);
if (_tipostima == 'T') var.set(datafine);
{ }
avanzamento = calcola_avanzamento_tempo(); else
} if (strcmp(column_name, "AVANZAMENTO") == 0)
else //se stima e' di tipo Costi/Ricavi invece....Allah!! {
{ //RICAVI
//In caso di stampa Ricavi nei casi _tipostime = 'C' o 'R', l'avanzamento è calcolato in base agli importi. //------
//Caso 'C': valore_preventivo / totale_preventivo //Calcola lo stato di avanzamento della commessa in caso di stima x Tempo
//Caso 'R': valore_consuntivo / totale_preventivo (!) richiesta specifica Adolfo-Enrichetta 24-03-2011 //In questo caso i ricavihanno una % di avanzamento legata alla durata della commessa (prorogata ecc.)..
TAssoc_array& riga = (TAssoc_array&)_righe[_curr]; //..rispetto al momento della stampa
const real val = get("RICAVI").as_real(); real avanzamento;
if (!val.is_zero()) if (_tipostima == 'T')
{ {
const int indice = get("LEVEL").as_int(); avanzamento = calcola_avanzamento_tempo();
const TString& codcms = get("CODCMS").as_string(); }
#ifdef DBG else //se stima e' di tipo Costi/Ricavi invece....Allah!!
if (codcms == "FP10VB22388OP") {
const int cazzone = 1; //In caso di stampa Ricavi nei casi _tipostime = 'C' o 'R', l'avanzamento è calcolato in base agli importi.
#endif //Caso 'C': valore_preventivo / totale_preventivo
TAssoc_array& riga_tot = get_row((TAssoc_array&)_totali[indice], codcms, indice, codcms, EMPTY_STRING, EMPTY_STRING, //Caso 'R': valore_consuntivo / totale_preventivo (!) richiesta specifica Adolfo-Enrichetta 24-03-2011
"RICAVI"); TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
const TString* stric = (const TString*)riga_tot.objptr("RICAVI"); const real val = get("RICAVI").as_real();
if (stric && stric->full()) if (!val.is_zero())
{ {
const real totric = *stric; const int indice = get("LEVEL").as_int();
if (!totric.is_zero()) const TString& codcms = get("CODCMS").as_string();
avanzamento = val * CENTO / totric; 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())
var.set(avanzamento); {
} const real totric = *stric;
else //if(strcmp(column_name,AVANZAMENTO... if (!totric.is_zero())
{ avanzamento = val * CENTO / totric;
TAssoc_array& riga = (TAssoc_array&)_righe[_curr]; }
if (strncmp(column_name, "RECORD.", 7) == 0) }
column_name += 7; }
if (avanzamento > CENTO)
//COSTI avanzamento = CENTO;
//----- var.set(avanzamento);
if (strcmp(column_name, "COS_PERC") == 0) }
{ else //if(strcmp(column_name,AVANZAMENTO...
const int indice = get("LEVEL").as_int(); {
if (indice == 4) TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
int cazzone = 100; if (strncmp(column_name, "RECORD.", 7) == 0)
//la % dei costi, in caso si forzi il maturato (considerare finite le commesse che terminano nell'esercizio selezionato).. column_name += 7;
//..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 //COSTI
if (_forza_maturato && (indice <= 1 || indice == 4)) //-----
var.set(CENTO); if (strcmp(column_name, "COS_PERC") == 0)
else {
{ const int indice = get("LEVEL").as_int();
const TString* val_bdg = (TString*)riga.objptr("COS_BDG"); //la % dei costi, in caso si forzi il maturato (considerare finite le commesse che terminano nell'esercizio selezionato)..
if (val_bdg == NULL || real::is_null(*val_bdg)) //..viene posta artificialmente pari a 100% nelle sezioni delle commesse che terminano nell'esercizio selezionato (sez. 0 e 1)..
var.set(CENTO); //..e nella sezione delle commesse di supporto (sez. 4). Richiesta Adolfica del 08/03/2011
else if (_forza_maturato && (indice <= 1 || indice == 4))
{ var.set(CENTO);
const TString* val_mat = (TString*)riga.objptr("COS_MAT"); else
if (val_mat == NULL || real::is_null(*val_mat)) {
var.set(ZERO); const TString* val_bdg = (TString*)riga.objptr("COS_BDG");
else if (val_bdg == NULL || real::is_null(*val_bdg))
{ var.set(CENTO);
const real bdg(*val_bdg); else
const real mat(*val_mat); {
real perc = mat * CENTO / bdg; const TString* val_mat = (TString*)riga.objptr("COS_MAT");
perc.round(2); if (val_mat == NULL || real::is_null(*val_mat))
var.set(perc); var.set(ZERO);
} else
} {
} const real bdg(*val_bdg);
} const real mat(*val_mat);
else real perc = mat * CENTO / bdg;
{ perc.round(2);
const TString* val = (TString*)riga.objptr(column_name); if (perc > CENTO)
if (val) perc = CENTO;
var.set(*val); var.set(perc);
else
var.set_null(); }
} }
} }
}
else
{
const TString* val = (TString*)riga.objptr(column_name);
if (val)
var.set(*val);
else
var.set_null();
}
}
return var; return var;
} }
return NULL_VARIANT; 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]; _tipostima = msk.get(F_TIPOSTIMA)[0];
_vitaintera = msk.get_bool(F_VITAINTERA); _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); _include_documenti = msk.get_bool(F_INCLUDE_DOCUMENTI);
_depth = msk.get_int(F_DEPTH); _depth = msk.get_int(F_DEPTH);
_tipostampa = msk.get_int(F_TIPOSTAMPA); _tipostampa = msk.get_int(F_TIPOSTAMPA);
@ -1662,8 +1687,30 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_
break; break;
} }
} //if(tipo==8.. } //if(tipo==8..
else
if (_tipo == 9) if (_tipo == 9)
{ {
_forza_maturato = msk.get_bool(F_FORZA_MATURATO); _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 _detrazioni_consuntive;
bool _include_documenti; bool _include_documenti;
bool _forza_maturato; bool _forza_maturato;
bool _inevasi;
char _tipostima; char _tipostima;
TDate _dal;
TDate _al;
protected: protected:
virtual int tipo() const { return _tipo; } virtual int tipo() const { return _tipo; }
@ -129,7 +133,9 @@ protected:
TAssoc_array& get_row(TAssoc_array& cms, const char* chiave, TAssoc_array& get_row(TAssoc_array& cms, const char* chiave,
const int indice, const TString& codcms, const TString& fase, const int indice, const TString& codcms, const TString& fase,
const TString& 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: public:
virtual void set_filter(const TMask& msk, const TString& curr_sublevel); 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" PROMPT 2 6 "Considerare finite le commesse che terminano nell'esercizio selezionato"
END 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 GROUPBOX F_PRE0 76 5
BEGIN BEGIN
PROMPT 0 12 "@bPrefisso del piano dei conti analitico:" PROMPT 0 12 "@bPrefisso del piano dei conti analitico:"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<report libraries="ve1300" name="ca3900a" orientation="2" lpi="6" class="ca3900a"> <report libraries="ve1300" name="ca3900a" orientation="2" lpi="6" class="ca3900a">
<description>Stima ricavi di competenza CA</description> <description>Stima ricavi di competenza CA</description>
<font face="Arial Narrow" size="8" /> <font face="Arial Narrow" size="7" />
<section type="Head" pattern="1"> <section type="Head" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<field x="1" type="Stringa" width="50" pattern="1"> <field x="1" type="Stringa" width="50" pattern="1">
@ -19,28 +19,97 @@
<field x="154" type="Numero" align="right" width="3" pattern="1"> <field x="154" type="Numero" align="right" width="3" pattern="1">
<source>#REPORT.PAGE</source> <source>#REPORT.PAGE</source>
</field> </field>
<field border="2" x="1" y="1.5" 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="63.5" y="2" type="Testo" align="center" width="8" pattern="1" text="COSTI" /> <field x="1" y="1.75" type="Testo" width="12" pattern="1" text="Include inevasi">
<field x="107" y="2" type="Testo" align="center" width="20" pattern="1" text="RICAVI" /> <font italic="1" face="Arial Narrow" size="9" />
<field x="152" y="2.25" type="Testo" align="right" width="8" pattern="1" text="Margine" /> </field>
<field x="51" y="3" type="Testo" align="right" width="8" pattern="1" text="Budget" /> <field x="13.5" y="1.75" type="Stringa" width="3" pattern="1">
<field x="61" y="3" type="Testo" align="right" width="12" pattern="1" text="Maturati" /> <font face="Arial Narrow" bold="1" size="9" />
<field x="75" y="3" type="Testo" align="right" width="12" pattern="1" text="Avanzamento" /> <source>INCLUDE_DOCUMENTI</source>
<field x="88" y="3" type="Testo" align="right" width="12" pattern="1" text="Budget" /> </field>
<field x="102" y="3" type="Testo" align="right" width="12" pattern="1" text="Competenza" /> <field x="19" y="1.75" type="Testo" width="15" pattern="1" text="Fase specificata">
<field x="116" y="3" type="Testo" align="right" width="12" pattern="1" text="Accertato" /> <font italic="1" face="Arial Narrow" size="9" />
<field x="130" y="3" type="Testo" align="right" width="12" pattern="1" text="Integrazione" /> <prescript description="H0.0 PRESCRIPT">#FASESPEC @
<field x="150" y="3" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " /> EMPTY= IF
<field border="1" x="1" y="4" type="Linea" width="164" height="0" pattern="1" /> #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" /> <field x="1" y="3" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
</section> </section>
<section type="Head" level="1" height="4" pattern="1"> <section type="Head" level="1" height="4" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1 <prescript description="H1 PRESCRIPT">MESSAGE RESET,F1
</prescript> </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" /> <font face="Courier New" bold="1" size="16" />
</field> </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"> <field x="0.96" y="3" type="Numero" hidden="1" align="right" width="4" id="2" pattern="1">
<source>ANNO</source> <source>ANNO</source>
</field> </field>
@ -50,7 +119,7 @@
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2 <prescript description="H2 PRESCRIPT">MESSAGE RESET,F2
</prescript> </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"> <field type="Numero" hidden="1" align="right" width="1" id="97" pattern="1">
<source>LEVEL</source> <source>LEVEL</source>
<postscript description="H2.97 POSTSCRIPT">MESSAGE COPY,F2.97</postscript> <postscript description="H2.97 POSTSCRIPT">MESSAGE COPY,F2.97</postscript>
@ -73,7 +142,7 @@
<groupby>LEVEL</groupby> <groupby>LEVEL</groupby>
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="H3 PRESCRIPT">MESSAGE RESET,F3</prescript> <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"> <field type="Numero" hidden="1" align="right" width="1" id="97" pattern="1">
<source>LEVEL</source> <source>LEVEL</source>
<postscript description="H3.97 POSTSCRIPT">MESSAGE COPY,F3.97</postscript> <postscript description="H3.97 POSTSCRIPT">MESSAGE COPY,F3.97</postscript>
@ -94,28 +163,54 @@
<field x="1" type="Stringa" width="17" pattern="1"> <field x="1" type="Stringa" width="17" pattern="1">
<source>CODCMS</source> <source>CODCMS</source>
</field> </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" /> <font face="Arial Narrow" size="7" />
<source>DESCRIZ</source> <source>DESCRIZ</source>
</field> </field>
<field x="83" type="Testo" align="center" width="2" pattern="1" text="%" /> <field x="1" y="1" type="Stringa" width="9" id="5" pattern="1">
<field x="164" type="Testo" align="center" width="2" pattern="1" text="%" /> <source>FASE</source>
<field x="45" type="Valuta" align="right" width="14" id="101" pattern="1" text="###.###.###,@@"> <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> <source>#COS_BDG</source>
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F3.101</postscript> <postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F3.101</postscript>
</field> </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> <source>#COS_MAT</source>
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F3.102</postscript> <postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F3.102</postscript>
</field> </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> <source>#COS_PERC</source>
</field> </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> <source>#RIC_BDG</source>
<postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F3.104</postscript> <postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F3.104</postscript>
</field> </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 @ <prescript description="B1.105 PRESCRIPT">#103 @
#104 @ #104 @
* *
@ -124,18 +219,18 @@
#THIS !</prescript> #THIS !</prescript>
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F3.105</postscript> <postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F3.105</postscript>
</field> </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> <source>#RIC_MAT</source>
<postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F3.106</postscript> <postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F3.106</postscript>
</field> </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 @ <prescript description="B1.107 PRESCRIPT">#105 @
#106 @ #106 @
- -
#THIS !</prescript> #THIS !</prescript>
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F3.107</postscript> <postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F3.107</postscript>
</field> </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 @ <prescript description="B1.108 PRESCRIPT">#105 @
#102 @ #102 @
- -
@ -143,7 +238,7 @@
</prescript> </prescript>
<postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F3.108</postscript> <postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F3.108</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" size="8" />
<prescript description="B1.109 PRESCRIPT">#105 @ <prescript description="B1.109 PRESCRIPT">#105 @
0 0
@ -163,7 +258,7 @@ THEN
</field> </field>
</section> </section>
<section type="Foot" pattern="1"> <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"> <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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
</field> </field>
@ -174,13 +269,13 @@ THEN
</section> </section>
<section type="Foot" level="1" height="3" pattern="1"> <section type="Foot" level="1" height="3" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <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="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="95.5" 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="173" 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="58.5" 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="72.5" 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="89.5" y="1.5" type="Numero" align="right" width="6" id="103" pattern="1" text="##@,@@">
<prescript description="F1.103 PRESCRIPT">#101 @ <prescript description="F1.103 PRESCRIPT">#101 @
0 = IF 0 = IF
100 100
@ -197,12 +292,12 @@ ELSE
THEN THEN
#THIS !</prescript> #THIS !</prescript>
</field> </field>
<field x="86" y="1.5" type="Valuta" align="right" width="14" id="104" pattern="1" text="###.###.###,@@" /> <field x="98" 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="112" 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="126" 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="140" 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="154.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="168.5" y="1.5" type="Numero" align="right" width="5" id="109" pattern="1">
<prescript description="F1.109 PRESCRIPT">#105 @ <prescript description="F1.109 PRESCRIPT">#105 @
0 0
= =
@ -222,11 +317,11 @@ THEN
</section> </section>
<section type="Foot" level="2" height="2.5" pattern="1"> <section type="Foot" level="2" height="2.5" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" /> <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 border="1" x="1" y="0.5" type="Linea" width="174" height="0" pattern="1" />
<field x="83" y="1" type="Testo" align="center" width="2" pattern="1" text="%"> <field x="95" y="1" type="Testo" align="center" width="2" pattern="1" text="%">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
</field> </field>
<field y="1" type="Numero" hidden="1" align="right" width="1" id="97" pattern="1" /> <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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<source>H2.99</source> <source>H2.99</source>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript> <postscript description="F2.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript> <postscript description="F2.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="F2.103 PRESCRIPT">#101 @ <prescript description="F2.103 PRESCRIPT">#101 @
0 = IF 0 = IF
@ -271,27 +366,27 @@ ELSE
THEN THEN
#THIS !</prescript> #THIS !</prescript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.104 POSTSCRIPT">MESSAGE ADD,F1.104</postscript> <postscript description="F2.104 POSTSCRIPT">MESSAGE ADD,F1.104</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.105 POSTSCRIPT">MESSAGE ADD,F1.105</postscript> <postscript description="F2.105 POSTSCRIPT">MESSAGE ADD,F1.105</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.106 POSTSCRIPT">MESSAGE ADD,F1.106</postscript> <postscript description="F2.106 POSTSCRIPT">MESSAGE ADD,F1.106</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.107 POSTSCRIPT">MESSAGE ADD,F1.107</postscript> <postscript description="F2.107 POSTSCRIPT">MESSAGE ADD,F1.107</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<postscript description="F2.108 POSTSCRIPT">MESSAGE ADD,F1.108</postscript> <postscript description="F2.108 POSTSCRIPT">MESSAGE ADD,F1.108</postscript>
</field> </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" /> <font italic="1" face="Arial Narrow" bold="1" size="8" />
<prescript description="F2.109 PRESCRIPT">#105 @ <prescript description="F2.109 PRESCRIPT">#105 @
0 0
@ -312,9 +407,9 @@ THEN
</section> </section>
<section type="Foot" level="3" height="2" pattern="1"> <section type="Foot" level="3" height="2" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="8" /> <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 border="1" x="2" y="0.25" type="Linea" width="174" height="0" pattern="1" />
<field x="83" y="0.5" type="Testo" align="center" width="2" pattern="1" text="%" /> <field x="95.5" 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 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 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"> <field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" id="98" pattern="1">
<source>H3.98</source> <source>H3.98</source>
@ -326,14 +421,14 @@ THEN
<li Value="TOTALI Commesse di supporto" Code="4" /> <li Value="TOTALI Commesse di supporto" Code="4" />
</list> </list>
</field> </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> <postscript description="F3.101 POSTSCRIPT">MESSAGE ADD,F2.101</postscript>
</field> </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 description="F3.102 POSTSCRIPT">MESSAGE ADD,F2.102
</postscript> </postscript>
</field> </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 @ <prescript description="F3.103 PRESCRIPT">#101 @
0 = IF 0 = IF
100 100
@ -350,22 +445,22 @@ ELSE
THEN THEN
#THIS !</prescript> #THIS !</prescript>
</field> </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> <postscript description="F3.104 POSTSCRIPT">MESSAGE ADD,F2.104</postscript>
</field> </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> <postscript description="F3.105 POSTSCRIPT">MESSAGE ADD,F2.105</postscript>
</field> </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> <postscript description="F3.106 POSTSCRIPT">MESSAGE ADD,F2.106</postscript>
</field> </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> <postscript description="F3.107 POSTSCRIPT">MESSAGE ADD,F2.107</postscript>
</field> </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> <postscript description="F3.108 POSTSCRIPT">MESSAGE ADD,F2.108</postscript>
</field> </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 @ <prescript description="F3.109 PRESCRIPT">#105 @
0 0
= =
@ -384,4 +479,4 @@ THEN
</field> </field>
</section> </section>
<sql>USE SALDANA</sql> <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 TFieldref& field = mci.fieldref(i);
const int length = field.to() - field.from(); const int length = field.to() - field.from();
out << "IN " << field << ' ' << (key_id+i); 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 << " SE";
out << '\n'; out << '\n';
out << "DI \"" << prompt; 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, 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; TWait_cursor hourglass;
const TMultilevel_code_info& mci = ca_multilevel_code_info(logicnum); 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); kfld = &msk.add_number(kid, page, prompt, tab0, y+i, picture.len(), flags);
else else
kfld = &msk.add_string(kid, page, prompt, tab0, y+i, picture.len(), flags); 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) if ((mode & 0x1) != 0 && fieldname == NULL)
kfld->set_key(1); 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++) 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); TEdit_field& dfld = msk.add_string(did, page, "", tab1, y+i, 50, "B", 72+tab0-tab1);
ca_create_browse2(dfld, i, logicnum, key_id); ca_create_browse2(dfld, i, logicnum, key_id);
if ((mode & 0x2) != 0 && fieldname == NULL) 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 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) 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; numero_campi += sh;
} }
} else } 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(); const int h = ca_multilevel_code_info(LF_COMMESSE).levels();
int sh = 0; 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); const int sh = ca_create_fields_compact(m, 0, LF_FASI, x, y++, dlg, dlg + 50);
first_fase = dlg; 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; numero_campi += sh;
} }
if (conto_fld) //Crea conto if (conto_fld && *conto_fld) //Crea conto
{ {
const bool use_pdcc = ini.get_bool("UsePdcc"); const bool use_pdcc = ini.get_bool("UsePdcc");
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA; 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++) for (short id = first_fase; id < first_fase + 4; id++)
{ {
const TMask_field& fld = m.field(id); const TMask_field& fld = m.field(id);
if (fld.prompt() != fase_fld) if(fld.prompt() != fase_fld)
break; break;
const int len = fld.size(); const int len = fld.size();
row.add(cdc.mid(pos, len), sheet.cid2index(id)); 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); 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) bool TSimple_anal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{ {
switch (o.dlg()) switch (o.dlg())
@ -2080,7 +2093,9 @@ bool TAnal_app::user_create()
void TAnal_app::init_query_mode(TMask& mask) void TAnal_app::init_query_mode(TMask& mask)
{ {
TSimple_anal_msk& m = (TSimple_anal_msk&)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); const short id = m.get_field_id(i, 1);
if (id <= 0 || m.id2pos(id) < 0) if (id <= 0 || m.id2pos(id) < 0)
@ -2095,6 +2110,16 @@ void TAnal_app::init_query_mode(TMask& mask)
d.enable_check(); d.enable_check();
d.set_field(""); 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)); 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) int TAnal_app::write(const TMask& m)
{ {
const int err = TRelation_application::write(m);
_msk->update_tree_field(); _msk->update_tree_field();
return TRelation_application::write(m); return err;
} }
int TAnal_app::rewrite(const TMask& m) int TAnal_app::rewrite(const TMask& m)
{ {
const int err = TRelation_application::rewrite(m);
_msk->update_tree_field(); _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() 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; 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); 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, 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, 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); 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 //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, 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, 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); 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(const TRectype& rec, int k = 1) const;
virtual const TToken_string& get_key_value(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 bool user_destroy();
virtual int write(const TMask& m); virtual int write(const TMask& m);
virtual int rewrite(const TMask& m); virtual int rewrite(const TMask& m);
virtual bool remove();
void init_key_fields(TSimple_anal_msk & m) const; 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_query_mode(TMask& mask);
virtual void init_modify_mode(TMask& mask); virtual void init_modify_mode(TMask& mask);
virtual void init_insert_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 //metodo per ricavare la durata di una commessa
long ca_durata_commessa(const TRectype& rec_commesse, TDate& dataini, TDate& datafine); 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 #endif

View File

@ -21,9 +21,26 @@ void TSaldanal::copy(const TSaldanal& sa)
_dare = sa._dare; _dare = sa._dare;
_avere = sa._avere; _avere = sa._avere;
_fin = sa._fin; _fin = sa._fin;
_iniind = sa._iniind;
_dareind = sa._dareind;
_avereind = sa._avereind;
_finind = sa._finind;
_movimentato = sa._movimentato; _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 // 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; TString query, select;
if (b.costo().full()) if (b.costo().full())
select << "(COSTO=='" << b.costo() << "')"; select << "(COSTO=='" << (b.costo() == "~" ? "" : b.costo()) << "')";
if (b.commessa().full()) if (b.commessa().full())
{ {
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(COMMESSA=='" << b.commessa() << "')"; select << "(COMMESSA=='" << (b.commessa() == "~" ? "" : b.commessa()) << "')";
} }
if (b.fase().full()) if (b.fase().full())
{ {
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(FASE=='" << b.fase() << "')"; select << "(FASE=='" << (b.fase() == "~" ? "" : b.fase()) << "')";
} }
if (da_anno > 0) if (da_anno > 0)
{ {
@ -903,19 +920,19 @@ bool TSaldi_cache::int_saldo_movimenti(const TAnal_bill& b,
{ {
if (select.full()) if (select.full())
select << "&&"; select << "&&";
select << "(CODCCOSTO==\"" << b.costo() << "\")"; select << "(CODCCOSTO==\"" << (b.costo() == "~" ? "" : b.costo()) << "\")";
} }
if (b.commessa().full()) if (b.commessa().full())
{ {
if (select.full()) if (select.full())
select << "&&"; select << "&&";
select << "(CODCMS==\"" << b.commessa() << "\")"; select << "(CODCMS==\"" << (b.commessa() == "~" ? "" : b.commessa()) << "\")";
} }
if (b.fase().full()) if (b.fase().full())
{ {
if (select.full()) if (select.full())
select << "&&"; 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!).. //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 //..l'eventuale filtro sulle date va fatto nella SELECT

View File

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