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

adds sales order line item price #1545

Merged
merged 32 commits into from
May 7, 2021
Merged

Conversation

matmair
Copy link
Member

@matmair matmair commented May 4, 2021

As part of #1425

@SchrodingersGat
Copy link
Member

Looks like a great idea :)

@matmair
Copy link
Member Author

matmair commented May 5, 2021

not ready due to:

  • strange table layout
    grafik
  • pricing table/modal 'calculate price' button not working - looses part information

@matmair
Copy link
Member Author

matmair commented May 6, 2021

@SchrodingersGat @eeintech
Any idea where this strange layout can come from? I set the colspan but nothing seems to work.

@eeintech
Copy link
Contributor

eeintech commented May 6, 2021

@matmair Where is that modal view?

@matmair
Copy link
Member Author

matmair commented May 6, 2021

@eeintech the template is here

@eeintech
Copy link
Contributor

eeintech commented May 6, 2021

@matmair I imagine you want the cells to align between tables right?

You can edit the <td> tag with style='width:XX%' to set the column width percentage.

For instance, here is a 3 column table, with no headers:

<table class='table table-striped table-condensed'>
    <tr>
        <td style='width:40%'><b>{% trans 'Unit Cost' %}</b></td>
        <td style='width:30%'>Min: {% include "price.html" with price=min_unit_buy_price %}</td>
        <td style='width:30%'>Max: {% include "price.html" with price=max_unit_buy_price %}</td>
    </tr>
    <tr>
        <td><b>{% trans 'Total Cost' %}</b></td>
        <td>Min: {% include "price.html" with price=min_total_buy_price %}</td>
        <td>Max: {% include "price.html" with price=max_total_buy_price %}</td>
    </tr>
    <tr>
        <td colspan='3'>
            <span class='warning-msg'><i>{% trans 'No supplier pricing available' %}</i></span>
        </td>
    </tr>
</table>

And for the 2 columns header:

<table class='table table-striped table-condensed'>
    <tr>
        <td style='width:40%'><b>{% trans 'Unit Cost' %}</b></td>
        <td style='width:60%'>Min: {% include "price.html" with price=min_unit_buy_price %}</td>
    </tr>
    <tr>
        <td><b>{% trans 'Total Cost' %}</b></td>
        <td>Min: {% include "price.html" with price=min_total_buy_price %}</td>
    </tr>
    <tr>
        <td colspan='2'>
            <span class='warning-msg'><i>{% trans 'No supplier pricing available' %}</i></span>
        </td>
    </tr>
</table>

This gives me:

image

@eeintech
Copy link
Contributor

eeintech commented May 6, 2021

Also this might not be the cleanest way to do it in CSS, you may want to create your own class for this table and define the width there. Using the style inside the <td> tag overwrites any other CSS styling.

@matmair
Copy link
Member Author

matmair commented May 6, 2021

@eeintech yes exactly thank you

@matmair matmair marked this pull request as ready for review May 7, 2021 05:51
@matmair
Copy link
Member Author

matmair commented May 7, 2021

@SchrodingersGat this closes 2 tasks on #1425, I will tick them after this PR is merged

@SchrodingersGat
Copy link
Member

@matmair looks great, fantastic effort on this :)

I've had a bit of a play around, the only thing that jumps out at me - when you add a part to a sales order which has price breaks associated with it, should it automatically calculate the sale price based on the selected quantity?

@matmair
Copy link
Member Author

matmair commented May 7, 2021

@SchrodingersGat please set the following tasks in #1425 as done:

  • Implement "Sale Price" into sales order lines
  • Allow customization of sale price in quotation or sales order

I added the functionality to auto-set price if a pricebreak is set

@SchrodingersGat SchrodingersGat merged commit e47a8d6 into inventree:master May 7, 2021
@matmair matmair deleted the issue1425 branch May 7, 2021 14:06
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.

3 participants