Patch level :10.0 180

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
riportate modifiche dalla 5.0


git-svn-id: svn://10.65.10.50/trunk@17746 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2008-11-28 11:58:27 +00:00
parent 091f7f46e0
commit 5095de7507
6 changed files with 117 additions and 50 deletions

@ -82,10 +82,10 @@ bool TPrint_bilancio_ca_mask::on_field_event(TOperable_field& o, TField_event e,
{
switch (o.dlg())
{
case F_ANNO:
case F_BILANCIO:
case F_TIPOSTAMPA:
case F_STAMPA:
if (e == fe_init || e == fe_modify)
if (e == fe_modify || (e == fe_init && o.dlg() == F_ANNO))
{
test_compatible_report();
@ -103,14 +103,37 @@ bool TPrint_bilancio_ca_mask::on_field_event(TOperable_field& o, TField_event e,
TEsercizi_contabili esc;
TDate dal, al;
esc.code2range(anno, dal, al);
if (!enable_from) set(F_DATADA, dal);
if (!enable_to) set(F_DATAA, al);
if (!enable_from || o.dlg() == F_ANNO)
set(F_DATADA, dal);
if (!enable_to || o.dlg() == F_ANNO)
set(F_DATAA, al);
}
}
enable(F_DATADA, enable_from);
enable(F_DATAA, enable_to);
}
break;
case F_DATADA:
case F_DATAA:
if (e == fe_close)
{
const int anno = get_int(F_ANNO);
if (anno > 0)
{
TEsercizi_contabili esc;
TDate dal, al;
esc.code2range(anno, dal, al);
if (o.empty())
o.set(o.dlg() == F_DATADA ? dal : al);
else
{
const TDate d = o.get();
if (d < dal || d > al)
return error_box(FR("La data deve appartenere all'esercizio %d"), anno);
}
}
}
break;
case F_REPORT:
if (e == fe_button)
{

@ -6,8 +6,8 @@
#define F_RAGSOC 302
#define F_DATASTAMPA 303
#define F_ANNO 304
#define F_BILANCIO 105
#define F_STAMPA 107
#define F_BILANCIO 305
#define F_STAMPA 307
#define F_SALDO 310
#define F_STAMPAV 311
#define F_DATADA 312

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report name="ca3300b" orientation="2" lpi="8" command="ca3 -2" class="ca3300b">
<description>Bilancio normale di verifica</description>
<font face="Courier New" size="8" />
@ -142,68 +142,69 @@
</field>
<field x="150" y="1" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="2">
<section type="Foot" level="2" height="2">
<condition>#101 != ""</condition>
<font face="Courier New" bold="1" size="8" />
<field type="Stringa" width="23" id="101" pattern="1">
<font italic="1" face="Courier New" bold="1" size="8" />
<field border="1" x="1" y="2" type="Linea" width="162" height="0" pattern="1" />
<field y="0.5" type="Stringa" width="23" id="101" pattern="1">
<prescript description="F2.101 PRESCRIPT">#THIS @ #102 !
CA_FORMAT_CONTO</prescript>
</field>
<field x="25" type="Stringa" width="50" id="102" pattern="1">
<prescript description="F2.102 PRESCRIPT">MESSAGE ISAMREAD,PCONANA,CODCONTO=#102,DESCR</prescript>
<field x="25" y="0.5" type="Stringa" width="50" id="102" pattern="1">
<prescript description="F2.102 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field>
<field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="78" y="0.5" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F2.103 PRESCRIPT">103 DARE_AVERE</prescript>
</field>
<field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="92" y="0.5" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="107" y="0.5" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="121" y="0.5" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" y="0.5" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F2.107 PRESCRIPT">107 DARE_AVERE</prescript>
</field>
<field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="150" y="0.5" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="3">
<section type="Foot" level="3" height="1.5">
<condition>#101 != ""</condition>
<font face="Courier New" bold="1" size="8" />
<field type="Stringa" width="23" id="101" pattern="1">
<field y="0.5" type="Stringa" width="23" id="101" pattern="1">
<prescript description="F3.101 PRESCRIPT">#THIS @ #102 !
CA_FORMAT_CONTO</prescript>
</field>
<field x="25" type="Stringa" width="50" id="102" pattern="1">
<prescript description="F3.102 PRESCRIPT">MESSAGE ISAMREAD,PCONANA,CODCONTO=#102,DESCR</prescript>
<field x="25" y="0.5" type="Stringa" width="50" id="102" pattern="1">
<prescript description="F3.102 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field>
<field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="78" y="0.5" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F3.103 PRESCRIPT">103 DARE_AVERE</prescript>
</field>
<field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="92" y="0.5" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="107" y="0.5" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="121" y="0.5" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" y="0.5" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F3.107 PRESCRIPT">107 DARE_AVERE</prescript>
</field>
<field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="150" y="0.5" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section type="Foot" level="4">
<section type="Foot" level="4" height="1.5">
<condition>#101 != ""</condition>
<font face="Courier New" bold="1" size="8" />
<field type="Stringa" width="23" id="101" pattern="1">
<field y="0.5" type="Stringa" width="23" id="101" pattern="1">
<prescript description="F4.101 PRESCRIPT">#THIS @ #102 !
CA_FORMAT_CONTO</prescript>
</field>
<field x="25" type="Stringa" width="50" id="102" pattern="1">
<prescript description="F4.102 PRESCRIPT">MESSAGE ISAMREAD,PCONANA,CODCONTO=#102,DESCR</prescript>
<field x="25" y="0.5" type="Stringa" width="50" id="102" pattern="1">
<prescript description="F4.102 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field>
<field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="78" y="0.5" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F4.103 PRESCRIPT">103 DARE_AVERE</prescript>
</field>
<field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="92" y="0.5" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="107" y="0.5" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="121" y="0.5" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" y="0.5" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F4.107 PRESCRIPT">107 DARE_AVERE</prescript>
</field>
<field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="150" y="0.5" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<sql>USE PCONANA</sql>
<prescript description="PRESCRIPT">: AZZERA_TOTALI ( ID_SEC - )

@ -712,7 +712,7 @@ void TPrint_rendiconto_ca_recordset::scrive_riga(const TRectype& rmovana, const
{
//Controlla se il documento di origine (padre del documento da cui deriva l'attuale riga..
//..di analitica) era una FDR/FDE...
const TCodice_numerazione& kodice_num = cached_numerazione(babbo_codnum);
const TCodice_numerazione& kodice_num = TDocumento::codice_numerazione(babbo_codnum);
//Se lo era...
if (kodice_num.fattura_emettere_ricevere())
{

@ -362,11 +362,52 @@ void TAnal_report::msg_format_commessa(TVariant_stack& stack)
void TAnal_report::msg_format_fase(TVariant_stack& stack)
{ msg_format(LF_FASI, stack); }
void TAnal_report::msg_format_conto(TVariant_stack& stack)
char TAnal_report::determina_tipo_pdc(TVariant_stack& stack) const
{
// Cerca di determinare se si usa il piano contabile o analitico
char tipo = ' ';
switch (stack.items())
{
case 0: break;
case 1:
{
const char t = stack.peek(0).as_string()[0];
if (t == 'A' || t == 'C')
{
tipo = t;
stack.drop();
}
}
break;
default:
{
const char t = stack.peek(1).as_string()[0];
if (t == 'A' || t == 'C')
{
tipo = t;
stack.roll(1);
stack.drop();
}
}
break;
}
if (tipo != 'A' && tipo != 'C')
{
const TString& conto = curr_field()->get().as_string();
if (conto.len() == 12 && real::is_natural(conto))
const int contolen = conto.len();
if ((contolen == 3 || contolen == 6 || contolen == 12) && real::is_natural(conto))
tipo = 'C';
else
tipo = 'A';
}
return tipo;
}
void TAnal_report::msg_format_conto(TVariant_stack& stack)
{
if (determina_tipo_pdc(stack) == 'C')
msg_format(LF_PCON, stack);
else
msg_format(LF_PCONANA, stack);
@ -375,23 +416,23 @@ void TAnal_report::msg_format_conto(TVariant_stack& 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))
if (determina_tipo_pdc(stack) == 'C')
{
TToken_string chiave;
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);
const TString& conto_descr = cache().get(LF_PCON, chiave, PCN_DESCR);
curr_field()->set(conto_descr);
}
else
{
conto_descr = cache().get(LF_PCONANA, conto, PCONANA_DESCR);
}
const TString& conto_descr = cache().get(LF_PCONANA, conto, PCONANA_DESCR);
curr_field()->set(conto_descr);
}
}
void TAnal_report::msg_format_commessa_costo(TVariant_stack& stack)
{
@ -807,7 +848,7 @@ bool TSaldi_cache::int_saldo_movimenti(const TAnal_bill& b,
{
if (select.full())
select << "&&";
select << "(CODCOSTO==\"" << b.costo() << "\")";
select << "(CODCCOSTO==\"" << b.costo() << "\")";
}
if (b.commessa().full())
{

@ -126,6 +126,8 @@ protected: // protected is safer
virtual bool execute_usr_word(unsigned int opcode, TVariant_stack& stack);
virtual bool use_mask() { return false; }
char determina_tipo_pdc(TVariant_stack& stack) const; // usata dalle msg_format_conto*
virtual void msg_format(int logicnum, TVariant_stack& stack);
virtual void msg_format_costo (TVariant_stack& stack);
virtual void msg_format_commessa (TVariant_stack& stack);