mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 20:59:11 +00:00
chore: resolve conflicts
This commit is contained in:
@@ -85,9 +85,8 @@ frappe.ui.form.on("Delivery Note", {
|
||||
erpnext.stock.delivery_note.set_print_hide(frm.doc);
|
||||
},
|
||||
|
||||
<<<<<<< HEAD
|
||||
refresh: function(frm) {
|
||||
if (frm.doc.docstatus === 1 && frm.doc.is_return === 1 && frm.doc.per_billed !== 100) {
|
||||
if (frm.doc.docstatus === 1 && frm.doc.is_return === 1 && frm.doc.per_billed !== 100 && frappe.model.can_create("Sales Invoice")) {
|
||||
frm.add_custom_button(__('Credit Note'), function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
||||
@@ -95,26 +94,6 @@ frappe.ui.form.on("Delivery Note", {
|
||||
})
|
||||
}, __('Create'));
|
||||
frm.page.set_inner_btn_group_as_primary(__('Create'));
|
||||
=======
|
||||
refresh: function (frm) {
|
||||
if (
|
||||
frm.doc.docstatus === 1 &&
|
||||
frm.doc.is_return === 1 &&
|
||||
frm.doc.per_billed !== 100 &&
|
||||
frappe.model.can_create("Sales Invoice")
|
||||
) {
|
||||
frm.add_custom_button(
|
||||
__("Credit Note"),
|
||||
function () {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
||||
frm: cur_frm,
|
||||
});
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
frm.page.set_inner_btn_group_as_primary(__("Create"));
|
||||
>>>>>>> 418bdc1dcc (fix(Delivery Note): only show permitted actions)
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -160,87 +139,24 @@ erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends erpn
|
||||
refresh(doc, dt, dn) {
|
||||
var me = this;
|
||||
super.refresh();
|
||||
<<<<<<< HEAD
|
||||
if ((!doc.is_return) && (doc.status!="Closed" || this.frm.is_new())) {
|
||||
if (this.frm.doc.docstatus===0) {
|
||||
this.frm.add_custom_button(__('Sales Order'),
|
||||
function() {
|
||||
if (!me.frm.doc.customer) {
|
||||
frappe.throw({
|
||||
title: __("Mandatory"),
|
||||
message: __("Please Select a Customer")
|
||||
});
|
||||
}
|
||||
erpnext.utils.map_current_doc({
|
||||
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
|
||||
source_doctype: "Sales Order",
|
||||
target: me.frm,
|
||||
setters: {
|
||||
customer: me.frm.doc.customer,
|
||||
},
|
||||
get_query_filters: {
|
||||
docstatus: 1,
|
||||
status: ["not in", ["Closed", "On Hold"]],
|
||||
per_delivered: ["<", 99.99],
|
||||
company: me.frm.doc.company,
|
||||
project: me.frm.doc.project || undefined,
|
||||
}
|
||||
})
|
||||
}, __("Get Items From"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!doc.is_return && doc.status!="Closed") {
|
||||
if(doc.docstatus == 1) {
|
||||
this.frm.add_custom_button(__('Shipment'), function() {
|
||||
me.make_shipment() }, __('Create'));
|
||||
}
|
||||
|
||||
if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1)
|
||||
this.frm.add_custom_button(__('Installation Note'), function() {
|
||||
me.make_installation_note() }, __('Create'));
|
||||
|
||||
if (doc.docstatus==1) {
|
||||
this.frm.add_custom_button(__('Sales Return'), function() {
|
||||
me.make_sales_return() }, __('Create'));
|
||||
}
|
||||
|
||||
if (doc.docstatus==1) {
|
||||
this.frm.add_custom_button(__('Delivery Trip'), function() {
|
||||
me.make_delivery_trip() }, __('Create'));
|
||||
}
|
||||
|
||||
if(doc.docstatus==0 && !doc.__islocal) {
|
||||
if (doc.__onload && doc.__onload.has_unpacked_items) {
|
||||
this.frm.add_custom_button(__('Packing Slip'), function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip",
|
||||
frm: me.frm
|
||||
}) }, __('Create')
|
||||
);
|
||||
}
|
||||
=======
|
||||
if (
|
||||
!doc.is_return &&
|
||||
(doc.status != "Closed" || this.frm.is_new()) &&
|
||||
this.frm.has_perm("write") &&
|
||||
frappe.model.can_read("Sales Order") &&
|
||||
this.frm.doc.docstatus === 0
|
||||
!doc.is_return
|
||||
&& (doc.status!="Closed" || this.frm.is_new())
|
||||
&& this.frm.has_perm("write")
|
||||
&& frappe.model.can_read("Sales Order")
|
||||
&& this.frm.doc.docstatus===0
|
||||
) {
|
||||
this.frm.add_custom_button(
|
||||
__("Sales Order"),
|
||||
function () {
|
||||
__('Sales Order'),
|
||||
function() {
|
||||
if (!me.frm.doc.customer) {
|
||||
frappe.throw({
|
||||
title: __("Mandatory"),
|
||||
message: __("Please Select a Customer"),
|
||||
message: __("Please Select a Customer")
|
||||
});
|
||||
}
|
||||
erpnext.utils.map_current_doc({
|
||||
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
|
||||
args: {
|
||||
for_reserved_stock: 1,
|
||||
},
|
||||
source_doctype: "Sales Order",
|
||||
target: me.frm,
|
||||
setters: {
|
||||
@@ -252,76 +168,59 @@ erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends erpn
|
||||
per_delivered: ["<", 99.99],
|
||||
company: me.frm.doc.company,
|
||||
project: me.frm.doc.project || undefined,
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
__("Get Items From")
|
||||
);
|
||||
}
|
||||
|
||||
if (!doc.is_return && doc.status != "Closed" && frappe.model.can_create("Shipment")) {
|
||||
if (doc.docstatus == 1) {
|
||||
this.frm.add_custom_button(
|
||||
__("Shipment"),
|
||||
function () {
|
||||
me.make_shipment();
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
if (!doc.is_return && doc.status!="Closed") {
|
||||
if (doc.docstatus == 1 && frappe.model.can_create("Shipment")) {
|
||||
this.frm.add_custom_button(__('Shipment'), function() {
|
||||
me.make_shipment() }, __('Create'));
|
||||
}
|
||||
|
||||
if (
|
||||
flt(doc.per_installed, 2) < 100 &&
|
||||
doc.docstatus == 1 &&
|
||||
frappe.model.can_create("Installation Note")
|
||||
flt(doc.per_installed, 2) < 100
|
||||
&& doc.docstatus==1
|
||||
&& frappe.model.can_create("Installation Note")
|
||||
) {
|
||||
this.frm.add_custom_button(
|
||||
__("Installation Note"),
|
||||
function () {
|
||||
me.make_installation_note();
|
||||
__('Installation Note'),
|
||||
function() {
|
||||
me.make_installation_note()
|
||||
},
|
||||
__("Create")
|
||||
__('Create')
|
||||
);
|
||||
}
|
||||
|
||||
if (doc.docstatus == 1 && this.frm.has_perm("create")) {
|
||||
this.frm.add_custom_button(
|
||||
__("Sales Return"),
|
||||
function () {
|
||||
me.make_sales_return();
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
if (doc.docstatus==1 && this.frm.has_perm("create")) {
|
||||
this.frm.add_custom_button(__('Sales Return'), function() {
|
||||
me.make_sales_return() }, __('Create'));
|
||||
}
|
||||
|
||||
if (doc.docstatus == 1 && frappe.model.can_create("Delivery Trip")) {
|
||||
this.frm.add_custom_button(
|
||||
__("Delivery Trip"),
|
||||
function () {
|
||||
me.make_delivery_trip();
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
if (doc.docstatus==1 && frappe.model.can_create("Delivery Trip")) {
|
||||
this.frm.add_custom_button(__('Delivery Trip'), function() {
|
||||
me.make_delivery_trip() }, __('Create'));
|
||||
}
|
||||
|
||||
if (
|
||||
doc.docstatus == 0 &&
|
||||
!doc.__islocal &&
|
||||
doc.__onload &&
|
||||
doc.__onload.has_unpacked_items &&
|
||||
frappe.model.can_create("Packing Slip")
|
||||
doc.docstatus==0
|
||||
&& !doc.__islocal
|
||||
&& frappe.model.can_create("Packing Slip")
|
||||
&& (doc.__onload && doc.__onload.has_unpacked_items)
|
||||
) {
|
||||
this.frm.add_custom_button(
|
||||
__("Packing Slip"),
|
||||
function () {
|
||||
__('Packing Slip'),
|
||||
function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip",
|
||||
frm: me.frm,
|
||||
frm: me.frm
|
||||
});
|
||||
},
|
||||
__("Create")
|
||||
__('Create')
|
||||
);
|
||||
>>>>>>> 418bdc1dcc (fix(Delivery Note): only show permitted actions)
|
||||
}
|
||||
|
||||
if (!doc.__islocal && doc.docstatus==1) {
|
||||
@@ -340,17 +239,13 @@ erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends erpn
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
if(doc.docstatus==1 && !doc.is_return && doc.status!="Closed" && flt(doc.per_billed) < 100) {
|
||||
=======
|
||||
if (
|
||||
doc.docstatus == 1 &&
|
||||
!doc.is_return &&
|
||||
doc.status != "Closed" &&
|
||||
flt(doc.per_billed) < 100 &&
|
||||
frappe.model.can_create("Sales Invoice")
|
||||
if(
|
||||
doc.docstatus==1
|
||||
&& !doc.is_return
|
||||
&& doc.status!="Closed"
|
||||
&& flt(doc.per_billed) < 100
|
||||
&& frappe.model.can_create("Sales Invoice")
|
||||
) {
|
||||
>>>>>>> 418bdc1dcc (fix(Delivery Note): only show permitted actions)
|
||||
// show Make Invoice button only if Delivery Note is not created from Sales Invoice
|
||||
var from_sales_invoice = false;
|
||||
from_sales_invoice = me.frm.doc.items.some(function(item) {
|
||||
@@ -369,7 +264,12 @@ erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends erpn
|
||||
}
|
||||
erpnext.stock.delivery_note.set_print_hide(doc, dt, dn);
|
||||
|
||||
if(doc.docstatus==1 && !doc.is_return && !doc.auto_repeat) {
|
||||
if(
|
||||
doc.docstatus==1
|
||||
&& !doc.is_return
|
||||
&& !doc.auto_repeat
|
||||
&& frappe.model.can_create("Auto Repeat")
|
||||
) {
|
||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||
}, __('Create'))
|
||||
|
||||
Reference in New Issue
Block a user