Skip to content

Commit

Permalink
Merge pull request #528 from resilient-tech/mergify/bp/version-14-hot…
Browse files Browse the repository at this point in the history
…fix/pr-525

fix: misc fixes to Bill of Entry (backport #525)
  • Loading branch information
sagarvora authored Mar 24, 2023
2 parents fda9360 + d0ed8d0 commit 7d4f348
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ frappe.ui.form.on("Purchase Invoice", {
if (
frm.doc.docstatus !== 1 ||
frm.doc.gst_category !== "Overseas" ||
frm.doc.__onload?.existing_bill_of_entry
frm.doc.__onload?.bill_of_entry_exists
)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@

frappe.ui.form.on("Bill of Entry", {
onload(frm) {
frm.fields_dict.items.grid.cannot_add_rows = true;
frm.bill_of_entry_controller = new BillOfEntryController(frm);
frm.call("set_taxes_and_totals");
},

refresh(frm) {
// disable add row button in items table
frm.fields_dict.items.grid.wrapper.find(".grid-add-row").hide();
if (frm.doc.docstatus === 0) return;

// check if Journal Entry exists;
if (frm.doc.docstatus === 1 && !frm.doc.__onload?.existing_journal_entry) {
if (frm.doc.docstatus === 1 && !frm.doc.__onload?.journal_entry_exists) {
frm.add_custom_button(
__("Payment Entry"),
__("Journal Entry for Payment"),
() => {
frappe.model.open_mapped_doc({
method: "india_compliance.gst_india.doctype.bill_of_entry.bill_of_entry.make_journal_entry_for_payment",
Expand All @@ -26,7 +24,7 @@ frappe.ui.form.on("Bill of Entry", {
);
}

if (frm.doc.docstatus === 1) {
if (frm.doc.docstatus === 1 && frm.doc.total_customs_duty > 0) {
frm.add_custom_button(
__("Landed Cost Voucher"),
() => {
Expand Down Expand Up @@ -241,6 +239,8 @@ class TaxesController {
* @param {string} tax_name - Tax row name for which the tax rates are to be fetched.
*/

if (!this.frm.taxes || !this.frm.taxes.length) return;

await this.frm.call("set_item_wise_tax_rates", {
item_name: item_name,
tax_name: tax_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
{
"fieldname": "items",
"fieldtype": "Table",
"options": "Bill of Entry Item"
"options": "Bill of Entry Item",
"reqd": 1
},
{
"fieldname": "section_break_biay",
Expand All @@ -158,7 +159,8 @@
{
"fieldname": "taxes",
"fieldtype": "Table",
"options": "Bill of Entry Taxes"
"options": "Bill of Entry Taxes",
"reqd": 1
},
{
"fieldname": "section_break_ujtl",
Expand Down Expand Up @@ -263,10 +265,11 @@
"reqd": 1
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-03-22 03:55:41.315752",
"modified": "2023-03-24 09:46:13.847177",
"modified_by": "Administrator",
"module": "GST India",
"name": "Bill of Entry",
Expand Down
Loading

0 comments on commit 7d4f348

Please sign in to comment.