-- ================================
-- تصحيح حالة سندات الصرف النقدية
-- Fix Cash Payment Status
-- ================================

-- تحديث سندات صرف العملاء من draft إلى confirmed
-- Update Customer Payments from draft to confirmed
UPDATE customer_payments 
SET status = 'confirmed' 
WHERE status = 'draft';

-- تحديث سندات صرف الموردين من draft إلى confirmed
-- Update Supplier Payments from draft to confirmed
UPDATE supplier_payments 
SET status = 'confirmed' 
WHERE status = 'draft';

-- عرض النتائج
-- Show Results
SELECT 'Customer Payments Updated' as message, COUNT(*) as count 
FROM customer_payments 
WHERE status = 'confirmed';

SELECT 'Supplier Payments Updated' as message, COUNT(*) as count 
FROM supplier_payments 
WHERE status = 'confirmed';
