Patch level : 10.0 patch ???

Files correlati     : lv3
Ricompilazione Demo : [ ]
Commento            :
Aggiunta lock dei documenti in uso


git-svn-id: svn://10.65.10.50/trunk@20487 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca83 2010-05-24 14:17:32 +00:00
parent 1a65352873
commit 9e0c3d1683
4 changed files with 35 additions and 3 deletions

View File

@ -372,6 +372,14 @@ bool TGestione_bolle_msk::lv_bolla_handler(TMask_field& f, KEY k)
TDocumento& doc = dmsk.doc(); TDocumento& doc = dmsk.doc();
TLocalisamfile fdoc(LF_DOC);
int err = doc.read(fdoc, _isequal, _testandlock);
if(err != NOERR)
{
warning_box(TR("Il documento è già in uso"));
return false;
}
TSheet_field& sheet = dmsk.sfield(F_SHEET); TSheet_field& sheet = dmsk.sfield(F_SHEET);
int nrighe = sheet.items(); int nrighe = sheet.items();

View File

@ -366,6 +366,14 @@ bool TGestione_buoni_msk::set_righe_buono_handler(TMask_field& f, KEY k)
TDocumento& doc = dmsk.doc(); TDocumento& doc = dmsk.doc();
TLocalisamfile fdoc(LF_DOC);
int err = doc.read(fdoc, _isequal, _testandlock);
if(err != NOERR)
{
warning_box(TR("Il documento è già in uso"));
return false;
}
TSheet_field& sheet = dmsk.sfield(F_SHEET); TSheet_field& sheet = dmsk.sfield(F_SHEET);
int nrighe = sheet.items(); int nrighe = sheet.items();

View File

@ -247,6 +247,14 @@ bool TEvasione_ter_msk::precarica_righe()
return false; return false;
} }
TLocalisamfile fdoc(LF_DOC);
int err = doc.read(fdoc, _isequal, _testandlock);
if(err != NOERR)
{
warning_box(TR("Il documento è già in uso"));
return false;
}
const TString4 stato = cache().get("%TIP", ini_get_string(CONFIG_DITTA, "lv", "TIPODOC_PRE", NULL, 0), "S2").mid(2,1); const TString4 stato = cache().get("%TIP", ini_get_string(CONFIG_DITTA, "lv", "TIPODOC_PRE", NULL, 0), "S2").mid(2,1);
if (doc.get(DOC_STATO) == stato) if (doc.get(DOC_STATO) == stato)

View File

@ -178,6 +178,14 @@ bool TInventario_ter_msk::precarica_righe()
TDoc_key kinv(get_int(F_ANNO), ini_get_string(CONFIG_DITTA, "lv", "NUM_INV", NULL), get_long(F_NINV)); TDoc_key kinv(get_int(F_ANNO), ini_get_string(CONFIG_DITTA, "lv", "NUM_INV", NULL), get_long(F_NINV));
TDoc_inventario inv(kinv); TDoc_inventario inv(kinv);
TLocalisamfile fdoc(LF_DOC);
int err = inv.read(fdoc, _isequal, _testandlock);
if(err != NOERR)
{
warning_box(TR("L'inventario già in uso"));
return false;
}
if (inv.empty()) if (inv.empty())
{ {
warning_box(TR("L'inventario cercato è inesistente")); warning_box(TR("L'inventario cercato è inesistente"));