diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c3590cb94a5..2cca7fa9a3e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -26,9 +26,9 @@ /** * \file htdocs/compta/facture.php -* \ingroup facture -* \brief Page to create/see an invoice -*/ + * \ingroup facture + * \brief Page to create/see an invoice + */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1952,9 +1952,9 @@ llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES /********************************************************************* * -* Mode creation -* -**********************************************************************/ + * Mode creation + * + **********************************************************************/ if ($action == 'create') { $facturestatic=new Facture($db); @@ -2048,8 +2048,26 @@ if ($action == 'create') // Ref print ''.$langs->trans('Ref').''.$langs->trans('Draft').''; + // Tiers + print ''; + print ''.$langs->trans('Customer').''; + if($soc->id > 0) + { + print ''; + print $soc->getNomUrl(1); + print ''; + print ''; + } + else + { + print ''; + print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); + print ''; + } + print ''."\n"; + // Factures predefinies - if (empty($origin) && empty($originid) && $socid>0) + if (empty($origin) && empty($originid) && $socid > 0) { $sql = 'SELECT r.rowid, r.titre, r.total_ttc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_rec as r'; @@ -2084,24 +2102,6 @@ if ($action == 'create') } } - // Tiers - print ''; - print ''.$langs->trans('Customer').''; - if($soc->id > 0) - { - print ''; - print $soc->getNomUrl(1); - print ''; - print ''; - } - else - { - print ''; - print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); - print ''; - } - print ''."\n"; - // Type de facture $facids=$facturestatic->list_replacable_invoices($soc->id); if ($facids < 0) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index f098eee307f..0573a00ce3c 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -106,6 +106,7 @@ if ($action == 'delete' && $user->rights->facture->supprimer) llxHeader('',$langs->trans("RepeatableInvoices"),'ch-facture.html#s-fac-facture-rec'); $form = new Form($db); +$companystatic = new Societe($db); /* * Create mode @@ -114,7 +115,7 @@ if ($action == 'create') { print_fiche_titre($langs->trans("CreateRepeatableInvoice")); - $object = new Facture($db); // Source invoice + $object = new FactureRec($db); // Source invoice $product_static = new Product($db); if ($object->fetch($id) > 0) @@ -364,7 +365,13 @@ else $author = new User($db); $author->fetch($object->user_author); - dol_fiche_head($head, 'compta', $langs->trans("PredefinedInvoices"),0,'company'); // Add a div + $head=array(); + $h=0; + $head[$h][0] = $_SERVER["PHP_SELF"].'?id='.$object->id; + $head[$h][1] = $langs->trans("CardBill"); + $head[$h][2] = 'card'; + + dol_fiche_head($head, 'card', $langs->trans("PredefinedInvoices"),0,'bill'); // Add a div print ''; @@ -552,7 +559,10 @@ else print '\n"; - print ''; + + $companystatic->id=$objp->socid; + $companystatic->name=$objp->nom; + print ''; print ''."\n";
'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre; print "'.$objp->nom.''.$companystatic->getNomUrl(1,'customer').''.price($objp->total).'