Patch level : 12.0 1198
Files correlati : fp0.exe fp0300a.msk Commento: invio fatture in valuta
This commit is contained in:
parent
cf06e35ae8
commit
802c39e23e
@ -169,7 +169,6 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\fp\fplib04.cpp" />
|
<ClCompile Include="..\src\fp\fplib04.cpp" />
|
||||||
<ClCompile Include="..\src\fp\fplib05.cpp" />
|
<ClCompile Include="..\src\fp\fplib05.cpp" />
|
||||||
<ClCompile Include="..\src\ve\velib01.cpp" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
<ClCompile Include="..\src\fp\fplib03.cpp">
|
<ClCompile Include="..\src\fp\fplib03.cpp">
|
||||||
<Filter>Sources</Filter>
|
<Filter>Sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\ve\velib01.cpp">
|
|
||||||
<Filter>Sources</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\src\fp\fplib04.cpp">
|
<ClCompile Include="..\src\fp\fplib04.cpp">
|
||||||
<Filter>Sources</Filter>
|
<Filter>Sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
#define F_PROVVISORIO 408
|
#define F_PROVVISORIO 408
|
||||||
#define END_MASK 499
|
#define END_MASK 499
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define F_DOCUMENTI_TIPO 301
|
#define F_DOCUMENTI_TIPO 301
|
||||||
|
|
||||||
#define S_SELCODNUM 101
|
#define S_SELCODNUM 101
|
||||||
|
@ -83,7 +83,7 @@ BEGIN
|
|||||||
ITEM "Tipo SDI"
|
ITEM "Tipo SDI"
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 5
|
GROUPBOX DLG_NULL 85 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 12 "@BConfigurazione Esportazione"
|
PROMPT 1 12 "@BConfigurazione Esportazione"
|
||||||
END
|
END
|
||||||
@ -115,7 +115,7 @@ END
|
|||||||
|
|
||||||
BOOLEAN F_PROVVISORIO
|
BOOLEAN F_PROVVISORIO
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 17 "Provvisorio"
|
PROMPT 1 16 "Provvisorio"
|
||||||
FLAG "H"
|
FLAG "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -494,6 +494,8 @@ private:
|
|||||||
TFP_nota_piede_f _riga_npf;
|
TFP_nota_piede_f _riga_npf;
|
||||||
bool _has_cust;
|
bool _has_cust;
|
||||||
bool _tracciati_2021;
|
bool _tracciati_2021;
|
||||||
|
bool _in_valuta;
|
||||||
|
|
||||||
// Classe interna per gestire righe aggiuntive in riepilogo
|
// Classe interna per gestire righe aggiuntive in riepilogo
|
||||||
class TRiepilogo_agg
|
class TRiepilogo_agg
|
||||||
{
|
{
|
||||||
@ -505,14 +507,6 @@ private:
|
|||||||
|
|
||||||
std::map<TString, TRiepilogo_agg> _riepilogo_agg;
|
std::map<TString, TRiepilogo_agg> _riepilogo_agg;
|
||||||
|
|
||||||
/*
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool _is_valuta_estera{ false }; // Se il documento in valuta estera
|
|
||||||
TString4 _cod_val;
|
|
||||||
real _cambio;
|
|
||||||
} _doc_cambio;
|
|
||||||
*/
|
|
||||||
//int parse_line(const TString& line, TString& var, TString& val) const;
|
//int parse_line(const TString& line, TString& var, TString& val) const;
|
||||||
//bool create_table(TScanner& paf, const TString& table);
|
//bool create_table(TScanner& paf, const TString& table);
|
||||||
|
|
||||||
@ -553,7 +547,7 @@ protected:
|
|||||||
void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const;
|
void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const;
|
||||||
bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
|
bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
|
||||||
bool add_row_alleg(TFilename& file, long& nprogr, TPaf_record& paf);
|
bool add_row_alleg(TFilename& file, long& nprogr, TPaf_record& paf);
|
||||||
const TString& converti_prezzo(const real& prezzo) const;
|
const TString& value2string(const real& prezzo) const;
|
||||||
void set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) const;
|
void set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) const;
|
||||||
void add_ritenuta(const TRiga_documento & rdoc, TPaf_record& paf0700f) const;
|
void add_ritenuta(const TRiga_documento & rdoc, TPaf_record& paf0700f) const;
|
||||||
bool add_riepilogo_iva(TPaf_record& paf2200f, const TCodiceIVA& cod_iva, const char* eiva, const real& imponibile = ZERO, const real& imposta = ZERO);
|
bool add_riepilogo_iva(TPaf_record& paf2200f, const TCodiceIVA& cod_iva, const char* eiva, const real& imponibile = ZERO, const real& imposta = ZERO);
|
||||||
|
@ -409,7 +409,8 @@ TString& add_filter(const TString& field, const TString& from, const TString& to
|
|||||||
// Imposta il valore di un campo variant
|
// Imposta il valore di un campo variant
|
||||||
void TPaf_record::set(const char* fld, const TVariant& var)
|
void TPaf_record::set(const char* fld, const TVariant& var)
|
||||||
{
|
{
|
||||||
CHECK(fld && *fld, "Null field name");
|
if (fld && *fld)
|
||||||
|
{
|
||||||
if (var.is_null())
|
if (var.is_null())
|
||||||
{
|
{
|
||||||
_fields.remove(fld);
|
_fields.remove(fld);
|
||||||
@ -422,6 +423,7 @@ void TPaf_record::set(const char* fld, const TVariant& var)
|
|||||||
else
|
else
|
||||||
_fields.add(fld, new TVariant(var));
|
_fields.add(fld, new TVariant(var));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Imposta il valore di un campo intero
|
// Imposta il valore di un campo intero
|
||||||
@ -571,7 +573,7 @@ bool TPaf_record::remove()
|
|||||||
|
|
||||||
bool TPaf_record::search()
|
bool TPaf_record::search()
|
||||||
{
|
{
|
||||||
CHECKS(_fields.items() > 0, "Can't search with empty key on table ", static_cast<const char*>(_table));
|
//CHECKS(_fields.items() > 0, "Can't search with empty key on table ", static_cast<const char*>(_table));
|
||||||
|
|
||||||
TString256 query;
|
TString256 query;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
@ -659,7 +661,7 @@ TString & TPaf_record::update_string()
|
|||||||
|
|
||||||
TString & TPaf_record::filter_string()
|
TString & TPaf_record::filter_string()
|
||||||
{
|
{
|
||||||
CHECKS(_fields.items() > 0, "Can't search with empty key on table ", static_cast<const char*>(_table));
|
//CHECKS(_fields.items() > 0, "Can't search with empty key on table ", static_cast<const char*>(_table));
|
||||||
|
|
||||||
TString & filter = get_tmp_string();
|
TString & filter = get_tmp_string();
|
||||||
bool first = true;
|
bool first = true;
|
||||||
@ -687,6 +689,11 @@ bool TPaf_record::insert(bool force)
|
|||||||
return fp_db().sq_set_exec(insert_string(), false);
|
return fp_db().sq_set_exec(insert_string(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPaf_record::force_insert()
|
||||||
|
{
|
||||||
|
return fp_db().sq_set_exec(insert_string(), false);
|
||||||
|
}
|
||||||
|
|
||||||
// Aggiunge un record al db
|
// Aggiunge un record al db
|
||||||
bool TPaf_record::update()
|
bool TPaf_record::update()
|
||||||
{
|
{
|
||||||
@ -754,7 +761,7 @@ TPaf_record::TPaf_record(const char* table) : _table(table), _key(15, ',')
|
|||||||
_key.add("PO_RIGA");
|
_key.add("PO_RIGA");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CHECKS(!_key.empty_items(), "Invalid primary key for table ", table);
|
// CHECKS(!_key.empty_items(), "Invalid primary key for table ", table);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
@ -1289,9 +1296,6 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
|||||||
// Preparo il record del cliente
|
// Preparo il record del cliente
|
||||||
_rec_clifo = doc.clifor();
|
_rec_clifo = doc.clifor();
|
||||||
// Valorizzo la gestione del cambio
|
// Valorizzo la gestione del cambio
|
||||||
//_doc_cambio._cod_val = doc.valuta();
|
|
||||||
//_doc_cambio._is_valuta_estera = doc.valuta().full() && !is_euro_value(doc.valuta());
|
|
||||||
//_doc_cambio._cambio = doc.cambio();
|
|
||||||
// Paese del documento
|
// Paese del documento
|
||||||
_paese = "IT";
|
_paese = "IT";
|
||||||
_has_bolla = false;
|
_has_bolla = false;
|
||||||
@ -1487,21 +1491,18 @@ bool TDoc_fp::add_row_alleg(TFilename& file, long& nprogr, TPaf_record& paf)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TString& TDoc_fp::converti_prezzo(const real& prezzo) const
|
const TString& TDoc_fp::value2string(const real& prezzo) const
|
||||||
{
|
{
|
||||||
TString& ret = get_tmp_string();
|
real val = prezzo;
|
||||||
ret.cut(0);
|
|
||||||
|
|
||||||
|
|
||||||
if (_doc->in_valuta())
|
if (_doc->in_valuta())
|
||||||
{
|
{
|
||||||
TCurrency_documento app(prezzo, *_doc, true);
|
TCurrency_documento app(prezzo, *_doc, true);
|
||||||
|
|
||||||
app.change_to_euro_val();
|
app.change_to_euro_val();
|
||||||
ret << app.get_num().string(0);
|
val = app.get_num();
|
||||||
}
|
}
|
||||||
else
|
return get_tmp_string() = val.string(0);
|
||||||
ret << prezzo;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) const
|
void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) const
|
||||||
@ -1523,8 +1524,9 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) con
|
|||||||
}
|
}
|
||||||
// Salvo tutto
|
// Salvo tutto
|
||||||
paf1800f.set("PI_QUANTITA", qta_string);
|
paf1800f.set("PI_QUANTITA", qta_string);
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(prezzo_unit));
|
|
||||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(prezzo_tot));
|
paf1800f.set("PI_PREZZOUNIT", value2string(prezzo_unit)); // prezzo , true));
|
||||||
|
paf1800f.set("PI_PRZTOTALE", value2string(prezzo_tot)); // valore , false));
|
||||||
}
|
}
|
||||||
|
|
||||||
const real calc_ritenuta(const TDocumento& doc)
|
const real calc_ritenuta(const TDocumento& doc)
|
||||||
@ -1560,7 +1562,8 @@ void TDoc_fp::add_ritenuta(const TRiga_documento & rdoc, TPaf_record& paf0700f)
|
|||||||
if (tipo_rit.empty())
|
if (tipo_rit.empty())
|
||||||
tipo_rit = _rec_clifo.get_char(CLI_TIPOPERS) == 'F' ? "RT01" : "RT02";
|
tipo_rit = _rec_clifo.get_char(CLI_TIPOPERS) == 'F' ? "RT01" : "RT02";
|
||||||
paf0700f.set("P7_TIPORITENUTA", tipo_rit);
|
paf0700f.set("P7_TIPORITENUTA", tipo_rit);
|
||||||
paf0700f.set("P7_IMPORTORIT", converti_prezzo(importo_ritenuta));
|
|
||||||
|
paf0700f.set("P7_IMPORTORIT", value2string(importo_ritenuta)); // valore, false));
|
||||||
paf0700f.set("P7_ALIQUOTARIT", sp.perc());
|
paf0700f.set("P7_ALIQUOTARIT", sp.perc());
|
||||||
static TString caus_la; caus_la.cut(0);
|
static TString caus_la; caus_la.cut(0);
|
||||||
caus_la << sp.get("S14")[0];
|
caus_la << sp.get("S14")[0];
|
||||||
@ -1585,9 +1588,11 @@ bool TDoc_fp::add_riepilogo_iva(TPaf_record& paf2200f, const TCodiceIVA& cod_iva
|
|||||||
if (aliquota.is_zero())
|
if (aliquota.is_zero())
|
||||||
paf2200f.set("PL_NATURA", natura(cod_aliquota));
|
paf2200f.set("PL_NATURA", natura(cod_aliquota));
|
||||||
// Imponibile
|
// Imponibile
|
||||||
paf2200f.set("PL_IMPONIBILE", converti_prezzo(imponibile + riepilogo_agg.imponibile));
|
|
||||||
|
paf2200f.set("PL_IMPONIBILE", value2string(imponibile + riepilogo_agg.imponibile)); // valore , false));
|
||||||
// Imposta
|
// Imposta
|
||||||
paf2200f.set("PL_IMPOSTA", converti_prezzo(imposta + riepilogo_agg.imposta));
|
|
||||||
|
paf2200f.set("PL_IMPOSTA", value2string(imposta + riepilogo_agg.imposta)); // valore, false));
|
||||||
// Esigibilit IVA
|
// Esigibilit IVA
|
||||||
paf2200f.set("PL_ESIGIVA", eiva);
|
paf2200f.set("PL_ESIGIVA", eiva);
|
||||||
if (*eiva == 'S')
|
if (*eiva == 'S')
|
||||||
@ -1615,9 +1620,11 @@ bool TDoc_fp::add_cassa_previdenziale(TRiga_documento& rdoc)
|
|||||||
// Aliquota della cassa
|
// Aliquota della cassa
|
||||||
paf0800f.set("P8_ALIQCASSA", sp.perc());
|
paf0800f.set("P8_ALIQCASSA", sp.perc());
|
||||||
// Importo contributo cassa
|
// Importo contributo cassa
|
||||||
paf0800f.set("P8_IMCONTRCASSA", converti_prezzo(importo_cassa));
|
|
||||||
|
paf0800f.set("P8_IMCONTRCASSA", value2string(importo_cassa)); // valore, false));
|
||||||
// Imponibile cassa
|
// Imponibile cassa
|
||||||
paf0800f.set("P8_IMPONCASSA", converti_prezzo(imponibile_doc));
|
|
||||||
|
paf0800f.set("P8_IMPONCASSA", value2string(imponibile_doc)); // valore, false));
|
||||||
// Aliquota applicata alla riga spesa
|
// Aliquota applicata alla riga spesa
|
||||||
paf0800f.set("P8_ALIQIVA", rdoc.iva().percentuale());
|
paf0800f.set("P8_ALIQIVA", rdoc.iva().percentuale());
|
||||||
if (sp.sogg_a_rit())
|
if (sp.sogg_a_rit())
|
||||||
@ -1727,12 +1734,10 @@ bool TDoc_fp::export_paf0100f()
|
|||||||
paf0100f.set("P1_CODDEST", _coddest);
|
paf0100f.set("P1_CODDEST", _coddest);
|
||||||
|
|
||||||
TString80 tel;
|
TString80 tel;
|
||||||
TString80 pec;
|
|
||||||
|
|
||||||
tel << get_firm().get(NDT_PTEL) << get_firm().get(NDT_TEL);
|
tel << get_firm().get(NDT_PTEL) << get_firm().get(NDT_TEL);
|
||||||
paf0100f.set("P1_TELEFONO", tel);
|
paf0100f.set("P1_TELEFONO", tel);
|
||||||
pec << get_firm().get(NDT_MAIL);
|
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
|
||||||
paf0100f.set("P1_MAIL", pec);
|
|
||||||
paf0100f.set("P1_GESTIONE", stato_paf());
|
paf0100f.set("P1_GESTIONE", stato_paf());
|
||||||
paf0100f.set("P1_ERRINT", "");
|
paf0100f.set("P1_ERRINT", "");
|
||||||
// </DatiTrassmissione>
|
// </DatiTrassmissione>
|
||||||
@ -1952,8 +1957,13 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
ok &= insert(paf0400f);
|
ok &= insert(paf0400f);
|
||||||
// </CessionarioCommittente>
|
// </CessionarioCommittente>
|
||||||
// <DatiGenerali>
|
// <DatiGenerali>
|
||||||
|
|
||||||
TPaf_record& paf0700f = _paf_container.get_paf("PAF0700F");
|
TPaf_record& paf0700f = _paf_container.get_paf("PAF0700F");
|
||||||
|
|
||||||
paf0700f.set("P7_TIPODOC", tipo_doc_sdi(doc));
|
paf0700f.set("P7_TIPODOC", tipo_doc_sdi(doc));
|
||||||
|
if (doc.in_valuta())
|
||||||
|
paf0700f.set("P7_DIVISA", doc.get(DOC_CODVAL));
|
||||||
|
else
|
||||||
paf0700f.set("P7_DIVISA", "EUR"); // Fisso su euro in quanto effettuiamo il cambio
|
paf0700f.set("P7_DIVISA", "EUR"); // Fisso su euro in quanto effettuiamo il cambio
|
||||||
|
|
||||||
TDate data = doc.data();
|
TDate data = doc.data();
|
||||||
@ -1967,7 +1977,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
const real bolli_es = ini_get_real(CONFIG_STUDIO, "ve", "BOLLIES");
|
const real bolli_es = ini_get_real(CONFIG_STUDIO, "ve", "BOLLIES");
|
||||||
|
|
||||||
paf0700f.set("P7_NUMEROBOLLO", "SI");
|
paf0700f.set("P7_NUMEROBOLLO", "SI");
|
||||||
paf0700f.set("P7_IMPORTOBOLLO", converti_prezzo(bolli_es));
|
|
||||||
|
paf0700f.set("P7_IMPORTOBOLLO", value2string(bolli_es)); // valore, false));
|
||||||
}
|
}
|
||||||
// </DatiBollo>
|
// </DatiBollo>
|
||||||
// <DatiCassaPrevidenziale>
|
// <DatiCassaPrevidenziale>
|
||||||
@ -2354,8 +2365,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
paf1800f.set("PI_QUANTITA", qta);
|
paf1800f.set("PI_QUANTITA", qta);
|
||||||
}
|
}
|
||||||
|
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(prz));
|
|
||||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(imp));
|
paf1800f.set("PI_PREZZOUNIT", value2string(prz)); // prezzo, true));
|
||||||
|
paf1800f.set("PI_PRZTOTALE", value2string(imp)); // valore, false));
|
||||||
set_IVA(*rdoc, paf1800f);
|
set_IVA(*rdoc, paf1800f);
|
||||||
// Controllo se una ritenuta fiscale
|
// Controllo se una ritenuta fiscale
|
||||||
if (sp.tipo_ritenuta() == 'F')
|
if (sp.tipo_ritenuta() == 'F')
|
||||||
@ -2403,8 +2415,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
// Metto i dati come si trattasse di una riga normalissima
|
// Metto i dati come si trattasse di una riga normalissima
|
||||||
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
||||||
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0));
|
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0));
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(rdoc->prezzo(false, false)));
|
|
||||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(rdoc->prezzo(false, false) * rdoc->get_real(RDOC_QTA)));
|
paf1800f.set("PI_PREZZOUNIT", value2string(rdoc->prezzo(false, false))); // prezzo, true));
|
||||||
|
paf1800f.set("PI_PRZTOTALE", value2string(rdoc->prezzo(false, false) * rdoc->get_real(RDOC_QTA))); // valore , false));
|
||||||
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[rdoc->iva().codice()];
|
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[rdoc->iva().codice()];
|
||||||
riepilogo_agg.imponibile += rdoc->imponibile_omaggio(2);
|
riepilogo_agg.imponibile += rdoc->imponibile_omaggio(2);
|
||||||
paf1800f.set("PI_GESTIONE", stato_paf());
|
paf1800f.set("PI_GESTIONE", stato_paf());
|
||||||
@ -2417,9 +2430,11 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
set_qta_prezzo(paf1800f, rdoc);
|
set_qta_prezzo(paf1800f, rdoc);
|
||||||
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
||||||
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0));
|
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0));
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(-rdoc->prezzo(false, false)));
|
|
||||||
|
|
||||||
const real imponibile = converti_prezzo(-rdoc->prezzo(false, false) * rdoc->get_real(RDOC_QTA));
|
paf1800f.set("PI_PREZZOUNIT", value2string(-rdoc->prezzo(false, false))); // prezzo , true));
|
||||||
|
|
||||||
|
|
||||||
|
const real imponibile = value2string(-rdoc->prezzo(false, false) * rdoc->get_real(RDOC_QTA)); // valore , false);
|
||||||
|
|
||||||
paf1800f.set("PI_PRZTOTALE", imponibile);
|
paf1800f.set("PI_PRZTOTALE", imponibile);
|
||||||
|
|
||||||
@ -2620,8 +2635,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||||
paf3000f.set("PT_COMMENTO", "Imposta di bollo assolta virtualmente ai sensi dell'art. 6 D.M. 17.6.2014");
|
paf3000f.set("PT_COMMENTO", "Imposta di bollo assolta virtualmente ai sensi dell'art. 6 D.M. 17.6.2014");
|
||||||
paf1800f.set("PI_QUANTITA", UNO);
|
paf1800f.set("PI_QUANTITA", UNO);
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(importo_bolli));
|
|
||||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(importo_bolli));
|
paf1800f.set("PI_PREZZOUNIT", value2string(importo_bolli)); // valore, false));
|
||||||
|
paf1800f.set("PI_PRZTOTALE", value2string(importo_bolli)); // valore, false));
|
||||||
set_IVA(doc.codiva_bolli(), paf1800f);
|
set_IVA(doc.codiva_bolli(), paf1800f);
|
||||||
ok &= insert(paf1800f) && insert(paf3000f);
|
ok &= insert(paf1800f) && insert(paf3000f);
|
||||||
riga++;
|
riga++;
|
||||||
@ -2638,8 +2654,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
paf3000f.set("PT_COMMENTO", "Spese incasso");
|
paf3000f.set("PT_COMMENTO", "Spese incasso");
|
||||||
paf1800f.set("PI_QUANTITA", UNO);
|
paf1800f.set("PI_QUANTITA", UNO);
|
||||||
real imponibile = doc.imponibile();
|
real imponibile = doc.imponibile();
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto)));
|
|
||||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto)));
|
paf1800f.set("PI_PREZZOUNIT", value2string(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto))); // prezzo, true));
|
||||||
|
paf1800f.set("PI_PRZTOTALE", value2string(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto))); // valore, false));
|
||||||
|
|
||||||
set_IVA(ini_get_string(CONFIG_DITTA, "ve", "SPINCODIVA"), paf1800f);
|
set_IVA(ini_get_string(CONFIG_DITTA, "ve", "SPINCODIVA"), paf1800f);
|
||||||
ok &= insert(paf1800f) && insert(paf3000f);
|
ok &= insert(paf1800f) && insert(paf3000f);
|
||||||
@ -2824,9 +2841,11 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
||||||
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
|
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
|
||||||
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
|
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
|
||||||
paf2500f.set("PO_DATASCADENZA", TDate(riga_scadenze.get(0))); // Data scadenza
|
|
||||||
|
|
||||||
paf2500f.set("PO_IMPORTO", converti_prezzo(real(riga_scadenze.get()))); // Importo rata
|
paf2500f.set("PO_DATASCADENZA", riga_scadenze.get_date(0)); // Data scadenza
|
||||||
|
|
||||||
|
|
||||||
|
paf2500f.set("PO_IMPORTO", value2string(riga_scadenze.get_real())); // valore, false)); // Importo rata
|
||||||
paf2500f.set("PO_GESTIONE", stato_paf());
|
paf2500f.set("PO_GESTIONE", stato_paf());
|
||||||
ok &= insert(paf2500f);
|
ok &= insert(paf2500f);
|
||||||
}
|
}
|
||||||
@ -2928,7 +2947,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
pafw300f.set("PW_RAGSOC", cliente.ragione_sociale().left(35));
|
pafw300f.set("PW_RAGSOC", cliente.ragione_sociale().left(35));
|
||||||
pafw300f.set("PW_IMPO", converti_prezzo(doc.totale_doc()));
|
|
||||||
|
pafw300f.set("PW_IMPO", value2string(doc.totale_doc())); // valore, false));
|
||||||
pafw300f.set("PW_UPAG", "");
|
pafw300f.set("PW_UPAG", "");
|
||||||
ok &= insert(pafw300f);
|
ok &= insert(pafw300f);
|
||||||
return _to_commit = (ok && save_paf());
|
return _to_commit = (ok && save_paf());
|
||||||
@ -3281,7 +3301,6 @@ bool TReg_fp::add_row_alleg(TFilename& file, long& nprogr, TPaf_record& paf)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TReg_fp::add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga)
|
bool TReg_fp::add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga)
|
||||||
{
|
{
|
||||||
TPaf_record& paf2200f = _paf_container.get_paf("PAF2200F");
|
TPaf_record& paf2200f = _paf_container.get_paf("PAF2200F");
|
||||||
@ -3290,32 +3309,25 @@ bool TReg_fp::add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga)
|
|||||||
const TRectype& rec_iva = mov.iva()[n_riga];
|
const TRectype& rec_iva = mov.iva()[n_riga];
|
||||||
const TString16 cod_aliquota = rec_iva.get(RMI_CODIVA);
|
const TString16 cod_aliquota = rec_iva.get(RMI_CODIVA);
|
||||||
const TCodiceIVA& cod_iva= cached_codIVA(cod_aliquota);
|
const TCodiceIVA& cod_iva= cached_codIVA(cod_aliquota);
|
||||||
|
|
||||||
const real aliquota = cod_iva.percentuale();
|
const real aliquota = cod_iva.percentuale();
|
||||||
const real imponibile = rec_iva.get(RMI_IMPONIBILE);
|
|
||||||
const real imposta = rec_iva.get(RMI_IMPOSTA);
|
|
||||||
const char * eiva = get_esigibilita_iva(mov);
|
const char * eiva = get_esigibilita_iva(mov);
|
||||||
|
|
||||||
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[cod_aliquota];
|
|
||||||
|
|
||||||
|
|
||||||
// Aliquota
|
// Aliquota
|
||||||
paf2200f.set("PL_ALIQUOTAIVA", aliquota);
|
paf2200f.set("PL_ALIQUOTAIVA", aliquota);
|
||||||
// Natura
|
// Natura
|
||||||
if (aliquota.is_zero())
|
if (aliquota.is_zero())
|
||||||
paf2200f.set("PL_NATURA", natura(cod_aliquota));
|
paf2200f.set("PL_NATURA", natura(cod_aliquota));
|
||||||
// Imponibile
|
// Imponibile
|
||||||
paf2200f.set("PL_IMPONIBILE", (imponibile + riepilogo_agg.imponibile));
|
paf2200f.set("PL_IMPONIBILE", rec_iva.get(RMI_IMPONIBILE));
|
||||||
// Imposta
|
// Imposta
|
||||||
paf2200f.set("PL_IMPOSTA", (imposta + riepilogo_agg.imposta));
|
paf2200f.set("PL_IMPOSTA", rec_iva.get(RMI_IMPOSTA));
|
||||||
// Esigibilit IVA
|
// Esigibilit IVA
|
||||||
|
|
||||||
paf2200f.set("PL_ESIGIVA", eiva);
|
paf2200f.set("PL_ESIGIVA", eiva);
|
||||||
|
|
||||||
paf2200f.set("PL_RIFNORMATIVO", cod_iva.descrizione());
|
paf2200f.set("PL_RIFNORMATIVO", cod_iva.descrizione());
|
||||||
|
|
||||||
// Aggiorno il riepilogo IVA
|
|
||||||
riepilogo_agg.imponibile += imponibile;
|
|
||||||
riepilogo_agg.imposta += imposta;
|
|
||||||
|
|
||||||
// Elimino l'oggetto
|
// Elimino l'oggetto
|
||||||
_riepilogo_agg.erase(cod_aliquota);
|
_riepilogo_agg.erase(cod_aliquota);
|
||||||
|
|
||||||
@ -3441,17 +3453,20 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
|
|||||||
TString forn_n = fornitore.nome();
|
TString forn_n = fornitore.nome();
|
||||||
TString forn_c = fornitore.cognome();
|
TString forn_c = fornitore.cognome();
|
||||||
|
|
||||||
|
|
||||||
paf0200f.set("P2_ANANOME", fornitore.nome());
|
paf0200f.set("P2_ANANOME", fornitore.nome());
|
||||||
paf0200f.set("P2_ANACOGNOME", fornitore.cognome());
|
paf0200f.set("P2_ANACOGNOME", fornitore.cognome());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
paf0200f.set("P2_ANADENOMIN", fornitore.ragione_sociale());
|
paf0200f.set("P2_ANADENOMIN", fornitore.ragione_sociale());
|
||||||
}
|
}
|
||||||
|
|
||||||
paf0200f.set("P2_ANACODEORI", fornitore.cod_EORI());
|
paf0200f.set("P2_ANACODEORI", fornitore.cod_EORI());
|
||||||
paf0200f.set("P2_REGFISCALE", _regfisc); //TODO DA RF01 A RF09
|
paf0200f.set("P2_REGFISCALE", _regfisc); //TODO DA RF01 A RF09
|
||||||
// DatiSede
|
// DatiSede
|
||||||
|
|
||||||
paf0200f.set("P2_SEDEIND", fornitore.via_residenza());
|
paf0200f.set("P2_SEDEIND", fornitore.via_residenza());
|
||||||
paf0200f.set("P2_SEDENRCIVICO", fornitore.civico_residenza().left(8));
|
paf0200f.set("P2_SEDENRCIVICO", fornitore.civico_residenza().left(8));
|
||||||
paf0200f.set("P2_SEDECOMUNE", fornitore.comune_residenza());
|
paf0200f.set("P2_SEDECOMUNE", fornitore.comune_residenza());
|
||||||
@ -3460,11 +3475,10 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
|
|||||||
// I clienti esteri possono avere CAP alfanumerici, li tolgo
|
// I clienti esteri possono avere CAP alfanumerici, li tolgo
|
||||||
if (fornitore.stato_residenza_ISO() != "IT")
|
if (fornitore.stato_residenza_ISO() != "IT")
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
//paf0200f.set("P2_SEDECAP", "0000");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
paf0200f.set("P2_SEDECAP", fornitore.CAP_residenza());
|
paf0200f.set("P2_SEDECAP", fornitore.CAP_residenza());
|
||||||
paf0200f.set("P2_SEDEPROV", fornitore.provincia_residenza());
|
paf0200f.set("P2_SEDEPROV", fornitore.provincia_residenza());
|
||||||
}
|
}
|
||||||
@ -3500,10 +3514,12 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
|
|||||||
|
|
||||||
if (piva.full())
|
if (piva.full())
|
||||||
{
|
{
|
||||||
|
|
||||||
paf0400f.set("P4_FISCIVAPAESE", stato);
|
paf0400f.set("P4_FISCIVAPAESE", stato);
|
||||||
paf0400f.set("P4_FISCIVACOD", piva);
|
paf0400f.set("P4_FISCIVACOD", piva);
|
||||||
}
|
}
|
||||||
if (fisc.full())
|
if (fisc.full())
|
||||||
|
|
||||||
paf0400f.set("P4_CODFISC", fisc);
|
paf0400f.set("P4_CODFISC", fisc);
|
||||||
}
|
}
|
||||||
else // Cliente EXTRA-EU sempre nel campo della partita iva sui paf
|
else // Cliente EXTRA-EU sempre nel campo della partita iva sui paf
|
||||||
@ -3517,11 +3533,13 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
|
|||||||
|
|
||||||
if (_ditta.fisica() && _ditta.nome().full())
|
if (_ditta.fisica() && _ditta.nome().full())
|
||||||
{
|
{
|
||||||
|
|
||||||
paf0400f.set("P4_ANANOME", _ditta.nome());
|
paf0400f.set("P4_ANANOME", _ditta.nome());
|
||||||
paf0400f.set("P4_ANACOGNOME", _ditta.cognome());
|
paf0400f.set("P4_ANACOGNOME", _ditta.cognome());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
paf0400f.set("P4_ANADENOM", _ditta.ragione_sociale());
|
paf0400f.set("P4_ANADENOM", _ditta.ragione_sociale());
|
||||||
}
|
}
|
||||||
// DatiSede
|
// DatiSede
|
||||||
@ -3665,7 +3683,6 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
|
|||||||
|
|
||||||
if (ok) ok &= insert(paf0700f);
|
if (ok) ok &= insert(paf0700f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tabella di non invio XML
|
// Tabella di non invio XML
|
||||||
TPaf_record& pafw300f = _paf_container.get_paf("PAFW300F");
|
TPaf_record& pafw300f = _paf_container.get_paf("PAFW300F");
|
||||||
reset(pafw300f);
|
reset(pafw300f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user