fixed merge conflict

This commit is contained in:
Nabin Hait 2018-04-06 15:18:27 +05:30
commit e9638be032
5 changed files with 28 additions and 35 deletions

View File

@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
from frappe.utils import getdate from frappe.utils import getdate
__version__ = '10.1.19' __version__ = '10.1.20'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -2,9 +2,8 @@
<style> <style>
@media screen { @media screen {
.print-format { .print-format {
padding: 8mm; padding: 4mm;
margin:4mm; font-size: 8.0pt !important;
font-size: 10.0pt !important;
font-family: Tahoma, sans-serif; font-family: Tahoma, sans-serif;
} }
} }
@ -12,9 +11,8 @@
{% } %} {% } %}
<style> <style>
.print-format { .print-format {
padding: 8mm; padding: 4mm;
margin:4mm; font-size: 8.0pt !important;
font-size: 10.0pt !important;
font-family: Tahoma, sans-serif; font-family: Tahoma, sans-serif;
} }
</style> </style>
@ -41,7 +39,7 @@
var range4 = report.columns[14].label; var range4 = report.columns[14].label;
%} %}
{% if(balance_row) { %} {% if(balance_row) { %}
<table class="table table-bordered table-condensed table-sm small"> <table class="table table-bordered table-condensed">
<caption class="text-right">(Amount in {%= data[0][__("currency")] || "" %})</caption> <caption class="text-right">(Amount in {%= data[0][__("currency")] || "" %})</caption>
<colgroup> <colgroup>
<col style="width: 30mm;"> <col style="width: 30mm;">
@ -100,8 +98,8 @@
<thead> <thead>
<tr> <tr>
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
<th style="width: 15%">{%= __("Date") %}</th> <th style="width: 18%">{%= __("Date") %}</th>
<th style="width: 20%">{%= __("Reference") %}</th> <th style="width: 17%">{%= __("Reference") %}</th>
{% if(!filters.show_pdc_in_print) { %} {% if(!filters.show_pdc_in_print) { %}
<th style="width: 20%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th> <th style="width: 20%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
{% } %} {% } %}
@ -234,4 +232,4 @@
{% } %} {% } %}
</tbody> </tbody>
</table> </table>
<p class="text-right text-muted">{{ __("Printed On") }}{%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p> <p class="text-right text-muted">{{ __("Printed On ") }}{%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>

View File

@ -9,7 +9,7 @@ import googlemaps
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from frappe.utils.user import get_user_fullname from frappe.utils.user import get_user_fullname
from frappe.utils import getdate from frappe.utils import getdate, cstr
from frappe.integrations.doctype.google_maps.google_maps import round_timedelta from frappe.integrations.doctype.google_maps.google_maps import round_timedelta
from frappe.integrations.doctype.google_maps.google_maps import format_address from frappe.integrations.doctype.google_maps.google_maps import format_address
@ -141,40 +141,33 @@ def calculate_time_matrix(name):
@frappe.whitelist() @frappe.whitelist()
def notify_customers(docname, date, driver, vehicle, sender_email, delivery_notification): def notify_customers(docname, date, driver, vehicle, sender_email, delivery_notification):
sender_name = get_user_fullname(sender_email) sender_name = get_user_fullname(sender_email)
delivery_stops = frappe.get_all('Delivery Stop', {"parent": docname})
attachments = [] attachments = []
for delivery_stop in delivery_stops: parent_doc = frappe.get_doc('Delivery Trip', docname)
delivery_stop_info = frappe.db.get_value( args = parent_doc.as_dict()
"Delivery Stop",
delivery_stop.name, for delivery_stop in parent_doc.delivery_stops:
["notified_by_email", "estimated_arrival", "details", "contact", "delivery_note"], contact_info = frappe.db.get_value("Contact", delivery_stop.contact,
as_dict=1)
contact_info = frappe.db.get_value("Contact", delivery_stop_info.contact,
["first_name", "last_name", "email_id", "gender"], as_dict=1) ["first_name", "last_name", "email_id", "gender"], as_dict=1)
if delivery_stop_info.delivery_note: args.update(delivery_stop.as_dict())
args.update(contact_info)
if delivery_stop.delivery_note:
default_print_format = frappe.get_meta('Delivery Note').default_print_format default_print_format = frappe.get_meta('Delivery Note').default_print_format
attachments = frappe.attach_print('Delivery Note', attachments = frappe.attach_print('Delivery Note',
delivery_stop_info.delivery_note, delivery_stop.delivery_note,
file_name="Delivery Note", file_name="Delivery Note",
print_format=default_print_format or "Standard") print_format=default_print_format or "Standard")
if not delivery_stop_info.notified_by_email and contact_info.email_id: if not delivery_stop.notified_by_email and contact_info.email_id:
driver_info = frappe.db.get_value("Driver", driver, ["full_name", "cell_number"], as_dict=1) driver_info = frappe.db.get_value("Driver", driver, ["full_name", "cell_number"], as_dict=1)
sender_designation = frappe.db.get_value("Employee", sender_email, ["designation"]) sender_designation = frappe.db.get_value("Employee", sender_email, ["designation"])
estimated_arrival = str(delivery_stop_info.estimated_arrival)[:-3] estimated_arrival = cstr(delivery_stop.estimated_arrival)[:-3]
email_template = frappe.get_doc("Standard Reply", delivery_notification) email_template = frappe.get_doc("Standard Reply", delivery_notification)
message = frappe.render_template( message = frappe.render_template(email_template.response, args)
email_template.response,
dict(contact_info=contact_info, sender_name=sender_name,
details=delivery_stop_info.details,
estimated_arrival=estimated_arrival,
date=getdate(date).strftime('%d.%m.%y'), vehicle=vehicle,
driver_info=driver_info,
sender_designation=sender_designation)
)
frappe.sendmail( frappe.sendmail(
recipients=contact_info.email_id, recipients=contact_info.email_id,
sender=sender_email, sender=sender_email,

View File

@ -532,7 +532,7 @@ class Item(WebsiteGenerator):
def on_trash(self): def on_trash(self):
super(Item, self).on_trash() super(Item, self).on_trash()
frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code) frappe.db.sql("""delete from tabBin where item_code=%s""", self.name)
frappe.db.sql("delete from `tabItem Price` where item_code=%s", self.name) frappe.db.sql("delete from `tabItem Price` where item_code=%s", self.name)
for variant_of in frappe.get_all("Item", filters={"variant_of": self.name}): for variant_of in frappe.get_all("Item", filters={"variant_of": self.name}):
frappe.delete_doc("Item", variant_of.name) frappe.delete_doc("Item", variant_of.name)

View File

@ -40,6 +40,8 @@ def get_data(item):
name = item_dict["variant_name"] name = item_dict["variant_name"]
for d in attribute_list: for d in attribute_list:
attr_dict = attr_val_map[name]
if attr_dict and attr_dict.get(d):
item_dict[d] = attr_val_map[name][d] item_dict[d] = attr_val_map[name][d]
item_dict["Open Orders"] = order_count_map.get(name) or 0 item_dict["Open Orders"] = order_count_map.get(name) or 0