Initialize vat number in payment forms

This commit is contained in:
PCoder 2019-12-17 23:48:05 +05:30
parent 568d874476
commit 6ea486b527
2 changed files with 4 additions and 0 deletions

View file

@ -254,6 +254,9 @@ class PaymentOrderView(FormView):
billing_address_form = BillingAddressForm(
instance=self.request.user.billing_addresses.first()
)
billing_address_form.fields['vat_number'].initial = (
self.request.user.vat_number
)
user = self.request.user
if hasattr(user, 'stripecustomer'):
stripe_customer = user.stripecustomer

View file

@ -694,6 +694,7 @@ class PaymentVMView(LoginRequiredMixin, FormView):
'city': current_billing_address.city,
'postal_code': current_billing_address.postal_code,
'country': current_billing_address.country,
'vat_number': self.request.user.vat_number
}
})
return form_kwargs