Foros del Web » Programando para Internet » PHP »

¿Alguien me ilumina para retocar este template PHP?

Estas en el tema de ¿Alguien me ilumina para retocar este template PHP? en el foro de PHP en Foros del Web. Buenas chicos Estoy con un programa de facturación para mi negocio, el programa es Myclientbase Bien, este tiene unos templates de factura (sin tasas con ...
  #1 (permalink)  
Antiguo 27/08/2012, 15:12
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
¿Alguien me ilumina para retocar este template PHP?

Buenas chicos

Estoy con un programa de facturación para mi negocio, el programa es Myclientbase

Bien, este tiene unos templates de factura (sin tasas con tasas o consulta por ejemplo...)

Yo quiero hacer modificaciones por ejemplo al de uso de tasas.

La factura se presenta así, para que lo veáis gráficamente:



Yo quiero hacer dos cambios:

1.- Que el cliente que sale debajo de las letras borrosas (cliente inventado), salga formateado a la derecha en vez de a la izquierda como véis (no me es prioritario)

2.- Que desde "subtotal" hasta "total pendiente" aparezca donde está pero al final de la página, no directamente debajo de los productos o u y servicios... No se si me explico... Es que tal y como está la hoja, queda toda vacía desde este punto

El código es:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
			<?php echo $this->lang->line('invoice_number'); ?>
			<?php echo invoice_id($invoice); ?>
		</title>
		<style type="text/css">

			body {
				font-family: Verdana, Geneva, sans-serif;
				font-size: 12px;
				margin-left: 35px;
				margin-right: 45px;
			}

			th {
				border: 1px solid #666666;
				background-color: #D3D3D3;
			}

			h2 {
				margin-bottom: 0px;
			}

			p.notop {
				margin-top: 0px;
			}

		</style>
	</head>
	<body>

		<table width="100%">
			<tr>
				<td width="60%" valign="top">
					<?php echo invoice_logo($output_type); ?>
					<h2><?php echo invoice_from_company_name($invoice); ?></h2>
					<p class="notop">
						<?php echo invoice_from_name($invoice); ?><br />
						<?php echo invoice_from_address($invoice); ?><br />
						<?php if (invoice_from_address_2($invoice)) { echo invoice_from_address_2($invoice) . '<br />'; } ?>
						<?php echo invoice_from_city_state_zip($invoice); ?><br />
						<?php echo invoice_from_country($invoice); ?><br />
						<?php echo invoice_tax_id($invoice); ?>
					</p>
				</td>
				<td width="40%" align="right" valign="top">
					<h2><?php echo $this->lang->line('invoice'); ?></h2>
					<p class="notop">
						<?php echo $this->lang->line('invoice_number'); ?>
						<?php echo invoice_id($invoice); ?><br />
						<?php echo $this->lang->line('invoice_date'); ?>:
						<?php echo invoice_date_entered($invoice); ?><br />
						<?php echo $this->lang->line('due_date'); ?>:
						<?php echo invoice_due_date($invoice); ?>
					</p>

				</td>
			</tr>
		</table>

		<p>
			<?php echo invoice_to_client_name($invoice); ?><br />
			<?php echo invoice_to_address($invoice); ?><br />
			<?php if (invoice_to_address_2($invoice)) { echo invoice_to_address_2($invoice) . '<br />'; } ?>
			<?php echo invoice_to_city($invoice) . ', ' . invoice_to_state($invoice) . ' ' . invoice_to_zip($invoice) . ' ' . invoice_to_country($invoice); ?><br />
			<?php echo invoice_client_tax_id($invoice); ?>
		</p>

		<br />

		<table style="width: 100%;">
			<tr>
				<th width="10%">
					<?php echo $this->lang->line('quantity'); ?>
				</th>
				<th width="20%">
					<?php echo $this->lang->line('item_name'); ?>
				</th>
				<th width="30%">
					<?php echo $this->lang->line('item_description'); ?>
				</th>
				<th width="10%" align="right">
					<?php echo $this->lang->line('unit'); ?>
				</th>
                <th width="10%" align="right">
                    <?php echo $this->lang->line('tax_rate'); ?>
                </th>
				<th width="10%" align="right">
					<?php echo $this->lang->line('tax'); ?>
				</th>
				<th width="10%" align="right">
					<?php echo $this->lang->line('cost'); ?>
				</th>
			</tr>
			<?php foreach ($invoice->invoice_items as $item) { ?>
			<tr>
				<td align="center">
					<?php echo invoice_item_qty($item); ?>
				</td>
				<td>
					<?php echo invoice_item_name($item); ?>
				</td>
				<td>
					<?php echo invoice_item_description($item); ?>
				</td>
				<td align="right">
					<?php echo invoice_item_unit_price($item); ?>
				</td>
                <td align="right">
                    <?php echo invoice_item_tax_rate($item); ?>
                </td>
				<td align="right">
					<?php echo invoice_item_tax($item); ?>
				</td>
				<td align="right">
					<?php echo invoice_item_total($item); ?>
				</td>
			</tr>
			<?php } ?>
			<tr>
				<td colspan="3"></td>
				<td colspan="4">
					<hr />
				</td>
			</tr>

			<tr>
				<td colspan="6" align="right">
					<?php echo $this->lang->line('subtotal'); ?>
				</td>
				<td align="right">
					<?php echo invoice_subtotal($invoice); ?>
				</td>
			</tr>

			<?php foreach ($invoice->invoice_tax_rates as $invoice_tax_rate) { ?>
			<?php if (invoice_has_tax($invoice_tax_rate)) { ?>
			<tr>
				<td colspan="6" align="right">
					<?php echo invoice_tax_rate_name($invoice_tax_rate); ?>
				</td>
				<td align="right">
					<?php echo invoice_tax_rate_amount($invoice_tax_rate); ?>
				</td>
			</tr>
			<?php } ?>
			<?php } ?>

			<?php if ($invoice->invoice_shipping > 0) { ?>
			<tr>
				<td colspan="6" align="right">
					<?php echo $this->lang->line('shipping'); ?>
				</td>
				<td align="right">
					<?php echo invoice_shipping($invoice); ?>
				</td>
			</tr>
			<?php } ?>

			<?php if ($invoice->invoice_discount > 0) { ?>
			<tr>
				<td colspan="6" align="right">
					<?php echo $this->lang->line('discount'); ?>
				</td>
				<td align="right">
					<?php echo invoice_discount($invoice); ?>
				</td>
			</tr>
			<?php } ?>

			<tr>
				<td colspan="6" align="right">
					<?php echo $this->lang->line('grand_total'); ?>
				</td>
				<td align="right">
					<?php echo invoice_total($invoice); ?>
				</td>
			</tr>

			<tr>
				<td colspan="6" align="right">
					<?php echo $this->lang->line('amount_paid'); ?>
				</td>
				<td align="right">
					<?php echo invoice_paid($invoice); ?>
				</td>
			</tr>

			<tr>
				<td colspan="6" align="right">
					<?php echo $this->lang->line('total_due'); ?>
				</td>
				<td align="right">
					<?php echo invoice_balance($invoice); ?>
				</td>
			</tr>
		</table>

	</body>
</html>
Saludos!
  #2 (permalink)  
Antiguo 27/08/2012, 15:37
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

Vale lo de alinear es una tontería:

Código HTML:
Ver original
  1. <p align="right">
  2.             <?php echo invoice_to_client_name($invoice); ?><br />
  3.             <?php echo invoice_to_address($invoice); ?><br />
  4.             <?php if (invoice_to_address_2($invoice)) { echo invoice_to_address_2($invoice) . '<br />'; } ?>
  5.             <?php echo invoice_to_city($invoice) . ', ' . invoice_to_state($invoice) . ' ' . invoice_to_zip($invoice) . ' ' . invoice_to_country($invoice); ?><br />
  6.             <?php echo invoice_client_tax_id($invoice); ?></p>
  #3 (permalink)  
Antiguo 27/08/2012, 15:59
Avatar de memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 14 años, 10 meses
Puntos: 641
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

y además va en el foro de css ;)
  #4 (permalink)  
