Project

General

Profile

追加功能 #477

v4.0: Logistics - Shipping Cost Calculator

Added by Xihua Fan 6 months ago. Updated 5 months ago.

Status:
已关闭
Priority:
普通
Assignee:
Target version:
IT: Easytryck (Sweden) - v4.0
Start date:
06/23/2025
Due date:
07/04/2025
% Done:

100%

Estimated time:
50.00 h

Description

Background
  1. https://trello.com/c/ZRVr3ge2/21-11-%E8%BF%90%E8%B4%B9%E8%AE%A1%E7%AE%97%E6%A8%A1%E5%9D%97-shipping-cost-calculator
Task Details
  • 1. Shipping Cost Calculator
v4 coding standard:
  1. Git提交
    #xxx(redmine number): xxx(redmine title) - xxx(任意:补充内容)
      
  2. 代码规范
    2.1: 结构:Public -> Protected -> Private
    2.2: 其他代码规范同SBX
      
  3. MVCL的v3/v4物理分割
    3.1: v3/v4的代码分为两个文件,比如: order.php, order_v3.php
    3.2: system也分为两个文件,暂时只有一个user_v3
    - Note: front的$this->user在v4中会替换为$this->customer, 即v4中需要清除$this->user
    3.3: 代码中,区分v3/v4的调用,比如:new User_V3
     
  4. 前台代码
    twig, js, css (js, css尽量写在单独的css文件中)
     
  5. 后台代码
    MVCL (L:en,cn)
     
  6. 注释
    1. 类名:
      /**
       * xxx
       *
       * @copyright RedBlue-OTS 2024
       * @version v4
       *
       */
      
    2. 函数名:参数类型 + 返回值类型
          /**
           * xxx
           *
           * @param  xxx $xxx
           * @param  xxx $xxx
           * @return xxx
           */
      
Output
  • Report and Solution

Others


Related issues

Copied from 追加功能 #476: v4.0: Logistics - Cartons已关闭Junyi Zhang06/23/202506/30/2025

Actions
#1

Updated by Xihua Fan 6 months ago

#2

Updated by Xihua Fan 6 months ago

  • Due date changed from 06/30/2025 to 07/04/2025
#3

Updated by Junyi Zhang 6 months ago

Output (2025/08/01), (2025/07/07),(2025/07/01 - 2025/07/04):

DONE:
  1. Functions:
    1. 在运输主页模块添加“运费计算器”模块。
    2. 区域一(编辑shipping suppliers区域)(仅限桌面版):
      - 支持编辑不同国家/地区的运输供应商:目前,仅支持“CN”、“SK”作为位置国家/地区。(countries数据源取自admin country模块,且使用常量限制显示的国家)
      - 支持在同一运输供应商类型(express、air、train、boat、others)中重新排序,否则显示警告框并恢复排序。
      - 支持在同一运输供应商类型中添加新的运输供应商。
      - 支持使用不同货币编辑运输供应商成本价格:目前,CN => 人民币,SE => 瑞典克朗。
      - 单价 21kg- 含所有附加费和单价 21kg+ 含所有附加费的结果。所有附加费:(单价21kg+旺季附加费) * (1+燃油附加费/100)
    3. 运费计算器:根据区域二(CTN Parameters)或区域三(Total Parameters)计算运输供应商的总成本和交货时间。
      - 客户需要提供CTN参数或总参数
      - CTN参数验证:客户需要提供CTN毛重或CTN尺寸(长、宽、高)参数。
      - 总成本 = 总重量 * 单价 + (CTN)长度超尺寸(其中一边大于120)+ (CTN)整箱超尺寸(整箱尺寸大于300)+ (CTN)超重(总重量大于30)
    4. 权限:
      - 区域一(编辑shipping suppliers区域)仅允许display_shipping = 1的公司查看或编辑。
      - 区域二和区域三(运费计算器)允许所有客户查看和使用。
    5. 替换 v3 中hardcode的 TRACKING_TYPE_TEXT 和 CUSTOMER_SHIP_TO。
      - 由于 TRACKING_TYPE_TEXT 和 CUSTOMER_SHIP_TO 在 V3 中仍然使用,我们还将 v3 和 v4 中的“logistics”分别拆分为“logictic_v3”和“shipping”。
    6. 支持按货币计算总费用: (从 https://www.boc.cn/sourcedb/whpj/ 获取,取第一页的最新数据,取‘现汇买入价’)
      - 解析https://www.boc.cn/sourcedb/whpj/ 的html结构(参考SBX的scan函数),找到特定table的特定td,取得货币。
      - 在Currency后面显示当前汇率(此汇率是相对于货源国货币的汇率)
      - 报错机制:错误使用trigger_error抛在error.log中, 前端显示常规的alert。
      - 显示的currencies取自admin的currency模块,且在web/system/library/cart/currency.php中额外增加两个值: row(在https://www.boc.cn/sourcedb/whpj/网站中的行数), Chinese_title(用于校验当前所取的行是否是目标行)。
    7. Modify the extra charge(Length Over Size, Whole Over Size and Over Weight) rules in shipping cost calculator.(The following description: use A for Length Over Size, use B for Whole Over Size, use C for Over Weight )
      1. Only 'CN' calculate extra charge.(Since we only get 'CN' extra charge rules)
      2. 'Express'(DHL, UPS, FEDEX) type shipping supplier will take extra charge.
        1. DHL:
          - B always 0
          - A or C: A or C
          - A and C: A
        2. UPS:
          - A and B and C: B
          - A and B: B
          - A and C: A + C
          - B and C: B
        3. Fedex:
          - A and B and C: A + B
          - A and B: A + B
          - A and C: A
          - B and C: B + C

Database: 参考 #440

#4

Updated by Junyi Zhang 6 months ago

  • % Done changed from 0 to 70
#5

Updated by Junyi Zhang 5 months ago

  • Status changed from 新建 to 已关闭
  • % Done changed from 70 to 100

Also available in: Atom PDF