-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5137.3 Requisition line edit + UI updates to line columns #5308
Changes from 29 commits
9237b1f
4883c67
497c8e3
7ed5c46
e4b4264
1f63ef5
70d2bdc
ea39dbb
56ecd01
a884b6b
05bba09
1ec5867
8d84927
42fe9b2
1934f51
266df44
920175e
bc610df
4d9f5b0
593eaf5
d164bc6
c459e4d
79be92a
52a8dd3
eba331a
a6ce13d
9f2a975
e1f4e0b
29029b6
54ff080
8af9e35
ae32c65
c0972f1
63c3405
25d0378
a5bebb2
474db73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,11 +67,13 @@ | |
"button.new-return": "New Return", | ||
"button.new-shipment": "New Shipment", | ||
"button.new-stock": "New Stock", | ||
"button.next": "Next", | ||
"button.next-step": "Next step", | ||
"button.ok": "OK", | ||
"button.ok-and-next": "OK & Next", | ||
"button.open-the-menu": "Open the menu", | ||
"button.order-more": "Order more", | ||
"button.previous": "Previous", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other than this and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct~ |
||
"button.print": "Print", | ||
"button.print-qr": "Print QR code", | ||
"button.reduce-lines-to-zero": "Reduce lines to 0", | ||
|
@@ -142,6 +144,7 @@ | |
"customers": "Customers", | ||
"dashboard": "Dashboard", | ||
"description.already-issued": "Quantity already issued in shipments.", | ||
"description.available-stock": "The customer's initial stock on hand + incoming stock +/- inventory adjustments - outgoing stock", | ||
"description.average-monthly-consumption": "Average Monthly Consumption", | ||
"description.breach-type": "Ongoing breach type", | ||
"description.counted-num-of-packs": "Counted # of Packs", | ||
|
@@ -155,7 +158,6 @@ | |
"description.fc-sell-price": "Foreign currency sell price per pack", | ||
"description.forecast-quantity": "Forecast Quantity to Reach Target", | ||
"description.initial-stock-on-hand": "Stock on hand on the first day of the program period", | ||
"description.available-stock": "The customer's initial stock on hand + incoming stock +/- inventory adjustments - outgoing stock", | ||
"description.invoice-number": "Shipment number", | ||
"description.last-reading-datetime": "Date and time of the last reading", | ||
"description.max-min-temperature": "Maximum or minimum temperature reading", | ||
|
@@ -732,11 +734,11 @@ | |
"label.invoice-number": "Number", | ||
"label.is-vaccine": "Vaccine", | ||
"label.issue": "Issue", | ||
"label.item-variant": "Item Variant", | ||
"label.item_few": "Items", | ||
"label.item_many": "Items", | ||
"label.item_one": "Item", | ||
"label.item_other": "Items", | ||
"label.item-variant": "Item Variant", | ||
"label.items-expiring-before": "Items expiring before", | ||
"label.items-no-stock_few": "Items with no stock", | ||
"label.items-no-stock_many": "Items with no stock", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2934,21 +2934,9 @@ export type InsertResponseRequisitionLineErrorInterface = { | |
}; | ||
|
||
export type InsertResponseRequisitionLineInput = { | ||
additionInUnits?: InputMaybe<Scalars['Float']['input']>; | ||
averageMonthlyConsumption?: InputMaybe<Scalars['Float']['input']>; | ||
comment?: InputMaybe<Scalars['String']['input']>; | ||
daysOutOfStock?: InputMaybe<Scalars['Float']['input']>; | ||
expiringUnits?: InputMaybe<Scalars['Float']['input']>; | ||
Comment on lines
-2972
to
-2976
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need all these fields on insert. We will do everything on update as everything is saved on blur except for the actual line creation itself |
||
id: Scalars['String']['input']; | ||
incomingUnits?: InputMaybe<Scalars['Float']['input']>; | ||
itemId: Scalars['String']['input']; | ||
lossInUnits?: InputMaybe<Scalars['Float']['input']>; | ||
optionId?: InputMaybe<Scalars['String']['input']>; | ||
outgoingUnits?: InputMaybe<Scalars['Float']['input']>; | ||
requestedQuantity?: InputMaybe<Scalars['Float']['input']>; | ||
requisitionId: Scalars['String']['input']; | ||
stockOnHand?: InputMaybe<Scalars['Float']['input']>; | ||
supplyQuantity?: InputMaybe<Scalars['Float']['input']>; | ||
}; | ||
|
||
export type InsertResponseRequisitionLineResponse = InsertResponseRequisitionLineError | RequisitionLineNode; | ||
|
@@ -6469,6 +6457,7 @@ export type RequisitionLineNode = { | |
remainingQuantityToSupply: Scalars['Float']['output']; | ||
/** Quantity requested */ | ||
requestedQuantity: Scalars['Float']['output']; | ||
requisitionNumber: Scalars['Int']['output']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for navigation |
||
/** | ||
* Calculated quantity | ||
* When months_of_stock < requisition.min_months_of_stock, calculated = average_monthly_consumption * requisition.max_months_of_stock - months_of_stock | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { CheckIcon, ChevronDownIcon } from '@common/icons'; | ||
import { | ||
List, | ||
ListItemIcon, | ||
ListItem, | ||
ListItemText, | ||
Divider, | ||
Box, | ||
} from '@mui/material'; | ||
import React from 'react'; | ||
|
||
export type ListOptionValues = { | ||
id: string; | ||
value: string; | ||
}; | ||
|
||
interface ListProps { | ||
onClick: (id: string) => void; | ||
options: ListOptionValues[]; | ||
currentId?: string; | ||
enteredLineIds?: string[]; | ||
} | ||
|
||
export const ListOptions = ({ | ||
onClick, | ||
options, | ||
currentId, | ||
enteredLineIds, | ||
}: ListProps) => { | ||
const startIcon = ( | ||
<CheckIcon | ||
style={{ | ||
backgroundColor: '#33A901', | ||
borderRadius: '50%', | ||
padding: '2px', | ||
color: 'white', | ||
height: 18, | ||
width: 18, | ||
}} | ||
/> | ||
); | ||
|
||
const endIcon = ( | ||
<ChevronDownIcon | ||
style={{ width: 17, height: 17, transform: 'rotate(-90deg)' }} | ||
/> | ||
); | ||
Comment on lines
+30
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had them passed in as props at first since we might use different icons for different use cases, but can't think of them right now for what we will use it for. Easy to refactor later on if needed |
||
|
||
return ( | ||
<List sx={{ padding: 0 }}> | ||
{options?.map((option, _) => ( | ||
<React.Fragment key={option.id}> | ||
<ListItem | ||
sx={{ padding: '5px 0px' }} | ||
onClick={() => onClick(option.id)} | ||
> | ||
<ListItemIcon sx={{ padding: 0, minWidth: 25 }}> | ||
{enteredLineIds?.includes(option.id) ? ( | ||
startIcon | ||
) : ( | ||
<Box style={{ visibility: 'hidden' }}>{startIcon}</Box> | ||
)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is quite funky - behind the scenes it appears to still be rendering the icon it's just invisible. But if you remove the icon JSX from here it renders the same anyway, just shadow dom doing less work? |
||
</ListItemIcon> | ||
<ListItemText | ||
primary={option.value} | ||
sx={{ margin: 0, padding: 0 }} | ||
/> | ||
<ListItemIcon sx={{ padding: 0, minWidth: 15 }}> | ||
{option.id === currentId ? ( | ||
endIcon | ||
) : ( | ||
<Box style={{ visibility: 'hidden' }}>{endIcon}</Box> | ||
)} | ||
</ListItemIcon> | ||
</ListItem> | ||
<Divider component="li" /> | ||
</React.Fragment> | ||
))} | ||
</List> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ListOptions'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming of the next button so I can create an actual 'next' button not 'ok & next'