Merge remote-tracking branch 'upstream/develop' into free_email
This commit is contained in:
commit
39ac031aa9
@ -2999,9 +2999,9 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$main = MAIN_DB_PREFIX . 'propaldet';
|
$main = MAIN_DB_PREFIX.'propaldet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = " . $this->id . ")";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = ".$this->id.")";
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
|
||||||
if ($this->db->query($sqlef) && $this->db->query($sql))
|
if ($this->db->query($sqlef) && $this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3412,9 +3412,9 @@ class Commande extends CommonOrder
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Delete extrafields of order details
|
// Delete extrafields of order details
|
||||||
$main = MAIN_DB_PREFIX . 'commandedet';
|
$main = MAIN_DB_PREFIX.'commandedet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = " . $this->id . ")";
|
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = ".$this->id.")";
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -748,8 +748,8 @@ class FactureRec extends CommonInvoice
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$main = MAIN_DB_PREFIX . 'facturedet_rec';
|
$main = MAIN_DB_PREFIX.'facturedet_rec';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)";
|
||||||
dol_syslog($sqlef);
|
dol_syslog($sqlef);
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid;
|
||||||
|
|||||||
@ -2187,8 +2187,8 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Invoice line extrafileds
|
// Invoice line extrafileds
|
||||||
$main = MAIN_DB_PREFIX . 'facturedet';
|
$main = MAIN_DB_PREFIX.'facturedet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)";
|
||||||
// Delete invoice line
|
// Delete invoice line
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid;
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid;
|
||||||
|
|||||||
@ -1255,9 +1255,9 @@ class Contrat extends CommonObject
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
// Delete contratdet extrafields
|
// Delete contratdet extrafields
|
||||||
$main = MAIN_DB_PREFIX . 'contratdet';
|
$main = MAIN_DB_PREFIX.'contratdet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_contrat = " . $this->id . ")";
|
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_contrat = ".$this->id.")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::delete contratdet_extrafields", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete contratdet_extrafields", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -3077,7 +3077,7 @@ abstract class CommonObject
|
|||||||
if (empty($reshook) && $forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
|
if (empty($reshook) && $forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
|
||||||
{
|
{
|
||||||
// This part of code is to fix data. We should not call it too often.
|
// This part of code is to fix data. We should not call it too often.
|
||||||
$localtax_array = array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx);
|
$localtax_array = array($obj->localtax1_type, $obj->localtax1_tx, $obj->localtax2_type, $obj->localtax2_tx);
|
||||||
$tmpcal = calcul_price_total($obj->qty, $obj->up, $obj->remise_percent, $obj->vatrate, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->product_type, $seller, $localtax_array, (isset($obj->situation_percent) ? $obj->situation_percent : 100), $multicurrency_tx);
|
$tmpcal = calcul_price_total($obj->qty, $obj->up, $obj->remise_percent, $obj->vatrate, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->product_type, $seller, $localtax_array, (isset($obj->situation_percent) ? $obj->situation_percent : 100), $multicurrency_tx);
|
||||||
|
|
||||||
$diff_when_using_price_ht = price2num($tmpcal[1] - $obj->total_tva, 'MT', 1); // If price was set with tax price adn unit price HT has a low number of digits, then we may have a diff on recalculation from unit price HT.
|
$diff_when_using_price_ht = price2num($tmpcal[1] - $obj->total_tva, 'MT', 1); // If price was set with tax price adn unit price HT has a low number of digits, then we may have a diff on recalculation from unit price HT.
|
||||||
@ -3090,7 +3090,7 @@ abstract class CommonObject
|
|||||||
$sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".$tmpcal[1].", total_ttc = ".$tmpcal[2]." WHERE rowid = ".$obj->rowid;
|
$sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".$tmpcal[1].", total_ttc = ".$tmpcal[2]." WHERE rowid = ".$obj->rowid;
|
||||||
dol_syslog('We found unconsistent data into detailed line (diff_when_using_price_ht = '.$diff_when_using_price_ht.' and diff_on_current_total = '.$diff_on_current_total.') for line rowid = '.$obj->rowid." (total vat of line calculated=".$tmpcal[1].", database=".$obj->total_tva."). We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix, LOG_WARNING);
|
dol_syslog('We found unconsistent data into detailed line (diff_when_using_price_ht = '.$diff_when_using_price_ht.' and diff_on_current_total = '.$diff_on_current_total.') for line rowid = '.$obj->rowid." (total vat of line calculated=".$tmpcal[1].", database=".$obj->total_tva."). We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix, LOG_WARNING);
|
||||||
$resqlfix = $this->db->query($sqlfix);
|
$resqlfix = $this->db->query($sqlfix);
|
||||||
if (! $resqlfix) dol_print_error($this->db, 'Failed to update line');
|
if (!$resqlfix) dol_print_error($this->db, 'Failed to update line');
|
||||||
$obj->total_tva = $tmpcal[1];
|
$obj->total_tva = $tmpcal[1];
|
||||||
$obj->total_ttc = $tmpcal[2];
|
$obj->total_ttc = $tmpcal[2];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3151,7 +3151,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
||||||
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
||||||
'object_holiday', 'object_hrm', 'object_intervention', 'object_label',
|
'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',
|
||||||
'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
|
'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
|
||||||
'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal',
|
'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal',
|
||||||
'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
|
'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
|
||||||
@ -3195,7 +3195,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||||
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
||||||
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
||||||
'intervention'=>'ambulance', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
||||||
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
||||||
'other'=>'square',
|
'other'=>'square',
|
||||||
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
||||||
@ -3264,7 +3264,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'order'=>'bg-infobox-commande',
|
'order'=>'bg-infobox-commande',
|
||||||
'user'=>'bg-infobox-adherent', 'users'=>'bg-infobox-adherent',
|
'user'=>'bg-infobox-adherent', 'users'=>'bg-infobox-adherent',
|
||||||
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
|
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
|
||||||
'holiday'=>'bg-infobox-holiday',
|
'holiday'=>'bg-infobox-holiday', 'invoice'=>'bg-infobox-commande',
|
||||||
'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
|
'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
|
||||||
'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
|
'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
|
||||||
'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
|
'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
|
|||||||
$this->numero = 310;
|
$this->numero = 310;
|
||||||
|
|
||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
$this->module_position = '55';
|
$this->module_position = '06';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Management of members of a foundation or association";
|
$this->description = "Management of members of a foundation or association";
|
||||||
|
|||||||
@ -143,6 +143,7 @@ class modBanque extends DolibarrModules
|
|||||||
//--------
|
//--------
|
||||||
$r = 0;
|
$r = 0;
|
||||||
|
|
||||||
|
// Bank lines
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r] = 'Ecritures bancaires et releves';
|
$this->export_label[$r] = 'Ecritures bancaires et releves';
|
||||||
@ -174,6 +175,7 @@ class modBanque extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' AND ba.entity IN ('.getEntity('bank_account').')';
|
$this->export_sql_end[$r] .= ' AND ba.entity IN ('.getEntity('bank_account').')';
|
||||||
$this->export_sql_order[$r] = ' ORDER BY b.datev, b.num_releve';
|
$this->export_sql_order[$r] = ' ORDER BY b.datev, b.num_releve';
|
||||||
|
|
||||||
|
//
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r] = 'Bordereaux remise Chq/Fact';
|
$this->export_label[$r] = 'Bordereaux remise Chq/Fact';
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class modCommande extends DolibarrModules
|
|||||||
$this->numero = 25;
|
$this->numero = 25;
|
||||||
|
|
||||||
$this->family = "crm";
|
$this->family = "crm";
|
||||||
$this->module_position = '23';
|
$this->module_position = '11';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des commandes clients";
|
$this->description = "Gestion des commandes clients";
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class modContrat extends DolibarrModules
|
|||||||
$this->numero = 54;
|
$this->numero = 54;
|
||||||
|
|
||||||
$this->family = "crm";
|
$this->family = "crm";
|
||||||
$this->module_position = '35';
|
$this->module_position = '41';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des contrats de services";
|
$this->description = "Gestion des contrats de services";
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class modFacture extends DolibarrModules
|
|||||||
$this->numero = 30;
|
$this->numero = 30;
|
||||||
|
|
||||||
$this->family = "financial";
|
$this->family = "financial";
|
||||||
$this->module_position = '10';
|
$this->module_position = '11';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des factures";
|
$this->description = "Gestion des factures";
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class modPropale extends DolibarrModules
|
|||||||
$this->numero = 20;
|
$this->numero = 20;
|
||||||
|
|
||||||
$this->family = "crm";
|
$this->family = "crm";
|
||||||
$this->module_position = '22';
|
$this->module_position = '10';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des propositions commerciales";
|
$this->description = "Gestion des propositions commerciales";
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class modStock extends DolibarrModules
|
|||||||
$this->numero = 52;
|
$this->numero = 52;
|
||||||
|
|
||||||
$this->family = "products";
|
$this->family = "products";
|
||||||
$this->module_position = '40';
|
$this->module_position = '39';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Gestion des stocks";
|
$this->description = "Gestion des stocks";
|
||||||
|
|||||||
@ -922,7 +922,7 @@ class Don extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $notooltip = 0)
|
public function getNomUrl($withpicto = 0, $notooltip = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
|
|||||||
@ -1514,9 +1514,9 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$main = MAIN_DB_PREFIX . 'expeditiondet';
|
$main = MAIN_DB_PREFIX.'expeditiondet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_expedition = " . $this->id . ")";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_expedition = ".$this->id.")";
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
||||||
$sql .= " WHERE fk_expedition = ".$this->id;
|
$sql .= " WHERE fk_expedition = ".$this->id;
|
||||||
|
|||||||
@ -994,9 +994,9 @@ class Fichinter extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$main = MAIN_DB_PREFIX . 'fichinterdet';
|
$main = MAIN_DB_PREFIX.'fichinterdet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_fichinter = " . $this->id . ")";
|
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_fichinter = ".$this->id.")";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) $error++;
|
if (!$resql) $error++;
|
||||||
|
|||||||
@ -2035,9 +2035,9 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
$main = MAIN_DB_PREFIX . 'commande_fournisseurdet';
|
$main = MAIN_DB_PREFIX.'commande_fournisseurdet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = " . $this->id . ")";
|
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = ".$this->id.")";
|
||||||
dol_syslog(get_class($this)."::delete extrafields lines", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete extrafields lines", LOG_DEBUG);
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1180,8 +1180,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$main = MAIN_DB_PREFIX . 'facture_fourn_det';
|
$main = MAIN_DB_PREFIX.'facture_fourn_det';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture_fourn = $rowid)";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture_fourn = $rowid)";
|
||||||
$resqlef = $this->db->query($sqlef);
|
$resqlef = $this->db->query($sqlef);
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';';
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';';
|
||||||
|
|||||||
@ -207,7 +207,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
'suppliers' => 'Fournisseur',
|
'suppliers' => 'Fournisseur',
|
||||||
'contacts' => 'Contact',
|
'contacts' => 'Contact',
|
||||||
'products' => 'Product',
|
'products' => 'Product',
|
||||||
'services' => 'Service',
|
'services' => 'ProductService',
|
||||||
'proposals' => 'Propal',
|
'proposals' => 'Propal',
|
||||||
'orders' => 'Commande',
|
'orders' => 'Commande',
|
||||||
'invoices' => 'Facture',
|
'invoices' => 'Facture',
|
||||||
|
|||||||
@ -716,18 +716,18 @@ class Products extends DolibarrApi
|
|||||||
if (!DolibarrApiAccess::$user->rights->produit->supprimer) {
|
if (!DolibarrApiAccess::$user->rights->produit->supprimer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$result = $this->product->fetch($id);
|
$result = $this->productsupplier->fetch($id);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
throw new RestException(404, 'Product not found');
|
throw new RestException(404, 'Product not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) {
|
if (!DolibarrApi::_checkAccessToResource('product', $this->productsupplier->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$resultsupplier = 0;
|
$resultsupplier = 0;
|
||||||
if ($result) {
|
if ($result > 0) {
|
||||||
$this->productsupplier->fetch($id);
|
$resultsupplier = $this->productsupplier->remove_product_fournisseur_price($priceid);
|
||||||
$resultsupplier = $this->product->remove_product_fournisseur_price($priceid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $resultsupplier;
|
return $resultsupplier;
|
||||||
|
|||||||
@ -5639,9 +5639,10 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage products or services
|
* Class to manage products or services.
|
||||||
|
* Do not use 'Service' as class name since it is already used by APIs.
|
||||||
*/
|
*/
|
||||||
class Service extends Product
|
class ProductService extends Product
|
||||||
{
|
{
|
||||||
public $picto = 'service';
|
public $picto = 'service';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -930,9 +930,9 @@ class Reception extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$main = MAIN_DB_PREFIX . 'commande_fournisseur_dispatch';
|
$main = MAIN_DB_PREFIX.'commande_fournisseur_dispatch';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_reception = " . $this->id . ")";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_reception = ".$this->id.")";
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch";
|
||||||
$sql .= " WHERE fk_reception = ".$this->id;
|
$sql .= " WHERE fk_reception = ".$this->id;
|
||||||
|
|||||||
@ -2069,9 +2069,9 @@ class SupplierProposal extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$main = MAIN_DB_PREFIX . 'supplier_proposaldet';
|
$main = MAIN_DB_PREFIX.'supplier_proposaldet';
|
||||||
$ef = $main . "_extrafields";
|
$ef = $main."_extrafields";
|
||||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_supplier_proposal = " . $this->id . ")";
|
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_supplier_proposal = ".$this->id.")";
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE fk_supplier_proposal = ".$this->id;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE fk_supplier_proposal = ".$this->id;
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -102,10 +102,12 @@ if ($rss) {
|
|||||||
$MAXNEWS = 20;
|
$MAXNEWS = 20;
|
||||||
$arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters);
|
$arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters);
|
||||||
$eventarray = array();
|
$eventarray = array();
|
||||||
|
if (is_array($arrayofblogs)) {
|
||||||
foreach ($arrayofblogs as $blog) {
|
foreach ($arrayofblogs as $blog) {
|
||||||
$blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php';
|
$blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php';
|
||||||
$eventarray[] = $blog;
|
$eventarray[] = $blog;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php";
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user