Merge branch 'develop' into razorpay-subscription

This commit is contained in:
Shivam Mishra 2020-04-29 11:17:44 +05:30 committed by GitHub
commit 357d11adbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 58 additions and 64 deletions

View File

@ -326,7 +326,7 @@ def make_payment_request(**args):
"reference_doctype": args.dt, "reference_doctype": args.dt,
"reference_name": args.dn, "reference_name": args.dn,
"party_type": args.get("party_type") or "Customer", "party_type": args.get("party_type") or "Customer",
"party": args.get("party") or ref_doc.customer, "party": args.get("party") or ref_doc.get("customer"),
"bank_account": bank_account "bank_account": bank_account
}) })

View File

@ -23,11 +23,7 @@ def get_data():
}, },
{ {
'label': _('Payments'), 'label': _('Payments'),
'items': ['Payment Entry'] 'items': ['Payment Entry', 'Bank Account']
},
{
'label': _('Bank'),
'items': ['Bank Account']
}, },
{ {
'label': _('Pricing'), 'label': _('Pricing'),

View File

@ -112,6 +112,8 @@ frappe.ui.form.on("Fees", {
args: { args: {
"dt": frm.doc.doctype, "dt": frm.doc.doctype,
"dn": frm.doc.name, "dn": frm.doc.name,
"party_type": "Student",
"party": frm.doc.student,
"recipient_id": frm.doc.student_email "recipient_id": frm.doc.student_email
}, },
callback: function(r) { callback: function(r) {

View File

@ -75,7 +75,8 @@ class Fees(AccountsController):
self.make_gl_entries() self.make_gl_entries()
if self.send_payment_request and self.student_email: if self.send_payment_request and self.student_email:
pr = make_payment_request(dt="Fees", dn=self.name, recipient_id=self.student_email, pr = make_payment_request(party_type="Student", party=self.student, dt="Fees",
dn=self.name, recipient_id=self.student_email,
submit_doc=True, use_dummy_message=True) submit_doc=True, use_dummy_message=True)
frappe.msgprint(_("Payment request {0} created").format(getlink("Payment Request", pr.name))) frappe.msgprint(_("Payment request {0} created").format(getlink("Payment Request", pr.name)))

View File

@ -6,6 +6,9 @@ def get_data():
'heatmap': True, 'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Student'), 'heatmap_message': _('This is based on the attendance of this Student'),
'fieldname': 'student', 'fieldname': 'student',
'non_standard_fieldnames': {
'Bank Account': 'party'
},
'transactions': [ 'transactions': [
{ {
'label': _('Admission'), 'label': _('Admission'),
@ -29,7 +32,7 @@ def get_data():
}, },
{ {
'label': _('Fee'), 'label': _('Fee'),
'items': ['Fees'] 'items': ['Fees', 'Bank Account']
} }
] ]
} }

View File

@ -6,6 +6,9 @@ def get_data():
'heatmap': True, 'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Employee'), 'heatmap_message': _('This is based on the attendance of this Employee'),
'fieldname': 'employee', 'fieldname': 'employee',
'non_standard_fieldnames': {
'Bank Account': 'party'
},
'transactions': [ 'transactions': [
{ {
'label': _('Leave and Attendance'), 'label': _('Leave and Attendance'),
@ -33,7 +36,7 @@ def get_data():
}, },
{ {
'label': _('Payroll'), 'label': _('Payroll'),
'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet','Employee Incentive', 'Retention Bonus'] 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet','Employee Incentive', 'Retention Bonus', 'Bank Account']
}, },
{ {
'label': _('Training'), 'label': _('Training'),

View File

@ -6,10 +6,17 @@ def get_data():
'heatmap': True, 'heatmap': True,
'heatmap_message': _('Member Activity'), 'heatmap_message': _('Member Activity'),
'fieldname': 'member', 'fieldname': 'member',
'non_standard_fieldnames': {
'Bank Account': 'party'
},
'transactions': [ 'transactions': [
{ {
'label': _('Membership Details'), 'label': _('Membership Details'),
'items': ['Membership'] 'items': ['Membership']
},
{
'label': _('Fee'),
'items': ['Bank Account']
} }
] ]
} }

View File

@ -24,7 +24,7 @@ doctypes_with_dimensions.forEach((doctype) => {
onload: function(frm) { onload: function(frm) {
erpnext.dimension_filters.forEach((dimension) => { erpnext.dimension_filters.forEach((dimension) => {
frappe.model.with_doctype(dimension['document_type'], () => { frappe.model.with_doctype(dimension['document_type'], () => {
if (frappe.meta.has_field(dimension['document_type'], 'is_group')) { if(frappe.meta.has_field(dimension['document_type'], 'is_group')) {
frm.set_query(dimension['fieldname'], { frm.set_query(dimension['fieldname'], {
"is_group": 0 "is_group": 0
}); });
@ -42,21 +42,23 @@ doctypes_with_dimensions.forEach((doctype) => {
update_dimension: function(frm) { update_dimension: function(frm) {
erpnext.dimension_filters.forEach((dimension) => { erpnext.dimension_filters.forEach((dimension) => {
if (frm.is_new()) { if(frm.is_new()) {
if (frm.doc.company && Object.keys(default_dimensions || {}).length > 0 if(frm.doc.company && Object.keys(default_dimensions || {}).length > 0
&& default_dimensions[frm.doc.company]) { && default_dimensions[frm.doc.company]) {
let default_dimension = default_dimensions[frm.doc.company][dimension['document_type']];
if(default_dimension) {
if (frappe.meta.has_field(doctype, dimension['fieldname'])) { if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
frm.set_value(dimension['fieldname'], frm.set_value(dimension['fieldname'], default_dimension);
default_dimensions[frm.doc.company][dimension['document_type']]);
} }
$.each(frm.doc.items || frm.doc.accounts || [], function(i, row) { $.each(frm.doc.items || frm.doc.accounts || [], function(i, row) {
frappe.model.set_value(row.doctype, row.name, dimension['fieldname'], frappe.model.set_value(row.doctype, row.name, dimension['fieldname'], default_dimension);
default_dimensions[frm.doc.company][dimension['document_type']])
}); });
} }
} }
}
}); });
} }
}); });
@ -71,20 +73,6 @@ child_docs.forEach((doctype) => {
}); });
}, },
accounts_add: function(frm, cdt, cdn) {
erpnext.dimension_filters.forEach((dimension) => {
var row = frappe.get_doc(cdt, cdn);
frm.script_manager.copy_from_first_row("accounts", row, [dimension['fieldname']]);
});
},
items_add: function(frm, cdt, cdn) {
erpnext.dimension_filters.forEach((dimension) => {
var row = frappe.get_doc(cdt, cdn);
frm.script_manager.copy_from_first_row("items", row, [dimension['fieldname']]);
});
},
accounts_add: function(frm, cdt, cdn) { accounts_add: function(frm, cdt, cdn) {
erpnext.dimension_filters.forEach((dimension) => { erpnext.dimension_filters.forEach((dimension) => {
var row = frappe.get_doc(cdt, cdn); var row = frappe.get_doc(cdt, cdn);

View File

@ -11,7 +11,8 @@ def get_data():
'non_standard_fieldnames': { 'non_standard_fieldnames': {
'Payment Entry': 'party', 'Payment Entry': 'party',
'Quotation': 'party_name', 'Quotation': 'party_name',
'Opportunity': 'party_name' 'Opportunity': 'party_name',
'Bank Account': 'party'
}, },
'dynamic_links': { 'dynamic_links': {
'party_name': ['Customer', 'quotation_to'] 'party_name': ['Customer', 'quotation_to']
@ -27,7 +28,7 @@ def get_data():
}, },
{ {
'label': _('Payments'), 'label': _('Payments'),
'items': ['Payment Entry'] 'items': ['Payment Entry', 'Bank Account']
}, },
{ {
'label': _('Support'), 'label': _('Support'),

View File

@ -215,9 +215,7 @@ frappe.ui.form.on('Stock Entry', {
source_doctype: "Material Request", source_doctype: "Material Request",
target: frm, target: frm,
date_field: "schedule_date", date_field: "schedule_date",
setters: { setters: {},
company: frm.doc.company,
},
get_query_filters: { get_query_filters: {
docstatus: 1, docstatus: 1,
material_request_type: ["in", ["Material Transfer", "Material Issue"]], material_request_type: ["in", ["Material Transfer", "Material Issue"]],

View File

@ -1,4 +1,5 @@
{ {
"actions": [],
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-04-09 11:43:55", "creation": "2013-04-09 11:43:55",
@ -12,7 +13,6 @@
"stock_entry_type", "stock_entry_type",
"outgoing_stock_entry", "outgoing_stock_entry",
"purpose", "purpose",
"company",
"work_order", "work_order",
"purchase_order", "purchase_order",
"delivery_note_no", "delivery_note_no",
@ -20,6 +20,7 @@
"pick_list", "pick_list",
"purchase_receipt_no", "purchase_receipt_no",
"col2", "col2",
"company",
"posting_date", "posting_date",
"posting_time", "posting_time",
"set_posting_time", "set_posting_time",
@ -65,6 +66,7 @@
"dimension_col_break", "dimension_col_break",
"printing_settings", "printing_settings",
"select_print_heading", "select_print_heading",
"print_settings_col_break",
"letter_head", "letter_head",
"more_info", "more_info",
"is_opening", "is_opening",
@ -291,6 +293,7 @@
"fieldtype": "Section Break" "fieldtype": "Section Break"
}, },
{ {
"description": "Sets 'Source Warehouse' in each row of the items table.",
"fieldname": "from_warehouse", "fieldname": "from_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -320,6 +323,7 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"description": "Sets 'Target Warehouse' in each row of the items table.",
"fieldname": "to_warehouse", "fieldname": "to_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -622,12 +626,17 @@
"label": "Pick List", "label": "Pick List",
"options": "Pick List", "options": "Pick List",
"read_only": 1 "read_only": 1
},
{
"fieldname": "print_settings_col_break",
"fieldtype": "Column Break"
} }
], ],
"icon": "fa fa-file-text", "icon": "fa fa-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2019-09-27 14:38:20.801420", "links": [],
"modified": "2020-04-23 12:56:52.881752",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Entry", "name": "Stock Entry",

View File

@ -14,12 +14,12 @@
"t_warehouse", "t_warehouse",
"sec_break1", "sec_break1",
"item_code", "item_code",
"item_group",
"col_break2", "col_break2",
"item_name", "item_name",
"section_break_8", "section_break_8",
"description", "description",
"column_break_10", "column_break_10",
"item_group",
"image", "image",
"image_view", "image_view",
"quantity_and_rate", "quantity_and_rate",
@ -178,6 +178,7 @@
"bold": 1, "bold": 1,
"fieldname": "basic_rate", "fieldname": "basic_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"in_list_view": 1,
"label": "Basic Rate (as per Stock UOM)", "label": "Basic Rate (as per Stock UOM)",
"oldfieldname": "incoming_rate", "oldfieldname": "incoming_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
@ -420,6 +421,7 @@
"options": "Item" "options": "Item"
}, },
{ {
"collapsible": 1,
"fieldname": "reference_section", "fieldname": "reference_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Reference" "label": "Reference"
@ -466,7 +468,6 @@
"fetch_from": "item_code.item_group", "fetch_from": "item_code.item_group",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Item Group" "label": "Item Group"
}, },
{ {
@ -495,7 +496,7 @@
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2020-03-19 12:34:09.836295", "modified": "2020-04-23 19:19:28.539769",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Entry Detail", "name": "Stock Entry Detail",

View File

@ -46,19 +46,6 @@ def execute(filters=None):
"out_qty": min(sle.actual_qty, 0) "out_qty": min(sle.actual_qty, 0)
}) })
# get the name of the item that was produced using this item
if sle.voucher_type == "Stock Entry":
purpose, work_order, fg_completed_qty = frappe.db.get_value(sle.voucher_type, sle.voucher_no, ["purpose", "work_order", "fg_completed_qty"])
if purpose == "Manufacture" and work_order:
finished_product = frappe.db.get_value("Work Order", work_order, "item_name")
finished_qty = fg_completed_qty
sle.update({
"finished_product": finished_product,
"finished_qty": finished_qty,
})
data.append(sle) data.append(sle)
if include_uom: if include_uom:
@ -77,8 +64,6 @@ def get_columns():
{"label": _("In Qty"), "fieldname": "in_qty", "fieldtype": "Float", "width": 80, "convertible": "qty"}, {"label": _("In Qty"), "fieldname": "in_qty", "fieldtype": "Float", "width": 80, "convertible": "qty"},
{"label": _("Out Qty"), "fieldname": "out_qty", "fieldtype": "Float", "width": 80, "convertible": "qty"}, {"label": _("Out Qty"), "fieldname": "out_qty", "fieldtype": "Float", "width": 80, "convertible": "qty"},
{"label": _("Balance Qty"), "fieldname": "qty_after_transaction", "fieldtype": "Float", "width": 100, "convertible": "qty"}, {"label": _("Balance Qty"), "fieldname": "qty_after_transaction", "fieldtype": "Float", "width": 100, "convertible": "qty"},
{"label": _("Finished Product"), "fieldname": "finished_product", "width": 100},
{"label": _("Finished Qty"), "fieldname": "finished_qty", "fieldtype": "Float", "width": 100, "convertible": "qty"},
{"label": _("Voucher #"), "fieldname": "voucher_no", "fieldtype": "Dynamic Link", "options": "voucher_type", "width": 150}, {"label": _("Voucher #"), "fieldname": "voucher_no", "fieldtype": "Dynamic Link", "options": "voucher_type", "width": 150},
{"label": _("Warehouse"), "fieldname": "warehouse", "fieldtype": "Link", "options": "Warehouse", "width": 150}, {"label": _("Warehouse"), "fieldname": "warehouse", "fieldtype": "Link", "options": "Warehouse", "width": 150},
{"label": _("Item Group"), "fieldname": "item_group", "fieldtype": "Link", "options": "Item Group", "width": 100}, {"label": _("Item Group"), "fieldname": "item_group", "fieldtype": "Link", "options": "Item Group", "width": 100},