mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
Merge branch 'develop' into pos-fixes-9
This commit is contained in:
@@ -385,13 +385,16 @@ def validate_totals(einvoice):
|
|||||||
if abs(flt(value_details['AssVal']) - total_item_ass_value) > 1:
|
if abs(flt(value_details['AssVal']) - total_item_ass_value) > 1:
|
||||||
frappe.throw(_('Total Taxable Value of the items is not equal to the Invoice Net Total. Please check item taxes / discounts for any correction.'))
|
frappe.throw(_('Total Taxable Value of the items is not equal to the Invoice Net Total. Please check item taxes / discounts for any correction.'))
|
||||||
|
|
||||||
if abs(flt(value_details['TotInvVal']) + flt(value_details['Discount']) - flt(value_details['OthChrg']) - total_item_value) > 1:
|
if abs(
|
||||||
|
flt(value_details['TotInvVal']) + flt(value_details['Discount']) -
|
||||||
|
flt(value_details['OthChrg']) - flt(value_details['RndOffAmt']) -
|
||||||
|
total_item_value) > 1:
|
||||||
frappe.throw(_('Total Value of the items is not equal to the Invoice Grand Total. Please check item taxes / discounts for any correction.'))
|
frappe.throw(_('Total Value of the items is not equal to the Invoice Grand Total. Please check item taxes / discounts for any correction.'))
|
||||||
|
|
||||||
calculated_invoice_value = \
|
calculated_invoice_value = \
|
||||||
flt(value_details['AssVal']) + flt(value_details['CgstVal']) \
|
flt(value_details['AssVal']) + flt(value_details['CgstVal']) \
|
||||||
+ flt(value_details['SgstVal']) + flt(value_details['IgstVal']) \
|
+ flt(value_details['SgstVal']) + flt(value_details['IgstVal']) \
|
||||||
+ flt(value_details['OthChrg']) - flt(value_details['Discount'])
|
+ flt(value_details['OthChrg']) + flt(value_details['RndOffAmt']) - flt(value_details['Discount'])
|
||||||
|
|
||||||
if abs(flt(value_details['TotInvVal']) - calculated_invoice_value) > 1:
|
if abs(flt(value_details['TotInvVal']) - calculated_invoice_value) > 1:
|
||||||
frappe.throw(_('Total Item Value + Taxes - Discount is not equal to the Invoice Grand Total. Please check taxes / discounts for any correction.'))
|
frappe.throw(_('Total Item Value + Taxes - Discount is not equal to the Invoice Grand Total. Please check taxes / discounts for any correction.'))
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ class SalesOrder(SellingController):
|
|||||||
# Checks Sales Invoice
|
# Checks Sales Invoice
|
||||||
submit_rv = frappe.db.sql_list("""select t1.name
|
submit_rv = frappe.db.sql_list("""select t1.name
|
||||||
from `tabSales Invoice` t1,`tabSales Invoice Item` t2
|
from `tabSales Invoice` t1,`tabSales Invoice Item` t2
|
||||||
where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus = 1""",
|
where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus < 2""",
|
||||||
self.name)
|
self.name)
|
||||||
|
|
||||||
if submit_rv:
|
if submit_rv:
|
||||||
|
|||||||
@@ -1217,6 +1217,19 @@ class TestSalesOrder(unittest.TestCase):
|
|||||||
# To test if the SO does NOT have a Blanket Order
|
# To test if the SO does NOT have a Blanket Order
|
||||||
self.assertEqual(so_doc.items[0].blanket_order, None)
|
self.assertEqual(so_doc.items[0].blanket_order, None)
|
||||||
|
|
||||||
|
def test_so_cancellation_when_si_drafted(self):
|
||||||
|
"""
|
||||||
|
Test to check if Sales Order gets cancelled if Sales Invoice is in Draft state
|
||||||
|
Expected result: sales order should not get cancelled
|
||||||
|
"""
|
||||||
|
so = make_sales_order()
|
||||||
|
so.submit()
|
||||||
|
si = make_sales_invoice(so.name)
|
||||||
|
si.save()
|
||||||
|
|
||||||
|
self.assertRaises(frappe.ValidationError, so.cancel)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def make_sales_order(**args):
|
def make_sales_order(**args):
|
||||||
so = frappe.new_doc("Sales Order")
|
so = frappe.new_doc("Sales Order")
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ frappe.ui.form.on('Material Request', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (frm.doc.docstatus == 1 && frm.doc.status != 'Stopped') {
|
if (frm.doc.docstatus == 1 && frm.doc.status != 'Stopped') {
|
||||||
if (flt(frm.doc.per_ordered, 2) < 100) {
|
let precision = frappe.defaults.get_default("float_precision");
|
||||||
|
if (flt(frm.doc.per_ordered, precision) < 100) {
|
||||||
let add_create_pick_list_button = () => {
|
let add_create_pick_list_button = () => {
|
||||||
frm.add_custom_button(__('Pick List'),
|
frm.add_custom_button(__('Pick List'),
|
||||||
() => frm.events.create_pick_list(frm), __('Create'));
|
() => frm.events.create_pick_list(frm), __('Create'));
|
||||||
|
|||||||
Reference in New Issue
Block a user