Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove automatically generated invoices not editable text and restore edit buttons #517

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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