Patch level : 12.0 982

Files correlati     : ef0.exe ef1.exe
Commento            :

Corretto aggiornamento effetti perchè non dia errore se mancano righe nel mezzo e li risistemi
This commit is contained in:
Alessandro Bonazzi 2020-07-26 10:13:07 +02:00
parent 9badace4e9
commit 347027ce9b
6 changed files with 15 additions and 50 deletions

View File

@ -26,7 +26,8 @@ BEGIN
PROMPT 30 1 "Numero "
FIELD NPROGTR
KEY 1
USE LF_EFFETTI SELECT (TIPOCF=#F_TIPOCF)&&(BETWEEN(CODCF,#F_CODCF,#F_CODCF))
USE LF_EFFETTI
// SELECT (TIPOCF=#F_TIPOCF)&&(BETWEEN(CODCF,#F_CODCF,#F_CODCF))
JOIN LF_CLIFO INTO CODCF=CODCF TIPOCF=TIPOCF
INPUT NPROGTR F_NPROGTR
DISPLAY "Nr.progr." NPROGTR

View File

@ -98,8 +98,10 @@ int TEffetto::leggi(TLocalisamfile &f, const TRectype& r, word lockop)
if (err == NOERR)
{ // leggo dai record array
_righe.read(k_reff);
_righe.pack();
_cess.read(k_cess);
}
_cess.pack();
}
else // se ho trovato un errore
{
head() = r;

View File

@ -54,20 +54,20 @@ int TDistinta::read(const char tipo, const long numero, word lockop)
{
TISAM_recordset reff(query(tipo, numero));
TLocalisamfile& f = reff.cursor()->file();
int i = 0;
for (bool ok = reff.move_first(); ok; ok = reff.move_next())
int i = 0;
for (bool ok = reff.move_first(); ok; ok = reff.move_next(), i++)
{
const word lock = (i == 0 && lockop == _lock) ? _lock : _nolock; // Lock solo sulla prima riga
const int n = reff.get(EFF_NRIGADIST).as_int();
TEffetto* effetto = new TEffetto;
err = effetto->read(f, tipo, numero, n, lock);//legge un effetto per chiave 4
TEffetto effetto;
err = effetto.read(f, tipo, numero, n, lock);//legge un effetto per chiave 4
if (err == NOERR)
{
i = _righe_dist.add(effetto) + 1;
effetto->put(EFF_NRIGADIST, i);
_righe_dist.add(effetto, i);
effetto.put(EFF_NRIGADIST, i + 1);
}
else
delete effetto;
}
}
// se ho letto degli effetti della distinta ed ho

View File

@ -35,9 +35,8 @@
#include <sheet.h>
#include "../cg/cg2101.h"
#include "../cg/cg2103.h"
#include "../cg/cglib.h"
#include "../cg/cgsaldac.h"
#include "../cg/cglib02.h"
#include "../ve/velib04.h"
#include "ef0301.h"
#include "ef0800a.h"

View File

@ -24,43 +24,6 @@
static XVT_SQLDB _db = NULL; // SEPA sqlite db
/////////////////////////////////////////////////////////////////////////////////////
// Utilities
/////////////////////////////////////////////////////////////////////////////////////
// Cerca una stringa all'interno di una SLIST (Potrebbe diventare una funzione di XVT.h)
static SLIST_ELT xvt_slist_find_str(SLIST list, const char* str)
{
SLIST_ELT e = NULL;
for (e = xvt_slist_get_first(list); e; e = xvt_slist_get_next(list, e))
{
const char* val = xvt_slist_get(list, e, NULL);
if (xvt_str_compare_ignoring_case(str, val) == 0)
break;
}
return e;
}
// Aggiorna il file dst se più vecchio di src (Potrebbe diventare una funzione di XVT.h)
bool xvt_fsys_fupdate(const char* src, const char* dst)
{
bool ok = false;
if (xvt_fsys_file_exists(src))
{
const long tsrc = xvt_fsys_file_attr(src, XVT_FILE_ATTR_MTIME);
if (tsrc > 0)
{
long tdst = 0;
if (xvt_fsys_file_exists(dst))
tdst = xvt_fsys_file_attr(dst, XVT_FILE_ATTR_MTIME);
if (tsrc > tdst)
ok = xvt_fsys_fcopy(src, dst) != 0;
}
}
return ok;
}
/////////////////////////////////////////////////////////////////////////////////////
// TJava_profile
/////////////////////////////////////////////////////////////////////////////////////

View File

@ -62,7 +62,7 @@ BEGIN
OUTPUT F_CAB CODTAB[6,10]
OUTPUT F_PRO CODTAB[11,12]
OUTPUT F_BANCA 4->S0
CHECTYPE NORMAL
END
STRING F_BANCA 50 47