Improve auto-taxes
This commit is contained in:
parent
f88565debe
commit
d9d197de1f
|
|
@ -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)
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -221,9 +221,6 @@ class _$ClientEntitySerializer implements StructuredSerializer<ClientEntity> {
|
|||
'is_tax_exempt',
|
||||
serializers.serialize(object.isTaxExempt,
|
||||
specifiedType: const FullType(bool)),
|
||||
'tax_data',
|
||||
serializers.serialize(object.taxData,
|
||||
specifiedType: const FullType(TaxDataEntity)),
|
||||
'contacts',
|
||||
serializers.serialize(object.contacts,
|
||||
specifiedType: const FullType(
|
||||
|
|
@ -461,10 +458,6 @@ class _$ClientEntitySerializer implements StructuredSerializer<ClientEntity> {
|
|||
result.isTaxExempt = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
case 'tax_data':
|
||||
result.taxData.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(TaxDataEntity)) as TaxDataEntity);
|
||||
break;
|
||||
case 'contacts':
|
||||
result.contacts.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(
|
||||
|
|
@ -1022,8 +1015,6 @@ class _$ClientEntity extends ClientEntity {
|
|||
@override
|
||||
final bool isTaxExempt;
|
||||
@override
|
||||
final TaxDataEntity taxData;
|
||||
@override
|
||||
final BuiltList<ClientContactEntity> contacts;
|
||||
@override
|
||||
final BuiltList<ActivityEntity> activities;
|
||||
|
|
@ -1094,7 +1085,6 @@ class _$ClientEntity extends ClientEntity {
|
|||
this.customValue4,
|
||||
this.routingId,
|
||||
this.isTaxExempt,
|
||||
this.taxData,
|
||||
this.contacts,
|
||||
this.activities,
|
||||
this.ledger,
|
||||
|
|
@ -1175,7 +1165,6 @@ class _$ClientEntity extends ClientEntity {
|
|||
routingId, r'ClientEntity', 'routingId');
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
isTaxExempt, r'ClientEntity', 'isTaxExempt');
|
||||
BuiltValueNullFieldError.checkNotNull(taxData, r'ClientEntity', 'taxData');
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
contacts, r'ClientEntity', 'contacts');
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
|
|
@ -1244,7 +1233,6 @@ class _$ClientEntity extends ClientEntity {
|
|||
customValue4 == other.customValue4 &&
|
||||
routingId == other.routingId &&
|
||||
isTaxExempt == other.isTaxExempt &&
|
||||
taxData == other.taxData &&
|
||||
contacts == other.contacts &&
|
||||
activities == other.activities &&
|
||||
ledger == other.ledger &&
|
||||
|
|
@ -1303,7 +1291,6 @@ class _$ClientEntity extends ClientEntity {
|
|||
_$hash = $jc(_$hash, customValue4.hashCode);
|
||||
_$hash = $jc(_$hash, routingId.hashCode);
|
||||
_$hash = $jc(_$hash, isTaxExempt.hashCode);
|
||||
_$hash = $jc(_$hash, taxData.hashCode);
|
||||
_$hash = $jc(_$hash, contacts.hashCode);
|
||||
_$hash = $jc(_$hash, activities.hashCode);
|
||||
_$hash = $jc(_$hash, ledger.hashCode);
|
||||
|
|
@ -1363,7 +1350,6 @@ class _$ClientEntity extends ClientEntity {
|
|||
..add('customValue4', customValue4)
|
||||
..add('routingId', routingId)
|
||||
..add('isTaxExempt', isTaxExempt)
|
||||
..add('taxData', taxData)
|
||||
..add('contacts', contacts)
|
||||
..add('activities', activities)
|
||||
..add('ledger', ledger)
|
||||
|
|
@ -1546,11 +1532,6 @@ class ClientEntityBuilder
|
|||
bool get isTaxExempt => _$this._isTaxExempt;
|
||||
set isTaxExempt(bool isTaxExempt) => _$this._isTaxExempt = isTaxExempt;
|
||||
|
||||
TaxDataEntityBuilder _taxData;
|
||||
TaxDataEntityBuilder get taxData =>
|
||||
_$this._taxData ??= new TaxDataEntityBuilder();
|
||||
set taxData(TaxDataEntityBuilder taxData) => _$this._taxData = taxData;
|
||||
|
||||
ListBuilder<ClientContactEntity> _contacts;
|
||||
ListBuilder<ClientContactEntity> get contacts =>
|
||||
_$this._contacts ??= new ListBuilder<ClientContactEntity>();
|
||||
|
|
@ -1665,7 +1646,6 @@ class ClientEntityBuilder
|
|||
_customValue4 = $v.customValue4;
|
||||
_routingId = $v.routingId;
|
||||
_isTaxExempt = $v.isTaxExempt;
|
||||
_taxData = $v.taxData.toBuilder();
|
||||
_contacts = $v.contacts.toBuilder();
|
||||
_activities = $v.activities.toBuilder();
|
||||
_ledger = $v.ledger.toBuilder();
|
||||
|
|
@ -1750,7 +1730,6 @@ class ClientEntityBuilder
|
|||
customValue4: BuiltValueNullFieldError.checkNotNull(customValue4, r'ClientEntity', 'customValue4'),
|
||||
routingId: BuiltValueNullFieldError.checkNotNull(routingId, r'ClientEntity', 'routingId'),
|
||||
isTaxExempt: BuiltValueNullFieldError.checkNotNull(isTaxExempt, r'ClientEntity', 'isTaxExempt'),
|
||||
taxData: taxData.build(),
|
||||
contacts: contacts.build(),
|
||||
activities: activities.build(),
|
||||
ledger: ledger.build(),
|
||||
|
|
@ -1771,8 +1750,6 @@ class ClientEntityBuilder
|
|||
_$failedField = 'settings';
|
||||
settings.build();
|
||||
|
||||
_$failedField = 'taxData';
|
||||
taxData.build();
|
||||
_$failedField = 'contacts';
|
||||
contacts.build();
|
||||
_$failedField = 'activities';
|
||||
|
|
|
|||
|
|
@ -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>(),
|
||||
|
|
@ -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;
|
||||
|
|
@ -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>())
|
||||
|
|
|
|||
|
|
@ -383,9 +383,6 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
|||
'tax_data',
|
||||
serializers.serialize(object.taxConfig,
|
||||
specifiedType: const FullType(TaxConfigEntity)),
|
||||
'origin_tax_data',
|
||||
serializers.serialize(object.taxData,
|
||||
specifiedType: const FullType(TaxDataEntity)),
|
||||
'has_e_invoice_certificate',
|
||||
serializers.serialize(object.hasEInvoiceCertificate,
|
||||
specifiedType: const FullType(bool)),
|
||||
|
|
@ -943,10 +940,6 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
|||
specifiedType: const FullType(TaxConfigEntity))
|
||||
as TaxConfigEntity);
|
||||
break;
|
||||
case 'origin_tax_data':
|
||||
result.taxData.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(TaxDataEntity)) as TaxDataEntity);
|
||||
break;
|
||||
case 'has_e_invoice_certificate':
|
||||
result.hasEInvoiceCertificate = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
|
|
@ -1870,8 +1863,6 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
@override
|
||||
final TaxConfigEntity taxConfig;
|
||||
@override
|
||||
final TaxDataEntity taxData;
|
||||
@override
|
||||
final bool hasEInvoiceCertificate;
|
||||
@override
|
||||
final bool hasEInvoiceCertificatePassphrase;
|
||||
|
|
@ -2004,7 +1995,6 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
this.stopOnUnpaidRecurring,
|
||||
this.calculateTaxes,
|
||||
this.taxConfig,
|
||||
this.taxData,
|
||||
this.hasEInvoiceCertificate,
|
||||
this.hasEInvoiceCertificatePassphrase,
|
||||
this.eInvoiceCertificatePassphrase,
|
||||
|
|
@ -2215,7 +2205,6 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
calculateTaxes, r'CompanyEntity', 'calculateTaxes');
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
taxConfig, r'CompanyEntity', 'taxConfig');
|
||||
BuiltValueNullFieldError.checkNotNull(taxData, r'CompanyEntity', 'taxData');
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
hasEInvoiceCertificate, r'CompanyEntity', 'hasEInvoiceCertificate');
|
||||
BuiltValueNullFieldError.checkNotNull(hasEInvoiceCertificatePassphrase,
|
||||
|
|
@ -2346,7 +2335,6 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
stopOnUnpaidRecurring == other.stopOnUnpaidRecurring &&
|
||||
calculateTaxes == other.calculateTaxes &&
|
||||
taxConfig == other.taxConfig &&
|
||||
taxData == other.taxData &&
|
||||
hasEInvoiceCertificate == other.hasEInvoiceCertificate &&
|
||||
hasEInvoiceCertificatePassphrase ==
|
||||
other.hasEInvoiceCertificatePassphrase &&
|
||||
|
|
@ -2471,7 +2459,6 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
_$hash = $jc(_$hash, stopOnUnpaidRecurring.hashCode);
|
||||
_$hash = $jc(_$hash, calculateTaxes.hashCode);
|
||||
_$hash = $jc(_$hash, taxConfig.hashCode);
|
||||
_$hash = $jc(_$hash, taxData.hashCode);
|
||||
_$hash = $jc(_$hash, hasEInvoiceCertificate.hashCode);
|
||||
_$hash = $jc(_$hash, hasEInvoiceCertificatePassphrase.hashCode);
|
||||
_$hash = $jc(_$hash, eInvoiceCertificatePassphrase.hashCode);
|
||||
|
|
@ -2595,7 +2582,6 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
..add('stopOnUnpaidRecurring', stopOnUnpaidRecurring)
|
||||
..add('calculateTaxes', calculateTaxes)
|
||||
..add('taxConfig', taxConfig)
|
||||
..add('taxData', taxData)
|
||||
..add('hasEInvoiceCertificate', hasEInvoiceCertificate)
|
||||
..add('hasEInvoiceCertificatePassphrase',
|
||||
hasEInvoiceCertificatePassphrase)
|
||||
|
|
@ -3154,11 +3140,6 @@ class CompanyEntityBuilder
|
|||
set taxConfig(TaxConfigEntityBuilder taxConfig) =>
|
||||
_$this._taxConfig = taxConfig;
|
||||
|
||||
TaxDataEntityBuilder _taxData;
|
||||
TaxDataEntityBuilder get taxData =>
|
||||
_$this._taxData ??= new TaxDataEntityBuilder();
|
||||
set taxData(TaxDataEntityBuilder taxData) => _$this._taxData = taxData;
|
||||
|
||||
bool _hasEInvoiceCertificate;
|
||||
bool get hasEInvoiceCertificate => _$this._hasEInvoiceCertificate;
|
||||
set hasEInvoiceCertificate(bool hasEInvoiceCertificate) =>
|
||||
|
|
@ -3326,7 +3307,6 @@ class CompanyEntityBuilder
|
|||
_stopOnUnpaidRecurring = $v.stopOnUnpaidRecurring;
|
||||
_calculateTaxes = $v.calculateTaxes;
|
||||
_taxConfig = $v.taxConfig.toBuilder();
|
||||
_taxData = $v.taxData.toBuilder();
|
||||
_hasEInvoiceCertificate = $v.hasEInvoiceCertificate;
|
||||
_hasEInvoiceCertificatePassphrase = $v.hasEInvoiceCertificatePassphrase;
|
||||
_eInvoiceCertificatePassphrase = $v.eInvoiceCertificatePassphrase;
|
||||
|
|
@ -3481,7 +3461,6 @@ class CompanyEntityBuilder
|
|||
stopOnUnpaidRecurring: BuiltValueNullFieldError.checkNotNull(stopOnUnpaidRecurring, r'CompanyEntity', 'stopOnUnpaidRecurring'),
|
||||
calculateTaxes: BuiltValueNullFieldError.checkNotNull(calculateTaxes, r'CompanyEntity', 'calculateTaxes'),
|
||||
taxConfig: taxConfig.build(),
|
||||
taxData: taxData.build(),
|
||||
hasEInvoiceCertificate: BuiltValueNullFieldError.checkNotNull(hasEInvoiceCertificate, r'CompanyEntity', 'hasEInvoiceCertificate'),
|
||||
hasEInvoiceCertificatePassphrase: BuiltValueNullFieldError.checkNotNull(hasEInvoiceCertificatePassphrase, r'CompanyEntity', 'hasEInvoiceCertificatePassphrase'),
|
||||
eInvoiceCertificatePassphrase: BuiltValueNullFieldError.checkNotNull(eInvoiceCertificatePassphrase, r'CompanyEntity', 'eInvoiceCertificatePassphrase'),
|
||||
|
|
@ -3571,8 +3550,6 @@ class CompanyEntityBuilder
|
|||
|
||||
_$failedField = 'taxConfig';
|
||||
taxConfig.build();
|
||||
_$failedField = 'taxData';
|
||||
taxData.build();
|
||||
} catch (e) {
|
||||
throw new BuiltValueNestedFieldError(
|
||||
r'CompanyEntity', _$failedField, e.toString());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -956,7 +956,9 @@ class TaxDataEntityBuilder
|
|||
set originDestination(String originDestination) =>
|
||||
_$this._originDestination = originDestination;
|
||||
|
||||
TaxDataEntityBuilder();
|
||||
TaxDataEntityBuilder() {
|
||||
TaxDataEntity._initializeBuilder(this);
|
||||
}
|
||||
|
||||
TaxDataEntityBuilder get _$this {
|
||||
final $v = _$v;
|
||||
|
|
|
|||
Loading…
Reference in New Issue