From 663896becb4fb5b15260cfed18ed35d5c1623ab4 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 16 May 2026 00:27:59 +0300 Subject: [PATCH] Update: 2026-05-16 00:27:57 --- update_annual_plans.sql | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/update_annual_plans.sql b/update_annual_plans.sql index 04d89c8..3a36364 100644 --- a/update_annual_plans.sql +++ b/update_annual_plans.sql @@ -1,46 +1,41 @@ --- 1. Update existing plans to annual quotas and pricing --- We'll assume the basic plan ID is 'basic' and pro is 'pro'. If they are different, they will need adjusting. - --- Basic Plan (Annual) +-- 1. تحديث الباقات الحالية إلى باقات سنوية بالأسعار والأرقام الجديدة UPDATE subscription_plans SET name_ar = 'الباقة الأساسية (سنوي)', name_en = 'Basic Plan (Annual)', - price = 120.00, - max_invoices_per_month = 12000, + price_jod = 120.00, + max_invoices_month = 12000, max_companies = 1, max_users = 1 WHERE id = 'basic'; --- Pro Plan (Annual) UPDATE subscription_plans SET name_ar = 'الباقة الاحترافية (سنوي)', name_en = 'Pro Plan (Annual)', - price = 250.00, - max_invoices_per_month = 50000, - max_companies = 9999, -- unlimited + price_jod = 250.00, + max_invoices_month = 50000, + max_companies = 9999, -- للشركات غير المحدودة max_users = 5 WHERE id = 'pro'; --- Free Trial Plan +-- 2. إبقاء الباقة المجانية كما هي UPDATE subscription_plans SET name_ar = 'التجربة المجانية', name_en = 'Free Trial', - price = 0.00, - max_invoices_per_month = 15, + price_jod = 0.00, + max_invoices_month = 15, max_companies = 1, max_users = 1 WHERE id = 'free'; --- 2. Update existing active subscriptions to match the new annual quota limits so no one gets blocked +-- 3. ترحيل وتحديث بيانات العملاء المشتركين حالياً UPDATE subscriptions s JOIN subscription_plans sp ON s.plan_id = sp.id SET - s.max_invoices_per_month = sp.max_invoices_per_month, + s.max_invoices_per_month = sp.max_invoices_month, s.max_companies = sp.max_companies, s.max_users = sp.max_users, - -- Adjust the period end to +1 year if it's currently set to a month (for paid plans only) + -- تمديد فترة الفوترة للمشتركين المدفوعين لتصبح سنة كاملة من تاريخ بدايتها s.current_period_end = IF(s.plan_id != 'free', DATE_ADD(s.current_period_start, INTERVAL 1 YEAR), s.current_period_end); -