Skip to content

Commit

Permalink
Predefined invoices are now always enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 27, 2009
1 parent 892a8c1 commit 86625da
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 61 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -13,6 +13,7 @@ For users:
third parties with expired contract's lines.
- New: Can add a field errors-to in emailing.
- New: Can use inline images in emails.
- New: Add predefined invoices (can be use for repeated invoices).
- Fix: Customer code was not correct on PDF it if contains special
characters.
- Fix: Can update price even with "NPR" VAT rates.
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/facture.php
Expand Up @@ -108,7 +108,7 @@
$sql.= " WHERE nom = '".$_GET["value"];
$sql.= " AND type = '".$type."'";
$sql.= " AND entity = ".$conf->entity;

if ($db->query($sql))
{

Expand Down Expand Up @@ -145,7 +145,7 @@

if ($_GET["action"] == 'setmod')
{
// \todo Verifier si module numerotation choisi peut etre activ�
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated

dolibarr_set_const($db, "FACTURE_ADDON",$_GET["value"],'chaine',0,'',$conf->entity);
Expand Down
18 changes: 7 additions & 11 deletions htdocs/compta/commande/pre.inc.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -20,7 +20,7 @@
* $Source$
*/

/**
/**
\file htdocs/compta/commande/pre.inc.php
\ingroup compta,commande
\brief Fichier gestionnaire du menu commande de compta
Expand Down Expand Up @@ -69,11 +69,7 @@ function llxHeader($head = "", $title="", $help_url='')
$menu->add(DOL_URL_ROOT."/compta/facture.php",$langs->trans("Bills"));
$menu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php",$langs->trans("Unpayed"));
$menu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php",$langs->trans("Payments"));

if ($conf->global->FACTURE_ENABLE_RECUR)
{
$menu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php", $langs->trans("Repeatable"));
}
$menu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php", $langs->trans("Repeatable"));

$menu->add_submenu(DOL_URL_ROOT."/compta/facture/stats/", $langs->trans("Statistics"));
}
Expand All @@ -86,7 +82,7 @@ function llxHeader($head = "", $title="", $help_url='')
}


// Les dépenses
// Les d�penses
if ($conf->fournisseur->enabled)
{
$langs->load("suppliers");
Expand All @@ -95,7 +91,7 @@ function llxHeader($head = "", $title="", $help_url='')

if ($conf->deplacement->enabled && $user->societe_id == 0)
{
$menu->add(DOL_URL_ROOT."/compta/deplacement/", "Déplacement");
$menu->add(DOL_URL_ROOT."/compta/deplacement/", "D�placement");
}

if ($conf->tax->enabled && $conf->compta->tva && $user->societe_id == 0)
Expand All @@ -109,7 +105,7 @@ function llxHeader($head = "", $title="", $help_url='')
}


// Vision des recettes-dépenses
// Vision des recettes-d�penses
if ($conf->banque->enabled && $user->rights->banque->lire)
{
$langs->load("banks");
Expand All @@ -129,7 +125,7 @@ function llxHeader($head = "", $title="", $help_url='')
{
$menu->add(DOL_URL_ROOT."/compta/ventilation/",$langs->trans("Ventilation"));
}

if ($user->rights->compta->ventilation->parametrer)
{
$menu->add(DOL_URL_ROOT."/compta/param/",$langs->trans("Param"));
Expand Down
53 changes: 25 additions & 28 deletions htdocs/compta/facture.php
Expand Up @@ -1449,39 +1449,36 @@
}

// Factures prédéfinnies
if ($conf->global->FACTURE_ENABLE_RECUR)
if ($_GET['propalid'] == 0 && $_GET['commandeid'] == 0 && $_GET['contratid'] == 0)
{
if ($_GET['propalid'] == 0 && $_GET['commandeid'] == 0 && $_GET['contratid'] == 0)
$sql = 'SELECT r.rowid, r.titre, r.total_ttc FROM '.MAIN_DB_PREFIX.'facture_rec as r';
$sql.= ' WHERE r.fk_soc = '.$soc->id;
$resql=$db->query($sql);
if ($resql)
{
$sql = 'SELECT r.rowid, r.titre, r.total_ttc FROM '.MAIN_DB_PREFIX.'facture_rec as r';
$sql.= ' WHERE r.fk_soc = '.$soc->id;
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$num = $db->num_rows($resql);
$i = 0;

if ($num > 0)
if ($num > 0)
{
print '<tr><td>'.$langs->trans('CreateFromRepeatableInvoice').'</td><td>';
print '<select class="flat" name="fac_rec">';
print '<option value="0" selected="true"></option>';
while ($i < $num)
{
print '<tr><td>'.$langs->trans('CreateFromRepeatableInvoice').'</td><td>';
print '<select class="flat" name="fac_rec">';
print '<option value="0" selected="true"></option>';
while ($i < $num)
{
$objp = $db->fetch_object($resql);
print '<option value="'.$objp->rowid.'"';
if ($_POST["fac_rec"] == $objp->rowid) print ' selected="true"';
print '>'.$objp->titre.' ('.$objp->total_ttc.' '.$langs->trans("TTC").')</option>';
$i++;
}
print '</select></td></tr>';
$objp = $db->fetch_object($resql);
print '<option value="'.$objp->rowid.'"';
if ($_POST["fac_rec"] == $objp->rowid) print ' selected="true"';
print '>'.$objp->titre.' ('.$objp->total_ttc.' '.$langs->trans("TTC").')</option>';
$i++;
}
$db->free();
}
else
{
dol_print_error($db);
print '</select></td></tr>';
}
$db->free();
}
else
{
dol_print_error($db);
}
}

Expand Down Expand Up @@ -3296,7 +3293,7 @@
}

// Clone as predefined
if ($conf->global->FACTURE_ENABLE_RECUR && ($fac->type == 0 || $fac->type == 3 || $fac->type == 4) && $fac->statut == 0 && $user->rights->facture->creer)
if (($fac->type == 0 || $fac->type == 3 || $fac->type == 4) && $fac->statut == 0 && $user->rights->facture->creer)
{
if (! $facidnext)
{
Expand Down
6 changes: 1 addition & 5 deletions htdocs/compta/pre.inc.php
Expand Up @@ -66,11 +66,7 @@ function llxHeader($head = '', $title='', $help_url='')
$menu->add(DOL_URL_ROOT."/compta/facture.php",$langs->trans("Bills"));
$menu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php",$langs->trans("Unpayed"));
$menu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php",$langs->trans("Payments"));

if ($conf->global->FACTURE_ENABLE_RECUR)
{
$menu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php", $langs->trans("Repeatable"));
}
$menu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php", $langs->trans("Repeatable"));

$menu->add_submenu(DOL_URL_ROOT."/compta/facture/stats/", $langs->trans("Statistics"));
}
Expand Down
6 changes: 2 additions & 4 deletions htdocs/includes/menus/barre_left/eldy_backoffice.php
Expand Up @@ -431,10 +431,8 @@ function showmenu()
{
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/clients.php?action=facturer&amp;leftmenu=customers_bills",$langs->trans("NewBill"),2,$user->rights->facture->creer);
}
if ($conf->global->FACTURE_ENABLE_RECUR)
{
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),2,$user->rights->facture->lire);
}
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),2,$user->rights->facture->lire);

if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpayed"),2,$user->rights->facture->lire);

if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
Expand Down
7 changes: 3 additions & 4 deletions htdocs/includes/menus/barre_left/eldy_frontoffice.php
Expand Up @@ -414,10 +414,9 @@ function showmenu()
{
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/clients.php?action=facturer&amp;leftmenu=customers_bills",$langs->trans("NewBill"),2,$user->rights->facture->creer);
}
if ($conf->global->FACTURE_ENABLE_RECUR)
{
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatable"),2,$user->rights->facture->lire);
}

if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatable"),2,$user->rights->facture->lire);

if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpayed"),2,$user->rights->facture->lire);

if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
Expand Down

0 comments on commit 86625da

Please sign in to comment.