Ejemplo n.º 1
0
								<th width='15%'>Start </th>
								<th width='15%'>End</th>
								<th class='last' width='19%'>Total</th>
							</tr>
							<tbody>
						";
					$colorFlag=true;
						while($invoice = mysql_fetch_assoc($invoices)){
							if($colorFlag){echo "<tr id='invoice".$invoice['invoiceId']."'>";}
							else{echo "<tr class='bg' id='invoice".$invoice['invoiceId']."'>";}
							!$colorFlag;
							echo "<td class='first style2' width='7%'>".$invoice['projectId']."</td>";
							echo "<td width='29%'>".$invoice['projectName']."</td>";
							echo "<td width='15%'>".to_MDY($invoice['invoiceDate'])."</td>";
							echo "<td width='15%'>".to_MDY($invoice['invoiceStartDate'])."</td>";
							echo "<td width='15%'>".to_MDY($invoice['invoiceEndDate'])."</td>";
							echo "<td width='19%'>$".decimalPad($invoice['invoiceTotal'])."</td>";
							echo "</tr>";
							
						}echo "</tbody></table>";
				}
			?>
			</div>
			<?
			/*
			$queryContacts = "select * from item order by itemId desc limit 5";
			$terms = mysql_query($queryContacts,$conexion);
			$numTerms = mysql_num_rows($terms);
			if($numTerms>0)
			{
				echo "<div class='table'>";
 } else {
     $totalChequeAmount = decimalPad($chequeInfo['customerSuperCheckAmount']);
     $totalChequeSum = decimalPad($chequeInfo['total']);
     if ($totalChequeSum == $totalChequeAmount) {
         $totalSum = $totalChequeSum;
     } else {
         if ($totalChequeAmount < $totalChequeSum) {
             $totalSum = "<span style='color:red;'>{$totalChequeSum}</span>";
         } else {
             $totalSum = "<span style='color:green;'>{$totalChequeSum}</span>";
         }
     }
 }
 $tableHolder .= "<tr>";
 $tableHolder .= "<td rowspan='{$rowspan}'>" . $chequeInfo['receiptchequeNumber'] . "</td>";
 $tableHolder .= "<td rowspan='{$rowspan}'>" . to_MDY($chequeInfo['receiptchequesDate']) . "</td>";
 $tableHolder .= "<td rowspan='{$rowspan}'>" . $totalChequeAmount . "</td>";
 $tableHolder .= "<td rowspan='{$rowspan}'>" . $totalSum . "</td>";
 $first = true;
 $chequesGroupQuery = "SELECT * FROM receiptcheques JOIN invoice USING (invoiceId) JOIN project USING (projectId) WHERE receiptchequeNumber = '" . $chequeInfo['receiptchequeNumber'] . "' ORDER BY invoiceId asc";
 //echo $chequesGroupQuery."<br/>";
 $chequesGroup = mysql_query($chequesGroupQuery, $conexion);
 while ($cheque = mysql_fetch_assoc($chequesGroup)) {
     if ($first) {
         $first = false;
     } else {
         $tableHolder .= "</tr><tr>\n";
     }
     $tableHolder .= "<td>" . decimalPad($cheque['receiptchequesAmount']) . "</td>";
     $tableHolder .= "<td>" . $cheque['invoiceId'] . "</td>";
     $tableHolder .= "<td>" . $cheque['projectName'] . "</td>";
Ejemplo n.º 3
0
<?php

include "../conexion.php";
include "../commons.php";
include "../password.php";
#################
$title = "Edit";
#################
$subtitle = "Driver";
$description = "Driver Information.";
###############News section###############
$queryNews = "SELECT \r\n\t\t*\r\n\tFROM\r\n\t\tnews\r\n\tORDER BY\r\n\t\tnewsDate desc\r\n\tLIMIT\r\n\t\t1";
$news = mysql_query($queryNews, $conexion);
$lastNew = mysql_fetch_assoc($news);
$lastNew = $lastNew["newsComment"] . " -" . to_MDY($lastNew["newsDate"]);
##########################################
if (isset($_GET['i'])) {
    ###############To Edit###############
    $queryLast = "SELECT \r\n\t\t* \r\n\tFROM\r\n \t\tdriver\r\n \tJOIN (select brokerName, brokerPid, brokerId from broker) as b using (brokerId)\r\n\tJOIN address USING (addressId)\r\n\tJOIN term USING (termId)\r\n\tLEFT JOIN carrier USING (carrierId)\r\n\tLEFT JOIN ethnic USING (ethnicId)\r\n\tLEFT JOIN work USING (workId)\r\n\tWHERE\r\n\t\tdriverId=" . $_GET['i'];
    $Last = mysql_query($queryLast, $conexion);
    $lastVal = mysql_fetch_assoc($Last);
    ##########################################
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title><?echo$title." -".$subtitle;?></title>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
		<link rel="shortcut icon" href="/trucking/img/favicon.ico" type="image/x-icon" />
	<style media="all" type="text/css">@import "../../css/all.css";</style>
Ejemplo n.º 4
0
				<tr>
					<th class='first'>Ticket MFI</th>
					<th>Dump ticket</th>
					<th>Date</th>
					<th>Truck</th>
					<th>Amount</th>
					<th class='last'>Broker Amount</th>
				</tr>
				<?
				$ticketsWithItem = mysql_query("select * from ticket JOIN item using (itemId) JOIN truck using (truckId) JOIN broker using (brokerId) where itemId = ".$lastVal['itemId'],$conexion);
				$flag = true;
				while($ticket = mysql_fetch_assoc($ticketsWithItem)){
					echo "<tr ".($flag?"class='bg'":"")." ticketId='".$ticket['ticketId']."' class='lookable'>";
						echo "<td>".$ticket['ticketMfi']."</td>";
						echo "<td>".$ticket['ticketNumber']."</td>";
						echo "<td>".to_MDY($ticket['ticketDate'])."</td>";
						echo "<td>".$ticket['brokerPid']."-".$ticket['truckNumber']."</td>";
						echo "<td>".decimalPad($ticket['ticketAmount'] * $ticket['itemCustomerCost'])."</td>";
						echo "<td>".decimalPad($ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost'])."</td>";
					echo "</tr>";
				}
				?>
				</table>
			</div>
			
		<?
		}
		else
		{
		?>
					<div class='table' id='searchBar'>
				<table class='listing form' cellpadding='0' cellspacing='0' id='searchResultsTable'>
					<thead>
						<tr class='bg'>
							<th>Cheque Number</th>
							<th>Date</th>
							<th>Amount</th>
							<th>Remove</th>
						</tr>
					</thead>
					<tbody>
						<?
						$superchecks = mysql_query("select * from customer_super_check order by customerSuperCheckId limit 40", $conexion);
						while($check = mysql_fetch_assoc($superchecks)){
							echo "<tr class='editable' id='paymentRow".$check['customerSuperCheckId']."' superCheckId='".$check['customerSuperCheckId']."' >";
								echo "<td>".$check['customerSuperCheckNumber']."</td>";
								echo "<td>".to_MDY($check['customerSuperCheckDate'])."</td>";
								echo "<td>".decimalPad($check['customerSuperCheckAmount'])."</td>";
								echo "<td><img src='/trucking/img/118.png' width='20px' height='20px' class='removablePayment' /></td>";
							echo "</tr>";
						}
						?>
					</tbody>
				</table>
			</div>
			
		<?
		}
		?>
		</div>
		<div id="right-column">
			<strong class="h">INFO</strong>
Ejemplo n.º 6
0
?>
	<div class="table" id="oldFuelLoads">
		<table class="listing form" cellpadding="0" cellspacing="0">
			<tr>
				<th class="full" colspan="8">Older Elements</th>
			</tr>
			<tr>
				<th>Date</th>
				<th>Broker</th>
				<th>Truck</th>
				<th>Driver</th>
				<th>Start</th>
				<th>Finish</th>
				<th>Registered</th>
				<th>Miles</th>
			</tr>
			<?php 
$fuels = mysql_query("SELECT * FROM fuel_load JOIN broker ON (broker.brokerId = fuel_load.brokerId) JOIN truck USING (truckId) order by fuelLoadId", $conexion);
while ($fuel = mysql_fetch_assoc($fuels)) {
    echo "<tr class='doubleClickable' fuelLoadId='" . $fuel['fuelLoadId'] . "'>\n\t\t\t\t\t<td>" . to_MDY($fuel['fuelLoadDate']) . "</td>\n\t\t\t\t\t<td>" . $fuel['brokerName'] . "</td>\n\t\t\t\t\t<td>" . $fuel['brokerPid'] . "-" . $fuel['truckNumber'] . "</td>\n\t\t\t\t\t<td>" . $fuel['fuelLoadCommet'] . "</td>\n\t\t\t\t\t<td>" . $fuel['fuelLoadStart'] . "</td>\n\t\t\t\t\t<td>" . $fuel['fuelLoadFinish'] . "</td>\n\t\t\t\t\t<td>" . $fuel['fuelLoadRegistered'] . "</td>\n\t\t\t\t\t<td>" . $fuel['fuelLoadMileage'] . "</td>\n\t\t\t\t</tr>";
}
?>
		</table>
	</div>
</div>
<?include_once '../news.php';?>
</div>
<?
include_once '../app_footer.php';
?>
Ejemplo n.º 7
0
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='4'>Pay Cheques for Supplier Invoice [<?php 
echo $supplierInvoice['supplierInvoiceNumber'];
?>
]</th>
		</tr>
		<tr>
		<th>Number</th>
		<th>Date</th>
		<th>Amount</th>
		<th>Remove</th>
		</tr>
		<?php 
$cheques = mysql_query("select * from suppliercheque where supplierInvoiceId = {$reportId}", $conexion);
//Truck
$flag = true;
while ($cheque = mysql_fetch_assoc($cheques)) {
    $flag = !$flag;
    echo "<tr " . ($flag ? "class='bg'" : "") . " id='paycheque" . $cheque['supplierchequeId'] . "'>";
    echo "<td>" . $cheque['supplierchequeNumber'] . "</td>";
    echo "<td>" . to_MDY($cheque['supplierchequeDate']) . "</td>";
    echo "<td>" . decimalPad($cheque['supplierchequeAmount']) . "</td>";
    echo "<td>" . createActionIcon(IMG_DELETE, '', 'Delete Payment', '../submit/deleteSupplierCheck.php', 'chequeId=' . $cheque['supplierchequeId'], 'delete', " width='22' height='22'") . "</td>";
    echo "</tr>";
}
?>
	</table>
</div>
Ejemplo n.º 8
0
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Customer Check Information</th>
		</tr>
		<?php 
$flag = true;
$customerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_VENDOR, createGenericNyroableAttributesSmall($customerSuperCheckInfo['customerId'], 'customer'));
echo printTuple($flag ? '' : "class='bg'", 'Customer', $customerSuperCheckInfo['customerName'], $customerLink);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Check Number', $customerSuperCheckInfo['customerSuperCheckNumber']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Check Date', to_MDY($customerSuperCheckInfo['customerSuperCheckDate']));
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Check Registration', to_MDY($customerSuperCheckInfo['customerSuperCheckCreationDate']));
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Check Amount', "\$ " . decimalPad($customerSuperCheckInfo['customerSuperCheckAmount']));
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Check Note', $customerSuperCheckInfo['customerSuperCheckNote']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Credit', "\$ " . decimalPad($customerSuperCheckInfo['checkCredit']));
$flag = !$flag;
?>
	</table>
</div>

<?php 
if (mysql_num_rows($payments) > 0) {
    ?>
<div id='formDiv' class='table'>
	
	if($paidTotal == null || $paidTotal <= 0 ){ $paid = 'Unpaid';if($paidR)continue;}
	if($paidTotal != null && $paidTotal >= $reportTotal && $paidTotal != 0){ $paid = 'Paid'; if($unpaidR)continue;}
	if($paidTotal != null && $paidTotal > 0 && $paidTotal < $reportTotal){ $paid = 'Warning';if($paidR)continue;}
	if($paidTotal != null && $paidTotal > $reportTotal){ $paid = 'Overpaid'; if($unpaid)continue;}
	
	if($colorFlag){$tbody.= "<tr class='even".$paid." printable' id='report".$invoice['reportId']."' invoice='".$invoice['reportId']."'>";}
	else{$tbody.= "<tr class='odd".$paid." printable' id='report".$invoice['reportId']."' invoice='".$invoice['reportId']."'>";}
	$colorFlag=!$colorFlag;
	
	$tbody.= "<td>".$invoice['reportId']."</td>";
	$tbody.= "<td>".$invoice['brokerPid']."</td>";
	$tbody.= "<td>".($invoice['driverFirstName']==null?'----':$invoice['driverLastName'].", ".$invoice['driverFirstName'])."</td>";
	$tbody.= "<td>".to_MDY($invoice['reportDate'])."</td>";
	$tbody.= "<td>".to_MDY($invoice['reportStartDate'])."</td>";
	$tbody.= "<td>".to_MDY($invoice['reportEndDate'])."</td>";
	$tbody.= "<td>".(date('m/d/Y', strtotime('+'.$invoice['termValue'].' days', strtotime($invoice['reportEndDate']))))."</td>";
	$tbody.= "<td>".decimalPad($reportTotal)."</td>";
	$tbody.= "<td>".decimalPad($paidTotal)."</td>";
	$tbody.= "<td>".decimalPad($reportTotal - $paidTotal)."</td>";
	
	if($paid == "Overpaid" || $paid == "Paid")$tbody.="<td></td>";
	else $tbody.="<td>".createActionIcon(IMG_PAY,'pay'.$invoice['reportId'],'Pay Report','../nyros/payBrokerInvoice.php','reportId='.$invoice['reportId'],'show'," width='22' height='22'")."</td>";
	
	if($paid == "Unpaid") {
		$tbody.= "<td>".createActionIcon(IMG_DELETE,'delete'.$invoice['reportId'],'Delete Invoice','../submit/deleteBrokerInvoice.php','reportId='.$invoice['reportId'],'delete'," width='22' height='22'")."</td>";
	} else {
		$tbody.="<td>".createActionIcon(IMG_MNG,'','Manage Invoice','../nyros/manageBrokerInvoice.php','reportId='.$invoice['reportId'],'show'," width='22' height='22'")."</td>";
	}
	$tbody.="</tr>";
}
Ejemplo n.º 10
0
						if($num_dispatch>0){
							while($dispatch = mysql_fetch_assoc($dispatches)){
								if($dispatch['truckCount']==$dispatch['dispatchCount']){
									$tbody.= "<tr>";
								}else
									$tbody.= "<tr>";
									
								$tbody.="<td id='dispatch".$dispatch['dispatchId']."' >";
								$tbody.= $dispatch['projectName']." <Strong><label id='count".$dispatch['dispatchId']."'>".($dispatch['truckCount']==null?"0":$dispatch['truckCount'])."</label>/<label id='max".$dispatch['dispatchCount']."' >".$dispatch['dispatchCount']."</label></Strong>";
								$tbody.="</td>";
								$tbody.= "</tr>";
							}
						}
	$tbody.="</tbody>";
	$response['tbody']=$tbody;
	$response['currentDate']=to_MDY($currentDay);
	echo json_encode($response);
}

/*
For Log Actions:
1 -> New (insert into)
2 -> Edit (update from)
3 -> Delete (delete from)
*/

