Patch level : 2.0 546

Files correlati     : cg2.exe
Ricompilazione Demo : [ ]
Commento            :

Corretta importazione da file .ini righe di prima nota:
ignorava le righe con lo stesso conto delle precedenti


git-svn-id: svn://10.65.10.50/trunk@11362 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-08-01 07:55:21 +00:00
parent a3859b2053
commit 476f1a9b26
3 changed files with 32 additions and 13 deletions

View File

@ -1532,17 +1532,27 @@ void TPrimanota_application::ini2mask(TConfig& ini, TMask& msk, bool query)
TClinton conto; ini2clinton(ini, conto); TClinton conto; ini2clinton(ini, conto);
int numrig = -1; // Normalmente aggiungi la riga in fondo int numrig = ini.get_int(RMV_NUMRIG)-1;
if (numrig != i) // Controllo se ho un numero riga valido
{
numrig = -1; // Normalmente aggiungi la riga in fondo
// Cerca una riga che abbia gia' il tipo ed il conto richiesto // Cerca una riga che abbia gia' il tipo ed il conto richiesto
if (strchr(" DINT", tipo) != NULL) if (strchr(" DINT", tipo) != NULL)
{ {
int nr = -1;
if (tipo == 'I' || tipo == ' ') if (tipo == 'I' || tipo == ' ')
numrig = clint2pos(conto, tipo); nr = clint2pos(conto, tipo);
else else
numrig = type2pos(tipo); nr = type2pos(tipo);
if (numrig < 0)
if (nr < 0)
tipo = ' '; tipo = ' ';
else
{
if (get_cgs_imp(nr).is_zero())
numrig = nr;
}
}
} }
TToken_string& riga = cg.row(numrig); TToken_string& riga = cg.row(numrig);

View File

@ -714,6 +714,15 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
if (!ok) return FALSE; if (!ok) return FALSE;
} }
if (app().is_transaction())
{
// Controlla esistenza conti nelle transazioni
if (!c.find())
return f.error_box("Il conto della riga %d non esiste", i+1);
if (!co.empty() && !co.find())
return f.error_box("Il conto di contropartita della riga %d non esiste", i+1);
}
empty = FALSE; empty = FALSE;
if (paga || nota) if (paga || nota)
{ {

View File

@ -486,7 +486,7 @@ real TCodiceIVA::imposta(const real & imponibile, int ndec, const char * codval)
real TCodiceIVA::scorpora(real& lordo, int ndec, const char* codval) const real TCodiceIVA::scorpora(real& lordo, int ndec, const char* codval) const
{ {
const real percent = percentuale(); const real percent = percentuale();
real iva = (lordo * percent) / (percent + 100.0); real iva = (lordo * percent) / (percent + CENTO);
real imponibile = lordo - iva; real imponibile = lordo - iva;
switch (ndec) switch (ndec)