Merge branch 'master' into develop
This commit is contained in:
commit
a531ebea8a
@ -147,10 +147,11 @@ def get_invoice_expense_map(invoice_list):
|
|||||||
|
|
||||||
def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
||||||
tax_details = frappe.db.sql("""
|
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`
|
from `tabPurchase Taxes and Charges`
|
||||||
where parent in (%s) and category in ('Total', 'Valuation and Total')
|
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)
|
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||||
|
|
||||||
invoice_tax_map = {}
|
invoice_tax_map = {}
|
||||||
|
@ -25,6 +25,26 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
onload: function() {
|
onload: function() {
|
||||||
this.setup_queries();
|
this.setup_queries();
|
||||||
this._super();
|
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() {
|
setup_queries: function() {
|
||||||
@ -225,25 +245,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
|
|
||||||
shipping_address: function(){
|
shipping_address: function(){
|
||||||
var me = this;
|
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",
|
erpnext.utils.get_address_display(this.frm, "shipping_address",
|
||||||
"shipping_address_display", is_your_company_address=true)
|
"shipping_address_display", is_your_company_address=true)
|
||||||
},
|
},
|
||||||
|
@ -220,7 +220,7 @@ $.extend(cur_frm.cscript, {
|
|||||||
flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
|
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);
|
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]), 'default': max },
|
description: __("Max: {0}", [max]), 'default': max },
|
||||||
function(data) {
|
function(data) {
|
||||||
if(data.qty > max) {
|
if(data.qty > max) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user