mysql_close();


?>
Ejemplo n.º 11
0
		$paidTotal = decimalPad($paidInfo['totalPaid'] == null ? 0 : $paidInfo['totalPaid']);
		$chequeTotal = $paidInfo['number'] == null ? 0 : $paidInfo['number'];
		$reportTotal = decimalPad($invoice['supplierInvoiceAmount'] );
		
		if($paidTotal == null || $paidTotal <= 0 || $chequeTotal == 0 ) $paid = 'Unpaid';
		if($paidTotal != null && $paidTotal >= $reportTotal && $chequeTotal != 0) $paid = 'Paid';
		if($paidTotal != null && $paidTotal > 0 && $paidTotal < $reportTotal) $paid = 'Warning';
		if($paidTotal != null && $paidTotal > $reportTotal) $paid = 'Overpaid';
		
		if($colorFlag){$tbody.= "<tr class='even".$paid."' id='invoice".$invoice['supplierInvoiceId']."'>";}
		else{$tbody.= "<tr class='odd".$paid."' id='invoice".$invoice['supplierInvoiceId']."'>";}
		$colorFlag=!$colorFlag;
		
		$tbody.= "<td>".$invoice['supplierName']."</td>";
		$tbody.= "<td>".$invoice['supplierInvoiceNumber']."</td>";
		$tbody.= "<td>".to_MDY($invoice['supplierInvoiceDate'])."</td>";
		$tbody.= "<td>".decimalPad($reportTotal)."</td>";
		$tbody.= "<td>".decimalPad($reportTotal - $paidTotal)."</td>";
		$tbody.= "<td>".decimalPad($paidTotal)."</td>";
		
		if($paid == 'Unpaid' || $paid == 'Warning') $tbody.= "<td class='number' ><img src='/trucking/img/87.png' width='24' height='22' class='payable' supplierInvoiceId='".$invoice['supplierInvoiceId']."' /></td>";
		else $tbody.= "<td></td>";
		
		if($paid == 'Unpaid')$tbody.= "<td><img src='/trucking/img/118.png' width='20' height='20' class='deletable' supplierInvoiceId='".$invoice['supplierInvoiceId']."' supplierInvoiceNumber='".$invoice['supplierInvoiceNumber']."' /></td>";
		else $tbody.= "<td><img src='/trucking/img/2.png' width='24' height='22' class='managable' supplierInvoiceId='".$invoice['supplierInvoiceId']."' /></td>";
		
		$tbody.= "</tr>";
	}
}
$tbody.= "</tbody>";
Ejemplo n.º 12
0
                $firstBroker = false;
                $reportPaid = mysql_fetch_assoc(mysql_query("select * from report JOIN broker using (brokerId) where reportId = " . $payment['reportId'], $conexion));
                $tableHolder .= "<td rowspan='" . $reportInfo['totalCheques'] . "'>" . $reportPaid['brokerName'] . "</td>";
            } else {
                $tableHolder .= "</tr><tr>\n";
            }
            $tableHolder .= "<td>" . $payment['reportId'] . "</td>";
            $tableHolder .= "<td>" . decimalPad($reportTotal) . "</td>";
        }
        $tableHolder .= "</tr>\n";
    } else {
        //just one report
        $reportPaid = mysql_fetch_assoc(mysql_query("select * from report JOIN broker using (brokerId) where reportId = " . $reportInfo['reportId'], $conexion));
        $reportTotal = getReportTotal($reportInfo['reportId'], $conexion);
        $tableHolder .= "<tr>";
        $tableHolder .= "<td>" . to_MDY($reportInfo['paidchequesDate']) . "</td>";
        $tableHolder .= "<td>" . $reportInfo['paidchequeNumber'] . "</td>";
        $tableHolder .= "<td align='right'>" . decimalPad($reportInfo['totalPaid']) . "</td>";
        $tableHolder .= "<td>" . $reportPaid['brokerName'] . "</td>";
        $tableHolder .= "<td>" . $reportPaid['reportId'] . "</td>";
        $tableHolder .= "<td align='rigth'>" . decimalPad($reportTotal) . "</td>";
        $tableHolder .= "</tr>\n";
    }
    $globalTotal += $reportInfo['totalPaid'];
}
echo "<tr><td colspan='2'></td><td align='right'>" . decimalPad($globalTotal) . "</td><td colspan='3'></td></tr>";
?>
<tr>
	<th>Date</th>
	<th>Cheque #</th>
	<th>Amount</th>
