Patch level : 12.0 976

Files correlati     : ve0.exe
Commento            :

- Se  cancello tutte le righe merce o omaggio da un documento con CONAI la riga di addebito viene trafornata in una riga normale per gestire le rettifiche CONAI com copia documento
This commit is contained in:
Alessandro Bonazzi 2020-07-10 12:15:48 +02:00
parent 13ee345b49
commit fd38f41625

View File

@ -3073,15 +3073,18 @@ void TDocumento::update_conai()
const TDate dataees = cfven.get(CFV_DATAECONAI);
const bool esponi_esenti = ini_get_bool(CONFIG_DITTA, "ve", "ESPONIESENTI");
real perc_esenz;
const int rows = physical_rows();
bool to_delete = false;
// Come prima cosa mi calcolo le qta conai
update_conai_qta();
for (int i = physical_rows(); i > 0; i--)
for (int i = 1; i <= rows; i++)
{
TRiga_documento& r = row(i);
const bool tipo_conai = r.get_char("GENTIPO") == 'C';
to_delete |= (!tipo_conai) && (r.is_merce() || r.is_omaggio());
// Elimina righe generate
if (tipo_conai)
{
@ -3112,9 +3115,15 @@ void TDocumento::update_conai()
destroy_row(i, true);
}
else
destroy_row(i, true);
if (to_delete)
destroy_row(i, true);
conai_aggiornati.add(sottocat, sottocat);
}
if (!to_delete)
{
r.zero(RDOC_GENERATA);
r.zero(RDOC_GENTIPO);
}
}
}