Fixed version conflict
This commit is contained in:
commit
d5ebd79ad7
@ -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"))
|
||||
|
||||
|
@ -530,6 +530,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:
|
||||
|
@ -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)),
|
||||
|
@ -325,4 +325,5 @@ erpnext.patches.v7_0.update_status_for_timesheet
|
||||
erpnext.patches.v7_0.set_party_name_in_payment_entry
|
||||
erpnext.patches.v7_1.set_student_guardian
|
||||
erpnext.patches.v7_0.update_conversion_factor_in_supplier_quotation_item
|
||||
erpnext.patches.v7_1.move_sales_invoice_from_parent_to_child_timesheet
|
||||
erpnext.patches.v7_1.move_sales_invoice_from_parent_to_child_timesheet
|
||||
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")
|
||||
|
@ -29,8 +29,8 @@ def execute():
|
||||
row.db_update()
|
||||
|
||||
si_doc.set_paid_amount()
|
||||
si_doc.db_set("paid_amount", si_doc.paid_amount)
|
||||
si_doc.db_set("base_paid_amount", si_doc.base_paid_amount)
|
||||
si_doc.db_set("paid_amount", si_doc.paid_amount, update_modified = False)
|
||||
si_doc.db_set("base_paid_amount", si_doc.base_paid_amount, update_modified = False)
|
||||
|
||||
count +=1
|
||||
|
||||
|
@ -9,6 +9,6 @@ def execute():
|
||||
ts = si_doc.append('timesheets',{})
|
||||
ts.time_sheet = time_sheet.name
|
||||
ts.billing_amount = time_sheet.total_billable_amount
|
||||
si_doc.update_time_sheet(time_sheet.sales_invoice)
|
||||
si_doc.flags.ignore_validate_update_after_submit = True
|
||||
si_doc.save()
|
||||
ts.db_update()
|
||||
si_doc.calculate_billing_amount_from_timesheet()
|
||||
si_doc.db_set("total_billing_amount", si_doc.total_billing_amount, update_modified = False)
|
@ -1,9 +1,10 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
for doctype in ['Time Log Batch', 'Time Log Batch Detail', 'Time Log']:
|
||||
frappe.delete_doc('DocType', doctype)
|
||||
|
||||
if frappe.db.table_exists("Time Log"):
|
||||
frappe.db.sql("""delete from `tabDocType`
|
||||
where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""")
|
||||
|
||||
report = "Daily Time Log Summary"
|
||||
if frappe.db.exists("Report", report):
|
||||
frappe.delete_doc('Report', report)
|
@ -8,6 +8,7 @@ from frappe import _
|
||||
|
||||
import json
|
||||
from datetime import timedelta
|
||||
from erpnext.controllers.queries import get_match_cond
|
||||
from frappe.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, get_datetime_str
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
@ -20,6 +21,7 @@ class OverProductionLoggedError(frappe.ValidationError): pass
|
||||
|
||||
class Timesheet(Document):
|
||||
def validate(self):
|
||||
self.set_employee_name()
|
||||
self.set_status()
|
||||
self.validate_dates()
|
||||
self.validate_time_logs()
|
||||
@ -27,6 +29,10 @@ class Timesheet(Document):
|
||||
self.calculate_total_amounts()
|
||||
self.calculate_percentage_billed()
|
||||
|
||||
def set_employee_name(self):
|
||||
if self.employee and not self.employee_name:
|
||||
self.employee_name = frappe.db.get_value('Employee', self.employee, 'employee_name')
|
||||
|
||||
def calculate_total_amounts(self):
|
||||
self.total_hours = 0.0
|
||||
self.total_billable_hours = 0.0
|
||||
@ -360,10 +366,14 @@ def get_events(start, end, filters=None):
|
||||
filters = json.loads(filters)
|
||||
|
||||
conditions = get_conditions(filters)
|
||||
return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.docstatus as status, `tabTimesheet Detail`.parent as parent,
|
||||
from_time, hours, activity_type, project, to_time from `tabTimesheet Detail`,
|
||||
`tabTimesheet` where `tabTimesheet Detail`.parent = `tabTimesheet`.name and `tabTimesheet`.docstatus < 2 and
|
||||
(from_time between %(start)s and %(end)s) {conditions}""".format(conditions=conditions),
|
||||
return frappe.db.sql("""select `tabTimesheet Detail`.name as name,
|
||||
`tabTimesheet Detail`.docstatus as status, `tabTimesheet Detail`.parent as parent,
|
||||
from_time, hours, activity_type, project, to_time
|
||||
from `tabTimesheet Detail`, `tabTimesheet`
|
||||
where `tabTimesheet Detail`.parent = `tabTimesheet`.name
|
||||
and `tabTimesheet`.docstatus < 2
|
||||
and (from_time between %(start)s and %(end)s) {conditions} {match_cond}
|
||||
""".format(conditions=conditions, match_cond = get_match_cond('Timesheet')),
|
||||
{
|
||||
"start": start,
|
||||
"end": end
|
||||
|
@ -20,7 +20,13 @@ frappe.ui.form.on("Item Group", {
|
||||
frm.trigger("set_root_readonly");
|
||||
frm.add_custom_button(__("Item Group Tree"), function() {
|
||||
frappe.set_route("Tree", "Item Group");
|
||||
}, "icon-sitemap");
|
||||
});
|
||||
|
||||
if(!frm.is_new()) {
|
||||
frm.add_custom_button(__("Items"), function() {
|
||||
frappe.set_route("List", "Item", {"item_group": frm.doc.name});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
set_root_readonly: function(frm) {
|
||||
|
@ -60,13 +60,15 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
|
||||
def get_context(self, context):
|
||||
context.show_search=True
|
||||
context.page_length = 6
|
||||
context.search_link = '/product_search'
|
||||
|
||||
start = int(frappe.form_dict.start or 0)
|
||||
if start < 0:
|
||||
start = 0
|
||||
context.update({
|
||||
"items": get_product_list_for_group(product_group = self.name, start=start, limit=24, search=frappe.form_dict.get("search")),
|
||||
"items": get_product_list_for_group(product_group = self.name, start=start,
|
||||
limit=context.page_length, search=frappe.form_dict.get("search")),
|
||||
"parent_groups": get_parent_item_groups(self.name),
|
||||
"title": self.name,
|
||||
"products_as_list": cint(frappe.db.get_single_value('Website Settings', 'products_as_list'))
|
||||
|
@ -455,16 +455,18 @@ class Item(WebsiteGenerator):
|
||||
|
||||
def cant_change(self):
|
||||
if not self.get("__islocal"):
|
||||
vals = frappe.db.get_value("Item", self.name, ["has_serial_no", "is_stock_item",
|
||||
"valuation_method", "has_batch_no", "is_fixed_asset"], as_dict=True)
|
||||
to_check = ("has_serial_no", "is_stock_item",
|
||||
"valuation_method", "has_batch_no", "is_fixed_asset")
|
||||
|
||||
if vals and ((self.is_stock_item != vals.is_stock_item) or
|
||||
vals.has_serial_no != self.has_serial_no or
|
||||
vals.has_batch_no != self.has_batch_no or
|
||||
cstr(vals.valuation_method) != cstr(self.valuation_method)):
|
||||
if self.check_if_linked_document_exists():
|
||||
frappe.throw(_("As there are existing transactions for this item, \
|
||||
you can not change the values of 'Has Serial No', 'Has Batch No', 'Is Stock Item' and 'Valuation Method'"))
|
||||
vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True)
|
||||
|
||||
if vals:
|
||||
for key in to_check:
|
||||
if self.get(key) != vals.get(key):
|
||||
if not self.check_if_linked_document_exists():
|
||||
break # no linked document, allowed
|
||||
else:
|
||||
frappe.throw(_("As there are existing transactions for this item, you can not change the value of {0}").format(frappe.bold(self.meta.get_label(key))))
|
||||
|
||||
if vals and not self.is_fixed_asset and self.is_fixed_asset != vals.is_fixed_asset:
|
||||
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
|
||||
|
@ -40,14 +40,6 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
}
|
||||
}
|
||||
}
|
||||
this.frm.set_query("difference_account", function() {
|
||||
return {
|
||||
"filters": {
|
||||
"company": me.frm.doc.company,
|
||||
"is_group": 0
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -844,33 +844,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"description": "",
|
||||
"fieldname": "difference_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Difference Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -1431,7 +1404,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-04-07 06:40:03.284036",
|
||||
"modified": "2016-09-08 06:40:03.284036",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry",
|
||||
|
@ -71,9 +71,6 @@ class StockEntry(StockController):
|
||||
if self.purpose not in valid_purposes:
|
||||
frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes)))
|
||||
|
||||
if self.purpose in ("Manufacture", "Repack") and not self.difference_account:
|
||||
self.difference_account = frappe.db.get_value("Company", self.company, "default_expense_account")
|
||||
|
||||
def set_transfer_qty(self):
|
||||
for item in self.get("items"):
|
||||
if not flt(item.qty):
|
||||
@ -97,9 +94,6 @@ class StockEntry(StockController):
|
||||
if f in ["stock_uom", "conversion_factor"] or not item.get(f):
|
||||
item.set(f, item_details.get(f))
|
||||
|
||||
if self.difference_account and not item.expense_account:
|
||||
item.expense_account = self.difference_account
|
||||
|
||||
if not item.transfer_qty and item.qty:
|
||||
item.transfer_qty = item.qty * item.conversion_factor
|
||||
|
||||
|
@ -57,8 +57,6 @@ def make_stock_entry(**args):
|
||||
s.purchase_receipt_no = args.purchase_receipt_no
|
||||
s.delivery_note_no = args.delivery_note_no
|
||||
s.sales_invoice_no = args.sales_invoice_no
|
||||
if args.difference_account:
|
||||
s.difference_account = args.difference_account
|
||||
if not args.cost_center:
|
||||
args.cost_center = frappe.get_value('Company', s.company, 'cost_center')
|
||||
|
||||
|
@ -31,10 +31,10 @@
|
||||
</div>
|
||||
<div class="text-center item-group-nav-buttons">
|
||||
{% if frappe.form_dict.start|int > 0 %}
|
||||
<a class="btn btn-default" href="{{ pathname }}?start={{ frappe.form_dict.start|int - 24 }}">Prev</a>
|
||||
<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int - page_length }}">Prev</a>
|
||||
{% endif %}
|
||||
{% if items|length == 24 %}
|
||||
<a class="btn btn-default" href="{{ pathname }}?start={{ frappe.form_dict.start|int + 24 }}">Next</a>
|
||||
{% if items|length == page_length %}
|
||||
<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int + page_length }}">Next</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
Loading…
Reference in New Issue
Block a user