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

Order modal show price #1682

Merged
merged 12 commits into from Jun 22, 2021
Merged

Conversation

matmair
Copy link
Member

@matmair matmair commented Jun 17, 2021

Fixes #391

This PR adds the fuctionallity propsed by @SchrodingersGat in #391 in 2019.
In the part-order-modal the price of each supplier-part (based on the entered quantity) is displayed. A custom submit button enables reloading the supplier-part selection screen to update the prices.

@matmair matmair marked this pull request as ready for review June 18, 2021 07:41
@matmair matmair mentioned this pull request Jun 18, 2021
11 tasks
<option value="{{ supplier.id }}"{% if part.order_supplier == supplier.id %} selected="selected"{% endif %}>
{% if show_price %}
{% call_method supplier 'get_price' part.order_quantity as price %}
{% include "price.html" with price=price %} -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

This line throws an error immediately for me, I think you need to pass currency to price.html ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SchrodingersGat that is done in line 7, I think the merge fixed if, could you try again?

@SchrodingersGat
Copy link
Member

image

image

Still seeing the error, not sure what I'm doing wrong, this part has prices set for multiple suppliers as shown in the first screenshot.

@matmair
Copy link
Member Author

matmair commented Jun 19, 2021

@SchrodingersGat right. I could reproduce and fix it with the fixtures loaded. Will start doing that instead of using my own testing database. Should work now.

@SchrodingersGat
Copy link
Member

@matmair still having some issues:

Firstly, I definitely have supplier pricing set:

image

However when I click the "order" button (on the same page):

image

Also, when I hit "Update Prices" I get the following screen:

image

Note that this part is marked as purchasable:

image

Also, the "Update Prices" button seems to persist on other modals once it is drawn:

image

Looks like these extra modal buttons need to be explicitly reset

@SchrodingersGat
Copy link
Member

@matmair that's fixed the zero-pricing issue, nice work.

However the extra button still persists on the next modal you launch after closing that one:

image

@matmair
Copy link
Member Author

matmair commented Jun 20, 2021

@SchrodingersGat I found a few other problems while debugging this, will ping you when I ironed out everything.

@matmair
Copy link
Member Author

matmair commented Jun 20, 2021

I fixed the button always appearing but still working on another the quantity-zero issue and on errors not finished multi-part modals reappear.

@SchrodingersGat
Copy link
Member

ok no worries, let me know when you are again ready for review.

@matmair
Copy link
Member Author

matmair commented Jun 22, 2021

Also, when I hit "Update Prices" I get the following screen:

image

@SchrodingersGat turns out that dropping all parts with a quantity of zero is no bug but hardcoded behaviour. I think that makes sense. The question is if the start-quantity should be 1 by default (currently 0) to prevent confusion.

@SchrodingersGat
Copy link
Member

Fair enough, this makes sense. Thanks for your work on this.

@SchrodingersGat SchrodingersGat merged commit 962badc into inventree:master Jun 22, 2021
@matmair matmair deleted the order-modal-show-price branch June 22, 2021 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When ordering parts, show the pricing for each supplier
2 participants