Patch level : 12.0 900

Files correlati     : ve0.exe ve6.exe
Commento            :

Contollata la sottocategoria e il codice spesa coani in fatturazione bolle
This commit is contained in:
Alessandro Bonazzi 2019-11-15 16:59:50 +01:00
parent 192867cff1
commit 3cde95efb6
3 changed files with 59 additions and 53 deletions

View File

@ -563,6 +563,7 @@ class TConai : public TObject
TAssoc_array _conais;
public:
bool exist_sottocat(const TString& sottocat) { return _conais.objptr(sottocat); }
const TSpesa_prest& get_spesa(const TString& sottocat) { return (const TSpesa_prest &)_conais[sottocat]; }
const bool find(const TString& cod_spesa) { return _conais.objptr(cod_spesa) != NULL; }
int get_lista_cod_spesa(TString_array & keys) { return _conais.get_keys(keys); }

View File

@ -182,8 +182,7 @@ TSpesa_prest::TSpesa_prest(const char* codice, char tipo)
if (codice && *codice)
{
const int err = read(codice);
/*
#ifdef DBG
if (err != NOERR)
switch (tipo)
{
@ -203,8 +202,6 @@ TSpesa_prest::TSpesa_prest(const char* codice, char tipo)
error_box("Spesa %s assente", codice);
break;
}
#endif
*/
}
}

View File

@ -3125,12 +3125,14 @@ void TDocumento::update_conai()
FOR_EACH_ASSOC_OBJECT(_conaiqta, o, key, item)
{
const TString cod_sottocat = key;
const TString8 cod_sottocat = key;
// Se l'ho già fatto skippo
if (conai_aggiornati.objptr(cod_sottocat) != NULL)
continue;
if (conai.exist_sottocat(cod_sottocat))
{
TSpesa_prest sp = conai.get_spesa(cod_sottocat);
// Aggiungo la spesa
@ -3146,7 +3148,10 @@ void TDocumento::update_conai()
if (qta > ZERO)
{
const TString4 tipo = sp.tipo_riga();
TString4 tipo = sp.tipo_riga();
if (tipo.blank())
tipo = "03";
TRiga_documento& riga = new_row(tipo);
riga.put(RDOC_CODART, sp.codice());
@ -3175,6 +3180,9 @@ void TDocumento::update_conai()
riga.put(RDOC_CODIVA, cod_iva_cli);
}
}
else
error_box("Sottocategoria CONAI %s assente", (const char *) cod_sottocat);
}
}
}
}