@@ -107,18 +107,25 @@ class EditPurchaseOrderPage extends React.Component {
107107 < div className = "container" >
108108 < h3 >
109109 { title } { T . translate ( "edit_purchase_order.purchase_order" ) }
110- { entity . id != 0 &&
110+ { entity . id !== 0 &&
111111 < div className = "pull-right form-inline" >
112- < input
112+ {
113+ ( entity . status === 'RefundRequested' || entity . status === 'Paid' ) &&
114+ < input
113115 className = "form-control"
114116 type = "number"
115117 min = "0"
116118 value = { refund_amount }
117119 onChange = { this . handleRefundChange }
118- />
119- < button className = "btn btn-sm btn-primary right-space" onClick = { this . handleRefundOrder . bind ( this , entity ) } >
120- { T . translate ( "edit_purchase_order.refund" ) }
121- </ button >
120+ />
121+ }
122+ {
123+ ( entity . status === 'RefundRequested' || entity . status === 'Paid' ) &&
124+ < button className = "btn btn-sm btn-primary right-space"
125+ onClick = { this . handleRefundOrder . bind ( this , entity ) } >
126+ { T . translate ( "edit_purchase_order.refund" ) }
127+ </ button >
128+ }
122129 {
123130 entity . status === 'RefundRequested' &&
124131 < button className = "btn btn-sm btn-primary right-space" onClick = { this . handleCancelRefundOrder . bind ( this , entity ) } >
@@ -128,7 +135,7 @@ class EditPurchaseOrderPage extends React.Component {
128135 < button className = "btn btn-sm btn-danger" onClick = { this . handleDeleteOrder . bind ( this , entity ) } >
129136 { T . translate ( "edit_purchase_order.delete_order" ) }
130137 </ button >
131- { entity . status === 'Paid' &&
138+ { entity . status === 'Paid' &&
132139 < button className = "btn btn-sm btn-primary left-space"
133140 onClick = { this . handleResendEmail . bind ( this , entity ) } >
134141 { T . translate ( "edit_purchase_order.resend_order_email" ) }
0 commit comments