Patch level : 12.0 428
Files correlati : Corretta l'impostazione del flag split payment nella contabilizzazione fatture. Gestita la concorrenza nell'attribuzione del protocollo IVA sempre in contabilizzazione git-svn-id: svn://10.65.10.50/branches/R_10_00@24026 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d0696d8126
commit
53df66542c
@ -907,6 +907,8 @@ public:
|
|||||||
const TString & codesiva() const;
|
const TString & codesiva() const;
|
||||||
void get_protocolli_esenzione(TString & esenzione, TString & data_esenzione,
|
void get_protocolli_esenzione(TString & esenzione, TString & data_esenzione,
|
||||||
TString & registrazione, TString & data_registrazione) const;
|
TString & registrazione, TString & data_registrazione) const;
|
||||||
|
bool is_split_payment() const;
|
||||||
|
|
||||||
void cli2doc() { clifor().cli2doc(*this); }
|
void cli2doc() { clifor().cli2doc(*this); }
|
||||||
TDocumento ();
|
TDocumento ();
|
||||||
TDocumento (const TDocumento& d);
|
TDocumento (const TDocumento& d);
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
#include "../sv/svlib01.h"
|
#include "../sv/svlib01.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <causali.h>
|
||||||
|
|
||||||
#include "veini.h"
|
#include "veini.h"
|
||||||
#include "velib.h"
|
#include "velib.h"
|
||||||
#include "sconti.h"
|
#include "sconti.h"
|
||||||
@ -3240,3 +3242,27 @@ void TDocumento::get_protocolli_esenzione(TString& esenzione, TString& data_esen
|
|||||||
data_registrazione = c.vendite().get(CFV_NSDATAREG);
|
data_registrazione = c.vendite().get(CFV_NSDATAREG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TDocumento::is_split_payment() const
|
||||||
|
{
|
||||||
|
bool yes = get_int(DOC_ANNO) >= 2015 && clifor().get_bool(CLI_SPLITPAY) &&
|
||||||
|
(is_fattura() || is_nota_credito()) && !imposta().is_zero() && ritenute().is_zero();
|
||||||
|
if (yes)
|
||||||
|
{
|
||||||
|
const TRectype& causale = cache().get(LF_CAUSALI, tipo().causale());
|
||||||
|
const int rsi = causale.get_int(CAU_REGSPIVA);
|
||||||
|
yes = rsi != 13 && rsi != 50 && rsi != 51; // No reverse charge
|
||||||
|
if(yes && physical_rows() > 0)
|
||||||
|
{
|
||||||
|
TAssoc_array& table = ((TDocumento*)this)->tabella_iva();
|
||||||
|
|
||||||
|
for (TRiepilogo_iva * ri = (TRiepilogo_iva *) table.get(); ri != NULL && yes;
|
||||||
|
ri = (TRiepilogo_iva *) table.get())
|
||||||
|
{
|
||||||
|
TString ivaPA = cache().get("%IVA", ri->cod_iva().codice()).get("S12");
|
||||||
|
yes = ivaPA != "N6" && ivaPA != "N5";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return yes;
|
||||||
|
}
|
@ -1212,11 +1212,10 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
|||||||
{
|
{
|
||||||
if (_nump_iva) // Reperisce l'ultimo numero di protocollo dal registro IVA
|
if (_nump_iva) // Reperisce l'ultimo numero di protocollo dal registro IVA
|
||||||
{
|
{
|
||||||
static int _ult_prot = -1;
|
TRegistro reg(registro);
|
||||||
if (_ult_prot < 0)
|
|
||||||
_ult_prot = registro.protocol();
|
ult_prot = registro.protocol();
|
||||||
_ult_prot++;
|
ult_prot++;
|
||||||
ult_prot = _ult_prot;
|
|
||||||
if (ult_prot <= 0)
|
if (ult_prot <= 0)
|
||||||
{
|
{
|
||||||
_error = ultprot_error;
|
_error = ultprot_error;
|
||||||
@ -1428,6 +1427,7 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
|||||||
if (_caus->valintra())
|
if (_caus->valintra())
|
||||||
mov_rec.put(MOV_CORRVALUTA, corrval.get_num());
|
mov_rec.put(MOV_CORRVALUTA, corrval.get_num());
|
||||||
|
|
||||||
|
|
||||||
TDate dataintra = data_reg;
|
TDate dataintra = data_reg;
|
||||||
if (doc.tipo().nota_credito())
|
if (doc.tipo().nota_credito())
|
||||||
{
|
{
|
||||||
@ -1438,11 +1438,7 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
|||||||
mov_rec.put(MOV_DATACOMPI, dataintra);
|
mov_rec.put(MOV_DATACOMPI, dataintra);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
mov_rec.put(MOV_SPLITPAY, doc.is_split_payment() ? 'S': 'N'); // Imposta nelle fatture di vendita normali il flag di split payment
|
||||||
// Imposta nelle fatture di vendita normali il flag di split payment
|
|
||||||
if (mov_rec.get_char(MOV_SPLITPAY) <= ' ')
|
|
||||||
mov_rec.put(MOV_SPLITPAY, is_split_payment(mov_rec) ? 'S': 'N');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,16 +356,8 @@ void TDocumentoEsteso::set_riga_tic()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TDocumentoEsteso::is_split_payment() const
|
/*bool TDocumentoEsteso::is_split_payment() const
|
||||||
{/*
|
{
|
||||||
const long numregcg = get_long(DOC_NUMREG);
|
|
||||||
if (numregcg > 0)
|
|
||||||
{
|
|
||||||
const TRectype& mov = cache().get(LF_MOV, numregcg);
|
|
||||||
if (!mov.empty())
|
|
||||||
return ::is_split_payment(mov);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
bool yes = get_int(DOC_ANNO) >= 2015 && clifor().get_bool(CLI_SPLITPAY) &&
|
bool yes = get_int(DOC_ANNO) >= 2015 && clifor().get_bool(CLI_SPLITPAY) &&
|
||||||
(is_fattura() || is_nota_credito()) && !imposta().is_zero() && ritenute().is_zero();
|
(is_fattura() || is_nota_credito()) && !imposta().is_zero() && ritenute().is_zero();
|
||||||
if (yes)
|
if (yes)
|
||||||
@ -386,7 +378,7 @@ bool TDocumentoEsteso::is_split_payment() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return yes;
|
return yes;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
void TDocumentoEsteso::set_riga_split()
|
void TDocumentoEsteso::set_riga_split()
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
int summary_items() { return tabella_iva().items();} // ritorna il numero di righe in totale della tabellina
|
int summary_items() { return tabella_iva().items();} // ritorna il numero di righe in totale della tabellina
|
||||||
const TAssoc_array& summary() const { return _summary_table; }
|
const TAssoc_array& summary() const { return _summary_table; }
|
||||||
const TArray& summary_array() const { return _summary_array;}
|
const TArray& summary_array() const { return _summary_array;}
|
||||||
bool is_split_payment() const;
|
// bool is_split_payment() const;
|
||||||
|
|
||||||
// Funzioni per il ricalcolo delle scadenze
|
// Funzioni per il ricalcolo delle scadenze
|
||||||
void scadenze_reset(); // riposiziona sulla prima scadenza
|
void scadenze_reset(); // riposiziona sulla prima scadenza
|
||||||
|
Loading…
x
Reference in New Issue
Block a user