add task based items to invoices using the mobile app #541
This commit is contained in:
parent
5edaa9f233
commit
c84f43e4cc
|
|
@ -1552,7 +1552,8 @@ class TaskItemFields {
|
||||||
|
|
||||||
abstract class InvoiceItemEntity
|
abstract class InvoiceItemEntity
|
||||||
implements Built<InvoiceItemEntity, InvoiceItemEntityBuilder> {
|
implements Built<InvoiceItemEntity, InvoiceItemEntityBuilder> {
|
||||||
factory InvoiceItemEntity({String? productKey, double? quantity}) {
|
factory InvoiceItemEntity(
|
||||||
|
{String? productKey, double? quantity, String? typeId}) {
|
||||||
return _$InvoiceItemEntity._(
|
return _$InvoiceItemEntity._(
|
||||||
productKey: productKey ?? '',
|
productKey: productKey ?? '',
|
||||||
notes: '',
|
notes: '',
|
||||||
|
|
@ -1565,7 +1566,7 @@ abstract class InvoiceItemEntity
|
||||||
taxRate2: 0,
|
taxRate2: 0,
|
||||||
taxName3: '',
|
taxName3: '',
|
||||||
taxRate3: 0,
|
taxRate3: 0,
|
||||||
typeId: TYPE_STANDARD,
|
typeId: typeId ?? TYPE_STANDARD,
|
||||||
customValue1: '',
|
customValue1: '',
|
||||||
customValue2: '',
|
customValue2: '',
|
||||||
customValue3: '',
|
customValue3: '',
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,9 @@ class ItemEditDetailsState extends State<ItemEditDetails> {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
DecoratedFormField(
|
DecoratedFormField(
|
||||||
label: localization.product,
|
label: widget.invoiceItem.isTask
|
||||||
|
? localization.service
|
||||||
|
: localization.product,
|
||||||
controller: _productKeyController,
|
controller: _productKeyController,
|
||||||
onSavePressed: widget.entityViewModel.onSavePressed,
|
onSavePressed: widget.entityViewModel.onSavePressed,
|
||||||
keyboardType: TextInputType.text,
|
keyboardType: TextInputType.text,
|
||||||
|
|
@ -296,7 +298,9 @@ class ItemEditDetailsState extends State<ItemEditDetails> {
|
||||||
value: _custom4Controller.text,
|
value: _custom4Controller.text,
|
||||||
),
|
),
|
||||||
DecoratedFormField(
|
DecoratedFormField(
|
||||||
label: localization.unitCost,
|
label: widget.invoiceItem.isTask
|
||||||
|
? localization.rate
|
||||||
|
: localization.unitCost,
|
||||||
controller: _costController,
|
controller: _costController,
|
||||||
keyboardType:
|
keyboardType:
|
||||||
TextInputType.numberWithOptions(decimal: true, signed: true),
|
TextInputType.numberWithOptions(decimal: true, signed: true),
|
||||||
|
|
@ -304,7 +308,9 @@ class ItemEditDetailsState extends State<ItemEditDetails> {
|
||||||
),
|
),
|
||||||
company.enableProductQuantity
|
company.enableProductQuantity
|
||||||
? DecoratedFormField(
|
? DecoratedFormField(
|
||||||
label: localization.quantity,
|
label: widget.invoiceItem.isTask
|
||||||
|
? localization.hours
|
||||||
|
: localization.quantity,
|
||||||
controller: _qtyController,
|
controller: _qtyController,
|
||||||
keyboardType: TextInputType.numberWithOptions(
|
keyboardType: TextInputType.numberWithOptions(
|
||||||
decimal: true, signed: true),
|
decimal: true, signed: true),
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
String? _filter;
|
String? _filter;
|
||||||
String? _filterClientId;
|
String? _filterClientId;
|
||||||
TabController? _tabController;
|
late TabController _tabController;
|
||||||
final List<BaseEntity> _selected = [];
|
final List<BaseEntity> _selected = [];
|
||||||
|
|
||||||
final _textController = TextEditingController();
|
final _textController = TextEditingController();
|
||||||
|
|
@ -57,7 +57,7 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector>
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_textController.dispose();
|
_textController.dispose();
|
||||||
_tabController!.dispose();
|
_tabController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,7 +65,9 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector>
|
||||||
widget.onItemsSelected!([
|
widget.onItemsSelected!([
|
||||||
InvoiceItemEntity(
|
InvoiceItemEntity(
|
||||||
quantity:
|
quantity:
|
||||||
company.defaultQuantity || !company.enableProductQuantity ? 1 : 0)
|
company.defaultQuantity || !company.enableProductQuantity ? 1 : 0,
|
||||||
|
typeId: _tabController.index == 1 ? InvoiceItemEntity.TYPE_TASK : null,
|
||||||
|
)
|
||||||
]);
|
]);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue