diff --git a/maya/App.tsx b/maya/App.tsx
index 3bee94f270..ea199d9ee5 100644
--- a/maya/App.tsx
+++ b/maya/App.tsx
@@ -108,7 +108,7 @@ function App(): React.JSX.Element {
if (loginState.isLoading) {
return (
-
+
);
}
diff --git a/maya/config/url.js b/maya/config/url.js
index 8883d3353a..31cb550df4 100644
--- a/maya/config/url.js
+++ b/maya/config/url.js
@@ -23,8 +23,8 @@ export default {
//stored items
'get-stored-items' : { url: "maya/org/{}/warehouses/{}/inventory/stored-items" },
'get-stored-item' : { url: "maya/org/{}/warehouses/{}/inventory/stored-items/{}" },
- "set-stored-item-pick" : { url: "maya/action/pallet-return-item/{}/pick" },
- "set-stored-item-undo-pick" : { url: "" },
+ "set-stored-item-pick" : { url: "maya/action/pallet-return-item/stored-items/{}/pick" },
+ "set-stored-item-undo-pick" : { url: "maya/action/pallet-return-item/stored-items/{}/undo-pick" },
//scanner
'get-scanner' : { url: "maya/org/{}/warehouses/{}/scanners/{}" },
@@ -45,9 +45,9 @@ export default {
'set-pallet-location' : { url: "maya/action/pallet/{}/location/{}/move" },
'set-pallet-not-received' : { url: "maya/action/pallet/{}/not-received" },
'undo-pallet-not-received' : { url: "maya/action/pallet/{}/undo-not-received" },
- 'set-pallet-picked' : { url : "maya/action/pallet-return-item/{}/pick"},
- 'set-pallet-not-picked' : { url : "maya/action/pallet-return-item/{}/not-picked"},
- 'undo-pallet-picked' : { url : "maya/action/pallet-return-item/{}/undo-pick"},
+ 'set-pallet-picked' : { url : "maya/action/pallet-return-item/pallet/{}/pick"},
+ 'set-pallet-not-picked' : { url : "maya/action/pallet-return-item/pallet/{}/not-picked"},
+ 'undo-pallet-picked' : { url : "maya/action/pallet-return-item/pallet/{}/undo-pick"},
//return
diff --git a/maya/src/components/BaseList.jsx b/maya/src/components/BaseList.jsx
index 1df117cccc..d311844bb4 100644
--- a/maya/src/components/BaseList.jsx
+++ b/maya/src/components/BaseList.jsx
@@ -71,6 +71,7 @@ const BaseList = forwardRef((props, ref) => {
});
}
}
+ /* setMeta(prevData => ({ ...prevData , last_page : page })) */
setIsFetching(false);
setIsLoadingMore(false);
},
@@ -142,7 +143,7 @@ const BaseList = forwardRef((props, ref) => {
// Show Loading Indicator on First Fetch
-
+
) : (
{
ListFooterComponent={
isLoadingMore ? (
-
+
) : null
}
diff --git a/maya/src/components/CustomDrawer.jsx b/maya/src/components/CustomDrawer.jsx
index 0c75902456..38b0c3fc8d 100644
--- a/maya/src/components/CustomDrawer.jsx
+++ b/maya/src/components/CustomDrawer.jsx
@@ -24,6 +24,7 @@ const CustomDrawer = props => {
.toUpperCase();
};
+
return (
{
if (loading) {
return (
-
+
);
}
diff --git a/maya/src/screens/Delivery/PalletInDeliveries.jsx b/maya/src/screens/Delivery/PalletInDeliveries.jsx
index 6950c54928..d760623848 100644
--- a/maya/src/screens/Delivery/PalletInDeliveries.jsx
+++ b/maya/src/screens/Delivery/PalletInDeliveries.jsx
@@ -70,7 +70,7 @@ const PalletInDeliveries = ({navigation, route, onChangeState}) => {
action: 'primary',
style: {borderTopRightRadius: 0, borderBottomRightRadius: 0},
onPress: null,
- text: `To do : 1 / ${data.number_pallets || 0}`,
+ text: `To do : ${data.number_pallets_state_not_received + data.number_pallets_state_booked_in }/ ${data.number_pallets + data.number_boxes + data.number_oversizes || 0}`,
}}
button2={{
size: 'md',
@@ -157,7 +157,7 @@ const GroupItem = ({item: initialItem, navigation}) => {
setItem(prevItem => ({
...prevItem,
state: response.data.state,
- state_icon: response.data.status_icon,
+ state_icon: response.data.state_icon,
}));
Animated.spring(translateX, {
diff --git a/maya/src/screens/Delivery/ShowFulfilmentDelivery.jsx b/maya/src/screens/Delivery/ShowFulfilmentDelivery.jsx
index e4ffd790b4..5407642d23 100644
--- a/maya/src/screens/Delivery/ShowFulfilmentDelivery.jsx
+++ b/maya/src/screens/Delivery/ShowFulfilmentDelivery.jsx
@@ -1,5 +1,5 @@
import React, {useState} from 'react';
-import {View, ScrollView, TouchableOpacity} from 'react-native';
+import {View, ScrollView, TouchableOpacity, RefreshControl} from 'react-native';
import {Card} from '@/src/components/ui/card';
import {Heading} from '@/src/components/ui/heading';
import {Center} from '@/src/components/ui/center';
@@ -18,7 +18,7 @@ import {Alert, AlertText} from '@/src/components/ui/alert';
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome';
import {faChevronDown, faChevronUp,faCheckCircle} from '@/private/fa/pro-light-svg-icons';
-const ShowFulfilmentDelivery = ({navigation, route, onChangeState}) => {
+const ShowFulfilmentDelivery = ({navigation, route, onChangeState, handleRefresh}) => {
const {data} = useDelivery();
const [isTimelineOpen, setIsTimelineOpen] = useState(false);
const insets = useSafeAreaInsets();
@@ -55,6 +55,10 @@ const ShowFulfilmentDelivery = ({navigation, route, onChangeState}) => {
label: 'Customer',
value: data.customer_name,
},
+ {
+ label: 'Customer Reference',
+ value: data.customer_reference,
+ },
{
label: 'Boxes',
value: data.number_boxes ? data.number_boxes.toString() : '-',
@@ -82,13 +86,17 @@ const ShowFulfilmentDelivery = ({navigation, route, onChangeState}) => {
value: data.public_notes,
},
];
-console.log(data)
+
+ console.log(data.number_pallets_state_not_received + data.number_pallets_state_booked_in)
return (
- {data.state != "Booked-in" ? (
+ contentContainerStyle={{paddingBottom: insets.bottom + 120}}
+ refreshControl={
+ handleRefresh()} />
+ }>
+ {data.state != "booked_in" ? (
{
if (loading) {
return (
-
+
);
}
diff --git a/maya/src/screens/Location/ShowLocation.jsx b/maya/src/screens/Location/ShowLocation.jsx
index 3f9068ab56..c05f6da4d0 100644
--- a/maya/src/screens/Location/ShowLocation.jsx
+++ b/maya/src/screens/Location/ShowLocation.jsx
@@ -64,7 +64,7 @@ const ShowLocation = ({navigation, route}) => {
if (loading) {
return (
-
+
);
}
diff --git a/maya/src/screens/LoginScreen.jsx b/maya/src/screens/LoginScreen.jsx
index 71e807be85..f5c77f3223 100644
--- a/maya/src/screens/LoginScreen.jsx
+++ b/maya/src/screens/LoginScreen.jsx
@@ -55,17 +55,16 @@ const LoginScreen = ({navigation}) => {
Toast.show({
type: ALERT_TYPE.DANGER,
title: 'Error',
- textBody: err?.detail?.message || 'Failed to fetch data',
+ textBody: err?.data.message || 'failed from server',
});
console.error('Profile Retrieval Failed:', err);
},
});
} else {
- console.error('Login Failed:', userRes);
Toast.show({
type: ALERT_TYPE.DANGER,
title: 'Error',
- textBody: userRes?.detail?.message || 'Failed to fetch data',
+ textBody: userRes?.data.message || 'failed from server',
});
resolve(false);
}
diff --git a/maya/src/screens/OrgStock/ShowOrgStock.jsx b/maya/src/screens/OrgStock/ShowOrgStock.jsx
index fb16bdea0e..6a11906621 100644
--- a/maya/src/screens/OrgStock/ShowOrgStock.jsx
+++ b/maya/src/screens/OrgStock/ShowOrgStock.jsx
@@ -52,7 +52,7 @@ const ShowOrgStock = ({navigation, route}) => {
if (loading) {
return (
-
+
);
}
diff --git a/maya/src/screens/Return/ItemsInReturn.jsx b/maya/src/screens/Return/ItemsInReturn.jsx
index 8e830f08dc..1198e858c3 100644
--- a/maya/src/screens/Return/ItemsInReturn.jsx
+++ b/maya/src/screens/Return/ItemsInReturn.jsx
@@ -19,7 +19,7 @@ import {getFilteredActionsReturn} from '@/src/utils';
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome';
import {library} from '@fortawesome/fontawesome-svg-core';
import {Center} from '@/src/components/ui/center';
-import {Button, ButtonText} from '@/src/components/ui/button';
+import {Button, ButtonText, ButtonSpinner} from '@/src/components/ui/button';
import Modal from '@/src/components/Modal';
import {Input, InputField} from '@/src/components/ui/input';
@@ -67,7 +67,6 @@ const ItemsInReturn = ({navigation, route, onChangeState}) => {
const {data, setData} = useReturn();
const {id} = route.params;
const _BaseList = useRef(null);
-
return (
{data.state != 'dispatched' ? (
@@ -81,10 +80,14 @@ const ItemsInReturn = ({navigation, route, onChangeState}) => {
borderBottomRightRadius: 0,
},
onPress: null,
- text: `To do : 0 / ${
+ text: `To do : ${
+ (data.type == 'pallet'
+ ? data?.number_pallet_pick
+ : data?.number_stored_items)
+ } / ${
(data.type == 'pallet'
? data?.number_pallets
- : data?.number_stored_items) || 0
+ : data?.number_stored_items)
}`,
}}
button2={{
@@ -128,7 +131,7 @@ const ItemsInReturn = ({navigation, route, onChangeState}) => {
const GroupItem = ({item: initialItem, navigation}) => {
const [item, setItem] = useState(initialItem);
const inputRef = useRef(null);
- const {data} = useReturn();
+ const {data, setData} = useReturn();
const [loadingSave, setLoadingSave] = useState(false);
const [modalSetPicked, setModalSetPicked] = useState(false);
const translateX = useRef(new Animated.Value(0)).current;
@@ -136,7 +139,7 @@ const GroupItem = ({item: initialItem, navigation}) => {
const MAX_SWIPE = 100;
const {control, handleSubmit, reset, setValue} = useForm({
defaultValues: {
- quantity_picked: parseInt(item.quantity_ordered).toString(),
+ quantity_picked: parseInt(item.quantity_ordered).toString(),
},
});
@@ -177,19 +180,27 @@ const GroupItem = ({item: initialItem, navigation}) => {
).current;
const onPicked = (allPicked = true, data) => {
+ setLoadingSave(true);
request({
urlKey: 'set-stored-item-pick',
method: 'patch',
args: [item.id],
- data: allPicked ? {} : data,
+ data: allPicked
+ ? {
+ quantity_picked:
+ parseInt(item.quantity_ordered)
+ .toString(),
+ }
+ : data,
onSuccess: response => {
- console.log(response);
+ setLoadingSave(false);
setItem(prevItem => ({
...prevItem,
state: response.data.state,
state_icon: response.data.state_icon,
+ quantity_picked: response.data.quantity_picked,
}));
-
+ setModalSetPicked(false);
Animated.spring(translateX, {
toValue: 0,
useNativeDriver: true,
@@ -198,17 +209,19 @@ const GroupItem = ({item: initialItem, navigation}) => {
Toast.show({
type: ALERT_TYPE.SUCCESS,
title: 'Success',
- textBody: 'Updated pallet ' + item.reference,
+ textBody: 'Updated sku ' + item.stored_items_name,
});
},
onFailed: error => {
console.log(error);
+ setLoadingSave(false);
+ setModalSetPicked(false);
Toast.show({
type: ALERT_TYPE.DANGER,
title: 'Error',
textBody:
error.detail?.message ||
- 'Failed to update pallet ' + item.reference,
+ 'Failed to update sku ' + item.stored_items_name,
});
},
});
@@ -218,15 +231,15 @@ const GroupItem = ({item: initialItem, navigation}) => {
request({
urlKey: 'set-stored-item-undo-pick',
method: 'patch',
- data: {},
args: [item.id],
onSuccess: response => {
setItem(prevItem => ({
...prevItem,
state: response.data.state,
state_icon: response.data.state_icon,
+ quantity_picked: response.data.quantity_picked,
}));
-
+ setModalSetPicked(false);
Animated.spring(translateX, {
toValue: 0,
useNativeDriver: true,
@@ -235,17 +248,18 @@ const GroupItem = ({item: initialItem, navigation}) => {
Toast.show({
type: ALERT_TYPE.SUCCESS,
title: 'Success',
- textBody: 'Updated pallet ' + item.reference,
+ textBody: 'Updated sku ' + item.stored_items_name,
});
},
onFailed: error => {
console.log(error);
+ setModalSetPicked(false);
Toast.show({
type: ALERT_TYPE.DANGER,
title: 'Error',
textBody:
error.detail?.message ||
- 'Failed to update pallet ' + item.reference,
+ 'Failed to update sku ' + item.stored_items_name,
});
},
});
@@ -277,9 +291,7 @@ const GroupItem = ({item: initialItem, navigation}) => {
- setModalSetPicked(true)
- }>
+ onPress={() => setModalSetPicked(true)}>
{
onPicked(false)}>
+ onPress={() => onPicked(true)}>
{
>
)}
- {item.state == 'picked' && (
-
- undoPicked()}>
-
-
+ {item.state == 'picked' && (
+
+ undoPicked()}>
+
+
)}
>
@@ -366,7 +384,7 @@ const GroupItem = ({item: initialItem, navigation}) => {
{item?.stored_items_name || 'N/A'}
- {parseInt(item.quantity_dispatched) +
+ {parseInt(item.quantity_picked) +
'/' +
parseInt(item.quantity_ordered)}
@@ -424,7 +442,7 @@ const GroupItem = ({item: initialItem, navigation}) => {
/>