Skip to content

Commit

Permalink
Merge pull request Qloapps#500 from abhishek-webkul/update-refund-states
Browse files Browse the repository at this point in the history
Improve order refund flow
  • Loading branch information
rohit053 authored Jan 20, 2023
2 parents 019e410 + 81f9563 commit 0f95722
Show file tree
Hide file tree
Showing 56 changed files with 870 additions and 786 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,64 @@
</form>
</div>
</div>
{if is_array($returns) && count($returns)}
<div class="panel">
<div class="panel-heading">
<i class="icon-undo"></i> {l s='Refunds'}
</div>
<table class="table table-striped">
<thead>
<tr>
<th class="text-left">{l s='Refund ID'}</th>
<th class="text-left">{l s='Status'}</th>
</tr>
</thead>
<tbody>
{foreach from=$returns item=return_info}
<tr>
<td class="text-left">
<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$return_info.id_order_return}" target="_blank">#{$return_info.id_order_return}</a>
</td>
<td class="text-left">
{capture name=refund_status}
{if isset($return_info.payment_mode) && $return_info.payment_mode != ''}{l s='Payment Mode: '}{$return_info.payment_mode}<br/>{/if}
{if isset($return_info.id_transaction) && $return_info.id_transaction != ''}{l s='Transaction ID: '}{$return_info.id_transaction}<br/>{/if}
{if isset($return_info.id_return_type) && isset($return_info.return_type) && $return_info.id_return_type && $return_info.return_type}
{if $return_info.return_type == OrderReturn::RETURN_TYPE_CART_RULE}
{l s='Voucher ID: '}
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$return_info.id_return_type}" target="_blank">
#{$return_info.id_return_type}
</a>
{elseif $return_info.return_type == OrderReturn::RETURN_TYPE_ORDER_SLIP}
{l s='Credit Slip ID: '}
#{$return_info.id_return_type}
<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$return_info.id_return_type}" title="#{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{$return_info.id_return_type|string_format:'%06d'}">
{l s='Download' mod='hotelreservationsystem'}
</a>
{/if}
<br/>
{/if}
{if isset($return_info.id_cart_rule) && $return_info.id_cart_rule}
{l s='Voucher ID: '}
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$return_info.id_cart_rule}" target="_blank">
#{$return_info.id_cart_rule}
</a>
<br/>
{/if}
{/capture}

{if $smarty.capture.refund_status|trim != ''}
{$smarty.capture.refund_status}
{else}
{$return_info.state_name}
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{hook h="displayAdminOrderRight" id_order=$order->id}
</div>
</div>
Expand All @@ -1034,7 +1092,7 @@
<input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" />
</div>

<div class="panel">
<div class="panel" id="refundForm">
<div class="panel-heading">
<i class="icon-shopping-cart"></i>
{l s='Rooms In This Order'} <span class="badge">{$order_detail_data|@count}</span>
Expand Down Expand Up @@ -1113,9 +1171,14 @@
</button>

{if $refund_allowed && !$hasCompletelyRefunded}
<button style="display: none;" type="submit" name="initiateRefund" class="btn btn-success standard_refund_fields pull-right" id="initiateRefund">
{if $order->hasBeenPaid()}<i class="icon-undo"></i> {l s='Initiate Refund'}{else}{l s='Cancel bookings'}{/if}
</button>
<div class="pull-right">
<button style="display: none;" type="button" class="btn btn-default standard_refund_fields" id="cancelRefund">
{l s='Cancel'}
</button>
<button style="display: none;" type="submit" name="initiateRefund" class="btn btn-success standard_refund_fields" id="initiateRefund">
{if $order->hasBeenPaid()}<i class="icon-undo"></i> {l s='Initiate Refund'}{else}{l s='Submit'}{/if}
</button>
</div>
{/if}
</div>
{/if}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}

<a class="btn btn-link" href="{$link->getAdminLink('AdminCartRules')|escape:'html':'UTF-8'}&updatecart_rule&id_cart_rule={$id_cart_rule}" target="_blank">
#{$id_cart_rule}
</a>
24 changes: 24 additions & 0 deletions admin/themes/default/template/controllers/slip/_redeem_status.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{**
* 2010-2022 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}

{if $redeem_status == OrderSlip::REDEEM_STATUS_REDEEMED}
<span class="badge badge-danger">{l s='Redeemed'}</span>
{else}
<span class="badge badge-success">{l s='Active'}</span>
{/if}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}

<a href="{$status_change_link|escape:'html':'UTF-8'}" title="{l s='Change Status'}">
<i class="icon-refresh"></i>
{l s='Change Status'}
</a>
Loading

0 comments on commit 0f95722

Please sign in to comment.