BACKEND PDF CHECK

This commit is contained in:
Velz2020 2020-02-17 11:01:06 +05:30
parent 8096ec59cb
commit 45aa74b0be

View File

@ -432,13 +432,27 @@ class iobpay extends REST_Controller
function prepareReceipt($merchant_txn_id)
{
$this->db->SELECT('CSR_TXN_DETAILS.trackid,ROUND(CSR_TXN_DETAILS.amount,0) as amount,CSR_TXN_DETAILS.txnstatus,CSR_USER.name,CSR_USER_ORG.org_pan,DATE_FORMAT(convert_tz(CSR_TXN_DETAILS.createdon,"+00:00","+05:30"),"%d-%m-%Y") as txn_date,concat(DATE_FORMAT(convert_tz(CSR_TXN_DETAILS.createdon,"+00:00","+05:30"),"%Y%m%d"),CSR_TXN_DETAILS.merchant_txn_id) as ref_id');
$this->db->SELECT('CSR_TXN_DETAILS.trackid,ROUND(CSR_TXN_DETAILS.amount,0) as amount,CSR_TXN_DETAILS.txnstatus,CSR_USER.name,CSR_USER_ORG.org_pan,DATE_FORMAT(convert_tz(CSR_TXN_DETAILS.createdon,"+00:00","+05:30"),"%d-%m-%Y") as txn_date,concat(DATE_FORMAT(convert_tz(CSR_TXN_DETAILS.createdon,"+00:00","+05:30"),"%Y%m%d"),CSR_TXN_DETAILS.merchant_txn_id) as ref_id,CSR_TXN_DETAILS.is_receipt');
$this->db->FROM(CSR_TXN_DETAILS.' as CSR_TXN_DETAILS');
$this->db->JOIN(CSR_USER.' as CSR_USER','CSR_TXN_DETAILS.user_id = CSR_USER.id','LEFT');
$this->db->JOIN(CSR_USER_ORG.' as CSR_USER_ORG','CSR_USER.id = CSR_USER_ORG.user_id','LEFT');
$this->db->WHERE('CSR_TXN_DETAILS.merchant_txn_id',$merchant_txn_id);
$txn_details = $this->db->GET()->result_array();
if(count($txn_details)) { $txn_details[0]['numtowords'] = $this->numtowords($txn_details[0]['amount']); }
if(count($txn_details) && $txn_details[0]['is_receipt'])
{
$singed_uri = $this->aws_s3->get_s3_url(SCHOOL_BUCKET_NAME,CSR_RECEIPT_FOLDERNAME.'/'.$merchant_txn_id.'.pdf');
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $singed_uri;
$this->response($data,REST_Controller::HTTP_OK);
}
else
{
$txn_details[0]['numtowords'] = $this->numtowords($txn_details[0]['amount']);
$view_data['data'] = $txn_details[0];
// print_r($txn_details[0]);
$html = $this->load->view('receipt',$view_data,true);
@ -467,6 +481,7 @@ class iobpay extends REST_Controller
$data['msg'] = 'Something Went Wrong..!Try later';
$this->response($data,REST_Controller::HTTP_OK);
}
}
}