Integrate with PhpNuxBill Printer
This commit is contained in:
parent
9552a14de5
commit
6de63bed63
@ -2,6 +2,10 @@
|
||||
|
||||
# CHANGELOG
|
||||
|
||||
## 2024.2.23
|
||||
|
||||
- Integrate with PhpNuxBill Printer
|
||||
|
||||
## 2024.2.22
|
||||
|
||||
- Add Loading when click submit
|
||||
|
@ -143,9 +143,8 @@ switch ($action) {
|
||||
|
||||
case 'view':
|
||||
$id = $routes['2'];
|
||||
$d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
|
||||
$ui->assign('in', $d);
|
||||
|
||||
$in = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
|
||||
$ui->assign('in', $in);
|
||||
if (!empty($routes['3']) && $routes['3'] == 'send') {
|
||||
$c = ORM::for_table('tbl_customers')->where('username', $d['username'])->find_one();
|
||||
if ($c) {
|
||||
@ -154,6 +153,54 @@ switch ($action) {
|
||||
}
|
||||
r2(U . 'prepaid/view/' . $id, 'd', "Customer not found");
|
||||
}
|
||||
//print
|
||||
$invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n";
|
||||
$invoice .= Lang::pad($config['address'], ' ', 2) . "\n";
|
||||
$invoice .= Lang::pad($config['phone'], ' ', 2) . "\n";
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pads("Invoice", $in['invoice'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Date'), $date, ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Sales'), $admin['fullname'], ' ') . "\n";
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
||||
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
|
||||
|
||||
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n";
|
||||
if ($in['type'] != 'Balance') {
|
||||
$invoice .= Lang::pads(Lang::T('Created On'), Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time']), ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Expires On'), Lang::dateAndTimeFormat($in['expiration'], $in['time']), ' ') . "\n";
|
||||
}
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pad($config['note'], ' ', 2) . "\n";
|
||||
$ui->assign('invoice', $invoice);
|
||||
$config['printer_cols'] = 30;
|
||||
//whatsapp
|
||||
$invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n";
|
||||
$invoice .= Lang::pad($config['address'], ' ', 2) . "\n";
|
||||
$invoice .= Lang::pad($config['phone'], ' ', 2) . "\n";
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pads("Invoice", $in['invoice'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Date'), $date, ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Sales'), $admin['fullname'], ' ') . "\n";
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
||||
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
|
||||
|
||||
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n";
|
||||
if ($in['type'] != 'Balance') {
|
||||
$invoice .= Lang::pads(Lang::T('Created On'), Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time']), ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Expires On'), Lang::dateAndTimeFormat($in['expiration'], $in['time']), ' ') . "\n";
|
||||
}
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pad($config['note'], ' ', 2) . "\n";
|
||||
$ui->assign('whatsapp', urlencode("```$invoice```"));
|
||||
|
||||
$ui->assign('_title', 'View Invoice');
|
||||
$ui->assign('date', Lang::dateAndTimeFormat($d['recharged_on'], $d['recharged_time']));
|
||||
$ui->display('invoice.tpl');
|
||||
@ -597,7 +644,7 @@ switch ($action) {
|
||||
$content .= Lang::pad("", '=') . "\n";
|
||||
$content .= Lang::pad($config['note'], ' ', 2) . "\n";
|
||||
$ui->assign('_title', Lang::T('View'));
|
||||
$ui->assign('wa', urlencode("```$content```"));
|
||||
$ui->assign('whatsapp', urlencode("```$content```"));
|
||||
$ui->display('voucher-view.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/voucher/', 'e', Lang::T('Voucher Not Found'));
|
||||
|
@ -448,5 +448,7 @@
|
||||
"SMS_and_WhatsApp": "SMS and WhatsApp",
|
||||
"The_method_which_OTP_will_be_sent_to_user": "The method which OTP will be sent to user",
|
||||
"Report_Viewer": "Report Viewer",
|
||||
"Super_Administrator": "Super Administrator"
|
||||
"Super_Administrator": "Super Administrator",
|
||||
"Send_To": "Send To",
|
||||
"Resend": "Resend"
|
||||
}
|
@ -7,39 +7,27 @@
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
|
||||
<pre id="content"></pre>
|
||||
<textarea class="hidden" id="formcontent" name="content">{Lang::pad($_c['CompanyName'],' ', 2)}
|
||||
{Lang::pad($_c['address'],' ', 2)}
|
||||
{Lang::pad($_c['phone'],' ', 2)}
|
||||
{Lang::pad("", '=')}
|
||||
{Lang::pads("Invoice", $in['invoice'], ' ')}
|
||||
{Lang::pads(Lang::T('Date'), $date, ' ')}
|
||||
{Lang::pads(Lang::T('Sales'), $_admin['fullname'], ' ')}
|
||||
{Lang::pad("", '=')}
|
||||
{Lang::pads(Lang::T('Type'), $in['type'], ' ')}
|
||||
{Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ')}
|
||||
{Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ')}
|
||||
{Lang::pad($in['method'], ' ', 2)}
|
||||
|
||||
{Lang::pads(Lang::T('Username'), $in['username'], ' ')}
|
||||
{Lang::pads(Lang::T('Password'), '**********', ' ')}
|
||||
{if $in['type'] != 'Balance'}
|
||||
{Lang::pads(Lang::T('Created On'), Lang::dateAndTimeFormat($in['recharged_on'],$in['recharged_time']), ' ')}
|
||||
{Lang::pads(Lang::T('Expires On'), Lang::dateAndTimeFormat($in['expiration'],$in['time']), ' ')}
|
||||
{/if}
|
||||
{Lang::pad("", '=')}
|
||||
{Lang::pad($_c['note'],' ', 2)}</textarea>
|
||||
<textarea class="hidden" id="formcontent" name="content">{$invoice}</textarea>
|
||||
<input type="hidden" name="id" value="{$in['id']}">
|
||||
<a href="{$_url}prepaid/list" class="btn btn-primary btn-sm"><i
|
||||
<a href="{$_url}prepaid/list" class="btn btn-default btn-sm"><i
|
||||
class="ion-reply-all"></i>{Lang::T('Finish')}</a>
|
||||
<a href="https://api.whatsapp.com/send/?text={$whatsapp}" target="_blank"
|
||||
class="btn btn-primary btn-sm">
|
||||
<i class="glyphicon glyphicon-share"></i> WhatsApp</a>
|
||||
<a href="{$_url}prepaid/view/{$in['id']}/send" class="btn btn-info text-black btn-sm"><i
|
||||
class="glyphicon glyphicon-envelope"></i> {Lang::T("Resend To Customer")}</a>
|
||||
<button type="submit" class="btn btn-success text-black btn-sm" name="nux" value="print">
|
||||
<i class="glyphicon glyphicon-print"></i>
|
||||
Nux Print
|
||||
class="glyphicon glyphicon-envelope"></i> {Lang::T("Resend")}</a>
|
||||
<button type="submit" class="btn btn-info text-black btn-sm"><i class="glyphicon glyphicon-print"></i>
|
||||
Print</button>
|
||||
<a href="nux://print?text={urlencode($invoice)}"
|
||||
class="btn btn-success text-black btn-sm hidden-md hidden-lg">
|
||||
<i class="glyphicon glyphicon-phone"></i>
|
||||
</button>
|
||||
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-print"></i>
|
||||
{Lang::T('Click Here to Print')}</button>
|
||||
NuxPrint
|
||||
</a>
|
||||
<a href="https://github.com/hotspotbilling/android-printer"
|
||||
class="btn btn-success text-black btn-sm hidden-xs hidden-sm" target="_blank">
|
||||
<i class="glyphicon glyphicon-phone"></i>
|
||||
NuxPrint
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,18 +8,23 @@
|
||||
<pre id="content"></pre>
|
||||
<textarea class="hidden" id="formcontent" name="content">{$print}</textarea>
|
||||
<input type="hidden" name="id" value="{$in['id']}">
|
||||
<a href="{$_url}prepaid/voucher" class="btn btn-primary btn-sm"><i
|
||||
<a href="{$_url}prepaid/voucher" class="btn btn-default btn-sm"><i
|
||||
class="ion-reply-all"></i>{Lang::T('Finish')}</a>
|
||||
<a href="https://api.whatsapp.com/send/?text={$wa}" target="_blank"
|
||||
class="btn btn-info text-black btn-sm">
|
||||
{Lang::T("Send To Customer")}</a>
|
||||
<button type="submit" class="btn btn-success text-black btn-sm" name="nux" value="print">
|
||||
<i class="glyphicon glyphicon-print"></i>
|
||||
Nux Print
|
||||
<a href="https://api.whatsapp.com/send/?text={$whatsapp}" target="_blank"
|
||||
class="btn btn-primary btn-sm">
|
||||
<i class="glyphicon glyphicon-share"></i> WhatsApp</a>
|
||||
<button type="submit" class="btn btn-info text-black btn-sm"><i class="glyphicon glyphicon-print"></i>
|
||||
Print</button>
|
||||
<a href="nux://print?text={urlencode($print)}"
|
||||
class="btn btn-success text-black btn-sm hidden-md hidden-lg">
|
||||
<i class="glyphicon glyphicon-phone"></i>
|
||||
</button>
|
||||
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-print"></i>
|
||||
{Lang::T('Click Here to Print')}</button>
|
||||
NuxPrint
|
||||
</a>
|
||||
<a href="https://github.com/hotspotbilling/android-printer"
|
||||
class="btn btn-success text-black btn-sm hidden-xs hidden-sm" target="_blank">
|
||||
<i class="glyphicon glyphicon-phone"></i>
|
||||
NuxPrint
|
||||
</a>
|
||||
</form>
|
||||
<javascript type="text/javascript">
|
||||
</javascript>
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.2.22"
|
||||
"version": "2024.2.23"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user