feat(입출고): 봉투·백 표에서 단가·무게·은 열 제거
봉투·백에는 단가·무게·은이 없어 표에서 네 열을 뺀다. 전에 넣은 값은 숨은 칸으로 저장 때 그대로 보내 지우지 않는다. 새 발주서·발주서 화면·발주 메일의 단가 미입력 안내에서도 봉투·백을 뺀다. 은 칸이 없는 줄에서 그룹을 바꿔도 색상 표시가 덮이지 않게 고친다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -126,6 +126,10 @@ class ProductValueTests(unittest.TestCase):
|
||||
self.assertEqual((t["amount"], t["missing_price"], t["pp_kg"], t["silver_g"]), (D("8550.00"), 1, D("2.45"), D("12.25")))
|
||||
empty = s.order_totals([{"qty": 5}]) # 004 전 발주서(값 칸 없음)
|
||||
self.assertEqual((empty["amount"], empty["missing_price"], empty["pp_kg"], empty["silver_g"]), (None, 1, None, None))
|
||||
# 봉투·백은 단가가 원래 없음 — "단가 미입력" 안내에 안 잡힘
|
||||
bag = {"qty": 5, "unit_price": None, "item_name": "미라클백 2.5L"}
|
||||
self.assertEqual(s.order_totals([bag])["missing_price"], 0)
|
||||
self.assertEqual(s.order_totals([bag, {"qty": 5, "unit_price": None, "item_name": "통"}])["missing_price"], 1)
|
||||
|
||||
def test_parse_and_validate(self):
|
||||
from decimal import Decimal as D
|
||||
|
||||
@@ -439,9 +439,14 @@ def body(c):
|
||||
assert 'data-key="boxes_per_pallet"' in bag_row and 'data-key="lid_per_box"' not in bag_row
|
||||
assert 'data-key="boxes_per_pallet"' not in box_row and 'data-key="lid_per_box"' in box_row
|
||||
assert panel.index('data-code="%s"' % BAG) < panel.index("일반 상품") < panel.index('data-code="%s"' % BOX)
|
||||
# 봉투·백 표엔 단가·무게·은 칸이 없다(일반 상품 표에만) — 전에 넣은 값은 숨은 칸으로 남아 저장해도 안 지워짐
|
||||
assert panel.count("단가(원)</th>") == 1 and panel.count("은(g/개)</th>") == 1
|
||||
assert 'class="io-ag"' not in bag_row and 'io-ag' not in bag_row and 'io-in-num" data-key="unit_price"' not in bag_row
|
||||
assert 'io-in-num" data-key="unit_price"' in box_row
|
||||
r = c.post("/inout/settings/products/save", headers={"X-Inout-Options": "1"}, json={"rows": [
|
||||
{"code": BAG, "unit_price": "", "weight_g": "", "silver_pct": "", "body_per_box": "1,000", "boxes_per_pallet": "40"}]})
|
||||
{"code": BAG, "unit_price": "1500", "weight_g": "", "silver_pct": "", "body_per_box": "1,000", "boxes_per_pallet": "40"}]})
|
||||
assert r.status_code == 200 and r.json()["ok"], r.text
|
||||
assert 'type="hidden" data-key="unit_price" value="1,500"' in c.get("/inout/settings?panel=1").text
|
||||
item = c.get("/inout/api/items?q=" + BAG).json()["items"][0]
|
||||
assert (item["is_bag"], item["body_per_box"], item["lid_per_box"], item["boxes_per_pallet"]) == (True, 1000, None, 40)
|
||||
r = c.post("/inout/settings/products/save", headers={"X-Inout-Options": "1"}, json={"rows": [
|
||||
|
||||
Reference in New Issue
Block a user