From e15136d97cb9d9e55a266f54037802ba819c21c7 Mon Sep 17 00:00:00 2001 From: Cheng Date: Tue, 6 Feb 2024 17:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8D=8E=E9=87=91=E8=A8=88=E7=AE=97+=E6=96=B0?= =?UTF-8?q?=E6=A2=AF=E5=83=B9=E5=AF=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/bonus/api/postCalBouns.php | 61 ++++++++++++++++++++------- wms/bonus/bonus.php | 2 +- wms/bonus/bonus_index1.php | 4 +- wms/contract-repair/js/alpine.js | 20 +++++++-- wms/mkt/pricereview-check.php | 5 ++- wms/mkt/pricereview-create.php | 15 ++++--- wms/mkt/pricereview-edit.php | 41 +++++++++++++++--- wms/mkt/pricereview-record-submit.php | 12 +++--- wms/mkt/pricereview_mi-api.php | 2 + 9 files changed, 123 insertions(+), 39 deletions(-) diff --git a/wms/bonus/api/postCalBouns.php b/wms/bonus/api/postCalBouns.php index 0545c351..8a8f0a54 100644 --- a/wms/bonus/api/postCalBouns.php +++ b/wms/bonus/api/postCalBouns.php @@ -51,7 +51,7 @@ if (!empty($_POST)) { if ($checkbox == 13) { // 保養獎金計算 - $result = maintenance_contract_bonus_v2_1( + $results = maintenance_contract_bonus_v2_1( $bonuns_verson, $clientType[$client_type], $paykind[$pay_kind], @@ -63,20 +63,49 @@ if (!empty($_POST)) { $manager, $contract_manger ); + if ($results['result_status'] != 'error') { + array_push($bonus_json, [ + 'maintain_type' => $maintain_type, + 'total' => $maintain_price_month, + 'fee_per_st' => $maintain_price_total, + 'commission_fee' => $commission_fee, + 'paykind' => $paykind[$pay_kind], + 'receivable_date_due' => $pay_day, + ]); + } + if (!empty($_POST['status']) && $_POST['status'] == 'save') { + foreach ($results['bonus_array'] as $i => $result) { + // echo '
';
+                // print_r($result);
+                // echo '
'; + $bonus_type = $result['bonus_type']; + $pay_day = $result['pay_day_due']; + $amount = $result['bonus_amount']; + $receiver = $result['bonus_receiver']; + $discount = $result['discount']; + foreach ($bonus_json as $json) { + $json['discount'] = "$discount"; + $a = json_encode($json); + } + echo '
';
+                print_r($a);
+                echo '
'; + // exit(); + // $sql = "INSERT INTO bonus + // (bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,pay_day,status,bonus_json,create_id,create_at) VALUES + // ($bonus_type,'$bonus_verson','$contract_no',$contract_type,'$facility_no',$amount,'$receiver','$pay_day',$status,'$a','$create_id','$create_at')"; + // $stmt = $conn->prepare($sql); + // $stmt->execute(); + // $count++; + // echo '
';
+                // print_r($count . '-- > Success');
+                // echo '
'; + + // exit; + } + } else { + header('Content-Type: application/json'); + echo json_encode($results); + } } - // $result = [ - // $bonuns_verson, - // $clientType[$client_type], - // $paykind[$pay_kind], - // $maintain_price_month, - // $maintain_price_total, - // $commission_fee, - // $pay_day, - // $receiver, - // $manager, - // $contract_manger - // ]; - // echo json_encode($result); - header('Content-Type: application/json'); - echo json_encode($result); } diff --git a/wms/bonus/bonus.php b/wms/bonus/bonus.php index 49d1f754..186a1598 100644 --- a/wms/bonus/bonus.php +++ b/wms/bonus/bonus.php @@ -102,7 +102,7 @@ WHERE c.checkBillNo = '$checkBillNo'
- + btn-sm categoryBtn"> 所有獎金 diff --git a/wms/bonus/bonus_index1.php b/wms/bonus/bonus_index1.php index 04c00c7e..cf2d00ce 100644 --- a/wms/bonus/bonus_index1.php +++ b/wms/bonus/bonus_index1.php @@ -345,14 +345,14 @@ require_once('../contract-repair/conn.php'); - +