DELETE FROM consolida1 WHERE CODSUCURSAL = '347' AND (DVDIAOPE LIKE '%/05/2023' OR DDDIAOPE LIKE '%/05/2023');
;
UPDATE consolida1 SET DEVALPAR  = DEVALUNI*DECANTIDAD WHERE DEVALPAR = 0 AND PERIODODOC = '052023' AND DECODBOD='347';
UPDATE consolida1 SET DEVALBASE = DEVALTOTAL*DEVALIVA WHERE DEVALBASE = 0 AND PERIODODOC = '052023' AND DECODBOD='347';
UPDATE consolida1 SET DEVALIVA  = DEVALTOTAL-DEVALBASE WHERE PERIODODOC = '052023' AND DECODBOD='347';
UPDATE consolida1 SET VRBASEDOC = TOTALDOC-VRIVADOC WHERE VRBASEDOC = 0 AND VRIVADOC = 0 AND PERIODODOC = '052023' AND DECODBOD='347';
DELETE FROM consolida2 WHERE PERIODOESPE = '052023' AND CODSUCURSAL = '347';
