Patch level : nopatch
Files correlati : Commento : Fido
This commit is contained in:
parent
7346ddc573
commit
496ce96167
@ -876,6 +876,7 @@ static real calcola_esposto_da_saldaconto (const char tipocf, const long codcf,c
|
|||||||
// //data considerante i giorni di rischio ammessi dall'utonto
|
// //data considerante i giorni di rischio ammessi dall'utonto
|
||||||
TDate data_sbf = to;
|
TDate data_sbf = to;
|
||||||
TImporto esposto; //importone somma degli importi delle righe del recordset
|
TImporto esposto; //importone somma degli importi delle righe del recordset
|
||||||
|
TAssoc_array parts;
|
||||||
|
|
||||||
//estrae le righe partita relative a pagamenti successivi alla data di rischio (e con tipopag >2,<7)
|
//estrae le righe partita relative a pagamenti successivi alla data di rischio (e con tipopag >2,<7)
|
||||||
TString query;
|
TString query;
|
||||||
@ -886,65 +887,36 @@ static real calcola_esposto_da_saldaconto (const char tipocf, const long codcf,c
|
|||||||
TISAM_recordset partite(query);
|
TISAM_recordset partite(query);
|
||||||
|
|
||||||
data_sbf -= riskdays;
|
data_sbf -= riskdays;
|
||||||
for (bool ok = partite.move_first(); ok; ok = partite.move_next())
|
for (bool ok = partite.move_first(); ok; ok = partite.move_next())
|
||||||
{
|
{
|
||||||
const TDate datadoc = partite.get_date(PART_DATADOC);
|
const TDate datareg = partite.get_date(PART_DATAREG);
|
||||||
const int anno = partite.get_int(PART_ANNO);
|
|
||||||
const TString& npart = partite.get_string(PART_NUMPART);
|
|
||||||
const long nreg = partite.get_long(PART_NREG);
|
|
||||||
|
|
||||||
if (datadoc>= from)
|
if (between(datareg, from, to))
|
||||||
{
|
{
|
||||||
TBill bill(0, 0, codcf, 'C');
|
TBill bill(0, 0, codcf, 'C');
|
||||||
TPartita part(bill,anno, npart);
|
const int anno = partite.get_int(PART_ANNO);
|
||||||
|
const TString& npart = partite.get_string(PART_NUMPART);
|
||||||
for (int r = part.last(); r > 0; r = part.pred(r)) {
|
TToken_string key;
|
||||||
|
|
||||||
const TRiga_partite& row = part.riga(r);
|
|
||||||
bool is_esposto;
|
|
||||||
TImporto imp = row.esposto(false, to, data_sbf, is_esposto);
|
|
||||||
|
|
||||||
if (is_esposto)
|
key.add(anno);
|
||||||
esposto += imp;
|
key.add(npart);
|
||||||
|
|
||||||
|
|
||||||
}
|
if (anno == 2021 && (atoi(npart) > 2000))
|
||||||
|
int i = 1;
|
||||||
|
if (!parts.is_key(key))
|
||||||
|
parts.add(key, new TPartita(bill, anno, npart));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
bool is_esposto;
|
||||||
TImporto importo_riga;
|
|
||||||
|
|
||||||
//fatture,note di credito,pagamenti
|
FOR_EACH_ASSOC_OBJECT(parts, ho, key, o)
|
||||||
TImporto importo_partita = get_importo(partite, PART_SEZ, PART_IMPORTO);
|
{
|
||||||
|
const TPartita & p = (const TPartita &)*o;
|
||||||
|
|
||||||
|
if (p.anno() == 2021 && atoi(p.numero()) > 2000)
|
||||||
importo_riga += importo_partita;
|
int i = 1;
|
||||||
const tipo_movimento tipo_mov = (tipo_movimento)partite.get_int(PART_TIPOMOV);
|
esposto += p.esposto(false, to, data_sbf, is_esposto);
|
||||||
const tipo_pagamento tipo_pag = (tipo_pagamento)partite.get_int(PART_TIPOPAG);
|
|
||||||
TDate data = partite.get_date(PART_DATAPAG);
|
|
||||||
const long codcf = partite.get_long(PART_SOTTOCONTO);
|
|
||||||
|
|
||||||
if (!data.ok())
|
|
||||||
data = partite.get_date(PART_DATAREG);
|
|
||||||
//pagamenti (tm=3), insoluti (tm=5), pagamenti insoluti(tm=6)
|
|
||||||
if ((tipo_mov >= tm_pagamento) &&
|
|
||||||
(tipo_pag >= tp_tratta && tipo_pag <= tp_rid) &&
|
|
||||||
((data >= data_sbf) && (data <= to)))
|
|
||||||
{
|
|
||||||
TImporto importo_abbuono = get_importo(partite, PART_SEZABB, PART_ABBUONI);
|
|
||||||
importo_riga += importo_abbuono;
|
|
||||||
|
|
||||||
if (!partite.get(PART_CODVAL).is_empty()) // pagamenti in valuta
|
|
||||||
{
|
|
||||||
TImporto importo_diff_cambio = get_importo(partite, PART_SEZDIFCAM, PART_DIFFCAM);
|
|
||||||
importo_riga += importo_diff_cambio;
|
|
||||||
}
|
|
||||||
//somma importi presenti sulla riga partita (fatture, pagamenti, insoluti, pagamenti insoluti)
|
|
||||||
esposto += importo_riga;
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//la normalizzazione del totale delle partite va fatta in base al fatto che si parli di 'C'liente o 'F'ornitore
|
//la normalizzazione del totale delle partite va fatta in base al fatto che si parli di 'C'liente o 'F'ornitore
|
||||||
const char sezione_finale = (tipocf == 'C') ? 'A' : 'D';
|
const char sezione_finale = (tipocf == 'C') ? 'A' : 'D';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user