mirror of
https://github.com/itflow-org/itflow
synced 2026-03-27 15:55:37 +00:00
Started adding currency symbols and starting with invoice
This commit is contained in:
34
blank.php
34
blank.php
@@ -16,6 +16,40 @@
|
|||||||
Copy to clipboard
|
Copy to clipboard
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Function to generate OTP
|
||||||
|
function generateNumericOTP($n) {
|
||||||
|
|
||||||
|
// Take a generator string which consist of
|
||||||
|
// all numeric digits
|
||||||
|
$generator = "1357902468";
|
||||||
|
|
||||||
|
// Iterate for n-times and pick a single character
|
||||||
|
// from generator and append it to $result
|
||||||
|
|
||||||
|
// Login for generating a random character from generator
|
||||||
|
// ---generate a random number
|
||||||
|
// ---take modulus of same with length of generator (say i)
|
||||||
|
// ---append the character at place (i) from generator to result
|
||||||
|
|
||||||
|
$result = "";
|
||||||
|
|
||||||
|
for ($i = 1; $i <= $n; $i++) {
|
||||||
|
$result .= substr($generator, (rand()%(strlen($generator))), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return result
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main program
|
||||||
|
$n = 6;
|
||||||
|
print_r(generateNumericOTP($n));
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo "$session_permission_companies";
|
echo "$session_permission_companies";
|
||||||
|
|||||||
@@ -183,4 +183,39 @@ function truncate($text, $chars = 25) {
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_currency_symbol($cc = 'USD')
|
||||||
|
{
|
||||||
|
$cc = strtoupper($cc);
|
||||||
|
$currency = array(
|
||||||
|
"USD" => "$" , //U.S. Dollar
|
||||||
|
"AUD" => "$" , //Australian Dollar
|
||||||
|
"BRL" => "R$" , //Brazilian Real
|
||||||
|
"CAD" => "C$" , //Canadian Dollar
|
||||||
|
"CZK" => "Kč" , //Czech Koruna
|
||||||
|
"DKK" => "kr" , //Danish Krone
|
||||||
|
"EUR" => "€" , //Euro
|
||||||
|
"HKD" => "$" , //Hong Kong Dollar
|
||||||
|
"HUF" => "Ft" , //Hungarian Forint
|
||||||
|
"ILS" => "₪" , //Israeli New Sheqel
|
||||||
|
"INR" => "₹", //Indian Rupee
|
||||||
|
"JPY" => "¥" , //Japanese Yen
|
||||||
|
"MYR" => "RM" , //Malaysian Ringgit
|
||||||
|
"MXN" => "$" , //Mexican Peso
|
||||||
|
"NOK" => "kr" , //Norwegian Krone
|
||||||
|
"NZD" => "$" , //New Zealand Dollar
|
||||||
|
"PHP" => "₱" , //Philippine Peso
|
||||||
|
"PLN" => "zł" ,//Polish Zloty
|
||||||
|
"GBP" => "£" , //Pound Sterling
|
||||||
|
"SEK" => "kr" , //Swedish Krona
|
||||||
|
"CHF" => "Fr" , //Swiss Franc
|
||||||
|
"TWD" => "$" , //Taiwan New Dollar
|
||||||
|
"THB" => "฿" , //Thai Baht
|
||||||
|
"TRY" => "₺" //Turkish Lira
|
||||||
|
);
|
||||||
|
|
||||||
|
if(array_key_exists($cc, $currency)){
|
||||||
|
return $currency[$cc];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
31
invoice.php
31
invoice.php
@@ -48,6 +48,7 @@ if(isset($_GET['invoice_id'])){
|
|||||||
}
|
}
|
||||||
$client_website = $row['client_website'];
|
$client_website = $row['client_website'];
|
||||||
$client_currency_code = $row['client_currency_code'];
|
$client_currency_code = $row['client_currency_code'];
|
||||||
|
$client_currency_symbol = get_currency_symbol("$client_currency_code");
|
||||||
$client_net_terms = $row['client_net_terms'];
|
$client_net_terms = $row['client_net_terms'];
|
||||||
if($client_net_terms == 0){
|
if($client_net_terms == 0){
|
||||||
$client_net_terms = $config_default_net_terms;
|
$client_net_terms = $config_default_net_terms;
|
||||||
@@ -271,9 +272,9 @@ if(isset($_GET['invoice_id'])){
|
|||||||
<td><?php echo $item_name; ?></td>
|
<td><?php echo $item_name; ?></td>
|
||||||
<td><?php echo $item_description; ?></td>
|
<td><?php echo $item_description; ?></td>
|
||||||
<td class="text-center"><?php echo $item_quantity; ?></td>
|
<td class="text-center"><?php echo $item_quantity; ?></td>
|
||||||
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
|
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
|
||||||
<td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
|
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
|
||||||
<td class="text-right">$<?php echo number_format($item_total,2); ?></td>
|
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@@ -344,23 +345,23 @@ if(isset($_GET['invoice_id'])){
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr class="border-bottom">
|
<tr class="border-bottom">
|
||||||
<td>Subtotal</td>
|
<td>Subtotal</td>
|
||||||
<td class="text-right">$<?php echo number_format($sub_total,2); ?></td>
|
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($sub_total,2); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if($total_tax > 0){ ?>
|
<?php if($total_tax > 0){ ?>
|
||||||
<tr class="border-bottom">
|
<tr class="border-bottom">
|
||||||
<td>Tax</td>
|
<td>Tax</td>
|
||||||
<td class="text-right">$<?php echo number_format($total_tax,2); ?></td>
|
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($total_tax,2); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if($amount_paid > 0){ ?>
|
<?php if($amount_paid > 0){ ?>
|
||||||
<tr class="border-bottom">
|
<tr class="border-bottom">
|
||||||
<td><div class="text-success">Paid to Date</div></td>
|
<td><div class="text-success">Paid to Date</div></td>
|
||||||
<td class="text-right text-success">$<?php echo number_format($amount_paid,2); ?></td>
|
<td class="text-right text-success"><?php echo $client_currency_symbol; ?><?php echo number_format($amount_paid,2); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<tr class="border-bottom">
|
<tr class="border-bottom">
|
||||||
<td><strong>Balance Due</strong></td>
|
<td><strong>Balance Due</strong></td>
|
||||||
<td class="text-right"><strong>$<?php echo number_format($balance,2); ?></strong></td>
|
<td class="text-right"><strong><?php echo $client_currency_symbol; ?><?php echo number_format($balance,2); ?></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -672,15 +673,15 @@ var docDefinition = {
|
|||||||
style:'itemQty'
|
style:'itemQty'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text:'$<?php echo number_format($item_price,2); ?>',
|
text:'<?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?>',
|
||||||
style:'itemNumber'
|
style:'itemNumber'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text:'$<?php echo number_format($item_tax,2); ?>',
|
text:'<?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?>',
|
||||||
style:'itemNumber'
|
style:'itemNumber'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '$<?php echo number_format($item_total,2); ?>',
|
text: '<?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?>',
|
||||||
style:'itemNumber'
|
style:'itemNumber'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -722,7 +723,7 @@ var docDefinition = {
|
|||||||
style:'itemsFooterSubTitle'
|
style:'itemsFooterSubTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text:'$<?php echo number_format($sub_total,2); ?>',
|
text:'<?php echo $client_currency_symbol; ?><?php echo number_format($sub_total,2); ?>',
|
||||||
style:'itemsFooterSubValue'
|
style:'itemsFooterSubValue'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -733,7 +734,7 @@ var docDefinition = {
|
|||||||
style:'itemsFooterSubTitle'
|
style:'itemsFooterSubTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '$<?php echo number_format($total_tax,2); ?>',
|
text: '<?php echo $client_currency_symbol; ?><?php echo number_format($total_tax,2); ?>',
|
||||||
style:'itemsFooterSubValue'
|
style:'itemsFooterSubValue'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -744,7 +745,7 @@ var docDefinition = {
|
|||||||
style:'itemsFooterSubTitle'
|
style:'itemsFooterSubTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '$<?php echo number_format($invoice_amount,2); ?>',
|
text: '<?php echo $client_currency_symbol; ?><?php echo number_format($invoice_amount,2); ?>',
|
||||||
style:'itemsFooterSubValue'
|
style:'itemsFooterSubValue'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -755,7 +756,7 @@ var docDefinition = {
|
|||||||
style:'itemsFooterSubTitle'
|
style:'itemsFooterSubTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '$<?php echo number_format($amount_paid,2); ?>',
|
text: '<?php echo $client_currency_symbol; ?><?php echo number_format($amount_paid,2); ?>',
|
||||||
style:'itemsFooterSubValue'
|
style:'itemsFooterSubValue'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -766,7 +767,7 @@ var docDefinition = {
|
|||||||
style:'itemsFooterTotalTitle'
|
style:'itemsFooterTotalTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '$<?php echo number_format($balance,2); ?>',
|
text: '<?php echo $client_currency_symbol; ?><?php echo number_format($balance,2); ?>',
|
||||||
|
|
||||||
style:'itemsFooterTotalTitle'
|
style:'itemsFooterTotalTitle'
|
||||||
}
|
}
|
||||||
|
|||||||
11
tickets.php
11
tickets.php
@@ -20,7 +20,7 @@
|
|||||||
if(isset($_GET['status'])){
|
if(isset($_GET['status'])){
|
||||||
$status = mysqli_real_escape_string($mysqli,$_GET['status']);
|
$status = mysqli_real_escape_string($mysqli,$_GET['status']);
|
||||||
}else{
|
}else{
|
||||||
$status = "";
|
$status = "Open";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['sb'])){
|
if(!empty($_GET['sb'])){
|
||||||
@@ -113,12 +113,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="btn-group float-right">
|
<div class="btn-group float-right">
|
||||||
<a href="?status=%" class="btn <?php if($status == '%'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">All</a>
|
<a href="<?php echo $_SERVER['REQUEST_URI']; ?>&status=%" class="btn <?php if($status == '%'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">All Tickets</a>
|
||||||
<a href="?status=Open" class="btn <?php if($status == 'Open'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Open</a>
|
<a href="<?php echo $_SERVER['REQUEST_URI']; ?>&status=Open" class="btn <?php if($status == 'Open'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Open Tickets</a>
|
||||||
<a href="?status=In-Progress" class="btn <?php if($status == 'In-Progress'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">In-Progress</a>
|
<a href="<?php echo $_SERVER['REQUEST_URI']; ?>&status=Closed" class="btn <?php if($status == 'Closed'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Closed Tickets</a>
|
||||||
<a href="?status=On-Hold" class="btn <?php if($status == 'On-Hold'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">On-Hold</a>
|
|
||||||
<a href="?status=Resolved" class="btn <?php if($status == 'Resolved'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Resolved</a>
|
|
||||||
<a href="?status=Closed" class="btn <?php if($status == 'Closed'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Closed</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user