|
|
|
|
@ -282,7 +282,6 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
|
|
|
|
|
|
|
|
|
|
void _loadInitialData() {
|
|
|
|
|
assetDeliveryProvider = Provider.of<AssetDeliveryProvider>(context, listen: false);
|
|
|
|
|
|
|
|
|
|
if (widget.assetDetailsModel != null) {
|
|
|
|
|
model = EndUserAssetDetailsModel.fromJson(
|
|
|
|
|
widget.assetDetailsModel!.toJson(),
|
|
|
|
|
@ -291,7 +290,9 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
|
|
|
|
|
model.assetDeliveryExternalDeliveryId = widget.tableId;
|
|
|
|
|
model.status = widget.assetDetailsModel?.status;
|
|
|
|
|
model.rejectionReason = widget.assetDetailsModel?.rejectionReason;
|
|
|
|
|
model.receivedQty = widget.assetDetailsModel?.receivedQty;
|
|
|
|
|
}
|
|
|
|
|
log('details ${model.toJson()}');
|
|
|
|
|
|
|
|
|
|
quantityController.text = model.rejectedQty != null ? model.rejectedQty.toString() : '';
|
|
|
|
|
descriptionController.text = model.description ?? '';
|
|
|
|
|
@ -309,6 +310,11 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool get _showReceivedQty {
|
|
|
|
|
if (_isAccessory && model.receivedQty != null) return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool get _showRejectionReason {
|
|
|
|
|
if (_isAccessory) {
|
|
|
|
|
if (_isRejected) return true;
|
|
|
|
|
@ -358,6 +364,10 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
|
|
|
|
|
children: [
|
|
|
|
|
_statusDropdown(),
|
|
|
|
|
8.height,
|
|
|
|
|
if (_showReceivedQty) ...[
|
|
|
|
|
_receivedQtyField(),
|
|
|
|
|
8.height,
|
|
|
|
|
],
|
|
|
|
|
if (_showRejectedQty) ...[
|
|
|
|
|
_rejectedQtyField(),
|
|
|
|
|
8.height,
|
|
|
|
|
@ -420,6 +430,36 @@ class _UpdateEndUserAssetDetailsViewState extends State<UpdateEndUserAssetDetail
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _receivedQtyField() {
|
|
|
|
|
log('received qty ${model.receivedQty}');
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColor.fieldBgColor(context),
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text('Received Qty', style: AppTextStyles.textFieldLabelStyle),
|
|
|
|
|
4.height,
|
|
|
|
|
Text(model.receivedQty.toString(), style: AppTextStyles.textFieldLabelStyle),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: 'Received Quantity'.addTranslation,
|
|
|
|
|
initialValue: model.receivedQty.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
enable: false,
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _rejectionReasonDropdown() {
|
|
|
|
|
return SingleItemDropDownMenu<Lookup, EndUserRejectionReasonLookupProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
|