Compare commits
68 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b3d99d39a | ||
|
|
47a10f5a39 | ||
|
|
ecb39a5b63 | ||
|
|
39c8c9e7b0 | ||
|
|
4e7cc93af9 | ||
|
|
f8cb1a916e | ||
|
|
ab2e75e98e | ||
|
|
354892b1c6 | ||
|
|
abe69afd69 | ||
|
|
c72a89aaf8 | ||
|
|
873d98be2d | ||
|
|
f1d06b02e7 | ||
|
|
675276b802 | ||
|
|
9e95e780da | ||
|
|
015fa7a1d1 | ||
|
|
1ff3a6cdb8 | ||
|
|
7620efc9ad | ||
|
|
7778b480fd | ||
|
|
a17d7cea34 | ||
|
|
a9cafcb8ae | ||
|
|
bdfd0d1ff9 | ||
|
|
afc8b1a087 | ||
|
|
6c1773025b | ||
|
|
e24365f1f4 | ||
|
|
fd334bf451 | ||
|
|
5515b1ea7f | ||
|
|
96d67f5153 | ||
|
|
8a00319962 | ||
|
|
c6136e4801 | ||
|
|
0938b5dec6 | ||
|
|
88f8fcb32e | ||
|
|
f40ce616a7 | ||
|
|
b02788b915 | ||
|
|
b094ee45d7 | ||
|
|
de0c87757a | ||
|
|
5604f987f2 | ||
|
|
9d14f0f36a | ||
|
|
a74468b353 | ||
|
|
35f81b24f1 | ||
|
|
40431cbf89 | ||
|
|
5529f14aaf | ||
|
|
54c31b498b | ||
|
|
899dba9022 | ||
|
|
7d8fa8089a | ||
|
|
ac86c5b6d1 | ||
|
|
ecc3f312b9 | ||
|
|
b65b5f43a7 | ||
|
|
c3270d7504 | ||
|
|
ea909ace01 | ||
|
|
f64d11da3c | ||
|
|
95225be93d | ||
|
|
e5d169b8d2 | ||
|
|
da4e3fb366 | ||
|
|
13ce150149 | ||
|
|
a04489a72b | ||
|
|
35cd88b09b | ||
|
|
ff56566506 | ||
|
|
01ad94bfad | ||
|
|
cfe3c54ca0 | ||
|
|
2f6a20a93a | ||
|
|
5d1543f241 | ||
|
|
c56650c773 | ||
|
|
cb11f27558 | ||
|
|
98be98816c | ||
|
|
ca2c297f72 | ||
|
|
387e1e21cb | ||
|
|
d6e49150a8 | ||
|
|
49a2729663 |
27
README.md
27
README.md
@@ -1,34 +1,31 @@
|
||||
# ERPNext - Open Source ERP for small, medium sized businesses [](https://travis-ci.org/frappe/erpnext)
|
||||
# ERPNext - Open source ERP for small and medium-size business [](https://travis-ci.org/frappe/erpnext)
|
||||
|
||||
[https://erpnext.com](https://erpnext.com)
|
||||
|
||||
Includes Accounting, Inventory, CRM, Sales, Purchase, Projects, HRMS. Built on Python / MariaDB.
|
||||
Includes: Accounting, Inventory, CRM, Sales, Purchase, Projects, HRMS. Requires MariaDB.
|
||||
|
||||
ERPNext is built on [frappe](https://github.com/frappe/frappe) Python Framework.
|
||||
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & Javascript.
|
||||
|
||||
- [User Guide](http://erpnext.org/user-guide.html)
|
||||
- [User Guide](https://erpnext.com/user-guide)
|
||||
- [Getting Help](http://erpnext.org/getting-help.html)
|
||||
- [Developer Forum](http://groups.google.com/group/erpnext-developer-forum)
|
||||
- [User Forum](http://groups.google.com/group/erpnext-user-forum)
|
||||
- [Discussion Forum](https://discuss.frappe.io/)
|
||||
|
||||
---
|
||||
|
||||
### Install
|
||||
### Full Install
|
||||
|
||||
Use the bench, https://github.com/frappe/bench
|
||||
The Easy Way install script for bench will install all dependencies (e.g. MariaDB). See https://github.com/frappe/bench
|
||||
|
||||
### Admin Login
|
||||
New passwords will be created for the ERPNext "Administrator" user, the MariaDB root user, and the frappe user (the script displays the passwords and saves them to ~/frappe_passwords.txt).
|
||||
|
||||
1. go to "/login"
|
||||
1. Administrator user name: "Administrator"
|
||||
1. Administrator password: "admin"
|
||||
### Virtual Image
|
||||
|
||||
### Download and Install
|
||||
|
||||
##### Virtual Image:
|
||||
You can download a virtual image to run ERPNext in a virtual machine on your local system.
|
||||
|
||||
- [ERPNext Download](http://erpnext.com/download)
|
||||
|
||||
System and user credentials are listed on the download page.
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = '4.14.0'
|
||||
__version__ = '4.17.0'
|
||||
|
||||
@@ -492,7 +492,7 @@ erpnext.POS = Class.extend({
|
||||
});
|
||||
|
||||
me.refresh_delete_btn();
|
||||
if(me.frm.doc[this.party]) {
|
||||
if(me.frm.doc[this.party.toLowerCase()]) {
|
||||
this.barcode.$input.focus();
|
||||
} else {
|
||||
this.party_field.$input.focus();
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"doc_type": "Journal Voucher",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"html": "<div style=\"position: relative\">\n\n\t{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Advice\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n{%- for label, value in (\n (_(\"Voucher Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Reference / Cheque No.\"), doc.cheque_no),\n (_(\"Reference / Cheque Date\"), frappe.utils.formatdate(doc.cheque_date))\n ) -%}\n <div class=\"row\">\n <div class=\"col-sm-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-sm-8\">{{ value }}</div>\n </div>\n{%- endfor -%}\n\t<hr>\n\t<p>{{ _(\"This amount is in full / part settlement of the listed bills\") }}:</p>\n{%- for label, value in (\n (_(\"Amount\"), \"<strong>\" + (doc.total_amount or \"\") + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"References\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-sm-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-sm-8\">{{ value }}</div>\n </div>\n {%- endfor -%}\n <hr>\n\t<div style=\"position: absolute; top: 14cm; left: 0cm;\">\n\t\tPrepared By</div>\n\t<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">\n\t\tAuthorised Signatory</div>\n\t<div style=\"position: absolute; top: 14cm; left: 11cm;\">\n\t\tReceived Payment as Above</div>\n\t<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 6cm;\">\n\t\t<strong>A/C Payee</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}</div>\n\t<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n\t\t{{ doc.pay_to_recd_from }}</div>\n\t<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n\t\t{{ doc.total_amount_in_words }}</div>\n\t<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n\t\t{{ doc.total_amount }}</div>\n</div>",
|
||||
"html": "<div style=\"position: relative\">\n\n\t{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Advice\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n{%- for label, value in (\n (_(\"Voucher Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Reference / Cheque No.\"), doc.cheque_no),\n (_(\"Reference / Cheque Date\"), frappe.utils.formatdate(doc.cheque_date))\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-8\">{{ value }}</div>\n </div>\n{%- endfor -%}\n\t<hr>\n\t<p>{{ _(\"This amount is in full / part settlement of the listed bills\") }}:</p>\n{%- for label, value in (\n (_(\"Amount\"), \"<strong>\" + (doc.total_amount or \"\") + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"References\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-8\">{{ value }}</div>\n </div>\n {%- endfor -%}\n <hr>\n\t<div style=\"position: absolute; top: 14cm; left: 0cm;\">\n\t\tPrepared By</div>\n\t<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">\n\t\tAuthorised Signatory</div>\n\t<div style=\"position: absolute; top: 14cm; left: 11cm;\">\n\t\tReceived Payment as Above</div>\n\t<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 6cm;\">\n\t\t<strong>A/C Payee</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}</div>\n\t<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n\t\t{{ doc.pay_to_recd_from }}</div>\n\t<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n\t\t{{ doc.total_amount_in_words }}</div>\n\t<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n\t\t{{ doc.total_amount }}</div>\n</div>",
|
||||
"idx": 1,
|
||||
"modified": "2014-09-09 03:27:13.708596",
|
||||
"modified": "2015-01-12 11:03:17.032512",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cheque Printing Format",
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
"doc_type": "Journal Voucher",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Credit Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Credit To\"), doc.pay_to_recd_from),\n (_(\"Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Amount\"), \"<strong>\" + frappe.utils.cstr(doc.total_amount) + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n\n <div class=\"row\">\n <div class=\"col-sm-3\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-sm-9\">{{ value }}</div>\n </div>\n\n {%- endfor -%}\n\n <hr>\n <br>\n <p class=\"strong\">\n {{ _(\"For\") }} {{ doc.company }},<br>\n <br>\n <br>\n <br>\n {{ _(\"Authorized Signatory\") }}\n </p>\n</div>\n\n\n",
|
||||
"html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Credit Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Credit To\"), doc.pay_to_recd_from),\n (_(\"Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Amount\"), \"<strong>\" + frappe.utils.cstr(doc.total_amount) + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n\n <div class=\"row\">\n <div class=\"col-xs-3\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-9\">{{ value }}</div>\n </div>\n\n {%- endfor -%}\n\n <hr>\n <br>\n <p class=\"strong\">\n {{ _(\"For\") }} {{ doc.company }},<br>\n <br>\n <br>\n <br>\n {{ _(\"Authorized Signatory\") }}\n </p>\n</div>\n\n\n",
|
||||
"idx": 2,
|
||||
"modified": "2014-10-17 17:20:02.740340",
|
||||
"modified": "2015-01-12 11:02:25.716825",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Credit Note",
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"doc_type": "Journal Voucher",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Receipt Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Received On\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Received From\"), doc.pay_to_recd_from),\n (_(\"Amount\"), \"<strong>\" + doc.total_amount or 0 + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-sm-3\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-sm-9\">{{ value }}</div>\n </div>\n\n {%- endfor -%}\n\n <hr>\n <br>\n <p class=\"strong\">\n {{ _(\"For\") }} {{ doc.company }},<br>\n <br>\n <br>\n <br>\n {{ _(\"Authorized Signatory\") }}\n </p>\n</div>\n\n",
|
||||
"html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Receipt Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Received On\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Received From\"), doc.pay_to_recd_from),\n (_(\"Amount\"), \"<strong>\" + doc.total_amount or 0 + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-3\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-9\">{{ value }}</div>\n </div>\n\n {%- endfor -%}\n\n <hr>\n <br>\n <p class=\"strong\">\n {{ _(\"For\") }} {{ doc.company }},<br>\n <br>\n <br>\n <br>\n {{ _(\"Authorized Signatory\") }}\n </p>\n</div>\n\n",
|
||||
"idx": 1,
|
||||
"modified": "2014-11-04 11:25:57.560873",
|
||||
"modified": "2015-01-12 11:03:22.893209",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Receipt Voucher",
|
||||
|
||||
@@ -149,7 +149,7 @@ class AccountsReceivableReport(object):
|
||||
if not account_map:
|
||||
frappe.throw(_("No Customer Accounts found."))
|
||||
else:
|
||||
accounts_list = ['"{0}"'.format(ac.replace('"', '\"')) for ac in account_map]
|
||||
accounts_list = ["'{0}'".format(frappe.db.escape(ac)) for ac in account_map]
|
||||
conditions.append("account in ({0})".format(", ".join(accounts_list)))
|
||||
|
||||
return " and ".join(conditions), values
|
||||
|
||||
@@ -28,7 +28,7 @@ def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1):
|
||||
from `tabFiscal Year` where %s order by year_start_date desc""" % cond)
|
||||
|
||||
if not fy:
|
||||
error_msg = _("""{0} {1} not in any Fiscal Year""").format(label, formatdate(date))
|
||||
error_msg = _("""{0} {1} not in any Fiscal Year. For more details check {2}.""").format(label, formatdate(date), "https://erpnext.com/kb/accounts/fiscal-year-error")
|
||||
if verbose: frappe.msgprint(error_msg)
|
||||
raise FiscalYearError, error_msg
|
||||
|
||||
|
||||
@@ -211,7 +211,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
var tax_count = this.frm.tax_doclist.length;
|
||||
this.frm.doc.grand_total = flt(tax_count ?
|
||||
this.frm.tax_doclist[tax_count - 1].total : this.frm.doc.net_total);
|
||||
this.frm.doc.grand_total_import = flt(this.frm.doc.grand_total / this.frm.doc.conversion_rate);
|
||||
this.frm.doc.grand_total_import = flt(tax_count ?
|
||||
flt(this.frm.doc.grand_total / this.frm.doc.conversion_rate) : this.frm.doc.net_total_import);
|
||||
|
||||
this.frm.doc.total_tax = flt(this.frm.doc.grand_total - this.frm.doc.net_total,
|
||||
precision("total_tax"));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -119,6 +119,10 @@ class AccountsController(TransactionBase):
|
||||
item.get(fieldname) is None and value is not None:
|
||||
item.set(fieldname, value)
|
||||
|
||||
if fieldname == "cost_center" and item.meta.get_field("cost_center") \
|
||||
and not item.get("cost_center") and value is not None:
|
||||
item.set(fieldname, value)
|
||||
|
||||
if ret.get("pricing_rule"):
|
||||
for field in ["base_price_list_rate", "price_list_rate",
|
||||
"discount_percentage", "base_rate", "rate"]:
|
||||
@@ -467,7 +471,7 @@ class AccountsController(TransactionBase):
|
||||
max_allowed_amt = flt(ref_amt * (100 + tolerance) / 100)
|
||||
|
||||
if total_billed_amt - max_allowed_amt > 0.01:
|
||||
frappe.throw(_("Cannot overbill for Item {0} in row {0} more than {1}. To allow overbilling, please set in Stock Settings").format(item.item_code, item.idx, max_allowed_amt))
|
||||
frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow overbilling, please set in Stock Settings").format(item.item_code, item.idx, max_allowed_amt))
|
||||
|
||||
def get_company_default(self, fieldname):
|
||||
from erpnext.accounts.utils import get_company_default
|
||||
|
||||
@@ -111,7 +111,8 @@ class BuyingController(StockController):
|
||||
|
||||
def calculate_totals(self):
|
||||
self.grand_total = flt(self.tax_doclist[-1].total if self.tax_doclist else self.net_total)
|
||||
self.grand_total_import = flt(self.grand_total / self.conversion_rate)
|
||||
self.grand_total_import = flt(self.grand_total / self.conversion_rate) \
|
||||
if self.tax_doclist else self.net_total_import
|
||||
|
||||
self.total_tax = flt(self.grand_total - self.net_total, self.precision("total_tax"))
|
||||
|
||||
|
||||
@@ -218,7 +218,8 @@ class SellingController(StockController):
|
||||
def calculate_totals(self):
|
||||
self.grand_total = flt(self.tax_doclist[-1].total if self.tax_doclist else self.net_total)
|
||||
|
||||
self.grand_total_export = flt(self.grand_total / self.conversion_rate)
|
||||
self.grand_total_export = flt(self.grand_total / self.conversion_rate) \
|
||||
if self.tax_doclist else self.net_total_export
|
||||
|
||||
self.other_charges_total = flt(self.grand_total - self.net_total, self.precision("other_charges_total"))
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class StockController(AccountsController):
|
||||
else:
|
||||
is_expense_account = frappe.db.get_value("Account",
|
||||
item.get("expense_account"), "report_type")=="Profit and Loss"
|
||||
if self.doctype not in ("Purchase Receipt", "Stock Reconciliation") and not is_expense_account:
|
||||
if self.doctype not in ("Purchase Receipt", "Stock Reconciliation", "Stock Entry") and not is_expense_account:
|
||||
frappe.throw(_("Expense / Difference account ({0}) must be a 'Profit or Loss' account")
|
||||
.format(item.get("expense_account")))
|
||||
if is_expense_account and not item.get("cost_center"):
|
||||
@@ -245,7 +245,7 @@ def compare_existing_and_expected_gle(existing_gle, expected_gle):
|
||||
for entry in expected_gle:
|
||||
for e in existing_gle:
|
||||
if entry.account==e.account and entry.against_account==e.against_account \
|
||||
and entry.cost_center==e.cost_center \
|
||||
and (not entry.cost_center or not e.cost_center or entry.cost_center==e.cost_center) \
|
||||
and (entry.debit != e.debit or entry.credit != e.credit):
|
||||
matched = False
|
||||
break
|
||||
|
||||
@@ -4,7 +4,7 @@ app_publisher = "Web Notes 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 = "4.14.0"
|
||||
app_version = "4.17.0"
|
||||
|
||||
error_report_email = "support@erpnext.com"
|
||||
|
||||
|
||||
@@ -57,6 +57,9 @@ class BOM(Document):
|
||||
last_purchase_rate, is_manufactured_item
|
||||
from `tabItem` where name=%s""", item_code, as_dict = 1)
|
||||
|
||||
if not item:
|
||||
frappe.throw(_("Item: {0} does not exist in the system").format(item_code))
|
||||
|
||||
return item
|
||||
|
||||
def validate_rm_item(self, item):
|
||||
|
||||
@@ -10,7 +10,7 @@ from erpnext.manufacturing.doctype.production_order.production_order import make
|
||||
from erpnext.stock.doctype.stock_entry import test_stock_entry
|
||||
|
||||
class TestProductionOrder(unittest.TestCase):
|
||||
def test_planned_qty(self):
|
||||
def check_planned_qty(self):
|
||||
set_perpetual_inventory(0)
|
||||
|
||||
planned0 = frappe.db.get_value("Bin", {"item_code": "_Test FG Item", "warehouse": "_Test Warehouse 1 - _TC"}, "planned_qty") or 0
|
||||
@@ -27,11 +27,15 @@ class TestProductionOrder(unittest.TestCase):
|
||||
s = frappe.get_doc(make_stock_entry(pro_doc.name, "Material Transfer", 4))
|
||||
for d in s.get("mtn_details"):
|
||||
d.s_warehouse = "Stores - _TC"
|
||||
s.fiscal_year = "_Test Fiscal Year 2013"
|
||||
s.posting_date = "2013-01-02"
|
||||
s.insert()
|
||||
s.submit()
|
||||
|
||||
# from wip to fg
|
||||
s = frappe.get_doc(make_stock_entry(pro_doc.name, "Manufacture", 4))
|
||||
s.fiscal_year = "_Test Fiscal Year 2013"
|
||||
s.posting_date = "2013-01-03"
|
||||
s.insert()
|
||||
s.submit()
|
||||
|
||||
@@ -44,12 +48,14 @@ class TestProductionOrder(unittest.TestCase):
|
||||
|
||||
def test_over_production(self):
|
||||
from erpnext.manufacturing.doctype.production_order.production_order import StockOverProductionError
|
||||
pro_doc = self.test_planned_qty()
|
||||
pro_doc = self.check_planned_qty()
|
||||
|
||||
test_stock_entry.make_stock_entry("_Test Item", None, "_Test Warehouse - _TC", 100, 100)
|
||||
test_stock_entry.make_stock_entry("_Test Item Home Desktop 100", None, "_Test Warehouse - _TC", 100, 100)
|
||||
|
||||
s = frappe.get_doc(make_stock_entry(pro_doc.name, "Manufacture", 7))
|
||||
s.fiscal_year = "_Test Fiscal Year 2013"
|
||||
s.posting_date = "2013-01-04"
|
||||
s.insert()
|
||||
|
||||
self.assertRaises(StockOverProductionError, s.submit)
|
||||
|
||||
@@ -24,6 +24,13 @@ cur_frm.cscript.item_code = function(doc,cdt,cdn) {
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.raise_purchase_request = function(doc, cdt, cdn) {
|
||||
return frappe.call({
|
||||
method: "raise_purchase_request",
|
||||
doc:doc
|
||||
})
|
||||
}
|
||||
|
||||
cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) {
|
||||
return $c_obj(doc, 'validate_data', '', function(r, rt) {
|
||||
if (!r['exc'])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"creation": "2013-01-21 12:03:47.000000",
|
||||
"creation": "2013-01-21 12:03:47",
|
||||
"default_print_format": "Standard",
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
@@ -20,6 +20,7 @@
|
||||
{
|
||||
"fieldname": "fg_item",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Filter based on item",
|
||||
"options": "Item",
|
||||
"permlevel": 0
|
||||
@@ -27,6 +28,7 @@
|
||||
{
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Filter based on customer",
|
||||
"options": "Customer",
|
||||
"permlevel": 0
|
||||
@@ -34,6 +36,7 @@
|
||||
{
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
@@ -140,7 +143,7 @@
|
||||
"fieldname": "raise_purchase_request",
|
||||
"fieldtype": "Button",
|
||||
"label": "Create Material Requests",
|
||||
"options": "raise_purchase_request",
|
||||
"options": "",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@@ -155,7 +158,7 @@
|
||||
"idx": 1,
|
||||
"in_create": 1,
|
||||
"issingle": 1,
|
||||
"modified": "2013-12-20 19:23:25.000000",
|
||||
"modified": "2015-01-11 21:53:21.253556",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Manufacturing",
|
||||
"name": "Production Planning Tool",
|
||||
|
||||
@@ -6,6 +6,7 @@ import frappe
|
||||
|
||||
def execute():
|
||||
reference_date = guess_reference_date()
|
||||
frappe.reload_doc('accounts', 'doctype', 'journal_voucher_detail')
|
||||
for name in frappe.db.sql_list("""select name from `tabJournal Voucher`
|
||||
where date(creation)>=%s""", reference_date):
|
||||
jv = frappe.get_doc("Journal Voucher", name)
|
||||
|
||||
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc('manufacturing', 'doctype', 'bom_operation')
|
||||
for d in frappe.db.sql("""select bom.name from `tabBOM` bom where bom.docstatus < 2 and
|
||||
exists(select bom_op.name from `tabBOM Operation` bom_op where
|
||||
bom.name = bom_op.parent and bom_op.fixed_cycle_cost IS NOT NULL)""", as_dict=1):
|
||||
|
||||
@@ -108,6 +108,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
// otherwise, only reset values
|
||||
$.each(this.data, function(i, d) {
|
||||
me.reset_item_values(d);
|
||||
d["closing_qty_value"] = 0;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -402,20 +402,32 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
},
|
||||
|
||||
_set_values_for_item_list: function(children) {
|
||||
var me = this;
|
||||
var price_list_rate_changed = false;
|
||||
$.each(children, function(i, d) {
|
||||
var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule");
|
||||
$.each(d, function(k, v) {
|
||||
if (["doctype", "name"].indexOf(k)===-1) {
|
||||
if(k=="price_list_rate") {
|
||||
if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true;
|
||||
}
|
||||
frappe.model.set_value(d.doctype, d.name, k, v);
|
||||
}
|
||||
});
|
||||
// if pricing rule set as blank from an existing value, apply price_list
|
||||
if(!me.frm.doc.ignore_pricing_rule && existing_pricing_rule && !d.pricing_rule) {
|
||||
me.apply_price_list(frappe.get_doc(d.doctype, d.name));
|
||||
}
|
||||
|
||||
if(!price_list_rate_changed) me.calculate_taxes_and_totals();
|
||||
});
|
||||
},
|
||||
|
||||
apply_price_list: function() {
|
||||
apply_price_list: function(item) {
|
||||
var me = this;
|
||||
return this.frm.call({
|
||||
method: "erpnext.stock.get_item_details.apply_price_list",
|
||||
args: { args: this._get_args() },
|
||||
args: { args: this._get_args(item) },
|
||||
callback: function(r) {
|
||||
if (!r.exc) {
|
||||
me.in_apply_price_list = true;
|
||||
|
||||
@@ -35,8 +35,6 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
|
||||
});
|
||||
}
|
||||
|
||||
if(this.frm.doc.customer && !this.frm.doc.customer_name) cur_frm.cscript.customer(this.frm.doc);
|
||||
|
||||
this.setup_queries();
|
||||
},
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Customer",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "customer",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Customer",
|
||||
@@ -416,7 +417,7 @@
|
||||
"icon": "icon-info-sign",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2014-12-01 08:46:35.331148",
|
||||
"modified": "2014-12-19 10:49:20.695720",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Opportunity",
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
"enquiry_from": "Lead",
|
||||
"enquiry_type": "Sales",
|
||||
"lead": "_T-Lead-00001",
|
||||
"transaction_date": "2013-12-12",
|
||||
"fiscal_year": "_Test Fiscal Year 2013",
|
||||
"enquiry_details": [{
|
||||
"item_name": "Test Item",
|
||||
"description": "Some description"
|
||||
|
||||
@@ -342,7 +342,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
var tax_count = this.frm.tax_doclist.length;
|
||||
|
||||
this.frm.doc.grand_total = flt(tax_count ? this.frm.tax_doclist[tax_count - 1].total : this.frm.doc.net_total);
|
||||
this.frm.doc.grand_total_export = flt(this.frm.doc.grand_total / this.frm.doc.conversion_rate);
|
||||
this.frm.doc.grand_total_export = flt(tax_count ?
|
||||
flt(this.frm.doc.grand_total / this.frm.doc.conversion_rate) : this.frm.doc.net_total_export);
|
||||
|
||||
this.frm.doc.other_charges_total = flt(this.frm.doc.grand_total - this.frm.doc.net_total,
|
||||
precision("other_charges_total"));
|
||||
|
||||
@@ -61,14 +61,27 @@ frappe.pages['setup-wizard'].onload = function(wrapper) {
|
||||
fields: [
|
||||
{
|
||||
"fieldname": "language", "label": __("Language"), "fieldtype": "Select",
|
||||
options: ["english", "العربية", "deutsch", "ελληνικά", "español", "français", "हिंदी", "hrvatski",
|
||||
"italiano", "nederlands", "polski", "português brasileiro", "português", "српски", "தமிழ்",
|
||||
"ไทย", "中国(简体)", "中國(繁體)"],
|
||||
reqd:1, "default": "english"
|
||||
reqd:1
|
||||
},
|
||||
],
|
||||
help: __("Welcome to ERPNext. Please select your language to begin the Setup Wizard."),
|
||||
onload: function(slide) {
|
||||
var me = this;
|
||||
|
||||
if (!this.language_list) {
|
||||
frappe.call({
|
||||
method: "erpnext.setup.page.setup_wizard.setup_wizard.load_languages",
|
||||
callback: function(r) {
|
||||
me.language_list = r.message;
|
||||
slide.get_input("language")
|
||||
.add_options(r.message)
|
||||
.val("english");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
slide.get_input("language").add_options(this.language_list);
|
||||
}
|
||||
|
||||
slide.get_input("language").on("change", function() {
|
||||
var lang = $(this).val() || "english";
|
||||
frappe._messages = {};
|
||||
|
||||
@@ -434,4 +434,6 @@ def load_messages(language):
|
||||
send_translations(m)
|
||||
return lang
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def load_languages():
|
||||
return sorted(get_lang_dict().keys())
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Customer's Purchase Order No",
|
||||
"no_copy": 1,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "po_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
@@ -1013,7 +1013,7 @@
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"is_submittable": 1,
|
||||
"modified": "2014-12-16 10:37:08.934881",
|
||||
"modified": "2014-12-22 14:58:19.575566",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note",
|
||||
|
||||
@@ -229,7 +229,7 @@ class Item(WebsiteGenerator):
|
||||
if not frappe.db.exists("Item", newdn):
|
||||
frappe.throw(_("Item {0} does not exist").format(newdn))
|
||||
|
||||
field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"]
|
||||
field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no", "is_manufactured_item"]
|
||||
new_properties = [cstr(d) for d in frappe.db.get_value("Item", newdn, field_list)]
|
||||
if new_properties != [cstr(self.get(fld)) for fld in field_list]:
|
||||
frappe.throw(_("To merge, following properties must be same for both items")
|
||||
|
||||
@@ -936,6 +936,8 @@ def make_stock_entry(item, source, target, qty, incoming_rate=None):
|
||||
"incoming_rate": incoming_rate,
|
||||
"conversion_factor": 1.0
|
||||
})
|
||||
s.posting_date= "2013-01-01"
|
||||
s.fiscal_year= "_Test Fiscal Year 2013"
|
||||
s.insert()
|
||||
s.submit()
|
||||
return s
|
||||
|
||||
@@ -39,8 +39,8 @@ class StockLedgerEntry(Document):
|
||||
(self.warehouse, self.item_code, self.batch_no))[0][0])
|
||||
|
||||
if batch_bal_after_transaction < 0:
|
||||
frappe.throw(_("Negative balance in Batch {0} for Item {1} at Warehouse {2} on {3} {4}").format(\
|
||||
batch_bal_after_transaction - self.actual_qty, self.item_code, self.warehouse,
|
||||
frappe.throw(_("Negative balance {0} in Batch {1} for Item {2} at Warehouse {3} on {4} {5}")
|
||||
.format(batch_bal_after_transaction - self.actual_qty, self.batch_no, self.item_code, self.warehouse,
|
||||
formatdate(self.posting_date), self.posting_time))
|
||||
|
||||
def validate_mandatory(self):
|
||||
|
||||
@@ -153,8 +153,8 @@ class StockReconciliation(StockController):
|
||||
if row.valuation_rate in ("", None):
|
||||
row.valuation_rate = previous_sle.get("valuation_rate")
|
||||
|
||||
# if row.qty and not row.valuation_rate:
|
||||
# frappe.throw(_("Valuation Rate required for Item {0}").format(row.item_code))
|
||||
if row.qty and not row.valuation_rate:
|
||||
frappe.throw(_("Valuation Rate required for Item {0}").format(row.item_code))
|
||||
|
||||
self.insert_entries(row)
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ def repost_all_stock_vouchers():
|
||||
doc.validate()
|
||||
|
||||
doc.update_stock_ledger()
|
||||
doc.make_gl_entries(repost_future_gle=False, allow_negative_stock=True)
|
||||
doc.make_gl_entries(repost_future_gle=False)
|
||||
frappe.db.commit()
|
||||
except Exception, e:
|
||||
print frappe.get_traceback()
|
||||
|
||||
Reference in New Issue
Block a user