Project

General

Profile

解析Bug #227

Delivery date cannot be less than input date

Added by Xihua Fan about 3 years ago. Updated about 1 year ago.

Status:
已关闭
Priority:
普通
Assignee:
Target version:
IT: Easytryck (Sweden) - v3.0
Start date:
10/12/2022
Due date:
10/14/2022
% Done:

100%

Estimated time:
8.00 h
Spent time:

Description

Task Details
  1. Currently Delivery date can be set < Input Date (see attachment)
  2. We should add some validation to set Delivery date >= Input Date dayas.
Input
  • Claim from Lee
Output
  • Report and Solution

Others


Files

Delivery Date Issue.png (274 KB) Delivery Date Issue.png Xihua Fan, 10/12/2022 10:40 AM
#2

Updated by Xihua Fan about 3 years ago

  • Subject changed from Delivery date should be greater than input date to Delivery date cannot be less than input date
  • Description updated (diff)
#3

Updated by Xihua Fan about 3 years ago

  • Description updated (diff)
#4

Updated by Zhongbao Ye about 3 years ago

  • Status changed from 进行中 to 已关闭
  • % Done changed from 0 to 100

Output(2022/10/13)
1. 订单创建时,delivery date 需大于当前时间
2. 订单修改时,delivery date 需大于等于订单创建时间
3. 后端抛出异常后,前端js控制订单界面维持原状态,不关闭当前编辑的订单界面。

order/ui/desktop/js/order.js

old:
complete:function(b,c){e.orderGrid("closeEditor",{editor:d,row:a,isSave:!0,data:null,updateRows:!1});
new:
complete:function(b,c){if(!b.responseJSON.success){return 0;}e.orderGrid("closeEditor",{editor:d,row:a,isSave:!0,data:null,updateRows:!1});

protected/actions/order/SaveByAjaxAction.php:run()

try {

// The delivery date should be greater than the order input date
if ($orderRetailerShipTime) {

    if ($orderId) {
        $orderInfo = Order::model()->findByPk($orderId);

        $createDate = $orderInfo->create_time;

    } else {

        $createDate = time();
    }

    if (strtotime($orderRetailerShipTime) < strtotime(date("Y-m-d", $createDate))) {
        throw new Exception("Delivery date cannot be less than input date");
    }
}

}
#5

Updated by Xihua Fan about 1 year ago

  • Target version set to v3.0

Also available in: Atom PDF