Patch level : 10.0 514
Files correlati : ve0.exe ve6.exe Ricompilazione Demo : [ ] EElminata segnalazione inutile sulla mancanza di rate git-svn-id: svn://10.65.10.50/trunk@19623 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
33e9f8b468
commit
0ff8b7232e
179
ve/velib04c.cpp
179
ve/velib04c.cpp
@ -306,7 +306,7 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
|
|||||||
{
|
{
|
||||||
_error = codpag_error;
|
_error = codpag_error;
|
||||||
display_error(doc);
|
display_error(doc);
|
||||||
return 0L;
|
continue;
|
||||||
}
|
}
|
||||||
const real tot = doc.totale_doc() - doc.ritenute();
|
const real tot = doc.totale_doc() - doc.ritenute();
|
||||||
doc.put(DOC_CODPAG, codpag); //placeholder
|
doc.put(DOC_CODPAG, codpag); //placeholder
|
||||||
@ -337,11 +337,7 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
|
|||||||
TPagamento& pag = doc.pagamento();
|
TPagamento& pag = doc.pagamento();
|
||||||
int numrate = pag.n_rate( );
|
int numrate = pag.n_rate( );
|
||||||
if (numrate <= 0)
|
if (numrate <= 0)
|
||||||
{
|
continue;
|
||||||
_error = scadenze_error;
|
|
||||||
display_error(doc);
|
|
||||||
return 0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (numrate > last_rata)
|
if (numrate > last_rata)
|
||||||
{
|
{
|
||||||
@ -594,103 +590,100 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
|
|||||||
TPagamento & pag = doc.pagamento();
|
TPagamento & pag = doc.pagamento();
|
||||||
// CHECK(pag,"Failed to create a TPagamento");
|
// CHECK(pag,"Failed to create a TPagamento");
|
||||||
const int numrate = pag.n_rate( );
|
const int numrate = pag.n_rate( );
|
||||||
if (numrate <= 0)
|
if (numrate > 0)
|
||||||
{
|
{
|
||||||
_error = scadenze_error;
|
_efffile->last();
|
||||||
return;
|
// Variabili per la scrittura dell'effetto
|
||||||
}
|
long nprog = _efffile->get_long(EFF_NPROGTR)+1;
|
||||||
|
const char tipocf = doc.get_char(DOC_TIPOCF);
|
||||||
|
const long codcf = doc.get_long(DOC_CODCF);
|
||||||
|
const TString4 codval(doc.get(DOC_CODVAL));
|
||||||
|
const TDate data_cambio = doc.get_date(DOC_DATACAMBIO);
|
||||||
|
const bool contro_euro = doc.get_bool(DOC_CONTROEURO);
|
||||||
|
const long codabi = doc.get_long(DOC_CODABIA);
|
||||||
|
const long codcab = doc.get_long(DOC_CODCABA);
|
||||||
|
const TString80 iban = doc.get(DOC_IBAN);
|
||||||
|
const TString16 provv(doc.get(DOC_PROVV));
|
||||||
|
const int anno = doc.get_int(DOC_ANNO);
|
||||||
|
const TString16 codnum(doc.get(DOC_CODNUM));
|
||||||
|
const long nfatt = doc.get_long(DOC_NDOC);
|
||||||
|
const TDate datafatt = doc.get_date(DOC_DATADOC);
|
||||||
|
TRectype& effetto = _efffile->curr();
|
||||||
|
TRectype& reffetto = _refffile->curr();
|
||||||
|
real importo;
|
||||||
|
for (int i = 0; i < numrate && good(); i++)
|
||||||
|
{
|
||||||
|
const int nrata = is_anticipo ? i + 2: i + 1;
|
||||||
|
|
||||||
_efffile->last();
|
if (valid_type(pag.tipo_rata(i)))
|
||||||
// Variabili per la scrittura dell'effetto
|
|
||||||
long nprog = _efffile->get_long(EFF_NPROGTR)+1;
|
|
||||||
const char tipocf = doc.get_char(DOC_TIPOCF);
|
|
||||||
const long codcf = doc.get_long(DOC_CODCF);
|
|
||||||
const TString4 codval(doc.get(DOC_CODVAL));
|
|
||||||
const TDate data_cambio = doc.get_date(DOC_DATACAMBIO);
|
|
||||||
const bool contro_euro = doc.get_bool(DOC_CONTROEURO);
|
|
||||||
const long codabi = doc.get_long(DOC_CODABIA);
|
|
||||||
const long codcab = doc.get_long(DOC_CODCABA);
|
|
||||||
const TString80 iban = doc.get(DOC_IBAN);
|
|
||||||
const TString16 provv(doc.get(DOC_PROVV));
|
|
||||||
const int anno = doc.get_int(DOC_ANNO);
|
|
||||||
const TString16 codnum(doc.get(DOC_CODNUM));
|
|
||||||
const long nfatt = doc.get_long(DOC_NDOC);
|
|
||||||
const TDate datafatt = doc.get_date(DOC_DATADOC);
|
|
||||||
TRectype& effetto = _efffile->curr();
|
|
||||||
TRectype& reffetto = _refffile->curr();
|
|
||||||
real importo;
|
|
||||||
for (int i = 0; i < numrate && good(); i++)
|
|
||||||
{
|
|
||||||
const int nrata = is_anticipo ? i + 2: i + 1;
|
|
||||||
|
|
||||||
if (valid_type(pag.tipo_rata(i)))
|
|
||||||
{
|
|
||||||
effetto.zero();
|
|
||||||
reffetto.zero();
|
|
||||||
effetto.put(EFF_NPROGTR,nprog);
|
|
||||||
effetto.put(EFF_DATASCAD, pag.data_rata(i));
|
|
||||||
effetto.put(EFF_TIPOPAG,pag.tipo_rata(i));
|
|
||||||
effetto.put(EFF_ULTCLASS,pag.ulc_rata(i));
|
|
||||||
effetto.put(EFF_TIPOCF, tipocf);
|
|
||||||
effetto.put(EFF_CODCF, codcf);
|
|
||||||
effetto.put(EFF_CODVAL, codval);
|
|
||||||
if (valuta)
|
|
||||||
{
|
|
||||||
effetto.put(EFF_CAMBIO, change);
|
|
||||||
effetto.put(EFF_DATACAMBIO,data_cambio);
|
|
||||||
effetto.put(EFF_CONTROEURO, contro_euro);
|
|
||||||
}
|
|
||||||
effetto.put(EFF_CODABI,codabi);
|
|
||||||
effetto.put(EFF_CODCAB,codcab);
|
|
||||||
effetto.put(EFF_IBAN,iban);
|
|
||||||
effetto.put(EFF_EFFCOMP,TRUE);
|
|
||||||
if (i == numrate - 1) effetto.put(EFF_ULTRATA,TRUE);
|
|
||||||
// Put sulla riga dell'effetto
|
|
||||||
reffetto.put(REFF_NPROGTR,nprog);
|
|
||||||
reffetto.put(REFF_NRIGATR,1);
|
|
||||||
reffetto.put(REFF_DATAFATT, datafatt);
|
|
||||||
reffetto.put(REFF_NRATA,nrata);
|
|
||||||
reffetto.put(REFF_PROVV,provv);
|
|
||||||
reffetto.put(REFF_ANNODOC,anno);
|
|
||||||
reffetto.put(REFF_CODNUM,codnum);
|
|
||||||
reffetto.put(REFF_NFATT,nfatt);
|
|
||||||
if (doc.get_char(DOC_TIPOCF) == 'F' || doc.tipo().nota_credito())
|
|
||||||
{
|
|
||||||
reffetto.put(REFF_ANNO, doc.get_date(DOC_DATADOCRIF).year());
|
|
||||||
reffetto.put(REFF_NUMPART, doc.get(DOC_NUMDOCRIF));
|
|
||||||
}
|
|
||||||
|
|
||||||
importo = pag.importo_rata(i,FALSE);
|
|
||||||
effetto.put(EFF_IMPORTO,importo);
|
|
||||||
reffetto.put(REFF_IMPFATT,totale_fatt.get_num());
|
|
||||||
reffetto.put(REFF_IMPORTO,importo);
|
|
||||||
|
|
||||||
TString key;
|
|
||||||
|
|
||||||
key.format("%c|%ld", tipocf, codcf);
|
|
||||||
const real impmin(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
|
||||||
|
|
||||||
if (importo >= impmin)
|
|
||||||
{
|
{
|
||||||
|
effetto.zero();
|
||||||
|
reffetto.zero();
|
||||||
|
effetto.put(EFF_NPROGTR,nprog);
|
||||||
|
effetto.put(EFF_DATASCAD, pag.data_rata(i));
|
||||||
|
effetto.put(EFF_TIPOPAG,pag.tipo_rata(i));
|
||||||
|
effetto.put(EFF_ULTCLASS,pag.ulc_rata(i));
|
||||||
|
effetto.put(EFF_TIPOCF, tipocf);
|
||||||
|
effetto.put(EFF_CODCF, codcf);
|
||||||
|
effetto.put(EFF_CODVAL, codval);
|
||||||
if (valuta)
|
if (valuta)
|
||||||
{
|
{
|
||||||
importo = pag.importo_rata(i,TRUE); // Importo in valuta
|
effetto.put(EFF_CAMBIO, change);
|
||||||
TCurrency_documento totfatlit(totale_fatt); totfatlit.change_to_firm_val();
|
effetto.put(EFF_DATACAMBIO,data_cambio);
|
||||||
effetto.put(EFF_IMPORTOVAL,importo);
|
effetto.put(EFF_CONTROEURO, contro_euro);
|
||||||
reffetto.put(REFF_IMPFATTVAL,totale_fatt.get_num());
|
}
|
||||||
reffetto.put(REFF_IMPFATT,totfatlit.get_num());
|
effetto.put(EFF_CODABI,codabi);
|
||||||
reffetto.put(REFF_IMPORTOVAL,importo);
|
effetto.put(EFF_CODCAB,codcab);
|
||||||
|
effetto.put(EFF_IBAN,iban);
|
||||||
|
effetto.put(EFF_EFFCOMP,TRUE);
|
||||||
|
if (i == numrate - 1) effetto.put(EFF_ULTRATA,TRUE);
|
||||||
|
// Put sulla riga dell'effetto
|
||||||
|
reffetto.put(REFF_NPROGTR,nprog);
|
||||||
|
reffetto.put(REFF_NRIGATR,1);
|
||||||
|
reffetto.put(REFF_DATAFATT, datafatt);
|
||||||
|
reffetto.put(REFF_NRATA,nrata);
|
||||||
|
reffetto.put(REFF_PROVV,provv);
|
||||||
|
reffetto.put(REFF_ANNODOC,anno);
|
||||||
|
reffetto.put(REFF_CODNUM,codnum);
|
||||||
|
reffetto.put(REFF_NFATT,nfatt);
|
||||||
|
if (doc.get_char(DOC_TIPOCF) == 'F' || doc.tipo().nota_credito())
|
||||||
|
{
|
||||||
|
reffetto.put(REFF_ANNO, doc.get_date(DOC_DATADOCRIF).year());
|
||||||
|
reffetto.put(REFF_NUMPART, doc.get(DOC_NUMDOCRIF));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_efffile->write() == NOERR && _refffile->write() == NOERR)
|
importo = pag.importo_rata(i,FALSE);
|
||||||
|
effetto.put(EFF_IMPORTO,importo);
|
||||||
|
reffetto.put(REFF_IMPFATT,totale_fatt.get_num());
|
||||||
|
reffetto.put(REFF_IMPORTO,importo);
|
||||||
|
|
||||||
|
TString key;
|
||||||
|
|
||||||
|
key.format("%c|%ld", tipocf, codcf);
|
||||||
|
const real impmin(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
||||||
|
|
||||||
|
if (importo >= impmin)
|
||||||
{
|
{
|
||||||
_total_bills++;
|
if (valuta)
|
||||||
nprog++;
|
{
|
||||||
|
importo = pag.importo_rata(i,TRUE); // Importo in valuta
|
||||||
|
TCurrency_documento totfatlit(totale_fatt); totfatlit.change_to_firm_val();
|
||||||
|
effetto.put(EFF_IMPORTOVAL,importo);
|
||||||
|
reffetto.put(REFF_IMPFATTVAL,totale_fatt.get_num());
|
||||||
|
reffetto.put(REFF_IMPFATT,totfatlit.get_num());
|
||||||
|
reffetto.put(REFF_IMPORTOVAL,importo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_efffile->write() == NOERR && _refffile->write() == NOERR)
|
||||||
|
{
|
||||||
|
_total_bills++;
|
||||||
|
nprog++;
|
||||||
|
}
|
||||||
|
else _error = write_error;
|
||||||
}
|
}
|
||||||
else _error = write_error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user