Skip to content

Commit

Permalink
pallet retuen
Browse files Browse the repository at this point in the history
  • Loading branch information
YudhistiraA committed Feb 21, 2025
1 parent eab3699 commit 1579f36
Show file tree
Hide file tree
Showing 21 changed files with 195 additions and 155 deletions.
2 changes: 1 addition & 1 deletion maya/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function App(): React.JSX.Element {
if (loginState.isLoading) {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<ActivityIndicator size="large" />
<ActivityIndicator size="large" color='#4F46E5'/>
</View>
);
}
Expand Down
10 changes: 5 additions & 5 deletions maya/config/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/{}" },
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions maya/src/components/BaseList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const BaseList = forwardRef((props, ref) => {
});
}
}
/* setMeta(prevData => ({ ...prevData , last_page : page })) */
setIsFetching(false);
setIsLoadingMore(false);
},
Expand Down Expand Up @@ -142,7 +143,7 @@ const BaseList = forwardRef((props, ref) => {
// Show Loading Indicator on First Fetch
<View
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Spinner size="large" />
<Spinner size="large" color={"#837FE1"}/>
</View>
) : (
<FlatList
Expand All @@ -161,7 +162,7 @@ const BaseList = forwardRef((props, ref) => {
ListFooterComponent={
isLoadingMore ? (
<View style={{paddingVertical: 10}}>
<Spinner size="small" />
<Spinner size="small" color={"#837FE1"}/>
</View>
) : null
}
Expand Down
1 change: 1 addition & 0 deletions maya/src/components/CustomDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const CustomDrawer = props => {
.toUpperCase();
};


return (
<View className="flex-1">
<DrawerContentScrollView
Expand Down
2 changes: 1 addition & 1 deletion maya/src/screens/Area/ShowArea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ShowArea = ({navigation, route}) => {
if (loading) {
return (
<View className="flex-1 items-center justify-center bg-gray-100">
<Spinner size="large" />
<Spinner size="large" color={"#837FE1"} />
</View>
);
}
Expand Down
4 changes: 2 additions & 2 deletions maya/src/screens/Delivery/PalletInDeliveries.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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, {
Expand Down
20 changes: 14 additions & 6 deletions maya/src/screens/Delivery/ShowFulfilmentDelivery.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
Expand Down Expand Up @@ -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() : '-',
Expand Down Expand Up @@ -82,21 +86,25 @@ 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 (
<ScrollView
style={globalStyles.container}
contentContainerStyle={{paddingBottom: insets.bottom + 120}}>
{data.state != "Booked-in" ? (
contentContainerStyle={{paddingBottom: insets.bottom + 120}}
refreshControl={
<RefreshControl onRefresh={()=>handleRefresh()} />
}>
{data.state != "booked_in" ? (
<SetStateButton
button1={{
size: 'md',
variant: 'outline',
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',
Expand Down
2 changes: 1 addition & 1 deletion maya/src/screens/DeliveryNote/ShowDeliveryNote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ShowDeliveryNote = ({navigation, route}) => {
if (loading) {
return (
<View className="flex-1 items-center justify-center bg-gray-100">
<ActivityIndicator size="large" color="#3b82f6" />
<ActivityIndicator size="large" color='#4F46E5'/>
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion maya/src/screens/Location/ShowLocation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const ShowLocation = ({navigation, route}) => {
if (loading) {
return (
<View className="flex-1 items-center justify-center bg-gray-100">
<ActivityIndicator size="large" color="#3b82f6" />
<ActivityIndicator size="large" color='#4F46E5' />
</View>
);
}
Expand Down
5 changes: 2 additions & 3 deletions maya/src/screens/LoginScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion maya/src/screens/OrgStock/ShowOrgStock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ShowOrgStock = ({navigation, route}) => {
if (loading) {
return (
<View className="flex-1 items-center justify-center bg-gray-100">
<ActivityIndicator size="large" color="#3b82f6" />
<ActivityIndicator size="large" color='#4F46E5' />
</View>
);
}
Expand Down
Loading

0 comments on commit 1579f36

Please sign in to comment.