[fix] [minor] conversion arte related fixes
This commit is contained in:
parent
1797cfef63
commit
7837827e30
@ -147,7 +147,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
debit_to: function() {
|
debit_to: function() {
|
||||||
|
@ -52,7 +52,7 @@ class AccountsController(TransactionBase):
|
|||||||
msgprint(_("Account for this ") + fieldname + _(" has been freezed. ") +
|
msgprint(_("Account for this ") + fieldname + _(" has been freezed. ") +
|
||||||
self.doc.doctype + _(" can not be made."), raise_exception=1)
|
self.doc.doctype + _(" can not be made."), raise_exception=1)
|
||||||
|
|
||||||
def set_price_list_currency(self, buying_or_selling):
|
def set_price_list_currency(self, buying_or_selling, for_validate=False):
|
||||||
if self.meta.get_field("currency"):
|
if self.meta.get_field("currency"):
|
||||||
company_currency = get_company_currency(self.doc.company)
|
company_currency = get_company_currency(self.doc.company)
|
||||||
|
|
||||||
@ -60,14 +60,13 @@ class AccountsController(TransactionBase):
|
|||||||
fieldname = "selling_price_list" if buying_or_selling.lower() == "selling" \
|
fieldname = "selling_price_list" if buying_or_selling.lower() == "selling" \
|
||||||
else "buying_price_list"
|
else "buying_price_list"
|
||||||
if self.meta.get_field(fieldname) and self.doc.fields.get(fieldname):
|
if self.meta.get_field(fieldname) and self.doc.fields.get(fieldname):
|
||||||
if not self.doc.price_list_currency:
|
|
||||||
self.doc.price_list_currency = webnotes.conn.get_value("Price List",
|
self.doc.price_list_currency = webnotes.conn.get_value("Price List",
|
||||||
self.doc.fields.get(fieldname), "currency")
|
self.doc.fields.get(fieldname), "currency")
|
||||||
|
|
||||||
if self.doc.price_list_currency == company_currency:
|
if self.doc.price_list_currency == company_currency:
|
||||||
self.doc.plc_conversion_rate = 1.0
|
self.doc.plc_conversion_rate = 1.0
|
||||||
|
|
||||||
elif not self.doc.plc_conversion_rate:
|
elif not self.doc.plc_conversion_rate or not for_validate:
|
||||||
self.doc.plc_conversion_rate = self.get_exchange_rate(
|
self.doc.plc_conversion_rate = self.get_exchange_rate(
|
||||||
self.doc.price_list_currency, company_currency)
|
self.doc.price_list_currency, company_currency)
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ class AccountsController(TransactionBase):
|
|||||||
self.doc.conversion_rate = self.doc.plc_conversion_rate
|
self.doc.conversion_rate = self.doc.plc_conversion_rate
|
||||||
elif self.doc.currency == company_currency:
|
elif self.doc.currency == company_currency:
|
||||||
self.doc.conversion_rate = 1.0
|
self.doc.conversion_rate = 1.0
|
||||||
elif not self.doc.conversion_rate:
|
elif not self.doc.conversion_rate or not for_validate:
|
||||||
self.doc.conversion_rate = self.get_exchange_rate(self.doc.currency,
|
self.doc.conversion_rate = self.get_exchange_rate(self.doc.currency,
|
||||||
company_currency)
|
company_currency)
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class SellingController(StockController):
|
|||||||
|
|
||||||
# set contact and address details for customer, if they are not mentioned
|
# set contact and address details for customer, if they are not mentioned
|
||||||
self.set_missing_lead_customer_details()
|
self.set_missing_lead_customer_details()
|
||||||
self.set_price_list_and_item_details()
|
self.set_price_list_and_item_details(for_validate)
|
||||||
if self.doc.fields.get("__islocal"):
|
if self.doc.fields.get("__islocal"):
|
||||||
self.set_taxes("other_charges", "charge")
|
self.set_taxes("other_charges", "charge")
|
||||||
|
|
||||||
@ -38,8 +38,8 @@ class SellingController(StockController):
|
|||||||
if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
|
if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
|
||||||
self.doc.fields[fieldname] = val
|
self.doc.fields[fieldname] = val
|
||||||
|
|
||||||
def set_price_list_and_item_details(self):
|
def set_price_list_and_item_details(self, for_validate=False):
|
||||||
self.set_price_list_currency("Selling")
|
self.set_price_list_currency("Selling", for_validate)
|
||||||
self.set_missing_item_details(get_item_details)
|
self.set_missing_item_details(get_item_details)
|
||||||
|
|
||||||
def get_other_charges(self):
|
def get_other_charges(self):
|
||||||
|
@ -39,7 +39,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onload_post_render: function() {
|
onload_post_render: function() {
|
||||||
if(this.frm.doc.__islocal && this.frm.doc.company && !this.frm.doc.customer) {
|
if(this.frm.doc.__islocal && this.frm.doc.company &&
|
||||||
|
!this.frm.doc.customer && !this.frm.doc.is_pos) {
|
||||||
var me = this;
|
var me = this;
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
@ -134,10 +135,12 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
this.frm.set_value("currency", company_currency);
|
this.frm.set_value("currency", company_currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.frm.doc.currency == company_currency)
|
if (this.frm.doc.currency == company_currency) {
|
||||||
this.frm.set_value("conversion_rate", 1.0);
|
this.frm.set_value("conversion_rate", 1.0);
|
||||||
if(this.frm.doc.price_list_currency == company_currency)
|
}
|
||||||
|
if (this.frm.doc.price_list_currency == company_currency) {
|
||||||
this.frm.set_value('plc_conversion_rate', 1.0);
|
this.frm.set_value('plc_conversion_rate', 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
this.frm.script_manager.trigger("currency");
|
this.frm.script_manager.trigger("currency");
|
||||||
}
|
}
|
||||||
@ -155,10 +158,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
if(this.frm.doc.currency !== company_currency) {
|
if(this.frm.doc.currency !== company_currency) {
|
||||||
this.get_exchange_rate(this.frm.doc.currency, company_currency,
|
this.get_exchange_rate(this.frm.doc.currency, company_currency,
|
||||||
function(exchange_rate) {
|
function(exchange_rate) {
|
||||||
if(exchange_rate) {
|
|
||||||
me.frm.set_value("conversion_rate", exchange_rate);
|
me.frm.set_value("conversion_rate", exchange_rate);
|
||||||
me.conversion_rate();
|
me.conversion_rate();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.conversion_rate();
|
this.conversion_rate();
|
||||||
|
@ -144,7 +144,6 @@ class TransactionBase(StatusUpdater):
|
|||||||
|
|
||||||
def get_customer_address(self, args):
|
def get_customer_address(self, args):
|
||||||
args = load_json(args)
|
args = load_json(args)
|
||||||
webnotes.errprint(args)
|
|
||||||
ret = {
|
ret = {
|
||||||
'customer_address' : args["address"],
|
'customer_address' : args["address"],
|
||||||
'address_display' : get_address_display(args["address"]),
|
'address_display' : get_address_display(args["address"]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user