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