diff --git a/buzz/api/__init__.py b/buzz/api/__init__.py index 7ed096a..06e636e 100644 --- a/buzz/api/__init__.py +++ b/buzz/api/__init__.py @@ -332,6 +332,9 @@ def process_booking( payment_proof: str | None = None, is_offline: bool = False, offline_payment_method: str | None = None, + invoice_requested: bool = False, + tax_id: str | None = None, + billing_address: str | None = None, ) -> dict: event_doc = frappe.get_cached_doc("Buzz Event", event) if not event_doc.is_published: @@ -378,6 +381,11 @@ def process_booking( booking.coupon_code = coupon_code booking.user = booking_user + if event_doc.apply_tax and invoice_requested: + booking.invoice_requested = 1 + booking.tax_id = tax_id + booking.billing_address = billing_address + if utm_parameters: for utm_param in utm_parameters: booking.append( diff --git a/buzz/ticketing/doctype/event_booking/event_booking.json b/buzz/ticketing/doctype/event_booking/event_booking.json index 1d4fb71..8c379dd 100644 --- a/buzz/ticketing/doctype/event_booking/event_booking.json +++ b/buzz/ticketing/doctype/event_booking/event_booking.json @@ -32,6 +32,11 @@ "currency", "coupon_code", "discount_amount", + "billing_details_section", + "invoice_requested", + "tax_id", + "column_break_billing", + "billing_address", "section_break_sdfp", "amended_from", "marketing_tab", @@ -176,6 +181,28 @@ "options": "currency", "read_only": 1 }, + { + "fieldname": "billing_details_section", + "fieldtype": "Section Break", + "label": "Billing Details" + }, + { + "depends_on": "eval:doc.invoice_requested==1", + "fieldname": "tax_id", + "fieldtype": "Data", + "label": "Tax ID" + }, + { + "fieldname": "column_break_billing", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval:doc.invoice_requested==1", + "fieldname": "billing_address", + "fieldtype": "Small Text", + "label": "Billing Address", + "mandatory_depends_on": "eval:doc.invoice_requested==1" + }, { "fieldname": "section_break_status", "fieldtype": "Section Break", @@ -224,6 +251,12 @@ "fieldtype": "Data", "label": "Offline Payment Method", "read_only": 1 + }, + { + "default": "0", + "fieldname": "invoice_requested", + "fieldtype": "Check", + "label": "Invoice Requested" } ], "grid_page_length": 50, @@ -239,7 +272,7 @@ "link_fieldname": "reference_docname" } ], - "modified": "2026-02-05 09:10:22.542973", + "modified": "2026-05-03 07:18:23.131237", "modified_by": "Administrator", "module": "Ticketing", "name": "Event Booking", diff --git a/buzz/ticketing/doctype/event_booking/event_booking.py b/buzz/ticketing/doctype/event_booking/event_booking.py index 8a39f79..3c1af12 100644 --- a/buzz/ticketing/doctype/event_booking/event_booking.py +++ b/buzz/ticketing/doctype/event_booking/event_booking.py @@ -26,15 +26,20 @@ class EventBooking(Document): additional_fields: DF.Table[AdditionalField] amended_from: DF.Link | None attendees: DF.Table[EventBookingAttendee] + billing_address: DF.SmallText | None coupon_code: DF.Link | None currency: DF.Link discount_amount: DF.Currency event: DF.Link + invoice_requested: DF.Check naming_series: DF.Literal["B.###"] net_amount: DF.Currency + offline_payment_method: DF.Data | None + payment_method: DF.Data | None payment_status: DF.Literal["Unpaid", "Paid", "Verification Pending"] status: DF.Literal["Confirmed", "Approval Pending", "Approved", "Rejected"] tax_amount: DF.Currency + tax_id: DF.Data | None tax_label: DF.Data | None tax_percentage: DF.Percent total_amount: DF.Currency diff --git a/dashboard/components.d.ts b/dashboard/components.d.ts index d8d060c..308f757 100644 --- a/dashboard/components.d.ts +++ b/dashboard/components.d.ts @@ -12,6 +12,7 @@ declare module 'vue' { AttendeeFormControl: typeof import('./src/components/AttendeeFormControl.vue')['default'] BackButton: typeof import('./src/components/common/BackButton.vue')['default'] BaseCustomEventForm: typeof import('./src/components/BaseCustomEventForm.vue')['default'] + BillingDetails: typeof import('./src/components/BillingDetails.vue')['default'] BookingEventInfo: typeof import('./src/components/BookingEventInfo.vue')['default'] BookingFinancialSummary: typeof import('./src/components/BookingFinancialSummary.vue')['default'] BookingForm: typeof import('./src/components/BookingForm.vue')['default'] diff --git a/dashboard/src/components/BillingDetails.vue b/dashboard/src/components/BillingDetails.vue new file mode 100644 index 0000000..c91bc6c --- /dev/null +++ b/dashboard/src/components/BillingDetails.vue @@ -0,0 +1,67 @@ +