@@ -5,10 +5,11 @@ import LineItemsTable from '../../components/LineItemsTable/LineItemsTable'
5
5
import './document.scss'
6
6
7
7
const Document = ( { document, addClass } ) => {
8
- const { identifier, date, documentStatusColor, documentType,
9
- documentTypeColor, documentStatus, lineItems, requestIdentifier,
10
- shippingPrice, shipTo, shipFrom, subtotalPrice,
11
- taxAmount, terms, totalPrice } = document
8
+ const {
9
+ adPO, date, documentStatusColor, documentType, documentTypeColor, documentStatus, identifier, lineItems, poNumber,
10
+ relatedSOWIdentifier, requestIdentifier, shippingPrice, shipTo, shipFrom, subtotalPrice, taxAmount, terms, totalPrice,
11
+ turnaroundTime,
12
+ } = document
12
13
const [ show , setShow ] = useState ( false )
13
14
const handleClose = ( ) => setShow ( false )
14
15
const handleShow = ( ) => setShow ( true )
@@ -21,14 +22,14 @@ const Document = ({ document, addClass }) => {
21
22
{ documentType }
22
23
</ div >
23
24
< div className = 'border-end p-2' >
24
- < b > { identifier } :</ b > { subtotalPrice }
25
+ < b > { ( documentType === 'SOW' ) ? identifier : poNumber } :</ b > { subtotalPrice }
25
26
</ div >
26
27
< small className = 'text-muted fw-light p-2' >
27
28
{ date }
28
29
</ small >
29
30
</ div >
30
31
< div className = 'ms-auto p-2' >
31
- < div className = 'badge p-2' style = { { backgroundColor : documentStatusColor } } >
32
+ < div className = 'badge p-2' style = { { backgroundColor : documentStatusColor } } >
32
33
{ documentStatus }
33
34
</ div >
34
35
</ div >
@@ -52,8 +53,12 @@ const Document = ({ document, addClass }) => {
52
53
< Offcanvas . Body >
53
54
< div className = 'd-block d-md-flex justify-content-between' >
54
55
< div className = 'details' >
55
- < h6 > Details:</ h6 >
56
- < b > Proposal:</ b > { identifier } < br />
56
+ < h5 > Details:</ h5 >
57
+ { poNumber && < > < b > PO:</ b > { poNumber } < br /> </ > }
58
+ { adPO && < > < b > AD PO:</ b > { identifier } < br /> </ > }
59
+ { documentType === 'SOW'
60
+ ? < > < b > Proposal:</ b > { identifier } </ >
61
+ : < > < b > Related SOW:</ b > { relatedSOWIdentifier } </ > } < br />
57
62
< b > Amount:</ b > { subtotalPrice } < br />
58
63
< b > Request:</ b > { requestIdentifier } < br />
59
64
< b > Date:</ b > { date } < br />
@@ -71,8 +76,7 @@ const Document = ({ document, addClass }) => {
71
76
< div className = 'address' > { shipFrom . text } </ div >
72
77
</ div >
73
78
</ div >
74
- { lineItems
75
- && (
79
+ { lineItems && (
76
80
< LineItemsTable
77
81
lineItems = { lineItems }
78
82
subtotalPrice = { subtotalPrice }
@@ -81,6 +85,7 @@ const Document = ({ document, addClass }) => {
81
85
totalPrice = { totalPrice }
82
86
/>
83
87
) }
88
+ { turnaroundTime && < h5 > < b > Turnaround Time:</ b > { turnaroundTime } </ h5 > }
84
89
</ Offcanvas . Body >
85
90
</ Offcanvas >
86
91
</ >
@@ -91,13 +96,16 @@ const Document = ({ document, addClass }) => {
91
96
Document . propTypes = {
92
97
addClass : PropTypes . string ,
93
98
document : PropTypes . shape ( {
99
+ adPO : PropTypes . string ,
94
100
identifier : PropTypes . string . isRequired ,
95
101
date : PropTypes . string . isRequired ,
96
102
documentStatus : PropTypes . string . isRequired ,
97
103
documentStatusColor : PropTypes . string ,
98
104
documentType : PropTypes . string . isRequired ,
99
105
documentTypeColor : PropTypes . string ,
100
106
lineItems : PropTypes . arrayOf ( PropTypes . shape ( { } ) ) . isRequired ,
107
+ poNumber : PropTypes . string ,
108
+ relatedSOWIdentifier : PropTypes . string ,
101
109
requestIdentifier : PropTypes . string . isRequired ,
102
110
shippingPrice : PropTypes . string . isRequired ,
103
111
shipTo : PropTypes . shape ( {
@@ -112,6 +120,7 @@ Document.propTypes = {
112
120
taxAmount : PropTypes . string . isRequired ,
113
121
terms : PropTypes . string . isRequired ,
114
122
totalPrice : PropTypes . string . isRequired ,
123
+ turnaroundTime : PropTypes . string ,
115
124
} ) ,
116
125
}
117
126
0 commit comments