Skip to content

Commit

Permalink
revert automatically generated invoices not editable text
Browse files Browse the repository at this point in the history
  • Loading branch information
NC-jsAhonen committed Aug 29, 2024
1 parent 7b84973 commit 1a6234b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/leases/components/leaseSections/invoice/InvoicePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,15 @@ class InvoicePanel extends PureComponent<Props, State> {
creditedInvoice,
interestInvoiceFor
} = this.state;
const automaticallyGenerated = invoice && invoice.generated;

return (
<TablePanelContainer
innerRef={this.setComponentRef}
footer={invoice && !invoice.sap_id &&
<Authorization allow={isMethodAllowed(invoiceMethods, Methods.PATCH)}>
<>
<Button className={ButtonColors.SECONDARY} onClick={onClose} text='Peruuta' />
{automaticallyGenerated
? <p className="invoice-panel__error-text">Automaattisesti luotuja laskuja ei voi muokata.</p>
: <Button className={ButtonColors.SUCCESS} disabled={isEditClicked || !valid} onClick={this.handleSave} text='Tallenna' />
}
<Button className={ButtonColors.SECONDARY} onClick={onClose} text='Peruuta' />
<Button className={ButtonColors.SUCCESS} disabled={isEditClicked || !valid} onClick={this.handleSave} text='Tallenna' />
</>
</Authorization>}
onClose={onClose}
Expand Down

0 comments on commit 1a6234b

Please sign in to comment.