Skip to content

Commit

Permalink
fix: better implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninad1306 committed Sep 10, 2024
1 parent d768fcb commit 6957f33
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions india_compliance/gst_india/client_scripts/stock_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,22 @@ function get_items(doc) {
}

function get_field_and_label(frm, field) {
let field_dict = {};
let label_dict = {};
let field_label_dict = {};

if (frm.doc.purpose === "Material Transfer" && frm.doc.is_return) {
field_dict = {
party_field: "bill_from_address",
company_field: "bill_to_address",
};
label_dict = {
party_field: __("Bill From (same as Supplier Address)"),
company_field: __("Bill To"),
field_label_dict = {
party_field: [
"bill_from_address",
__("Bill From (same as Supplier Address)"),
],
company_field: ["bill_to_address", __("Bill To")],
};
} else {
field_dict = {
party_field: "bill_to_address",
company_field: "bill_from_address",
};
label_dict = {
party_field: __("Bill To (same as Supplier Address)"),
company_field: __("Bill From"),
field_label_dict = {
party_field: ["bill_to_address", __("Bill To (same as Supplier Address)")],
company_field: ["bill_from_address", __("Bill From")],
};
}
return [field_dict[field], label_dict[field]];

return field_label_dict[field];
}

0 comments on commit 6957f33

Please sign in to comment.