[Fix] Delivery Note fixed
This commit is contained in:
parent
34feab1b25
commit
dbc2511a39
@ -8,8 +8,7 @@ frappe.provide("erpnext.accounts");
|
||||
erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
onload: function() {
|
||||
this._super();
|
||||
console.log('----> TESTING');
|
||||
this.setup_quality_inspection("Incoming");
|
||||
|
||||
if(!this.frm.doc.__islocal) {
|
||||
// show credit_to in print format
|
||||
if(!this.frm.doc.supplier && this.frm.doc.credit_to) {
|
||||
@ -34,6 +33,10 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
this.show_stock_ledger();
|
||||
}
|
||||
|
||||
if (doc.update_stock==1){
|
||||
this.setup_quality_inspection("Incoming");
|
||||
}
|
||||
|
||||
if(!doc.is_return && doc.docstatus==1) {
|
||||
if(doc.outstanding_amount != 0) {
|
||||
this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __("Make"));
|
||||
|
@ -146,14 +146,13 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
return {
|
||||
"inspection_type": inspection_type,
|
||||
"reference_type": me.frm.doc.doctype,
|
||||
"purchase_receipt": me.frm.doc.name,
|
||||
"reference_name": me.frm.doc.name,
|
||||
"item_code": doc.item_code,
|
||||
"description": doc.description,
|
||||
"item_serial_no": doc.serial_no ? doc.serial_no.split("\n")[0] : null,
|
||||
"batch_no": doc.batch_no
|
||||
}
|
||||
}
|
||||
console.log(quality_inspection_field);
|
||||
this.frm.set_query("quality_inspection", "items", function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
return {
|
||||
|
@ -8,19 +8,6 @@ frappe.provide("erpnext.stock.delivery_note");
|
||||
|
||||
frappe.ui.form.on("Delivery Note", {
|
||||
setup: function(frm) {
|
||||
var quality_inspection = frappe.meta.get_docfield("Delivery Note Item", "quality_inspection");
|
||||
quality_inspection.get_route_options_for_new_doc = function(field) {
|
||||
if(frm.is_new()) return;
|
||||
var doc = field.doc;
|
||||
return {
|
||||
"inspection_type": "Outgoing",
|
||||
"delivery_note_no": frm.doc.name,
|
||||
"item_code": doc.item_code,
|
||||
"description": doc.description,
|
||||
"item_serial_no": doc.serial_no ? doc.serial_no.split("\n")[0] : null,
|
||||
"batch_no": doc.batch_no
|
||||
}
|
||||
}
|
||||
|
||||
frm.set_indicator_formatter('item_code',
|
||||
function(doc) {
|
||||
@ -36,20 +23,15 @@ frappe.ui.form.on("Delivery Note", {
|
||||
}
|
||||
})
|
||||
|
||||
frm.set_query("quality_inspection", "items", function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
return {
|
||||
filters: {
|
||||
docstatus: 1,
|
||||
inspection_type: "Outgoing",
|
||||
item_code: d.item_code
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({
|
||||
onload: function() {
|
||||
this._super();
|
||||
this.setup_quality_inspection("Outgoing");
|
||||
},
|
||||
|
||||
refresh: function(doc, dt, dn) {
|
||||
this._super();
|
||||
if (!doc.is_return && doc.status!="Closed") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user