El asociado genero por error un corte final y era un corte parcial que deseaba hacer
En este escenario es necesario eliminarlo ya que de lo contrario el asociado no podrá seguir cobrando por ello no debe existir un corte final generado.
Query: Balance – verificación corte de cajeros.
DECLARE @Date datetime = '2024-07-17' --Dia de Operacion
DECLARE @Cashier int = 40467 --Employee 9995, 9997
DECLARE @Emp int = (Select employeeno from employee where employeeno = @Cashier or payrollid = @Cashier)
--SP PARA FORZAR EL CORTE FINAL DE CAJERO ECOMMERCE
--exec spWithdrawalEccomerce '2023-03-06'
Select GETDATE() as 'HORA ACTUAL', 'CIERRE DE TIENDA', ProgStartTim, EOPStatus, AcctStatus, CurrentDate, CurRptDate, Progname,Lasttran,* FROM AcctPeriod order by getdate() desc
/* Cierre de caja general */
SELECT @@SERVERNAME AS 'Server Name'
SELECT 'CIERRE CAJA GENERAL', * FROM STORE_FinalTenderTotals WHERE CAST(Date as date) = @Date
--update STORE_FinalTenderTotals set status = 'Approved' where date = '2023-12-24 18:37:05.133' and status = 'Reviewed'
--eliminar corte de caja general
--delete from STORE_FinalTenderTotals where date = '2024-04-16 22:25:18.453' and transmitted = 0
/* Conciliación de cajero */--4629
SELECT * FROM CashierBalances WHERE Date = @Date AND EmployeeNo = @Emp
--ELIMINAR CONCILIACION DE CAJERO--
--delete from cashierbalances where employeeno = 376 and date = '2024-06-27'
SELECT TABadge, JobTitle, * FROM Employee WHERE EMPLOYEENO = @Emp OR PayrollId = @Emp
/* Encabezado del corte */
SELECT * FROM STORE_Withdrawals WHERE Cast(Date as date) = @Date and EmployeeNo = @Emp
SELECT @@SERVERNAME AS 'Server Name'
BEGIN
SELECT TenderCode AS 'Tipo de pago', Cajas, Cortes--, convert(money,Cajas)-Isnull(convert(money,Cortes),0) 'Diferencia'
FROM(
/* Información de cortes */
SELECT
CONCAT(DEN.TenderCode, ' - ', TN.[Description]) AS TenderCode,
FORMAT(SUM(WDE.TotalPrice), 'C', 'en-us') AS Amount,
'Cortes' AS Type
FROM STORE_Withdrawals AS WD
JOIN STORE_WithdrawalDenominations AS WDE ON WD.WithdrawalId = WDE.WithdrawalId
JOIN STORE_Denominations AS DEN ON WDE.DenominationId = DEN.DenominationId
JOIN TenderCntrl TN ON DEN.TenderCode = TN.TenderCode
WHERE WD.WithdrawalId IN (SELECT WithdrawalId FROM STORE_Withdrawals WHERE EmployeeNo = @Emp)
AND CAST(WD.Date as date) = @Date
GROUP BY DEN.TenderCode, TN.[Description]
UNION
/* Información de cajas */
SELECT
CONCAT(TTE.TenderCode, ' - ', TN.[Description]) AS TenderCode,
FORMAT(SUM(tte.TenderAmount), 'C', 'en-us') AS Amount,
'Cajas' AS Type
FROM TranTotal TT
JOIN TranTender TTE on TT.TranNumber = TTE.TranNumber and TT.TranDate = TTE.TranDate and TT.RegisterID = TTE.RegisterID
JOIN Employee AS EMP ON TT.EmployeeNo = EMP.EmployeeNo
JOIN TenderCntrl TN ON TTE.TenderCode = TN.TenderCode
WHERE TT.TranDate = @Date
AND TT.EmployeeNo = @Emp
AND TT.OperatMode = 0
AND TT.RecType = 'N'
AND TT.TypeOfSale NOT IN (3,49,88)
AND TTE.TenderCode != 14
GROUP BY TTE.TenderCode, TN.[Description]
) M
PIVOT
(
MAX(Amount) FOR Type in (Cajas,Cortes)
) piv;
END
/* Detalle del corte final */
SELECT 'DETALLE DE CORTE FINAL', * FROM STORE_Withdrawaldenominations wd JOIN STORE_Withdrawals w ON wd.WithdrawalId = w.Withdrawalid
WHERE Cast(Date as date) = @Date and EmployeeNo = @Emp and w.DocumentType like '%final%'
/* Transacciones del cajero */
SELECT tt.posted, tt.Endtime, tt.RecType, tt.OperatMode, te.TranDate, tt.RegisterId, tt.TranNumber, tt.EmployeeNo, te.TenderCode, te.TenderAmount, SigSequence
FROM TranTotal tt LEFT JOIN TranTender te
ON te.TranDate = tt.TranDate and te.RegisterId = tt.RegisterId and te.TranNumber = tt.TranNumber
WHERE tt.TranDate = @Date and EmployeeNo = @Emp
ORDER BY EndTime

Aquí se observa un final creado que debió ser final, procedemos a borrarlo y el asociado podrá seguir cobrando sin problemas y al final del turno podrá realizar su corte final sin problemas
Nota: solo se debe eliminar si NO está APROBADO debe estar rejected, en caso de que este aprobado lo colocamos en pending para que caja general rechace y posteriormente eliminamos.
Para eliminar
Para depurar los cortes tomamos el dato del campo withdrawalid de la tabla STORE_Withdrawaldenominations y ejecutamos el delete que viene en el query y ejecutamos solo esa línea. Al volver a consultar ya no debería aparecer el corte final reportado.

Con el final eliminado el cajero podrá cobrar sin problemas y por ende ya no se observará en BD.
--Depurar/ ELIMINAR corte de cajero final o parcial
--Declare @wdr int = 442131 -- colocar el dato que se encuentra en el campo de withdrawalid
--DELETE FROM STORE_Withdrawaldenominations where withdrawalid = @wdr
--DELETE FROM STORE_Withdrawals where withdrawalid = @wdr