Skip to content

Commit

Permalink
Merge branch 'develop' into fix/6782-support-phone-dev-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jessy-p authored Dec 14, 2023
2 parents ff33502 + 7a7a05e commit 546d117
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 86 deletions.
4 changes: 4 additions & 0 deletions changelog/add-7591-missing-columns-export-csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Introduce Customer currency, Deposit currency, Amount in Customer Currency and Deposit ID columns to the Transaction list UI and CSV export
4 changes: 4 additions & 0 deletions changelog/cleanup-redundant-script-enqueueing
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: dev

Cleanup enqueueing of the scripts which were removed
76 changes: 71 additions & 5 deletions client/transactions/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ const getColumns = (
},
{
key: 'date',
label: __( 'Date / Time', 'woocommerce-payments' ),
screenReaderLabel: __( 'Date and time', 'woocommerce-payments' ),
label: __( 'Date / Time (UTC)', 'woocommerce-payments' ),
screenReaderLabel: __(
'Date and time in UTC',
'woocommerce-payments'
),
required: true,
isLeftAligned: true,
defaultOrder: 'desc',
Expand All @@ -167,10 +170,41 @@ const getColumns = (
required: true,
isLeftAligned: true,
},
{
key: 'customer_currency',
label: __( 'Paid Currency', 'woocommerce-payments' ),
screenReaderLabel: __(
'Customer Currency',
'woocommerce-payments'
),
isSortable: true,
visible: false,
},
{
key: 'customer_amount',
label: __( 'Amount Paid', 'woocommerce-payments' ),
screenReaderLabel: __(
'Amount in Customer Currency',
'woocommerce-payments'
),
isNumeric: true,
isSortable: true,
visible: false,
},
{
key: 'deposit_currency',
label: __( 'Deposit Currency', 'woocommerce-payments' ),
screenReaderLabel: __( 'Deposit Currency', 'woocommerce-payments' ),
isSortable: true,
visible: false,
},
{
key: 'amount',
label: __( 'Amount', 'woocommerce-payments' ),
screenReaderLabel: __( 'Amount', 'woocommerce-payments' ),
screenReaderLabel: __(
'Amount in Deposit Curency',
'woocommerce-payments'
),
isNumeric: true,
isSortable: true,
},
Expand Down Expand Up @@ -205,8 +239,8 @@ const getColumns = (
},
{
key: 'source',
label: __( 'Source', 'woocommerce-payments' ),
screenReaderLabel: __( 'Source', 'woocommerce-payments' ),
label: __( 'Payment Method', 'woocommerce-payments' ),
screenReaderLabel: __( 'Payment Method', 'woocommerce-payments' ),
cellClassName: 'is-center-aligned',
},
{
Expand Down Expand Up @@ -236,6 +270,14 @@ const getColumns = (
visible: false,
isLeftAligned: true,
},
includeDeposit && {
key: 'deposit_id',
label: __( 'Deposit ID', 'woocommerce-payments' ),
screenReaderLabel: __( 'Deposit ID', 'woocommerce-payments' ),
cellClassName: 'deposit',
isLeftAligned: true,
visible: false,
},
includeDeposit && {
key: 'deposit',
label: __( 'Deposit date', 'woocommerce-payments' ),
Expand Down Expand Up @@ -371,6 +413,17 @@ export const TransactionsList = (
),
};
};
const formatCustomerAmount = () => {
return {
value: formatExportAmount(
txn.customer_amount,
txn.customer_currency
),
display: clickable(
formatCurrency( txn.customer_amount, txn.customer_currency )
),
};
};

const isFinancingType =
-1 !==
Expand Down Expand Up @@ -464,6 +517,15 @@ export const TransactionsList = (
value: txn.customer_country,
display: clickable( txn.customer_country ),
},
customer_currency: {
value: txn.customer_currency.toUpperCase(),
display: clickable( txn.customer_currency.toUpperCase() ),
},
customer_amount: formatCustomerAmount(),
deposit_currency: {
value: txn.currency.toUpperCase(),
display: clickable( txn.currency.toUpperCase() ),
},
amount: formatAmount(),
// fees should display as negative. The format $-9.99 is determined by WC-Admin
fees: formatFees(),
Expand All @@ -477,6 +539,10 @@ export const TransactionsList = (
value: calculateRiskMapping( txn.risk_level ),
display: clickable( riskLevel ),
},
deposit_id: {
value: txn.deposit_id,
display: txn.deposit_id,
},
deposit: { value: txn.available_on, display: deposit },
deposit_status: {
value: depositStatus,
Expand Down
Loading

0 comments on commit 546d117

Please sign in to comment.