save pdf invoice customer from admin page

This commit is contained in:
iBNu Maksum
2025-03-13 15:05:16 +07:00
parent 0868d61271
commit 9301f1058c
3 changed files with 60 additions and 9 deletions

View File

@ -269,6 +269,17 @@ switch ($action) {
r2(getUrl('plan/view/') . $id, 'd', "Customer not found");
}
Package::createInvoice($in);
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
$logo = '';
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) {
$logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.png';
$imgsize = getimagesize($logo);
$width = $imgsize[0];
$height = $imgsize[1];
$ui->assign('wlogo', $width);
$ui->assign('hlogo', $height);
}
$ui->assign('logo', $logo);
$ui->assign('_title', 'View Invoice');
$ui->display('admin/plan/invoice.tpl');
break;