Antiguo 27/08/2012, 16:05
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

uy perdón :)

Aunque no se que tiene que ver el CSS para insertar una función si es que existe en PHP para que cierto texto se quede al final de la página...
  #5 (permalink)  
Antiguo 27/08/2012, 16:15
Colaborador
 
Fecha de Ingreso: mayo-2008
Ubicación: $MX['VZ']['Xalapa']
Mensajes: 3.005
Antigüedad: 16 años
Puntos: 528
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

No, <p align="right"> no es una función de php, es una etiqueta html.
  #6 (permalink)  
Antiguo 27/08/2012, 16:16
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

Ya, era la primera parte de mi pregunta, pero la segunda y más importante

2.- Que desde "subtotal" hasta "total pendiente" aparezca donde está pero al final de la página, no directamente debajo de los productos o u y servicios... No se si me explico... Es que tal y como está la hoja, queda toda vacía desde este punto

Es sobre una función supongo que de PHP
  #7 (permalink)  
Antiguo 27/08/2012, 16:34
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

Aunque ahora que lo miro detenidamente igual es algo más de tablas (html) que de otra cosa :s
  #8 (permalink)  
Antiguo 27/08/2012, 16:43
Colaborador
 
Fecha de Ingreso: mayo-2008
Ubicación: $MX['VZ']['Xalapa']
Mensajes: 3.005
Antigüedad: 16 años
Puntos: 528
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

Para tu segunda pregunta, hay que hacer prueba y error: necesitas ver con cuántos saltos de linea o bien cuántos pixeles o puntos sobran en la hoja para o bien poner los saltos de linea o colocar una capa vacía que tenga el alto en pixeles o puntos necesario
  #9 (permalink)  
Antiguo 27/08/2012, 17:22
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

Pero haciendo eso, si pongo más líneas de prodcuto los totales se irán a otra página ¿No?
  #10 (permalink)  
Antiguo 27/08/2012, 18:55
 
Fecha de Ingreso: mayo-2007
Mensajes: 237
Antigüedad: 17 años
Puntos: 3
Respuesta: ¿Alguien me ilumina para retocar este template PHP?

he activado el border="1" para ver como están repartida las tablas, y quedan así:



Lo que querría es separar las tablas desde "la línea" que está por encima de "subtotal" para ponerla a final de la página haciendo <br> ya que es donde lo puedo hacer porque como veis si añadimos artículos se añaden uno detrás de otro en filas distintas ...

¿Que se os ocurre :)

Etiquetas: html, template
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:32.