SQL Tips

Lorsque les documents sont bloqués en statut Upload complete, waiting for review

On peut avoir deux cas avec le même message Upload complete, waiting for review

Le premier cas: Quand dans le dossier d'index un fichier index.err est créé

index.err

La solution proposée par Zylab est : Ticket Zylab index_ticket.err

Les index sont ici : D:\ZyLAB Data\SearchEngine\Indexes

Puis redémarrer ZyLAB Legal Review Standalone Service

Le deuxième cas

Solution par zylab

indexoffset_before%20

UPDATE [ZyLABLegalReview].[dbo].[Matter]
SET IndexOffset = 0
WHERE Id = 90 

indexOffset_0

Puis redémarrer ZyLAB Legal Review Standalone Service

Convertir une colonne en float

Float_

Si on a cette erreur lorsque nous cliquons sur enregistrer

Error converting data type varchar to float

On utilise cette requête pour changer le type de données

UPDATE [dbo].[M_0101] SET montant_ttc= TRY_CONVERT(float, montant_ttc) float

Après cela l'enregistrement se fait sans problème.

Changer le statut du doc

GO

UPDATE [dbo].[M_0090]
   SET [doc_statut] = 'DOC_ERRONE'

 WHERE ID in ('400685','400684','400683','400682','400681','400639','400627','400625','400444','397875','397134')
GO

Statistiques LAD

Combien de documents ont été traités par LAD pendant un mois, deux mois...

Vérification côté LAD: show_statisticsstat_par_jour

Vérification côté Legal Review (GED)

SQL_ FROM [ZyLABLegalReview].[dbo].[M_0090]

WHERE documentimportedtime between '2021-10-01' and '2021-10-31' AND name not like '%.mfp%'

Exemple: 01/10/2021 jusqu'au 31/10/2021

LAD-GED

Pour la modification des Default View dans la GED, la requête qui update l’ensemble des default view en place, dans SQL Saisissez le numéro de MatterId='' à la fin du script

USE [ZyLABLegalReview]
GO

UPDATE [dbo].[DocumentListView]
   SET [Columns] = '{"Columns":[{"Id":"DocumentGridColumn_upload_id","IsVisible":true,"VisibleIndex":0,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_id","IsVisible":true,"VisibleIndex":1,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_fournisseur","IsVisible":true,"VisibleIndex":2,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_num_fournisseur","IsVisible":true,"VisibleIndex":3,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_type_doc","IsVisible":true,"VisibleIndex":4,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_num_facture","IsVisible":true,"VisibleIndex":5,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_num_bon","IsVisible":true,"VisibleIndex":6,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_num_commande","IsVisible":true,"VisibleIndex":7,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_num_avoir","IsVisible":true,"VisibleIndex":8,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_date_doc","IsVisible":true,"VisibleIndex":9,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_date_echeance","IsVisible":true,"VisibleIndex":10,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_montant_ttc","IsVisible":true,"VisibleIndex":11,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_doc_statut","IsVisible":true,"VisibleIndex":12,"IsSortingAllowed":true,"Width":0.0},{"Id":"DocumentGridColumn_source","IsVisible":true,"VisibleIndex":13,"IsSortingAllowed":true,"Width":0.0}]}'
 WHERE Name='Default View' AND MatterId=''
GO

MAJ InheritedMetadataFields

UPDATE dbo.Matter
SET Settings.modify('replace value of (/Settings/Setting[@Name=("InheritedMetadataFields")]/@Value)[1] with "emxdoc|emxmsg|emxsnd|emxrcx|emxrcp|emxsdt|emxrdt|emxcdt|emxsub|emxcnv|emxstore|emxfolder|emxbdy|emxtype|emxappst|emxappet|zz_on|zz_ol|zz_isattment|zz_isinlineattment|zz_uploadname|zz_mfd|zz_mfd_iv|mediafileproperties|rmaguid|rmaid|fileid|registrationid|binaryid|BinaryFileName|UploadStatus|remarks|RegExFileSplitter|RegExPattern|RegExParentZyXmlTiffFile|RegExPatternFound|RegExHits|RegExNumberOfHits|RegExNumberOfPages|date_doc|type_doc|domaine|doc_statut|upload_id|num_facture|num_fournisseur|fournisseur|num_bon|num_bon_retour|num_avoir|num_commande|date_archivage|date_archivage_lad|montant_ht|montant_tva|montant_ttc|date_echeance|date_debut|date_fin|traitement_lad|signed|lieu_de_vente"')
WHERE LegalReviewTemplateName='ZyLAB ONE Logilec'

Recherche de doublons sur la GED

WITH CTE_TEST AS (SELECT fournisseur, num_facture, montant_ttc, COUNT(*) as nbdups
    FROM [ZyLABLegalReview].[dbo].[M_0023]
    GROUP BY fournisseur, num_facture, montant_ttc
    HAVING COUNT(*) > 1)
SELECT InvoiceData.id, CTE_TEST.* 
FROM [ZyLABLegalReview].[dbo].[M_0023] as InvoiceData
INNER JOIN CTE_TEST ON CTE_TEST.num_facture = InvoiceData.num_facture
ORDER BY InvoiceData.fournisseur, InvoiceData.num_facture ASC

Vérifier le nombre total de documents dans vérifieur (avec le statut Verifier)

/****** Script de la commande SelectTopNRows à partir de SSMS  ******/
SELECT TOP (1000) [SF_STACKS].STACK_ID,
    SF_STACK_ATTR.ATTR_IMPORT_VALUE
      ,[CLIENT_ID]
      ,[IMPORT_TIME]
      ,[SUBSYSTEM]
      ,[VERSION]
      ,[CATEGORY]
      ,[STATE]
      ,[NUM_IMAGES]
      ,[NUM_ANA_DOCS]
      ,[NUM_VER_DOCS]
      ,[NUM_SUP_DOCS]
      ,[NUM_EXP_DOCS]
      ,[ANA_START]
      ,[ANA_DURATION]
      ,[VER_START]
      ,[VER_DURATION]
      ,[FLAGS]
      ,[LAST_MODIFIED]

  FROM [SmartFix_Control_DB].[smartfix].[SF_STACKS]
  INNER JOIN SmartFix_Control_DB.smartfix.SF_STACK_ATTR ON SF_STACK_ATTR.STACK_ID=SF_STACKS.STACK_ID
  WHERE STATE='Verifier' and SF_STACK_ATTR.ATTR_NAME='$DocID'
  AND SUBSYSTEM IN ('Logilec')
  ORDER BY SUBSYSTEM ASC