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:
“VeLiTi”
2026-01-07 14:36:48 +01:00
parent 543f0b3cac
commit 08263c7933
46 changed files with 4982 additions and 151 deletions

View File

@@ -30,16 +30,16 @@ $url = 'index.php?page=histories'.$status.$search;
//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;}
template_header('Histories', 'histories','view');
$view = '
@@ -116,7 +116,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 = ['{', '}', '"',':','[',']',','];
$replace = ['', '','','=','','',''];