From 99c1b5fe88c08ad715a0e79fce1a9223a7bc531c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Jul 2009 11:06:03 +0000 Subject: [PATCH] Fix: function not found --- htdocs/commande/fiche.php | 4 ++-- htdocs/commonobject.class.php | 1 + htdocs/compta/commande/fiche.php | 10 +++++++++- htdocs/expedition/commande.php | 13 +++++++++++-- htdocs/expedition/fiche.php | 8 ++++---- htdocs/livraison/livraison.class.php | 13 ------------- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index e2ddebd3050..b5487f074ff 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1336,7 +1336,7 @@ else { if ($commande->statut > 0) { - print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->transnoentities("Currency".$conf->monnaie)); + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); } else { @@ -1441,7 +1441,7 @@ else print ''; - if ($_GET['action'] != 'editmode') print ''; + if ($_GET['action'] != 'editmode' && $commande->brouillon) print ''; print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'),1).'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; print ''; if ($_GET['action'] == 'editmode') diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 8f97214cfab..7469857f555 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -398,6 +398,7 @@ class CommonObject $address = new Societe($this->db); $result=$address->fetch_adresse_livraison($deliveryaddressid); $this->deliveryaddress = $address; + $this->adresse = $adresse; return $result; } diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php index 5ae94196edd..530626533aa 100644 --- a/htdocs/compta/commande/fiche.php +++ b/htdocs/compta/commande/fiche.php @@ -54,6 +54,14 @@ $result=restrictedArea($user,'commande',$comid,''); * Actions */ +// Categorisation dans projet +if ($_POST['action'] == 'classin') +{ + $commande = new Commande($db); + $commande->fetch($_GET['id']); + $commande->setProject($_POST['projetid']); +} + if ($_GET["action"] == 'facturee') { $commande = new Commande($db); @@ -316,7 +324,7 @@ if ($id > 0 || ! empty($ref)) print ''; - if ($_GET['action'] != 'classer' && $commande->brouillon) print ''; + if ($_GET['action'] != 'classer') print ''; print '
'; print $langs->trans('Project'); print ''.img_edit($langs->trans('SetProject')).''.img_edit($langs->trans('SetProject')).'
'; print ''; if ($_GET['action'] == 'classer') diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php index 3a4cd7167fe..74faa167050 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/commande.php @@ -58,6 +58,15 @@ $error = $user->load_entrepots(); /* * Actions */ + +// Categorisation dans projet +if ($_POST['action'] == 'classin') +{ + $commande = new Commande($db); + $commande->fetch($_GET['id']); + $commande->setProject($_POST['projetid']); +} + if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes') { $commande = new Commande($db); @@ -306,7 +315,7 @@ if ($id > 0 || ! empty($ref)) $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->cond_reglement_id,'none'); } print ''; - + // Mode of payment print ''; print '"; print '\n"; - + // Delivery address print ''; print ''."\n"; @@ -343,7 +343,7 @@ if ($_GET["action"] == 'create') * Lignes de commandes * */ - print '
'; @@ -333,7 +342,7 @@ if ($id > 0 || ! empty($ref)) print ''; - if ($_GET['action'] != 'classer' && $commande->brouillon) print ''; + if ($_GET['action'] != 'classer') print ''; print '
'; print $langs->trans('Project'); print ''.img_edit($langs->trans('SetProject')).''.img_edit($langs->trans('SetProject')).'
'; print '
'; if ($_GET['action'] == 'classer') diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 31cd37dcbbe..826a406bcf0 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -282,13 +282,13 @@ if ($_GET["action"] == 'create') // Date print "
".$langs->trans("Date")."'.dol_print_date($object->date,"day")."
'.$langs->trans('DeliveryAddress').''; if (!empty($object->fk_delivery_address)) { - $expedition->fetch_adresse_livraison($object->fk_delivery_address); + $object->fetch_adresse_livraison($object->fk_delivery_address); print ''.$expedition->deliveryaddress->label.''; } print '
'; + print '
'; //$lignes = $object->fetch_lines(1); $numAsked = sizeof($object->lignes); @@ -647,7 +647,7 @@ else print ''; print '\n"; print ''; - + // Delivery address print ''; print '
'.$langs->trans("Date").''.dol_print_date($expedition->date,"daytext")."
'.$langs->trans('DeliveryAddress').''; diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index cf524c29b2f..355a831156d 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -627,19 +627,6 @@ class Livraison extends CommonObject $this->$object->fetch($this->origin_id); } - /** - * - * - */ - - function fetch_adresse_livraison($id) - { - $idadresse = $id; - $adresse = new Societe($this->db); - $adresse->fetch_adresse_livraison($idadresse); - $this->adresse = $adresse; - } - /** * *