Merge branch 'develop' into datev_check_fiscal_year

This commit is contained in:
Raffael Meyer 2020-11-05 17:29:42 +01:00 committed by GitHub
commit a62d138748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 43 additions and 36 deletions

View File

@ -17,7 +17,7 @@
</div>
<div class="col-xs-6">
<table>
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.format_date(doc.creation) }}</td></tr>
</table>
</div>
</div>

View File

@ -5,7 +5,7 @@
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
{%- for label, value in (
(_("Received On"), frappe.utils.formatdate(doc.voucher_date)),
(_("Received On"), frappe.utils.format_date(doc.voucher_date)),
(_("Received From"), doc.pay_to_recd_from),
(_("Amount"), "<strong>" + doc.get_formatted("total_amount") + "</strong><br>" + (doc.total_amount_in_words or "") + "<br>"),
(_("Remarks"), doc.remark)

View File

@ -8,7 +8,7 @@
<div class="col-xs-6">
<table>
<tr><td><strong>Supplier Name: </strong></td><td>{{ doc.supplier }}</td></tr>
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.format_date(doc.due_date) }}</td></tr>
<tr><td><strong>Address: </strong></td><td>{{doc.address_display}}</td></tr>
<tr><td><strong>Contact: </strong></td><td>{{doc.contact_display}}</td></tr>
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
@ -17,7 +17,7 @@
<div class="col-xs-6">
<table>
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.format_date(doc.creation) }}</td></tr>
</table>
</div>
</div>

View File

@ -8,7 +8,7 @@
<div class="col-xs-6">
<table>
<tr><td><strong>Customer Name: </strong></td><td>{{ doc.customer }}</td></tr>
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.format_date(doc.due_date) }}</td></tr>
<tr><td><strong>Address: </strong></td><td>{{doc.address_display}}</td></tr>
<tr><td><strong>Contact: </strong></td><td>{{doc.contact_display}}</td></tr>
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
@ -17,7 +17,7 @@
<div class="col-xs-6">
<table>
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.format_date(doc.creation) }}</td></tr>
</table>
</div>
</div>

View File

