From 9b0644b116783f16cc68155dfeb302e0ebf43391 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Thu, 14 Apr 2022 19:27:49 +0100 Subject: [PATCH] Add ceiling (plafond) to ilink paliers config wallets --- application/controllers/Gestion.php | 43 +- application/language/english/message_lang.php | 4 + application/language/french/message_lang.php | 5 +- .../agent_send_cash_canal.php | 402 ++++++++++-------- .../user_wallet_cash.php | 47 +- .../user_wallet_wallet.php | 46 +- .../hyper/infos_health_care_sheet.php | 6 + 7 files changed, 335 insertions(+), 218 deletions(-) diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index 17c23245..8af98adb 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1489,7 +1489,9 @@ class Gestion extends CI_Controller if ($this->isLogged()) { if (isset($_POST)) { $type = $_POST['type']; - $res = false; + + $this->db->trans_begin(); + if ($method == 'create') { $country_id = $_POST['country_id']; $network_id = $_POST['network_id']; @@ -1592,18 +1594,21 @@ class Gestion extends CI_Controller break; } - $res = true; + } else if ($type == 'ilink_sante') { unset($_POST['id_config'], $_POST['type']); $this->nano_health_model->updateConfig($idConfig, $_POST); - $res = true; + } } - if ($res != false) { - echo json_encode("200"); - } else { + + if ($this->db->trans_status() === FALSE) { + $this->db->trans_rollback(); echo json_encode("500"); + } else { + $this->db->trans_commit(); + echo json_encode("200"); } } } @@ -1629,22 +1634,24 @@ class Gestion extends CI_Controller } } - private function insertPalier($palier, $name, $idConfig) + private function insertPalier($palier, $type, $idConfig) { - - $exist = $this->wallet_model->getPalierConfigWallet($name, $idConfig); - if ($exist) { - $this->wallet_model->deletePalierConfigWallet($name, $idConfig); - } + $this->db->delete('paliersConfigWallet',['type' => $type , 'idConfig' => $idConfig]); if ($palier) { + $data = []; foreach ($palier as $p) { - $array = json_decode(json_encode($p), true); - $row = []; - foreach ($array as $key => $value) { - $row[] = $value; - } - $this->wallet_model->addPalierConfigWallet($name, $idConfig, $row[0], $row[1], $row[2]); + $data[] = [ + 'type' => $type, + 'min' => $p[0], + 'max' => $p[1], + 'taux' => $p[2], + 'plafond' => !empty($p[3]) ? $p[3] : null, + 'idConfig' => $idConfig + ]; + } + if(sizeof($data) > 0){ + $this->db->insert_batch('paliersConfigWallet',$data); } } } diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 4e1d62c5..de336010 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -912,4 +912,8 @@ $lang['issuer_agent'] = "Issuing agent"; $lang['CONSULTATION'] = "CONSULTATION"; $lang['EXAM_OR_OTHER'] = "EXAM OR OTHER"; $lang['consultation_cannot_have_unit_price'] = "A consultation cannot have a unit price"; +$lang['EXPIRED'] = 'EXPIRED'; +$lang['SUSPENDED'] = "SUSPENDED"; +$lang['billed_quantity'] = "Billed quantity"; +$lang['ceiling'] = "Ceiling"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 9a6d32bb..696481b3 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -922,5 +922,8 @@ $lang['issuer_agent'] = "Agent emetteur"; $lang['CONSULTATION'] = "CONSULTATION"; $lang['EXAM_OR_OTHER'] = "EXAMEN OU AUTRE"; $lang['consultation_cannot_have_unit_price'] = "Une consultation ne peut pas avoir de prix unitaire"; -$lang['SUSPENDED'] = "SUSPENDU" +$lang['SUSPENDED'] = "SUSPENDU"; +$lang['EXPIRED'] = 'EXPIRÉE'; +$lang['billed_quantity'] = "Quantité facturée"; +$lang['ceiling'] = "Plafond"; ?> diff --git a/application/views/config_wallet_ilink_hyp/agent_send_cash_canal.php b/application/views/config_wallet_ilink_hyp/agent_send_cash_canal.php index 7f165ab5..3c3a9519 100755 --- a/application/views/config_wallet_ilink_hyp/agent_send_cash_canal.php +++ b/application/views/config_wallet_ilink_hyp/agent_send_cash_canal.php @@ -120,15 +120,17 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); Min Max Taux (%) + lang->line('ceiling')?> result() as $row) { echo " - " . $fmt->format($row->min) . " - " . $fmt->format($row->max) . " - " . $row->taux . "" . ' - '; + " . $fmt->format($row->min) . " + " . $fmt->format($row->max) . " + " . $row->taux . " + " . (isset($row->plafond) ? floatval($row->plafond) : '') . "" . ' + '; } } ?> @@ -149,15 +151,17 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); Min Max Taux (%) + lang->line('ceiling')?> result() as $row) { echo " - " . $fmt->format($row->min) . " - " . $fmt->format($row->max) . " - " . $row->taux . "" . ' - '; + " . $fmt->format($row->min) . " + " . $fmt->format($row->max) . " + " . $row->taux . " + " . (isset($row->plafond) ? floatval($row->plafond) : '') . "" . ' + '; } } ?> @@ -180,15 +184,17 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); Min Max Taux (%) + lang->line('ceiling')?> result() as $row) { echo " - " . $fmt->format($row->min) . " - " . $fmt->format($row->max) . " - " . $row->taux . "" . ' - '; + " . $fmt->format($row->min) . " + " . $fmt->format($row->max) . " + " . $row->taux . " + " . (isset($row->plafond) ? floatval($row->plafond) : '') . "" . ' + '; } } ?> @@ -209,15 +215,17 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); Min Max Taux (%) + lang->line('ceiling')?> result() as $row) { echo " - " . $fmt->format($row->min) . " - " . $fmt->format($row->max) . " - " . $row->taux . "" . ' - '; + " . $fmt->format($row->min) . " + " . $fmt->format($row->max) . " + " . $row->taux . " + " . (isset($row->plafond) ? floatval($row->plafond) : '') . "" . ' + '; } } ?> @@ -242,15 +250,17 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); Min Max Taux (%) + lang->line('ceiling')?> result() as $row) { echo " - " . $fmt->format($row->min) . " - " . $fmt->format($row->max) . " - " . $row->taux . "" . ' - '; + " . $fmt->format($row->min) . " + " . $fmt->format($row->max) . " + " . $row->taux . " + " . (isset($row->plafond) ? floatval($row->plafond) : '') . "" . ' + '; } } ?> @@ -271,15 +281,17 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); Min Max Taux (%) + lang->line('ceiling')?> result() as $row) { echo " - " . $fmt->format($row->min) . " - " . $fmt->format($row->max) . " - " . $row->taux . "" . ' - '; + " . $fmt->format($row->min) . " + " . $fmt->format($row->max) . " + " . $row->taux . " + " . (isset($row->plafond) ? floatval($row->plafond) : '') . "" . ' + '; } } ?> @@ -302,7 +314,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);