Skip to content

Commit cfbd019

Browse files
committed
Merge branch 'master' into develop
2 parents 26f9673 + ec6267e commit cfbd019

File tree

10 files changed

+103
-38
lines changed

10 files changed

+103
-38
lines changed

erpnext/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from __future__ import unicode_literals
33
import frappe
44

5-
__version__ = '7.0.31'
5+
__version__ = '7.0.32'
66

77
def get_default_company(user=None):
88
'''Get default company for user'''

erpnext/accounts/doctype/sales_invoice/sales_invoice.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,10 @@ def validate_delivery_note(self):
381381
if d.delivery_note:
382382
msgprint(_("Stock cannot be updated against Delivery Note {0}").format(d.delivery_note), raise_exception=1)
383383

384-
385384
def validate_write_off_account(self):
385+
if flt(self.write_off_amount) and not self.write_off_account:
386+
self.write_off_account = frappe.db.get_value('Company', self.company, 'write_off_account')
387+
386388
if flt(self.write_off_amount) and not self.write_off_account:
387389
msgprint(_("Please enter Write Off Account"), raise_exception=1)
388390

erpnext/accounts/page/pos/pos.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
509509
this.remove_zero_qty_item();
510510
}
511511

512-
this.refresh();
512+
this.update_paid_amount_status(false)
513513
},
514514

515515
remove_zero_qty_item: function(){
@@ -591,7 +591,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
591591
if (!caught)
592592
this.add_new_item_to_grid();
593593

594-
this.refresh();
594+
this.update_paid_amount_status(false)
595595
},
596596

597597
add_new_item_to_grid: function() {
@@ -616,13 +616,22 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
616616
? this.item_serial_no[this.child.item_code][0] : '');
617617
},
618618

619+
update_paid_amount_status: function(update_paid_amount){
620+
if(this.name){
621+
update_paid_amount = update_paid_amount ? false : true;
622+
}
623+
624+
this.refresh(update_paid_amount);
625+
},
626+
619627
refresh: function(update_paid_amount) {
620628
var me = this;
621629
this.refresh_fields(update_paid_amount);
622630
this.update_qty();
623631
this.update_rate();
624632
this.set_primary_action();
625633
},
634+
626635
refresh_fields: function(update_paid_amount) {
627636
this.apply_pricing_rule();
628637
this.discount_amount_applied = false;
@@ -698,7 +707,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
698707

699708
if (this.frm.doc.docstatus==0) {
700709
this.page.set_primary_action(__("Pay"), function() {
701-
me.validate()
710+
me.validate();
711+
me.update_paid_amount_status(true);
702712
me.create_invoice();
703713
me.make_payment();
704714
}, "octicon octicon-credit-card");

erpnext/change_log/v7/v7_0_0.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#### New POS
2+
- Offline
3+
- Multiple Payment Modes
4+
- Standard documents cannot be edited in POS view
5+
6+
#### Payment Entry
7+
- Dedicated form for managing Payments
8+
- Designed for normal users who do not have accounting background
9+
10+
#### Request for Quotation
11+
- Updated workflow: Material Request -> **Request for Quotation** -> Supplier Quotation -> Purchase Order
12+
13+
#### Fixed Asset Management
14+
- Manage fixed asset records and their depreciation
15+
16+
#### Improved Navigation
17+
- Heatmaps
18+
- Centralized navigation from Masters like Item, Customer, Supplier, Employee etc.
19+
20+
#### Timesheets
21+
- New grid
22+
- Multiple time logs in one timesheets
23+
- Linked to Payroll and Billing
24+
25+
#### Graphs in Reports
26+
- Added graphs in some important reports like Balance Sheet, Accounts Receivable etc.
27+
28+
#### Sub-warehouse
29+
- Tree view for Warehouse
30+
31+
#### New Portal Design
32+
- New Homepage Design
33+
- Sidebar in Portal View
34+
- New Cart View
35+
36+
#### Collaborative Project Management
37+
- Web View
38+
- Customers/Suppliers can add/edit issues and view timesheets
39+
40+
#### Budget
41+
- Dedicated budget form
42+
- Budget can be assigned against Cost Center Group
43+
44+
#### Check Printing Format
45+
- Ability to customize Cheque Printing Format for any bank
46+
47+
#### Schools application is now part of ERPNext
48+
49+
#### Minor
50+
51+
- Selling Price calculation based on Margin defined in the Pricing Rule
52+
- Document flow-chart on Sales / Purchase Transactions
53+
- Domain specific desktop views
54+
- Add opening Stock and Rate while creating a new Item
55+
- Book payments and update stock directly from Purchase Invoice
56+
- List view for Products on Website
57+
- Features Setup is deprecated, settings moved to individual module setup views
58+
- Added Safety Stock to Item Master

erpnext/controllers/stock_controller.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ def make_sl_entries(self, sl_entries, is_amended=None, allow_negative_stock=Fals
204204
from erpnext.stock.stock_ledger import make_sl_entries
205205
make_sl_entries(sl_entries, is_amended, allow_negative_stock, via_landed_cost_voucher)
206206

207-
def make_gl_entries_on_cancel(self):
207+
def make_gl_entries_on_cancel(self, repost_future_gle=True):
208208
if frappe.db.sql("""select name from `tabGL Entry` where voucher_type=%s
209209
and voucher_no=%s""", (self.doctype, self.name)):
210-
self.make_gl_entries()
210+
self.make_gl_entries(repost_future_gle)
211211

212212
def get_serialized_items(self):
213213
serialized_items = []
@@ -261,7 +261,7 @@ def _delete_gl_entries(voucher_type, voucher_no):
261261

262262
future_stock_vouchers = get_future_stock_vouchers(posting_date, posting_time, for_warehouses, for_items)
263263
gle = get_voucherwise_gl_entries(future_stock_vouchers, posting_date)
264-
264+
265265
for voucher_type, voucher_no in future_stock_vouchers:
266266
existing_gle = gle.get((voucher_type, voucher_no), [])
267267
voucher_obj = frappe.get_doc(voucher_type, voucher_no)

erpnext/controllers/taxes_and_totals.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ def calculate_change_amount(self):
471471

472472
def calculate_write_off_amount(self):
473473
if flt(self.doc.change_amount) > 0:
474-
self.doc.write_off_amount = self.doc.grand_total - self.doc.paid_amount + self.doc.change_amount
474+
self.doc.write_off_amount = flt(self.doc.grand_total - self.doc.paid_amount + self.doc.change_amount,
475+
self.doc.precision("write_off_amount"))
475476
self.doc.base_write_off_amount = flt(self.doc.write_off_amount * self.doc.conversion_rate,
476477
self.doc.precision("base_write_off_amount"))
477478

erpnext/manufacturing/doctype/operation/operation.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
# For license information, please see license.txt
33

44
from __future__ import unicode_literals
5-
import frappe
65
from frappe.model.document import Document
76

87
class Operation(Document):
9-
def calculate_op_cost(self):
10-
if self.hour_rate and self.time_in_mins:
11-
self.operating_cost = flt(self.hour_rate) * flt(self.time_in_mins) / 60.0
12-
else :
13-
self.operating_cost = 0
14-
8+
def validate(self):
9+
if not self.description:
10+
self.description = self.name

erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"print_hide_if_no_value": 0,
5959
"read_only": 1,
6060
"report_hide": 0,
61-
"reqd": 0,
61+
"reqd": 1,
6262
"search_index": 0,
6363
"set_only_once": 0,
6464
"unique": 0
@@ -85,7 +85,7 @@
8585
"print_hide_if_no_value": 0,
8686
"read_only": 1,
8787
"report_hide": 0,
88-
"reqd": 1,
88+
"reqd": 0,
8989
"search_index": 0,
9090
"set_only_once": 0,
9191
"unique": 0
@@ -539,7 +539,7 @@
539539
"issingle": 0,
540540
"istable": 1,
541541
"max_attachments": 0,
542-
"modified": "2016-07-11 03:28:04.235889",
542+
"modified": "2016-08-22 03:41:42.356833",
543543
"modified_by": "Administrator",
544544
"module": "Manufacturing",
545545
"name": "Production Order Operation",

erpnext/public/js/payment/payments.js

+15-17
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ erpnext.payments = erpnext.stock.StockController.extend({
112112
$(this.$body).find('.form-control').click(function(){
113113
me.idx = $(this).attr("idx");
114114
me.set_outstanding_amount();
115-
me.update_paid_amount();
115+
me.update_paid_amount(true);
116116
})
117117

118118
$(this.$body).find('.write_off_amount').change(function(){
119-
me.write_off_amount(flt($(this).val()));
119+
me.write_off_amount(flt($(this).val()), precision("write_off_amount"));
120120
})
121121

122122
$(this.$body).find('.change_amount').change(function(){
123-
me.change_amount(flt($(this).val()));
123+
me.change_amount(flt($(this).val()), precision("change_amount"));
124124
})
125125
},
126126

@@ -139,7 +139,7 @@ erpnext.payments = erpnext.stock.StockController.extend({
139139
me.payment_val += $(this).text();
140140
me.selected_mode.val(format_number(me.payment_val, 2))
141141
me.idx = me.selected_mode.attr("idx")
142-
me.selected_mode.change()
142+
me.update_paid_amount()
143143
})
144144

145145
$(this.$body).find('.delete-btn').click(function(){
@@ -177,31 +177,29 @@ erpnext.payments = erpnext.stock.StockController.extend({
177177
write_off_amount: function(write_off_amount) {
178178
var me = this;
179179

180-
if(this.frm.doc.paid_amount > 0){
181-
this.frm.doc.write_off_amount = write_off_amount;
182-
this.frm.doc.base_write_off_amount = flt(this.frm.doc.write_off_amount * this.frm.doc.conversion_rate,
183-
precision("base_write_off_amount"));
184-
this.calculate_outstanding_amount(false)
185-
this.show_amounts()
186-
}
180+
this.frm.doc.write_off_amount = flt(write_off_amount, precision("write_off_amount"));
181+
this.frm.doc.base_write_off_amount = flt(this.frm.doc.write_off_amount * this.frm.doc.conversion_rate,
182+
precision("base_write_off_amount"));
183+
this.calculate_outstanding_amount(false)
184+
this.show_amounts()
187185
},
188186

189187
change_amount: function(change_amount) {
190188
var me = this;
191189

192-
this.frm.doc.change_amount = change_amount;
190+
this.frm.doc.change_amount = flt(change_amount, precision("change_amount"));
193191
this.calculate_write_off_amount()
194192
this.show_amounts()
195193
},
196194

197-
update_paid_amount: function() {
195+
update_paid_amount: function(update_write_off) {
198196
var me = this;
199197
if(in_list(['change_amount', 'write_off_amount'], this.idx)){
200-
value = flt(me.selected_mode.val(), 2)
198+
value = me.selected_mode.val();
201199
if(me.idx == 'change_amount'){
202200
me.change_amount(value)
203201
} else{
204-
if(value == 0) {
202+
if(value == 0 && update_write_off) {
205203
value = me.frm.doc.outstanding_amount;
206204
}
207205
me.write_off_amount(value)
@@ -226,9 +224,9 @@ erpnext.payments = erpnext.stock.StockController.extend({
226224

227225
show_amounts: function(){
228226
var me = this;
229-
$(this.$body).find(".write_off_amount").val(format_number(this.frm.doc.write_off_amount, 2));
227+
$(this.$body).find(".write_off_amount").val(format_number(this.frm.doc.write_off_amount, precision("write_off_amount")));
230228
$(this.$body).find('.paid_amount').text(format_currency(this.frm.doc.paid_amount, this.frm.doc.currency));
231-
$(this.$body).find('.change_amount').val(format_number(this.frm.doc.change_amount, 2))
229+
$(this.$body).find('.change_amount').val(format_number(this.frm.doc.change_amount, precision("change_amount")))
232230
$(this.$body).find('.outstanding_amount').text(format_currency(this.frm.doc.outstanding_amount, this.frm.doc.currency))
233231
this.update_invoice();
234232
}

erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def on_cancel(self):
8484
self.update_landed_cost()
8585

8686
def update_landed_cost(self):
87-
for d in self.get("items"):
87+
for d in self.get("purchase_receipts"):
8888
doc = frappe.get_doc(d.receipt_document_type, d.receipt_document)
8989

9090
# set landed cost voucher amount in pr item
@@ -103,7 +103,7 @@ def update_landed_cost(self):
103103
# update stock & gl entries for cancelled state of PR
104104
doc.docstatus = 2
105105
doc.update_stock_ledger(allow_negative_stock=True, via_landed_cost_voucher=True)
106-
doc.make_gl_entries_on_cancel()
106+
doc.make_gl_entries_on_cancel(repost_future_gle=False)
107107

108108

109109
# update stock & gl entries for submit state of PR

0 commit comments

Comments
 (0)