f863f2bc by Kevin Burton

some updates to invoice

1 parent 0d2e1302
......@@ -444,6 +444,10 @@ input.dp-applied {
#invoice-table tbody th { margin:0; padding:4px 2px 4px 10px; text-align: left; }
#invoice-table tbody td { margin:0; padding:4px 2px 4px 10px; text-align: left; border-right:1px solid #ccc; }
#invoice-table tbody tr.odd td { background-color: #f5f5f5; }
#invoice-table tbody tr.unpaid td { background-color: #efd5d5; color:#c17575; }
#invoice-table tbody tr.unpaid td a {color: #c17575;}
#invoice-table tbody tr.unpaid td a:hover {color: #CC4433;}
#invoice-table tfoot td { margin:0; padding:4px 2px 4px 10px; text-align: left; border-top:1px solid #ccc;border-right:1px solid #ccc; }
#invoice-table caption { text-align:left; font-size:11px; color:#777; padding-left:11px; text-transform: uppercase; }
......
......@@ -18,7 +18,7 @@ use WP_User;
<div style="position:absolute; width:200px; height:30px;right:20px; top:35px;text-align:right;font-size:16px;">Balance: <strong>$<?php echo get_user_meta($_GET['uid'],'balance',true);?></strong></div>
<h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Invoices...
<?php if (!isset($_GET['view'])):?>
<a href="#" class="button add-new-h2" id="creditNotBtn">Make Credit Note</a>
<a href="#" class="button add-new-h2" id="creditNotBtn">Creat new Invoice</a>
<?php endif; ?>
</h2>
......@@ -26,17 +26,19 @@ use WP_User;
<div style="border:1px solid #e8e8e8; background-color:#f5f5f5;padding:10px;">
<form id="creditForm" method="POST">
<input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>" />
<h3 style="margin:0;padding:0;">Credit Note:</h3>
<table width="100%">
<h3 style="margin:0;padding:0;">Invoice...</h3>
<table width="100%" style="margin-top:10px;">
<tbody>
<tr>
<td width="80">Credit for:</td>
<td width="130">Invoice Description</td>
<td><input type="text" name="title" style="width:400px" /></td>
<td width="130" style="text-align:right;padding-right:10px;">Credit Amount $</td>
</tr>
<tr>
<td width="130">Amount ($)</td>
<td><input type="text" name="amount" /></td>
</tr>
<tr>
<td colspan="4" style="padding-top:5px;"><input type="submit" value="Apply Credit Note" /></td>
<td colspan="4" style="padding-top:5px;"><input type="submit" value="Apply Invoice" /></td>
</tr>
</tbody>
</table>
......@@ -52,7 +54,7 @@ use WP_User;
$invoice->payment = get_post_meta($invoice->ID, 'payment',true);
$date = strtotime($invoice->post_date);
$date = date("F j Y",$date);
$date = date("F j, Y",$date);
if ( ($invoice->post_author !== Tools\getCurrentUser()->ID) AND !is_admin()) {
print "<div style='color:#DF1C24;font-weight:bold;'>YOU CAN ONLY VIEW YOUR OWN INVOICES.</div>";
......@@ -61,17 +63,19 @@ use WP_User;
$html = '<p><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid='.$_GET['uid'].'&section=payhistory">Show all invoices</a></p>';
$html .= '<p>
<img src="assets/images/logo.gif" width="114" height="92" /><br />
<strong>The Canadian Institute of Chartered Business Valuators</strong><br />
277 Wellington St. West, Suite 710<br />
Toronto, ON, Canada M5V 3H2
</p>';
//$html .= '<div style="text-align:right;margin-bottom:5px;"><a href="/invoices/?view='.$invoice->ID.'&pagename=invoice-preview" class="label label-black-print print-invoice-handler" target="_blank"></a></div>';
$html .= '<div style="border:1px solid #777;padding:20px;position:relative;" id="viewable-port">';
$html .= '
<p><img src="/wp-content/themes/cbv/assets/images/logo.gif" width="114" height="92" /></p>
<p><strong>The Canadian Institute of Chartered Business Valuators</strong><br />
277 Wellington St. West, Suite 710<br />
Toronto, ON, Canada M5V 3H2
</p>';
$status = get_post_meta($invoice->ID,'trans_status',true);
if ($status=="paid") {
$html .= '<div class="status-paid"></div>';
......