From 932b8f90e1ce680e8b706dd8c5bbdd9da9cfe721 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Aug 2011 05:41:01 +0000 Subject: [PATCH] Fix: works on repair broken features --- htdocs/admin/workflow.php | 6 +-- htdocs/commande/class/commande.class.php | 8 ++-- htdocs/commande/fiche.php | 6 +-- htdocs/compta/facture/class/facture.class.php | 39 +++++++++++-------- ...face_modWorkflow_WorkflowManager.class.php | 4 +- 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 529b72793dc..00629a0e4a8 100755 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -22,7 +22,7 @@ * \file htdocs/admin/workflow.php * \ingroup company * \brief Workflows setup page - * \version $Id: workflow.php,v 1.6 2011/08/08 16:00:18 eldy Exp $ + * \version $Id: workflow.php,v 1.7 2011/08/12 05:41:01 hregis Exp $ */ require("../main.inc.php"); @@ -96,7 +96,7 @@ $workflowcodes=array(); if ($conf->propal->enabled && $conf->commande->enabled) $workflowcodes['WORKFLOW_PROPAL_AUTOCREATE_ORDER']='WORKFLOW_PROPAL_AUTOCREATE_ORDER'; //if ($conf->propal->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_PROPAL_AUTOCREATE_INVOICE']='WORKFLOW_PROPAL_AUTOCREATE_INVOICE'; //if ($conf->contrat->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_CONTRACT_AUTOCREATE_INVOICE']='WORKFLOW_CONTRACT_AUTOCREATE_INVOICE'; -//if ($conf->commande->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_ORDER_AUTOCREATE_INVOICE']='WORKFLOW_ORDER_AUTOCREATE_INVOICE'; +if ($conf->commande->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_ORDER_AUTOCREATE_INVOICE']='WORKFLOW_ORDER_AUTOCREATE_INVOICE'; if (sizeof($workflowcodes) > 0) { @@ -135,5 +135,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/08/08 16:00:18 $ - $Revision: 1.6 $'); +llxFooter('$Date: 2011/08/12 05:41:01 $ - $Revision: 1.7 $'); ?> diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d48e8041c1e..dff53765e0b 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -24,7 +24,7 @@ * \file htdocs/commande/class/commande.class.php * \ingroup commande * \brief Fichier des classes de commandes - * \version $Id: commande.class.php,v 1.124 2011/08/11 07:41:41 hregis Exp $ + * \version $Id: commande.class.php,v 1.125 2011/08/12 05:41:01 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); @@ -453,7 +453,8 @@ class Commande extends CommonObject */ function cloture($user) { - global $conf; + global $conf, $langs; + $error=0; if ($user->rights->commande->valider) @@ -855,10 +856,9 @@ class Commande extends CommonObject /** * Load an object from a proposal and create a new order into database * @param object Object source - * @param invertdetail Reverse sign of amounts for lines * @return int <0 if KO, 0 if nothing done, 1 if OK */ - function createFromProposal($object,$invertdetail=0,$hookmanager=false) + function createFromProposal($object,$hookmanager=false) { global $conf,$user,$langs; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 8babc2a2ddd..56ccb0822dd 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/commande/fiche.php * \ingroup commande * \brief Page to show customer order - * \version $Id: fiche.php,v 1.534 2011/08/11 15:14:51 hregis Exp $ + * \version $Id: fiche.php,v 1.535 2011/08/12 05:41:02 hregis Exp $ */ require("../main.inc.php"); @@ -1502,7 +1502,7 @@ else if (! $formconfirm) { - $parameters=array('lineid'=>$lienid); + $parameters=array('lineid'=>$lineid); $formconfirm=$hookmanager->executeHooks('formconfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook } @@ -2070,5 +2070,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/11 15:14:51 $ - $Revision: 1.534 $'); +llxFooter('$Date: 2011/08/12 05:41:02 $ - $Revision: 1.535 $'); ?> diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3e6d3cb15ef..2dc7ba205f3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -27,7 +27,7 @@ * \file htdocs/compta/facture/class/facture.class.php * \ingroup facture * \brief Fichier de la classe des factures clients - * \version $Id: facture.class.php,v 1.127 2011/08/11 15:14:50 hregis Exp $ + * \version $Id: facture.class.php,v 1.128 2011/08/12 05:41:01 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); @@ -618,22 +618,27 @@ class Facture extends CommonObject { $line = new FactureLigne($this->db); - $line->libelle = $object->lines[$i]->libelle; - $line->desc = $object->lines[$i]->desc; - $line->price = $object->lines[$i]->price; - $line->subprice = $object->lines[$i]->subprice; - $line->tva_tx = $object->lines[$i]->tva_tx; - $line->localtax1_tx = $object->lines[$i]->localtax1_tx; - $line->localtax2_tx = $object->lines[$i]->localtax2_tx; - $line->qty = $object->lines[$i]->qty; - $line->fk_remise_except = $object->lines[$i]->fk_remise_except; - $line->remise_percent = $object->lines[$i]->remise_percent; - $line->fk_product = $object->lines[$i]->fk_product; - $line->info_bits = $object->lines[$i]->info_bits; - $line->product_type = $object->lines[$i]->product_type; - $line->rang = $object->lines[$i]->rang; - $line->special_code = $object->lines[$i]->special_code; - $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->libelle = $object->lines[$i]->libelle; + $line->desc = $object->lines[$i]->desc; + $line->price = $object->lines[$i]->price; + $line->subprice = $object->lines[$i]->subprice; + $line->tva_tx = $object->lines[$i]->tva_tx; + $line->localtax1_tx = $object->lines[$i]->localtax1_tx; + $line->localtax2_tx = $object->lines[$i]->localtax2_tx; + $line->qty = $object->lines[$i]->qty; + $line->fk_remise_except = $object->lines[$i]->fk_remise_except; + $line->remise_percent = $object->lines[$i]->remise_percent; + $line->fk_product = $object->lines[$i]->fk_product; + $line->info_bits = $object->lines[$i]->info_bits; + $line->product_type = $object->lines[$i]->product_type; + $line->rang = $object->lines[$i]->rang; + $line->special_code = $object->lines[$i]->special_code; + $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + + // TODO it's ok ? + $line->total_ht = $object->lines[$i]->total_ht; + $line->total_tva = $object->lines[$i]->total_tva; + $line->total_ttc = $object->lines[$i]->total_ttc; $this->lines[$i] = $line; } diff --git a/htdocs/includes/triggers/interface_modWorkflow_WorkflowManager.class.php b/htdocs/includes/triggers/interface_modWorkflow_WorkflowManager.class.php index 1c2b408e76a..b99e69a9af8 100755 --- a/htdocs/includes/triggers/interface_modWorkflow_WorkflowManager.class.php +++ b/htdocs/includes/triggers/interface_modWorkflow_WorkflowManager.class.php @@ -20,7 +20,7 @@ * \file htdocs/includes/triggers/interface_modWorkflow_WorkflowManager.class.php * \ingroup core * \brief Trigger file for workflows - * \version $Id: interface_modWorkflow_WorkflowManager.class.php,v 1.9 2011/08/10 19:55:21 hregis Exp $ + * \version $Id: interface_modWorkflow_WorkflowManager.class.php,v 1.10 2011/08/12 05:41:01 hregis Exp $ */ @@ -111,7 +111,7 @@ class InterfaceWorkflowManager $hookmanager=new HookManager($this->db); $hookmanager->callHooks(array('ordercard')); - $ret=$order->createFromProposal($object,0,$hookmanager); + $ret=$order->createFromProposal($object,$hookmanager); if ($ret < 0) { $this->error=$invoice->error; $this->errors[]=$invoice->error; } return $ret; }