Jump to content

how to change the client detail home page "Due Invoices"


LemonBarley

Recommended Posts

hi, in the client details home page, (the page after logging in as client),

 

there is a "Due Invoices" and it shows all the due invoice only. is there a way to change the "Due Invoices" to "Invoices".

 

Basically it shows all the invoices the client has instead of only the due invoice.

 

and with the status "Paid" or "Unpaid" (the status table is already there). And maybe limiting the invoices to 5 or 10?

Link to comment
Share on other sites

Open the clientareahome.tpl in your template files and change the following:

 

<p align="left"><img src="images/supporttickets.gif" border="0" hspace="5" align="absmiddle" alt="" /> <strong>{$stats.numactivetickets} {$LANG.supportticketsopentickets}</strong> (<a href="submitticket.php">{$LANG.supportticketssubmitticket}</a>)</p>
<div align="center">
<table align="center" style="width:100%" class="clientareatable" cellspacing="1">
<tr class="clientareatableheading"><td>{$LANG.supportticketsdate}</td><td>{$LANG.supportticketssubject}</td><td>{$LANG.supportticketsstatus}</td><td>{$LANG.supportticketsticketurgency}</td></tr>
{foreach key=num item=ticket from=$tickets}
<tr class="clientareatableactive"><td>{$ticket.date}</td><td><div align="left"><img src="images/article.gif" hspace="5" align="middle" alt="" /><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}">{if $ticket.unread}<strong>{/if}#{$ticket.tid} - {$ticket.subject}{if $ticket.unread}</strong>{/if}</a></div></td><td width="120">{$ticket.status}</td><td width="80">{$ticket.urgency}</td></tr>
{foreachelse}
<tr class="clientareatableactive"><td colspan="4">{$LANG.norecordsfound}</td></tr>
{/foreach}
</table>
</div>
<br />

 

Change to:

 

<div align="center">
<table class="clientareatable" cellspacing="1">
<tr class="clientareatableheading">
<td>{$LANG.invoicestitle}</td><td>{$LANG.invoicesdatecreated}</td><td>{$LANG.invoicesdatedue}</td><td>{$LANG.invoicestotal}</td><td>{$LANG.invoicesstatus}</td><td></td></tr>
{foreach key=num item=invoice from=$invoices}
<tr class="clientareatableactive"><td>{$invoice.invoicenum}</td><td>{$invoice.datecreated}</td><td>{$invoice.datedue}</td><td>{$currencysymbol}{$invoice.total} {$currency}</td><td>{$invoice.status}</td><td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td></tr>
{foreachelse}
<tr class="clientareatableactive"><td colspan=6>{$LANG.norecordsfound}</td></tr>
{/foreach}
</table>
</div>
<br />

 

I believe that will get you out of trouble.

 

Someone please correct me if I am wrong.

 

Cheers,

 

Dale

Link to comment
Share on other sites

i think you have misunderstand what my question is..

 

i was intending to change the "due invoice" to "invoices"

 

it basically shows all the invoice that the client has.

 

