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

[bug] pricing autofill in purchase orders #4902

Closed
2 of 3 tasks
T0jan opened this issue May 26, 2023 · 10 comments
Closed
2 of 3 tasks

[bug] pricing autofill in purchase orders #4902

T0jan opened this issue May 26, 2023 · 10 comments
Labels
bug Identifies a bug which needs to be addressed order Related to purchase orders / sales orders Platform UI Related to the React based User Interface pricing Pricing functionality question This is a question user interface User interface
Milestone

Comments

@T0jan
Copy link

T0jan commented May 26, 2023

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

hi again,

I found that between 0.11.0 dev and 0.12.0 dev a for me quite useful function was removed and I wanted to check if this is intended: in 0.11.0 dev editing a line item of a purchase order automatically changed the price to the latest information available in the Supplier Part Pricing of the assigned Supplier Part of this line item. So e.g. if a part had a price of 10$ per item at first, the price was updated to 9.50$ while the purchase order was prepared, then editing this specific line item would change the purchase price to 9.5$ as well. in 0.12.0 dev the price now never gets updated, is this intended?

If the function is intended to come back I also would suggest, that some kind of autofill on creation function is added. Adding a line item to a purchase order should automatically set the fitting price based on the available pricing information to have at least a rough estimation of the total price initially.

Steps to Reproduce

  1. add a line item to a purchase order
  2. make sure the item has a Supplier Part Pricing entry
  3. edit the line item in the purchase order
    on 0.11.0 dev: the price is autofilled
    on 0.12.0 dev: the price remains empty

Expected behaviour

The price should be autofilled in 0.12.0 dev as well. If the function comes back an autofill on creation of the line item, not just on editing would be great.

Deployment Method

  • Docker
  • Bare metal

Version Information

Version Information:

InvenTree-Version: 0.11.0 dev
Django Version: 3.2.18
Commit Hash: 1ba51e5
Commit Date: 2023-03-14
Database: postgresql
Debug-Mode: True
Deployed using Docker: False
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'Label Printer', 'slug': 'samplelabel', 'version': '0.2'}, {'name': 'Brother Labels', 'slug': 'brother', 'version': '0.6.0'}]

VS

Version Information:

InvenTree-Version: 0.12.0 dev
Django Version: 3.2.18

Database: postgresql
Debug-Mode: True
Deployed using Docker: False
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}]

Relevant log output

No response

@T0jan T0jan added bug Identifies a bug which needs to be addressed question This is a question triage:not-checked Item was not checked by the core team labels May 26, 2023
@SchrodingersGat SchrodingersGat added order Related to purchase orders / sales orders pricing Pricing functionality and removed triage:not-checked Item was not checked by the core team labels May 26, 2023
@SchrodingersGat
Copy link
Member

This was not a planned regression, I'll have to look into the behaviour.

In terms of moving forward I'd like the user to be able to have controls over the process. The line item price shouldn't update without specific user intervention. Maybe a "refresh" button in the form?

I think auto calculation is good when the line item is first calculated..

There are a lot of other outstanding issues which have my attention currently. Do you want to take a look at this?

@T0jan
Copy link
Author

T0jan commented May 26, 2023

@SchrodingersGat I can't commit to working on it as I don't know if I find time to work on this. If I do I will come back here and let you know.

@SchrodingersGat
Copy link
Member

Fair enough!

@SchrodingersGat SchrodingersGat added this to the 0.12.0 milestone May 26, 2023
@SchrodingersGat SchrodingersGat modified the milestones: 0.12.0, 0.13.0 Jun 20, 2023
@SchrodingersGat SchrodingersGat added user interface User interface Platform UI Related to the React based User Interface labels Oct 17, 2023
@SchrodingersGat SchrodingersGat modified the milestones: 0.13.0, horizon Oct 17, 2023
@SchrodingersGat
Copy link
Member

Removing this from the next release as it likely should be implemented in the new react UI

@chille
Copy link

chille commented Jan 19, 2024

I have the same problem when working working with Purchase Orders. I'm currently trying to migrate away from LibreOffice Spreadsheets, but can't because the price in the Purchase Order is unreliable because it is hardcoded into each Line Item and not pulled from Supplier Part Pricing.

I suggest the following solution

Add a configuration to a Purchase Order where the user can select between two different options:

  1. Use Supplier Part Pricing (I suggest that this will be the default option in the future)
  2. Specifiy a price on each Line Item

When the first option is selected the following things will happen:

  1. The UI will disable the "Purchase Price" field when editing a Line Item and also tell the user why.
  2. The backend will check if the Purchase Order is configured to use Supplier Part Pricing and if so do the following:
    • Include the correct purchase_price in /api/order/po-line
    • Report an error if changes are made to the purchase_price field in /api/order/po-line

When changing configuration from "Supplier Part Pricing" to "Specifiy a price on each Line Item" then the current Supplier Part Pricing should be imported into each Line Item.

When "Issue Order" is pressed there should also be an option to change the pricing configuration and import and lock all prices.

When "Specifiy a price on each Line Item" is used it might be a good idea to have an "Import current prices" button.

It could maybe be a good idea to let the API always include both the Line Item price and the Supplier Part Pricing and let the UI show a warning if there is a discrepancy between the two prices.

@Mimosa-oceanis
Copy link

Hi, I don't know if it the right place for it. But it seems to be linked.
Here is my configuration:

Version Information:

InvenTree-Version: 0.14.5
Django Version: 4.2.11
Commit Hash: b32f081
Commit Date: 2024-04-18

Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-4.19.0-25-cloud-amd64-x86_64-with
Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.0.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]

So the problem is in POs, when I have parts with price break in Euro, I have the PO in Euro and I add the parts saying the price should be in Euro too. But as my system is in CHF, if I'm not adding the price manually but keep the auto pricing toggle on, the value is converted into CHF while it is set in Euro.

Price break of the parts.
Capture d’écran 2024-04-19 à 15 05 22

Setting the currency for the order in order and keep the auto pricing option
Capture d’écran 2024-04-19 à 15 05 39

What is calculating as result in the PO.
Capture d’écran 2024-04-19 à 15 05 51

@SchrodingersGat
Copy link
Member

@Mimosa-oceanis thanks for reporting - looks like there was a bug here - fix incoming in #7075

@matmair
Copy link
Member

matmair commented Apr 23, 2024

@SchrodingersGat can we close this now that #7075 is released?

@wolflu05
Copy link
Contributor

Also related to #6483

@SchrodingersGat
Copy link
Member

Yes, I believe this can be closed out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed order Related to purchase orders / sales orders Platform UI Related to the React based User Interface pricing Pricing functionality question This is a question user interface User interface
Projects
None yet
Development

No branches or pull requests

6 participants