diff --git a/frontend/controllers/FinanceController.php b/frontend/controllers/FinanceController.php index 822e630..2a588f7 100644 --- a/frontend/controllers/FinanceController.php +++ b/frontend/controllers/FinanceController.php @@ -56,10 +56,15 @@ class FinanceController extends \frontend\controllers\UserBaseController public $layout = 'blue-main'; public function actionReceipt() { - return $this->render('receipt'); + $insurer_company_items = InsurerCompanyT::find()->all(); + + return $this->render('receipt',[ + 'insurer_company_items' => $insurer_company_items + ]); } public function actionReceiptJson() { + Yii::$app->response->format = Response::FORMAT_JSON; $request = Yii::$app->request; $begin_date = $request->get('begin_date'); $end_date = $request->get('end_date'); @@ -89,8 +94,6 @@ class FinanceController extends \frontend\controllers\UserBaseController } } - if ($page < 1) $page = 1; - $query = CaiwuT::find() ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id"); @@ -209,7 +212,12 @@ class FinanceController extends \frontend\controllers\UserBaseController $data['rows'] = []; foreach($items as $item) { $row = $item->toArray(); - $row['user'] = $item->user?$item->user->getShowName():''; + $row['group'] = $item->user->group->name; + $row['company_name'] = $item->order->company->name; + $row['username'] = $item->user->getShowName(); + $row['submit_date'] = $item->order->submit_date; + $row['print_date'] = $item->order->print_date; + $row['total_real'] = round($item->total_clear_real + $item->total_tax_real,2); $data['rows'][] = $row; } diff --git a/frontend/views/car/order-add.php b/frontend/views/car/order-add.php index c861086..60579ac 100644 --- a/frontend/views/car/order-add.php +++ b/frontend/views/car/order-add.php @@ -443,7 +443,7 @@ use common\models\PriceT; var total_real = Number($('#total_real').val()); var yuangong_money = Number($('#yuangong_money').val()); total_all = total1 + total2 + total3; - total1_real = total1_clear * ( 1 - fanxian_rate); + total1_real = total1_clear * ( 1 - fanxian_rate) - yuangong_money; total1_dis = total1_clear * fanxian_rate; total_real = total_all - total1_dis - yuangong_money; total1_percent = parseFloat(total1_real/total1_clear); diff --git a/frontend/views/finance/receipt.php b/frontend/views/finance/receipt.php index b835df1..ef5c8b4 100644 --- a/frontend/views/finance/receipt.php +++ b/frontend/views/finance/receipt.php @@ -21,7 +21,51 @@ use \common\libs\MyLib;