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:
@@ -133,6 +133,7 @@ if (isset($criterias['sn']) && $criterias['sn'] != ''){
|
||||
JOIN products_software_versions psv ON psa.software_version_id = psv.rowID
|
||||
WHERE psa.product_id = ?
|
||||
AND psa.status = 1
|
||||
AND psv.latest = 1
|
||||
AND (psv.hw_version = ? OR psv.hw_version IS NULL OR psv.hw_version = "")';
|
||||
|
||||
$stmt = $pdo->prepare($sql);
|
||||
@@ -212,16 +213,13 @@ if (isset($criterias['sn']) && $criterias['sn'] != ''){
|
||||
$decision_reason = 'Skipped - is current version but no upgrades scenario';
|
||||
}
|
||||
} else {
|
||||
//Check if this is the current version and should be shown as disabled
|
||||
if ($is_current_version && $has_paid_upgrade_from_current && $version['latest'] == 1) {
|
||||
//Show current version as disabled only if it's the latest AND there's a paid upgrade available
|
||||
//Check if this is the current version - always show it
|
||||
if ($is_current_version) {
|
||||
$show_version = true;
|
||||
$is_current = true;
|
||||
$final_price = '0.00';
|
||||
$final_currency = '';
|
||||
$decision_reason = 'Showing as CURRENT - is latest version with paid upgrade available';
|
||||
} else if ($is_current_version && !($has_paid_upgrade_from_current && $version['latest'] == 1)) {
|
||||
$decision_reason = 'Skipped - is current version but not (latest + has_paid_upgrade)';
|
||||
$decision_reason = 'Showing as CURRENT - always show current version';
|
||||
} else if (!$is_current_version) {
|
||||
//Check if this version is part of ANY upgrade path system (either FROM or TO)
|
||||
$sql = 'SELECT COUNT(*) as path_count
|
||||
|
||||
Reference in New Issue
Block a user