HI,
I am creating a pos print format
so i wrote a following code in my custom print format
{%- if number <= 0 -%}
{% set number = 10 %}
{% endif %}```
i am getting follwing error on console of browser
var _p=[],print=function(){_p.push.apply(_p,arguments)};with(obj){
_p.push(' POS @media screen { .print-format-gutter { background-color: #ddd; padding: 15px 0px; } .print-format { background-color: white; box-shadow: 0px 0px 9px rgba(0,0,0,0.5); max-width: 8.3in; min-height: 11.69in; padding: 0.75in; margin: auto; } .print-format.landscape { max-width: 11.69in; padding: 0.2in; } .page-break { padding: 30px 0px; border-bottom: 1px dashed #888; } .page-break:first-child { padding-top: 0px; } .page-break:last-child { border-bottom: 0px; } /* mozilla hack for images in table / body:last-child .print-format td img { width: 100% !important; } @media(max-width: 767px) { .print-format { padding: 0.2in; } } } @media print { .print-format p { margin-left: 1px; margin-right: 1px; } } .data-field { margin-top: 5px; margin-bottom: 5px; } .data-field .value { word-wrap: break-word; } .important .value { font-size: 120%; font-weight: bold; } .important label { line-height: 1.8; margin: 0px; } .table { margin: 20px 0px; } .square-image { width: 100%; height: 0; padding: 50% 0; background-size: contain; /background-size: cover;/ background-repeat: no-repeat !important; background-position: center center; border-radius: 4px; } .print-item-image { object-fit: contain; } .pdf-variables, .pdf-variable, .visible-pdf { display: none !important; } .print-format { font-size: 9pt; font-family: “Helvetica Neue”, Helvetica, Arial, “Open Sans”, sans-serif; -webkit-print-color-adjust:exact; } .page-break { page-break-after: always; } .print-heading { border-bottom: 1px solid #aaa; margin-bottom: 10px; } .print-heading h2 { margin: 0px; } .print-heading h4 { margin-top: 5px; } table.no-border, table.no-border td { border: 0px; } .print-format label { / wkhtmltopdf breaks label into multiple lines when it is inline-block / display: block; } .print-format img { max-width: 100%; } .print-format table td > .primary:first-child { font-weight: bold; } .print-format td, .print-format th { vertical-align: top !important; padding: 6px !important; } .print-format p { margin: 3px 0px 3px; } table td div { / needed to avoid partial cutting of text between page break in wkhtmltopdf / page-break-inside: avoid !important; } / hack for webkit specific browser / @media (-webkit-min-device-pixel-ratio:0) { thead, tfoot { display: table-row-group; } } [document-status] { margin-bottom: 5mm; }.print-heading { text-align: right; text-transform: uppercase; color: #666; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #d1d8dd; } .print-heading h2 { font-size: 24px; } .print-format th { background-color: #eee !important; border-bottom: 0px !important; } / modern format: don't remove this line /
Page of
set number = frappe.db.get_value(“Print Settings”, None, “no_of_row_per_page”) | int
_p.push(’ ');
- if number <= 0 -
_p.push(’ ‘);
set number = 10
_p.push(’ ‘);
};
_p.push(’No: ‘, offline_pos_name ,’‘, __(“Date:”),’ ‘,dateutil.global_date_format(posting_date),’ ‘, __(“التاريخ”),’‘, __(“Mr./M/s:”) ,’ ‘, customer ,’‘, __("الفاضل/ الفاضلة ") ,’‘, __(“L.P.O.No:”) ,’ ‘,“” ,’‘, __(“Date:”) ,’ ‘, dateutil.global_date_format(posting_date) ,’‘, __(“D.O.No:”) ,’ ‘,“”,’‘, __(“Date:”) ,’ ‘, dateutil.global_date_format(posting_date) ,’‘);
for (var PFC=0, qMi=items.length; PFC<qMi; PFC++) { var item = items[PFC]; item._index = PFC;
_p.push(’ ‘);
};
_p.push(’‘, __(“الرقم”) ,’ ‘, __(“Qty”) ,’ ‘, __(“U.Price”) ,’ ‘, __(“سعر الوحدة”) ,’ ‘, __(“Amount”) ,’ ‘, __(“المبلغ”) ,’ ‘, __(“S.No.”) ,’ ‘, __(“Description”) ,’ ‘, __(“التفاصيل”) ,’ ‘, __(“العدد”) ,’ ‘, __("ريال عماني ") ,’
‘, __(“R.O.”) ,’‘, __(“بيسة”) ,’
‘, __(“Bzs.”),’‘, __("ريال عماني ") ,’
‘, __(“R.O.”) ,’‘, __(“بيسة”) ,’
‘, __(“Bzs.”) ,’‘);
if (item.idx ) {
_p.push(’ ‘, item.idx,’ ‘);
} else {
_p.push(’ ‘);
};
_p.push(’‘);
if (item.item_name ) {
_p.push(’ ‘, item.item_name ,’ ‘);
};
_p.push(’‘);
if (item.qty ) {
_p.push(’ ‘,item.qty ,’ ‘);
};
_p.push(’‘);
if (item.rate_integer_part ) {
_p.push(’ ‘, item.rate_integer_part ,’ ‘);
};
_p.push(’‘);
if (item.rate_fractional_part ) {
_p.push(’‘, item.rate_fractional_part ,’‘);
};
_p.push(’‘);
if (item.amount_integer_part ) {
_p.push(’ ‘, item.amount_integer_part ,’‘);
};
_p.push(’‘);
if (item.amount_fractional_part ) {
_p.push(’ ‘, item.amount_fractional_part ,’ ‘);
};
_p.push(’‘, __(“Total R.O:”) ,’ ‘, total_in_words,’ ‘, __(“المجموع الريال العماني”) ,’ ‘, total_integer_part ,’ ‘, total_fractional_part ,’ ‘, __(“For”) ,’ ‘, __(“Majan Telecommunication & Information Technology LLC”) ,’‘, __(“Receiver’s Sign: …توقيع المستلم”) ,’‘, __(“Signature: …التوقيع”) ,’C.R.No.1284805, P.O.Box: 463, P.C:121, Al-Seeb, Way No:4803, Bldg. No:209, Al-Azaiba, Sultanate of Oman, Tel: +968 24820911
‘, __(“E-mail:sales@majantel.com - www.majantel.on”) ,’
desk.min.js?ver=1525935573.0:2512 Uncaught TypeError: frappe.template.compile(…) is not a function
at Object.frappe.render (desk.min.js?ver=1525935573.0:2512)
at HTMLButtonElement. (:2137:23)
at HTMLButtonElement. (desk.min.js?ver=1525935573.0:3031)
at HTMLButtonElement.dispatch (jquery.min.js:3)
at HTMLButtonElement.$event.dispatch (report.min.js?ver=1525935573.0:2958)
at HTMLButtonElement.r.handle (jquery.min.js:3)