Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f7ce3b

Browse files
OBPIH-7555 Create UI for Expiration History report (#5577)
Co-authored-by: SebastianLib <sebastianlib04@gmail.com>
1 parent3bc0033 commit0f7ce3b

File tree

17 files changed

+690
-14
lines changed

17 files changed

+690
-14
lines changed

‎grails-app/conf/runtime.groovy‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ openboxes {
330330
[label:"report.showTransactionReport.label",defaultLabel:"Transaction Report",href:"/report/showTransactionReport"],
331331
[label:"report.consumption.label",defaultLabel:"Consumption Report",href:"/consumption/show"],
332332
[label:"report.requestDetailReport.label",defaultLabel:"Request Detail Report",href:"/report/showRequestDetailReport"],
333+
[label:"report.expirationHistoryReport.label",defaultLabel:"Expiration History Report",href:"/report/expirationHistoryReport"],
333334
]
334335
],
335336
[

‎grails-app/controllers/org/pih/warehouse/reporting/ReportController.groovy‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,10 @@ class ReportController {
618618
render(view:'showRequestDetailReport',params: params)
619619
}
620620

621+
defexpirationHistoryReport() {
622+
render(view:"/common/react")
623+
}
624+
621625
defshowCycleCountReport() {
622626
Location location=Location.load(session.warehouse.id)
623627
List binLocations= inventoryService.getQuantityByBinLocation(location)

‎grails-app/i18n/messages.properties‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,6 +2429,7 @@ report.transactionReports.label=Transaction Reports
24292429
report.expiredStockReport.label=Expired Stock Report
24302430
report.expiringStockReport.label=Expiring Stock
24312431
report.requestDetailReport.label=Request Detail Report
2432+
report.expirationHistoryReport.label=Expiration History Report
24322433
report.optionalFilters.label=Optional Filters
24332434
report.listRequestItems.label=List Completed Request Items
24342435
report.totalDemand.label=Total Demand
@@ -4850,6 +4851,8 @@ react.cycleCount.indicators.cardSubtitle.valueOfShrinkage.label=value of shrinka
48504851
react.cycleCount.indicators.cardInfo.productsInventoried.label=Number of products that were counted at least once during the time range.
48514852
react.cycleCount.indicators.cardInfo.inventoryAccuracy.label=Percentage of cycle counts with an equal count, compared to all cycle counts recorded during the time range (equal and non equal counts). This represents the share of inventory for which OpenBoxes inventory is accurately representing the physical inventory.
48524853
react.cycleCount.indicators.cardInfo.inventoryShrinkage.label=Inventory Shrinkage count is the number of products for which the overall inventory change over the time range selected is a negative adjustment (qty at the beginning of the time range is more than qty at the end). The financial inventory shrinkage is the equivalent of the inventory decrease for these products in USD.
4854+
4855+
# REPORTING
48534856
react.report.reorder.header.label=Reorder Report
48544857
react.report.reorder.additionalInventoryLocations.label=Additional Inventory Locations
48554858
react.report.reorder.expiredStock.label=Expired Stock
@@ -4864,6 +4867,23 @@ react.report.reorder.showProductsBelowMinimum.label=Show products below minimum
48644867
react.report.reorder.category.label=Category
48654868
react.report.reorder.tags.label=Tags
48664869
react.report.reorder.loadTable.label=Load table
4870+
react.report.expirationHistory.header.label=Expiration History Report
4871+
react.report.expirationHistory.location.label=Location
4872+
react.report.expirationHistory.startDate.label=Start Date
4873+
react.report.expirationHistory.endDate.label=End Date
4874+
react.report.expirationHistory.transactionId.label=Transaction Id
4875+
react.report.expirationHistory.transactionDate.label=Transaction Date
4876+
react.report.expirationHistory.code.label=Code
4877+
react.report.expirationHistory.productName.label=Product Name
4878+
react.report.expirationHistory.category.label=Category
4879+
react.report.expirationHistory.lotNumber.label=Lot Number
4880+
react.report.expirationHistory.expirationDate.label=Expiration Date
4881+
react.report.expirationHistory.quantityLostToExpiry.label=Quantity Lost to Expiry
4882+
react.report.expirationHistory.unitPrice.label=Unit Price
4883+
react.report.expirationHistory.valueLostToExpiry.label=Value Lost to Expiry
4884+
react.report.expirationHistory.noResultFound.label=No result found.
4885+
react.report.expirationHistory.selectATimeRange.label=Please select a time range to load the table.
4886+
react.report.expirationHistory.unableToLoadData.label=Unable to load data
48674887

48684888
react.confirmExpirationDate.modal.title.label=Confirm save
48694889
react.confirmExpirationDate.modal.subtitle.label=This will update the expiry date across all depots in the system for the lots listed below. Are you sure you want to proceed?

‎src/css/main.scss‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
@import"src/css/colors";
22

3+
@mixin
4+
limit-lines($lines-number) {
5+
overflow:hidden;
6+
display:-webkit-box;
7+
-webkit-line-clamp:$lines-number;
8+
line-clamp:$lines-number;
9+
-webkit-box-orient:vertical;
10+
}
11+
12+
@for$ifrom1through10 {
13+
.limit-lines-#{$i} {
14+
@includelimit-lines($i);
15+
}
16+
}
17+
318
body {
419
overflow-x:hidden;
520
font-family:'Inter',sans-serif;

‎src/js/api/urls.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,4 @@ export const INDICATORS_INVENTORY_ACCURACY = `${INDICATORS_REPORT}/inventoryAccu
217217
// INVENTORY
218218
exportconstINVENTORY_API=(id)=>`${API}/facilities/${id}/inventories`;
219219
exportconstREORDER_REPORT=(id)=>`${INVENTORY_API(id)}/reorderReport`;
220+
exportconstEXPIRATION_HISTORY_REPORT=`${API}/inventories/expirationHistoryReport`;

‎src/js/components/DataTable/v2/DataTable.jsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import DataTableHeader from 'components/DataTable/v2/DataTableHeader';
99
importuseDataTablefrom'hooks/useDataTable';
1010
importuseWindowWidthCheckfrom'hooks/useWindowWidthCheck';
1111

12+
import'react-table/react-table.css';
1213
import'components/DataTable/DataTable.scss';
1314

1415
// To enable virtualization of the table the "virtualize" object should be passed.

‎src/js/components/Router.jsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ const AsyncReorderReport = Loadable({
198198
loading:Loading,
199199
});
200200

201+
constAsyncExpirationHistoryReport=Loadable({
202+
loader:()=>import('components/reporting/expirationHistoryReport/ExpirationHistoryReport'),
203+
loading:Loading,
204+
});
205+
201206
constStockMovementList=(props)=>{
202207
constparsedSearchQuery=queryString.parse(props?.location?.search);
203208
constdirection=parsedSearchQuery?.direction?.toUpperCase();
@@ -238,6 +243,7 @@ const Router = (props) => {
238243
<MainLayoutRoutepath="**/stockMovement/list"component={StockMovementList}/>
239244
<MainLayoutRoutepath="**/stockMovement/createOutbound/:stockMovementId?"component={AsyncStockMovement}/>
240245
<MainLayoutRoutepath="**/stockMovement/importOutboundStockMovement"component={AsyncOutboundImport}/>
246+
<MainLayoutRoutepath="**/report/expirationHistoryReport"component={AsyncExpirationHistoryReport}/>
241247
<MainLayoutRoutepath="**/inventory/reorderReport"component={AsyncReorderReport}/>
242248
<MainLayoutRoutepath="**/inventory/cycleCount/count"component={AsyncCycleCountCountStep}/>
243249
<MainLayoutRoutepath="**/inventory/cycleCount/resolve"component={AsyncCycleCountResolveStep}/>

‎src/js/components/cycleCount/cycleCount.scss‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
@import"src/css/colors";
22

3-
@mixin
4-
limit-lines($lines-number) {
5-
overflow:hidden;
6-
display:-webkit-box;
7-
-webkit-line-clamp:$lines-number;
8-
line-clamp:$lines-number;
9-
-webkit-box-orient:vertical;
10-
}
11-
123
.all-products-tab-footer {
134

145
p {
@@ -51,11 +42,6 @@ limit-lines($lines-number) {
5142
font-size:14px;
5243
}
5344

54-
@for$ifrom1through10 {
55-
.limit-lines-#{$i} {
56-
@includelimit-lines($i);
57-
}
58-
}
5945

6046
.resolve-table-limit-lines {
6147
max-height:calc(1.5em*3+20px);
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
importReactfrom'react';
2+
3+
import{RiDownload2Line}from'react-icons/ri';
4+
5+
importButtonfrom'components/form-elements/Button';
6+
importexpirationHistoryReportFilterFields
7+
from'components/reporting/expirationHistoryReport/ExpirationHistoryReportFilterFields';
8+
importExpirationHistoryReportFilters
9+
from'components/reporting/expirationHistoryReport/ExpirationHistoryReportFilters';
10+
importExpirationHistoryReportHeader
11+
from'components/reporting/expirationHistoryReport/ExpirationHistoryReportHeader';
12+
importExpirationHistoryReportTable
13+
from'components/reporting/expirationHistoryReport/ExpirationHistoryReportTable';
14+
importuseExpirationHistoryReportfrom'hooks/reporting/useExpirationHistoryReport';
15+
importuseExpirationHistoryReportFiltersfrom'hooks/reporting/useExpirationHistoryReportFilters';
16+
importuseTranslationfrom'hooks/useTranslation';
17+
importPageWrapperfrom'wrappers/PageWrapper';
18+
19+
constExpirationHistoryReport=()=>{
20+
useTranslation('reporting');
21+
22+
const{
23+
defaultFilterValues,
24+
filterParams,
25+
filtersInitialized,
26+
setFilterValues,
27+
shouldFetch,
28+
setShouldFetch,
29+
}=useExpirationHistoryReportFilters({filterFields:expirationHistoryReportFilterFields});
30+
31+
const{
32+
columns,
33+
loading,
34+
emptyTableMessage,
35+
tableData,
36+
paginationProps,
37+
setSerializedParams,
38+
exportData,
39+
}=useExpirationHistoryReport({
40+
filterParams,
41+
defaultFilterValues,
42+
shouldFetch,
43+
setShouldFetch,
44+
filtersInitialized,
45+
});
46+
47+
return(
48+
<PageWrapper>
49+
<ExpirationHistoryReportHeader/>
50+
<divclassName="list-page-list-section">
51+
<ExpirationHistoryReportFilters
52+
defaultFilterValues={defaultFilterValues}
53+
setSerializedParams={setSerializedParams}
54+
setFilterValues={setFilterValues}
55+
setShouldFetch={setShouldFetch}
56+
/>
57+
<divclassName="d-flex m-2 gap-8 justify-content-end">
58+
<Button
59+
onClick={exportData}
60+
defaultLabel="Export"
61+
label="react.default.button.export.label"
62+
variant="secondary"
63+
EndIcon={<RiDownload2Line/>}
64+
/>
65+
</div>
66+
<ExpirationHistoryReportTable
67+
columns={columns}
68+
emptyTableMessage={emptyTableMessage}
69+
filterParams={filterParams}
70+
tableData={tableData}
71+
paginationProps={paginationProps}
72+
loading={loading}
73+
/>
74+
</div>
75+
</PageWrapper>
76+
);
77+
};
78+
79+
exportdefaultExpirationHistoryReport;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
importDateFilterfrom'components/form-elements/DateFilter/DateFilter';
2+
importFilterSelectFieldfrom'components/form-elements/FilterSelectField';
3+
import{DateFormat}from'consts/timeFormat';
4+
5+
constExpirationHistoryReportFilterFields={
6+
location:{
7+
type:FilterSelectField,
8+
attributes:{
9+
valueKey:'id',
10+
filterElement:true,
11+
placeholder:'react.report.expirationHistory.location.label',
12+
defaultPlaceholder:'Location',
13+
options:[],
14+
showLabelTooltip:true,
15+
disabled:true,
16+
},
17+
},
18+
startDate:{
19+
type:DateFilter,
20+
attributes:{
21+
label:'react.report.expirationHistory.startDate.label',
22+
defaultMessage:'Start Date',
23+
dateFormat:DateFormat.DD_MMM_YYYY,
24+
filterElement:true,
25+
required:true,
26+
},
27+
},
28+
endDate:{
29+
type:DateFilter,
30+
attributes:{
31+
label:'react.report.expirationHistory.endDate.label',
32+
defaultMessage:'End Date',
33+
dateFormat:DateFormat.DD_MMM_YYYY,
34+
filterElement:true,
35+
required:true,
36+
},
37+
},
38+
};
39+
40+
exportdefaultExpirationHistoryReportFilterFields;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp