Compare commits
254 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c0a9f420f | ||
|
|
f3882d2699 | ||
|
|
fe86debf5d | ||
|
|
7d977a243a | ||
|
|
43b508089e | ||
|
|
d5e52bc251 | ||
|
|
13a07c2029 | ||
|
|
9ef4f0dc30 | ||
|
|
aa8abfa5b3 | ||
|
|
ac9172f6df | ||
|
|
44b4e5eef3 | ||
|
|
ff183eedb9 | ||
|
|
184f6d42cc | ||
|
|
afceac620c | ||
|
|
2acbb11923 | ||
|
|
b33695138c | ||
|
|
8872842edf | ||
|
|
7791ed845f | ||
|
|
498cc1b7e1 | ||
|
|
170b0cc83c | ||
|
|
d5c4a5c802 | ||
|
|
a1099d28b8 | ||
|
|
7b9e8368ea | ||
|
|
f32547a414 | ||
|
|
17f6874450 | ||
|
|
55a8797919 | ||
|
|
401be3f49b | ||
|
|
a9ce406c48 | ||
|
|
0b1b8afc3c | ||
|
|
e040510545 | ||
|
|
efd7c3e22b | ||
|
|
8e881cc7b9 | ||
|
|
fc90758932 | ||
|
|
1ca7a27b2f | ||
|
|
3485d2467a | ||
|
|
6f33dfbc56 | ||
|
|
8d62af627a | ||
|
|
1c0ecede06 | ||
|
|
896c731a46 | ||
|
|
05790d1b38 | ||
|
|
5655ce936b | ||
|
|
361739ffb6 | ||
|
|
8fa2a04024 | ||
|
|
89326b366d | ||
|
|
6aaa7d7742 | ||
|
|
05ba967a45 | ||
|
|
d17bbdeb4d | ||
|
|
2f3a68b8d6 | ||
|
|
f69edb3fa3 | ||
|
|
06195de812 | ||
|
|
ad8218e5ac | ||
|
|
9bfef84545 | ||
|
|
81754954cb | ||
|
|
2907881dfb | ||
|
|
0799969063 | ||
|
|
c1b7104126 | ||
|
|
ee25cf7ead | ||
|
|
2f75b7b42e | ||
|
|
1915214518 | ||
|
|
770d04e633 | ||
|
|
022d87969d | ||
|
|
a1d7646e70 | ||
|
|
bd2a1c3553 | ||
|
|
16f3f378f6 | ||
|
|
1885207eca | ||
|
|
e0a636c081 | ||
|
|
ef4e41380b | ||
|
|
77ede941b0 | ||
|
|
7d5298997b | ||
|
|
1397159bc1 | ||
|
|
ec08a50af1 | ||
|
|
4eb196905b | ||
|
|
370e711f48 | ||
|
|
3ae5672e27 | ||
|
|
297fbcd388 | ||
|
|
b7a5502b97 | ||
|
|
7dcab89321 | ||
|
|
a162b3f0cd | ||
|
|
2f163ef360 | ||
|
|
cccc45edc5 | ||
|
|
7b9638c93a | ||
|
|
33fafb7728 | ||
|
|
2704a4a8fc | ||
|
|
55c328348f | ||
|
|
e86eaf543c | ||
|
|
163e3598c7 | ||
|
|
7229b64128 | ||
|
|
9501b38e8b | ||
|
|
09adc10543 | ||
|
|
219148d23d | ||
|
|
9ac2fc932d | ||
|
|
86da020dcd | ||
|
|
6c49fa20b5 | ||
|
|
9e64f07540 | ||
|
|
d5cebd7bb4 | ||
|
|
80de91776d | ||
|
|
cf87027422 | ||
|
|
661db8ba71 | ||
|
|
82be020ae9 | ||
|
|
6f1d012b65 | ||
|
|
112827ee86 | ||
|
|
e2b8ae56e1 | ||
|
|
a65c223428 | ||
|
|
d114aca20d | ||
|
|
5a431127c5 | ||
|
|
69ca382529 | ||
|
|
c9fc091289 | ||
|
|
e7e920b487 | ||
|
|
e8519938e0 | ||
|
|
10a48ea5e9 | ||
|
|
0b7b109c0b | ||
|
|
4f62c4cf2d | ||
|
|
b1391ca635 | ||
|
|
6f3d04caf7 | ||
|
|
c158ccd884 | ||
|
|
b498eb5f9e | ||
|
|
47863a3049 | ||
|
|
e1aee56e85 | ||
|
|
a7b0ffca1c | ||
|
|
74bf022273 | ||
|
|
c1a3e379d8 | ||
|
|
6870e45276 | ||
|
|
7652d5db93 | ||
|
|
1d0b18661e | ||
|
|
29a0b31ca6 | ||
|
|
773d93b628 | ||
|
|
626fcd5199 | ||
|
|
2c452a6881 | ||
|
|
d0a25f72c7 | ||
|
|
424bffc98b | ||
|
|
473ccc410b | ||
|
|
b81a7538b9 | ||
|
|
a3ffe530f0 | ||
|
|
f1d2fd2436 | ||
|
|
4b24683c27 | ||
|
|
2e31d7c7bf | ||
|
|
17adb970f1 | ||
|
|
f21f1af0c9 | ||
|
|
b3bc41131e | ||
|
|
f1ad32059f | ||
|
|
eba0d83541 | ||
|
|
7441a93a10 | ||
|
|
d63bfaa5f2 | ||
|
|
a82358bb98 | ||
|
|
0a6529a643 | ||
|
|
63552166be | ||
|
|
147ecab6b0 | ||
|
|
45f05d2c9b | ||
|
|
2b6cacc799 | ||
|
|
577aa9cb33 | ||
|
|
ad3e213b41 | ||
|
|
7faa4b5fdf | ||
|
|
f04721ee79 | ||
|
|
5874a76eac | ||
|
|
4f72480045 | ||
|
|
d728f5a429 | ||
|
|
5f0aceab19 | ||
|
|
aec28a2c88 | ||
|
|
09f1ee637e | ||
|
|
3720045eb9 | ||
|
|
147b288d66 | ||
|
|
d4321ec18b | ||
|
|
84fa3dfac8 | ||
|
|
aca857e708 | ||
|
|
d03087d3ab | ||
|
|
4ed0653c7f | ||
|
|
b2382c0b8e | ||
|
|
f79b3f8c3c | ||
|
|
481ca832b0 | ||
|
|
22e1665244 | ||
|
|
deaee7c08b | ||
|
|
0d36862917 | ||
|
|
bd599b0169 | ||
|
|
0967b17320 | ||
|
|
b1041072a2 | ||
|
|
a58a65457f | ||
|
|
993d7ca630 | ||
|
|
7108991039 | ||
|
|
342ec18b83 | ||
|
|
6835a6fb49 | ||
|
|
4fead63419 | ||
|
|
06131dd0b1 | ||
|
|
aac32d644d | ||
|
|
d12990ff57 | ||
|
|
429a38f90b | ||
|
|
57a1905576 | ||
|
|
30a25e11f7 | ||
|
|
1f912f67ae | ||
|
|
af03de3d00 | ||
|
|
414199a5db | ||
|
|
759ef4c00d | ||
|
|
4a121d60db | ||
|
|
72801043f1 | ||
|
|
9c32baa1f4 | ||
|
|
4bd08182ac | ||
|
|
ae9990cb81 | ||
|
|
a5de83351e | ||
|
|
33a20bdb13 | ||
|
|
f314494555 | ||
|
|
daee449063 | ||
|
|
03e5e68a7a | ||
|
|
a36a88b6de | ||
|
|
9c82dd9157 | ||
|
|
3aa315040f | ||
|
|
7819744e5b | ||
|
|
aaa6d1f1bc | ||
|
|
a8b8d81e2a | ||
|
|
3e669ca656 | ||
|
|
1bf8e70339 | ||
|
|
1bdffbff57 | ||
|
|
094d3adba3 | ||
|
|
6a5751e91c | ||
|
|
23147ff881 | ||
|
|
c16c0ca944 | ||
|
|
525900c5c1 | ||
|
|
75a41a6f75 | ||
|
|
9b54b78794 | ||
|
|
93851df048 | ||
|
|
f79d7188de | ||
|
|
3cdc74e3b0 | ||
|
|
377c7acd53 | ||
|
|
05621ed564 | ||
|
|
ca627fb806 | ||
|
|
6e4ab60e4c | ||
|
|
911e9caa43 | ||
|
|
b239a09951 | ||
|
|
d223a03814 | ||
|
|
4cb58c410a | ||
|
|
906552a401 | ||
|
|
3bd5014b7b | ||
|
|
8693b5c93a | ||
|
|
36830016ee | ||
|
|
533e564867 | ||
|
|
88d7e419ad | ||
|
|
54254cca58 | ||
|
|
142f14dd5c | ||
|
|
0f0c131ba4 | ||
|
|
e1e187bee1 | ||
|
|
c946c730da | ||
|
|
5a4ca64c4a | ||
|
|
47fd4c6521 | ||
|
|
e58031ab49 | ||
|
|
f8e374643c | ||
|
|
0ef9da65dc | ||
|
|
98d58b5ed1 | ||
|
|
ff910f4c72 | ||
|
|
5c69fed218 | ||
|
|
d07557eaf6 | ||
|
|
13b37c6346 | ||
|
|
b34ba6bd6e | ||
|
|
94dbc14f8a | ||
|
|
600ab0f7a0 | ||
|
|
9afee28c36 | ||
|
|
86f143863f |
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '7.0.35'
|
||||
__version__ = '7.0.63'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
||||
@@ -171,7 +171,7 @@ class Account(Document):
|
||||
|
||||
old_warehouse = cstr(frappe.db.get_value("Account", self.name, "warehouse"))
|
||||
if old_warehouse != cstr(self.warehouse):
|
||||
if old_warehouse:
|
||||
if old_warehouse and frappe.db.exists("Warehouse", old_warehouse):
|
||||
self.validate_warehouse(old_warehouse)
|
||||
if self.warehouse:
|
||||
self.validate_warehouse(self.warehouse)
|
||||
|
||||
@@ -48,5 +48,24 @@ frappe.treeview_settings["Account"] = {
|
||||
+ " " + dr_or_cr
|
||||
+ '</span>').insertBefore(node.$ul);
|
||||
}
|
||||
}
|
||||
},
|
||||
toolbar: [
|
||||
{
|
||||
condition: function(node) {
|
||||
return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
|
||||
},
|
||||
label: __("View Ledger"),
|
||||
click: function(node, btn) {
|
||||
frappe.route_options = {
|
||||
"account": node.label,
|
||||
"from_date": sys_defaults.year_start_date,
|
||||
"to_date": sys_defaults.year_end_date,
|
||||
"company": frappe.defaults.get_default('company') ? frappe.defaults.get_default('company'): ""
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
},
|
||||
btnClass: "hidden-xs"
|
||||
}
|
||||
],
|
||||
extend_toolbar: true
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"description": "If enabled, the system will post accounting entries for inventory automatically.",
|
||||
"fieldname": "auto_accounting_for_stock",
|
||||
@@ -41,6 +42,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
|
||||
"fieldname": "acc_frozen_upto",
|
||||
"fieldtype": "Date",
|
||||
@@ -66,6 +68,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
|
||||
"fieldname": "frozen_accounts_modifier",
|
||||
"fieldtype": "Link",
|
||||
@@ -92,6 +95,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -116,6 +120,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Role that is allowed to submit transactions that exceed credit limits set.",
|
||||
"fieldname": "credit_controller",
|
||||
"fieldtype": "Link",
|
||||
@@ -142,6 +147,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "check_supplier_invoice_uniqueness",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@@ -162,6 +168,32 @@
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "make_payment_via_journal_entry",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Make Payment via Journal Entry",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
@@ -175,8 +207,8 @@
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-14 14:32:06.056888",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2016-10-05 16:13:10.978208",
|
||||
"modified_by": "rohitw1991@gmail.com",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Settings",
|
||||
"owner": "Administrator",
|
||||
@@ -191,6 +223,7 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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]
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -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"])
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "Setup",
|
||||
"editable_grid": 0,
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -249,14 +250,15 @@
|
||||
"hide_toolbar": 0,
|
||||
"icon": "icon-money",
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 1,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-05-16 15:23:14.770933",
|
||||
"modified": "2016-10-18 14:22:00.207907",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cost Center",
|
||||
@@ -368,6 +370,5 @@
|
||||
"read_only_onload": 0,
|
||||
"search_fields": "parent_cost_center, is_group",
|
||||
"sort_order": "ASC",
|
||||
"track_seen": 0,
|
||||
"version": 0
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -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({
|
||||
@@ -505,6 +511,18 @@ frappe.ui.form.on('Payment Entry', {
|
||||
});
|
||||
},
|
||||
|
||||
allocate_payment_amount: function(frm) {
|
||||
if(frm.doc.payment_type == 'Internal Transfer'){
|
||||
return
|
||||
}
|
||||
|
||||
if(frm.doc.references.length == 0){
|
||||
frm.events.get_outstanding_documents(frm);
|
||||
}
|
||||
|
||||
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
|
||||
},
|
||||
|
||||
allocate_party_amount_against_ref_docs: function(frm, paid_amount) {
|
||||
var total_positive_outstanding_including_order = 0;
|
||||
var total_negative_outstanding = 0;
|
||||
@@ -546,22 +564,24 @@ frappe.ui.form.on('Payment Entry', {
|
||||
}
|
||||
|
||||
$.each(frm.doc.references || [], function(i, row) {
|
||||
row.allocated_amount = 0
|
||||
row.allocated_amount = 0 //If allocate payment amount checkbox is unchecked, set zero to allocate amount
|
||||
if(frm.doc.allocate_payment_amount){
|
||||
if(row.outstanding_amount > 0 && allocated_positive_outstanding > 0) {
|
||||
if(row.outstanding_amount >= allocated_positive_outstanding)
|
||||
row.allocated_amount = allocated_positive_outstanding;
|
||||
else row.allocated_amount = row.outstanding_amount;
|
||||
|
||||
if(row.outstanding_amount > 0 && allocated_positive_outstanding > 0) {
|
||||
if(row.outstanding_amount >= allocated_positive_outstanding)
|
||||
row.allocated_amount = allocated_positive_outstanding;
|
||||
else row.allocated_amount = row.outstanding_amount;
|
||||
allocated_positive_outstanding -= flt(row.allocated_amount);
|
||||
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
|
||||
if(Math.abs(row.outstanding_amount) >= allocated_negative_outstanding)
|
||||
row.allocated_amount = -1*allocated_negative_outstanding;
|
||||
else row.allocated_amount = row.outstanding_amount;
|
||||
|
||||
allocated_positive_outstanding -= flt(row.allocated_amount);
|
||||
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
|
||||
if(Math.abs(row.outstanding_amount) >= allocated_negative_outstanding)
|
||||
row.allocated_amount = -1*allocated_negative_outstanding;
|
||||
else row.allocated_amount = row.outstanding_amount;
|
||||
|
||||
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
|
||||
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
frm.refresh_fields()
|
||||
frm.events.set_total_allocated_amount(frm);
|
||||
},
|
||||
|
||||
@@ -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,35 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"depends_on": "eval:in_list(['Pay', 'Receive'], doc.payment_type)",
|
||||
"fieldname": "allocate_payment_amount",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Allocate Payment Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"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,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fieldname": "references",
|
||||
"fieldtype": "Table",
|
||||
@@ -750,6 +832,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fieldname": "section_break_34",
|
||||
"fieldtype": "Section Break",
|
||||
@@ -776,6 +859,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 +886,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fieldname": "base_total_allocated_amount",
|
||||
"fieldtype": "Currency",
|
||||
@@ -829,6 +914,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "set_exchange_gain_loss",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 0,
|
||||
@@ -854,6 +940,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_36",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -878,6 +965,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 +992,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 +1020,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "difference_amount",
|
||||
"fieldname": "write_off_difference_amount",
|
||||
"fieldtype": "Button",
|
||||
@@ -958,6 +1048,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 +1075,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "deductions",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
@@ -1010,6 +1102,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "transaction_references",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@@ -1035,6 +1128,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 +1155,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_23",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -1085,6 +1180,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 +1207,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==1",
|
||||
"fieldname": "clearance_date",
|
||||
"fieldtype": "Date",
|
||||
@@ -1138,6 +1235,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 +1262,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
@@ -1191,6 +1290,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "remarks",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
@@ -1216,6 +1316,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_16",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -1240,6 +1341,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -1266,6 +1368,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "print_heading",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -1292,6 +1395,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -1317,6 +1421,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
@@ -1349,8 +1454,8 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-11 08:06:33.121527",
|
||||
"modified_by": "NuranVerkleij@example.com",
|
||||
"modified": "2016-09-28 18:20:47.625383",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry",
|
||||
"name_case": "",
|
||||
|
||||
@@ -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:
|
||||
@@ -666,6 +669,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
|
||||
pe.paid_to_account_currency = party_account_currency if payment_type=="Pay" else bank.account_currency
|
||||
pe.paid_amount = paid_amount
|
||||
pe.received_amount = received_amount
|
||||
pe.allocate_payment_amount = 1
|
||||
|
||||
pe.append("references", {
|
||||
"reference_doctype": dt,
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -165,6 +165,13 @@ def get_pricing_rule_for_item(args):
|
||||
})
|
||||
else:
|
||||
item_details.discount_percentage = pricing_rule.discount_percentage
|
||||
elif args.get('pricing_rule'):
|
||||
if frappe.db.get_value('Pricing Rule', args.get('pricing_rule'), 'price_or_discount') == 'Discount Percentage':
|
||||
item_details.discount_percentage = 0.0
|
||||
|
||||
item_details.margin_rate_or_amount = 0.0
|
||||
item_details.margin_type = None
|
||||
|
||||
return item_details
|
||||
|
||||
def get_pricing_rules(args):
|
||||
|
||||
@@ -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]
|
||||
]
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -58,7 +58,7 @@ class PurchaseInvoice(BuyingController):
|
||||
self.check_for_closed_status()
|
||||
self.validate_with_previous_doc()
|
||||
self.validate_uom_is_integer("uom", "qty")
|
||||
self.set_expense_account()
|
||||
self.set_expense_account(for_validate=True)
|
||||
self.set_against_expense_account()
|
||||
self.validate_write_off_account()
|
||||
self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "items")
|
||||
@@ -71,7 +71,7 @@ class PurchaseInvoice(BuyingController):
|
||||
frappe.throw(_("Cash or Bank Account is mandatory for making payment entry"))
|
||||
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) \
|
||||
- flt(self.base_grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
|
||||
- flt(self.grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
|
||||
frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total"""))
|
||||
|
||||
def create_remarks(self):
|
||||
@@ -155,7 +155,7 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
super(PurchaseInvoice, self).validate_warehouse()
|
||||
|
||||
def set_expense_account(self):
|
||||
def set_expense_account(self, for_validate=False):
|
||||
auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
|
||||
|
||||
if auto_accounting_for_stock:
|
||||
@@ -181,7 +181,7 @@ class PurchaseInvoice(BuyingController):
|
||||
else:
|
||||
item.expense_account = stock_not_billed_account
|
||||
|
||||
elif not item.expense_account:
|
||||
elif not item.expense_account and for_validate:
|
||||
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
|
||||
|
||||
def set_against_expense_account(self):
|
||||
@@ -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"))
|
||||
|
||||
@@ -369,7 +372,7 @@ class PurchaseInvoice(BuyingController):
|
||||
if flt(item.base_net_amount):
|
||||
account_currency = get_account_currency(item.expense_account)
|
||||
|
||||
if self.update_stock and self.auto_accounting_for_stock:
|
||||
if self.update_stock and self.auto_accounting_for_stock and item.item_code in stock_items:
|
||||
val_rate_db_precision = 6 if cint(item.precision("valuation_rate")) <= 6 else 9
|
||||
|
||||
# warehouse account
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'purchase_invoice',
|
||||
'non_standard_fieldnames': {
|
||||
'Delivery Note': 'against_sales_invoice',
|
||||
'Journal Entry': 'reference_name',
|
||||
'Payment Entry': 'reference_name',
|
||||
'Payment Request': 'reference_name',
|
||||
'Landed Cost Voucher': 'receipt_document',
|
||||
'Purchase Invoice': 'return_against'
|
||||
},
|
||||
'internal_links': {
|
||||
'Purchase Order': ['items', 'sales_order'],
|
||||
'Purchase Receipt': ['items', 'delivery_note'],
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Payment'),
|
||||
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'purchase_invoice',
|
||||
'non_standard_fieldnames': {
|
||||
'Delivery Note': 'against_sales_invoice',
|
||||
'Journal Entry': 'reference_name',
|
||||
'Payment Entry': 'reference_name',
|
||||
'Payment Request': 'reference_name',
|
||||
'Landed Cost Voucher': 'receipt_document',
|
||||
'Purchase Invoice': 'return_against'
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
|
||||
'internal_links': {
|
||||
'Purchase Order': ['items', 'sales_order'],
|
||||
'Purchase Receipt': ['items', 'delivery_note'],
|
||||
},
|
||||
{
|
||||
'label': _('Returns'),
|
||||
'items': ['Purchase Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Payment'),
|
||||
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
|
||||
},
|
||||
{
|
||||
'label': _('Returns'),
|
||||
'items': ['Purchase Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -15,6 +15,7 @@ def get_pos_data():
|
||||
doc = frappe.new_doc('Sales Invoice')
|
||||
doc.is_pos = 1;
|
||||
pos_profile = get_pos_profile(doc.company) or {}
|
||||
if not doc.company: doc.company = pos_profile.get('company')
|
||||
doc.update_stock = pos_profile.get('update_stock')
|
||||
|
||||
if pos_profile.get('name'):
|
||||
@@ -66,7 +67,7 @@ def update_pos_profile_data(doc, pos_profile, company_data):
|
||||
doc.naming_series = pos_profile.get('naming_series') or 'SINV-'
|
||||
doc.letter_head = pos_profile.get('letter_head') or company_data.default_letter_head
|
||||
doc.ignore_pricing_rule = pos_profile.get('ignore_pricing_rule') or 0
|
||||
doc.apply_discount_on = pos_profile.get('apply_discount_on') or ''
|
||||
doc.apply_discount_on = pos_profile.get('apply_discount_on') if pos_profile.get('apply_discount') else ''
|
||||
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
|
||||
doc.territory = pos_profile.get('territory') or get_root('Territory')
|
||||
|
||||
@@ -242,6 +243,6 @@ def save_invoice(e, si_doc, name):
|
||||
|
||||
def make_scheduler_log(e, sales_invoice):
|
||||
scheduler_log = frappe.new_doc('Scheduler Log')
|
||||
scheduler_log.method = "erpnext.accounts.doctype.sales_invoice.pos.make_invoice"
|
||||
scheduler_log.error = e
|
||||
scheduler_log.sales_invoice = sales_invoice
|
||||
scheduler_log.save(ignore_permissions=True)
|
||||
@@ -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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'sales_invoice',
|
||||
'non_standard_fieldnames': {
|
||||
'Delivery Note': 'against_sales_invoice',
|
||||
'Journal Entry': 'reference_name',
|
||||
'Payment Entry': 'reference_name',
|
||||
'Payment Request': 'reference_name',
|
||||
'Sales Invoice': 'return_against'
|
||||
},
|
||||
'internal_links': {
|
||||
'Sales Order': ['items', 'sales_order'],
|
||||
'Delivery Note': ['items', 'delivery_note'],
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Payment'),
|
||||
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'sales_invoice',
|
||||
'non_standard_fieldnames': {
|
||||
'Delivery Note': 'against_sales_invoice',
|
||||
'Journal Entry': 'reference_name',
|
||||
'Payment Entry': 'reference_name',
|
||||
'Payment Request': 'reference_name',
|
||||
'Sales Invoice': 'return_against'
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
|
||||
'internal_links': {
|
||||
'Sales Order': ['items', 'sales_order'],
|
||||
'Delivery Note': ['items', 'delivery_note'],
|
||||
},
|
||||
{
|
||||
'label': _('Returns'),
|
||||
'items': ['Sales Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Payment'),
|
||||
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
|
||||
},
|
||||
{
|
||||
'label': _('Returns'),
|
||||
'items': ['Sales Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -168,8 +168,8 @@ def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,
|
||||
|
||||
if not gl_entries:
|
||||
gl_entries = frappe.db.sql("""
|
||||
select account, posting_date, party_type, party, cost_center, fiscal_year,
|
||||
voucher_type, voucher_no, against_voucher_type, against_voucher, cost_center
|
||||
select account, posting_date, party_type, party, cost_center, fiscal_year,voucher_type,
|
||||
voucher_no, against_voucher_type, against_voucher, cost_center, company
|
||||
from `tabGL Entry`
|
||||
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no), as_dict=True)
|
||||
|
||||
|
||||
@@ -15,13 +15,11 @@ frappe.pages['pos'].refresh = function(wrapper) {
|
||||
window.onbeforeunload = function () {
|
||||
return wrapper.pos.beforeunload()
|
||||
}
|
||||
wrapper.pos.on_refresh_page()
|
||||
}
|
||||
|
||||
|
||||
erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
init: function(wrapper){
|
||||
this.load = true;
|
||||
this.page = wrapper.page;
|
||||
this.wrapper = $(wrapper).find('.page-content');
|
||||
this.set_indicator();
|
||||
@@ -31,17 +29,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.si_docs = this.get_doc_from_localstorage();
|
||||
},
|
||||
|
||||
on_refresh_page: function() {
|
||||
var me = this;
|
||||
if(this.load){
|
||||
this.load = false;
|
||||
}else if(this.connection_status){
|
||||
this.onload();
|
||||
}else{
|
||||
this.create_new();
|
||||
}
|
||||
},
|
||||
|
||||
beforeunload: function(e){
|
||||
if(this.connection_status == false && frappe.get_route()[0] == "pos"){
|
||||
e = e || window.event;
|
||||
@@ -111,6 +98,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
})
|
||||
});
|
||||
|
||||
this.page.add_menu_item(__("Sync Offline Invoices"), function(){
|
||||
me.sync_sales_invoice()
|
||||
});
|
||||
|
||||
this.page.add_menu_item(__("POS Profile"), function() {
|
||||
frappe.set_route('List', 'POS Profile');
|
||||
});
|
||||
@@ -355,11 +346,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
get_customers: function(key){
|
||||
var me = this;
|
||||
key = key.toLowerCase().trim()
|
||||
var re = new RegExp('%', 'g');
|
||||
var reg = new RegExp(key.replace(re, '\\w*\\s*[a-zA-Z0-9]*'))
|
||||
|
||||
if(key){
|
||||
return $.grep(this.customers, function(data) {
|
||||
if(data.name.toLowerCase().match(key)
|
||||
|| data.customer_name.toLowerCase().match(key)
|
||||
|| (data.customer_group && data.customer_group.toLowerCase().match(key))){
|
||||
if(reg.test(data.name.toLowerCase())
|
||||
|| reg.test(data.customer_name.toLowerCase())
|
||||
|| (data.customer_group && reg.test(data.customer_group.toLowerCase()))){
|
||||
return data
|
||||
}
|
||||
})
|
||||
@@ -383,7 +377,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
if (this.items) {
|
||||
$.each(this.items, function(index, obj) {
|
||||
if(index < 16){
|
||||
if(index < 30){
|
||||
$(frappe.render_template("pos_item", {
|
||||
item_code: obj.name,
|
||||
item_price: format_currency(obj.price_list_rate, obj.currency),
|
||||
@@ -427,7 +421,9 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
})
|
||||
}
|
||||
|
||||
key = this.search.$input.val().toLowerCase();
|
||||
key = this.search.$input.val().toLowerCase();
|
||||
var re = new RegExp('%', 'g');
|
||||
var reg = new RegExp(key.replace(re, '[\\w*\\s*[a-zA-Z0-9]*]*'))
|
||||
search_status = true
|
||||
|
||||
if(key){
|
||||
@@ -443,8 +439,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
} else if(item.barcode == me.search.$input.val()) {
|
||||
search_status = false;
|
||||
return item.barcode == me.search.$input.val();
|
||||
} else if((item.item_code.toLowerCase().match(key)) ||
|
||||
(item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))) {
|
||||
} else if(reg.test(item.item_code.toLowerCase()) || reg.test(item.description.toLowerCase()) ||
|
||||
reg.test(item.item_name.toLowerCase()) || reg.test(item.item_group.toLowerCase()) ){
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -614,6 +610,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 +651,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 +771,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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -53,9 +53,10 @@ class ReceivablePayableReport(object):
|
||||
self.filters["range3"] = "90"
|
||||
|
||||
for label in ("0-{range1}".format(range1=self.filters["range1"]),
|
||||
"{range1}-{range2}".format(range1=self.filters["range1"]+1, range2=self.filters["range2"]),
|
||||
"{range2}-{range3}".format(range2=self.filters["range2"]+1, range3=self.filters["range3"]),
|
||||
"{range3}-{above}".format(range3=self.filters["range3"] + 1, above=_("Above"))):
|
||||
"{range1}-{range2}".format(range1=cint(self.filters["range1"])+ 1, range2=self.filters["range2"]),
|
||||
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
|
||||
"{range3}-{above}".format(range3=cint(self.filters["range3"])+ 1, above=_("Above"))):
|
||||
frappe.errprint(label)
|
||||
columns.append({
|
||||
"label": label,
|
||||
"fieldtype": "Currency",
|
||||
@@ -93,9 +94,10 @@ class ReceivablePayableReport(object):
|
||||
data = []
|
||||
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
|
||||
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
|
||||
outstanding_amount = self.get_outstanding_amount(gle, self.filters.report_date, dr_or_cr)
|
||||
outstanding_amount = flt(self.get_outstanding_amount(gle,
|
||||
self.filters.report_date, dr_or_cr), currency_precision)
|
||||
|
||||
if abs(outstanding_amount) > 0.1/10**currency_precision:
|
||||
|
||||
row = [gle.posting_date, gle.party]
|
||||
|
||||
# customer / supplier name
|
||||
@@ -124,6 +126,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:
|
||||
@@ -214,14 +220,16 @@ class ReceivablePayableReport(object):
|
||||
conditions, values = self.prepare_conditions(party_type)
|
||||
|
||||
if self.filters.get(scrub(party_type)):
|
||||
select_fields = "debit_in_account_currency as debit, credit_in_account_currency as credit"
|
||||
select_fields = "sum(debit_in_account_currency) as debit, sum(credit_in_account_currency) as credit"
|
||||
else:
|
||||
select_fields = "debit, credit"
|
||||
select_fields = "sum(debit) as debit, sum(credit) as credit"
|
||||
|
||||
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
|
||||
voucher_type, voucher_no, against_voucher_type, against_voucher, account_currency, remarks, {0}
|
||||
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
|
||||
voucher_type, voucher_no, against_voucher_type, against_voucher,
|
||||
account_currency, remarks, {0}
|
||||
from `tabGL Entry`
|
||||
where docstatus < 2 and party_type=%s and (party is not null and party != '') {1}
|
||||
group by voucher_type, voucher_no, against_voucher_type, against_voucher, party
|
||||
order by posting_date, party"""
|
||||
.format(select_fields, conditions), values, as_dict=True)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ def get_cost_center_target_details(filters):
|
||||
return frappe.db.sql("""
|
||||
select b.cost_center, b.monthly_distribution, ba.account, ba.budget_amount
|
||||
from `tabBudget` b, `tabBudget Account` ba
|
||||
where b.name=ba.parent and b.fiscal_year=%s and b.company=%s
|
||||
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year=%s and b.company=%s
|
||||
""", (filters.fiscal_year, filters.company), as_dict=True)
|
||||
|
||||
#Get target distribution details of accounts of cost center
|
||||
@@ -84,8 +84,9 @@ def get_actual_details(cost_center, fiscal_year):
|
||||
ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,
|
||||
MONTHNAME(gl.posting_date) as month_name, b.cost_center
|
||||
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b
|
||||
where
|
||||
where
|
||||
b.name = ba.parent
|
||||
and b.docstatus = 1
|
||||
and ba.account=gl.account
|
||||
and gl.fiscal_year=%s
|
||||
and b.cost_center=%s
|
||||
|
||||
@@ -59,7 +59,6 @@ def execute(filters=None):
|
||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||
|
||||
for cash_flow_account in cash_flow_accounts:
|
||||
|
||||
section_data = []
|
||||
data.append({
|
||||
"account_name": cash_flow_account['section_header'],
|
||||
@@ -82,7 +81,8 @@ def execute(filters=None):
|
||||
account_data = get_account_type_based_data(filters.company,
|
||||
account['account_type'], period_list, filters.accumulated_values)
|
||||
account_data.update({
|
||||
"account_name": account['label'],
|
||||
"account_name": account['label'],
|
||||
"account": account['label'],
|
||||
"indent": 1,
|
||||
"parent_account": cash_flow_account['section_header'],
|
||||
"currency": company_currency
|
||||
@@ -129,7 +129,7 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
|
||||
def add_total_row_account(out, data, label, period_list, currency):
|
||||
total_row = {
|
||||
"account_name": "'" + _("{0}").format(label) + "'",
|
||||
"account": None,
|
||||
"account": "'" + _("{0}").format(label) + "'",
|
||||
"currency": currency
|
||||
}
|
||||
for row in data:
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -34,7 +34,7 @@ def get_net_profit_loss(income, expense, period_list, company):
|
||||
total = 0
|
||||
net_profit_loss = {
|
||||
"account_name": "'" + _("Net Profit / Loss") + "'",
|
||||
"account": None,
|
||||
"account": "'" + _("Net Profit / Loss") + "'",
|
||||
"warn_if_negative": True,
|
||||
"currency": frappe.db.get_value("Company", company, "default_currency")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -302,6 +302,11 @@ def make_purchase_invoice(source_name, target_doc=None):
|
||||
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||
target.base_amount = target.amount * flt(source_parent.conversion_rate)
|
||||
target.qty = target.amount / flt(obj.rate) if (flt(obj.rate) and flt(obj.billed_amt)) else flt(obj.qty)
|
||||
|
||||
item = frappe.db.get_value("Item", target.item_code, ["item_group", "buying_cost_center"], as_dict=1)
|
||||
target.cost_center = frappe.db.get_value("Project", obj.project, "cost_center") \
|
||||
or item.buying_cost_center \
|
||||
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
|
||||
|
||||
doc = get_mapped_doc("Purchase Order", source_name, {
|
||||
"Purchase Order": {
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'purchase_order',
|
||||
'internal_links': {
|
||||
'Material Request': ['items', 'material_request'],
|
||||
'Supplier Quotation': ['items', 'supplier_quotation'],
|
||||
'Project': ['project'],
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Purchase Receipt', 'Purchase Invoice']
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'purchase_order',
|
||||
'internal_links': {
|
||||
'Material Request': ['items', 'material_request'],
|
||||
'Supplier Quotation': ['items', 'supplier_quotation'],
|
||||
'Project': ['project'],
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Material Request', 'Supplier Quotation', 'Project']
|
||||
},
|
||||
{
|
||||
'label': _('Sub-contracting'),
|
||||
'items': ['Stock Entry']
|
||||
},
|
||||
]
|
||||
}
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Purchase Receipt', 'Purchase Invoice']
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Material Request', 'Supplier Quotation', 'Project']
|
||||
},
|
||||
{
|
||||
'label': _('Sub-contracting'),
|
||||
'items': ['Stock Entry']
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'docstatus': 1,
|
||||
'fieldname': 'request_for_quotation',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Supplier Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'docstatus': 1,
|
||||
'fieldname': 'request_for_quotation',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Supplier Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -1,17 +1,18 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
|
||||
'fieldname': 'supplier',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Procurement'),
|
||||
'items': ['Request for Quotation', 'Supplier Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Orders'),
|
||||
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
|
||||
}
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
|
||||
'fieldname': 'supplier',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Procurement'),
|
||||
'items': ['Request for Quotation', 'Supplier Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Orders'),
|
||||
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,20 +1,21 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'supplier_quotation',
|
||||
'internal_links': {
|
||||
'Material Request': ['items', 'material_request'],
|
||||
'Request for Quotation': ['items', 'request_for_quotation'],
|
||||
'Project': ['items', 'project'],
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Purchase Order']
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'supplier_quotation',
|
||||
'internal_links': {
|
||||
'Material Request': ['items', 'material_request'],
|
||||
'Request for Quotation': ['items', 'request_for_quotation'],
|
||||
'Project': ['items', 'project'],
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Material Request', 'Request for Quotation', 'Project']
|
||||
},
|
||||
]
|
||||
}
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Purchase Order']
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Material Request', 'Request for Quotation', 'Project']
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ class AccountsController(TransactionBase):
|
||||
|
||||
return self.__company_currency
|
||||
|
||||
def onload(self):
|
||||
self.get("__onload").make_payment_via_journal_entry = frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
|
||||
|
||||
def validate(self):
|
||||
if self.get("_action") and self._action != "update_after_submit":
|
||||
self.set_missing_values(for_validate=True)
|
||||
@@ -144,7 +147,7 @@ class AccountsController(TransactionBase):
|
||||
self.conversion_rate = get_exchange_rate(self.currency,
|
||||
self.company_currency)
|
||||
|
||||
def set_missing_item_details(self):
|
||||
def set_missing_item_details(self, for_validate=False):
|
||||
"""set missing item values"""
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
|
||||
@@ -196,7 +199,7 @@ class AccountsController(TransactionBase):
|
||||
(1.0 - (flt(item.discount_percentage) / 100.0)), item.precision("rate"))
|
||||
|
||||
if self.doctype == "Purchase Invoice":
|
||||
self.set_expense_account()
|
||||
self.set_expense_account(for_validate)
|
||||
|
||||
def set_taxes(self):
|
||||
if not self.meta.get_field("taxes"):
|
||||
@@ -662,7 +665,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 +677,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)
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class BuyingController(StockController):
|
||||
if getattr(self, "supplier", None):
|
||||
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions))
|
||||
|
||||
self.set_missing_item_details()
|
||||
self.set_missing_item_details(for_validate)
|
||||
|
||||
def set_supplier_from_item_default(self):
|
||||
if self.meta.get_field("supplier") and not self.supplier:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,6 +23,7 @@ class SellingController(StockController):
|
||||
self.grand_total)
|
||||
|
||||
def onload(self):
|
||||
super(SellingController, self).onload()
|
||||
if self.doctype in ("Sales Order", "Delivery Note", "Sales Invoice"):
|
||||
for item in self.get("items"):
|
||||
item.update(get_bin_details(item.item_code,
|
||||
|
||||
@@ -301,12 +301,7 @@ class StatusUpdater(Document):
|
||||
ref_doc = frappe.get_doc(ref_dt, ref_dn)
|
||||
|
||||
ref_doc.db_set("per_billed", per_billed)
|
||||
|
||||
if frappe.get_meta(ref_dt).get_field("billing_status"):
|
||||
if per_billed < 0.001: billing_status = "Not Billed"
|
||||
elif per_billed >= 99.99: billing_status = "Fully Billed"
|
||||
else: billing_status = "Partly Billed"
|
||||
ref_doc.db_set('billing_status', billing_status)
|
||||
ref_doc.set_status(update=True)
|
||||
|
||||
def get_tolerance_for(item_code, item_tolerance={}, global_tolerance=None):
|
||||
"""
|
||||
|
||||
@@ -338,7 +338,7 @@ class calculate_taxes_and_totals(object):
|
||||
tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail, separators=(',', ':'))
|
||||
|
||||
def set_discount_amount(self):
|
||||
if not self.doc.discount_amount and self.doc.additional_discount_percentage:
|
||||
if self.doc.additional_discount_percentage:
|
||||
self.doc.discount_amount = flt(flt(self.doc.get(scrub(self.doc.apply_discount_on)))
|
||||
* self.doc.additional_discount_percentage / 100, self.doc.precision("discount_amount"))
|
||||
|
||||
|
||||
@@ -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"]
|
||||
@@ -48,7 +49,10 @@ def get_data(filters, conditions):
|
||||
posting_date = 't1.posting_date'
|
||||
|
||||
if conditions["based_on_select"] in ["t1.project,", "t2.project,"]:
|
||||
cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL'
|
||||
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)
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'prevdoc_docname',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'prevdoc_docname',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 82 KiB |
BIN
erpnext/docs/assets/img/buying/material-request-flowchart.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 47 KiB |
@@ -3,6 +3,7 @@ opening-accounts
|
||||
sales-invoice
|
||||
point-of-sale-pos-invoice
|
||||
purchase-invoice
|
||||
payments
|
||||
journal-entry
|
||||
payment-entry
|
||||
multi-currency-accounting
|
||||
|
||||
48
erpnext/docs/user/manual/en/accounts/payments.md
Normal file
@@ -0,0 +1,48 @@
|
||||
Payment can be made against following transactions.
|
||||
|
||||
1. Sales Invoice.
|
||||
2. Purchase Invoice.
|
||||
3. Sales Order (Advance Payment)
|
||||
4. Purchase Order (Advance Payment)
|
||||
|
||||
In ERPNext, there is two options through which user can capture the payment
|
||||
|
||||
1. Payment Entry(Default).
|
||||
2. Journal Entry.
|
||||
|
||||
## Payment Entry
|
||||
|
||||
####Step 1: Make Payment
|
||||
|
||||
On submitting a document against which Payment Entry can be made, you will find Make Payment button.
|
||||
|
||||
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/payment-entry-1.png">
|
||||
|
||||
####Step 2: Payment Entry
|
||||
|
||||
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/payment-entry-9.png">
|
||||
|
||||
For more details about payment entry [check here.](https://frappe.github.io/erpnext/user/manual/en/accounts/payment-entry)
|
||||
|
||||
## Journal Entry
|
||||
|
||||
To make paymant using journal entry, check below steps
|
||||
|
||||
####Step 1: Activate Payment via Journal Entry
|
||||
|
||||
Goto Accounts Settings > checked Make Payment via Journal Entry
|
||||
|
||||
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/account-settings.png">
|
||||
|
||||
####Step 2: Make Payment
|
||||
|
||||
On submitting a document against which Journal Entry can be made, you will find Make Payment button.
|
||||
|
||||
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/payment-entry-1.png">
|
||||
|
||||
####Step 3: Journal Entry
|
||||
|
||||
Save and submit the journal entry to record the payament against the invoice
|
||||
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/journal-entry.png">
|
||||
|
||||
For more details about journal entry [check here.](https://frappe.github.io/erpnext/user/manual/en/accounts/journal-entry)
|
||||
@@ -18,6 +18,11 @@ choose to start its fiscal year on October 1. That way, they know what their
|
||||
income will be for that year, and can adjust their expenses to maintain their
|
||||
desired profit margins.
|
||||
|
||||
To set the Fiscal Year as default, click on the 'Default' button.
|
||||
|
||||
In case you have multiple companies sharing the same Fiscal Year, you can add
|
||||
it into the grid as shown below.
|
||||
|
||||
<img class="screenshot" alt="Fiscal Year" src="{{docs_base_url}}/assets/img/accounts/fiscal-year.png">
|
||||
|
||||
{next}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
A Material Request is a simple document identifying a requirement of a set of
|
||||
Items (products or services) for a particular reason.
|
||||
|
||||

|
||||

|
||||
|
||||
To generate a Material Request manually go to:
|
||||
|
||||
@@ -25,6 +25,8 @@ A Material Request can be of type:
|
||||
* Material Issue - If the requested material is to be Issued.
|
||||
* Manufacture - If the requested material is to be Produced.
|
||||
|
||||
The User can also raise a [Request For Quotation]({{docs_base_url}}/user/manual/en/buying/request-for-quotation.html) against a Material Request. To create a Request For Quotation the user can click on 'Make'.
|
||||
|
||||
> Info: Material Request is not mandatory. It is ideal if you have centralized
|
||||
buying so that you can collect this information from various departments.
|
||||
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the attendance of this Employee'),
|
||||
'fieldname': 'employee',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Leave and Attendance'),
|
||||
'items': ['Attendance', 'Leave Application', 'Leave Allocation']
|
||||
},
|
||||
{
|
||||
'label': _('Payroll'),
|
||||
'items': ['Salary Structure', 'Salary Slip', 'Timesheet']
|
||||
},
|
||||
{
|
||||
'label': _('Expense'),
|
||||
'items': ['Expense Claim']
|
||||
},
|
||||
{
|
||||
'label': _('Evaluation'),
|
||||
'items': ['Appraisal']
|
||||
}
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the attendance of this Employee'),
|
||||
'fieldname': 'employee',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Leave and Attendance'),
|
||||
'items': ['Attendance', 'Leave Application', 'Leave Allocation']
|
||||
},
|
||||
{
|
||||
'label': _('Payroll'),
|
||||
'items': ['Salary Structure', 'Salary Slip', 'Timesheet']
|
||||
},
|
||||
{
|
||||
'label': _('Expense'),
|
||||
'items': ['Expense Claim']
|
||||
},
|
||||
{
|
||||
'label': _('Evaluation'),
|
||||
'items': ['Appraisal']
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -129,9 +129,6 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
||||
doc.total_sanctioned_amount = 0;
|
||||
$.each((doc.expenses || []), function(i, d) {
|
||||
doc.total_claimed_amount += d.claim_amount;
|
||||
if(d.sanctioned_amount==null) {
|
||||
d.sanctioned_amount = d.claim_amount;
|
||||
}
|
||||
doc.total_sanctioned_amount += d.sanctioned_amount;
|
||||
});
|
||||
|
||||
@@ -144,17 +141,6 @@ cur_frm.cscript.calculate_total_amount = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.claim_amount = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
|
||||
var child = locals[cdt][cdn];
|
||||
refresh_field("sanctioned_amount", child.name, child.parentfield);
|
||||
}
|
||||
|
||||
cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) {
|
||||
cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message);
|
||||
@@ -172,6 +158,25 @@ erpnext.expense_claim = {
|
||||
}
|
||||
}
|
||||
|
||||
frappe.ui.form.on("Expense Claim Detail", {
|
||||
claim_amount: function(frm, cdt, cdn) {
|
||||
var child = locals[cdt][cdn];
|
||||
var doc = frm.doc;
|
||||
|
||||
if(!child.sanctioned_amount){
|
||||
frappe.model.set_value(cdt, cdn, 'sanctioned_amount', child.claim_amount)
|
||||
}
|
||||
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
},
|
||||
|
||||
sanctioned_amount: function(frm, cdt, cdn) {
|
||||
var doc = frm.doc;
|
||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
frappe.ui.form.on("Expense Claim", "employee_name", function(frm) {
|
||||
erpnext.expense_claim.set_title(frm);
|
||||
});
|
||||
|
||||
@@ -97,12 +97,19 @@ class LeaveApplication(Document):
|
||||
.format(formatdate(future_allocation[0].from_date), future_allocation[0].name))
|
||||
|
||||
def validate_salary_processed_days(self):
|
||||
last_processed_pay_slip = frappe.db.sql("""select start_date, end_date from `tabSalary Slip`
|
||||
where docstatus != 2 and employee = %s and ((%s between start_date and end_date) or (%s between start_date and end_date)) order by modified desc limit 1""",(self.employee, self.to_date, self.from_date))
|
||||
if not frappe.db.get_value("Leave Type", self.leave_type, "is_lwp"):
|
||||
return
|
||||
|
||||
last_processed_pay_slip = frappe.db.sql("""
|
||||
select start_date, end_date from `tabSalary Slip`
|
||||
where docstatus != 2 and employee = %s
|
||||
and ((%s between start_date and end_date) or (%s between start_date and end_date))
|
||||
order by modified desc limit 1
|
||||
""",(self.employee, self.to_date, self.from_date))
|
||||
|
||||
if last_processed_pay_slip:
|
||||
frappe.throw(_("Salary already processed for period between {0} and {1}, Leave application period cannot be between this date range.").
|
||||
format(formatdate(last_processed_pay_slip[0][0]), formatdate(last_processed_pay_slip[0][1])))
|
||||
frappe.throw(_("Salary already processed for period between {0} and {1}, Leave application period cannot be between this date range.").format(formatdate(last_processed_pay_slip[0][0]),
|
||||
formatdate(last_processed_pay_slip[0][1])))
|
||||
|
||||
|
||||
def show_block_day_warning(self):
|
||||
|
||||
@@ -14,7 +14,7 @@ class TestSalarySlip(unittest.TestCase):
|
||||
for dt in ["Leave Application", "Leave Allocation", "Salary Slip"]:
|
||||
frappe.db.sql("delete from `tab%s`" % dt)
|
||||
|
||||
make_allocation_record(leave_type="_Test Leave Type LWP")
|
||||
# make_allocation_record(leave_type="_Test Leave Type")
|
||||
|
||||
frappe.db.set_value("Company", "_Test Company", "default_holiday_list", "_Test Holiday List")
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,9 +55,11 @@ class ProductionOrder(Document):
|
||||
if not self.expected_delivery_date:
|
||||
self.expected_delivery_date = so[0].delivery_date
|
||||
|
||||
self.project = so[0].project
|
||||
if so[0].project:
|
||||
self.project = so[0].project
|
||||
|
||||
self.validate_production_order_against_so()
|
||||
if not self.material_request:
|
||||
self.validate_production_order_against_so()
|
||||
else:
|
||||
frappe.throw(_("Sales Order {0} is not valid").format(self.sales_order))
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_per
|
||||
from erpnext.manufacturing.doctype.production_order.production_order \
|
||||
import make_stock_entry, ItemHasVariantError
|
||||
from erpnext.stock.doctype.stock_entry import test_stock_entry
|
||||
from erpnext.stock.doctype.item.test_item import get_total_projected_qty
|
||||
from erpnext.stock.utils import get_bin
|
||||
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
|
||||
|
||||
class TestProductionOrder(unittest.TestCase):
|
||||
def setUp(self):
|
||||
@@ -172,6 +174,28 @@ class TestProductionOrder(unittest.TestCase):
|
||||
self.assertEqual(self.bin1_at_start.projected_qty,
|
||||
cint(bin1_on_cancel.projected_qty))
|
||||
|
||||
def test_projected_qty_for_production_and_sales_order(self):
|
||||
before_production_order = get_bin(self.item, self.warehouse)
|
||||
before_production_order.update_reserved_qty_for_production()
|
||||
|
||||
self.pro_order = make_prod_order_test_record(item="_Test FG Item", qty=2,
|
||||
source_warehouse=self.warehouse)
|
||||
|
||||
after_production_order = get_bin(self.item, self.warehouse)
|
||||
|
||||
sales_order = make_sales_order(item = self.item, qty = 2)
|
||||
after_sales_order = get_bin(self.item, self.warehouse)
|
||||
|
||||
self.assertEqual(cint(before_production_order.reserved_qty_for_production) + 2,
|
||||
cint(after_sales_order.reserved_qty_for_production))
|
||||
self.assertEqual(cint(before_production_order.projected_qty),
|
||||
cint(after_sales_order.projected_qty) + 2)
|
||||
|
||||
total_projected_qty = get_total_projected_qty(self.item)
|
||||
|
||||
item_doc = frappe.get_doc('Item', self.item)
|
||||
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
|
||||
|
||||
def test_reserved_qty_for_production_on_stock_entry(self):
|
||||
test_stock_entry.make_stock_entry(item_code="_Test Item",
|
||||
target= self.warehouse, qty=100, basic_rate=100)
|
||||
|
||||
@@ -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
|
||||
@@ -284,7 +282,7 @@ execute:frappe.reload_doc('projects', 'doctype', 'project_user')
|
||||
erpnext.patches.v7_0.convert_timelogbatch_to_timesheet
|
||||
erpnext.patches.v7_0.convert_timelog_to_timesheet
|
||||
erpnext.patches.v7_0.move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet
|
||||
erpnext.patches.v7_0.remove_doctypes_and_reports
|
||||
erpnext.patches.v7_0.remove_doctypes_and_reports #2016-10-29
|
||||
erpnext.patches.v7_0.update_maintenance_module_in_doctype
|
||||
erpnext.patches.v7_0.update_prevdoc_values_for_supplier_quotation_item
|
||||
erpnext.patches.v7_0.rename_advance_table_fields
|
||||
@@ -310,7 +308,16 @@ erpnext.patches.v7_0.update_refdoc_in_landed_cost_voucher
|
||||
erpnext.patches.v7_0.set_material_request_type_in_item
|
||||
erpnext.patches.v7_0.rename_examination_to_assessment
|
||||
erpnext.patches.v7_0.set_portal_settings
|
||||
erpnext.patches.v7_0.update_change_amount_account
|
||||
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")
|
||||
execute:frappe.db.sql("delete from `tabTimesheet Detail` where NOT EXISTS (select name from `tabTimesheet` where name = `tabTimesheet Detail`.parent)")
|
||||
erpnext.patches.v7_0.update_mode_of_payment_type
|
||||
finally:erpnext.patches.v7_0.update_timesheet_communications
|
||||
erpnext.patches.v7_0.update_status_of_zero_amount_sales_order
|
||||
erpnext.patches.v7_0.repost_bin_qty_and_item_projected_qty
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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])
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
@@ -1,9 +1,26 @@
|
||||
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')""")
|
||||
|
||||
frappe.db.sql("""delete from `tabDocField` where parent in ('Time Log', 'Time Log Batch')""")
|
||||
frappe.db.sql("""update `tabCustom Script` set dt = 'Timesheet' where dt = 'Time Log'""")
|
||||
|
||||
for data in frappe.db.sql(""" select label, fieldname from `tabCustom Field` where dt = 'Time Log'""", as_dict=1):
|
||||
custom_field = frappe.get_doc({
|
||||
'doctype': 'Custom Field',
|
||||
'label': data.label,
|
||||
'dt': 'Timesheet Detail',
|
||||
'fieldname': data.fieldname,
|
||||
'fieldtype': data.fieldtype or "Data"
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
frappe.db.sql("""delete from `tabCustom Field` where dt = 'Time Log'""")
|
||||
frappe.reload_doc('projects', 'doctype', 'timesheet')
|
||||
frappe.reload_doc('projects', 'doctype', 'timesheet_detail')
|
||||
|
||||
report = "Daily Time Log Summary"
|
||||
if frappe.db.exists("Report", report):
|
||||
frappe.delete_doc('Report', report)
|
||||
frappe.delete_doc('Report', report)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -78,9 +78,12 @@ def execute():
|
||||
|
||||
for doctype, cols in dt_cols_de.items():
|
||||
source_cols = "`" + "`, `".join(standard_cols_de + cols) + "`"
|
||||
|
||||
frappe.db.sql("""INSERT INTO `tabSalary Component` ({0}) SELECT {1} FROM `tab{2}`"""
|
||||
.format(target_cols, source_cols, doctype))
|
||||
try:
|
||||
frappe.db.sql("""INSERT INTO `tabSalary Component` ({0}) SELECT {1} FROM `tab{2}`"""
|
||||
.format(target_cols, source_cols, doctype))
|
||||
except Exception, e:
|
||||
if e.args[0]==1062:
|
||||
pass
|
||||
|
||||
update_customizations()
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from erpnext.stock.doctype.bin.bin import update_item_projected_qty
|
||||
|
||||
def execute():
|
||||
repost_bin_qty()
|
||||
repost_item_projected_qty()
|
||||
|
||||
def repost_bin_qty():
|
||||
for bin in frappe.db.sql(""" select name from `tabBin`
|
||||
where (actual_qty + ordered_qty + indented_qty + planned_qty- reserved_qty - reserved_qty_for_production) != projected_qty """, as_dict=1):
|
||||
bin_doc = frappe.get_doc('Bin', bin.name)
|
||||
bin_doc.set_projected_qty()
|
||||
bin_doc.db_set("projected_qty", bin_doc.projected_qty, update_modified = False)
|
||||
|
||||
def repost_item_projected_qty():
|
||||
for data in frappe.db.sql(""" select
|
||||
`tabBin`.item_code as item_code,
|
||||
sum(`tabBin`.projected_qty) as projected_qty,
|
||||
`tabItem`.total_projected_qty as total_projected_qty
|
||||
from
|
||||
`tabBin`, `tabItem`
|
||||
where `tabBin`.item_code = `tabItem`.name
|
||||
group by `tabBin`.item_code having projected_qty <> total_projected_qty """, as_dict=1):
|
||||
update_item_projected_qty(data.item_code)
|
||||
@@ -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}):
|
||||
|
||||
20
erpnext/patches/v7_0/set_party_name_in_payment_entry.py
Normal 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)
|
||||
|
||||
@@ -10,9 +10,11 @@ def execute():
|
||||
for dt in ("assessment", "announcement", "course", "fees"):
|
||||
frappe.reload_doc("schools", "doctype", dt)
|
||||
|
||||
frappe.reload_doc('website', 'doctype', 'portal_menu_item')
|
||||
|
||||
frappe.get_doc('Portal Settings').sync_menu()
|
||||
|
||||
if 'schools' in frappe.get_installed_apps():
|
||||
domainify.setup_domain('Education')
|
||||
else:
|
||||
domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
|
||||
domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
|
||||
|
||||
@@ -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)
|
||||
19
erpnext/patches/v7_0/update_change_amount_account.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
|
||||
|
||||
for company in frappe.db.sql("""select company from `tabSales Invoice`
|
||||
where change_amount <> 0 and account_for_change_amount is null group by company""", as_list = 1):
|
||||
cash_account = get_default_bank_cash_account(company[0], 'Cash').get('account')
|
||||
if not cash_account:
|
||||
bank_account = get_default_bank_cash_account(company[0], 'Bank').get('account')
|
||||
cash_account = bank_account
|
||||
|
||||
if cash_account:
|
||||
frappe.db.sql("""update `tabSales Invoice`
|
||||
set account_for_change_amount = %(cash_account)s where change_amount <> 0
|
||||
and company = %(company)s and account_for_change_amount is null""",
|
||||
{'cash_account': cash_account, 'company': company[0]})
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
29
erpnext/patches/v7_0/update_mode_of_payment_type.py
Normal 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)
|
||||
11
erpnext/patches/v7_0/update_status_for_timesheet.py
Normal 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""")
|
||||
@@ -0,0 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
for data in frappe.get_all('Sales Order', fields = ["name"], filters = [["docstatus", "=", "1"], ["grand_total", "=", "0"]]):
|
||||
sales_order = frappe.get_doc('Sales Order', data.name)
|
||||
sales_order.set_status(update=True, update_modified = False)
|
||||
27
erpnext/patches/v7_0/update_timesheet_communications.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
if frappe.db.table_exists("Time Log"):
|
||||
timesheet = frappe.db.sql("""SELECT ts.name AS name, tl.name AS timelogname,
|
||||
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""", as_dict=1)
|
||||
|
||||
for data in timesheet:
|
||||
frappe.db.sql(""" update `tabTimesheet` set creation = %(creation)s,
|
||||
owner = %(owner)s, modified = %(modified)s, modified_by = %(modified_by)s
|
||||
where name = %(name)s""", data)
|
||||
|
||||
frappe.db.sql("""
|
||||
update
|
||||
tabCommunication
|
||||
set
|
||||
reference_doctype = "Timesheet", reference_name = %(timesheet)s
|
||||
where
|
||||
reference_doctype = "Time Log" and reference_name = %(timelog)s
|
||||
""", {'timesheet': data.name, 'timelog': data.timelogname}, auto_commit=1)
|
||||
@@ -2,6 +2,14 @@
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Homepage', {
|
||||
setup: function(frm) {
|
||||
frm.fields_dict["products"].grid.get_field("item_code").get_query = function(){
|
||||
return {
|
||||
filters: {'show_in_website': 1}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
||||
},
|
||||
@@ -35,5 +43,12 @@ frappe.ui.form.on('Homepage Featured Product', {
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
view: function(frm, cdt, cdn){
|
||||
var child= locals[cdt][cdn]
|
||||
if(child.item_code && frm.doc.products_url){
|
||||
window.location.href = frm.doc.products_url + '/' + encodeURIComponent(child.item_code);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the Time Sheets created against this project'),
|
||||
'fieldname': 'project',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Project'),
|
||||
'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue']
|
||||
},
|
||||
{
|
||||
'label': _('Material'),
|
||||
'items': ['Material Request', 'BOM', 'Stock Entry']
|
||||
},
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the Time Sheets created against this project'),
|
||||
'fieldname': 'project',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Project'),
|
||||
'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue']
|
||||
},
|
||||
{
|
||||
'label': _('Material'),
|
||||
'items': ['Material Request', 'BOM', 'Stock Entry']
|
||||
},
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -139,7 +145,7 @@ class Timesheet(Document):
|
||||
|
||||
def validate_dates(self):
|
||||
for data in self.time_logs:
|
||||
if time_diff_in_hours(data.to_time, data.from_time) < 0:
|
||||
if data.from_time and data.to_time and time_diff_in_hours(data.to_time, data.from_time) < 0:
|
||||
frappe.throw(_("To date cannot be before from date"))
|
||||
|
||||
def validate_time_logs(self):
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -15,21 +15,17 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
|
||||
},
|
||||
apply_pricing_rule_on_item: function(item){
|
||||
if(!item.margin_type){
|
||||
item.margin_rate_or_amount = 0.0;
|
||||
}
|
||||
|
||||
if(item.margin_type == "Percentage"){
|
||||
item.total_margin = item.price_list_rate + item.price_list_rate * ( item.margin_rate_or_amount / 100);
|
||||
}else{
|
||||
item.total_margin = item.price_list_rate + item.margin_rate_or_amount;
|
||||
}
|
||||
|
||||
item.rate = flt(item.total_margin , 2);
|
||||
item.rate = flt(item.total_margin , precision("rate", item));
|
||||
|
||||
if(item.discount_percentage){
|
||||
discount_value = flt(item.total_margin) * flt(item.discount_percentage) / 100;
|
||||
item.rate = flt((item.total_margin) - (discount_value), precision('rate'));
|
||||
item.rate = flt((item.total_margin) - (discount_value), precision('rate', item));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -719,7 +720,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
"brand": d.brand,
|
||||
"qty": d.qty,
|
||||
"parenttype": d.parenttype,
|
||||
"parent": d.parent
|
||||
"parent": d.parent,
|
||||
"pricing_rule": d.pricing_rule
|
||||
});
|
||||
|
||||
// if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list
|
||||
@@ -988,7 +990,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
|
||||
make_payment_entry: function() {
|
||||
return frappe.call({
|
||||
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry",
|
||||
method: cur_frm.cscript.get_method_for_payment(),
|
||||
args: {
|
||||
"dt": cur_frm.doc.doctype,
|
||||
"dn": cur_frm.doc.name
|
||||
@@ -999,5 +1001,18 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
// cur_frm.refresh_fields()
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
get_method_for_payment: function(){
|
||||
method = "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry"
|
||||
if(cur_frm.doc.__onload && cur_frm.doc.__onload.make_payment_via_journal_entry){
|
||||
if(in_list(['Sales Invoice', 'Purchase Invoice'], cur_frm.doc.doctype)){
|
||||
method = "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_invoice"
|
||||
}else {
|
||||
method= "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_order"
|
||||
}
|
||||
}
|
||||
|
||||
return method
|
||||
}
|
||||
});
|
||||
@@ -1,15 +1,16 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the attendance of this Student'),
|
||||
'fieldname': 'student',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Student Log', 'Student Group', 'Student Attendance']
|
||||
},
|
||||
{
|
||||
'items': ['Program Enrollment', 'Fees', 'Assessment', 'Guardian']
|
||||
}
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the attendance of this Student'),
|
||||
'fieldname': 'student',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Student Log', 'Student Group', 'Student Attendance']
|
||||
},
|
||||
{
|
||||
'items': ['Program Enrollment', 'Fees', 'Assessment', 'Guardian']
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,25 +1,26 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
|
||||
'fieldname': 'customer',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Pre Sales'),
|
||||
'items': ['Opportunity', 'Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Orders'),
|
||||
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
|
||||
},
|
||||
{
|
||||
'label': _('Support'),
|
||||
'items': ['Issue']
|
||||
},
|
||||
{
|
||||
'label': _('Projects'),
|
||||
'items': ['Project']
|
||||
}
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
|
||||
'fieldname': 'customer',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Pre Sales'),
|
||||
'items': ['Opportunity', 'Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Orders'),
|
||||
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
|
||||
},
|
||||
{
|
||||
'label': _('Support'),
|
||||
'items': ['Issue']
|
||||
},
|
||||
{
|
||||
'label': _('Projects'),
|
||||
'items': ['Project']
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'prevdoc_docname',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Sales Order']
|
||||
},
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'prevdoc_docname',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related'),
|
||||
'items': ['Sales Order']
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -442,6 +442,11 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
|
||||
target.amount = flt(source.amount) - flt(source.billed_amt)
|
||||
target.base_amount = target.amount * flt(source_parent.conversion_rate)
|
||||
target.qty = target.amount / flt(source.rate) if (source.rate and source.billed_amt) else source.qty
|
||||
|
||||
item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
|
||||
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
|
||||
or item.selling_cost_center \
|
||||
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
|
||||
|
||||
doclist = get_mapped_doc("Sales Order", source_name, {
|
||||
"Sales Order": {
|
||||
@@ -553,6 +558,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:
|
||||
|
||||
@@ -1,33 +1,34 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'sales_order',
|
||||
'non_standard_fieldnames': {
|
||||
'Delivery Note': 'against_sales_order',
|
||||
},
|
||||
'internal_links': {
|
||||
'Quotation': ['items', 'prevdoc_docname']
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Fulfillment'),
|
||||
'items': ['Sales Invoice', 'Delivery Note']
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'sales_order',
|
||||
'non_standard_fieldnames': {
|
||||
'Delivery Note': 'against_sales_order',
|
||||
},
|
||||
{
|
||||
'label': _('Purchasing'),
|
||||
'items': ['Material Request', 'Purchase Order']
|
||||
'internal_links': {
|
||||
'Quotation': ['items', 'prevdoc_docname']
|
||||
},
|
||||
{
|
||||
'label': _('Projects'),
|
||||
'items': ['Project']
|
||||
},
|
||||
{
|
||||
'label': _('Manufacturing'),
|
||||
'items': ['Production Order']
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Fulfillment'),
|
||||
'items': ['Sales Invoice', 'Delivery Note']
|
||||
},
|
||||
{
|
||||
'label': _('Purchasing'),
|
||||
'items': ['Material Request', 'Purchase Order']
|
||||
},
|
||||
{
|
||||
'label': _('Projects'),
|
||||
'items': ['Project']
|
||||
},
|
||||
{
|
||||
'label': _('Manufacturing'),
|
||||
'items': ['Production Order']
|
||||
},
|
||||
{
|
||||
'label': _('Reference'),
|
||||
'items': ['Quotation']
|
||||
},
|
||||
]
|
||||
}
|
||||