Commit e20b8e73 by LJM
parents 366ed250 b85d3ca1
......@@ -53,7 +53,7 @@ class OrderController extends AdminController
$user = request()->user;
// dump(PermService::getUserPerms());
return Grid::make(new Order(), function (Grid $grid) {
$grid->model()->rule(Order::$ruleViewList)->with("scmUser")->orderBy('order_id', 'desc');
$grid->model()->rule(Order::$ruleViewList)->with("scmUser")->with("order_price")->orderBy('order_id', 'desc');
$grid->fixColumns(1,2);//固定列
// $grid->showColumnSelector();//开启字段选择器功能
// 在 display 回调中使用
......@@ -73,7 +73,22 @@ class OrderController extends AdminController
});
$grid->column('scmUser.name',admin_trans('scm-user.fields.name'));
$grid->column('order_amount')->help('订单详情里-结算信息的“运费”“支付手续费”“其他费用”为空时;应付金额一栏为“待确认”');
$grid->column('order_price',"应付金额")->display(function ($order_price) {
$otherAmount = 0;
foreach($order_price->toArray() as $key=>$val ){
if(in_array($val["price_type"],[3,5])){
$otherAmount += $val["price"];
}
}
if($otherAmount == 0){
return "待确认";
}else{
return decimal_number_format_usd($this->order_amount+$otherAmount);
}
});
$grid->column('order_pay_type')->using(admin_trans('order.options.order_pay_type'))->sortable();
$grid->column('order_user_pay_type',admin_trans("order.fields.order_user_pay_type"))->display(function () {
return Arr::get(admin_trans("order.options.order_user_pay_type"),$this->order_user_pay_type,"");
......
......@@ -30,7 +30,7 @@ class HandOrderListEStatus extends Form implements LazyRenderable
if($orderInfo["status"] <= Order::$STATUS_FORAMT["待审核"] ){
return $this->response()->error(admin_trans("order.return_msg.50001"))->refresh();
}
//dd($order_id,$status);
Order::updateOrder(["order_id"=>$order_id],["status"=>$status]);
return $this->response()->success('order.return_msg.50000')->refresh();
}
......
......@@ -156,7 +156,7 @@ class OrderService extends BaseService
}
}else{
if(in_array($insertReturnItemData["type"],[1,2]) && $insertReturnItemData["return_price"] || $insertReturnItemData["return_num"]){
if(in_array($insertReturnItemData["type"],[1,2]) && $insertReturnItemData["return_price"] && $insertReturnItemData["return_num"]){
$createOrEdit = true;
}
}
......@@ -172,6 +172,7 @@ class OrderService extends BaseService
//修改订单总金额
self::pullOrderAmount($order_id);
//修改订单备注
if($order_remark){
Order::updateOrder(["order_id"=>$order_id],[
......@@ -191,9 +192,11 @@ class OrderService extends BaseService
//拉取订单明细金额 回写订单主表
public static function pullOrderAmount($order_id=0){
$amount = OrderItem::getOrderTotalAmount($order_id);
$orderInfo = Order::getOne($order_id);
Order::updateOrder(["order_id"=>$order_id],[
"order_amount"=>$amount,
]);
OrderPrice::updateOrderAmount($order_id,$orderInfo["order_sn"]??"",$amount);
}
......
......@@ -102,6 +102,7 @@ class Order extends BaseModel
return $orderInfo ? $orderInfo->toArray() : [];
}
//取消
public static function canelOrder($orderId=0){
return self::where("order_id",$orderId)->update([
......
......@@ -61,4 +61,17 @@ class OrderPrice extends Model
}
//
public static function updateOrderAmount($orderId,$orderSn,$orderAmount=0){
self::updateOrCreate([
"order_id"=>$orderId,
"price_type"=>self::$PRICE_TYPE_LIST["货款"],
],[
"order_sn"=>$orderSn,
"price"=>decimal_number_format($orderAmount),
"currency"=>2,
"create_time"=>time(),
]);
}
}
......@@ -10,6 +10,7 @@ return [
'是否确认审核' => 'Do you confirm the audit',
'审核成功' => 'Successful audit',
'是否确认反审核' => 'Whether to confirm counteraudit',
'待确认' => 'To be confirmed',
],
'fields' => [
......
......@@ -10,6 +10,7 @@ return [
'是否确认审核' => '是否确认审核',
'审核成功' => '是否确认审核',
'是否确认反审核' => '是否确认审核',
'待确认' => '待确认',
],
'fields' => [
......
<table>
<table border="1">
<tr>
<td style="font-size: 16px;font-weight: bold">SEMOUR ELECTRONICS CO.,LIMITED</td>
<td colspan="2">
<img src="{{public_path('assets/images/excel-logo.png')}}" width="80" height="20" style="width: 80px">
</td>
<td colspan="8" style="font-size: 16px;font-weight: bold;">SEMOUR ELECTRONICS CO.,LIMITED</td>
</tr>
<tr>
<td>Flat Rm 1210, 12/F Sunbeam Centre #27, Shing Yip Street, Kwun Tong, Kowloon Hong Kong</td>
<td colspan="10" style="text-align:center">Flat Rm 1210, 12/F Sunbeam Centre #27, Shing Yip Street, Kwun Tong, Kowloon Hong Kong</td>
</tr>
<tr>
<td>SELLER /CONTACT:Joanna Email:Joanna@ichunt.com Tel: (+86)755-3580 8309 Fax: (+86)755-3580 0650 Mob: +8613600403130(业务员信息)</td>
<td colspan="10" style="text-align:center">
SELLER /CONTACT:Joanna Email:Joanna@ichunt.com Tel: (+86)755-3580 8309 Fax: (+86)755-3580 0650 Mob:
+8613600403130
</td>
</tr>
<tr>
<td style="font-size: 16px;font-weight: bold">COMMERCIAL INVOICE</td>
<td colspan="10" style="text-align:center;font-size: 16px;font-weight: bold;">Proforma Invoice</td>
</tr>
</table>
......
<table border="1">
<tr>
<td rowspan="4">
<img src="./assets/images/logo.png" width="50" height="50" >
<td colspan="2">
<img src="{{public_path('assets/images/excel-logo.png')}}" width="80" height="20" style="width: 80px">
</td>
<td colspan="8" style="font-size: 16px;font-weight: bold;">SEMOUR ELECTRONICS CO.,LIMITED</td>
</tr>
<tr>
<td colspan="10">SEMOUR ELECTRONICS CO.,LIMITED</td>
</tr>
<tr>
<td colspan="10">Flat Rm 1210, 12/F Sunbeam Centre #27, Shing Yip Street, Kwun Tong, Kowloon Hong Kong</td>
<td colspan="10" style="text-align:center">Flat Rm 1210, 12/F Sunbeam Centre #27, Shing Yip Street, Kwun Tong, Kowloon Hong Kong</td>
</tr>
<tr>
<td colspan="10">
<td colspan="10" style="text-align:center">
SELLER /CONTACT:Joanna Email:Joanna@ichunt.com Tel: (+86)755-3580 8309 Fax: (+86)755-3580 0650 Mob:
+8613600403130
</td>
</tr>
<tr>
<td colspan="10">Proforma Invoice</td>
<td colspan="10" style="text-align:center;font-size: 16px;font-weight: bold;">Proforma Invoice</td>
</tr>
</table>
<table border="1">
<tbody>
<tr>
<td width="8%">Ship to:</td>
<td width="8%" style="font-weight: bold;">Ship to:</td>
<td width="20%">
{{@$ship["consignee"]}}
</td>
<td width="8%">Bill to:</td>
<td width="8%" style="font-weight: bold;">Bill to:</td>
<td width="20%">{{@$bill["consignee"]}}</td>
<td>INV No.</td>
<td>Date:</td>
<td style="font-weight: bold;">INV No.</td>
<td style="font-weight: bold;">Date:</td>
<!-- <td>{{@$info["sn"]}}</td>-->
<!-- <td>Date:</td>-->
<!-- <td>{{date("Y-m-d")}}</td>-->
</tr>
<tr>
<td>Company Name:</td>
<td style="font-weight: bold;">Company Name:</td>
<td>{{@$ship["company_name"]}}</td>
<td>Company Name:</td>
<td style="font-weight: bold;">Company Name:</td>
<td>{{@$bill["company_name"]}}</td>
<td>{{@$info["sn"]}}</td>
<td>{{date("Y-m-d")}}</td>
</tr>
<tr>
<td rowspan="2">Address:</td>
<td rowspan="2">{{@$ship["country_name"]}} {{@$ship["province"]}} {{@$ship["city"]}} {{@$ship["detail_address"]}}</td>
<td rowspan="2">Address:</td>
<td rowspan="2" style="font-weight: bold;">Address:</td>
<td rowspan="2" >{{@$ship["country_name"]}} {{@$ship["province"]}} {{@$ship["city"]}} {{@$ship["detail_address"]}}</td>
<td rowspan="2" style="font-weight: bold;">Address:</td>
<td rowspan="2" style="width:100px;word-wrap: break-word">{{@$bill["country_name"]}} {{@$bill["province"]}}
{{@$bill["city"]}} {{@$bill["detail_address"]}}
</td>
<td>Payment terms:</td>
<td>Delivery terms:</td>
<td style="font-weight: bold;">Payment terms:</td>
<td style="font-weight: bold;">Delivery terms:</td>
<!-- <td>100%advance</td>-->
<!-- <td>-->
<!-- <td>Delivery terms:</td>-->
......@@ -67,18 +64,18 @@
<tr>
<td>Tel:</td>
<td style="font-weight: bold;">Tel:</td>
<td>{{@$ship["phone"]}}</td>
<td>Tel:</td>
<td style="font-weight: bold;">Tel:</td>
<td>{{@$bill["phone"]}}</td>
<td>Buyer:</td>
<td>Courier Account No.</td>
<td style="font-weight: bold;">Buyer:</td>
<td style="font-weight: bold;">Courier Account No.</td>
</tr>
<tr>
<td>Attn:</td>
<td style="font-weight: bold;">Attn:</td>
<td>{{@$ship["consignee"]}}</td>
<td>Attn:</td>
<td style="font-weight: bold;">Attn:</td>
<td>{{@$bill["consignee"]}}</td>
<td>
@if(!empty($info["orderList"]["scm_user"]))
......@@ -96,15 +93,15 @@
<table border="1">
<tbody>
<tr>
<td width="100">Slno</td>
<td>CUSTOMER P/N</td>
<td>Manufacturer</td>
<td>Description</td>
<td>QTY(Total)</td>
<td>UNIT</td>
<td>UNIT PRICE</td>
<td>CURRENCY</td>
<td>AMOUNT</td>
<td width="100" style="font-weight: bold;">Slno</td>
<td style="font-weight: bold;">CUSTOMER P/N</td>
<td style="font-weight: bold;">Manufacturer</td>
<td style="font-weight: bold;">Description</td>
<td style="font-weight: bold;">QTY(Total)</td>
<td style="font-weight: bold;">UNIT</td>
<td style="font-weight: bold;">UNIT PRICE</td>
<td style="font-weight: bold;">CURRENCY</td>
<td style="font-weight: bold;">AMOUNT</td>
</tr>
@if(!empty($info["orderList"]["order_items"]))
@foreach($info["orderList"]["order_items"] as $k=>$item)
......@@ -122,18 +119,18 @@
@endforeach
@endif
<tr>
<td colspan="8">Bank Charge</td>
<td colspan="8" style="font-weight: bold;">Bank Charge</td>
<td>{{$info["orderList"]["payServiceFee_format"] ?? ""}}</td>
</tr>
<tr>
<td colspan="8">Freight Cost</td>
<td colspan="8" style="font-weight: bold;">Freight Cost</td>
<td>{{$info["orderList"]["carriage_format"] ?? ""}}</td>
</tr>
<tr>
<td colspan="1">TOTAL:</td>
<td colspan="1" style="font-weight: bold;">TOTAL:</td>
<td colspan="3"></td>
<td colspan="1">{{$info["orderList"]["total_qty"] ?? ""}}</td>
<td colspan="3">Total Amount</td>
<td colspan="3" style="font-weight: bold;">Total Amount</td>
<td colspan="1">{{$info["orderList"]["total_amount_format"] ?? ""}}</td>
</tr>
</tbody>
......@@ -142,7 +139,7 @@
<table style="table-layout: fixed;" border="1">
<tbody>
<tr >
<td colspan="9" style="word-break: break-all; word-wrap:break-word;width: 100%;">Remark:1.Once received the goods, please sign on the invoice and packing list and send back the scan copy for record, if we didn't receive any feedback with in 3 days we will not entertain any claim regarding this shipment.2.All bank fees are the responsibility of the customer.</td>
<td colspan="9" style="word-break: break-all; word-wrap:break-word;width: 100%; height: 60px;font-weight: bold;">Remark:1.Once received the goods, please sign on the invoice and packing list and send back the scan copy for record, if we didn't receive any feedback with in 3 days we will not entertain any claim regarding this shipment.2.All bank fees are the responsibility of the customer.</td>
</tr>
</tbody>
</table>
......@@ -152,22 +149,22 @@
<td>&nbsp;</td>
</tr>
<tr>
<td>Bank Information</td>
<td style="font-weight: bold;height: 24px;line-height: 24px">Bank Information</td>
</tr>
<tr>
<td> Bank Name HSBC Hong Kong</td>
<td style="font-weight: bold;height: 24px;line-height: 24px"> Bank Name HSBC Hong Kong</td>
</tr>
<tr>
<td> Bank address 1 Queen's Road Central, Hong Kong</td>
<td style="font-weight: bold;height: 24px;line-height: 24px"> Bank address 1 Queen's Road Central, Hong Kong</td>
</tr>
<tr>
<td> Swift Code HSBCHKHHHKH</td>
<td style="font-weight: bold;height: 24px;line-height: 24px"> Swift Code HSBCHKHHHKH</td>
</tr>
<tr>
<td> Company Name SEMOUR ELECTRONICS CO., LIMITED</td>
<td style="font-weight: bold;height: 24px;line-height: 24px"> Company Name SEMOUR ELECTRONICS CO., LIMITED</td>
</tr>
<tr>
<td> Account No 819-847187-838</td>
<td style="font-weight: bold;height: 24px;line-height: 24px"> Account No 819-847187-838</td>
</tr>
<tr>
......@@ -175,26 +172,26 @@
</tr>
<tr>
<td>Terms &amp; Conditions</td>
<td style="font-weight: bold;height: 20px;">Terms &amp; Conditions</td>
</tr>
<tr>
<td>1.Your order is NCNR.</td>
<td height="20">1.Your order is NCNR.</td>
</tr>
<tr>
<td>2.All Claims of shortage or shipment errors or shipment damage must be made within 15 days of after
<td height="20">2.All Claims of shortage or shipment errors or shipment damage must be made within 15 days of after
delivery.
</td>
</tr>
<tr>
<td>3.Our liability shall be limited to the invoiced value of the materials or its replacement.</td>
<td height="20">3.Our liability shall be limited to the invoiced value of the materials or its replacement.</td>
</tr>
<tr>
<td>4.Parts are warranty 6 month form, fit, and function guarantee. All returns must be authorized by our sales
<td height="20">4.Parts are warranty 6 month form, fit, and function guarantee. All returns must be authorized by our sales
department within 6 month of receipts of shipment.
</td>
</tr>
<tr>
<td>5.VAT and Bank transfer charger is excluded in the invoice amount. Buyer will be responsible for TAX and
<td height="20">5.VAT and Bank transfer charger is excluded in the invoice amount. Buyer will be responsible for TAX and
Bank Charges if there is any.
</td>
</tr>
......
<table>
<table border="1">
<tr>
<td style="font-size: 16px;font-weight: bold">SEMOUR ELECTRONICS CO.,LIMITED</td>
<td colspan="2">
<img src="{{public_path('assets/images/excel-logo.png')}}" width="80" height="20" style="width: 80px">
</td>
<td colspan="8" style="font-size: 16px;font-weight: bold;">SEMOUR ELECTRONICS CO.,LIMITED</td>
</tr>
<tr>
<td>Flat Rm 1210, 12/F Sunbeam Centre #27, Shing Yip Street, Kwun Tong, Kowloon Hong Kong(固定地址)</td>
<td colspan="10" style="text-align:center">Flat Rm 1210, 12/F Sunbeam Centre #27, Shing Yip Street, Kwun Tong, Kowloon Hong Kong</td>
</tr>
<tr>
<td>SELLER /CONTACT:Joanna Email:Joanna@ichunt.com Tel: (+86)755-3580 8309 Fax: (+86)755-3580 0650 Mob: +8613600403130(业务员信息)</td>
<td colspan="10" style="text-align:center">
SELLER /CONTACT:Joanna Email:Joanna@ichunt.com Tel: (+86)755-3580 8309 Fax: (+86)755-3580 0650 Mob:
+8613600403130
</td>
</tr>
<tr>
<td style="font-size: 16px;font-weight: bold">PACKING LIST</td>
<td colspan="10" style="text-align:center;font-size: 16px;font-weight: bold;">Proforma Invoice</td>
</tr>
</table>
......@@ -108,7 +114,7 @@
@endforeach
@endif
<tr>
<td colspan="8">Bank Charge</td>
<td colspan="8" >Bank Charge</td>
<td>{{$info["orderList"]["payServiceFee_format"] ?? ""}}</td>
</tr>
<tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment