Payments
This commit is contained in:
parent
24abe58b2e
commit
f648135d01
|
|
@ -8,7 +8,7 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
class PaymentEdit extends StatefulWidget {
|
||||
final PaymentEditVM viewModel;
|
||||
|
||||
PaymentEdit({
|
||||
const PaymentEdit({
|
||||
Key key,
|
||||
@required this.viewModel,
|
||||
}) : super(key: key);
|
||||
|
|
@ -39,7 +39,7 @@ class _PaymentEditState extends State<PaymentEdit> {
|
|||
|
||||
_controllers.forEach((controller) => controller.removeListener(_onChanged));
|
||||
|
||||
var payment = widget.viewModel.payment;
|
||||
final payment = widget.viewModel.payment;
|
||||
|
||||
//_amountController.text = payment.amount;
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ class _PaymentEditState extends State<PaymentEdit> {
|
|||
}
|
||||
|
||||
void _onChanged() {
|
||||
var payment = widget.viewModel.payment.rebuild((b) => b
|
||||
final payment = widget.viewModel.payment.rebuild((b) => b
|
||||
//..amount = _amountController.text.trim()
|
||||
..transactionReference = _transactionReferenceController.text.trim()
|
||||
..privateNotes = _privateNotesController.text.trim());
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
|
|
@ -11,10 +10,9 @@ import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
|
|||
import 'package:invoiceninja_flutter/data/models/payment_model.dart';
|
||||
import 'package:invoiceninja_flutter/ui/payment/edit/payment_edit.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||
|
||||
class PaymentEditScreen extends StatelessWidget {
|
||||
static final String route = '/payment/edit';
|
||||
static const String route = '/payment/edit';
|
||||
|
||||
const PaymentEditScreen({Key key}) : super(key: key);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,15 +41,6 @@ class PaymentList extends StatelessWidget {
|
|||
final message = await showDialog<String>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => SimpleDialog(children: <Widget>[
|
||||
user.canCreate(EntityType.payment)
|
||||
? ListTile(
|
||||
leading: Icon(Icons.control_point_duplicate),
|
||||
title: Text(AppLocalization.of(context).clone),
|
||||
onTap: () => viewModel.onEntityAction(
|
||||
context, payment, EntityAction.clone),
|
||||
)
|
||||
: Container(),
|
||||
Divider(),
|
||||
user.canEditEntity(payment) && !payment.isActive
|
||||
? ListTile(
|
||||
leading: Icon(Icons.restore),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import 'package:invoiceninja_flutter/ui/payment/payment_list_vm.dart';
|
|||
import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_drawer_vm.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_bottom_bar.dart';
|
||||
import 'package:invoiceninja_flutter/utils/keys.dart';
|
||||
|
||||
class PaymentScreen extends StatelessWidget {
|
||||
static const String route = '/payment';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
|
|
@ -10,11 +9,11 @@ import 'package:invoiceninja_flutter/data/models/payment_model.dart';
|
|||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/ui/payment/view/payment_view.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||
|
||||
class PaymentViewScreen extends StatelessWidget {
|
||||
static final String route = '/payment/view';
|
||||
PaymentViewScreen({Key key}) : super(key: key);
|
||||
static const String route = '/payment/view';
|
||||
|
||||
const PaymentViewScreen({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -48,7 +47,6 @@ class PaymentViewVM {
|
|||
@required this.isSaving,
|
||||
@required this.isLoading,
|
||||
@required this.isDirty,
|
||||
|
||||
});
|
||||
|
||||
factory PaymentViewVM.fromStore(Store<AppState> store) {
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ class AppLocalization {
|
|||
'industry': 'Industry',
|
||||
'size': 'Size',
|
||||
'payment_terms': 'Payment Terms',
|
||||
'payment_date': 'Payment Date',
|
||||
'net': 'Net',
|
||||
'client_portal': 'Client Portal',
|
||||
'show_tasks': 'Show tasks',
|
||||
|
|
@ -7473,6 +7474,9 @@ class AppLocalization {
|
|||
String get paymentTerms =>
|
||||
_localizedValues[locale.languageCode]['payment_terms'];
|
||||
|
||||
String get paymentDate =>
|
||||
_localizedValues[locale.languageCode]['payment_date'];
|
||||
|
||||
String get net => _localizedValues[locale.languageCode]['net'];
|
||||
|
||||
String get clientPortal =>
|
||||
|
|
@ -7526,7 +7530,8 @@ class AppLocalization {
|
|||
|
||||
String get payments => _localizedValues[locale.languageCode]['payments'];
|
||||
|
||||
String get enterPayment => _localizedValues[locale.languageCode]['enter_payment'];
|
||||
String get enterPayment =>
|
||||
_localizedValues[locale.languageCode]['enter_payment'];
|
||||
|
||||
String get createdPayment =>
|
||||
_localizedValues[locale.languageCode]['created_payment'];
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import 'package:invoiceninja_flutter/ui/app/buttons/refresh_icon_button.dart';
|
|||
class StubEdit extends StatefulWidget {
|
||||
final StubEditVM viewModel;
|
||||
|
||||
StubEdit({
|
||||
const StubEdit({
|
||||
Key key,
|
||||
@required this.viewModel,
|
||||
}) : super(key: key);
|
||||
|
|
@ -32,7 +32,7 @@ class _StubEditState extends State<StubEdit> {
|
|||
|
||||
_controllers.forEach((controller) => controller.removeListener(_onChanged));
|
||||
|
||||
var stub = widget.viewModel.stub;
|
||||
final stub = widget.viewModel.stub;
|
||||
// STARTER: read value - do not remove comment
|
||||
|
||||
_controllers.forEach((controller) => controller.addListener(_onChanged));
|
||||
|
|
@ -51,7 +51,7 @@ class _StubEditState extends State<StubEdit> {
|
|||
}
|
||||
|
||||
_onChanged() {
|
||||
var stub = widget.viewModel.stub.rebuild((b) => b
|
||||
final stub = widget.viewModel.stub.rebuild((b) => b
|
||||
// STARTER: set value - do not remove comment
|
||||
);
|
||||
if (stub != widget.viewModel.stub) {
|
||||
|
|
@ -61,7 +61,7 @@ class _StubEditState extends State<StubEdit> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var viewModel = widget.viewModel;
|
||||
final viewModel = widget.viewModel;
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
|||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||
|
||||
class StubEditScreen extends StatelessWidget {
|
||||
static final String route = '/stub/edit';
|
||||
static const String route = '/stub/edit';
|
||||
StubEditScreen({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
|||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||
|
||||
class StubViewScreen extends StatelessWidget {
|
||||
static final String route = '/stub/view';
|
||||
StubViewScreen({Key key}) : super(key: key);
|
||||
static const String route = '/stub/view';
|
||||
const StubViewScreen({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue