Patch level : 10.0 patch 810
Files correlati : ca0.exe Ricompilazione Demo : [ ] Commento Aggiunto un totale da ripartire sula tabelle di ripartizione che, se compilato, serve per aggiungere una eventuale differenza all'ultima riga della ripartizione (rif. Habilita) git-svn-id: svn://10.65.10.50/branches/R_10_00@20903 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f189d463f4
commit
ef3638b4df
@ -374,6 +374,8 @@ void TRiparti_app::spezza_campo(const TString& str, TToken_string& row, int firs
|
|||||||
|
|
||||||
void TRiparti_app::write_rows()
|
void TRiparti_app::write_rows()
|
||||||
{
|
{
|
||||||
|
real diff = _msk->get_real(F_TOTRIP);
|
||||||
|
const bool has_tot = _msk->get_int(F_TIPORIP) == 2 &&diff != ZERO;
|
||||||
TRectype* key = new TRectype(LF_RRIP);
|
TRectype* key = new TRectype(LF_RRIP);
|
||||||
const char tipo = _msk->get(F_TIPO)[0];
|
const char tipo = _msk->get(F_TIPO)[0];
|
||||||
key->put("TIPO", tipo);
|
key->put("TIPO", tipo);
|
||||||
@ -398,7 +400,18 @@ void TRiparti_app::write_rows()
|
|||||||
mf.field()->write(row->get(idx), rec);
|
mf.field()->write(row->get(idx), rec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( has_tot)
|
||||||
|
diff -= rec.get_real(RRIP_RIPARTO);
|
||||||
}
|
}
|
||||||
|
if (has_tot != ZERO)
|
||||||
|
if (yesno_box(FR("Il totale da ripartire differisce di %s\ndal totale delle righe devo aggiungere la differenza"), abs(diff).stringa()))
|
||||||
|
a[a.last_row()].add(RRIP_RIPARTO, diff);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const real newtot = _msk->get_real(F_TOTRIP) - diff;
|
||||||
|
_msk->set (F_TOTRIP, newtot);
|
||||||
|
}
|
||||||
|
|
||||||
a.rewrite();
|
a.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,18 +466,14 @@ bool TRiparti_app::get_next_key(TToken_string& key)
|
|||||||
|
|
||||||
int TRiparti_app::write(const TMask& m)
|
int TRiparti_app::write(const TMask& m)
|
||||||
{
|
{
|
||||||
const int err = TRelation_application::write(m);
|
write_rows();
|
||||||
if (err == NOERR)
|
return TRelation_application::write(m);
|
||||||
write_rows();
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TRiparti_app::rewrite(const TMask& m)
|
int TRiparti_app::rewrite(const TMask& m)
|
||||||
{
|
{
|
||||||
const int err = TRelation_application::rewrite(m);
|
write_rows();
|
||||||
if (err == NOERR)
|
return TRelation_application::rewrite(m);
|
||||||
write_rows();
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TRiparti_app::read(TMask& m)
|
int TRiparti_app::read(TMask& m)
|
||||||
|
@ -40,3 +40,4 @@
|
|||||||
|
|
||||||
#define F_SHEET 151
|
#define F_SHEET 151
|
||||||
#define F_GENFASI 152
|
#define F_GENFASI 152
|
||||||
|
#define F_TOTRIP 153
|
||||||
|
@ -191,6 +191,12 @@ BEGIN
|
|||||||
GROUP 2
|
GROUP 2
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER F_TOTRIP 15 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 10 "Totale riparto "
|
||||||
|
FIELD TOTRIP
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Righe" -1 -1 78 22
|
PAGE "Righe" -1 -1 78 22
|
||||||
@ -208,7 +214,7 @@ END
|
|||||||
SPREADSHEET F_SHEET 80 -3
|
SPREADSHEET F_SHEET 80 -3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 3 ""
|
PROMPT 0 3 ""
|
||||||
ITEM "Ripartiz.@9F"
|
ITEM "Ripartiz.@15F"
|
||||||
ITEM "Cdc1"
|
ITEM "Cdc1"
|
||||||
ITEM "Cdc2"
|
ITEM "Cdc2"
|
||||||
ITEM "Cdc3"
|
ITEM "Cdc3"
|
||||||
@ -238,7 +244,7 @@ ENDMASK
|
|||||||
|
|
||||||
PAGE "Sheet" -1 -1 78 19
|
PAGE "Sheet" -1 -1 78 19
|
||||||
|
|
||||||
NUMBER 101 6 2
|
NUMBER 101 15 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 0 "% Ripartizione "
|
PROMPT 1 0 "% Ripartizione "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
149
|
149
|
||||||
0
|
0
|
||||||
$rip|||129|0|Archivio tabelle di ripartizione analitica|||
|
$rip|||144|0|Archivio tabelle di ripartizione analitica|||
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
149
|
149
|
||||||
13
|
14
|
||||||
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch, <P>areggio)
|
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch, <P>areggio)
|
||||||
CODICE|1|8|0|Codice ripartizione
|
CODICE|1|8|0|Codice ripartizione
|
||||||
GRUPPO|2|3|0|Gruppo
|
GRUPPO|2|3|0|Gruppo
|
||||||
@ -13,6 +13,7 @@ TIPORIP|1|1|0|Modalita' ripartizione (percentuale, quote, parti)
|
|||||||
ANNOES|9|4|0|Codice esercizio
|
ANNOES|9|4|0|Codice esercizio
|
||||||
INDBIL|2|1|0|Indicatore bilancio conti di destinazione
|
INDBIL|2|1|0|Indicatore bilancio conti di destinazione
|
||||||
CLASSEMOV|2|1|0|Classe movimento (0=tutti,1=normali e temp.,2=preventivi e variaz.)
|
CLASSEMOV|2|1|0|Classe movimento (0=tutti,1=normali e temp.,2=preventivi e variaz.)
|
||||||
|
TOTRIP|4|15|5|Totale di tutti i riparti
|
||||||
4
|
4
|
||||||
TIPO+CODICE|
|
TIPO+CODICE|
|
||||||
TIPO+DESCRIZ|X
|
TIPO+DESCRIZ|X
|
||||||
|
Loading…
x
Reference in New Issue
Block a user