Merge branch 'develop'

This commit is contained in:
Pratik Vyas 2015-05-28 14:14:58 +05:30
commit 618fefea73
63 changed files with 5428 additions and 5092 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '5.0.10'
__version__ = '5.0.11'

View File

@ -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

View File

@ -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",

View File

@ -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"]);
}
}
});
}

View File

@ -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",

View File

@ -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",

View File

@ -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);
}
},

View File

@ -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")] || "&nbsp;" %}</b></td>
<td><b>{%= frappe.format(data[i][__("Account")], {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
<td style="text-align: right">
{%= data[i][__("Account")] && format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">

View File

@ -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)

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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",

View File

@ -1 +0,0 @@
- POS Setting is renamed to POS Profile

View 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

View File

@ -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"
}
]
}
]

View File

@ -156,4 +156,14 @@ def get_data():
}
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"label": _("Customer and Supplier"),
"youtube_id": "anoGi_RpQ20"
},
]
},
]

View File

@ -128,4 +128,14 @@ def get_data():
},
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"label": _("Lead to Quotation"),
"youtube_id": "TxYX4r4JAKA"
},
]
},
]

View File

@ -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
View 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"
},
]
}
]

View File

@ -105,4 +105,15 @@ def get_data():
},
]
},
{
"label": _("Help"),
"icon": "icon-facetime-video",
"items": [
{
"type": "help",
"label": _("Bill of Materials"),
"youtube_id": "hDV0c1OeWLo"
},
]
}
]

View File

@ -275,4 +275,14 @@ def get_data():
},
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"label": _("Customer and Supplier"),
"youtube_id": "anoGi_RpQ20"
},
]
},
]

View File

@ -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",

View File

@ -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"
},
]
}
]

View File

@ -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)

View File

@ -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.10"
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"},
]

View File

@ -10,3 +10,5 @@ frappe.listview_settings['BOM'] = {
}
}
};
frappe.help.youtube_id["BOM"] = "hDV0c1OeWLo";

View File

@ -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:

View File

@ -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"
})

View File

@ -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

View File

@ -158,3 +158,5 @@ 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.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'")

View File

@ -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:

View File

@ -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)

View File

@ -4,4 +4,5 @@ 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()

View File

@ -48,3 +48,9 @@
.product-text {
padding: 15px 0px;
}
@media (max-width: 767px) {
.product-search {
width: 100%;
margin-bottom: 13px;
}
}

View File

@ -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);
}

View File

@ -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();
}
}

View File

@ -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>

View File

@ -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);
});
});
}
});

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -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))

View File

@ -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);
},

View File

@ -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")

View 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>

View File

@ -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() {

View File

@ -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",

View File

@ -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():

View File

@ -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

View File

@ -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",

View File

@ -14,3 +14,5 @@ frappe.listview_settings['Item'] = {
}
}
};
frappe.help.youtube_id["Item"] = "qXaEwld4_Ps";

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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):

View File

@ -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,

View File

@ -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;
});

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages
version = "5.0.10"
version = "5.0.11"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()