[FIX][13.0]stock_account: Fix stock valuation layer#339
Open
lathuat1997 wants to merge 2 commits intoViindoo:13.0from
Open
[FIX][13.0]stock_account: Fix stock valuation layer#339lathuat1997 wants to merge 2 commits intoViindoo:13.0from
lathuat1997 wants to merge 2 commits intoViindoo:13.0from
Conversation
e3e9c13 to
1767d83
Compare
lathuat1997
commented
Sep 29, 2022
|
|
||
|
|
||
| def _prepare_out_svl_vals(move, quantity, unit_cost, product, value=0.0, cost_method=False): | ||
| def _prepare_out_svl_vals(move, quantity, unit_cost, product, value=0.0): |
Author
There was a problem hiding this comment.
chỉnh sửa lại hàm này, không cần truyền vào cost_method vì đó chính là cost_method của product
Comment on lines
+169
to
+175
| old_price = history_lines[h_index-1]["cost"] if h_index > 0 else price_history_rec["cost"] | ||
| if float_compare(price_history_rec["cost"], old_price, precision_digits=precision_price): | ||
| if have_qty: | ||
| svl_vals = _prepare_man_svl_vals( | ||
| price_history_rec, previous_price, previous_qty, company, product) | ||
| price_history_rec, old_price, previous_qty, company, product) | ||
| svl_man_vals_list.append(svl_vals) | ||
| old_price = price_history_rec["cost"] |
Author
There was a problem hiding this comment.
Khi sinh ra định giá tồn kho do việc điều chỉnh giá thủ công, dựa vào chênh lệch giá giữa các bản ghi trong product.price.history chứ không dựa vào previous_price (không quan tâm previous_price được tính theo công thức nào)
Comment on lines
+188
to
194
| valuation_price_unit = move["price_unit"] | ||
| if product.cost_method == 'standard': | ||
| valuation_price_unit = price_history_rec["cost"] | ||
| svl_vals = _prepare_in_svl_vals( | ||
| move, move["product_qty"], move["price_unit"], product, is_dropship) | ||
| move, move["product_qty"], valuation_price_unit, product, is_dropship) | ||
| svl_in_vals_list.append(svl_vals) | ||
| previous_qty = total_qty |
Author
There was a problem hiding this comment.
Nếu sản phẩm được định giá theo phương pháp "Giá tiêu chuẩn" thì khi sinh ra định giá tồn kho phải lấy giá trên sản phẩm tại thời điểm đó (giá trong bảng product.price.history) chứ không dựa vào đơn giá trên stock.move
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.