diff --git a/ChangeLog b/ChangeLog index f6f3267d5aa..d5247f4c379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ For users: - New: Add hidden option MAIN_DISABLE_PDF_AUTOUPDATE to avoid generating pdf each time data change. - New: Add hidden option PROJECT_HIDE_UNSELECTABLES to hide project you can't select into combo list. - New: Add option INVOICE_POSITIVE_CREDIT_NOTE. +- New: Support zip/town autocompletion into warehouses. - Fix: Can use POS module with several concurrent users. For developers: diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index df4e84ddb29..0047e488ffe 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -102,7 +102,7 @@ print ''; print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; /* @@ -128,7 +128,7 @@ print "\n"; // Title rule for stock decrease print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; $var=true; @@ -178,7 +178,7 @@ if ($conf->expedition->enabled) // Title rule for stock increase print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; $var=true; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 833d7e80443..8bd5bd98f8d 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1045,9 +1045,7 @@ if ($id > 0 || ! empty($ref)) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); } - /* - * Confirmation de la validation de la propale - */ + // Confirm validate proposal if ($action == 'validate') { $error=0; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 93eb16b0762..29ffea851c9 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -108,7 +108,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file,0,0,0,'FILE_DELETE',$object); + dol_delete_file($file,0,0,0,$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1144a3dc120..c83edcea45e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -315,11 +315,13 @@ class Commande extends CommonObject } /** - * \brief Set draft status - * \param user Object user that modify - * \return int <0 if KO, >0 if OK + * Set draft status + * + * @param User $user Object user that modify + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK */ - function set_draft($user) + function set_draft($user, $idwarehouse=-1) { global $conf,$langs; @@ -343,7 +345,7 @@ class Commande extends CommonObject $sql.= " SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog("Commande::set_draft sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG); if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it @@ -359,8 +361,7 @@ class Commande extends CommonObject { $mouvP = new MouvementStock($this->db); // We increment stock of product (and sub-products) - $entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot - $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); + $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); if ($result < 0) { $error++; } } } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 2853ae6b0c3..2833215960d 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -111,7 +111,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file,0,0,0,'FILE_DELETE',$object); + dol_delete_file($file,0,0,0,$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 84c301428e6..f8df322e99a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -382,7 +382,7 @@ if ($action == 'setremise' && $user->rights->commande->creer) $object->set_remise($user, $_POST['remise']); } -if ($action == "setabsolutediscount" && $user->rights->commande->creer) +if ($action == 'setabsolutediscount' && $user->rights->commande->creer) { if ($_POST["remise_id"]) { @@ -775,6 +775,45 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->command } } +// Go back to draft status +if ($action == 'confirm_modif' && $user->rights->commande->creer) +{ + $idwarehouse=GETPOST('idwarehouse'); + + $object->fetch($id); // Load order and lines + $object->fetch_thirdparty(); + + // Check parameters + if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + { + if (! $idwarehouse || $idwarehouse == -1) + { + $error++; + $errors[]=$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")); + $action=''; + } + } + + if (! $error) + { + $result = $object->set_draft($user,$idwarehouse); + if ($result >= 0) + { + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + } + } +} + if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->commande->cloturer) { $object->fetch($id); // Load order and lines @@ -790,30 +829,6 @@ if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande- $result = $object->cancel($user); } -if ($action == 'modif' && $user->rights->commande->creer) -{ - /* - * Repasse la commande en mode brouillon - */ - $object->fetch($id); // Load order and lines - $object->fetch_thirdparty(); - - $result = $object->set_draft($user); - if ($result >= 0) - { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); - } -} /* * Ordonnancement des lignes @@ -1492,9 +1507,30 @@ else array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); } - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220); } + // Confirm back to draft status + if ($action == 'modif') + { + $text=$langs->trans('ConfirmUnvalidateOrder',$object->ref); + $formquestion=array(); + if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) + { + $langs->load("stocks"); + require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); + $formproduct=new FormProduct($db); + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); + } + + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); + } + + /* * Confirmation de la cloture */ diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 85f8afd0bf5..2103c50dd99 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -321,7 +321,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v $object->fetch_thirdparty(); // Check parameters - if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) { if (! $idwarehouse || $idwarehouse == -1) { @@ -355,56 +355,72 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v } } -// Repasse la facture en mode brouillon (unvalidate) -if ($action == 'modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)) +// Go back to draft status (unvalidate) +if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)) { + $idwarehouse=GETPOST('idwarehouse'); + $object->fetch($id); $object->fetch_thirdparty(); - // On verifie si la facture a des paiements - $sql = 'SELECT pf.amount'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; - $sql.= ' WHERE pf.fk_facture = '.$object->id; - - $result = $db->query($sql); - if ($result) + // Check parameters + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) { - $i = 0; - $num = $db->num_rows($result); - - while ($i < $num) + if (! $idwarehouse || $idwarehouse == -1) { - $objp = $db->fetch_object($result); - $totalpaye += $objp->amount; - $i++; + $error++; + $errors[]=$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")); + $action=''; } } - else + + if (! $error) { - dol_print_error($db,''); - } - - $resteapayer = $object->total_ttc - $totalpaye; - - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees - $ventilExportCompta = $object->getVentilExportCompta(); - - // On verifie si aucun paiement n'a ete effectue - if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) - { - $object->set_draft($user); - - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + // On verifie si la facture a des paiements + $sql = 'SELECT pf.amount'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; + $sql.= ' WHERE pf.fk_facture = '.$object->id; + + $result = $db->query($sql); + if ($result) + { + $i = 0; + $num = $db->num_rows($result); + + while ($i < $num) + { + $objp = $db->fetch_object($result); + $totalpaye += $objp->amount; + $i++; + } + } + else + { + dol_print_error($db,''); + } + + $resteapayer = $object->total_ttc - $totalpaye; + + // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + $ventilExportCompta = $object->getVentilExportCompta(); + + // On verifie si aucun paiement n'a ete effectue + if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) + { + $object->set_draft($user, $idwarehouse); + + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + } } } @@ -1985,7 +2001,7 @@ else $text.=$notify->confirmMessage('NOTIFY_VAL_FAC',$object->socid); } $formquestion=array(); - if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) { $langs->load("stocks"); require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); @@ -2000,6 +2016,26 @@ else $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('ValidateBill'),$text,'confirm_valid',$formquestion,"yes",($conf->notification->enabled?0:2)); } + // Confirm back to draft status + if ($action == 'modif') + { + $text=$langs->trans('ConfirmUnvalidateBill',$object->ref); + $formquestion=array(); + if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) + { + $langs->load("stocks"); + require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); + $formproduct=new FormProduct($db); + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); + } + + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('UnvalidateBill'),$text,'confirm_modif',$formquestion,"yes",1); + } + // Confirmation du classement paye if ($action == 'paid' && $resteapayer <= 0) { @@ -2877,7 +2913,8 @@ else $delallowed=$user->rights->facture->supprimer; print '
'; - $somethingshown=$formfile->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$hookmanager); + print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$hookmanager); + $somethingshown=$formfile->numoffiles; /* * Linked object block diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f3c8c4af323..df884230f06 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1249,6 +1249,7 @@ class Facture extends CommonObject /** * Renvoi une date limite de reglement de facture en fonction des * conditions de reglements de la facture et date de facturation + * * @param cond_reglement_id Condition de reglement a utiliser, 0=Condition actuelle de la facture * @return date Date limite de reglement si ok, <0 si ko */ @@ -1308,11 +1309,12 @@ class Facture extends CommonObject } /** - * Tag la facture comme paye completement (close_code non renseigne) ou partiellement (close_code renseigne) + appel trigger BILL_PAYED - * @param user Objet utilisateur qui modifie - * @param close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) - * @param close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) - * @return int <0 si ok, >0 si ok + * Tag la facture comme paye completement (close_code non renseigne) ou partiellement (close_code renseigne) + appel trigger BILL_PAYED + * + * @param User $user Objet utilisateur qui modifie + * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) + * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) + * @return int <0 if KO, >0 if OK */ function set_paid($user,$close_code='',$close_note='') { @@ -1367,11 +1369,12 @@ class Facture extends CommonObject /** - * \brief Tag la facture comme non payee completement + appel trigger BILL_UNPAYED - * Fonction utilisee quand un paiement prelevement est refuse, - * ou quand une facture annulee et reouverte. - * \param user Object user that change status - * \return int <0 si ok, >0 si ok + * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED + * Fonction utilisee quand un paiement prelevement est refuse, + * ou quand une facture annulee et reouverte. + * + * @param User $user Object user that change status + * @return int <0 if KO, >0 if OK */ function set_unpaid($user) { @@ -1416,17 +1419,20 @@ class Facture extends CommonObject /** - * \brief Tag la facture comme abandonnee, sans paiement dessus (exemple car facture de remplacement) + appel trigger BILL_CANCEL - * \param user Objet utilisateur qui modifie - * \param close_code Code de fermeture - * \param close_note Commentaire de fermeture - * \return int <0 si ok, >0 si ok + * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL + * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because + * of no payment even if merchandises were sent). + * + * @param User $user Object user making change + * @param string $close_code Code de fermeture + * @param string $close_note Comment + * @return int <0 if KO, >0 if OK */ function set_canceled($user,$close_code='',$close_note='') { global $conf,$langs; - dol_syslog("Facture::set_canceled rowid=".$this->id, LOG_DEBUG); + dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); $this->db->begin(); @@ -1475,6 +1481,7 @@ class Facture extends CommonObject /** * Tag invoice as validated + call trigger BILL_VALIDATE + * Object must have lines loaded with fetch_lines * * @param User $user Object user that validate * @param string $force_number Reference to force on invoice @@ -1488,7 +1495,7 @@ class Facture extends CommonObject $error=0; - // Protection + // Check parameters if (! $this->brouillon) { dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); @@ -1602,7 +1609,7 @@ class Facture extends CommonObject $result=$this->client->set_as_client(); // Si active on decremente le produit principal et ses composants a la validation de facture - if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) + if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) { require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); $langs->load("agenda"); @@ -1615,7 +1622,8 @@ class Facture extends CommonObject { $mouvP = new MouvementStock($this->db); // We decrease stock for product - $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + if ($this->type == 2) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); if ($result < 0) { $error++; } } } @@ -1692,10 +1700,10 @@ class Facture extends CommonObject * Set draft status * * @param User $user Object user that modify - * @param int $idwarehouse Id warehouse to use for stock change + * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function set_draft($user,$idwarehouse=0) + function set_draft($user,$idwarehouse=-1) { global $conf,$langs; @@ -1714,10 +1722,11 @@ class Facture extends CommonObject $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG); - if ($this->db->query($sql)) + $result=$this->db->query($sql); + if ($result) { // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement - if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) + if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) { require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); $langs->load("agenda"); @@ -1729,8 +1738,8 @@ class Facture extends CommonObject { $mouvP = new MouvementStock($this->db); // We decrease stock for product - $entrepot_id = "1"; // TODO ajouter possibilite de choisir l'entrepot - $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); + if ($this->type == 2) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); + else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); } } } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 17c0e3bdb8c..f6ceb457ea5 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -113,7 +113,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file,0,0,0,'FILE_DELETE',$object); + dol_delete_file($file,0,0,0,$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 0b43b1871da..453fd7c8b3e 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -60,7 +60,8 @@ if((isset($_GET['field']) && ! empty($_GET['field'])) $subelement = $regs[2]; } - if ($element == 'fichinter') $element = 'ficheinter'; + if ($element == 'propal') $element = 'propale'; + else if ($element == 'fichinter') $element = 'ficheinter'; if ($user->rights->$element->lire || $user->rights->$element->read || $user->rights->$element->$subelement->lire || $user->rights->$element->$subelement->read) diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 1ac227482a9..e1462e6dd1a 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -66,7 +66,8 @@ if((isset($_POST['field']) && ! empty($_POST['field'])) $subelement = $regs[2]; } - if ($element == 'fichinter') $element = 'ficheinter'; + if ($element == 'propal') $element = 'propale'; + else if ($element == 'fichinter') $element = 'ficheinter'; if ($user->rights->$element->creer || $user->rights->$element->write || $user->rights->$element->$subelement->creer || $user->rights->$element->$subelement->write) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0d7e8434388..587ad9470a1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2242,7 +2242,7 @@ class Form if (is_array($formquestion) && count($formquestion) > 0) { - $more.='
".$langs->trans("Parameters")."".$langs->trans("Value")." 
".$langs->trans("RuleForStockManagementDecrease")."".$langs->trans("Value")." 
".$langs->trans("RuleForStockManagementIncrease")."".$langs->trans("Value")." 
'."\n"; + $more.='
'."\n"; $more.=''."\n"; foreach ($formquestion as $key => $input) { @@ -2258,8 +2258,8 @@ class Form } else if ($input['type'] == 'select') { - $more.=''."\n"; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 207de988a4f..062ad198f73 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -134,7 +134,7 @@ class FormActions $total = 0; $var=true; print '
'.$formquestion['text'].'
'; - if (! empty($input['label'])) $more.=$input['label'].''; + $more.='
'; + if (! empty($input['label'])) $more.=$input['label'].''; $more.=$this->selectarray($input['name'],$input['values'],$input['default'],1); $more.='
'; - print ''; + print ''; print "\n"; foreach($actioncomm->actions as $action) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index b76ed8c3724..52c68848b15 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -369,12 +369,12 @@ class FormFile $out.= '
'.$titletoshow.'
'; $out.= '
'.$langs->trans('Ref').''.$langs->trans('Date').''.$langs->trans('Action').''.$langs->trans('By').'
'.$langs->trans('Ref').''.$langs->trans('Date').''.$langs->trans('Action').''.$langs->trans('By').'
'; - $out.= ''; + $out.= ''; // Model if (! empty($modellist)) { - $out.= ''; } else { - $out.= ''; } // Language code (if multilang) - $out.= ''; // Button - $out.= ''; $out.= ''; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ec10c68f2e4..94872285ddc 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -23,8 +23,9 @@ /** * Return user/group account of web server - * @param $mode 'user' or 'group' - * @return string + * + * @param string $mode 'user' or 'group' + * @return string Return user or group of web server */ function dol_getwebuser($mode) { @@ -37,15 +38,16 @@ function dol_getwebuser($mode) /** * Scan a directory and return a list of files/directories. * Content for string is UTF8 and dir separator is "/". - * @param $path Starting path from which to search - * @param $types Can be "directories", "files", or "all" - * @param $recursive Determines whether subdirectories are searched - * @param $filter Regex for include filter - * @param $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.') - * @param $sortcriteria Sort criteria ("","name","date","size") - * @param $sortorder Sort order (SORT_ASC, SORT_DESC) - * @param $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only - * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file') + * + * @param string $path Starting path from which to search + * @param string $types Can be "directories", "files", or "all" + * @param int $recursive Determines whether subdirectories are searched + * @param string $filter Regex for include filter + * @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.') + * @param string $sortcriteria Sort criteria ("","name","date","size") + * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) + * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only + * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file') */ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0) { @@ -152,9 +154,10 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil /** * Fast compare of 2 files identified by their properties ->name, ->date and ->size - * @param $a File 1 - * @param $b File 2 - * @return int 1, 0, 1 + * + * @param string $a File 1 + * @param string $b File 2 + * @return int 1, 0, 1 */ function dol_compare_file($a, $b) { @@ -186,12 +189,11 @@ function dol_compare_file($a, $b) /** * Return mime type of a file * - * @param file Filename we looking for MIME type - * @param default Default mime type if extension not found in known list - * @param mode 0=Return full mime, 1=otherwise short mime string, 2=image for mime type, 3=source language - * @return string Return a mime type family - * (text/xxx, application/xxx, image/xxx, audio, video, archive) - * @see image_format_supported (images.lib.php) + * @param string $file Filename we looking for MIME type + * @param string $default Default mime type if extension not found in known list + * @param int $mode 0=Return full mime, 1=otherwise short mime string, 2=image for mime type, 3=source language + * @return string Return a mime type family (text/xxx, application/xxx, image/xxx, audio, video, archive) + * @see image_format_supported (images.lib.php) */ function dol_mimetype($file,$default='application/octet-stream',$mode=0) { @@ -295,10 +297,10 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0) /** - * Test if filename is a directory + * Test if filename is a directory * - * @param folder Name of folder - * @return boolean True if it's a directory, False if not found + * @param string $folder Name of folder + * @return boolean True if it's a directory, False if not found */ function dol_is_dir($folder) { @@ -310,8 +312,8 @@ function dol_is_dir($folder) /** * Return if path is a file * - * @param $pathoffile - * @return boolean True or false + * @param string $pathoffile Path of file + * @return boolean True or false */ function dol_is_file($pathoffile) { @@ -322,8 +324,8 @@ function dol_is_file($pathoffile) /** * Return if path is an URL * - * @param $url - * @return boolean True or false + * @param string $url Url + * @return boolean True or false */ function dol_is_url($url) { @@ -339,8 +341,8 @@ function dol_is_url($url) /** * Test if a folder is empty * - * @param folder Name of folder - * @return boolean True if dir is empty or non-existing, False if it contains files + * @param string $folder Name of folder + * @return boolean True if dir is empty or non-existing, False if it contains files */ function dol_dir_is_emtpy($folder) { @@ -365,8 +367,9 @@ function dol_dir_is_emtpy($folder) /** * Count number of lines in a file - * @param file Filename - * @return int <0 if KO, Number of lines in files if OK + * + * @param string $file Filename + * @return int <0 if KO, Number of lines in files if OK */ function dol_count_nb_of_line($file) { @@ -395,8 +398,9 @@ function dol_count_nb_of_line($file) /** * Return size of a file - * @param $pathoffile - * @return string File size + * + * @param tring $pathoffile Path of file + * @return string File size */ function dol_filesize($pathoffile) { @@ -406,8 +410,9 @@ function dol_filesize($pathoffile) /** * Return time of a file - * @param $pathoffile - * @return timestamp Time of file + * + * @param string $pathoffile Path of file + * @return timestamp Time of file */ function dol_filemtime($pathoffile) { @@ -446,11 +451,12 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1) /** * Move a file into another name - * @param $srcfile Source file (can't be a directory) - * @param $destfile Destination file (can't be a directory) - * @param $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK) - * @param $overwriteifexists Overwrite file if exists (1 by default) - * @return boolean True if OK, false if KO + * + * @param string $srcfile Source file (can't be a directory) + * @param string $destfile Destination file (can't be a directory) + * @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK) + * @param int $overwriteifexists Overwrite file if exists (1 by default) + * @return boolean True if OK, false if KO */ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1) { @@ -475,13 +481,14 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1) /** * Move an uploaded file after some controls. * If there is errors (virus found, antivir in error, bad filename), file is not moved. - * @param src_file Source full path filename ($_FILES['field']['tmp_name']) - * @param dest_file Target full path filename - * @param allowoverwrite 1=Overwrite target file if it already exists - * @param disablevirusscan 1=Disable virus scan - * @param uploaderrorcode Value of upload error code ($_FILES['field']['error']) - * @param notrigger Disable all triggers - * @return int >0 if OK, <0 or string if KO + * + * @param string $src_file Source full path filename ($_FILES['field']['tmp_name']) + * @param string $dest_file Target full path filename + * @param int $allowoverwrite 1=Overwrite target file if it already exists + * @param int $disablevirusscan 1=Disable virus scan + * @param string $uploaderrorcode Value of upload error code ($_FILES['field']['error']) + * @param int $notrigger Disable all triggers + * @return int >0 if OK, <0 or string if KO */ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $notrigger=0) { @@ -606,15 +613,14 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable /** * Remove a file or several files with a mask * - * @param file File to delete or mask of file to delete - * @param disableglob Disable usage of glob like * - * @param nophperrors Disable all PHP output errors - * @param notrigger Disable all triggers - * @param triggercode Code of trigger TODO ???? why ? - * @param object Object for trigger - * @return boolean True if file is deleted, False if error + * @param string $file File to delete or mask of file to delete + * @param int $disableglob Disable usage of glob like * + * @param int $nophperrors Disable all PHP output errors + * @param int $notrigger Disable all triggers + * @param Object $object Object + * @return boolean True if file is deleted, False if error */ -function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$triggercode='FILE_DELETE',$object=null) +function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$object=null) { global $db, $conf, $user, $langs; @@ -635,10 +641,11 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$trigg if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$file; + // TODO Replace trigger by a hook. Triggers must be used for business events only. // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($db); - $result=$interface->run_triggers($triggercode,$object,$user,$langs,$conf); + $result=$interface->run_triggers('FILE_DELETE',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers } @@ -660,9 +667,9 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$trigg * Remove a directory (not recursive, so content must be empty). * If directory is not empty, return false * - * @param dir Directory to delete - * @param nophperrors Disable all PHP output errors - * @return boolean True if success, false if error + * @param string $dir Directory to delete + * @param int $nophperrors Disable all PHP output errors + * @return boolean True if success, false if error */ function dol_delete_dir($dir,$nophperrors=0) { @@ -886,10 +893,11 @@ function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession= /** * Remove an uploaded file (for example after submitting a new file a mail form). * All information used are in db, conf, langs, user and _FILES. - * @param filenb File nb to delete - * @param donotupdatesession 1=Do not edit _SESSION variable - * @param donotdeletefile 1=Do not delete physically file - * @return string Message with result of upload and store. + * + * @param int $filenb File nb to delete + * @param int $donotupdatesession 1=Do not edit _SESSION variable + * @param int $donotdeletefile 1=Do not delete physically file + * @return string Message with result of upload and store. */ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=0) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 8ead0625328..d4825c62fd1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -380,11 +380,13 @@ class CommandeFournisseur extends Commande /** * Set draft status + * TODO This method seems to be never called. * - * @param User $user Object user that modify - * @return int <0 if KO, >0 if OK + * @param User $user Object user that modify + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK */ - function set_draft($user) + function set_draft($user, $idwarehouse=-1) { global $conf,$langs; @@ -424,8 +426,7 @@ class CommandeFournisseur extends Commande { $mouvP = new MouvementStock($this->db); // We increment stock of product (and sub-products) - $entrepot_id = "1"; // TODO ajouter possibilite de choisir l'entrepot - $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); + $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); if ($result < 0) { $error++; } } } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index ed2100a03bd..244efc1a636 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -835,11 +835,13 @@ class FactureFournisseur extends Facture /** - * Set draft status - * @param user Object user that modify - * @param int <0 if KO, >0 if OK + * Set draft status + * + * @param User $user Object user that modify + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK */ - function set_draft($user) + function set_draft($user, $idwarehouse=-1) { global $conf,$langs; @@ -847,7 +849,7 @@ class FactureFournisseur extends Facture if ($this->statut == 0) { - dol_syslog("FactureFournisseur::set_draft already draft status", LOG_WARNING); + dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); return 0; } @@ -857,8 +859,9 @@ class FactureFournisseur extends Facture $sql.= " SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog("FactureFournisseur::set_draft sql=".$sql, LOG_DEBUG); - if ($this->db->query($sql)) + dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG); + $result=$this->db->query($sql); + if ($result) { // Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) @@ -873,8 +876,7 @@ class FactureFournisseur extends Facture { $mouvP = new MouvementStock($this->db); // We increase stock for product - $entrepot_id = "1"; // TODO ajouter possibilite de choisir l'entrepot - $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); + $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); } } } @@ -901,10 +903,10 @@ class FactureFournisseur extends Facture /** * Ajoute une ligne de facture (associe a aucun produit/service predefini) - * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel - * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini - * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,idprod) - * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) + * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel + * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini + * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,idprod) + * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * * @param desc Description de la ligne * @param pu Prix unitaire (HT ou TTC selon price_base_type) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0a147a5c1d9..86d235922e2 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1215,7 +1215,7 @@ else array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); } - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $object->ref), 'confirm_valid', $formquestion, 0, 1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $object->ref), 'confirm_valid', $formquestion, 0, 1, 240); if ($ret == 'html') print '
'; } diff --git a/htdocs/langs/ca_ES/agenda.lang b/htdocs/langs/ca_ES/agenda.lang index 5de2bcd4a09..931e4e1647b 100644 --- a/htdocs/langs/ca_ES/agenda.lang +++ b/htdocs/langs/ca_ES/agenda.lang @@ -38,6 +38,7 @@ InvoiceValidatedInDolibarr=Factura %s validada InvoiceBackToDraftInDolibarr=Factura %s tornada a borrador OrderValidatedInDolibarr=Comanda %s validada OrderApprovedInDolibarr=Comanda %s aprovada +OrderBackToDraftInDolibarr=Comanda %s tordada a borrador InterventionValidatedInDolibarr=Intervenció %s validada ProposalSentByEMail=Pressupost %s enviat per e-mail OrderSentByEMail=Comanda de client %s enviada per e-mail diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index caafb2956e1..0bed48fefee 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - ca_ES - bills +# Dolibarr language file - ca_ES - bills CHARSET=UTF-8 Bill=Factura Bills=Factures @@ -140,6 +140,7 @@ SuppliersDraftInvoices=Factures de proveïdors esborrany Unpaid=Pendents ConfirmDeleteBill=Esteu segur de voler eliminar aquesta factura? ConfirmValidateBill=Esteu segur de voler validar aquesta factura amb la referència %s? +ConfirmUnvalidateBill=Esteu segur de voler tornar la factura %s a l'estat esborrany? ConfirmClassifyPaidBill=Esteu segur de voler classificar la factura %s com pagada? ConfirmCancelBill=Esteu segur de voler anul·lar la factura %s? ConfirmCancelBillQuestion=Per quina raó vol abandonar la factura? @@ -162,6 +163,7 @@ ConfirmClassifyAbandonReasonOtherDesc=Aquesta elecció serà per a qualsevol alt ConfirmCustomerPayment=¿Confirmeu el procés d'aquest pagament de %s%s? ConfirmValidatePayment=Esteu segur de voler validar aquest pagament (cap modificació és possible un cop el pagament estigui validat)? ValidateBill=Validar factura +UnvalidateBill=Tornar factura a esborrany NumberOfBills=Nº de factures NumberOfBillsByMonth=Nº de factures per mes AmountOfBills=Import de les factures diff --git a/htdocs/langs/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index dd75e6c45fc..5e6e455596d 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - ca_ES - orders +# Dolibarr language file - ca_ES - orders CHARSET=UTF-8 OrdersArea=Àrea comandes de clients SuppliersOrdersArea=Àrea comandes a proveïdors @@ -59,6 +59,7 @@ CreateOrder=Crear comanda RefuseOrder=Rebutjar la comanda ApproveOrder=Acceptar la comanda ValidateOrder=Validar la comanda +UnvalidateOrder=Desvalidar la comanda DeleteOrder=Eliminar la comanda CancelOrder=Anul·lar la comanda AddOrder=Crear comanda @@ -83,6 +84,7 @@ ConfirmCloseOrder=Esteu segur de voler tancar aquesta comanda? Un cop tancat, ha ConfirmCloseOrderIfSending=Esteu segur de voler tancar aquesta comanda? No ha de tancar una comanda que encara no té els seus productes enviats ConfirmDeleteOrder=Esteu segur de voler eliminar aquest comanda? ConfirmValidateOrder=Esteu segur de voler validar aquesta comanda sota la referència %s ? +ConfirmUnvalidateOrder=Esteu segur de voler restaurar la comanda %s a l'estat esborrany? ConfirmCancelOrder=Esteu segur de voler anul lar aquesta comanda? ConfirmMakeOrder=Esteu segur de voler confirmar aquest comanda a data de %s ? GenerateBill=Facturar @@ -140,4 +142,4 @@ OrderByMail=Correu OrderByFax=Fax OrderByEMail=E-Mail OrderByWWW=En línia -OrderByPhone=Telèfon \ No newline at end of file +OrderByPhone=Telèfon diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 2acf601712d..8a28ba667bc 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -38,6 +38,7 @@ InvoiceValidatedInDolibarr= Invoice %s validated InvoiceBackToDraftInDolibarr=Invoice %s go back to draft status OrderValidatedInDolibarr= Order %s validated OrderApprovedInDolibarr=Order %s approved +OrderBackToDraftInDolibarr=Order %s go back to draft status InterventionValidatedInDolibarr=Intervention %s validated ProposalSentByEMail=Commercial proposal %s sent by EMail OrderSentByEMail=Customer order %s sent by EMail diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index a66bd16a546..b6ff02dfbf4 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -144,6 +144,7 @@ SuppliersDraftInvoices=Suppliers draft invoices Unpaid=Unpaid ConfirmDeleteBill=Are you sure you want to delete this invoice ? ConfirmValidateBill=Are you sure you want to validate this invoice with reference %s ? +ConfirmUnvalidateBill=Are you sure you want to change invoice %s to draft status ? ConfirmClassifyPaidBill=Are you sure you want to change invoice %s to status paid ? ConfirmCancelBill=Are you sure you want to cancel invoice %s ? ConfirmCancelBillQuestion=Why do you want to classify this invoice 'abandoned' ? @@ -166,6 +167,7 @@ ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other case ConfirmCustomerPayment=Do you confirm this payment input for %s %s ? ConfirmValidatePayment=Are you sure you want to validate this payment ? No change can be made once payment is validated. ValidateBill=Validate invoice +UnvalidateBill=Unvalidate invoice NumberOfBills=Nb of invoices NumberOfBillsByMonth=Nb of invoices by month AmountOfBills=Amount of invoices diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 9b9bdc626e2..ff8a50fad6e 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -59,6 +59,7 @@ CreateOrder=Create Order RefuseOrder=Refuse order ApproveOrder=Accept order ValidateOrder=Validate order +UnvalidateOrder=Unvalidate order DeleteOrder=Delete order CancelOrder=Cancel order AddOrder=Add order @@ -83,6 +84,7 @@ ConfirmCloseOrder=Are you sure you want to close this order ? Once an order is c ConfirmCloseOrderIfSending=Are you sure you want to close this order ? You must close an order only when all shipping are done. ConfirmDeleteOrder=Are you sure you want to delete this order ? ConfirmValidateOrder=Are you sure you want to validate this order under name %s ? +ConfirmUnvalidateOrder=Are you sure you want to restore order %s to draft status ? ConfirmCancelOrder=Are you sure you want to cancel this order ? ConfirmMakeOrder=Are you sure you want to confirm you made this order on %s ? GenerateBill=Generate invoice diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index 0c3a662260d..1571887e1ac 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -38,6 +38,7 @@ InvoiceValidatedInDolibarr=Factura %s validada InvoiceBackToDraftInDolibarr=Factura %s devuelta a borrador OrderValidatedInDolibarr=Pedido %s validado OrderApprovedInDolibarr=Pedido %s aprobado +OrderBackToDraftInDolibarr=Pedido %s devuelto a borrador InterventionValidatedInDolibarr=Intervención %s validada ProposalSentByEMail=Presupuesto %s enviado por e-mail OrderSentByEMail=Pedido de cliente %s enviado por e-mail @@ -61,7 +62,7 @@ AgendaUrlOptions5=logind=%s para restringir inserciones a acciones realiz AgendaShowBirthdayEvents=Mostrar cumpleaños de los contactos AgendaHideBirthdayEvents=Ocultar cumpleaños de los contactos ExtSites=Calendarios externos -# External Sites ical=undefined +# External Sites ical= ExtSitesEnableThisTool=Mostrar calendarios externos en la agenda ExtSitesNbOfAgenda=Número de calendarios AgendaExtNb=Calendario nº %s diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 7bcc3cb432c..9501abc248f 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - es_ES - bills +# Dolibarr language file - es_ES - bills CHARSET=UTF-8 Bill=Factura Bills=Facturas @@ -140,6 +140,7 @@ SuppliersDraftInvoices=Facturas de proveedores borrador Unpaid=Pendientes ConfirmDeleteBill=¿Está seguro de querer eliminar esta factura? ConfirmValidateBill=¿Está seguro de querer validar esta factura con la referencia %s ? +ConfirmUnvalidateBill=¿Está seguro de querer devolver la factura %s al estado borrador? ConfirmClassifyPaidBill=¿Esta seguro de querer clasificar la factura %s como pagada? ConfirmCancelBill=¿Está seguro de querer anular la factura %s ? ConfirmCancelBillQuestion=¿Por qué razón quiere abandonar la factura? @@ -162,6 +163,7 @@ ConfirmClassifyAbandonReasonOtherDesc=Esta elección será para cualquier otro c ConfirmCustomerPayment=¿Confirma el proceso de este pago de %s %s ? ConfirmValidatePayment=¿Está seguro de querer validar este pago (ninguna modificación es posible una vez el pago esté validado)? ValidateBill=Validar factura +UnvalidateBill=Devolver factura a borrador NumberOfBills=Nº de facturas NumberOfBillsByMonth=Nº de facturas por mes AmountOfBills=Importe de las facturas diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index b35d80898c9..881920cc4e6 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -59,6 +59,7 @@ CreateOrder=Crear pedido RefuseOrder=Rechazar el pedido ApproveOrder=Aceptar el pedido ValidateOrder=Validar el pedido +UnvalidateOrder=Desvalidar el pedido DeleteOrder=Eliminar el pedido CancelOrder=Anular el pedido AddOrder=Crear pedido @@ -83,6 +84,7 @@ ConfirmCloseOrder=¿Está seguro de querer cerrar este pedido? Una vez cerrado, ConfirmCloseOrderIfSending=¿Está seguro de querer cerrar este pedido? No debe cerrar un pedido que aún no tiene sus productos enviados ConfirmDeleteOrder=¿Está seguro de querer eliminar este pedido? ConfirmValidateOrder=¿Está seguro de querer validar este pedido bajo la referencia %s ? +ConfirmUnvalidateOrder=¿Está seguro de querer restaurar el pedido %s al estado borrador? ConfirmCancelOrder=¿Está seguro de querer anular este pedido? ConfirmMakeOrder=¿Está seguro de querer confirmar este pedido en fecha de%s ? GenerateBill=Facturar diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index f9dd2226d77..b4ef15f0ae9 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -38,6 +38,7 @@ InvoiceValidatedInDolibarr=Facture %s validée InvoiceBackToDraftInDolibarr=Facture %s repassée en brouillon OrderValidatedInDolibarr=Commande %s validée OrderApprovedInDolibarr=Commande %s approuvée +OrderBackToDraftInDolibarr=Commande %s repassée en brouillon InterventionValidatedInDolibarr=Intervention %s validée ProposalSentByEMail=Proposition commerciale %s envoyée par EMail OrderSentByEMail=Commande client %s envoyée par EMail diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 99865ba5387..6be746e3f55 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -140,6 +140,7 @@ SuppliersDraftInvoices=Factures fournisseurs brouillons Unpaid=Impayées ConfirmDeleteBill=Êtes-vous sûr de vouloir supprimer cette facture ? ConfirmValidateBill=Êtes-vous sûr de vouloir valider cette facture sous la référence %s ? +ConfirmUnvalidateBill=Êtes-vous sûr de vouloir repasser la facture %s au statut brouillon ? ConfirmClassifyPaidBill=Êtes-vous sûr de vouloir classer la facture %s comme payée ? ConfirmCancelBill=Êtes-vous sûr de vouloir annuler la facture %s ? ConfirmCancelBillQuestion=Pour quelle raison voulez-vous classer la facture abandonnée ? @@ -162,6 +163,7 @@ ConfirmClassifyAbandonReasonOtherDesc=Ce choix sera celui choisi dans tout autre ConfirmCustomerPayment=Confirmez-vous la saisie de ce règlement de %s %s ? ConfirmValidatePayment=Êtes-vous sûr de vouloir valider ce paiement, aucune modification n'est possible une fois le paiement validé ? ValidateBill=Valider facture +UnvalidateBill=Repasser facture en brouillon NumberOfBills=Nb de factures NumberOfBillsByMonth=Nb de factures par mois AmountOfBills=Montant de factures diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index 67261fc26cd..df484e33b3a 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -59,6 +59,7 @@ CreateOrder=Créer Commande RefuseOrder=Refuser la commande ApproveOrder=Accepter la commande ValidateOrder=Valider la commande +UnvalidateOrder=Dévalider la commande DeleteOrder=Supprimer la commande CancelOrder=Annuler la commande AddOrder=Créer commande @@ -83,6 +84,7 @@ ConfirmCloseOrder=Êtes-vous sûr de vouloir clôturer cette commande ? Une fois ConfirmCloseOrderIfSending=Êtes-vous sûr de vouloir clôturer cette commande ? Vous ne devez clôturer une commande qu'une fois les produits expédiés. ConfirmDeleteOrder=Êtes-vous sûr de vouloir effacer cette commande ? ConfirmValidateOrder=Êtes-vous sûr de vouloir valider cette commande sous la référence %s ? +ConfirmUnvalidateOrder=Êtes-vous sûr de vouloir restaurer la commande %s au statut brouillon ? ConfirmCancelOrder=Êtes-vous sûr de vouloir annuler cette commande ? ConfirmMakeOrder=Êtes-vous sûr de vouloir confirmer cette commande en date du %s ? GenerateBill=Facturer diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 5046fb47e28..c516101295b 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -133,6 +133,9 @@ class Entrepot extends CommonObject $this->cp=trim($this->cp); $this->ville=$this->db->escape(trim($this->ville)); $this->pays_id=trim($this->pays_id?$this->pays_id:0); + $this->zip=trim($this->cp); + $this->town=$this->db->escape(trim($this->ville)); + $this->country_id=trim($this->pays_id?$this->pays_id:0); $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; $sql .= " SET label = '" . $this->libelle ."'"; @@ -140,9 +143,9 @@ class Entrepot extends CommonObject $sql .= ",statut = " . $this->statut ; $sql .= ",lieu = '" . $this->lieu ."'"; $sql .= ",address = '" . $this->address ."'"; - $sql .= ",cp = '" . $this->cp ."'"; - $sql .= ",ville = '" . $this->ville ."'"; - $sql .= ",fk_pays = " . $this->pays_id; + $sql .= ",cp = '" . $this->zip ."'"; + $sql .= ",ville = '" . $this->town ."'"; + $sql .= ",fk_pays = " . $this->country_id; $sql .= " WHERE rowid = " . $id; $this->db->begin(); @@ -221,7 +224,7 @@ class Entrepot extends CommonObject */ function fetch($id) { - $sql = "SELECT rowid, label, description, statut, lieu, address, cp, ville, fk_pays"; + $sql = "SELECT rowid, label, description, statut, lieu, address, cp as zip, ville as town, fk_pays as country_id"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; $sql .= " WHERE rowid = ".$id; @@ -238,13 +241,16 @@ class Entrepot extends CommonObject $this->statut = $obj->statut; $this->lieu = $obj->lieu; $this->address = $obj->address; - $this->cp = $obj->cp; - $this->ville = $obj->ville; - $this->pays_id = $obj->fk_pays; + $this->cp = $obj->zip; + $this->ville = $obj->town; + $this->pays_id = $obj->country_id; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->country_id = $obj->country_id; - if ($this->pays_id) + if ($this->country_id) { - $sqlp = "SELECT code,libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$this->pays_id; + $sqlp = "SELECT code,libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$this->country_id; $resql=$this->db->query($sqlp); if ($resql) { @@ -256,6 +262,8 @@ class Entrepot extends CommonObject } $this->pays=$objp->libelle; $this->pays_code=$objp->code; + $this->country=$objp->libelle; + $this->country_code=$objp->code; } $this->db->free($result); @@ -269,9 +277,10 @@ class Entrepot extends CommonObject } - /* - * \brief Charge les informations d'ordre info dans l'objet entrepot - * \param id id de l'entrepot a charger + /** + * Charge les informations d'ordre info dans l'objet entrepot + * + * @param int $id id de l'entrepot a charger */ function info($id) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 3c6d2e051e6..d96539e311e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -78,7 +78,7 @@ class MouvementStock $movestock=0; if ($product->type != 1 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock=1; - if ($movestock) // Change stock for current product, change for subproduct is done after + if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after { $sql = "INSERT INTO ".MAIN_DB_PREFIX."stock_mouvement"; $sql.= " (datem, fk_product, fk_entrepot, value, type_mouvement, fk_user_author, label, price)"; diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 16cab013f43..f8043f306d8 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -29,6 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/stock.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/product.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php"); $langs->load("products"); $langs->load("stocks"); @@ -51,20 +52,23 @@ $mesg = ''; // Ajout entrepot if ($action == 'add' && $user->rights->stock->creer) { - $entrepot = new Entrepot($db); + $object = new Entrepot($db); - $entrepot->ref = $_POST["ref"]; - $entrepot->libelle = $_POST["libelle"]; - $entrepot->description = $_POST["desc"]; - $entrepot->statut = $_POST["statut"]; - $entrepot->lieu = $_POST["lieu"]; - $entrepot->address = $_POST["address"]; - $entrepot->cp = $_POST["cp"]; - $entrepot->ville = $_POST["ville"]; - $entrepot->pays_id = $_POST["pays_id"]; + $object->ref = $_POST["ref"]; + $object->libelle = $_POST["libelle"]; + $object->description = $_POST["desc"]; + $object->statut = $_POST["statut"]; + $object->lieu = $_POST["lieu"]; + $object->address = $_POST["address"]; + $object->cp = $_POST["zipcode"]; + $object->ville = $_POST["town"]; + $object->pays_id = $_POST["pays_id"]; + $object->zip = $_POST["zipcode"]; + $object->town = $_POST["town"]; + $object->country_id = $_POST["pays_id"]; - if ($entrepot->libelle) { - $id = $entrepot->create($user); + if ($object->libelle) { + $id = $object->create($user); if ($id > 0) { header("Location: fiche.php?id=".$id); @@ -72,7 +76,7 @@ if ($action == 'add' && $user->rights->stock->creer) } $action = 'create'; - $mesg='
'.$entrepot->error.'
'; + $mesg='
'.$object->error.'
'; } else { $mesg='
'.$langs->trans("ErrorWarehouseRefRequired").'
'; @@ -83,9 +87,9 @@ if ($action == 'add' && $user->rights->stock->creer) // Delete warehouse if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->stock->supprimer) { - $entrepot = new Entrepot($db); - $entrepot->fetch($_REQUEST["id"]); - $result=$entrepot->delete($user); + $object = new Entrepot($db); + $object->fetch($_REQUEST["id"]); + $result=$object->delete($user); if ($result > 0) { header("Location: ".DOL_URL_ROOT.'/product/stock/liste.php'); @@ -93,7 +97,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right } else { - $mesg='
'.$entrepot->error.'
'; + $mesg='
'.$object->error.'
'; $action=''; } } @@ -101,19 +105,22 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right // Modification entrepot if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) { - $entrepot = new Entrepot($db); - if ($entrepot->fetch($_POST["id"])) + $object = new Entrepot($db); + if ($object->fetch($_POST["id"])) { - $entrepot->libelle = $_POST["libelle"]; - $entrepot->description = $_POST["desc"]; - $entrepot->statut = $_POST["statut"]; - $entrepot->lieu = $_POST["lieu"]; - $entrepot->address = $_POST["address"]; - $entrepot->cp = $_POST["cp"]; - $entrepot->ville = $_POST["ville"]; - $entrepot->pays_id = $_POST["pays_id"]; + $object->libelle = $_POST["libelle"]; + $object->description = $_POST["desc"]; + $object->statut = $_POST["statut"]; + $object->lieu = $_POST["lieu"]; + $object->address = $_POST["address"]; + $object->cp = $_POST["zipcode"]; + $object->ville = $_POST["town"]; + $object->pays_id = $_POST["pays_id"]; + $object->zip = $_POST["zipcode"]; + $object->town = $_POST["town"]; + $object->country_id = $_POST["pays_id"]; - if ( $entrepot->update($_POST["id"], $user) > 0) + if ( $object->update($_POST["id"], $user) > 0) { $action = ''; $_GET["id"] = $_POST["id"]; @@ -123,14 +130,14 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) { $action = 'edit'; $_GET["id"] = $_POST["id"]; - $mesg = '
'.$entrepot->error.'
'; + $mesg = '
'.$object->error.'
'; } } else { $action = 'edit'; $_GET["id"] = $_POST["id"]; - $mesg = '
'.$entrepot->error.'
'; + $mesg = '
'.$object->error.'
'; } } @@ -148,6 +155,7 @@ if ($_POST["cancel"] == $langs->trans("Cancel")) $productstatic=new Product($db); $form=new Form($db); +$formcompany=new FormCompany($db); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("",$langs->trans("WarehouseCard"),$help_url); @@ -169,25 +177,31 @@ if ($action == 'create') // Ref print ''; - print ''; + print ''; // Description print ''; print ''; - print ''; - print ''; + // Zip / Town + print ''; - print ''; print ''; - print ''; + print ''; // Description - print ''; + print ''; // Address print ''; // Ville - print ''; - print ''; + print ''; + print ''; // Country print ''; // Statut - print ''; + print ''; - $calcproducts=$entrepot->nb_products(); + $calcproducts=$object->nb_products(); // Nb of products print '"; } if ($user->rights->stock->creer) { - print '"; } @@ -475,44 +489,52 @@ else print ''; print ''; print ''; - print ''; + print ''; print '
'; + $out.= ''; $out.= $langs->trans('Model').' '; if (is_array($modellist) && count($modellist) == 1) // If there is only one element { @@ -382,17 +382,17 @@ class FormFile $modelselected=$arraykeys[0]; } $out.= $form->selectarray('model',$modellist,$modelselected,$showempty,0,0); - $out.= ''; + $out.= ''; + $out.= ''; $out.= $langs->trans("Files"); - $out.= ''; + $out.= ''; + $out.= ''; if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang) { include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'); @@ -404,10 +404,10 @@ class FormFile { $out.= ' '; } - $out.= ''; + $out.= ''; + $out.= ''; $out.= 'load("errors"); $out.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } - $out.= ''; + $out.= '
'.$langs->trans("Ref").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("Description").''; // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); - $doleditor=new DolEditor('desc',$entrepot->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); + $doleditor=new DolEditor('desc',$object->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); $doleditor->Create(); print '
'.$langs->trans('Address').'
'.$langs->trans('Zip').''.$langs->trans('Town').'
'.$langs->trans('Zip').''; + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectpays_id','departement_id'),6); + print ''.$langs->trans('Town').''; + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectpays_id','departement_id')); + print '
'.$langs->trans('Country').''; - $form->select_pays($entrepot->pays_id?$entrepot->pays_id:$mysoc->pays_code, 'pays_id'); + // Country + print '
'.$langs->trans('Country').''; + $form->select_pays($object->country_id?$object->country_id:$mysoc->country_code,'pays_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
'.$langs->trans("Status").''; @@ -209,8 +223,8 @@ else { dol_htmloutput_mesg($mesg); - $entrepot = new Entrepot($db); - $result = $entrepot->fetch($_GET["id"]); + $object = new Entrepot($db); + $result = $object->fetch($_GET["id"]); if ($result < 0) { dol_print_error($db); @@ -221,7 +235,7 @@ else */ if ($action <> 'edit' && $action <> 're-edit') { - $head = stock_prepare_head($entrepot); + $head = stock_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("Warehouse"), 0, 'stock'); @@ -229,7 +243,7 @@ else if ($action == 'delete') { $form = new Form($db); - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$entrepot->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$entrepot->libelle),"confirm_delete",'',0,2); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2); if ($ret == 'html') print '
'; } @@ -237,34 +251,34 @@ else // Ref print '
'.$langs->trans("Ref").''; - print $form->showrefnav($entrepot,'id','',1,'rowid','libelle'); + print $form->showrefnav($object,'id','',1,'rowid','libelle'); print '
'.$langs->trans("LocationSummary").''.$entrepot->lieu.'
'.$langs->trans("LocationSummary").''.$object->lieu.'
'.$langs->trans("Description").''.nl2br($entrepot->description).'
'.$langs->trans("Description").''.nl2br($object->description).'
'.$langs->trans('Address').''; - print $entrepot->address; + print $object->address; print '
'.$langs->trans('Zip').''.$entrepot->cp.''.$langs->trans('Town').''.$entrepot->ville.'
'.$langs->trans('Zip').''.$object->zip.''.$langs->trans('Town').''.$object->town.'
'.$langs->trans('Country').''; - $img=picto_from_langcode($entrepot->pays_code); + $img=picto_from_langcode($object->country_code); print ($img?$img.' ':''); - print $entrepot->pays; + print $object->country; print '
'.$langs->trans("Status").''.$entrepot->getLibStatut(4).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("NumberOfProducts").''; @@ -279,7 +293,7 @@ else // Last movement $sql = "SELECT max(m.datem) as datem"; $sql .= " FROM llx_stock_mouvement as m"; - $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."'"; + $sql .= " WHERE m.fk_entrepot = '".$object->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) { @@ -294,7 +308,7 @@ else if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour').' '; - print '('.$langs->trans("FullList").')'; + print '('.$langs->trans("FullList").')'; } else { @@ -318,12 +332,12 @@ else if ($action == '') { if ($user->rights->stock->creer) - print "id."\">".$langs->trans("Modify").""; + print "id."\">".$langs->trans("Modify").""; else print "".$langs->trans("Modify").""; if ($user->rights->stock->supprimer) - print "id."\">".$langs->trans("Delete").""; + print "id."\">".$langs->trans("Delete").""; else print "".$langs->trans("Delete").""; } @@ -359,7 +373,7 @@ else $sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p"; $sql.= " WHERE ps.fk_product = p.rowid"; $sql.= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) - $sql.= " AND ps.fk_entrepot = ".$entrepot->id; + $sql.= " AND ps.fk_entrepot = ".$object->id; $sql.= $db->order($sortfield,$sortorder); dol_syslog('List products sql='.$sql); @@ -426,14 +440,14 @@ else if ($user->rights->stock->mouvement->creer) { - print ''; + print ''; print img_picto($langs->trans("StockMovement"),'uparrow.png').' '.$langs->trans("StockMovement"); print "'; + print ''; print $langs->trans("StockCorrection"); print "
'; // Ref - print ''; + print ''; - print ''; + print ''; // Description print ''; print ''; - print ''; - print ''; + // Zip / Town + print ''; - print ''; print ''; - print ''; print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("LocationSummary").'
'.$langs->trans("Description").''; // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); - $doleditor=new DolEditor('desc',$entrepot->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); + $doleditor=new DolEditor('desc',$object->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); $doleditor->Create(); print '
'.$langs->trans('Address').'
'.$langs->trans('Zip').''.$langs->trans('Town').'
'.$langs->trans('Zip').''; + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectpays_id','departement_id'),6); + print ''.$langs->trans('Town').''; + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectpays_id','departement_id')); + print '
'.$langs->trans('Country').''; - $form->select_pays($entrepot->pays_id, 'pays_id'); + // Country + print '
'.$langs->trans('Country').''; + $form->select_pays($object->country_id?$object->country_id:$mysoc->country_code,'pays_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
'.$langs->trans("Status").''; print ''; print '
 '; - print '
