Adjust variables for payment template
This commit is contained in:
parent
0427a9b7a5
commit
c719db0941
|
|
@ -17,9 +17,11 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
class VariablesHelp extends StatefulWidget {
|
||||
const VariablesHelp({
|
||||
this.showInvoiceAsQuote = false,
|
||||
this.showInvoiceAsInvoices = false,
|
||||
});
|
||||
|
||||
final bool showInvoiceAsQuote;
|
||||
final bool showInvoiceAsInvoices;
|
||||
|
||||
@override
|
||||
_VariablesHelpState createState() => _VariablesHelpState();
|
||||
|
|
@ -57,6 +59,8 @@ class _VariablesHelpState extends State<VariablesHelp>
|
|||
Tab(
|
||||
child: Text(widget.showInvoiceAsQuote
|
||||
? localization.quote
|
||||
: widget.showInvoiceAsInvoices
|
||||
? localization.invoices
|
||||
: localization.invoice)),
|
||||
Tab(child: Text(localization.client)),
|
||||
Tab(child: Text(localization.contact)),
|
||||
|
|
@ -78,7 +82,11 @@ class _VariablesHelpState extends State<VariablesHelp>
|
|||
'assigned_to_user',
|
||||
'invoices',
|
||||
'payments',
|
||||
if (widget.showInvoiceAsQuote) ...[
|
||||
if (widget.showInvoiceAsInvoices) ...[
|
||||
'invoice_references',
|
||||
'invoice.po_number',
|
||||
'payment.status',
|
||||
] else if (widget.showInvoiceAsQuote) ...[
|
||||
QuoteFields.amount,
|
||||
QuoteFields.discount,
|
||||
QuoteFields.date,
|
||||
|
|
|
|||
|
|
@ -521,6 +521,10 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
|
|||
),
|
||||
VariablesHelp(
|
||||
showInvoiceAsQuote: template == EmailTemplate.quote,
|
||||
showInvoiceAsInvoices: [
|
||||
EmailTemplate.payment,
|
||||
EmailTemplate.payment_partial,
|
||||
].contains(template),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue