Patch level : 10.0
Files correlati : ve6.exe Ricompilazione Demo : [ ] Commento : Miugliorato calcolo totale documento in generazione effetti batch git-svn-id: svn://10.65.10.50/trunk@20545 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8f7cd35669
commit
8d7e5c7128
@ -54,11 +54,7 @@ TRiga_documento& TDoc_recordset::riga_doc(int n) const
|
|||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
n = _mypos+1;
|
n = _mypos+1;
|
||||||
if (n > _doc->rows()) // Non dovrebbe succedere mai
|
if (n > _doc->rows()) // Non dovrebbe succedere mai
|
||||||
{
|
n = _doc->new_row("05").get_int(RDOC_NRIGA); // Crea ua riga descrizione fittizia
|
||||||
n = _doc->
|
|
||||||
new_row("05").get_int(RDOC_NRIGA);
|
|
||||||
//(*_doc)[n].put(RDOC_TIPORIGA, "05"); // Crea ua riga descrizione fittizia
|
|
||||||
}
|
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
n = 1;
|
n = 1;
|
||||||
return (*_doc)[n];
|
return (*_doc)[n];
|
||||||
|
@ -727,7 +727,7 @@ protected:
|
|||||||
void init();
|
void init();
|
||||||
void check_modules();
|
void check_modules();
|
||||||
virtual void set_variables(TExpression * e) const ;
|
virtual void set_variables(TExpression * e) const ;
|
||||||
void update_raee();
|
void update_raee();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int set_row_ids();
|
int set_row_ids();
|
||||||
|
@ -561,15 +561,20 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
|
|||||||
|
|
||||||
if (!doc.is_nota_credito()) // I documenti immessi come note di credito non generano effetti...(che senso hanno gli effetti con importi negativi?)
|
if (!doc.is_nota_credito()) // I documenti immessi come note di credito non generano effetti...(che senso hanno gli effetti con importi negativi?)
|
||||||
{
|
{
|
||||||
const TString16 codpag(doc.get(DOC_CODPAG));
|
const TString4 codpag(doc.get(DOC_CODPAG));
|
||||||
const TRectype& cpg = cache().get("%CPG", codpag);
|
const TRectype& cpg = cache().get("%CPG", codpag);
|
||||||
if (cpg.empty())
|
if (cpg.empty())
|
||||||
{
|
{
|
||||||
_error = codpag_error;
|
_error = codpag_error;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TString16 data(doc.get(DOC_DATAINSC));
|
|
||||||
|
|
||||||
|
// Totdoc inaffidabile: ne forzo il ricalcolo
|
||||||
|
TVariable_field* tot_fld = doc.variable_field(doc.tipo().totale_doc());
|
||||||
|
if (tot_fld != NULL)
|
||||||
|
tot_fld->set_dirty();
|
||||||
|
|
||||||
|
TString16 data(doc.get(DOC_DATAINSC));
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
data = doc.get(DOC_DATADOC);
|
data = doc.get(DOC_DATADOC);
|
||||||
|
|
||||||
@ -601,9 +606,9 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
|
|||||||
const long codabi = doc.get_long(DOC_CODABIA);
|
const long codabi = doc.get_long(DOC_CODABIA);
|
||||||
const long codcab = doc.get_long(DOC_CODCABA);
|
const long codcab = doc.get_long(DOC_CODCABA);
|
||||||
const TString80 iban = doc.get(DOC_IBAN);
|
const TString80 iban = doc.get(DOC_IBAN);
|
||||||
const TString16 provv(doc.get(DOC_PROVV));
|
const TString4 provv(doc.get(DOC_PROVV));
|
||||||
const int anno = doc.get_int(DOC_ANNO);
|
const int anno = doc.get_int(DOC_ANNO);
|
||||||
const TString16 codnum(doc.get(DOC_CODNUM));
|
const TString4 codnum(doc.get(DOC_CODNUM));
|
||||||
const long nfatt = doc.get_long(DOC_NDOC);
|
const long nfatt = doc.get_long(DOC_NDOC);
|
||||||
const TDate datafatt = doc.get_date(DOC_DATADOC);
|
const TDate datafatt = doc.get_date(DOC_DATADOC);
|
||||||
TRectype& effetto = _efffile->curr();
|
TRectype& effetto = _efffile->curr();
|
||||||
@ -655,29 +660,27 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
|
|||||||
reffetto.put(REFF_IMPFATT,totale_fatt.get_num());
|
reffetto.put(REFF_IMPFATT,totale_fatt.get_num());
|
||||||
reffetto.put(REFF_IMPORTO,importo);
|
reffetto.put(REFF_IMPORTO,importo);
|
||||||
|
|
||||||
TString key;
|
TString8 key;
|
||||||
|
|
||||||
key.format("%c|%ld", tipocf, codcf);
|
key.format("%c|%ld", tipocf, codcf);
|
||||||
const real impmin(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
const real impmin(cache().get(LF_CFVEN, key, CFV_IMPMINEFF));
|
||||||
|
|
||||||
if (importo >= impmin)
|
if (importo >= impmin)
|
||||||
{
|
{
|
||||||
if (valuta)
|
if (valuta)
|
||||||
{
|
{
|
||||||
importo = pag.importo_rata(i,TRUE); // Importo in valuta
|
importo = pag.importo_rata(i, true); // Importo in valuta
|
||||||
TCurrency_documento totfatlit(totale_fatt); totfatlit.change_to_firm_val();
|
TCurrency_documento totfatlit(totale_fatt); totfatlit.change_to_firm_val();
|
||||||
effetto.put(EFF_IMPORTOVAL,importo);
|
effetto.put(EFF_IMPORTOVAL,importo);
|
||||||
reffetto.put(REFF_IMPFATTVAL,totale_fatt.get_num());
|
reffetto.put(REFF_IMPFATTVAL,totale_fatt.get_num());
|
||||||
reffetto.put(REFF_IMPFATT,totfatlit.get_num());
|
reffetto.put(REFF_IMPFATT,totfatlit.get_num());
|
||||||
reffetto.put(REFF_IMPORTOVAL,importo);
|
reffetto.put(REFF_IMPORTOVAL,importo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_efffile->write() == NOERR && _refffile->write() == NOERR)
|
if (_efffile->write() == NOERR && _refffile->write() == NOERR)
|
||||||
{
|
{
|
||||||
_total_bills++;
|
_total_bills++;
|
||||||
nprog++;
|
nprog++;
|
||||||
}
|
}
|
||||||
else _error = write_error;
|
else
|
||||||
|
_error = write_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -701,7 +704,7 @@ bool TGenerazione_effetti::elabora(TLista_documenti& doc_in, TLista_documenti& d
|
|||||||
for (int i = 0; i < items ; i++) // Scorriamo tutti i documenti nella lista
|
for (int i = 0; i < items ; i++) // Scorriamo tutti i documenti nella lista
|
||||||
{
|
{
|
||||||
TDocumento& doc = doc_in[i];
|
TDocumento& doc = doc_in[i];
|
||||||
msg.format("Generazione effetti documento %s/%ld.", (const char*) doc.numerazione(), doc.numero());
|
msg.format(FR("Generazione effetti documento %s/%ld."), (const char*) doc.numerazione(), doc.numero());
|
||||||
xvtil_statbar_set(msg);
|
xvtil_statbar_set(msg);
|
||||||
do_events();
|
do_events();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user