Thank you for pointing me in the right direct Nicolas!
Attached is a zip archive of the files I edited and a readme.txt file that shows where they go in the filesystem. All edits are wrapped in comments. I am sure it can be improved upon (specifically the automation of the currency code when entering payments). Very limited testing was done on a shared hosting environment with apache server running PHP 5.3 with IE 8, Chrome 33 and Firefox 26. (that means I tried it once in each browser and it worked).
Summary of Edits:
Corrected the name attribute on the checkbox added to edit_additional.php. (code in previous post)
Added the following code to order.php around line 657:
if(!empty($data['history']['store_pmt'])) {
if(isset($data['history']['amount'])){
$order->history->history_amount = $data['history']['amount'];
$order->history->history_type = 'payment';
}
else{
$order->history->history_amount = @$data['history']['history_amount'];
$order->history->history_type = 'payment';
}
}
Added the following line to en-GB.com_hikashop,ini around line 1816:
SET_HISTORY_PMT_AMT="Set payment amount (Format: '1.00USD')"
Added the following two code snippets to the front end order template 'show.php' under Display->Views to display payments made to users when they log in and view the order:
<tr>
<td colspan='<?php echo $colspan;?>'>
</td>
<td class='hikashop_order_total_title key'>
<label>Payments</label>
</td>
<td class='hikashop_order_total_value' >
<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('history_amount', 'history_data','history_created')));
$query->from($db->quoteName('#__hikashop_history'));
$conditions = array(
$db->quoteName('history_order_id') . '=\'' . $this->element->order_id . '\'',
$db->quoteName('history_type') . '=\'payment\''
);
$query->where($conditions);
$db->setQuery($query);
$db->setQuery($query);
$row = $db->loadRowList();
$numRows = count($row);
$i=0;
$myTotalPmts = 0;
while ($i<$numRows){
preg_match('/[A-Za-z]/', $row[$i][0], $matches, PREG_OFFSET_CAPTURE);
$myPayAmt = substr($row[$i][0],0,$matches[0][1]);
$myTotalPmts = $myTotalPmts + $myPayAmt;
$i++;
}
setlocale(LC_MONETARY, 'en_US');
echo money_format('%n',$myTotalPmts);
?>
</td>
</tr>
<?php
$myTotal = substr($this->order->order_full_price,0,-1);
$myDueAmt = $myTotal - $myTotalPmts;
?>
<tr>
<td colspan='<?php echo $colspan;?>'>
</td>
<td class='hikashop_order_total_title key'>
<label>Total Due</label>
</td>
<td class='hikashop_order_total_value' >
<?php echo money_format('%n', $myDueAmt);?>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>Payment Information</legend>
<table cellpadding="1" width="100%">
<thead>
<tr>
<th style="text-align:left;">Date</th>
<th style="text-align:left;">Amount</th>
<th style="text-align:left;">Details</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
while ($i<$numRows){
echo "<tr><td>";
echo date_format(date_create($row[i][2]), 'm-d-Y');
echo "</td><td>";
preg_match('/[A-Za-z]/', $row[$i][0], $matches, PREG_OFFSET_CAPTURE);
$myPayAmt = substr($row[$i][0],0,$matches[0][1]);
echo money_format('%n', $myPayAmt);
echo "</td><td>";
echo $row[$i][1];
echo "</td></tr>";
$i++;
}
?>
</tbody>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>Shipping Information</legend>
<table cellpadding="1" width="100%">
<thead>
<tr>
<th style="text-align:left;">Shipper</th>
<th style="text-align:left;">Tracking Number</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php echo $this->element->order_shipping_method;?>
</td>
<td>
<?php
switch ($this->element->order_shipping_method){
case 'usps':
echo "<a target='_blank' href='https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=" . $this->element->tracking_number . "'>" . $this->element->tracking_number . "</a>";
break;
case 'ups':
echo "<a target='_blank' href='http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=" . $this->element->tracking_number . "'>" . $this->element->tracking_number . "</a>";
break;
case 'fedex':
echo "<a target='_blank' href='http://www.fedex.com/Tracking?action=track&tracknumbers=" . $this->element->tracking_number . "'>" . $this->element->tracking_number . "</a>";
break;
}
?>
</td>
</tr>
</tbody>
</table>
</fieldset>
</td>
</tr>