-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display vendor details and extended info for version history
- Loading branch information
1 parent
67b0c93
commit 62af0f3
Showing
5 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...istoryView/VersionHistoryViewExtendedInformation/VersionHistoryViewExtendedInformation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { useStripes } from '@folio/stripes/core'; | ||
import { | ||
Col, | ||
Row, | ||
} from '@folio/stripes/components'; | ||
import { | ||
PAYMENT_METHOD_LABELS, | ||
VersionKeyValue, | ||
VersionCheckbox, | ||
} from '@folio/stripes-acq-components'; | ||
|
||
export const VersionHistoryViewExtendedInformation = ({ version = {} }) => { | ||
const { folioInvoiceNo, | ||
paymentMethod, | ||
currency, | ||
chkSubscriptionOverlap, | ||
exportToAccounting, | ||
enclosureNeeded, | ||
exchangeRate, | ||
} = version; | ||
|
||
const stripes = useStripes(); | ||
const isExchangeRateVisible = stripes.currency !== currency; | ||
|
||
return ( | ||
<Row> | ||
<Col xs={3}> | ||
<VersionKeyValue | ||
name="folioInvoiceNo" | ||
label={<FormattedMessage id="ui-invoice.invoice.folioInvoiceNo" />} | ||
value={folioInvoiceNo} | ||
/> | ||
</Col> | ||
|
||
<Col xs={3}> | ||
<VersionKeyValue | ||
name="paymentMethod" | ||
label={<FormattedMessage id="ui-invoice.invoice.paymentMethod" />} | ||
value={PAYMENT_METHOD_LABELS[paymentMethod]} | ||
/> | ||
</Col> | ||
|
||
<Col xs={3}> | ||
<VersionCheckbox | ||
checked={Boolean(chkSubscriptionOverlap)} | ||
disabled | ||
label={<FormattedMessage id="ui-invoice.invoice.chkSubscriptionOverlap" />} | ||
type="checkbox" | ||
name="chkSubscriptionOverlap" | ||
/> | ||
</Col> | ||
|
||
<Col xs={3}> | ||
<VersionCheckbox | ||
checked={Boolean(exportToAccounting)} | ||
disabled | ||
label={<FormattedMessage id="ui-invoice.invoice.exportToAccounting" />} | ||
type="checkbox" | ||
name="exportToAccounting" | ||
/> | ||
</Col> | ||
|
||
<Col xs={3}> | ||
<VersionCheckbox | ||
checked={Boolean(enclosureNeeded)} | ||
disabled | ||
label={<FormattedMessage id="ui-invoice.invoice.enclosureNeeded" />} | ||
type="checkbox" | ||
name="enclosureNeeded" | ||
/> | ||
</Col> | ||
|
||
<Col xs={3}> | ||
<VersionKeyValue | ||
name="currency" | ||
label={<FormattedMessage id="ui-invoice.invoice.currency" />} | ||
value={currency} | ||
/> | ||
</Col> | ||
|
||
{isExchangeRateVisible && ( | ||
<Col | ||
xs={3} | ||
> | ||
<VersionKeyValue | ||
name="exchangeRate" | ||
label={<FormattedMessage id="ui-invoice.invoice.details.voucher.exchangeRate" />} | ||
value={exchangeRate} | ||
/> | ||
</Col> | ||
)} | ||
</Row> | ||
); | ||
}; | ||
|
||
VersionHistoryViewExtendedInformation.propTypes = { | ||
version: PropTypes.object.isRequired, | ||
}; |
1 change: 1 addition & 0 deletions
1
...y/InvoiceVersionHistory/VersionHistoryView/VersionHistoryViewExtendedInformation/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { VersionHistoryViewExtendedInformation } from './VersionHistoryViewExtendedInformation'; |
44 changes: 44 additions & 0 deletions
44
...ory/VersionHistoryView/VersionHistoryViewVendorDetails/VersionHistoryViewVendorDetails.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { | ||
Col, | ||
Row, | ||
} from '@folio/stripes/components'; | ||
import { | ||
VersionKeyValue, | ||
} from '@folio/stripes-acq-components'; | ||
|
||
export const VersionHistoryViewVendorDetails = ({ version = {} }) => { | ||
const { vendor, vendorInvoiceNo, accountingCode } = version; | ||
|
||
return ( | ||
<Row> | ||
<Col xs={3}> | ||
<VersionKeyValue | ||
name="vendorInvoiceNo" | ||
label={<FormattedMessage id="ui-invoice.invoice.details.vendor.vendorInvoiceNo" />} | ||
value={vendorInvoiceNo} | ||
/> | ||
</Col> | ||
<Col xs={3}> | ||
<VersionKeyValue | ||
name="vendorId" | ||
label={<FormattedMessage id="ui-invoice.invoice.details.vendor.name" />} | ||
value={vendor} | ||
/> | ||
</Col> | ||
<Col xs={3}> | ||
<VersionKeyValue | ||
name="accountingCode" | ||
label={<FormattedMessage id="ui-invoice.invoice.accountingCode" />} | ||
value={accountingCode} | ||
/> | ||
</Col> | ||
</Row> | ||
); | ||
}; | ||
|
||
VersionHistoryViewVendorDetails.propTypes = { | ||
version: PropTypes.object.isRequired, | ||
}; |
1 change: 1 addition & 0 deletions
1
...History/InvoiceVersionHistory/VersionHistoryView/VersionHistoryViewVendorDetails/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { VersionHistoryViewVendorDetails } from './VersionHistoryViewVendorDetails'; |