'; + + print '

 '; + print '
'; + print ''; } diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index d4855b58f4a..4b7057125c4 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -116,7 +116,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($object->fetch($socid)) { $file = $upload_dir . "/" . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file,0,0,0,'FILE_DELETE',$object); + dol_delete_file($file,0,0,0,$object); $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } } diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 0f05eaf349a..d251c48fc23 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1076,6 +1076,14 @@ background-repeat: repeat-x; */ +.paddingrightonly { + border-collapse: collapse; + border: 0px; + margin-left: 0px; + spacing-left: 0px; + padding-left: 0px; + padding-right: 4px; +} .nocellnopadd { list-style-type:none; margin: 0px; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 00d6c77f0c2..4cb8fcb67ee 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -91,7 +91,6 @@ a:link, a:visited, a:hover, a:active { font-family: ; fo input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; } - input, input.flat, textarea, textarea.flat, form.flat select, select.flat { font-size: px; font-family: ; @@ -133,6 +132,9 @@ textarea:disabled { .button:hover { background: #dee7ec; } +.button:disabled { + background: #ddd; +} .buttonajax { font-family: ; border: 0px; @@ -155,6 +157,14 @@ div.float { float:; } +th .button { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + -moz-border-radius:0px !important; + -webkit-border-radius:0px !important; + border-radius:0px !important; +} /* ============================================================================== */ /* Styles to hide objects */ @@ -166,6 +176,7 @@ div.float .linkobject { cursor: pointer; } + /* ============================================================================== */ /* Styles for dragging lines */ /* ============================================================================== */ @@ -953,10 +964,6 @@ a.tabTitle { margin: 0px 6px; text-decoration: none; white-space: nowrap; - - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; } a.tab:link { @@ -1121,7 +1128,14 @@ background-repeat: repeat-x; } */ - +.paddingrightonly { + border-collapse: collapse; + border: 0px; + margin-left: 0px; + spacing-left: 0px; + padding-left: 0px; + padding-right: 4px; +} .nocellnopadd { list-style-type:none; margin: 0px; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index e18cd0020a5..7727f351915 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1318,8 +1318,8 @@ else print ''; print ''; print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; print '
'.$langs->trans("GroupsToAdd").''; + print '
'.$langs->trans("GroupsToAdd").''; print $form->select_dolgroups('','group',1,$exclude,0,'','',$fuser->entity); print '   '; // Multicompany @@ -1341,7 +1341,7 @@ else print ''; } print ''; - print '
'."\n"; print '
'; @@ -1516,7 +1516,7 @@ else print "\n"; // Administrator - print "".''.$langs->trans("Administrator").''; + print ''.$langs->trans("Administrator").''; if ($fuser->societe_id > 0) { print '';