Ejemplo n.º 13
0
if(isset($_GET['materialId'])&&isset($_GET['supplierId']))
{
	$queryMaterials =
	"SELECT
		*
	FROM
		suppliermaterial
	WHERE
		materialId = '".$_GET['materialId']."' and
		supplierId = '".$_GET['supplierId']."'";
	$result = mysql_query($queryMaterials,$conexion);
	
	while($row = mysql_fetch_assoc($result)){
		//$jsondata[$row['materialId']]=$row['materialName']."~".$row['supplierMaterialPrice']."~".$row['supplierMaterialLastModified'];
		$jsondata['price']=decimalPad($row['supplierMaterialPrice']);
		$jsondata['lastModified']=to_MDY($row['supplierMaterialLastModified']);
	}
	
	echo json_encode($jsondata);
}

/*
For Log Actions:
1 -> New (insert into)
2 -> Edit (update from)
3 -> Delete (delete from)
*/

mysql_close();

Ejemplo n.º 14
0
 $invoices5Info = mysql_fetch_assoc($invoices5);
 $queryInvoice6 = "\nSELECT \n\ttruckId, truckNumber\nFROM\n\ttruck\nWHERE\n\ttruckId=" . $invoices3Info['truckId'] . "\n\tORDER BY truckNumber\n\t";
 $invoices6 = mysql_query($queryInvoice6, $conexion);
 $invoices6Info = mysql_fetch_assoc($invoices6);
 $queryInvoice7 = "\nSELECT \n\t*\nFROM\n\tproject JOIN address using (addressId)\nWHERE\n\tprojectId=" . $invoices4Info['projectId'];
 $invoices7 = mysql_query($queryInvoice7, $conexion);
 $invoices7Info = mysql_fetch_assoc($invoices7);
 $queryInvoice8 = "\nSELECT \n\tcustomerId, customerName\nFROM\n\tcustomer\nWHERE\n\tcustomerId=" . $invoices7Info['customerId'];
 $invoices8 = mysql_query($queryInvoice8, $conexion);
 $invoices8Info = mysql_fetch_assoc($invoices8);
 if ($invoices7Info['projectUnder'] == ILLINOIS_PW_ACT || $invoices7Info['projectUnder'] == DAVIS_BACON_ACT) {
     $projectsInAct[$invoices7Info['projectName'] . " " . $invoices7Info['addressLine1']] = $invoices7Info['projectUnder'];
 }
 $row = "";
 $row .= "<tr>";
 $row .= "<td>" . to_MDY($invoices3Info['ticketDate'], true) . "</td>";
 $row .= "<td>" . $invoices8Info['customerName'] . "</td>";
 $row .= "<td>" . $projectInfo2['brokerPid'] . "-" . $invoices6Info['truckNumber'] . "</td>";
 $row .= "<td align=left >" . $invoices3Info['ticketMfi'];
 if ($invoices3Info['ticketNumber'] != "") {
     $row .= "/" . $invoices3Info['ticketNumber'];
 }
 $row .= "</td>";
 $row .= "<td align=left>" . $invoices4Info['itemDisplayFrom'] . "</td>";
 $row .= "<td align=left>" . $invoices4Info['itemDisplayTo'] . "</td>";
 $row .= "<td >" . decimalPad($invoices3Info['ticketBrokerAmount'], 2);
 $row .= "</td>";
 $row .= "<td align=right >" . decimalPad($invoices4Info['itemBrokerCost'], 2);
 $row .= "</td>";
 $row .= "<td align=right >" . decimalPad($invoices3Info['ticketBrokerAmount'] * $invoices4Info['itemBrokerCost'], 2);
 $row .= "</td>";
