Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vtiger/vtigercrm
  • varma/vtigercrm
  • alanbell/vtigercrm
  • mariusz.krzaczkowski/vtigercrm
  • manu.k/vtigercrm
  • adrgranado/vtigercrm
  • uma.s/vtigercrm
  • sardoj/vtigercrm
  • preexo/vtigercrm
  • david.valminos/vtigercrm
  • luca.saba/vtigercrm
  • dubwise/vtigercrm
  • valmir.ttcasolucoes/vtigercrm
  • lord_alan/vtigercrm
  • adrien.futschik/vtigercrm
  • edonit.rexhepi/vtigercrm
  • robert.heinze/vtigercrm
  • nrdimatteo/vtigercrm
  • sebastianzahan/vtigercrm
  • Miky/vtigercrm
  • germanf/vtigercrm
  • bernhardkau1/vtigercrm
  • olegtsoy/vtigercrm
  • grandel/vtigercrm
  • mario.thummler/vtigercrm
  • sutharsan/vtigercrm
  • james.douglas/vtigercrm
  • vikas/vtigercrm
  • jeffmchristensen/vtigercrm
  • lukasz.g/vtigercrm
  • nicolas.gasnier/vtigercrm
  • hamish.theitcompany/vtigercrm
  • engrbm87/vtigercrm
  • Quoc/vtigercrm
  • peter.maria.engeli/vtigercrm
  • kiranraju.j/vtigercrm
  • manuel.lozano/vtigercrm
  • dhaupin/vtigercrm
  • Ragupathyranesh/vtigercrm
  • Stefanbauer/vtigercrm
  • ruben.estrada/vtigercrm
  • sg_mwi1/vtigercrm
  • khaluk/vtigercrm
  • franzfroemel/vtigercrm
  • milan9615/vtigercrm
  • carlos.martin/vtigercrm
  • cmaggi/vtigercrm
  • Soltoon.theLeader/vtigercrm
  • alex.kaplun/vtigercrm
  • navid.hosseini/vtigercrm
  • maie/vtigercrm
  • simonetravaglini/vtigercrm
  • bertrand.wattel/vtigercrm
  • balaji.m/vtigercrm
  • mclarke4/vtigercrm
  • lajeeshk/vtigercrm
  • liam/vtigercrm
  • novikov.sergey/vtigercrm
  • johnwayne.williamson/vtigercrm
  • florian.strahberger-schramm/vtigercrm
  • daniel.schaefer/vtigercrm
  • christopher.gunther/vtigercrm
  • adrien.faveraux/vtigercrm
  • carsten.brandt/vtigercrm
  • stephane.molano/vtigercrm
  • krastan.petrov/vtigercrm
  • alfredo.bravo/vtigercrm
  • flipflop.Joe/vtigercrm
  • mirko.stagni/vtigercrm
  • remigio.ruberto/vtigercrm
  • gautam.dhudashiya/vtigercrm
  • manish.devitechnosolutions1/vtigercrm
  • matinbeigi/vtigercrm
  • devs/vtigercrm
  • happy.dev/vtigercrm
  • m.gigon/vtigercrm
  • manuelmigone/vtigercrm
  • eduardo.gqf/vtigercrm
  • elsayedEl-araby/vtigercrm
  • mirza.mehran/vtigercrm
  • maurice.courtois/vtigercrm
  • zuhri.utama/vtigercrm
  • shilpa.k/vtigercrm
  • Ignazio/vtigercrm
  • code80team/vtigercrm
  • code80/vtigercrm
  • nilay.automatesmb/cache
  • greeshma.kk/vtigercrm
  • vijay.tilak/vtigercrm
  • Paolo.Palamini/vtigercrm
  • estevan/vtigercrm
  • mobilcmcdk/vtigercrm
  • massimiliano.vessi/vtigercrm
  • daniel.voelskow/vtigercrm
  • james1/vtigercrm
  • lokesh.s/vtigercrm
  • rdb/vtigercrm
  • neftaliyagua/vtigercrm
  • angelo.paglialonga/vtigercrm
  • webmarka/vtigercrm
  • javanile/vtigercrm
  • akshath/vtigercrm
  • Hemanth/vtigercrm
  • opencrmitalia/vtigercrm
  • direzione/vtigercrm
  • umadas306/vtigercrm
  • jd-wraptec/vtigercrm
  • felipe.camacho/vtigercrm
  • Martin.allen/vtigercrm
  • amit.r/vtigercrm
  • vicus/vtigercrm
  • dev.osmi/vtigercrm
  • laurent.guillout/vtigercrm
  • christian.blaeul/vtigercrm
  • ap.js100/vtigercrm
  • yoann.mourot/vtigercrm-temp
  • christian.cruz/vtigercrm
  • zyli/vtigercrm
  • kaushik.p/vtigercrm
  • Madhuk/vtigercrm
  • cinakzm/vtigercrm
  • raquel.martinez/vtigercrm
  • tosajibadhi/vtigercrm
  • melvin.i/vtigercrm-melvin
  • ashashingadia/vtigercrm
  • stefanwarnat/vtigercrm
  • saran.s/vtigercrm
  • eduardomozart/vtigercrm
  • Daniel.Lennartz1/vtigercrm
  • juergen.fassmann/vtigercrm
  • Michel.Ram/vtigercrm
  • vincenzo.bruno/vtigercrm
