mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
[fix] Asset test cases and added make_sales_invoice (#11800)
* [fix] Asset test cases and added make_sales_invoice * vehicle trip test cases
This commit is contained in:
committed by
Nabin Hait
parent
e761b9de40
commit
e34ef60e3e
@@ -41,7 +41,7 @@ frappe.ui.form.on('Asset', {
|
||||
});
|
||||
|
||||
frm.add_custom_button("Sell Asset", function() {
|
||||
erpnext.asset.make_sales_invoice(frm);
|
||||
frm.trigger("make_sales_invoice");
|
||||
});
|
||||
|
||||
} else if (frm.doc.status=='Scrapped') {
|
||||
@@ -168,6 +168,21 @@ frappe.ui.form.on('Asset', {
|
||||
})
|
||||
},
|
||||
|
||||
make_sales_invoice: function(frm) {
|
||||
frappe.call({
|
||||
args: {
|
||||
"asset": frm.doc.name,
|
||||
"item_code": frm.doc.item_code,
|
||||
"company": frm.doc.company
|
||||
},
|
||||
method: "erpnext.accounts.doctype.asset.asset.make_sales_invoice",
|
||||
callback: function(r) {
|
||||
var doclist = frappe.model.sync(r.message);
|
||||
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
create_asset_maintenance: function(frm) {
|
||||
frappe.call({
|
||||
args: {
|
||||
|
||||
@@ -234,8 +234,9 @@ class TestAsset(unittest.TestCase):
|
||||
|
||||
expected_gle = (
|
||||
("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
|
||||
("_Test Depreciations - _TC", 70000.0, 0.0),
|
||||
("_Test Fixed Asset - _TC", 0.0, 100000.0),
|
||||
("_Test Gain/Loss on Asset Disposal - _TC", 45000.0, 0.0),
|
||||
("_Test Gain/Loss on Asset Disposal - _TC", 0.0, 25000.0),
|
||||
("Debtors - _TC", 25000.0, 0.0)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user