-
-
Save lxthien/7ba5945c907b92bc71d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Sample Print Format for ERPNext | |
Please use at your own discretion | |
For suggestions and contributions: | |
https://github.com/webnotes/erpnext-print-templates | |
Freely usable under MIT license | |
--> | |
<!-- Style Settings --> | |
<style> | |
/* | |
common style for whole page | |
This should include: | |
+ page size related settings | |
+ font family settings | |
+ line spacing settings | |
*/ | |
@media screen { | |
body { | |
width: 8.3in; | |
} | |
} | |
html, body, div, span, td { | |
font-family: "Georgia", serif; | |
font-size: 12px; | |
} | |
body { | |
padding: 10px; | |
margin: auto; | |
font-size: 12px; | |
line-height: 150%; | |
} | |
.common { | |
font-family: "Georgia", serif !important; | |
font-size: 12px; | |
padding: 1px 0px; | |
} | |
table { | |
border-collapse: collapse; | |
width: 100%; | |
vertical-align: top; | |
} | |
table td { | |
padding: 2px 0px; | |
} | |
table h1, h2, h3, h4, h5, h6 { | |
padding: 0px; | |
margin: 0px; | |
} | |
table.header-table td { | |
vertical-align: top; | |
} | |
table.header-table thead { | |
border-bottom: 1px solid black; | |
} | |
table.header-table h3 { | |
color: gray; | |
} | |
table.header-table thead td { | |
padding: 5px 0px; | |
} | |
div.page-body table td:nth-child(6), | |
div.page-body table td:nth-child(7) { | |
text-align: right; | |
} | |
table.footer-table td { | |
vertical-align: top; | |
} | |
table.footer-table td table td:nth-child(2), | |
table.footer-table td table td:nth-child(3) { | |
text-align: right; | |
} | |
.developper-01{ | |
width: 8.3in; | |
} | |
.developper-border-01{ | |
font-weight: normal; | |
} | |
.developper-border-02{font-weight: 600; margin-left: 10px;} | |
.headder-developper-01 table{ | |
width: 8.3in; | |
} | |
.td-header-1{ | |
width: 5.3in; | |
} | |
.td-header-2{ | |
width: 3.0in; | |
} | |
</style> | |
<style> | |
.title-sales-voice-1{font-weight: 600; font-size: 20px; text-transform: uppercase;} | |
.title-sales-voice-2{font-size: 16px; text-transform: uppercase;} | |
.row{width: 100%; display: block;} | |
.row-header-01{display: inline-block; width: 45%; float: left;} | |
.row-header-02{display: inline-block; width: 50%; float: left; font-weight: bolder;} | |
.letter-head{width: 100%; margin-bottom: 10px;} | |
.letter-head table{width: 100%;} | |
.letter-head .letter-head-left{width: 70%;} | |
.letter-head .letter-head-left span{font-weight: 600;} | |
.letter-head .letter-head-right{width: 30%;} | |
.signature{width: 100%;} | |
.signature table{width: 100%;} | |
.signature table tr.tr-signature-01{height: 140px;} | |
.signature table tr.tr-signature-01 td{vertical-align: top;} | |
.signature table tr td{text-align: center; width: 50%;} | |
.signature-title{font-weight: bold;} | |
.signature-01{font-style: italic;} | |
.headder-developper-01{height: 110px;} | |
.page-body table tr td{text-align: center !important; } | |
.page-body table tr td div{text-align: center !important; } | |
.page-body table tr:not(:first-child) td:nth-child(2){text-align: left !important;}; | |
</style> | |
<!--column add by Thien STS--> | |
<!-- Javascript --> | |
<script> | |
si_std = { | |
print_item_table: function() { | |
var table = print_table( | |
'Sales Invoice', | |
doc.name, | |
'entries', | |
'Sales Invoice Item', | |
[// Here specify the table columns to be displayed | |
'SR', 'description', 'stock_uom', 'qty', | |
'basic_rate', 'amount' | |
], | |
[// Here specify the labels of column headings | |
'Stt<br>(No)', 'Tên Hàng Hóa, Dịch Vụ<br>(Description)', | |
'Đơn vị tính<br>(Unit)', 'Số Lượng<br>(Quantily)', 'Đơn giá<br>(Unit Price)', 'Thành tiền<br>(Amount)' | |
], | |
[// Here specify the column widths | |
'5%', '30%', '15%', | |
'15%', '15%', '20%' | |
], | |
null, | |
null, | |
{ | |
'description' : function(data_row) { | |
return data_row.description.substr(0, data_row.description.indexOf("<br>")); | |
//doc.address_display.substr(0, doc.address_display.indexOf("Phone")); | |
} | |
} | |
); | |
// This code takes care of page breaks | |
if(table.appendChild) { | |
out = table.innerHTML; | |
} else { | |
out = ''; | |
for(var i=0; i < (table.length-1); i++) { | |
out += table[i].innerHTML + | |
'<div style = "page-break-after: always;" \ | |
class = "page_break"></div>\ | |
<div class="page-settings"></div>'; | |
} | |
out += table[table.length-1].innerHTML; | |
} | |
return out; | |
}, | |
print_other_charges: function(parent) { | |
var oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges'); | |
var rows = '<table width=100%>\n'; | |
for(var i=0; i<oc.length; i++) { | |
if(!oc[i].included_in_print_rate) { | |
rows += | |
'<tr>\n' + | |
'\t<td>' + oc[i].description + '</td>\n' + | |
'\t<td></td>\n' + | |
'\t<td width=38%>' + fmt_money(oc[i].tax_amount/doc.conversion_rate) + '</td>\n' + | |
'</tr>\n'; | |
} | |
} | |
return rows + '</table>\n'; | |
} | |
}; | |
function number_format( number, decimals, dec_point, thousands_sep ) { | |
var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; | |
var d = dec_point == undefined ? "," : dec_point; | |
var t = thousands_sep == undefined ? "." : thousands_sep, s = n < 0 ? "-" : ""; | |
var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; | |
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); | |
} | |
var th = ['','nghìn','triệu', 'tỷ','trillion']; | |
// uncomment this line for English Number System | |
// var th = ['','thousand','million', 'milliard','billion']; | |
var dg = ['không','một','hai','ba','bốn', 'năm','sáu','bảy','tám','chín']; | |
var tn = ['mười','mười một','mười hai','mười ba', 'mười bốn','mười lăm','mười sáu', 'mười bảy','mười tám','mười chín']; | |
var tw = ['hai mươi','ba mươi','bốn mươi','năm mươi', 'sáu mươi','bảy mươi','tám mươi','chín mươi']; | |
function toWords(s){ | |
s = s.toString(); s = s.replace(/[\, ]/g,''); | |
if (s != parseFloat(s)) | |
return 'not a number'; | |
var x = s.indexOf('.'); | |
if (x == -1) x = s.length; | |
if (x > 15) return 'too big'; | |
var n = s.split(''); | |
var str = ''; | |
var sk = 0; | |
for (var i=0; i < x; i++) { | |
if ((x-i)%3==2) { | |
if (n[i] == '1') { | |
str += tn[Number(n[i+1])] + ' '; i++; sk=1; | |
}else if (n[i]!=0) { | |
str += tw[n[i]-2] + ' ';sk=1;} | |
} | |
else if (n[i]!=0) {str += dg[n[i]] +' '; | |
if ((x-i)%3==0) str += 'trăm ';sk=1;} | |
if ((x-i)%3==1) {if (sk) str += th[(x-i-1)/3] + ' ';sk=0;}} | |
if (x != s.length) { | |
var y = s.length; str += 'point '; | |
for (var i=x+1; i<y; i++) | |
str += dg[n[i]] +' '; | |
} return str.replace(/\s+/g,' '); | |
} | |
function ucfirst(str) { | |
str += ''; | |
var f = str.charAt(0).toUpperCase(); | |
return f + str.substr(1); | |
} | |
</script> | |
<div class="headder-developper-01"> | |
<table> | |
<tr> | |
<td rowspan="4"><span class="title-sales-voice-1">Hóa đơn giá trị tăng</span> - <span class="title-sales-voice-2">(Vat Invoice)</span></td> | |
<td><span class="row-header-01">Mẫu số (Form):</span> <span class="row-header-02">01GTKT3/001</span></td> | |
</tr> | |
<tr> | |
<td><span class="row-header-01">Kí hiệu (Serial):</span> <span class="row-header-02">HN/13T</span></td> | |
</tr> | |
<tr> | |
<td><span class="row-header-01">Liên 1 (Copy 1):</span> <span class="row-header-02">Lưu (for save)</span></td> | |
</tr> | |
<tr> | |
<td><span class="row-header-01">Số (No.):</span> <span class="row-header-02"><script>cur_frm.docname</script></span></td> | |
</tr> | |
<tr> | |
<td colspan="2">Ngày (date) <script>date.str_to_user(doc.posting_date).substr(0, 2)</script> Tháng (month) <script>date.str_to_user(doc.posting_date).substr(3, 2)</script> Năm (year) <script>date.str_to_user(doc.posting_date).substr(6, 4)</script></td> | |
</tr> | |
</table> | |
</div> | |
<div class='common page-header'> | |
<table class='header-table developper-01' cellspacing=0> | |
<tbody> | |
<tr> | |
<td><span class="developper-border-01">Họ và tên người mua (Buyer's name):</span> <span class="developper-border-02"><script>doc.customer</script></span></td> | |
</tr> | |
<tr> | |
<td><span class="developper-border-01">Đơn vị (Company's name):</span> <span class="developper-border-02"><script>doc.company_name</script></span></td> | |
</tr> | |
<tr> | |
<td><span class="developper-border-01">Mã số thuế (Tax code):</span> <span class="developper-border-02"><script>doc.customer_tax_code</script></span></td> | |
</tr> | |
<tr> | |
<td><span class="developper-border-01">Địa chỉ (Address):</span> <span class="developper-border-02"> | |
<script> | |
if(doc.address_display.length > 0){ | |
doc.address_display.substr(0, doc.address_display.indexOf("Phone")); | |
} | |
</script></span></td> | |
</tr> | |
<tr> | |
<td><span class="developper-border-01">Số tài khoản (Account No.):</span> <span class="developper-border-02"><script>doc.customer_account</script></span></td> | |
</tr> | |
<tr> | |
<td><span class="developper-border-01">Hình thức thanh toán (Method of payment):</span> <span class="developper-border-02"><script>doc.method_of_payment</script></span></td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
<!--column add by Thien STS--> | |
<!-- Page Layout Settings --> | |
<div class='common page-body'> | |
<script>si_std.print_item_table()</script> | |
</div> | |
<div class='common page-footer'> | |
<!-- | |
Page Footer will contain | |
+ table 3 | |
- Terms and Conditions | |
- Total Rounded Amount Calculation | |
- Total Rounded Amount in Words | |
--> | |
<table class='footer-table' width=100% cellspacing=0> | |
<thead></thead> | |
<tbody> | |
<tr> | |
<td width=30% style='padding-right: 10px;'></td> | |
<td width=70%> | |
<table cellspacing=0 width=100%><tbody> | |
<tr> | |
<td width=60% colspan="2">CỘNG TIỀN HÀNG (SUB TOTAL)</td> | |
<td width=40%><script> | |
//fmt_money(doc.net_total_export) | |
'VND '+number_format(doc.net_total, 2, ',', '.'); | |
</script></td> | |
</tr> | |
<!--<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>--> | |
<tr> | |
<td colspan="2">THUẾ SUẤT GTGT (VAT RATE)</td> | |
<td>5%</td> | |
</tr> | |
<tr> | |
<td colspan="2">TIỀN THUẾ GTGT (VAT AMOUNT)</td> | |
<td><script> | |
//fmt_money(doc.grand_total_export) | |
'VND '+number_format(doc.grand_total-doc.net_total, 2, ',', '.'); | |
</script></td> | |
</tr> | |
<tr style='font-weight: bold'> | |
<td colspan="2">TỔNG CỘNG TIỀN THANH TOÁN (GRAND TOTAL)</td> | |
<!--<td><script>doc.currency</script></td>--> | |
<td><script> | |
//fmt_money(doc.rounded_total_export) | |
'VND '+number_format(doc.rounded_total, 2, ',', '.'); | |
</script></td> | |
</tr> | |
</tbody> | |
</table> | |
<!--<br /><b>In Words</b><br />--> | |
</td> | |
</tr> | |
<tr> | |
<td colspan=2> | |
Số tiền viết bằng chữ (Amount in word): <i><script> | |
//doc.in_words_export | |
ucfirst(toWords(doc.rounded_total)+' đồng./.'); | |
</script></i> | |
</td> | |
</tr> | |
</tbody> | |
<tfoot></tfoot> | |
</table> | |
</div> | |
<div class="signature"> | |
<table> | |
<tr class="tr-signature-01"> | |
<td>NGƯỜI MUA HÀNG<br>(BUYER)</td> | |
<td>NGƯỜI BÁN HÀNG<br>(SELLER)</td> | |
</tr> | |
<tr class="tr-signature-02"> | |
<td>Ký và ghi rõ họ tên<br>(Sign, with fullname)</td> | |
<td>Ký, đóng dấu và ghi rõ họ tên<br>(Sign & stamp, with fullname)</td> | |
</tr> | |
<tr> | |
<td colspan=2><em>(cần kiểm tra, đối chiếu khi lập, giao, nhận hóa đơn)</em></td> | |
</tr> | |
<tr> | |
<td colspan=2> | |
<span class="signature-title">Web Notes Techonlogies Pvt. Ldt.</span><br> | |
<span class="signature-01">PAN Number: </span><span>AAACW8099E</span><br> | |
<span class="signature-01">Service Tax No: </span><span>AAACW8099EST001</span> | |
</td> | |
</tr> | |
</table> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment