mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
Merge branch 'version-13-hotfix' into supplier_defaults_v13hf
This commit is contained in:
@@ -28,4 +28,4 @@ frappe.tour['Buying Settings'] = [
|
||||
title: "Purchase Receipt Required for Purchase Invoice Creation",
|
||||
description: __("If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice without creating a Purchase Receipt first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Receipt' checkbox in the Supplier master.")
|
||||
}
|
||||
];
|
||||
];
|
||||
|
||||
@@ -565,6 +565,7 @@
|
||||
"fieldname": "scan_barcode",
|
||||
"fieldtype": "Data",
|
||||
"label": "Scan Barcode",
|
||||
"options": "Barcode",
|
||||
"show_days": 1,
|
||||
"show_seconds": 1
|
||||
},
|
||||
@@ -1378,7 +1379,7 @@
|
||||
"idx": 105,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-05-30 15:17:53.663648",
|
||||
"modified": "2021-08-17 20:16:12.737743",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Purchase Order",
|
||||
|
||||
@@ -447,10 +447,11 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
|
||||
target.flags.ignore_permissions = ignore_permissions
|
||||
set_missing_values(source, target)
|
||||
#Get the advance paid Journal Entries in Purchase Invoice Advance
|
||||
|
||||
if target.get("allocate_advances_automatically"):
|
||||
target.set_advances()
|
||||
|
||||
target.set_payment_schedule()
|
||||
|
||||
def update_item(obj, target, source_parent):
|
||||
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||
target.base_amount = target.amount * flt(source_parent.conversion_rate)
|
||||
@@ -470,6 +471,7 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
|
||||
"party_account_currency": "party_account_currency",
|
||||
"supplier_warehouse":"supplier_warehouse"
|
||||
},
|
||||
"field_no_map" : ["payment_terms_template"],
|
||||
"validation": {
|
||||
"docstatus": ["=", 1],
|
||||
}
|
||||
@@ -489,12 +491,6 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
|
||||
},
|
||||
}
|
||||
|
||||
if frappe.get_single("Accounts Settings").automatically_fetch_payment_terms == 1:
|
||||
fields["Payment Schedule"] = {
|
||||
"doctype": "Payment Schedule",
|
||||
"add_if_empty": True
|
||||
}
|
||||
|
||||
doc = get_mapped_doc("Purchase Order", source_name, fields,
|
||||
target_doc, postprocess, ignore_permissions=ignore_permissions)
|
||||
|
||||
@@ -639,4 +635,4 @@ def add_items_in_ste(ste_doc, row, qty, po_details, batch_no=None):
|
||||
'item_code': row.item_details['rm_item_code'],
|
||||
'subcontracted_item': row.item_details['main_item_code'],
|
||||
'serial_no': '\n'.join(row.serial_no) if row.serial_no else ''
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% include "erpnext/regional/india/taxes.js" %}
|
||||
|
||||
erpnext.setup_auto_gst_taxation('Purchase Order');
|
||||
erpnext.setup_auto_gst_taxation('Purchase Order');
|
||||
|
||||
@@ -484,6 +484,9 @@ class TestPurchaseOrder(unittest.TestCase):
|
||||
|
||||
|
||||
def test_make_purchase_invoice_with_terms(self):
|
||||
from erpnext.selling.doctype.sales_order.test_sales_order import automatically_fetch_payment_terms, compare_payment_schedules
|
||||
|
||||
automatically_fetch_payment_terms()
|
||||
po = create_purchase_order(do_not_save=True)
|
||||
|
||||
self.assertRaises(frappe.ValidationError, make_pi_from_po, po.name)
|
||||
@@ -509,6 +512,7 @@ class TestPurchaseOrder(unittest.TestCase):
|
||||
self.assertEqual(getdate(pi.payment_schedule[0].due_date), getdate(po.transaction_date))
|
||||
self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0)
|
||||
self.assertEqual(getdate(pi.payment_schedule[1].due_date), add_days(getdate(po.transaction_date), 30))
|
||||
automatically_fetch_payment_terms(enable=0)
|
||||
|
||||
def test_subcontracting(self):
|
||||
po = create_purchase_order(item_code="_Test FG Item", is_subcontracted="Yes")
|
||||
@@ -632,14 +636,18 @@ class TestPurchaseOrder(unittest.TestCase):
|
||||
else:
|
||||
raise Exception
|
||||
|
||||
def test_terms_does_not_copy(self):
|
||||
po = create_purchase_order()
|
||||
|
||||
self.assertTrue(po.get('payment_schedule'))
|
||||
def test_terms_are_not_copied_if_automatically_fetch_payment_terms_is_unchecked(self):
|
||||
po = create_purchase_order(do_not_save=1)
|
||||
po.payment_terms_template = '_Test Payment Term Template'
|
||||
po.save()
|
||||
po.submit()
|
||||
|
||||
frappe.db.set_value('Company', '_Test Company', 'payment_terms', '_Test Payment Term Template 1')
|
||||
pi = make_pi_from_po(po.name)
|
||||
pi.save()
|
||||
|
||||
self.assertFalse(pi.get('payment_schedule'))
|
||||
self.assertEqual(pi.get('payment_terms_template'), '_Test Payment Term Template 1')
|
||||
frappe.db.set_value('Company', '_Test Company', 'payment_terms', '')
|
||||
|
||||
def test_terms_copied(self):
|
||||
po = create_purchase_order(do_not_save=1)
|
||||
@@ -968,8 +976,27 @@ class TestPurchaseOrder(unittest.TestCase):
|
||||
# To test if the PO does NOT have a Blanket Order
|
||||
self.assertEqual(po_doc.items[0].blanket_order, None)
|
||||
|
||||
def test_payment_terms_are_fetched_when_creating_purchase_invoice(self):
|
||||
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template
|
||||
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
|
||||
from erpnext.selling.doctype.sales_order.test_sales_order import automatically_fetch_payment_terms, compare_payment_schedules
|
||||
|
||||
automatically_fetch_payment_terms()
|
||||
|
||||
po = create_purchase_order(qty=10, rate=100, do_not_save=1)
|
||||
create_payment_terms_template()
|
||||
po.payment_terms_template = 'Test Receivable Template'
|
||||
po.submit()
|
||||
|
||||
pi = make_purchase_invoice(qty=10, rate=100, do_not_save=1)
|
||||
pi.items[0].purchase_order = po.name
|
||||
pi.items[0].po_detail = po.items[0].name
|
||||
pi.insert()
|
||||
|
||||
# self.assertEqual(po.payment_terms_template, pi.payment_terms_template)
|
||||
compare_payment_schedules(self, po, pi)
|
||||
|
||||
automatically_fetch_payment_terms(enable=0)
|
||||
|
||||
def make_pr_against_po(po, received_qty=0):
|
||||
pr = make_purchase_receipt(po)
|
||||
|
||||
@@ -77,4 +77,4 @@ QUnit.test("test: purchase order", function(assert) {
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -58,4 +58,4 @@ QUnit.test("test: purchase order with get items", function(assert) {
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,4 +44,4 @@ QUnit.test("test: purchase order with discount on grand total", function(assert)
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,4 +41,4 @@ QUnit.test("test: purchase order with item wise discount", function(assert) {
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,4 +36,4 @@ QUnit.test("test: purchase order with multi UOM", function(assert) {
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,4 +40,4 @@ QUnit.test("test: purchase order with shipping rule", function(assert) {
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,4 +41,4 @@ QUnit.test("test: purchase order with taxes and charges", function(assert) {
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,4 +10,4 @@ class PurchaseOrderItem(Document):
|
||||
pass
|
||||
|
||||
def on_doctype_update():
|
||||
frappe.db.add_index("Purchase Order Item", ["item_code", "warehouse"])
|
||||
frappe.db.add_index("Purchase Order Item", ["item_code", "warehouse"])
|
||||
|
||||
@@ -7,4 +7,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class PurchaseOrderItemSupplied(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class PurchaseReceiptItemSupplied(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -425,4 +425,4 @@ def get_rfq_containing_supplier(doctype, txt, searchfield, start, page_len, filt
|
||||
.format(filters.get("supplier"), filters.get("company"), conditions),
|
||||
{"page_len": page_len, "start": start}, as_dict=1)
|
||||
|
||||
return rfq_data
|
||||
return rfq_data
|
||||
|
||||
@@ -10,4 +10,4 @@ def get_data():
|
||||
'items': ['Supplier Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,4 @@ QUnit.test("test: request_for_quotation", function(assert) {
|
||||
() => frappe.click_button('Close'),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -125,4 +125,4 @@ QUnit.test("Test: Request for Quotation", function (assert) {
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% include "erpnext/regional/india/party.js" %}
|
||||
|
||||
erpnext.setup_gst_reminder_button('Supplier');
|
||||
erpnext.setup_gst_reminder_button('Supplier');
|
||||
|
||||
@@ -74,4 +74,4 @@ QUnit.test("test: supplier", function(assert) {
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,4 +15,4 @@ class SupplierItemGroup(Document):
|
||||
'item_group': self.item_group
|
||||
})
|
||||
if exists:
|
||||
frappe.throw(_("Item Group has already been linked to this supplier."))
|
||||
frappe.throw(_("Item Group has already been linked to this supplier."))
|
||||
|
||||
@@ -166,4 +166,4 @@ def set_expired_status():
|
||||
`tabSupplier Quotation` SET `status` = 'Expired'
|
||||
WHERE
|
||||
`status` not in ('Cancelled', 'Stopped') AND `valid_till` < %s
|
||||
""", (nowdate()))
|
||||
""", (nowdate()))
|
||||
|
||||
@@ -71,4 +71,4 @@ QUnit.test("test: supplier quotation", function(assert) {
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,4 +31,4 @@ QUnit.test("test: supplier quotation with item wise discount", function(assert){
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -34,4 +34,4 @@ QUnit.test("test: supplier quotation with taxes and charges", function(assert) {
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -93,5 +93,3 @@ var loadAllStandings = function(frm) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -13,4 +13,4 @@ def get_data():
|
||||
'items': ['Supplier Scorecard Period']
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,4 +128,3 @@ valid_scorecard = [
|
||||
"weighting_function":"{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -72,4 +72,4 @@ test_bad_criteria = [
|
||||
"criteria_name":"Fake Criteria 3",
|
||||
"max_score":100.0
|
||||
},
|
||||
]
|
||||
]
|
||||
|
||||
@@ -109,4 +109,3 @@ def make_supplier_scorecard(source_name, target_doc=None):
|
||||
}, target_doc, post_process, ignore_permissions=True)
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
@@ -26,4 +26,4 @@ def get_standings_list():
|
||||
`tabSupplier Scorecard Standing` scs""",
|
||||
{}, as_dict=1)
|
||||
|
||||
return standings
|
||||
return standings
|
||||
|
||||
@@ -493,4 +493,4 @@ def get_rfq_response_days(scorecard):
|
||||
total_sq_days = 0
|
||||
|
||||
|
||||
return total_sq_days
|
||||
return total_sq_days
|
||||
|
||||
@@ -54,4 +54,4 @@ test_bad_variables = [
|
||||
"variable_label":"Fake Variable 1",
|
||||
"path":"get_fake_variable1"
|
||||
},
|
||||
]
|
||||
]
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
"name": "Drop Shipping Format",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Server",
|
||||
"print_format_type": "Jinja",
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -296,4 +296,4 @@ def get_po_entries(conditions):
|
||||
{conditions}
|
||||
GROUP BY
|
||||
parent.name, child.item_code
|
||||
""".format(conditions=conditions), as_dict=1) #nosec
|
||||
""".format(conditions=conditions), as_dict=1) #nosec
|
||||
|
||||
@@ -68,4 +68,4 @@ class TestProcurementTracker(unittest.TestCase):
|
||||
"actual_delivery_date": date_obj
|
||||
}
|
||||
|
||||
return expected_data
|
||||
return expected_data
|
||||
|
||||
@@ -268,4 +268,3 @@ def get_columns(filters):
|
||||
])
|
||||
|
||||
return columns
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ frappe.require("assets/erpnext/js/purchase_trends_filters.js", function() {
|
||||
frappe.query_reports["Purchase Order Trends"] = {
|
||||
filters: erpnext.get_purchase_trends_filters()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,4 +55,4 @@ def get_chart_data(data, conditions, filters):
|
||||
"lineOptions": {
|
||||
"regionFill": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,4 +149,4 @@ def get_columns():
|
||||
"fieldtype": "Float",
|
||||
"width": 110
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -33,4 +33,4 @@ def make_purchase_receipt_against_po(po, quantity=5):
|
||||
pr.items[0].qty = quantity
|
||||
pr.supplier_warehouse = '_Test Warehouse 1 - _TC'
|
||||
pr.insert()
|
||||
pr.submit()
|
||||
pr.submit()
|
||||
|
||||
@@ -94,4 +94,4 @@ def get_po_items_to_supply(filters):
|
||||
["Purchase Order", "transaction_date", ">=", filters.from_date],
|
||||
["Purchase Order", "docstatus", "=", 1]
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -129,4 +129,4 @@
|
||||
|
||||
|
||||
|
||||
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
|
||||
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
|
||||
|
||||
@@ -174,4 +174,4 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,4 +263,4 @@ def get_message():
|
||||
|
||||
<span class="indicator red">
|
||||
Expires today / Already Expired
|
||||
</span>"""
|
||||
</span>"""
|
||||
|
||||
@@ -102,4 +102,3 @@ def get_linked_material_requests(items):
|
||||
mr_list.append(material_request)
|
||||
|
||||
return mr_list
|
||||
|
||||
|
||||
Reference in New Issue
Block a user