Merge branch 'feature/fin' into develop
# Conflicts: # app/common/service/FinReceiptService.php
This commit is contained in:
@@ -162,4 +162,20 @@ class FinPaymentApplyController extends BaseController
|
|||||||
$data['stock'] = array_values($stock);
|
$data['stock'] = array_values($stock);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作废
|
||||||
|
* @param Request $request
|
||||||
|
* @return \support\Response
|
||||||
|
*/
|
||||||
|
public function delete(Request $request)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$id = $request->input('id');
|
||||||
|
$raw = $this->service->delete($id);
|
||||||
|
return $this->success($raw);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return $this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -41,22 +41,6 @@ class FinReceiptController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 确认入账
|
|
||||||
* @param Request $request
|
|
||||||
* @return \support\Response
|
|
||||||
*/
|
|
||||||
public function delete(Request $request)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$id = $request->input('id');
|
|
||||||
$raw = $this->service->delete($id);
|
|
||||||
return $this->success($raw);
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
return $this->error($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show(Request $request)
|
public function show(Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
namespace app\common\model;
|
namespace app\common\model;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use support\Model;
|
use support\Model;
|
||||||
|
|
||||||
class FinPaymentApply extends Model
|
class FinPaymentApply extends Model
|
||||||
{
|
{
|
||||||
|
use SoftDeletes;
|
||||||
/**
|
/**
|
||||||
* The connection name for the model.
|
* The connection name for the model.
|
||||||
*
|
*
|
||||||
@@ -40,7 +42,7 @@ class FinPaymentApply extends Model
|
|||||||
/**
|
/**
|
||||||
* 允许自动填充模型字段
|
* 允许自动填充模型字段
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'created_at', 'updated_at', 'claimed_by',];
|
protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'created_at', 'updated_at', 'deleted_at', 'claimed_by', 'created_by',];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不允许自动填充模型字段
|
* 不允许自动填充模型字段
|
||||||
|
|||||||
@@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
namespace app\common\model;
|
namespace app\common\model;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
use support\Model;
|
use support\Model;
|
||||||
|
|
||||||
class FinReceipt extends Model
|
class FinReceipt extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
|
||||||
/**
|
/**
|
||||||
* The connection name for the model.
|
* The connection name for the model.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -214,6 +214,12 @@ class FinPaymentApplyService
|
|||||||
$query->whereDoesntHave('receipt');
|
$query->whereDoesntHave('receipt');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($param['scene'] == 'delete'){ //查询作废数据
|
||||||
|
$query->onlyTrashed();
|
||||||
|
}elseif ($param['scene'] == 'all'){ //查询包含作废数据的全量数据
|
||||||
|
$query->withTrashed();
|
||||||
|
}
|
||||||
|
|
||||||
if ((isset($param['scene']) && $param['scene'] == 'list') || empty($param['receipt_id'])) {
|
if ((isset($param['scene']) && $param['scene'] == 'list') || empty($param['receipt_id'])) {
|
||||||
return $query->orderBy('id','desc')->paginate($limit, ['*'], 'page', $page);
|
return $query->orderBy('id','desc')->paginate($limit, ['*'], 'page', $page);
|
||||||
}
|
}
|
||||||
@@ -271,4 +277,11 @@ class FinPaymentApplyService
|
|||||||
return $query->paginate($limit, ['*'], 'page', $page);
|
return $query->paginate($limit, ['*'], 'page', $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function delete($id)
|
||||||
|
{
|
||||||
|
$res = FinPaymentApply::where('id', $id)->delete();
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -233,12 +233,6 @@ class FinReceiptService
|
|||||||
$query->where('submit_files','!=','');
|
$query->where('submit_files','!=','');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($param['scene']) && $param['scene'] == 'delete'){ //查询作废数据
|
|
||||||
$query->onlyTrashed();
|
|
||||||
}elseif (isset($param['scene']) && $param['scene'] == 'all'){ //查询包含作废数据的全量数据
|
|
||||||
$query->withTrashed();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($param['scene']) && ($param['scene'] == 'list' ||$param['scene'] == 'pending')) {
|
if (isset($param['scene']) && ($param['scene'] == 'list' ||$param['scene'] == 'pending')) {
|
||||||
return $query->paginate($limit, ['*'], 'page', $page);
|
return $query->paginate($limit, ['*'], 'page', $page);
|
||||||
}
|
}
|
||||||
@@ -299,13 +293,6 @@ class FinReceiptService
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function delete($id)
|
|
||||||
{
|
|
||||||
$res = FinReceipt::where('id', $id)->delete();
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新:绑定收款记录,计算折让金额
|
* 更新:绑定收款记录,计算折让金额
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
|||||||
+2
-2
@@ -429,8 +429,8 @@ Route::group('/admin', function () {
|
|||||||
Route::any('/store', [app\common\controller\FinReceiptController::class, 'store']);
|
Route::any('/store', [app\common\controller\FinReceiptController::class, 'store']);
|
||||||
Route::any('/update', [app\common\controller\FinReceiptController::class, 'update']);
|
Route::any('/update', [app\common\controller\FinReceiptController::class, 'update']);
|
||||||
Route::any('/payment', [app\common\controller\FinReceiptController::class, 'payment']);
|
Route::any('/payment', [app\common\controller\FinReceiptController::class, 'payment']);
|
||||||
|
Route::any('/destroy', [app\common\controller\FinReceiptController::class, 'destroy']);
|
||||||
Route::any('/credit', [app\common\controller\FinReceiptController::class, 'credit']);
|
Route::any('/credit', [app\common\controller\FinReceiptController::class, 'credit']);
|
||||||
Route::any('/delete', [app\common\controller\FinReceiptController::class, 'delete']);
|
|
||||||
});
|
});
|
||||||
// 收款记录历史
|
// 收款记录历史
|
||||||
Route::group('/receipt/his', function () {
|
Route::group('/receipt/his', function () {
|
||||||
@@ -448,7 +448,7 @@ Route::group('/admin', function () {
|
|||||||
Route::any('/show', [app\common\controller\FinPaymentApplyController::class, 'show']);
|
Route::any('/show', [app\common\controller\FinPaymentApplyController::class, 'show']);
|
||||||
Route::any('/store', [app\common\controller\FinPaymentApplyController::class, 'store']);
|
Route::any('/store', [app\common\controller\FinPaymentApplyController::class, 'store']);
|
||||||
Route::any('/update', [app\common\controller\FinPaymentApplyController::class, 'update']);
|
Route::any('/update', [app\common\controller\FinPaymentApplyController::class, 'update']);
|
||||||
Route::any('/destroy', [app\common\controller\FinPaymentApplyController::class, 'destroy']);
|
Route::any('/delete', [app\common\controller\FinPaymentApplyController::class, 'delete']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 系统配置
|
// 系统配置
|
||||||
|
|||||||
Reference in New Issue
Block a user