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

@ -68,6 +68,7 @@ protected:
virtual void ini2mask(TConfig& ini, TMask&m, bool query);
virtual void mask2ini(const TMask& m, TConfig& ini);
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool filtered() const;
virtual void init_modify_mode(TMask& mask);
@ -75,6 +76,10 @@ protected:
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TCms_anal_msk; }
virtual bool user_create();
public:
TCms_app() {}
};
void TCms_app::fin2row(const TMask& m)

View File

@ -68,6 +68,8 @@ class TFsc_app : public TAnal_app
bool _has_filter;
protected:
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
virtual bool filtered() const;
virtual bool protected_record(TRectype& record);
virtual TSimple_anal_msk* create_mask() const { return new TFsc_anal_msk; }

View File

@ -59,6 +59,35 @@ bool TRiparti_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
{
//gestione tipo di ripartizioni possibili
//0 = percentuale; 1 = in base al peso economico della commessa; 2 = per parti (modello cocktail)
case F_TIPO:
if (e == fe_init || e == fe_modify)
{
TSheet_field& sf = sfield(F_SHEET);
const char tipo = o.get()[0];
switch (tipo)
{
case 'I':
sf.enable_column(sf.cid2index(118));
break;
case 'B':
case 'P':
default:
{
sf.enable_column(sf.cid2index(118), false);
const int items = sf.items();
for (int r = 0; r < items; r++ )
{
TToken_string & row = sf.row(r);
row.add("", sf.cid2index(118));
}
}
break;
}
sf.force_update();
}
case F_TIPORIP:
if (e == fe_init || e == fe_modify)
{
@ -421,7 +450,7 @@ void TRiparti_app::write_rows()
if (has_tot)
diff -= rec.get_real(RRIP_RIPARTO);
}
if (has_tot && !_msk->get_real(F_DIFFERENZA).is_zero())
if (has_tot && _msk->get_real(F_DIFFERENZA) != ZERO)
{
if (yesno_box(FR("Il totale da ripartire differisce di %s\ndal totale delle righe devo aggiungere la differenza all'ultima riga"), diff.stringa()))
a[a.last_row()].add(RRIP_RIPARTO, diff);
@ -469,6 +498,7 @@ bool TRiparti_app::get_next_key(TToken_string& key)
TString query;
query << "USE RIP\nFROM TIPO=" << tipo << "\nTO TIPO=" << tipo;
TISAM_recordset rip_recset(query);
const long items = rip_recset.items();
if (rip_recset.move_last())
num += rip_recset.get(RIP_CODICE).as_int();

View File

@ -393,9 +393,11 @@ BEGIN
DISPLAY "Codice@20" CODART
DISPLAY "Descrizione@50" DESCR
OUTPUT 118 CODART
OUTPUT 260 DESCR
CHECKTYPE NORMAL
ADD RUN ve2 -3
FIELD CODART
MODULE CI
END

View File

@ -9,6 +9,7 @@
#include <textset.h>
#include <utility.h>
#include "movana.h"
#include "rmovana.h"
#include "calib01.h"
#include "calib02.h"
@ -267,9 +268,17 @@ TPrint_contixcms_recordset* TPrint_contixcms::elabora() const
TString query;
query << "USE RMOVANA KEY 3\n";
if (_has_ca)
query << "SELECT (BETWEEN(CODCMS,#CODCMS,#CODCMS))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))\n";
query << "SELECT (BETWEEN(CODCMS,#CODCMS,#CODCMS))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))";
else
query << "SELECT (BETWEEN(CODCMS,#DACODCMS,#ACODCMS))&&(BETWEEN(CODFASE,#DACODFASE,#ACODFASE))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))\n";
query << "SELECT (BETWEEN(CODCMS,#DACODCMS,#ACODCMS))&&(BETWEEN(CODFASE,#DACODFASE,#ACODFASE))&&(BETWEEN(CODCONTO,#DACODCONTO,#ACODCONTO))";
const TString4 tipomov = _mask->get(F_TIPOMOV);
if (tipomov.full())
query << "&&(" << LF_MOVANA << "->" << MOVANA_TIPOMOV << (tipomov == "N" ? "==" : "!=") << "\"\")";
query << "\n";
if (tipomov.full())
query << "JOIN MOVANA INTO NUMREG==NUMREG\n";
query << "FROM DATACOMP=#DADATA\n";
query << "TO DATACOMP=#ADATA";

View File

@ -27,6 +27,7 @@
#define F_CONTOFIN 123
#define F_SOTTOCFIN 124
#define F_DESCRFIN 125
#define F_TIPOMOV 126
#define F_HIDESOTT 130

View File

@ -349,6 +349,14 @@ BEGIN
PROMPT 1 21 "Nascondi sottoconti"
END
LIST F_TIPOMOV 24
BEGIN
PROMPT 32 21 "Selezione movimenti "
ITEM " |Qualsiasi"
ITEM "N|Normale"
ITEM "P|Preventivo e variazione"
END
STRING F_REPORT 50
BEGIN
PROMPT 1 22 "Report personalizzato "

View File

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

View File

@ -47,9 +47,10 @@
#define S_CON2 117
#define S_CON3 118
#define S_CON4 119
#define S_CODART 120
#define S_DESCART 121
#define S_CDC_ORI 122
#define S_CMS_ORI 123
#define S_FAS_ORI 124
#define S_CON_ORI 125
#define S_DES_CON 120
#define S_CODART 121
#define S_DESCART 122
#define S_CDC_ORI 123
#define S_CMS_ORI 124
#define S_FAS_ORI 125
#define S_CON_ORI 126

View File

@ -286,6 +286,7 @@ BEGIN
ITEM "Con 2"
ITEM "Con 3"
ITEM "Con 4"
ITEM "Descrizione conto@50"
ITEM "Articolo@20"
ITEM "Descrizione@30"
ITEM "Cdc.Orig."
@ -347,6 +348,141 @@ BEGIN
FIELD DESCR
END
STRING S_CDC1 50
BEGIN
PROMPT 1 4 "Cdc 1"
USE LF_CDC
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC2 50
BEGIN
PROMPT 21 5 "Cdc 2"
COPY USE S_CDC1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC3 50
BEGIN
PROMPT 41 6 "Cdc 3"
COPY USE S_CDC1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC4 50
BEGIN
PROMPT 61 7 "Cdc 4"
COPY USE S_CDC1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS1 50
BEGIN
PROMPT 1 8 "Cms 1"
USE LF_COMMESSE
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS2 50
BEGIN
PROMPT 21 9 "Cms 2"
COPY USE S_CMS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS3 50
BEGIN
PROMPT 41 10 "Cms 3"
COPY USE S_CMS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS4 50
BEGIN
PROMPT 61 11 "Cms 4"
COPY USE S_CMS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS1 50
BEGIN
PROMPT 1 12 "Fas 1"
USE LF_FASI
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS2 50
BEGIN
PROMPT 21 13 "Fas 2"
COPY USE S_FAS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS3 50
BEGIN
PROMPT 41 14 "Fas 3"
COPY USE S_FAS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS4 50
BEGIN
PROMPT 61 15 "Fas 4"
COPY USE S_FAS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON1 50
BEGIN
PROMPT 1 16 "Con 1"
USE LF_PCON
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON2 50
BEGIN
PROMPT 21 17 "Con 2"
COPY USE S_CON1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON3 50
BEGIN
PROMPT 41 18 "Con 3"
COPY USE S_CON1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON4 50
BEGIN
PROMPT 61 19 "Con 4"
COPY USE S_CON1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_DES_CON 50
BEGIN
PROMPT 61 19 ""
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CODART 20
BEGIN
PROMPT 1 2 "Articolo "
@ -371,134 +507,6 @@ BEGIN
CHECKTYPE NORMAL
END
STRING S_CDC1 20
BEGIN
PROMPT 1 4 "Cdc 1"
USE LF_CDC
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC2 20
BEGIN
PROMPT 21 5 "Cdc 2"
COPY USE S_CDC1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC3 20
BEGIN
PROMPT 41 6 "Cdc 3"
COPY USE S_CDC1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC4 20
BEGIN
PROMPT 61 7 "Cdc 4"
COPY USE S_CDC1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS1 20
BEGIN
PROMPT 1 8 "Cms 1"
USE LF_COMMESSE
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS2 20
BEGIN
PROMPT 21 9 "Cms 2"
COPY USE S_CMS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS3 20
BEGIN
PROMPT 41 10 "Cms 3"
COPY USE S_CMS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CMS4 20
BEGIN
PROMPT 61 11 "Cms 4"
COPY USE S_CMS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS1 20
BEGIN
PROMPT 1 12 "Fas 1"
USE LF_FASI
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS2 20
BEGIN
PROMPT 21 13 "Fas 2"
COPY USE S_FAS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS3 20
BEGIN
PROMPT 41 14 "Fas 3"
COPY USE S_FAS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_FAS4 20
BEGIN
PROMPT 61 15 "Fas 4"
COPY USE S_FAS1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON1 20
BEGIN
PROMPT 1 16 "Con 1"
USE LF_PCON
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON2 20
BEGIN
PROMPT 21 17 "Con 2"
COPY USE S_CON1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON3 20
BEGIN
PROMPT 41 18 "Con 3"
COPY USE S_CON1
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CON4 20
BEGIN
PROMPT 61 19 "Con 4"
COPY USE S_CON1
CHECKTYPE NORMAL
GROUP 1
END
TEXT DLG_NULL
BEGIN
PROMPT 1 20 "@bValori originali pre-ripartizione"
@ -532,6 +540,32 @@ BEGIN
FIELD CODCONTORI
END
STRING S_ART 20
BEGIN
PROMPT 2 23 "Articolo "
USE LF_ANAMAG
INPUT CODART S_ART
DISPLAY "Codice@20" CODART
DISPLAY "Descrizione@50" DESCR
OUTPUT S_ART CODART
OUTPUT S_DES_ART DESCR
CHECKTYPE NORMAL
FIELD CODART
MODULE CI
END
STRING S_DES_ART 50 40
BEGIN
PROMPT 35 23 ""
USE LF_ANAMAG KEY 2
INPUT DESCR S_DES_ART
DISPLAY "Codice@20" CODART
DISPLAY "Descrizione@50" DESCR
COPY OUTPUT S_ART
CHECKTYPE SEARCH
MODULE CI
END
ENDPAGE
ENDMASK

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3100a" lpi="8" class="ca3100b">
<description>Movimenti CA per numero registrazione</description>
<font face="Courier New" size="8" />
<section type="Head">
<section type="Head" pattern="1">
<font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E;
@ -21,18 +21,18 @@ THEN
<source>#REPORT.PAGE</source>
</field>
<field x="10" y="1.25" type="Testo" width="12" pattern="1" text="Dal numero" />
<field x="22" y="1.25" type="Numero" width="12" pattern="1">
<field x="22" y="1.25" type="Numero" align="right" width="12" pattern="1" hide_zero="1">
<font face="Courier New" bold="1" size="8" />
<source>#DANUMREG</source>
</field>
<field x="40" y="1.25" type="Testo" width="12" pattern="1" text="Al numero" />
<field x="52" y="1.25" type="Numero" 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" />
<source>#ANUMREG</source>
</field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" />
<field x="1.5" y="3" type="Testo" align="center" width="7" pattern="1" text="N.Reg." />
<field x="33.5" y="3" type="Testo" align="center" width="10" pattern="1" text="Data Doc." />
<field x="33.5" y="3" type="Testo" align="center" width="11" pattern="1" text="Fine Comp." />
<field x="45.5" y="3" type="Testo" align="center" width="8" pattern="1" text="N.Reg.CG" />
<field x="55" y="3" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="62" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Doc." />
@ -41,24 +41,25 @@ THEN
<field x="125" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Mov." />
<field x="133" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Dare" />
<field x="147" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Avere" />
<field border="2" x="1" y="4" type="Linea" width="161" height="0" pattern="1" />
<field x="33.5" y="4" type="Testo" align="center" width="11" pattern="1" text="Data Doc." />
<field border="2" x="1" y="5" type="Linea" width="161" height="0" pattern="1" />
<field x="10" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
<field x="22" y="3" type="Testo" width="10" id="122" pattern="1" text="Data Comp." />
<field x="22" y="3" type="Testo" width="11" id="122" pattern="1" text="Data Comp." />
</section>
<section type="Head" level="1" height="3">
<section type="Head" level="1" height="3" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" pattern="2" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<font face="Courier New" bold="1" size="16" />
</field>
</section>
<section type="Head" level="2">
<section type="Head" level="2" pattern="1">
<groupby>NUMREG</groupby>
<field x="1" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
<source>MOVANA.NUMREG</source>
</field>
<field x="34" y="1" type="Data" width="10" pattern="1">
<source>MOVANA.DATADOC</source>
<field x="34" y="1" type="Data" width="11" pattern="1">
<source>MOVANA.DATAFCOMP</source>
</field>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
<source>MOVANA.NUMREGCG</source>
@ -99,6 +100,9 @@ IF
THEN
</prescript>
</field>
<field x="34" y="2" type="Data" width="11" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
@ -114,12 +118,12 @@ THEN
<field x="10" y="1" type="Data" width="10" id="121" pattern="1">
<source>MOVANA.DATAREG</source>
</field>
<field x="22" y="1" type="Data" align="right" width="10" id="122" pattern="1">
<field x="22" y="1" type="Data" align="right" width="11" id="122" pattern="1">
<source>MOVANA.DATACOMP</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<prescript description="B1 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
@ -169,8 +173,8 @@ THEN
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
</field>
</section>
<section type="Foot" height="1" />
<section type="Foot" level="1">
<section type="Foot" height="1" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
<font face="Courier New" bold="1" size="8" />
@ -182,7 +186,7 @@ THEN
<font face="Courier New" bold="1" size="8" />
</field>
</section>
<section type="Foot" level="2" />
<section type="Foot" level="2" pattern="1" />
<sql>USE RMOVANA
JOIN MOVANA INTO NUMREG==NUMREG</sql>
<prescript description="PRESCRIPT">: SCAMBIA_CAMPI ( F1 F2 -- )

View File

@ -2,7 +2,7 @@
<report libraries="ve1300" name="ca3100b" lpi="8" class="ca3100b">
<description>Movimenti CA per data</description>
<font face="Courier New" size="8" />
<section type="Head">
<section type="Head" pattern="1">
<font italic="1" face="Courier New" size="8" />
<prescript description="H0 PRESCRIPT">#ESERCIZIO @
0 &#3E;
@ -32,7 +32,7 @@ THEN
</field>
<field border="2" x="1" y="2.5" type="Linea" width="161" height="0" pattern="1" />
<field x="13" y="3" type="Testo" align="center" width="7" pattern="1" text="N.Reg." />
<field x="33" y="3" type="Testo" align="center" width="10" pattern="1" text="Data Doc." />
<field x="33" y="3" type="Testo" align="center" width="11" pattern="1" text="Fine Comp." />
<field x="45" y="3" type="Testo" align="center" width="8" pattern="1" text="N.Reg.CG" />
<field x="55" y="3" type="Testo" align="center" width="6" pattern="1" text="N.Doc." />
<field x="62" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Doc." />
@ -41,29 +41,30 @@ THEN
<field x="124" y="3" type="Testo" align="center" width="7" pattern="1" text="Tp.Mov." />
<field x="131" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Dare" />
<field x="146" y="3" type="Testo" align="center" width="15" pattern="1" text="Totale Avere" />
<field border="2" x="1" y="4" type="Linea" width="161" height="0" pattern="1" />
<field x="33" y="4" type="Testo" align="center" width="11" pattern="1" text="Data Doc." />
<field border="2" x="1" y="5" type="Linea" width="161" height="0" pattern="1" />
<field x="1" y="3" type="Testo" align="center" width="10" id="121" pattern="1" text="Data Reg." />
<field x="22" y="3" type="Testo" width="10" id="122" pattern="1" text="Data Comp." />
<field x="22" y="3" type="Testo" width="11" id="122" pattern="1" text="Data Comp." />
</section>
<section type="Head" level="1" height="3">
<section type="Head" level="1" height="3" pattern="1">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="161" height="2.5" pattern="2" text="MOVIMENTI DI CONTABILITA' ANALITICA">
<font face="Courier New" bold="1" size="16" />
</field>
</section>
<section type="Head" level="2">
<section type="Head" level="2" pattern="1">
<groupby>IF (#ANNO &#3E; 0,MOVANA.DATACOMP,MOVANA.DATAREG)</groupby>
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2.131
MESSAGE RESET,F2.132</prescript>
</section>
<section type="Head" level="3">
<section type="Head" level="3" pattern="1">
<groupby>NUMREG</groupby>
<field x="13" y="1" type="Numero" align="right" link="107.NUMREG" width="7" pattern="1">
<source>MOVANA.NUMREG</source>
</field>
<field x="34" y="1" type="Data" width="10" pattern="1">
<source>MOVANA.DATADOC</source>
<field x="34" y="1" type="Data" width="11" pattern="1">
<source>MOVANA.DATAFCOMP</source>
</field>
<field x="47" y="1" type="Numero" align="right" link="23.NUMREG" width="7" pattern="1" hide_zero="1">
<source>MOVANA.NUMREGCG</source>
@ -104,6 +105,9 @@ IF
THEN
</prescript>
</field>
<field x="34" y="2" type="Data" width="11" pattern="1">
<source>MOVANA.DATADOC</source>
</field>
<field x="8" y="3" type="Testo" align="center" width="4" pattern="1" text="Riga" />
<field x="13" y="3" type="Testo" width="23" pattern="1" text="Centro di Costo" />
<field x="37" y="3" type="Testo" width="23" pattern="1" text="Commessa" />
@ -116,12 +120,12 @@ THEN
<field x="1" y="1" type="Data" width="10" id="121" pattern="1">
<source>MOVANA.DATAREG</source>
</field>
<field x="22" y="1" type="Data" align="right" width="10" id="122" pattern="1">
<field x="22" y="1" type="Data" align="right" width="11" id="122" pattern="1">
<source>MOVANA.DATACOMP</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<prescript description="B1 PRESCRIPT">#ESERCIZIO @
0 &#3E;
IF
@ -173,8 +177,8 @@ THEN
MESSAGE ADD,F2.132</postscript>
</field>
</section>
<section type="Foot" height="1" />
<section type="Foot" level="1">
<section type="Foot" height="1" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="2" x="1" y="1" type="Linea" width="161" height="0" pattern="1" />
<field x="101" y="1.5" type="Testo" width="30" pattern="1" text="Totale generale per sezione:">
<font face="Courier New" bold="1" size="8" />
@ -186,13 +190,13 @@ MESSAGE ADD,F2.132</postscript>
<font face="Courier New" bold="1" size="8" />
</field>
</section>
<section type="Foot" level="2">
<section type="Foot" level="2" pattern="1">
<field border="1" x="2" y="1" type="Linea" width="160" height="0" pattern="1" />
<field x="110" y="1.5" type="Testo" width="20" pattern="1" text="Totale giornaliero:" />
<field x="131" y="1.25" type="Valuta" align="right" width="15" id="131" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="146" y="1.25" type="Valuta" align="right" width="15" id="132" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="3" />
<section type="Foot" level="3" pattern="1" />
<sql>USE RMOVANA
JOIN MOVANA INTO NUMREG==NUMREG
BY MOVANA-&#3E;#DATAORD</sql>

View File

@ -466,6 +466,8 @@ void TPrint_mastrini_ca_alternative_recordset::set_filter(const TPrint_mastrini_
_tipoconti = msk.get_int(F_TIPOCONTI);
//scandisce il piano dei conti analitico creando un cursore con i conti nell'intervallo scelto sulla maschera
if (cms_row >= 0)
{
TPconana_recordset pconana;
pconana.set_filter(' ', _daconto, _aconto, _codcosto, _codcms, _codfas,
@ -546,7 +548,7 @@ void TPrint_mastrini_ca_alternative_recordset::set_filter(const TPrint_mastrini_
}
} //end for su pconana_items
}
}
////////////////////////////////////////////////////////
@ -629,6 +631,13 @@ void TPrint_mastrini_ca::print_or_preview(const bool stampa)
TSheet_field& sheet = _mask->sfield(F_RIGHE);
TString video_string; //stringa che compare nella progind
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
{
if (_mask->get_bool(F_PERCONTO))
{
rep.set_filter(*_mask, -1); //fa la set filter sulla prima riga (che è quella usata)
book.add(rep);
}
else
{
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
@ -696,6 +705,7 @@ void TPrint_mastrini_ca::print_or_preview(const bool stampa)
book.add(rep);
}
sheet.destroy(); //cancella le commesse aggiunte in automatico sullo sheet
}
}
else
{

View File

@ -23,6 +23,7 @@
#define F_DATAFIN 251
#define F_TIPOCONTI 252
#define F_TIPIMOV 253
#define F_PERCONTO 254
//sheet di pagina 2
#define F_RIGHE 260

View File

@ -69,7 +69,7 @@ BEGIN
ADD NONE
END
GROUPBOX DLG_NULL 78 6
GROUPBOX DLG_NULL 78 7
BEGIN
PROMPT 1 5 "@bOpzioni stampa"
END
@ -110,9 +110,14 @@ BEGIN
ITEM "P|Preventivo e variazione"
END
BOOLEAN F_PERCONTO
BEGIN
PROMPT 2 10 "Non suddivisi per Commessa/CDC "
END
SPREADSHEET F_RIGHE -1 -1
BEGIN
PROMPT 0 11 ""
PROMPT 0 12 ""
ITEM "Cdc1"
ITEM "Cdc2"
ITEM "Cdc3"

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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