$queryTickets .= "limit ".$_GET['listed']; } //echo $queryTickets; //echo $queryTickets; $colorFlag=true; $terms = mysql_query($queryTickets,$conexion); $numTerms = mysql_num_rows($terms); $tbody = "<tbody>"; while($term = mysql_fetch_assoc($terms)){ //get invoice balance $invoiceTotal = getInvoiceTotal($term['invoiceId'], $conexion); $invoicePaid = getInvoicePaid($term['invoiceId'], $conexion); $balance = decimalPad($invoiceTotal - $invoicePaid); $cheques = mysql_fetch_assoc(mysql_query("select count(*) as paidCheques from receiptcheques WHERE invoiceId = ".$term['invoiceId'], $conexion)); if($cheques['paidCheques'] > 0 && $balance <= 0)continue; //if already paid continue if($balance <= 0)/*continue;*/$paid = true; else $paid = false; // //TODO: try with mysql query //if($_GET['vendorId']!=0 && $_GET['vendorId']!=$term['vendorId'])continue; //if($_GET['supplierId']!=0 && $_GET['supplierId']!=$term['supplierId'])continue; /*if($term['supplierInvoiceId'] == null){ }else{ $supplierInvoiceQuery = "select * from supplierinvoice where supplierInvoiceId = ".$term['supplierInvoiceId']; $supplierInvoices = mysql_fetch_assoc(mysql_query($supplierInvoiceQuery));
$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>"; } $tableHolder .= "</tr>\n"; } } //echo "<tr><td colspan='6'></td><td>".decimalPad($globalTotal)."</td><td>".decimalPad($globalTotal - $paidTotal)."</td><td>".decimalPad($paidTotal)."</td><td colspan='3'></td></tr>"; ?> <tr> <th>Cheque Number</th> <th>Date</th> <th>Cheque Amount</th> <th>Paid</th> <th>Amount</th> <th>Invoice</th>
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>
$actual=true; $colorFlag=true; $tdClass=""; if($numitems>0) { while($item=mysql_fetch_assoc($items)) { echo "<tr id='item".$item['itemId']."'>"; echo "<td ".$tdClass.">".$item['projectId']."</td>"; echo "<td ".$tdClass.">".$item['itemNumber']."</td>"; echo "<td ".$tdClass.">".$item['materialName']."</td>"; echo "<td ".$tdClass.">".$item['itemDisplayFrom']."</td>"; echo "<td ".$tdClass.">".$item['itemDisplayTo']."</td>"; echo "<td ".$tdClass." align='right'>".decimalPad($item['itemCustomerCost'])."</td>"; echo "<td ".$tdClass." align='right'>".decimalPad($item['itemBrokerCost'])."</td>"; echo "<td ".$tdClass." align='right'>".decimalPad($item['itemMaterialPrice'])."</td>"; echo "</tr>"; $colorFlag=!$colorFlag; if($colorFlag)$tdClass=""; else $tdClass="class='bg'"; } } ?> </tbody> </table> </div> <? } ?> </div>
</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> </p>--> </div> </div> <div id="right-column"> <strong class="h">INFO</strong> <div class="box">
} $fica = $grossPay * ($localInfo['sssec'] + $localInfo['medicare']) / 100; $ilwithholding = $grossPay - 78.8; $whtax = ($ilwithholding < 0 ? 0 : $ilwithholding) * $localInfo['withHoldingTax']; $fed = $grossPay * $localInfo['fed']; $other = $grossPay * $localInfo['other']; $totalDeductions = $fica + $whtax + $fed + $other + $other; $tableBody2 .= "<td align=right width=18 height=18>" . ($driverRate == 0 ? "N/A" : ($hourlyRate == 0 ? "N/A" : decimalPad($grossPay / $hourlyRate))) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($driverRate) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($grossPay) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($fica) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($fed) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($whtax) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($other) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($totalDeductions) . "</td>"; $tableBody2 .= "<td align=right width=18 height=18>" . decimalPad($grossPay - $totalDeductions) . "</td>"; $tableBody2 .= "</tr>"; } } } } $tableBody2 .= "<tr>"; $tableBody2 .= "</tr>"; echo $tableBody; echo "<tr><td colspan='17' ><br/><br/></td></tr>"; echo $tableBody2; //p_array($brokerPerWeek); //p_array($drivers); //p_array($brokersSum); ?> </table>
$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>"; echo "</tr>"; $total += $invoiceInfo1['ticketAmount'] * $invoiceInfo2['itemCustomerCost']; $count++; } echo "<tr><td colspan='2' align=center> {$count} Tickets </td><td colspan='7'></td></tr>"; echo "<tr><td colspan='7'></td><th><span>Total</span></th><td align=right >" . decimalPad($total, 2); echo "</td></tr>"; ?> </table> </body> </html>
continue; } echo $row; $hiddenTable .= $hiddenRow; $subtotal += $invoices3Info['ticketBrokerAmount'] * $invoices4Info['itemBrokerCost']; $count++; } echo "<tr><td colspan='2' align=center> {$count} Tickets </td><td colspan='5'></td><th>Subtotal</th><td align=right >" . decimalPad($subtotal); echo "</td><td></td><td align=right >" . decimalPad($total); echo "</td></tr>"; echo "<tr><td colspan='9'></td><th><span>Total</span></th><td align=right ><strong>" . decimalPad($total, 2); echo "</strong></td></tr>"; //$hiddenTable.="<tr><td colspan='2' align=center> $count Tickets </td><td colspan='5'></td><td><strong>Subtotal</strong></td><td align=right ><strong>".decimalPad($subtotal);echo"</strong></td></tr>"; //$hiddenTable.="<tr><td colspan='7'></td><td><span>Discount</span></td><td align=right >".decimalPad(decimalPad($total) - decimalPad($subtotal));echo"</td></tr>"; //$hiddenTable.="<tr><td colspan='7'></td><td><span>Total</span></td><td align=right >".decimalPad($total);echo"</td></tr>"; $preHidenTable .= "<tr>\n\t\t<td colspan='2'><strong> {$count} Tickets</strong></td>\n\t\t<td><strong>Subtotal</strong></td><td align='right'><strong>" . decimalPad($subtotal, 2) . "</strong></td>\n\t\t<td><strong>Discount</strong></td><td align='right'><strong>" . decimalPad(decimalPad($total) - decimalPad($subtotal), 2) . "</strong></td>\n\t\t<td><strong>Total</strong></td><td align='right'><strong>" . decimalPad($total, 2) . "</strong></td>\n\t</tr>\n"; ?> </table> </div> <div class="hide_and_print"> <table align="center" class="report" width="100%" cellspacing="0" > <? echo $preHidenTable; ?> </table> <table align="center" class="report" width="100%" cellspacing="0" > <tr> <th >Date</th> <th >Customer</th> <th >Truck</th>
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();
<input type='hidden' id='creditAmount' name='creditAmount' value="0" /> <input type='hidden' id='missingAmount' name='missingAmount' value="<?echo decimalPad($missing);?>" /> <th class='first'>Number</th> <th>Date</th> <th>Credit value</th> <th>Amount</th> <th class='last'>Pay</th> </tr> <? while($credit = mysql_fetch_assoc($credits)){ $creditValue = decimalPad($credit['customerCreditAmount']); echo "<tr>"; echo "<td>".$credit['customerSuperCheckNumber']."</td>"; echo "<td>".to_MDY($credit['customerSuperCheckDate'])."</td>"; echo "<td><input type='hidden' id='max".$credit['customerSuperCheckId']."' value='$creditValue' />".$creditValue."</td>"; echo "<td><input type='text' id='payable".$credit['customerSuperCheckId']."' value='".decimalPad( $creditValue > $missing? $missing : $creditValue)."'/></td>"; echo "<td><img src='/trucking/img/87.png' class='submitable' width='20px' height='20px' customerSuperCheckId='".$credit['customerSuperCheckId']."' creditAmount='".$credit['customerCreditAmount']."' /></td>"; echo "</tr>"; }?> </table> </div> <? } ?>
$projectTotal = $project['projectIncome'] - ($project['projectMaterialExpense'] + $project['projectBrokerExpense']); $total += $projectTotal; $tableBody .= "<tr>\r\n\t\t<td>" . $projectInfo['projectName'] . "</td>\r\n\t\t<td align=right >" . decimalPad($project['projectIncome']) . "</td>\r\n\t\t<td align=right >" . decimalPad($project['projectBrokerExpense']) . "</td>\r\n\t\t<td align=right >" . decimalPad($project['projectMaterialExpense']) . "</td>\r\n\t\t<td align=right >" . decimalPad($projectTotal) . "</td>\r\n\t</tr>"; $totalIncome += $project['projectIncome']; $totalBrokerExpense += $project['projectBrokerExpense']; $totalMaterialExpense += $project['projectMaterialExpense']; } echo "<tr>\r\n\t<td></td>\r\n\t<th>Total Income per customer</th>\r\n\t<th>Total Broker Expense</th>\r\n\t<th>Total Material Expense</th>\r\n\t<th>Total Gross Profit</th>\r\n</tr>"; echo "<tr>\r\n\t<td></td>\r\n\t<td align=right >" . decimalPad($totalIncome) . "</td>\r\n\t<td align=right >" . decimalPad($totalBrokerExpense) . "</td>\r\n\t<td align=right >" . decimalPad($totalMaterialExpense) . "</td>\r\n\t<td align=right >" . decimalPad($total) . "</td>\r\n</tr>"; ?> <tr> <th >Project</th> <th >Gross Income</th> <th >Broker Expenses</th> <th >Material Expenses</th> <th >Gross Profit</th> </tr> <?php echo $tableBody; echo "<tr>\r\n\t<th>Totals</th>\r\n\t<td align=right >" . decimalPad($totalIncome) . "</td>\r\n\t<td align=right >" . decimalPad($totalBrokerExpense) . "</td>\r\n\t<td align=right >" . decimalPad($totalMaterialExpense) . "</td>\r\n\t<td align=right >" . decimalPad($total) . "</td>\r\n</tr>"; echo "<tr><td colspan='1' align=center> " . count($tablearray) . " Projects </td><td colspan='4'></td></tr>"; echo "<tr><td colspan='3'></td><th><span>Total GP</span></th><td align=right >" . decimalPad($total); echo "</td></tr>"; ?> </table> </form> </body> </html>
<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'>"; echo "<img src='/trucking/img/bg-th-left.gif' width='8' height='7' alt='' class='left' />";
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> "; } $jsondata['table'] = $tbody."</tbody>"; $jsondata['query'] = $query; echo json_encode($jsondata); mysql_close(); ?>
<?php include_once '../function_header.php'; include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; $supplier = $_REQUEST['supplier']; if ($supplier == '0' || $supplier == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a supplier', '')); } $material = $_REQUEST['material']; if ($material == '0' || $material == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a material', '')); } $price = $_REQUEST['price']; if ($price == '0' || $price == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a price', '')); } $info = $_REQUEST['info']; //die(wrapError(-2,'Feature not ready')); saveSupplierMaterial($conexion, $supplier, $material, $price, $info); $materialInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM material WHERE materialId = '{$material}'", $conexion)); $delImg = createActionIcon(IMG_DELETE, 'delete' . $supplier . "-" . $material, 'Delete Price', '../submit/deleteSupplierMaterial.php', 'supplier=' . $supplier . '&material=' . $material, 'delete', " width='22' height='22'"); $newLine = printRow('', array($materialInfo['materialName'], decimalPad($price), date('m/d/Y'), $delImg)); $response['code'] = 0; $response['created'] = ""; $response['newLine'] = $newLine; echo json_encode($response);
echo "</td>"; echo "<td align=right >" . decimalPad($ticket['itemBrokerCost']); echo "</td>"; echo "<td align=right >" . decimalPad($ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost']); echo "</td>"; if (strpos(strtolower($ticket['itemDescription']), "toll") === FALSE) { echo "<td>" . decimalPad($projectInfo['brokerPercentage']) . "%</td>"; echo "<td align=right >" . decimalPad($ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost'] * ($percentage / 100)); echo "</td>"; $total += $ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost'] * ($percentage / 100); } else { echo "<td>" . decimalPad('100') . "%</td>"; echo "<td align=right >" . decimalPad($ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost']); echo "</td>"; $total += $ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost']; } echo "</tr>"; $subtotal += $ticket['ticketBrokerAmount'] * $ticket['itemBrokerCost']; $count++; } echo "<tr><td colspan='2' align=center> {$count} Tickets </td><td colspan='5'></td><th>Subtotal</th><td align=right >" . decimalPad($subtotal); echo "</td><td></td><td align=right >" . decimalPad($total); echo "</td></tr>"; echo "<tr><td colspan='9'></td><th><span>Total</span></th><td align=right ><strong>" . decimalPad($total); echo "</strong></td></tr>"; ?> </table> </body> </html>
UPDATE address SET addressLine1='".mysql_real_escape_string($_REQUEST['addressLine1'])."', addressLine2='".mysql_real_escape_string($_REQUEST['addressLine2'])."', addressCity='".mysql_real_escape_string($_REQUEST['addressCity'])."', addressState='".mysql_real_escape_string($_REQUEST['addressState'])."', addressZip='".mysql_real_escape_string($_REQUEST['addressZip'])."', addressPOBox='".mysql_real_escape_string($_REQUEST['addressPOBox'])."', addressLat='".$coordinates[0]."', addressLong='".$coordinates[1]."' WHERE addressId=".$_REQUEST['a']." "; //insert //echo $queryAddress; mysql_query ($queryAddress, $conexion); */ $queryItem = "\r\nUPDATE\r\n\tfakeitem\r\nSET\r\n\t\titemMaterialPrice='" . mysql_real_escape_string(decimalPad($_REQUEST['materialPrice'])) . "',\r\n\t\titemBrokerCost='" . mysql_real_escape_string(decimalPad($_REQUEST['itemBrokerCost'])) . "',\r\n\t\titemCustomerCost='" . mysql_real_escape_string(decimalPad($_REQUEST['itemCustomerCost'])) . "',\r\n\t\titemType='" . mysql_real_escape_string($_REQUEST['itemType']) . "',\r\n\t\titemDescription='" . mysql_real_escape_string($_REQUEST['itemDescription']) . "'\r\nWHERE\r\n\t\titemId=" . $_REQUEST['i'] . "\r\n\t\t"; //echo $queryItem; mysql_query($queryItem, $conexion); $queryLog = "\r\ninsert into \r\n\tlog\r\n\t\t(logDate, userId, logAction, logDescription)\r\n\tvalues\r\n\t\t(NOW()," . $_SESSION['user']->id . ",2,' " . mysql_real_escape_string($_REQUEST['i']) . " into fakeitem');"; /* For Log Actions: 1 -> New (insert into) 2 -> Edit (update from) 3 -> Delete (delete from) */ mysql_query($queryLog, $conexion); mysql_close($conexion); header("Location:/trucking/php/view/viewProposal.php?i=" . $_REQUEST['i']);
function getReportTotal($reportId, $conexionHandler) { $queryTotal = "\r\n\t\tSELECT\r\n\t\t\tSUM( (ticketBrokerAmount * itemBrokerCost) * (ticketPercentage)/100 ) as totalReported\r\n\t\tFROM\r\n\t\t\treportticket\r\n\t\t\tJOIN report using (reportId)\r\n\t\t\tJOIN ticket using (ticketId)\r\n\t\t\tJOIN item using (itemId)\r\n\t\tWHERE\r\n\t\t\treportId = " . $reportId . "\r\n\t"; $reportInfo = mysql_fetch_assoc(mysql_query($queryTotal, $conexionHandler)); return decimalPad($reportInfo['totalReported']); }
} 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> <th>Broker</th> <th>Report</th> <th>reported</th> </tr> <? echo $tableHolder; ?> </table> </form>
$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> <th>Invoice Number</th> <th>Date</th> <th>Aging</th> <th>Due Date</th> <th>Amount</th> <th>Balance</th> </tr> <? echo $tableHolder; echo "<tr><td colspan='5'></td><td align='right'>".decimalPad($totalAmount)."</td><td align='right'>".decimalPad($totalBalance)."</td></tr>"; ?> </table>
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>"; $jsondata['table']=$tbody; $jsondata['query']=$queryTickets;
<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>
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'> <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'>Payments Information</th> </tr> <?php $flag = true; while ($payment = mysql_fetch_assoc($payments)) { echo printTuple($flag ? '' : "class='bg'", $payment['invoiceId'], "\$ " . decimalPad($payment['receiptchequesAmount'])); $flag = !$flag; } ?> </table> </div> <?php }
<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> <div class="box">
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>"; } $tbody.="</table>"; $jsondata['objectId'] = 'brokerInvoicesTable'; $jsondata['table'] = $tbody;
$vendorLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_VENDOR, createGenericNyroableAttributesSmall($itemInfo['vendorId'], 'vendor')); echo printTuple($flag ? '' : "class='bg'", 'Item Id', $itemInfo['fakeitemId']); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Customer', $itemInfo['customerId'] . " " . $itemInfo['customerName'], $customerLink); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Project', $itemInfo['fakeprojectId'] . " " . $itemInfo['fakeprojectName'], $estimateLink); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Vendor', $itemInfo['vendorName'], $vendorLink); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Supplier', $itemInfo['supplierName'], $supplierLink); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Material', $itemInfo['materialName']); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'From', $itemInfo['itemDisplayFrom']); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'To', $itemInfo['itemDisplayTo']); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Material', decimalPad($itemInfo['itemMaterialPrice'])); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Broker', decimalPad($itemInfo['itemBrokerCost'])); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Customer', decimalPad($itemInfo['itemCustomerCost'])); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Type', $itemInfo['itemTypeString']); $flag = !$flag; echo printTuple($flag ? '' : "class='bg'", 'Item Description', $itemInfo['itemDescription']); $flag = !$flag; ?> </table> </div>
<?php include "../commons.php"; include "../conexion.php"; ini_set('display_errors', 'Off'); ini_set('display_startup_errors', 'Off'); error_reporting(0); session_start(); //p_array($_REQUEST); //p_array($_SESSION); $queryItem = "\r\ninsert into\r\n\tfakeitem\r\n\t(\r\n\t\titemNumber,\r\n\t\tfakeprojectId,\r\n\t\tsupplierId,\r\n\t\tmaterialId,\r\n\t\tfromAddressId,\r\n\t\ttoAddressId,\r\n\t\titemDisplayTo,\r\n\t\titemDisplayFrom,\r\n\t\titemMaterialPrice,\r\n\t\titemBrokerCost,\r\n\t\titemCustomerCost,\r\n\t\titemType,\r\n\t\titemDescription\r\n\t)\r\n\tvalues\r\n\t(\r\n\t\t'" . mysql_real_escape_string($_REQUEST['itemNumber']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['fakeprojectId']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['supplierId']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['material']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['fromAddressId']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['toAddressId']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['toAddress']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['fromAddress']) . "',\r\n\t\t'" . mysql_real_escape_string(decimalPad($_REQUEST['materialPrice'])) . "',\r\n\t\t'" . mysql_real_escape_string(decimalPad($_REQUEST['itemClientCost'])) . "',\r\n\t\t'" . mysql_real_escape_string(decimalPad($_REQUEST['itemCustomerCost'])) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['itemType']) . "',\r\n\t\t'" . mysql_real_escape_string($_REQUEST['itemDescription']) . "'\r\n\t)"; //echo $queryItem; mysql_query($queryItem, $conexion); /* For Log Actions: 1 -> New (insert into) 2 -> Edit (update from) 3 -> Delete (delete from) */ mysql_close($conexion); header("Location:newProposal.php");
if(isset($_GET['projectId'])) { $queryItems = "SELECT * FROM item JOIN material using (materialId) JOIN supplier using (supplierId) WHERE projectId = '".$_GET['projectId']."'"; $result = mysql_query($queryItems,$conexion); while($row = mysql_fetch_assoc($result)){ //$jsondata[$row['itemId']]=$row['itemNumber']; $jsondata[$row['itemId']]=$row['materialName']." to ".$row['supplierName']." @@ MC (".decimalPad($row['itemMaterialPrice']).") CC (".decimalPad($row['itemCustomerCost']).") BC (".decimalPad($row['itemBrokerCost']).")"; } /**//* $queryItems = "SELECT * FROM item JOIN material using (materialId) JOIN (SELECT supplierId, supplierName, addressId as sai, addressLine1 as toAddress FROM supplier JOIN address using (addressId) ) as SA using (supplierId)
?> <tr class="bg"> <td class="first"><strong>Dump Ticket:</strong><span style="color:red;">*</span></td> <td class="last"><?if(isset($lastVal['ticketNumber'])&&$lastVal['ticketNumber']!=0)echo $lastVal['ticketNumber'];?></td> </tr> <tr> <td class="first" width="172"><strong>Date:</strong><span style="color:red;">*</span></td> <td class="last"><?if(isset($lastVal['ticketDate']))echo to_MDY($lastVal['ticketDate']);?></td> </tr> <tr class="bg"> <td class="first"><strong>Customer Amount:</strong><span style="color:red;">*</span></td> <td class="last"><?if(isset($lastVal['ticketAmount']))echo decimalPad($lastVal['ticketAmount'])." ".$LTH[$lastVal['itemType']];?></td> </tr> <tr> <td class="first"><strong>Broker Amount:</strong><span style="color:red;">*</span></td> <td class="last"><?if(isset($lastVal['ticketBrokerAmount']))echo decimalPad($lastVal['ticketBrokerAmount'])." ".$LTH[$lastVal['itemType']];?></td> </tr> <tr class='bg'> <td class="first" width="172"><strong>In Invoice:</strong><span style="color:red;">*</span></td> <td class="last"><?if(isset($lastVal['invoiceId'])&& $lastVal['invoiceId']!=null)echo $lastVal['invoiceId'];else echo"--";?></td> </tr> <tr> <td class="first" width="172"><strong>In Broker Report:</strong><span style="color:red;">*</span></td> <td class="last"><?if(isset($lastVal['reportId'])&& $lastVal['reportId']!=null)echo $lastVal['reportId'];else echo"--";?></td> </tr> <tr class='bg'> <td class="first" width="172"><strong>In Supplier Invoice:</strong><span style="color:red;">*</span></td> <td class="last"> <? if(isset($lastVal['supplierInvoiceId'])&& $lastVal['supplierInvoiceId']!=null && $lastVal['supplierInvoiceId']!="--" ){ $supplierInfo = mysql_fetch_assoc(mysql_query("select * from supplierinvoice join supplier using (supplierId) where supplierInvoiceId = ".$lastVal['supplierInvoiceId']));
$tableHolder .= "<td>" . decimalPad($brokerReported) . "</td>"; $tableHolder .= "<td>(" . ($brokerTicketInfo['totalTickets'] - $reportedInfo['reportedTickets']) . ")</td>"; $tableHolder .= "<td>" . decimalPad($brokerPaid) . "</td>"; $tableHolder .= "<td>(" . $paidInfo['chequesPaid'] . ")</td>"; $tableHolder .= "</tr>"; $ticketTotaled += $brokerIncome; $reportedTotaled += $brokerReported; $paidTotaled += $brokerPaid; } //echo $ticketsProfitQuery; ?> <tr> <td colspan='2'></td> <td><? echo decimalPad($ticketTotaled);?></td><td></td> <td><? echo decimalPad($reportedTotaled);?></td><td></td> <td><? echo decimalPad($paidTotaled);?></td><td></td> </tr> <tr> <th colspan='2'>Broker</th> <th >Income</th><th>Total tickets</th> <th >In report</th><th>Not reported</th> <th >Paid</th><th># cheques</th> </tr> <?php echo $tableHolder; ?> </table> </body> </html>
</tr> <tr class="bg"> <td class="first"><strong>Prevailing Wage for Class 2:</strong></td> <td class="last"><input type="text" class="text" id='projectClass2PW' name='projectClass2PW' <?echo "value='". decimalPad($lastVal['projectClass2PW'])."'";?> /></td> </tr> <tr> <td class="first"><strong>Prevailing Wage for Class 3:</strong></td> <td class="last"><input type="text" class="text" id='projectClass3PW' name='projectClass3PW' <?echo "value='". decimalPad($lastVal['projectClass3PW'])."'";?> /></td> </tr> <tr class="bg"> <td class="first"><strong>Prevailing Wage for Class 4:</strong></td> <td class="last"><input type="text" class="text" id='projectClass4PW' name='projectClass4PW' <?echo "value='". decimalPad($lastVal['projectClass4PW'])."'";?> /></td> </tr> <tr> <td class="first"><strong>Prevailing Wage for Broker:</strong></td> <td class="last"><input type="text" class="text" id='projectBrokerPW' name='projectBrokerPW' <?echo "value='". decimalPad($lastVal['projectClassBrokerPW'])."'";?> /></td> </tr> <tr class="bg"> <td class="first"><strong>Project Under:</strong></td> <td class="last"> <input type="radio" id='projectUnderNoAct' name='projectUnder' value='<?echo NO_ACT; ?>' <?if($lastVal['projectUnder'] == NO_ACT)echo " checked ";?> /><label for='projectUnderNoAct'>No Act/Other</label><br/> <input type="radio" id='projectUnderIPW' name='projectUnder' value='<?echo ILLINOIS_PW_ACT; ?>' <?if($lastVal['projectUnder'] == ILLINOIS_PW_ACT)echo " checked ";?>/><label for='projectUnderIPW'>Illinois Prevailing Wage</label><br/> <input type="radio" id='projectUnderDBA' name='projectUnder' value='<?echo DAVIS_BACON_ACT; ?>' <?if($lastVal['projectUnder'] == DAVIS_BACON_ACT)echo " checked ";?>/><label for='projectUnderDBA'>Davis Bacon Act</label> </td> </tr> <tr> <td class="first"><strong>Approval Number:</strong></td> <td class="last"><input type="text" class="text" id='projectApprovalNumber' name='projectApprovalNumber' <?if(isset($lastVal['projectApprovalNumber']))echo"value='".$lastVal['projectApprovalNumber']."'";?> /></td> </tr> </table> <table>