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

「受注管理」で「商品追加」「商品削除」対応 #2030

Closed
wants to merge 7 commits into from

Conversation

trebla-on
Copy link
Contributor

@trebla-on trebla-on commented Jan 12, 2017

「受注管理」で「商品追加」「商品削除」を繰り返えした場合(3つ商品登録し、真ん中の2番目を削除→再度追加)、明細がおかしくなる。
#2023

■対応内容

  1. 商品削除の後にorder[OrderDetail]のインデックスをデクリメントを外しました
  2. 画面ロード時に次のorder[OrderDetail]インデックスを設定するようにロッジク入れました

{% else %}
{% set maxIndex = max(form.OrderDetails|keys) + 1 %}
{% endif %}
order_details_count = '{{ maxIndex }}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

' 'で囲むと、文字列として変数にセットされてしまいます。

Copy link
Contributor Author

@trebla-on trebla-on Jan 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もとのソース見ると文字列でしたのでそのままにしました

order_details_count = '{{ form.OrderDetails|length }}';

order_details_countはキーを作る時使ってますので数字、文字列でも大丈夫です

@trebla-on trebla-on changed the title [WIP] 「受注管理」で「商品追加」「商品削除」対応 「受注管理」で「商品追加」「商品削除」対応 Jan 12, 2017
@Yangsin Yangsin modified the milestone: 3.0.14 Jan 20, 2017
@chihiro-adachi
Copy link
Contributor

#2023 のパターンは解消されているのを確認できました。

本PRの影響かは不明ですが、複数配送時にshipment_itemが削除されない事象が発生します。

  • 複数配送を有効にする
  • 商品A, B, Cの受注を作成する(お届け先は一つ)
  • お届け先情報 -> 商品Bの個数に0を入力する
  • 受注情報を登録する

このとき、

  • order_detailは商品A、B
  • shipment_itemは商品A、B、C
    の状態になります。

ただし、計算結果を更新する -> 受注情報を登録する、の順に操作すると正しくshipment_itemは削除されます。

@trebla-on
Copy link
Contributor Author

こちらのPR #2053 はソースのほうが最新です
備考:PR#2053マージしたらこのPRマージする必要ないです

@trebla-on
Copy link
Contributor Author

trebla-on commented Jan 27, 2017

@chihiro-adachi
確認しました、編集の後shipment_item[0]をして受注情報を登録するとレーコドが残ります。
この問題は最新のソースでもでます。

@trebla-on
Copy link
Contributor Author

@chihiro-adachi
問題はコントローラの中でした、shipment_itemとshippingレーコドを削除するようにしました。
ご確認お願いします

@chihiro-adachi
Copy link
Contributor

@trebla-on
#2053 で本修正も含まれているのを確認しましたので、こちらのprはクローズします。

@Yangsin Yangsin added duplicate This issue or pull request already exists and removed Status: fix-me labels Mar 23, 2017
@Yangsin Yangsin modified the milestones: Not release, 3.0.14 Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants