ForgeFlow / stock-rma

Stock RMA
GNU Affero General Public License v3.0
38 stars 41 forks source link

[FIX] rma_sale: fix _get_price_unit to handle dropship cases #540

Open AlexPForgeFlow opened 4 weeks ago

AlexPForgeFlow commented 4 weeks ago

Take negative valuation layers, as are to customers, and we handle dropship cases where will have negative and positive layers. Up to now with dropship orders, sums from valuation layers were 0 and div by 0 error was raised.

codecov-commenter commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.80%. Comparing base (53bb77a) to head (93b827f). Report is 3 commits behind head on 16.0.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540/graphs/tree.svg?width=650&height=150&src=pr&token=hagShlnibr&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow)](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow) ```diff @@ Coverage Diff @@ ## 16.0 #540 +/- ## ========================================== + Coverage 80.71% 80.80% +0.08% ========================================== Files 151 159 +8 Lines 5295 5387 +92 Branches 856 868 +12 ========================================== + Hits 4274 4353 +79 - Misses 783 793 +10 - Partials 238 241 +3 ``` | [Files with missing lines](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow) | Coverage Δ | | |---|---|---| | [rma\_sale/models/rma\_order\_line.py](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540?src=pr&el=tree&filepath=rma_sale%2Fmodels%2Frma_order_line.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow#diff-cm1hX3NhbGUvbW9kZWxzL3JtYV9vcmRlcl9saW5lLnB5) | `72.58% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow). Last update [2e9bf62...93b827f](https://app.codecov.io/gh/ForgeFlow/stock-rma/pull/540?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ForgeFlow).