Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento :riporti dalla 5.0 git-svn-id: svn://10.65.10.50/trunk@16667 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fb8153465f
commit
b8d4da1014
@ -16,6 +16,10 @@
|
||||
CA_FORMAT_CONTO
|
||||
;
|
||||
|
||||
: MESSAGE_FORMAT_CONTO_DESCR ( -- )
|
||||
CA_FORMAT_CONTO_DESCR
|
||||
;
|
||||
|
||||
: MESSAGE_FORMAT_CMSCDC ( -- )
|
||||
\ da implementare
|
||||
CA_FORMAT_CMSCDC
|
||||
|
@ -142,10 +142,13 @@ void TPrint_cms::main_loop()
|
||||
TString codcms;
|
||||
for (short codcms_id = F_DACMS; m.id2pos(codcms_id) > 0; codcms_id++)
|
||||
codcms << m.get(codcms_id);
|
||||
query << "/n" << "FROM CODCMS='" << codcms << "'";
|
||||
if (codcms.full()) //non c'e' bisogno di query.full() x' c'e' gia la USE
|
||||
query << "/n" << "FROM CODCMS='" << codcms << "'";
|
||||
|
||||
for (short codcms_id = F_ACMS; m.id2pos(codcms_id) > 0; codcms_id++)
|
||||
codcms << m.get(codcms_id);
|
||||
query << "/n" << "TO CODCMS='" << codcms << "'";
|
||||
if (codcms.full())
|
||||
query << "/n" << "TO CODCMS='" << codcms << "'";
|
||||
|
||||
//cabia la query al report
|
||||
rep.set_recordset(query);
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
public:
|
||||
void set_annoes(int anno) { _annoes = anno; }
|
||||
TAnal_mov_ric(long numreg = 0) : TAnal_mov(numreg) {}
|
||||
TAnal_mov_ric(long numreg = 0) : TAnal_mov(numreg), _annoes(0) {}
|
||||
};
|
||||
|
||||
int TAnal_mov_ric::readat(TBaseisamfile& f, TRecnotype nrec, word lockop)
|
||||
@ -104,7 +104,23 @@ bool TRic_saldi_app::destroy()
|
||||
|
||||
bool TRic_saldi_app::remove_saldo(const TRelation& rel, void* pJolly)
|
||||
{
|
||||
((TRelation &)rel).remove();
|
||||
const int anno = *(int*)pJolly;
|
||||
TRectype& rec = rel.curr();
|
||||
const int curr_anno = rec.get_int(SALDANA_ANNO);
|
||||
//azzeratore dei saldi anno corrente
|
||||
if (curr_anno == anno)
|
||||
((TRelation &)rel).remove();
|
||||
else //azzeratore dei preventivi/variazioni di altri anni
|
||||
{
|
||||
const real saldop = rec.get_real(SALDANA_SALDOP);
|
||||
const real saldov = rec.get_real(SALDANA_SALDOV);
|
||||
if (!saldop.is_zero() || !saldov.is_zero())
|
||||
{
|
||||
rec.zero(SALDANA_SALDOP);
|
||||
rec.zero(SALDANA_SALDOV);
|
||||
((TRelation&)rel).rewrite();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -112,21 +128,34 @@ void TRic_saldi_app::main_loop()
|
||||
{
|
||||
while (_mask->run() == K_ENTER)
|
||||
{
|
||||
//Il ricalcolo saldi e' diviso in 2 fasi:
|
||||
//1 Azzeramento e ricalcolo dei saldi dei movimenti di tipo normale o temporaneo per il solo anno selezionato
|
||||
//2 Azzeramento e ricalcolo dei saldi dei movimenti di tipo preventivo o variazione per TUTTI gli esercizi..
|
||||
//..questo perche' i movimenti P e T possono essere "spalmati" su piu' anni
|
||||
|
||||
//AZZERAMENTO dei saldi normali e temporanei dell'anno selezionato, preventivi e variazione di tutti..
|
||||
//..gli esercizi che trova
|
||||
const int anno = _mask->get_int(F_ANNO);
|
||||
TRelation rel_saldi(LF_SALDANA);
|
||||
TRectype rec_saldi(rel_saldi.curr());
|
||||
|
||||
rec_saldi.put(SALDANA_ANNO, anno);
|
||||
TCursor cur_saldi(&rel_saldi, "", 1, &rec_saldi, &rec_saldi);
|
||||
TCursor cur_saldi(&rel_saldi);
|
||||
const long items_saldi = cur_saldi.items();
|
||||
|
||||
if (items_saldi > 0)
|
||||
cur_saldi.scan(remove_saldo, this, "Azzeramento saldi...");
|
||||
cur_saldi.scan(remove_saldo, (void*)&anno, "Azzeramento saldi...");
|
||||
|
||||
//FASE 1
|
||||
//ricostruzione dei saldi normali e temporanei dell'anno selezionato
|
||||
TEsercizi_contabili esc;
|
||||
const TDate datainies = esc[anno].inizio();
|
||||
const TDate datafines = esc[anno].fine();
|
||||
TRelation rel_movana(LF_MOVANA);
|
||||
TString filter; filter.format("ANNOES==%04d", anno);
|
||||
TRectype darec(LF_MOVANA), arec(LF_MOVANA);
|
||||
darec.put(MOVANA_DATACOMP, datainies);
|
||||
arec.put(MOVANA_DATACOMP, datafines);
|
||||
|
||||
TString filter = "(TIPOMOV=='')||(TIPOMOV=='T')";
|
||||
|
||||
TCursor cur_movana(&rel_movana, filter, 1);
|
||||
TCursor cur_movana(&rel_movana, filter, 2, &darec, &arec);
|
||||
const long items = cur_movana.items();
|
||||
//usa la scan dei TCursor,quindi niente progind e for,x' gia' nel metodo
|
||||
if (items > 0)
|
||||
@ -134,26 +163,21 @@ void TRic_saldi_app::main_loop()
|
||||
TAnal_mov_ric* amr = new TAnal_mov_ric;
|
||||
amr->set_annoes(anno);
|
||||
rel_movana.lfile().set_curr(amr); //il record principale della rel e' un TMov_anal!!
|
||||
cur_movana.scan(elabora_movimento, this, "Ricostruzione saldi...");
|
||||
cur_movana.scan(elabora_movimento, this, "Ricostruzione saldi consuntivi e temporanei...");
|
||||
rel_movana.lfile().set_curr(new TRectype(LF_MOVANA)); //il record principale della rel e' un TMov_anal!!
|
||||
}
|
||||
|
||||
//FASE 2
|
||||
//ricostruzione saldi di preventivo spammati su piu' anni
|
||||
TEsercizi_contabili esc;
|
||||
const TDate datainies = esc[anno].inizio();
|
||||
filter.format("((TIPOMOV='P')||(TIPOMOV='V'))&&(NUM(ANSI(DATAFCOMP))>=%ld)", datainies.date2ansi());
|
||||
|
||||
TRectype beginning(LF_MOVANA), ending(LF_MOVANA);
|
||||
ending.put(MOVANA_ANNOES, anno - 1);
|
||||
cur_movana.setregion(beginning, ending);
|
||||
cur_movana.setfilter(filter, true);
|
||||
const long preventivi_items = cur_movana.items();
|
||||
filter = "(TIPOMOV='P')||(TIPOMOV='V')";
|
||||
TCursor cur_movana_prev(&rel_movana, filter);
|
||||
const long preventivi_items = cur_movana_prev.items();
|
||||
if (preventivi_items > 0)
|
||||
{
|
||||
TAnal_mov_ric* amr = new TAnal_mov_ric;
|
||||
amr->set_annoes(anno);
|
||||
amr->set_annoes(0);
|
||||
rel_movana.lfile().set_curr(amr); //il record principale della rel e' un TMov_anal!!
|
||||
cur_movana.scan(elabora_movimento, this, "Ricostruzione saldi preventivi precedenti...");
|
||||
cur_movana_prev.scan(elabora_movimento, this, "Ricostruzione saldi preventivi...");
|
||||
rel_movana.lfile().set_curr(new TRectype(LF_MOVANA)); //il record principale della rel e' un TMov_anal!!
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,8 @@ MESSAGE RESET,F2.900</prescript>
|
||||
</field>
|
||||
<field x="24" y="0.5" type="Stringa" bg_color="#C0C0C0" width="50">
|
||||
<font italic="1" face="Courier New" bold="1" size="8" />
|
||||
<prescript description="H2.0 PRESCRIPT">MESSAGE ISAMREAD,PCONANA,CODCONTO=CONTO,DESCR</prescript>
|
||||
<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 E;E;E;">
|
||||
<font face="Courier New" bold="1" size="8" />
|
||||
|
@ -16,7 +16,7 @@ END
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "" 0 -2 0 2
|
||||
|
||||
|
||||
STRING DLG_PROFILE 50
|
||||
BEGIN
|
||||
PROMPT 9 -11 "Profilo "
|
||||
@ -118,17 +118,25 @@ BEGIN
|
||||
OUTPUT F_CDC CODCOSTO
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPOSTIMA 1 35
|
||||
BEGIN
|
||||
PROMPT 41 7 "Tipo di stima"
|
||||
ITEM "T|Tempo"
|
||||
ITEM "C|Costi consuntivi\Ricavi preventivi"
|
||||
ITEM "R|Costi consuntivi\Ricavi consuntivi"
|
||||
END
|
||||
|
||||
BOOLEAN F_VITAINTERA
|
||||
BEGIN
|
||||
PROMPT 41 12 "Includere esercizi successivi (vita intera)"
|
||||
PROMPT 1 11 "Includere esercizi successivi (vita intera)"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPOSTIMA 1 42
|
||||
BEGIN
|
||||
PROMPT 34 9 "Tipo di stima"
|
||||
ITEM "T|Costi preventivi\Ricavi preventivi (Tempo)"
|
||||
MESSAGE SHOW,F_TIPODETR|ENABLE,F_TIPODETR
|
||||
ITEM "C|Costi consuntivi\Ricavi preventivi"
|
||||
MESSAGE CLEAR,F_TIPODETR|HIDE,F_TIPODETR
|
||||
ITEM "R|Costi consuntivi\Ricavi consuntivi"
|
||||
MESSAGE CLEAR,F_TIPODETR|HIDE,F_TIPODETR
|
||||
END
|
||||
|
||||
BOOLEAN F_TIPODETR
|
||||
BEGIN
|
||||
PROMPT 1 12 "Utilizzare consuntivi per le detrazioni "
|
||||
END
|
||||
|
||||
GROUPBOX F_PRE0 76 5
|
||||
@ -139,14 +147,14 @@ END
|
||||
|
||||
LISTBOX F_DEPTH 1 20
|
||||
BEGIN
|
||||
PROMPT 1 18 "Profondita' del piano dei conti da considerare "
|
||||
PROMPT 1 19 "Profondita' del piano dei conti da considerare "
|
||||
ITEM "1|Gruppo"
|
||||
ITEM "2|Conto"
|
||||
END
|
||||
|
||||
STRING F_REPORT 256 64
|
||||
BEGIN
|
||||
PROMPT 1 19 "Report "
|
||||
PROMPT 1 20 "Report "
|
||||
FLAGS "B"
|
||||
END
|
||||
|
||||
|
@ -40,29 +40,61 @@
|
||||
<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">
|
||||
<font face="Courier New" bold="1" size="16" />
|
||||
</field>
|
||||
<field x="10" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
|
||||
<field x="7" 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="45" y="3" type="Stringa" width="4" pattern="1">
|
||||
<field x="42" y="3" type="Stringa" width="4" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>ANNO</source>
|
||||
</field>
|
||||
<field x="60" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento ">
|
||||
<field x="57" 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="30" pattern="1">
|
||||
<field x="72" y="3" type="Array" width="35" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>TIPOSTIMA</source>
|
||||
<list>
|
||||
<li Value="TEMPO" Code="T" />
|
||||
<li Value="COSTI Preventivi \ RICAVI Preventivi (TEMPO)" Code="T" />
|
||||
<li Value="COSTI Consuntivi \ RICAVI Preventivi" Code="C" />
|
||||
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="120" y="3" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
|
||||
<field x="130" 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="7" pattern="1">
|
||||
<field x="148" y="3" type="Array" width="10" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>TIPODETR</source>
|
||||
<list>
|
||||
<li Value="Preventivi" Code=" " />
|
||||
<li Value="Consuntivi" Code="X" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="7" 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">
|
||||
<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">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="72" 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">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="105" y="4.25" type="Stringa" width="20" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>CDCSPEC</source>
|
||||
</field>
|
||||
<field x="130" y="4.25" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="155" y="4.25" type="Array" width="7" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>DEPTH</source>
|
||||
<list>
|
||||
@ -70,27 +102,6 @@
|
||||
<li Value="Conto" Code="2" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="10" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="30" 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 specificata">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="75" y="4.25" type="Stringa" width="10" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>FASESPEC</source>
|
||||
</field>
|
||||
<field x="100" y="4.25" type="Testo" width="15" pattern="1" text="CdC specificato">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="112" y="4.25" type="Stringa" width="20" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>CDCSPEC</source>
|
||||
</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">
|
||||
@ -101,8 +112,8 @@
|
||||
<list>
|
||||
<li Value="Commesse terminate nel" Code="0" />
|
||||
<li Value="Commesse terminate nel" Code="1" />
|
||||
<li Value="Commesse in corso entro fine" Code="2" />
|
||||
<li Value="Commesse in corso entro fine" Code="3" />
|
||||
<li Value="Commesse che terminano oltre il" Code="2" />
|
||||
<li Value="Commesse che terminano oltre il" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||
@ -240,8 +251,8 @@ THEN
|
||||
<list>
|
||||
<li Value="TOTALI Commesse terminate nel" Code="0" />
|
||||
<li Value="TOTALI Commesse terminate nel" Code="1" />
|
||||
<li Value="TOTALI Commesse in corso entro fine" Code="2" />
|
||||
<li Value="TOTALI Commesse in corso entro fine" Code="3" />
|
||||
<li Value="TOTALI Commesse che terminano oltre il" Code="2" />
|
||||
<li Value="TOTALI Commesse che terminano oltre il" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="28" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||
@ -265,7 +276,7 @@ MESSAGE RESET,169</postscript>
|
||||
<section type="Foot" level="3" height="2">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<field border="1" x="2" y="0.25" type="Linea" width="169" height="0" pattern="1" />
|
||||
<field x="1" y="0.5" type="Array" bg_color="#C0C0C0" width="33">
|
||||
<field x="1" y="0.5" type="Array" width="33" pattern="1">
|
||||
<source>H3.101</source>
|
||||
<list>
|
||||
<li Value="TOTALI Commesse avviate in esercizi precedenti" Code="0" />
|
||||
|
@ -34,25 +34,36 @@
|
||||
<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">
|
||||
<font face="Courier New" bold="1" size="16" />
|
||||
</field>
|
||||
<field x="10" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
|
||||
<field x="7" 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 ">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="75" y="3" type="Array" width="30" pattern="1">
|
||||
<field x="75" y="3" type="Array" width="35" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>TIPOSTIMA</source>
|
||||
<list>
|
||||
<li Value="TEMPO" Code="T" />
|
||||
<li Value="COSTI Preventivi \ RICAVI Preventivi (TEMPO)" Code="T" />
|
||||
<li Value="COSTI Consuntivi \ RICAVI Preventivi" Code="C" />
|
||||
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="120" y="3" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
|
||||
<field x="120" y="3" type="Testo" width="25" pattern="1" text="Detrazioni calcolate come">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="145" y="3" type="Array" width="7" pattern="1">
|
||||
<field x="145" y="3" type="Array" width="10" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>TIPODETR</source>
|
||||
<list>
|
||||
<li Value="Preventivi" Code=" " />
|
||||
<li Value="Consuntivi" Code="X" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="120" 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">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>DEPTH</source>
|
||||
<list>
|
||||
@ -60,10 +71,10 @@
|
||||
<li Value="Conto" Code="2" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="10" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
|
||||
<field x="7" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="30" y="4.25" type="Stringa" width="3" pattern="1">
|
||||
<field x="27" y="4.25" type="Stringa" width="3" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>VITAINTERA</source>
|
||||
</field>
|
||||
@ -76,7 +87,7 @@
|
||||
<source>FASESPEC</source>
|
||||
<postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript>
|
||||
</field>
|
||||
<field x="45" y="3" type="Stringa" width="4" id="2" pattern="1">
|
||||
<field x="42" y="3" type="Stringa" width="4" id="2" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>ANNO</source>
|
||||
</field>
|
||||
@ -89,8 +100,8 @@
|
||||
<list>
|
||||
<li Value="Commesse terminate nel" Code="0" />
|
||||
<li Value="Commesse terminate nel" Code="1" />
|
||||
<li Value="Commesse in corso entro fine" Code="2" />
|
||||
<li Value="Commesse in corso entro fine" Code="3" />
|
||||
<li Value="Commesse che terminano oltre il" Code="2" />
|
||||
<li Value="Commesse che terminano oltre il" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||
@ -189,8 +200,8 @@ THEN
|
||||
<list>
|
||||
<li Value="TOTALI Commesse terminate nel" Code="0" />
|
||||
<li Value="TOTALI Commesse terminate nel" Code="1" />
|
||||
<li Value="TOTALI Commesse in corso entro fine" Code="2" />
|
||||
<li Value="TOTALI Commesse in corso entro fine" Code="3" />
|
||||
<li Value="TOTALI Commesse che terminano oltre il" Code="2" />
|
||||
<li Value="TOTALI Commesse che terminano oltre il" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||
|
@ -34,25 +34,36 @@
|
||||
<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">
|
||||
<font face="Courier New" bold="1" size="16" />
|
||||
</field>
|
||||
<field x="10" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio">
|
||||
<field x="7" 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 ">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="75" y="3" type="Array" width="30" pattern="1">
|
||||
<field x="75" y="3" type="Array" width="35" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>TIPOSTIMA</source>
|
||||
<list>
|
||||
<li Value="TEMPO" Code="T" />
|
||||
<li Value="COSTI Preventivi \ RICAVI Preventivi (TEMPO)" Code="T" />
|
||||
<li Value="COSTI Consuntivi \ RICAVI Preventivi" Code="C" />
|
||||
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="120" y="3" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
|
||||
<field x="120" y="3" type="Testo" width="25" pattern="1" text="Detrazioni calcolate come">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="145" y="3" type="Array" width="7" pattern="1">
|
||||
<field x="145" y="3" type="Array" width="10" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>TIPODETR</source>
|
||||
<list>
|
||||
<li Value="Preventivi" Code=" " />
|
||||
<li Value="Consuntivi" Code="X" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="120" 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">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>DEPTH</source>
|
||||
<list>
|
||||
@ -60,10 +71,10 @@
|
||||
<li Value="Conto" Code="2" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="10" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
|
||||
<field x="7" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
|
||||
<font italic="1" face="Arial Narrow" size="9" />
|
||||
</field>
|
||||
<field x="30" y="4.25" type="Stringa" width="3" pattern="1">
|
||||
<field x="27" y="4.25" type="Stringa" width="3" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>VITAINTERA</source>
|
||||
</field>
|
||||
@ -76,7 +87,7 @@
|
||||
<source>CDCSPEC</source>
|
||||
<postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.2</postscript>
|
||||
</field>
|
||||
<field x="45" y="3" type="Stringa" width="4" id="2" pattern="1">
|
||||
<field x="42" y="3" type="Stringa" width="4" id="2" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="9" />
|
||||
<source>ANNO</source>
|
||||
</field>
|
||||
@ -89,8 +100,8 @@
|
||||
<list>
|
||||
<li Value="Commesse terminate nel" Code="0" />
|
||||
<li Value="Commesse terminate nel" Code="1" />
|
||||
<li Value="Commesse in corso entro fine" Code="2" />
|
||||
<li Value="Commesse in corso entro fine" Code="3" />
|
||||
<li Value="Commesse che terminano oltre il" Code="2" />
|
||||
<li Value="Commesse che terminano oltre il" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||
@ -191,8 +202,8 @@ THEN
|
||||
<list>
|
||||
<li Value="TOTALI Commesse terminate nel" Code="0" />
|
||||
<li Value="TOTALI Commesse terminate nel" Code="1" />
|
||||
<li Value="TOTALI Commesse in corso entro fine" Code="2" />
|
||||
<li Value="TOTALI Commesse in corso entro fine" Code="3" />
|
||||
<li Value="TOTALI Commesse che terminano oltre il" Code="2" />
|
||||
<li Value="TOTALI Commesse che terminano oltre il" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6">
|
||||
|
235
ca/ca3883.cpp
235
ca/ca3883.cpp
@ -255,7 +255,7 @@ void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TStr
|
||||
|
||||
//campo modello
|
||||
rep_sect.find_field(model_id)->set_column(x0);
|
||||
}
|
||||
} //if(fld_fase!=NULL..
|
||||
}
|
||||
else //campi non del body
|
||||
{
|
||||
@ -276,10 +276,10 @@ void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TStr
|
||||
brock.activate(champ->active());
|
||||
brock.set_column(champ->get_rect().left());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} //if(id>0..
|
||||
} //for(int i=0;...
|
||||
} //else di if(rep_sect.type()=='B'...
|
||||
} //if(!show_fasi||!show_cdc...
|
||||
|
||||
TReport_field& rep_field = *rep_sect.find_field(model_id);
|
||||
|
||||
@ -480,8 +480,8 @@ static int righe_compare(const TObject** o1, const TObject** o2)
|
||||
}
|
||||
else
|
||||
{
|
||||
const int z1 = c1.starts_with("DETR_");
|
||||
const int z2 = c2.starts_with("DETR_");
|
||||
const int z1 = c1.starts_with("detr_");
|
||||
const int z2 = c2.starts_with("detr_");
|
||||
if (z1 || z2)
|
||||
cmp = z1 - z2;
|
||||
}
|
||||
@ -516,58 +516,85 @@ void TPrint_saldana_recordset::parse_bill(const TString& bill, TString& conto) c
|
||||
}
|
||||
|
||||
int TPrint_saldana_recordset::estrai_saldi(const TRecordset& saldana, const int indbil,
|
||||
TImporto& saldo, TImporto& saldop) const
|
||||
TImporto& saldo, TImporto& saldop, const bool cms_detraz) const
|
||||
{
|
||||
int flag = 0;
|
||||
saldo.reset();
|
||||
saldop.reset();
|
||||
|
||||
//stampa bilancio di commessa ca3800 (_tipo=8)
|
||||
if (_tipo == 8)
|
||||
{
|
||||
if (_tipostima == 'R') //stampa adolfica nuova con ricavi consuntivi (spezzabili per fase)
|
||||
|
||||
switch (_tipostima)
|
||||
{
|
||||
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
|
||||
saldana.get(SALDANA_SALDO).as_real());
|
||||
saldo.reset();
|
||||
saldop.reset();
|
||||
if (!imp_saldo.is_zero())
|
||||
case 'R': //CostiConsuntivi RicaviConsuntivi (Cc/Rc)
|
||||
{
|
||||
if (indbil == 3) //colonna costi
|
||||
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
|
||||
saldana.get(SALDANA_SALDO).as_real());
|
||||
if (!imp_saldo.is_zero())
|
||||
{
|
||||
saldo = imp_saldo;
|
||||
flag = 1;
|
||||
}
|
||||
else //indbil == 4; colonna ricavi
|
||||
{
|
||||
saldop = imp_saldo;
|
||||
flag = 2;
|
||||
if (indbil == 3) //indbil=3 costi
|
||||
{
|
||||
saldo = imp_saldo;
|
||||
flag = 1;
|
||||
}
|
||||
else //indbil=4 ricavi
|
||||
{
|
||||
saldop = imp_saldo;
|
||||
flag = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else //programma originale con ricavi di budget totalizzati ad inizio commessa
|
||||
{
|
||||
if (_tipostima == 'C' && indbil == 3)
|
||||
{
|
||||
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
|
||||
saldana.get(SALDANA_SALDO).as_real());
|
||||
saldo = imp_saldo;
|
||||
flag |= saldo.is_zero() ? 0 : 1;
|
||||
}
|
||||
else
|
||||
saldo.reset();
|
||||
break;
|
||||
|
||||
if (_tipostima == 'T' || (_tipostima == 'C' && indbil == 4)) //stima Tempo o (Costi e indbil=ricavo)
|
||||
{
|
||||
const TImporto imp_saldop(saldana.get(SALDANA_SEZIONEP).as_string()[0],
|
||||
case 'C': //CostiConsuntivi RicaviPreventivi (Cc/Rp)
|
||||
{
|
||||
if (indbil == 3) //costi
|
||||
{
|
||||
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
|
||||
saldana.get(SALDANA_SALDO).as_real());
|
||||
saldo = imp_saldo;
|
||||
flag |= saldo.is_zero() ? 0 : 1;
|
||||
}
|
||||
else //indbil=4 ricavi
|
||||
{
|
||||
const TImporto imp_saldop(saldana.get(SALDANA_SEZIONEP).as_string()[0],
|
||||
saldana.get(SALDANA_SALDOP).as_real());
|
||||
const TImporto imp_saldov(saldana.get(SALDANA_SEZIONEV).as_string()[0],
|
||||
saldana.get(SALDANA_SALDOV).as_real());
|
||||
saldop = imp_saldop;
|
||||
saldop += imp_saldov;
|
||||
flag |= saldop.is_zero() ? 0 : 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T': //CostiPreventivi RicaviPreventivi (Cc/Rp) = Tempo
|
||||
//nel caso stia calcolando le detrazioni di anni precedenti (cms_detraz) e si sia scelto di farlo..
|
||||
//..usando i consuntivi (Adolf rikiesten)...
|
||||
if (cms_detraz && _tipodetr)
|
||||
{
|
||||
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
|
||||
saldana.get(SALDANA_SALDO).as_real());
|
||||
saldo = imp_saldo;
|
||||
flag |= saldo.is_zero() ? 0 : 1;
|
||||
}
|
||||
else //in tutti gli altri casi vanno bene i preventivi
|
||||
{
|
||||
const TImporto imp_saldop(saldana.get(SALDANA_SEZIONEP).as_string()[0],
|
||||
saldana.get(SALDANA_SALDOP).as_real());
|
||||
const TImporto imp_saldov(saldana.get(SALDANA_SEZIONEV).as_string()[0],
|
||||
saldana.get(SALDANA_SALDOV).as_real());
|
||||
saldop = imp_saldop;
|
||||
saldop += imp_saldov;
|
||||
flag |= saldop.is_zero() ? 0 : 2;
|
||||
}
|
||||
else
|
||||
saldop.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
} //switch (_tipostima)...
|
||||
|
||||
} //if(_tipo=8...
|
||||
// stampa stima ricavi ca3900 (_tipo=9)
|
||||
else
|
||||
{
|
||||
@ -642,8 +669,8 @@ TAssoc_array& TPrint_saldana_recordset::get_row(TAssoc_array& cms, const char* c
|
||||
}
|
||||
|
||||
//for ca3800 only!
|
||||
void TPrint_saldana_recordset::aggiorna_importo(TAssoc_array& riga_array,
|
||||
const TString& livello, const int indbil, const TRecordset& saldana, const bool inverti) const
|
||||
void TPrint_saldana_recordset::aggiorna_importo(TAssoc_array& riga_array, const TString& livello,
|
||||
const int indbil, const TRecordset& saldana, const bool inverti, const bool cms_detraz) const
|
||||
{
|
||||
TString* str_imp = (TString*)riga_array.objptr(livello);
|
||||
if (str_imp == NULL)
|
||||
@ -659,7 +686,7 @@ void TPrint_saldana_recordset::aggiorna_importo(TAssoc_array& riga_array,
|
||||
//ci sono tutti i tipi di saldo, ma solo quelli che rientrano nei parametri iniziali..
|
||||
//..verranno considerati (_tipostima,indbil)
|
||||
TImporto imp_saldo, imp_saldop;
|
||||
estrai_saldi(saldana, indbil, imp_saldo, imp_saldop);
|
||||
estrai_saldi(saldana, indbil, imp_saldo, imp_saldop, cms_detraz);
|
||||
|
||||
if (inverti) // Devo sottrarre l'importo = gli scambio la sezione
|
||||
{
|
||||
@ -751,7 +778,7 @@ void TPrint_saldana_recordset::aggiorna_importi(TAssoc_array& riga_array,
|
||||
|
||||
TImporto imp_saldo, imp_saldop;
|
||||
|
||||
estrai_saldi(saldana, indbil, imp_saldo, imp_saldop);
|
||||
estrai_saldi(saldana, indbil, imp_saldo, imp_saldop, false);
|
||||
|
||||
//saldi normali:Maturato
|
||||
if (!imp_saldo.is_zero())
|
||||
@ -793,27 +820,35 @@ void TPrint_saldana_recordset::create_lines_to_print(const TString& query)
|
||||
const TString& codconto = saldana.get(SALDANA_CONTO).as_string();
|
||||
//trova l'indicatore di bilancio
|
||||
TString80 conto_anale;
|
||||
|
||||
const int indbil = _indicatori.get_indbil(codconto, conto_anale);
|
||||
//solo i Costi(3) ed i Ricavi(4) devono essere considerati per la stampa
|
||||
if (indbil == 3 || indbil == 4)
|
||||
{
|
||||
//estrae i dati di commessa e le date relative;le date servono successivamente per stabilire...
|
||||
//..le sezioni in cui compariranno le commesse nella stampa
|
||||
const TString& codcms = saldana.get(SALDANA_COMMESSA).as_string();
|
||||
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
|
||||
const TDate dataini = rec_commesse.get(COMMESSE_DATAINIZIO);
|
||||
|
||||
//per la data fine deve tener conto di eventuali proroghe..
|
||||
TDate datafine;
|
||||
if (rec_commesse.get_bool(COMMESSE_PROROGA) && rec_commesse.get(COMMESSE_DATAPROR).ok())
|
||||
datafine = rec_commesse.get(COMMESSE_DATAPROR);
|
||||
else
|
||||
datafine = rec_commesse.get(COMMESSE_DATAFINE);
|
||||
|
||||
//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";
|
||||
TString80 conto;
|
||||
parse_bill(conto_anale, conto);
|
||||
|
||||
TImporto saldo, saldop;
|
||||
const int flag = estrai_saldi(saldana, indbil, saldo, saldop);
|
||||
if (flag != 0)
|
||||
const int flag = estrai_saldi(saldana, indbil, saldo, saldop, false);
|
||||
//se ci sono saldi/saldop != 0...
|
||||
// if (flag != 0)
|
||||
{
|
||||
const TString& codcms = saldana.get(SALDANA_COMMESSA).as_string();
|
||||
const TString& fase = saldana.get(SALDANA_FASE).as_string();
|
||||
const TString& cdc = saldana.get(SALDANA_COSTO).as_string();
|
||||
|
||||
const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms);
|
||||
|
||||
const TDate dataini = rec_commesse.get(COMMESSE_DATAINIZIO);
|
||||
//per la data fine deve tener conto di eventuali proroghe..
|
||||
TDate datafine;
|
||||
if (rec_commesse.get_bool(COMMESSE_PROROGA) && rec_commesse.get(COMMESSE_DATAPROR).ok())
|
||||
datafine = rec_commesse.get(COMMESSE_DATAPROR);
|
||||
else
|
||||
datafine = rec_commesse.get(COMMESSE_DATAFINE);
|
||||
//e' inutile considerare le commesse terminate prima dell'esercizio selezionato..
|
||||
//..cioe' nel passato oppure che iniziano nel futuro!
|
||||
if (datafine >= datainiesc && dataini <= datafinesc)
|
||||
@ -827,6 +862,9 @@ void TPrint_saldana_recordset::create_lines_to_print(const TString& query)
|
||||
if (dataini >= datainiesc)
|
||||
indice++;
|
||||
|
||||
//ci sono filtri o raggruppamenti per fase o centro di costo?
|
||||
const TString& fase = saldana.get(SALDANA_FASE).as_string();
|
||||
const TString& cdc = saldana.get(SALDANA_COSTO).as_string();
|
||||
TString80 chiave = codcms;
|
||||
//selezione fasi solo su bilancio commessa (_tipo=8)
|
||||
if (_tipo == 8 && (_tipostampa >= 1 && _tipostampa <= 3))
|
||||
@ -851,16 +889,12 @@ void TPrint_saldana_recordset::create_lines_to_print(const TString& query)
|
||||
|
||||
//riempie le righe degli array da mandare poi in stampa
|
||||
//dapprima le righe normali..
|
||||
//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";
|
||||
TString80 conto;
|
||||
parse_bill(conto_anale, conto);
|
||||
//bilancio di commessa ca3800 (_tipo=8)
|
||||
if (_tipo == 8)
|
||||
{
|
||||
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc,
|
||||
rec_commesse.get(COMMESSE_DESCRIZ));
|
||||
|
||||
//aggiunge gli importi e normalizza
|
||||
aggiorna_importo(riga_array, gruppo, indbil, saldana);
|
||||
aggiorna_importo(riga_array, conto, indbil, saldana);
|
||||
@ -879,33 +913,41 @@ void TPrint_saldana_recordset::create_lines_to_print(const TString& query)
|
||||
aggiorna_importi(riga_array, indbil, saldana);
|
||||
|
||||
}
|
||||
//..poi le righe speciali,che esistono solo se la commessa e' iniziata prima dell'anno
|
||||
//selezionato,quindi se l'indice e' 0 o 2
|
||||
if (indice %2 == 0)
|
||||
{
|
||||
//aggiorna il record speciale con la somma dei saldi con anno anteriore a quello..
|
||||
//..selezionato sulla maschera (CRPA request)
|
||||
const int anno = saldana.get(SALDANA_ANNO).as_int();
|
||||
if (anno < _anno)
|
||||
{
|
||||
TString16 cazzo_cod; cazzo_cod.format("DETR_%04d", _anno - 1);
|
||||
TString cazzo_descr = "DETRAZIONE PER COMPETENZA ";
|
||||
cazzo_descr << (_anno - 1);
|
||||
TAssoc_array& riga_array = get_row(cms[indice], CMS_DEL_CAZZO, indice, cazzo_cod,
|
||||
EMPTY_STRING, EMPTY_STRING, cazzo_descr);
|
||||
if (_tipo == 8)
|
||||
{
|
||||
aggiorna_importo(riga_array, gruppo, indbil, saldana, true);
|
||||
aggiorna_importo(riga_array, conto, indbil, saldana, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
aggiorna_importi(riga_array, indbil, saldana, true);
|
||||
}
|
||||
}
|
||||
} //if(indice...
|
||||
|
||||
} //if (datafine >= datainiesc &&...
|
||||
} //if (saldop != ZERO..
|
||||
} //if (flag!=0..
|
||||
|
||||
//RIGHE COMMESSA SPECIALE: esistono solo se la commessa e' iniziata prima dell'anno
|
||||
//selezionato e se ha a che fare con quello in corso,quindi l'indice e' 0 o 2
|
||||
if (datafine >= datainiesc && dataini < datainiesc)
|
||||
{
|
||||
//indice e' il parametro che stabilisce in quale sezione del report viene stampata la commessa
|
||||
//se la commessa termina prima della fine dell'esercizio selezionato -> indice 0, altrimenti..
|
||||
//..indice 2
|
||||
const int indice = datafine <= datafinesc ? 0 : 2;
|
||||
//aggiorna il record speciale con la somma dei saldi con anno anteriore a quello..
|
||||
//..selezionato sulla maschera (CRPA request)
|
||||
const int anno = saldana.get(SALDANA_ANNO).as_int();
|
||||
if (anno < _anno)
|
||||
{
|
||||
TString16 cazzo_cod; cazzo_cod.format("detr_al_%04d", _anno - 1);
|
||||
TString cazzo_descr = "DETRAZIONE PER COMPETENZA FINO AL ";
|
||||
cazzo_descr << (_anno - 1);
|
||||
TAssoc_array& riga_array = get_row(cms[indice], CMS_DEL_CAZZO, indice, cazzo_cod,
|
||||
EMPTY_STRING, EMPTY_STRING, cazzo_descr);
|
||||
if (_tipo == 8)
|
||||
{
|
||||
//cms_detr con tipo detrazione a consuntivo o preventivo in base al valore di _tipodetr
|
||||
aggiorna_importo(riga_array, gruppo, indbil, saldana, true, _tipodetr);
|
||||
aggiorna_importo(riga_array, conto, indbil, saldana, true, _tipodetr);
|
||||
}
|
||||
else
|
||||
{
|
||||
aggiorna_importi(riga_array, indbil, saldana, true);
|
||||
}
|
||||
} //if(anno<_anno...
|
||||
} //if(dataini<datainiesc...
|
||||
|
||||
} //if (indbil == 3 ||...
|
||||
} //for(bool ok=saldana.move_first()..
|
||||
|
||||
@ -1023,6 +1065,11 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const
|
||||
var.set(_depth);
|
||||
}
|
||||
else
|
||||
if (strcmp(column_name, "TIPODETR") == 0)
|
||||
{
|
||||
var.set(_tipodetr == true ? "X" : "");
|
||||
}
|
||||
else
|
||||
if (strcmp(column_name, "VITAINTERA") == 0)
|
||||
{
|
||||
var.set(_vitaintera == true ? "SI" : "NO");
|
||||
@ -1087,6 +1134,8 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const
|
||||
else //if(strcmp(column_name,AVANZAMENTO...
|
||||
{
|
||||
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
|
||||
if (strncmp(column_name, "RECORD.", 7) == 0)
|
||||
column_name += 7;
|
||||
const TString* val = (TString*)riga.objptr(column_name);
|
||||
if (val)
|
||||
var.set(*val);
|
||||
@ -1115,7 +1164,7 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_
|
||||
_tipostima = msk.get(F_TIPOSTIMA)[0];
|
||||
_vitaintera = msk.get_bool(F_VITAINTERA);
|
||||
_depth = msk.get_int(F_DEPTH);
|
||||
|
||||
_tipodetr = msk.get_bool(F_TIPODETR);
|
||||
_tipostampa = msk.get_int(F_TIPOSTAMPA);
|
||||
|
||||
//in base al tipo di stampa selezionata setta un po' di parametri
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
const bool show_fasi, const bool show_cdc);
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// RECORDSET PER STAMPE DI SALDANA CA3800, CA3900
|
||||
///////////////////////////////////////////////////////////////
|
||||
@ -69,6 +68,7 @@ class TPrint_saldana_recordset : public TRecordset
|
||||
int _depth;
|
||||
int _tipostampa;
|
||||
bool _vitaintera;
|
||||
bool _tipodetr;
|
||||
char _tipostima;
|
||||
TString16 _fase;
|
||||
TString80 _cdc;
|
||||
@ -87,10 +87,10 @@ protected:
|
||||
|
||||
void parse_bill(const TString& bill, TString& conto) const;
|
||||
int estrai_saldi(const TRecordset& saldana, const int indbil,
|
||||
TImporto& saldo, TImporto& saldop) const;
|
||||
TImporto& saldo, TImporto& saldop, const bool cms_detraz) const;
|
||||
//per il solo ca3800
|
||||
void aggiorna_importo(TAssoc_array& riga_array, const TString& livello,
|
||||
const int indbil, const TRecordset& saldana, const bool inverti = false) const;
|
||||
void aggiorna_importo(TAssoc_array& riga_array, const TString& livello, const int indbil,
|
||||
const TRecordset& saldana, const bool inverti = false, const bool cms_detraz = false) const;
|
||||
real calcola_avanzamento_tempo() const;
|
||||
void create_lines_to_print(const TString& query);
|
||||
//per il solo ca3900
|
||||
|
@ -14,6 +14,7 @@
|
||||
#define F_CDC 111
|
||||
#define F_DEPTH 112
|
||||
#define F_TIPOSTAMPA 113
|
||||
#define F_TIPODETR 114
|
||||
|
||||
/* campi per la generazione automatica
|
||||
#define F_FASE1 112
|
||||
|
@ -717,7 +717,7 @@ bool TSimple_anal_msk::on_field_event(TOperable_field& o, TField_event e, long j
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_TREE:
|
||||
if (e == fe_button)
|
||||
if (e == fe_select)
|
||||
{
|
||||
if (edit_mode() && !dirty())
|
||||
set_mode(MODE_QUERY);
|
||||
@ -1389,10 +1389,20 @@ bool TAnal_mov::save_saldi(const int annoes)
|
||||
const char tipo = key.get_char(0);
|
||||
const int anno = key.get_int(1);
|
||||
|
||||
// Se e' attivo il filtro su un anno, aggiorno i saldi solo dell'anno voluto
|
||||
if (annoes != 0 && anno != annoes) // Usata solo da ricalcolo saldi
|
||||
//Controlla se deve veramente salvre i saldi che ha calcolato
|
||||
bool save_for_true = true;
|
||||
//se annoes = 0 -> registrazione movimento analitico -> save_for_true = true -> salva!
|
||||
//se invece trova un anno e' in fase ricostruzione saldi! Deve fare delle considerazioni..
|
||||
if (annoes != 0)
|
||||
{
|
||||
if (annoes > 0) //se annoes e' positivo -> sono saldi normali -> salva!
|
||||
save_for_true = anno == annoes;
|
||||
else //se annoes e' negativo -> sono preventivi futuri -> salva solo se abs(anno)>annoes (senno' non sei nel futuro!)
|
||||
save_for_true = anno > -annoes;
|
||||
}
|
||||
if (!save_for_true) //se non deve salvare davvero il saldo -> continua
|
||||
continue;
|
||||
|
||||
|
||||
saldi.put(SALDANA_ANNO, anno);
|
||||
saldi.put(SALDANA_COSTO, key.get(2));
|
||||
saldi.put(SALDANA_COMMESSA, key.get(3));
|
||||
@ -1402,8 +1412,10 @@ bool TAnal_mov::save_saldi(const int annoes)
|
||||
int err = saldi.read(_isequal, _testandlock);
|
||||
if (err != NOERR)
|
||||
{
|
||||
TEsercizi_contabili esc;
|
||||
if (esc.exist(anno))
|
||||
//Richiesta specifica del nostro Fuhrer! I saldi appartenenti ad esercizi futuri NON ancora aperti vanno..
|
||||
//..comunque registrati!!!
|
||||
// TEsercizi_contabili esc;
|
||||
// if (esc.exist(anno))
|
||||
{
|
||||
saldi.zero();
|
||||
saldi.put(SALDANA_ANNO, anno);
|
||||
@ -1413,8 +1425,8 @@ bool TAnal_mov::save_saldi(const int annoes)
|
||||
saldi.put(SALDANA_CONTO, key.get(5));
|
||||
err = saldi.write();
|
||||
}
|
||||
else
|
||||
continue; // NON devo dare errori fuorvianti causa saldi nel futuro che ci saranno ma non vanno scritti
|
||||
// else
|
||||
// continue; // NON devo dare errori fuorvianti causa saldi nel futuro che ci saranno ma non vanno scritti
|
||||
}
|
||||
|
||||
if (err == NOERR)
|
||||
|
@ -320,8 +320,9 @@ size_t TAnal_report::get_usr_words(TString_array& words) const
|
||||
"CA_FORMAT_COSTO",
|
||||
"CA_FORMAT_COMMESSA",
|
||||
"CA_FORMAT_FASE",
|
||||
"CA_FORMAT_CONTO",
|
||||
"CA_FORMAT_CMSCDC",
|
||||
"CA_FORMAT_CONTO",
|
||||
"CA_FORMAT_CMSCDC",
|
||||
"CA_FORMAT_CONTO_DESCR",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -371,6 +372,27 @@ void TAnal_report::msg_format_conto(TVariant_stack& stack)
|
||||
msg_format(LF_PCONANA, stack);
|
||||
}
|
||||
|
||||
void TAnal_report::msg_format_conto_descr(TVariant_stack& stack)
|
||||
{
|
||||
// Cerca di determinare se si usa il piano contabile o analitico
|
||||
TString conto_descr;
|
||||
TToken_string chiave;
|
||||
const TString& conto = curr_field()->get().as_string();
|
||||
if (conto.len() == 12 && real::is_natural(conto))
|
||||
{
|
||||
chiave.add(conto.mid(0,3));
|
||||
chiave.add(conto.mid(3,3));
|
||||
chiave.add(conto.mid(6,6));
|
||||
conto_descr = cache().get(LF_PCON, chiave, PCN_DESCR);
|
||||
}
|
||||
else
|
||||
{
|
||||
conto_descr = cache().get(LF_PCONANA, conto, PCONANA_DESCR);
|
||||
}
|
||||
|
||||
curr_field()->set(conto_descr);
|
||||
}
|
||||
|
||||
void TAnal_report::msg_format_commessa_costo(TVariant_stack& stack)
|
||||
{
|
||||
const TMultilevel_code_info& fas_info = ca_multilevel_code_info(LF_FASI);
|
||||
@ -392,6 +414,7 @@ bool TAnal_report::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
|
||||
case 2 : msg_format_fase(stack); break;
|
||||
case 3 : msg_format_conto(stack); break;
|
||||
case 4 : msg_format_commessa_costo(stack); break;
|
||||
case 5 : msg_format_conto_descr(stack); break;
|
||||
default: ok = false; break;
|
||||
}
|
||||
}
|
||||
|
@ -132,6 +132,7 @@ protected: // protected is safer
|
||||
virtual void msg_format_fase (TVariant_stack& stack);
|
||||
virtual void msg_format_conto (TVariant_stack& stack);
|
||||
virtual void msg_format_commessa_costo(TVariant_stack& stack);
|
||||
virtual void msg_format_conto_descr (TVariant_stack& stack);
|
||||
|
||||
public: // meglio pubic?
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user