132 results
Show changes
Commits on Source (1228)
Showing with 1479 additions and 125 deletions
vendor/*
!vendor/.htaccess
.vscode/*
\ No newline at end of file
......@@ -99,6 +99,7 @@ $GLOBALS['_PEAR_error_handler_stack'] = array();
* @since Class available since PHP 4.0.2
* @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
*/
#[\AllowDynamicProperties]
class PEAR
{
// {{{ properties
......@@ -234,7 +235,7 @@ class PEAR
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
function &getStaticProperty($class, $var)
static function &getStaticProperty($class, $var)
{
static $properties;
return $properties[$class][$var];
......@@ -252,7 +253,7 @@ class PEAR
* @param mixed $args The arguments to pass to the function
* @return void
*/
function registerShutdownFunc($func, $args = array())
static function registerShutdownFunc($func, $args = array())
{
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
}
......@@ -271,7 +272,7 @@ class PEAR
* @access public
* @return bool true if parameter is an error
*/
function isError($data, $code = null)
static function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) {
......@@ -327,7 +328,7 @@ class PEAR
* @since PHP 4.0.5
*/
function setErrorHandling($mode = null, $options = null)
static function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
$setmode = $this->_default_error_mode;
......@@ -516,7 +517,7 @@ class PEAR
* @see PEAR::setErrorHandling
* @since PHP 4.0.5
*/
function &raiseError($message = null,
static function &raiseError($message = null,
$code = null,
$mode = null,
$options = null,
......@@ -814,6 +815,7 @@ function _PEAR_call_destructors()
* @see PEAR::raiseError(), PEAR::throwError()
* @since Class available since PHP 4.0.2
*/
#[\AllowDynamicProperties]
class PEAR_Error
{
// {{{ properties
......
Vtiger CRM
==========
# Vtiger CRM
Vtiger is a PHP based web application that enables businesses to increase sales wins, marketing ROI, and support satisfaction by providing tools for employees and management work more effectively, capture more data, and derive new actionable insights from across the customer lifecycle.
Get involved
------------
## Get involved
Development on vtiger is done at https://code.vtiger.com
......@@ -40,6 +38,8 @@ you will switch to that branch using the checkout command
git branch fix_projects_on_calendar
git checkout fix_projects_on_calendar
Before you install, you need to run ```composer update```
Now you can make your changes and commit all changed files with
git commit -a
......
{
"name": "vtiger/vtigercrm",
"description": "Vtiger CRM",
"type": "project",
"license": "VPL",
"authors": [
{
"name": "Vtiger",
"email": "info@vtiger.com"
}
],
"autoload": {
"files": ["includes/Loader.php"]
},
"minimum-stability": "stable",
"require": {
"php": ">=8.1",
"ext-mysqli": "*",
"ext-imap": "*",
"ext-curl": "*",
"smarty/smarty": "^4.3",
"dg/rss-php": "^1.5",
"ezyang/htmlpurifier": "^4.16",
"tecnickcom/tcpdf": "^6.6",
"monolog/monolog": "^3.5",
"league/oauth2-client": "^2.7",
"phpmailer/phpmailer": "^6.9",
"league/oauth2-google": "^4.0"
}
}
This diff is collapsed.
......@@ -9,8 +9,8 @@
************************************************************************************/
/* Performance paramters can be configured to fine tune vtiger CRM runtime */
$PERFORMANCE_CONFIG = Array(
// Enable log4php debugging only if requried
'LOG4PHP_DEBUG' => false,
// Enable Vtiger Log Level for debugging only if requried
'LOGLEVEL_DEBUG' => false,
// Should the caller information be captured in SQL Logging?
// It adds little overhead for performance but will be useful to debug
......
......@@ -22,6 +22,11 @@ include('config.inc.php');
$THIS_DIR = dirname(__FILE__);
/* Pre-install overrides */
if (!isset($dbconfig)) {
error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED);
}
if (file_exists($THIS_DIR.'/config_override.php')) {
include_once $THIS_DIR.'/config_override.php';
}
......
......@@ -111,7 +111,7 @@ $allow_exports = 'all';
// files with one of these extensions will have '.txt' appended to their filename on upload
// upload_badext default value = php, php3, php4, php5, pl, cgi, py, asp, cfm, js, vbs, html, htm
$upload_badext = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm', 'exe', 'bin', 'bat', 'sh', 'dll', 'phps', 'phtml', 'xhtml', 'rb', 'msi', 'jsp', 'shtml', 'sth', 'shtm');
$upload_badext = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm', 'exe', 'bin', 'bat', 'sh', 'dll', 'phps', 'phtml', 'xhtml', 'rb', 'msi', 'jsp', 'shtml', 'sth', 'shtm', 'htaccess', 'phar');
// list_max_entries_per_page default value = 20
$list_max_entries_per_page = '20';
......
<?php
/** Logging configuration for Strict Development */
require_once "vtlib/Vtiger/Utils/PhpLogHandler.php";
Vtiger_PhpLogHandler::enableStrictLogging(__DIR__, "logs/phperr.log");
......@@ -22,8 +22,8 @@
//file modified by richie
require_once('include/utils/utils.php');
require_once("modules/Emails/class.smtp.php");
require_once("modules/Emails/class.phpmailer.php");
//require_once("modules/Emails/class.smtp.php");
//require_once("modules/Emails/class.phpmailer.php");
require_once("modules/Emails/mail.php");
require_once('include/logging.php');
require_once("config.php");
......@@ -194,11 +194,11 @@ if($adb->num_rows($result) >= 1)
$recordModel = Vtiger_Record_Model::getInstanceById($activity_id, 'Calendar');
$recordDetailViewLink = $recordModel->getDetailViewUrl();
$contents = $contents."<br/> ".vtranslate('LBL_CLICK_HERE_TO_VIEW', 'Calendar')."&nbsp;<a href=$site_URL/$recordDetailViewLink>".vtranslate('LBL_RECORD', 'Calendar')."</a>";
if(count($to_addr) >=1)
if(php7_count($to_addr) >=1)
{
send_email($to_addr,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password);
$upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent = ?";
$upd_params = array(1);
$upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent = ? WHERE activity_id = ?";
$upd_params = array('1',$activity_id);
if($recur_id!=0)
{
......@@ -232,7 +232,7 @@ function send_email($to,$from,$subject,$contents,$mail_server,$mail_server_usern
$log->info("This is send_mail function in SendReminder.php(vtiger home).");
global $root_directory;
$mail = new PHPMailer();
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->Subject = $subject;
......
<?php
/*+*******************************************************************************
/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
$mysql_dir = 'MYSQLINSTALLDIR';
$mysql_username = 'MYSQLUSERNAME';
$mysql_password = 'MYSQLPASSWORD';
$mysql_port = 'MYSQLPORT';
$mysql_bundled = 'MYSQLBUNDLEDSTATUS';
$apache_dir = 'APACHEINSTALLDIR';
$apache_bin = 'APACHEBIN';
$apache_conf = 'APACHECONF';
$apache_port = 'APACHEPORT';
$apache_bundled = 'APACHEBUNDLED';
?>
*************************************************************************************/
require_once 'modules/Oauth2/handlers/TokenRefresher.php';
$tokenRefresher = new Oauth2_TokenRefresher_Handler();
$tokenRefresher->refreshAll();
\ No newline at end of file
......@@ -22,13 +22,13 @@
//file modified by richie
require_once("modules/Emails/class.smtp.php");
require_once("modules/Emails/class.phpmailer.php");
// require_once("modules/Emails/class.smtp.php");
// require_once("modules/Emails/class.phpmailer.php");
require_once 'include/utils/CommonUtils.php';
function sendmail($to,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password,$filename,$smtp_auth='')
{
$mail = new PHPMailer();
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->Subject = $subject;
$mail->Body = $contents;//"This is the HTML message body <b>in bold!</b>";
......
This diff is collapsed.
......@@ -91,7 +91,7 @@ $log->info("in track view method ".$current_module);
$fl = array();
foreach($fieldlists as $w => $c)
{
if (count($fl))
if (php7_count($fl))
$fl[] = "' '";
$fl[] = $c;
}
......@@ -144,7 +144,7 @@ $log->info("in track view method ".$current_module);
// If the module was not specified or the module matches the module of the row, add the row to the list
if($module_name == "" || $row[module_name] == $module_name)
if($module_name == "" || $row["module_name"] == $module_name)
{
//Adding Security check
require_once('include/utils/utils.php');
......
......@@ -92,12 +92,12 @@ class VTEntityDelta extends VTEventHandler {
function getOldValue($moduleName, $recordId, $fieldName) {
$entityDelta = self::$entityDelta[$moduleName][$recordId];
return $entityDelta[$fieldName]['oldValue'];
return isset($entityDelta[$fieldName]['oldValue']) ? $entityDelta[$fieldName]['oldValue'] : "";
}
function getCurrentValue($moduleName, $recordId, $fieldName) {
$entityDelta = self::$entityDelta[$moduleName][$recordId];
return $entityDelta[$fieldName]['currentValue'];
return isset($entityDelta[$fieldName]['currentValue']) ? $entityDelta[$fieldName]['currentValue'] : "";
}
function getOldEntity($moduleName, $recordId) {
......@@ -109,19 +109,25 @@ class VTEntityDelta extends VTEventHandler {
}
function hasChanged($moduleName, $recordId, $fieldName, $fieldValue = NULL) {
$result = false;
if(empty(self::$oldEntity[$moduleName][$recordId])) {
return false;
}
if (!array_key_exists($fieldName, self::$entityDelta[$moduleName][$recordId])) {
return false;
}
$fieldDelta = self::$entityDelta[$moduleName][$recordId][$fieldName];
if(is_array($fieldDelta)) {
$fieldDelta = array_map('decode_html', $fieldDelta);
}
$result = $fieldDelta['oldValue'] != $fieldDelta['currentValue'];
if(isset($fieldDelta['oldValue']) && isset($fieldDelta['currentValue'])) {
$result = $fieldDelta['oldValue'] != $fieldDelta['currentValue'];
}
if ($fieldValue !== NULL) {
$result = $result && ($fieldDelta['currentValue'] === $fieldValue);
}
return $result;
}
}
}
?>
\ No newline at end of file
?>
......@@ -34,7 +34,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
'username' => $username,
'email' => $email,
'time' => $time,
'hash' => md5($username.$time)
'hash' => hash('sha256',$username.$time)
)
);
$trackURL = Vtiger_ShortURL_Helper::generateURL($options);
......@@ -42,7 +42,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
You recently requested a password reset for your VtigerCRM Open source Account.<br>
To create a new password, click on the link <a target="_blank" href='.$trackURL.'>here</a>.
<br><br>
This request was made on '.date("Y-m-d H:i:s").' and will expire in next 24 hours.<br><br>
This request was made on '.date("Y-m-d H:i:s").' and will expire in next 1 hour.<br><br>
Regards,<br>
VtigerCRM Open source Support Team.<br>';
......@@ -54,6 +54,15 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
$mail->Subject = $subject;
$mail->AddAddress($email);
// ensure default sender if not coming from outgoing server
if (!$mail->From) {
global $HELPDESK_SUPPORT_EMAIL_ID;
// use only when config val is valid
if (strpos($HELPDESK_SUPPORT_EMAIL_ID, "@") !== false) {
$mail->From = $HELPDESK_SUPPORT_EMAIL_ID;
}
}
$status = $mail->Send(true);
if ($status === 1 || $status === true) {
header('Location: index.php?modules=Users&view=Login&mailStatus=success');
......
......@@ -40,7 +40,7 @@ Class ChartUtils {
$alts = array();
$temp = array();
for ($i = 0; $i < count($xaxisData); $i++) {
for ($i = 0; $i < php7_count($xaxisData); $i++) {
$name = html_entity_decode($xaxisData[$i], ENT_QUOTES, $default_charset);
$pos = substr_count($name, " ");
$alts[] = $name;
......@@ -49,9 +49,9 @@ Class ChartUtils {
$name = substr($name, 0, 44);
if ($pos >= 2) {
$val = explode(" ", $name);
$n = count($val) - 1;
$n = php7_count($val) - 1;
$x = "";
for ($j = 0; $j < count($val); $j++) {
for ($j = 0; $j < php7_count($val); $j++) {
if ($j != $n) {
$x .=" " . $val[$j];
} else {
......@@ -97,7 +97,7 @@ Class ChartUtils {
$fill = & Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, $color, 'white'));
}
for ($i = 0; $i < count($yaxisData); $i++) {
for ($i = 0; $i < php7_count($yaxisData); $i++) {
$x = 1 + $i;
if ($yaxisData[$i] >= $max)
$max = $yaxisData[$i];
......@@ -125,7 +125,7 @@ Class ChartUtils {
//You can change the width of the bars if you like
if (!empty($xaxisData))
$bplot->setBarWidth($barwidth / count($xaxisData), "%");
$bplot->setBarWidth($barwidth / php7_count($xaxisData), "%");
//$bplot->setPadding(array('top'=>10));
$bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', 'white')));
$xaxis = & $plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
......@@ -165,7 +165,7 @@ Class ChartUtils {
// The fix the tick marks
$xaxis->setDataPreprocessor($array_data);
$xaxis->forceMinimum(0.5);
$xaxis->forceMaximum(0.5 + count($yaxisData));
$xaxis->forceMaximum(0.5 + php7_count($yaxisData));
if ($charttype == 'vertical')
$xaxis->setFontAngle('vertical');
$xaxis->setLabelInterval(1);
......@@ -226,7 +226,7 @@ Class ChartUtils {
$alts = array();
$temp = array();
for ($i = 0; $i < count($xaxisData); $i++) {
for ($i = 0; $i < php7_count($xaxisData); $i++) {
$name = html_entity_decode($xaxisData[$i], ENT_QUOTES, $default_charset);
$pos = substr_count($name, " ");
$alts[] = $name;
......@@ -235,9 +235,9 @@ Class ChartUtils {
$name = substr($name, 0, 34);
if ($pos >= 2) {
$val = explode(" ", $name);
$n = count($val) - 1;
$n = php7_count($val) - 1;
$x = "";
for ($j = 0; $j < count($val); $j++) {
for ($j = 0; $j < php7_count($val); $j++) {
if ($j != $n) {
$x .=" " . $val[$j];
} else {
......@@ -269,15 +269,15 @@ Class ChartUtils {
// To create unique lables we need to keep track of lable name and its count
$uniquex = array();
// Generate colours
$colors = color_generator(count($yaxisData), '#33DDFF', '#3322FF');
$colors = color_generator(php7_count($yaxisData), '#33DDFF', '#3322FF');
$dataset = & Image_Graph::factory('dataset');
$fills = & Image_Graph::factory('Image_Graph_Fill_Array');
$sum = 0;
$pcvalues = array();
for ($i = 0; $i < count($yaxisData); $i++) {
for ($i = 0; $i < php7_count($yaxisData); $i++) {
$sum += $yaxisData[$i];
}
for ($i = 0; $i < count($yaxisData); $i++) {
for ($i = 0; $i < php7_count($yaxisData); $i++) {
// To have unique names even in case of duplicates let us add the id
$datalabel = $xaxisData[$i];
$xaxisData_appearance = $uniquex[$xaxisData[$i]];
......@@ -363,14 +363,14 @@ Class ChartUtils {
}
}
if(is_array($restrictedModules) && count($restrictedModules) > 0) {
if(is_array($restrictedModules) && php7_count($restrictedModules) > 0) {
$ChartDataArray['error'] = "<h4>".getTranslatedString('LBL_NO_ACCESS', 'Reports').' - '.implode(',', $restrictedModules)."</h4>";
return $ChartDataArray;
}
if ($fieldDetails != '') {
list($tablename, $colname, $module_field, $fieldname, $single) = explode(":", $fieldDetails);
list($module, $field) = split("_", $module_field);
list($module, $field) = explode('_', $module_field);
$dateField = false;
if ($single == 'D') {
$dateField = true;
......@@ -411,7 +411,7 @@ Class ChartUtils {
$groupByFields[] = "Null";
}
else if (in_array($fieldname, array_keys($referenceFields))) {
if (count($referenceFields[$fieldname]) > 1) {
if (php7_count($referenceFields[$fieldname]) > 1) {
$refenceModule = CustomReportUtils::getEntityTypeFromName($decodedGroupFieldValue, $referenceFields[$fieldname]);
}
else {
......@@ -471,7 +471,7 @@ Class ChartUtils {
}
}
}
if(count($groupByFields) == 0) {
if(php7_count($groupByFields) == 0) {
$ChartDataArray['error'] = "<div class='componentName'>".getTranslatedString('LBL_NO_DATA', 'Reports')."</div";
}
$ChartDataArray['xaxisData'] = $groupByFields;
......
......@@ -355,8 +355,7 @@ $combo_strings = Array(
);
require_once('modules/Users/UserTimeZonesArray.php');
$usertimezonesClass = new UserTimeZones();
$arrayOfSupportedTimeZones = $usertimezonesClass->userTimeZones();
$arrayOfSupportedTimeZones = UserTimeZones::getAll();
$combo_strings['time_zone_dom'] = array_combine($arrayOfSupportedTimeZones,$arrayOfSupportedTimeZones);
?>
......
......@@ -31,7 +31,7 @@ function getComboArray($combofieldNames)
if(!is_admin($current_user))
{
$subrole = getRoleSubordinates($roleid);
if(count($subrole)> 0)
if(php7_count($subrole)> 0)
{
$roleids = $subrole;
array_push($roleids, $roleid);
......
......@@ -17,7 +17,7 @@ include_once 'vtlib/Vtiger/PDF/inventory/ContentViewer2.php';
include_once 'vtlib/Vtiger/PDF/viewers/PagerViewer.php';
include_once 'vtlib/Vtiger/PDF/PDFGenerator.php';
include_once 'data/CRMEntity.php';
#[\AllowDynamicProperties]
class Vtiger_InventoryPDFController {
protected $module;
......@@ -114,7 +114,7 @@ class Vtiger_InventoryPDFController {
$taxable_total = number_format($taxable_total, $no_of_decimal_places,'.','');
$producttotal = $taxable_total;
if($this->focus->column_fields["hdnTaxType"] == "individual") {
for($tax_count=0;$tax_count<count($productLineItem['taxes']);$tax_count++) {
foreach($productLineItem['taxes'] as $tax_count => $productLinetItemTaxInfo) {
$tax_percent = $productLineItem['taxes'][$tax_count]['percentage'];
$total_tax_percent += $tax_percent;
$tax_amount = (($taxable_total*$tax_percent)/100);
......@@ -131,7 +131,7 @@ class Vtiger_InventoryPDFController {
$discountPercentage = $productLineItem["discount_percent{$productLineItemIndex}"];
$productName = decode_html($productLineItem["productName{$productLineItemIndex}"]);
//get the sub product
$subProducts = $productLineItem["subProductArray{$productLineItemIndex}"];
$subProducts = isset($productLineItem["subProductArray{$productLineItemIndex}"]) ? $productLineItem["subProductArray{$productLineItemIndex}"] : "";
if($subProducts != '') {
foreach($subProducts as $subProduct) {
$productName .="\n"." - ".decode_html($subProduct);
......@@ -201,14 +201,14 @@ class Vtiger_InventoryPDFController {
//To calculate the group tax amount
if($final_details['taxtype'] == 'group') {
$group_tax_details = $final_details['taxes'];
for($i=0;$i<count($group_tax_details);$i++) {
$group_total_tax_percent += $group_tax_details[$i]['percentage'];
foreach($group_tax_details as $i => $group_tax_info) {
$group_total_tax_percent += isset($group_tax_details[$i]['percentage']) ? $group_tax_details[$i]['percentage'] : 0.00;
}
$summaryModel->set(getTranslatedString("Tax:", $this->moduleName)."($group_total_tax_percent%)", $this->formatPrice($final_details['tax_totalamount']));
}
//Shipping & Handling taxes
$sh_tax_details = $final_details['sh_taxes'];
for($i=0;$i<count($sh_tax_details);$i++) {
foreach($sh_tax_details as $i => $sh_tax_info) {
$sh_tax_percent = $sh_tax_percent + $sh_tax_details[$i]['percentage'];
}
//obtain the Currency Symbol
......@@ -429,4 +429,4 @@ class Vtiger_InventoryPDFController {
}
}
?>
\ No newline at end of file
?>