Skip to content

Commit

Permalink
Improve auto-taxes
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jul 19, 2023
1 parent 87ca35b commit 5bc2400
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/data/models/client_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ abstract class ClientEntity extends Object
customValue4: '',
routingId: '',
isTaxExempt: false,
//taxData: TaxDataEntity(),
taxData: TaxDataEntity(),
contacts: BuiltList<ClientContactEntity>(
<ClientContactEntity>[
ClientContactEntity().rebuild((b) => b..isPrimary = true)
Expand Down Expand Up @@ -315,8 +315,8 @@ abstract class ClientEntity extends Object
@BuiltValueField(wireName: 'is_tax_exempt')
bool get isTaxExempt;

//@BuiltValueField(wireName: 'tax_data')
//TaxDataEntity get taxData;
@BuiltValueField(wireName: 'tax_data_temp')
TaxDataEntity get taxData;

BuiltList<ClientContactEntity> get contacts;

Expand Down Expand Up @@ -780,7 +780,7 @@ abstract class ClientEntity extends Object
..number = ''
..routingId = ''
..isTaxExempt = false
//..taxData.replace(TaxDataEntity())
..taxData.replace(TaxDataEntity())
..paymentBalance = 0;

static Serializer<ClientEntity> get serializer => _$clientEntitySerializer;
Expand Down
23 changes: 23 additions & 0 deletions lib/data/models/client_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions lib/data/models/invoice_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:invoiceninja_flutter/data/models/mixins/invoice_mixin.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/data/models/quote_model.dart';
import 'package:invoiceninja_flutter/data/models/recurring_invoice_model.dart';
import 'package:invoiceninja_flutter/data/models/tax_model.dart';
import 'package:invoiceninja_flutter/main_app.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/redux/client/client_selectors.dart';
Expand Down Expand Up @@ -250,6 +251,7 @@ abstract class InvoiceEntity extends Object
dueDateDays: 'terms',
saveDefaultTerms: false,
saveDefaultFooter: false,
taxData: TaxDataEntity(),
);
}

Expand Down Expand Up @@ -626,6 +628,9 @@ abstract class InvoiceEntity extends Object
@BuiltValueField(serialize: false)
bool get saveDefaultFooter;

@BuiltValueField(wireName: 'tax_data_temp')
TaxDataEntity get taxData;

bool get isApproved {
if (isQuote &&
[
Expand Down Expand Up @@ -1551,6 +1556,7 @@ abstract class InvoiceEntity extends Object
..saveDefaultFooter = false
..autoBillEnabled = false
..nextSendDatetime = ''
..taxData.replace(TaxDataEntity())
..subscriptionId = '';

static Serializer<InvoiceEntity> get serializer => _$invoiceEntitySerializer;
Expand Down
24 changes: 24 additions & 0 deletions lib/data/models/invoice_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5bc2400

Please sign in to comment.