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 21ead56 commit e181dce
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 55 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')
//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: 0 additions & 23 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.

8 changes: 4 additions & 4 deletions lib/data/models/company_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ abstract class CompanyEntity extends Object
hasEInvoiceCertificate: false,
hasEInvoiceCertificatePassphrase: false,
eInvoiceCertificatePassphrase: '',
taxData: TaxDataEntity(),
//taxData: TaxDataEntity(),
taxConfig: TaxConfigEntity(),
groups: BuiltList<GroupEntity>(),
taxRates: BuiltList<TaxRateEntity>(),
Expand Down Expand Up @@ -472,8 +472,8 @@ abstract class CompanyEntity extends Object
@BuiltValueField(wireName: 'tax_data')
TaxConfigEntity get taxConfig;

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

@BuiltValueField(wireName: 'has_e_invoice_certificate')
bool get hasEInvoiceCertificate;
Expand Down Expand Up @@ -787,7 +787,7 @@ abstract class CompanyEntity extends Object
..hasEInvoiceCertificatePassphrase = false
..eInvoiceCertificatePassphrase = ''
..taxConfig.replace(TaxConfigEntity())
..taxData.replace(TaxDataEntity())
//..taxData.replace(TaxDataEntity())
..systemLogs.replace(BuiltList<SystemLogEntity>())
..subscriptions.replace(BuiltList<SubscriptionEntity>())
..recurringExpenses.replace(BuiltList<ExpenseEntity>())
Expand Down
23 changes: 0 additions & 23 deletions lib/data/models/company_model.g.dart

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

37 changes: 37 additions & 0 deletions lib/data/models/tax_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,43 @@ abstract class TaxDataEntity
double get district5UseTax;
String get originDestination;

// ignore: unused_element
static void _initializeBuilder(TaxDataEntityBuilder builder) => builder
..citySalesTax = 0
..cityTaxCode = ''
..cityUseTax = 0
..countySalesTax = 0
..countyTaxCode = ''
..countyUseTax = 0
..district1Code = ''
..district1SalesTax = 0
..district1UseTax = 0
..district2Code = ''
..district2SalesTax = 0
..district2UseTax = 0
..district3Code = ''
..district3SalesTax = 0
..district3UseTax = 0
..district4Code = ''
..district4SalesTax = 0
..district4UseTax = 0
..district5Code = ''
..district5SalesTax = 0
..district5UseTax = 0
..districtSalesTax = 0
..districtUseTax = 0
..geoCity = ''
..geoCounty = ''
..geoPostalCode = ''
..geoState = ''
..originDestination = ''
..stateSalesTax = 0
..stateUseTax = 0
..taxSales = 0
..taxUse = 0
..txbFreight = ''
..txbService = '';

static Serializer<TaxDataEntity> get serializer => _$taxDataEntitySerializer;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/data/models/tax_model.g.dart

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

0 comments on commit e181dce

Please sign in to comment.