Merge branch 'master' into customer-login

This commit is contained in:
Anand Doshi 2013-09-03 16:42:21 +05:30
commit 0e23929740
134 changed files with 281 additions and 137 deletions

View File

@ -70,5 +70,5 @@ cur_frm.fields_dict["expense_account"].get_query = function(doc) {
}
cur_frm.fields_dict.user.get_query = function(doc,cdt,cdn) {
return{ query:"controllers.queries.profile_query"}
return{ query:"core.doctype.profile.profile.profile_query"}
}

View File

@ -80,7 +80,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
source_doctype: "Delivery Note",
get_query: function() {
var filters = {
docstatus: 1,
company: cur_frm.doc.company
};
if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer;

View File

@ -333,10 +333,10 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
// other charges added/deducted
if(tax_count) {
this.frm.doc.other_charges_added = wn.utils.sum($.map(this.frm.tax_doclist,
function(tax) { return tax.add_deduct_tax == "Add" ? tax.tax_amount : 0.0; }));
function(tax) { return (tax.add_deduct_tax == "Add" && in_list(["Valuation and Total", "Total"], tax.category)) ? tax.tax_amount : 0.0; }));
this.frm.doc.other_charges_deducted = wn.utils.sum($.map(this.frm.tax_doclist,
function(tax) { return tax.add_deduct_tax == "Deduct" ? tax.tax_amount : 0.0; }));
function(tax) { return (tax.add_deduct_tax == "Deduct" && in_list(["Valuation and Total", "Total"], tax.category)) ? tax.tax_amount : 0.0; }));
wn.model.round_floats_in(this.frm.doc, ["other_charges_added", "other_charges_deducted"]);

View File

@ -18,9 +18,6 @@ class DocType(TransactionBase):
self.doc = doc
self.doclist = doclist
def onload(self):
self.add_communication_list()
def autoname(self):
supp_master_name = webnotes.defaults.get_global_default('supp_master_name')

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:11",
"docstatus": 0,
"modified": "2013-08-08 14:22:08",
"modified": "2013-09-02 16:25:44",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -204,6 +204,14 @@
"oldfieldname": "website",
"oldfieldtype": "Data"
},
{
"doctype": "DocField",
"fieldname": "communications",
"fieldtype": "Table",
"hidden": 1,
"label": "Communications",
"options": "Communication"
},
{
"cancel": 0,
"create": 0,

View File

@ -3,6 +3,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.widgets.reportview import get_match_cond
def get_filters_cond(doctype, filters, conditions):
if filters:
@ -22,34 +23,6 @@ def get_filters_cond(doctype, filters, conditions):
cond = ''
return cond
def get_match_cond(doctype, searchfield = 'name'):
from webnotes.widgets.reportview import build_match_conditions
cond = build_match_conditions(doctype)
if cond:
cond = ' and ' + cond
else:
cond = ''
return cond
# searches for enabled profiles
def profile_query(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
from `tabProfile`
where ifnull(enabled, 0)=1
and docstatus < 2
and name not in ('Administrator', 'Guest')
and (%(key)s like "%(txt)s"
or concat_ws(' ', first_name, middle_name, last_name) like "%(txt)s")
%(mcond)s
order by
case when name like "%(txt)s" then 0 else 1 end,
case when concat_ws(' ', first_name, middle_name, last_name) like "%(txt)s"
then 0 else 1 end,
name asc
limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt,
'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
# searches for active employees
def employee_query(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select name, employee_name from `tabEmployee`
@ -196,10 +169,12 @@ def get_price_list_currency(doctype, txt, searchfield, start, page_len, filters)
def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name
from `tabDelivery Note`
where `tabDelivery Note`.`%(key)s` like %(txt)s %(fcond)s and
where `tabDelivery Note`.`%(key)s` like %(txt)s and
`tabDelivery Note`.docstatus = 1 %(fcond)s and
(ifnull((select sum(qty) from `tabDelivery Note Item` where
`tabDelivery Note Item`.parent=`tabDelivery Note`.name), 0) >
ifnull((select sum(qty) from `tabSales Invoice Item` where
`tabSales Invoice Item`.docstatus = 1 and
`tabSales Invoice Item`.delivery_note=`tabDelivery Note`.name), 0))
%(mcond)s order by `tabDelivery Note`.`%(key)s` asc
limit %(start)s, %(page_len)s""" % {

View File

@ -99,6 +99,8 @@ class SellingController(StockController):
for item in self.doclist.get({"parentfield": self.fname}):
if item.item_code in self.stock_items or \
(item_sales_bom and item_sales_bom.get(item.item_code)):
buying_amount = 0
if item.item_code in self.stock_items:
buying_amount = get_buying_amount(self.doc.doctype, self.doc.name,
item.name, stock_ledger_entries.get((item.item_code,
@ -108,9 +110,10 @@ class SellingController(StockController):
self.doc.doctype, self.doc.name, item.name, stock_ledger_entries,
item_sales_bom)
item.buying_amount = buying_amount >= 0.01 and buying_amount or 0
webnotes.conn.set_value(item.doctype, item.name, "buying_amount",
item.buying_amount)
# buying_amount >= 0.01 so that gl entry doesn't get created for such small amounts
item.buying_amount = buying_amount >= 0.01 and buying_amount or 0
webnotes.conn.set_value(item.doctype, item.name, "buying_amount",
item.buying_amount)
def check_expense_account(self, item):
if item.buying_amount and not item.expense_account:

View File

@ -0,0 +1,10 @@
---
{
"_label": "Client Scripts: Custoimzing ERPNext"
}
---

View File

@ -5,8 +5,9 @@
"docs.dev.install",
"docs.dev.quickstart",
"docs.dev.framework",
"docs.dev.api",
"docs.dev.modules",
"docs.dev.client_script",
"docs.dev.api",
"docs.dev.translate",
"docs.dev.docs"
]

51
docs/templates/docs.html vendored Normal file
View File

@ -0,0 +1,51 @@
{% extends "lib/core/doctype/documentation_tool/docs.html" %}
{% block navbar %}
<div class="navbar navbar-default" style="border-bottom: 2px solid #c0392b">
<div class="container">
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<object data="img/splash.svg" class="erpnext-logo"
type="image/svg+xml"></object> erpnext.org</a>
<div class="collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li><a href="docs.user.html">User</a></li>
<li><a href="docs.dev.html">Developer</a></li>
<li><a href="docs.user.help.html">Help</a></li>
<li><a href="docs.download.html">Download</a></li>
<li><a href="https://erpnext.com" target="_blank">Cloud</a></li>
</ul>
<ul class="nav navbar-nav pull-right">
<li><a href="docs.about.html">About</a></li>
</ul>
</div>
</div>
</div>
{% endblock %}
{% block footer %}
<hr />
<div class="footer text-muted" style="font-size: 80%;">
<div class="content row">
<div class="col-md-12">
&copy; <a href="https://erpnext.com">Web Notes</a> |
<a href="docs.user.help.html">Help</a> |
<a href="https://github.com/webnotes/erpnext" target="_blank">Code</a> |
<a href="docs.attributions.html">Attributions</a> |
<a href="https://erpnext.com">ERPNext Cloud</a> |
<a href="https://erpnext.com/partners">Find a Partner</a> |
<a href="https://erpnext.com/donate">Donate</a>
<br>
<p>
Code License: <a href="https://www.gnu.org/licenses/gpl.html">GNU/GPL 3</a>.
Documentation License: <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a>.
</p>
</div>
</div>
</div>
{% endblock %}

Some files were not shown because too many files have changed in this diff Show More