Improve auto-taxes
This commit is contained in:
parent
d9d197de1f
commit
4e48469a93
|
|
@ -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,6 +383,9 @@ 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)),
|
||||
|
|
@ -940,6 +943,10 @@ 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;
|
||||
|
|
@ -1863,6 +1870,8 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
@override
|
||||
final TaxConfigEntity taxConfig;
|
||||
@override
|
||||
final TaxDataEntity taxData;
|
||||
@override
|
||||
final bool hasEInvoiceCertificate;
|
||||
@override
|
||||
final bool hasEInvoiceCertificatePassphrase;
|
||||
|
|
@ -1995,6 +2004,7 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
this.stopOnUnpaidRecurring,
|
||||
this.calculateTaxes,
|
||||
this.taxConfig,
|
||||
this.taxData,
|
||||
this.hasEInvoiceCertificate,
|
||||
this.hasEInvoiceCertificatePassphrase,
|
||||
this.eInvoiceCertificatePassphrase,
|
||||
|
|
@ -2205,6 +2215,7 @@ 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,
|
||||
|
|
@ -2335,6 +2346,7 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
stopOnUnpaidRecurring == other.stopOnUnpaidRecurring &&
|
||||
calculateTaxes == other.calculateTaxes &&
|
||||
taxConfig == other.taxConfig &&
|
||||
taxData == other.taxData &&
|
||||
hasEInvoiceCertificate == other.hasEInvoiceCertificate &&
|
||||
hasEInvoiceCertificatePassphrase ==
|
||||
other.hasEInvoiceCertificatePassphrase &&
|
||||
|
|
@ -2459,6 +2471,7 @@ 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);
|
||||
|
|
@ -2582,6 +2595,7 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
..add('stopOnUnpaidRecurring', stopOnUnpaidRecurring)
|
||||
..add('calculateTaxes', calculateTaxes)
|
||||
..add('taxConfig', taxConfig)
|
||||
..add('taxData', taxData)
|
||||
..add('hasEInvoiceCertificate', hasEInvoiceCertificate)
|
||||
..add('hasEInvoiceCertificatePassphrase',
|
||||
hasEInvoiceCertificatePassphrase)
|
||||
|
|
@ -3140,6 +3154,11 @@ 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) =>
|
||||
|
|
@ -3307,6 +3326,7 @@ 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;
|
||||
|
|
@ -3461,6 +3481,7 @@ 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'),
|
||||
|
|
@ -3550,6 +3571,8 @@ class CompanyEntityBuilder
|
|||
|
||||
_$failedField = 'taxConfig';
|
||||
taxConfig.build();
|
||||
_$failedField = 'taxData';
|
||||
taxData.build();
|
||||
} catch (e) {
|
||||
throw new BuiltValueNestedFieldError(
|
||||
r'CompanyEntity', _$failedField, e.toString());
|
||||
|
|
|
|||
Loading…
Reference in New Issue