------------------------------------------------------------------
-- For Oracle Database --
------------------------------------------------------------------
-- Cancel invoices from a Scan Date defined
update docs
set status_index = '4'
where scan_date >= sysdate-90;
delete from flow_current where doc_id in (select d.doc_id from docs d where d.scan_date >= sysdate-90);
commit;
-- Cancel invoices from a Scan Date
update docs d set d.status_index ='4' where d.scan_date >= to_date('01/03/2020','DD/MM/YYYY');
delete from flow_current where doc_id in (select d.doc_id from docs d where d.scan_date >= to_date('01/03/2020','DD/MM/YYYY'));
commit;
-- Delete invoices from a Scan Date defined
delete from acc_data where doc_id in (select doc_id from docs where scan_date >= sysdate-90);
delete from flow_current where doc_id in (select doc_id from docs where scan_date >= sysdate-90);
delete from docs where scan_date >= sysdate-90;
commit;
-- Cancel invoices from a Scan Date
update docs d set d.status_index ='4' where d.scan_date >= to_date('01/03/2020','DD/MM/YYYY');
delete from flow_current where doc_id in (select d.doc_id from docs d where d.scan_date >= to_date('01/03/2020','DD/MM/YYYY'));
commit;
--------------------------------------------------------
-- Delete invoices from a Scan Date defined --
--------------------------------------------------------
delete from acc_data
where
doc_id in (select doc_id from docs where comp_no not in (select comp_no from companies)
and scan_date < to_date('01/01/2020','DD/MM/YYYY'));
delete from flow_current
where
doc_id in (select doc_id from docs where comp_no not in (select comp_no from companies)
and scan_date < to_date('01/01/2020','DD/MM/YYYY'));
delete from docs
where
doc_id in (select doc_id from docs where comp_no not in (select comp_no from companies)
and scan_date < to_date('01/01/2020','DD/MM/YYYY'));
-- Delete invoices from a Scan Date defined and COMP_NO is null
delete from acc_data
where
doc_id in (select doc_id from docs where scan_date < to_date('01/01/2020','DD/MM/YYYY') and (comp_no is null or comp_no = ''))
;
delete from flow_current
where
doc_id in (select doc_id from docs where scan_date < to_date('01/01/2020','DD/MM/YYYY') and (comp_no is null or comp_no = ''))
;
delete from docs
where
doc_id in (select doc_id from docs where scan_date < to_date('01/01/2020','DD/MM/YYYY') and (comp_no is null or comp_no = ''))
;
-- Mise à jour des DOC_ID restants
update docs
set comp_no = 'ZZZZ'
where
comp_no is null or comp_no = '';
select count(*) from docs where comp_no is null or comp_no = '';
commit;
Search Knowledge Base Articles
IP Master | How to delete all invoices from a Scan Date defined
Please find below a SQL Script to cancel invoices or delete invoices from your BasWare Invoice Processing database:
Did you find this article useful?
Related Articles
-
IP ThinClient | Security Check Fails
Vous avez peut-être déjà rencontré le message d'erreur suivant dans votre applic... -
IP ThinClient | Security Error Knows
Bonjour,J'ai un problème chez un client dans Thinclient.Lorsque je me connecte dans mon espace ... -
IP Admin - Comment désactiver l'envoi de mails de relance aux utilisateurs
Vous souhaitez désactiver l'envoi des mails de relances aux utilisateurs?Pour cela, il vous suf... -
IP Admin | Est-ce que la suppression d'un utilisateur efface la piste d'audit de ses anciennes factures?
La suppression d'un utilisateur n'efface pas les informations d'historique / piste d'audit des factu... -
IP ThinClient | HTTP Erreur 500
Description :L'utilisateur rencontre dans BasWare IP Thinclient, le message d'erreur : "HTTP Error 5...