Patch level :2.2 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :stampa rendiconto: filtro finale del report funzionante anche con estremi conto e data vuoti;inserita la selezione su stato numerazione documento per mettere poi il filtro sui documenti (necessario per evitare di elaborare documenti già elaborati) git-svn-id: svn://10.65.10.50/trunk@13288 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5b29a414ed
commit
d11018ad2d
@ -357,16 +357,16 @@ static const TPrint_rendiconto_ca_recordset* myself = NULL;
|
||||
|
||||
TPrint_rendiconto_ca_recordset* rendiconto_recordset() { return (TPrint_rendiconto_ca_recordset* ) myself;}
|
||||
|
||||
//metodo per riconoscere se il record corrente soddisfa i filtri della maschera...strafighissimo!
|
||||
/*//metodo per riconoscere se il record corrente soddisfa i filtri della maschera...strafighissimo!
|
||||
bool TPrint_rendiconto_ca_recordset::valid_record(const TRelation& rel) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
bool TPrint_rendiconto_ca_recordset::mov_filter(const TRelation* rel)
|
||||
/*bool TPrint_rendiconto_ca_recordset::mov_filter(const TRelation* rel)
|
||||
{
|
||||
return myself->valid_record(*rel);
|
||||
}
|
||||
}*/
|
||||
|
||||
void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const
|
||||
{
|
||||
@ -374,10 +374,14 @@ void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const
|
||||
|
||||
//filtro sul file esterno (_tmp, cioè 1000) sui conti selezionati sulla maschera
|
||||
TRectype darec(cur.curr()), arec(cur.curr()); //curr perchè è il file externisamfile
|
||||
darec.zero();
|
||||
arec.zero();
|
||||
if (!_riclassificato)
|
||||
{
|
||||
darec.put("CONTO", _daconto);
|
||||
arec.put("CONTO", _aconto);
|
||||
if (_daconto.not_empty())
|
||||
darec.put("CONTO", _daconto);
|
||||
if (_aconto.not_empty())
|
||||
arec.put("CONTO", _aconto);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -385,13 +389,23 @@ void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const
|
||||
arec.put("CONTO", _a_conto_riclas);
|
||||
}
|
||||
|
||||
darec.put("DATA", _dadata);
|
||||
arec.put("DATA", _adata);
|
||||
//filtro sulla data(non avendo anche codnum non ho la chiave completa per mettere la data nella setregion)
|
||||
TString filtro;
|
||||
if (_dadata.ok())
|
||||
filtro << "(ANSI(DATA)>=" << _dadata << ")";
|
||||
|
||||
if (_adata.ok())
|
||||
{
|
||||
if (filtro.not_empty())
|
||||
filtro << "&&";
|
||||
filtro << "(ANSI(DATA)<=" << _adata << ")";
|
||||
}
|
||||
|
||||
cur.setregion(darec, arec);
|
||||
cur.setfilter(filtro);
|
||||
|
||||
myself = this;
|
||||
cur.set_filterfunction(mov_filter, true);
|
||||
//cur.set_filterfunction(mov_filter, true);
|
||||
}
|
||||
|
||||
//metodo per il calcolo del budget PREVENTIVO o VARIAZIONE (sezione di raggruppamento sul report)
|
||||
@ -402,13 +416,20 @@ real TPrint_rendiconto_ca_recordset::somma_budget(const TString& codconto, const
|
||||
TRelation rel_rmovana(LF_RMOVANA);
|
||||
rel_rmovana.add(LF_MOVANA, "NUMREG==NUMREG");
|
||||
|
||||
//..crea un cursore su movana per avere solo i conti di tipo tipomovana, con il codice conto
|
||||
//..crea un cursore su rmovana per avere solo i conti di tipo tipomovana, con il codice conto
|
||||
//selezionato e la datacomp compresa nell'intervallo date
|
||||
TRectype da_rmovana(LF_RMOVANA);
|
||||
da_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
da_rmovana.put(RMOVANA_DATACOMP, _dadata);
|
||||
TRectype a_rmovana(LF_RMOVANA);
|
||||
a_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
if (!_riclassificato)
|
||||
{
|
||||
da_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
a_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
}
|
||||
else //se riclassificato
|
||||
{
|
||||
}
|
||||
|
||||
da_rmovana.put(RMOVANA_DATACOMP, _dadata);
|
||||
a_rmovana.put(RMOVANA_DATACOMP, _adata);
|
||||
|
||||
TString filtro;
|
||||
@ -458,13 +479,13 @@ const TVariant& TPrint_rendiconto_ca_recordset::get(const char* column_name) con
|
||||
if (strcmp(column_name, "#PREVENTIVO") == 0)
|
||||
{
|
||||
TVariant& var = get_tmp_var();
|
||||
var = rendiconto_recordset()->somma_budget(get(RMOVANA_CODCONTO).as_string(), "P");
|
||||
var = rendiconto_recordset()->somma_budget(get("CONTO").as_string(), "P");
|
||||
return var;
|
||||
}
|
||||
if (strcmp(column_name, "#VARIAZIONE") == 0)
|
||||
{
|
||||
TVariant& var = get_tmp_var();
|
||||
var = rendiconto_recordset()->somma_budget(get(RMOVANA_CODCONTO).as_string(), "V");
|
||||
var = rendiconto_recordset()->somma_budget(get("CONTO").as_string(), "V");
|
||||
return var;
|
||||
}
|
||||
}
|
||||
@ -553,6 +574,8 @@ void TPrint_rendiconto_ca_recordset::salva_rmovana(const TRectype& rmovana, cons
|
||||
else //...sennò si usa il normale piano dei conti analitico (cioè tutti tranne che il CRPA)
|
||||
_tmp->curr().put("CONTO", rmovana.get(RMOVANA_CODCONTO)); //conto
|
||||
|
||||
|
||||
|
||||
//i movimenti possono essere normali o generati da documento...
|
||||
if (dadoc) //movimento generato da documento
|
||||
{
|
||||
@ -619,6 +642,8 @@ void TPrint_rendiconto_ca_recordset::salva_rmovana(const TRectype& rmovana, cons
|
||||
_tmp->curr().put("DOCORIG", riferimento);
|
||||
}
|
||||
|
||||
|
||||
//campi comuni
|
||||
_tmp->curr().put("DESC", movana.get(MOVANA_DESCR)); //descrizione movana
|
||||
_tmp->curr().put("NRIGA", rmovana.get(RMOVANA_NUMRIG));
|
||||
_tmp->curr().put("DESCRIGA", rmovana.get(RMOVANA_DESCR)); //descrizione rmovana
|
||||
|
@ -66,6 +66,8 @@
|
||||
//elementi dello sheet dei documenti (pag.3)
|
||||
#define SN_CODNUM 101
|
||||
#define SN_DESCR 102
|
||||
#define SN_DASTATO 103
|
||||
#define SN_ASTATO 104
|
||||
|
||||
#endif // __CA3700_H
|
||||
|
||||
|
@ -136,8 +136,9 @@ SPREADSHEET F_RIGHE_NUM -1 -2
|
||||
BEGIN
|
||||
PROMPT 1 2 ""
|
||||
ITEM "Numerazione"
|
||||
// ITEM "Tipo"
|
||||
ITEM "Descrizione@50"
|
||||
ITEM "Da stato"
|
||||
ITEM "A stato"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
@ -288,6 +289,30 @@ BEGIN
|
||||
COPY OUTPUT SN_CODNUM
|
||||
END
|
||||
|
||||
STRING SN_DASTATO 1
|
||||
BEGIN
|
||||
PROMPT 1 3 "Da stato "
|
||||
USE %STD
|
||||
CHECKTYPE NORMAL
|
||||
INPUT CODTAB SN_DASTATO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT SN_DASTATO CODTAB
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
STRING SN_ASTATO 1
|
||||
BEGIN
|
||||
PROMPT 1 4 "A stato "
|
||||
USE %STD
|
||||
CHECKTYPE NORMAL
|
||||
INPUT CODTAB SN_ASTATO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT SN_ASTATO CODTAB
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -13 -1 ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user