Tutorial: WHMCS adaptacion a autonomos y Ley española

  • Autor Autor comprido
  • Fecha de inicio Fecha de inicio
C

comprido

Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Muy buenas a tod@s los que lean 🙂

Soy Pedro, de fcsites, llevo años usando WHMCS y como estais bien posicionados para las busquedas relacionadas he decidido dejar aqui un pequeño MOD de aporte para aquellos que están comenzando y se decantan por este gestor de clientes y cuentas.

Lo que hace es transformar las plantillas de proformas/presupuestos y facturas para incluir IRPF y alguna informacion necesaria según Leyes españolas.


ABRIR lang/spanish.php

-----------------------------------------------------------------------
REEMPLAZAR palabra "Cotización" por "Presupuesto".
-----------------------------------------------------------------------


-----------------------------------------------------------------------
INCLUIR NOTA LEGAL
-----------------------------------------------------------------------

BUSCAR
Insertar CODE, HTML o PHP:
$_LANG['invoicesnotes'] = "Notas";

DESPUES PEGAR:

Insertar CODE, HTML o PHP:
$_LANG["invoicesmessage"] = "RECUERDE: Algunos medios de comunicación a través de Internet no garantizan el cumplimiento de todos los requisitos exigidos en el régimen de facturación telemática (autenticidad e integridad) según la legislación española por lo que esta factura no será válida a efectos fiscales si carece de sello y firma. Le enviaremos la factura original a la dirección postal asociada a su cuenta de cliente.";
$_LANG["quotemessage"] = "Esperamos que el presupuesto sea de su agrado. Para proceder con la realización del trabajo ingrese la cantidad mencionada en el número de cuenta de ***PON AQUI TU IBAN*** facilitando: nombre completo, DNI/CIF y la referencia indicada en la parte superior del presente.";

HACER LO MISMO EN english.php

Insertar CODE, HTML o PHP:
$_LANG["invoicesmessage"] = "NOTE: Some media over the Internet do not guarantee compliance with all requirements of the electronic invoicing system (authenticity and integrity) under Spanish law so this bill will not be valid for tax purposes if no seal and signature. We will send the original invoice to the address associated with your account.";
$_LANG["quotemessage"] = "We hope you enjoy this quote. To proceed with the job we need you to transfer the amount mentioned in the account number ***PON AQUI TU IBAN*** providing: full name, ID / CIF and quote reference..";


GUARDAR Y SUBIR VIA FTP lang/spanish.php.


-----------------------------------------------------------------------
Dar anchura necesaria a columna en quotepdf.tpl para que aparezca bien "Presupuesto #"
-----------------------------------------------------------------------
BUSCAR
Insertar CODE, HTML o PHP:
$pdf->Cell(20,6,$_LANG['quotenumber'],1,0,'C');

REEMPLAZAR POR
Insertar CODE, HTML o PHP:
$pdf->Cell(30,6,$_LANG['quotenumber'],1,0,'C');

BUSCAR
Insertar CODE, HTML o PHP:
$pdf->MultiCell(30,$height,$quotenumber,1,'C',0,0);

REEMPLAZAR POR
Insertar CODE, HTML o PHP:
$pdf->MultiCell(30,$height,$quotenumber,1,'C',0,0);



-----------------------------------------------------------------------
INCLUIR EL CIF EN PRESUPUESTOS Y FACTURAS
-----------------------------------------------------------------------
ABRIR templates/portal/quotepdf.tpl:
ABRIR templates/portal/invoicepdf.tpl:

BUSCAR
Insertar CODE, HTML o PHP:
$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');

JUSTO ANTES PEGAR:
Insertar CODE, HTML o PHP:
$pdf->Cell(0,4,$clientsdetails["customfields2"],0,1,'L');



-----------------------------------------------------------------------
PONER MENSAJE BAJO LOS PRESUPUESTOS
-----------------------------------------------------------------------

ABRIR templates/portal/quotepdf.tpl:

BUSCAR AL FINAL
Insertar CODE, HTML o PHP:
?>

JUSTO ANTES PEGAR:

