Patch level :2.2 160
Files correlati :ca3.exe, ca3700a.msk Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@13292 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6c828212df
commit
0e84bac04b
@ -284,7 +284,7 @@ TPrint_rendiconto_ca_mask::TPrint_rendiconto_ca_mask()
|
||||
daconto.set_group(1);
|
||||
daconto.set_group(4);
|
||||
daconto.set_group(g);
|
||||
daconto.check_type(CHECK_NORMAL);
|
||||
daconto.check_type(CHECK_SEARCH);
|
||||
|
||||
field(da_des+i).set_group(4);
|
||||
field(da_des+i).set_group(g);
|
||||
@ -293,7 +293,7 @@ TPrint_rendiconto_ca_mask::TPrint_rendiconto_ca_mask()
|
||||
aconto.set_group(2);
|
||||
aconto.set_group(4);
|
||||
aconto.set_group(g);
|
||||
aconto.check_type(CHECK_NORMAL);
|
||||
aconto.check_type(CHECK_SEARCH);
|
||||
|
||||
field(a_des+i).set_group(4);
|
||||
field(a_des+i).set_group(g);
|
||||
@ -420,20 +420,15 @@ real TPrint_rendiconto_ca_recordset::somma_budget(const TString& codconto, const
|
||||
//selezionato e la datacomp compresa nell'intervallo date
|
||||
TRectype da_rmovana(LF_RMOVANA);
|
||||
TRectype a_rmovana(LF_RMOVANA);
|
||||
if (!_riclassificato)
|
||||
{
|
||||
da_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
a_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
}
|
||||
else //se riclassificato
|
||||
{
|
||||
}
|
||||
|
||||
da_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
a_rmovana.put(RMOVANA_CODCONTO, codconto);
|
||||
|
||||
da_rmovana.put(RMOVANA_DATACOMP, _dadata);
|
||||
a_rmovana.put(RMOVANA_DATACOMP, _adata);
|
||||
|
||||
TString filtro;
|
||||
filtro << "(MOVANA_TIPODOC==" << tipomovana << ")";
|
||||
filtro << "(107->TIPOMOV==\"" << tipomovana << "\")";
|
||||
|
||||
TCursor cur_rmovana(&rel_rmovana, filtro, 2, &da_rmovana, &a_rmovana);
|
||||
const long rmovana_items = cur_rmovana.items();
|
||||
@ -479,13 +474,25 @@ 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("CONTO").as_string(), "P");
|
||||
TString80 conto;
|
||||
if (_riclassificato)
|
||||
conto = TISAM_recordset::get("CONTOCG").as_string();
|
||||
else
|
||||
conto = TISAM_recordset::get("CONTO").as_string();
|
||||
|
||||
var = rendiconto_recordset()->somma_budget(conto, "P");
|
||||
return var;
|
||||
}
|
||||
if (strcmp(column_name, "#VARIAZIONE") == 0)
|
||||
{
|
||||
TVariant& var = get_tmp_var();
|
||||
var = rendiconto_recordset()->somma_budget(get("CONTO").as_string(), "V");
|
||||
TString80 conto;
|
||||
if (_riclassificato)
|
||||
conto = TISAM_recordset::get("CONTOCG").as_string();
|
||||
else
|
||||
conto = TISAM_recordset::get("CONTO").as_string();
|
||||
|
||||
var = rendiconto_recordset()->somma_budget(conto, "V");
|
||||
return var;
|
||||
}
|
||||
}
|
||||
@ -567,14 +574,16 @@ void TPrint_rendiconto_ca_recordset::salva_rmovana(const TRectype& rmovana, cons
|
||||
//ATTENZIONE! Se era stata operata una selezione sui conti riclassificati nella maschera
|
||||
//ed il conto riclassificato attuale non ricade nell'intervallo selezionato il programma
|
||||
//non deve aggiungere il record al file!!
|
||||
if (conto_riclassificato < _da_conto_riclas || conto_riclassificato > _a_conto_riclas)
|
||||
if ((_da_conto_riclas.not_empty() && conto_riclassificato < _da_conto_riclas) ||
|
||||
(_a_conto_riclas.not_empty() && conto_riclassificato.compare(_a_conto_riclas, _a_conto_riclas.len()) > 0))
|
||||
return;
|
||||
|
||||
}
|
||||
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
|
||||
|
||||
|
||||
//in ogni caso riempio il campo conto_cg
|
||||
_tmp->curr().put("CONTOCG", rmovana.get(RMOVANA_CODCONTO)); //conto_cg
|
||||
|
||||
//i movimenti possono essere normali o generati da documento...
|
||||
if (dadoc) //movimento generato da documento
|
||||
@ -758,15 +767,15 @@ void TPrint_rendiconto_ca_recordset::crea_righe_rmovana()
|
||||
|
||||
void TPrint_rendiconto_ca_recordset::crea_righe_rdoc(const TPrint_rendiconto_ca_mask& msk)
|
||||
{
|
||||
TRelation rel_doc(LF_DOC);
|
||||
// rel_doc.add(LF_RIGHEDOC, "CODNUM==CODNUM|ANNO==ANNO|PROVV==PROVV|NDOC==NDOC"); //aggiunge le testate
|
||||
TRelation rel_rdoc(LF_RIGHEDOC);
|
||||
rel_rdoc.add(LF_DOC, "CODNUM==CODNUM|ANNO==ANNO|PROVV==PROVV|NDOC==NDOC"); //aggiunge le testate
|
||||
|
||||
TRectype dadoc(LF_DOC);
|
||||
TRectype adoc(LF_DOC);
|
||||
TRectype dardoc(LF_RIGHEDOC);
|
||||
TRectype ardoc(LF_RIGHEDOC);
|
||||
TString filtro_date;
|
||||
|
||||
dadoc.put(DOC_PROVV, 'D');
|
||||
adoc.put(DOC_PROVV, 'D');
|
||||
dardoc.put(RDOC_PROVV, 'D');
|
||||
ardoc.put(RDOC_PROVV, 'D');
|
||||
|
||||
//se siamo fortunati l'anno si può trovare così..
|
||||
int anno = msk.get_int(F_ANNO);
|
||||
@ -775,18 +784,18 @@ void TPrint_rendiconto_ca_recordset::crea_righe_rdoc(const TPrint_rendiconto_ca_
|
||||
|
||||
if (anno > 0)
|
||||
{
|
||||
dadoc.put(DOC_ANNO, anno);
|
||||
adoc.put(DOC_ANNO, anno);
|
||||
dardoc.put(RDOC_ANNO, anno);
|
||||
ardoc.put(RDOC_ANNO, anno);
|
||||
}
|
||||
|
||||
if (_dadata.ok())
|
||||
filtro_date << "(ANSI(DATADOC)>=" << _dadata.date2ansi() << ")";
|
||||
filtro_date << "(ANSI(33->DATADOC)>=" << _dadata.date2ansi() << ")";
|
||||
if (_adata.ok())
|
||||
{
|
||||
if (filtro_date.not_empty())
|
||||
filtro_date << "&&";
|
||||
|
||||
filtro_date << "(ANSI(DATADOC)<=" << _adata.date2ansi() << ")";
|
||||
filtro_date << "(ANSI(33->DATADOC)<=" << _adata.date2ansi() << ")";
|
||||
}
|
||||
|
||||
TContabilizzazione_analitica cont_anal; //oggetto necessario per contabilizzare il documento in osservazione
|
||||
@ -799,33 +808,33 @@ void TPrint_rendiconto_ca_recordset::crea_righe_rdoc(const TPrint_rendiconto_ca_
|
||||
const TString4 codnum(row->get(0)); //prende il codice numerazione sulla riga
|
||||
if (anno > 0)
|
||||
{
|
||||
dadoc.put(DOC_CODNUM, codnum);
|
||||
adoc.put(DOC_CODNUM, codnum);
|
||||
dardoc.put(RDOC_CODNUM, codnum);
|
||||
ardoc.put(RDOC_CODNUM, codnum);
|
||||
}
|
||||
|
||||
TString filtro = filtro_date;
|
||||
if (filtro.not_empty())
|
||||
filtro << "&&";
|
||||
filtro << "(CODNUM==\"" << codnum << "\")";
|
||||
filtro << "&&(PROVV==\"" << "D" << "\")";
|
||||
filtro << "&&(33->STATO>=\"" << row->get(2) << "\")";
|
||||
filtro << "&&(33->STATO<=\"" << row->get(3) << "\")";
|
||||
|
||||
TCursor cur_rdoc(&rel_rdoc, filtro, 1, &dardoc, &ardoc);
|
||||
const long rdoc_items = cur_rdoc.items();
|
||||
cur_rdoc.freeze();
|
||||
|
||||
TCursor cur_doc(&rel_doc, filtro, 1, &dadoc, &adoc);
|
||||
const long doc_items = cur_doc.items();
|
||||
cur_doc.freeze();
|
||||
|
||||
if (doc_items > 0)
|
||||
if (rdoc_items > 0)
|
||||
{
|
||||
TString commento_progind;
|
||||
commento_progind << "Scansione documenti " << codnum << "...";
|
||||
TProgind pi(doc_items, commento_progind);
|
||||
commento_progind << "Scansione righe documenti " << codnum << "...";
|
||||
TProgind pi(rdoc_items, commento_progind);
|
||||
|
||||
//scanning del file dei documenti alla ricerca di quelli che hanno la data ed il CODNUM
|
||||
//validi nei filtri impostati dall'utente
|
||||
for (cur_doc = 0; cur_doc.pos() < doc_items; ++cur_doc)
|
||||
for (cur_rdoc = 0; cur_rdoc.pos() < rdoc_items; ++cur_rdoc)
|
||||
{
|
||||
pi.addstatus(1);
|
||||
TDocumento doc(cur_doc.curr());
|
||||
TDocumento doc(cur_rdoc.curr(LF_DOC));
|
||||
TAnal_mov mov;
|
||||
cont_anal.elabora(doc, 0, NULL, false, mov);
|
||||
for (int j = 1; j <= mov.rows(); j++)
|
||||
@ -843,23 +852,24 @@ void TPrint_rendiconto_ca_recordset::crea_trr(const TFilename& trr) const
|
||||
{
|
||||
ofstream of(trr);
|
||||
of << 1000 << endl;
|
||||
of << 14 << endl;
|
||||
of << 15 << endl;
|
||||
of << "CONTO|1|20|0|Conto analitico" << endl;
|
||||
of << "CODNUM|1|4|0|Numerazione documento" << endl;
|
||||
of << "ANNO|9|4|0|Anno" << endl;
|
||||
of << "DATA|5|8|0|Data movimento o documento" << endl;
|
||||
of << "NUMRD|3|7|0|Numero registrazione o documento" << endl;
|
||||
of << "NRIGA|2|3|0|Riga movimento o documento" << endl;
|
||||
of << "ANNO|9|4|0|Anno" << endl;
|
||||
of << "NUMDOCRIF|1|7|0|Numero documento riferimento" << endl;
|
||||
of << "DATADOCRIF|5|8|0|Data documento riferimento" << endl;
|
||||
of << "DESC|1|50|0|Descrizione movimento o documento" << endl;
|
||||
of << "NRIGA|2|3|0|Riga movimento o documento" << endl;
|
||||
of << "DESCRIGA|1|50|0|Descrizione riga movimento o documento" << endl;
|
||||
of << "DOCORIG|1|20|0|Riferimento ordine/bolla" << endl;
|
||||
of << "FATTURATO|4|18|5|Fatturato" << endl;
|
||||
of << "MATURATO|4|18|5|Maturato" << endl;
|
||||
of << "IMPEGNATO|4|18|5|Impegnato" << endl;
|
||||
of << "CONTOCG|1|12|0|Conto contabile" << endl;
|
||||
of << 1 << endl;
|
||||
of << "CONTO+CODNUM+DATA+NUMRD" << endl;
|
||||
of << "CONTO+CODNUM+DATA+NUMRD+NRIGA" << endl;
|
||||
}
|
||||
|
||||
void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row)
|
||||
|
@ -293,7 +293,7 @@ STRING SN_DASTATO 1
|
||||
BEGIN
|
||||
PROMPT 1 3 "Da stato "
|
||||
USE %STD
|
||||
CHECKTYPE NORMAL
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB SN_DASTATO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
@ -305,7 +305,7 @@ STRING SN_ASTATO 1
|
||||
BEGIN
|
||||
PROMPT 1 4 "A stato "
|
||||
USE %STD
|
||||
CHECKTYPE NORMAL
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB SN_ASTATO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
|
Loading…
x
Reference in New Issue
Block a user