Merge pull request #20980 from atm-maxime/fix_scrutinizer1
Fix scrutinizer and remove unused functions
This commit is contained in:
commit
ac88e5f59e
@ -102,11 +102,9 @@ print load_fiche_titre($langs->trans("AccountancyTreasuryArea"), '', 'bill');
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
//print getCustomerInvoicePieChart($socid);
|
||||
print getNumberInvoicesPieChart('customers');
|
||||
print '<br>';
|
||||
print getNumberInvoicesPieChart('fourn');
|
||||
//print getPurchaseInvoicePieChart($socid);
|
||||
print '<br>';
|
||||
print getCustomerInvoiceDraftTable($max, $socid);
|
||||
print '<br>';
|
||||
|
||||
@ -245,246 +245,6 @@ function supplier_invoice_rec_prepare_head($object)
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a HTML table that contains a pie chart of customer invoices
|
||||
*
|
||||
* @param int $socid (Optional) Show only results from the customer with this id
|
||||
* @return string A HTML table that contains a pie chart of customer invoices
|
||||
*/
|
||||
function getCustomerInvoicePieChart($socid = 0)
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$sql = "SELECT count(f.rowid), f.fk_statut";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture').")";
|
||||
if ($user->socid) {
|
||||
$sql .= ' AND f.fk_soc = '.((int) $user->socid);
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " GROUP BY f.fk_statut";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
return '';
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$total = 0;
|
||||
$vals = array();
|
||||
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) {
|
||||
$vals[$row[1]] = $row[0];
|
||||
$total += $row[0];
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
|
||||
$result = '<div class="div-table-responsive-no-min">';
|
||||
$result .= '<table class="noborder nohover centpercent">';
|
||||
$result .= '<tr class="liste_titre">';
|
||||
$result .= '<td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomerInvoice").'</td>';
|
||||
$result .= '</tr>';
|
||||
|
||||
$objectstatic = new Facture($db);
|
||||
$array = array(Facture::STATUS_DRAFT, Facture::STATUS_VALIDATED, Facture::STATUS_CLOSED, Facture::STATUS_ABANDONED);
|
||||
$dataseries = array();
|
||||
|
||||
foreach ($array as $status) {
|
||||
$objectstatic->statut = $status;
|
||||
$objectstatic->paye = $status == Facture::STATUS_CLOSED ? -1 : 0;
|
||||
|
||||
$dataseries[] = array($objectstatic->getLibStatut(1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||
if ($status == Facture::STATUS_DRAFT) {
|
||||
$colorseries[$status] = '-'.$badgeStatus0;
|
||||
}
|
||||
if ($status == Facture::STATUS_VALIDATED) {
|
||||
$colorseries[$status] = $badgeStatus1;
|
||||
}
|
||||
if ($status == Facture::STATUS_CLOSED) {
|
||||
$colorseries[$status] = $badgeStatus9;
|
||||
}
|
||||
if ($status == Facture::STATUS_ABANDONED) {
|
||||
$colorseries[$status] = $badgeStatus6;
|
||||
}
|
||||
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
$result .= '<tr class="oddeven">';
|
||||
$result .= '<td>'.$objectstatic->getLibStatut(0).'</td>';
|
||||
$result .= '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).'</a></td>';
|
||||
$result .= '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
$dolgraph = new DolGraph();
|
||||
$dolgraph->SetData($dataseries);
|
||||
$dolgraph->SetDataColor(array_values($colorseries));
|
||||
$dolgraph->setShowLegend(2);
|
||||
$dolgraph->setShowPercent(1);
|
||||
$dolgraph->SetType(['pie']);
|
||||
$dolgraph->setHeight('150');
|
||||
$dolgraph->setWidth('300');
|
||||
$dolgraph->draw('idgraphcustomerinvoices');
|
||||
|
||||
$result .= '<tr>';
|
||||
$result .= '<td align="center" colspan="2">'.$dolgraph->show($total ? 0 : 1).'</td>';
|
||||
$result .= '</tr>';
|
||||
}
|
||||
|
||||
$result .= '<tr class="liste_total">';
|
||||
$result .= '<td>'.$langs->trans("Total").'</td>';
|
||||
$result .= '<td class="right">'.$total.'</td>';
|
||||
$result .= '</tr>';
|
||||
|
||||
$result .= '</table>';
|
||||
$result .= '</div>';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a HTML table that contains a pie chart of supplier invoices
|
||||
*
|
||||
* @param int $socid (Optional) Show only results from the supplier with this id
|
||||
* @return string A HTML table that contains a pie chart of supplier invoices
|
||||
*/
|
||||
function getPurchaseInvoicePieChart($socid = 0)
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
if (!((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire))) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$sql = "SELECT count(f.rowid), f.fk_statut";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn').")";
|
||||
if ($user->socid) {
|
||||
$sql .= ' AND f.fk_soc = '.((int) $user->socid);
|
||||
}
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " GROUP BY f.fk_statut";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
return '';
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$total = 0;
|
||||
$vals = array();
|
||||
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) {
|
||||
$vals[$row[1]] = $row[0];
|
||||
$total += $row[0];
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
|
||||
$result = '<div class="div-table-responsive-no-min">';
|
||||
$result .= '<table class="noborder nohover centpercent">';
|
||||
|
||||
$result .= '<tr class="liste_titre">';
|
||||
$result .= '<td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SupplierInvoice").'</td>';
|
||||
$result .= '</tr>';
|
||||
|
||||
$objectstatic = new FactureFournisseur($db);
|
||||
$array = array(FactureFournisseur::STATUS_DRAFT, FactureFournisseur::STATUS_VALIDATED, FactureFournisseur::STATUS_CLOSED, FactureFournisseur::STATUS_ABANDONED);
|
||||
$dataseries = array();
|
||||
|
||||
foreach ($array as $status) {
|
||||
$objectstatic->statut = $status;
|
||||
$objectstatic->paye = $status == FactureFournisseur::STATUS_CLOSED ? -1 : 0;
|
||||
|
||||
$dataseries[] = array($objectstatic->getLibStatut(1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||
if ($status == FactureFournisseur::STATUS_DRAFT) {
|
||||
$colorseries[$status] = '-'.$badgeStatus0;
|
||||
}
|
||||
if ($status == FactureFournisseur::STATUS_VALIDATED) {
|
||||
$colorseries[$status] = $badgeStatus1;
|
||||
}
|
||||
if ($status == FactureFournisseur::STATUS_CLOSED) {
|
||||
$colorseries[$status] = $badgeStatus9;
|
||||
}
|
||||
if ($status == FactureFournisseur::STATUS_ABANDONED) {
|
||||
$colorseries[$status] = $badgeStatus6;
|
||||
}
|
||||
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
$result .= '<tr class="oddeven">';
|
||||
$result .= '<td>'.$objectstatic->getLibStatut(0).'</td>';
|
||||
$result .= '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).'</a></td>';
|
||||
$result .= '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
$dolgraph = new DolGraph();
|
||||
$dolgraph->SetData($dataseries);
|
||||
$dolgraph->SetDataColor(array_values($colorseries));
|
||||
$dolgraph->setShowLegend(2);
|
||||
$dolgraph->setShowPercent(1);
|
||||
$dolgraph->SetType(['pie']);
|
||||
$dolgraph->setHeight('150');
|
||||
$dolgraph->setWidth('300');
|
||||
$dolgraph->draw('idgraphpurchaseinvoices');
|
||||
|
||||
$result .= '<tr>';
|
||||
$result .= '<td align="center" colspan="2">'.$dolgraph->show($total ? 0 : 1).'</td>';
|
||||
$result .= '</tr>';
|
||||
}
|
||||
|
||||
$result .= '<tr class="liste_total">';
|
||||
$result .= '<td>'.$langs->trans("Total").'</td>';
|
||||
$result .= '<td class="right">'.$total.'</td>';
|
||||
$result .= '</tr>';
|
||||
|
||||
$result .= '</table>';
|
||||
$result .= '</div>';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an HTML table that contains a pie chart of the number of customers or supplier invoices
|
||||
*
|
||||
|
||||
@ -2069,69 +2069,6 @@ class Expedition extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Update/create delivery method.
|
||||
*
|
||||
* @param string $id id method to activate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update_delivery_method($id = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($id == '') {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
|
||||
$sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')";
|
||||
$resql = $this->db->query($sql);
|
||||
} else {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
|
||||
$sql .= " code='".$this->db->escape($this->update['code'])."'";
|
||||
$sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'";
|
||||
$sql .= ",description='".$this->db->escape($this->update['description'])."'";
|
||||
$sql .= ",tracking='".$this->db->escape($this->update['tracking'])."'";
|
||||
$sql .= " WHERE rowid=".((int) $id);
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
if ($resql < 0) {
|
||||
dol_print_error($this->db, '');
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Activate delivery method.
|
||||
*
|
||||
* @param int $id id method to activate
|
||||
* @return void
|
||||
*/
|
||||
public function activ_delivery_method($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1';
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* DesActivate delivery method.
|
||||
*
|
||||
* @param int $id id method to desactivate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function disable_delivery_method($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0';
|
||||
$sql .= " WHERE rowid= ".((int) $id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Forge an set tracking url
|
||||
*
|
||||
|
||||
@ -112,6 +112,9 @@ class ExpenseReport extends CommonObject
|
||||
public $fk_user_validator; // User that is defined to approve
|
||||
|
||||
// Validation
|
||||
/* @deprecated */
|
||||
public $datevalid;
|
||||
|
||||
public $date_valid; // User making validation
|
||||
public $fk_user_valid;
|
||||
public $user_valid_infos;
|
||||
@ -1806,8 +1809,6 @@ class ExpenseReport extends CommonObject
|
||||
// We don't know seller and buyer for expense reports
|
||||
$seller = $mysoc; // We use same than current company (expense report are often done in same country)
|
||||
$seller->tva_assuj = 1; // Most seller uses vat
|
||||
$seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
|
||||
$seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
|
||||
$buyer = new Societe($this->db);
|
||||
|
||||
$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller);
|
||||
@ -1891,10 +1892,7 @@ class ExpenseReport extends CommonObject
|
||||
if (!is_object($seller)) {
|
||||
$seller = $mysoc; // We use same than current company (expense report are often done in same country)
|
||||
$seller->tva_assuj = 1; // Most seller uses vat
|
||||
$seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
|
||||
$seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
|
||||
}
|
||||
//$buyer = new Societe($this->db);
|
||||
|
||||
$expensereportrule = new ExpenseReportRule($db);
|
||||
$rulestocheck = $expensereportrule->getAllRule($this->line->fk_c_type_fees, $this->line->date, $this->fk_user_author);
|
||||
@ -1979,10 +1977,7 @@ class ExpenseReport extends CommonObject
|
||||
if (!is_object($seller)) {
|
||||
$seller = $mysoc; // We use same than current company (expense report are often done in same country)
|
||||
$seller->tva_assuj = 1; // Most seller uses vat
|
||||
$seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
|
||||
$seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
|
||||
}
|
||||
//$buyer = new Societe($this->db);
|
||||
|
||||
$expenseik = new ExpenseReportIk($this->db);
|
||||
$range = $expenseik->getRangeByUser($userauthor, $this->line->fk_c_exp_tax_cat);
|
||||
@ -2618,9 +2613,11 @@ class ExpenseReportLine extends CommonObjectLine
|
||||
|
||||
public $projet_ref;
|
||||
public $projet_title;
|
||||
public $rang;
|
||||
|
||||
public $vatrate;
|
||||
public $vat_src_code;
|
||||
public $tva_tx;
|
||||
public $localtax1_tx;
|
||||
public $localtax2_tx;
|
||||
public $localtax1_type;
|
||||
|
||||
@ -80,6 +80,13 @@ class CommandeFournisseurDispatch extends CommonObjectLine
|
||||
public $fk_commandefourndet;
|
||||
|
||||
public $qty;
|
||||
public $qty_asked;
|
||||
|
||||
public $libelle;
|
||||
public $desc;
|
||||
public $tva_tx;
|
||||
public $vat_src_code;
|
||||
public $ref_supplier;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
|
||||
@ -270,9 +270,9 @@ if (empty($reshook)) {
|
||||
$object->origin_id = $origin_id;
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->weight = GETPOST('weight', 'int') == '' ? null : GETPOST('weight', 'int');
|
||||
$object->sizeH = GETPOST('sizeH', 'int') == '' ? null : GETPOST('sizeH', 'int');
|
||||
$object->sizeW = GETPOST('sizeW', 'int') == '' ? null : GETPOST('sizeW', 'int');
|
||||
$object->sizeS = GETPOST('sizeS', 'int') == '' ? null : GETPOST('sizeS', 'int');
|
||||
$object->trueHeight = GETPOST('trueHeight', 'int') == '' ? null : GETPOST('trueHeight', 'int');
|
||||
$object->trueWidth = GETPOST('trueWidth', 'int') == '' ? null : GETPOST('trueWidth', 'int');
|
||||
$object->trueDepth = GETPOST('trueDepth', 'int') == '' ? null : GETPOST('trueDepth', 'int');
|
||||
$object->size_units = GETPOST('size_units', 'int');
|
||||
$object->weight_units = GETPOST('weight_units', 'int');
|
||||
|
||||
@ -849,9 +849,9 @@ if ($action == 'create') {
|
||||
// Dim
|
||||
print '<tr><td>';
|
||||
print $langs->trans("Width").' x '.$langs->trans("Height").' x '.$langs->trans("Depth");
|
||||
print ' </td><td colspan="3"><input name="sizeW" size="4" value="'.GETPOST('sizeW', 'int').'">';
|
||||
print ' x <input name="sizeH" size="4" value="'.GETPOST('sizeH', 'int').'">';
|
||||
print ' x <input name="sizeS" size="4" value="'.GETPOST('sizeS', 'int').'">';
|
||||
print ' </td><td colspan="3"><input name="trueWidth" size="4" value="'.GETPOST('trueWidth', 'int').'">';
|
||||
print ' x <input name="trueHeight" size="4" value="'.GETPOST('trueHeight', 'int').'">';
|
||||
print ' x <input name="trueDepth" size="4" value="'.GETPOST('trueDepth', 'int').'">';
|
||||
print ' ';
|
||||
$text = $formproduct->selectMeasuringUnits("size_units", "size", GETPOST('size_units', 'int'), 0, 2);
|
||||
$htmltext = $langs->trans("KeepEmptyForAutoCalculation");
|
||||
|
||||
@ -273,9 +273,9 @@ class Reception extends CommonObject
|
||||
$sql .= ", ".($this->shipping_method_id > 0 ? ((int) $this->shipping_method_id) : "null");
|
||||
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
|
||||
$sql .= ", ".(is_null($this->weight) ? "NULL" : ((double) $this->weight));
|
||||
$sql .= ", ".(is_null($this->sizeS) ? "NULL" : ((double) $this->sizeS)); // TODO Should use this->trueDepth
|
||||
$sql .= ", ".(is_null($this->sizeW) ? "NULL" : ((double) $this->sizeW)); // TODO Should use this->trueWidth
|
||||
$sql .= ", ".(is_null($this->sizeH) ? "NULL" : ((double) $this->sizeH)); // TODO Should use this->trueHeight
|
||||
$sql .= ", ".(is_null($this->trueDepth) ? "NULL" : ((double) $this->trueDepth));
|
||||
$sql .= ", ".(is_null($this->trueWidth) ? "NULL" : ((double) $this->trueWidth));
|
||||
$sql .= ", ".(is_null($this->trueHeight) ? "NULL" : ((double) $this->trueHeight));
|
||||
$sql .= ", ".(is_null($this->weight_units) ? "NULL" : ((double) $this->weight_units));
|
||||
$sql .= ", ".(is_null($this->size_units) ? "NULL" : ((double) $this->size_units));
|
||||
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
||||
@ -744,7 +744,6 @@ class Reception extends CommonObject
|
||||
|
||||
if (!empty($this->origin) && $this->origin_id > 0 && ($this->origin == 'order_supplier' || $this->origin == 'commandeFournisseur')) {
|
||||
if (empty($this->commandeFournisseur)) {
|
||||
$this->commandeFournisseur = null;
|
||||
$this->fetch_origin();
|
||||
if (empty($this->commandeFournisseur->lines)) {
|
||||
$res = $this->commandeFournisseur->fetch_lines();
|
||||
@ -1485,70 +1484,6 @@ class Reception extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Update/create delivery method.
|
||||
*
|
||||
* @param string $id id method to activate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update_delivery_method($id = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($id == '') {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
|
||||
$sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')";
|
||||
$resql = $this->db->query($sql);
|
||||
} else {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
|
||||
$sql .= " code='".$this->db->escape($this->update['code'])."'";
|
||||
$sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'";
|
||||
$sql .= ",description='".$this->db->escape($this->update['description'])."'";
|
||||
$sql .= ",tracking='".$this->db->escape($this->update['tracking'])."'";
|
||||
$sql .= " WHERE rowid=".((int) $id);
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
if ($resql < 0) {
|
||||
dol_print_error($this->db, '');
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Activate delivery method.
|
||||
*
|
||||
* @param int $id id method to activate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function activ_delivery_method($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1';
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* DesActivate delivery method.
|
||||
*
|
||||
* @param int $id id method to desactivate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function disable_delivery_method($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0';
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Forge an set tracking url
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user