+ Fix bug when deleting wallet transaction
This commit is contained in:
parent
b5f82b9694
commit
e79764e1ec
|
@ -578,13 +578,13 @@ class Hyperviseur_dash extends CI_Controller
|
|||
if ($this->isLogged()) {
|
||||
$datetime = $this->user_model->getCurrentTimeByNetworkID($this->session->userdata('network_id'));
|
||||
$id = $this->input->post('id_transaction');
|
||||
$query = $this->db->get_where('wallet_transaction', ['id' => $id]);
|
||||
$query = $this->db->get_where('infos_transaction', ['id' => $id]);
|
||||
if($query->num_rows()>0) {
|
||||
$transaction = $query->first_row();
|
||||
|
||||
// Debiter le compte de l'agent de sa commission
|
||||
$this->db->set('balance_com', 'balance_com-'.$transaction->commission_ag,false);
|
||||
$this->db->where('id',$transaction->id_wallet);
|
||||
$this->db->where('id',$transaction->id_wallet_ag);
|
||||
$this->db->update('wallets');
|
||||
|
||||
// Debiter le compte du superviseur de sa commission
|
||||
|
@ -606,7 +606,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$query = $this->db->update('wallet_transaction',$data);
|
||||
|
||||
try {
|
||||
$message = line_with_arguments($this->lang->line('credit_request_canceled_by_hypervisor_message'), array($id,$demand->montant));
|
||||
$message = line_with_arguments($this->lang->line('wallet_transaction_deleted_message'), array($id,$transaction->agent));
|
||||
|
||||
$url = NOTIFICATION_SERVICE_URL . '/onesignal/pushToAgent' ;
|
||||
|
||||
|
@ -622,29 +622,30 @@ class Hyperviseur_dash extends CI_Controller
|
|||
));
|
||||
|
||||
$data = new \stdClass();
|
||||
$data->screen = "Historique";
|
||||
$data->screen = "notificationview";
|
||||
$data->data = new \stdClass();
|
||||
$data->data->id = $id;
|
||||
|
||||
$body = new \stdClass();
|
||||
$body->agent_code = $demand->codeMembre;
|
||||
$body->agent_code = $transaction->codeMembre;
|
||||
$body->message = $message;
|
||||
$body->data = $data;
|
||||
$body->date = $datetime;
|
||||
|
||||
//Send to agent
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
|
||||
|
||||
/* set return type json */
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
/* execute request */
|
||||
curl_exec($ch);
|
||||
|
||||
$body->agent_code = $demand->codeParrain;
|
||||
|
||||
//Send to supervisor
|
||||
$body->agent_code = $transaction->codeParrain;
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
|
||||
|
||||
curl_exec($ch);
|
||||
|
||||
//Send to hypervisor
|
||||
$body->agent_code = $transaction->code_membre_hyp;
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
|
||||
curl_exec($ch);
|
||||
|
||||
/* close cURL resource */
|
||||
curl_close($ch);
|
||||
|
||||
|
|
|
@ -604,4 +604,5 @@ $lang['delete_transaction'] = "Delete a transaction";
|
|||
$lang['are_you_sure'] = "Are you sure what you are doing?";
|
||||
$lang['deleted_transactions'] = "Deleted Transactions";
|
||||
$lang['deletion_date'] = "Date of deletion";
|
||||
$lang['wallet_transaction_deleted_message'] = "Transaction number %s made by agent %s has been deleted"
|
||||
?>
|
||||
|
|
|
@ -616,4 +616,5 @@ $lang['delete_transaction'] = "Supprimer une transaction";
|
|||
$lang['are_you_sure'] = "Êtes vous sûr de ce que vous faites ?";
|
||||
$lang['deleted_transactions'] = "Transactions supprimées";
|
||||
$lang['deletion_date'] = "Date de suppression";
|
||||
$lang['wallet_transaction_deleted_message'] = "La transaction numéro %s faites par l'agent %s a été supprimée"
|
||||
?>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"source": "https://github.com/bcit-ci/CodeIgniter"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"php": ">=7.0",
|
||||
"spatie/async": "^1.4",
|
||||
"nesbot/carbon": "^2.33",
|
||||
"brick/money": "^0.4.5",
|
||||
|
|
Loading…
Reference in New Issue