[pos] POS Invoice print format done
diff --git a/accounts/Print Format/POS Invoice/POS Invoice.txt b/accounts/Print Format/POS Invoice/POS Invoice.txt
index 672c107..2d48fff 100644
--- a/accounts/Print Format/POS Invoice/POS Invoice.txt
+++ b/accounts/Print Format/POS Invoice/POS Invoice.txt
@@ -2,14 +2,14 @@
  {
   "creation": "2011-12-21 11:08:55", 
   "docstatus": 0, 
-  "modified": "2013-08-16 16:15:46", 
+  "modified": "2013-08-29 17:40:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
  {
   "doc_type": "Sales Invoice", 
   "doctype": "Print Format", 
-  "html": "<html>\n<head>\n<!--Other charges function-->\n<script>\nvar make_row = function(title,val,bold){\nvar bstart = '<b>'; var bend = '</b>';\nreturn '<tr><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n        +'<td style=\"width:20%\">'+doc.currency+'</td>'\n        +'<td style=\"width:30%;text-align:right\">'+(val?val:'0.00')+'</td>'\n        +'</tr>'\n}\nvar make_row1 = function(title,val,bold){\n    var bstart = '<b>'; var bend = '</b>';\n    \n    return '<tr style=\"font-family:courier new; line-height:150%\"><td style=\"width:50%\">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'\n            +'<td style=\"width:50%;text-align:right\">'+(bold?bstart:'')+(val?val:'0.00')+(bold?bend:'')+'</td>'\n            +'</tr>'\n}\n\nfunction get_letter_head() {\n    // add letter head\n    var cp = wn.boot.control_panel;\n    if(doc.letter_head)\n        var lh= cstr(_p.letter_heads[doc.letter_head]);\n    else if(cp.letter_head)\n        var lh= cp.letter_head;\n    else \n        var lh= '';\n        \n    return lh;\n}\n\nfunction get_tax_details(){\n    var cl = getchildren('Sales Taxes and Charges',doc.name,'other_charges');\n    var out = '';\n\n    out += '<div><table style=\"float: right;\">';\n    for(var i=0;i<cl.length;i++){\n        if(cl[i].tax_amount) {\n            out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n        }\n    }\n    out += make_row1('TOTAL',doc.currency + \" \" + fmt_money(convert_rate(doc.grand_total)),1);\n    out +='</table></div>';\n    return out;\n}\n\nfunction convert_rate(val){    \n    var new_val = flt(val)/flt(doc.conversion_rate);\n    return new_val;\n}\n</script>\n<style>\n    table, td, tr, div, span {\n        font-family: courier new;\n        line-height: 200%;\n    }\n</style>\n</head>\n\n<body>\n<table width=\"100%\" style=\"font-family: courier new; line-height:200%\">\n<tr>\n    <td align=\"left\">NO: <script>doc.name</script></td>\n    <td align=\"right\">DATE: <script>date.str_to_user(doc.posting_date)</script></td>\n</tr>\n<tr>\n    <td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n<script>\nvar t = print_table(\n    \t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'description', 'qty', 'export_rate', 'export_amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Description', 'Qty', 'Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'5%', '35%', '20%', '20%', '20%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\nif(t.appendChild) { // single\n    out = t.innerHTML.replace(/style=\"/gi,'style=\"font-family:courier new;line-height:150%;');\n} else { //multiple\n    out = '<table class=\"None\" border=\"0px\" width=\"100%\" style=\"border:0px; font-family:courier-new\">';\n\n    for(var i=0;i<t.length;i++) {\n        if(i==0) {\n            out += '<tr>' + t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML\n                .replace(/style=\"border: 1px solid rgb\\(0, 0, 0\\);/gi,'style=\"font-family:courier new;')\n                + '</tr>';\n        }\n        out += '<tr>' + t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML\n                .replace(/style=\"border: 1px solid rgb\\(0, 0, 0\\);/gi,'style=\"font-family:courier new;')\n                + '</tr>';\n    }\n    out += '</table>';\n}\nout;\n</script>\n</div>\n<!--Tax table-->\n<div><script>get_tax_details();</script></div><br />\n<table style=\"font-family:courier new;\">\n    <tr><td><b><script>doc.terms</script></b></td></tr>\n    <tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n    <tr><td>&nbsp;</td></tr>\n    <tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>\n", 
+  "html": "<html>\n<head>\n<!--Item Table, Totals and Other Charges-->\n<script>\nfunction get_print_format() {\n\tvar oc = getchildren('Sales Invoice Item', doc.name, 'entries');\n\tvar rows = '<table width=\"100%\" cellpadding=\"0\" class=\"cart\">\\\n                <tr>\\\n                    <td colspan=\"3\">------------------------------------------------------</td>\\\n                </tr>\\\n                <tr>\\\n                    <td width=\"60%\" align=\"left\">ITEM CODE/DESC.</td>\\\n                    <td width=\"10%\" align=\"right\">QTY</td>\\\n                    <td width=\"30%\" align=\"right\">RATE</td>\\\n                </tr>\\\n                <tr>\\\n                    <td colspan=\"3\">------------------------------------------------------</td>\\\n                </tr>';\n\tfor (var x=0; x<oc.length; x++) {\n\t\trows += '<tr>\\\n                    <td align=\"left\">' + oc[x].item_code + '<br>' + oc[x].item_name + '</td>\\\n                    <td align=\"right\" style=\"vertical-align:top;\">' + oc[x].qty + '</td>\\\n                    <td align=\"right\"><strong>' + format_currency(oc[x].export_amount) + '</strong><br>' + format_currency(oc[x].ref_rate) + '</td>\\\n                </tr>';\n\t}\n    rows += '<tr>\\\n                <td colspan=\"3\">------------------------------------------------------</td>\\\n            </tr>\\\n            <tr>\\\n                <td colspan=\"2\" align=\"right\">Net Total</td>\\\n                <td align=\"right\">' + format_currency(doc.net_total_export) + '</td>\\\n            </tr>';\n    if (doc.other_charges_total_export != 0) {\n        var taxes = wn.model.get_children(\"Sales Taxes and Charges\", doc.name, \"other_charges\", \"Sales Invoice\");\n\t\t$.each(taxes, function(i, d) {\n\t\t\trows += '<tr>\\\n        \t\t\t\t<td colspan=\"2\" align=\"right\">' + d.description + '</td>\\\n        \t\t\t\t<td style=\"text-align: right;\">' + format_currency(d.tax_amount) + '</td>\\\n        \t\t\t<tr>';\n\t\t});\n    }\n    rows += '<tr>\\\n                <td colspan=\"2\" align=\"right\" style=\"vertical-align:middle;\">Grand Total</td>\\\n                <td align=\"right\">==============<br>' + format_currency(doc.grand_total_export) + '<br>==============</td>\\\n            </tr>\\\n            <tr>\\\n                <td align=\"center\" colspan=\"3\">Thank You. Please visit again.</td>\\\n            </tr>\\\n            </table>';\n\treturn rows;\n}\n</script>\n<style>\n    table, tr, td, div {\n        font-family: Monospace;\n        line-height: 200%;\n    }\n    h1, h2, h3, h4, h5, h6 {\n        text-align: center;\n    }\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 4in;\n\t\t}\n\t}\n</style>\n</head>\n\n<body>\n<table width=\"100%\" cellpadding=\"4\">\n    <tr>\n        <td align=\"left\">RECEIPT NO: <script>doc.name</script></td>\n        <td align=\"right\">DATE: <script>date.str_to_user(doc.posting_date)</script></td>\n    </tr>\n    <tr>\n        <td>M/s <script>doc.customer</script></td>\n    </tr>\n</table>\n<!--Item Table & Totals-->\n<div><script>get_print_format();</script></div>\n</body>\n</html>\n", 
   "module": "Accounts", 
   "name": "__common__", 
   "print_format_type": "Client",