NEW auto event msg

This commit is contained in:
atm-quentin 2018-10-15 17:08:28 +02:00
parent 3e29b11890
commit 83c8a78628
8 changed files with 86 additions and 49 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -832,7 +832,7 @@ if ($id > 0 || ! empty($ref)) {
print '</td>';
// Comment
print '<td class="tdoverflowmax300">' . $objp->comment . '</td>';
print '<td class="tdoverflowmax300" style="white-space: pre;">' . $objp->comment . '</td>';
// Status
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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 '</td></tr>';
// Delivery method
print "<tr><td>".$langs->trans("DeliveryMethod")."</td>";
print "<tr><td>".$langs->trans("ReceptionMethod")."</td>";
print '<td colspan="3">';
$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 '<!-- Case warehouse already known or product not a predefined product -->';
@ -1163,7 +1166,7 @@ $numAsked ++;
if ($line->fk_product > 0)
{
print '<!-- Show warehouse selection -->';
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 "</tr>\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 "<tr class=\"oddeven\"><td>&nbsp; &nbsp; &nbsp; ->
<a href=\"".DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']."
</a> (".$value['nb'].")</td><td align=\"center\"> ".$value['nb_total']."</td><td>&nbsp</td><td>&nbsp</td>
<td align=\"center\">".$value['stock']." ".$img."</td></tr>";
}
}
}
}
@ -1600,7 +1582,7 @@ else if ($id || $ref)
// Reception method
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('SendingMethod');
print $langs->trans('ReceptionMethod');
print '</td>';
if ($action != 'editshipping_method_id') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshipping_method_id&amp;id='.$object->id.'">'.img_edit($langs->trans('SetReceptionMethod'),1).'</a></td>';
@ -1690,6 +1672,8 @@ else if ($id || $ref)
}
// Product/Service
print '<td>'.$langs->trans("Products").'</td>';
// Comment
print '<td>'.$langs->trans("Comment").'</td>';
// Qty
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
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 "</td>\n";
}
if ($action == 'editline' && $lines[$i]->id == $line_id)
{
print '<td ><textarea name="comment'.$line_id.'" id="comment'.$line_id.'" /> '.$lines[$i]->comment.'</textarea></td>';
}
else
{
print '<td style="white-space: pre;" >'.$lines[$i]->comment.'</td>';
}
// Qty ordered
print '<td align="center">'.$lines[$i]->qty_asked.'</td>';

View File

@ -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);