Rushabh Mehta | ad45e31 | 2013-11-20 12:59:58 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
Rushabh Mehta | 793ba6b | 2014-02-14 15:47:51 +0530 | [diff] [blame] | 5 | import frappe |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 6 | |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 7 | from frappe.utils import flt, cstr, nowdate, nowtime |
| 8 | from erpnext.stock.utils import update_bin |
| 9 | from erpnext.stock.stock_ledger import update_entries_after |
| 10 | from erpnext.accounts.utils import get_fiscal_year |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 11 | |
Nabin Hait | 2348a5f | 2014-10-15 15:31:33 +0530 | [diff] [blame] | 12 | def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False): |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 13 | """ |
| 14 | Repost everything! |
| 15 | """ |
Anand Doshi | e9baaa6 | 2014-02-26 12:35:33 +0530 | [diff] [blame] | 16 | frappe.db.auto_commit_on_many_writes = 1 |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 17 | |
Nabin Hait | ca471f4 | 2013-11-20 13:14:12 +0530 | [diff] [blame] | 18 | if allow_negative_stock: |
Nabin Hait | 249bbbc | 2014-11-26 15:35:08 +0530 | [diff] [blame] | 19 | existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock") |
| 20 | frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 21 | |
| 22 | for d in frappe.db.sql("""select distinct item_code, warehouse from |
Nabin Hait | 4ed7f68 | 2013-10-23 11:50:09 +0530 | [diff] [blame] | 23 | (select item_code, warehouse from tabBin |
| 24 | union |
Nabin Hait | c2caae5 | 2013-10-23 12:02:08 +0530 | [diff] [blame] | 25 | select item_code, warehouse from `tabStock Ledger Entry`) a"""): |
Nabin Hait | 8a28ccf | 2014-10-14 11:41:44 +0530 | [diff] [blame] | 26 | try: |
Nabin Hait | 2348a5f | 2014-10-15 15:31:33 +0530 | [diff] [blame] | 27 | repost_stock(d[0], d[1], allow_zero_rate, only_actual) |
Nabin Hait | 8a28ccf | 2014-10-14 11:41:44 +0530 | [diff] [blame] | 28 | frappe.db.commit() |
| 29 | except: |
| 30 | frappe.db.rollback() |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 31 | |
Nabin Hait | ca471f4 | 2013-11-20 13:14:12 +0530 | [diff] [blame] | 32 | if allow_negative_stock: |
Nabin Hait | 249bbbc | 2014-11-26 15:35:08 +0530 | [diff] [blame] | 33 | frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock) |
Anand Doshi | e9baaa6 | 2014-02-26 12:35:33 +0530 | [diff] [blame] | 34 | frappe.db.auto_commit_on_many_writes = 0 |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 35 | |
Nabin Hait | 2348a5f | 2014-10-15 15:31:33 +0530 | [diff] [blame] | 36 | def repost_stock(item_code, warehouse, allow_zero_rate=False, only_actual=False): |
Nabin Hait | f1a07ff | 2014-10-15 12:23:35 +0530 | [diff] [blame] | 37 | repost_actual_qty(item_code, warehouse, allow_zero_rate) |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 38 | |
Nabin Hait | 2348a5f | 2014-10-15 15:31:33 +0530 | [diff] [blame] | 39 | if item_code and warehouse and not only_actual: |
Nabin Hait | 7f3f2a0 | 2014-09-01 18:16:05 +0530 | [diff] [blame] | 40 | update_bin_qty(item_code, warehouse, { |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 41 | "reserved_qty": get_reserved_qty(item_code, warehouse), |
| 42 | "indented_qty": get_indented_qty(item_code, warehouse), |
| 43 | "ordered_qty": get_ordered_qty(item_code, warehouse), |
| 44 | "planned_qty": get_planned_qty(item_code, warehouse) |
| 45 | }) |
| 46 | |
Nabin Hait | f1a07ff | 2014-10-15 12:23:35 +0530 | [diff] [blame] | 47 | def repost_actual_qty(item_code, warehouse, allow_zero_rate=False): |
Nabin Hait | 5048c98 | 2013-10-23 12:14:32 +0530 | [diff] [blame] | 48 | try: |
Nabin Hait | f1a07ff | 2014-10-15 12:23:35 +0530 | [diff] [blame] | 49 | update_entries_after({ "item_code": item_code, "warehouse": warehouse }, allow_zero_rate) |
Nabin Hait | 5048c98 | 2013-10-23 12:14:32 +0530 | [diff] [blame] | 50 | except: |
| 51 | pass |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 52 | |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 53 | def get_reserved_qty(item_code, warehouse): |
Anand Doshi | e9baaa6 | 2014-02-26 12:35:33 +0530 | [diff] [blame] | 54 | reserved_qty = frappe.db.sql(""" |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 55 | select |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 56 | sum((dnpi_qty / so_item_qty) * (so_item_qty - so_item_delivered_qty)) |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 57 | from |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 58 | ( |
| 59 | (select |
| 60 | qty as dnpi_qty, |
| 61 | ( |
| 62 | select qty from `tabSales Order Item` |
| 63 | where name = dnpi.parent_detail_docname |
| 64 | ) as so_item_qty, |
| 65 | ( |
| 66 | select ifnull(delivered_qty, 0) from `tabSales Order Item` |
| 67 | where name = dnpi.parent_detail_docname |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 68 | ) as so_item_delivered_qty, |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 69 | parent, name |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 70 | from |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 71 | ( |
| 72 | select qty, parent_detail_docname, parent, name |
Nabin Hait | d1fd1e2 | 2013-10-18 12:29:11 +0530 | [diff] [blame] | 73 | from `tabPacked Item` dnpi_in |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 74 | where item_code = %s and warehouse = %s |
| 75 | and parenttype="Sales Order" |
Nabin Hait | fc2dd44 | 2014-10-17 13:05:24 +0530 | [diff] [blame] | 76 | and item_code != parent_item |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 77 | and exists (select * from `tabSales Order` so |
| 78 | where name = dnpi_in.parent and docstatus = 1 and status != 'Stopped') |
| 79 | ) dnpi) |
| 80 | union |
| 81 | (select qty as dnpi_qty, qty as so_item_qty, |
| 82 | ifnull(delivered_qty, 0) as so_item_delivered_qty, parent, name |
| 83 | from `tabSales Order Item` so_item |
Nabin Hait | 06927a2 | 2014-08-25 14:08:54 +0530 | [diff] [blame] | 84 | where item_code = %s and warehouse = %s |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 85 | and exists(select * from `tabSales Order` so |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 86 | where so.name = so_item.parent and so.docstatus = 1 |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 87 | and so.status != 'Stopped')) |
| 88 | ) tab |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 89 | where |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 90 | so_item_qty >= so_item_delivered_qty |
| 91 | """, (item_code, warehouse, item_code, warehouse)) |
| 92 | |
| 93 | return flt(reserved_qty[0][0]) if reserved_qty else 0 |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 94 | |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 95 | def get_indented_qty(item_code, warehouse): |
Nabin Hait | 4acd431 | 2014-11-04 15:32:31 +0530 | [diff] [blame] | 96 | indented_qty = frappe.db.sql("""select sum(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) |
| 97 | from `tabMaterial Request Item` mr_item, `tabMaterial Request` mr |
| 98 | where mr_item.item_code=%s and mr_item.warehouse=%s |
| 99 | and mr_item.qty > ifnull(mr_item.ordered_qty, 0) and mr_item.parent=mr.name |
| 100 | and mr.status!='Stopped' and mr.docstatus=1""", (item_code, warehouse)) |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 101 | |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 102 | return flt(indented_qty[0][0]) if indented_qty else 0 |
| 103 | |
| 104 | def get_ordered_qty(item_code, warehouse): |
Anand Doshi | e9baaa6 | 2014-02-26 12:35:33 +0530 | [diff] [blame] | 105 | ordered_qty = frappe.db.sql(""" |
Nabin Hait | 1a60fd8 | 2013-10-14 14:27:08 +0530 | [diff] [blame] | 106 | select sum((po_item.qty - ifnull(po_item.received_qty, 0))*po_item.conversion_factor) |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 107 | from `tabPurchase Order Item` po_item, `tabPurchase Order` po |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 108 | where po_item.item_code=%s and po_item.warehouse=%s |
| 109 | and po_item.qty > ifnull(po_item.received_qty, 0) and po_item.parent=po.name |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 110 | and po.status!='Stopped' and po.docstatus=1""", (item_code, warehouse)) |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 111 | |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 112 | return flt(ordered_qty[0][0]) if ordered_qty else 0 |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 113 | |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 114 | def get_planned_qty(item_code, warehouse): |
Anand Doshi | e9baaa6 | 2014-02-26 12:35:33 +0530 | [diff] [blame] | 115 | planned_qty = frappe.db.sql(""" |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 116 | select sum(ifnull(qty, 0) - ifnull(produced_qty, 0)) from `tabProduction Order` |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 117 | where production_item = %s and fg_warehouse = %s and status != "Stopped" |
Nabin Hait | 1a60fd8 | 2013-10-14 14:27:08 +0530 | [diff] [blame] | 118 | and docstatus=1 and ifnull(qty, 0) > ifnull(produced_qty, 0)""", (item_code, warehouse)) |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 119 | |
| 120 | return flt(planned_qty[0][0]) if planned_qty else 0 |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 121 | |
| 122 | |
Nabin Hait | 7f3f2a0 | 2014-09-01 18:16:05 +0530 | [diff] [blame] | 123 | def update_bin_qty(item_code, warehouse, qty_dict=None): |
Rushabh Mehta | 1f84799 | 2013-12-12 19:12:19 +0530 | [diff] [blame] | 124 | from erpnext.stock.utils import get_bin |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 125 | bin = get_bin(item_code, warehouse) |
| 126 | mismatch = False |
| 127 | for fld, val in qty_dict.items(): |
Anand Doshi | f78d1ae | 2014-03-28 13:55:00 +0530 | [diff] [blame] | 128 | if flt(bin.get(fld)) != flt(val): |
| 129 | bin.set(fld, flt(val)) |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 130 | mismatch = True |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 131 | |
Nabin Hait | eea2b34 | 2013-10-11 18:31:33 +0530 | [diff] [blame] | 132 | if mismatch: |
Anand Doshi | f78d1ae | 2014-03-28 13:55:00 +0530 | [diff] [blame] | 133 | bin.projected_qty = flt(bin.actual_qty) + flt(bin.ordered_qty) + \ |
| 134 | flt(bin.indented_qty) + flt(bin.planned_qty) - flt(bin.reserved_qty) |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 135 | |
| 136 | bin.save() |
| 137 | |
| 138 | def set_stock_balance_as_per_serial_no(item_code=None, posting_date=None, posting_time=None, |
| 139 | fiscal_year=None): |
| 140 | if not posting_date: posting_date = nowdate() |
| 141 | if not posting_time: posting_time = nowtime() |
| 142 | if not fiscal_year: fiscal_year = get_fiscal_year(posting_date)[0] |
| 143 | |
| 144 | condition = " and item.name='%s'" % item_code.replace("'", "\'") if item_code else "" |
| 145 | |
| 146 | bin = frappe.db.sql("""select bin.item_code, bin.warehouse, bin.actual_qty, item.stock_uom |
| 147 | from `tabBin` bin, tabItem item |
| 148 | where bin.item_code = item.name and item.has_serial_no = 'Yes' %s""" % condition) |
| 149 | |
| 150 | for d in bin: |
| 151 | serial_nos = frappe.db.sql("""select count(name) from `tabSerial No` |
| 152 | where item_code=%s and warehouse=%s and status = 'Available' and docstatus < 2""", (d[0], d[1])) |
| 153 | |
| 154 | if serial_nos and flt(serial_nos[0][0]) != flt(d[2]): |
| 155 | print d[0], d[1], d[2], serial_nos[0][0] |
| 156 | |
| 157 | sle = frappe.db.sql("""select valuation_rate, company from `tabStock Ledger Entry` |
| 158 | where item_code = %s and warehouse = %s and ifnull(is_cancelled, 'No') = 'No' |
| 159 | order by posting_date desc limit 1""", (d[0], d[1])) |
| 160 | |
| 161 | sle_dict = { |
| 162 | 'doctype' : 'Stock Ledger Entry', |
| 163 | 'item_code' : d[0], |
| 164 | 'warehouse' : d[1], |
| 165 | 'transaction_date' : nowdate(), |
| 166 | 'posting_date' : posting_date, |
| 167 | 'posting_time' : posting_time, |
| 168 | 'voucher_type' : 'Stock Reconciliation (Manual)', |
| 169 | 'voucher_no' : '', |
| 170 | 'voucher_detail_no' : '', |
| 171 | 'actual_qty' : flt(serial_nos[0][0]) - flt(d[2]), |
| 172 | 'stock_uom' : d[3], |
| 173 | 'incoming_rate' : sle and flt(serial_nos[0][0]) > flt(d[2]) and flt(sle[0][0]) or 0, |
| 174 | 'company' : sle and cstr(sle[0][1]) or 0, |
| 175 | 'fiscal_year' : fiscal_year, |
| 176 | 'is_cancelled' : 'No', |
| 177 | 'batch_no' : '', |
| 178 | 'serial_no' : '' |
| 179 | } |
| 180 | |
| 181 | sle_doc = frappe.get_doc(sle_dict) |
Nabin Hait | eca7e22 | 2014-12-02 11:35:29 +0530 | [diff] [blame] | 182 | sle_doc.ignore_validate = True |
| 183 | sle_doc.ignore_links = True |
Nabin Hait | 6298536 | 2014-04-04 12:05:16 +0530 | [diff] [blame] | 184 | sle_doc.insert() |
| 185 | |
| 186 | args = sle_dict.copy() |
| 187 | args.update({ |
| 188 | "sle_id": sle_doc.name, |
| 189 | "is_amended": 'No' |
| 190 | }) |
| 191 | |
| 192 | update_bin(args) |
| 193 | update_entries_after({ |
| 194 | "item_code": d[0], |
| 195 | "warehouse": d[1], |
| 196 | "posting_date": posting_date, |
| 197 | "posting_time": posting_time |
| 198 | }) |
nabinhait | 5c38488 | 2014-07-14 11:43:00 +0530 | [diff] [blame] | 199 | |
nabinhait | 7700c62 | 2014-07-14 14:21:21 +0530 | [diff] [blame] | 200 | def reset_serial_no_status_and_warehouse(serial_nos=None): |
nabinhait | 5c38488 | 2014-07-14 11:43:00 +0530 | [diff] [blame] | 201 | if not serial_nos: |
| 202 | serial_nos = frappe.db.sql_list("""select name from `tabSerial No` where status != 'Not in Use' |
| 203 | and docstatus = 0""") |
| 204 | for serial_no in serial_nos: |
| 205 | try: |
| 206 | sr = frappe.get_doc("Serial No", serial_no) |
nabinhait | b0a8d00 | 2014-07-14 11:56:03 +0530 | [diff] [blame] | 207 | last_sle = sr.get_last_sle() |
| 208 | if flt(last_sle.actual_qty) > 0: |
| 209 | sr.warehouse = last_sle.warehouse |
Nabin Hait | 7f3f2a0 | 2014-09-01 18:16:05 +0530 | [diff] [blame] | 210 | |
nabinhait | 5c38488 | 2014-07-14 11:43:00 +0530 | [diff] [blame] | 211 | sr.via_stock_ledger = True |
| 212 | sr.save() |
| 213 | except: |
| 214 | pass |
Nabin Hait | 7f3f2a0 | 2014-09-01 18:16:05 +0530 | [diff] [blame] | 215 | |
nabinhait | 5c38488 | 2014-07-14 11:43:00 +0530 | [diff] [blame] | 216 | frappe.db.sql("""update `tabSerial No` set warehouse='' where status in ('Delivered', 'Purchase Returned')""") |
Nabin Hait | 7f3f2a0 | 2014-09-01 18:16:05 +0530 | [diff] [blame] | 217 | |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 218 | def repost_all_stock_vouchers(): |
Nabin Hait | 8a28ccf | 2014-10-14 11:41:44 +0530 | [diff] [blame] | 219 | warehouses_with_account = frappe.db.sql_list("""select master_name from tabAccount |
| 220 | where ifnull(account_type, '') = 'Warehouse'""") |
| 221 | |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 222 | vouchers = frappe.db.sql("""select distinct voucher_type, voucher_no |
Nabin Hait | 8a28ccf | 2014-10-14 11:41:44 +0530 | [diff] [blame] | 223 | from `tabStock Ledger Entry` sle |
| 224 | where voucher_type != "Serial No" and sle.warehouse in (%s) |
| 225 | order by posting_date, posting_time, name""" % |
| 226 | ', '.join(['%s']*len(warehouses_with_account)), tuple(warehouses_with_account)) |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 227 | |
| 228 | rejected = [] |
Nabin Hait | 4d74216 | 2014-10-09 19:25:03 +0530 | [diff] [blame] | 229 | i = 0 |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 230 | for voucher_type, voucher_no in vouchers: |
Nabin Hait | 4d74216 | 2014-10-09 19:25:03 +0530 | [diff] [blame] | 231 | i+=1 |
Nabin Hait | 7c6f990 | 2014-10-10 18:03:27 +0530 | [diff] [blame] | 232 | print i, "/", len(vouchers) |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 233 | try: |
| 234 | for dt in ["Stock Ledger Entry", "GL Entry"]: |
| 235 | frappe.db.sql("""delete from `tab%s` where voucher_type=%s and voucher_no=%s"""% |
| 236 | (dt, '%s', '%s'), (voucher_type, voucher_no)) |
| 237 | |
| 238 | doc = frappe.get_doc(voucher_type, voucher_no) |
| 239 | if voucher_type=="Stock Entry" and doc.purpose in ["Manufacture", "Repack"]: |
| 240 | doc.get_stock_and_rate(force=1) |
Nabin Hait | 7c6f990 | 2014-10-10 18:03:27 +0530 | [diff] [blame] | 241 | elif voucher_type=="Purchase Receipt" and doc.is_subcontracted == "Yes": |
| 242 | doc.validate() |
Nabin Hait | e96e83d | 2014-10-08 18:06:14 +0530 | [diff] [blame] | 243 | |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 244 | doc.update_stock_ledger() |
Nabin Hait | e96e83d | 2014-10-08 18:06:14 +0530 | [diff] [blame] | 245 | doc.make_gl_entries(repost_future_gle=False, allow_negative_stock=True) |
| 246 | frappe.db.commit() |
| 247 | except Exception, e: |
| 248 | print frappe.get_traceback() |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 249 | rejected.append([voucher_type, voucher_no]) |
Nabin Hait | e96e83d | 2014-10-08 18:06:14 +0530 | [diff] [blame] | 250 | frappe.db.rollback() |
Nabin Hait | 6c48ef7 | 2014-10-08 11:00:38 +0530 | [diff] [blame] | 251 | |
| 252 | print rejected |