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;
@nullable
@BuiltValueField(wireName: 'enabled_tax_rates')
@BuiltValueField(wireName: 'invoice_item_taxes')
int get numberOfItemTaxRates;
@nullable

View File

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

View File

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

View File

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