Compare commits

..

105 Commits

Author SHA1 Message Date
Nabin Hait
2b6cacc799 Merge branch 'hotfix' 2016-09-26 18:02:19 +05:30
Nabin Hait
577aa9cb33 bumped to version 7.0.49 2016-09-26 18:32:19 +06:00
Nabin Hait
ad3e213b41 minor patch fixes 2016-09-26 18:00:13 +05:30
Nabin Hait
7faa4b5fdf Merge pull request #6455 from rohitwaghchaure/retun_field_duplicate_issue
[Fix] Allow renaming for UOM, When Duplicate Is Return field should not be copied #5510 #6288
2016-09-26 17:57:28 +05:30
Nabin Hait
f04721ee79 Update naming_series.py 2016-09-26 17:55:34 +05:30
Pawan Mehta
4f72480045 Merge pull request #6453 from PawanMeh/hotfix
[fix]-Ageing buckets should not have amounts if due date is not reached
2016-09-23 22:52:00 +05:30
Rohit Waghchaure
d728f5a429 [Fix] Allow renaming for UOM, When Duplicate Is Return field should not be copied #5510 #6288 2016-09-23 18:06:24 +05:30
Nabin Hait
5f0aceab19 Merge branch 'hotfix' 2016-09-23 17:23:28 +05:30
Nabin Hait
aec28a2c88 bumped to version 7.0.48 2016-09-23 17:53:28 +06:00
pawan
09f1ee637e [fix] #6371 2016-09-23 17:19:54 +05:30
Nabin Hait
3720045eb9 Update patches.txt 2016-09-23 16:31:43 +05:30
Nabin Hait
147b288d66 Update repost_gle_for_pos_sales_return.py 2016-09-23 13:11:05 +05:30
Nabin Hait
d4321ec18b Merge branch 'hotfix' 2016-09-23 12:16:02 +05:30
Nabin Hait
84fa3dfac8 bumped to version 7.0.47 2016-09-23 12:46:01 +06:00
Nabin Hait
aca857e708 Merge pull request #6447 from nabinhait/patch_fix_legacy_migration
Patch fixed for legacy migration
2016-09-23 12:15:06 +05:30
Nabin Hait
d03087d3ab Patch fixed for legacy migration 2016-09-23 11:08:02 +05:30
Nabin Hait
4ed0653c7f Merge pull request #6444 from rohitwaghchaure/supplier_status_issue
[fix] Supplier status stuck at Open forever
2016-09-22 18:52:26 +05:30
Rohit Waghchaure
b2382c0b8e [fix] Supplier status stuck at Open forever 2016-09-22 18:45:24 +05:30
Nabin Hait
f79b3f8c3c Merge pull request #6443 from rohitwaghchaure/pos_discount_issue
[POS] minor fix
2016-09-22 18:00:55 +05:30
Rohit Waghchaure
481ca832b0 minor fix 2016-09-22 17:21:37 +05:30
Nabin Hait
22e1665244 Merge pull request #6440 from rohitwaghchaure/additional_discount_amount_issue
[Fix] Additional Discount Amount can't be refresh automatically #6199
2016-09-22 16:03:00 +05:30
Rohit Waghchaure
deaee7c08b [Fix] Additional Discount Amount can't be refresh automatically #6199 2016-09-22 14:02:53 +05:30
Nabin Hait
0d36862917 Merge pull request #6434 from rohitwaghchaure/net_rate_issue
[Fix] Discount copied during making of PO from SO
2016-09-22 12:34:08 +05:30
Rohit Waghchaure
bd599b0169 [Fix] Discount copied during making of PO from SO 2016-09-22 11:47:17 +05:30
Nabin Hait
0967b17320 Merge branch 'hotfix' 2016-09-22 11:33:32 +05:30
Nabin Hait
b1041072a2 bumped to version 7.0.46 2016-09-22 12:03:32 +06:00
Nabin Hait
a58a65457f Sales Register report minor fix 2016-09-22 11:31:42 +05:30
Nabin Hait
993d7ca630 Merge pull request #6424 from rohitwaghchaure/daily_timesheet_summary_permission_issue
[Fix] Daily timesheet summary permission issue
2016-09-21 18:41:54 +05:30
Nabin Hait
7108991039 Patch order changed 2016-09-21 16:34:44 +05:30
Rohit Waghchaure
342ec18b83 [Fix] Daily timesheet summary permission issue 2016-09-21 13:22:15 +05:30
Nabin Hait
6835a6fb49 Merge branch 'hotfix' 2016-09-21 13:05:26 +05:30
Nabin Hait
4fead63419 bumped to version 7.0.45 2016-09-21 13:35:26 +06:00
Nabin Hait
06131dd0b1 Merge pull request #6420 from nabinhait/sales_reg_fix
Fix in Sales Register for multiple mode of payments
2016-09-21 12:54:25 +05:30
Nabin Hait
aac32d644d Fix in Sales Register for multiple mode of payments 2016-09-21 11:46:07 +05:30
Nabin Hait
d12990ff57 Update update_home_page.py 2016-09-20 18:20:58 +05:30
Nabin Hait
429a38f90b Merge pull request #6415 from rmehta/hotfix
[minor] bring back old grid style in material request
2016-09-20 18:05:32 +05:30
Rushabh Mehta
57a1905576 [minor] bring back old grid style in material request 2016-09-20 17:22:54 +05:30
Nabin Hait
30a25e11f7 Merge branch 'hotfix' 2016-09-20 16:52:10 +05:30
Nabin Hait
1f912f67ae bumped to version 7.0.44 2016-09-20 17:22:10 +06:00
Nabin Hait
af03de3d00 Merge pull request #6399 from rohitwaghchaure/pos_payment_mode_type_missing_issue
[Fix] POS, mode of payment issue
2016-09-20 10:56:54 +05:30
Rohit Waghchaure
414199a5db [Fix] Mode of payment issue 2016-09-19 23:43:47 +05:30
Nabin Hait
759ef4c00d Allowed past dates in next depreciation date 2016-09-15 12:24:33 +05:30
Nabin Hait
4a121d60db Merge branch 'hotfix' 2016-09-14 15:44:25 +05:30
Nabin Hait
72801043f1 bumped to version 7.0.43 2016-09-14 16:14:25 +06:00
Nabin Hait
9c32baa1f4 Merge pull request #6355 from rohitwaghchaure/timesheet_calendar_permission_issue
[Fix] Timesheet calendar permission issue
2016-09-14 15:26:30 +05:30
Rohit Waghchaure
4bd08182ac [Fix] Timesheet calendar permission issue 2016-09-13 13:35:53 +05:30
Nabin Hait
ae9990cb81 Merge pull request #6353 from rohitwaghchaure/patch_fix_for_timesheet
[Fix] Timesheet patch
2016-09-13 13:31:11 +05:30
Rohit Waghchaure
a5de83351e [Fix] Timesheet patch 2016-09-13 12:36:37 +05:30
Nabin Hait
33a20bdb13 Merge pull request #6340 from nabinhait/se_difference_account
Remove Difference Account field from Stock Entry parent form
2016-09-12 17:34:59 +05:30
Nabin Hait
f314494555 Merge pull request #6345 from rohitwaghchaure/employee_name_missing
[Fix] Employee name is missing in timesheet
2016-09-12 17:34:13 +05:30
Rushabh Mehta
daee449063 [fix] for print format draft (#6346) 2016-09-12 16:42:36 +05:30
Rohit Waghchaure
03e5e68a7a [Fix] Employee name is missing in timesheet 2016-09-12 16:14:06 +05:30
Nabin Hait
a36a88b6de Remove Difference Account field from Stock Entry parent form 2016-09-12 13:15:59 +05:30
Nabin Hait
9c82dd9157 Merge pull request #6332 from rmehta/item-group-paging
[fix] paging for item group
2016-09-12 13:01:54 +05:30
Rushabh Mehta
3aa315040f [fix] paging for item group 2016-09-11 16:48:24 +05:30
Nabin Hait
7819744e5b Merge pull request #6315 from rohitwaghchaure/patch_fix
Patch fix
2016-09-08 16:52:32 +05:30
Rohit Waghchaure
aaa6d1f1bc patch fix 2016-09-08 12:34:36 +05:30
Nabin Hait
a8b8d81e2a Merge branch 'hotfix' 2016-09-07 17:20:14 +05:30
Nabin Hait
3e669ca656 bumped to version 7.0.42 2016-09-07 17:50:14 +06:00
Nabin Hait
1bf8e70339 Update convert_timelog_to_timesheet.py 2016-09-07 17:19:27 +05:30
Nabin Hait
1bdffbff57 Merge branch 'hotfix' 2016-09-07 17:01:17 +05:30
Nabin Hait
094d3adba3 bumped to version 7.0.41 2016-09-07 17:31:17 +06:00
Nabin Hait
6a5751e91c Merge pull request #6311 from nabinhait/patch_hotfix_1
Patch fixed
2016-09-07 17:00:29 +05:30
Nabin Hait
23147ff881 Patch fixed 2016-09-07 16:59:55 +05:30
Nabin Hait
c16c0ca944 Merge pull request #6310 from rohitwaghchaure/pos_itemwise_tax_issue
[Fix] Item level taxes are not getting calculated in POS
2016-09-07 15:59:32 +05:30
Rohit Waghchaure
525900c5c1 [Fix] Item level taxes are not getting calculated in POS 2016-09-07 15:01:08 +05:30
Nabin Hait
75a41a6f75 Merge branch 'hotfix' 2016-09-06 17:55:55 +05:30
Nabin Hait
9b54b78794 bumped to version 7.0.40 2016-09-06 18:25:55 +06:00
Nabin Hait
93851df048 Merge pull request #6299 from nabinhait/patch_fix_800
Patch fixed
2016-09-06 17:49:53 +05:30
Nabin Hait
f79d7188de Patch fixed 2016-09-06 17:47:19 +05:30
Nabin Hait
3cdc74e3b0 Merge pull request #6286 from rohitwaghchaure/pos_name
[POS] Added offline_pos_name in print format
2016-09-06 11:38:51 +05:30
Rohit Waghchaure
377c7acd53 [POS] Added offline_pos_name in print format 2016-09-05 17:59:01 +05:30
Nabin Hait
05621ed564 Merge pull request #6284 from nabinhait/advance_fetch
[fix] Fetch advance journal entry in invoice if it is tagged against linked order
2016-09-05 17:02:44 +05:30
Nabin Hait
ca627fb806 [fix] Fetch advance journal entry in invoice if it is tagged against linked order 2016-09-05 16:17:08 +05:30
Nabin Hait
6e4ab60e4c Merge branch 'hotfix' 2016-09-05 15:43:48 +05:30
Nabin Hait
911e9caa43 bumped to version 7.0.39 2016-09-05 16:13:48 +06:00
Nabin Hait
b239a09951 Merge pull request #6282 from nabinhait/maintenance_schedule_fix
Minor fix in maintenance schedule
2016-09-05 15:39:54 +05:30
Nabin Hait
d223a03814 Merge pull request #6281 from nabinhait/notifications
Notifications filters for DN, PR and PI
2016-09-05 15:26:23 +05:30
Nabin Hait
4cb58c410a Minor fix in maintenance schedule 2016-09-05 15:14:26 +05:30
Nabin Hait
906552a401 Notifications filters for DN, PR and PI 2016-09-05 14:35:40 +05:30
Nabin Hait
3bd5014b7b Merge pull request #6280 from nabinhait/minorfixes
Minor fixes
2016-09-05 12:32:09 +05:30
Nabin Hait
8693b5c93a Minor fixes 2016-09-05 11:51:45 +05:30
Nabin Hait
36830016ee Merge branch 'hotfix' 2016-09-02 16:19:21 +05:30
Nabin Hait
533e564867 bumped to version 7.0.38 2016-09-02 16:49:21 +06:00
Nabin Hait
88d7e419ad Merge pull request #6263 from nabinhait/timesheet_fix_101
Migrate employee field to timesheet only if it exists in time log
2016-09-02 16:18:12 +05:30
Nabin Hait
54254cca58 Update set_party_name_in_payment_entry.py 2016-09-02 16:17:42 +05:30
Nabin Hait
142f14dd5c Migrate employee field to timesheet only if it exists in time log 2016-09-02 14:47:14 +05:30
Nabin Hait
0f0c131ba4 Merge branch 'hotfix' 2016-09-02 14:26:33 +05:30
Nabin Hait
e1e187bee1 bumped to version 7.0.37 2016-09-02 14:56:33 +06:00
Nabin Hait
c946c730da Merge pull request #6258 from nabinhait/party_name_in_pe
Party name in Payment Entry and cheque print format
2016-09-02 14:20:22 +05:30
Nabin Hait
5a4ca64c4a Party name in Payment Entry and cheque print format 2016-09-02 14:20:01 +05:30
Nabin Hait
47fd4c6521 Merge pull request #6261 from nabinhait/order_trends_fix
Ignore closed sales/purchase order in trends report
2016-09-02 14:17:30 +05:30
Nabin Hait
e58031ab49 Merge pull request #6249 from rohitwaghchaure/rfq_webform_issue
[RFQ] Web form alignment issue
2016-09-02 14:17:22 +05:30
Nabin Hait
f8e374643c Merge pull request #6257 from nabinhait/letter_head_in_report
Default letter head in report printing based on selected company
2016-09-02 14:17:12 +05:30
Nabin Hait
0ef9da65dc Merge pull request #6260 from rohitwaghchaure/timesheet_status_and_date_issue
[Fix] Updated timesheet status, start date, end date
2016-09-02 14:16:53 +05:30
Nabin Hait
98d58b5ed1 Merge pull request #6262 from saurabh6790/hotfix
[fix] set is_group filter in get query for warehouse
2016-09-02 14:14:47 +05:30
Saurabh
ff910f4c72 [fixes] set filter for warehouse 2016-09-02 13:39:05 +05:30
Nabin Hait
5c69fed218 Ignore closed sales/purchase order in trends report 2016-09-02 12:53:18 +05:30
Rohit Waghchaure
d07557eaf6 [Fix] Updated timesheet status 2016-09-02 12:24:54 +05:30
Nabin Hait
13b37c6346 Default letter head in report printing based on selected company 2016-09-02 11:25:42 +05:30
Rohit Waghchaure
b34ba6bd6e [RFQ] Web form alignment issue 2016-09-01 19:10:58 +05:30
Nabin Hait
94dbc14f8a Merge branch 'hotfix' 2016-09-01 12:42:29 +05:30
Nabin Hait
600ab0f7a0 bumped to version 7.0.36 2016-09-01 13:12:29 +06:00
Nabin Hait
9afee28c36 Merge pull request #6243 from rohitwaghchaure/timesheet_issue
[Patch] Check table exist
2016-09-01 12:38:30 +05:30
Rohit Waghchaure
86f143863f [Patch] Check table exist 2016-09-01 12:37:20 +05:30
71 changed files with 827 additions and 211 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.0.35'
__version__ = '7.0.49'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -18,7 +18,8 @@ frappe.ui.form.on('Asset', {
frm.set_query("warehouse", function() {
return {
"filters": {
"company": frm.doc.company
"company": frm.doc.company,
"is_group": 0
}
};
});
@@ -232,7 +233,10 @@ erpnext.asset.transfer_asset = function(frm) {
"options": "Warehouse",
"get_query": function () {
return {
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
},
"reqd": 1

View File

@@ -80,7 +80,7 @@ class Asset(Document):
frappe.throw(_("Number of Depreciations Booked cannot be greater than Total Number of Depreciations"))
if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(nowdate()):
frappe.throw(_("Next Depreciation Date must be on or after today"))
frappe.msgprint(_("Next Depreciation Date is entered as past date"))
if (flt(self.value_after_depreciation) > flt(self.expected_value_after_useful_life)
and not self.next_depreciation_date):

View File

@@ -7,7 +7,10 @@ frappe.ui.form.on('Asset Movement', {
frm.set_query("target_warehouse", function() {
return {
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})

View File

@@ -51,6 +51,9 @@ class Budget(Document):
def validate_expense_against_budget(args):
args = frappe._dict(args)
if not args.cost_center:
return
if frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}):
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", args.cost_center, ["lft", "rgt"])

View File

@@ -43,7 +43,7 @@ def create_or_update_cheque_print_format(template_name):
</span>
<span style="top:%(payer_name_from_top_edge)scm;left: %(payer_name_from_left_edge)scm;
position: absolute;">
{{doc.party}}
{{doc.party_name}}
</span>
<span style="top:%(amt_in_words_from_top_edge)scm; left:%(amt_in_words_from_left_edge)scm;
position: absolute; display: block; width: %(amt_in_word_width)scm;

View File

@@ -226,6 +226,12 @@ frappe.ui.form.on('Payment Entry', {
party: function(frm) {
if(frm.doc.payment_type && frm.doc.party_type && frm.doc.party) {
if(!frm.doc.posting_date) {
frappe.msgprint(__("Please select Posting Date before selecting Party"))
frm.set_value("party", "");
return ;
}
frm.set_party_account_based_on_party = true;
return frappe.call({

View File

@@ -15,6 +15,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "type_of_payment",
"fieldtype": "Section Break",
"hidden": 0,
@@ -40,6 +41,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -66,13 +68,14 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Payment Type",
"length": 0,
"no_copy": 0,
@@ -92,6 +95,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type)",
"fieldname": "party_type",
"fieldtype": "Select",
@@ -119,6 +123,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
"fieldname": "party",
"fieldtype": "Dynamic Link",
@@ -146,6 +151,33 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "party_name",
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -170,6 +202,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
@@ -196,6 +229,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -222,6 +256,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "mode_of_payment",
"fieldtype": "Link",
"hidden": 0,
@@ -248,6 +283,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "payment_accounts_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -273,6 +309,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "party",
"fieldname": "party_balance",
"fieldtype": "Currency",
@@ -299,6 +336,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(in_list([\"Internal Transfer\", \"Pay\"], doc.payment_type) || doc.party)",
"fieldname": "paid_from",
"fieldtype": "Link",
@@ -326,6 +364,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "paid_from",
"fieldname": "paid_from_account_currency",
"fieldtype": "Link",
@@ -353,6 +392,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "paid_from",
"fieldname": "paid_from_account_balance",
"fieldtype": "Currency",
@@ -380,6 +420,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_18",
"fieldtype": "Column Break",
"hidden": 0,
@@ -404,6 +445,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(in_list([\"Internal Transfer\", \"Receive\"], doc.payment_type) || doc.party)",
"fieldname": "paid_to",
"fieldtype": "Link",
@@ -431,6 +473,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "paid_to",
"fieldname": "paid_to_account_currency",
"fieldtype": "Link",
@@ -458,6 +501,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "paid_to",
"fieldname": "paid_to_account_balance",
"fieldtype": "Currency",
@@ -486,6 +530,7 @@
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "eval:(doc.paid_to && doc.paid_from)",
"fieldname": "payment_amounts_section",
"fieldtype": "Section Break",
@@ -512,6 +557,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "paid_amount",
"fieldtype": "Currency",
@@ -539,6 +585,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "source_exchange_rate",
"fieldtype": "Float",
@@ -565,6 +612,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
@@ -592,6 +640,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_21",
"fieldtype": "Column Break",
"hidden": 0,
@@ -616,6 +665,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "received_amount",
"fieldtype": "Currency",
@@ -643,6 +693,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "target_exchange_rate",
"fieldtype": "Float",
@@ -669,6 +720,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "base_received_amount",
"fieldtype": "Currency",
@@ -697,6 +749,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "references",
"columns": 0,
"depends_on": "eval:(doc.party && doc.paid_from && doc.paid_to && doc.paid_amount && doc.received_amount)",
"fieldname": "section_break_14",
"fieldtype": "Section Break",
@@ -723,6 +776,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "references",
"fieldtype": "Table",
@@ -750,6 +804,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "section_break_34",
"fieldtype": "Section Break",
@@ -776,6 +831,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.paid_amount && doc.received_amount && doc.references)",
"fieldname": "total_allocated_amount",
"fieldtype": "Currency",
@@ -802,6 +858,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "base_total_allocated_amount",
"fieldtype": "Currency",
@@ -829,6 +886,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "set_exchange_gain_loss",
"fieldtype": "Button",
"hidden": 0,
@@ -854,6 +912,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_36",
"fieldtype": "Column Break",
"hidden": 0,
@@ -878,6 +937,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.paid_amount && doc.received_amount && doc.references)",
"fieldname": "unallocated_amount",
"fieldtype": "Currency",
@@ -904,6 +964,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.paid_amount && doc.received_amount)",
"fieldname": "difference_amount",
"fieldtype": "Currency",
@@ -931,6 +992,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "difference_amount",
"fieldname": "write_off_difference_amount",
"fieldtype": "Button",
@@ -958,6 +1020,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "deductions",
"columns": 0,
"depends_on": "eval:(doc.paid_amount && doc.received_amount)",
"fieldname": "deductions_or_loss_section",
"fieldtype": "Section Break",
@@ -984,6 +1047,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "deductions",
"fieldtype": "Table",
"hidden": 0,
@@ -1010,6 +1074,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transaction_references",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1035,6 +1100,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.paid_from && doc.paid_to)",
"fieldname": "reference_no",
"fieldtype": "Data",
@@ -1061,6 +1127,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1085,6 +1152,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.paid_from && doc.paid_to)",
"fieldname": "reference_date",
"fieldtype": "Date",
@@ -1111,6 +1179,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.docstatus==1",
"fieldname": "clearance_date",
"fieldtype": "Date",
@@ -1138,6 +1207,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "eval:(doc.paid_from && doc.paid_to && doc.paid_amount && doc.received_amount)",
"fieldname": "section_break_12",
"fieldtype": "Section Break",
@@ -1164,6 +1234,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "project",
"fieldtype": "Link",
@@ -1191,6 +1262,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remarks",
"fieldtype": "Small Text",
"hidden": 0,
@@ -1216,6 +1288,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_16",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1240,6 +1313,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -1266,6 +1340,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -1292,6 +1367,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -1317,6 +1393,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 1,
@@ -1349,8 +1426,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-11 08:06:33.121527",
"modified_by": "NuranVerkleij@example.com",
"modified": "2016-09-05 11:06:18.183458",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
"name_case": "",

View File

@@ -73,6 +73,9 @@ class PaymentEntry(AccountsController):
if not self.party:
frappe.throw(_("Party is mandatory"))
self.party_name = frappe.db.get_value(self.party_type, self.party,
self.party_type.lower() + "_name")
if self.party:
if not self.party_balance:

View File

@@ -1,6 +0,0 @@
frappe.listview_settings['Payment Entry'] = {
add_fields: ["payment_type"],
get_indicator: function(doc) {
return [__(doc.payment_type), (doc.docstatus==0 ? 'red' : 'blue'), 'status=' + doc.payment_type]
}
}

View File

@@ -171,7 +171,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Allocated",
"length": 0,
"no_copy": 0,

View File

@@ -340,14 +340,20 @@ frappe.ui.form.on("Purchase Invoice", {
$.each(["warehouse", "rejected_warehouse"], function(i, field) {
frm.set_query(field, "items", function() {
return {
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})
})
frm.set_query("supplier_warehouse", function() {
return {
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})
},

View File

@@ -15,6 +15,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "{supplier_name}",
"fieldname": "title",
"fieldtype": "Data",
@@ -41,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -68,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
@@ -95,6 +98,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "supplier",
"fieldname": "supplier_name",
"fieldtype": "Data",
@@ -122,6 +126,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "bill_no",
"fieldtype": "Data",
@@ -149,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_paid",
"fieldtype": "Check",
"hidden": 0,
@@ -174,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "is_return",
"fieldtype": "Check",
@@ -184,7 +191,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -200,6 +207,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -225,6 +233,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
@@ -252,6 +261,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
@@ -278,6 +288,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bill_date",
"fieldtype": "Date",
"hidden": 0,
@@ -304,6 +315,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -331,6 +343,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -356,6 +369,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_return",
"fieldname": "return_against",
"fieldtype": "Link",
@@ -366,7 +380,7 @@
"in_list_view": 0,
"label": "Return Against Purchase Invoice",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Purchase Invoice",
"permlevel": 0,
"precision": "",
@@ -383,6 +397,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
"hidden": 0,
@@ -408,6 +423,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_address",
"fieldtype": "Link",
"hidden": 0,
@@ -433,6 +449,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
@@ -458,6 +475,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "address_display",
"fieldtype": "Small Text",
@@ -483,6 +501,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -507,6 +526,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_mobile",
"fieldtype": "Small Text",
"hidden": 0,
@@ -531,6 +551,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_email",
"fieldtype": "Small Text",
"hidden": 0,
@@ -555,6 +576,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_address",
"fieldtype": "Column Break",
"hidden": 0,
@@ -579,6 +601,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "shipping_address",
"fieldtype": "Link",
@@ -606,6 +629,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -631,6 +655,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -656,6 +681,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -683,6 +709,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "conversion_rate",
"fieldtype": "Float",
@@ -711,6 +738,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -734,6 +762,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "buying_price_list",
"fieldtype": "Link",
"hidden": 0,
@@ -759,6 +788,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_list_currency",
"fieldtype": "Link",
"hidden": 0,
@@ -784,6 +814,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "plc_conversion_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -809,6 +840,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"hidden": 0,
@@ -833,6 +865,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -859,6 +892,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "update_stock",
"fieldtype": "Check",
@@ -885,6 +919,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items",
"fieldtype": "Table",
"hidden": 0,
@@ -912,6 +947,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_26",
"fieldtype": "Section Break",
"hidden": 0,
@@ -935,6 +971,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -961,6 +998,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "base_net_total",
"fieldtype": "Currency",
@@ -989,6 +1027,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_28",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1012,6 +1051,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1038,6 +1078,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1065,6 +1106,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1091,6 +1133,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"hidden": 0,
@@ -1118,6 +1161,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
@@ -1145,6 +1189,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "other_charges_calculation",
"fieldtype": "HTML",
"hidden": 0,
@@ -1170,6 +1215,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "totals",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1196,6 +1242,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"hidden": 0,
@@ -1223,6 +1270,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"hidden": 0,
@@ -1250,6 +1298,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1277,6 +1326,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_40",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1301,6 +1351,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"hidden": 0,
@@ -1328,6 +1379,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"hidden": 0,
@@ -1355,6 +1407,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1382,6 +1435,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"columns": 0,
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1407,6 +1461,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Grand Total",
"fieldname": "apply_discount_on",
"fieldtype": "Select",
@@ -1434,6 +1489,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1460,6 +1516,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_46",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1484,6 +1541,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "additional_discount_percentage",
"fieldtype": "Float",
"hidden": 0,
@@ -1509,6 +1567,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1535,6 +1594,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1559,6 +1619,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1586,6 +1647,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "base_in_words",
"fieldtype": "Data",
@@ -1613,6 +1675,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break8",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1638,6 +1701,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1665,6 +1729,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_words",
"fieldtype": "Data",
"hidden": 0,
@@ -1691,6 +1756,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_advance",
"fieldtype": "Currency",
"hidden": 0,
@@ -1718,6 +1784,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1746,6 +1813,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "paid_amount",
"columns": 0,
"depends_on": "eval:doc.is_paid===1||(doc.advances && doc.advances.length>0)",
"fieldname": "payments_section",
"fieldtype": "Section Break",
@@ -1772,6 +1840,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "mode_of_payment",
"fieldtype": "Link",
"hidden": 0,
@@ -1798,6 +1867,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cash_bank_account",
"fieldtype": "Link",
"hidden": 0,
@@ -1824,6 +1894,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_br_payments",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1848,6 +1919,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_paid",
"fieldname": "paid_amount",
"fieldtype": "Currency",
@@ -1875,6 +1947,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1902,6 +1975,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "write_off_amount",
"columns": 0,
"depends_on": "grand_total",
"fieldname": "write_off",
"fieldtype": "Section Break",
@@ -1928,6 +2002,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "write_off_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1953,6 +2028,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_write_off_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1979,6 +2055,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_61",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2003,6 +2080,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:flt(doc.write_off_amount)!=0",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -2029,6 +2107,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:flt(doc.write_off_amount)!=0",
"fieldname": "write_off_cost_center",
"fieldtype": "Link",
@@ -2056,6 +2135,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "advances",
"columns": 0,
"fieldname": "advances_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2082,6 +2162,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "get_advances",
"fieldtype": "Button",
"hidden": 0,
@@ -2108,6 +2189,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "advances",
"fieldtype": "Table",
"hidden": 0,
@@ -2136,6 +2218,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "terms",
"columns": 0,
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2161,6 +2244,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"hidden": 0,
@@ -2186,6 +2270,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "terms",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -2210,6 +2295,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2235,6 +2321,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"fieldname": "is_subcontracted",
"fieldtype": "Select",
@@ -2262,6 +2349,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -2290,6 +2378,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
@@ -2316,6 +2405,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2341,6 +2431,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -2367,6 +2458,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -2394,6 +2486,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"hidden": 0,
@@ -2419,6 +2512,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2445,6 +2539,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "credit_to",
"fieldtype": "Link",
@@ -2473,6 +2568,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "party_account_currency",
"fieldtype": "Link",
"hidden": 1,
@@ -2499,6 +2595,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"description": "",
"fieldname": "is_opening",
@@ -2528,6 +2625,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "against_expense_account",
"fieldtype": "Small Text",
"hidden": 1,
@@ -2554,6 +2652,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_63",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2577,6 +2676,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "posting_time",
"fieldtype": "Time",
"hidden": 0,
@@ -2604,6 +2704,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remarks",
"fieldtype": "Small Text",
"hidden": 0,
@@ -2630,6 +2731,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
@@ -2658,6 +2760,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "is_recurring",
"columns": 0,
"depends_on": "eval:doc.docstatus<2",
"fieldname": "recurring_invoice",
"fieldtype": "Section Break",
@@ -2684,6 +2787,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.docstatus<2",
"description": "",
"fieldname": "is_recurring",
@@ -2710,6 +2814,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "Select the period when the invoice will be generated automatically",
"fieldname": "recurring_type",
@@ -2737,6 +2842,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "Start date of current invoice's period",
"fieldname": "from_date",
@@ -2763,6 +2869,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "End date of current invoice's period",
"fieldname": "to_date",
@@ -2789,6 +2896,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
"fieldname": "submit_on_creation",
"fieldtype": "Check",
@@ -2815,6 +2923,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
"description": "",
"fieldname": "notify_by_email",
@@ -2842,6 +2951,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc",
"fieldname": "repeat_on_day_of_month",
@@ -2868,6 +2978,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The date on which recurring invoice will be stop",
"fieldname": "end_date",
@@ -2894,6 +3005,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_82",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2918,6 +3030,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The date on which next invoice will be generated. It is generated on submit.",
"fieldname": "next_date",
@@ -2944,6 +3057,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The unique id for tracking all recurring invoices. It is generated on submit.",
"fieldname": "recurring_id",
@@ -2970,6 +3084,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
"fieldname": "notification_email_address",
@@ -2996,6 +3111,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"fieldname": "recurring_print_format",
"fieldtype": "Link",
@@ -3032,7 +3148,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-08-24 12:50:15.777689",
"modified": "2016-09-23 18:02:45.349273",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -302,6 +302,9 @@ class PurchaseInvoice(BuyingController):
asset.save()
def make_gl_entries(self, repost_future_gle=True):
if not self.grand_total:
return
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))

View File

@@ -191,7 +191,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -380,7 +380,7 @@
"in_list_view": 0,
"label": "Return Against Sales Invoice",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Sales Invoice",
"permlevel": 0,
"precision": "",
@@ -3867,7 +3867,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-08-31 15:47:32.064861",
"modified": "2016-09-23 17:59:42.200474",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -491,6 +491,8 @@ class SalesInvoice(SellingController):
throw(_("Delivery Note {0} is not submitted").format(d.delivery_note))
def make_gl_entries(self, repost_future_gle=True):
if not self.grand_total:
return
gl_entries = self.get_gl_entries()
if gl_entries:

View File

@@ -614,6 +614,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.batch_no = this.item_batch_no[this.child.item_code];
this.child.serial_no = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][0] : '');
this.child.item_tax_rate = this.items[0].taxes;
},
update_paid_amount_status: function(update_paid_amount){
@@ -654,7 +655,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
show_items_in_item_cart: function() {
var me = this;
var $items = this.wrapper.find(".items").empty();
me.frm.doc.net_total = 0.0
$.each(this.frm.doc.items|| [], function(i, d) {
$(frappe.render_template("pos_bill_item", {
item_code: d.item_code,
@@ -775,6 +775,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.update_invoice()
}else{
this.name = $.now();
this.frm.doc.offline_pos_name = this.name;
this.frm.doc.posting_date = frappe.datetime.get_today();
this.frm.doc.posting_time = frappe.datetime.now_time();
invoice_data[this.name] = this.frm.doc

View File

@@ -55,7 +55,6 @@ def notify_status(doc, method=None):
if party.status == 'Open':
# may be open elsewhere, check
# default status
party.status = status
update_status(party)
party.update_modified()

View File

@@ -2,7 +2,7 @@
<div class="page-break">
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
and doc.set("select_print_heading", _("Payment Receipt Note")) -%}{%- endif -%}
{{ add_header(0, 1, doc, letter_head, no_letterhead) }}
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
{%- for label, value in (
(_("Received On"), frappe.utils.formatdate(doc.voucher_date)),

View File

@@ -6,9 +6,9 @@
"docstatus": 0,
"doctype": "Print Format",
"font": "Default",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"Invoice\") }}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
"idx": 0,
"modified": "2016-08-11 07:23:04.530676",
"modified": "2016-09-05 08:28:42.308782",
"modified_by": "Administrator",
"name": "Point of Sale",
"owner": "Administrator",

View File

@@ -1,5 +1,5 @@
<div style="margin-bottom: 7px;" class="text-center">
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
{%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>

View File

@@ -124,6 +124,10 @@ class ReceivablePayableReport(object):
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
# issue 6371-Ageing buckets should not have amounts if due date is not reached
if self.filters.ageing_based_on == "Due Date" and getdate(due_date) > getdate(self.filters.report_date):
row[-1]=row[-2]=row[-3]=row[-4]=0
if self.filters.get(scrub(args.get("party_type"))):
row.append(gle.account_currency)
else:

View File

@@ -13,7 +13,9 @@
height: 37px;
}
</style>
<div style="margin-bottom: 7px;" class="text-center">
{%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.company %}</h3>
<h4 class="text-center">{%= filters.fiscal_year %}</h3>

View File

@@ -1,5 +1,5 @@
<div style="margin-bottom: 7px;" class="text-center">
{%= frappe.boot.letter_heads[filters.letter_head || frappe.defaults.get_default("letter_head")] %}
{%= frappe.boot.letter_heads[filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __("Statement of Account") %}</h2>
<h4 class="text-center">{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ") || "" %} {%= filters.company %}</h4>

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
def execute(filters=None):
if not filters: filters = {}
@@ -21,6 +22,7 @@ def execute(filters=None):
"width": 80
})
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
mode_of_payments = get_mode_of_payments(set([d.parent for d in item_list]))
data = []
for d in item_list:
@@ -32,7 +34,8 @@ def execute(filters=None):
from `tabDelivery Note Item` where docstatus=1 and so_detail=%s""", d.so_detail))
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name,
d.customer_group, d.debit_to, d.mode_of_payment, d.territory, d.project, d.company, d.sales_order,
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
d.territory, d.project, d.company, d.sales_order,
delivery_note, d.income_account, d.cost_center, d.qty, d.base_net_rate, d.base_net_amount]
for tax in tax_accounts:
@@ -52,7 +55,7 @@ def get_columns():
_("Posting Date") + ":Date:80", _("Customer") + ":Link/Customer:120",
_("Customer Name") + "::120", _("Customer Group") + ":Link/Customer Group:120",
_("Receivable Account") + ":Link/Account:120",
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Territory") + ":Link/Territory:80",
_("Mode of Payment") + "::120", _("Territory") + ":Link/Territory:80",
_("Project") + ":Link/Project:80", _("Company") + ":Link/Company:100",
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
_("Income Account") + ":Link/Account:140", _("Cost Center") + ":Link/Cost Center:140",
@@ -68,10 +71,14 @@ def get_conditions(filters):
("customer", " and si.customer = %(customer)s"),
("item_code", " and si_item.item_code = %(item_code)s"),
("from_date", " and si.posting_date>=%(from_date)s"),
("to_date", " and si.posting_date<=%(to_date)s"),
("mode_of_payment", " and ifnull(mode_of_payment, '') = %(mode_of_payment)s")):
("to_date", " and si.posting_date<=%(to_date)s")):
if filters.get(opts[0]):
conditions += opts[1]
if filters.get("mode_of_payment"):
conditions += """ and exists(select name from `tabSales Invoice Payment`
where parent=si.name
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
return conditions
@@ -84,7 +91,7 @@ def get_items(filters):
si_item.item_code, si_item.item_name, si_item.item_group, si_item.sales_order,
si_item.delivery_note, si_item.income_account, si_item.cost_center, si_item.qty,
si_item.base_net_rate, si_item.base_net_amount, si.customer_name,
si.customer_group, si_item.so_detail, si.mode_of_payment
si.customer_group, si_item.so_detail
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
where si.name = si_item.parent and si.docstatus = 1 %s
order by si.posting_date desc, si_item.item_code desc""" % conditions, filters, as_dict=1)

View File

@@ -23,6 +23,7 @@ def execute(filters=None):
invoice_so_dn_map = get_invoice_so_dn_map(invoice_list)
customer_map = get_customer_deatils(invoice_list)
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
mode_of_payments = get_mode_of_payments([inv.name for inv in invoice_list])
data = []
for inv in invoice_list:
@@ -33,7 +34,7 @@ def execute(filters=None):
row = [inv.name, inv.posting_date, inv.customer, inv.customer_name,
customer_map.get(inv.customer, {}).get("customer_group"),
customer_map.get(inv.customer, {}).get("territory"),
inv.debit_to, inv.mode_of_payment, inv.project, inv.remarks,
inv.debit_to, ", ".join(mode_of_payments.get(inv.name, [])), inv.project, inv.remarks,
", ".join(sales_order), ", ".join(delivery_note), company_currency]
# map income values
@@ -68,7 +69,7 @@ def get_columns(invoice_list):
_("Invoice") + ":Link/Sales Invoice:120", _("Posting Date") + ":Date:80",
_("Customer Id") + "::120", _("Customer Name") + "::120",
_("Customer Group") + ":Link/Customer Group:120", _("Territory") + ":Link/Territory:80",
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + ":Link/Mode of Payment:80",
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + "::120",
_("Project") +":Link/Project:80", _("Remarks") + "::150",
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
{
@@ -113,14 +114,17 @@ def get_conditions(filters):
if filters.get("from_date"): conditions += " and posting_date >= %(from_date)s"
if filters.get("to_date"): conditions += " and posting_date <= %(to_date)s"
if filters.get("mode_of_payment"): conditions += " and ifnull(mode_of_payment, '') = %(mode_of_payment)s"
if filters.get("mode_of_payment"):
conditions += """ and exists(select name from `tabSales Invoice Payment`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
return conditions
def get_invoices(filters):
conditions = get_conditions(filters)
return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, remarks,
base_net_total, base_grand_total, base_rounded_total, outstanding_amount, mode_of_payment
base_net_total, base_grand_total, base_rounded_total, outstanding_amount
from `tabSales Invoice`
where docstatus = 1 %s order by posting_date desc, name desc""" %
conditions, filters, as_dict=1)
@@ -188,3 +192,16 @@ def get_customer_deatils(invoice_list):
customer_map.setdefault(cust.name, cust)
return customer_map
def get_mode_of_payments(invoice_list):
mode_of_payments = {}
if invoice_list:
inv_mop = frappe.db.sql("""select parent, mode_of_payment
from `tabSales Invoice Payment` where parent in (%s) group by parent, mode_of_payment""" %
', '.join(['%s']*len(invoice_list)), tuple(invoice_list), as_dict=1)
for d in inv_mop:
mode_of_payments.setdefault(d.parent, []).append(d.mode_of_payment)
return mode_of_payments

View File

@@ -662,7 +662,7 @@ def get_advance_journal_entries(party_type, party, party_account, amount_field,
.format(order_doctype, order_condition))
reference_condition = " and (" + " or ".join(conditions) + ")" if conditions else ""
journal_entries = frappe.db.sql("""
select
"Journal Entry" as reference_type, t1.name as reference_name,
@@ -674,8 +674,7 @@ def get_advance_journal_entries(party_type, party, party_account, amount_field,
t1.name = t2.parent and t2.account = %s
and t2.party_type = %s and t2.party = %s
and t2.is_advance = 'Yes' and t1.docstatus = 1
and {1} > 0
and (ifnull(t2.reference_name, '')='' {2})
and {1} > 0 {2}
order by t1.posting_date""".format(amount_field, dr_or_cr, reference_condition),
[party_account, party_type, party] + order_list, as_dict=1)

View File

@@ -17,7 +17,8 @@ def get_filters_cond(doctype, filters, conditions):
if isinstance(f[1], basestring) and f[1][0] == '!':
flt.append([doctype, f[0], '!=', f[1][1:]])
else:
flt.append([doctype, f[0], '=', f[1]])
value = frappe.db.escape(f[1]) if isinstance(f[1], basestring) else f[1]
flt.append([doctype, f[0], '=', value])
query = DatabaseQuery(doctype)
query.filters = flt

View File

@@ -39,6 +39,7 @@ def validate_filters(filters):
frappe.throw(_("'Based On' and 'Group By' can not be same"))
def get_data(filters, conditions):
data = []
inc, cond= '',''
query_details = conditions["based_on_select"] + conditions["period_wise_select"]
@@ -49,6 +50,9 @@ def get_data(filters, conditions):
if conditions["based_on_select"] in ["t1.project,", "t2.project,"]:
cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL'
if conditions.get('trans') in ['Sales Order', 'Purchase Order']:
cond += "and t1.status != 'Closed'"
year_start_date, year_end_date = frappe.db.get_value("Fiscal Year",
filters.get('fiscal_year'), ["year_start_date", "year_end_date"])
@@ -85,10 +89,10 @@ def get_data(filters, conditions):
#to get distinct value of col specified by group_by in filter
row = frappe.db.sql("""select DISTINCT(%s) from `tab%s` t1, `tab%s Item` t2 %s
where t2.parent = t1.name and t1.company = %s and %s between %s and %s
and t1.docstatus = 1 and %s = %s %s
and t1.docstatus = 1 and %s = %s %s %s
""" %
(sel_col, conditions["trans"], conditions["trans"], conditions["addl_tables"],
"%s", posting_date, "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")),
"%s", posting_date, "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond"), cond),
(filters.get("company"), year_start_date, year_end_date, data1[d][0]), as_list=1)
for i in range(len(row)):
@@ -97,11 +101,11 @@ def get_data(filters, conditions):
#get data for group_by filter
row1 = frappe.db.sql(""" select %s , %s from `tab%s` t1, `tab%s Item` t2 %s
where t2.parent = t1.name and t1.company = %s and %s between %s and %s
and t1.docstatus = 1 and %s = %s and %s = %s %s
and t1.docstatus = 1 and %s = %s and %s = %s %s %s
""" %
(sel_col, conditions["period_wise_select"], conditions["trans"],
conditions["trans"], conditions["addl_tables"], "%s", posting_date, "%s","%s", sel_col,
"%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")),
"%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond"), cond),
(filters.get("company"), year_start_date, year_end_date, row[i][0],
data1[d][0]), as_list=1)

View File

@@ -58,7 +58,7 @@ class MaintenanceSchedule(TransactionBase):
if no_email_sp:
frappe.msgprint(
frappe._("Setting Events to {0}, since the Employee attached to the below Sales Persons does not have a User ID{1}").format(
self.owner, "<br>"+no_email_sp.join("<br>")
self.owner, "<br>" + "<br>".join(no_email_sp)
))
scheduled_date = frappe.db.sql("""select scheduled_date from
@@ -187,14 +187,17 @@ class MaintenanceSchedule(TransactionBase):
if not sr_details:
frappe.throw(_("Serial No {0} not found").format(serial_no))
if sr_details.warranty_expiry_date and sr_details.warranty_expiry_date>=amc_start_date:
throw(_("Serial No {0} is under warranty upto {1}").format(serial_no, sr_details.warranty_expiry_date))
if sr_details.warranty_expiry_date \
and getdate(sr_details.warranty_expiry_date) >= getdate(amc_start_date):
throw(_("Serial No {0} is under warranty upto {1}")
.format(serial_no, sr_details.warranty_expiry_date))
if sr_details.amc_expiry_date and sr_details.amc_expiry_date >= amc_start_date:
throw(_("Serial No {0} is under maintenance contract upto {1}").format(serial_no, sr_details.amc_start_date))
if sr_details.amc_expiry_date and getdate(sr_details.amc_expiry_date) >= getdate(amc_start_date):
throw(_("Serial No {0} is under maintenance contract upto {1}")
.format(serial_no, sr_details.amc_start_date))
if not sr_details.warehouse and sr_details.delivery_date and \
sr_details.delivery_date >= amc_start_date:
getdate(sr_details.delivery_date) >= getdate(amc_start_date):
throw(_("Maintenance start date can not be before delivery date for Serial No {0}")
.format(serial_no))

View File

@@ -174,7 +174,8 @@ erpnext.production_order = {
var company_filter = function(doc) {
return {
filters: {
'company': frm.doc.company
'company': frm.doc.company,
'is_group': 0
}
}
}

View File

@@ -23,17 +23,15 @@ execute:frappe.reload_doc('selling', 'doctype', 'customer') # 2014-01-29
execute:frappe.reload_doc('buying', 'doctype', 'supplier') # 2014-01-29
execute:frappe.reload_doc('accounts', 'doctype', 'asset_category')
execute:frappe.reload_doc('accounts', 'doctype', 'pricing_rule')
execute:frappe.reload_doctype('Item')
erpnext.patches.v4_0.map_charge_to_taxes_and_charges
execute:frappe.reload_doc('support', 'doctype', 'newsletter') # 2014-01-31
execute:frappe.reload_doc('hr', 'doctype', 'employee') # 2014-02-03
execute:frappe.db.sql("update tabPage set module='Core' where name='Setup'")
erpnext.patches.v5_2.change_item_selects_to_checks
execute:frappe.reload_doctype('Item')
erpnext.patches.v4_0.fields_to_be_renamed
erpnext.patches.v4_0.rename_sitemap_to_route
erpnext.patches.v7_0.re_route #2016-06-27
erpnext.patches.v4_0.fix_contact_address
erpnext.patches.v4_0.customer_discount_to_pricing_rule
execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
@@ -173,6 +171,7 @@ execute:frappe.db.set_value("Backup Manager", None, "send_backups_to_dropbox", 1
execute:frappe.db.sql_list("delete from `tabDocPerm` where parent='Issue' and modified_by='Administrator' and role='Guest'")
erpnext.patches.v5_0.update_item_and_description_again
erpnext.patches.v6_0.multi_currency
erpnext.patches.v7_0.create_budget_record
erpnext.patches.v5_0.repost_gle_for_jv_with_multiple_party
erpnext.patches.v5_0.portal_fixes
erpnext.patches.v5_0.reset_values_in_tools # 02-05-2016
@@ -235,7 +234,6 @@ execute:frappe.delete_doc_if_exists("DocType", "Shopping Cart Taxes and Charges
erpnext.patches.v6_4.set_user_in_contact
erpnext.patches.v6_4.make_image_thumbnail #2015-10-20
erpnext.patches.v6_5.show_in_website_for_template_item
erpnext.patches.v7_0.create_budget_record
erpnext.patches.v6_4.fix_expense_included_in_valuation
execute:frappe.delete_doc_if_exists("Report", "Item-wise Last Purchase Rate")
erpnext.patches.v6_6.fix_website_image
@@ -266,7 +264,7 @@ erpnext.patches.v6_20x.remove_fiscal_year_from_holiday_list
erpnext.patches.v6_24.map_customer_address_to_shipping_address_on_po
erpnext.patches.v6_27.fix_recurring_order_status
erpnext.patches.v6_20x.update_product_bundle_description
erpnext.patches.v7_0.update_party_status
erpnext.patches.v7_0.update_party_status #2016-09-22
erpnext.patches.v7_0.update_item_projected
erpnext.patches.v7_0.remove_features_setup
erpnext.patches.v7_0.update_home_page
@@ -313,4 +311,8 @@ erpnext.patches.v7_0.set_portal_settings
erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice
erpnext.patches.v7_0.fix_duplicate_icons
erpnext.patches.v7_0.repost_gle_for_pos_sales_return
erpnext.patches.v7_0.update_missing_employee_in_timesheet
erpnext.patches.v7_0.update_missing_employee_in_timesheet
erpnext.patches.v7_0.update_status_for_timesheet
erpnext.patches.v7_0.set_party_name_in_payment_entry
execute:frappe.db.sql("update `tabTimesheet` ts, `tabEmployee` emp set ts.employee_name = emp.employee_name where emp.name = ts.employee and ts.employee_name is null and ts.employee is not null")
erpnext.patches.v7_0.update_mode_of_payment_type

View File

@@ -4,8 +4,10 @@ from erpnext.manufacturing.doctype.production_order.production_order \
def execute():
frappe.reload_doc('projects', 'doctype', 'timesheet')
if not frappe.db.table_exists("Time Log"):
return
for data in frappe.get_all('Time Log', fields=["*"], filters = [["docstatus", "<", "2"]]):
for data in frappe.db.sql("select * from `tabTime Log` where docstatus < 2", as_dict=1):
if data.task:
company = frappe.db.get_value("Task", data.task, "company")
elif data.production_order:
@@ -19,13 +21,15 @@ def execute():
time_sheet.employee = data.employee
time_sheet.note = data.note
time_sheet.company = company
time_sheet.set_status()
time_sheet.set_dates()
time_sheet.update_cost()
time_sheet.calculate_total_amounts()
time_sheet.flags.ignore_validate = True
time_sheet.flags.ignore_links = True
time_sheet.save(ignore_permissions=True)
# To ignore validate_mandatory_fields function
if data.docstatus == 1:
time_sheet.db_set("docstatus", 1)
@@ -33,7 +37,6 @@ def execute():
d.db_set("docstatus", 1)
time_sheet.update_production_order(time_sheet.name)
time_sheet.update_task_and_project()
def get_timelog_data(data):
return {

View File

@@ -17,10 +17,10 @@ def execute():
add_timesheet_detail(time_sheet, args)
time_sheet.docstatus = tlb.docstatus
time_sheet.flags.ignore_links = True
time_sheet.save(ignore_permissions=True)
def get_timesheet_data(data):
time_log = frappe.get_all('Time Log', fields=["*"],
filters = {'name': data.time_log})[0]
return get_timelog_data(time_log)
time_log = frappe.get_all('Time Log', fields=["*"], filters = {'name': data.time_log})
if time_log:
return get_timelog_data(time_log[0])

View File

@@ -29,10 +29,11 @@ def execute():
make_warehouse_nestedset(company)
else:
sle_against_companies = frappe.db.sql_list("""select distinct company from `tabStock Ledger Entry`""")
company = frappe.defaults.get_defaults().company
if len(sle_against_companies) == 1:
set_company_to_warehouse(company)
company = frappe.db.get_value("Company", sle_against_companies[0],
fieldname=["name", "abbr"], as_dict=1)
set_company_to_warehouse(company.name)
make_warehouse_nestedset(company)
elif len(sle_against_companies) > 1:

View File

@@ -4,17 +4,35 @@ import frappe
def execute():
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_timesheet')
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment')
for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount from
`tabSales Invoice` where is_pos = 1 and docstatus < 2 and cash_bank_account is not null""", as_dict=1):
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
count = 0
for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount, company
from `tabSales Invoice` si
where si.is_pos = 1 and si.docstatus < 2
and si.cash_bank_account is not null and si.cash_bank_account != ''
and not exists(select name from `tabSales Invoice Payment` where parent=si.name)""", as_dict=1):
if not data.mode_of_payment and not frappe.db.exists("Mode of Payment", "Cash"):
mop = frappe.new_doc("Mode of Payment")
mop.mode_of_payment = "Cash"
mop.type = "Cash"
mop.save()
si_doc = frappe.get_doc('Sales Invoice', data.name)
si_doc.append('payments', {
row = si_doc.append('payments', {
'mode_of_payment': data.mode_of_payment or 'Cash',
'account': data.cash_bank_account,
'type': frappe.db.get_value('Mode of Payment', data.mode_of_payment, 'type') or 'Cash',
'amount': data.paid_amount
})
row.db_update()
si_doc.set_paid_amount()
si_doc.flags.ignore_validate_update_after_submit = True
si_doc.save()
si_doc.db_set("paid_amount", si_doc.paid_amount, update_modified = False)
si_doc.db_set("base_paid_amount", si_doc.base_paid_amount, update_modified = False)
count +=1
if count % 200 == 0:
frappe.db.commit()

View File

@@ -5,10 +5,12 @@ def execute():
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment')
for time_sheet in frappe.db.sql(""" select sales_invoice, name, total_billing_amount from `tabTimesheet`
where sales_invoice is not null and docstatus < 2""", as_dict=True):
if not frappe.db.exists('Sales Invoice', time_sheet.sales_invoice):
continue
si_doc = frappe.get_doc('Sales Invoice', time_sheet.sales_invoice)
ts = si_doc.append('timesheets',{})
ts.time_sheet = time_sheet.name
ts.billing_amount = time_sheet.total_billing_amount
si_doc.update_time_sheet(time_sheet.sales_invoice)
si_doc.flags.ignore_validate_update_after_submit = True
si_doc.save()
ts.db_update()
si_doc.calculate_billing_amount_from_timesheet()
si_doc.db_set("total_billing_amount", si_doc.total_billing_amount, update_modified = False)

View File

@@ -1,9 +1,10 @@
import frappe
def execute():
for doctype in ['Time Log Batch', 'Time Log Batch Detail', 'Time Log']:
frappe.delete_doc('DocType', doctype)
if frappe.db.table_exists("Time Log"):
frappe.db.sql("""delete from `tabDocType`
where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""")
report = "Daily Time Log Summary"
if frappe.db.exists("Report", report):
frappe.delete_doc('Report', report)

View File

@@ -7,6 +7,8 @@ def execute():
frappe.reload_doctype('Stock Settings')
stock_settings = frappe.get_doc('Stock Settings', 'Stock Settings')
stock_settings.show_barcode_field = cint(frappe.db.get_value("Features Setup", None, "fs_item_barcode"))
if not frappe.db.exists("UOM", stock_settings.stock_uom):
stock_settings.stock_uom = None
stock_settings.save()
create_compact_item_print_custom_field()

View File

@@ -7,6 +7,7 @@ from frappe.utils import cint, flt
def execute():
frappe.reload_doctype("Sales Invoice")
frappe.reload_doctype("Sales Invoice Item")
for si in frappe.get_all("Sales Invoice", fields = ["name"],
filters={"docstatus": 1, "is_pos": 1, "is_return": 1}):

View File

@@ -0,0 +1,20 @@
# 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
def execute():
customers = frappe._dict(frappe.db.sql("select name, customer_name from tabCustomer"))
suppliers = frappe._dict(frappe.db.sql("select name, supplier_name from tabSupplier"))
frappe.reload_doc('accounts', 'doctype', 'payment_entry')
pe_list = frappe.db.sql("""select name, party_type, party from `tabPayment Entry`
where party is not null and party != ''""", as_dict=1)
for pe in pe_list:
party_name = customers.get(pe.party) if pe.party_type=="Customer" else suppliers.get(pe.party)
frappe.db.set_value("Payment Entry", pe.name, "party_name", party_name, update_modified=False)

View File

@@ -9,10 +9,12 @@ def execute():
return
for expense_claim_type in frappe.get_all("Expense Claim Type", fields=["name", "default_account"]):
if expense_claim_type.default_account:
if expense_claim_type.default_account \
and frappe.db.exists("Account", expense_claim_type.default_account):
doc = frappe.get_doc("Expense Claim Type", expense_claim_type.name)
doc.append("accounts", {
"company": frappe.db.get_value("Account", expense_claim_type.default_account, "company"),
"default_account": expense_claim_type.default_account,
})
doc.flags.ignore_mandatory = True
doc.save(ignore_permissions=True)

View File

@@ -13,7 +13,7 @@ def execute():
header = frappe.db.get_value('Web Page', website_settings.home_page, 'header')
if header and header.startswith("<div class='hero text-center'>"):
homepage = frappe.get_doc('Homepage', 'Homepage')
homepage.company = erpnext.get_default_company()
homepage.company = erpnext.get_default_company() or frappe.get_all("Company")[0].name
if '<h1>' in header:
homepage.tag_line = header.split('<h1>')[1].split('</h1>')[0] or 'Default Website'
else:

View File

@@ -2,18 +2,19 @@ from __future__ import unicode_literals
import frappe
def execute():
timesheet = frappe.db.sql("""select tl.employee as employee, ts.name as name,
tl.modified as modified, tl.modified_by as modified_by, tl.creation as creation, tl.owner as owner
from
`tabTimesheet` ts, `tabTimesheet Detail` tsd, `tabTime Log` tl
where
tsd.parent = ts.name and tl.from_time = tsd.from_time and tl.to_time = tsd.to_time
and tl.hours = tsd.hours and tl.billing_rate = tsd.billing_rate and tsd.idx=1
and tl.docstatus < 2 and (ts.employee = '' or ts.employee is null)""", as_dict=1)
if frappe.db.table_exists("Time Log") and "employee" in frappe.db.get_table_columns("Time Log"):
timesheet = frappe.db.sql("""select tl.employee as employee, ts.name as name,
tl.modified as modified, tl.modified_by as modified_by, tl.creation as creation, tl.owner as owner
from
`tabTimesheet` ts, `tabTimesheet Detail` tsd, `tabTime Log` tl
where
tsd.parent = ts.name and tl.from_time = tsd.from_time and tl.to_time = tsd.to_time
and tl.hours = tsd.hours and tl.billing_rate = tsd.billing_rate and tsd.idx=1
and tl.docstatus < 2 and (ts.employee = '' or ts.employee is null)""", as_dict=1)
for data in timesheet:
ts_doc = frappe.get_doc('Timesheet', data.name)
if len(ts_doc.time_logs) == 1:
frappe.db.sql(""" update `tabTimesheet` set creation = %(creation)s,
owner = %(owner)s, modified = %(modified)s, modified_by = %(modified_by)s,
employee = %(employee)s where name = %(name)s""", data)
for data in timesheet:
ts_doc = frappe.get_doc('Timesheet', data.name)
if len(ts_doc.time_logs) == 1:
frappe.db.sql(""" update `tabTimesheet` set creation = %(creation)s,
owner = %(owner)s, modified = %(modified)s, modified_by = %(modified_by)s,
employee = %(employee)s where name = %(name)s""", data)

View File

@@ -0,0 +1,29 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
frappe.db.sql(""" update `tabMode of Payment` set type = 'Cash' where (type is null or type = '') and name = 'Cash'""")
for data in frappe.db.sql("""select name from `tabSales Invoice` where is_pos=1 and docstatus<2 and
(ifnull(paid_amount, 0) - ifnull(change_amount, 0)) > ifnull(grand_total, 0) and modified > '2016-05-01'""", as_dict=1):
if data.name:
si_doc = frappe.get_doc("Sales Invoice", data.name)
remove_payment = []
mode_of_payment = [d.mode_of_payment for d in si_doc.payments if flt(d.amount) > 0]
if mode_of_payment != set(mode_of_payment):
for payment_data in si_doc.payments:
if payment_data.idx != 1 and payment_data.amount == si_doc.grand_total:
remove_payment.append(payment_data)
frappe.db.sql(""" delete from `tabSales Invoice Payment`
where name = %(name)s""", {'name': payment_data.name})
if len(remove_payment) > 0:
for d in remove_payment:
si_doc.remove(d)
si_doc.set_paid_amount()
si_doc.db_set("paid_amount", si_doc.paid_amount, update_modified = False)
si_doc.db_set("base_paid_amount", si_doc.base_paid_amount, update_modified = False)

View File

@@ -0,0 +1,11 @@
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""update
`tabTimesheet` as ts,
(
select min(from_time)as from_time, max(to_time) as to_time, parent from `tabTimesheet Detail` group by parent
) as tsd
set ts.status = 'Submitted', ts.start_date = tsd.from_time, ts.end_date = tsd.to_time
where tsd.parent = ts.name and ts.status = 'Draft' and ts.docstatus =1""")

View File

@@ -8,6 +8,7 @@ from frappe import _
import json
from datetime import timedelta
from erpnext.controllers.queries import get_match_cond
from frappe.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, get_datetime_str
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
@@ -20,12 +21,17 @@ class OverProductionLoggedError(frappe.ValidationError): pass
class Timesheet(Document):
def validate(self):
self.set_employee_name()
self.set_status()
self.validate_dates()
self.validate_time_logs()
self.update_cost()
self.calculate_total_amounts()
def set_employee_name(self):
if self.employee and not self.employee_name:
self.employee_name = frappe.db.get_value('Employee', self.employee, 'employee_name')
def calculate_total_amounts(self):
self.total_hours = 0.0
self.total_billing_amount = 0.0
@@ -305,7 +311,8 @@ def get_events(start, end, filters=None):
return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.parent as parent,
from_time, hours, activity_type, project, to_time from `tabTimesheet Detail`,
`tabTimesheet` where `tabTimesheet Detail`.parent = `tabTimesheet`.name and
(from_time between %(start)s and %(end)s) {conditions}""".format(conditions=conditions),
(from_time between %(start)s and %(end)s) {conditions}
{match_cond}""".format(conditions=conditions, match_cond = get_match_cond('Timesheet')),
{
"start": start,
"end": end

View File

@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.reportview import build_match_conditions
def execute(filters=None):
if not filters:
@@ -12,23 +13,36 @@ def execute(filters=None):
filters["from_time"] = "00:00:00"
filters["to_time"] = "24:00:00"
columns = [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("From Datetime") + "::140",
_("To Datetime") + "::140", _("Hours") + "::70", _("Activity Type") + "::120", _("Task") + ":Link/Task:150",
_("Project") + ":Link/Project:120", _("Status") + "::70"]
conditions = "ts.docstatus = 1"
if filters.get("from_date"):
conditions += " and tsd.from_time >= timestamp(%(from_date)s, %(from_time)s)"
if filters.get("to_date"):
conditions += " and tsd.to_time <= timestamp(%(to_date)s, %(to_time)s)"
columns = get_column()
conditions = get_conditions(filters)
data = get_data(conditions, filters)
return columns, data
def get_column():
return [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("Employee Name") + "::150",
_("From Datetime") + "::140", _("To Datetime") + "::140", _("Hours") + "::70",
_("Activity Type") + "::120", _("Task") + ":Link/Task:150",
_("Project") + ":Link/Project:120", _("Status") + "::70"]
def get_data(conditions, filters):
time_sheet = frappe.db.sql(""" select ts.name, ts.employee, tsd.from_time, tsd.to_time, tsd.hours,
tsd.activity_type, tsd.task, tsd.project, ts.status from `tabTimesheet Detail` tsd,
`tabTimesheet` ts where ts.name = tsd.parent and %s order by ts.name"""%(conditions), filters, as_list=1)
time_sheet = frappe.db.sql(""" select `tabTimesheet`.name, `tabTimesheet`.employee, `tabTimesheet`.employee_name,
`tabTimesheet Detail`.from_time, `tabTimesheet Detail`.to_time, `tabTimesheet Detail`.hours,
`tabTimesheet Detail`.activity_type, `tabTimesheet Detail`.task, `tabTimesheet Detail`.project,
`tabTimesheet`.status from `tabTimesheet Detail`, `tabTimesheet` where
`tabTimesheet Detail`.parent = `tabTimesheet`.name and %s order by `tabTimesheet`.name"""%(conditions), filters, as_list=1)
return time_sheet
def get_conditions(filters):
conditions = "`tabTimesheet`.docstatus = 1"
if filters.get("from_date"):
conditions += " and `tabTimesheet Detail`.from_time >= timestamp(%(from_date)s, %(from_time)s)"
if filters.get("to_date"):
conditions += " and `tabTimesheet Detail`.to_time <= timestamp(%(to_date)s, %(to_time)s)"
match_conditions = build_match_conditions("Timesheet")
if match_conditions:
conditions += " and %s" % match_conditions
return conditions

View File

@@ -678,6 +678,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
me._set_values_for_item_list(r.message);
if(item) me.set_gross_profit(item);
if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on")
}
}
});

View File

@@ -553,6 +553,9 @@ def get_events(start, end, filters=None):
def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=None):
def set_missing_values(source, target):
target.supplier = for_supplier
target.apply_discount_on = ""
target.additional_discount_percentage = 0.0
target.discount_amount = 0.0
default_price_list = frappe.get_value("Supplier", for_supplier, "default_price_list")
if default_price_list:

View File

@@ -20,7 +20,13 @@ frappe.ui.form.on("Item Group", {
frm.trigger("set_root_readonly");
frm.add_custom_button(__("Item Group Tree"), function() {
frappe.set_route("Tree", "Item Group");
}, "icon-sitemap");
});
if(!frm.is_new()) {
frm.add_custom_button(__("Items"), function() {
frappe.set_route("List", "Item", {"item_group": frm.doc.name});
});
}
},
set_root_readonly: function(frm) {

View File

@@ -60,13 +60,15 @@ class ItemGroup(NestedSet, WebsiteGenerator):
def get_context(self, context):
context.show_search=True
context.page_length = 6
context.search_link = '/product_search'
start = int(frappe.form_dict.start or 0)
if start < 0:
start = 0
context.update({
"items": get_product_list_for_group(product_group = self.name, start=start, limit=24, search=frappe.form_dict.get("search")),
"items": get_product_list_for_group(product_group = self.name, start=start,
limit=context.page_length, search=frappe.form_dict.get("search")),
"parent_groups": get_parent_item_groups(self.name),
"title": self.name,
"products_as_list": cint(frappe.db.get_single_value('Website Settings', 'products_as_list'))

View File

@@ -24,7 +24,7 @@ class NamingSeries(Document):
try:
options = self.get_options(d)
except frappe.DoesNotExistError:
frappe.pass_does_not_exist_error()
frappe.msgprint('Unable to find DocType {0}'.format(d))
continue
if options:

View File

@@ -1,7 +1,7 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
"allow_rename": 1,
"autoname": "field:uom_name",
"beta": 0,
"creation": "2013-01-10 16:34:24",
@@ -15,6 +15,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "uom_name",
"fieldtype": "Data",
"hidden": 0,
@@ -41,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Check this to disallow fractions. (for Nos)",
"fieldname": "must_be_whole_number",
"fieldtype": "Check",
@@ -74,7 +76,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-25 05:24:25.434534",
"modified": "2016-09-23 17:58:21.574996",
"modified_by": "Administrator",
"module": "Setup",
"name": "UOM",
@@ -144,5 +146,6 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
}

View File

@@ -63,7 +63,8 @@ def get_domain(domain):
'Education': {
'desktop_icons': ['Student', 'Program', 'Course', 'Student Group', 'Instructor',
'Fees', 'ToDo', 'Schools'],
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Website Manager'],
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Item Manager',
'Website Manager', 'HR User', 'HR Manager', 'Purchase User', 'Purchase Manager'],
'allow_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
}

View File

@@ -22,12 +22,21 @@ def get_notification_config():
"docstatus": ("<", 2)
},
"Journal Entry": {"docstatus": 0},
"Sales Invoice": { "outstanding_amount": (">", 0), "docstatus": ("<", 2) },
"Purchase Invoice": {"docstatus": 0},
"Sales Invoice": {
"outstanding_amount": (">", 0),
"docstatus": ("<", 2)
},
"Purchase Invoice": {
"outstanding_amount": (">", 0),
"docstatus": ("<", 2)
},
"Leave Application": {"status": "Open"},
"Expense Claim": {"approval_status": "Draft"},
"Job Applicant": {"status": "Open"},
"Delivery Note": {"docstatus": 0},
"Delivery Note": {
"status": ("not in", ("Completed", "Closed")),
"docstatus": ("<", 2)
},
"Stock Entry": {"docstatus": 0},
"Material Request": {
"docstatus": ("<", 2),
@@ -40,7 +49,10 @@ def get_notification_config():
"status": ("not in", ("Completed", "Closed")),
"docstatus": ("<", 2)
},
"Purchase Receipt": {"docstatus": 0},
"Purchase Receipt": {
"status": ("not in", ("Completed", "Closed")),
"docstatus": ("<", 2)
},
"Production Order": { "status": ("in", ("Draft", "Not Started", "In Process")) },
"BOM": {"docstatus": 0},
"Timesheet": {"status": "Draft"}

View File

@@ -3,16 +3,19 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 0,
"creation": "2013-05-24 19:29:09",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "delivery_to_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -38,6 +41,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -64,6 +68,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "{customer_name}",
"fieldname": "title",
"fieldtype": "Data",
@@ -90,6 +95,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -117,6 +123,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
@@ -144,6 +151,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "customer",
"fieldname": "customer_name",
"fieldtype": "Data",
@@ -169,6 +177,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -193,6 +202,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -222,6 +232,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "company",
"fieldtype": "Link",
@@ -252,6 +263,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
@@ -281,6 +293,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "po_no",
"fieldtype": "Data",
"hidden": 0,
@@ -309,6 +322,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.po_no",
"fieldname": "po_date",
"fieldtype": "Date",
@@ -338,6 +352,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_return",
"fieldtype": "Check",
"hidden": 0,
@@ -347,7 +362,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -363,6 +378,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_return",
"fieldname": "return_against",
"fieldtype": "Link",
@@ -373,7 +389,7 @@
"in_list_view": 0,
"label": "Return Against Delivery Note",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Delivery Note",
"permlevel": 0,
"precision": "",
@@ -390,6 +406,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"depends_on": "customer",
"fieldname": "contact_info",
"fieldtype": "Section Break",
@@ -416,6 +433,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address_name",
"fieldtype": "Link",
"hidden": 0,
@@ -441,6 +459,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address",
"fieldtype": "Small Text",
"hidden": 0,
@@ -465,6 +484,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
@@ -490,6 +510,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -514,6 +535,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_mobile",
"fieldtype": "Small Text",
"hidden": 1,
@@ -538,6 +560,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_email",
"fieldtype": "Data",
"hidden": 1,
@@ -563,6 +586,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break21",
"fieldtype": "Column Break",
"hidden": 0,
@@ -588,6 +612,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "customer",
"fieldname": "customer_address",
"fieldtype": "Link",
@@ -614,6 +639,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "address_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -638,6 +664,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "customer_group",
"fieldtype": "Link",
@@ -664,6 +691,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
@@ -690,6 +718,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -715,6 +744,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -742,6 +772,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Rate at which customer's currency is converted to company's base currency",
"fieldname": "conversion_rate",
"fieldtype": "Float",
@@ -770,6 +801,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -793,6 +825,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "selling_price_list",
"fieldtype": "Link",
"hidden": 0,
@@ -820,6 +853,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_list_currency",
"fieldtype": "Link",
"hidden": 0,
@@ -845,6 +879,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Rate at which Price list currency is converted to company's base currency",
"fieldname": "plc_conversion_rate",
"fieldtype": "Float",
@@ -871,6 +906,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"hidden": 0,
@@ -895,6 +931,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -921,6 +958,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items",
"fieldtype": "Table",
"hidden": 0,
@@ -949,6 +987,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "packed_items",
"columns": 0,
"fieldname": "packing_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -975,6 +1014,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "packed_items",
"fieldtype": "Table",
"hidden": 0,
@@ -1002,6 +1042,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "product_bundle_help",
"fieldtype": "HTML",
"hidden": 0,
@@ -1026,6 +1067,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_31",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1049,6 +1091,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1075,6 +1118,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1104,6 +1148,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_33",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1127,6 +1172,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1153,6 +1199,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1178,6 +1225,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1204,6 +1252,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "If you have created a standard template in Sales Taxes and Charges Template, select one and click on the button below.",
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
@@ -1232,6 +1281,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_39",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1255,6 +1305,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_rule",
"fieldtype": "Link",
"hidden": 0,
@@ -1281,6 +1332,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_41",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1304,6 +1356,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
@@ -1331,6 +1384,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "other_charges_calculation",
"fieldtype": "HTML",
"hidden": 0,
@@ -1356,6 +1410,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1379,6 +1434,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1408,6 +1464,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_47",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1432,6 +1489,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1458,6 +1516,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"columns": 0,
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1483,6 +1542,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Grand Total",
"fieldname": "apply_discount_on",
"fieldtype": "Select",
@@ -1510,6 +1570,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1536,6 +1597,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_51",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1559,6 +1621,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "additional_discount_percentage",
"fieldtype": "Float",
"hidden": 0,
@@ -1584,6 +1647,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1609,6 +1673,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "totals",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1635,6 +1700,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1664,6 +1730,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_rounded_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1693,6 +1760,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "In Words will be visible once you save the Delivery Note.",
"fieldname": "base_in_words",
"fieldtype": "Data",
@@ -1722,6 +1790,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1746,6 +1815,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1775,6 +1845,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1804,6 +1875,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "In Words (Export) will be visible once you save the Delivery Note.",
"fieldname": "in_words",
"fieldtype": "Data",
@@ -1834,6 +1906,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "terms",
"columns": 0,
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1860,6 +1933,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"hidden": 0,
@@ -1887,6 +1961,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "terms",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -1914,6 +1989,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "transporter_name",
"columns": 0,
"fieldname": "transporter_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1939,6 +2015,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transporter_name",
"fieldtype": "Data",
"hidden": 0,
@@ -1967,6 +2044,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break34",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1992,6 +2070,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "lr_no",
"fieldtype": "Data",
@@ -2021,6 +2100,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"description": "",
"fieldname": "lr_date",
@@ -2051,6 +2131,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2077,6 +2158,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Track this Delivery Note against any Project",
"fieldname": "project",
"fieldtype": "Link",
@@ -2105,6 +2187,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.source == 'Campaign'",
"fieldname": "campaign",
"fieldtype": "Link",
@@ -2133,6 +2216,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "source",
"fieldtype": "Select",
"hidden": 0,
@@ -2160,6 +2244,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2186,6 +2271,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Time at which items were delivered from warehouse",
"fieldname": "posting_time",
"fieldtype": "Time",
@@ -2215,6 +2301,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "per_billed",
"fieldtype": "Percent",
"hidden": 0,
@@ -2240,6 +2327,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "printing_details",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2265,6 +2353,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -2292,6 +2381,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -2319,6 +2409,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"hidden": 0,
@@ -2344,6 +2435,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_88",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2368,6 +2460,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "print_without_amount",
"fieldtype": "Check",
"hidden": 0,
@@ -2394,6 +2487,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_break_83",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2418,6 +2512,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -2448,6 +2543,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.__islocal",
"description": "% of materials delivered against this Delivery Note",
"fieldname": "per_installed",
@@ -2476,6 +2572,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "installation_status",
"fieldtype": "Select",
"hidden": 1,
@@ -2500,6 +2597,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_89",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2523,6 +2621,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Required only for sample item.",
"fieldname": "to_warehouse",
"fieldtype": "Link",
@@ -2551,6 +2650,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "excise_page",
"fieldtype": "Data",
"hidden": 1,
@@ -2577,6 +2677,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "instructions",
"fieldtype": "Text",
"hidden": 0,
@@ -2604,6 +2705,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "total_commission",
"columns": 0,
"fieldname": "sales_team_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2630,6 +2732,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sales_partner",
"fieldtype": "Link",
"hidden": 0,
@@ -2659,6 +2762,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break7",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2684,6 +2788,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "commission_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -2712,6 +2817,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_commission",
"fieldtype": "Currency",
"hidden": 0,
@@ -2740,6 +2846,7 @@
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "sales_team",
"columns": 0,
"fieldname": "section_break1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2764,6 +2871,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sales_team",
"fieldtype": "Table",
"hidden": 0,
@@ -2792,6 +2900,7 @@
"hide_toolbar": 0,
"icon": "icon-truck",
"idx": 146,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2799,7 +2908,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-04-14 12:53:48.081945",
"modified": "2016-09-23 18:01:54.003673",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
@@ -2906,6 +3015,7 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 1,
"search_fields": "status,customer,customer_name, territory,base_grand_total",
@@ -2914,4 +3024,4 @@
"timeline_field": "customer",
"title_field": "title",
"track_seen": 0
}
}

View File

@@ -455,16 +455,18 @@ class Item(WebsiteGenerator):
def cant_change(self):
if not self.get("__islocal"):
vals = frappe.db.get_value("Item", self.name, ["has_serial_no", "is_stock_item",
"valuation_method", "has_batch_no", "is_fixed_asset"], as_dict=True)
to_check = ("has_serial_no", "is_stock_item",
"valuation_method", "has_batch_no", "is_fixed_asset")
if vals and ((self.is_stock_item != vals.is_stock_item) or
vals.has_serial_no != self.has_serial_no or
vals.has_batch_no != self.has_batch_no or
cstr(vals.valuation_method) != cstr(self.valuation_method)):
if self.check_if_linked_document_exists():
frappe.throw(_("As there are existing transactions for this item, \
you can not change the values of 'Has Serial No', 'Has Batch No', 'Is Stock Item' and 'Valuation Method'"))
vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True)
if vals:
for key in to_check:
if self.get(key) != vals.get(key):
if not self.check_if_linked_document_exists():
break # no linked document, allowed
else:
frappe.throw(_("As there are existing transactions for this item, you can not change the value of {0}").format(frappe.bold(self.meta.get_label(key))))
if vals and not self.is_fixed_asset and self.is_fixed_asset != vals.is_fixed_asset:
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)

View File

@@ -15,9 +15,9 @@ from erpnext.controllers.buying_controller import BuyingController
from erpnext.manufacturing.doctype.production_order.production_order import get_item_details
# form_grid_templates = {
# "items": "templates/form_grid/material_request_grid.html"
# }
form_grid_templates = {
"items": "templates/form_grid/material_request_grid.html"
}
class MaterialRequest(BuyingController):
def get_feed(self):

View File

@@ -25,14 +25,20 @@ frappe.ui.form.on("Purchase Receipt", {
$.each(["warehouse", "rejected_warehouse"], function(i, field) {
frm.set_query(field, "items", function() {
return {
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})
})
frm.set_query("supplier_warehouse", function() {
return {
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})
}

View File

@@ -9,11 +9,13 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -39,6 +41,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -65,6 +68,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "{supplier_name}",
"fieldname": "title",
"fieldtype": "Data",
@@ -91,6 +95,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"fieldname": "naming_series",
"fieldtype": "Select",
@@ -119,6 +124,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
@@ -148,6 +154,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "supplier",
"fieldname": "supplier_name",
"fieldtype": "Data",
@@ -173,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -199,6 +207,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
@@ -228,6 +237,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Time at which materials were received",
"fieldname": "posting_time",
"fieldtype": "Time",
@@ -257,6 +267,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "company",
"fieldtype": "Link",
@@ -287,6 +298,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_return",
"fieldtype": "Check",
"hidden": 0,
@@ -296,7 +308,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -312,6 +324,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_return",
"fieldname": "return_against",
"fieldtype": "Link",
@@ -322,7 +335,7 @@
"in_list_view": 0,
"label": "Return Against Purchase Receipt",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Purchase Receipt",
"permlevel": 0,
"precision": "",
@@ -339,6 +352,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
"hidden": 0,
@@ -364,6 +378,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_address",
"fieldtype": "Link",
"hidden": 0,
@@ -389,6 +404,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
@@ -414,6 +430,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "address_display",
"fieldtype": "Small Text",
@@ -439,6 +456,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -463,6 +481,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_mobile",
"fieldtype": "Small Text",
"hidden": 0,
@@ -487,6 +506,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_email",
"fieldtype": "Small Text",
"hidden": 0,
@@ -511,6 +531,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_address",
"fieldtype": "Column Break",
"hidden": 0,
@@ -535,6 +556,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "shipping_address",
"fieldtype": "Link",
@@ -562,6 +584,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -587,6 +610,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -612,6 +636,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -639,6 +664,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Rate at which supplier's currency is converted to company's base currency",
"fieldname": "conversion_rate",
"fieldtype": "Float",
@@ -667,6 +693,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -693,6 +720,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "buying_price_list",
"fieldtype": "Link",
"hidden": 0,
@@ -718,6 +746,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "buying_price_list",
"fieldname": "price_list_currency",
"fieldtype": "Link",
@@ -744,6 +773,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "buying_price_list",
"fieldname": "plc_conversion_rate",
"fieldtype": "Float",
@@ -770,6 +800,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"hidden": 0,
@@ -794,6 +825,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -820,6 +852,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items",
"fieldtype": "Table",
"hidden": 0,
@@ -847,6 +880,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "get_current_stock",
"fieldtype": "Button",
"hidden": 0,
@@ -873,6 +907,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break0",
"fieldtype": "Section Break",
"hidden": 0,
@@ -897,6 +932,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -923,6 +959,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -952,6 +989,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_27",
"fieldtype": "Column Break",
"hidden": 0,
@@ -975,6 +1013,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1001,6 +1040,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1028,6 +1068,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Add / Edit Taxes and Charges",
"fieldname": "taxes_section",
"fieldtype": "Section Break",
@@ -1055,6 +1096,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
@@ -1083,6 +1125,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
@@ -1110,6 +1153,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "other_charges_calculation",
"fieldtype": "HTML",
"hidden": 0,
@@ -1135,6 +1179,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "totals",
"fieldtype": "Section Break",
@@ -1162,6 +1207,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"hidden": 0,
@@ -1189,6 +1235,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"hidden": 0,
@@ -1216,6 +1263,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1243,6 +1291,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1268,6 +1317,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"hidden": 0,
@@ -1295,6 +1345,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"hidden": 0,
@@ -1322,6 +1373,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1349,6 +1401,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"columns": 0,
"fieldname": "section_break_42",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1374,6 +1427,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Grand Total",
"fieldname": "apply_discount_on",
"fieldtype": "Select",
@@ -1401,6 +1455,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1427,6 +1482,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_44",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1451,6 +1507,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "additional_discount_percentage",
"fieldtype": "Float",
"hidden": 0,
@@ -1476,6 +1533,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1502,6 +1560,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_46",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1526,6 +1585,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1553,6 +1613,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "base_in_words",
"fieldtype": "Data",
@@ -1580,6 +1641,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_rounded_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1607,6 +1669,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_50",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1631,6 +1694,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1658,6 +1722,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_words",
"fieldtype": "Data",
"hidden": 0,
@@ -1685,6 +1750,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "terms",
"columns": 0,
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1711,6 +1777,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"hidden": 0,
@@ -1738,6 +1805,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "terms",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -1765,6 +1833,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "supplied_items",
"columns": 0,
"description": "",
"fieldname": "raw_material_details",
"fieldtype": "Section Break",
@@ -1792,6 +1861,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"description": "",
"fieldname": "is_subcontracted",
@@ -1821,6 +1891,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
@@ -1851,6 +1922,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
@@ -1878,6 +1950,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bill_no",
"fieldtype": "Data",
"hidden": 1,
@@ -1904,6 +1977,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bill_date",
"fieldtype": "Date",
"hidden": 1,
@@ -1930,6 +2004,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1956,6 +2031,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -1986,6 +2062,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
@@ -2014,6 +2091,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 1,
@@ -2043,6 +2121,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "range",
"fieldtype": "Data",
"hidden": 1,
@@ -2069,6 +2148,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2095,6 +2175,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "per_billed",
"fieldtype": "Percent",
"hidden": 0,
@@ -2120,6 +2201,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2145,6 +2227,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -2170,6 +2253,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -2197,6 +2281,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"hidden": 0,
@@ -2222,6 +2307,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "other_details",
"fieldtype": "HTML",
"hidden": 1,
@@ -2250,6 +2336,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "instructions",
"fieldtype": "Small Text",
"hidden": 0,
@@ -2276,6 +2363,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remarks",
"fieldtype": "Small Text",
"hidden": 0,
@@ -2301,6 +2389,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "transporter_name",
"columns": 0,
"fieldname": "transporter_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2326,6 +2415,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transporter_name",
"fieldtype": "Data",
"hidden": 0,
@@ -2352,6 +2442,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2377,6 +2468,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "lr_no",
"fieldtype": "Data",
@@ -2406,6 +2498,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "lr_date",
"fieldtype": "Date",
@@ -2444,7 +2537,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-06-30 13:42:23.310309",
"modified": "2016-09-23 18:02:17.332333",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",

View File

@@ -40,14 +40,6 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
}
}
}
this.frm.set_query("difference_account", function() {
return {
"filters": {
"company": me.frm.doc.company,
"is_group": 0
}
};
});
}
this.frm.get_field('items').grid.editable_fields = [

View File

@@ -844,33 +844,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "",
"fieldname": "difference_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Difference Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -1431,7 +1404,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-04-07 06:40:03.284036",
"modified": "2016-09-08 06:40:03.284036",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",

View File

@@ -71,9 +71,6 @@ class StockEntry(StockController):
if self.purpose not in valid_purposes:
frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes)))
if self.purpose in ("Manufacture", "Repack") and not self.difference_account:
self.difference_account = frappe.db.get_value("Company", self.company, "default_expense_account")
def set_transfer_qty(self):
for item in self.get("items"):
if not flt(item.qty):
@@ -97,9 +94,6 @@ class StockEntry(StockController):
if f in ["stock_uom", "conversion_factor"] or not item.get(f):
item.set(f, item_details.get(f))
if self.difference_account and not item.expense_account:
item.expense_account = self.difference_account
if not item.transfer_qty and item.qty:
item.transfer_qty = item.qty * item.conversion_factor

View File

@@ -57,8 +57,6 @@ def make_stock_entry(**args):
s.purchase_receipt_no = args.purchase_receipt_no
s.delivery_note_no = args.delivery_note_no
s.sales_invoice_no = args.sales_invoice_no
if args.difference_account:
s.difference_account = args.difference_account
if not args.cost_center:
args.cost_center = frappe.get_value('Company', s.company, 'cost_center')

View File

@@ -71,7 +71,7 @@ class Warehouse(NestedSet):
"freeze_account": "No"
})
ac_doc.flags.ignore_permissions = True
ac_doc.flags.ignore_mandatory = True
try:
ac_doc.insert()
msgprint(_("Account head {0} created").format(ac_doc.name))

View File

@@ -0,0 +1,49 @@
{% var visible_columns = row.get_visible_columns(["item_code", "warehouse",
"item_name", "amount", "stock_uom", "uom", "qty", "schedule_date"]); %}
{% if(!doc) { %}
<div class="row">
<div class="col-sm-4">{%= __("Item") %}</div>
<div class="col-sm-3">{%= __("Required On") %}</div>
<div class="col-sm-3">{%= __("Warehouse") %}</div>
<div class="col-sm-2 text-right">{%= __("Qty") %}</div>
</div>
{% } else { %}
<div class="row">
<div class="col-sm-4">
<span class="indicator {%= (doc.qty<=doc.ordered_qty) ? "green" : "orange" %}">{%= doc.item_code %}</strong>
{% if(doc.item_name != doc.item_code) { %}
<br>{%= doc.item_name %}{% } %}
<!-- {% if(doc.item_name != doc.description) { %}
<p>{%= doc.description %}</p>{% } %} -->
{% include "templates/form_grid/includes/visible_cols.html" %}
</div>
<div class="col-sm-3">
{% if(doc.schedule_date) { %}
<span title="{%= __("Reqd By Date") %}" class="{%=
(frappe.datetime.get_diff(doc.schedule_date, frappe.datetime.get_today()) < 0
&& doc.ordered_qty < doc.qty)
? "text-danger" : "text-muted" %}">
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
<!-- warehouse -->
<div class="col-sm-3">
{% if(doc.warehouse) { %}
<span class="label label-default" title="{%= __("For Warehouse") %}"
style="margin-right: 10px;">
{%= doc.warehouse %}
</span>
{% } %}
</div>
<!-- qty -->
<div class="col-sm-2 text-right">
{%= doc.get_formatted("qty") %}
<span class="small">{%= doc.uom || doc.stock_uom %}</span>
</div>
</div>
{% } %}

View File

@@ -31,10 +31,10 @@
</div>
<div class="text-center item-group-nav-buttons">
{% if frappe.form_dict.start|int > 0 %}
<a class="btn btn-default" href="{{ pathname }}?start={{ frappe.form_dict.start|int - 24 }}">Prev</a>
<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int - page_length }}">Prev</a>
{% endif %}
{% if items|length == 24 %}
<a class="btn btn-default" href="{{ pathname }}?start={{ frappe.form_dict.start|int + 24 }}">Next</a>
{% if items|length == page_length %}
<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int + page_length }}">Next</a>
{% endif %}
</div>
{% else %}

View File

@@ -30,9 +30,10 @@ rfq = Class.extend({
var me = this;
$('.rfq-items').on("change", ".rfq-qty", function(){
me.idx = parseFloat($(this).attr('data-idx'));
me.qty = parseFloat($(this).val());
me.qty = parseFloat($(this).val()) || 0;
me.rate = parseFloat($(repl('.rfq-rate[data-idx=%(idx)s]',{'idx': me.idx})).val());
me.update_qty_rate();
$(this).val(format_number(me.qty, 2));
})
},
@@ -40,9 +41,10 @@ rfq = Class.extend({
var me = this;
$(".rfq-items").on("change", ".rfq-rate", function(){
me.idx = parseFloat($(this).attr('data-idx'));
me.rate = parseFloat($(this).val());
me.rate = parseFloat($(this).val()) || 0;
me.qty = parseFloat($(repl('.rfq-qty[data-idx=%(idx)s]',{'idx': me.idx})).val());
me.update_qty_rate();
$(this).val(format_number(me.rate, 2));
})
},

View File

@@ -3,26 +3,26 @@
{% for d in doc.items %}
<div class="rfq-item">
<div class="row">
<div class="col-sm-6 col-xs-6" style="margin-bottom: 10px;margin-top: 5px;">
<div class="col-sm-5 col-xs-12" style="margin-bottom: 10px;margin-top: 5px;">
{{ item_name_and_description(d, doc) }}
</div>
<!-- <div class="col-sm-2 col-xs-2" style="margin-bottom: 10px;">
<textarea type="text" style="margin-top: 5px;" class="input-with-feedback form-control rfq-offer_detail" ></textarea>
</div> -->
<div class="col-sm-2 col-xs-2 text-right">
<input type="number" class="form-control text-right rfq-qty" style="margin-top: 5px; max-width: 70px;display: inline-block"
<div class="col-sm-2 col-xs-4 text-right">
<input type="text" class="form-control text-right rfq-qty" style="margin-top: 5px;display: inline-block"
value = "{{ d.get_formatted('qty') }}"
data-idx="{{ d.idx }}">
<p class="text-muted small" style="margin-top: 10px;">
{{_("UOM") + ": "+ d.uom}}
{{_("UOM") + ":"+ d.uom}}
</p>
</div>
<div class="col-sm-2 col-xs-2 text-right">
{{doc.currency_symbol}} <input type="number" class="form-control text-right rfq-rate"
style="margin-top: 5px; max-width: 70px;display: inline-block" value="0.00"
<div class="col-sm-2 col-xs-4 text-right">
<input type="text" class="form-control text-right rfq-rate"
style="margin-top: 5px;display: inline-block" value="0.00"
data-idx="{{ d.idx }}">
</div>
<div class="col-sm-2 col-xs-2 text-right" style="padding-top: 9px;">
<div class="col-sm-3 col-xs-4 text-right" style="padding-top: 9px;">
{{doc.currency_symbol}} <span class="rfq-amount" data-idx="{{ d.idx }}">0.00</span>
</div>
</div>

View File

@@ -33,16 +33,16 @@
<div id="order-container">
<div id="rfq-items">
<div class="row cart-item-header">
<div class="col-sm-6 col-xs-6">
<div class="col-sm-5 col-xs-12">
Items
</div>
<div class="col-sm-2 col-xs-2 text-right">
<div class="col-sm-2 col-xs-4 text-right">
Qty
</div>
<div class="col-sm-2 col-xs-2 text-right">
<div class="col-sm-2 col-xs-4 text-right">
Rate
</div>
<div class="col-sm-2 col-xs-2 text-right">
<div class="col-sm-3 col-xs-4 text-right">
Amount
</div>
</div>
@@ -55,8 +55,8 @@
</div>
{% if doc.items %}
<div class="row grand-total-row">
<div class="col-xs-10 text-right">{{ _("Grand Total") }}</div>
<div class="col-xs-2 text-right">
<div class="col-xs-9 text-right">{{ _("Grand Total") }}</div>
<div class="col-xs-3 text-right">
{{doc.currency_symbol}} <span class="tax-grand-total">0.0</span>
</div>
</div>