get('invoicing_enable') === 'true'; if (!$invoicingEnable) { api_not_allowed(true, $plugin->get_lang('NoInvoiceEnable')); } $saleId = isset($_GET['invoice']) ? (int) $_GET['invoice'] : 0; $isService = isset($_GET['is_service']) ? (int) $_GET['is_service'] : 0; $globalParameters = $plugin->getGlobalParameters(); $infoSale = $plugin->getDataSaleInvoice($saleId, $isService); $buyer = api_get_user_info($infoSale['user_id']); $extraUserInfoData = UserManager::get_extra_user_data($infoSale['user_id']); $infoInvoice = $plugin->getDataInvoice($saleId, $isService); $taxAppliesTo = $globalParameters['tax_applies_to']; $taxEnable = $plugin->get('tax_enable') === 'true' && ($taxAppliesTo == BuyCoursesPlugin::TAX_APPLIES_TO_ALL || ($taxAppliesTo == BuyCoursesPlugin::TAX_APPLIES_TO_ONLY_COURSE && !$isService) || ($taxAppliesTo == BuyCoursesPlugin::TAX_APPLIES_TO_ONLY_SESSION && $isService)); $htmlText = ''; $htmlText .= ''; $htmlText .= ''; $htmlText .= '
'; $organization = ChamiloApi::getPlatformLogo('', [], true); // Use custom logo image. $pdfLogo = api_get_setting('pdf_logo_header'); if ($pdfLogo === 'true') { $visualTheme = api_get_visual_theme(); $img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png'; if (file_exists($img)) { $organization = "| ';
$htmlText .= ''.$globalParameters['seller_name'].' '; $htmlText .= $globalParameters['seller_id'].' '; $htmlText .= $globalParameters['seller_address'].' '; $htmlText .= $globalParameters['seller_email'].' '; $htmlText .= ' | ';
$htmlText .= '';
$htmlText .= ''.$buyer['complete_name'].' '; $htmlText .= ($extraUserInfoData['buycourses_company'] ? $extraUserInfoData['buycourses_company'].' ' : ''); $htmlText .= ($extraUserInfoData['buycourses_vat'] ? $extraUserInfoData['buycourses_vat'].' ' : ''); $htmlText .= ($extraUserInfoData['buycourses_address'] ? $extraUserInfoData['buycourses_address'].' ' : ''); $htmlText .= ($buyer['phone'] ? $buyer['phone'].' ' : ''); $htmlText .= ($buyer['email'] ? $buyer['email'].' ' : ''); $htmlText .= ' | ';
$htmlText .= '
';
$htmlText .= $plugin->get_lang('InvoiceDate').': '
.api_convert_and_format_date($infoInvoice['date_invoice'], DATE_TIME_FORMAT_LONG_24H).'
';
$htmlText .= $plugin->get_lang('InvoiceNumber').': '
.$infoInvoice['serie'].$infoInvoice['year'].'/'.$infoInvoice['num_invoice'].'
';
$htmlText .= '