Support thermal printer for invoice
This commit is contained in:
parent
64f52d6c1c
commit
b4bec8964d
@ -7,6 +7,7 @@
|
|||||||
- Add yellow color to table for plan not allowed to purchase
|
- Add yellow color to table for plan not allowed to purchase
|
||||||
- Fix Radius pool select
|
- Fix Radius pool select
|
||||||
- add price to reminder notification
|
- add price to reminder notification
|
||||||
|
- Support thermal printer for invoice
|
||||||
|
|
||||||
## 2024.1.15
|
## 2024.1.15
|
||||||
|
|
||||||
|
@ -99,4 +99,28 @@ class Lang
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $pad_type
|
||||||
|
* 0 Left
|
||||||
|
* 1 right
|
||||||
|
* 2 center
|
||||||
|
* */
|
||||||
|
public static function pad($text, $pad_string = ' ', $pad_type = 0){
|
||||||
|
global $config;
|
||||||
|
$cols = 37;
|
||||||
|
if($config['printer_cols']){
|
||||||
|
$cols = $config['printer_cols'];
|
||||||
|
}
|
||||||
|
return str_pad($text, $cols, $pad_string, $pad_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function pads($textLeft, $textRight, $pad_string = ' '){
|
||||||
|
global $config;
|
||||||
|
$cols = 37;
|
||||||
|
if($config['printer_cols']){
|
||||||
|
$cols = $config['printer_cols'];
|
||||||
|
}
|
||||||
|
return $textLeft.str_pad($textRight, $cols-strlen($textLeft), $pad_string, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,14 @@
|
|||||||
<input type="text" class="form-control" id="phone" name="phone" value="{$_c['phone']}">
|
<input type="text" class="form-control" id="phone" name="phone" value="{$_c['phone']}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-2 control-label"><i class="glyphicon glyphicon-print"></i> Print Max Char</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="number" required class="form-control" id="printer_cols" placeholder="37" name="printer_cols"
|
||||||
|
value="{$_c['printer_cols']}">
|
||||||
|
</div>
|
||||||
|
<span class="help-block col-md-4">For invoice print using Thermal Printer</span>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label">Theme</label>
|
<label class="col-md-2 control-label">Theme</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
@ -21,30 +21,27 @@
|
|||||||
<table width="200">
|
<table width="200">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<pre style="border-style: none; background-color: white;"><b>{Lang::pad($_c['CompanyName'],' ', 2)}</b>
|
||||||
<center>
|
{Lang::pad($_c['address'],' ', 2)}
|
||||||
<b>{$_c['CompanyName']}</b><br>
|
{Lang::pad($_c['phone'],' ', 2)}
|
||||||
{$_c['address']}<br>
|
{Lang::pad("", '=')}
|
||||||
{$_c['phone']}<br>
|
{Lang::pads("Invoice", $in['invoice'], ' ')}
|
||||||
</center>
|
{Lang::pads($_L['Date'], $date, ' ')}
|
||||||
============================================<br>
|
{Lang::pads($_L['Sales'], $_admin['fullname'], ' ')}
|
||||||
INVOICE: <b>{$d['invoice']}</b> - {$_L['Date']} : {$date}<br>
|
{Lang::pad("", '=')}
|
||||||
{$_L['Sales']} : {$_admin['fullname']}<br>
|
{Lang::pads($_L['Type'], $in['type'], ' ')}
|
||||||
============================================<br>
|
{Lang::pads($_L['Plan_Name'], $in['plan_name'], ' ')}
|
||||||
{$_L['Type']} : <b>{$d['type']}</b><br>
|
{Lang::pads($_L['Plan_Price'], Lang::moneyFormat($in['price']), ' ')}
|
||||||
{$_L['Plan_Name']} : <b>{$d['plan_name']}</b><br>
|
{Lang::pad($in['method'], ' ', 2)}
|
||||||
{$_L['Plan_Price']} : <b>{Lang::moneyFormat($d['price'])}</b><br>
|
|
||||||
<br>
|
{Lang::pads($_L['Username'], $in['username'], ' ')}
|
||||||
{$_L['Username']} : <b>{$d['username']}</b><br>
|
{Lang::pads($_L['Password'], '**********', ' ')}
|
||||||
{$_L['Password']} : **********<br>
|
{if $in['type'] != 'Balance'}
|
||||||
{if $in['type'] != 'Balance'}
|
{Lang::pads($_L['Created_On'], Lang::dateAndTimeFormat($in['recharged_on'],$in['recharged_time']), ' ')}
|
||||||
<br>
|
{Lang::pads($_L['Expires_On'], Lang::dateAndTimeFormat($in['expiration'],$in['time']), ' ')}
|
||||||
{$_L['Created_On']} : <b>{Lang::dateAndTimeFormat($d['recharged_on'],$d['recharged_time'])}</b><br>
|
{/if}
|
||||||
{$_L['Expires_On']} : <b>{Lang::dateAndTimeFormat($d['expiration'],$d['time'])}</b><br>
|
{Lang::pad("", '=')}
|
||||||
{/if}
|
{Lang::pad($_c['note'],' ', 2)}</pre>
|
||||||
============================================<br>
|
|
||||||
<center>{$_c['note']}</center>
|
|
||||||
</fieldset>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -5,34 +5,28 @@
|
|||||||
<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">
|
||||||
<div class="well">
|
<pre><b>{Lang::pad($_c['CompanyName'],' ', 2)}</b>
|
||||||
<fieldset>
|
{Lang::pad($_c['address'],' ', 2)}
|
||||||
<center>
|
{Lang::pad($_c['phone'],' ', 2)}
|
||||||
<b>{$_c['CompanyName']}</b><br>
|
{Lang::pad("", '=')}
|
||||||
{$_c['address']}<br>
|
{Lang::pads("Invoice", $in['invoice'], ' ')}
|
||||||
{$_c['phone']}<br>
|
{Lang::pads($_L['Date'], $date, ' ')}
|
||||||
</center>
|
{Lang::pads($_L['Sales'], $_admin['fullname'], ' ')}
|
||||||
====================================================<br>
|
{Lang::pad("", '=')}
|
||||||
INVOICE: <b>{$in['invoice']}</b> - {$_L['Date']} : {$date}<br>
|
{Lang::pads($_L['Type'], $in['type'], ' ')}
|
||||||
{$_L['Sales']} : {$_admin['fullname']}<br>
|
{Lang::pads($_L['Plan_Name'], $in['plan_name'], ' ')}
|
||||||
====================================================<br>
|
{Lang::pads($_L['Plan_Price'], Lang::moneyFormat($in['price']), ' ')}
|
||||||
{$_L['Type']} : <b>{$in['type']}</b><br>
|
{Lang::pad($in['method'], ' ', 2)}
|
||||||
{$_L['Plan_Name']} : <b>{$in['plan_name']}</b><br>
|
|
||||||
{$_L['Plan_Price']} : <b>{Lang::moneyFormat($in['price'])}</b><br>
|
{Lang::pads($_L['Username'], $in['username'], ' ')}
|
||||||
{$in['method']}<br>
|
{Lang::pads($_L['Password'], '**********', ' ')}
|
||||||
<br>
|
{if $in['type'] != 'Balance'}
|
||||||
{$_L['Username']} : <b>{$in['username']}</b><br>
|
{Lang::pads($_L['Created_On'], Lang::dateAndTimeFormat($in['recharged_on'],$in['recharged_time']), ' ')}
|
||||||
{$_L['Password']} : **********<br>
|
{Lang::pads($_L['Expires_On'], Lang::dateAndTimeFormat($in['expiration'],$in['time']), ' ')}
|
||||||
{if $in['type'] != 'Balance'}
|
{/if}
|
||||||
<br>
|
{Lang::pad("", '=')}
|
||||||
{$_L['Created_On']} : <b>{Lang::dateAndTimeFormat($in['recharged_on'],$in['recharged_time'])}</b><br>
|
{Lang::pad($_c['note'],' ', 2)}</pre>
|
||||||
{$_L['Expires_On']} : <b>{Lang::dateAndTimeFormat($in['expiration'],$in['time'])}</b><br>
|
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
|
||||||
{/if}
|
|
||||||
=====================================================<br>
|
|
||||||
<center>{$_c['note']}</center>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
|
|
||||||
<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-primary btn-sm"><i
|
||||||
class="ion-reply-all"></i>{$_L['Finish']}</a>
|
class="ion-reply-all"></i>{$_L['Finish']}</a>
|
||||||
@ -40,7 +34,7 @@
|
|||||||
class="glyphicon glyphicon-envelope"></i> {Lang::T("Resend To Customer")}</a>
|
class="glyphicon glyphicon-envelope"></i> {Lang::T("Resend To Customer")}</a>
|
||||||
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-print"></i>
|
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-print"></i>
|
||||||
{$_L['Click_Here_to_Print']}</button>
|
{$_L['Click_Here_to_Print']}</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user