mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-12 17:51:20 +00:00
synced to upstream
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
'client_script_core': None,
|
||||
'client_string': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2011-06-22 16:08:49',
|
||||
'creation': '2011-06-23 11:03:25',
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocType',
|
||||
@@ -29,7 +29,7 @@
|
||||
'istable': None,
|
||||
'max_attachments': None,
|
||||
'menu_index': None,
|
||||
'modified': '2011-06-22 16:24:18',
|
||||
'modified': '2011-06-23 11:03:25',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Tools',
|
||||
'name': 'Rename Tool',
|
||||
@@ -59,15 +59,15 @@
|
||||
'amend': None,
|
||||
'cancel': None,
|
||||
'create': 1,
|
||||
'creation': '2011-06-22 16:08:49',
|
||||
'creation': '2011-06-23 11:03:25',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': 1,
|
||||
'match': None,
|
||||
'modified': '2011-06-22 16:24:18',
|
||||
'modified': '2011-06-23 11:03:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00829',
|
||||
'name': 'PERM00859',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Rename Tool',
|
||||
'parentfield': 'permissions',
|
||||
@@ -81,7 +81,7 @@
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-06-22 16:08:49',
|
||||
'creation': '2011-06-23 11:03:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
@@ -94,9 +94,9 @@
|
||||
'idx': 1,
|
||||
'in_filter': None,
|
||||
'label': 'Select DocType',
|
||||
'modified': '2011-06-22 16:24:18',
|
||||
'modified': '2011-06-23 11:03:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL05282',
|
||||
'name': 'FL05599',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
@@ -117,7 +117,7 @@
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-06-22 16:08:49',
|
||||
'creation': '2011-06-23 11:03:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
@@ -130,9 +130,9 @@
|
||||
'idx': 2,
|
||||
'in_filter': None,
|
||||
'label': 'Document to rename',
|
||||
'modified': '2011-06-22 16:24:18',
|
||||
'modified': '2011-06-23 11:03:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL05283',
|
||||
'name': 'FL05600',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
@@ -153,7 +153,7 @@
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-06-22 16:08:49',
|
||||
'creation': '2011-06-23 11:03:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
@@ -166,9 +166,9 @@
|
||||
'idx': 3,
|
||||
'in_filter': None,
|
||||
'label': 'New Name',
|
||||
'modified': '2011-06-22 16:24:18',
|
||||
'modified': '2011-06-23 11:03:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL05284',
|
||||
'name': 'FL05601',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
@@ -189,7 +189,7 @@
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-06-22 16:08:49',
|
||||
'creation': '2011-06-23 11:03:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
@@ -202,9 +202,9 @@
|
||||
'idx': 4,
|
||||
'in_filter': None,
|
||||
'label': 'Rename',
|
||||
'modified': '2011-06-22 16:24:18',
|
||||
'modified': '2011-06-23 11:03:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL05285',
|
||||
'name': 'FL05602',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
|
||||
@@ -57,7 +57,7 @@ class DocType:
|
||||
|
||||
|
||||
# get reserved_qty
|
||||
res_qty =sql("select sum(if ( ifnull(t2.qty, 0) > ifnull(t2.delivered_qty, 0), ifnull(t2.qty, 0) - ifnull(t2.delivered_qty, 0) , 0) ) from `tabSales Order` t1, `tabSales Order Detail` t2 where t1.name = t2.parent and t1.docstatus = 1 and t2.reserved_warehouse = '%s' and t2.item_code = '%s' " % (wh, item))
|
||||
res_qty =sql("select sum(if ( ifnull(t2.qty, 0) > ifnull(t2.delivered_qty, 0), ifnull(t2.qty, 0) - ifnull(t2.delivered_qty, 0) , 0) ) from `tabSales Order` t1, `tabSales Order Detail` t2 where t1.name = t2.parent and t1.docstatus = 1 and t2.reserved_warehouse = '%s' and t2.item_code = '%s' " % (wh, item))
|
||||
res_qty = res_qty and flt(res_qty[0][0]) or 0
|
||||
|
||||
# get planned_qty
|
||||
@@ -95,8 +95,9 @@ class DocType:
|
||||
# check bin qty
|
||||
self.check_bin_qty(bin_obj, qty_dict)
|
||||
|
||||
projected_qty = flt(qty_dict['indented_qty']) + flt(qty_dict['ordered_qty']) - flt(qty_dict['reserved_qty']) + flt(qty_dict['planned_qty']) + flt(qty_dict['actual_qty'])
|
||||
# update indented_qty, ordered_qty, reserved_qty, planned_qty
|
||||
sql("update `tabBin` set indented_qty = '%s', ordered_qty = '%s', reserved_qty = '%s', planned_qty = '%s' where warehouse = '%s' and item_code = '%s'" % ( flt(qty_dict['indented_qty']), flt(qty_dict['ordered_qty']), flt(qty_dict['reserved_qty']), flt(qty_dict['planned_qty']), bin_obj.doc.warehouse, bin_obj.doc.item_code))
|
||||
sql("update `tabBin` set indented_qty = '%s', ordered_qty = '%s', reserved_qty = '%s', planned_qty = '%s', projected_qty = '%s' where warehouse = '%s' and item_code = '%s'" % ( flt(qty_dict['indented_qty']), flt(qty_dict['ordered_qty']), flt(qty_dict['reserved_qty']), flt(qty_dict['planned_qty']), projected_qty, bin_obj.doc.warehouse, bin_obj.doc.item_code))
|
||||
|
||||
# update projected_qty
|
||||
sql("update `tabBin` set projected_qty = ifnull(indented_qty, 0) + ifnull(ordered_qty,0) + ifnull(actual_qty, 0) + ifnull(planned_qty, 0) - ifnull(reserved_qty,0) where warehouse = '%s' and item_code = '%s' " % (bin_obj.doc.warehouse, bin_obj.doc.item_code))
|
||||
@@ -115,7 +116,7 @@ class DocType:
|
||||
sql("commit")
|
||||
sql("start transaction")
|
||||
cnt += 1
|
||||
|
||||
|
||||
self.repair_bin(bin[0])
|
||||
|
||||
# =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user