Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The VAT number is not displayed at the order details if a legal person made the order #2070

Open
KingaOrsii opened this issue Jan 21, 2025 · 7 comments
Labels
bug Something isn't working unconfirmed

Comments

@KingaOrsii
Copy link

  • Lunar version: 1.0.0-beta.6
  • Laravel Version: 11.35.1
  • PHP Version: 8.3.15
  • Database Driver & Version: MySQL 8

Expected Behaviour:

The VAT number (and all other meta field items) should appear at the order details if the order was created by a legal person.
OR
The VAT number should be saved to the DB in a separate field and handled at the order details as any other field.

Actual Behaviour:

The company's VAT number is not displayed at the order details on backend (nor in the generated PDF), and it should if the order was made by a legal person.

Steps To Reproduce:

Create an order as a legal person, add company details.
Check the order on backend.
Observe that the given VAT number is not appearing at the order details, nor in the generated PDF.

@alecritson
Copy link
Collaborator

Thanks @KingaOrsii Whilst I agree this could be useful, I'm not sure assuming vatNumber in the meta is the correct way as it's not part of the core and undocumented. I'll bring @glennjacobs on here to see if he has any opinions on the approach.

@glennjacobs
Copy link
Contributor

No, I think it demands it's own specific field.

@KingaOrsii
Copy link
Author

Thanks for your response.
So are you suggesting that there should be a separate DB field for vat number?

@alecritson
Copy link
Collaborator

Correct :) we can then document and use it properly throughout the core and panel.

@glennjacobs
Copy link
Contributor

Yes, as this is a common requirement to store a customer's VAT number, I think it deserves it's own database field.

We need to be storing this with the billing entity, which in Lunar's case would be the billing address. Addresses in the system can of course be used for delivery also, but this gives flexibility if someone does for some reason need to store it against a delivery address.

We have three address tables to consider: addresses, cart_addresses & order_addresses.

Once updated in the core, we can then add some display logic to the admin panel.

@KingaOrsii
Copy link
Author

I created a new pull request if you don't mind. I added a new DB field for the VAT number, also renamed vat_no to vat_number at the customer.

#2106

Copy link
Contributor

Thanks, looks good. I'll give it a proper review soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

3 participants