mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
fix to packing slip (validation)
This commit is contained in:
@@ -88,7 +88,7 @@ cur_frm.cscript.validate_duplicate_items = function(doc, ps_detail) {
|
||||
// Calculate Net Weight of Package
|
||||
cur_frm.cscript.calc_net_total_pkg = function(doc, ps_detail) {
|
||||
var net_weight_pkg = 0;
|
||||
doc.net_weight_uom = ps_detail?ps_detail[0].weight_uom:'';
|
||||
doc.net_weight_uom = (ps_detail && ps_detail.length) ? ps_detail[0].weight_uom : '';
|
||||
doc.gross_weight_uom = doc.net_weight_uom;
|
||||
|
||||
for(var i=0; i<ps_detail.length; i++) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"description": "Indicates that the package is a part of this delivery",
|
||||
"description": "Indicates that the package is a part of this delivery (Only Draft)",
|
||||
"fieldname": "delivery_note",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
@@ -63,8 +63,8 @@
|
||||
"description": "Identification of the package for the delivery (for print)",
|
||||
"fieldname": "from_case_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "From Package No.",
|
||||
"in_list_view": 1,
|
||||
"label": "From Package No.",
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"read_only": 0,
|
||||
@@ -81,8 +81,8 @@
|
||||
"description": "If more than one package of the same type (for print)",
|
||||
"fieldname": "to_case_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "To Package No.",
|
||||
"in_list_view": 1,
|
||||
"label": "To Package No.",
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"read_only": 0,
|
||||
@@ -180,7 +180,7 @@
|
||||
"icon": "icon-suitcase",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2014-05-06 08:20:35.134198",
|
||||
"modified": "2014-05-26 03:19:59.409839",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Packing Slip",
|
||||
|
||||
@@ -54,10 +54,12 @@ class PackingSlip(Document):
|
||||
|
||||
res = frappe.db.sql("""SELECT name FROM `tabPacking Slip`
|
||||
WHERE delivery_note = %(delivery_note)s AND docstatus = 1 AND
|
||||
(from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s
|
||||
OR to_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s
|
||||
OR %(from_case_no)s BETWEEN from_case_no AND to_case_no)
|
||||
""", self.as_dict())
|
||||
((from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s)
|
||||
OR (to_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s)
|
||||
OR (%(from_case_no)s BETWEEN from_case_no AND to_case_no))
|
||||
""", {"delivery_note":self.delivery_note,
|
||||
"from_case_no":self.from_case_no,
|
||||
"to_case_no":self.to_case_no}, debug=1)
|
||||
|
||||
if res:
|
||||
frappe.throw(_("""Case No(s) already in use. Try from Case No {0}""").format(self.get_recommended_case_no()))
|
||||
|
||||
Reference in New Issue
Block a user