Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 1 | frappe.provide('erpnext.stock'); |
| 2 | |
| 3 | erpnext.stock.ItemDashboard = Class.extend({ |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 4 | init: function (opts) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 5 | $.extend(this, opts); |
| 6 | this.make(); |
| 7 | }, |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 8 | make: function () { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 9 | var me = this; |
| 10 | this.start = 0; |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 11 | if (!this.sort_by) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 12 | this.sort_by = 'projected_qty'; |
| 13 | this.sort_order = 'asc'; |
| 14 | } |
| 15 | |
| 16 | this.content = $(frappe.render_template('item_dashboard')).appendTo(this.parent); |
| 17 | this.result = this.content.find('.result'); |
| 18 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 19 | this.content.on('click', '.btn-move', function () { |
| 20 | handle_move_add($(this), "Move"); |
Shivam Mishra | 38b930b | 2019-07-05 10:38:48 +0530 | [diff] [blame] | 21 | }); |
| 22 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 23 | this.content.on('click', '.btn-add', function () { |
| 24 | handle_move_add($(this), "Add"); |
Shivam Mishra | 5738c93 | 2019-07-16 12:52:19 +0530 | [diff] [blame] | 25 | }); |
| 26 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 27 | this.content.on('click', '.btn-edit', function () { |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 28 | let item = unescape($(this).attr('data-item')); |
| 29 | let warehouse = unescape($(this).attr('data-warehouse')); |
| 30 | let company = unescape($(this).attr('data-company')); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 31 | frappe.db.get_value('Putaway Rule', { |
| 32 | 'item_code': item, |
| 33 | 'warehouse': warehouse, |
| 34 | 'company': company |
| 35 | }, 'name', (r) => { |
| 36 | frappe.set_route("Form", "Putaway Rule", r.name); |
| 37 | }); |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 38 | }); |
| 39 | |
Shivam Mishra | 5738c93 | 2019-07-16 12:52:19 +0530 | [diff] [blame] | 40 | function handle_move_add(element, action) { |
| 41 | let item = unescape(element.attr('data-item')); |
| 42 | let warehouse = unescape(element.attr('data-warehouse')); |
| 43 | let actual_qty = unescape(element.attr('data-actual_qty')); |
| 44 | let disable_quick_entry = Number(unescape(element.attr('data-disable_quick_entry'))); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 45 | let entry_type = action === "Move" ? "Material Transfer" : null; |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 46 | |
Shivam Mishra | fd6ff62 | 2019-07-16 12:32:50 +0530 | [diff] [blame] | 47 | if (disable_quick_entry) { |
Shivam Mishra | 5738c93 | 2019-07-16 12:52:19 +0530 | [diff] [blame] | 48 | open_stock_entry(item, warehouse, entry_type); |
Shivam Mishra | fd6ff62 | 2019-07-16 12:32:50 +0530 | [diff] [blame] | 49 | } else { |
Shivam Mishra | 5738c93 | 2019-07-16 12:52:19 +0530 | [diff] [blame] | 50 | if (action === "Add") { |
| 51 | let rate = unescape($(this).attr('data-rate')); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 52 | erpnext.stock.move_item(item, null, warehouse, actual_qty, rate, function () { |
| 53 | me.refresh(); |
| 54 | }); |
| 55 | } else { |
| 56 | erpnext.stock.move_item(item, warehouse, null, actual_qty, null, function () { |
| 57 | me.refresh(); |
| 58 | }); |
Shivam Mishra | 5738c93 | 2019-07-16 12:52:19 +0530 | [diff] [blame] | 59 | } |
Shivam Mishra | fd6ff62 | 2019-07-16 12:32:50 +0530 | [diff] [blame] | 60 | } |
Shivam Mishra | 5738c93 | 2019-07-16 12:52:19 +0530 | [diff] [blame] | 61 | } |
Shivam Mishra | 38b930b | 2019-07-05 10:38:48 +0530 | [diff] [blame] | 62 | |
| 63 | function open_stock_entry(item, warehouse, entry_type) { |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 64 | frappe.model.with_doctype('Stock Entry', function () { |
Shivam Mishra | 38b930b | 2019-07-05 10:38:48 +0530 | [diff] [blame] | 65 | var doc = frappe.model.get_new_doc('Stock Entry'); |
| 66 | if (entry_type) doc.stock_entry_type = entry_type; |
| 67 | |
| 68 | var row = frappe.model.add_child(doc, 'items'); |
| 69 | row.item_code = item; |
| 70 | row.s_warehouse = warehouse; |
| 71 | |
| 72 | frappe.set_route('Form', doc.doctype, doc.name); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 73 | }); |
Shivam Mishra | 38b930b | 2019-07-05 10:38:48 +0530 | [diff] [blame] | 74 | } |
| 75 | |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 76 | // more |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 77 | this.content.find('.btn-more').on('click', function () { |
marination | a5d8d32 | 2020-12-09 16:27:18 +0530 | [diff] [blame] | 78 | me.start += me.page_length; |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 79 | me.refresh(); |
| 80 | }); |
| 81 | |
| 82 | }, |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 83 | refresh: function () { |
| 84 | if (this.before_refresh) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 85 | this.before_refresh(); |
| 86 | } |
| 87 | |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 88 | let args = { |
| 89 | item_code: this.item_code, |
| 90 | warehouse: this.warehouse, |
| 91 | parent_warehouse: this.parent_warehouse, |
| 92 | item_group: this.item_group, |
| 93 | company: this.company, |
| 94 | start: this.start, |
| 95 | sort_by: this.sort_by, |
| 96 | sort_order: this.sort_order |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 97 | }; |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 98 | |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 99 | var me = this; |
| 100 | frappe.call({ |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 101 | method: this.method, |
| 102 | args: args, |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 103 | callback: function (r) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 104 | me.render(r.message); |
| 105 | } |
| 106 | }); |
| 107 | }, |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 108 | render: function (data) { |
| 109 | if (this.start === 0) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 110 | this.max_count = 0; |
| 111 | this.result.empty(); |
| 112 | } |
| 113 | |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 114 | let context = ""; |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 115 | if (this.page_name === "warehouse-capacity-summary") { |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 116 | context = this.get_capacity_dashboard_data(data); |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 117 | } else { |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 118 | context = this.get_item_dashboard_data(data, this.max_count, true); |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 119 | } |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 120 | |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 121 | this.max_count = this.max_count; |
| 122 | |
| 123 | // show more button |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 124 | if (data && data.length === (this.page_length + 1)) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 125 | this.content.find('.more').removeClass('hidden'); |
| 126 | |
| 127 | // remove the last element |
| 128 | data.splice(-1); |
| 129 | } else { |
| 130 | this.content.find('.more').addClass('hidden'); |
| 131 | } |
| 132 | |
Vinayak Jethe | 2c8ce5a | 2018-01-24 13:51:26 +0530 | [diff] [blame] | 133 | // If not any stock in any warehouses provide a message to end user |
Stavros Anastasiadis | 58b5878 | 2017-10-05 16:14:50 +0300 | [diff] [blame] | 134 | if (context.data.length > 0) { |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 135 | this.content.find('.result').css('text-align', 'unset'); |
| 136 | $(frappe.render_template(this.template, context)).appendTo(this.result); |
Stavros Anastasiadis | 58b5878 | 2017-10-05 16:14:50 +0300 | [diff] [blame] | 137 | } else { |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 138 | var message = __("No Stock Available Currently"); |
| 139 | this.content.find('.result').css('text-align', 'center'); |
| 140 | |
marination | a97eb6a | 2021-02-07 22:27:40 +0530 | [diff] [blame] | 141 | $(`<div class='text-muted' style='margin: 20px 5px;'> |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 142 | ${message} </div>`).appendTo(this.result); |
Stavros Anastasiadis | 58b5878 | 2017-10-05 16:14:50 +0300 | [diff] [blame] | 143 | } |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 144 | }, |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 145 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 146 | get_item_dashboard_data: function (data, max_count, show_item) { |
| 147 | if (!max_count) max_count = 0; |
| 148 | if (!data) data = []; |
Vinayak Jethe | 549c196 | 2018-01-24 19:47:59 +0530 | [diff] [blame] | 149 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 150 | data.forEach(function (d) { |
Nabin Hait | a674640 | 2018-03-28 11:16:00 +0530 | [diff] [blame] | 151 | d.actual_or_pending = d.projected_qty + d.reserved_qty + d.reserved_qty_for_production + d.reserved_qty_for_sub_contract; |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 152 | d.pending_qty = 0; |
Nabin Hait | 2c7a6e6 | 2018-03-12 14:12:12 +0530 | [diff] [blame] | 153 | d.total_reserved = d.reserved_qty + d.reserved_qty_for_production + d.reserved_qty_for_sub_contract; |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 154 | if (d.actual_or_pending > d.actual_qty) { |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 155 | d.pending_qty = d.actual_or_pending - d.actual_qty; |
| 156 | } |
| 157 | |
| 158 | max_count = Math.max(d.actual_or_pending, d.actual_qty, |
| 159 | d.total_reserved, max_count); |
| 160 | }); |
Vinayak Jethe | 549c196 | 2018-01-24 19:47:59 +0530 | [diff] [blame] | 161 | |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 162 | let can_write = 0; |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 163 | if (frappe.boot.user.can_write.indexOf("Stock Entry") >= 0) { |
Vinayak Jethe | 549c196 | 2018-01-24 19:47:59 +0530 | [diff] [blame] | 164 | can_write = 1; |
| 165 | } |
| 166 | |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 167 | return { |
| 168 | data: data, |
| 169 | max_count: max_count, |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 170 | can_write: can_write, |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 171 | show_item: show_item || false |
marination | b8aeb9e | 2021-01-05 12:16:25 +0530 | [diff] [blame] | 172 | }; |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 173 | }, |
| 174 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 175 | get_capacity_dashboard_data: function (data) { |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 176 | if (!data) data = []; |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 177 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 178 | data.forEach(function (d) { |
| 179 | d.color = d.percent_occupied >= 80 ? "#f8814f" : "#2490ef"; |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 180 | }); |
| 181 | |
| 182 | let can_write = 0; |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 183 | if (frappe.boot.user.can_write.indexOf("Putaway Rule") >= 0) { |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 184 | can_write = 1; |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 185 | } |
marination | 1087d97 | 2020-11-26 10:45:44 +0530 | [diff] [blame] | 186 | |
| 187 | return { |
| 188 | data: data, |
| 189 | can_write: can_write, |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 190 | }; |
Rushabh Mehta | 3d2622c | 2016-04-25 17:53:42 +0530 | [diff] [blame] | 191 | } |
marination | 0f3cfc5 | 2020-12-08 19:11:51 +0530 | [diff] [blame] | 192 | }); |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 193 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 194 | erpnext.stock.move_item = function (item, source, target, actual_qty, rate, callback) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 195 | var dialog = new frappe.ui.Dialog({ |
| 196 | title: target ? __('Add Item') : __('Move Item'), |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 197 | fields: [{ |
| 198 | fieldname: 'item_code', |
| 199 | label: __('Item'), |
| 200 | fieldtype: 'Link', |
| 201 | options: 'Item', |
| 202 | read_only: 1 |
| 203 | }, |
| 204 | { |
| 205 | fieldname: 'source', |
| 206 | label: __('Source Warehouse'), |
| 207 | fieldtype: 'Link', |
| 208 | options: 'Warehouse', |
| 209 | read_only: 1 |
| 210 | }, |
| 211 | { |
| 212 | fieldname: 'target', |
| 213 | label: __('Target Warehouse'), |
| 214 | fieldtype: 'Link', |
| 215 | options: 'Warehouse', |
| 216 | reqd: 1 |
| 217 | }, |
| 218 | { |
| 219 | fieldname: 'qty', |
| 220 | label: __('Quantity'), |
| 221 | reqd: 1, |
| 222 | fieldtype: 'Float', |
| 223 | description: __('Available {0}', [actual_qty]) |
| 224 | }, |
| 225 | { |
| 226 | fieldname: 'rate', |
| 227 | label: __('Rate'), |
| 228 | fieldtype: 'Currency', |
| 229 | hidden: 1 |
| 230 | }, |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 231 | ], |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 232 | }); |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 233 | dialog.show(); |
| 234 | dialog.get_field('item_code').set_input(item); |
| 235 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 236 | if (source) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 237 | dialog.get_field('source').set_input(source); |
| 238 | } else { |
| 239 | dialog.get_field('source').df.hidden = 1; |
| 240 | dialog.get_field('source').refresh(); |
| 241 | } |
| 242 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 243 | if (rate) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 244 | dialog.get_field('rate').set_value(rate); |
| 245 | dialog.get_field('rate').df.hidden = 0; |
| 246 | dialog.get_field('rate').refresh(); |
| 247 | } |
| 248 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 249 | if (target) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 250 | dialog.get_field('target').df.read_only = 1; |
| 251 | dialog.get_field('target').value = target; |
| 252 | dialog.get_field('target').refresh(); |
| 253 | } |
| 254 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 255 | dialog.set_primary_action(__('Submit'), function () { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 256 | var values = dialog.get_values(); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 257 | if (!values) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 258 | return; |
| 259 | } |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 260 | if (source && values.qty > actual_qty) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 261 | frappe.msgprint(__('Quantity must be less than or equal to {0}', [actual_qty])); |
| 262 | return; |
| 263 | } |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 264 | if (values.source === values.target) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 265 | frappe.msgprint(__('Source and target warehouse must be different')); |
| 266 | } |
| 267 | |
| 268 | frappe.call({ |
| 269 | method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry', |
| 270 | args: values, |
Ankush Menat | 042b852 | 2021-05-18 16:31:55 +0530 | [diff] [blame] | 271 | btn: dialog.get_primary_btn(), |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 272 | freeze: true, |
Ankush Menat | 042b852 | 2021-05-18 16:31:55 +0530 | [diff] [blame] | 273 | freeze_message: __('Creating Stock Entry'), |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 274 | callback: function (r) { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 275 | frappe.show_alert(__('Stock Entry {0} created', |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 276 | ['<a href="/app/stock-entry/' + r.message.name + '">' + r.message.name + '</a>'])); |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 277 | dialog.hide(); |
| 278 | callback(r); |
| 279 | }, |
| 280 | }); |
| 281 | }); |
| 282 | |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 283 | $('<p style="margin-left: 10px;"><a class="link-open text-muted small">' + |
| 284 | __("Add more items or open full form") + '</a></p>') |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 285 | .appendTo(dialog.body) |
| 286 | .find('.link-open') |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 287 | .on('click', function () { |
| 288 | frappe.model.with_doctype('Stock Entry', function () { |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 289 | var doc = frappe.model.get_new_doc('Stock Entry'); |
| 290 | doc.from_warehouse = dialog.get_value('source'); |
| 291 | doc.to_warehouse = dialog.get_value('target'); |
| 292 | var row = frappe.model.add_child(doc, 'items'); |
| 293 | row.item_code = dialog.get_value('item_code'); |
| 294 | row.f_warehouse = dialog.get_value('target'); |
| 295 | row.t_warehouse = dialog.get_value('target'); |
| 296 | row.qty = dialog.get_value('qty'); |
| 297 | row.conversion_factor = 1; |
| 298 | row.transfer_qty = dialog.get_value('qty'); |
| 299 | row.basic_rate = dialog.get_value('rate'); |
| 300 | frappe.set_route('Form', doc.doctype, doc.name); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 301 | }); |
Shivam Mishra | 444091b | 2019-07-10 10:22:08 +0530 | [diff] [blame] | 302 | }); |
Anurag Mishra | abf974d | 2021-03-17 18:40:21 +0530 | [diff] [blame] | 303 | }; |