From a1b0fbcc2c49f490e41bbae6fcd63ce91147b0b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Dec 2012 14:14:52 +0100 Subject: [PATCH] Fix: [ bug #659 ] Comment in recurrent invoices is not stored Fix: Missing payment mode --- htdocs/compta/facture/fiche-rec.php | 75 ++++++++++++++--------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index a0173e74fa4..84d4d68932c 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -72,7 +72,7 @@ if ($action == 'add') if (! $error) { $object->titre = GETPOST('titre', 'alpha'); - $object->note = GETPOST('comment'); + $object->note = GETPOST('note'); $object->usenewprice = GETPOST('usenewprice'); if ($object->create($user, $id) > 0) @@ -113,53 +113,60 @@ if ($action == 'create') { print_fiche_titre($langs->trans("CreateRepeatableInvoice")); - $invoice = new Facture($db); // Source invoice + $object = new Facture($db); // Source invoice $product_static = new Product($db); - if ($invoice->fetch($id) > 0) + if ($object->fetch($id) > 0) { print '
'; print ''; print ''; - print ''; + print ''; $rowspan=4; - if (! empty($conf->projet->enabled) && $invoice->fk_project > 0) $rowspan++; + if (! empty($conf->projet->enabled) && $object->fk_project > 0) $rowspan++; print ''; - $invoice->fetch_thirdparty(); + $object->fetch_thirdparty(); - print ''; + // Third party + print ''; print ''; + // Title print ''; + // Note print ''; + // Author print ""; + // Payment term print ""; + // Payment mode print ""; - if (! empty($conf->projet->enabled) && $invoice->fk_project > 0) + // Project + if (! empty($conf->projet->enabled) && $object->fk_project > 0) { print ""; @@ -194,7 +201,7 @@ if ($action == 'create') $sql.= ' p.description as product_desc'; $sql.= " FROM ".MAIN_DB_PREFIX."facturedet as l"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid"; - $sql.= " WHERE l.fk_facture = ".$invoice->id; + $sql.= " WHERE l.fk_facture = ".$object->id; $sql.= " ORDER BY l.rowid"; $result = $db->query($sql); @@ -339,7 +346,7 @@ if ($action == 'create') } else { - dol_print_error('',"Error, no invoice ".$invoice->id); + dol_print_error('',"Error, no invoice ".$object->id); } } else @@ -360,29 +367,13 @@ else print '
'.$langs->trans("Customer").''.$invoice->client->getNomUrl(1,'customer').'
'.$langs->trans("Customer").''.$object->client->getNomUrl(1,'customer').''; //print $langs->trans("NotePrivate"); print '
'.$langs->trans("Title").''; - print ''; + print ''; print ''; print ''; print '
".$langs->trans("Author")."".$user->getFullName($langs)."
".$langs->trans("PaymentConditions").""; - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$invoice->id, $invoice->cond_reglement_id, 'none'); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); print "
".$langs->trans("PaymentMode").""; - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$invoice->id, $facture->mode_reglement_id, 'none'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); print "
".$langs->trans("Project").""; - if ($invoice->fk_project > 0) + if ($object->fk_project > 0) { $project = new Project($db); - $project->fetch($invoice->fk_project); + $project->fetch($object->fk_project); print $project->title; } print "
'; - print ''; + print ''; print ''; print ''; - print ''; - print ""; + print ''; - print ""; - - if ($object->remise_percent > 0) - { - print '"; + print ""; print ''; print ''; @@ -392,11 +383,19 @@ else print ''; print ''; print ''; - if ($object->note) - { - print '"; - } + // Payment term + print '"; + + // Payment mode + print '"; + + print '"; + print "
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''.$object->titre.'
'.$langs->trans("Customer").''.$object->thirdparty->getNomUrl(1,'customer').'". $langs->trans("PaymentConditions") ." : "; - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id,'none'); - print "
'.$object->thirdparty->getNomUrl(1,'customer').'
".$langs->trans("Author")."".$author->getFullName($langs)."'; - } - else - { - print ''; - } - - print $langs->trans("PaymentMode") ." : "; - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id,'none'); - print "
".$langs->trans("Author").''.$author->getFullName($langs)."
'.$langs->trans("AmountHT").''.price($object->total_ht).''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("AmountTTC").''.price($object->total_ttc).''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Note").' : '.nl2br($object->note)."
'.$langs->trans("PaymentConditions").''; + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id,'none'); + print "
'.$langs->trans("PaymentMode").''; + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id,'none'); + print "
'.$langs->trans("Note").''.nl2br($object->note)."
"; print '';