Insertar CODE, HTML o PHP:
# CONDICIONES !
	$pdf->Ln();
	$pdf->MultiCell(180,5,$_LANG["quotemessage"],1,'L',1);


-----------------------------------------------------------------------
INCLUIR EL IRPF EN FACTURA
-----------------------------------------------------------------------
ABRIR templates/portal/invoicepdf.tpl:

BUSCAR

Insertar CODE, HTML o PHP:
if ($taxname) $tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right">'.$taxrate.'% '.$taxname.'</td>
        <td align="center">'.$tax.'</td>
    </tr>';

REEMPLAZAR POR
Insertar CODE, HTML o PHP:
if ($taxname) $tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right">'.$taxrate.'% '.$taxname.'</td>
        <td align="center">'.$tax.'</td>
    </tr>
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right">-21% I.R.P.F</td>
        <td align="center">'.$tax2.'</td>
    </tr>';

BUSCAR
Insertar CODE, HTML o PHP:
# Generation Date

JUSTO ENCIMA PEGAR

Insertar CODE, HTML o PHP:
# NO ES FACTURA!
	$pdf->Ln();
	$pdf->MultiCell(180,5,$_LANG["invoicesmessage"],1,'L',1);

-----------------------------------------------------------------------
TRUCO PARA INCLUIR EL IRPF EN PRESUPUESTOS
-----------------------------------------------------------------------
ABRIR templates/portal/quotepdf.tpl:

BUSCAR
Insertar CODE, HTML o PHP:
$tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$_LANG['invoicessubtotal'].'</td>
        <td align="center">'.$subtotal.'</td>
    </tr>';
if ($taxlevel1['rate']>0) $tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$taxlevel1['name'].' @ '.$taxlevel1['rate'].'%</td>
        <td align="center">'.$tax1.'</td>
    </tr>';
if ($taxlevel2['rate']>0) $tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$taxlevel2['name'].' @ '.$taxlevel2['rate'].'%</td>
        <td align="center">'.$tax2.'</td>
    </tr>';
$tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$_LANG['invoicestotal'].'</td>
        <td align="center">'.$total.'</td>
    </tr>
</table>';

Y REEMPLAZAR POR

Insertar CODE, HTML o PHP:
$tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$_LANG['invoicessubtotal'].'</td>
        <td align="center">'.$subtotal.'</td>
    </tr>';
if ($taxlevel1['rate']>0) $tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$taxlevel1['name'].' @ '.$taxlevel1['rate'].'%</td>
        <td align="center">'.$tax1.'</td>
    </tr>
  <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$taxlevel2['name'].' @ '.$taxlevel2['rate'].'%</td>
        <td align="center">-'.$tax1.'</td>
    </tr>';
$tblhtml .= '
    <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
        <td align="right" colspan="4">'.$_LANG['invoicestotal'].'</td>
        <td align="center">'.$subtotal.'</td>
    </tr>
</table>';

GUARDAR AMBOS ARCHIVOS templates/portal/quotepdf.tpl Y templates/portal/invoicepdf.tpl Y SUBIR VIA FTP

Espero que os sirvan tanto como a mí a la hora de funcionar como marca comercial/autonomo.

Llevo muchos años trabajando con WHMCS si tenéis cualquier duda, tal vez pueda ayudaros.

Saludos
 
Por cierto, hay va una pequeña muestra de los cambios:

muestra_cambios.webp
 
Muy Bueno, Agregado a marcadores
 
Hola, estoy empezando con WHMCS y la primera duda que me surge es lo de como agregar la retención del IRPF a mis facturas. Veo que hay algunos módulos de pago y este código de aquí, pero como veo que el tema es del 2013 no se si sigue funcinando o no, lo problemas que puede dar, y si cuando haya una actualización del WHMCS esto se mantendrá o no.... ¿alguien que lo use y/o haya usado puede darme su opinión?

Gracias
 
Sigue vigente ulises2010 puedes hacer los cambios tranquilo, verás aplicado el IRPF en factura y presupuestos.
Para cualquier duda estoy en fcsites.com
Saludos
 
Genial aporte, le vendrá muy bien a muchos Hosters de por aquí
 
Atrás
Arriba