Ejemplo n.º 15
0
            $startingDate = strtotime($invoice['invoiceDate']);
            $dateDiff = $now - $startingDate;
            $daysOff = floor($dateDiff / (60 * 60 * 24));
            $dueDate = date('Y-m-d', strtotime($invoice['invoiceDate'] . " +" . $termValue . " days"));
            $customerTotalAmount += $invoiceAmount;
            $lastProjectAmount += $invoiceAmount;
            $totalAmount += $invoiceAmount;
            $customerTotalBalance += $invoiceBalance;
            $lastProjectBalance += $invoiceBalance;
            $totalBalance += $invoiceBalance;
            $tmpHolder .= "<tr>";
            $tmpHolder .= "<td></td>";
            $tmpHolder .= "<td>" . $invoice['invoiceId'] . "</td>";
            $tmpHolder .= "<td>" . to_MDY($invoice['invoiceDate']) . "</td>";
            $tmpHolder .= "<td>" . $daysOff . "</td>";
            $tmpHolder .= "<td>" . to_MDY($dueDate) . "</td>";
            $tmpHolder .= "<td align='right'>" . $invoiceAmount . "</td>";
            $tmpHolder .= "<td align='right'>" . $invoiceBalance . "</td>";
            $tmpHolder .= "</tr>\n";
        }
        $tmpHolder .= "<tr><td colspan='5'></td><td align='right'>" . decimalPad($lastProjectAmount) . "</td><td align='right'>" . decimalPad($lastProjectBalance) . "</td></tr>";
        $tmpHolder .= "<tr><td colspan='5'></td><th class='total' align='right'>" . decimalPad($customerTotalAmount) . "</th><th class='total' align='right'>" . decimalPad($customerTotalBalance) . "</th></tr>";
        if ($shouldAdd) {
            $tableHolder .= $tmpHolder;
        }
    }
}
echo "<tr><td colspan='5'></td><td align='right'>" . decimalPad($totalAmount) . "</td><td align='right'>" . decimalPad($totalBalance) . "</td></tr>";
?>
<tr>
	<th></th>
