Code replacement for journal voucher renaming

This commit is contained in:
Nabin Hait
2014-12-25 17:14:18 +05:30
parent e7d153624f
commit 23d2a53017
84 changed files with 934 additions and 917 deletions

View File

@@ -69,14 +69,14 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
this.show_general_ledger();
if(this.frm.doc.docstatus === 1 &&
frappe.boot.user.can_create.indexOf("Journal Voucher")!==-1) {
frappe.boot.user.can_create.indexOf("Journal Entry")!==-1) {
if(this.frm.doc.purpose === "Sales Return") {
this.frm.add_custom_button(__("Make Credit Note"),
function() { me.make_return_jv(); }, frappe.boot.doctype_icons["Journal Voucher"]);
function() { me.make_return_jv(); }, frappe.boot.doctype_icons["Journal Entry"]);
this.add_excise_button();
} else if(this.frm.doc.purpose === "Purchase Return") {
this.frm.add_custom_button(__("Make Debit Note"),
function() { me.make_return_jv(); }, frappe.boot.doctype_icons["Journal Voucher"]);
function() { me.make_return_jv(); }, frappe.boot.doctype_icons["Journal Entry"]);
this.add_excise_button();
}
}
@@ -197,11 +197,11 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
add_excise_button: function() {
if(frappe.boot.sysdefaults.country === "India")
this.frm.add_custom_button(__("Make Excise Invoice"), function() {
var excise = frappe.model.make_new_doc_and_get_name('Journal Voucher');
excise = locals['Journal Voucher'][excise];
excise.voucher_type = 'Excise Voucher';
loaddoc('Journal Voucher', excise.name);
}, frappe.boot.doctype_icons["Journal Voucher"], "btn-default");
var excise = frappe.model.make_new_doc_and_get_name('Journal Entry');
excise = locals['Journal Entry'][excise];
excise.voucher_type = 'Excise Entry';
loaddoc('Journal Entry', excise.name);
}, frappe.boot.doctype_icons["Journal Entry"], "btn-default");
},
make_return_jv: function() {

View File

@@ -822,7 +822,7 @@ def make_return_jv(stock_entry):
result = make_return_jv_from_purchase_receipt(se, ref)
# create jv doc and fetch balance for each unique row item
jv = frappe.new_doc("Journal Voucher")
jv = frappe.new_doc("Journal Entry")
jv.update({
"posting_date": se.posting_date,
"voucher_type": se.purpose == "Sales Return" and "Credit Note" or "Debit Note",