diff --git a/bookings/bookings/doctype/booking_credit/booking_credit.py b/bookings/bookings/doctype/booking_credit/booking_credit.py index 894771a3ec90946792d6643b0d1a5799ac2c4cfa..bbe297535340a3bce9d6710556955d9ac587170e 100644 --- a/bookings/bookings/doctype/booking_credit/booking_credit.py +++ b/bookings/bookings/doctype/booking_credit/booking_credit.py @@ -183,18 +183,25 @@ def are_subscription_credits_due(date, rule, subscription): if rule.recurrence == "Every Day": frequency = rrule.DAILY + recurrence_interval = 1 elif rule.recurrence == "Every Week": frequency = rrule.WEEKLY + recurrence_interval = 1 elif rule.recurrence == "Every Month": frequency = rrule.MONTHLY + recurrence_interval = 1 + + elif rule.recurrence == "Every 3 Months": + frequency = rrule.MONTHLY + recurrence_interval = 3 end_date = getdate(subscription.cancellation_date or subscription.current_invoice_end) possible_dates = [ getdate(x) for x in rrule.rrule( - frequency, dtstart=get_datetime(subscription.start), until=get_datetime(end_date) + frequency, interval=recurrence_interval, dtstart=get_datetime(subscription.start), until=get_datetime(end_date) ) ] diff --git a/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.json b/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.json index 549bb15bdd1499f380226b5cb7163524f6173d6f..724db2ad843909ed23fa60ab4b6e815704e9f2c1 100644 --- a/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.json +++ b/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.json @@ -49,7 +49,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Recurrence", - "options": "Once\nEvery Day\nEvery Week\nEvery Month\nEvery Billing Period", + "options": "Once\nEvery Day\nEvery Week\nEvery Month\nEvery 3 Months\nEvery Billing Period", "reqd": 1 }, { @@ -69,7 +69,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2025-02-17 14:26:47.398321", + "modified": "2025-06-16 14:40:20.614485", "modified_by": "Administrator", "module": "Bookings", "name": "Booking Credit Allocation Rule", @@ -90,7 +90,8 @@ "write": 1 } ], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} diff --git a/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.py b/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.py index 1477c2eb127ae802e888a283c65e1d6e9d3f7a10..cb50de82b4666f0b48471116d5853c22f796eec9 100644 --- a/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.py +++ b/bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.py @@ -17,7 +17,7 @@ class BookingCreditAllocationRule(Document): booking_credit_type: DF.Link expiration_days: DF.Int quantity: DF.Int - recurrence: DF.Literal["Once", "Every Day", "Every Week", "Every Month", "Every Billing Period"] + recurrence: DF.Literal["Once", "Every Day", "Every Week", "Every Month", "Every 3 Months", "Every Billing Period"] subscription: DF.Link # end: auto-generated types diff --git a/bookings/locale/fr.po b/bookings/locale/fr.po index ce08b2d5a7b975e24a989f1a558ecaa84f73dfd2..39eecd8b5b0f2f79dc0d12eba2956031002665b4 100644 --- a/bookings/locale/fr.po +++ b/bookings/locale/fr.po @@ -1647,3 +1647,9 @@ msgstr "📑 Contrats" #: bookings/workspace/events_&_resources/events_&_resources.json msgid "🗓️ Events & Resource Bookings" msgstr "🗓️ Evénéments & réservations de ressources" + +#. Option for the 'Recurrence' (Select) field in DocType 'Booking Credit +#. Allocation Rule' +#: bookings/bookings/doctype/booking_credit_allocation_rule/booking_credit_allocation_rule.json +msgid "Every 3 Months" +msgstr "Tout les 3 Mois"