feat: Implement invoice generation and emailing functionality
- Added invoice generation logic using DomPDF. - Integrated invoice data retrieval from the API. - Implemented language determination for invoices based on customer data. - Added options to email invoices to customers and admin. - Included HTML output option for direct viewing in the browser. - Ensured proper redirection and error handling throughout the process.
This commit is contained in:
10
history.php
10
history.php
@@ -33,16 +33,16 @@ $url = 'index.php?page=history&equipmentID='.$_GET['equipmentID'].$status.$searc
|
||||
//GET Details from URL
|
||||
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||
//CALL TO API
|
||||
$api_url = '/v1/history/'.$GET_VALUES;
|
||||
$api_url = '/v2/history/'.$GET_VALUES;
|
||||
$responses = ioServer($api_url,'');
|
||||
//Decode Payload
|
||||
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||
if (!empty($responses)){$responses = json_decode($responses);}else{$responses = null;}
|
||||
|
||||
//Return QueryTotal from API
|
||||
$api_url = '/v1/history/'.$GET_VALUES.'&totals=';
|
||||
$api_url = '/v2/history/'.$GET_VALUES.'&totals=';
|
||||
$query_total = ioServer($api_url,'');
|
||||
//Decode Payload
|
||||
if (!empty($query_total)){$query_total = decode_payload($query_total);}else{$query_total = null;}
|
||||
if (!empty($query_total)){$query_total = json_decode($query_total);}else{$query_total = null;}
|
||||
|
||||
|
||||
// Handle success messages
|
||||
@@ -137,7 +137,7 @@ $view .= '
|
||||
foreach ($responses as $response){
|
||||
|
||||
$description = json_decode($response->description) ?? $response->description;
|
||||
$description = json_encode($description, JSON_PRETTY_PRINT);
|
||||
$description = json_encode($description, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
|
||||
//Replace JSON ITEMS
|
||||
$search = ['{', '}', '"',':','[',']',','];
|
||||
|
||||
Reference in New Issue
Block a user