Patch level : 12.0 426
Files correlati : ce0.exe ce0a00.rep ce3.exe ce4.exe ce3900.msk ce3900b.rep ce4100a.msk ce4100b.mskce ce4500a.rep cemenu.men MODIFICHE CRPA Coefficiente di durata nella tabella esercizi cespiti Ordinamento per cespite nella stampa inventario sintetico Stampa etichette cespiti Copia della ripartizione cespiti da un esercizio a un altro Stampa del costo storico e del residuo nella stampa cespiti per analitica git-svn-id: svn://10.65.10.50/branches/R_10_00@23998 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b3f1c89ef8
commit
ac3bc208e9
@ -141,6 +141,7 @@ class TCCC_mask : public TAutomask
|
||||
public:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
TCCC_mask();
|
||||
virtual ~TCCC_mask() { }
|
||||
};
|
||||
|
||||
//costruttore: se la chiave ha l'analitica fa comparire i campi per cms/cdc/fase
|
||||
@ -364,6 +365,7 @@ real TCCE_mask::calc_coeff(const TDate& ies, const TDate& fes) const
|
||||
const int sm = ies.year()*12 + ies.month();
|
||||
coeff = real(fm - sm + 1) / real(12);
|
||||
}
|
||||
coeff.round(9);
|
||||
return coeff;
|
||||
}
|
||||
|
||||
@ -399,8 +401,17 @@ bool TCCE_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case F_DURATA:
|
||||
if (e == fe_init && !field(F_CODESER).empty())
|
||||
{
|
||||
const TDate ies = get_date(F_DATAINI);
|
||||
const TDate fes = get_date(F_DATAFINE);
|
||||
set(F_DURATA, fes-ies+1);
|
||||
set(F_COEFF_DURATA, calc_coeff(ies, fes));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
42
src/ce/ce0a00a.rep
Normal file
42
src/ce/ce0a00a.rep
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report name="ce0a00a" cpi="17" orientation="2" lpi="6" class="repcom">
|
||||
<description>Etichette standard cespiti</description>
|
||||
<font face="Courier New" size="7" />
|
||||
<section type="Head" pattern="1" />
|
||||
<section type="Head" level="1" pattern="1" />
|
||||
<section type="Body" pattern="1" />
|
||||
<section type="Body" level="1" width="60" height="8" pattern="1">
|
||||
<field type="Testo" valign="bottom" width="5" pattern="1" text="Cod.">
|
||||
<font face="Courier New" size="10" />
|
||||
</field>
|
||||
<field x="6" type="Stringa" valign="bottom" width="16" pattern="1">
|
||||
<font face="Courier New" size="10" />
|
||||
<source>IDCESPITE</source>
|
||||
</field>
|
||||
<field y="1" type="Testo" valign="bottom" width="5" pattern="1" text="Imp.">
|
||||
<font face="Courier New" size="10" />
|
||||
</field>
|
||||
<field x="6" y="1" type="Stringa" valign="bottom" width="53" pattern="1">
|
||||
<font face="Courier New" size="10" />
|
||||
<source>201@.S0</source>
|
||||
</field>
|
||||
<field y="2" type="Testo" valign="bottom" width="4" pattern="1" text="Ubic.">
|
||||
<font face="Courier New" size="10" />
|
||||
</field>
|
||||
<field x="6" y="2" type="Stringa" valign="bottom" width="53" pattern="1">
|
||||
<font face="Courier New" size="10" />
|
||||
<source>202@.S0</source>
|
||||
</field>
|
||||
<field y="3.5" type="Stringa" valign="center" width="60" height="4" pattern="1">
|
||||
<font face="Courier New" size="10" />
|
||||
<source>DESC</source>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" pattern="1" />
|
||||
<section type="Foot" level="1" pattern="1" />
|
||||
<sql>USE CESPI
|
||||
JOIN CIM ALIAS 201 INTO CODTAB==CODIMP
|
||||
JOIN LOC ALIAS 202 INTO CODTAB==CODLOC
|
||||
FROM IDCESPITE=#DACOD
|
||||
TO IDCESPITE=#ACOD</sql>
|
||||
</report>
|
@ -133,7 +133,8 @@ void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk)
|
||||
query << "&&(STR(BETWEEN(CODCAT,#DACAT,#ACAT)))";
|
||||
}
|
||||
//ordinamenti
|
||||
query << "\nBY CODCAT|CODIMP|CODLOC|IDCESPITE";
|
||||
if (!msk.get_bool(F_SORT_BY_CESP))
|
||||
query << "\nBY CODCAT|CODIMP|CODLOC|IDCESPITE";
|
||||
|
||||
//setta la nuova complicata query nel report (che avrebbe solo USE CESPI)
|
||||
set(query);
|
||||
@ -367,7 +368,11 @@ void TStampa_sintetica::main_loop()
|
||||
//report e book dei report
|
||||
TReport_book book;
|
||||
TStampa_sintetica_rep rep;
|
||||
rep.load("ce3900a");
|
||||
|
||||
if (mask.get_bool(F_SORT_BY_CESP))
|
||||
rep.load("ce3900b");
|
||||
else
|
||||
rep.load("ce3900a");
|
||||
|
||||
rep.set_filter(mask);
|
||||
book.add(rep);
|
||||
|
@ -26,3 +26,4 @@
|
||||
#define F_DESCDC 125*/
|
||||
|
||||
#define F_REPORT 126
|
||||
#define F_SORT_BY_CESP 127
|
||||
|
@ -156,6 +156,16 @@ BEGIN
|
||||
PROMPT 42 14 "Escludere i cespiti alienati"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 39 3
|
||||
BEGIN
|
||||
PROMPT 1 16 "@bOrdinamenti"
|
||||
END
|
||||
|
||||
BOOLEAN F_SORT_BY_CESP
|
||||
BEGIN
|
||||
PROMPT 2 17 "Per cespite"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
ENDMASK
|
||||
|
140
src/ce/ce3900b.rep
Normal file
140
src/ce/ce3900b.rep
Normal file
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report name="ce3900b" orientation="2" lpi="6">
|
||||
<description>Registro cespiti sintetico per codice cespite</description>
|
||||
<font face="Arial Narrow" size="8" />
|
||||
<section type="Head" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="8" />
|
||||
<field x="18.5" y="0.5" type="Testo" align="center" width="10" pattern="1" text="Date" />
|
||||
<field x="83" y="0.5" type="Testo" align="center" width="8" pattern="1" text="Valori" />
|
||||
<field x="124" y="0.5" type="Testo" width="20" pattern="1" text="Fondo Ammortamento" />
|
||||
<field x="157" y="0.75" type="Testo" align="right" width="12" pattern="1" text="Residuo da" />
|
||||
<field x="1" y="1.5" type="Testo" width="10" pattern="1" text="Codice" />
|
||||
<field x="11" y="1.5" type="Testo" width="10" pattern="1" text="Alienazione" />
|
||||
<field x="21" y="1.5" type="Testo" width="10" pattern="1" text="Acquisto" />
|
||||
<field x="31" y="1.5" type="Testo" width="10" pattern="1" text="Entr. Funz." />
|
||||
<field x="41" y="1.5" type="Testo" width="28" pattern="1" text="Descrizione" />
|
||||
<field x="66" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Iniziale" />
|
||||
<field x="78" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Variazione" />
|
||||
<field x="90" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Finale" />
|
||||
<field x="102.5" y="1.5" type="Testo" align="right" width="6" pattern="1" text="%Amm" />
|
||||
<field x="109" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Es. corr." />
|
||||
<field x="121" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Fine es.prec" />
|
||||
<field x="133" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Cessioni" />
|
||||
<field x="145" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Totale" />
|
||||
<field x="157" y="1.5" type="Testo" align="right" width="12" pattern="1" text="ammortizzare" />
|
||||
<field border="1" x="1" y="2.5" type="Linea" width="168" height="0" pattern="1" />
|
||||
</section>
|
||||
<section type="Head" level="1" pattern="1">
|
||||
<font face="Arial" size="8" />
|
||||
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1
|
||||
</prescript>
|
||||
<field border="1" radius="100" x="12" y="0.5" type="Testo" valign="center" align="center" shade_offset="25" width="148" height="2.5" pattern="2" text="REGISTRO CESPITI SINTETICO">
|
||||
<font face="Times New Roman" bold="1" size="16" />
|
||||
</field>
|
||||
<field border="2" x="1" y="4" type="Linea" width="168" height="0" pattern="1" />
|
||||
<field x="1" y="4.5" type="Stringa" width="50" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SYSTEM.RAGSOC</source>
|
||||
</field>
|
||||
<field x="58.5" y="4.5" type="Testo" width="14" pattern="1" text="Data stampa:">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="72.5" y="4.5" type="Data" width="11" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SYSTEM.DATE</source>
|
||||
</field>
|
||||
<field x="93" y="4.5" type="Testo" width="7" pattern="1" text="Anno:">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="100" y="4.5" type="Numero" align="right" width="5" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#ANNO</source>
|
||||
</field>
|
||||
<field x="117" y="4.5" type="Array" width="25" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SITUAZIONE</source>
|
||||
<list>
|
||||
<li Value="Situazione Fiscale" Code="1" />
|
||||
<li Value="Situazione Civilistica" Code="2" />
|
||||
<li Value="Situazione Gestionale" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Body" pattern="1" />
|
||||
<section type="Body" level="1" pattern="1">
|
||||
<field x="1" type="Stringa" width="10" pattern="1">
|
||||
<source>IDCESPITE</source>
|
||||
</field>
|
||||
<field x="11" type="Data" width="10" pattern="1">
|
||||
<source>DTALIEN</source>
|
||||
</field>
|
||||
<field x="21" type="Data" width="10" pattern="1">
|
||||
<source>DTCOMP</source>
|
||||
</field>
|
||||
<field x="31" type="Data" width="10" pattern="1">
|
||||
<source>DTFUNZ</source>
|
||||
</field>
|
||||
<field x="41" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
|
||||
<source>DESC</source>
|
||||
</field>
|
||||
<field x="102.5" type="Numero" align="right" width="6" pattern="1" text="##@,@@">
|
||||
<source>#PERCAMM</source>
|
||||
</field>
|
||||
<field x="66" type="Valuta" align="right" width="12" id="101" pattern="1" text="#########,@@">
|
||||
<source>#COSTOINI</source>
|
||||
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
|
||||
</field>
|
||||
<field x="90" type="Valuta" align="right" width="12" id="102" pattern="1" text="#########,@@">
|
||||
<source>#COSTOFIN</source>
|
||||
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
|
||||
</field>
|
||||
<field x="78" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@">
|
||||
<source>#102-#101</source>
|
||||
<postscript description="B1.103 POSTSCRIPT">MESSAGE ADD,F1.103</postscript>
|
||||
</field>
|
||||
<field x="109" type="Valuta" align="right" width="12" id="104" pattern="1" text="#########,@@">
|
||||
<source>#QAMM+#QAMMMV-#QAMM_FPRIVATO</source>
|
||||
<postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F1.104</postscript>
|
||||
</field>
|
||||
<field x="121" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@">
|
||||
<source>#FAMM-#FAMM_FPRIVATO</source>
|
||||
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F1.105</postscript>
|
||||
</field>
|
||||
<field x="133" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@">
|
||||
<source>#CESSELIM+#QAMMMV</source>
|
||||
<postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F1.106</postscript>
|
||||
</field>
|
||||
<field x="145" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@">
|
||||
<source>#104+#105-#106</source>
|
||||
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F1.107</postscript>
|
||||
</field>
|
||||
<field x="157" type="Valuta" align="right" width="12" id="108" pattern="1" text="#########,@@">
|
||||
<source>#RESAMM-#QAMM</source>
|
||||
<postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F1.108</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" pattern="1">
|
||||
<field border="1" x="1" type="Linea" width="168" height="0" pattern="1" />
|
||||
<field x="140" y="0.25" type="Testo" width="5" pattern="1" text="Pag.">
|
||||
<font italic="1" face="Courier New" size="9" />
|
||||
</field>
|
||||
<field x="146" y="0.25" type="Numero" align="right" width="3" pattern="1">
|
||||
<font italic="1" face="Courier New" bold="1" size="9" />
|
||||
<source>#REPORT.PAGE</source>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" level="1" bg_color="#000000" pattern="2">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<field border="2" x="1" type="Linea" fg_color="#FFFFFF" width="168" height="0" pattern="1" />
|
||||
<field x="1" type="Testo" txt_color="#FFFFFF" width="25" pattern="1" text="Totali generali" />
|
||||
<field x="66" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="101" pattern="1" text="#########,@@" />
|
||||
<field x="90" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="102" pattern="1" text="#########,@@" />
|
||||
<field x="78" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="103" pattern="1" text="#########,@@" />
|
||||
<field x="109" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="104" pattern="1" text="#########,@@" />
|
||||
<field x="121" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="105" pattern="1" text="#########,@@" />
|
||||
<field x="133" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="106" pattern="1" text="#########,@@" />
|
||||
<field x="145" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="107" pattern="1" text="#########,@@" />
|
||||
<field x="157" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="108" pattern="1" text="#########,@@" />
|
||||
</section>
|
||||
<sql>USE CESPI KEY 2</sql>
|
||||
</report>
|
@ -9,10 +9,10 @@ int main(int argc,char** argv)
|
||||
{
|
||||
case 1: ce4200(argc,argv); break; //calcolo cespiti per commessa
|
||||
case 2: ce4300(argc,argv); break; //stampa proiezione ammortamenti cespiti
|
||||
case 3: ce4400(argc,argv); break; //contabilizzazione cespiti
|
||||
case 3: ce4400(argc,argv); break; //contabilizzazione cespiti
|
||||
case 4: ce4500(argc,argv); break; //stampa cespiti in contabilitŕ analitica
|
||||
case 0:
|
||||
default: ce4100(argc,argv); break; // ripartizione analitica cespiti
|
||||
default: ce4100(argc,argv) ; break; // ripartizione analitica cespiti
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,21 +1,56 @@
|
||||
#include <automask.h>
|
||||
#include <defmask.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
#include <relapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "../ca/commesse.h"
|
||||
#include "../ca/calib01.h"
|
||||
#include "../cg/cglib01.h"
|
||||
#include "celib.h"
|
||||
#include "salcecms.h"
|
||||
|
||||
#include "ce2101.h"
|
||||
#include "ce4100a.h"
|
||||
#include "ce4100b.h"
|
||||
|
||||
#include "cespi.h"
|
||||
|
||||
|
||||
struct date_commessa : public TObject
|
||||
{
|
||||
TDate _dataini_cms, _datafine_cms;
|
||||
};
|
||||
|
||||
class TCesp_anal_mask;
|
||||
|
||||
class TCesp_anal: public TRelation_application
|
||||
{
|
||||
TCesp_anal_mask *_msk; // maschera principale
|
||||
TRelation *_rel; // relazione principale
|
||||
|
||||
//metodi virtuali obbligatori per gli oggetti TRelation_application
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) { return (TMask *)_msk; }
|
||||
virtual bool changing_mask(int mode) { return false;}
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_query_insert_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
virtual bool remove();
|
||||
|
||||
|
||||
public:
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
|
||||
virtual ~TCesp_anal() {}
|
||||
};
|
||||
|
||||
TCesp_anal & app() { return (TCesp_anal &) main_app(); }
|
||||
|
||||
//=============================================================================================
|
||||
//maschera
|
||||
|
||||
@ -388,6 +423,178 @@ bool TCesp_anal_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
||||
calc_percutil();
|
||||
}
|
||||
break;
|
||||
case DLG_COPY:
|
||||
if (e == fe_button)
|
||||
{
|
||||
TMask m("ce4100b");
|
||||
|
||||
const TDitta_cespiti& cce = ditta_cespiti();
|
||||
const int esercizio_corrente = cce.esercizio_corrente();
|
||||
int esercizio = get_int(F_ESERCIZIO);
|
||||
|
||||
if (esercizio == esercizio_corrente)
|
||||
{
|
||||
TEsercizi_contabili esc;
|
||||
|
||||
esercizio = esc.pred(esercizio_corrente);
|
||||
}
|
||||
m.set(F_ESERCIZIO1, esercizio);
|
||||
if (m.run() == K_ENTER)
|
||||
{
|
||||
const TString8 anno_src(m.get(F_ESERCIZIO1));
|
||||
const TString8 anno_dest(m.get(F_ESERCIZIO2));
|
||||
|
||||
if (anno_src < anno_dest)
|
||||
{
|
||||
TLocalisamfile f(LF_SALCECMS);
|
||||
TRectype rec(f.curr());
|
||||
TRectype from(f.curr());
|
||||
TRectype to(f.curr());
|
||||
|
||||
from.put(SALCECMS_CODES, anno_dest);
|
||||
to.put(SALCECMS_CODES, anno_dest);
|
||||
|
||||
{
|
||||
TCursor sal(new TRelation(LF_SALCECMS), "", 2, &from, &to);
|
||||
const long items = sal.items();
|
||||
|
||||
sal.freeze();
|
||||
|
||||
TProgind progind1(items, format(FR("Cancellazione anno %s in corso..."), (const char *) anno_dest), false, true);
|
||||
|
||||
for (sal = 0; sal.pos() < items; ++sal)
|
||||
{
|
||||
progind1.addstatus(1);
|
||||
sal.curr().remove(f);
|
||||
}
|
||||
}
|
||||
{
|
||||
from.put(SALCECMS_CODES, anno_src);
|
||||
to.put(SALCECMS_CODES, anno_src);
|
||||
|
||||
TCursor sal(new TRelation(LF_SALCECMS), "", 2, &from, &to);
|
||||
const long items = sal.items();
|
||||
TString80 idcespite;
|
||||
TRecord_array * recarray = NULL;
|
||||
|
||||
sal.freeze();
|
||||
|
||||
TProgind progind2(items, format(FR("Generazione anno %s in corso..."), (const char *) anno_dest), false, true);
|
||||
|
||||
for (sal = 0; sal.pos() < items; ++sal)
|
||||
{
|
||||
rec = sal.curr();
|
||||
if (idcespite.full())
|
||||
{
|
||||
if (idcespite != rec.get(SALCECMS_IDCESPITE))
|
||||
{
|
||||
TCespite cespite(idcespite);
|
||||
|
||||
cespite.load_saldi(1, atoi((const char *)anno_src));
|
||||
if (cespite.res_amm() > ZERO && recarray->rows() > 0)
|
||||
{
|
||||
TGeneric_distrib d(CENTO, 2);
|
||||
|
||||
recarray->pack();
|
||||
|
||||
int items = recarray->last_row();
|
||||
|
||||
for (int i = recarray->first_row(); i <= items; i = recarray->succ_row(i))
|
||||
d.add(recarray->row(i).get_real(SALCECMS_PERCUTIL));
|
||||
for (int i = recarray->first_row(); i <= items; i = recarray->succ_row(i))
|
||||
{
|
||||
TRectype & r = (*recarray)[i];
|
||||
|
||||
r.put(SALCECMS_PERCUTIL, d.get());
|
||||
}
|
||||
recarray->write(true);
|
||||
}
|
||||
delete recarray;
|
||||
recarray = NULL;
|
||||
}
|
||||
#ifdef DBG_VERBOSE
|
||||
else
|
||||
message_box(FR("Cespite %s ammortizzato"), (const char*) idcespite);
|
||||
#endif
|
||||
}
|
||||
progind2.addstatus(1);
|
||||
idcespite = rec.get(SALCECMS_IDCESPITE);
|
||||
if (recarray == NULL)
|
||||
{
|
||||
TToken_string key;
|
||||
|
||||
key.add(idcespite);
|
||||
key.add(anno_dest);
|
||||
recarray = new TRecord_array(key, LF_SALCECMS);
|
||||
}
|
||||
|
||||
TString80 codcms = rec.get(SALCECMS_CODCMS);
|
||||
TString80 codcms_new = codcms;
|
||||
|
||||
if (codcms == "4.6.11.27/2014")
|
||||
int i = 1;
|
||||
const int pos = codcms_new.find(anno_src);
|
||||
|
||||
if (pos >= 0)
|
||||
{
|
||||
codcms_new.overwrite(anno_dest, pos);
|
||||
const TRectype & commessa_new = cache().get(LF_COMMESSE, codcms_new);
|
||||
if (!commessa_new.empty())
|
||||
{
|
||||
rec.put(SALCECMS_CODCMS, codcms_new);
|
||||
codcms = codcms_new;
|
||||
}
|
||||
}
|
||||
|
||||
const TRectype & commessa = cache().get(LF_COMMESSE, codcms);
|
||||
|
||||
if(!commessa.get_bool(COMMESSE_CHIUSA))
|
||||
{
|
||||
rec.put(SALCECMS_CODES, anno_dest);
|
||||
recarray->add_row(rec);
|
||||
}
|
||||
#ifdef DBG_VERBOSE
|
||||
else
|
||||
message_box(FR("Commessa %s chiusa"), (const char*) rec.get(SALCECMS_CODCMS));
|
||||
#endif
|
||||
}
|
||||
if (idcespite.full())
|
||||
{
|
||||
TCespite cespite(idcespite);
|
||||
|
||||
cespite.load_saldi(1, atoi((const char *)anno_src));
|
||||
if (cespite.res_amm() > ZERO && recarray->rows() > 0)
|
||||
{
|
||||
TGeneric_distrib d(CENTO, 2);
|
||||
|
||||
recarray->pack();
|
||||
|
||||
int items = recarray->last_row();
|
||||
|
||||
for (int i = recarray->first_row(); i <= items; i = recarray->succ_row(i))
|
||||
d.add(recarray->row(i).get_real(SALCECMS_PERCUTIL));
|
||||
for (int i = recarray->first_row(); i <= items; i = recarray->succ_row(i))
|
||||
{
|
||||
TRectype & r = (*recarray)[i];
|
||||
|
||||
r.put(SALCECMS_PERCUTIL, d.get());
|
||||
}
|
||||
recarray->write(true);
|
||||
}
|
||||
delete recarray;
|
||||
recarray = NULL;
|
||||
}
|
||||
#ifdef DBG_VERBOSE
|
||||
else
|
||||
message_box(FR("Cespite %s ammortizzato"), (const char*) idcespite);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
error_box(FR("Non posso copiare il %s nel %s"), (const char *) anno_src, (const char *) anno_dest);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLG_SAVEREC:
|
||||
if (e == fe_button)
|
||||
{
|
||||
@ -408,28 +615,6 @@ bool TCesp_anal_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
||||
|
||||
//===============================================================================================
|
||||
//Applicazione
|
||||
class TCesp_anal: public TRelation_application
|
||||
{
|
||||
TCesp_anal_mask *_msk; // maschera principale
|
||||
TRelation *_rel; // relazione principale
|
||||
|
||||
//metodi virtuali obbligatori per gli oggetti TRelation_application
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) { return _msk; }
|
||||
virtual bool changing_mask(int mode) { return false;}
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_query_insert_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
virtual bool remove();
|
||||
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
|
||||
public:
|
||||
virtual ~TCesp_anal() {}
|
||||
};
|
||||
|
||||
//metodi per la maschera
|
||||
//abilita i campi per inserimento nuovo cespite,attivando i campi del gruppo 2 (che fanno riferimento al file LF_CESPI)
|
||||
|
@ -8,6 +8,12 @@ BEGIN
|
||||
PICTURE TOOL_RECALC
|
||||
END
|
||||
|
||||
BUTTON DLG_COPY 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "~Genera"
|
||||
PICTURE TOOL_COPY
|
||||
END
|
||||
|
||||
#include <relapbar.h>
|
||||
ENDPAGE
|
||||
|
||||
@ -382,4 +388,4 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
ENDMASK
|
||||
|
11
src/ce/ce4100b.h
Normal file
11
src/ce/ce4100b.h
Normal file
@ -0,0 +1,11 @@
|
||||
//definizioni campi per la maschera ce4100b.uml (copia cespiti)
|
||||
|
||||
#define F_DITTA 201
|
||||
#define F_RAGSOC 202
|
||||
#define F_ESERCIZIO1 203
|
||||
#define F_INIZIO_ES1 204
|
||||
#define F_FINE_ES1 205
|
||||
#define F_ESERCIZIO2 206
|
||||
#define F_INIZIO_ES2 207
|
||||
#define F_FINE_ES2 209
|
||||
|
93
src/ce/ce4100b.uml
Normal file
93
src/ce/ce4100b.uml
Normal file
@ -0,0 +1,93 @@
|
||||
#include "ce4100b.h"
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
|
||||
#include <stdbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Duplicazione cespiti" 0 2 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 0 1 "@bDitta"
|
||||
END
|
||||
|
||||
NUMBER F_DITTA 5
|
||||
BEGIN
|
||||
PROMPT 1 2 "Ditta "
|
||||
FLAGS "DF"
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 50
|
||||
BEGIN
|
||||
PROMPT 26 2 ""
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_DITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ESERCIZIO1 4
|
||||
BEGIN
|
||||
PROMPT 1 6 "Da Esercizio "
|
||||
FLAGS "Z"
|
||||
USE CCE
|
||||
JOIN ESC ALIAS 104 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO1
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Inizio esercizio" 104@->D0
|
||||
DISPLAY "Fine esercizio" 104@->D1
|
||||
OUTPUT F_ESERCIZIO1 CODTAB
|
||||
OUTPUT F_INIZIO_ES1 104@->D0
|
||||
OUTPUT F_FINE_ES1 104@->D1
|
||||
CHECKTYPE REQUIRED
|
||||
FIELD CODES
|
||||
KEY 1
|
||||
END
|
||||
|
||||
DATE F_INIZIO_ES1
|
||||
BEGIN
|
||||
PROMPT 26 6 "Inizio "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_FINE_ES1
|
||||
BEGIN
|
||||
PROMPT 50 6 "Fine "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ESERCIZIO2 4
|
||||
BEGIN
|
||||
PROMPT 1 8 " A Esercizio "
|
||||
FLAGS "AZ"
|
||||
USE CCE
|
||||
JOIN ESC ALIAS 104 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO2
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Inizio esercizio" 104@->D0
|
||||
DISPLAY "Fine esercizio" 104@->D1
|
||||
OUTPUT F_ESERCIZIO2 CODTAB
|
||||
OUTPUT F_INIZIO_ES2 104@->D0
|
||||
OUTPUT F_FINE_ES2 104@->D1
|
||||
CHECKTYPE REQUIRED
|
||||
FIELD CODES
|
||||
KEY 1
|
||||
END
|
||||
|
||||
DATE F_INIZIO_ES2
|
||||
BEGIN
|
||||
PROMPT 26 8 "Inizio "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_FINE_ES2
|
||||
BEGIN
|
||||
PROMPT 50 8 "Fine "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
@ -115,6 +115,8 @@ class TPrint_anal_cespi_rep : public TReport
|
||||
|
||||
protected:
|
||||
real val_amm(const TRectype& rec_saldi) const;
|
||||
real fondo(const TRectype& rec_amm, bool prec = false) const;
|
||||
|
||||
virtual bool get_usr_val(const TString& name, TVariant& var) const;
|
||||
virtual bool use_mask() { return false; }
|
||||
|
||||
@ -166,6 +168,17 @@ real TPrint_anal_cespi_rep::val_amm(const TRectype& rec_saldi) const
|
||||
return valore;
|
||||
}
|
||||
|
||||
real TPrint_anal_cespi_rep::fondo(const TRectype& rec_amm, bool prec) const
|
||||
{
|
||||
real valore = rec_amm.get_real(AMMCE_QNORP) + rec_amm.get_real(AMMCE_QACCP) + rec_amm.get_real(AMMCE_QANTP) +
|
||||
rec_amm.get_real(AMMCE_QPERSEP) + rec_amm.get_real(AMMCE_FPRIVATOP) + rec_amm.get_real(AMMCE_QPPRIVATEP);
|
||||
|
||||
if (!prec)
|
||||
valore += rec_amm.get_real(AMMCE_QNOR) + rec_amm.get_real(AMMCE_QACC) + rec_amm.get_real(AMMCE_QANT) +
|
||||
rec_amm.get_real(AMMCE_QPERSE) + rec_amm.get_real(AMMCE_FPRIVATO) + rec_amm.get_real(AMMCE_QPPRIVATE);
|
||||
return valore;
|
||||
}
|
||||
|
||||
//metodo per il calcolo dei campi da calcolare (ma va'!) nel report
|
||||
bool TPrint_anal_cespi_rep::get_usr_val(const TString& name, TVariant& var) const
|
||||
{
|
||||
@ -201,6 +214,39 @@ bool TPrint_anal_cespi_rep::get_usr_val(const TString& name, TVariant& var) cons
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name.starts_with("#COSTO")) //variazione del valore annuale (saldo finale - saldo iniziale)
|
||||
{
|
||||
const real val_fin = val_amm(_cespite.sal_pro());
|
||||
|
||||
var = val_fin * percutil;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name.starts_with("#COSTOI")) //variazione del valore annuale (saldo finale - saldo iniziale)
|
||||
{
|
||||
const real val_fin = val_amm(_cespite.sal_ini());
|
||||
|
||||
var = val_fin * percutil;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name.starts_with("#FONDO")) //variazione del valore annuale (saldo finale - saldo iniziale)
|
||||
{
|
||||
const real val_fondo = fondo(_cespite.amm_pro(), true);
|
||||
|
||||
var = val_fondo * percutil;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name.starts_with("#RESIDUO")) //variazione del valore annuale (saldo finale - saldo iniziale)
|
||||
{
|
||||
const real val_fin = val_amm(_cespite.sal_pro());
|
||||
const real val_fondo = fondo(_cespite.amm_pro());
|
||||
|
||||
var = (val_fin - val_fondo) * percutil;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name == "#QAMMMV") //quote ammortamento su movimento esercizio corrente
|
||||
{
|
||||
real quote_ammmv;
|
||||
@ -349,4 +395,4 @@ int ce4500(int argc, char* argv[])
|
||||
TPrint_anal_cespi a;
|
||||
a.run(argc, argv, TR("Stampa cespiti per analitica"));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report name="ce4500a" orientation="1" lpi="6">
|
||||
<report name="ce4500a" orientation="2" lpi="6">
|
||||
<description>Cespiti in analitica</description>
|
||||
<font face="Arial Narrow" size="8" />
|
||||
<section type="Head" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="8" />
|
||||
<field border="1" x="1" type="Linea" width="117" height="0" pattern="1" />
|
||||
<field x="97" y="0.5" type="Testo" align="center" width="20" pattern="1" text="Fondo Ammortamento" />
|
||||
<field border="1" x="1" type="Linea" width="141" height="0" pattern="1" />
|
||||
<field x="109" y="0.5" type="Testo" align="center" width="20" pattern="1" text="Fondo Ammortamento" />
|
||||
<field x="1" y="1.5" type="Testo" width="10" pattern="1" text="Cespite" />
|
||||
<field x="34" y="1.5" type="Testo" width="15" pattern="1" text="Centro di costo" />
|
||||
<field x="49" y="1.5" type="Testo" width="15" pattern="1" text="Commessa" />
|
||||
<field x="64" y="1.5" type="Testo" width="5" pattern="1" text="Fase" />
|
||||
<field x="72" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Variazione" />
|
||||
<field x="84.5" y="1.5" type="Testo" align="right" width="6" pattern="1" text="%Amm" />
|
||||
<field x="91.5" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Es. corr." />
|
||||
<field x="104" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Cessioni" />
|
||||
<field border="1" x="1" y="2.5" type="Linea" width="117" height="0" pattern="1" />
|
||||
<field x="72" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Costo storico" />
|
||||
<field x="84" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Variazione" />
|
||||
<field x="96.5" y="1.5" type="Testo" align="right" width="6" pattern="1" text="%Amm" />
|
||||
<field x="103.5" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Es. corr." />
|
||||
<field x="116" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Cessioni" />
|
||||
<field x="128" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Residuo" />
|
||||
<field border="1" x="1" y="2.5" type="Linea" width="141" height="0" pattern="1" />
|
||||
</section>
|
||||
<section type="Head" level="1" pattern="1">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
@ -24,18 +26,19 @@ MESSAGE RESET,F1.101
|
||||
MESSAGE RESET,F1.104
|
||||
MESSAGE RESET,F1.105
|
||||
MESSAGE RESET,F1.106
|
||||
MESSAGE RESET,F1.107</prescript>
|
||||
<field border="1" radius="100" x="12" y="0.5" type="Testo" valign="center" align="center" shade_offset="25" width="96" height="2.5" pattern="2" text="CESPITI IN ANALITICA">
|
||||
MESSAGE RESET,F1.107
|
||||
MESSAGE RESET,F1.108</prescript>
|
||||
<field border="1" radius="100" y="0.5" type="Testo" valign="center" align="center" shade_offset="25" width="141" height="2.5" pattern="2" text="CESPITI IN ANALITICA">
|
||||
<font face="Arial" bold="1" size="16" />
|
||||
</field>
|
||||
<field border="2" x="1" y="4" type="Linea" width="117" height="0" pattern="1" />
|
||||
<field border="2" y="4" type="Linea" width="141" height="0" pattern="1" />
|
||||
<field x="1" y="4.5" type="Testo" width="10" pattern="1" text="Ditta:" />
|
||||
<field x="11" y="4.5" type="Stringa" width="50" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SYSTEM.RAGSOC</source>
|
||||
</field>
|
||||
<field x="93" y="4.5" type="Testo" width="14" pattern="1" text="Data stampa:" />
|
||||
<field x="107" y="4.5" type="Data" width="11" pattern="1">
|
||||
<field x="116" y="4.5" type="Testo" width="14" pattern="1" text="Data stampa:" />
|
||||
<field x="130" y="4.5" type="Data" width="11" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SYSTEM.DATE</source>
|
||||
</field>
|
||||
@ -102,28 +105,38 @@ MESSAGE RESET,F1.107</prescript>
|
||||
<field x="64" type="Stringa" width="8" pattern="1">
|
||||
<source>CODFASE</source>
|
||||
</field>
|
||||
<field x="72" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@">
|
||||
<field x="84" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@">
|
||||
<source>#VARIAZIONE</source>
|
||||
<postscript description="B1.103 POSTSCRIPT">MESSAGE ADD,F1.103
|
||||
</postscript>
|
||||
</field>
|
||||
<field x="84.5" type="Numero" align="right" width="6" id="104" pattern="1" text="##@,@@">
|
||||
<field x="96" type="Numero" align="right" width="6" id="104" pattern="1" text="##@,@@">
|
||||
<source>#PERCAMM</source>
|
||||
</field>
|
||||
<field x="91.5" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@">
|
||||
<field x="103.5" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@">
|
||||
<source>#QAMM+#QAMMMV</source>
|
||||
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F1.105
|
||||
</postscript>
|
||||
</field>
|
||||
<field x="104" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@">
|
||||
<field x="116" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@">
|
||||
<source>#CESSELIM+#QAMMMV</source>
|
||||
<postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F1.106
|
||||
</postscript>
|
||||
</field>
|
||||
<field x="72" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@">
|
||||
<source>#COSTOI</source>
|
||||
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F1.107
|
||||
</postscript>
|
||||
</field>
|
||||
<field x="128" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@">
|
||||
<source>#RESIDUO</source>
|
||||
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F1.107
|
||||
</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" pattern="1">
|
||||
<font face="Arial" size="8" />
|
||||
<field border="1" x="1" type="Linea" width="117" height="0" pattern="1" />
|
||||
<field border="1" type="Linea" width="141" height="0" pattern="1" />
|
||||
<field x="101" y="0.25" type="Testo" width="5" pattern="1" text="Pag." />
|
||||
<field x="107" y="0.25" type="Numero" align="right" width="3" pattern="1">
|
||||
<source>#REPORT.PAGE</source>
|
||||
@ -131,13 +144,15 @@ MESSAGE RESET,F1.107</prescript>
|
||||
</section>
|
||||
<section type="Foot" level="1" bg_color="#000000" height="1.5" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="8" />
|
||||
<field border="2" x="1" y="0.25" type="Linea" txt_color="#FFFFFF" width="117" height="0" pattern="1" />
|
||||
<field border="2" x="1" y="0.25" type="Linea" txt_color="#FFFFFF" width="141" height="0" pattern="1" />
|
||||
<field x="58" y="0.5" type="Testo" width="10" pattern="1" text="Totali" />
|
||||
<field x="72" y="0.5" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@" />
|
||||
<field x="91.5" y="0.5" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@" />
|
||||
<field x="104" y="0.5" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@" />
|
||||
<field x="84" y="0.5" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@" />
|
||||
<field x="103.5" y="0.5" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@" />
|
||||
<field x="116" y="0.5" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@" />
|
||||
<field x="72" y="0.5" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@" />
|
||||
<field x="128" y="0.5" type="Valuta" align="right" width="12" id="108" pattern="1" text="#########,@@" />
|
||||
</section>
|
||||
<sql>USE SALCECMS KEY 2
|
||||
FROM CODES=#CODES IDCESPITE=#IDCESPITE
|
||||
TO CODES=#CODES IDCESPITE=#IDCESPITE</sql>
|
||||
</report>
|
||||
</report>
|
||||
|
@ -38,6 +38,7 @@ Item_01 = "Gruppi", "ba3 -1 %cgr", ""
|
||||
Item_02 = "Specie", "ba3 -1 %cat", ""
|
||||
Item_03 = "Categorie", "ba3 -1 %cac", ""
|
||||
Item_04 = "Tipi movimento", "ba3 -1 %tmc" , ""
|
||||
Item_05 = "Etichette cespiti", "ba8 -4 ce0a00a" , ""
|
||||
|
||||
[CEMENU_005]
|
||||
Caption = "Scelta ditta"
|
||||
|
Loading…
x
Reference in New Issue
Block a user