Patch level : 12.0 1028
Files correlati : tf0.exe Commento : Modificato l'aggiornamento del database del trasferimento fatture. Non modificava i campi esistenti ma creava solo i campi nuovi. Aggiornata la funzione che carica la natura IVA.
This commit is contained in:
parent
e8db4b39a2
commit
fd0b2b3299
@ -553,7 +553,7 @@ void TTrFa_app::log(int severity, const char* msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TTrFa_app::display_log()
|
bool TTrFa_app::show_log()
|
||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if (_log)
|
if (_log)
|
||||||
@ -610,6 +610,7 @@ bool TTrFa_app::create_table(TScanner& tff, const TString& table)
|
|||||||
break;
|
break;
|
||||||
if (xvt_slist_find_str(fields, var) == NULL)
|
if (xvt_slist_find_str(fields, var) == NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1594,7 +1595,7 @@ bool TTrFa_app::is_new_natura(const TString& natura)
|
|||||||
|
|
||||||
bool TTrFa_app::check_new_codici_fp(const TSheet_field& sheet)
|
bool TTrFa_app::check_new_codici_fp(const TSheet_field& sheet)
|
||||||
{
|
{
|
||||||
const TDate start = get_date_start_new_fatt();
|
const TDate start = fp_settings().get_date_start_new_fatt();
|
||||||
FOR_EACH_SHEET_ROW(sheet, nr, row)
|
FOR_EACH_SHEET_ROW(sheet, nr, row)
|
||||||
{
|
{
|
||||||
const TString tipodoc = row->get(cid2index(A_TIPODOCAE));
|
const TString tipodoc = row->get(cid2index(A_TIPODOCAE));
|
||||||
|
@ -133,7 +133,9 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
if(e == fe_modify)
|
if(e == fe_modify)
|
||||||
{
|
{
|
||||||
// Calcolo la natura
|
// Calcolo la natura
|
||||||
o.mask().set(A_NATURA, natura(o.get()));
|
TCodiceIVA iva(o.get());
|
||||||
|
|
||||||
|
o.mask().set(A_NATURA, iva.natura());
|
||||||
// Se esiste un imponibile calcolo l'imposta
|
// Se esiste un imponibile calcolo l'imposta
|
||||||
real imponibile = o.mask().get_real(A_IMPONIBILE), imposta = ZERO;
|
real imponibile = o.mask().get_real(A_IMPONIBILE), imposta = ZERO;
|
||||||
if(imponibile > 0)
|
if(imponibile > 0)
|
||||||
@ -515,9 +517,13 @@ bool TTrFa_mask::check_rec(TPrinter* stampa, TToken_string* rec)
|
|||||||
// Controllo aliquota, imponibile e imposta *********************************************************
|
// Controllo aliquota, imponibile e imposta *********************************************************
|
||||||
TCodiceIVA codiva(rec->get(_aliquota));
|
TCodiceIVA codiva(rec->get(_aliquota));
|
||||||
TString nat = rec->get(_natura);
|
TString nat = rec->get(_natura);
|
||||||
const TString real_nat(natura(rec->get(_aliquota)));
|
const TString real_nat(codiva.natura());
|
||||||
|
|
||||||
nat.ltrim(); // Se vuoto arriva con uno spazio
|
nat.ltrim(); // Se vuoto arriva con uno spazio
|
||||||
const real imponibile = static_cast<const char*>(rec->get(_imponibile)), imposta = static_cast<const char*>(rec->get(_importoIVA));
|
|
||||||
|
const real imponibile = rec->get_real(_imponibile);
|
||||||
|
const real imposta = rec->get_real(_importoIVA);
|
||||||
|
|
||||||
if(nat != real_nat)
|
if(nat != real_nat)
|
||||||
{
|
{
|
||||||
msgerr.cut(0) << "Natura del movimento errata, valore dichiarato: " << nat << " valore corretto: " << real_nat;
|
msgerr.cut(0) << "Natura del movimento errata, valore dichiarato: " << nat << " valore corretto: " << real_nat;
|
||||||
@ -674,9 +680,8 @@ void TTrFa_mask::load_sheet()
|
|||||||
|
|
||||||
TSheet_field& sheet = sfield(F_RIGHE);
|
TSheet_field& sheet = sfield(F_RIGHE);
|
||||||
|
|
||||||
sheet.hide(); // Nascondo lo sheet per guadagnare un 20% di velocità di caricamento, le ottimizzazioni da PRO!
|
// Nascondo lo sheet per guadagnare un 20% di velocità di caricamento, le ottimizzazioni da PRO!
|
||||||
if(!sheet.empty())
|
sheet.destroy();
|
||||||
sheet.destroy();
|
|
||||||
TAssoc_array recimposte;
|
TAssoc_array recimposte;
|
||||||
const int items = c.update_filters(tipo, codice, dal, al, get_int(F_FATTSEL));
|
const int items = c.update_filters(tipo, codice, dal, al, get_int(F_FATTSEL));
|
||||||
TString tipocf, codcf, ocfpi, nat;
|
TString tipocf, codcf, ocfpi, nat;
|
||||||
@ -722,8 +727,14 @@ void TTrFa_mask::load_sheet()
|
|||||||
row.add(get_rfso(cli.get("CODRFSO")), _ragsocrfso); // Ragione Sociale RF/SO
|
row.add(get_rfso(cli.get("CODRFSO")), _ragsocrfso); // Ragione Sociale RF/SO
|
||||||
row.add(movimento.get("NUMDOC"), _numdoc); // Numero documento
|
row.add(movimento.get("NUMDOC"), _numdoc); // Numero documento
|
||||||
row.add(movimento.get_date("DATADOC"), _datadoc); // Data documento
|
row.add(movimento.get_date("DATADOC"), _datadoc); // Data documento
|
||||||
nat.cut(0) << movimento.get("NATURA");
|
nat = movimento.get("NATURA");
|
||||||
row.add(nat.full() ? nat : natura(iva), _natura); // NATURA!
|
if (nat.blank())
|
||||||
|
{
|
||||||
|
TCodiceIVA civa(iva);
|
||||||
|
|
||||||
|
nat = civa.natura();
|
||||||
|
}
|
||||||
|
row.add(nat, _natura); // NATURA!
|
||||||
row.add(iva, _aliquota); // Codice aliquota!
|
row.add(iva, _aliquota); // Codice aliquota!
|
||||||
row.add(find_detraib(movimento.get("TIPODET")), _detraibile); // Detraibilità
|
row.add(find_detraib(movimento.get("TIPODET")), _detraibile); // Detraibilità
|
||||||
row.add(movimento.get_real("IMPONIBILE"), _imponibile); // Imponibile
|
row.add(movimento.get_real("IMPONIBILE"), _imponibile); // Imponibile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user