[Mod] point_of_sale.js: Allowed print before pay and saved the invoice before print
[New] test_point_of_sale.js: Test Cases to check the print before pay functionality in Online POS
This commit is contained in:
parent
29abe291c9
commit
1ccb0cfa2f
@ -519,13 +519,20 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
if(this.frm.doc.docstatus == 1 || this.frm.doc.allow_print_before_pay == 1){
|
if(this.frm.doc.docstatus == 1 || this.frm.doc.allow_print_before_pay == 1){
|
||||||
|
|
||||||
this.page.set_secondary_action(__("Print"), () => {
|
this.page.set_secondary_action(__("Print"), () => {
|
||||||
|
if(this.frm.doc.docstatus != 1 ){
|
||||||
|
this.frm.save();
|
||||||
|
setTimeout(() => {this.frm.print_preview.printit(true);}, 1700);
|
||||||
|
}else{
|
||||||
this.frm.print_preview.printit(true);
|
this.frm.print_preview.printit(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.page.set_primary_action(__("New"), () => {
|
this.page.set_primary_action(__("New"), () => {
|
||||||
this.make_new_invoice();
|
this.make_new_invoice();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.frm.doc.docstatus == 1) {
|
||||||
this.page.add_menu_item(__("Email"), () => {
|
this.page.add_menu_item(__("Email"), () => {
|
||||||
this.frm.email_doc();
|
this.frm.email_doc();
|
||||||
});
|
});
|
||||||
|
@ -127,7 +127,6 @@ def item_group_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def fetch_pos_profile_detail(pos_profile):
|
def fetch_pos_profile_detail(pos_profile):
|
||||||
doc_detail=frappe.get_doc("POS Profile",pos_profile)
|
pos_profile_doc = frappe.get_doc("POS Profile",pos_profile)
|
||||||
print_check=doc_detail.allow_print_before_pay
|
allow_print_before_pay_check = pos_profile_doc.allow_print_before_pay
|
||||||
return print_check
|
return allow_print_before_pay_check
|
||||||
|
|
@ -13,6 +13,9 @@ QUnit.test("test:Point of Sales", function(assert) {
|
|||||||
() => frappe.timeout(0.2),
|
() => frappe.timeout(0.2),
|
||||||
() => frappe.click_element(`.cart-items [data-item-code="Test Product 2"]`),
|
() => frappe.click_element(`.cart-items [data-item-code="Test Product 2"]`),
|
||||||
() => frappe.timeout(0.2),
|
() => frappe.timeout(0.2),
|
||||||
|
() => frappe.click_element(`.btn-secondary`),
|
||||||
|
() => frappe.timeout(0.4),
|
||||||
|
() => assert.ok(!cur_frm.doc.__islocal, "Sales invoice saved"),
|
||||||
() => frappe.click_element(`.number-pad [data-value="Rate"]`),
|
() => frappe.click_element(`.number-pad [data-value="Rate"]`),
|
||||||
() => frappe.timeout(0.2),
|
() => frappe.timeout(0.2),
|
||||||
() => frappe.click_element(`.number-pad [data-value="2"]`),
|
() => frappe.click_element(`.number-pad [data-value="2"]`),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user