Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
68b3480c86
@ -834,7 +834,7 @@ class ActionComm extends CommonObject
|
|||||||
if (! empty($elementtype))
|
if (! empty($elementtype))
|
||||||
{
|
{
|
||||||
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
|
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
|
||||||
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
|
else $sql.= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
|
||||||
}
|
}
|
||||||
if (! empty($filter)) $sql.= $filter;
|
if (! empty($filter)) $sql.= $filter;
|
||||||
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
|
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
|
||||||
|
|||||||
@ -76,9 +76,41 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
var $brouillon;
|
var $brouillon;
|
||||||
var $cond_reglement_code;
|
var $cond_reglement_code;
|
||||||
|
|
||||||
|
var $fk_account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It holds the label of the payment mode. Use it in case translation cannot be found.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $mode_reglement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Payment mode id
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
var $mode_reglement_id;
|
||||||
|
/**
|
||||||
|
* Payment mode code
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $mode_reglement_code;
|
var $mode_reglement_code;
|
||||||
|
/**
|
||||||
|
* Availability delivery time id
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $availability_id;
|
var $availability_id;
|
||||||
|
/**
|
||||||
|
* Availability delivery time code
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $availability_code;
|
var $availability_code;
|
||||||
|
/**
|
||||||
|
* Label of availability delivery time. Use it in case translation cannot be found.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $availability;
|
||||||
|
|
||||||
var $demand_reason_id;
|
var $demand_reason_id;
|
||||||
var $demand_reason_code;
|
var $demand_reason_code;
|
||||||
var $address;
|
var $address;
|
||||||
@ -1435,7 +1467,7 @@ class Commande extends CommonOrder
|
|||||||
$sql.= ", i.libelle as libelle_incoterms";
|
$sql.= ", i.libelle as libelle_incoterms";
|
||||||
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||||
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
|
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
|
||||||
$sql.= ', ca.code as availability_code';
|
$sql.= ', ca.code as availability_code, ca.label as availability_label';
|
||||||
$sql.= ', dr.code as demand_reason_code';
|
$sql.= ', dr.code as demand_reason_code';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)';
|
||||||
@ -1492,6 +1524,7 @@ class Commande extends CommonOrder
|
|||||||
$this->fk_account = $obj->fk_account;
|
$this->fk_account = $obj->fk_account;
|
||||||
$this->availability_id = $obj->fk_availability;
|
$this->availability_id = $obj->fk_availability;
|
||||||
$this->availability_code = $obj->availability_code;
|
$this->availability_code = $obj->availability_code;
|
||||||
|
$this->availability = $obj->availability_label;
|
||||||
$this->demand_reason_id = $obj->fk_input_reason;
|
$this->demand_reason_id = $obj->fk_input_reason;
|
||||||
$this->demand_reason_code = $obj->demand_reason_code;
|
$this->demand_reason_code = $obj->demand_reason_code;
|
||||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||||
|
|||||||
@ -1281,12 +1281,12 @@ class AccountLine extends CommonObject
|
|||||||
$nbko++;
|
$nbko++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".$this->rowid;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".(int) $this->rowid;
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (! $result) $nbko++;
|
if (! $result) $nbko++;
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$this->rowid;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".(int) $this->rowid;
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (! $result) $nbko++;
|
if (! $result) $nbko++;
|
||||||
@ -1323,7 +1323,7 @@ class AccountLine extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$this->rowid;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".(int) $this->rowid;
|
||||||
dol_syslog(get_class($this)."::delete_urls", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete_urls", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (! $result) $nbko++;
|
if (! $result) $nbko++;
|
||||||
|
|||||||
@ -99,12 +99,15 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
|
|||||||
if ($action == 'del')
|
if ($action == 'del')
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$bankline->fetch($_GET["rowid"]);
|
|
||||||
|
if ($bankline->fetch($_GET["rowid"]) > 0) {
|
||||||
$result = $bankline->delete($user);
|
$result = $bankline->delete($user);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
dol_print_error($db, $bankline->error);
|
dol_print_error($db, $bankline->error);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1040,7 +1040,7 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql;
|
$this->error='Bill with id '.$rowid.' or ref '.$ref.' not found';
|
||||||
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,6 +108,12 @@ if ($typeid) {
|
|||||||
$sql .= " AND s.fk_typepayment=".$typeid;
|
$sql .= " AND s.fk_typepayment=".$typeid;
|
||||||
}
|
}
|
||||||
//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev, s.fk_typepayment, s.num_payment, pst.code";
|
//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev, s.fk_typepayment, s.num_payment, pst.code";
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1,$offset);
|
$sql.= $db->plimit($limit+1,$offset);
|
||||||
|
|
||||||
|
|||||||
@ -119,6 +119,12 @@ if ($typeid) {
|
|||||||
$sql .= " AND cs.fk_type=".$typeid;
|
$sql .= " AND cs.fk_type=".$typeid;
|
||||||
}
|
}
|
||||||
$sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle";
|
$sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle";
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1,$offset);
|
$sql.= $db->plimit($limit+1,$offset);
|
||||||
|
|
||||||
|
|||||||
@ -115,6 +115,12 @@ if ($filtre) {
|
|||||||
if ($typeid) {
|
if ($typeid) {
|
||||||
$sql .= " AND t.fk_typepayment=".$typeid;
|
$sql .= " AND t.fk_typepayment=".$typeid;
|
||||||
}
|
}
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1,$offset);
|
$sql.= $db->plimit($limit+1,$offset);
|
||||||
|
|
||||||
|
|||||||
@ -136,17 +136,21 @@ if ($search_contract) {
|
|||||||
if (!empty($search_ref_supplier)) {
|
if (!empty($search_ref_supplier)) {
|
||||||
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_sale > 0)
|
if ($search_sale > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
}
|
}
|
||||||
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
||||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid";
|
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid";
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($conf->liste_limit + 1, $offset);
|
$sql.= $db->plimit($conf->liste_limit + 1, $offset);
|
||||||
|
|
||||||
|
|||||||
@ -147,6 +147,12 @@ $filter_date1=dol_mktime(0,0,0,$op1month,$op1day,$op1year);
|
|||||||
$filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year);
|
$filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year);
|
||||||
if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$filter_op1." '".$db->idate($filter_date1)."'";
|
if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$filter_op1." '".$db->idate($filter_date1)."'";
|
||||||
if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'";
|
if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'";
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql .= $db->order($sortfield,$sortorder);
|
$sql .= $db->order($sortfield,$sortorder);
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class dolprintIPP
|
|||||||
*/
|
*/
|
||||||
function list_jobs($module)
|
function list_jobs($module)
|
||||||
{
|
{
|
||||||
global $conf, $db, $bc;
|
global $conf, $db, $bc, $langs;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||||
$ipp = new CupsPrintIPP();
|
$ipp = new CupsPrintIPP();
|
||||||
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
|
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
|
||||||
@ -96,7 +96,8 @@ class dolprintIPP
|
|||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
print $e->getMessage();
|
setEventMessage('[printipp] '.$langs->trans('CoreErrorMessage'), 'errors');
|
||||||
|
dol_syslog($e->getMessage(), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
|
|||||||
@ -1100,7 +1100,7 @@ class Form
|
|||||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
||||||
$sql.= " re.description, re.fk_facture_source";
|
$sql.= " re.description, re.fk_facture_source";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re";
|
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re";
|
||||||
$sql.= " WHERE fk_soc = ".$socid;
|
$sql.= " WHERE fk_soc = ".(int) $socid;
|
||||||
if ($filter) $sql.= " AND ".$filter;
|
if ($filter) $sql.= " AND ".$filter;
|
||||||
$sql.= " ORDER BY re.description ASC";
|
$sql.= " ORDER BY re.description ASC";
|
||||||
|
|
||||||
|
|||||||
@ -560,7 +560,7 @@ class Expedition extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR);
|
dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR);
|
||||||
$this->error='Delivery with id '.$id.' not found sql='.$sql;
|
$this->error='Delivery with id '.$id.' not found';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,6 +123,12 @@ if ($socid)
|
|||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
}
|
}
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if ($sref)
|
|||||||
}
|
}
|
||||||
if ($snom)
|
if ($snom)
|
||||||
{
|
{
|
||||||
$sql .= natural_search('s.nom', $snom);
|
$sql .= natural_search('p.label', $snom);
|
||||||
}
|
}
|
||||||
if($catid)
|
if($catid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,6 +49,21 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortfield) $sortfield="f.datef";
|
if (! $sortfield) $sortfield="f.datef";
|
||||||
|
|
||||||
|
$object = new Societe($db);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('thirdpartymargins','globalcard'));
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parameters=array('id'=>$socid);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -79,6 +79,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
$extralabels = $extrafields->fetch_name_optionals_label('product');
|
$extralabels = $extrafields->fetch_name_optionals_label('product');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||||
|
|
||||||
|
if (empty($action)) $action='list';
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$canvas=GETPOST("canvas");
|
$canvas=GETPOST("canvas");
|
||||||
$objcanvas=null;
|
$objcanvas=null;
|
||||||
@ -165,8 +167,8 @@ $form=new Form($db);
|
|||||||
|
|
||||||
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||||
{
|
{
|
||||||
$objcanvas->assign_values('list'); // This must contains code to load data (must call LoadListDatas($limit, $offset, $sortfield, $sortorder))
|
$objcanvas->assign_values($action); // This must contains code to load data (must call LoadListDatas($limit, $offset, $sortfield, $sortorder))
|
||||||
$objcanvas->display_canvas('list'); // This is code to show template
|
$objcanvas->display_canvas($action); // This is code to show template
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -68,6 +68,12 @@ if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label
|
|||||||
if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status;
|
if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status;
|
||||||
if ($sall) $sql.= natural_search(array('e.label','e.description','e.lieu','e.address','e.town'), $sall);
|
if ($sall) $sql.= natural_search(array('e.label','e.description','e.lieu','e.address','e.town'), $sall);
|
||||||
$sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays";
|
$sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays";
|
||||||
|
$totalnboflines=0;
|
||||||
|
$result=$db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$totalnboflines = $db->num_rows($result);
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
|
||||||
@ -81,7 +87,7 @@ if ($result)
|
|||||||
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||||
llxHeader("",$langs->trans("ListOfWarehouses"),$help_url);
|
llxHeader("",$langs->trans("ListOfWarehouses"),$help_url);
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder,'',$num);
|
print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $totalnboflines);
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -168,6 +174,8 @@ if ($result)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($totalnboflines <= $limit)
|
||||||
|
{
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
|
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right">'.price(price2num($total,'MT'),1,$langs,0,0,-1,$conf->currency).'</td>';
|
print '<td align="right">'.price(price2num($total,'MT'),1,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
@ -183,6 +191,7 @@ if ($result)
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
|
|
||||||
|
|||||||
@ -56,16 +56,28 @@ if (! $sortfield) $sortfield="c.lastname";
|
|||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
|
$object = new Societe($db);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('thirdpartynotification','globalcard'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Add a notification
|
$parameters=array('id'=>$socid);
|
||||||
if ($action == 'add')
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
// Add a notification
|
||||||
|
if ($action == 'add')
|
||||||
|
{
|
||||||
if (empty($contactid))
|
if (empty($contactid))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")), null, 'errors');
|
||||||
@ -116,6 +128,7 @@ if ($action == 'delete')
|
|||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"];
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"];
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,11 +49,23 @@ if ($user->societe_id)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
$result = restrictedArea($user, 'societe', $socid, '&societe');
|
$result = restrictedArea($user, 'societe', $socid, '&societe');
|
||||||
|
|
||||||
|
$object = new Societe($db);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('thirdpartycustomerprice','globalcard'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$parameters=array('id'=>$socid);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
if ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
if ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||||
|
|
||||||
$update_child_soc = GETPOST('updatechildprice');
|
$update_child_soc = GETPOST('updatechildprice');
|
||||||
@ -69,12 +81,9 @@ if ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->ri
|
|||||||
|
|
||||||
$result = $prodcustprice->create($user, 0, $update_child_soc);
|
$result = $prodcustprice->create($user, 0, $update_child_soc);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,13 +95,10 @@ if ($action == 'delete_customer_price' && ($user->rights->produit->creer || $use
|
|||||||
$prodcustprice->id = GETPOST('lineid');
|
$prodcustprice->id = GETPOST('lineid');
|
||||||
$result = $prodcustprice->delete($user);
|
$result = $prodcustprice->delete($user);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'mesgs');
|
||||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
} else {
|
||||||
}
|
setEventMessages($langs->trans('Delete'), null, 'errors');
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('Delete'), null, 'mesgs');
|
|
||||||
}
|
}
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
@ -111,17 +117,15 @@ if ($action == 'update_customer_price_confirm' && ! $_POST ["cancel"] && ($user-
|
|||||||
$prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0);
|
$prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0);
|
||||||
|
|
||||||
$result = $prodcustprice->update($user, 0, $update_child_soc);
|
$result = $prodcustprice->update($user, 0, $update_child_soc);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user