[Fix] Delivery Note fixed

This commit is contained in:
Manas Solanki
2016-11-16 15:06:08 +05:30
committed by Nabin Hait
parent 34feab1b25
commit dbc2511a39
3 changed files with 11 additions and 27 deletions

View File

@@ -8,8 +8,7 @@ frappe.provide("erpnext.accounts");
erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
onload: function() { onload: function() {
this._super(); this._super();
console.log('----> TESTING');
this.setup_quality_inspection("Incoming");
if(!this.frm.doc.__islocal) { if(!this.frm.doc.__islocal) {
// show credit_to in print format // show credit_to in print format
if(!this.frm.doc.supplier && this.frm.doc.credit_to) { 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(); this.show_stock_ledger();
} }
if (doc.update_stock==1){
this.setup_quality_inspection("Incoming");
}
if(!doc.is_return && doc.docstatus==1) { if(!doc.is_return && doc.docstatus==1) {
if(doc.outstanding_amount != 0) { if(doc.outstanding_amount != 0) {
this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __("Make")); this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __("Make"));

View File

@@ -146,14 +146,13 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
return { return {
"inspection_type": inspection_type, "inspection_type": inspection_type,
"reference_type": me.frm.doc.doctype, "reference_type": me.frm.doc.doctype,
"purchase_receipt": me.frm.doc.name, "reference_name": me.frm.doc.name,
"item_code": doc.item_code, "item_code": doc.item_code,
"description": doc.description, "description": doc.description,
"item_serial_no": doc.serial_no ? doc.serial_no.split("\n")[0] : null, "item_serial_no": doc.serial_no ? doc.serial_no.split("\n")[0] : null,
"batch_no": doc.batch_no "batch_no": doc.batch_no
} }
} }
console.log(quality_inspection_field);
this.frm.set_query("quality_inspection", "items", function(doc, cdt, cdn) { this.frm.set_query("quality_inspection", "items", function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
return { return {

View File

@@ -8,19 +8,6 @@ frappe.provide("erpnext.stock.delivery_note");
frappe.ui.form.on("Delivery Note", { frappe.ui.form.on("Delivery Note", {
setup: function(frm) { 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', frm.set_indicator_formatter('item_code',
function(doc) { 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({ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({
onload: function() {
this._super();
this.setup_quality_inspection("Outgoing");
},
refresh: function(doc, dt, dn) { refresh: function(doc, dt, dn) {
this._super(); this._super();
if (!doc.is_return && doc.status!="Closed") { if (!doc.is_return && doc.status!="Closed") {