Patch level : 12.0
Files correlati : fp0700.cpp, fplib01.cpp Commento: "Corretto errore sull'invio integrazioni. Nei dati Riepilogo iva le righe con aliquota non venivano sommate. (Segnalazione Sicart)
This commit is contained in:
parent
cd68564f6c
commit
e499d65d9a
@ -113,6 +113,13 @@ void TPAR_mask::load_sheet(const TString& tipo_sel)
|
||||
{
|
||||
const TRectype& rec = cur.curr();
|
||||
const TString& tipodocsdi = rec.get(CAU_TIPODOCSDI);
|
||||
|
||||
if (tipodocsdi == "TD28")
|
||||
{
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
//COSA STA SUCCEDENDO QUI? PERCHE VA QUANDO VUOLE LUI?
|
||||
|
||||
if ((tipo_sel == "T" && tipodocsdi.full()) || tipodocsdi == tipo_sel)
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
#define F_DATAINI 401
|
||||
#define F_DATAEND 402
|
||||
#define F_REGSEL 403
|
||||
#define F_CAUSALI_TIPO 404
|
||||
#define F_TIPO_SDI 405
|
||||
#define F_CAUSALI_TIPO 404
|
||||
#define F_TIPO_SDI 405
|
||||
#define F_REG_FISC 406
|
||||
#define F_REGS 407
|
||||
#define F_DIAGN 408
|
||||
#define START_MASK F_DATAINI
|
||||
#define START_MASK F_DATAINI
|
||||
#define END_MASK F_DIAGN
|
||||
|
||||
//#define DLG_KEY 501
|
||||
|
@ -84,6 +84,7 @@ BEGIN
|
||||
ITEM "TD18|TD18 Integ. acq. beni intracomunitari"
|
||||
ITEM "TD19|TD19 Integ./autof. acq. beni ex art. 17"
|
||||
ITEM "TD20|TD20 Autofattura"
|
||||
ITEM "TD28|TD28 Fattura cartacea S.Marino"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 80 3
|
||||
|
@ -644,6 +644,17 @@ private:
|
||||
void reset(TPaf_record& p) const { TPaf_container::set_keys_paf(p, _hfatt, _bfatt); }
|
||||
bool save_paf();
|
||||
|
||||
// Classe per gestire le righe di riepilogo
|
||||
class TRiepilogo_agg
|
||||
{
|
||||
public:
|
||||
real imponibile;
|
||||
real imposta;
|
||||
TRiepilogo_agg() : imponibile(ZERO), imposta(ZERO) {}
|
||||
};
|
||||
|
||||
std::map<TString, TRiepilogo_agg> _riepilogo_agg;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@ -652,27 +663,16 @@ protected:
|
||||
bool check_initial(const TMovimento_contabile& mov);
|
||||
/**< Controllo di riga */
|
||||
bool check_row(const TMovimento_contabile& mov, int n_riga);
|
||||
/**< Controllo riepilogo IVA */
|
||||
|
||||
|
||||
|
||||
bool initialize(const TMovimento_contabile& Reg);
|
||||
//static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban);
|
||||
//bool get_bank(TRegumento& Reg, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
//bool get_bank_presentazione(const TRegumento& Reg, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
//bool get_bank_appoggio(const TRegumento& Reg, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
const TString& descrizione(const TMovimento_contabile& mov, int n_riga) const { return mov.cg()[n_riga].get((RMV_DESCR));}
|
||||
|
||||
|
||||
void save_log() { TReport_book b; b.add(_log); b.export_text(TFilename("fp_err.log")); }
|
||||
const TString & natura(const char* codiva) const;
|
||||
static const char* get_esigibilita_iva(const TMovimento_contabile& Reg);
|
||||
void set_IVA(TString codiva, TPaf_record& paf) const;
|
||||
void set_IVA(const TMovimento_contabile& mov, int n_row, 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_alleg(TFilename& file, long& nprogr, TPaf_record& paf);
|
||||
void set_qta_prezzo(TPaf_record& paf1800f, const TMovimento_contabile& mov, int n_row) const;
|
||||
void add_ritenuta(const TMovimento_contabile & mov, int n_row, TPaf_record& paf0700f) const;
|
||||
bool add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga);
|
||||
|
||||
const char * stato_paf() const { return _definitivo ? "P" : "D"; }
|
||||
|
@ -1726,10 +1726,12 @@ bool TDoc_fp::export_paf0100f()
|
||||
paf0100f.set("P1_CODDEST", _coddest);
|
||||
|
||||
TString80 tel;
|
||||
TString80 pec;
|
||||
|
||||
tel << get_firm().get(NDT_PTEL) << get_firm().get(NDT_TEL);
|
||||
paf0100f.set("P1_TELEFONO", tel);
|
||||
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
|
||||
pec << get_firm().get(NDT_MAIL);
|
||||
paf0100f.set("P1_MAIL", pec);
|
||||
paf0100f.set("P1_GESTIONE", stato_paf());
|
||||
paf0100f.set("P1_ERRINT", "");
|
||||
// </DatiTrassmissione>
|
||||
@ -3261,31 +3263,41 @@ bool TReg_fp::add_row_alleg(TFilename& file, long& nprogr, TPaf_record& paf)
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool TReg_fp::add_riepilogo_iva(const TMovimento_contabile & mov, int n_riga)
|
||||
{
|
||||
TPaf_record& paf2200f = _paf_container.get_paf("PAF2200F");
|
||||
reset(paf2200f);
|
||||
|
||||
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 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);
|
||||
|
||||
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[cod_aliquota];
|
||||
|
||||
|
||||
// Aliquota
|
||||
paf2200f.set("PL_ALIQUOTAIVA", aliquota);
|
||||
// Natura
|
||||
if (aliquota.is_zero())
|
||||
paf2200f.set("PL_NATURA", natura(cod_aliquota));
|
||||
paf2200f.set("PL_NATURA", natura(cod_aliquota));
|
||||
// Imponibile
|
||||
paf2200f.set("PL_IMPONIBILE", rec_iva.get(RMI_IMPONIBILE));
|
||||
paf2200f.set("PL_IMPONIBILE", (imponibile + riepilogo_agg.imponibile));
|
||||
// Imposta
|
||||
paf2200f.set("PL_IMPOSTA", rec_iva.get(RMI_IMPOSTA));
|
||||
paf2200f.set("PL_IMPOSTA", (imposta + riepilogo_agg.imposta));
|
||||
// Esigibilit IVA
|
||||
paf2200f.set("PL_ESIGIVA", eiva);
|
||||
|
||||
paf2200f.set("PL_RIFNORMATIVO", cod_iva.descrizione());
|
||||
|
||||
// Aggiorno il riepilogo IVA
|
||||
riepilogo_agg.imponibile += imponibile;
|
||||
riepilogo_agg.imposta += imposta;
|
||||
|
||||
// Inserisco
|
||||
return insert(paf2200f);
|
||||
}
|
||||
@ -3611,6 +3623,7 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
|
||||
|
||||
if (ok) ok &= insert(paf0700f);
|
||||
}
|
||||
|
||||
// Tabella di non invio XML
|
||||
TPaf_record& pafw300f = _paf_container.get_paf("PAFW300F");
|
||||
reset(pafw300f);
|
||||
|
Loading…
x
Reference in New Issue
Block a user