Commit 12a171ab by 朱继来

temp

parent f9da534e
......@@ -245,6 +245,21 @@ function getSelfStock($goods_id)
}
}
// 调用财务系统接口判断是否能修改发票
function isChangeInvoice($order_sn)
{
$url = Config('website.finance-self-invoice-url');
$data['order_sn'] = $order_sn;
$res = json_decode(curlApi($url, $data, 'POST'), true);
if ($res['err_code'] == 0) {
return true;
} else {
return false;
}
}
Class OrderController extends Controller
{
// 首页
......@@ -1156,7 +1171,8 @@ Class OrderController extends Controller
$data['operator_id'] = $request->user->userId;
$update_url = Config('website.api_domain').'order/updateOrderInvoice';
echo '<pre>';
print_r(curlApi($update_url, $data, 'POST'));
$update = json_decode(curlApi($update_url, $data, 'POST'), true);
if ($update['err_code'] == 0) {
......
......@@ -68,4 +68,7 @@ return [
// 获取自营商品库存
'self-stock-url' => 'http://footstone.liexin.net/webapi/goods_details?sku_id=',
// 财务系统接口地址 (自营发票)
'finance-self-invoice-url' => 'http://192.168.1.97/webapi/checkOrderBillStatus',
];
......@@ -221,7 +221,9 @@
<a href="/changeInvoice/{{$order_info['order_id']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'self' && !$extend)
@if(in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms))
<?php $isChangeInvoice = App\Http\Controllers\isChangeInvoice($order_info['order_sn']); ?>
<!-- in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms) -->
@if ($isChangeInvoice)
<a href="/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}" class="btn btn-success btn-sm changeBtn">更改发票</a>
@endif
@elseif (isset($_REQUEST['tags']) && $_REQUEST['tags'] == 'erp')
......
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