Patch level : 12.0 1076
Files correlati : ve0.exe ve1.exe ve5.exe ve6.exe fp0.exe li0300a.msk lv2.exe Commento : In fatturazione bolle scritto il cliente originale della fattura nel campo CFORIG quando uso il cliente FATTURARE A per poterlo recuperae nelle lettere d'intento In configurazione delle lettere d'intento c'è il parametro "Uitlizza il cliente originale nelle fatture" per attivare il meccanismo.
This commit is contained in:
parent
b2b083be6f
commit
6d4be4fadb
@ -987,7 +987,7 @@ void TDocumento::update_esenzione()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const TCodiceIVA i(cod);
|
const TCodiceIVA i(cod);
|
||||||
const bool plafond = i.get_int("S3") > 0;
|
const bool plafond = i.has_plafond();
|
||||||
|
|
||||||
if (plafond)
|
if (plafond)
|
||||||
{
|
{
|
||||||
@ -2848,11 +2848,21 @@ const real TDocumento::importo_plafond_salvato() const
|
|||||||
|
|
||||||
TLi_manager & TDocumento::plafond(bool force_reload)
|
TLi_manager & TDocumento::plafond(bool force_reload)
|
||||||
{
|
{
|
||||||
const char tipo = tipocf();
|
char tipo = tipocf();
|
||||||
const long codice = codcf();
|
long codice = codcf();
|
||||||
const TDate data = get_date(DOC_DATADOC);
|
const TDate data = get_date(DOC_DATADOC);
|
||||||
const int anno = data.year();
|
const int anno = data.year();
|
||||||
|
|
||||||
|
if (ini_get_bool(CONFIG_DITTA, "li", "CFORIGINAL"))
|
||||||
|
{
|
||||||
|
TToken_string key(get(DOC_CFORIG));
|
||||||
|
|
||||||
|
if (key.full())
|
||||||
|
{
|
||||||
|
tipo = key.get()[0];
|
||||||
|
codice = key.get_long();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (_plafond == nullptr)
|
if (_plafond == nullptr)
|
||||||
_plafond = new TLi_manager(tipo, codice, anno);
|
_plafond = new TLi_manager(tipo, codice, anno);
|
||||||
else
|
else
|
||||||
|
@ -402,12 +402,14 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
TDocumento& campione = doc_in[id];
|
TDocumento& campione = doc_in[id];
|
||||||
const char orig_t = campione.get_char(DOC_TIPOCF);
|
const char orig_t = campione.get_char(DOC_TIPOCF);
|
||||||
const long orig_cod = campione.get_long(DOC_CODCF);
|
const long orig_cod = campione.get_long(DOC_CODCF);
|
||||||
|
TToken_string cf_orig;
|
||||||
|
|
||||||
if (change_clifo())
|
if (change_clifo())
|
||||||
{
|
{
|
||||||
const char t = campione.get_char(DOC_TIPOCFFATT);
|
const char t = campione.get_char(DOC_TIPOCFFATT);
|
||||||
long codcf = campione.get_long(DOC_CODCFFATT);
|
long codcf = campione.get_long(DOC_CODCFFATT);
|
||||||
|
|
||||||
|
|
||||||
if (t > ' ')
|
if (t > ' ')
|
||||||
{
|
{
|
||||||
campione.put(DOC_TIPOCF, t);
|
campione.put(DOC_TIPOCF, t);
|
||||||
@ -425,6 +427,11 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
if (interattivo)
|
if (interattivo)
|
||||||
doc_out[0].put(DOC_CODCF, codcf);
|
doc_out[0].put(DOC_CODCF, codcf);
|
||||||
}
|
}
|
||||||
|
if (t > ' ' || codcf > 0L)
|
||||||
|
{
|
||||||
|
cf_orig = campione.get(DOC_TIPOCF);
|
||||||
|
cf_orig.add(orig_cod);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (_lista_campi.full())
|
if (_lista_campi.full())
|
||||||
{
|
{
|
||||||
@ -504,6 +511,8 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
const TString4 codnum(out.get(DOC_CODNUM));
|
const TString4 codnum(out.get(DOC_CODNUM));
|
||||||
if (cached_numerazione(codnum).num_provv())
|
if (cached_numerazione(codnum).num_provv())
|
||||||
out.put(DOC_PROVV, 'P');
|
out.put(DOC_PROVV, 'P');
|
||||||
|
if (cf_orig.full())
|
||||||
|
out.put(DOC_CFORIG, cf_orig);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -550,6 +559,10 @@ bool TFatturazione_bolle::elabora(TLista_documenti& doc_in, TLista_documenti& do
|
|||||||
new_doc->zero(DOC_SPESEUPD); // Senno' non aggiorna le spese automatiche
|
new_doc->zero(DOC_SPESEUPD); // Senno' non aggiorna le spese automatiche
|
||||||
new_doc->put(DOC_DATADOC, data_elab);
|
new_doc->put(DOC_DATADOC, data_elab);
|
||||||
new_doc->zero(DOC_IMPPAGATO); // 30 Luglio 2015 per Hardy
|
new_doc->zero(DOC_IMPPAGATO); // 30 Luglio 2015 per Hardy
|
||||||
|
if (cf_orig.full())
|
||||||
|
new_doc->put(DOC_CFORIG, cf_orig);
|
||||||
|
else
|
||||||
|
new_doc->zero(DOC_CFORIG);
|
||||||
|
|
||||||
// Aggiungilo alla lista dei documenti in uscita
|
// Aggiungilo alla lista dei documenti in uscita
|
||||||
od = doc_out.add(new_doc);
|
od = doc_out.add(new_doc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user