Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
618fefea73 | ||
|
|
31d9d9f561 | ||
|
|
e715572e7c | ||
|
|
d138b06c8e | ||
|
|
37ee57c211 | ||
|
|
95b995be6d | ||
|
|
86e479f908 | ||
|
|
2a52f59b32 | ||
|
|
c185734bf3 | ||
|
|
beb7c346ea | ||
|
|
88655890be | ||
|
|
e7b37af525 | ||
|
|
10026ea85c | ||
|
|
960118a954 | ||
|
|
8860b9d94d | ||
|
|
f4f9be9233 | ||
|
|
81bded1afe | ||
|
|
7f1d5efd5b | ||
|
|
54a10cd2af | ||
|
|
f52b5ac8af | ||
|
|
2fd33a2f03 | ||
|
|
78f137890c | ||
|
|
0d79be5628 | ||
|
|
fa555abbd2 | ||
|
|
eb00cae86c | ||
|
|
5b731ff73a | ||
|
|
5b8db3729c | ||
|
|
69fb13f229 | ||
|
|
c2acfc9828 | ||
|
|
409843d768 | ||
|
|
fb4e496b54 | ||
|
|
ff8a854b82 | ||
|
|
438b67e8b0 | ||
|
|
e440914327 | ||
|
|
dcbc4d1a46 | ||
|
|
e1637c4cae | ||
|
|
b3fb6e1e04 | ||
|
|
354443b073 | ||
|
|
d4c8dc2915 | ||
|
|
d51cf79fe2 | ||
|
|
306c49f8a0 | ||
|
|
c7cfa270cd | ||
|
|
1568dc32a2 | ||
|
|
878a18528c | ||
|
|
5fa6c4ce21 | ||
|
|
b8ad56f819 | ||
|
|
b3a142f5ab | ||
|
|
1f5b21673c | ||
|
|
093beecd0a | ||
|
|
822fd7747a | ||
|
|
f29a618b69 | ||
|
|
314af94737 | ||
|
|
6771240471 | ||
|
|
f8594feb55 | ||
|
|
6a0563f4b2 | ||
|
|
ed618f284b |
@@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '5.0.9'
|
||||
__version__ = '5.0.11'
|
||||
|
||||
@@ -76,9 +76,9 @@ class JournalEntry(AccountsController):
|
||||
account_type = frappe.db.get_value("Account", d.account, "account_type")
|
||||
if account_type in ["Receivable", "Payable"]:
|
||||
if not (d.party_type and d.party):
|
||||
frappe.throw(_("Row{0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
|
||||
frappe.throw(_("Row {0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
|
||||
elif d.party_type and d.party:
|
||||
frappe.throw(_("Row{0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
|
||||
frappe.throw(_("Row {0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
|
||||
|
||||
def check_credit_limit(self):
|
||||
customers = list(set([d.party for d in self.get("accounts") if d.party_type=="Customer" and flt(d.debit) > 0]))
|
||||
@@ -438,7 +438,7 @@ class JournalEntry(AccountsController):
|
||||
if self.stock_entry:
|
||||
if frappe.db.get_value("Stock Entry", self.stock_entry, "docstatus") != 1:
|
||||
frappe.throw(_("Stock Entry {0} is not submitted").format(self.stock_entry))
|
||||
|
||||
|
||||
if frappe.db.exists({"doctype": "Journal Entry", "stock_entry": self.stock_entry, "docstatus":1}):
|
||||
frappe.msgprint(_("Warning: Another {0} # {1} exists against stock entry {2}".format(self.voucher_type, self.name, self.stock_entry)))
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Float",
|
||||
"label": "Discount Percentage",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@@ -245,7 +245,7 @@
|
||||
"icon": "icon-gift",
|
||||
"idx": 1,
|
||||
"istable": 0,
|
||||
"modified": "2015-02-26 04:26:13.240166",
|
||||
"modified": "2015-05-27 02:47:16.777466",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Pricing Rule",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -105,10 +105,11 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount %",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0
|
||||
@@ -451,7 +452,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-02-23 15:35:32.895515",
|
||||
"modified": "2015-05-27 02:47:16.341373",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice Item",
|
||||
|
||||
@@ -23,7 +23,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
this.frm.set_value("is_pos", 1);
|
||||
this.is_pos(function() {
|
||||
if (cint(frappe.defaults.get_user_defaults("fs_pos_view"))===1)
|
||||
erpnext.pos.toggle(me.frm);
|
||||
erpnext.pos.toggle(me.frm, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
}
|
||||
|
||||
// Show buttons only when pos view is active
|
||||
if (doc.docstatus===0 && !this.pos_active) {
|
||||
if (doc.docstatus===0 && !cur_frm.page.current_view_name!=="pos") {
|
||||
cur_frm.cscript.sales_order_btn();
|
||||
cur_frm.cscript.delivery_note_btn();
|
||||
}
|
||||
@@ -253,7 +253,7 @@ cur_frm.cscript.mode_of_payment = function(doc) {
|
||||
if(r.message) {
|
||||
cur_frm.set_value("cash_bank_account", r.message["account"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
"default": "Grand Total",
|
||||
"fieldname": "apply_discount_on",
|
||||
"fieldtype": "Select",
|
||||
"label": "Apply Discount On",
|
||||
"label": "Apply Additional Discount On",
|
||||
"options": "\nGrand Total\nNet Total",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -494,7 +494,7 @@
|
||||
{
|
||||
"fieldname": "discount_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Discount Amount",
|
||||
"label": "Additional Discount Amount",
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
@@ -1243,7 +1243,7 @@
|
||||
"icon": "icon-file-text",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-05-21 05:34:21.539823",
|
||||
"modified": "2015-05-27 02:48:02.897865",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice",
|
||||
|
||||
@@ -98,10 +98,11 @@
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount (%)",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"oldfieldname": "adj_rate",
|
||||
"oldfieldtype": "Float",
|
||||
"permlevel": 0,
|
||||
@@ -504,7 +505,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-03-23 14:56:45.641026",
|
||||
"modified": "2015-05-27 02:47:15.645114",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Item",
|
||||
|
||||
@@ -55,7 +55,7 @@ frappe.pages["Accounts Browser"].on_page_load = function(wrapper){
|
||||
.change(function() {
|
||||
var ctype = frappe.get_route()[1] || 'Account';
|
||||
erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(),
|
||||
chart_area.get(0));
|
||||
chart_area.get(0), wrapper.page);
|
||||
})
|
||||
|
||||
// load up companies
|
||||
@@ -75,19 +75,23 @@ frappe.pages["Accounts Browser"].on_page_show = function(wrapper){
|
||||
// set route
|
||||
var ctype = frappe.get_route()[1] || 'Account';
|
||||
|
||||
|
||||
|
||||
if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) {
|
||||
wrapper.$company_select.change();
|
||||
}
|
||||
}
|
||||
|
||||
erpnext.AccountsChart = Class.extend({
|
||||
init: function(ctype, company, wrapper) {
|
||||
init: function(ctype, company, wrapper, page) {
|
||||
$(wrapper).empty();
|
||||
var me = this;
|
||||
me.ctype = ctype;
|
||||
me.can_create = frappe.model.can_create(this.ctype);
|
||||
me.can_delete = frappe.model.can_delete(this.ctype);
|
||||
me.can_write = frappe.model.can_write(this.ctype);
|
||||
me.page = page;
|
||||
me.set_title();
|
||||
|
||||
// __("Accounts"), __("Cost Centers")
|
||||
|
||||
@@ -169,9 +173,9 @@ erpnext.AccountsChart = Class.extend({
|
||||
set_title: function(val) {
|
||||
var chart_str = this.ctype=="Account" ? __("Chart of Accounts") : __("Chart of Cost Centers");
|
||||
if(val) {
|
||||
wrapper.page.set_title(chart_str + " - " + cstr(val));
|
||||
this.page.set_title(chart_str + " - " + cstr(val));
|
||||
} else {
|
||||
wrapper.page.set_title(chart_str);
|
||||
this.page.set_title(chart_str);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
|
||||
</div>
|
||||
<h2 class="text-center">{%= __("Statement of Account") %}</h2>
|
||||
<h4 class="text-center">{%= filters.account && (filters.account + ", ") || "" %} {%= filters.company %}</h4>
|
||||
<h4 class="text-center">{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ") || "" %} {%= filters.company %}</h4>
|
||||
<h5 class="text-center">
|
||||
{%= dateutil.str_to_user(filters.from_date) %}
|
||||
{%= __("to") %}
|
||||
@@ -26,15 +26,20 @@
|
||||
<td>{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}</td>
|
||||
<td>{%= data[i][__("Voucher Type")] %}
|
||||
<br>{%= data[i][__("Voucher No")] %}</td>
|
||||
<td>{%= data[i][__("Account")] %}
|
||||
<br>{%= __("Against") %}: {%= data[i][__("Against Account")] %}
|
||||
<td>
|
||||
{% if(!(filters.party || filters.account)) { %}
|
||||
{%= data[i][__("Party")] || data[i][__("Account")] %}
|
||||
<br>
|
||||
{% } %}
|
||||
|
||||
{{ __("Against") }}: {%= data[i][__("Against Account")] %}
|
||||
<br>{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}</td>
|
||||
<td style="text-align: right">{%= format_currency(data[i][__("Debit")]) %}</td>
|
||||
<td style="text-align: right">{%= format_currency(data[i][__("Credit")]) %}</td>
|
||||
{% } else { %}
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b>{%= data[i][__("Account")] || " " %}</b></td>
|
||||
<td><b>{%= frappe.format(data[i][__("Account")], {fieldtype: "Link"}) || " " %}</b></td>
|
||||
<td style="text-align: right">
|
||||
{%= data[i][__("Account")] && format_currency(data[i][__("Debit")]) %}</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
@@ -9,7 +9,7 @@ from frappe import _
|
||||
def execute(filters=None):
|
||||
account_details = {}
|
||||
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
|
||||
account_details.setdefault(acc.name, acc)
|
||||
account_details.setdefault(acc.name, acc)
|
||||
|
||||
validate_filters(filters, account_details)
|
||||
validate_party(filters)
|
||||
@@ -82,8 +82,6 @@ def get_conditions(filters):
|
||||
lft, rgt = frappe.db.get_value("Account", filters["account"], ["lft", "rgt"])
|
||||
conditions.append("""account in (select name from tabAccount
|
||||
where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
|
||||
else:
|
||||
conditions.append("posting_date between %(from_date)s and %(to_date)s")
|
||||
|
||||
if filters.get("voucher_no"):
|
||||
conditions.append("voucher_no=%(voucher_no)s")
|
||||
@@ -107,7 +105,7 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
|
||||
opening, total_debit, total_credit, gle_map = get_accountwise_gle(filters, gl_entries, gle_map)
|
||||
|
||||
# Opening for filtered account
|
||||
if filters.get("account"):
|
||||
if filters.get("account") or filters.get("party"):
|
||||
data += [get_balance_row(_("Opening"), opening), {}]
|
||||
|
||||
for acc, acc_dict in gle_map.items():
|
||||
@@ -130,7 +128,7 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
|
||||
data.append({"account": "'" + _("Totals") + "'", "debit": total_debit, "credit": total_credit})
|
||||
|
||||
# Closing for filtered account
|
||||
if filters.get("account"):
|
||||
if filters.get("account") or filters.get("party"):
|
||||
data.append(get_balance_row(_("Closing (Opening + Totals)"),
|
||||
(opening + total_debit - total_credit)))
|
||||
|
||||
@@ -153,9 +151,10 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
|
||||
|
||||
for gle in gl_entries:
|
||||
amount = flt(gle.debit, 3) - flt(gle.credit, 3)
|
||||
if filters.get("account") and gle.posting_date < getdate(filters.from_date):
|
||||
if gle.posting_date < getdate(filters.from_date):
|
||||
gle_map[gle.account].opening += amount
|
||||
opening += amount
|
||||
if filters.get("account") or filters.get("party"):
|
||||
opening += amount
|
||||
elif gle.posting_date <= getdate(filters.to_date):
|
||||
gle_map[gle.account].entries.append(gle)
|
||||
gle_map[gle.account].total_debit += flt(gle.debit, 3)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import msgprint, _
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
|
||||
def execute(filters=None):
|
||||
@@ -23,7 +23,7 @@ def execute(filters=None):
|
||||
purchase_receipt = d.purchase_receipt
|
||||
elif d.po_detail:
|
||||
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
|
||||
from `tabPurchase Receipt Item` where docstatus=1 and po_detail=%s""", d.po_detail))
|
||||
from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
|
||||
|
||||
expense_account = d.expense_account or aii_account_map.get(d.company)
|
||||
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,
|
||||
|
||||
@@ -144,7 +144,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
||||
return invoice_expense_map, invoice_tax_map
|
||||
|
||||
def get_invoice_po_pr_map(invoice_list):
|
||||
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail
|
||||
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail,
|
||||
project_name from `tabPurchase Invoice Item` where parent in (%s)
|
||||
and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')""" %
|
||||
', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||
@@ -160,7 +160,7 @@ def get_invoice_po_pr_map(invoice_list):
|
||||
pr_list = [d.purchase_receipt]
|
||||
elif d.po_detail:
|
||||
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
|
||||
where docstatus=1 and po_detail=%s""", d.pr_detail)
|
||||
where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail)
|
||||
|
||||
if pr_list:
|
||||
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -192,10 +192,11 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount %",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0
|
||||
@@ -537,7 +538,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-05-14 14:54:16.899713",
|
||||
"modified": "2015-05-27 02:47:16.553472",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Purchase Order Item",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -121,10 +121,11 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount %",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0
|
||||
@@ -412,7 +413,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-05-14 14:54:36.253819",
|
||||
"modified": "2015-05-27 02:47:15.853886",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Supplier Quotation Item",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
- POS Setting is renamed to POS Profile
|
||||
8
erpnext/change_log/v5/v5_0_11.md
Normal file
8
erpnext/change_log/v5/v5_0_11.md
Normal file
@@ -0,0 +1,8 @@
|
||||
- Watch help videos in new module "Learn"
|
||||
- Letter head and Terms removed from Purchase Invoice
|
||||
- Renaming Discount fields to "Discount on Price List Rate"
|
||||
- Backup manager: You you can choose which backup to download
|
||||
- "Reserved Warehouse" is renamed "Delivery Warehouse" in Sales Order
|
||||
- Timezone fixes: See all time-stamps in Events etc in your timezone, if you are not in the system timezone.
|
||||
- POS Setting is renamed to POS Profile
|
||||
- Fixes to POS
|
||||
@@ -329,4 +329,25 @@ def get_data():
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"icon": "icon-facetime-video",
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Chart of Accounts"),
|
||||
"youtube_id": "DyR-DST-PyA"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Opening Accounting Balance"),
|
||||
"youtube_id": "kdgM20Q-q68"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Setting up Taxes"),
|
||||
"youtube_id": "nQ1zZdPgdaQ"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -156,4 +156,14 @@ def get_data():
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Customer and Supplier"),
|
||||
"youtube_id": "anoGi_RpQ20"
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
@@ -128,4 +128,14 @@ def get_data():
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Lead to Quotation"),
|
||||
"youtube_id": "TxYX4r4JAKA"
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
@@ -62,5 +62,12 @@ def get_data():
|
||||
"icon": "icon-phone",
|
||||
"icon": "octicon octicon-issue-opened",
|
||||
"type": "module"
|
||||
},
|
||||
"Learn": {
|
||||
"color": "#7272FF",
|
||||
"force_show": True,
|
||||
"icon": "icon-facetime-video",
|
||||
"type": "module",
|
||||
"is_help": True
|
||||
}
|
||||
}
|
||||
|
||||
138
erpnext/config/learn.py
Normal file
138
erpnext/config/learn.py
Normal file
@@ -0,0 +1,138 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return [
|
||||
{
|
||||
"label": _("General"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Navigating"),
|
||||
"youtube_id": "YDoI2DF4Lmc"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Setup Wizard"),
|
||||
"youtube_id": "oIOf_zCFWKQ"
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
"label": _("Setup"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Data Import and Export"),
|
||||
"youtube_id": "6wiriRKPhmg"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Opening Stock Balance"),
|
||||
"youtube_id": "yPgrtfeCTs"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Setting up Email"),
|
||||
"youtube_id": "YFYe0DrB95o"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Printing and Branding"),
|
||||
"youtube_id": "cKZHcx1znMc"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Users and Permissions"),
|
||||
"youtube_id": "fnBoRhBrwR4"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Workflow"),
|
||||
"youtube_id": "yObJUg9FxFs"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Accounts"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Chart of Accounts"),
|
||||
"youtube_id": "DyR-DST-PyA"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Setting up Taxes"),
|
||||
"youtube_id": "nQ1zZdPgdaQ"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Opening Accounting Balance"),
|
||||
"youtube_id": "kdgM20Q-q68"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("CRM"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Lead to Quotation"),
|
||||
"youtube_id": "TxYX4r4JAKA"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Selling"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Customer and Supplier"),
|
||||
"youtube_id": "anoGi_RpQ20"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Stock"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Items and Pricing"),
|
||||
"youtube_id": "qXaEwld4_Ps"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Opening Stock Balance"),
|
||||
"youtube_id": "yPgrtfeCTs"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Item Variants"),
|
||||
"youtube_id": "OGBETlCzU5o"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Buying"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Customer and Supplier"),
|
||||
"youtube_id": "anoGi_RpQ20"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Manufacturing"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Bill of Materials"),
|
||||
"youtube_id": "hDV0c1OeWLo"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -55,6 +55,14 @@ def get_data():
|
||||
"name": "BOM Replace Tool",
|
||||
"description": _("Replace Item / BOM in all BOMs"),
|
||||
},
|
||||
{
|
||||
"type": "page",
|
||||
"name": "bom-browser",
|
||||
"icon": "icon-sitemap",
|
||||
"label": _("BOM Browser"),
|
||||
"description": _("Tree of Bill of Materials"),
|
||||
"doctype": "BOM"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -97,4 +105,15 @@ def get_data():
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"icon": "icon-facetime-video",
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Bill of Materials"),
|
||||
"youtube_id": "hDV0c1OeWLo"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -275,4 +275,14 @@ def get_data():
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Customer and Supplier"),
|
||||
"youtube_id": "anoGi_RpQ20"
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
@@ -43,6 +43,36 @@ def get_data():
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"name": _("Data Import and Export"),
|
||||
"youtube_id": "6wiriRKPhmg"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Setting up Email"),
|
||||
"youtube_id": "YFYe0DrB95o"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Printing and Branding"),
|
||||
"youtube_id": "cKZHcx1znMc"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Users and Permissions"),
|
||||
"youtube_id": "fnBoRhBrwR4"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Workflow"),
|
||||
"youtube_id": "yObJUg9FxFs"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Customize"),
|
||||
"icon": "icon-glass",
|
||||
|
||||
@@ -254,4 +254,25 @@ def get_data():
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": _("Help"),
|
||||
"icon": "icon-facetime-video",
|
||||
"items": [
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Items and Pricing"),
|
||||
"youtube_id": "qXaEwld4_Ps"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Opening Stock Balance"),
|
||||
"youtube_id": "yPgrtfeCTs"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Item Variants"),
|
||||
"youtube_id": "OGBETlCzU5o"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -85,9 +85,9 @@ class SellingController(StockController):
|
||||
existing_shipping_charge = self.get("taxes", filters=shipping_charge)
|
||||
if existing_shipping_charge:
|
||||
# take the last record found
|
||||
existing_shipping_charge[-1].rate = shipping_amount
|
||||
existing_shipping_charge[-1].tax_amount = shipping_amount
|
||||
else:
|
||||
shipping_charge["rate"] = shipping_amount
|
||||
shipping_charge["tax_amount"] = shipping_amount
|
||||
shipping_charge["description"] = shipping_rule.label
|
||||
self.append("taxes", shipping_charge)
|
||||
|
||||
|
||||
@@ -8,7 +8,9 @@ import frappe.utils
|
||||
from frappe import throw, _
|
||||
from frappe.model.document import Document
|
||||
from frappe.email.bulk import check_bulk_limit
|
||||
from frappe.utils.verified_command import get_signed_params, verify_request
|
||||
import erpnext.tasks
|
||||
from erpnext.crm.doctype.newsletter_list.newsletter_list import add_subscribers
|
||||
|
||||
class Newsletter(Document):
|
||||
def onload(self):
|
||||
@@ -87,7 +89,6 @@ def get_lead_options():
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def unsubscribe(email, name):
|
||||
from frappe.utils.verified_command import verify_request
|
||||
if not verify_request():
|
||||
return
|
||||
|
||||
@@ -123,3 +124,47 @@ def create_lead(email_id):
|
||||
"source": "Email"
|
||||
})
|
||||
lead.insert()
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def subscribe(email):
|
||||
url = frappe.utils.get_url("/api/method/erpnext.crm.doctype.newsletter.newsletter.confirm_subscription") +\
|
||||
"?" + get_signed_params({"email": email})
|
||||
|
||||
messages = (
|
||||
_("Thank you for your interest in subscribing to our updates"),
|
||||
_("Please verify your email id"),
|
||||
url,
|
||||
_("Click here to verify")
|
||||
)
|
||||
|
||||
print url
|
||||
|
||||
content = """
|
||||
<p>{0}. {1}.</p>
|
||||
<p><a href="{2}">{3}</a></p>
|
||||
"""
|
||||
|
||||
frappe.sendmail(email, subject=_("Confirm Your Email"), content=content.format(*messages), bulk=True)
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def confirm_subscription(email):
|
||||
if not verify_request():
|
||||
return
|
||||
|
||||
if not frappe.db.exists("Newsletter List", _("Website")):
|
||||
frappe.get_doc({
|
||||
"doctype": "Newsletter List",
|
||||
"title": _("Website")
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
|
||||
frappe.flags.ignore_permissions = True
|
||||
|
||||
add_subscribers(_("Website"), email)
|
||||
frappe.db.commit()
|
||||
|
||||
frappe.respond_as_web_page(_("Confirmed"), _("{0} has been successfully added to our Newsletter list.").format(email))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import validate_email_add, strip
|
||||
from frappe.utils import validate_email_add
|
||||
from frappe import _
|
||||
from email.utils import parseaddr
|
||||
|
||||
@@ -75,7 +75,7 @@ def add_subscribers(name, email_list):
|
||||
"doctype": "Newsletter List Subscriber",
|
||||
"newsletter_list": name,
|
||||
"email": email
|
||||
}).insert()
|
||||
}).insert(ignore_permissions = frappe.flags.ignore_permissions)
|
||||
|
||||
count += 1
|
||||
else:
|
||||
|
||||
@@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
|
||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||
app_icon = "icon-th"
|
||||
app_color = "#e74c3c"
|
||||
app_version = "5.0.9"
|
||||
app_version = "5.0.11"
|
||||
|
||||
error_report_email = "support@erpnext.com"
|
||||
|
||||
@@ -34,13 +34,13 @@ website_context = {
|
||||
|
||||
website_route_rules = [
|
||||
{"from_route": "/orders", "to_route": "Sales Order"},
|
||||
{"from_route": "/orders/<name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
|
||||
{"from_route": "/orders/<path:name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
|
||||
{"from_route": "/invoices", "to_route": "Sales Invoice"},
|
||||
{"from_route": "/invoices/<name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
|
||||
{"from_route": "/invoices/<path:name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
|
||||
{"from_route": "/shipments", "to_route": "Delivery Note"},
|
||||
{"from_route": "/shipments/<name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}},
|
||||
{"from_route": "/shipments/<path:name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}},
|
||||
{"from_route": "/issues", "to_route": "Issue"},
|
||||
{"from_route": "/issues/<name>", "to_route": "print", "defaults": {"doctype": "Issue"}},
|
||||
{"from_route": "/issues/<path:name>", "to_route": "print", "defaults": {"doctype": "Issue"}},
|
||||
{"from_route": "/addresses", "to_route": "Address"},
|
||||
]
|
||||
|
||||
@@ -96,8 +96,8 @@ scheduler_events = {
|
||||
]
|
||||
}
|
||||
|
||||
default_mail_footer = """<div style="padding: 7px; margin-top: 7px;">
|
||||
<a style="color: #8D99A6; font-size: 85%; text-decoration: none;" href="https://erpnext.com" target="_blank">
|
||||
default_mail_footer = """<div style="padding: 15px; text-align: center;">
|
||||
<a href="https://erpnext.com?source=via_email_footer" target="_blank" style="color: #8d99a6;">
|
||||
Sent via ERPNext
|
||||
</a>
|
||||
</div>"""
|
||||
|
||||
@@ -1,27 +1,36 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
// On REFRESH
|
||||
frappe.provide("erpnext.bom");
|
||||
cur_frm.cscript.refresh = function(doc,dt,dn){
|
||||
cur_frm.toggle_enable("item", doc.__islocal);
|
||||
toggle_operations(cur_frm);
|
||||
|
||||
if (!doc.__islocal && doc.docstatus<2) {
|
||||
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost);
|
||||
}
|
||||
}
|
||||
frappe.ui.form.on("BOM", {
|
||||
onload_post_render: function(frm) {
|
||||
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
|
||||
},
|
||||
refresh: function(frm) {
|
||||
frm.toggle_enable("item", frm.doc.__islocal);
|
||||
toggle_operations(frm);
|
||||
|
||||
cur_frm.cscript.update_cost = function() {
|
||||
return frappe.call({
|
||||
doc: cur_frm.doc,
|
||||
method: "update_cost",
|
||||
freeze: true,
|
||||
callback: function(r) {
|
||||
if(!r.exc) cur_frm.refresh_fields();
|
||||
if (!frm.doc.__islocal && frm.doc.docstatus<2) {
|
||||
frm.add_custom_button(__("Update Cost"), function() {
|
||||
frm.events.update_cost(frm);
|
||||
});
|
||||
frm.add_custom_button(__("Browse BOM"), function() {
|
||||
frappe.set_route("bom-browser", frm.doc.name);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
update_cost: function(frm) {
|
||||
return frappe.call({
|
||||
doc: frm.doc,
|
||||
method: "update_cost",
|
||||
freeze: true,
|
||||
callback: function(r) {
|
||||
if(!r.exc) frm.refresh_fields();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
cur_frm.add_fetch("item", "description", "description");
|
||||
cur_frm.add_fetch("item", "image", "image");
|
||||
|
||||
@@ -10,3 +10,5 @@ frappe.listview_settings['BOM'] = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
frappe.help.youtube_id["BOM"] = "hDV0c1OeWLo";
|
||||
|
||||
@@ -176,18 +176,18 @@ class ProductionOrder(Document):
|
||||
self.set('operations', [])
|
||||
|
||||
operations = frappe.db.sql("""select operation, description, workstation, idx,
|
||||
hour_rate, time_in_mins, "Pending" as status from `tabBOM Operation`
|
||||
hour_rate, time_in_mins, "Pending" as status from `tabBOM Operation`
|
||||
where parent = %s order by idx""", self.bom_no, as_dict=1)
|
||||
|
||||
self.set('operations', operations)
|
||||
self.calculate_time()
|
||||
|
||||
|
||||
def calculate_time(self):
|
||||
bom_qty = frappe.db.get_value("BOM", self.bom_no, "quantity")
|
||||
|
||||
|
||||
for d in self.get("operations"):
|
||||
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * flt(self.qty)
|
||||
|
||||
|
||||
self.calculate_operating_cost()
|
||||
|
||||
def get_holidays(self, workstation):
|
||||
@@ -220,7 +220,9 @@ class ProductionOrder(Document):
|
||||
time_log = make_time_log(self.name, d.operation, d.planned_start_time, d.planned_end_time,
|
||||
flt(self.qty) - flt(d.completed_qty), self.project_name, d.workstation, operation_id=d.name)
|
||||
|
||||
self.check_operation_fits_in_working_hours(d)
|
||||
if d.workstation:
|
||||
# validate operating hours if workstation [not mandatory] is specified
|
||||
self.check_operation_fits_in_working_hours(d)
|
||||
|
||||
original_start_time = time_log.from_time
|
||||
while True:
|
||||
|
||||
@@ -359,10 +359,7 @@ class ProductionPlanningTool(Document):
|
||||
|
||||
def insert_purchase_request(self):
|
||||
items_to_be_requested = self.get_requested_items()
|
||||
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
fiscal_year = get_fiscal_year(nowdate())[0]
|
||||
|
||||
|
||||
purchase_request_list = []
|
||||
if items_to_be_requested:
|
||||
for item in items_to_be_requested:
|
||||
@@ -372,7 +369,6 @@ class ProductionPlanningTool(Document):
|
||||
"transaction_date": nowdate(),
|
||||
"status": "Draft",
|
||||
"company": self.company,
|
||||
"fiscal_year": fiscal_year,
|
||||
"requested_by": frappe.session.user,
|
||||
"material_request_type": "Purchase"
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds, get_datetime
|
||||
from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds, to_timedelta
|
||||
from frappe.model.document import Document
|
||||
from dateutil.parser import parse
|
||||
|
||||
@@ -60,7 +60,7 @@ def is_within_operating_hours(workstation, operation, from_datetime, to_datetime
|
||||
workstation = frappe.get_doc("Workstation", workstation)
|
||||
|
||||
for working_hour in workstation.working_hours:
|
||||
slot_length = (get_datetime(working_hour.end_time) - get_datetime(working_hour.start_time)).total_seconds()
|
||||
slot_length = (to_timedelta(working_hour.end_time or "") - to_timedelta(working_hour.start_time or "")).total_seconds()
|
||||
if slot_length >= operation_length:
|
||||
return
|
||||
|
||||
|
||||
0
erpnext/manufacturing/page/__init__.py
Normal file
0
erpnext/manufacturing/page/__init__.py
Normal file
0
erpnext/manufacturing/page/bom_browser/__init__.py
Normal file
0
erpnext/manufacturing/page/bom_browser/__init__.py
Normal file
90
erpnext/manufacturing/page/bom_browser/bom_browser.js
Normal file
90
erpnext/manufacturing/page/bom_browser/bom_browser.js
Normal file
@@ -0,0 +1,90 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.pages['bom-browser'].on_page_load = function(wrapper) {
|
||||
var page = frappe.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: 'BOM Browser',
|
||||
single_column: true
|
||||
});
|
||||
|
||||
page.main.css({
|
||||
"min-height": "300px",
|
||||
"padding-bottom": "25px"
|
||||
});
|
||||
|
||||
page.tree_area = $('<div class="padding"><p class="text-muted">'+
|
||||
__("Select BOM to start")
|
||||
+'</p></div>').appendTo(page.main);
|
||||
|
||||
frappe.breadcrumbs.add(frappe.breadcrumbs.last_module || "Manufacturing");
|
||||
|
||||
var make_tree = function() {
|
||||
erpnext.bom_tree = new erpnext.BOMTree(page.$bom_select.val(), page, page.tree_area);
|
||||
}
|
||||
|
||||
page.$bom_select = wrapper.page.add_field({fieldname: "bom",
|
||||
fieldtype:"Link", options: "BOM", label: __("BOM")}).$input
|
||||
.change(function() {
|
||||
make_tree();
|
||||
});
|
||||
|
||||
page.set_secondary_action(__('Refresh'), function() {
|
||||
make_tree();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
frappe.pages['bom-browser'].on_page_show = function(wrapper){
|
||||
// set from route
|
||||
var bom = null;
|
||||
if(frappe.get_route()[1]) {
|
||||
var bom = frappe.get_route().splice(1).join("/");
|
||||
}
|
||||
if(frappe.route_options && frappe.route_options.bom) {
|
||||
var bom = frappe.route_options.bom;
|
||||
}
|
||||
if(bom) {
|
||||
wrapper.page.$bom_select.val(bom).trigger("change");
|
||||
}
|
||||
};
|
||||
|
||||
erpnext.BOMTree = Class.extend({
|
||||
init: function(root, page, parent) {
|
||||
$(parent).empty();
|
||||
var me = this;
|
||||
me.page = page;
|
||||
me.bom = page.$bom_select.val();
|
||||
me.can_read = frappe.model.can_read("BOM");
|
||||
me.can_create = frappe.boot.user.can_create.indexOf("BOM") !== -1 ||
|
||||
frappe.boot.user.in_create.indexOf("BOM") !== -1;
|
||||
me.can_write = frappe.model.can_write("BOM");
|
||||
me.can_delete = frappe.model.can_delete("BOM");
|
||||
|
||||
this.tree = new frappe.ui.Tree({
|
||||
parent: $(parent),
|
||||
label: me.bom,
|
||||
args: {parent: me.bom},
|
||||
method: 'erpnext.manufacturing.page.bom_browser.bom_browser.get_children',
|
||||
toolbar: [
|
||||
{toggle_btn: true},
|
||||
{
|
||||
label:__("Edit"),
|
||||
condition: function(node) {
|
||||
return node.expandable;
|
||||
},
|
||||
click: function(node) {
|
||||
frappe.set_route("Form", "BOM", node.data.parent);
|
||||
}
|
||||
}
|
||||
],
|
||||
get_label: function(node) {
|
||||
if(node.data.qty) {
|
||||
return node.data.qty + " x " + node.data.value;
|
||||
} else {
|
||||
return node.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
21
erpnext/manufacturing/page/bom_browser/bom_browser.json
Normal file
21
erpnext/manufacturing/page/bom_browser/bom_browser.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"content": null,
|
||||
"creation": "2015-05-25 02:57:33.472044",
|
||||
"docstatus": 0,
|
||||
"doctype": "Page",
|
||||
"modified": "2015-05-25 02:57:33.472044",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Manufacturing",
|
||||
"name": "bom-browser",
|
||||
"owner": "Administrator",
|
||||
"page_name": "bom-browser",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Manufacturing User"
|
||||
}
|
||||
],
|
||||
"script": null,
|
||||
"standard": "Yes",
|
||||
"style": null,
|
||||
"title": "BOM Browser"
|
||||
}
|
||||
15
erpnext/manufacturing/page/bom_browser/bom_browser.py
Normal file
15
erpnext/manufacturing/page/bom_browser/bom_browser.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_children(parent):
|
||||
return frappe.db.sql("""select item_code as value,
|
||||
bom_no as parent, qty,
|
||||
if(ifnull(bom_no, "")!="", 1, 0) as expandable
|
||||
from `tabBOM Item`
|
||||
where parent=%s
|
||||
order by idx
|
||||
""", parent, as_dict=True)
|
||||
@@ -156,4 +156,7 @@ erpnext.patches.v5_0.repost_requested_qty
|
||||
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.rename_pos_setting
|
||||
erpnext.patches.v5_0.update_operation_description
|
||||
erpnext.patches.v5_0.update_operation_description
|
||||
erpnext.patches.v5_0.set_footer_address
|
||||
execute:frappe.db.set_value("Backup Manager", None, "send_backups_to_dropbox", 1 if frappe.db.get_value("Backup Manager", None, "upload_backups_to_dropbox") in ("Daily", "Weekly") else 0)
|
||||
execute:frappe.db.sql_list("delete from `tabDocPerm` where parent='Issue' and modified_by='Administrator' and role='Guest'")
|
||||
|
||||
@@ -19,7 +19,7 @@ def create_receivable_payable_account():
|
||||
receivable_payable_accounts = frappe._dict()
|
||||
|
||||
def _create_account(args):
|
||||
if args["parent_account"]:
|
||||
if args["parent_account"] and frappe.db.exists("Account", args["parent_account"]):
|
||||
account_id = frappe.db.get_value("Account",
|
||||
{"account_name": args["account_name"], "company": args["company"]})
|
||||
if not account_id:
|
||||
|
||||
@@ -46,9 +46,9 @@ def get_all_renamed_fields():
|
||||
)
|
||||
|
||||
for fields in rename_map.values():
|
||||
if fields[0] != "entries":
|
||||
renamed_fields += tuple(fields)
|
||||
|
||||
valid_fields = [d for d in fields if d[0] != "entries"]
|
||||
renamed_fields += tuple(valid_fields)
|
||||
|
||||
return renamed_fields
|
||||
|
||||
def update_script(dt, name, script_field, script, renamed_fields):
|
||||
@@ -62,4 +62,4 @@ def update_script(dt, name, script_field, script, renamed_fields):
|
||||
elif dt in ("Sales Invoice", "Purchase Invoice"):
|
||||
script = re.sub(r"\bentries\b", "items", script)
|
||||
|
||||
frappe.db.set_value(dt, name, script_field, script)
|
||||
frappe.db.set_value(dt, name, script_field, script)
|
||||
8
erpnext/patches/v5_0/set_footer_address.py
Normal file
8
erpnext/patches/v5_0/set_footer_address.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doctype("System Settings")
|
||||
ss = frappe.get_doc("System Settings", "System Settings")
|
||||
ss.email_footer_address = frappe.db.get_default("company")
|
||||
ss.flags.ignore_mandatory = True
|
||||
ss.save()
|
||||
@@ -10,13 +10,15 @@ def execute():
|
||||
for m in frappe.get_all("Project Milestone", "*"):
|
||||
if (m.milestone and m.milestone_date
|
||||
and frappe.db.exists("Project", m.parent)):
|
||||
frappe.get_doc({
|
||||
task = frappe.get_doc({
|
||||
"doctype": "Task",
|
||||
"subject": m.milestone,
|
||||
"expected_start_date": m.milestone_date,
|
||||
"status": "Open" if m.status=="Pending" else "Closed",
|
||||
"project": m.parent,
|
||||
}).insert(ignore_permissions=True)
|
||||
})
|
||||
task.flags.ignore_mandatory = True
|
||||
task.insert(ignore_permissions=True)
|
||||
|
||||
# remove project milestone
|
||||
frappe.delete_doc("DocType", "Project Milestone")
|
||||
|
||||
@@ -48,3 +48,9 @@
|
||||
.product-text {
|
||||
padding: 15px 0px;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.product-search {
|
||||
width: 100%;
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 516 B |
BIN
erpnext/public/images/erpnext-footer.png
Normal file
BIN
erpnext/public/images/erpnext-footer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -1,112 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
viewBox="0 0 680 820"
|
||||
preserveAspectRatio="xMidyMid meet"
|
||||
width="100%"
|
||||
height="100%">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
style="display:inline">
|
||||
<rect
|
||||
style="fill:#fff"
|
||||
id="rect3800"
|
||||
width="150"
|
||||
height="150"
|
||||
x="60.000008"
|
||||
y="-472.36218"
|
||||
rx="20"
|
||||
ry="20"
|
||||
transform="scale(1,-1)" />
|
||||
</g>
|
||||
<g
|
||||
id="layer2">
|
||||
<path
|
||||
transform="scale(1,-1)"
|
||||
style="display:inline;fill:#fff"
|
||||
d="m 180,-372.36218 110,0 20,0 0,20 0,110 c 0,11.08 -8.92,20 -20,20 l -110,0 c -11.08,0 -20,-8.92 -20,-20 l 0,-110 c 0,-11.08 8.92,-20 20,-20 z"
|
||||
id="rect3051"/>
|
||||
</g>
|
||||
<g
|
||||
id="layer3">
|
||||
<rect
|
||||
style="display:inline;fill:#fff"
|
||||
id="rect3840"
|
||||
width="150"
|
||||
height="150"
|
||||
x="260"
|
||||
y="-272.36218"
|
||||
rx="20"
|
||||
ry="20"
|
||||
transform="scale(1,-1)" />
|
||||
</g>
|
||||
<g
|
||||
id="layer4">
|
||||
<path
|
||||
id="path3054"
|
||||
d="m 490,372.36218 -110,0 -20,0 0,-20 0,-110 c 0,-11.08 8.92,-20 20,-20 l 110,0 c 11.08,0 20,8.92 20,20 l 0,110 c 0,11.08 -8.92,20 -20,20 z"
|
||||
style="display:inline;fill:#fff" />
|
||||
</g>
|
||||
<g
|
||||
id="layer5">
|
||||
<rect
|
||||
style="display:inline;fill:#fff"
|
||||
id="rect3844"
|
||||
width="150"
|
||||
height="150"
|
||||
x="460"
|
||||
y="-472.36218"
|
||||
rx="20"
|
||||
ry="20"
|
||||
transform="scale(1,-1)" />
|
||||
</g>
|
||||
<g
|
||||
id="layer6">
|
||||
<path
|
||||
style="display:inline;fill:#fff"
|
||||
d="m 490,422.36218 -110,0 -20,0 0,20 0,110 c 0,11.08 8.92,20 20,20 l 110,0 c 11.08,0 20,-8.92 20,-20 l 0,-110 c 0,-11.08 -8.92,-20 -20,-20 z"
|
||||
id="path3058" />
|
||||
</g>
|
||||
<g
|
||||
id="layer7">
|
||||
<rect
|
||||
style="display:inline;fill:#fff"
|
||||
id="rect3848"
|
||||
width="150"
|
||||
height="150"
|
||||
x="260"
|
||||
y="-672.36218"
|
||||
rx="20"
|
||||
ry="20"
|
||||
transform="scale(1,-1)" />
|
||||
</g>
|
||||
<g
|
||||
id="layer8">
|
||||
<path
|
||||
id="path3056"
|
||||
d="m 180,422.36218 110,0 20,0 0,20 0,110 c 0,11.08 -8.92,20 -20,20 l -110,0 c -11.08,0 -20,-8.92 -20,-20 l 0,-110 c 0,-11.08 8.92,-20 20,-20 z"
|
||||
style="display:inline;fill:#fff" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 429 B |
Binary file not shown.
|
Before Width: | Height: | Size: 691 B |
@@ -98,7 +98,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
},
|
||||
|
||||
hide_currency_and_price_list: function() {
|
||||
if(this.frm.doc.docstatus > 0) {
|
||||
if(this.frm.doc.conversion_rate == 1 && this.frm.doc.docstatus > 0) {
|
||||
hide_field("currency_and_price_list");
|
||||
} else {
|
||||
unhide_field("currency_and_price_list");
|
||||
@@ -209,9 +209,11 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
me.frm.set_value('plc_conversion_rate', 1.0);
|
||||
}
|
||||
if (company_doc.default_letter_head) {
|
||||
me.frm.set_value("letter_head", company_doc.default_letter_head);
|
||||
if(me.frm.fields_dict.letter_head) {
|
||||
me.frm.set_value("letter_head", company_doc.default_letter_head);
|
||||
}
|
||||
}
|
||||
if (company_doc.default_terms) {
|
||||
if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice") {
|
||||
me.frm.set_value("tc_name", company_doc.default_terms);
|
||||
}
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ erpnext.pos.PointOfSale = Class.extend({
|
||||
},
|
||||
set_primary_action: function() {
|
||||
var me = this;
|
||||
if (!this.frm.pos_active) return;
|
||||
if (this.frm.page.current_view_name==="main") return;
|
||||
|
||||
if (this.frm.doctype == "Sales Invoice" && this.frm.doc.docstatus===0) {
|
||||
if (!this.frm.doc.is_pos) {
|
||||
@@ -342,7 +342,6 @@ erpnext.pos.PointOfSale = Class.extend({
|
||||
});
|
||||
} else if (this.frm.doc.docstatus===1) {
|
||||
this.frm.page.set_primary_action(__("New"), function() {
|
||||
me.frm.pos_active = false;
|
||||
erpnext.open_as_pos = true;
|
||||
new_doc(me.frm.doctype);
|
||||
});
|
||||
@@ -464,7 +463,6 @@ erpnext.pos.PointOfSale = Class.extend({
|
||||
var me = this;
|
||||
dialog.set_primary_action(__("Pay"), function() {
|
||||
var values = dialog.get_values();
|
||||
console.log(values);
|
||||
var is_cash = values.mode_of_payment === __("Cash");
|
||||
if (!is_cash) {
|
||||
values.write_off_amount = values.change = 0.0;
|
||||
@@ -498,8 +496,8 @@ erpnext.pos.make_pos_btn = function(frm) {
|
||||
erpnext.pos.toggle(frm) });
|
||||
}
|
||||
|
||||
if(erpnext.open_as_pos && !frm.pos_active) {
|
||||
erpnext.pos.toggle(frm);
|
||||
if(erpnext.open_as_pos && frm.page.current_view_name !== "pos") {
|
||||
erpnext.pos.toggle(frm, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,12 +506,22 @@ erpnext.pos.toggle = function(frm, show) {
|
||||
var price_list = frappe.meta.has_field(cur_frm.doc.doctype, "selling_price_list") ?
|
||||
frm.doc.selling_price_list : frm.doc.buying_price_list;
|
||||
|
||||
if((show===true && frm.pos_active) || (show===false && !frm.pos_active)) {
|
||||
return;
|
||||
if(show!==undefined) {
|
||||
if((show===true && frm.page.current_view_name === "pos")
|
||||
|| (show===false && frm.page.current_view_name === "main")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(show && !price_list) {
|
||||
frappe.throw(__("Please select Price List"));
|
||||
if(frm.page.current_view_name!=="pos") {
|
||||
// before switching, ask for pos name
|
||||
if(!price_list) {
|
||||
frappe.throw(__("Please select Price List"));
|
||||
}
|
||||
|
||||
if(!frm.doc.company) {
|
||||
frappe.throw(__("Please select Company"));
|
||||
}
|
||||
}
|
||||
|
||||
// make pos
|
||||
@@ -523,14 +531,13 @@ erpnext.pos.toggle = function(frm, show) {
|
||||
}
|
||||
|
||||
// toggle view
|
||||
frm.page.set_view(frm.pos_active ? "main" : "pos");
|
||||
frm.pos_active = !frm.pos_active;
|
||||
frm.page.set_view(frm.page.current_view_name==="pos" ? "main" : "pos");
|
||||
|
||||
frm.toolbar.current_status = null;
|
||||
frm.refresh();
|
||||
|
||||
// refresh
|
||||
if(frm.pos_active) {
|
||||
if(frm.page.current_view_name==="pos") {
|
||||
frm.pos.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
</div>
|
||||
{% if(actual_qty != null) { %}
|
||||
<div style="margin-top: 5px;" class="text-muted small text-right">
|
||||
<span title="{%= __("In Stock") %}">{%= actual_qty %}<span>
|
||||
<span title="{%= __("Projected") %}">({%= projected_qty %})<span>
|
||||
<span title="{%= __("In Stock") %}">{%= actual_qty || 0 %}<span>
|
||||
<span title="{%= __("Projected") %}">({%= projected_qty || 0 %})<span>
|
||||
</div>
|
||||
{% } %}
|
||||
</div>
|
||||
|
||||
@@ -14,19 +14,21 @@ $.extend(erpnext, {
|
||||
},
|
||||
|
||||
get_fiscal_year: function(company, date, fn) {
|
||||
frappe.call({
|
||||
type:"GET",
|
||||
method: "erpnext.accounts.utils.get_fiscal_year",
|
||||
args: {
|
||||
"company": company,
|
||||
"date": date,
|
||||
"verbose": 0
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
|
||||
if (fn) fn();
|
||||
}
|
||||
});
|
||||
if(frappe.meta.get_docfield(cur_frm.doctype, "fiscal_year")) {
|
||||
frappe.call({
|
||||
type:"GET",
|
||||
method: "erpnext.accounts.utils.get_fiscal_year",
|
||||
args: {
|
||||
"company": company,
|
||||
"date": date,
|
||||
"verbose": 0
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
|
||||
if (fn) fn();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
toggle_naming_series: function() {
|
||||
@@ -130,4 +132,17 @@ $.extend(erpnext.utils, {
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// add description on posting time
|
||||
$(document).on('app_ready', function() {
|
||||
if(!frappe.datetime.is_timezone_same()) {
|
||||
$.each(["Stock Reconciliation", "Stock Entry", "Stock Ledger Entry",
|
||||
"Delivery Note", "Purchase Receipt", "Sales Invoice"], function(i, d) {
|
||||
frappe.ui.form.on(d, "onload", function(frm) {
|
||||
cur_frm.set_df_property("posting_time", "description",
|
||||
sys_defaults.time_zone);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,5 +15,15 @@ frappe.send_message = function(opts, btn) {
|
||||
});
|
||||
};
|
||||
|
||||
erpnext.subscribe_to_newsletter = function(opts, btn) {
|
||||
return frappe.call({
|
||||
type: "POST",
|
||||
method: "erpnext.crm.doctype.newsletter.newsletter.subscribe",
|
||||
btn: btn,
|
||||
args: {"email": opts.email},
|
||||
callback: opts.callback
|
||||
});
|
||||
}
|
||||
|
||||
// for backward compatibility
|
||||
erpnext.send_message = frappe.send_message;
|
||||
erpnext.send_message = frappe.send_message;
|
||||
|
||||
@@ -51,3 +51,10 @@
|
||||
.product-text {
|
||||
padding: 15px 0px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.product-search {
|
||||
width: 100%;
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -121,10 +121,11 @@
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount (%)",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"oldfieldname": "adj_rate",
|
||||
"oldfieldtype": "Float",
|
||||
"permlevel": 0,
|
||||
@@ -389,7 +390,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-05-14 14:51:21.557189",
|
||||
"modified": "2015-05-27 02:47:15.474119",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Quotation Item",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -127,10 +127,11 @@
|
||||
"width": "70px"
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount(%)",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"oldfieldname": "adj_rate",
|
||||
"oldfieldtype": "Float",
|
||||
"permlevel": 0,
|
||||
@@ -310,7 +311,7 @@
|
||||
"fieldname": "warehouse",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Reserved Warehouse",
|
||||
"label": "Delivery Warehouse",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "reserved_warehouse",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -497,7 +498,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-05-14 14:51:46.978580",
|
||||
"modified": "2015-05-27 02:47:15.134435",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order Item",
|
||||
|
||||
@@ -72,7 +72,7 @@ def get_target_distribution_details(filters):
|
||||
target_details = {}
|
||||
|
||||
for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
|
||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` mdp
|
||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
|
||||
where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
|
||||
|
||||
|
||||
@@ -50,10 +50,14 @@ def get_conditions(filters, date_field):
|
||||
conditions = [""]
|
||||
values = []
|
||||
|
||||
for field in ["company", "customer", "territory", "sales_person"]:
|
||||
for field in ["company", "customer", "territory"]:
|
||||
if filters.get(field):
|
||||
conditions.append("dt.{0}=%s".format(field))
|
||||
values.append(filters[field])
|
||||
|
||||
if filters.get("sales_person"):
|
||||
conditions.append("st.sales_person=%s")
|
||||
values.append(filters["sales_person"])
|
||||
|
||||
if filters.get("from_date"):
|
||||
conditions.append("dt.{0}>=%s".format(date_field))
|
||||
|
||||
@@ -125,6 +125,11 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
},
|
||||
|
||||
barcode: function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.barcode=="" || d.barcode==null) {
|
||||
// barcode cleared, remove item
|
||||
d.item_code = "";
|
||||
}
|
||||
this.item_code(doc, cdt, cdn);
|
||||
},
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ def dropbox_callback(oauth_token=None, not_approved=False):
|
||||
frappe.db.set_value("Backup Manager", "Backup Manager", "dropbox_access_key", access_token.key)
|
||||
frappe.db.set_value("Backup Manager", "Backup Manager", "dropbox_access_secret", access_token.secret)
|
||||
frappe.db.set_value("Backup Manager", "Backup Manager", "dropbox_access_allowed", allowed)
|
||||
frappe.db.set_value("Backup Manager", "Backup Manager", "send_backups_to_dropbox", 1)
|
||||
dropbox_client = client.DropboxClient(sess)
|
||||
try:
|
||||
dropbox_client.file_create_folder("files")
|
||||
|
||||
30
erpnext/setup/doctype/backup_manager/backup_files_list.html
Normal file
30
erpnext/setup/doctype/backup_manager/backup_files_list.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<table class="table table-striped" style="max-width: 600px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%;">
|
||||
{{ __("Date") }}
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
{{ __("File") }}
|
||||
</th>
|
||||
<th>
|
||||
{{ __("Size") }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for (var i=0; i < files.length; i++) { %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ files[i][1] }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ files[i][0] }}" target="_blank">{{ files[i][0] }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ files[i][2] }}
|
||||
</td>
|
||||
</tr>
|
||||
{% } %}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -2,35 +2,16 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
$.extend(cur_frm.cscript, {
|
||||
onload_post_render: function() {
|
||||
cur_frm.fields_dict.allow_dropbox_access.$input.addClass("btn-primary");
|
||||
|
||||
if(cur_frm.doc.__onload && cur_frm.doc.__onload.files) {
|
||||
$(frappe.render_template("backup_files_list", {files:cur_frm.doc.__onload.files}))
|
||||
.appendTo(cur_frm.fields_dict.current_backups.$wrapper.empty());
|
||||
}
|
||||
},
|
||||
refresh: function() {
|
||||
cur_frm.disable_save();
|
||||
|
||||
if(!(cint(cur_frm.doc.dropbox_access_allowed) ||
|
||||
cint(cur_frm.doc.gdrive_access_allowed))) {
|
||||
cur_frm.set_intro(__("You can start by selecting backup frequency and granting access for sync"));
|
||||
} else {
|
||||
var services = {
|
||||
"dropbox": __("Dropbox")
|
||||
// "gdrive": __("Google Drive")
|
||||
}
|
||||
var active_services = [];
|
||||
|
||||
$.each(services, function(service, label) {
|
||||
var access_allowed = cint(cur_frm.doc[service + "_access_allowed"]);
|
||||
var frequency = cur_frm.doc["upload_backups_to_" + service];
|
||||
if(access_allowed && frequency && frequency !== "Never") {
|
||||
active_services.push(label + " [" + frequency + "]");
|
||||
}
|
||||
});
|
||||
|
||||
if(active_services.length > 0) {
|
||||
cur_frm.set_intro(__("Backups will be uploaded to") + ": " +
|
||||
frappe.utils.comma_and(active_services));
|
||||
} else {
|
||||
cur_frm.set_intro("");
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
validate_send_notifications_to: function() {
|
||||
|
||||
@@ -8,16 +8,22 @@
|
||||
{
|
||||
"fieldname": "setup",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Setup",
|
||||
"label": "Download Backups",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Email ids separated by commas.",
|
||||
"fieldname": "send_notifications_to",
|
||||
"fieldtype": "Data",
|
||||
"label": "Send Notifications To",
|
||||
"fieldname": "current_backups",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Current Backups",
|
||||
"permlevel": 0,
|
||||
"reqd": 1
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"fieldname": "sync_with_dropbox",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Sync with Dropbox",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "backup_right_now",
|
||||
@@ -28,19 +34,30 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.",
|
||||
"fieldname": "sync_with_dropbox",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Sync with Dropbox",
|
||||
"permlevel": 0
|
||||
"fieldname": "send_backups_to_dropbox",
|
||||
"fieldtype": "Check",
|
||||
"label": "Send Backups to Dropbox",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"depends_on": "send_backups_to_dropbox",
|
||||
"description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.",
|
||||
"fieldname": "upload_backups_to_dropbox",
|
||||
"fieldtype": "Select",
|
||||
"label": "Upload Backups to Dropbox",
|
||||
"options": "Never\nWeekly\nDaily",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "send_backups_to_dropbox",
|
||||
"description": "Email ids separated by commas.",
|
||||
"fieldname": "send_notifications_to",
|
||||
"fieldtype": "Data",
|
||||
"label": "Send Notifications To",
|
||||
"permlevel": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "dropbox_access_key",
|
||||
"fieldtype": "Data",
|
||||
@@ -66,6 +83,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "send_backups_to_dropbox",
|
||||
"fieldname": "allow_dropbox_access",
|
||||
"fieldtype": "Button",
|
||||
"label": "Allow Dropbox Access",
|
||||
@@ -140,7 +158,7 @@
|
||||
"icon": "icon-cloud-upload",
|
||||
"idx": 1,
|
||||
"issingle": 1,
|
||||
"modified": "2015-02-05 05:11:34.700674",
|
||||
"modified": "2015-05-26 04:54:10.193573",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Backup Manager",
|
||||
|
||||
@@ -4,13 +4,36 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe.utils import get_site_path
|
||||
from frappe.utils.data import convert_utc_to_user_timezone
|
||||
import os
|
||||
import datetime
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
class BackupManager(Document):
|
||||
pass
|
||||
def onload(self):
|
||||
self.set_onload("files", get_files())
|
||||
|
||||
def get_files():
|
||||
def get_time(path):
|
||||
dt = os.path.getmtime(path)
|
||||
return convert_utc_to_user_timezone(datetime.datetime.utcfromtimestamp(dt)).strftime('%Y-%m-%d %H:%M')
|
||||
|
||||
def get_size(path):
|
||||
size = os.path.getsize(path)
|
||||
if size > 1048576:
|
||||
return "{0:.1f}M".format(float(size) / 1048576)
|
||||
else:
|
||||
return "{0:.1f}K".format(float(size) / 1024)
|
||||
|
||||
path = get_site_path('private', 'backups')
|
||||
files = [x for x in os.listdir(path) if os.path.isfile(os.path.join(path, x))]
|
||||
files = [('/backups/' + _file,
|
||||
get_time(os.path.join(path, _file)),
|
||||
get_size(os.path.join(path, _file))) for _file in files]
|
||||
return files
|
||||
|
||||
def take_backups_daily():
|
||||
take_backups_if("Daily")
|
||||
@@ -19,11 +42,12 @@ def take_backups_weekly():
|
||||
take_backups_if("Weekly")
|
||||
|
||||
def take_backups_if(freq):
|
||||
if frappe.db.get_value("Backup Manager", None, "upload_backups_to_dropbox")==freq:
|
||||
take_backups_dropbox()
|
||||
if frappe.db.get_value("Backup Manager", None, "send_backups_to_dropbox"):
|
||||
if frappe.db.get_value("Backup Manager", None, "upload_backups_to_dropbox")==freq:
|
||||
take_backups_dropbox()
|
||||
|
||||
# if frappe.db.get_value("Backup Manager", None, "upload_backups_to_gdrive")==freq:
|
||||
# take_backups_gdrive()
|
||||
# if frappe.db.get_value("Backup Manager", None, "upload_backups_to_gdrive")==freq:
|
||||
# take_backups_gdrive()
|
||||
|
||||
@frappe.whitelist()
|
||||
def take_backups_dropbox():
|
||||
|
||||
@@ -11,31 +11,37 @@ frappe.ui.form.on("Company", {
|
||||
erpnext.company.set_chart_of_accounts_options(frm.doc);
|
||||
},
|
||||
delete_company_transactions: function(frm) {
|
||||
var d = frappe.prompt({
|
||||
fieldtype:"Data",
|
||||
fieldname: "company_name",
|
||||
label: __("Please re-type company name to confirm"),
|
||||
reqd: 1,
|
||||
description: __("Please make sure you really want to delete all the transactions for this company. Your master data will remain as it is. This action cannot be undone.")},
|
||||
function(data) {
|
||||
if(data.company_name !== frm.doc.name) {
|
||||
frappe.msgprint("Company name not same");
|
||||
return;
|
||||
}
|
||||
frappe.call({
|
||||
method: "erpnext.setup.doctype.company.delete_company_transactions.delete_company_transactions",
|
||||
args: {
|
||||
company_name: data.company_name
|
||||
},
|
||||
freeze: true,
|
||||
callback: function(r, rt) {
|
||||
if(!r.exc)
|
||||
frappe.msgprint(__("Successfully deleted all transactions related to this company!"));
|
||||
frappe.verify_password(function() {
|
||||
var d = frappe.prompt({
|
||||
fieldtype:"Data",
|
||||
fieldname: "company_name",
|
||||
label: __("Please re-type company name to confirm"),
|
||||
reqd: 1,
|
||||
description: __("Please make sure you really want to delete all the transactions for this company. Your master data will remain as it is. This action cannot be undone.")},
|
||||
function(data) {
|
||||
if(data.company_name !== frm.doc.name) {
|
||||
frappe.msgprint("Company name not same");
|
||||
return;
|
||||
}
|
||||
});
|
||||
}, __("Delete all the Transactions for this Company"), __("Delete"));
|
||||
|
||||
d.get_primary_btn().addClass("btn-danger");
|
||||
frappe.call({
|
||||
method: "erpnext.setup.doctype.company.delete_company_transactions.delete_company_transactions",
|
||||
args: {
|
||||
company_name: data.company_name
|
||||
},
|
||||
freeze: true,
|
||||
callback: function(r, rt) {
|
||||
if(!r.exc)
|
||||
frappe.msgprint(__("Successfully deleted all transactions related to this company!"));
|
||||
},
|
||||
onerror: function() {
|
||||
frappe.msgprint(__("Wrong Password"));
|
||||
}
|
||||
});
|
||||
}, __("Delete all the Transactions for this Company"), __("Delete")
|
||||
);
|
||||
d.get_primary_btn().addClass("btn-danger");
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ def set_defaults(args):
|
||||
"language": args.get("language"),
|
||||
"time_zone": args.get("timezone"),
|
||||
"float_precision": 3,
|
||||
"email_footer_address": args.get("company"),
|
||||
'date_format': frappe.db.get_value("Country", args.get("country"), "date_format"),
|
||||
'number_format': number_format,
|
||||
'enable_scheduler': 1 if not frappe.flags.in_test else 0
|
||||
|
||||
@@ -130,6 +130,9 @@ class ShoppingCartSettings(Document):
|
||||
|
||||
def get_price_list(self, billing_territory):
|
||||
price_list = self.get_name_from_territory(billing_territory, "price_lists", "selling_price_list")
|
||||
if not (price_list and price_list[0]):
|
||||
price_list = self.get_name_from_territory(self.default_territory, "price_lists", "selling_price_list")
|
||||
|
||||
return price_list and price_list[0] or None
|
||||
|
||||
def get_tax_master(self, billing_territory):
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -134,10 +134,11 @@
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount (%)",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"oldfieldname": "adj_rate",
|
||||
"oldfieldtype": "Float",
|
||||
"permlevel": 0,
|
||||
@@ -522,7 +523,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-05-14 14:52:20.610748",
|
||||
"modified": "2015-05-27 02:47:16.946934",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note Item",
|
||||
|
||||
@@ -575,6 +575,7 @@
|
||||
"description": "Publish Item to hub.erpnext.com",
|
||||
"fieldname": "publish_in_hub",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"label": "Publish in Hub",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
@@ -878,7 +879,7 @@
|
||||
"icon": "icon-tag",
|
||||
"idx": 1,
|
||||
"max_attachments": 1,
|
||||
"modified": "2015-05-04 18:44:46.090445",
|
||||
"modified": "2015-05-22 02:16:57.435105",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Item",
|
||||
|
||||
@@ -14,3 +14,5 @@ frappe.listview_settings['Item'] = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
frappe.help.youtube_id["Item"] = "qXaEwld4_Ps";
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
$.extend(cur_frm.cscript, {
|
||||
onload: function () {
|
||||
frappe.ui.form.on("Item Price", {
|
||||
onload: function (frm) {
|
||||
// Fetch price list details
|
||||
cur_frm.add_fetch("price_list", "buying", "buying");
|
||||
cur_frm.add_fetch("price_list", "selling", "selling");
|
||||
cur_frm.add_fetch("price_list", "currency", "currency");
|
||||
frm.add_fetch("price_list", "buying", "buying");
|
||||
frm.add_fetch("price_list", "selling", "selling");
|
||||
frm.add_fetch("price_list", "currency", "currency");
|
||||
|
||||
// Fetch item details
|
||||
cur_frm.add_fetch("item_code", "item_name", "item_name");
|
||||
cur_frm.add_fetch("item_code", "description", "item_description");
|
||||
frm.add_fetch("item_code", "item_name", "item_name");
|
||||
frm.add_fetch("item_code", "description", "item_description");
|
||||
|
||||
frm.set_df_property("bulk_import_help", "options",
|
||||
'<a href="#data-import-tool/Item Price">' + __("Import in Bulk") + '</a>');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -100,13 +100,26 @@
|
||||
"label": "Item Description",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_12",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"fieldname": "bulk_import_help",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Bulk Import Help",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
}
|
||||
],
|
||||
"icon": "icon-flag",
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-03-03 01:05:09.876025",
|
||||
"modified": "2015-05-26 03:15:02.324161",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Item Price",
|
||||
|
||||
@@ -131,21 +131,6 @@
|
||||
"search_index": 1,
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"fieldname": "fiscal_year",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Fiscal Year",
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Fiscal Year",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_width": "150px",
|
||||
"reqd": 1,
|
||||
"search_index": 1,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break2",
|
||||
"fieldtype": "Column Break",
|
||||
@@ -236,7 +221,7 @@
|
||||
"icon": "icon-ticket",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-02-20 05:07:33.215371",
|
||||
"modified": "2015-05-27 15:36:06.818491",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Material Request",
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
"default": "Grand Total",
|
||||
"fieldname": "apply_discount_on",
|
||||
"fieldtype": "Select",
|
||||
"label": "Apply Discount On",
|
||||
"label": "Apply Additional Discount On",
|
||||
"options": "\nGrand Total\nNet Total",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -433,7 +433,7 @@
|
||||
{
|
||||
"fieldname": "discount_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Discount Amount",
|
||||
"label": "Additional Discount Amount",
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -854,7 +854,7 @@
|
||||
"icon": "icon-truck",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-05-18 05:06:04.723299",
|
||||
"modified": "2015-05-27 02:48:00.763945",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt",
|
||||
|
||||
@@ -191,10 +191,11 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_rate",
|
||||
"fieldname": "discount_percentage",
|
||||
"fieldtype": "Percent",
|
||||
"in_list_view": 1,
|
||||
"label": "Discount %",
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 0
|
||||
@@ -641,7 +642,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-05-14 14:54:02.462587",
|
||||
"modified": "2015-05-27 02:47:16.086625",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt Item",
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
|
||||
import frappe
|
||||
from frappe.utils import flt, cstr, nowdate, add_days, cint
|
||||
from erpnext.accounts.utils import get_fiscal_year, FiscalYearError
|
||||
|
||||
def reorder_item():
|
||||
""" Reorder item if stock reaches reorder level"""
|
||||
# if initial setup not completed, return
|
||||
if not frappe.db.sql("select name from `tabFiscal Year` limit 1"):
|
||||
if not (frappe.db.a_row_exists("Company") and frappe.db.a_row_exists("Fiscal Year")):
|
||||
return
|
||||
|
||||
if cint(frappe.db.get_value('Stock Settings', None, 'auto_indent')):
|
||||
@@ -83,7 +82,6 @@ def get_item_warehouse_projected_qty():
|
||||
def create_material_request(material_requests):
|
||||
""" Create indent on reaching reorder level """
|
||||
mr_list = []
|
||||
defaults = frappe.defaults.get_defaults()
|
||||
exceptions_list = []
|
||||
|
||||
def _log_exception():
|
||||
@@ -93,14 +91,6 @@ def create_material_request(material_requests):
|
||||
else:
|
||||
exceptions_list.append(frappe.get_traceback())
|
||||
|
||||
try:
|
||||
current_fiscal_year = get_fiscal_year(nowdate())[0] or defaults.fiscal_year
|
||||
|
||||
except FiscalYearError:
|
||||
_log_exception()
|
||||
notify_errors(exceptions_list)
|
||||
return
|
||||
|
||||
for request_type in material_requests:
|
||||
for company in material_requests[request_type]:
|
||||
try:
|
||||
@@ -111,7 +101,6 @@ def create_material_request(material_requests):
|
||||
mr = frappe.new_doc("Material Request")
|
||||
mr.update({
|
||||
"company": company,
|
||||
"fiscal_year": current_fiscal_year,
|
||||
"transaction_date": nowdate(),
|
||||
"material_request_type": request_type
|
||||
})
|
||||
@@ -170,7 +159,7 @@ def send_email_notification(mr_list):
|
||||
msg += "<tr><td>" + item.item_code + "</td><td>" + item.warehouse + "</td><td>" + \
|
||||
cstr(item.qty) + "</td><td>" + cstr(item.uom) + "</td></tr>"
|
||||
msg += "</table>"
|
||||
frappe.sendmail(recipients=email_list,
|
||||
frappe.sendmail(recipients=email_list,
|
||||
subject='Auto Material Request Generation Notification', message = msg)
|
||||
|
||||
def notify_errors(exceptions_list):
|
||||
|
||||
@@ -233,26 +233,12 @@
|
||||
],
|
||||
"icon": "icon-ticket",
|
||||
"idx": 1,
|
||||
"modified": "2015-05-20 07:16:53.673114",
|
||||
"modified": "2015-05-28 03:21:04.690112",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Support",
|
||||
"name": "Issue",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"delete": 0,
|
||||
"email": 1,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Guest",
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 1,
|
||||
|
||||
42
erpnext/templates/includes/footer/footer_extension.html
Normal file
42
erpnext/templates/includes/footer/footer_extension.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{% if not hide_footer_signup %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3 text-center" style="margin-top: 15px;">
|
||||
<input class="form-control" type="text" id="footer-subscribe-email"
|
||||
style="display: inline-block; max-width: 50%; margin-right: 10px;"
|
||||
placeholder="{{ _('Your email address') }}...">
|
||||
<button class="btn btn-default btn-sm" type="button"
|
||||
id="footer-subscribe-button">{{ _("Get Updates") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center text-muted small" style="padding: 30px;">
|
||||
<a href="https://erpnext.com?source=website_footer" target="_blank" class="text-extra-muted">
|
||||
Powered by ERPNext</a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$("#footer-subscribe-button").click(function() {
|
||||
|
||||
if($("#footer-subscribe-email").val()) {
|
||||
$("#footer-subscribe-email").attr('disabled', true);
|
||||
$("#footer-subscribe-button").html("Sending...")
|
||||
.attr("disabled", true);
|
||||
erpnext.subscribe_to_newsletter({
|
||||
email: $("#footer-subscribe-email").val(),
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
$("#footer-subscribe-button").html(__("Added"))
|
||||
.attr("disabled", true);
|
||||
} else {
|
||||
$("#footer-subscribe-button").html(__("Error: Not a valid id?"))
|
||||
.addClass("btn-danger").attr("disabled", false);
|
||||
$("#footer-subscribe-email").val("").attr('disabled', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
frappe.msgprint(frappe._("Please enter email address"))
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
1
erpnext/templates/includes/footer/footer_powered.html
Normal file
1
erpnext/templates/includes/footer/footer_powered.html
Normal file
@@ -0,0 +1 @@
|
||||
<!-- blank -->
|
||||
@@ -1,41 +0,0 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3" style="margin-top: 7px;">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" id="footer-subscribe-email"
|
||||
placeholder="{{ _('Your email address') }}...">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button"
|
||||
id="footer-subscribe-button">{{ _("Stay Updated") }}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$("#footer-subscribe-button").click(function() {
|
||||
|
||||
if($("#footer-subscribe-email").val()) {
|
||||
$("#footer-subscribe-email").attr('disabled', true);
|
||||
$("#footer-subscribe-button").html("Sending...")
|
||||
.attr("disabled", true);
|
||||
erpnext.send_message({
|
||||
subject:"Subscribe me",
|
||||
sender: $("#footer-subscribe-email").val(),
|
||||
message: "Subscribe to newsletter (via website footer).",
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
$("#footer-subscribe-button").html("Thank You :)")
|
||||
.addClass("btn-success").attr("disabled", true);
|
||||
} else {
|
||||
$("#footer-subscribe-button").html("Error :( Not a valid id?")
|
||||
.addClass("btn-danger").attr("disabled", false);
|
||||
$("#footer-subscribe-email").val("").attr('disabled', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
frappe.msgprint(frappe._("Please enter email address"))
|
||||
});
|
||||
</script>
|
||||
@@ -1 +0,0 @@
|
||||
<a href="http://erpnext.com" style="color: #aaa; font-size: 11px;">ERPNext Powered</a>
|
||||
@@ -2,7 +2,7 @@
|
||||
frappe.ready(function() {
|
||||
$(".product-search").remove();
|
||||
|
||||
$('<div class="product-search">\
|
||||
$('<div class="product-search pull-right">\
|
||||
<form class="form-inline form-search">\
|
||||
<div class="input-group">\
|
||||
<input class="form-control" type="text" id="product-search" placeholder="Product Search...">\
|
||||
@@ -12,13 +12,13 @@ frappe.ready(function() {
|
||||
</span>\
|
||||
</div>\
|
||||
</form>\
|
||||
</div>').appendTo(".page-header-right");
|
||||
</div>').prependTo(".page-header-block");
|
||||
|
||||
$('.dropdown-toggle').dropdown();
|
||||
$("#btn-product-search").click(function() {
|
||||
var txt = $("#product-search").val();
|
||||
if(txt) {
|
||||
window.location.href="product_search?q=" + txt;
|
||||
window.location.href="/product_search?q=" + txt;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
</div>
|
||||
{%- endif %}
|
||||
<div>
|
||||
{% if doc.in_format_data("item_code") -%}
|
||||
{% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%}
|
||||
<div class="primary">{{ doc.item_code }}</div>
|
||||
{%- endif %}
|
||||
{% if (doc.in_format_data("item_name") and
|
||||
(not doc.in_format_data("item_code") or doc.item_code != doc.item_name)) -%}
|
||||
(not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
|
||||
or doc.item_code != doc.item_name)) -%}
|
||||
<div class="primary">{{ doc.get_formatted("item_name") }}</div>
|
||||
{%- endif %}
|
||||
{% if (doc.in_format_data("description") and doc.description and
|
||||
|
||||
Reference in New Issue
Block a user