发票接口优化,发票后台无法编辑发票信息bug修复

This commit is contained in:
qinzexin 2025-07-01 18:26:23 +08:00
parent 28c957163b
commit 5f7627c987
12 changed files with 38238 additions and 20 deletions

View File

@ -47,7 +47,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tax_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tax_id" data-rule="required" class="form-control" name="row[tax_id]" type="text" value="">
<input id="c-tax_id" class="form-control" name="row[tax_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -51,7 +51,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tax_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tax_id" data-rule="required" class="form-control" name="row[tax_id]" type="text" value="{$row.tax_id|htmlentities}">
<input id="c-tax_id" class="form-control" name="row[tax_id]" type="text" value="{$row.tax_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -150,7 +150,7 @@ class Header extends Base
public function add(){
//敏感词过滤
$this->checkSensitivewords(["invoice_header"]);
// $this->checkSensitivewords(["invoice_header"]);
$user_id = 0;
$user = $this->auth->getUser();//登录用户
@ -202,7 +202,7 @@ class Header extends Base
*/
public function edit($ids = null){
//敏感词过滤
$this->checkSensitivewords(["name","idnum"]);
// $this->checkSensitivewords(["name","idnum"]);
$user_id = 0;
$user = $this->auth->getUser();//登录用户
@ -259,7 +259,7 @@ class Header extends Base
public function apply(){
$this->model = new Apply();
//敏感词过滤
$this->checkSensitivewords(["invoice_header"]);
// $this->checkSensitivewords(["invoice_header"]);
$user_id = 0;
$user = $this->auth->getUser();//登录用户

View File

@ -49,6 +49,7 @@ class Order extends BaseModel
'auth_time_text',
'reservation_time_text',
'finishtime_text',
'createtime_text',
'refundtime_text',
'auth_status_text',
'refundsendtime_text',
@ -56,6 +57,16 @@ class Order extends BaseModel
'invoice_status_text',
];
public function getCreatetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getInvoiceStatusList()
{
return ['0' => __('未申请'), '1' => __('申请中'), '2' => __('已开票')];
@ -2693,7 +2704,9 @@ class Order extends BaseModel
*/
public static function getHaveInvoiceApplyOrder($order_no,$check=true){
// $where = [self::STATUS_NOPAY,self::STATUS_PAYED];
$order = self::where('pay_no|order_no|id',$order_no)->where('status',"in",["9"])->where("sub_refundprice",">",0)->find();
// var_dump($order_no);
$order = self::where('pay_no|order_no|id', $order_no)->where('status',"in",["9"])->where("sub_refundprice",">",0)->find();
if(!$order)throw new \Exception("只有全部核销完成的订单才能申请发票!");
$detail = $order->detail;
if(!$detail)throw new \Exception("找不到订单详情!");

View File

@ -32,9 +32,20 @@ class Apply extends BaseModel
'apply_type_text',
'head_type_text',
'invoice_type_text',
'invoicingtime_text'
'invoicingtime_text',
'createtime_text',
];
public function getCreatetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStatusList()
@ -423,6 +434,7 @@ class Apply extends BaseModel
if ($alisa&&!$with) $model = $model->alias($alisa);
}
if ($alisa) $alisa = $alisa . '.';
// $alisa = '';
$tableFields = (new static)->getTableFields();
foreach ($tableFields as $fields)
{
@ -465,12 +477,13 @@ class Apply extends BaseModel
public static function applyList($page, $limit,$params=[]){
$with_field = [
'base'=>['*'],
"activityorders"=>['*'],
'user'=>['nickname',"avatar","mobile"],
"activityorders.detail"=>['*'],
];
// $alisa = (new self)->getWithAlisaName();
// $sort = "{$alisa}.id desc";
$alisa = (new self)->getWithAlisaName();
$sort = "{$alisa}.id desc";
$sort = "id desc";
// $sort = "id desc";
$serch_where = [];
$serch_where = array_merge($serch_where,$params);

View File

@ -28,11 +28,20 @@ class Header extends BaseModel
protected $append = [
'head_type_text',
'invoice_type_text',
'is_default_text'
'is_default_text',
'createtime_text',
];
public function getCreatetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getHeadTypeList()
{
return ['personal' => __('Head_type personal'), 'corporate' => __('Head_type corporate')];
@ -403,7 +412,7 @@ class Header extends BaseModel
// $alisa = (new self)->getWithAlisaName();
// $sort = "{$alisa}.id desc";
$sort = "id desc";
$sort = "is_default desc,id desc";
$serch_where = [];
$serch_where = array_merge($serch_where,$params);

View File

@ -0,0 +1,20 @@
<?php
namespace app\common\service;
/**
* 统计服务
*/
class Statistics
{
/** 活动相关统计
* @param $user_id
* @return void
*/
public static function activityStatistics($user_id = 0,$time=null){
}
}

View File

@ -69,7 +69,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tax_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tax_id" data-rule="required" class="form-control" name="row[tax_id]" type="text" value="">
<input id="c-tax_id" class="form-control" name="row[tax_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -83,7 +83,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tax_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tax_id" data-rule="required" class="form-control" name="row[tax_id]" type="text" value="{$row.tax_id|htmlentities}">
<input id="c-tax_id" class="form-control" name="row[tax_id]" type="text" value="{$row.tax_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -43,7 +43,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tax_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tax_id" data-rule="required" class="form-control" name="row[tax_id]" type="text" value="">
<input id="c-tax_id" class="form-control" name="row[tax_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -43,7 +43,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tax_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tax_id" data-rule="required" class="form-control" name="row[tax_id]" type="text" value="{$row.tax_id|htmlentities}">
<input id="c-tax_id" class="form-control" name="row[tax_id]" type="text" value="{$row.tax_id|htmlentities}">
</div>
</div>
<div class="form-group">

38163
public/api.html Normal file

File diff suppressed because it is too large Load Diff