diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 2356184fb75..c48fc607f6d 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -951,16 +951,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetTextColor(0,0,60); $pdf->SetFillColor(255,255,255); - // Show sender name - $pdf->SetXY($posx+2,$posy+3); - $pdf->SetFont('','B',$default_font_size); - $pdf->MultiCell($widthrecbox-2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy=$pdf->getY(); - - // Show sender information - $pdf->SetXY($posx+2,$posy); - $pdf->SetFont('','', $default_font_size - 1); - $pdf->MultiCell($widthrecbox-2, 4, $carac_emetteur, 0, 'L'); + // If RECEPTION contact defined, we use it @@ -985,6 +976,18 @@ class pdf_squille extends ModelePdfReception $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails',$object); + // Show recipient name + $pdf->SetXY($posx+2,$posy+3); + $pdf->SetFont('','B', $default_font_size); + $pdf->MultiCell($widthrecbox-2, 4, $carac_client_name, 0, 'L'); + + $posy = $pdf->getY(); + + // Show recipient information + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetXY($posx+2,$posy); + $pdf->MultiCell($widthrecbox-2, 4, $carac_client, 0, 'L'); + // Show recipient $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format @@ -999,17 +1002,18 @@ class pdf_squille extends ModelePdfReception $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L'); $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); - // Show recipient name + + + // Show sender name $pdf->SetXY($posx+2,$posy+3); - $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L'); + $pdf->SetFont('','B',$default_font_size); + $pdf->MultiCell($widthrecbox, 2, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); - $posy = $pdf->getY(); - - // Show recipient information - $pdf->SetFont('','', $default_font_size - 1); + // Show sender information $pdf->SetXY($posx+2,$posy); - $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell($widthrecbox, 4, $carac_emetteur, 0, 'L'); } $pdf->SetTextColor(0,0,0); diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 4e09fef4d43..42e95b95aab 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -62,6 +62,7 @@ class InterfaceActionsAuto extends DolibarrTriggers */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { + if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing $key = 'MAIN_AGENDA_ACTIONAUTO_'.$action; @@ -401,6 +402,36 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg=$langs->transnoentities("ShippingSentByEMail",$object->ref); } + // Parameters $object->sendtoid defined by caller + //$object->sendtoid=0; + } + elseif ($action == 'RECEPTION_VALIDATE') + { + $langs->load("agenda"); + $langs->load("other"); + $langs->load("receptions"); + + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ReceptionValidated",($object->newref?$object->newref:$object->ref)); + if (empty($object->actionmsg)) + { + $object->actionmsg=$langs->transnoentities("ReceptionValidated",($object->newref?$object->newref:$object->ref)); + } + + // Parameters $object->sendtoid defined by caller + //$object->sendtoid=0; + } + elseif ($action == 'RECEPTION_SENTBYMAIL') + { + $langs->load("agenda"); + $langs->load("other"); + $langs->load("receptions"); + + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ReceptionSentByEMail",$object->ref); + if (empty($object->actionmsg)) + { + $object->actionmsg=$langs->transnoentities("ReceptionSentByEMail",$object->ref); + } + // Parameters $object->sendtoid defined by caller //$object->sendtoid=0; } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 25a4202fcf2..01741c50682 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -832,7 +832,7 @@ if ($id > 0 || ! empty($ref)) { print ''; // Comment - print '' . $objp->comment . ''; + print '' . $objp->comment . ''; // Status if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) { diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index d25963e8c3a..b63fcfb6295 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -67,7 +67,9 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_VALIDATE','Reception validated','Executed when a reception is validated','reception',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_SENTBYMAIL','Reception sent by mail','Executed when a reception is sent by mail','reception',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',23); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',25); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',26); diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index d158b633eb2..d0659ed37d1 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -77,6 +77,8 @@ SupplierOrderSentByEMail=Commande fournisseur %s envoyée par email SupplierInvoiceSentByEMail=Facture fournisseur %s envoyée par email ShippingSentByEMail=Bon d'expédition %s envoyé par email ShippingValidated= Expédition %s validée +ReceptionSentByEMail=Réception %s envoyée par email +ReceptionValidated= Réception %s validée InterventionSentByEMail=Intervention %s envoyée par email ProposalDeleted=Proposition commerciale supprimée OrderDeleted=Commande supprimée diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index a0a1e337faa..75bbee61ab0 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - Source file is en_US - sendings +# Dolibarr language file - Source file is en_US - receptions RefReception=Réf. réception Reception=Réception reception=Réception @@ -11,7 +11,7 @@ ShowReception=Afficher Réceptions Receivings=Bons de réceptions ReceptionsArea=Espace réceptions ListOfReceptions=Liste des réceptions -ReceptionMethod=Méthode de réception +ReceptionMethod=Mode de transport LastReceptions=Les %s dernières réceptions StatisticsOfReceptions=Statistiques des réceptions NbOfReceptions=Nombre de réceptions diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index d58d0e40f70..7cd6ac43a62 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -625,11 +625,13 @@ if (empty($reshook)) // single warehouse reception line $stockLocation = "entl".$line_id; $qty = "qtyl".$line_id; + $comment = "comment".$line_id; $line->id = $line_id; $line->fk_entrepot = GETPOST($stockLocation, 'int'); $line->qty = GETPOST($qty, 'int'); + $line->comment = GETPOST($comment, 'alpha'); if(!empty($conf->productbatch->enabled)){ $batch = "batch".$line_id; @@ -869,7 +871,7 @@ if ($action == 'create') print ''; // Delivery method - print "".$langs->trans("DeliveryMethod").""; + print "".$langs->trans("ReceptionMethod").""; print ''; $recept->fetch_delivery_methods(); print $form->selectarray("shipping_method_id", $recept->meths, GETPOST('shipping_method_id','int'),1,0,0,"",1); @@ -1128,9 +1130,10 @@ $numAsked ++; $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; } $warehouse_id = $dispatchLines[$indiceAsked]['ent']; + $warehouseObject = null; - if ($warehouse_id > 0 || ! ($line->fk_product > 0) || empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection + if ( !empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection { print ''; @@ -1163,7 +1166,7 @@ $numAsked ++; if ($line->fk_product > 0) { print ''; - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1); + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0 , 0, $line->fk_product, '', 1); } } @@ -1192,28 +1195,7 @@ $numAsked ++; } print "\n"; - // Show subproducts of product - if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) - { - $product->get_sousproduits_arbo(); - $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); - if(count($prods_arbo) > 0) - { - foreach($prods_arbo as $key => $value) - { - //print $value[0]; - $img=''; - if ($value['stock'] < $value['stock_alert']) - { - $img=img_warning($langs->trans("StockTooLow")); - } - print "      -> - ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   - ".$value['stock']." ".$img.""; - } - } - } + } @@ -1600,7 +1582,7 @@ else if ($id || $ref) // Reception method print ''; print ''; if ($action != 'editshipping_method_id') print ''; @@ -1690,6 +1672,8 @@ else if ($id || $ref) } // Product/Service print ''; + // Comment + print ''; // Qty print ''; if ($origin && $origin_id > 0) @@ -1869,6 +1853,16 @@ else if ($id || $ref) print_date_range($lines[$i]->date_start,$lines[$i]->date_end); print "\n"; } + + if ($action == 'editline' && $lines[$i]->id == $line_id) + { + print ''; + } + else + { + print ''; + } + // Qty ordered print ''; diff --git a/htdocs/reception/create-table.php b/htdocs/reception/create-table.php index f5c06a7f45f..0f71fb6938f 100644 --- a/htdocs/reception/create-table.php +++ b/htdocs/reception/create-table.php @@ -37,10 +37,14 @@ $error = 0; // We always choose in mysql directory (Conversion is done by driver to translate SQL syntax) $dir = DOL_DOCUMENT_ROOT."/install/mysql/tables/"; $sql='ALTER TABLE '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL;'; + + $db->query($sql); +$sql=" insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_VALIDATE','Reception validated','Executed when a reception is validated','reception',22); + insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_SENTBYMAIL','Reception sent by mail','Executed when a reception is sent by mail','reception',22);"; - +$db->query($sql);
'; - print $langs->trans('SendingMethod'); + print $langs->trans('ReceptionMethod'); print 'id.'">'.img_edit($langs->trans('SetReceptionMethod'),1).''.$langs->trans("Products").''.$langs->trans("Comment").''.$langs->trans("QtyOrdered").''.$lines[$i]->comment.''.$lines[$i]->qty_asked.'