Ejemplo n.º 16
0
					</tr>
					<tr class='bg' >
						<td>Date:</td>
						<td>Broker:</td>
						<td>Truck:</td>
						<td>Driver:</td>
						<td>Start</td>
						<td>Finish</td>
						<td>Total</td>
						<td>Registered</td>
						<td>Miles</td>
						<td></td>
						
					</tr>
					<tr>
						<td><input type='text' size='6px' id='fuelDate' name='fuelDate' value='<?echo to_MDY($lastVal['fuelLoadDate']);?>' /></td>
						<td colspan='2'>
							<?
							echo "<select name='brokerId' id='brokerId' style='font-family:verdana;font-size:8pt'>";
							echo "<option selected='selected' value='0' >--Select Broker--</option>";
							$queryBroker = "SELECT * FROM broker where brokerStatus=1 order by brokerName";
							$brokers = mysql_query($queryBroker,$conexion);
							while($broker=mysql_fetch_assoc($brokers)){
									if($lastVal['brokerId']==$broker['brokerId'])
										echo "<option selected='selected' value='".$broker['brokerId']."' >".$broker['brokerName']."</option>";
									else
										echo "<option value='".$broker['brokerId']."' >".$broker['brokerName']."</option>";
							}
							echo "</select>";
							?><span style="color:red;">*</span>
						<br/>
Ejemplo n.º 17
0
$count = 0;
while ($ticket = mysql_fetch_assoc($invoices)) {
    $queryInvoice1 = "\nSELECT \n\t*\nFROM\n\tticket\nWHERE\n\tticketId=" . $ticket['ticketId'];
    $invoices1 = mysql_query($queryInvoice1, $conexion);
    if (mysql_num_rows($invoices1) == 0) {
        continue;
    }
    $invoiceInfo1 = mysql_fetch_assoc($invoices1);
    $queryInvoice2 = "\nSELECT \n\t*\nFROM\n\titem\nJOIN material using (materialId)\nWHERE\n\titemId=" . $invoiceInfo1['itemId'];
    $invoices2 = mysql_query($queryInvoice2, $conexion);
    $invoiceInfo2 = mysql_fetch_assoc($invoices2);
    $queryInvoice3 = "\nSELECT\n\t\ttruckId,\n\t\ttruckNumber,\n\t\tbrokerPid\n\tFROM\n\t\ttruck\n\tJOIN broker using(brokerId)\nWHERE\n\ttruckId=" . $invoiceInfo1['truckId'];
    $invoices3 = mysql_query($queryInvoice3, $conexion);
    $invoiceInfo3 = mysql_fetch_assoc($invoices3);
    echo "<tr>";
    echo "<td>" . to_MDY($invoiceInfo1['ticketDate']) . "</td>";
    echo "<td>" . $invoiceInfo3['brokerPid'] . "-" . $invoiceInfo3['truckNumber'] . "</td>";
    echo "<td align=left >" . $invoiceInfo1['ticketMfi'];
    if ($invoiceInfo1['ticketNumber'] != "" && $invoiceInfo1['ticketNumber'] != $invoiceInfo1['ticketMfi']) {
        echo "/" . $invoiceInfo1['ticketNumber'];
    }
    echo "</td>";
    echo "<td align=left>" . $invoiceInfo2['materialName'] . "</td>";
    echo "<td align=left>" . $invoiceInfo2['itemDisplayFrom'] . "</td>";
    echo "<td align=left>" . $invoiceInfo2['itemDisplayTo'] . "</td>";
    echo "<td >" . decimalPad($invoiceInfo1['ticketAmount']);
    echo "</td>";
    echo "<td align=right >" . decimalPad($invoiceInfo2['itemCustomerCost']);
    echo "</td>";
    echo "<td align=right >" . decimalPad($invoiceInfo1['ticketAmount'] * $invoiceInfo2['itemCustomerCost']);
    echo "</td>";
Ejemplo n.º 18
0
							if($colorFlag){ $tdClass=""; }
							else{ $tdClass=" class='bg' "; }
								switch($actual){
									case 0:
									$colorFlag=!$colorFlag;
									echo "<tr>";
									echo "<td width='6%'".$tdClass." >".to_MDY($ticket['ticketDate'])."</td>";
									echo "<td size='8px' width='6%'".$tdClass." id='ticket".$ticket['ticketId']."' >".$ticket['ticketMfi']."</td>";
									echo "<td width='6%'".$tdClass." >".$ticket['ticketNumber']."</td>";
									echo "<td width='6%'".$tdClass." >".$invoiceId."</td>";
									//echo "<td width='6%'".$tdClass." >".$reportId."</td>";
									//echo "<td width='6%'".$tdClass." >".$snvoiceId."</td>";
									$actual++;
									break;
									case 1:
									echo "<td width='6%'".$tdClass." >".to_MDY($ticket['ticketDate'])."</td>";
									echo "<td size='8px' width='6%'".$tdClass." id='ticket".$ticket['ticketId']."' >".$ticket['ticketMfi']."</td>";
									echo "<td width='6%'".$tdClass." >".$ticket['ticketNumber']."</td>";
									echo "<td width='6%'".$tdClass." >".$invoiceId."</td>";
									//echo "<td width='6%'".$tdClass." >".$reportId."</td>";
									//echo "<td width='6% class='last' ".$tdClass." >".$snvoiceId."</td>";
									echo "</tr>";
									$actual=0;
									break;
								}
						}
						switch($actual){
							case 0:break;
							case 1:echo"<td ".$tdClass." colspan='7'></td></tr>";break;
							#case 2:echo"<td ".$tdClass." colspan='6'></td></tr>";break;
						}
</td>
</tr>
</table>

<br>

<table align="center" class="report" width="100%" cellspacing="0" >
<?php 
$tableHolder = "";
$ticketsQuery = "\r\n\tSELECT\r\n\t\t*\r\n\tFROM\r\n\t\tticket\r\n\t\tJOIN item using (itemId)\r\n\t\tJOIN project using (projectId)\r\n\t\tJOIN customer using (customerId)\r\n\t\tJOIN truck using (truckId)\r\n\t\tJOIN broker using (brokerId)\r\n\t\tLEFT JOIN reportticket using (ticketId)\r\n\tWHERE\r\n\t\treportId is null AND\r\n\t\tticketDate >= '" . ($fromDate == "" ? "0000-00-00" : to_YMD($fromDate)) . "' \r\n\t\t" . ($toDate == "" ? "" : " AND ticketDate < '" . to_YMD($toDate) . "' ") . "\r\n\t\t" . ($filter == 0 ? "" : " AND brokerId = " . $filter) . "\r\n\tORDER BY\r\n\t\tticketDate asc\r\n";
//echo $ticketsQuery;
$tickets = mysql_query($ticketsQuery, $conexion);
while ($ticket = mysql_fetch_assoc($tickets)) {
    $tableHolder .= "<tr>";
    $tableHolder .= "<td>" . to_MDY($ticket['ticketDate']) . "</td>";
    $tableHolder .= "<td>" . $ticket['ticketMfi'] . ($ticket['ticketNumber'] == "" ? "" : "/" . $ticket['ticketNumber']) . "</td>";
    $tableHolder .= "<td>" . $ticket['customerName'] . "</td>";
    $tableHolder .= "<td>" . $ticket['projectName'] . "</td>";
    $tableHolder .= "<td>" . $ticket['brokerPid'] . "-" . $ticket['truckNumber'] . "</td>";
    $tableHolder .= "</tr>";
}
?>
	<tr>
		<th >Date</th>
		<th >Ticket</th>
		<th >Customer</th>
		<th >Project</th>
		<th >Truck</th>
	</tr>
