Skip to content

Commit

Permalink
Merge pull request #2376 from frappe/create-usage-record-util
Browse files Browse the repository at this point in the history
feat(subscription): Add optional arg in create_usage_record to use in scripts
  • Loading branch information
shadrak98 authored Dec 21, 2024
2 parents 492fb16 + 7054ebf commit 17fe55a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion press/press/doctype/subscription/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def disable(self):
frappe.log_error(title="Disable Subscription Error")

@frappe.whitelist()
def create_usage_record(self):
def create_usage_record(self, date: DF.Date | None = None):
cannot_charge = not self.can_charge_for_subscription()
if cannot_charge:
return None
Expand Down Expand Up @@ -163,6 +163,7 @@ def create_usage_record(self):
plan_type=self.plan_type,
plan=plan.name,
amount=amount,
date=date,
subscription=self.name,
interval=self.interval,
site=(
Expand Down

0 comments on commit 17fe55a

Please sign in to comment.