fix scheduler counting void and refund

This commit is contained in:
ryan 2026-05-14 14:22:07 +07:00
parent cb8a830345
commit 312ea94e62

View File

@ -105,7 +105,7 @@ func (r *OrganizationRepositoryImpl) GetTotalOmset(ctx context.Context, organiza
var total float64
err := r.db.WithContext(ctx).
Table("orders").
Where("organization_id = ? AND payment_status = ?", organizationID, "completed").
Where("organization_id = ? AND payment_status = ? AND is_void = ? AND is_refund = ?", organizationID, "completed", false, false).
Select("COALESCE(SUM(total_amount), 0)").
Scan(&total).Error
return total, err