diff --git a/system/controllers/plan.php b/system/controllers/plan.php index dc92ba6f..c8b81443 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -228,11 +228,13 @@ switch ($action) { $ui->assign('content', $content); } else { $id = _post('id'); + if(empty($id)) { + $id = $routes['2']; + } $d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); $ui->assign('in', $d); $ui->assign('date', Lang::dateAndTimeFormat($d['recharged_on'], $d['recharged_time'])); } - run_hook('print_invoice'); #HOOK $ui->display('invoice-print.tpl'); break; diff --git a/ui/ui/invoice-print.tpl b/ui/ui/invoice-print.tpl index 5c6b3afd..07b0647d 100644 --- a/ui/ui/invoice-print.tpl +++ b/ui/ui/invoice-print.tpl @@ -16,7 +16,8 @@ .invoice { width: 100%; - max-width: 70mm; /* Maximum width for thermal printing */ + max-width: 70mm; + /* Maximum width for thermal printing */ background: white; border-radius: 8px; padding: 10px; @@ -43,8 +44,10 @@ .details div { margin: 5px 0; - font-weight: bold; /* Bold text for details */ - color: black; /* Ensure text is black */ + font-weight: bold; + /* Bold text for details */ + color: black; + /* Ensure text is black */ } .invoice-info { @@ -57,8 +60,10 @@ .invoice-info td { padding: 5px; text-align: left; - color: black; /* Ensure text is black */ - font-weight: bold; /* Bold text for table content */ + color: black; + /* Ensure text is black */ + font-weight: bold; + /* Bold text for table content */ } .invoice-info th { @@ -68,7 +73,8 @@ .footer { margin-top: 10px; - text-align: left; /* Align footer text to left */ + text-align: left; + /* Align footer text to left */ } @media print { @@ -79,10 +85,14 @@ } .invoice { - width: 70mm; /* Fixed width for thermal printer */ - padding: 5px; /* Reduced padding for print */ - box-shadow: none; /* Remove shadow for clearer print */ - border: none; /* Remove border for print */ + width: 70mm; + /* Fixed width for thermal printer */ + padding: 5px; + /* Reduced padding for print */ + box-shadow: none; + /* Remove shadow for clearer print */ + border: none; + /* Remove border for print */ } .details { @@ -96,19 +106,25 @@ .invoice-info th, .invoice-info td { - padding: 5px; /* Reduced padding */ + padding: 5px; + /* Reduced padding */ text-align: left; - font-weight: bold; /* Bold text for print */ - color: black; /* Ensure text is black */ - border: none; /* Remove borders for print */ + font-weight: bold; + /* Bold text for print */ + color: black; + /* Ensure text is black */ + border: none; + /* Remove borders for print */ } hr { - border: 1px solid #000; /* Darker line for print */ + border: 1px solid #000; + /* Darker line for print */ } .btn { - display: none; /* Hide buttons when printing */ + display: none; + /* Hide buttons when printing */ } } @@ -122,63 +138,68 @@
{Lang::pad($_c['address'], ' ', 2)} | {Lang::pad($_c['phone'], ' ', 2)}
-{$content}+ {else} +
{Lang::pad($_c['address'], ' ', 2)} | {Lang::pad($_c['phone'], ' ', 2)}
+{Lang::pad(Lang::T('Type'), ' ', 2)} | -{$in['type']} | -
---|---|
{Lang::pad(Lang::T('Package Name'), ' ', 2)} | -{$in['plan_name']} | -
{Lang::pad(Lang::T('Package Price'), ' ', 2)} | -{Lang::moneyFormat($in['price'])} | -
{Lang::pad(Lang::T('Username'), ' ', 2)} | -{$in['username']} | -
{Lang::pad(Lang::T('Password'), ' ', 2)} | -********** | -
{Lang::pad(Lang::T('Payment Method'), ' ', 2)} | -{$in['method']} | -
{Lang::pad(Lang::T('Created On'), ' ', 2)} | -{Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time'])} | -
{Lang::pad(Lang::T('Expires On'), ' ', 2)} | -{Lang::dateAndTimeFormat($in['expiration'], $in['time'])} | -
{Lang::pad(Lang::T('Type'), ' ', 2)} | +{$in['type']} | +
---|---|
{Lang::pad(Lang::T('Package Name'), ' ', 2)} | +{$in['plan_name']} | +
{Lang::pad(Lang::T('Package Price'), ' ', 2)} | +{Lang::moneyFormat($in['price'])} | +
{Lang::pad(Lang::T('Username'), ' ', 2)} | +{$in['username']} | +
{Lang::pad(Lang::T('Password'), ' ', 2)} | +********** | +
{Lang::pad(Lang::T('Payment Method'), ' ', 2)} | +{$in['method']} | +
{Lang::pad(Lang::T('Created On'), ' ', 2)} | +{Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time'])} | +
{Lang::pad(Lang::T('Expires On'), ' ', 2)} | +{Lang::dateAndTimeFormat($in['expiration'], $in['time'])} | +