Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Feb 8, 2025
1 parent 7b10f16 commit b57a487
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick

- name: Install dependencies
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
- name: Get changed files (Payments)
id: changed-files-payments
uses: tj-actions/changed-files@v44
Expand All @@ -45,7 +34,7 @@ jobs:
src/Http/Controllers/Payments
tests/Feature/Payments
composer.json
.github/workflows/tests.yml
.github/workflows/tests.yaml
- name: Determine whether payment tests should run
id: should-run-payment-tests
Expand All @@ -54,6 +43,17 @@ jobs:
echo "result=true" >> $GITHUB_OUTPUT
echo "result=true" >> $env:GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick

- name: Install dependencies
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit --exclude-group=payments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div>{{ __('Grand Total') }}</div>
<div>{{ receipt.totals.grand_total }}</div>
</div>
<div class="receipt-total">
<div v-if="receipt.refund.issued" class="receipt-total">
<div>{{ __('Refund') }}</div>
<div>-{{ receipt.totals.amount_refunded }}</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/Fieldtypes/OrderReceiptFieldtype.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public function preProcess($data)
'amount' => Money::format($tax['amount'], Site::selected()),
])->all(),
] : null,
'refund' => [
'issued' => $order->get('amount_refunded', 0) > 0,
],
'totals' => [
'sub_total' => Money::format($order->subTotal(), Site::selected()),
'discount_total' => Money::format($order->discountTotal(), Site::selected()),
Expand Down

0 comments on commit b57a487

Please sign in to comment.