Ejemplo n.º 20
0
<?php

include_once '../function_header.php';
$objectId = $_REQUEST['objectId'];
$additionalId = $_REQUEST['additionalId'];
$infoNeed = $_REQUEST['type'];
$response['type'] = $infoNeed;
//type = projectInfo | supplierInfo | materialPrice
switch ($infoNeed) {
    case 'projectInfo':
        $projectInfo = getProjectInfo($conexion, $objectId);
        $response['displayFrom'] = $projectInfo['projectName'] . " @ " . $projectInfo['addressLine1'];
        break;
    case 'supplierInfo':
        $supplierInfo = getSupplierInfo($conexion, $objectId);
        $response['displayTo'] = $supplierInfo['supplierName'] . " @ " . $supplierInfo['addressLine1'];
        break;
    case 'materialPrice':
        //echo "SELECT * FROM suppliermaterial WHERE materialId = '$objectId' AND supplierId = '$additionalId'";
        $materialInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM suppliermaterial WHERE materialId = '{$objectId}' AND supplierId = '{$additionalId}'", $conexion));
        $response['materialPrice'] = $materialInfo['supplierMaterialPrice'];
        $response['materialLast'] = to_MDY($materialInfo['supplierMaterialLastModified']);
        break;
}
echo json_encode($response);
Ejemplo n.º 21
0
<?
include("../conexion.php");
include("../commons.php");
include("../password.php");

$queryFirstDate = 
"SELECT ticketDate FROM item join ticket using(itemId) where projectId = ".$_GET['projectId']." order by ticketDate asc limit 1";
$queryEndDate = 
"SELECT ticketDate FROM item join ticket using(itemId) where projectId = ".$_GET['projectId']." order by ticketDate desc limit 1";

$firstDates = mysql_query($queryFirstDate,$conexion);
if(mysql_num_rows($firstDates)>0) {$firstDate = mysql_fetch_assoc($firstDates); $startingDate = to_MDY($firstDate['ticketDate']); }
else $startingDate="";
$lastDates = mysql_query($queryEndDate,$conexion);
if(mysql_num_rows($lastDates)>0) {$lastDate = mysql_fetch_assoc($lastDates); $endingDate = to_MDY($lastDate['ticketDate']); }
else $endingDate="";

$jsondata['startingDate'] = $startingDate;
$jsondata['endingDate'] = $endingDate;

	echo json_encode($jsondata);

mysql_close();

?>

Ejemplo n.º 22
0
function getNextSaturdayDate($date)
{
    $ret = to_YMD($date);
    //$ret = strtotime($ret);
    //$ret = date('Y-m-d',$ret);
    for ($i = 1; $i <= 7; $i++) {
        if (date('w', strtotime()) == 6) {
            $ret = date('Y-m-d', strtotime('+' . $i . ' day'));
        }
    }
    $ret = to_MDY($ret);
    return $ret;
}
Ejemplo n.º 23
0
$flag = !$flag;
echo createFormRowTextField('City', 'editDriverAddressCity', $flag ? 'class="bg"' : '', false, "size='10px' value='" . $driverInfo['addressCity'] . "'");
$flag = !$flag;
//state
echo createFormRow('State', $flag ? 'class="bg"' : '', false, createStateSelect($conexion, 'editDriverAddressState', $driverInfo['addressState']));
$flag = !$flag;
echo createFormRowTextField('Zip', 'editDriverAddressZip', $flag ? 'class="bg"' : '', false, "size='10px' value='" . $driverInfo['addressZip'] . "'");
$flag = !$flag;
echo createFormRowTextField('P.O.Box', 'editDriverAddressBox', $flag ? 'class="bg"' : '', false, "size='10px' value='" . $driverInfo['addressPOBox'] . "'");
$flag = !$flag;
//
echo createFormRow('Payment Terms', $flag ? 'class="bg"' : '', true, createTermSelect($conexion, 'editDriverTermId', $driverInfo['termId']));
$flag = !$flag;
echo createFormRowTextField('Percentage', 'editDriverPercentage', $flag ? 'class="bg"' : '', true, "size='10px' value='" . $driverInfo['driverPercentage'] . "'");
$flag = !$flag;
echo createFormRowTextField('Driver Start Date', 'editDriverStartDate', $flag ? 'class="bg"' : '', false, "size='10px' value='" . to_MDY($driverInfo['driverStartDate']) . "'");
$flag = !$flag;
echo createFormRow('Gender', $flag ? 'class="bg"' : '', true, arrayToSelect(array("0" => "--Select Gender--", "male" => "Male", "female" => "Female"), $driverInfo['driverGender'], 'editDriverGender', 'Gender', true));
$flag = !$flag;
echo createFormRow('Ethnicity', $flag ? 'class="bg"' : '', true, createEthnicitySelect($conexion, 'editDriverEthnicId', $driverInfo['ethnicId']));
$flag = !$flag;
echo createFormRow('Class', $flag ? 'class="bg"' : '', true, arrayToSelect(array("--Select Class--", "Class 1", "Class 2", "Class 3", "Class 4"), $driverInfo['driverClass'], 'editDriverClass', 'Class', true));
$flag = !$flag;
?>
	</table>
	<table>
		<tr>
			<td><?php 
