rename livraison pdf and dependencies #14697

This commit is contained in:
Aurélien
2020-10-06 13:32:02 +02:00
parent af7c23b2ac
commit 1af42b313c
31 changed files with 94 additions and 94 deletions

View File

@@ -67,12 +67,12 @@ if ($action == 'disable_sending')
if ($action == 'activate_delivery')
{
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity);
header("Location: confexped.php");
exit;
} elseif ($action == 'disable_delivery')
{
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity);
dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity);
header("Location: confexped.php");
exit;
}
@@ -121,7 +121,7 @@ else
print "</td>";
print '</tr>';
// Bon de livraison activation/desactivation
// Delivery note activate/deactivate Bon de livraison activation/desactivation
print '<tr>';
print '<td>';
print $langs->trans("DeliveriesOrderAbility");
@@ -131,7 +131,7 @@ print '<td>';
print '</td>';
print '<td class="center">';
if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
if (empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{
print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} else {

View File

@@ -95,7 +95,7 @@ if ($action == 'specimen')
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir)
{
$file = dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php", 0);
$file = dol_buildpath($reldir."core/modules/delivery/doc/pdf_".$modele.".modules.php", 0);
if (file_exists($file))
{
$filefound = 1;
@@ -112,7 +112,7 @@ if ($action == 'specimen')
if ($module->write_file($sending, $langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=delivery&file=SPECIMEN.pdf");
return;
} else {
setEventMessages($module->error, $module->errors, 'errors');
@@ -134,17 +134,17 @@ if ($action == 'del')
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity);
if ($conf->global->DELIVERY_ADDON_PDF == "$value") dolibarr_del_const($db, 'DELIVERY_ADDON_PDF', $conf->entity);
}
}
if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
if (dolibarr_set_const($db, "DELIVERY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->LIVRAISON_ADDON_PDF = $value;
$conf->global->DELIVERY_ADDON_PDF = $value;
}
// On active le modele
@@ -160,7 +160,7 @@ if ($action == 'setmod')
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "DELIVERY_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
}
@@ -199,7 +199,7 @@ clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/livraison/");
$dir = dol_buildpath($reldir."core/modules/delivery/");
if (is_dir($dir))
{
@@ -208,7 +208,7 @@ foreach ($dirmodels as $reldir)
{
while (($file = readdir($handle)) !== false)
{
if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file) - 3, 3) == 'php')
if (substr($file, 0, 14) == 'mod_delivery_' && substr($file, dol_strlen($file) - 3, 3) == 'php')
{
$file = substr($file, 0, dol_strlen($file) - 4);
@@ -237,7 +237,7 @@ foreach ($dirmodels as $reldir)
print '</td>'."\n";
print '<td class="center">';
if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file")
if ($conf->global->DELIVERY_ADDON_NUMBER == "$file")
{
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
@@ -323,7 +323,7 @@ clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/livraison/doc/");
$dir = dol_buildpath($reldir."core/modules/delivery/doc/");
if (is_dir($dir))
{
@@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir)
// Default
print "<td align=\"center\">";
if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
if ($conf->global->DELIVERY_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"), 'on');
} else {

View File

@@ -2555,7 +2555,7 @@ if ($action == 'create' && $usercancreate)
$numshipping = $object->nb_expedition();
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->livraison->creer)) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
if ($user->rights->expedition->creer) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id.'">'.$langs->trans('CreateShipment').'</a>';
} else {

View File

@@ -3314,7 +3314,7 @@ abstract class CommonObject
} elseif ($objecttype == 'shipping') {
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
} elseif ($objecttype == 'delivery') {
$classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'delivery_note';
$classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'livraison_bon';
} elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
$classpath = 'fourn/class'; $module = 'fournisseur';
} elseif ($objecttype == 'fichinter') {

View File

@@ -371,7 +371,7 @@ class Conf
// Sous module bons d'expedition
$this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0);
// Sub module delivery note Sous module bons de livraison
$this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 0);
$this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0);
// Module fournisseur
if (!empty($this->fournisseur))

View File

@@ -6749,7 +6749,7 @@ class Form
$tplpath = 'reception';
if (empty($conf->reception->enabled)) continue; // Do not show if module disabled
} elseif ($objecttype == 'delivery') {
$tplpath = 'livraison';
$tplpath = 'delivery';
if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled
} elseif ($objecttype == 'invoice_supplier') {
$tplpath = 'fourn/facture';

View File

@@ -366,7 +366,7 @@ class FormFile
}
$printer = 0;
if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'livraison', 'ticket'))) // The direct print feature is implemented only for such elements
if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) // The direct print feature is implemented only for such elements
{
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ?true:false;
}
@@ -466,11 +466,11 @@ class FormFile
include_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php';
$modellist = ModelePdfReception::liste_modeles($this->db);
}
} elseif ($modulepart == 'livraison')
} elseif ($modulepart == 'delivery')
{
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
include_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
$modellist = ModelePDFDeliveryOrder::liste_modeles($this->db);
}
} elseif ($modulepart == 'ficheinter')

