Merge branch 'hotfix'
This commit is contained in:
commit
a5162b7529
@ -1,4 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__version__ = '6.27.22'
|
||||
__version__ = '6.27.23'
|
@ -147,10 +147,11 @@ def get_invoice_expense_map(invoice_list):
|
||||
|
||||
def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
||||
tax_details = frappe.db.sql("""
|
||||
select parent, account_head, sum(base_tax_amount_after_discount_amount) as tax_amount
|
||||
select parent, account_head, case add_deduct_tax when "Add" then sum(base_tax_amount_after_discount_amount)
|
||||
else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount
|
||||
from `tabPurchase Taxes and Charges`
|
||||
where parent in (%s) and category in ('Total', 'Valuation and Total')
|
||||
group by parent, account_head
|
||||
group by parent, account_head, add_deduct_tax
|
||||
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||
|
||||
invoice_tax_map = {}
|
||||
|
@ -14,6 +14,26 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
onload: function() {
|
||||
this.setup_queries();
|
||||
this._super();
|
||||
|
||||
if(this.frm.get_field('shipping_address')) {
|
||||
this.frm.set_query("shipping_address", function(){
|
||||
if(me.frm.doc.customer){
|
||||
return{
|
||||
filters:{
|
||||
"customer": me.frm.doc.customer
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
return{
|
||||
filters:{
|
||||
"is_your_company_address": 1,
|
||||
"company": me.frm.doc.company
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setup_queries: function() {
|
||||
@ -174,25 +194,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
|
||||
shipping_address: function(){
|
||||
var me = this;
|
||||
|
||||
this.frm.set_query("shipping_address", function(){
|
||||
if(me.frm.doc.customer){
|
||||
return{
|
||||
filters:{
|
||||
"customer": me.frm.doc.customer
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
return{
|
||||
filters:{
|
||||
"is_your_company_address": 1,
|
||||
"company": me.frm.doc.company
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
erpnext.utils.get_address_display(this.frm, "shipping_address",
|
||||
"shipping_address_display", is_your_company_address=true)
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ frappe.ui.form.on("Opportunity", {
|
||||
customer: function(frm) {
|
||||
erpnext.utils.get_party_details(frm);
|
||||
},
|
||||
customer_address: erpnext.utils.get_address_display,
|
||||
customer_address: function(frm, cdt, cdn){
|
||||
erpnext.utils.get_address_display(frm, 'customer_address', 'address_display', false);
|
||||
},
|
||||
contact_person: erpnext.utils.get_contact_details,
|
||||
enquiry_from: function(frm) {
|
||||
frm.toggle_reqd("lead", frm.doc.enquiry_from==="Lead");
|
||||
|
@ -177,7 +177,7 @@ $.extend(cur_frm.cscript, {
|
||||
flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
|
||||
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
|
||||
|
||||
frappe.prompt({fieldtype:"Int", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
||||
frappe.prompt({fieldtype:"Float", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
||||
description: __("Max: {0}", [max]) },
|
||||
function(data) {
|
||||
if(data.qty > max) {
|
||||
|
@ -5,10 +5,12 @@ frappe.provide("erpnext.support");
|
||||
|
||||
frappe.ui.form.on_change("Maintenance Schedule", "customer", function(frm) {
|
||||
erpnext.utils.get_party_details(frm) });
|
||||
frappe.ui.form.on_change("Maintenance Schedule", "customer_address",
|
||||
erpnext.utils.get_address_display);
|
||||
frappe.ui.form.on_change("Maintenance Schedule", "contact_person",
|
||||
erpnext.utils.get_contact_details);
|
||||
frappe.ui.form.on_change("Maintenance Schedule", "customer_address", function(){
|
||||
erpnext.utils.get_address_display(cur_frm, 'customer_address', 'address_display');
|
||||
});
|
||||
frappe.ui.form.on_change("Maintenance Schedule", "contact_person", function(){
|
||||
erpnext.utils.get_contact_details(cur_frm);
|
||||
});
|
||||
|
||||
// TODO commonify this code
|
||||
erpnext.support.MaintenanceSchedule = frappe.ui.form.Controller.extend({
|
||||
|
@ -6,10 +6,12 @@ frappe.require("assets/erpnext/js/utils.js");
|
||||
|
||||
frappe.ui.form.on_change("Maintenance Visit", "customer", function(frm) {
|
||||
erpnext.utils.get_party_details(frm) });
|
||||
frappe.ui.form.on_change("Maintenance Visit", "customer_address",
|
||||
erpnext.utils.get_address_display);
|
||||
frappe.ui.form.on_change("Maintenance Visit", "contact_person",
|
||||
erpnext.utils.get_contact_details);
|
||||
frappe.ui.form.on_change("Maintenance Visit", "customer_address", function(frm){
|
||||
erpnext.utils.get_address_display(frm, 'customer_address', 'address_display')
|
||||
});
|
||||
frappe.ui.form.on_change("Maintenance Visit", "contact_person", function(frm){
|
||||
erpnext.utils.get_contact_details(frm)
|
||||
});
|
||||
|
||||
// TODO commonify this code
|
||||
erpnext.support.MaintenanceVisit = frappe.ui.form.Controller.extend({
|
||||
@ -87,4 +89,4 @@ cur_frm.fields_dict['purposes'].grid.get_field('item_code').get_query = function
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
||||
return {query: "erpnext.controllers.queries.customer_query" }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user