f863f2bc by Kevin Burton

some updates to invoice

1 parent 0d2e1302
...@@ -444,6 +444,10 @@ input.dp-applied { ...@@ -444,6 +444,10 @@ input.dp-applied {
444 #invoice-table tbody th { margin:0; padding:4px 2px 4px 10px; text-align: left; } 444 #invoice-table tbody th { margin:0; padding:4px 2px 4px 10px; text-align: left; }
445 #invoice-table tbody td { margin:0; padding:4px 2px 4px 10px; text-align: left; border-right:1px solid #ccc; } 445 #invoice-table tbody td { margin:0; padding:4px 2px 4px 10px; text-align: left; border-right:1px solid #ccc; }
446 #invoice-table tbody tr.odd td { background-color: #f5f5f5; } 446 #invoice-table tbody tr.odd td { background-color: #f5f5f5; }
447
448 #invoice-table tbody tr.unpaid td { background-color: #efd5d5; color:#c17575; }
449 #invoice-table tbody tr.unpaid td a {color: #c17575;}
450 #invoice-table tbody tr.unpaid td a:hover {color: #CC4433;}
447 #invoice-table tfoot td { margin:0; padding:4px 2px 4px 10px; text-align: left; border-top:1px solid #ccc;border-right:1px solid #ccc; } 451 #invoice-table tfoot td { margin:0; padding:4px 2px 4px 10px; text-align: left; border-top:1px solid #ccc;border-right:1px solid #ccc; }
448 #invoice-table caption { text-align:left; font-size:11px; color:#777; padding-left:11px; text-transform: uppercase; } 452 #invoice-table caption { text-align:left; font-size:11px; color:#777; padding-left:11px; text-transform: uppercase; }
449 453
......
...@@ -18,7 +18,7 @@ use WP_User; ...@@ -18,7 +18,7 @@ use WP_User;
18 <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> 18 <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>
19 <h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Invoices... 19 <h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Invoices...
20 <?php if (!isset($_GET['view'])):?> 20 <?php if (!isset($_GET['view'])):?>
21 <a href="#" class="button add-new-h2" id="creditNotBtn">Make Credit Note</a> 21 <a href="#" class="button add-new-h2" id="creditNotBtn">Creat new Invoice</a>
22 <?php endif; ?> 22 <?php endif; ?>
23 </h2> 23 </h2>
24 24
...@@ -26,17 +26,19 @@ use WP_User; ...@@ -26,17 +26,19 @@ use WP_User;
26 <div style="border:1px solid #e8e8e8; background-color:#f5f5f5;padding:10px;"> 26 <div style="border:1px solid #e8e8e8; background-color:#f5f5f5;padding:10px;">
27 <form id="creditForm" method="POST"> 27 <form id="creditForm" method="POST">
28 <input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>" /> 28 <input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>" />
29 <h3 style="margin:0;padding:0;">Credit Note:</h3> 29 <h3 style="margin:0;padding:0;">Invoice...</h3>
30 <table width="100%"> 30 <table width="100%" style="margin-top:10px;">
31 <tbody> 31 <tbody>
32 <tr> 32 <tr>
33 <td width="80">Credit for:</td> 33 <td width="130">Invoice Description</td>
34 <td><input type="text" name="title" style="width:400px" /></td> 34 <td><input type="text" name="title" style="width:400px" /></td>
35 <td width="130" style="text-align:right;padding-right:10px;">Credit Amount $</td> 35 </tr>
36 <tr>
37 <td width="130">Amount ($)</td>
36 <td><input type="text" name="amount" /></td> 38 <td><input type="text" name="amount" /></td>
37 </tr> 39 </tr>
38 <tr> 40 <tr>
39 <td colspan="4" style="padding-top:5px;"><input type="submit" value="Apply Credit Note" /></td> 41 <td colspan="4" style="padding-top:5px;"><input type="submit" value="Apply Invoice" /></td>
40 </tr> 42 </tr>
41 </tbody> 43 </tbody>
42 </table> 44 </table>
...@@ -52,7 +54,7 @@ use WP_User; ...@@ -52,7 +54,7 @@ use WP_User;
52 $invoice->payment = get_post_meta($invoice->ID, 'payment',true); 54 $invoice->payment = get_post_meta($invoice->ID, 'payment',true);
53 55
54 $date = strtotime($invoice->post_date); 56 $date = strtotime($invoice->post_date);
55 $date = date("F j Y",$date); 57 $date = date("F j, Y",$date);
56 58
57 if ( ($invoice->post_author !== Tools\getCurrentUser()->ID) AND !is_admin()) { 59 if ( ($invoice->post_author !== Tools\getCurrentUser()->ID) AND !is_admin()) {
58 print "<div style='color:#DF1C24;font-weight:bold;'>YOU CAN ONLY VIEW YOUR OWN INVOICES.</div>"; 60 print "<div style='color:#DF1C24;font-weight:bold;'>YOU CAN ONLY VIEW YOUR OWN INVOICES.</div>";
...@@ -61,17 +63,19 @@ use WP_User; ...@@ -61,17 +63,19 @@ use WP_User;
61 63
62 $html = '<p><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid='.$_GET['uid'].'&section=payhistory">Show all invoices</a></p>'; 64 $html = '<p><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid='.$_GET['uid'].'&section=payhistory">Show all invoices</a></p>';
63 65
64 $html .= '<p> 66
65 <img src="assets/images/logo.gif" width="114" height="92" /><br />
66 <strong>The Canadian Institute of Chartered Business Valuators</strong><br />
67 277 Wellington St. West, Suite 710<br />
68 Toronto, ON, Canada M5V 3H2
69 </p>';
70 67
71 //$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>'; 68 //$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>';
72 69
73 $html .= '<div style="border:1px solid #777;padding:20px;position:relative;" id="viewable-port">'; 70 $html .= '<div style="border:1px solid #777;padding:20px;position:relative;" id="viewable-port">';
74 71
72 $html .= '
73 <p><img src="/wp-content/themes/cbv/assets/images/logo.gif" width="114" height="92" /></p>
74 <p><strong>The Canadian Institute of Chartered Business Valuators</strong><br />
75 277 Wellington St. West, Suite 710<br />
76 Toronto, ON, Canada M5V 3H2
77 </p>';
78
75 $status = get_post_meta($invoice->ID,'trans_status',true); 79 $status = get_post_meta($invoice->ID,'trans_status',true);
76 if ($status=="paid") { 80 if ($status=="paid") {
77 $html .= '<div class="status-paid"></div>'; 81 $html .= '<div class="status-paid"></div>';
......