Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions css/commerce_pos_style.css

Large diffs are not rendered by default.

21 changes: 1 addition & 20 deletions css/commerce_pos_style.css.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions modules/report/css/commerce_pos_report.css
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,11 @@ a:hover .commerce-pos-report-ico-journal-role {
border-bottom: 2px solid #ddd;
padding-top: 5px;
}

#commerce-pos-report-journal-role-container table tbody td .commerce-pos-report-order-details-payments table tr td.payment-no-total span {
text-decoration: line-through;
}

#commerce-pos-report-journal-role-container table tbody td .commerce-pos-report-order-details-payments table tr td.payment-no-total span.commerce-pos-receipt-void-message {
text-decoration: none;
}
7 changes: 5 additions & 2 deletions modules/report/includes/commerce_pos_report.pages.inc
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,11 @@ function commerce_pos_report_get_totals($date_filter, $register_id) {
CommercePosService::TRANSACTION_TYPE_RETURN => 0,
);
}
$method = &$totals[$row->commerce_order_total_currency_code][$row->payment_method];
$method[$row->type] += $row->amount;

if ($row->status == COMMERCE_PAYMENT_STATUS_SUCCESS) {
$method = &$totals[$row->commerce_order_total_currency_code][$row->payment_method];
$method[$row->type] += $row->amount;
}

if (in_array($row->status, $visible_statuses)) {
if (!isset($transaction_counts[$row->payment_method])) {
Expand Down
8 changes: 8 additions & 0 deletions sass/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
background: #f0f0f0;
}

table.commerce-pos-sidebar-table tr td.payment-no-total span {
text-decoration: line-through;
}

table.commerce-pos-sidebar-table tr td.payment-no-total span.commerce-pos-receipt-void-message {
text-decoration: none;
}

table.commerce-pos-sidebar-table {
width: 100%;
font-size: 14px;
Expand Down
21 changes: 17 additions & 4 deletions theme/commerce_pos.theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,26 @@ function theme_commerce_pos_order_balance_summary(&$variables) {
foreach ($transactions as $transaction) {
$payment_method = commerce_payment_method_load($transaction->payment_method);
$status = $transaction->status;
$payment_method_classes = array('payment-method');
$payment_method_title = '<span>' . $payment_method['title'] . '</span>';
$amount_classes = array('amount');

// If there is no total, append the status and add the payment-no-total classes.
$status_array = commerce_payment_transaction_status_load($transaction->status);
if (!$status_array['total']) {
$payment_method_title .= '&nbsp;-&nbsp;<span class="commerce-pos-receipt-void-message">' . $status_array['title'] . '</span>';
$payment_method_classes[] = 'payment-no-total';
$amount_classes[] = 'payment-no-total';
}

$currency_code = $transaction->currency_code;
$amount = $transaction->amount;

$row = array(
'data' => array(
array(
'data' => $payment_method['title'],
'class' => array('payment-method'),
'data' => $payment_method_title,
'class' => $payment_method_classes,
),
),
);
Expand All @@ -165,9 +177,10 @@ function theme_commerce_pos_order_balance_summary(&$variables) {
);
}

$amount_title = '<span>' . commerce_currency_format($amount, $currency_code) . '</span>';
$row['data'][] = array(
'data' => commerce_currency_format($amount, $currency_code),
'class' => array('amount'),
'data' => $amount_title,
'class' => $amount_classes,
);

$rows[] = $row;
Expand Down