from your changes, i have no idea why do you want to change support ticket table to due invoice table. the code you given, is still used for the due invoice.. :(

Link to comment
Share on other sites

from clientareainvoice.tpl

<table class="clientareatable" cellspacing="1">
<tr class="clientareatableheading">
<td>{$LANG.invoicestitle}</td><td>{$LANG.invoicesdatecreated}</td><td>{$LANG.invoicesdatedue}</td><td>{$LANG.invoicestotal}</td><td>{$LANG.invoicesstatus}</td><td></td></tr>
{foreach key=num item=invoice from=$invoices}
<tr class="clientareatableactive"><td>{$invoice.invoicenum}</td><td>{$invoice.datecreated}</td><td>{$invoice.datedue}</td><td>{$currencysymbol}{$invoice.total} {$currency}</td><td>{$invoice.status}</td><td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td></tr>
{foreachelse}
<tr class="clientareatableactive"><td colspan=6>{$LANG.invoicesnoinvoices}</td></tr>
{/foreach}
</table>

 

now my problem is, how to limit it....

Link to comment
Share on other sites

hi othellotech

 

if i am able to give you this code which shows the soon to expire domain, can you please help me to change it to show the invoices?

 

{php}

$display_domain=0;

$result = mysql_query("SELECT * FROM tbldomains WHERE userid = ".$_SESSION['uid']." AND status = 'Active' LIMIT 1");

while($data = mysql_fetch_array($result))

{

$display_domain=1;

}

 

if($display_domain){

{/php}

 

 

<p><strong>Upcoming Domain Renewals</strong></p>

<table align="center" style="width:90%" class="clientareatable" cellspacing="1">

<tr class="clientareatableheading"><td>Domain</td><td>Expiration Date</td><td></td></tr>

 

{php}

$i=1;

$range = "<= 30";

$result = mysql_query("SELECT * FROM tbldomains WHERE userid='".$_SESSION['uid']."' AND DATEDIFF(expirydate, NOW()) ".$range." AND status='Active' ORDER BY `expirydate` ASC ");

while($data = mysql_fetch_array($result))

{

echo '<tr class="clientareatableactive"><td>'.$data['domain'].'</td><td>'.$data['expirydate'].'</td><td><form method="post" action="clientarea.php?action=domainrenew"><input name="domainid" value="'.$data['id'].'" type="hidden"><input value="Renew Domain" class="button" type="submit"></form></td></tr>';

$i=0;

}

 

if($i)echo '<tr class="clientareatableactive"><td colspan="2">No upcoming domain renewals</td><td><a href="clientarea.php?action=domains">View Domains</a></td></tr>';

{/php}

</table>

{php}

}

 

{/php}

Link to comment
Share on other sites

  • 2 weeks later...

For anyone else wanting to list all invoices in the clientareahome page replace the due invoices table with this one

<p class="heading2">{$LANG.invoices}</p>
<br />
<table class="clientareatable" cellspacing="1">
<tr class="clientareatableheading">
<td>{$LANG.invoicestitle}</td><td>{$LANG.invoicesdatecreated}</td><td>{$LANG.invoicesdatedue}</td><td>{$LANG.invoicestotal}</td><td>{$LANG.invoicesstatus}</td><td></td></tr>
{php}
$ii=1;
$result = mysql_query("SELECT * FROM tblinvoices WHERE userid='".$_SESSION['uid']."' ORDER BY `date` DESC");
while($data = mysql_fetch_array($result))
{
   echo '<tr class="clientareatableactive"><td>'.$data['id'].'</td><td>'.fromMySQLDate($data['date']).'</td><td>'.fromMySQLDate($data['duedate']).'</td><td>';{/php}{$currencysymbol}{php} echo $data['total'] .' ';{/php}{$currency}{php} echo '</td><td>'.$data['status'].'</td><td><a href="viewinvoice.php?id='.$data['id'].'" target="_blank">';{/php}{$LANG.invoicesview}{php} echo '</a></td></tr>';
   $ii=0;
}
if ($ii) {
   echo '<tr class="clientareatableactive"><td colspan=6>';{/php}{$LANG.norecordsfound}{php} echo '</td></tr>';
}
{/php}
</table>

Link to comment
Share on other sites

  • 1 year later...
For anyone else wanting to list all invoices in the clientareahome page replace the due invoices table with this one

 

Is there a way to order / sort by the invoice id in clientareainvoice.tpl ?

 

I saw that most of invoices are ...random in there.

 

With sparky's code you can play with SQL's order by (date/id/whatever).

 

Is there something similar for smarty to change this:

 {foreach key=num item=invoice from=$invoices}
 <tr>
   <td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$invoice.invoicenum}</a></td>
   <td>{$invoice.datecreated}</td>
   <td>{$invoice.datedue}</td>
   <td>{$invoice.total}</td>
   <td>{$invoice.status}</td>
   <td><a href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td>
 </tr>
 {foreachelse}
 <tr>
   <td colspan="6">{$LANG.norecordsfound}</td>
 </tr>
 {/foreach}

 

and make it output the invoices in a right order ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated