commit
fdefbdb23b
@ -128,9 +128,13 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
|
||||
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
|
||||
# start_date: 1st of the last month or the start date
|
||||
# end_date: end_date or today-1
|
||||
enable_check = "enable_deferred_revenue" \
|
||||
if doc.doctype=="Sales Invoice" else "enable_deferred_expense"
|
||||
|
||||
gl_entries = []
|
||||
for item in doc.get('items'):
|
||||
if not item.get(enable_check): continue
|
||||
|
||||
skip = False
|
||||
last_gl_entry, booking_start_date, booking_end_date, skip = \
|
||||
get_booking_dates(doc, item, start_date, end_date)
|
||||
|
@ -171,7 +171,7 @@ class PaymentEntry(AccountsController):
|
||||
if not frappe.db.exists(self.party_type, self.party):
|
||||
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
|
||||
|
||||
if self.party_account:
|
||||
if self.party_account and self.party_type in ("Customer", "Supplier"):
|
||||
self.validate_account_type(self.party_account,
|
||||
[erpnext.get_party_account_type(self.party_type)])
|
||||
|
||||
@ -689,7 +689,7 @@ def get_party_details(company, party_type, party, date, cost_center=None):
|
||||
|
||||
account_currency = get_account_currency(party_account)
|
||||
account_balance = get_balance_on(party_account, date, cost_center=cost_center)
|
||||
_party_name = "title" if party_type == "Student" else party_type.lower() + "_name"
|
||||
_party_name = "title" if party_type in ("Student", "Shareholder") else party_type.lower() + "_name"
|
||||
party_name = frappe.db.get_value(party_type, party, _party_name)
|
||||
party_balance = get_balance_on(party_type=party_type, party=party, cost_center=cost_center)
|
||||
if party_type in ["Customer", "Supplier"]:
|
||||
|
@ -19,7 +19,6 @@ frappe.ui.form.on('Employee Advance', {
|
||||
filters: {
|
||||
"root_type": "Asset",
|
||||
"is_group": 0,
|
||||
"account_type": "Payable",
|
||||
"company": frm.doc.company
|
||||
}
|
||||
};
|
||||
|
@ -81,9 +81,9 @@ class MaterialRequest(BuyingController):
|
||||
|
||||
def set_title(self):
|
||||
'''Set title as comma separated list of items'''
|
||||
items = ', '.join([d.item_name for d in self.items][:4])
|
||||
|
||||
self.title = _('{0} for {1}'.format(self.material_request_type, items))[:100]
|
||||
if not self.title:
|
||||
items = ', '.join([d.item_name for d in self.items][:3])
|
||||
self.title = _('{0} Request for {1}').format(self.material_request_type, items)[:100]
|
||||
|
||||
def on_submit(self):
|
||||
# frappe.db.set(self, 'status', 'Submitted')
|
||||
|
@ -914,6 +914,11 @@ class StockEntry(StockController):
|
||||
filters={'parent': self.work_order, 'item_code': item_code},
|
||||
fields=["required_qty", "consumed_qty"]
|
||||
)
|
||||
if not req_items:
|
||||
frappe.msgprint(_("Did not found transfered item {0} in Work Order {1}, the item not added in Stock Entry")
|
||||
.format(item_code, self.work_order))
|
||||
continue
|
||||
|
||||
req_qty = flt(req_items[0].required_qty)
|
||||
req_qty_each = flt(req_qty / manufacturing_qty)
|
||||
consumed_qty = flt(req_items[0].consumed_qty)
|
||||
|
@ -259,6 +259,7 @@ class StockReconciliation(StockController):
|
||||
|
||||
def submit(self):
|
||||
if len(self.items) > 100:
|
||||
msgprint(_("The task has been enqueued as a background job. In case there is any issue on processing in background, the system will add a comment about the error on this Stock Reconciliation and revert to the Draft stage"))
|
||||
self.queue_action('submit')
|
||||
else:
|
||||
self._submit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user