update
This commit is contained in:
parent
6a3fc45e04
commit
be12b73d78
@ -12,9 +12,16 @@
|
||||
use app\common\model\finance\FinanceReceiptRecord;
|
||||
use app\common\model\project\Project;
|
||||
use app\common\model\supplier\Supplier;
|
||||
use think\App;
|
||||
|
||||
class FinancePaymentReceiptDifferenceController extends BaseAdminController
|
||||
{
|
||||
public function __construct(App $app)
|
||||
{
|
||||
parent::__construct($app);
|
||||
bcscale(2);
|
||||
}
|
||||
|
||||
//采购付款与收票差异
|
||||
public function procure(): \think\response\Json
|
||||
{
|
||||
@ -44,9 +51,9 @@
|
||||
//已收票金额
|
||||
$item['has_receipt_amount'] = FinanceReceiptRecord::where('contract_id', $item['id'])->where('contract_type', 1)->sum('invoice_amount');
|
||||
//收票未付款
|
||||
$item['has_receipt_not_payment_amount'] = ($item['has_receipt_amount'] - $item['has_payment_amount']) <= 0 ? 0 : $item['has_receipt_amount'] - $item['has_payment_amount'];
|
||||
$item['has_receipt_not_payment_amount'] = max(bcsub($item['has_receipt_amount'], $item['has_payment_amount']), 0);
|
||||
//付款未收票
|
||||
$item['has_payment_not_receipt_amount'] = ($item['has_payment_amount'] - $item['has_receipt_amount']) <= 0 ? 0 : $item['has_payment_amount'] - $item['has_receipt_amount'];
|
||||
$item['has_payment_not_receipt_amount'] = max(bcsub($item['has_payment_amount'], $item['has_receipt_amount']), 0);
|
||||
return $item;
|
||||
})->toArray();
|
||||
$count = ProcurementContract::field('id')->where($where)->count();
|
||||
@ -92,9 +99,9 @@
|
||||
//已收票金额
|
||||
$item['has_receipt_amount'] = FinanceReceiptRecord::where('contract_id', $item['id'])->where('contract_type', 2)->sum('invoice_amount');
|
||||
//收票未付款
|
||||
$item['has_receipt_not_payment_amount'] = ($item['has_receipt_amount'] - $item['has_payment_amount']) <= 0 ? 0 : $item['has_receipt_amount'] - $item['has_payment_amount'];
|
||||
$item['has_receipt_not_payment_amount'] = max(bcsub($item['has_receipt_amount'], $item['has_payment_amount']), 0);
|
||||
//付款未收票
|
||||
$item['has_payment_not_receipt_amount'] = ($item['has_payment_amount'] - $item['has_receipt_amount']) <= 0 ? 0 : $item['has_payment_amount'] - $item['has_receipt_amount'];
|
||||
$item['has_payment_not_receipt_amount'] = max(bcsub($item['has_payment_amount'], $item['has_receipt_amount']), 0);
|
||||
return $item;
|
||||
})->toArray();
|
||||
$count = SubcontractingContract::field('id')->where($where)->count();
|
||||
|
@ -14,6 +14,7 @@
|
||||
{
|
||||
public function lists(): \think\response\Json
|
||||
{
|
||||
bcscale(2);
|
||||
$params = $this->request->get(['page_no', 'page_size', 'contract_code', 'project_id']);
|
||||
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
|
||||
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
|
||||
@ -42,9 +43,9 @@
|
||||
//已开票金额
|
||||
$item['has_invoice_amount'] = FinanceInvoiceApply::where('contract_id', $item['id'])->sum('invoicing_amount');
|
||||
//开票未回款
|
||||
$item['has_invoice_not_refund_amount'] = ($item['has_invoice_amount'] - $item['has_refund_amount']) <= 0 ? 0 : $item['has_invoice_amount'] - $item['has_refund_amount'];
|
||||
$item['has_invoice_not_refund_amount'] = max(bcsub($item['has_invoice_amount'], $item['has_refund_amount']), 0);
|
||||
//回款未开票
|
||||
$item['has_refund_not_invoice_amount'] = ($item['has_refund_amount'] - $item['has_invoice_amount']) <= 0 ? 0 : $item['has_refund_amount'] - $item['has_invoice_amount'];
|
||||
$item['has_refund_not_invoice_amount'] = max(bcsub($item['has_refund_amount'], $item['has_invoice_amount']), 0);
|
||||
unset($item['amount']);
|
||||
return $item;
|
||||
})->toArray();
|
||||
|
Loading…
x
Reference in New Issue
Block a user