a2b_entity_invoice_detail.php

来自「asterisk用 的voip记费软件」· PHP 代码 · 共 803 行 · 第 1/2 页

PHP
803
字号
						<?php 	} ?>					</select>&nbsp;<input type="submit" class="form_input_button" name="submit" value="Update">					</form>					</td>            </tr>						<?php } ?>            <tr>              <td >&nbsp;</td>              <td >&nbsp;</td>            </tr>                    </table></td>      </tr>	         <tr>        <td valign="top"><table width="100%" align="left" cellpadding="0" cellspacing="0">   				<?php 				if (is_array($list_total_destination) && count($list_total_destination)>0)				{ 				?>				<tr>				<td colspan="5" align="center"> <b><?php echo gettext("Calls by Destination");?></b></font> </td>				</tr>			<tr class="invoice_subheading">              <td class="invoice_td" width="29%"><?php echo gettext("Destination");?> </td>              <td width="19%" class="invoice_td"><?php echo gettext("Duration");?> </td>			  <td width="20%" class="invoice_td"><?php echo gettext("Graphic");?> </td>			  <td width="11%" class="invoice_td"><?php echo gettext("Calls");?> </td>              <td width="21%" class="invoice_td" align="right"><?php echo gettext("Amount")." (".BASE_CURRENCY.")"; ?> </td>            </tr>			<?php  						$i=0;								foreach ($list_total_destination as $data){					$i=($i+1)%2;						$tmc = $data[1]/$data[3];								if ((!isset($resulttype)) || ($resulttype=="min")){  					$tmc = sprintf("%02d",intval($tmc/60)).":".sprintf("%02d",intval($tmc%60));						}else{									$tmc =intval($tmc);				}								if ((!isset($resulttype)) || ($resulttype=="min")){  						$minutes = sprintf("%02d",intval($data[1]/60)).":".sprintf("%02d",intval($data[1]%60));				}else{						$minutes = $data[1];				}				if ($mmax>0) 	$widthbar= intval(($data[1]/$mmax)*200); 					?>            <tr class="invoice_rows">              <td width="29%" class="invoice_td"><?php echo $data[0]?></td>              <td width="19%" class="invoice_td"><?php echo $minutes?> </td>			  <td width="20%" class="invoice_td"><img src="<?php echo Images_Path_Main ?>/sidenav-selected.gif" height="6" width="<?php echo $widthbar?>"> </td>			  <td width="11%" class="invoice_td"><?php echo $data[3]?> </td>              <td width="21%" align="right" class="invoice_td"><?php  display_2bill($data[2]) ?></td>            </tr>			<?php 	 }	 	 		 				if ((!isset($resulttype)) || ($resulttype=="min")){  				$total_tmc = sprintf("%02d",intval(($totalminutes/$totalcall)/60)).":".sprintf("%02d",intval(($totalminutes/$totalcall)%60));								$totalminutes = sprintf("%02d",intval($totalminutes/60)).":".sprintf("%02d",intval($totalminutes%60));			}else{				$total_tmc = intval($totalminutes/$totalcall);						}			 ?>   			 <tr >              <td width="29%" class="invoice_td">&nbsp;</td>              <td width="19%" class="invoice_td">&nbsp;</td>              <td width="20%" class="invoice_td">&nbsp; </td>			  <td width="11%" class="invoice_td">&nbsp; </td>			  <td width="21%" class="invoice_td">&nbsp; </td>			              </tr>            <tr class="invoice_subheading">              <td width="29%" class="invoice_td"><?php echo gettext("TOTAL");?> </td>              <td width="39%" class="invoice_td"colspan="2"><?php echo $totalminutes?></td>			  			  <td width="11%" class="invoice_td"><?php echo $totalcall?> </td>              <td width="21%" align="right" class="invoice_td"><?php  display_2bill($totalcost - $totalcost_did) ?> </td>            </tr>              <tr>              <td width="29%">&nbsp;</td>              <td width="19%">&nbsp;</td>              <td width="20%">&nbsp; </td>			  <td width="11%">&nbsp; </td>			  <td width="21%">&nbsp; </td>			              </tr>					<?php } ?>  			<!-- Start Here ****************************************-->			<?php											$mmax=0;				$totalcall=0;				$totalminutes=0;				$totalcost_day=0;				if (is_array($list_total_day) && count($list_total_day)>0)				{				foreach ($list_total_day as $data){						if ($mmax < $data[1]) $mmax=$data[1];					$totalcall+=$data[3];					$totalminutes+=$data[1];					$totalcost_day+=$data[2];				}				?>				<tr>				<td colspan="5" align="center"><b><?php echo gettext("Calls by Date");?></b> </td>				</tr>			  <tr class="invoice_subheading">              <td class="invoice_td" width="29%"><?php echo gettext("Date");?> </td>              <td width="19%" class="invoice_td"><?php echo gettext("Duration");?> </td>			  <td width="20%" class="invoice_td"><?php echo gettext("Graphic");?> </td>			  <td width="11%" class="invoice_td"><?php echo gettext("Calls");?> </td>              <td width="21%" class="invoice_td" align="right"><?php echo gettext("Amount")." (".BASE_CURRENCY.")"; ?> </td>            </tr>			<?php  						$i=0;								foreach ($list_total_day as $data){					$i=($i+1)%2;						$tmc = $data[1]/$data[3];								if ((!isset($resulttype)) || ($resulttype=="min")){  					$tmc = sprintf("%02d",intval($tmc/60)).":".sprintf("%02d",intval($tmc%60));						}else{									$tmc =intval($tmc);				}								if ((!isset($resulttype)) || ($resulttype=="min")){  						$minutes = sprintf("%02d",intval($data[1]/60)).":".sprintf("%02d",intval($data[1]%60));				}else{						$minutes = $data[1];				}				if ($mmax>0) 	$widthbar= intval(($data[1]/$mmax)*200); 						?>            <tr class="invoice_rows">              <td width="29%" class="invoice_td"><?php echo $data[0]?></td>              <td width="19%" class="invoice_td"><?php echo $minutes?> </td>			  <td width="20%" class="invoice_td"><img src="<?php echo Images_Path_Main ?>/sidenav-selected.gif" height="6" width="<?php echo $widthbar?>"> </td>			  <td width="11%" class="invoice_td"><?php echo $data[3]?> </td>              <td width="21%" align="right" class="invoice_td"><?php  display_2bill($data[2]) ?></td>            </tr>			 <?php 	 }	 	 		 					if ((!isset($resulttype)) || ($resulttype=="min")){  					$total_tmc = sprintf("%02d",intval(($totalminutes/$totalcall)/60)).":".sprintf("%02d",intval(($totalminutes/$totalcall)%60));									$totalminutes = sprintf("%02d",intval($totalminutes/60)).":".sprintf("%02d",intval($totalminutes%60));				}else{					$total_tmc = intval($totalminutes/$totalcall);							}			 			 ?>               			 <tr >              <td width="29%" class="invoice_td">&nbsp;</td>              <td width="19%" class="invoice_td">&nbsp;</td>              <td width="20%" class="invoice_td">&nbsp; </td>			  <td width="11%" class="invoice_td">&nbsp; </td>			  <td width="21%" class="invoice_td">&nbsp; </td>			              </tr>            <tr class="invoice_subheading">              <td width="29%" class="invoice_td"><?php echo gettext("TOTAL");?> </td>              <td width="39%" class="invoice_td"colspan="2"><?php echo $totalminutes?></td>			  			  <td width="11%" class="invoice_td"><?php echo $totalcall?> </td>              <td width="21%" align="right" class="invoice_td"><?php  display_2bill($totalcost_day) ?> </td>            </tr>                       <tr >              <td width="29%">&nbsp;</td>              <td width="19%">&nbsp;</td>              <td width="20%">&nbsp; </td>			  <td width="11%">&nbsp; </td>			  <td width="21%">&nbsp; </td>			              </tr>				 <?php }?> 										<!-- END HERE ******************************************-->        </table>				</td>      </tr>      <?php       if (is_array($list_total_did) && count($list_total_did)>0)				{      ?>	   <tr>	  <td>	  <!------------------------ DID Billing Here Starts ----------------------->				<table width="100%" align="left" cellpadding="0" cellspacing="0">   				<tr>				<td colspan="5" align="center"><font></font> <b><?php echo gettext("DID Billing")?></b></td>				</tr>			<tr class="invoice_subheading">			  <td width="17%" class="invoice_td"><?php echo gettext("Charge Date")?> </td>              <td class="invoice_td" width="12%"><?php echo gettext("DID")?> </td>              <td width="14%" class="invoice_td"><?php echo gettext("Country")?> </td>			  <td width="40%" class="invoice_td"><?php echo gettext("Description")?> </td>			  			                <td width="17%" class="invoice_td" align="right"><?php echo gettext("Amount")." (".BASE_CURRENCY.")"; ?> </td>            </tr>			<?php  						$i=0;								$totaldidcost = 0;								foreach ($list_total_did as $data)				{						$totaldidcost = $totaldidcost + convert_currency($currencies_list, $data[0], $data[5], BASE_CURRENCY);						?>			 <tr class="invoice_rows">			 <td width="17%" class="invoice_td"><?php echo $data[1]?> </td>              <td width="12%" class="invoice_td">&nbsp;<?php echo $data[4]; ?></td>              <td width="14%" class="invoice_td">&nbsp;<?php echo $data[3]; ?> </td>  			  <td width="40%" class="invoice_td"><?php echo $data[2]?></td>			  			                <td width="17%" align="right" class="invoice_td"><?php  echo convert_currency($currencies_list, $data[0], $data[5], BASE_CURRENCY)." ".BASE_CURRENCY?></td>            </tr>			 <?php				}				$totalcost = $totalcost  + $totaldidcost;			 ?>   			 <tr >              <td width="17%" class="invoice_td">&nbsp;</td>              <td width="12%" class="invoice_td">&nbsp;</td>              <td width="14%" class="invoice_td">&nbsp; </td>			  <td width="40%" class="invoice_td">&nbsp; </td>			  			  <td width="17%" class="invoice_td">&nbsp; </td>			              </tr>            <tr class="invoice_subheading">              <td width="17%" class="invoice_td"><?php echo gettext("TOTAL");?> </td>              <td class="invoice_td" >&nbsp;</td>			  			  <td width="14%" class="invoice_td">&nbsp; </td>			  <td width="40%" class="invoice_td">&nbsp;</td>              <td width="17%" align="right" class="invoice_td"><?php  display_2bill($totaldidcost) ?> </td>            </tr> 		            <tr >              <td width="17%">&nbsp;</td>              <td width="12%">&nbsp;</td>              <td width="14%">&nbsp; </td>			  <td width="40%">&nbsp; </td>			  			  <td width="17%">&nbsp; </td>			              </tr>				</table>				<!------------------------DID Billing ENDS Here ----------------------------->	  </td>	  </tr>	  <?php			 			 }			 ?>	   <!------------------------Extra Charges Start Here ----------------------------->	  <?php  				$i=0;						$extracharge_total = 0;		if (is_array($list_total_charges) && count($list_total_charges)>0)		{						  ?>			  <tr>	  <td>	  	  <table width="100%" align="left" cellpadding="0" cellspacing="0">   				<tr>				<td colspan="4" align="center"><font></font> <b><?php echo gettext("Extra Charges")?></b></td>				</tr>			<tr class="invoice_subheading">              <td class="invoice_td" width="18%"><?php echo gettext("Date")?> </td>              <td width="15%" class="invoice_td"><?php echo gettext("Type")?> </td>			  			  <td width="12%" class="invoice_td"><?php echo gettext("Description")?> </td>  			                <td width="25%" class="invoice_td" align="right"><?php echo gettext("Amount")." (".BASE_CURRENCY.")"; ?> </td>            </tr>			<?php  								foreach ($list_total_charges as $data)			{				 	$extracharge_total = $extracharge_total + convert_currency($currencies_list,$data[3], $data[6], BASE_CURRENCY) ;					?>			 <tr class="invoice_rows">              <td width="18%" class="invoice_td"><?php echo $data[2]?></td>              <td width="15%" class="invoice_td"><?php 			  if($data[4] == 1) //connection setup charges				{					echo gettext("Setup Charges");				}				if($data[4] == 2) //DID Montly charges				{					echo gettext("DID Montly Use");				}				if($data[4] == 3) //Subscription fee charges				{					echo gettext("Subscription Fee");				}				if($data[4] == 4) //Extra Misc charges				{					echo gettext("Extra Charges");				}			  ?> </td>  			  <td width="10%" class="invoice_td"><?php  echo $data[7]; ?></td>			                <td width="25%" align="right" class="invoice_td"><?php echo convert_currency($currencies_list,$data[3], $data[6],BASE_CURRENCY)." ".BASE_CURRENCY ?></td>            </tr>			 <?php			  }			  //for loop end here			   ?>			 <tr >              <td width="18%" class="invoice_td">&nbsp;</td>              <td width="15%" class="invoice_td">&nbsp;</td>              <td width="13%" class="invoice_td">&nbsp; </td>			  			 			  <td width="25%" class="invoice_td">&nbsp; </td>			              </tr>            <tr class="invoice_subheading">              <td width="18%" class="invoice_td"><?php echo gettext("TOTAL");?> </td>              <td class="invoice_td" >&nbsp;</td>			  			  <td width="17%" class="invoice_td">&nbsp; </td>              <td width="25%" align="right" class="invoice_td"><?php echo display_2bill($extracharge_total) ?> </td>            </tr>			            <tr >              <td width="18%">&nbsp;</td>              <td width="15%">&nbsp;</td>              <td width="13%">&nbsp; </td>			  			  <td width="25%">&nbsp; </td>			              </tr>				</table>			  	  </td>	  </tr>	  <?php	   }	   //if check end here	   $totalcost = $totalcost + $extracharge_total;	   ?>	  <!------------------------Extra Charges End Here ----------------------------->	  	 <tr>	 <td>&nbsp;</td>	 </tr> 	 <tr class="invoice_subheading">	 <td  align="right" class="invoice_td"><?php echo gettext("Total");?> = <?php echo display_2bill($totalcost);?>&nbsp;</td>	 </tr>	 <tr class="invoice_subheading">	 <td  align="right" class="invoice_td"><?php echo gettext("VAT");?> = <?php 	 $prvat = ($vat / 100) * $totalcost;	 display_2bill($prvat);?>&nbsp;</td>	 </tr>	 <tr class="invoice_subheading">	 <td  align="right" class="invoice_td"><?php echo gettext("Grand Total");?> = <?php echo display_2bill($totalcost + $prvat);?>&nbsp;</td>	 </tr>	 <tr>	 <td>&nbsp;</td>	 </tr>	  <?php if ($exporttype != "pdf"){?>      <tr>        <td><table cellspacing="0" cellpadding="0">            <tr>              <td width="15%"><?php echo gettext("Status");?> :&nbsp; </td>             <td width="20%"><?php if($info_customer[0][12] == 't') {?>			  <img width="18" height="7" src="<?php echo Images_Path;?>/connected.gif">			  <?php }			  else			  {			  ?>			  <img width="18" height="7" src="<?php echo Images_Path;?>/terminated.gif">			  <?php }?></td>              <td width="65%"><img width="18" height="7" src="<?php echo Images_Path;?>/connected.gif">&nbsp;<?php echo gettext("Connected");?>&nbsp;&nbsp;&nbsp;			  <img width="22" height="7" src="<?php echo Images_Path;?>/terminated.gif">&nbsp; <?php echo gettext("DisConnected");?></td>            </tr>        </table></td>      </tr>      <tr>        <td><table width="100%" cellpadding="0" cellspacing="0">            <tr>              <td valign="top"><table width="400" height="22" align="left" cellpadding="0" cellspacing="0">                                  </table>                  <table cellpadding="0">                    <tr>                      <td>&nbsp;</td>                    </tr>                  </table>        </table></td>      </tr>	  <?php } ?>    </table><?php$smarty->display( 'footer.tpl');?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?