Compare commits
233 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
c7be851bf8 | ||
|
|
b6f33c7c4f | ||
|
|
bb2bceef62 | ||
|
|
3e805708dc | ||
|
|
7f165f19d2 | ||
|
|
774ce63b75 | ||
|
|
879cb6ebee | ||
|
|
16e15283b5 | ||
|
|
ef16d657ff | ||
|
|
d39f53319d | ||
|
|
609e2b4ca3 | ||
|
|
4f71190a85 | ||
|
|
a57bf5ee2e | ||
|
|
51a236f38b | ||
|
|
11c2207a8a | ||
|
|
a0da708d51 | ||
|
|
84e88b5d63 | ||
|
|
9d1b56f423 | ||
|
|
63bdd679d0 | ||
|
|
f92f04bffc | ||
|
|
6592899741 | ||
|
|
06b27757ab | ||
|
|
e21e1ebae2 | ||
|
|
a26bb96d2d | ||
|
|
fbe1563101 | ||
|
|
47a3f639ed | ||
|
|
efb5bf2cfc | ||
|
|
385311c8a2 | ||
|
|
0788ee62c1 | ||
|
|
ec6267e82a | ||
|
|
db05ac2414 | ||
|
|
f862505bf9 | ||
|
|
ea6d7e9b09 | ||
|
|
8f782e71af | ||
|
|
dac204b1e3 | ||
|
|
9c786948d5 | ||
|
|
6f1795cb3d | ||
|
|
01b555edc7 | ||
|
|
20b01873ab | ||
|
|
43accf4c07 | ||
|
|
9239ed5c44 | ||
|
|
713e2b7b62 | ||
|
|
3b6dc141c6 | ||
|
|
e4fb7b1b2f | ||
|
|
9a1bcac576 | ||
|
|
e68b089187 | ||
|
|
d8a372587d | ||
|
|
f04ce3c5a6 | ||
|
|
50f8262ac7 | ||
|
|
e30fadc661 | ||
|
|
f0937bf722 | ||
|
|
4810831678 | ||
|
|
7cdc6fd789 | ||
|
|
03e5ea3a0d | ||
|
|
9d5a07d101 | ||
|
|
b7bc6bd75d | ||
|
|
23a6d05622 | ||
|
|
b969c2cb60 | ||
|
|
c4e71fcc51 | ||
|
|
b8a8fb5877 | ||
|
|
734cf70b43 | ||
|
|
6fe3ac49cf | ||
|
|
e4e69ec027 | ||
|
|
386d9e1613 | ||
|
|
40c60b6182 | ||
|
|
95c998109d | ||
|
|
33bcaa8a07 | ||
|
|
4da2c81641 | ||
|
|
c2595aa902 | ||
|
|
613ef344f3 | ||
|
|
0c1be8df35 | ||
|
|
815ebafa7b | ||
|
|
8f7708ed5b | ||
|
|
1bd9f22add | ||
|
|
f369b5951e | ||
|
|
81995389ac | ||
|
|
fe913c9969 | ||
|
|
18d6162935 | ||
|
|
91d6544958 | ||
|
|
f640ad4389 | ||
|
|
39bc4b2a4c | ||
|
|
d973c1606a | ||
|
|
df9cf2ef8e | ||
|
|
528ab53b3a | ||
|
|
9cd356c7f0 | ||
|
|
de08639d49 | ||
|
|
987009bf35 | ||
|
|
c833cc8432 | ||
|
|
3f22ec9536 | ||
|
|
d643f2b249 | ||
|
|
b739dd24b2 | ||
|
|
c917423b01 | ||
|
|
6a23016f90 | ||
|
|
730f3e7aba | ||
|
|
033ed00c56 | ||
|
|
6c0d9579d2 | ||
|
|
09fc241d59 | ||
|
|
e78ef5f8c8 | ||
|
|
315a5e1b4d | ||
|
|
8bd2487533 | ||
|
|
08fb39f1ba | ||
|
|
baef2624a2 | ||
|
|
c41ab8d15b | ||
|
|
7127a8f522 |
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '7.0.26'
|
||||
__version__ = '7.0.51'
|
||||
|
||||
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
|
||||
}
|
||||
@@ -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]
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -65,24 +66,24 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "monthly_distribution",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Monthly Distribution",
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Monthly Distribution",
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
@@ -170,24 +171,25 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "company",
|
||||
"depends_on": "eval:in_list([\"Stop\", \"Warn\"], doc.action_if_accumulated_monthly_budget_exceeded)",
|
||||
"fieldname": "monthly_distribution",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"label": "Monthly Distribution",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"options": "Monthly Distribution",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
@@ -271,13 +273,14 @@
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-05-16 15:00:40.233685",
|
||||
"modified": "2016-08-18 14:46:02.653081",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import flt, getdate, add_months, get_last_day
|
||||
from frappe.utils import flt, getdate, add_months, get_last_day, fmt_money
|
||||
from frappe.model.naming import make_autoname
|
||||
from frappe.model.document import Document
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -73,25 +76,30 @@ def validate_expense_against_budget(args):
|
||||
args.posting_date, args.fiscal_year, budget.budget_amount)
|
||||
|
||||
args["month_end_date"] = get_last_day(args.posting_date)
|
||||
|
||||
|
||||
compare_expense_with_budget(args, budget.cost_center,
|
||||
budget_amount, _("Accumulated Monthly"), monthly_action)
|
||||
|
||||
elif yearly_action in ["Stop", "Warn"]:
|
||||
compare_expense_with_budget(args, budget.cost_center,
|
||||
flt(budget.budget_amount), _("Annual"), yearly_action)
|
||||
if yearly_action in ("Stop", "Warn") and monthly_action != "Stop" \
|
||||
and yearly_action != monthly_action:
|
||||
compare_expense_with_budget(args, budget.cost_center,
|
||||
flt(budget.budget_amount), _("Annual"), yearly_action)
|
||||
|
||||
def compare_expense_with_budget(args, cost_center, budget_amount, action_for, action):
|
||||
actual_expense = get_actual_expense(args, cost_center)
|
||||
if actual_expense > budget_amount:
|
||||
diff = actual_expense - budget_amount
|
||||
currency = frappe.db.get_value('Company', frappe.db.get_value('Cost Center',
|
||||
cost_center, 'company'), 'default_currency')
|
||||
|
||||
msg = _("{0} Budget for Account {1} against Cost Center {2} is {3}. It will exceed by {4}").format(_(action_for), args.account, cost_center, budget_amount, diff)
|
||||
msg = _("{0} Budget for Account {1} against Cost Center {2} is {3}. It will exceed by {4}").format(_(action_for),
|
||||
frappe.bold(args.account), frappe.bold(cost_center),
|
||||
frappe.bold(fmt_money(budget_amount, currency=currency)), frappe.bold(fmt_money(diff, currency=currency)))
|
||||
|
||||
if action=="Stop":
|
||||
frappe.throw(msg, BudgetError)
|
||||
else:
|
||||
frappe.msgprint(msg)
|
||||
frappe.msgprint(msg, indicator='orange')
|
||||
|
||||
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
|
||||
distribution = {}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -32,8 +32,13 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
cur_frm.toggle_display('sb1', doc.is_group==0)
|
||||
cur_frm.set_intro(intro_txt);
|
||||
|
||||
cur_frm.add_custom_button(__('Chart of Cost Centers'),
|
||||
function() { frappe.set_route("Tree", "Cost Center"); }, __("View"))
|
||||
if(!cur_frm.doc.__islocal) {
|
||||
cur_frm.add_custom_button(__('Chart of Cost Centers'),
|
||||
function() { frappe.set_route("Tree", "Cost Center"); });
|
||||
|
||||
cur_frm.add_custom_button(__('Budget'),
|
||||
function() { frappe.set_route("List", "Budget", {'cost_center': cur_frm.doc.name}); });
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -118,6 +118,32 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "campaign",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Campaign",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Campaign",
|
||||
"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,
|
||||
@@ -690,6 +716,32 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "account_for_change_amount",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Account for Change Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -833,7 +885,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-08-06 17:05:59.990031",
|
||||
"modified": "2016-08-17 15:12:56.713748",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "POS Profile",
|
||||
|
||||
@@ -232,7 +232,8 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_query"
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
filters: {'is_purchase_item': 1}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,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,32 +261,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "bill_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Supplier Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "bill_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"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,
|
||||
"fieldname": "due_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
@@ -304,6 +288,34 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "bill_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Supplier Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "bill_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"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,
|
||||
"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-10 02:45:28.746569",
|
||||
"modified": "2016-09-23 18:02:45.349273",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice",
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -497,6 +500,18 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
i += 1
|
||||
|
||||
if self.update_stock and valuation_tax:
|
||||
for cost_center, amount in valuation_tax.items():
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.expenses_included_in_valuation,
|
||||
"cost_center": cost_center,
|
||||
"against": self.supplier,
|
||||
"credit": amount,
|
||||
"remarks": self.remarks or "Accounting Entry for Stock"
|
||||
})
|
||||
)
|
||||
|
||||
def make_payment_gl_entries(self, gl_entries):
|
||||
# Make Cash GL Entries
|
||||
if cint(self.is_paid) and self.cash_bank_account and self.paid_amount:
|
||||
|
||||
@@ -18,3 +18,13 @@ frappe.ui.form.on("Purchase Taxes and Charges", "add_deduct_tax", function(doc,
|
||||
}
|
||||
refresh_field('add_deduct_tax', d.name, 'taxes');
|
||||
});
|
||||
|
||||
frappe.ui.form.on("Purchase Taxes and Charges", "category", function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
|
||||
if (d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
|
||||
msgprint(__("Cannot deduct when category is for 'Valuation' or 'Vaulation and Total'"));
|
||||
d.add_deduct_tax = '';
|
||||
}
|
||||
refresh_field('add_deduct_tax', d.name, 'taxes');
|
||||
});
|
||||
|
||||
@@ -13,9 +13,9 @@ from erpnext.controllers.accounts_controller import get_taxes_and_charges
|
||||
@frappe.whitelist()
|
||||
def get_pos_data():
|
||||
doc = frappe.new_doc('Sales Invoice')
|
||||
doc.update_stock = 1;
|
||||
doc.is_pos = 1;
|
||||
pos_profile = get_pos_profile(doc.company) or {}
|
||||
doc.update_stock = pos_profile.get('update_stock')
|
||||
|
||||
if pos_profile.get('name'):
|
||||
pos_profile = frappe.get_doc('POS Profile', pos_profile.get('name'))
|
||||
@@ -23,7 +23,8 @@ def get_pos_data():
|
||||
frappe.msgprint('<a href="#List/POS Profile">'
|
||||
+ _("Welcome to POS: Create your POS Profile") + '</a>');
|
||||
|
||||
update_pos_profile_data(doc, pos_profile)
|
||||
company_data = get_company_data(doc.company)
|
||||
update_pos_profile_data(doc, pos_profile, company_data)
|
||||
update_multi_mode_option(doc, pos_profile)
|
||||
default_print_format = pos_profile.get('print_format') or "Point of Sale"
|
||||
print_template = frappe.db.get_value('Print Format', default_print_format, 'html')
|
||||
@@ -32,10 +33,9 @@ def get_pos_data():
|
||||
'doc': doc,
|
||||
'default_customer': pos_profile.get('customer'),
|
||||
'items': get_items(doc, pos_profile),
|
||||
'customers': get_customers(pos_profile, doc),
|
||||
'customers': get_customers(pos_profile, doc, company_data.default_currency),
|
||||
'pricing_rules': get_pricing_rules(doc),
|
||||
'print_template': print_template,
|
||||
'write_off_account': pos_profile.get('write_off_account'),
|
||||
'meta': {
|
||||
'invoice': frappe.get_meta('Sales Invoice'),
|
||||
'items': frappe.get_meta('Sales Invoice Item'),
|
||||
@@ -43,9 +43,16 @@ def get_pos_data():
|
||||
}
|
||||
}
|
||||
|
||||
def update_pos_profile_data(doc, pos_profile):
|
||||
company_data = frappe.db.get_value('Company', doc.company, '*', as_dict=1)
|
||||
def get_company_data(company):
|
||||
return frappe.get_all('Company', fields = ["*"], filters= {'name': company})[0]
|
||||
|
||||
def update_pos_profile_data(doc, pos_profile, company_data):
|
||||
doc.campaign = pos_profile.get('campaign')
|
||||
|
||||
doc.write_off_account = pos_profile.get('write_off_account') or \
|
||||
company_data.write_off_account
|
||||
doc.change_amount_account = pos_profile.get('change_amount_account') or \
|
||||
company_data.default_cash_account
|
||||
doc.taxes_and_charges = pos_profile.get('taxes_and_charges')
|
||||
if doc.taxes_and_charges:
|
||||
update_tax_table(doc)
|
||||
@@ -54,7 +61,8 @@ def update_pos_profile_data(doc, pos_profile):
|
||||
doc.conversion_rate = 1.0
|
||||
if doc.currency != company_data.default_currency:
|
||||
doc.conversion_rate = get_exchange_rate(doc.currency, company_data.default_currency)
|
||||
doc.selling_price_list = pos_profile.get('selling_price_list') or frappe.db.get_value('Selling Settings', None, 'selling_price_list')
|
||||
doc.selling_price_list = pos_profile.get('selling_price_list') or \
|
||||
frappe.db.get_value('Selling Settings', None, 'selling_price_list')
|
||||
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
|
||||
@@ -100,7 +108,7 @@ def update_tax_table(doc):
|
||||
|
||||
def get_items(doc, pos_profile):
|
||||
item_list = []
|
||||
for item in frappe.get_all("Item", fields=["*"], filters={'disabled': 0, 'has_variants': 0}):
|
||||
for item in frappe.get_all("Item", fields=["*"], filters={'disabled': 0, 'has_variants': 0, 'is_sales_item': 1}):
|
||||
item_doc = frappe.get_doc('Item', item.name)
|
||||
if item_doc.taxes:
|
||||
item.taxes = json.dumps(dict(([d.tax_type, d.tax_rate] for d in
|
||||
@@ -143,24 +151,25 @@ def get_serial_nos(item, pos_profile, company):
|
||||
|
||||
return serial_no_list
|
||||
|
||||
def get_customers(pos_profile, doc):
|
||||
def get_customers(pos_profile, doc, company_currency):
|
||||
filters = {'disabled': 0}
|
||||
customer_list = []
|
||||
customers = frappe.get_all("Customer", fields=["*"], filters = filters)
|
||||
|
||||
for customer in customers:
|
||||
customer_currency = get_party_account_currency('Customer', customer.name, doc.company) or doc.currency
|
||||
if customer_currency == doc.currency:
|
||||
if customer_currency == doc.currency or customer_currency == company_currency:
|
||||
customer_list.append(customer)
|
||||
return customer_list
|
||||
|
||||
def get_pricing_rules(doc):
|
||||
pricing_rules = ""
|
||||
if doc.ignore_pricing_rule == 0:
|
||||
pricing_rules = frappe.db.sql(""" Select * from `tabPricing Rule` where docstatus < 2 and disable = 0
|
||||
and selling = 1 and ifnull(company, '') in (%(company)s, '') and
|
||||
ifnull(for_price_list, '') in (%(price_list)s, '') and %(date)s between
|
||||
ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31') order by priority desc, name desc""",
|
||||
pricing_rules = frappe.db.sql(""" Select * from `tabPricing Rule` where docstatus < 2
|
||||
and ifnull(for_price_list, '') in (%(price_list)s, '') and selling = 1
|
||||
and ifnull(company, '') in (%(company)s, '') and disable = 0 and %(date)s
|
||||
between ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31')
|
||||
order by priority desc, name desc""",
|
||||
{'company': doc.company, 'price_list': doc.selling_price_list, 'date': nowdate()}, as_dict=1)
|
||||
return pricing_rules
|
||||
|
||||
@@ -173,17 +182,23 @@ def make_invoice(doc_list):
|
||||
|
||||
for docs in doc_list:
|
||||
for name, doc in docs.items():
|
||||
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
|
||||
validate_customer(doc)
|
||||
validate_item(doc)
|
||||
if not frappe.db.exists('Sales Invoice',
|
||||
{'offline_pos_name': name, 'docstatus': ("<", "2")}):
|
||||
validate_records(doc)
|
||||
si_doc = frappe.new_doc('Sales Invoice')
|
||||
si_doc.offline_pos_name = name
|
||||
si_doc.update(doc)
|
||||
submit_invoice(si_doc, name)
|
||||
name_list.append(name)
|
||||
else:
|
||||
name_list.append(name)
|
||||
|
||||
return name_list
|
||||
|
||||
def validate_records(doc):
|
||||
validate_customer(doc)
|
||||
validate_item(doc)
|
||||
|
||||
def validate_customer(doc):
|
||||
if not frappe.db.exists('Customer', doc.get('customer')):
|
||||
customer_doc = frappe.new_doc('Customer')
|
||||
@@ -195,8 +210,6 @@ def validate_customer(doc):
|
||||
frappe.db.commit()
|
||||
doc['customer'] = customer_doc.name
|
||||
|
||||
return doc
|
||||
|
||||
def validate_item(doc):
|
||||
for item in doc.get('items'):
|
||||
if not frappe.db.exists('Item', item.get('item_code')):
|
||||
@@ -222,6 +235,7 @@ def submit_invoice(si_doc, name):
|
||||
|
||||
def save_invoice(e, si_doc, name):
|
||||
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
|
||||
si_doc.docstatus = 0
|
||||
si_doc.flags.ignore_mandatory = True
|
||||
si_doc.insert()
|
||||
make_scheduler_log(e, si_doc.name)
|
||||
|
||||
@@ -267,6 +267,16 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
|
||||
amount: function(){
|
||||
this.write_off_outstanding_amount_automatically()
|
||||
},
|
||||
|
||||
change_amount: function(){
|
||||
if(this.frm.doc.paid_amount > this.frm.doc.grand_total){
|
||||
this.calculate_write_off_amount()
|
||||
}else {
|
||||
this.frm.set_value("change_amount", 0.0)
|
||||
}
|
||||
|
||||
this.frm.refresh_fields();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -458,7 +468,7 @@ frappe.ui.form.on('Sales Invoice', {
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
frappe.ui.form.on('Sales Invoice Timesheet', {
|
||||
|
||||
@@ -61,11 +61,12 @@ class SalesInvoice(SellingController):
|
||||
self.clear_unallocated_advances("Sales Invoice Advance", "advances")
|
||||
self.add_remarks()
|
||||
self.validate_write_off_account()
|
||||
self.validate_account_for_change_amount()
|
||||
self.validate_fixed_asset()
|
||||
self.set_income_account_for_fixed_assets()
|
||||
|
||||
# if cint(self.is_pos):
|
||||
# self.validate_pos()
|
||||
if cint(self.is_pos):
|
||||
self.validate_pos()
|
||||
|
||||
if cint(self.update_stock):
|
||||
self.validate_dropship_item()
|
||||
@@ -88,6 +89,8 @@ class SalesInvoice(SellingController):
|
||||
set_account_for_mode_of_payment(self)
|
||||
|
||||
def on_submit(self):
|
||||
self.validate_pos_paid_amount()
|
||||
|
||||
if not self.recurring_id:
|
||||
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
|
||||
self.company, self.base_grand_total, self)
|
||||
@@ -120,6 +123,10 @@ class SalesInvoice(SellingController):
|
||||
|
||||
self.update_time_sheet(self.name)
|
||||
|
||||
def validate_pos_paid_amount(self):
|
||||
if len(self.payments) == 0 and self.is_pos:
|
||||
frappe.throw(_("At least one mode of payment is required for POS invoice."))
|
||||
|
||||
def before_cancel(self):
|
||||
self.update_time_sheet(None)
|
||||
|
||||
@@ -218,6 +225,20 @@ class SalesInvoice(SellingController):
|
||||
timesheet.set_status()
|
||||
timesheet.save()
|
||||
|
||||
def on_update(self):
|
||||
self.set_paid_amount()
|
||||
|
||||
def set_paid_amount(self):
|
||||
paid_amount = 0.0
|
||||
base_paid_amount = 0.0
|
||||
for data in self.payments:
|
||||
data.base_amount = flt(data.amount*self.conversion_rate, self.precision("base_paid_amount"))
|
||||
paid_amount += data.amount
|
||||
base_paid_amount += data.base_amount
|
||||
|
||||
self.paid_amount = paid_amount
|
||||
self.base_paid_amount = base_paid_amount
|
||||
|
||||
def validate_time_sheets_are_submitted(self):
|
||||
for data in self.timesheets:
|
||||
if data.time_sheet:
|
||||
@@ -233,12 +254,22 @@ class SalesInvoice(SellingController):
|
||||
from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile
|
||||
pos = get_pos_profile(self.company)
|
||||
|
||||
if not self.get('payments') and not for_validate:
|
||||
pos_profile = frappe.get_doc('POS Profile', pos.name) if pos else None
|
||||
update_multi_mode_option(self, pos_profile)
|
||||
|
||||
if not self.account_for_change_amount:
|
||||
self.account_for_change_amount = frappe.db.get_value('Company', self.company, 'default_cash_account')
|
||||
|
||||
if pos:
|
||||
if not for_validate and not self.customer:
|
||||
self.customer = pos.customer
|
||||
self.mode_of_payment = pos.mode_of_payment
|
||||
# self.set_customer_defaults()
|
||||
|
||||
if pos.get('account_for_change_amount'):
|
||||
self.account_for_change_amount = pos.get('account_for_change_amount')
|
||||
|
||||
for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name',
|
||||
'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account',
|
||||
'write_off_account', 'write_off_cost_center'):
|
||||
@@ -265,10 +296,6 @@ class SalesInvoice(SellingController):
|
||||
if self.taxes_and_charges and not len(self.get("taxes")):
|
||||
self.set_taxes()
|
||||
|
||||
if not self.get('payments'):
|
||||
pos_profile = frappe.get_doc('POS Profile', pos.name)
|
||||
update_multi_mode_option(self, pos_profile)
|
||||
|
||||
return pos
|
||||
|
||||
def get_company_abbr(self):
|
||||
@@ -349,11 +376,8 @@ class SalesInvoice(SellingController):
|
||||
throw(_("Customer {0} does not belong to project {1}").format(self.customer,self.project))
|
||||
|
||||
def validate_pos(self):
|
||||
if not self.cash_bank_account and flt(self.paid_amount):
|
||||
frappe.throw(_("Cash or Bank Account is mandatory for making payment entry"))
|
||||
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) \
|
||||
- flt(self.grand_total) > 1/(10**(self.precision("grand_total") + 1)):
|
||||
- flt(self.grand_total) > 1/(10**(self.precision("grand_total") + 1)) and self.is_return:
|
||||
frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total"""))
|
||||
|
||||
|
||||
@@ -374,11 +398,16 @@ class SalesInvoice(SellingController):
|
||||
if d.delivery_note:
|
||||
msgprint(_("Stock cannot be updated against Delivery Note {0}").format(d.delivery_note), raise_exception=1)
|
||||
|
||||
|
||||
def validate_write_off_account(self):
|
||||
if flt(self.write_off_amount) and not self.write_off_account:
|
||||
self.write_off_account = frappe.db.get_value('Company', self.company, 'write_off_account')
|
||||
|
||||
if flt(self.write_off_amount) and not self.write_off_account:
|
||||
msgprint(_("Please enter Write Off Account"), raise_exception=1)
|
||||
|
||||
def validate_account_for_change_amount(self):
|
||||
if flt(self.change_amount) and not self.account_for_change_amount:
|
||||
msgprint(_("Please enter Account for Change Amount"), raise_exception=1)
|
||||
|
||||
def validate_c_form(self):
|
||||
""" Blank C-form no if C-form applicable marked as 'No'"""
|
||||
@@ -462,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:
|
||||
@@ -502,7 +533,7 @@ class SalesInvoice(SellingController):
|
||||
gl_entries = merge_similar_entries(gl_entries)
|
||||
|
||||
self.make_pos_gl_entries(gl_entries)
|
||||
self.make_gle_for_change(gl_entries)
|
||||
self.make_gle_for_change_amount(gl_entries)
|
||||
|
||||
self.make_write_off_gl_entry(gl_entries)
|
||||
|
||||
@@ -576,46 +607,44 @@ class SalesInvoice(SellingController):
|
||||
gl_entries += super(SalesInvoice, self).get_gl_entries()
|
||||
|
||||
def make_pos_gl_entries(self, gl_entries):
|
||||
if cint(self.is_pos) and self.paid_amount:
|
||||
if cint(self.is_pos):
|
||||
for payment_mode in self.payments:
|
||||
if payment_mode.base_amount > 0:
|
||||
# POS, make payment entries
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.debit_to,
|
||||
"party_type": "Customer",
|
||||
"party": self.customer,
|
||||
"against": payment_mode.account,
|
||||
"credit": payment_mode.base_amount,
|
||||
"credit_in_account_currency": payment_mode.base_amount \
|
||||
if self.party_account_currency==self.company_currency \
|
||||
else payment_mode.amount,
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
}, self.party_account_currency)
|
||||
)
|
||||
|
||||
payment_mode_account_currency = get_account_currency(payment_mode.account)
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": payment_mode.account,
|
||||
"against": self.customer,
|
||||
"debit": payment_mode.base_amount,
|
||||
"debit_in_account_currency": payment_mode.base_amount \
|
||||
if payment_mode_account_currency==self.company_currency else payment_mode.amount
|
||||
}, payment_mode_account_currency)
|
||||
)
|
||||
|
||||
def make_gle_for_change(self, gl_entries):
|
||||
if cint(self.is_pos) and self.change_amount:
|
||||
cash_account = self.get_cash_account()
|
||||
if cash_account:
|
||||
# POS, make payment entries
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.debit_to,
|
||||
"party_type": "Customer",
|
||||
"party": self.customer,
|
||||
"against": cash_account,
|
||||
"against": payment_mode.account,
|
||||
"credit": payment_mode.base_amount,
|
||||
"credit_in_account_currency": payment_mode.base_amount \
|
||||
if self.party_account_currency==self.company_currency \
|
||||
else payment_mode.amount,
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
}, self.party_account_currency)
|
||||
)
|
||||
|
||||
payment_mode_account_currency = get_account_currency(payment_mode.account)
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": payment_mode.account,
|
||||
"against": self.customer,
|
||||
"debit": payment_mode.base_amount,
|
||||
"debit_in_account_currency": payment_mode.base_amount \
|
||||
if payment_mode_account_currency==self.company_currency else payment_mode.amount
|
||||
}, payment_mode_account_currency)
|
||||
)
|
||||
|
||||
def make_gle_for_change_amount(self, gl_entries):
|
||||
if cint(self.is_pos) and self.change_amount:
|
||||
if self.account_for_change_amount:
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.debit_to,
|
||||
"party_type": "Customer",
|
||||
"party": self.customer,
|
||||
"against": self.account_for_change_amount,
|
||||
"debit": flt(self.base_change_amount),
|
||||
"debit_in_account_currency": flt(self.base_change_amount) \
|
||||
if self.party_account_currency==self.company_currency else flt(self.change_amount),
|
||||
@@ -626,22 +655,13 @@ class SalesInvoice(SellingController):
|
||||
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": cash_account,
|
||||
"account": self.account_for_change_amount,
|
||||
"against": self.customer,
|
||||
"credit": self.base_change_amount
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
def get_cash_account(self):
|
||||
cash_account = [d.account for d in self.payments if d.type=="Cash"]
|
||||
if cash_account:
|
||||
cash_account = cash_account[0]
|
||||
else:
|
||||
cash_account = frappe.db.get_value("Account",
|
||||
filters={"company": self.company, "account_type": "Cash", "is_group": 0})
|
||||
|
||||
return cash_account
|
||||
else:
|
||||
frappe.throw(_("Select change amount account"), title="Mandatory Field")
|
||||
|
||||
def make_write_off_gl_entry(self, gl_entries):
|
||||
# write off entries, applicable if only pos
|
||||
|
||||
@@ -455,6 +455,25 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
self.pos_gl_entry(si, pos, 300)
|
||||
|
||||
def test_pos_change_amount(self):
|
||||
set_perpetual_inventory()
|
||||
self.make_pos_profile()
|
||||
|
||||
self._insert_purchase_receipt()
|
||||
pos = copy.deepcopy(test_records[1])
|
||||
pos["is_pos"] = 1
|
||||
pos["update_stock"] = 1
|
||||
pos["payments"] = [{'mode_of_payment': 'Bank Draft', 'account': '_Test Bank - _TC', 'amount': 300},
|
||||
{'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 340}]
|
||||
|
||||
si = frappe.copy_doc(pos)
|
||||
si.change_amount = 5.0
|
||||
si.insert()
|
||||
si.submit()
|
||||
|
||||
self.assertEquals(si.grand_total, 630.0)
|
||||
self.assertEquals(si.write_off_amount, -5)
|
||||
|
||||
def test_make_pos_invoice(self):
|
||||
from erpnext.accounts.doctype.sales_invoice.pos import make_invoice
|
||||
|
||||
|
||||
@@ -183,6 +183,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
if(this.frm.doc.customer){
|
||||
this.party_field.$input.val(this.frm.doc.customer);
|
||||
}
|
||||
|
||||
if(!this.frm.doc.write_off_account){
|
||||
this.frm.doc.write_off_account = doc.write_off_account
|
||||
}
|
||||
|
||||
if(!this.frm.doc.account_for_change_amount){
|
||||
this.frm.doc.account_for_change_amount = doc.account_for_change_amount
|
||||
}
|
||||
},
|
||||
|
||||
get_invoice_doc: function(si_docs){
|
||||
@@ -209,7 +217,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
window.meta = r.message.meta;
|
||||
window.print_template = r.message.print_template;
|
||||
me.default_customer = r.message.default_customer || null;
|
||||
me.write_off_account = r.message.write_off_account;
|
||||
localStorage.setItem('doc', JSON.stringify(r.message.doc));
|
||||
if(callback){
|
||||
callback();
|
||||
@@ -485,11 +492,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
this.remove_item = []
|
||||
$.each(this.frm.doc["items"] || [], function(i, d) {
|
||||
if (d.item_code == item_code && d.serial_no
|
||||
&& field == 'qty' && cint(value) != value) {
|
||||
d.qty = 0.0;
|
||||
me.refresh();
|
||||
frappe.throw(__("Serial no item cannot be a fraction"))
|
||||
if(d.serial_no){
|
||||
me.validate_serial_no_qty(d, item_code, field, value)
|
||||
}
|
||||
|
||||
if (d.item_code == item_code) {
|
||||
@@ -505,7 +509,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.remove_zero_qty_item();
|
||||
}
|
||||
|
||||
this.refresh();
|
||||
this.update_paid_amount_status(false)
|
||||
},
|
||||
|
||||
remove_zero_qty_item: function(){
|
||||
@@ -587,7 +591,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
if (!caught)
|
||||
this.add_new_item_to_grid();
|
||||
|
||||
this.refresh();
|
||||
this.update_paid_amount_status(false)
|
||||
},
|
||||
|
||||
add_new_item_to_grid: function() {
|
||||
@@ -610,6 +614,15 @@ 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){
|
||||
if(this.name){
|
||||
update_paid_amount = update_paid_amount ? false : true;
|
||||
}
|
||||
|
||||
this.refresh(update_paid_amount);
|
||||
},
|
||||
|
||||
refresh: function(update_paid_amount) {
|
||||
@@ -619,6 +632,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.update_rate();
|
||||
this.set_primary_action();
|
||||
},
|
||||
|
||||
refresh_fields: function(update_paid_amount) {
|
||||
this.apply_pricing_rule();
|
||||
this.discount_amount_applied = false;
|
||||
@@ -641,7 +655,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
show_items_in_item_cart: function() {
|
||||
var me = this;
|
||||
var $items = this.wrapper.find(".items").empty();
|
||||
me.frm.doc.net_total = 0.0
|
||||
$.each(this.frm.doc.items|| [], function(i, d) {
|
||||
$(frappe.render_template("pos_bill_item", {
|
||||
item_code: d.item_code,
|
||||
@@ -694,7 +707,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
if (this.frm.doc.docstatus==0) {
|
||||
this.page.set_primary_action(__("Pay"), function() {
|
||||
me.validate()
|
||||
me.validate();
|
||||
me.update_paid_amount_status(true);
|
||||
me.create_invoice();
|
||||
me.make_payment();
|
||||
}, "octicon octicon-credit-card");
|
||||
@@ -723,49 +737,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
write_off_amount: function(){
|
||||
var me = this;
|
||||
var value = 0.0;
|
||||
|
||||
if(this.frm.doc.outstanding_amount > 0){
|
||||
dialog = new frappe.ui.Dialog({
|
||||
title: 'Write Off Amount',
|
||||
fields: [
|
||||
{fieldtype: "Check", fieldname: "write_off_amount", label: __("Write off Outstanding Amount")},
|
||||
{fieldtype: "Link", options:"Account", default:this.write_off_account, fieldname: "write_off_account",
|
||||
label: __("Write off Account"), get_query: function() {
|
||||
return {
|
||||
filters: {'is_group': 0, 'report_type': 'Profit and Loss'}
|
||||
}
|
||||
}}
|
||||
]
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
|
||||
dialog.fields_dict.write_off_amount.$input.change(function(){
|
||||
write_off_amount = dialog.get_values().write_off_amount;
|
||||
me.frm.doc.write_off_outstanding_amount_automatically = write_off_amount;
|
||||
me.frm.doc.base_write_off_amount = (write_off_amount==1) ? flt(me.frm.doc.grand_total - me.frm.doc.paid_amount, precision("outstanding_amount")) : 0;
|
||||
me.frm.doc.write_off_account = (write_off_amount==1) ? dialog.get_values().write_off_account : '';
|
||||
me.frm.doc.write_off_amount = flt(me.frm.doc.base_write_off_amount * me.frm.doc.conversion_rate, precision("write_off_amount"))
|
||||
me.calculate_outstanding_amount();
|
||||
me.set_primary_action();
|
||||
})
|
||||
|
||||
dialog.fields_dict.write_off_account.$input.change(function(){
|
||||
me.frm.doc.write_off_account = dialog.get_values().write_off_account;
|
||||
})
|
||||
|
||||
dialog.set_primary_action(__("Submit"), function(){
|
||||
dialog.hide()
|
||||
me.submit_invoice()
|
||||
})
|
||||
}else{
|
||||
this.submit_invoice()
|
||||
}
|
||||
},
|
||||
|
||||
submit_invoice: function(){
|
||||
var me = this;
|
||||
frappe.confirm(__("Do you really want to submit the invoice?"), function () {
|
||||
@@ -804,6 +775,9 @@ 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
|
||||
this.si_docs.push(invoice_data)
|
||||
this.update_localstorage();
|
||||
@@ -949,6 +923,23 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
},
|
||||
|
||||
validate_serial_no_qty: function(args, item_code, field, value){
|
||||
var me = this;
|
||||
if (args.item_code == item_code && args.serial_no
|
||||
&& field == 'qty' && cint(value) != value) {
|
||||
args.qty = 0.0;
|
||||
this.refresh();
|
||||
frappe.throw(__("Serial no item cannot be a fraction"))
|
||||
}
|
||||
|
||||
if(args.serial_no && args.serial_no.split('\n').length != cint(value)){
|
||||
args.qty = 0.0;
|
||||
args.serial_no = ''
|
||||
this.refresh();
|
||||
frappe.throw(__("Total nos of serial no is not equal to quantity."))
|
||||
}
|
||||
},
|
||||
|
||||
mandatory_batch_no: function(){
|
||||
var me = this;
|
||||
if(this.items[0].has_batch_no && !this.item_batch_no[this.items[0].item_code]){
|
||||
@@ -976,11 +967,13 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
get_pricing_rule: function(item){
|
||||
var me = this;
|
||||
return $.grep(this.pricing_rules, function(data){
|
||||
if(data.item_code == item.item_code || in_list(['All Item Groups', item.item_group], data.item_group)) {
|
||||
if(in_list(['Customer', 'Customer Group', 'Territory'], data.applicable_for)){
|
||||
return me.validate_condition(data)
|
||||
}else{
|
||||
return true
|
||||
if(item.qty >= data.min_qty && (item.qty <= (data.max_qty ? data.max_qty : item.qty)) ){
|
||||
if(data.item_code == item.item_code || in_list(['All Item Groups', item.item_group], data.item_group)) {
|
||||
if(in_list(['Customer', 'Customer Group', 'Territory', 'Campaign'], data.applicable_for)){
|
||||
return me.validate_condition(data)
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -999,6 +992,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
'Customer': [data.customer, [this.frm.doc.customer]],
|
||||
'Customer Group': [data.customer_group, [this.frm.doc.customer_group, 'All Customer Groups']],
|
||||
'Territory': [data.territory, [this.frm.doc.territory, 'All Territories']],
|
||||
'Campaign': [data.campaign, [this.frm.doc.campaign]],
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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\">{{ item.qty }}<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-05-21 00:25:20.359074",
|
||||
"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>
|
||||
|
||||
@@ -66,7 +66,8 @@ class ReceivablePayableReport(object):
|
||||
columns.append({
|
||||
"fieldname": "currency",
|
||||
"label": _("Currency"),
|
||||
"fieldtype": "Data",
|
||||
"fieldtype": "Link",
|
||||
"options": "Currency",
|
||||
"width": 100
|
||||
})
|
||||
if args.get("party_type") == "Customer":
|
||||
@@ -123,6 +124,10 @@ class ReceivablePayableReport(object):
|
||||
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
||||
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
|
||||
|
||||
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
||||
if self.filters.ageing_based_on == "Due Date" and getdate(due_date) > getdate(self.filters.report_date):
|
||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||
|
||||
if self.filters.get(scrub(args.get("party_type"))):
|
||||
row.append(gle.account_currency)
|
||||
else:
|
||||
@@ -213,14 +218,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
|
||||
order by posting_date, party"""
|
||||
.format(select_fields, conditions), values, as_dict=True)
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
columns.append({
|
||||
"fieldname": "currency",
|
||||
"label": _("Currency"),
|
||||
"fieldtype": "Data",
|
||||
"fieldtype": "Link",
|
||||
"options": "Currency",
|
||||
"width": 80
|
||||
})
|
||||
|
||||
|
||||
@@ -55,14 +55,6 @@ def get_columns():
|
||||
"fieldtype": "Date",
|
||||
"width": 90
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_document",
|
||||
"label": _("Payment Document"),
|
||||
"fieldtype": "Link",
|
||||
"options": "DocType",
|
||||
"width": 120,
|
||||
"hidden": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_entry",
|
||||
"label": _("Payment Entry"),
|
||||
|
||||
@@ -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
|
||||
@@ -79,7 +79,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
}
|
||||
} else {
|
||||
return{
|
||||
query: "erpnext.controllers.queries.item_query"
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
filters: {'is_purchase_item': 1}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,5 +11,72 @@ frappe.query_reports["Quoted Item Comparison"] = {
|
||||
"default": ""
|
||||
|
||||
}
|
||||
]
|
||||
],
|
||||
onload: function(report) {
|
||||
//Create a button for setting the default supplier
|
||||
report.page.add_inner_button(__("Select Default Supplier"), function() {
|
||||
|
||||
var reporter = frappe.query_reports["Quoted Item Comparison"];
|
||||
|
||||
//Always make a new one so that the latest values get updated
|
||||
reporter.make_default_supplier_dialog(report);
|
||||
report.dialog.show();
|
||||
setTimeout(function() { report.dialog.input.focus(); }, 1000);
|
||||
|
||||
}, 'Tools');
|
||||
|
||||
},
|
||||
"make_default_supplier_dialog": function (report) {
|
||||
//Get the name of the item to change
|
||||
var filters = report.get_values();
|
||||
var item_code = filters.item;
|
||||
|
||||
//Get a list of the suppliers (with a blank as well) for the user to select
|
||||
var select_options = "";
|
||||
for (let supplier of report.data)
|
||||
{
|
||||
select_options += supplier.supplier_name+ '\n'
|
||||
}
|
||||
|
||||
//Create a dialog window for the user to pick their supplier
|
||||
var d = new frappe.ui.Dialog({
|
||||
title: __('Select Default Supplier'),
|
||||
fields: [
|
||||
{fieldname: 'supplier', fieldtype:'Select', label:'Supplier', reqd:1,options:select_options},
|
||||
{fieldname: 'ok_button', fieldtype:'Button', label:'Set Default Supplier'},
|
||||
]
|
||||
});
|
||||
|
||||
//On the user clicking the ok button
|
||||
d.fields_dict.ok_button.input.onclick = function() {
|
||||
var btn = d.fields_dict.ok_button.input;
|
||||
var v = report.dialog.get_values();
|
||||
if(v) {
|
||||
$(btn).set_working();
|
||||
|
||||
//Set the default_supplier field of the appropriate Item to the selected supplier
|
||||
frappe.call({
|
||||
method: "frappe.client.set_value",
|
||||
args: {
|
||||
doctype: "Item",
|
||||
name: item_code,
|
||||
fieldname: "default_supplier",
|
||||
value: v.supplier,
|
||||
},
|
||||
callback: function (r){
|
||||
$(btn).done_working();
|
||||
msgprint("Successfully Set Supplier");
|
||||
report.dialog.hide();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
report.dialog = d;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
58
erpnext/change_log/v7/v7_0_0.md
Normal file
@@ -0,0 +1,58 @@
|
||||
#### New POS
|
||||
- Offline
|
||||
- Multiple Payment Modes
|
||||
- Standard documents cannot be edited in POS view
|
||||
|
||||
#### Payment Entry
|
||||
- Dedicated form for managing Payments
|
||||
- Designed for normal users who do not have accounting background
|
||||
|
||||
#### Request for Quotation
|
||||
- Updated workflow: Material Request -> **Request for Quotation** -> Supplier Quotation -> Purchase Order
|
||||
|
||||
#### Fixed Asset Management
|
||||
- Manage fixed asset records and their depreciation
|
||||
|
||||
#### Improved Navigation
|
||||
- Heatmaps
|
||||
- Centralized navigation from Masters like Item, Customer, Supplier, Employee etc.
|
||||
|
||||
#### Timesheets
|
||||
- New grid
|
||||
- Multiple time logs in one timesheets
|
||||
- Linked to Payroll and Billing
|
||||
|
||||
#### Graphs in Reports
|
||||
- Added graphs in some important reports like Balance Sheet, Accounts Receivable etc.
|
||||
|
||||
#### Sub-warehouse
|
||||
- Tree view for Warehouse
|
||||
|
||||
#### New Portal Design
|
||||
- New Homepage Design
|
||||
- Sidebar in Portal View
|
||||
- New Cart View
|
||||
|
||||
#### Collaborative Project Management
|
||||
- Web View
|
||||
- Customers/Suppliers can add/edit issues and view timesheets
|
||||
|
||||
#### Budget
|
||||
- Dedicated budget form
|
||||
- Budget can be assigned against Cost Center Group
|
||||
|
||||
#### Check Printing Format
|
||||
- Ability to customize Cheque Printing Format for any bank
|
||||
|
||||
#### Schools application is now part of ERPNext
|
||||
|
||||
#### Minor
|
||||
|
||||
- Selling Price calculation based on Margin defined in the Pricing Rule
|
||||
- Document flow-chart on Sales / Purchase Transactions
|
||||
- Domain specific desktop views
|
||||
- Add opening Stock and Rate while creating a new Item
|
||||
- Book payments and update stock directly from Purchase Invoice
|
||||
- List view for Products on Website
|
||||
- Features Setup is deprecated, settings moved to individual module setup views
|
||||
- Added Safety Stock to Item Master
|
||||
@@ -662,7 +662,7 @@ def get_advance_journal_entries(party_type, party, party_account, amount_field,
|
||||
.format(order_doctype, order_condition))
|
||||
|
||||
reference_condition = " and (" + " or ".join(conditions) + ")" if conditions else ""
|
||||
|
||||
|
||||
journal_entries = frappe.db.sql("""
|
||||
select
|
||||
"Journal Entry" as reference_type, t1.name as reference_name,
|
||||
@@ -674,8 +674,7 @@ def get_advance_journal_entries(party_type, party, party_account, amount_field,
|
||||
t1.name = t2.parent and t2.account = %s
|
||||
and t2.party_type = %s and t2.party = %s
|
||||
and t2.is_advance = 'Yes' and t1.docstatus = 1
|
||||
and {1} > 0
|
||||
and (ifnull(t2.reference_name, '')='' {2})
|
||||
and {1} > 0 {2}
|
||||
order by t1.posting_date""".format(amount_field, dr_or_cr, reference_condition),
|
||||
[party_account, party_type, party] + order_list, as_dict=1)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -142,7 +142,7 @@ class StatusUpdater(Document):
|
||||
if item['reduce_by'] > .01:
|
||||
self.limits_crossed_error(args, item)
|
||||
|
||||
else:
|
||||
elif item[args['target_ref_field']]:
|
||||
self.check_overflow_with_tolerance(item, args)
|
||||
|
||||
def check_overflow_with_tolerance(self, item, args):
|
||||
|
||||
@@ -204,10 +204,10 @@ class StockController(AccountsController):
|
||||
from erpnext.stock.stock_ledger import make_sl_entries
|
||||
make_sl_entries(sl_entries, is_amended, allow_negative_stock, via_landed_cost_voucher)
|
||||
|
||||
def make_gl_entries_on_cancel(self):
|
||||
def make_gl_entries_on_cancel(self, repost_future_gle=True):
|
||||
if frappe.db.sql("""select name from `tabGL Entry` where voucher_type=%s
|
||||
and voucher_no=%s""", (self.doctype, self.name)):
|
||||
self.make_gl_entries()
|
||||
self.make_gl_entries(repost_future_gle)
|
||||
|
||||
def get_serialized_items(self):
|
||||
serialized_items = []
|
||||
@@ -261,7 +261,7 @@ def update_gl_entries_after(posting_date, posting_time, for_warehouses=None, for
|
||||
|
||||
future_stock_vouchers = get_future_stock_vouchers(posting_date, posting_time, for_warehouses, for_items)
|
||||
gle = get_voucherwise_gl_entries(future_stock_vouchers, posting_date)
|
||||
|
||||
|
||||
for voucher_type, voucher_no in future_stock_vouchers:
|
||||
existing_gle = gle.get((voucher_type, voucher_no), [])
|
||||
voucher_obj = frappe.get_doc(voucher_type, voucher_no)
|
||||
|
||||
@@ -420,8 +420,10 @@ class calculate_taxes_and_totals(object):
|
||||
# NOTE:
|
||||
# write_off_amount is only for POS Invoice
|
||||
# total_advance is only for non POS Invoice
|
||||
if self.doc.is_return:
|
||||
return
|
||||
if self.doc.doctype == "Sales Invoice":
|
||||
self.calculate_paid_amount()
|
||||
|
||||
if self.doc.is_return: return
|
||||
|
||||
self.doc.round_floats_in(self.doc, ["grand_total", "total_advance", "write_off_amount"])
|
||||
self._set_in_company_currency(self.doc, ['write_off_amount'])
|
||||
@@ -435,38 +437,48 @@ class calculate_taxes_and_totals(object):
|
||||
- flt(self.doc.base_write_off_amount), self.doc.precision("grand_total"))
|
||||
|
||||
if self.doc.doctype == "Sales Invoice":
|
||||
self.calculate_paid_amount()
|
||||
self.doc.round_floats_in(self.doc, ["paid_amount"])
|
||||
paid_amount = self.doc.paid_amount \
|
||||
if self.doc.party_account_currency == self.doc.currency else self.doc.base_paid_amount
|
||||
|
||||
change_amount = self.doc.change_amount \
|
||||
if self.doc.party_account_currency == self.doc.currency else self.doc.base_change_amount
|
||||
|
||||
self.calculate_write_off_amount()
|
||||
self.calculate_change_amount()
|
||||
|
||||
self.doc.outstanding_amount = flt(total_amount_to_pay - flt(paid_amount) +
|
||||
flt(self.doc.change_amount), self.doc.precision("outstanding_amount"))
|
||||
|
||||
flt(change_amount), self.doc.precision("outstanding_amount"))
|
||||
|
||||
elif self.doc.doctype == "Purchase Invoice":
|
||||
self.doc.outstanding_amount = flt(total_amount_to_pay, self.doc.precision("outstanding_amount"))
|
||||
|
||||
def calculate_paid_amount(self):
|
||||
paid_amount = base_paid_amount = 0.0
|
||||
for payment in self.doc.get('payments'):
|
||||
if flt(payment.amount) > 0:
|
||||
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
||||
paid_amount += payment.amount
|
||||
base_paid_amount += payment.base_amount
|
||||
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
||||
paid_amount += payment.amount
|
||||
base_paid_amount += payment.base_amount
|
||||
|
||||
self.doc.paid_amount = flt(paid_amount, self.doc.precision("paid_amount"))
|
||||
self.doc.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
|
||||
|
||||
def calculate_change_amount(self):
|
||||
self.doc.change_amount = 0.0
|
||||
self.doc.base_change_amount = 0.0
|
||||
if self.doc.paid_amount > self.doc.grand_total:
|
||||
self.doc.change_amount = flt(self.doc.paid_amount - self.doc.grand_total +
|
||||
self.doc.write_off_amount, self.doc.precision("change_amount"))
|
||||
|
||||
self.doc.base_change_amount = flt(self.doc.change_amount * self.doc.conversion_rate,
|
||||
self.doc.precision("base_change_amount"))
|
||||
self.doc.base_change_amount = flt(self.doc.base_paid_amount - self.doc.base_grand_total +
|
||||
self.doc.base_write_off_amount, self.doc.precision("base_change_amount"))
|
||||
|
||||
def calculate_write_off_amount(self):
|
||||
if flt(self.doc.change_amount) > 0:
|
||||
self.doc.write_off_amount = flt(self.doc.grand_total - self.doc.paid_amount + self.doc.change_amount,
|
||||
self.doc.precision("write_off_amount"))
|
||||
self.doc.base_write_off_amount = flt(self.doc.write_off_amount * self.doc.conversion_rate,
|
||||
self.doc.precision("base_write_off_amount"))
|
||||
|
||||
def calculate_margin(self, item):
|
||||
total_margin = 0.0
|
||||
|
||||
@@ -39,6 +39,7 @@ def validate_filters(filters):
|
||||
frappe.throw(_("'Based On' and 'Group By' can not be same"))
|
||||
|
||||
def get_data(filters, conditions):
|
||||
|
||||
data = []
|
||||
inc, cond= '',''
|
||||
query_details = conditions["based_on_select"] + conditions["period_wise_select"]
|
||||
@@ -49,6 +50,9 @@ def get_data(filters, conditions):
|
||||
|
||||
if conditions["based_on_select"] in ["t1.project,", "t2.project,"]:
|
||||
cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL'
|
||||
|
||||
if conditions.get('trans') in ['Sales Order', 'Purchase Order']:
|
||||
cond += "and t1.status != 'Closed'"
|
||||
|
||||
year_start_date, year_end_date = frappe.db.get_value("Fiscal Year",
|
||||
filters.get('fiscal_year'), ["year_start_date", "year_end_date"])
|
||||
@@ -85,10 +89,10 @@ def get_data(filters, conditions):
|
||||
#to get distinct value of col specified by group_by in filter
|
||||
row = frappe.db.sql("""select DISTINCT(%s) from `tab%s` t1, `tab%s Item` t2 %s
|
||||
where t2.parent = t1.name and t1.company = %s and %s between %s and %s
|
||||
and t1.docstatus = 1 and %s = %s %s
|
||||
and t1.docstatus = 1 and %s = %s %s %s
|
||||
""" %
|
||||
(sel_col, conditions["trans"], conditions["trans"], conditions["addl_tables"],
|
||||
"%s", posting_date, "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")),
|
||||
"%s", posting_date, "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond"), cond),
|
||||
(filters.get("company"), year_start_date, year_end_date, data1[d][0]), as_list=1)
|
||||
|
||||
for i in range(len(row)):
|
||||
@@ -97,11 +101,11 @@ def get_data(filters, conditions):
|
||||
#get data for group_by filter
|
||||
row1 = frappe.db.sql(""" select %s , %s from `tab%s` t1, `tab%s Item` t2 %s
|
||||
where t2.parent = t1.name and t1.company = %s and %s between %s and %s
|
||||
and t1.docstatus = 1 and %s = %s and %s = %s %s
|
||||
and t1.docstatus = 1 and %s = %s and %s = %s %s %s
|
||||
""" %
|
||||
(sel_col, conditions["period_wise_select"], conditions["trans"],
|
||||
conditions["trans"], conditions["addl_tables"], "%s", posting_date, "%s","%s", sel_col,
|
||||
"%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")),
|
||||
"%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond"), cond),
|
||||
(filters.get("company"), year_start_date, year_end_date, row[i][0],
|
||||
data1[d][0]), as_list=1)
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ erpnext.crm.Opportunity = frappe.ui.form.Controller.extend({
|
||||
|
||||
this.frm.set_query("item_code", "items", function() {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_query"
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
filters: {'is_sales_item': 1}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
BIN
erpnext/docs/assets/img/accounts/perpetual-2.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
erpnext/docs/assets/img/accounts/perpetual-3.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 547 KiB |
|
Before Width: | Height: | Size: 85 KiB |
BIN
erpnext/docs/assets/img/articles/freeze-account-1.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
erpnext/docs/assets/img/articles/freeze-account-2.png
Normal file
|
After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 86 KiB |
BIN
erpnext/docs/assets/img/articles/post-dated-1.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
erpnext/docs/assets/img/setup-wizard/step-1.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
erpnext/docs/assets/img/setup/dropbox-1.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
erpnext/docs/assets/img/setup/dropbox-2.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
erpnext/docs/assets/img/setup/dropbox-3.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
erpnext/docs/assets/img/setup/dropbox-open-1.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
erpnext/docs/assets/img/setup/dropbox-open-2.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
erpnext/docs/assets/img/setup/dropbox-open-3.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 147 KiB |
|
After Width: | Height: | Size: 566 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 231 KiB |
|
Before Width: | Height: | Size: 242 KiB |
@@ -1,36 +0,0 @@
|
||||
#Cheque Print
|
||||
|
||||
** Whats is Cheque Print? **
|
||||
|
||||
You can choose to print Cheques at the time of making payments to Creditors/ parties during Voucher Entry i.e., directly from the Payment Vouchers and Inter-bank payment or transfers through Contra Vouchers.
|
||||
|
||||
###Setup Cheque Print
|
||||
|
||||
To enable cheque printing,
|
||||
|
||||
1. Create cheque settings under `Accounts > Cheque Print Template`.
|
||||
|
||||

|
||||
|
||||
You can see a preview of cheque print by attaching scanned copy of cheque to avoid miss printing.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
2. After saving cheque print settings, you can Create / Update print format for settings.
|
||||
|
||||
To create print format, click on `Create Print Format`.
|
||||
|
||||

|
||||
|
||||
If you have already created a Print Format, you can update it by clicking on `Update Print Format`.
|
||||
|
||||
3. You will see newly created / updated print format under Journal Entry.
|
||||
|
||||

|
||||
|
||||
|
||||
###Cheque Print
|
||||
|
||||

|
||||
@@ -1,41 +0,0 @@
|
||||
#Depreciation for Fixed Asset Items
|
||||
|
||||
Depreciation is when you write off certain value of your assets as an expense. For example, office computer will be used for five years. Hence total value of computer should be booked as expense over the period of five years.
|
||||
|
||||
As per perpetual inventory valuation system (set by default), you should create Stock Reconciliation for depreciating value of fixed asset items. Check below steps to learn more.
|
||||
|
||||
#### Step 1: Depreciation Account
|
||||
|
||||
Depreciation account is auto-created, under Indirect Expenses account.
|
||||
|
||||
<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/depreciation-1.png">
|
||||
|
||||
#### Step 2: Stock Reconciliation
|
||||
|
||||
To create new Stock Reconciliation, go to:
|
||||
|
||||
`Stock > Setup > Stock Reconciliation > New`
|
||||
|
||||
Set Posting Date and Time of Stock Reconciliation will when you wish depreciation entry to be posted in your accounts.
|
||||
|
||||
#### Step 3: Item
|
||||
|
||||
Select Fixed Asset Items in the item table. Update Warehouse of an item. For item valuation, update post-depreciation value. For example, item value was 100. Depreciation amount is 20. As per this post-depreciation valuation of an item will be 80. Hence 80 should be posted as valuation in the Stock Reconciliation.
|
||||
|
||||
<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/depreciation-2.png">
|
||||
|
||||
#### Step 4: Depreciation Account
|
||||
|
||||
Select Depereciation Account in which depereciation amount will be booked.
|
||||
|
||||
<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/depreciation-3.png">
|
||||
|
||||
#### Step 5: Submit
|
||||
|
||||
On submission of Stock Reconciliation, depreciation will booked for items asset items.
|
||||
|
||||
<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/depreciation-4.png">
|
||||
|
||||
Click [here]({{docs_base_url}}/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.html) for steps to be followed when making Stock Reconciliation entry.
|
||||
|
||||
<!-- markdown -->
|
||||
@@ -1,28 +1,36 @@
|
||||
#How To Freeze Accounting Ledger?
|
||||
|
||||
You can freeze any accounting ledger in ERPNext. So that frozen accounting ledger became unsearchable in accounting transaction. Follow below step to understand the process.
|
||||
If you want to discontinue using specific Account, you can freeze it.
|
||||
|
||||
#### 1. Set Frozen Accounts Modifier
|
||||
>Account can be Frozen by the User having specific Role. This Role for set in the Account Settings, in the field "Role Allowed to Set Frozen Accounts & Edit Frozen Entries".
|
||||
|
||||
To set frozen accounts modifier go to `Accounts > Setup > Accounts Setting`
|
||||
Please check following steps to freeze an Account from the Chart of Accounts master.
|
||||
|
||||
Search and select Role under Frozen Accounts Modifier field and save the Account Settings form.
|
||||
|
||||

|
||||
####Step 1: Chart of Accounts
|
||||
|
||||
#### 2. Edit Accounting Ledger.
|
||||
To edit an Account, go to Chart of Accounts:
|
||||
|
||||
To edit accounting ledger go to `Accounts > Setup > Chart of Accounts`
|
||||
`Explore > Accounts > Chart of Accounts`
|
||||
|
||||

|
||||
<img class="screenshot" alt="Freeze Account" src="{{docs_base_url}}/assets/img/articles/freeze-account-1.png">
|
||||
|
||||
#### 3. Set Frozen Status of Ledger.
|
||||
Click on Account in which Frozen Date is to be updated.
|
||||
|
||||

|
||||
####Step 2: Set Account as Frozen
|
||||
|
||||
In the Account form, you will find a field called **Frozen**. Set value in this field as 'Yes'
|
||||
|
||||
<img class="screenshot" alt="Freeze Account" src="{{docs_base_url}}/assets/img/articles/freeze-account-2.png">
|
||||
|
||||
####Step 3: Save
|
||||
|
||||
After update Save an Account.
|
||||
|
||||
On saving, this Account will be frozen and will not be selectable in any accounting transaction.
|
||||
|
||||
<div class ="well"> Note: In future, if you want to make an accounting transaction against this Account, then you can unfreeze this account by setting values in the Frozen field as 'No'.</div>
|
||||
|
||||
Set Frozen field status of ledger as 'Yes' and save the ledger form. On save this ledger will be frozen and you will became unable to search this ledger in accounting transactions.
|
||||
|
||||
<div class ="well"> Note: If you want to make accounting transaction against this ledger in the future, then that time again set frozen field status as 'No'.</div>
|
||||
|
||||
|
||||
<!-- markdown -->
|
||||
@@ -1,7 +1,5 @@
|
||||
tracking-project-profitability-using-cost-center
|
||||
c-form
|
||||
changing-parent-account
|
||||
depreciation-for-fixed-asset-items
|
||||
difference-entry-button
|
||||
fiscal-year-error
|
||||
freeze-accounting-entries
|
||||
@@ -13,4 +11,4 @@ post-dated-cheque-entry
|
||||
update-stock-option-in-sales-invoice
|
||||
what-is-the-differences-of-total-and-valuation-in-tax-and-charges
|
||||
withdrawing-salary-from-owners-equity-account
|
||||
cheque-print
|
||||
c-form
|
||||
@@ -1,32 +1,32 @@
|
||||
#Post Dated Cheque Entry
|
||||
|
||||
Post Dated Cheque is a cheque dated on future date. Party generally give post dated cheque, as advance payment. This cheque would be cleared only after cheque date has arrived.
|
||||
Post Dated Cheque is a cheque dated on future date. Party generally give post dated cheque, as advance payment. This cheque would be cleared only when cheque date arrives.
|
||||
|
||||
In ERPNext, create Journal Entries for post dated cheque.
|
||||
In ERPNext, create Payment Entry for post dated cheque.
|
||||
|
||||
####New Journal Entry
|
||||
####New Payment Entry
|
||||
|
||||
To open new journal voucher go to
|
||||
|
||||
`Accounts > Documents > Journal Entry > New`
|
||||
`Explore > Accounts > Payment Entry > New`
|
||||
|
||||
#### Set Posting Date
|
||||
|
||||
Assuming your Cheque Date is 31st December, 2016 (or any future date). As a result, this posting in your bank ledger will appear on Posting Date updated.
|
||||
|
||||
<img alt="JE Posting Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/post-dated-1.gif">
|
||||
<img alt="JE Posting Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/post-dated-1.png">
|
||||
|
||||
Note: Journal Voucher Reference Date should equal to or less than Posting Date.
|
||||
Note: Payment Entry Reference Date should equal to or less than Posting Date.
|
||||
|
||||
####Step 3: Save and Submit
|
||||
|
||||
After entering required details, Save and Submit the Journal Entry.
|
||||
After entering required details, Save and Submit the Payment Entry.
|
||||
|
||||
####Adjusting Post Dated Cheque Entry
|
||||
|
||||
If Post Dated Journal Entry needs to be adjusted against any invoice, it can be accomplished via [Payment Reconciliation Tool]({{docs_base_url}}/user/manual/en/accounts/tools/payment-reconciliation.html).
|
||||
You can adjust Post Dated Payment Entry against an invoice via [Payment Reconciliation Tool]({{docs_base_url}}/user/manual/en/accounts/tools/payment-reconciliation.html).
|
||||
|
||||
When cheque is cleared, i.e. on actual date on the cheque, you can update its Clearance Date via [Bank Reconciliation Tool]({{docs_base_url}}/user/manual/en/accounts/tools/bank-reconciliation.html).
|
||||
|
||||
You might find value of this Journal Entry already reflecting against bank's ledger. You should check **Bank Reconciliation Statement**, a report in the account module to know difference of bank balance as per system, and actual balance in a account.
|
||||
In the Chart of Accounts, you might find value of this Payment Entry already reflecting against bank Account. You should check **Bank Reconciliation Statement**, a report in the account module to know difference of bank balance as per system, and actual balance in the bank's statement.
|
||||
<!-- markdown -->
|
||||
@@ -1,74 +0,0 @@
|
||||
<h1>Setting Up Dropbox Backups</h1>
|
||||
|
||||
<h1>Setting Up Dropbox Backups</h1>
|
||||
|
||||
<p style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px;">If you wish to store your backups on a periodic basis,on Dropbox, you can do it directly through ERPNext.</p>
|
||||
<blockquote style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px; background-color: rgb(247, 247, 247);">
|
||||
<p>Setup > Manage 3rd Party Backups</p>
|
||||
</blockquote>
|
||||
<p style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px;"><strong>Step 1:</strong> Click on Integrations > Backup Manager
|
||||
<br>
|
||||
</p>
|
||||
<br>
|
||||
<div>
|
||||
<p style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px;">In the Backup Manager page, enter the email addresses of those people whom you wish to notify about the upload status. Under the topic 'Sync with Dropbox', select whether you wish to upload Daily, Weekly or Never.</p>
|
||||
<p style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px;"><strong>Step 2</strong> Click on <strong>Allow Dropbox Access</strong>.</p>
|
||||
<blockquote style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px; background-color: rgb(247, 247, 247);">
|
||||
<p>Tip: In future, if you wish to discontinue uploading backups to dropbox, then select the Never option.</p>
|
||||
</blockquote>
|
||||
<img src="{{docs_base_path}}/assets/img/articles/Screen Shot 2015-09-23 at 1.02.52 pm.png">
|
||||
</div>
|
||||
<div>
|
||||
<br>
|
||||
</div>
|
||||
<div><b>
|
||||
Step 3</b>
|
||||
<br>
|
||||
</div>
|
||||
<div>
|
||||
<p style="font-family: 'Noto Sans', sans-serif; line-height: 23.7999992370605px;">You need to login to your dropbox account, with your user id and password.</p>
|
||||
</div>
|
||||
<div>
|
||||
<img src="{{docs_base_path}}/assets/img/articles/dropbox-access.png" style="line-height: 1.42857143;">
|
||||
<br>
|
||||
</div>
|
||||
<div>
|
||||
<br>
|
||||
<hr>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="font-family: 'Noto Sans', Helvetica, Arial, sans-serif; color: rgb(51, 51, 51);">Open Source Users</h3>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<br>
|
||||
</div>
|
||||
<div><b>Step 1: </b>Go to <a href="https://www.dropbox.com/developers/apps" target="_blank" style="line-height: 1.42857143;">https://www.dropbox.com/developers/apps</a>
|
||||
|
||||
</div>
|
||||
<div><b>Step 2:</b> Create a new app</div>
|
||||
<div>
|
||||
<img src="{{docs_base_path}}/assets/img/articles/Screen Shot 2014-11-11 at 11.22.38 pm.png">
|
||||
<br>
|
||||
</div>
|
||||
<div><b>Step 3: </b>Fill in details for the app.</div>
|
||||
<div>
|
||||
<img src="{{docs_base_path}}/assets/img/articles/Screen Shot 2014-11-11 at 11.23.32 pm.png">
|
||||
<br>
|
||||
</div>
|
||||
<div>
|
||||
<br>
|
||||
</div>
|
||||
<div><b>Step 4: </b>After the app is created, note the app key and app secret and enter in `sites/{sitename}/site_config.json` as follows,</div>
|
||||
<div>
|
||||
<br>
|
||||
</div>
|
||||
<div><pre><code>{
|
||||
"db_name": "demo",
|
||||
"db_password": "DZ1Idd55xJ9qvkHvUH",
|
||||
"dropbox_access_key": "ACCESSKEY",
|
||||
"dropbox_secret_key": "SECRECTKEY"
|
||||
} </code></pre>
|
||||
<br>
|
||||
</div>
|
||||
<div><b>Step 5: </b>Setup dropbox backups from the backup manager as shown in previous section.</div>
|
||||
@@ -0,0 +1,74 @@
|
||||
#Setting Up Dropbox Backups
|
||||
|
||||
We always recommend customers to maintain backup of their data in ERPNext. he database backup is downloaded in the form of an SQL file. If needed, this SQL file of backup can be restored in the another ERPNext account as well.
|
||||
|
||||
You can automate database backup download of your ERPNext account into your Dropbox account.
|
||||
|
||||
####Step 1: Go to Setup
|
||||
|
||||
`Explore > Setup > Integrations > Dropbox Backup`
|
||||
|
||||
####Step 2: Activate
|
||||
|
||||
In the Dropbox Backup, check "Send Backups to Dropbox" to active this feature. On checking this field, you will find field to set Frequency and notification Email.
|
||||
|
||||
####Step 3: Set Frequency
|
||||
|
||||
Set Frequency to download backup in your Dropbox account.
|
||||
|
||||
<img class="screenshot" alt="set frequency" src="{{docs_base_url}}/assets/img/setup/dropbox-1.png">
|
||||
|
||||
####Step 4: Allow Dropbox Access
|
||||
|
||||
After setting frequency and updating notification email, click on `Allow Dropbox access`. On clicking this button, the Dropbox login page will open in the new tab. This might require you to allow pop-up for your ERPNext account.
|
||||
|
||||
####Step 5: Login to Dropbox
|
||||
|
||||
Login to your Dropbox account by entering login credentials.
|
||||
|
||||
<img class="screenshot" alt="Login" src="{{docs_base_url}}/assets/img/setup/dropbox-2.png">
|
||||
|
||||
####Step 6: Allow
|
||||
|
||||
On successfull login, you will find a confirmation message as following. Click on "Allow" to let your ERPNext account have access to your Dropbox account.
|
||||
|
||||
<img class="screenshot" alt="Allow" src="{{docs_base_url}}/assets/img/setup/dropbox-3.png">
|
||||
|
||||
With this, a folder called "ERPNext" will be created in your Dropbox account, and database backup will start to auto-download in it.
|
||||
|
||||
##Open Source Users
|
||||
|
||||
####Step 1: Go to
|
||||
|
||||
<a href="https://www.dropbox.com/developers/apps" target="_blank" style="line-height: 1.42857143;">https://www.dropbox.com/developers/apps</a>
|
||||
|
||||
####Step 2:Create a new app
|
||||
|
||||
<img class="screenshot" alt="Create new" src="{{docs_base_url}}/assets/img/setup/dropbox-open-3.png">
|
||||
|
||||
####Step 3: Fill in details for the app
|
||||
|
||||
<img class="screenshot" alt="Create new" src="{{docs_base_url}}/assets/img/setup/dropbox-open-1.png">
|
||||
|
||||
-
|
||||
<img class="screenshot" alt="Create new" src="{{docs_base_url}}/assets/img/setup/dropbox-open-2.png">
|
||||
|
||||
####Step 4: Settings in Site Config
|
||||
|
||||
After the app is created, note the app key and app secret and enter in `sites/{sitename}/site_config.json` as follows,
|
||||
|
||||
<div>
|
||||
<pre>
|
||||
<code>{
|
||||
"db_name": "demo",
|
||||
"db_password": "DZ1Idd55xJ9qvkHvUH",
|
||||
"dropbox_access_key": "ACCESSKEY",
|
||||
"dropbox_secret_key": "SECRECTKEY"
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
####Step 5: Complete Backup
|
||||
|
||||
Setup dropbox backups from the backup manager as shown in previous section.
|
||||
@@ -1,23 +1,38 @@
|
||||
# Letter Heads
|
||||
#Letter Head
|
||||
|
||||
You can manage multiple letter heads in ERPNext. In a letter head you can:
|
||||
Each company has default Letter Head for their company. This Letter Head values are generally set as Header and Footer in the documents. In ERPNext, you can capture the these details in the Letter Head master.
|
||||
|
||||
* Create an image with your logo, brand and other information that you want to put on your letter head.
|
||||
* Attach the image in your Letter Head record by clicking on image icon to automatically generate the HTML required for this Letter Head.
|
||||
* If you want to make this the default letter head, click on “Is Default”.
|
||||
In the Letter Head master, you can track Header and Footer details of the company. These details will appear in the Print Format of the transactions like Sales Order, Sales Invoice, Salary Slip, Purchase Order etc.
|
||||
|
||||
Your letter head will now appear in all Prints and Emails of documents.
|
||||
####Step 1: Go to Setup
|
||||
|
||||
You can create / manage Letter Heads from:
|
||||
`Explore > Setup > Printing > Letter Head > New Letter Head`
|
||||
|
||||
> Setup > Printing > Letter Head > New Letter Head
|
||||
####Step 2: Letter Head Name
|
||||
|
||||
### Example
|
||||
In one ERPNext account, you can enter multiple Letter Head, hence name Letter Head so that you can identify it easily. For example, if your Letter Head also contains office address, then you should create separate Letter Head for each office location.
|
||||
|
||||
####Step 3: Enter Details
|
||||
|
||||
Following is how you can enter details in the Letter Head.
|
||||
|
||||
* Logo Image: You can insert the image in your Letter Head record by clicking on image icon. Once image is inserted, HTML for it will be generated automatically.
|
||||
* Other information (like Address, tax ID etc.) that you want to put on your letter head.
|
||||
|
||||
<img class="screenshot" alt="Print Heading" src="{{docs_base_url}}/assets/img/setup/print/letter-head.png">
|
||||
|
||||
> If you want to make this the default letter head, click on “Is Default”.
|
||||
|
||||
This is how the letter head looks in a document print:
|
||||
####Step 4: Save
|
||||
|
||||
After enter values in the Header and Footer section, Save Letter Head.
|
||||
|
||||
####Letter Head in the Print Format
|
||||
|
||||
This is how the letter head looks in a document's print.
|
||||
|
||||
<img class="screenshot" alt="Print Heading" src="{{docs_base_url}}/assets/img/setup/print/letter-head-1.png">
|
||||
|
||||
{next}
|
||||
> Please note that Footer will be visible only when document's print is seen in the PDF. Footer will not be visible in the HTML based print preview.
|
||||
|
||||
{next}
|
||||
@@ -1,72 +1,60 @@
|
||||
# User Permissions
|
||||
|
||||
Limit access for a User to a set of documents using User Permissions Manager
|
||||
|
||||
Role Base Permissions define the periphery of document types within which a user with a set of Roles can move around in. However, you can have an even finer control by defining User Permissions for a User. By setting specific documents in User Permissions list, you can limit access for that User to specific documents of a particular DocType, on the condition that "Apply User Permissions" is checked in Role Permissions Manager.
|
||||
|
||||
To start with, go to:
|
||||
|
||||
> Setup > Permissions > User Permissions Manager
|
||||
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-company.png"
|
||||
class="img-responsive" alt="User Permissions Manager">
|
||||
<figcaption>User Permissions Manager displaying how users can access only a specific Company.</figcaption>
|
||||
</figure>
|
||||
User Permissions Manager displaying how users can access only a specific Company.
|
||||
|
||||
#### Example
|
||||
|
||||
User 'aromn@example.com' has Sales User role and we want to limit the user to access records for only a specific Company 'Wind Power LLC'.
|
||||
User 'tom.hagen@riosolutions.com' has Sales User role and we want to limit the user to access records for only a specific Company 'Rio Solutions'.
|
||||
|
||||
1. We add a User Permissions row for Company.
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permission-user-limited-by-company.png"
|
||||
class="img-responsive" alt="User Permissions For Company">
|
||||
<figcaption>Add User Permissions row for a combination of User 'aromn@example.com' and Company 'Wind Power LLC'.</figcaption>
|
||||
</figure>
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-new.gif" class="screen" alt="User Permissions For Company">
|
||||
|
||||
Add User Permissions row for a combination of User 'tom.hagen@riosolutions.com' and Company 'Rio Solutions'.
|
||||
|
||||
1. Also Role "All" has only Read permission for Company, with 'Apply User Permissions' checked.
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-company-role-all.png"
|
||||
class="img-responsive" alt="Role Permissions for All on Company">
|
||||
<figcaption>Read Permission with Apply User Permissions checked for DocType Company.</figcaption>
|
||||
</figure>
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-company-role-all.png" class="screen" alt="Role Permissions for All on Company">
|
||||
|
||||
1. The combined effect of the above two rules lead to User 'aromn@example.com' having only Read access to Company 'Wind Power LLC'.
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-company-wind-power-llc.png"
|
||||
class="img-responsive" alt="Effect of Role and User Permissions on Company">
|
||||
<figcaption>Access is limited to Company 'Wind Power LLC'.</figcaption>
|
||||
</figure>
|
||||
Read Permission with Apply User Permissions checked for DocType Company.
|
||||
|
||||
1. The combined effect of the above two rules lead to User 'tom.hagen@riosolutions.com' having only Read access to Company 'Rio Solutions'.
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permission-company.png" class="screen" alt="Effect of Role and User Permissions on Company">
|
||||
|
||||
Access is limited to Company 'Rio Solutions'.
|
||||
|
||||
1. We want this User Permission on Company to get applied on other documents like Quotation, Sales Order, etc.
|
||||
These forms have a **Link Field based on Company**. As a result, User Permissions on Company also get applied on these documents, which leads to User 'aromn@example.com' to acces these documents having Company 'Wind Power LLC'.
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-quotation-sales-user.png"
|
||||
class="img-responsive" alt="Sales User Role Permissions for Quotation">
|
||||
<figcaption>Users with Sales User Role can Read, Write, Create, Submit and Cancel Quotations based on their User Permissions, since 'Apply User Permissions' is checked.</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/old_images/erpnext/user-permissions-quotation-list.png"
|
||||
class="img-responsive" alt="Quotation List limited to results for Company 'Wind Power LLC'">
|
||||
<figcaption>Quotation List is limited to results for Company 'Wind Power LLC' for User 'aromn@example.com'.</figcaption>
|
||||
</figure>
|
||||
|
||||
These forms have a **Link Field based on Company**. As a result, User Permissions on Company also get applied on these documents, which leads to User 'tom.hagen@riosolutions' to acces these documents having Company 'Rio Solutions'.
|
||||
|
||||
1. User Permissions get applied automatically based on Link Fields, just like how it worked for Quotation. But, Lead Form has 4 Link fields: Territory, Company, Lead Owner and Next Contact By. Say, you want Leads to limit access to Users based only on Territory, even though you have defined User Permissions for DocTypes User, Territory and Company. You can do this by setting 'Ignore User Permissions' for Link fields: Company, Lead Owner and Next Contact By.
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-lead-role-permissions.png"
|
||||
class="img-responsive" alt="Role Permissions on Lead for Sales User Role">
|
||||
<figcaption>Sales User can Read, Write and Create Leads limited by User Permissions.</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-ignore-user-permissions.png"
|
||||
class="img-responsive" alt="Set Ingore User Permissions from Setup > Customize > Customize Form">
|
||||
<figcaption>Check 'Ingore User Permissions' for Company, Lead Owner and Next Contact By fields using Setup > Customize > Customize Form for Lead.</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<img src="{{docs_base_url}}/assets/old_images/erpnext/user-permissions-lead-based-on-territory.png"
|
||||
class="img-responsive" alt="Lead List is limited to records with Territory 'United States'">
|
||||
<figcaption>Due to the effect of the above combination, User 'aromn@example.com' can only access Leads with Territory 'United States'.</figcaption>
|
||||
</figure>
|
||||
<img class="screen" alt="Sales User Role Permissions for Quotation" src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-quotation-sales-user.png" >
|
||||
|
||||
Users with Sales User Role can Read, Write, Create, Submit and Cancel Quotations based on their User Permissions, since 'Apply User Permissions' is checked.
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permission-quotation.png" class="screenshot" alt="Quotation List limited to results for Company 'Rio Solutions'">
|
||||
|
||||
Quotation List is limited to results for Company 'Rio Solutions' for User 'tom.hagen@riosolutions.com'.
|
||||
|
||||
1. User Permissions get applied automatically based on Link Fields, just like how it worked for Quotation. But, Lead Form has 4 Link fields: Territory, Company, Lead Owner and Next Contact By. Say, you want Leads to limit access to Users based only on Territory, even though you have defined User Permissions for DocTypes User, Territory and Company. You can do this by setting 'Ignore User Permissions' for Link fields: Company, Lead Owner and Next Contact By.
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-lead-role-permissions.png" class="screen" alt="Role Permissions on Lead for Sales User Role">
|
||||
|
||||
Sales User can Read, Write and Create Leads limited by User Permissions.
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-permissions-ignore-user-permissions.png" class="screenshot" alt="Set Ingore User Permissions from Setup > Customize > Customize Form">
|
||||
|
||||
Check 'Ingore User Permissions' for Company, Lead Owner and Next Contact By fields using Setup > Customize > Customize Form for Lead.
|
||||
|
||||
<img src="{{docs_base_url}}/assets/img/users-and-permissions/permissions-lead-list.png" class="screenshot" alt="Lead List is limited to records with Territory 'United States'">
|
||||
|
||||
Due to the effect of the above combination, User 'tom.hagen@riosolutions.com' can only access Leads with Territory 'United States'.
|
||||
|
||||
{next}
|
||||
|
||||
|
||||
@@ -1,42 +1,38 @@
|
||||
In perpetual inventory, system creates accounting entries for each stock
|
||||
transactions, so that stock and account balance will always remain same. The
|
||||
account balance will be posted against their respective account heads for each
|
||||
Warehouse. On saving of a Warehouse, the system will automatically create an
|
||||
account head with the same name as warehouse. As account balance is maintained
|
||||
for each Warehouse, you should create Warehouses, based on the type of items
|
||||
(Current / Fixed Assets) it stores.
|
||||
As per the perpetual inventory system, accounts posting is done for every stock transaction.
|
||||
|
||||
At the time of items received in a particular warehouse, the balance of asset
|
||||
account (linked to that warehouse) will be increased. Similarly when you
|
||||
deliver some items from that warehouse, an expense will be booked and the
|
||||
asset account will be reduced, based on the valuation amount of those items.
|
||||
On creating new Warehouse, the system will automatically create an Account in the Chart of Accout, with the same name as Warehouse Name.
|
||||
|
||||
## **Activation**
|
||||
On receipt of items in a particular warehouse, the balance in the Warehouse Account will increase. Similarly when items are delivered from the Warehouse, an expense will be booked, and balance in the Warehouse Account will reduce.
|
||||
|
||||
1. Setup the following default accounts for each Company
|
||||
##Activation
|
||||
|
||||
1. Setup the following default accounts for each Company. These accounts are created automatically in the new ERPNext accounts.
|
||||
|
||||
* Stock Received But Not Billed
|
||||
* Stock Adjustment Account
|
||||
* Expenses Included In Valuation
|
||||
* Cost Center
|
||||
2. In perpetual inventory, the system will maintain separate account balance for each warehouse under separate account head. To create that account head, enter "Create Account Under" in Warehouse master.
|
||||
|
||||
2. Ensure each Warehouse is an Account in the Chart of Accounts master. As per the default configuration, Accounts for Warehouse are created under `Assets > Current Asset > Stock Assets > (Warehouse)`
|
||||
|
||||
3. Activate Perpetual Inventory
|
||||
|
||||
> Setup > Accounts Settings > Make Accounting Entry For Every Stock Movement
|
||||
> Explore > Accounts > Accounts Settings > "Make Accounting Entry For Every Stock Movement"
|
||||
|
||||
<img class="screenshot" alt="Perpetual Inventory" src="{{docs_base_url}}/assets/img/accounts/perpetual-1.png">
|
||||
|
||||
* * *
|
||||
|
||||
## **Example**
|
||||
##Example
|
||||
|
||||
Consider following Chart of Accounts and Warehouse setup for your company:
|
||||
|
||||
#### Chart of Accounts
|
||||
####Chart of Accounts
|
||||
|
||||
* Assets (Dr)
|
||||
* Current Assets
|
||||
* Accounts Receivable
|
||||
* Jane Doe
|
||||
* Debtor
|
||||
* Stock Assets
|
||||
* Stores
|
||||
* Finished Goods
|
||||
@@ -44,11 +40,11 @@ Consider following Chart of Accounts and Warehouse setup for your company:
|
||||
* Tax Assets
|
||||
* VAT
|
||||
* Fixed Assets
|
||||
* Fixed Asset Warehouse
|
||||
* Fixed Asset Warehouse
|
||||
* Liabilities (Cr)
|
||||
* Current Liabilities
|
||||
* Accounts Payable
|
||||
* East Wind Inc.
|
||||
* Creditors
|
||||
* Stock Liabilities
|
||||
* Stock Received But Not Billed
|
||||
* Tax Liabilities
|
||||
@@ -65,18 +61,15 @@ Consider following Chart of Accounts and Warehouse setup for your company:
|
||||
* Shipping Charges
|
||||
* Customs Duty
|
||||
|
||||
#### Warehouse - Account Configuration
|
||||
####Warehouse - Account Configuration
|
||||
|
||||
* Stores
|
||||
* Work In Progress
|
||||
* Finished Goods
|
||||
* Fixed Asset Warehouse
|
||||
|
||||
### **Purchase Receipt**
|
||||
###Purchase Receipt
|
||||
|
||||
Suppose you have purchased _10 nos_ of item "RM0001" at _$200_ and _5 nos_ of
|
||||
item "Desktop" at **$100** from supplier "East Wind Inc". Following are the
|
||||
details of Purchase Receipt:
|
||||
Suppose you have purchased _10 nos_ of item "RM0001" at _$200_ and _5 nos_ of item "Base Plate" at **$100** from supplier "East Wind Inc". Following are the details of Purchase Receipt:
|
||||
|
||||
**Supplier:** East Wind Inc.
|
||||
|
||||
@@ -100,15 +93,7 @@ details of Purchase Receipt:
|
||||
<td>10</td>
|
||||
<td>200</td>
|
||||
<td>2000</td>
|
||||
<td>2200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Desktop</td>
|
||||
<td>Fixed Asset Warehouse</td>
|
||||
<td>5</td>
|
||||
<td>100</td>
|
||||
<td>500</td>
|
||||
<td>550</td>
|
||||
<td>2250</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -129,8 +114,8 @@ details of Purchase Receipt:
|
||||
<td>Total and Valuation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>VAT</td>
|
||||
<td>120</td>
|
||||
<td>VAT (10%)</td>
|
||||
<td>200</td>
|
||||
<td>Total</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -140,25 +125,22 @@ details of Purchase Receipt:
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Stock Ledger</strong>
|
||||
</p>
|
||||
|
||||
<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-2.png">
|
||||
**Stock Ledger**
|
||||
|
||||
<img class="screenshot" alt="Perpetual Inventory" src="{{docs_base_url}}/assets/img/accounts/perpetual-2.png">
|
||||
|
||||
**General Ledger**
|
||||
|
||||
<img alt="Leger" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-3.png">
|
||||
<img class="screenshot" alt="Perpetual Inventory" src="{{docs_base_url}}/assets/img/accounts/perpetual-3.png">
|
||||
|
||||
As stock balance increases through Purchase Receipt, "Store" and "Fixed Asset
|
||||
Warehouse" accounts are debited and a temporary account "Stock Receipt But Not
|
||||
Billed" account is credited, to maintain double entry accounting system. At the same time, negative expense is booked in account "Expense included in Valuation" for the amount added for valuation purpose, to avoid double expense booking.
|
||||
As stock balance increases through Purchase Receipt, "Store" accounts are debited and a temporary account "Stock Receipt But Not Billed" account is credited, to maintain double entry accounting system. At the same time, negative expense is booked in account "Expense included in Valuation" for the amount added for valuation purpose, to avoid double expense booking.
|
||||
|
||||
* * *
|
||||
|
||||
### **Purchase Invoice**
|
||||
###Purchase Invoice
|
||||
|
||||
On receiving Bill from supplier, for the above Purchase Receipt, you will make
|
||||
Purchase Invoice for the same. The general ledger entries are as follows:
|
||||
On receiving Bill from supplier, for the above Purchase Receipt, you will make Purchase Invoice for the same. The general ledger entries are as follows:
|
||||
|
||||
**General Ledger**
|
||||
|
||||
@@ -169,7 +151,7 @@ effect of Purchase Receipt.
|
||||
|
||||
* * *
|
||||
|
||||
### **Delivery Note**
|
||||
###Delivery Note
|
||||
|
||||
Lets say, you have an order from "Jane Doe" to deliver 5 nos of item "RM0001"
|
||||
at $300. Following are the details of Delivery Note:
|
||||
@@ -246,7 +228,7 @@ valuation method (FIFO / Moving Average) or actual cost of serialized items.
|
||||
|
||||
* * *
|
||||
|
||||
### **Sales Invoice with Update Stock**
|
||||
###Sales Invoice with Update Stock
|
||||
|
||||
Lets say, you did not make Delivery Note against the above order and instead
|
||||
you have made Sales Invoice directly, with "Update Stock" options. The details
|
||||
@@ -265,7 +247,7 @@ Goods Sold" accounts are also affected based on the valuation amount.
|
||||
|
||||
* * *
|
||||
|
||||
### **Stock Entry (Material Receipt)**
|
||||
###Stock Entry (Material Receipt)
|
||||
|
||||
**Items:**
|
||||
|
||||
@@ -300,7 +282,7 @@ Goods Sold" accounts are also affected based on the valuation amount.
|
||||
|
||||
* * *
|
||||
|
||||
### **Stock Entry (Material Issue)**
|
||||
###Stock Entry (Material Issue)
|
||||
|
||||
**Items:**
|
||||
|
||||
@@ -335,7 +317,7 @@ Goods Sold" accounts are also affected based on the valuation amount.
|
||||
|
||||
* * *
|
||||
|
||||
### **Stock Entry (Material Transfer)**
|
||||
###Stock Entry (Material Transfer)
|
||||
|
||||
**Items:**
|
||||
|
||||
|
||||
@@ -14,14 +14,10 @@ To set up a shopping cart, go to the selling module.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### Step 2: Enter Price List, Tax Master and Shipping Rule.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### Shopping Cart Display
|
||||
|
||||
On the Website, the shopping cart image will be seen below the Item price.
|
||||
@@ -31,8 +27,6 @@ to the flower sign.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
Click on the flower sign on the right hand side to see the cart details. Click
|
||||
on the cart to get the final amount details.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
frappe.listview_settings['Employee'] = {
|
||||
add_fields: ["status", "branch", "department", "designation"],
|
||||
add_fields: ["status", "branch", "department", "designation","image"],
|
||||
filters: [["status","=", "Active"]],
|
||||
get_indicator: function(doc) {
|
||||
var indicator = [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -57,6 +57,8 @@ class ProcessPayroll(Document):
|
||||
Creates salary slip for selected employees if already not created
|
||||
"""
|
||||
|
||||
self.check_permission('write')
|
||||
|
||||
emp_list = self.get_emp_list()
|
||||
ss_list = []
|
||||
for emp in emp_list:
|
||||
@@ -102,6 +104,8 @@ class ProcessPayroll(Document):
|
||||
"""
|
||||
Submit all salary slips based on selected criteria
|
||||
"""
|
||||
self.check_permission('write')
|
||||
|
||||
ss_list = self.get_sal_slip_list()
|
||||
not_submitted_ss = []
|
||||
for ss in ss_list:
|
||||
@@ -159,6 +163,8 @@ class ProcessPayroll(Document):
|
||||
|
||||
|
||||
def make_journal_entry(self, salary_account = None):
|
||||
self.check_permission('write')
|
||||
|
||||
amount = self.get_total_salary()
|
||||
default_bank_account = frappe.db.get_value("Company", self.company,
|
||||
"default_bank_account")
|
||||
|
||||
@@ -99,7 +99,7 @@ def make_salary_slip(source_name, target_doc=None):
|
||||
for d in source.get(key):
|
||||
target.append(key, {
|
||||
'amount': d.amount,
|
||||
'default_amount': d.default_amount,
|
||||
'default_amount': d.amount,
|
||||
'depends_on_lwp' : d.depends_on_lwp,
|
||||
'salary_component' : d.salary_component
|
||||
})
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -2,13 +2,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Operation(Document):
|
||||
def calculate_op_cost(self):
|
||||
if self.hour_rate and self.time_in_mins:
|
||||
self.operating_cost = flt(self.hour_rate) * flt(self.time_in_mins) / 60.0
|
||||
else :
|
||||
self.operating_cost = 0
|
||||
|
||||
def validate(self):
|
||||
if not self.description:
|
||||
self.description = self.name
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
@@ -85,7 +85,7 @@
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
@@ -539,7 +539,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-11 03:28:04.235889",
|
||||
"modified": "2016-08-22 03:41:42.356833",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Manufacturing",
|
||||
"name": "Production Order Operation",
|
||||
|
||||
@@ -9,7 +9,7 @@ erpnext.patches.v4_0.move_warehouse_user_to_restrictions
|
||||
erpnext.patches.v4_0.global_defaults_to_system_settings
|
||||
erpnext.patches.v4_0.update_incharge_name_to_sales_person_in_maintenance_schedule
|
||||
execute:frappe.reload_doc('stock', 'doctype', 'warehouse')
|
||||
execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-29
|
||||
execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2016-08-31
|
||||
execute:frappe.reload_doc('selling', 'doctype', 'sales_order') # 2014-01-29
|
||||
execute:frappe.reload_doc('selling', 'doctype', 'quotation') # 2014-01-29
|
||||
execute:frappe.reload_doc('stock', 'doctype', 'delivery_note') # 2014-01-29
|
||||
@@ -22,17 +22,16 @@ execute:frappe.reload_doc('accounts', 'doctype', 'pos_setting') # 2014-01-29
|
||||
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_doctype('Item')
|
||||
execute:frappe.reload_doc('accounts', 'doctype', 'pricing_rule')
|
||||
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, '')=''""")
|
||||
@@ -103,7 +102,6 @@ erpnext.patches.v5_0.update_frozen_accounts_permission_role
|
||||
erpnext.patches.v5_0.update_dn_against_doc_fields
|
||||
execute:frappe.db.sql("update `tabMaterial Request` set material_request_type = 'Material Transfer' where material_request_type = 'Transfer'")
|
||||
execute:frappe.reload_doc('stock', 'doctype', 'item')
|
||||
execute:frappe.db.sql("update `tabItem` i set apply_warehouse_wise_reorder_level=1, re_order_level=0, re_order_qty=0 where exists(select name from `tabItem Reorder` where parent=i.name)")
|
||||
erpnext.patches.v5_0.set_default_company_in_bom
|
||||
execute:frappe.reload_doc('crm', 'doctype', 'lead')
|
||||
execute:frappe.reload_doc('crm', 'doctype', 'opportunity')
|
||||
@@ -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
|
||||
@@ -265,17 +264,17 @@ 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
|
||||
erpnext.patches.v7_0.create_budget_record
|
||||
execute:frappe.delete_doc_if_exists("Page", "financial-analytics")
|
||||
erpnext.patches.v7_0.update_project_in_gl_entry
|
||||
execute:frappe.db.sql('update tabQuotation set status="Cancelled" where docstatus=2')
|
||||
execute:frappe.rename_doc("DocType", "Payments", "Sales Invoice Payment", force=True)
|
||||
erpnext.patches.v7_0.update_mins_to_first_response
|
||||
erpnext.patches.v6_20x.repost_valuation_rate_for_negative_inventory
|
||||
erpnext.patches.v7_0.migrate_mode_of_payments_v6_to_v7
|
||||
erpnext.patches.v7_0.system_settings_setup_complete
|
||||
erpnext.patches.v7_0.set_naming_series_for_timesheet #2016-07-27
|
||||
execute:frappe.reload_doc('projects', 'doctype', 'project')
|
||||
@@ -283,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
|
||||
@@ -309,5 +308,13 @@ 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.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_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
|
||||
|
||||
@@ -219,6 +219,7 @@ def execute():
|
||||
frappe.reload_doc("manufacturing", "doctype", "production_order_operation")
|
||||
frappe.reload_doc("manufacturing", "doctype", "workstation_working_hour")
|
||||
frappe.reload_doc("stock", "doctype", "item_variant")
|
||||
frappe.reload_doc("hr", "doctype", "salary_detail")
|
||||
frappe.reload_doc("accounts", "doctype", "party_account")
|
||||
frappe.reload_doc("accounts", "doctype", "fiscal_year_company")
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ import frappe
|
||||
|
||||
def execute():
|
||||
fields = ("is_stock_item", "is_asset_item", "has_batch_no", "has_serial_no",
|
||||
"inspection_required", "is_sub_contracted_item")
|
||||
|
||||
"is_sales_item", "is_purchase_item", "inspection_required", "is_sub_contracted_item")
|
||||
|
||||
# convert to 1 or 0
|
||||
update_str = ", ".join(["`{0}`=if(`{0}`='Yes',1,0)".format(f) for f in fields])
|
||||
|
||||
@@ -13,4 +13,5 @@ def execute():
|
||||
ts.flags.ignore_validate = True
|
||||
ts.flags.ignore_mandatory = True
|
||||
ts.flags.ignore_validate_update_after_submit = True
|
||||
ts.flags.ignore_links = True
|
||||
ts.save()
|
||||
|
||||
@@ -1,20 +1,43 @@
|
||||
import frappe
|
||||
|
||||
from erpnext.manufacturing.doctype.production_order.production_order import make_timesheet, add_timesheet_detail
|
||||
from erpnext.manufacturing.doctype.production_order.production_order \
|
||||
import make_timesheet, add_timesheet_detail
|
||||
|
||||
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:
|
||||
company = frappe.db.get_value("Prodction Order", data.production_order, "company")
|
||||
else:
|
||||
company = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||
|
||||
time_sheet = make_timesheet(data.production_order)
|
||||
args = get_timelog_data(data)
|
||||
add_timesheet_detail(time_sheet, args)
|
||||
time_sheet.docstatus = data.docstatus
|
||||
time_sheet.employee = data.employee
|
||||
time_sheet.note = data.note
|
||||
time_sheet.company = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||
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)
|
||||
for d in time_sheet.get("time_logs"):
|
||||
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 {
|
||||
'billable': data.billable,
|
||||
|
||||