Merge pull request #3312 from nabinhait/develop
[fix] operations and bom
This commit is contained in:
commit
71b7a52990
@ -29,7 +29,7 @@ def execute(filters=None):
|
|||||||
def get_provisional_profit_loss(asset, liability, equity, period_list):
|
def get_provisional_profit_loss(asset, liability, equity, period_list):
|
||||||
if asset and (liability or equity):
|
if asset and (liability or equity):
|
||||||
provisional_profit_loss = {
|
provisional_profit_loss = {
|
||||||
"account_name": _("'Provisional Profit / Loss (Credit)'"),
|
"account_name": "'" + _("Provisional Profit / Loss (Credit)") + "'",
|
||||||
"account": None,
|
"account": None,
|
||||||
"warn_if_negative": True
|
"warn_if_negative": True
|
||||||
}
|
}
|
||||||
|
|||||||
@ -146,7 +146,7 @@ def prepare_data(accounts, balance_must_be, period_list):
|
|||||||
|
|
||||||
def add_total_row(out, balance_must_be, period_list):
|
def add_total_row(out, balance_must_be, period_list):
|
||||||
row = {
|
row = {
|
||||||
"account_name": _("'Total ({0})'").format(balance_must_be),
|
"account_name": "'" + _("Total ({0})").format(balance_must_be) + "'",
|
||||||
"account": None
|
"account": None
|
||||||
}
|
}
|
||||||
for period in period_list:
|
for period in period_list:
|
||||||
|
|||||||
@ -108,30 +108,30 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
|
|||||||
|
|
||||||
# Opening for filtered account
|
# Opening for filtered account
|
||||||
if filters.get("account"):
|
if filters.get("account"):
|
||||||
data += [get_balance_row("Opening", opening), {}]
|
data += [get_balance_row(_("Opening"), opening), {}]
|
||||||
|
|
||||||
for acc, acc_dict in gle_map.items():
|
for acc, acc_dict in gle_map.items():
|
||||||
if acc_dict.entries:
|
if acc_dict.entries:
|
||||||
# Opening for individual ledger, if grouped by account
|
# Opening for individual ledger, if grouped by account
|
||||||
if filters.get("group_by_account"):
|
if filters.get("group_by_account"):
|
||||||
data.append(get_balance_row("Opening", acc_dict.opening))
|
data.append(get_balance_row(_("Opening"), acc_dict.opening))
|
||||||
|
|
||||||
data += acc_dict.entries
|
data += acc_dict.entries
|
||||||
|
|
||||||
# Totals and closing for individual ledger, if grouped by account
|
# Totals and closing for individual ledger, if grouped by account
|
||||||
if filters.get("group_by_account"):
|
if filters.get("group_by_account"):
|
||||||
data += [{"account": "'Totals'", "debit": acc_dict.total_debit,
|
data += [{"account": "'" + _("Totals") + "'", "debit": acc_dict.total_debit,
|
||||||
"credit": acc_dict.total_credit},
|
"credit": acc_dict.total_credit},
|
||||||
get_balance_row("Closing (Opening + Totals)",
|
get_balance_row(_("Closing (Opening + Totals)"),
|
||||||
(acc_dict.opening + acc_dict.total_debit - acc_dict.total_credit)), {}]
|
(acc_dict.opening + acc_dict.total_debit - acc_dict.total_credit)), {}]
|
||||||
|
|
||||||
# Total debit and credit between from and to date
|
# Total debit and credit between from and to date
|
||||||
if total_debit or total_credit:
|
if total_debit or total_credit:
|
||||||
data.append({"account": "'Totals'", "debit": total_debit, "credit": total_credit})
|
data.append({"account": "'" + _("Totals") + "'", "debit": total_debit, "credit": total_credit})
|
||||||
|
|
||||||
# Closing for filtered account
|
# Closing for filtered account
|
||||||
if filters.get("account"):
|
if filters.get("account"):
|
||||||
data.append(get_balance_row("Closing (Opening + Totals)",
|
data.append(get_balance_row(_("Closing (Opening + Totals)"),
|
||||||
(opening + total_debit - total_credit)))
|
(opening + total_debit - total_credit)))
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|||||||
@ -27,7 +27,7 @@ def execute(filters=None):
|
|||||||
def get_net_profit_loss(income, expense, period_list):
|
def get_net_profit_loss(income, expense, period_list):
|
||||||
if income and expense:
|
if income and expense:
|
||||||
net_profit_loss = {
|
net_profit_loss = {
|
||||||
"account_name": _("'Net Profit / Loss'"),
|
"account_name": "'" + _("Net Profit / Loss") + "'",
|
||||||
"account": None,
|
"account": None,
|
||||||
"warn_if_negative": True
|
"warn_if_negative": True
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,6 @@ cur_frm.cscript.hour_rate = function(doc, dt, dn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.time_in_mins = cur_frm.cscript.hour_rate;
|
cur_frm.cscript.time_in_mins = cur_frm.cscript.hour_rate;
|
||||||
cur_frm.cscript.fixed_cycle_cost = cur_frm.cscript.hour_rate;
|
|
||||||
|
|
||||||
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
|
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
|
||||||
get_bom_material_detail(doc, cdt, cdn);
|
get_bom_material_detail(doc, cdt, cdn);
|
||||||
|
|||||||
@ -35,18 +35,20 @@ frappe.ui.form.on("Production Order", "additional_operating_cost", function(frm)
|
|||||||
|
|
||||||
frappe.ui.form.on("Production Order Operation", "workstation", function(frm, cdt, cdn) {
|
frappe.ui.form.on("Production Order Operation", "workstation", function(frm, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
frappe.call({
|
if (d.workstation) {
|
||||||
"method": "frappe.client.get",
|
frappe.call({
|
||||||
args: {
|
"method": "frappe.client.get",
|
||||||
doctype: "Workstation",
|
args: {
|
||||||
name: d.workstation
|
doctype: "Workstation",
|
||||||
},
|
name: d.workstation
|
||||||
callback: function (data) {
|
},
|
||||||
frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
|
callback: function (data) {
|
||||||
erpnext.production_order.calculate_cost(frm.doc);
|
frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
|
||||||
erpnext.production_order.calculate_total_cost(frm);
|
erpnext.production_order.calculate_cost(frm.doc);
|
||||||
}
|
erpnext.production_order.calculate_total_cost(frm);
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Production Order Operation", "time_in_mins", function(frm, cdt, cdn) {
|
frappe.ui.form.on("Production Order Operation", "time_in_mins", function(frm, cdt, cdn) {
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
@ -293,7 +293,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"modified": "2015-04-22 03:25:18.542350",
|
"modified": "2015-05-21 13:46:27.730392",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Production Order Operation",
|
"name": "Production Order Operation",
|
||||||
|
|||||||
@ -156,3 +156,4 @@ erpnext.patches.v5_0.repost_requested_qty
|
|||||||
erpnext.patches.v5_0.fix_taxes_and_totals_in_party_currency
|
erpnext.patches.v5_0.fix_taxes_and_totals_in_party_currency
|
||||||
erpnext.patches.v5_0.update_tax_amount_after_discount_in_purchase_cycle
|
erpnext.patches.v5_0.update_tax_amount_after_discount_in_purchase_cycle
|
||||||
erpnext.patches.v5_0.rename_pos_setting
|
erpnext.patches.v5_0.rename_pos_setting
|
||||||
|
execute:frappe.db.sql("update `tabBOM Operation` set description=opn_description where ifnull(description, '') = ''")
|
||||||
|
|||||||
@ -21,6 +21,7 @@ class NamingSeries(Document):
|
|||||||
|
|
||||||
prefixes = ""
|
prefixes = ""
|
||||||
for d in doctypes:
|
for d in doctypes:
|
||||||
|
options = ""
|
||||||
try:
|
try:
|
||||||
options = self.get_options(d)
|
options = self.get_options(d)
|
||||||
except frappe.DoesNotExistError:
|
except frappe.DoesNotExistError:
|
||||||
|
|||||||
@ -446,9 +446,9 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
|
|||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.message) {
|
if(r.message) {
|
||||||
$.each(r.message, function(k, v) {
|
$.each(r.message, function(k, v) {
|
||||||
frappe.model.set_value(cdt, cdn, k, v);
|
d[k] = v;
|
||||||
});
|
});
|
||||||
refresh_field('image_view', d.name, 'items');
|
refresh_field('items');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user