Commit bbbe6802 authored by marclaporte's avatar marclaporte

dos2unix

parent b72d68fe
<?php
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
$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 )) {
$smarty->assign('msg', tra('You need to install the "Invoice" profile'));
$smarty->display("error.tpl");
die;
}
$smarty->assign("clients", $trkqrylib->tracker_query_by_names("Invoice Clients"));
$smarty->assign("setting", end($trkqrylib->tracker_query_by_names("Invoice Settings")));
//we are editing an invoice here
if (isset($_REQUEST['invoice'])) {
$smarty->assign("invoice", end($trkqrylib->tracker_query_by_names("Invoices", null, null, $_REQUEST['invoice'])));
$smarty->assign("invoiceItems", $trkqrylib->tracker_query_by_names("Invoice Items", null, null, null, array($_REQUEST['invoice']), null, array("Invoice Id")));
}
// Display the template
$smarty->assign('mid', 'tiki-edit_invoice.tpl');
<?php
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
$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 )) {
$smarty->assign('msg', tra('You need to install the "Invoice" profile'));
$smarty->display("error.tpl");
die;
}
$smarty->assign("clients", $trkqrylib->tracker_query_by_names("Invoice Clients"));
$smarty->assign("setting", end($trkqrylib->tracker_query_by_names("Invoice Settings")));
//we are editing an invoice here
if (isset($_REQUEST['invoice'])) {
$smarty->assign("invoice", end($trkqrylib->tracker_query_by_names("Invoices", null, null, $_REQUEST['invoice'])));
$smarty->assign("invoiceItems", $trkqrylib->tracker_query_by_names("Invoice Items", null, null, null, array($_REQUEST['invoice']), null, array("Invoice Id")));
}
// Display the template
$smarty->assign('mid', 'tiki-edit_invoice.tpl');
$smarty->display("tiki.tpl");
\ No newline at end of file
<?php
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
$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 )) {
$smarty->assign('msg', tra('You need to install the "Invoice" profile'));
$smarty->display("error.tpl");
die;
}
$invoices = $trkqrylib->tracker_query_by_names("Invoices");
$clients = $trkqrylib->tracker_query_by_names("Invoices Clients");
$settings = end($trkqrylib->tracker_query_by_names("Invoice Settings"));
foreach($invoices as $key => $invoice) {
$amount = 0;
$paid = 0;
$status = "";
if (is_array($invoice["Item Amounts"])) {
foreach($invoice["Item Amounts"] as $key => $sum) {
$amount += $invoice["Item Amounts"][$key] * $invoice["Item Quantities"][$key];
}
} else {
$amount = $invoice["Item Amounts"] * $invoice["Item Quantities"];
}
$invoice["Amount"] = $amount;
if (is_array($invoice["Amounts Paid"])) {
foreach($invoice["Amounts Paid"] as $sum) {
$paid += $sum;
}
} else {
$paid = $invoice["Amounts Paid"];
}
$invoice["Paid"] = $paid;
if ($amount == $paid) {
$status = "Paid";
} else {
$status = "Open";
}
$invoice["Status"] = $status;
}
$smarty->assign("invoices", $invoices);
$smarty->assign("clients", $clients);
$smarty->assign("settings", $settings);
$smarty->assign("amount", $amount);
$smarty->assign("paid", $paid);
$smarty->assign("status", $status);
// Display the template
$smarty->assign('mid', 'tiki-list_invoices.tpl');
<?php
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
$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 )) {
$smarty->assign('msg', tra('You need to install the "Invoice" profile'));
$smarty->display("error.tpl");
die;
}
$invoices = $trkqrylib->tracker_query_by_names("Invoices");
$clients = $trkqrylib->tracker_query_by_names("Invoices Clients");
$settings = end($trkqrylib->tracker_query_by_names("Invoice Settings"));
foreach($invoices as $key => $invoice) {
$amount = 0;
$paid = 0;
$status = "";
if (is_array($invoice["Item Amounts"])) {
foreach($invoice["Item Amounts"] as $key => $sum) {
$amount += $invoice["Item Amounts"][$key] * $invoice["Item Quantities"][$key];
}
} else {
$amount = $invoice["Item Amounts"] * $invoice["Item Quantities"];
}
$invoice["Amount"] = $amount;
if (is_array($invoice["Amounts Paid"])) {
foreach($invoice["Amounts Paid"] as $sum) {
$paid += $sum;
}
} else {
$paid = $invoice["Amounts Paid"];
}
$invoice["Paid"] = $paid;
if ($amount == $paid) {
$status = "Paid";
} else {
$status = "Open";
}
$invoice["Status"] = $status;
}
$smarty->assign("invoices", $invoices);
$smarty->assign("clients", $clients);
$smarty->assign("settings", $settings);
$smarty->assign("amount", $amount);
$smarty->assign("paid", $paid);
$smarty->assign("status", $status);
// Display the template
$smarty->assign('mid', 'tiki-list_invoices.tpl');
$smarty->display("tiki.tpl");
\ No newline at end of file
<?php
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
$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 )) {
$smarty->assign('msg', tra('You need to install the "Invoice" profile'));
$smarty->display("error.tpl");
die;
}
$invoice = end($trkqrylib->tracker_query_by_names("Invoices", null, null, $_REQUEST['invoice']));
$amount = 0;
if (is_array($invoice["Item Amounts"])) {
foreach($invoice["Item Amounts"] as $key => $sum) {
$amount += $invoice["Item Amounts"][$key] * $invoice["Item Quantities"][$key];
}
} else {
$amount = $invoice["Item Amounts"] * $invoice["Item Quantities"];
}
$smarty->assign("invoice", $invoice);
$smarty->assign("amount", $amount);
$smarty->assign("client", end($trkqrylib->tracker_query_by_names("Invoice Clients", null, null, null, array($invoice['Client Id']), null, array("Client Id"))));
$smarty->assign("setting", end($trkqrylib->tracker_query_by_names("Invoice Settings")));
$smarty->assign("invoiceItems", $trkqrylib->tracker_query_by_names("Invoice Items", null, null, null, array($_REQUEST['invoice']), null, array("Invoice Id")));
// Display the template
$smarty->assign('mid', 'tiki-view_invoice.tpl');
<?php
require_once('tiki-setup.php');
require_once('lib/profilelib/installlib.php');
require_once('lib/profilelib/profilelib.php');
require_once('lib/trackers/trackerquerylib.php');
global $tikilib, $trkqrylib;
$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 )) {
$smarty->assign('msg', tra('You need to install the "Invoice" profile'));
$smarty->display("error.tpl");
die;
}
$invoice = end($trkqrylib->tracker_query_by_names("Invoices", null, null, $_REQUEST['invoice']));
$amount = 0;
if (is_array($invoice["Item Amounts"])) {
foreach($invoice["Item Amounts"] as $key => $sum) {
$amount += $invoice["Item Amounts"][$key] * $invoice["Item Quantities"][$key];
}
} else {
$amount = $invoice["Item Amounts"] * $invoice["Item Quantities"];
}
$smarty->assign("invoice", $invoice);
$smarty->assign("amount", $amount);
$smarty->assign("client", end($trkqrylib->tracker_query_by_names("Invoice Clients", null, null, null, array($invoice['Client Id']), null, array("Client Id"))));
$smarty->assign("setting", end($trkqrylib->tracker_query_by_names("Invoice Settings")));
$smarty->assign("invoiceItems", $trkqrylib->tracker_query_by_names("Invoice Items", null, null, null, array($_REQUEST['invoice']), null, array("Invoice Id")));
// Display the template
$smarty->assign('mid', 'tiki-view_invoice.tpl');
$smarty->display("tiki.tpl");
\ No newline at end of file
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