This commit is contained in:
Hillel Coren 2019-12-25 08:27:10 +02:00
parent 10635f97f1
commit 400bf1ab9e
4 changed files with 26 additions and 22 deletions

View File

@ -1317,7 +1317,7 @@ abstract class SettingsEntity
int get numberOfInvoiceTaxRates; int get numberOfInvoiceTaxRates;
@nullable @nullable
@BuiltValueField(wireName: 'enabled_tax_rates') @BuiltValueField(wireName: 'invoice_item_taxes')
int get numberOfItemTaxRates; int get numberOfItemTaxRates;
@nullable @nullable

View File

@ -1314,7 +1314,7 @@ class _$SettingsEntitySerializer
} }
if (object.numberOfItemTaxRates != null) { if (object.numberOfItemTaxRates != null) {
result result
..add('enabled_tax_rates') ..add('invoice_item_taxes')
..add(serializers.serialize(object.numberOfItemTaxRates, ..add(serializers.serialize(object.numberOfItemTaxRates,
specifiedType: const FullType(int))); specifiedType: const FullType(int)));
} }
@ -2113,7 +2113,7 @@ class _$SettingsEntitySerializer
result.numberOfInvoiceTaxRates = serializers.deserialize(value, result.numberOfInvoiceTaxRates = serializers.deserialize(value,
specifiedType: const FullType(int)) as int; specifiedType: const FullType(int)) as int;
break; break;
case 'enabled_tax_rates': case 'invoice_item_taxes':
result.numberOfItemTaxRates = serializers.deserialize(value, result.numberOfItemTaxRates = serializers.deserialize(value,
specifiedType: const FullType(int)) as int; specifiedType: const FullType(int)) as int;
break; break;

View File

@ -32,7 +32,7 @@ class QuoteRepository {
Future<BuiltList<InvoiceEntity>> loadList( Future<BuiltList<InvoiceEntity>> loadList(
Credentials credentials, int updatedAt) async { Credentials credentials, int updatedAt) async {
String url = credentials.url + String url = credentials.url +
'/quotes?include=invitations&invoice_type_id=2&is_recurring=0'; '/quotes?include=invitations';
if (updatedAt > 0) { if (updatedAt > 0) {
url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}'; url += '&updated_at=${updatedAt - kUpdatedAtBufferSeconds}';

View File

@ -216,7 +216,7 @@ class CustomFormField extends StatefulWidget {
class _CustomFormFieldState extends State<CustomFormField> { class _CustomFormFieldState extends State<CustomFormField> {
final _customFieldController = TextEditingController(); final _customFieldController = TextEditingController();
final _optionsController = TextEditingController(); final _optionsController = TextEditingController();
String _fieldType = kFieldTypeMultiLineText; String _fieldType = kFieldTypeSingleLineText;
List<TextEditingController> _controllers = []; List<TextEditingController> _controllers = [];
final _debouncer = Debouncer(); final _debouncer = Debouncer();
@ -240,7 +240,8 @@ class _CustomFormFieldState extends State<CustomFormField> {
_controllers _controllers
.forEach((dynamic controller) => controller.removeListener(_onChanged)); .forEach((dynamic controller) => controller.removeListener(_onChanged));
if ('${widget.value ?? ''}'.isNotEmpty && widget.value.contains('|')) { if ('${widget.value ?? ''}'.isNotEmpty) {
if (widget.value.contains('|')) {
final parts = widget.value.split('|'); final parts = widget.value.split('|');
_customFieldController.text = parts[0]; _customFieldController.text = parts[0];
switch (parts[1]) { switch (parts[1]) {
@ -258,6 +259,9 @@ class _CustomFormFieldState extends State<CustomFormField> {
_optionsController.text = parts[1]; _optionsController.text = parts[1];
break; break;
} }
} else {
_fieldType = kFieldTypeMultiLineText;
}
} else { } else {
_customFieldController.text = widget.value; _customFieldController.text = widget.value;
} }