[-] BO : Credit slips now appear in document section
This commit is contained in:
@@ -10,30 +10,34 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$order->getDocuments() item=document}
|
{foreach from=$order->getDocuments() item=document}
|
||||||
{*if TYPE DOCUMENT = INVOICE *}
|
|
||||||
<tr class="invoice_line" id="invoice_{$document->id}">
|
{if get_class($document) eq 'OrderInvoice'}
|
||||||
{*/if*}
|
<tr class="invoice_line" id="invoice_{$document->id}">
|
||||||
|
{elseif get_class($document) eq 'OrderSlip'}
|
||||||
|
<tr class="invoice_line" id="orderslip_{$document->id}">
|
||||||
|
{/if}
|
||||||
|
|
||||||
<td class="document_date">{dateFormat date=$document->date_add}</td>
|
<td class="document_date">{dateFormat date=$document->date_add}</td>
|
||||||
<td class="document_type">Invoice</td>
|
<td class="document_type">{if get_class($document) eq 'OrderInvoice'}Invoice{elseif get_class($document) eq 'OrderSlip'}Credit Slip{/if}</td>
|
||||||
<td class="document_number"><a target="_blank" href="pdf.php?pdf&id_order_invoice={$document->id}">{$document->getInvoiceNumberFormatted($current_id_lang)} <img src="../img/admin/details.gif" alt="{l s='See the invoice'}" /></a></td>
|
<td class="document_number"><a target="_blank" href="{if get_class($document) eq 'OrderInvoice'}pdf.php?pdf&id_order_invoice={$document->id}{elseif get_class($document) eq 'OrderSlip'}pdf.php?id_order_slip={$document->id}{/if}">{if get_class($document) eq 'OrderInvoice'}{$document->getInvoiceNumberFormatted($current_id_lang)}{elseif get_class($document) eq 'OrderSlip'}{l s='#'}{'%06d'|sprintf:$document->id}{/if} <img src="../img/admin/details.gif" alt="{l s='See the invoice'}" /></a></td>
|
||||||
<td class="document_amount">
|
<td class="document_amount">
|
||||||
{*if TYPE DOCUMENT = INVOICE *}
|
{if get_class($document) eq 'OrderInvoice'}
|
||||||
{displayPrice price=$document->total_paid_tax_incl currency=$currency->id}
|
{displayPrice price=$document->total_paid_tax_incl currency=$currency->id}
|
||||||
{if $document->getRestPaid()}
|
{if $document->getRestPaid()}
|
||||||
<span style="color:red;font-weight:bold;">({displayPrice price=$document->getRestPaid() currency=$currency->id} {l s='not paid'})</span>
|
<span style="color:red;font-weight:bold;">({displayPrice price=$document->getRestPaid() currency=$currency->id} {l s='not paid'})</span>
|
||||||
{/if}
|
{/if}
|
||||||
{*/if*}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td class="right document_action">
|
<td class="right document_action">
|
||||||
{*if TYPE DOCUMENT = INVOICE *}
|
{if get_class($document) eq 'OrderInvoice'}
|
||||||
{if $document->getRestPaid()}
|
{if $document->getRestPaid()}
|
||||||
<a href="#" class="js-set-payment" data-amount="{$document->getRestPaid()}" data-id-invoice="{$document->id}" title="{l s='Set payment form'}"><img src="../img/admin/money_add.png" alt="{l s='Set payment form'}" /></a>
|
<a href="#" class="js-set-payment" data-amount="{$document->getRestPaid()}" data-id-invoice="{$document->id}" title="{l s='Set payment form'}"><img src="../img/admin/money_add.png" alt="{l s='Set payment form'}" /></a>
|
||||||
{/if}
|
{/if}
|
||||||
<a href="#" onclick="$('#invoiceNote{$document->id}').show(); return false;" title="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}"><img src="../img/admin/note.png" alt="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}"{if $document->note eq ''} class="js-disabled-action"{/if} /></a>
|
<a href="#" onclick="$('#invoiceNote{$document->id}').show(); return false;" title="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}"><img src="../img/admin/note.png" alt="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}"{if $document->note eq ''} class="js-disabled-action"{/if} /></a>
|
||||||
{*/if*}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{*if TYPE DOCUMENT = INVOICE *}
|
{if get_class($document) eq 'OrderInvoice'}
|
||||||
<tr id="invoiceNote{$document->id}" style="display:none" class="current-edit">
|
<tr id="invoiceNote{$document->id}" style="display:none" class="current-edit">
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
<form action="{$currentIndex}&viewOrder&id_order={$smarty.get.id_order|escape:'htmlall':'UTF-8'}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}" method="post">
|
<form action="{$currentIndex}&viewOrder&id_order={$smarty.get.id_order|escape:'htmlall':'UTF-8'}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}" method="post">
|
||||||
@@ -49,7 +53,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{*/if*}
|
{/if}
|
||||||
{foreachelse}
|
{foreachelse}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5" class="center">
|
<td colspan="5" class="center">
|
||||||
@@ -59,4 +63,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -692,18 +692,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="float: left; margin-left: 40px">
|
|
||||||
<fieldset style="width: 400px;">
|
|
||||||
<legend><img src="../img/admin/slip.gif" alt="{l s='Credit slip'}" />{l s='Credit slip'}</legend>
|
|
||||||
{if (!sizeof($slips))}
|
|
||||||
{l s='No slip for this order.'}
|
|
||||||
{else}
|
|
||||||
{foreach from=$slips item=slip}
|
|
||||||
({dateFormat date=$slip['date_upd']}) : <b><a href="pdf.php?id_order_slip={$slip['id_order_slip']}">{l s='#'}{'%06d'|sprintf:$slip['id_order_slip']}</a></b><br />
|
|
||||||
{/foreach}
|
|
||||||
{/if}
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
<div class="clear"> </div>
|
<div class="clear"> </div>
|
||||||
<br /><br /><a href="{$currentIndex}&token={$smarty.get.token}"><img src="../img/admin/arrow2.gif" /> {l s='Back to list'}</a><br />
|
<br /><br /><a href="{$currentIndex}&token={$smarty.get.token}"><img src="../img/admin/arrow2.gif" /> {l s='Back to list'}</a><br />
|
||||||
|
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
|
|||||||
*/
|
*/
|
||||||
public function getResults()
|
public function getResults()
|
||||||
{
|
{
|
||||||
|
$this->getAll();
|
||||||
return $this->results;
|
return $this->results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,4 +458,4 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
|
|||||||
$this->alias[$association] = 'a'.$this->alias_iterator++;
|
$this->alias[$association] = 'a'.$this->alias_iterator++;
|
||||||
return $this->alias[$association];
|
return $this->alias[$association];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-3
@@ -1394,10 +1394,18 @@ class OrderCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public function getDocuments()
|
public function getDocuments()
|
||||||
{
|
{
|
||||||
// TODO
|
$invoices = $this->getInvoicesCollection()->getResults();
|
||||||
$invoices = $this->getInvoicesCollection();
|
$order_slips = $this->getOrderSlipsCollection()->getResults();
|
||||||
|
$documents = array_merge($invoices, $order_slips);
|
||||||
|
function sortDocuments($a, $b)
|
||||||
|
{
|
||||||
|
if ($a->date_add == $b->date_add)
|
||||||
|
return 0;
|
||||||
|
return ($a->date_add < $b->date_add) ? -1 : 1;
|
||||||
|
}
|
||||||
|
usort($documents, "sortDocuments");
|
||||||
|
|
||||||
return $invoices;
|
return $documents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReturn()
|
public function getReturn()
|
||||||
@@ -1424,6 +1432,21 @@ class OrderCore extends ObjectModel
|
|||||||
WHERE o.`id_order` = '.(int)$this->id);
|
WHERE o.`id_order` = '.(int)$this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get all order_slips for the current order
|
||||||
|
* @since 1.5.0.1
|
||||||
|
* @return Collection of Order slip
|
||||||
|
*/
|
||||||
|
public function getOrderSlipsCollection()
|
||||||
|
{
|
||||||
|
$order_slips = new Collection('OrderSlip');
|
||||||
|
$order_slips->where('id_order', '=', $this->id);
|
||||||
|
return $order_slips;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Get all invoices for the current order
|
* Get all invoices for the current order
|
||||||
|
|||||||
@@ -1026,7 +1026,6 @@ class AdminOrdersControllerCore extends AdminController
|
|||||||
'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), // Get the sum of total_paid_tax_incl of the order with similar reference
|
'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), // Get the sum of total_paid_tax_incl of the order with similar reference
|
||||||
'total_paid' => $order->getTotalPaid(),
|
'total_paid' => $order->getTotalPaid(),
|
||||||
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
||||||
'slips' => OrderSlip::getOrdersSlip($order->id_customer, $order->id),
|
|
||||||
'orderMessages' => OrderMessage::getOrderMessages($order->id_lang),
|
'orderMessages' => OrderMessage::getOrderMessages($order->id_lang),
|
||||||
'messages' => Message::getMessagesByOrderId($order->id, true),
|
'messages' => Message::getMessagesByOrderId($order->id, true),
|
||||||
'carrier' => new Carrier($order->id_carrier),
|
'carrier' => new Carrier($order->id_carrier),
|
||||||
|
|||||||
Reference in New Issue
Block a user