@ -50,13 +50,11 @@
"reqd": 1
},
{
"depends_on": "eval:parent.doctype == 'Asset'",
"fieldname": "depreciation_start_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Depreciation Posting Date",
"mandatory_depends_on": "eval:parent.doctype == 'Asset'",
"reqd": 1
"mandatory_depends_on": "eval:parent.doctype == 'Asset'"
},
{
"default": "0",
@ -87,7 +85,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-10-30 15:22:29.119868",
"modified": "2020-11-05 16:30:09.213479",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Finance Book",

View File

@ -108,7 +108,7 @@ def update_maintenance_log(asset_maintenance, item_code, item_name, task):
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_team_members(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.get_values('Maintenance Team Member', { 'parent': filters.get("maintenance_team") })
return frappe.db.get_values('Maintenance Team Member', { 'parent': filters.get("maintenance_team") }, "team_member")
@frappe.whitelist()
def get_maintenance_log(asset_name):

View File

@ -539,7 +539,7 @@ erpnext.utils.update_child_items = function(opts) {
fieldtype: "Table",
label: "Items",
cannot_add_rows: cannot_add_row,
in_place_edit: true,
in_place_edit: false,
reqd: 1,
data: this.data,
get_data: () => {

View File

@ -572,12 +572,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
"fieldname": "against_default_supplier",
"default": 0
},
{
"fieldtype": "Section Break",
"label": "",
"fieldname": "sec_break_dialog",
"hide_border": 1
},
{
fieldname: 'items_for_po', fieldtype: 'Table', label: 'Select Items',
fields: [
@ -616,16 +610,13 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
read_only:1,
in_list_view:1
},
],
data: me.frm.doc.items.map((item) =>{
item.pending_qty = (flt(item.stock_qty) - flt(item.ordered_qty)) / flt(item.conversion_factor);
return item;
}).filter((item) => {return item.pending_qty > 0;})
]
}
],
primary_action_label: 'Create Purchase Order',
primary_action (args) {
if (!args) return;
let selected_items = dialog.fields_dict.items_for_po.grid.get_selected_children();
if(selected_items.length == 0) {
frappe.throw({message: 'Please select Items from the Table', title: __('Items Required'), indicator:'blue'})
@ -635,8 +626,9 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
var method = args.against_default_supplier ? "make_purchase_order_for_default_supplier" : "make_purchase_order"
return frappe.call({
type: "GET",
method: "erpnext.selling.doctype.sales_order.sales_order." + method,
freeze: true,
freeze_message: __("Creating Purchase Order ..."),
args: {
"source_name": me.frm.doc.name,
"selected_items": selected_items
@ -660,8 +652,9 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
}
});
dialog.fields_dict["against_default_supplier"].df.onchange = () => {
console.log("yo");
dialog.fields_dict["against_default_supplier"].df.onchange = () => set_po_items_data(dialog);
function set_po_items_data (dialog) {
var against_default_supplier = dialog.get_value("against_default_supplier");
var items_for_po = dialog.get_value("items_for_po");
@ -671,16 +664,28 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
dialog.fields_dict["items_for_po"].df.data = items_with_supplier;
dialog.get_field("items_for_po").refresh();
} else {
let pending_items = me.frm.doc.items.map((item) =>{
item.pending_qty = (flt(item.stock_qty) - flt(item.ordered_qty)) / flt(item.conversion_factor);
return item;
}).filter((item) => {return item.pending_qty > 0;});
let po_items = [];
me.frm.doc.items.forEach(d => {
let pending_qty = (flt(d.stock_qty) - flt(d.ordered_qty)) / flt(d.conversion_factor);
if (pending_qty > 0) {
po_items.push({
"doctype": "Sales Order Item",
"name": d.name,
"item_name": d.item_name,
"item_code": d.item_code,
"pending_qty": pending_qty,
"uom": d.uom,
"supplier": d.supplier
});
}
});
dialog.fields_dict["items_for_po"].df.data = pending_items;
dialog.fields_dict["items_for_po"].df.data = po_items;
dialog.get_field("items_for_po").refresh();
}
}
set_po_items_data(dialog);
dialog.get_field("items_for_po").grid.only_sortable();
dialog.get_field("items_for_po").refresh();
dialog.wrapper.find('.grid-heading-row .grid-row-check').click();

View File

@ -779,7 +779,9 @@ def get_events(start, end, filters=None):
return data
@frappe.whitelist()
def make_purchase_order_for_default_supplier(source_name, selected_items=[], target_doc=None):
def make_purchase_order_for_default_supplier(source_name, selected_items=None, target_doc=None):
if not selected_items: return
if isinstance(selected_items, string_types):
selected_items = json.loads(selected_items)
@ -878,7 +880,9 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=[], tar
frappe.msgprint(_("Purchase Order already created for all Sales Order items"))
@frappe.whitelist()
def make_purchase_order(source_name, selected_items=[], target_doc=None):
def make_purchase_order(source_name, selected_items=None, target_doc=None):
if not selected_items: return
if isinstance(selected_items, string_types):
selected_items = json.loads(selected_items)

View File

@ -25,7 +25,7 @@
</span>
</div>
<div class="col-xs-6 text-muted text-right small">
{{ frappe.utils.formatdate(doc.transaction_date, 'medium') }}
{{ frappe.utils.format_date(doc.transaction_date, 'medium') }}
</div>
</div>

View File

@ -42,10 +42,10 @@
</span>
</div>
<div class="col-6 text-muted text-right small">
{{ frappe.utils.formatdate(doc.transaction_date, 'medium') }}
{{ frappe.utils.format_date(doc.transaction_date, 'medium') }}
{% if doc.valid_till %}
<p>
{{ _("Valid Till") }}: {{ frappe.utils.formatdate(doc.valid_till, 'medium') }}
{{ _("Valid Till") }}: {{ frappe.utils.format_date(doc.valid_till, 'medium') }}
</p>
{% endif %}
</div>