|
@@ -213,8 +213,8 @@ class InvoiceItem extends Base{
|
|
|
$listValid = Validate::rule([
|
|
|
"itemId|发票明细ID"=>'require|number|gt:0',
|
|
|
'code|订单编码' => 'require|max:20',
|
|
|
- 'num|数量' => 'require|float|gt:0',
|
|
|
- 'good_price|商品价格' => 'require|float|gt:0',
|
|
|
+ 'num|数量' => 'float|gt:0',
|
|
|
+ 'good_price|商品价格' => 'float|gt:0',
|
|
|
'total_amount|总金额' => 'require|float|gt:0',
|
|
|
'remark|备注' =>'max:255',
|
|
|
]);
|
|
@@ -265,8 +265,8 @@ class InvoiceItem extends Base{
|
|
|
'code'=>$v['code'],
|
|
|
'spuCode'=>$orderInfo[$itemArr[$v['itemId']]['invoiceCode'].$v['code']]['goodNo'],
|
|
|
'good_name'=>$orderInfo[$itemArr[$v['itemId']]['invoiceCode'].$v['code']]['goodName'],
|
|
|
- 'num'=>$v['num'],
|
|
|
- 'good_price'=>$v['good_price'],
|
|
|
+ 'num'=>$v['num']??1,
|
|
|
+ 'good_price'=>$v['good_price']??$v['total_amount'],
|
|
|
'total_amount'=>$v['total_amount'],
|
|
|
'tax_diff'=> $tax_diff,
|
|
|
'cat_diff'=>$cat_diff,
|