View File

@@ -51,7 +51,7 @@ function expedition_prepare_head(Expedition $object)
$hselected = $h;
$h++;
if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{
$head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
$head[$h][1] = $langs->trans("Receivings");
@@ -109,7 +109,7 @@ function expedition_admin_prepare_head()
$h++;
}
if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{
$head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
$head[$h][1] = $langs->trans("Receivings");
@@ -117,7 +117,7 @@ function expedition_admin_prepare_head()
$h++;
}
if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{
$head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
@@ -125,7 +125,7 @@ function expedition_admin_prepare_head()
$h++;
}
if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{
$head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");

View File

@@ -2636,10 +2636,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$accessallowed = 1;
}
$original_file = $conf->expedition->dir_output."/sending/".$original_file;
} // Wrapping pour les bons de livraison
elseif ($modulepart == 'livraison' && !empty($conf->expedition->dir_output))
} // Delivery Note Wrapping
elseif ($modulepart == 'delivery' && !empty($conf->expedition->dir_output))
{
if ($fuser->rights->expedition->livraison->{$lire} || preg_match('/^specimen/i', $original_file))
if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file))
{
$accessallowed = 1;
}

View File

@@ -8652,7 +8652,7 @@ function getElementProperties($element_type)
if ($element_type == 'delivery') {
$classpath = 'delivery/class';
$subelement = 'delivery';
$module = 'delivery_note';
$module = 'livraison_bon';
}
if ($element_type == 'contract') {
$classpath = 'contrat/class';

View File

@@ -1793,7 +1793,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
} elseif ($objecttype == 'delivery') {
$classpath = 'delivery/class';
$myobject = 'delivery';
$module = 'delivery_note';
$module = 'livraison_bon';
} elseif ($objecttype == 'contract') {
$classpath = 'contrat/class';
$module = 'contrat';

View File

@@ -59,17 +59,17 @@ function commande_prepare_head(Commande $object)
}
if (($conf->expedition_bon->enabled && $user->rights->expedition->lire)
|| ($conf->delivery_note->enabled && $user->rights->expedition->livraison->lire))
|| ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire))
{
$nbShipments = $object->getNbOfShipments(); $nbReceiption = 0;
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
$text = '';
if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments");
if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) $text .= ' - ';
if ($conf->delivery_note->enabled) $text .= $langs->trans("Receivings");
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - ';
if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings");
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '<span class="badge marginleftonlyshort">'.($nbShipments ? $nbShipments : 0);
if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - ';
if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0);
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - ';
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0);
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '</span>';
$head[$h][1] = $text;
$head[$h][2] = 'shipping';

View File

@@ -43,13 +43,13 @@ function propal_prepare_head($object)
$h++;
if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
|| (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->livraison->lire))))
|| (!empty($conf->expedition->enabled) && !empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire))))
{
$langs->load("sendings");
$text = '';
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text = $langs->trans("Shipment");
if ($conf->delivery_note->enabled) $text .= '/'.$langs->trans("Receivings");
if ($conf->livraison_bon->enabled) $text .= '/'.$langs->trans("Receivings");
$head[$h][1] = $text;
$head[$h][2] = 'shipping';
$h++;

View File

@@ -47,7 +47,7 @@ function shipping_prepare_head($object)
$head[$h][2] = 'shipping';
$h++;
if ($conf->delivery_note->enabled && $user->rights->expedition->livraison->lire)
if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)
{
// delivery link
$object->fetchObjectLinked($object->id, $object->element);
@@ -213,13 +213,13 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end,";
$sql .= " ed.rowid as edrowid, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot as warehouse_id,";
$sql .= " e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,";
//if ($conf->delivery_note->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,";
//if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,";
$sql .= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch,';
$sql .= ' p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql .= ", ".MAIN_DB_PREFIX."expedition as e";
$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj";
//if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line";
//if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
//TODO Add link to expeditiondet_batch
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
@@ -260,7 +260,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
print '<td>';
print '</td>';
}*/
if (!empty($conf->delivery_note->enabled))
if (!empty($conf->livraison_bon->enabled))
{
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
//print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
@@ -403,7 +403,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
}*/
// Informations on receipt
if (!empty($conf->delivery_note->enabled))
if (!empty($conf->livraison_bon->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
$expedition->id = $objp->sendingid;

View File

@@ -262,7 +262,7 @@ class pdf_ban extends ModeleBankAccountDoc
}
}
$this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
$this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR");
return 0;
}

View File

@@ -415,7 +415,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
}
}
$this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
$this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR");
return 0;
}