echo createSimpleButton('submitEditDriverButton', 'Submit');
?>
</td>
Ejemplo n.º 24
0
				{
					if($colorFlag)
					{
						echo "<tr>";
						!$colorFlag;
					}
					else
					{
						echo "<tr class='bg'>";
						!$colorFlag;
					}
					$truckInfo = mysql_fetch_assoc(mysql_query("SELECT * from truck JOIN broker using (brokerId) where truckId = ".$term['truckId']));
					echo "
						<td class='first style2'>".$term['projectId']."</td>
						<td class='first style2'>".$term['itemNumber']."</td>
						<td class='first style2'>".to_MDY($term['ticketDate'])."</td>
						<td class='first style2'>".$truckInfo['brokerPid']."-".$truckInfo['truckNumber']."</td>
						<td class='first style2'>".$term['materialName']."</td>
						<td class='first style2'>".$term['itemDisplayFrom']."</td>
						<td class='first style2'>".$term['itemDisplayTo']."</td>
						<td class='first style2'>".$term['ticketMfi']."</td>
						<td><a href='/trucking/php/view/viewTicket.php?i=".$term['ticketId']."'><img src='/trucking/img/16.png' width='20' height='20' /></a></td>
							";
					$invoiceTicket = mysql_query("select * from invoiceticket where ticketId = ".$term['ticketId']);
					$reportTicket = mysql_query("select * from reportticket where ticketId = ".$term['ticketId']);
					$supplierInvoiceTicket = mysql_query("select * from supplierinvoiceticket where ticketId = ".$term['ticketId']);
					if(mysql_num_rows($invoiceTicket)==0 && mysql_num_rows($reportTicket)==0 && mysql_num_rows($supplierInvoiceTicket)==0){
					//if($term['docId']==null){
						echo "
							<td><a href='/trucking/php/edit/editTicket.php?i=".$term['ticketId']."'><img src='/trucking/img/13.png' width='20' height='20' /></a></td>
							<td class='last'><a onclick=\"return confirm('Are you sure you want to delete ticket #".$term['ticketMfi']."?');\" href='deleteTicket.php?i=".$term['ticketId']."'><img src='/trucking/img/118.png' width='20' height='20' /></a></td>
Ejemplo n.º 25
0
						<th class="full" colspan="4">Pay Cheques available for Report <?echo $reportId;?></th>
					</tr>
					<tr>
						<th>Number</th>
						<th>Date</th>
						<th>Amount</th>
						<th>Remove</th>
					</tr>
					<?
					$cheques = mysql_query("select * from paidcheques where reportId = $reportId", $conexion);
					$flag = true;
					while($cheque = mysql_fetch_assoc($cheques)){
						$flag = !$flag;
						echo "<tr ".($flag?"class='bg'":"")." id='paycheque".$cheque['paidchequesId']."'>";
						echo "<td>".$cheque['paidchequeNumber']."</td>";
						echo "<td>".to_MDY($cheque['paidchequesDate'])."</td>";
						echo "<td>".decimalPad($cheque['paidchequesAmount'])."</td>";
						echo "<td><img src='/trucking/img/118.png' width='20' height='20' class='deletable' valor='".$cheque['paidchequesId']."' /></td>";
						echo "</tr>";
					}
					?>
				</table>
				</form>
	        <!--<p>&nbsp;</p>-->
			</div>



		</div>
		<div id="right-column">
			<strong class="h">INFO</strong>
Ejemplo n.º 26
0
	}
}
?>
<table align="center" class="report" width="100%" cellspacing="0" >
	<tr>
		<th>Week</th>
		<th>Total</th>
		<th>Minority</th>
		<th>Female</th>
		<th>Chicagoan</th>
	</tr>
<?

foreach($weekTable as $weekId=>$week) {
	echo "<tr>";
		echo "<td>".to_MDY($week['startDate'])."-".to_MDY($week['endDate'])."</td>";
		echo "<td>".$workersPerWeek[$weekId]['total']."</td>";
		echo "<td>".$workersPerWeek[$weekId]['minority']."</td>";
		echo "<td>".$workersPerWeek[$weekId]['female']."</td>";
		echo "<td>".$workersPerWeek[$weekId]['chicagoan']."</td>";
	echo "</tr>";
}
?>
</table>
<table align="center" class="report" width="100%" cellspacing="0" >
	<tr>
		<th>Contractor</th>
		<th>Total</th>
		<th>Minority</th>
		<th>Female</th>
		<th>Chicago Residency</th>
Ejemplo n.º 27
0
						break;
				}
			} catch(e) {
				alert("Internal Error: Please contact the administrator.");
			}
		},
		async:	true
	});
}
</script>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='4'>Supplier Information</th>
		</tr>
		<?php 
$flag = true;
//$vendorLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_VENDOR, createGenericNyroableAttributesSmall($supplierInfo['vendorId'],'vendor'));
$materials = mysql_query("SELECT * FROM suppliermaterial JOIN material USING (materialId) WHERE supplierId = '{$supplierId}'", $conexion);
while ($material = mysql_fetch_assoc($materials)) {
    $delImg = createActionIcon(IMG_DELETE, 'delete' . $supplierId . "-" . $material['materialId'], 'Delete Price', '../submit/deleteSupplierMaterial.php', 'supplier=' . $supplierId . '&material=' . $material['materialId'], 'delete', " width='22' height='22'");
    echo printRow($flag ? "" : "class='bg'", array($material['materialName'], decimalPad($material['supplierMaterialPrice']), to_MDY($material['supplierMaterialLastModified']), $delImg));
    $flag = !$flag;
}
echo printRow(" id='newPriceListItem' " . ($flag ? "" : "class='bg'"), array(arrayToSelect(materialsArray($conexion), '0', 'newPriceListMaterial', 'Material'), createInputText('newPriceListPrice', '', ''), '', createSimpleButton('saveNewPriceList', 'Submit')));
?>
	</table>
