Commit fd2de9ab authored by RobertPlummer's avatar RobertPlummer

[MOD] More invoice changes laying ground work for client contacts and clients ui

parent fc3e2136
......@@ -10,22 +10,43 @@
{assign var=TaxStatus value="Tax Status"}
{assign var=ClientNotes value="Client Notes"}
{assign var=TaxCode value="Tax Code"}
{assign var=ContactIds value="Contact Ids"}
{assign var=ContactFirstNames value="Contact First Names"}
{assign var=ContactLastNames value="Contact Last Names"}
{assign var=ContactEmails value="Contact Emails"}
{assign var=ContactTitles value="Contact Titles"}
{foreach from=$Clients item=Client}
<div>
<h3 class='ClientName'>{$Client.Name}</h3>
<div class='ClientDetails' style='display: none;'>
<table>
<table style='width: 100%;'>
<tr>
<td>
<td style='width: 50%;'>
{if $Client.$Address1}{$Client.$Address1}<br />{/if}
{if $Client.$Address2}{$Client.$Address2}<br />{/if}
{if $Client.City && $Client.Province && $Client.$PostalCode}{$Client.City} {$Client.Province}, {$Client.$PostalCode}<br />{/if}
{if $Client.Website}<a href='{$Client.Website}'>{$Client.Website}</a><br />{/if}
{tr}Tax Status:{/tr} {if $Client.$TaxStatus eq 'y'}{tr}Taxable{/tr}{else}Not Taxable{/if}<br />
</td>
<td>
{button href="tiki-invoice_edit_client_contact.php?contact=$contactId" _text="{tr}View{/tr}"}
{button href="tiki-invoice_edit_client_contact.php?contact=$contactId" _text="{tr}Edit{/tr}"}
{button href="tiki-invoice_edit_client_contact.php?contact=$contactId" _text="{tr}Delete{/tr}"}
</td>
<td style='width: 50%;'>
{button href="tiki-invoice_edit_client_contact.php" _text="{tr}New Contact{/tr}"}<br />
{foreach from=$Client.$ContactIds key=k item=contactId}
{if $contactId}
{$Client.$ContactTitles[$k]} {$Client.$ContactFirstNames[$k]} {$Client.$ContactLastNames[$k]}<br />
{$Client.$ContactEmails[$k]}
<br />
{button href="tiki-invoice_edit_client_contact.php?contact=$contactId" _text="{tr}View{/tr}"}
{button href="tiki-invoice_edit_client_contact.php?contact=$contactId" _text="{tr}Edit{/tr}"}
{button href="tiki-invoice_edit_client_contact.php?contact=$contactId" _text="{tr}Delete{/tr}"}
<hr />
{/if}
{/foreach}
</td>
</tr>
</table>
......
......@@ -11,9 +11,7 @@ $access->check_feature('feature_invoice');
$access->check_permission('tiki_p_admin');
//check if profile is created
$installer = new Tiki_Profile_Installer();
$profile = Tiki_Profile::fromNames( "profiles.tiki.org", "Invoice" );
if (!$installer->isInstalled( $profile )) {
if ($trklib->get_tracker_by_name("Invoice Items") < 1) {
$smarty->assign('msg', tra('You need to apply the "Invoice" profile'));
$smarty->display("error.tpl");
die;
......
......@@ -2,6 +2,7 @@
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerlib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
......@@ -10,9 +11,7 @@ $access->check_feature('feature_invoice');
$access->check_permission('tiki_p_admin');
//check if profile is created
$installer = new Tiki_Profile_Installer();
$profile = Tiki_Profile::fromNames( "profiles.tiki.org","Invoice" );
if (!$installer->isInstalled( $profile )) {
if ($trklib->get_tracker_by_name("Invoice Items") < 1) {
$smarty->assign('msg', tra('You need to apply the "Invoice" profile'));
$smarty->display("error.tpl");
die;
......@@ -27,7 +26,7 @@ $headerlib->add_jq_onready("
.css('cursor', 'pointer');
});
");
print_r($trkqrylib->tracker_query_by_names("Invoice Clients"));
$smarty->assign("Clients", $trkqrylib->tracker_query_by_names("Invoice Clients"));
$smarty->assign("Settings", end($trkqrylib->tracker_query_by_names("Invoice Settings")));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment