Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(selling): added delivery days to customer doctype #488

Merged
merged 29 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0030115
feat: from Delivery note, Purchase receipt and Stock entry Create Qua…
vishdha Jul 31, 2020
cd98359
fix: Fixed Suggested changes
vishdha Jul 31, 2020
1f73bc9
fix: minor changes added
vishdha Aug 5, 2020
0c3796c
fix: minor changes added
vishdha Aug 13, 2020
7796924
fix: show only quality required check item in dialog box
vishdha Aug 19, 2020
319b34a
fix: msgprint added for quality inspection link
vishdha Aug 19, 2020
cdc9545
Merge branch 'TASK-2020-01134-1' of https://github.com/vishdha/erpnex…
Aug 19, 2020
6d7698c
Merge branch 'staging' of https://github.com/DigiThinkIT/erpnext into…
Aug 19, 2020
c3b12ae
feat(selling): added delivery days to customer
Aug 19, 2020
746ecfc
resolved changes
Aug 19, 2020
1657427
resolved changes
Aug 19, 2020
de21ae8
resolved changes
Aug 19, 2020
78c4048
resolved changes
Aug 19, 2020
9ca5664
fixed changes
Aug 21, 2020
265f88c
fixed changes
Aug 21, 2020
8e9342e
fixed changes
Aug 21, 2020
88c020b
Merge branch 'staging' of https://github.com/DigiThinkIT/erpnext into…
Aug 24, 2020
af0548e
fix: changed Delivery Window Label to Delivery Preferences
Aug 24, 2020
d9abd3f
Merge branch 'staging' into customer-delivery-days
Alchez Aug 25, 2020
3a8fba4
fix: Fixed delivery days design
Aug 31, 2020
ee6e22e
Merge pull request #1 from meshramsaroj/fix-design-fixes
Alchez Sep 1, 2020
a711aff
change
Sep 3, 2020
055a4a6
WIP
Sep 7, 2020
0eb392e
feat: applied new solution
Sep 8, 2020
a742034
fixed changes
Sep 8, 2020
3735e66
fixed changes
Sep 8, 2020
9d9a117
fixed changes
Sep 8, 2020
4d2d27d
fixed changes
Sep 8, 2020
f6f621f
fix: indent
Alchez Sep 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions erpnext/selling/doctype/customer/customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ frappe.ui.form.on("Customer", {
}
},

onload: function(frm) {
let days_of_week = moment.weekdays()
Alchez marked this conversation as resolved.
Show resolved Hide resolved
$.each(days_of_week, function(i, m) {
$(repl('<div class="col-sm-3">\
<div class="checkbox">\
<label><input type="checkbox" day="%(day)s" value="%(day)s"/>\%(day)s</label>\
</div></div>', {day: m})).appendTo(frm.fields_dict.days_of_the_week.wrapper);
});
Alchez marked this conversation as resolved.
Show resolved Hide resolved
},

refresh: function(frm) {
if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
frm.toggle_display("naming_series", false);
Expand Down Expand Up @@ -179,5 +189,24 @@ frappe.ui.form.on("Customer", {
${ __("Sales Target") }</a></h5>`);
frm.dashboard.add_progress(__('Status'), bars, message).appendTo(section)
frm.dashboard.show();
},
before_save: function(frm) {
let days_selected = [];
if(frm.doc.delivery_days) {
Alchez marked this conversation as resolved.
Show resolved Hide resolved
$(frm.fields_dict.days_of_the_week.wrapper).find('input[type="checkbox"]').each(function(i, check) {
if($(check).is(":checked")) {
days_selected.push(this.value);
}
});
frm.set_value("delivery_days", days_selected.toString())
}
else {
$(frm.fields_dict.days_of_the_week.wrapper).find('input[type="checkbox"]').each(function(i, check) {
if($(check).is(":checked")) {
days_selected.push(this.value);
}
});
frm.set_value("delivery_days", days_selected.toString())
}
}
});
21 changes: 17 additions & 4 deletions erpnext/selling/doctype/customer/customer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"actions": [],
"allow_events_in_timeline": 1,
"allow_import": 1,
"allow_rename": 1,
Expand Down Expand Up @@ -59,6 +58,8 @@
"delivery_start_time",
"column_break_42",
"delivery_end_time",
"days_of_the_week",
"delivery_days",
"credit_limit_section",
"payment_terms",
"credit_limits",
Expand All @@ -76,7 +77,8 @@
"default_commission_rate",
"sales_team_section",
"sales_team",
"customer_pos_id"
"customer_pos_id",
"column_break_22"
Alchez marked this conversation as resolved.
Show resolved Hide resolved
],
"fields": [
{
Expand Down Expand Up @@ -535,13 +537,24 @@
"fieldname": "sales_target_sb",
"fieldtype": "Section Break",
"label": "Sales Target"
},
{
"columns": 11,
Alchez marked this conversation as resolved.
Show resolved Hide resolved
"fieldname": "delivery_days",
"fieldtype": "Data",
"hidden": 1,
"label": "Delivery Days"
},
{
"fieldname": "days_of_the_week",
Alchez marked this conversation as resolved.
Show resolved Hide resolved
"fieldtype": "HTML",
"label": "Days of the week"
}
],
"icon": "fa fa-user",
"idx": 363,
"image_field": "image",
"links": [],
"modified": "2020-06-30 22:24:37.691545",
"modified": "2020-08-18 05:12:17.235873",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
Expand Down