</div>
Ejemplo n.º 28
0
            $tableBody .= "<td align=right width=18 height=18>" . decimalPad($whtax) . "</td>";
            $tableBody .= "<td align=right width=18 height=18>" . decimalPad($other) . "</td>";
            $tableBody .= "<td align=right width=18 height=18>" . decimalPad($totalDeductions) . "</td>";
            $tableBody .= "<td align=right width=18 height=18>" . decimalPad($grossPay - $totalDeductions) . "</td>";
            $tableBody .= "</tr>";
        }
    }
}
$tableBody .= "<tr>";
$tableBody .= "</tr>";
foreach ($weekTable as $weekId => $week) {
    $currentDate = strtotime($week['startDate']);
    $tableBody2 .= "<tr> <th >Drivers</th>";
    $tableBody2 .= "<th colspan='16' title=" . to_MDY($week['startDate']) . "-" . to_MDY($week['endDate']) . "> Week " . ($weekId + 1) . "</th>";
    $tableBody2 .= "</tr>";
    $tableBody2 .= "<tr><td colspan='17' align=center>" . to_MDY($week['startDate']) . "- " . to_MDY($week['endDate']) . "</td></tr>";
    $tableBody2 .= "<tr></tr><td></td><td align=center width=18  height=18>Sun<br/>" . date('m/d', $currentDate) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Mon<br/>" . date('m/d', strtotime('+1 day', $currentDate)) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Tue<br/>" . date('m/d', strtotime('+2 day', $currentDate)) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Wed<br/>" . date('m/d', strtotime('+3 day', $currentDate)) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Thu<br/>" . date('m/d', strtotime('+4 day', $currentDate)) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Fri<br/>" . date('m/d', strtotime('+5 day', $currentDate)) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Sat<br/>" . date('m/d', strtotime('+6 day', $currentDate)) . "</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Total Hours</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Hourly Rate</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Gross Pay</td>";
    $tableBody2 .= "<td align=center width=18  height=18>FICA</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Federal W/H</td>";
    $tableBody2 .= "<td align=center width=18  height=18>State W/H</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Other</td>";
    $tableBody2 .= "<td align=center width=18  height=18>Total deductables</td>";
Ejemplo n.º 29
0
<tr>
	<td width="30%" align="left" >
		<table class="invinfo" width='100%'>
			<caption>Martinez Frogs Inc.</caption>
			<tr><td width='177'><?echo$mfiInfo['addressLine1'];?></td></tr>
			<tr><td><?echo$mfiInfo['addressCity'].", ".$mfiInfo['addressState'].". ".$mfiInfo['addressZip'];?></td></tr>
			<tr><td><? echo "Ph # ".showPhoneNumber($mfiInfo['mfiTel']); ?></td></tr>
			<tr><td><? echo "Fax # ".showPhoneNumber($mfiInfo['mfiFax']); ?></td></tr>
		</table>
	</td>
	<td width="30%" align="center" >
		<img src='/mfi/img/logo2print.gif' width="140" height="100" />
	</td>
	<td width="30%" align="right" >
		<table class="invinfo">
			<tr><th>Date</th><td><? echo to_MDY($mfiInfo['CURDATE()']);?></td></tr>
		</table>
	</td>
</tr>
</table>

<table align="center" class="report" width="100%" cellspacing="0" >
<?php 
$tableHolder = "";
$ticketTotaled = 0;
$reportedTotaled = 0;
$paidTotaled = 0;
$ticketsProfitQuery = "\n\tSELECT\n\t\tbroker.brokerId,\n\t\tbroker.brokerName,\n\t\tbroker.brokerPercentage,\n\t\tSUM(ticketBrokerAmount * itemBrokerCost) as totalIncome,\n\t\tCOUNT(*) as totalTickets\n\tFROM\n\t\tticket\n\t\tJOIN item using (itemId)\n\t\tJOIN truck using (truckId)\n\t\tJOIN broker using (brokerId)\n\tWHERE\n\t\tticketDate BETWEEN '{$fromDate}' AND '{$toDate}'\n\tGROUP BY\n\t\tbrokerName\n\tORDER BY\n\t\tbrokerName\n";
$ticketsBalance = mysql_query($ticketsProfitQuery, $conexion);
while ($brokerTicketInfo = mysql_fetch_assoc($ticketsBalance)) {
    $ticketsReportedQuery = "\n\t\tSELECT\n\t\t\tSUM(ticketBrokerAmount * itemBrokerCost) as totalReported,\n\t\t\tCOUNT(*) as reportedTickets\n\t\tFROM\n\t\t\treport\n\t\t\tJOIN reportticket using (reportId)\n\t\t\tJOIN ticket using (ticketId)\n\t\t\tJOIN item using (itemId)\n\t\tWHERE\n\t\t\tbrokerId = " . $brokerTicketInfo['brokerId'] . "\n\t\t\tAND ( reportStartDate between '{$fromDate}' AND '{$toDate}' OR reportEndDate between '{$fromDate}' AND '{$toDate}')\n\t";
	foreach($currentTickets as $ticketId) {
		$currentActive[$ticketId] = true;
	}
}
$tickets = mysql_query($query, $conexion);
$tbody = "<tbody>";
$flag = true;
while($ticket = mysql_fetch_assoc($tickets)) {
	if(isset($currentActive[$ticket['ticketId']]))continue;
	
	$tbody.= "
	<tr ticketId='".$ticket['ticketId']."' id='ticket".$ticket['ticketId']."' ".($flag ? " class='bg' " : "" ).">
		<td class='first style2'>".$ticket['projectId']."<input type='hidden' value=\"".$ticket['projectName']."\" id='projectName".$ticket['ticketId']."'/></td>
		<td class='first style2'>".$ticket['customerName']."</td>
		<td class='first style2'>".$ticket['itemNumber']."</td>
		<td class='first style2'>".to_MDY($ticket['ticketDate'])."<input type='hidden' value='".to_MDY($ticket['ticketDate'])."' id='ticketDate".$ticket['ticketId']."'/></td>
		<td class='first style2'>".$ticket['materialName']."<input type='hidden' value='".$ticket['materialName']."' id='materialName".$ticket['ticketId']."'/></td>
		<td class='first style2'>".$ticket['itemDisplayFrom']."</td>
		<td class='first style2'>".$ticket['ticketMfi']."<input type='hidden' value='".$ticket['ticketMfi']."' id='ticketMfi".$ticket['ticketId']."'/></td>
		<td class='first style2'>".$ticket['ticketNumber']."<input type='hidden' value='".$ticket['ticketNumber']."' id='ticketNumber".$ticket['ticketId']."'/></td>
		<td class='number'>$".decimalPad($ticket['itemMaterialPrice'])."<input type='hidden' value='".decimalPad(decimalPad($ticket['itemMaterialPrice'])*decimalPad($ticket['ticketAmount']))."' id='price".$ticket['ticketId']."'/></td>
		<td class='number'>".decimalPad($ticket['ticketAmount'])."</td>
		<td class='number'>$".decimalPad($ticket['itemCustomerCost'])."</td>
		<td class='number'>".decimalPad($ticket['ticketBrokerAmount'])."</td>
		<td class='number'>$".decimalPad($ticket['itemBrokerCost'])."</td>
		<td>".($ticket['supplierInvoiceNumber']==null?"<img src='/mfi/img/23.png' class='add-ticket' width='20px'>":"<label class='rm-ticket'>".$ticket['supplierInvoiceNumber']."</label>")."</td>
	</tr>
	";
	
}