Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@19907 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3a65000098
commit
82848382a8
@ -353,21 +353,24 @@ void TImporta_sc::nuovo_pagamento_o_nota(const TImporta_cogeco_recset& recset, T
|
||||
{
|
||||
const TRiga_scadenze& rata = fattura.rata(nrata);
|
||||
const real residuo = rata.residuo(false).valore();
|
||||
const TDate data_scad = rata.get(SCAD_DATASCAD);
|
||||
int score = data_scad == datadoc ? 2 : 0;
|
||||
if (score == 0 && datadoc == data_scad+1L)
|
||||
score++;
|
||||
if (residuo >= importo)
|
||||
{
|
||||
score++;
|
||||
if (residuo == importo)
|
||||
score++;
|
||||
}
|
||||
if (score > best_score)
|
||||
{
|
||||
best_rata = nrata;
|
||||
best_score = score;
|
||||
}
|
||||
if (!residuo.is_zero())
|
||||
{
|
||||
const TDate data_scad = rata.get(SCAD_DATASCAD);
|
||||
int score = data_scad == datadoc ? 2 : 0;
|
||||
if (score == 0 && datadoc == data_scad+1L)
|
||||
score++;
|
||||
if (residuo >= importo)
|
||||
{
|
||||
score++;
|
||||
if (residuo == importo)
|
||||
score++;
|
||||
}
|
||||
if (score > best_score)
|
||||
{
|
||||
best_rata = nrata;
|
||||
best_score = score;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (best_rata > 0)
|
||||
paga_rata(game, best_rata, nrigp, importo);
|
||||
@ -425,22 +428,25 @@ bool TImporta_sc::nuovo_insoluto(const TImporta_cogeco_recset& recset, TPartita&
|
||||
for (int nrata = fattura.rate(); nrata > 0; nrata--)
|
||||
{
|
||||
const TRiga_scadenze& scadenza = fattura.rata(nrata);
|
||||
const TImporto imp = scadenza.importo_pagato(false);
|
||||
const TDate data = scadenza.get(SCAD_DATASCAD);
|
||||
int score = datadoc == data ? 2 : 0;
|
||||
if (score == 0 && datadoc == data+1L)
|
||||
score++;
|
||||
if (imp.valore() >= importo)
|
||||
{
|
||||
score++;
|
||||
if (imp.valore() == importo)
|
||||
score++;
|
||||
}
|
||||
if (score > best_score)
|
||||
{
|
||||
best_rata = nrata;
|
||||
best_score = score;
|
||||
}
|
||||
const real imp = scadenza.importo_pagato(false).valore();
|
||||
if (!imp.is_zero())
|
||||
{
|
||||
const TDate data = scadenza.get(SCAD_DATASCAD);
|
||||
int score = datadoc == data ? 2 : 0;
|
||||
if (score == 0 && datadoc == data+1L)
|
||||
score++;
|
||||
if (imp >= importo)
|
||||
{
|
||||
score++;
|
||||
if (imp == importo)
|
||||
score++;
|
||||
}
|
||||
if (score > best_score)
|
||||
{
|
||||
best_rata = nrata;
|
||||
best_score = score;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (best_rata > 0) // Se ho trovato almeno una rata compatibile con l'insoluto...
|
||||
|
@ -151,7 +151,8 @@ void TImporta_cesp::transfer(const TFilename& file)
|
||||
long ntran = 1;
|
||||
TLog_report log(caption);
|
||||
TLocalisamfile cespi(LF_CESPI);
|
||||
|
||||
TLocalisamfile salce(LF_SALCE);
|
||||
TLocalisamfile ammce(LF_AMMCE);
|
||||
for (bool ok = recset.move_to(1); ok ; ok = recset.move_next())
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
@ -171,6 +172,7 @@ void TImporta_cesp::transfer(const TFilename& file)
|
||||
if (real::is_null(codpadre)) // nuovo cespite
|
||||
{
|
||||
// creo record anagrafica cespi
|
||||
cespi.zero();
|
||||
cespi.put(CESPI_IDCESPITE, codces);
|
||||
const int gr = recset.get(CGC_GRUPPO).as_int();
|
||||
const TString4 sp = recset.get(CGC_SPECIE).as_string();
|
||||
@ -191,7 +193,7 @@ void TImporta_cesp::transfer(const TFilename& file)
|
||||
cespi.put(CESPI_TPSPEMAN, 1);
|
||||
|
||||
// creo record salce
|
||||
TLocalisamfile salce(LF_SALCE);
|
||||
salce.zero();
|
||||
salce.put(SALCE_IDCESPITE, cespi.get(CESPI_IDCESPITE));
|
||||
salce.put(SALCE_CODES, lastesc); // verificare se ultimo esercizio va bene (2010?)
|
||||
salce.put(SALCE_TPSALDO, 1); // verificare se saldo iniziale (1) va bene
|
||||
@ -199,7 +201,7 @@ void TImporta_cesp::transfer(const TFilename& file)
|
||||
salce.put(SALCE_CSTO, recset.get(CGC_COSTOACQ).as_real());
|
||||
|
||||
// creo record ammce
|
||||
TLocalisamfile ammce(LF_AMMCE);
|
||||
ammce.zero();
|
||||
ammce.put(AMMCE_IDCESPITE, salce.get(CESPI_IDCESPITE));
|
||||
ammce.put(AMMCE_CODES, salce.get(SALCE_CODES));
|
||||
ammce.put(AMMCE_TPSALDO, salce.get(SALCE_TPSALDO));
|
||||
@ -227,7 +229,19 @@ void TImporta_cesp::transfer(const TFilename& file)
|
||||
}
|
||||
else
|
||||
{
|
||||
// chiedere cosa fare perche' non ho capito cosa devo sommare!!
|
||||
cespi.zero();
|
||||
cespi.put(CESPI_IDCESPITE, codpadre);
|
||||
int err = cespi.read();
|
||||
if ( err == NOERR)
|
||||
{
|
||||
TString256 descr = cespi.get(CESPI_DESC);
|
||||
descr << '+' << recset.get(CGC_DESCR).as_string();
|
||||
descr.cut(60);
|
||||
cespi.put(CESPI_DESC, descr);
|
||||
cespi.write();
|
||||
}
|
||||
else
|
||||
log_error(log, TR("Errore nel cespite padre "), recset, err);
|
||||
}
|
||||
}
|
||||
if (log.recordset()->items() > 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user