View File

@@ -23,12 +23,12 @@
*/
/**
* \file htdocs/core/modules/livraison/doc/pdf_storm.modules.php
* \file htdocs/core/modules/delivery/doc/pdf_storm.modules.php
* \ingroup livraison
* \brief File of class to manage receving receipts with template Storm
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
@@ -157,7 +157,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
/**
* Function to build pdf onto disk
*
* @param Livraison $object Object to generate
* @param Delivery $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details

View File

@@ -22,12 +22,12 @@
*/
/**
* \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
* \file htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
* \ingroup livraison
* \brief File of class to manage receving receipts with template Typhon
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
@@ -618,7 +618,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
}
}
$this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
$this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR");
return 0;
}
@@ -844,7 +844,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// If SHIPPING contact defined on order, we use it
$usecontact = false;
$arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING');
if (count($arrayidcontact) > 0)
if ($arrayidcontact && count($arrayidcontact) > 0)
{
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);

View File

@@ -19,20 +19,20 @@
*/
/**
* \file htdocs/core/modules/livraison/mod_livraison_jade.php
* \file htdocs/core/modules/delivery/mod_delivery_jade.php
* \ingroup delivery
* \brief Fichier contenant la classe du modele de numerotation de reference de bon de livraison Jade
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
/**
* \class mod_livraison_jade
* \class mod_delivery_jade
* \brief Classe du modele de numerotation de reference de bon de livraison Jade
*/
class mod_livraison_jade extends ModeleNumRefDeliveryOrder
class mod_delivery_jade extends ModeleNumRefDeliveryOrder
{
/**
* Dolibarr version of the loaded document
@@ -137,7 +137,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
$sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG);
dol_syslog("mod_delivery_jade::getNextValue", LOG_DEBUG);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj) $max = intval($obj->max);
@@ -153,7 +153,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
else $num = sprintf("%04s", $max + 1);
dol_syslog("mod_livraison_jade::getNextValue return ".$this->prefix.$yymm."-".$num);
dol_syslog("mod_delivery_jade::getNextValue return ".$this->prefix.$yymm."-".$num);
return $this->prefix.$yymm."-".$num;
}
@@ -166,7 +166,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
* @param Object $object Object livraison
* @return string Texte descriptif
*/
public function livraison_get_num($objsoc = 0, $object = '')
public function delivery_get_num($objsoc = 0, $object = '')
{
// phpcs:enable
return $this->getNextValue($objsoc, $object);

View File

@@ -19,17 +19,17 @@
*/
/**
* \file htdocs/core/modules/livraison/mod_livraison_saphir.php
* \file htdocs/core/modules/delivery/mod_livraison_saphir.php
* \ingroup expedition
* \brief Fichier contenant la classe du modele de numerotation de reference de livraison Saphir
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
/**
* \class mod_livraison_saphir
* \class mod_delivery_saphir
* \brief Classe du modele de numerotation de reference de livraison Saphir
*/
class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
{
/**
* Dolibarr version of the loaded document
@@ -72,7 +72,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstdelivery" value="LIVRAISON_SAPHIR_MASK">';
$texte .= '<input type="hidden" name="maskconstdelivery" value="DELIVERY_SAPHIR_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Delivery"), $langs->transnoentities("Delivery"));
@@ -83,7 +83,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
// Parametrage du prefix
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdelivery" value="'.$conf->global->LIVRAISON_SAPHIR_MASK.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdelivery" value="'.$conf->global->DELIVERY_SAPHIR_MASK.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
@@ -131,7 +131,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// On defini critere recherche compteur
$mask = $conf->global->LIVRAISON_SAPHIR_MASK;
$mask = $conf->global->DELIVERY_SAPHIR_MASK;
if (!$mask)
{
@@ -139,7 +139,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
return 0;
}
$numFinal = get_next_value($db, $mask, 'livraison', 'ref', '', $objsoc, $object->date_livraison);
$numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->date_livraison);
return $numFinal;
}
@@ -166,7 +166,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
* @param Object $object Objet livraison
* @return string Texte descripif
*/
public function livraison_get_num($objsoc = 0, $object = '')
public function delivery_get_num($objsoc = 0, $object = '')
{
// phpcs:enable
return $this->getNextValue($objsoc, $object);

View File

@@ -22,7 +22,7 @@
*/
/**
* \file htdocs/core/modules/livraison/modules_livraison.php
* \file htdocs/core/modules/delivery/modules_delivery.php
* \ingroup expedition
* \brief Fichier contenant la classe mere de generation de bon de livraison en PDF
* et la classe mere de numerotation des bons de livraisons

View File

@@ -103,21 +103,21 @@ class modExpedition extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "LIVRAISON_ADDON_PDF";
$this->const[$r][0] = "DELIVERY_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "typhon";
$this->const[$r][3] = 'Nom du gestionnaire de generation des bons de reception en PDF';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "LIVRAISON_ADDON_NUMBER";
$this->const[$r][0] = "DELIVERY_ADDON_NUMBER";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_livraison_jade";
$this->const[$r][2] = "mod_delivery_jade";
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des bons de reception';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH";
$this->const[$r][0] = "DELIVERY_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries";
$this->const[$r][3] = "";

View File

@@ -29,7 +29,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';

View File

@@ -116,7 +116,7 @@ class Delivery extends CommonObject
dol_syslog("Delivery::create");
if (empty($this->model_pdf)) $this->model_pdf = $conf->global->LIVRAISON_ADDON_PDF;
if (empty($this->model_pdf)) $this->model_pdf = $conf->global->DELIVERY_ADDON_PDF;
$error = 0;
@@ -376,14 +376,14 @@ class Delivery extends CommonObject
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate)))
{
if (!empty($conf->global->LIVRAISON_ADDON_NUMBER))
if (!empty($conf->global->DELIVERY_ADDON_NUMBER))
{
// Setting the command numbering module name
$modName = $conf->global->LIVRAISON_ADDON_NUMBER;
$modName = $conf->global->DELIVERY_ADDON_NUMBER;
if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/livraison/'.$modName.'.php'))
if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'))
{
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/'.$modName.'.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php';
$now = dol_now();
@@ -394,7 +394,7 @@ class Delivery extends CommonObject
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
{
$numref = $objMod->livraison_get_num($soc, $this);
$numref = $objMod->delivery_get_num($soc, $this);
} else {
$numref = $this->ref;
}
@@ -1050,12 +1050,12 @@ class Delivery extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->LIVRAISON_ADDON_PDF)) {
$modele = $conf->global->LIVRAISON_ADDON_PDF;
} elseif (!empty($conf->global->DELIVERY_ADDON_PDF)) {
$modele = $conf->global->DELIVERY_ADDON_PDF;
}
}
$modelpath = "core/modules/livraison/doc/";
$modelpath = "core/modules/delivery/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
@@ -1071,7 +1071,7 @@ class Delivery extends CommonObject
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'livraison'
'delivery'
);
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);

View File

@@ -399,7 +399,7 @@ if (empty($reshook))
/*
* Build a receiving receipt
*/
elseif ($action == 'create_delivery' && $conf->delivery_note->enabled && $user->rights->expedition->livraison->creer)
elseif ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
{
$result = $object->create_delivery($user);
if ($result > 0)
@@ -2046,13 +2046,13 @@ if ($action == 'create')
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
$sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
$sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition";
//if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
//if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
$sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
$sql .= ', p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql .= ", ".MAIN_DB_PREFIX."expedition as e";
$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj";
//if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line";
//if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
$sql .= " AND obj.fk_".$origin." = ".$origin_id;
@@ -2467,7 +2467,7 @@ if ($action == 'create')
// This is just to generate a delivery receipt
//var_dump($object->linkedObjectsIds['delivery']);
if ($conf->delivery_note->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery']))
if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery']))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
}

View File

@@ -873,7 +873,7 @@ class Expedition extends CommonObject
// phpcs:enable
global $conf;
if ($conf->delivery_note->enabled)
if ($conf->livraison_bon->enabled)
{
if ($this->statut == self::STATUS_VALIDATED || $this->statut == self::STATUS_CLOSED)
{

View File

@@ -127,8 +127,8 @@ $arrayfields = array(
'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)),
'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)),
'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
);

View File

@@ -1665,13 +1665,13 @@ if ($action == 'create')
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
$sql .= ", ed.rowid as receptionline_id, ed.qty, ed.fk_reception as reception_id, ed.fk_entrepot";
$sql .= ", e.rowid as reception_id, e.ref as reception_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_reception";
//if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
//if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
$sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
$sql .= ', p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed";
$sql .= ", ".MAIN_DB_PREFIX."reception as e";
$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj";
//if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line";
//if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
$sql .= " WHERE e.entity IN (".getEntity('reception').")";
$sql .= " AND obj.fk_commande = ".$origin_id;

View File

@@ -41,7 +41,7 @@ parameters:
- %currentWorkingDirectory%/htdocs/core/modules/facture
- %currentWorkingDirectory%/htdocs/core/modules/fichinter
- %currentWorkingDirectory%/htdocs/core/modules/holiday
- %currentWorkingDirectory%/htdocs/core/modules/livraison
- %currentWorkingDirectory%/htdocs/core/modules/delivery
#- %currentWorkingDirectory%/htdocs/core/modules/member
- %currentWorkingDirectory%/htdocs/core/modules/payment
- %currentWorkingDirectory%/htdocs/core/modules/product