mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
fix: einvoice button visiblity condition (#24800)
This commit is contained in:
@@ -22,8 +22,8 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<h5 class="font-bold" style="margin-top: 0px;">1. Transaction Details</h5>
|
||||||
<div class="row section-break" style="border-bottom: 1px solid #d1d8dd; padding-bottom: 10px;">
|
<div class="row section-break" style="border-bottom: 1px solid #d1d8dd; padding-bottom: 10px;">
|
||||||
<h5 class="font-bold" style="margin-left: 15px; margin-top: 0px;">1. Transaction Details</h5>
|
|
||||||
<div class="col-xs-8 column-break">
|
<div class="col-xs-8 column-break">
|
||||||
<div class="row data-field">
|
<div class="row data-field">
|
||||||
<div class="col-xs-4"><label>IRN</label></div>
|
<div class="col-xs-4"><label>IRN</label></div>
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
<img src="{{ doc.qrcode_image }}" width="175px" style="float: right;">
|
<img src="{{ doc.qrcode_image }}" width="175px" style="float: right;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<h5 class="font-bold" style="margin-top: 15px; margin-bottom: 10px;">2. Party Details</h5>
|
||||||
<div class="row section-break" style="border-bottom: 1px solid #d1d8dd; padding-bottom: 10px;">
|
<div class="row section-break" style="border-bottom: 1px solid #d1d8dd; padding-bottom: 10px;">
|
||||||
<h5 class="font-bold" style="margin-left: 15px; margin-bottom: 0px;">2. Party Details</h5>
|
|
||||||
{%- set seller = einvoice.SellerDtls -%}
|
{%- set seller = einvoice.SellerDtls -%}
|
||||||
<div class="col-xs-6 column-break">
|
<div class="col-xs-6 column-break">
|
||||||
<h5 style="margin-bottom: 5px;">Seller</h5>
|
<h5 style="margin-bottom: 5px;">Seller</h5>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="overflow-x: auto;">
|
<div style="overflow-x: auto;">
|
||||||
<h5 class="font-bold" style="margin-bottom: 0px;">3. Item Details</h5>
|
<h5 class="font-bold" style="margin-top: 15px; margin-bottom: 10px;">3. Item Details</h5>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
erpnext.setup_einvoice_actions = (doctype) => {
|
erpnext.setup_einvoice_actions = (doctype) => {
|
||||||
frappe.ui.form.on(doctype, {
|
frappe.ui.form.on(doctype, {
|
||||||
refresh(frm) {
|
async refresh(frm) {
|
||||||
const einvoicing_enabled = frappe.db.get_value("E Invoice Settings", "E Invoice Settings", "enable");
|
const einvoicing_enabled = await frappe.db.get_single_value("E Invoice Settings", "enable");
|
||||||
const supply_type = frm.doc.gst_category;
|
const supply_type = frm.doc.gst_category;
|
||||||
const valid_supply_type = ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export'].includes(supply_type);
|
const valid_supply_type = ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export'].includes(supply_type);
|
||||||
const company_transaction = frm.doc.billing_address_gstin == frm.doc.company_gstin;
|
const company_transaction = frm.doc.billing_address_gstin == frm.doc.company_gstin;
|
||||||
|
|
||||||
if (!einvoicing_enabled || !valid_supply_type || company_transaction) return;
|
if (cint(einvoicing_enabled) == 0 || !valid_supply_type || company_transaction) return;
|
||||||
|
|
||||||
const { doctype, irn, irn_cancelled, ewaybill, eway_bill_cancelled, name, __unsaved } = frm.doc;
|
const { doctype, irn, irn_cancelled, ewaybill, eway_bill_cancelled, name, __unsaved } = frm.doc;
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ erpnext.setup_einvoice_actions = (doctype) => {
|
|||||||
const action = () => {
|
const action = () => {
|
||||||
const d = new frappe.ui.Dialog({
|
const d = new frappe.ui.Dialog({
|
||||||
title: __('Generate E-Way Bill'),
|
title: __('Generate E-Way Bill'),
|
||||||
wide: 1,
|
size: "large",
|
||||||
fields: get_ewaybill_fields(frm),
|
fields: get_ewaybill_fields(frm),
|
||||||
primary_action: function() {
|
primary_action: function() {
|
||||||
const data = d.get_values();
|
const data = d.get_values();
|
||||||
@@ -252,7 +252,7 @@ const request_irn_generation = (frm) => {
|
|||||||
const get_preview_dialog = (frm, action) => {
|
const get_preview_dialog = (frm, action) => {
|
||||||
const dialog = new frappe.ui.Dialog({
|
const dialog = new frappe.ui.Dialog({
|
||||||
title: __("Preview"),
|
title: __("Preview"),
|
||||||
wide: 1,
|
size: "large",
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
"label": "Preview",
|
"label": "Preview",
|
||||||
|
|||||||
Reference in New Issue
Block a user