diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f92b80570b6..da77c5a4f9b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6551,7 +6551,7 @@ abstract class CommonObject * * @return array */ - private function set_save_query() + protected function set_save_query() { global $conf; @@ -6605,7 +6605,7 @@ abstract class CommonObject * * @param stdClass $obj Contain data of object from database */ - private function setVarsFromFetchObj(&$obj) + protected function setVarsFromFetchObj(&$obj) { foreach ($this->fields as $field => $info) { @@ -6650,7 +6650,7 @@ abstract class CommonObject * * @return string */ - private function get_field_list() + protected function get_field_list() { $keys = array_keys($this->fields); return implode(',', $keys); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index e00a63d195e..f516d142670 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -168,7 +168,7 @@ function societe_prepare_head(Societe $object) } // Related items - if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->fournisseur->enabled)) + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index a13410ddcf1..0cf19ec31e2 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -228,7 +228,7 @@ class modResource extends DolibarrModules 'langs'=> 'resource', 'position'=> 101, 'enabled'=> '1', - 'perms'=> '$user->rights->resource->read', + 'perms'=> '$user->rights->resource->write', 'target'=> '', 'user'=> 0 ); diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index fbd6ff107a7..0d9360b0e72 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -124,7 +124,7 @@ class Interventions extends DolibarrApi if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale - $sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')'; + $sql.= ' WHERE t.entity IN ('.getEntity('intervention').')'; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 2cbbd1be022..1204830fb0f 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -128,7 +128,7 @@ class Fichinter extends CommonObject $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")"; + $sql.= " ".$clause." fi.entity IN (".getEntity('intervention').")"; $resql=$this->db->query($sql); if ($resql) @@ -348,7 +348,10 @@ class Fichinter extends CommonObject $sql.= " f.tms as datem,"; $sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; - if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'"; + if ($ref) { + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.ref='".$this->db->escape($ref)."'"; + } else $sql.= " WHERE f.rowid=".$rowid; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -782,7 +785,6 @@ class Fichinter extends CommonObject $sql.= " f.fk_user_valid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " WHERE f.rowid = ".$id; - $sql.= " AND f.entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) @@ -886,7 +888,6 @@ class Fichinter extends CommonObject // Delete object $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; dol_syslog("Fichinter::delete", LOG_DEBUG); $resql = $this->db->query($sql); @@ -950,7 +951,6 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; $sql.= " SET datei = '".$this->db->idate($date_delivery)."'"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; $sql.= " AND fk_statut = 0"; if ($this->db->query($sql)) @@ -984,7 +984,6 @@ class Fichinter extends CommonObject $sql.= " SET description = '".$this->db->escape($description)."',"; $sql.= " fk_user_modif = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; if ($this->db->query($sql)) { @@ -1017,7 +1016,6 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; $sql.= " SET fk_contrat = '".$contractid."'"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; if ($this->db->query($sql)) { @@ -1395,7 +1393,7 @@ class FichinterLigne extends CommonObjectLine if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; + $this->id=$this->id; $result=$this->insertExtraFields(); if ($result < 0) { @@ -1457,7 +1455,7 @@ class FichinterLigne extends CommonObjectLine $sql.= ",date='".$this->db->idate($this->datei)."'"; $sql.= ",duree=".$this->duration; $sql.= ",rang='".$this->db->escape($this->rang)."'"; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " WHERE rowid = ".$this->id; dol_syslog("FichinterLigne::update", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1466,7 +1464,7 @@ class FichinterLigne extends CommonObjectLine if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; + $this->id=$this->id; $result=$this->insertExtraFields(); if ($result < 0) { @@ -1535,7 +1533,6 @@ class FichinterLigne extends CommonObjectLine $sql.= " , dateo = ".(! empty($obj->dateo)?"'".$this->db->idate($obj->dateo)."'":"null"); $sql.= " , datee = ".(! empty($obj->datee)?"'".$this->db->idate($obj->datee)."'":"null"); $sql.= " WHERE rowid = ".$this->fk_fichinter; - $sql.= " AND entity = ".$conf->entity; dol_syslog("FichinterLigne::update_total", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1574,10 +1571,10 @@ class FichinterLigne extends CommonObjectLine if ($this->statut == 0) { - dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid); + dol_syslog(get_class($this)."::deleteline lineid=".$this->id); $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->id; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index d7cae075eb1..1a4068f5911 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -81,8 +81,8 @@ $sql = "SELECT count(f.rowid), f.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f"; if (! $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('societe').")"; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; if ($user->societe_id) $sql.=' AND f.fk_soc = '.$user->societe_id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY f.fk_statut"; @@ -180,8 +180,8 @@ if (! empty($conf->ficheinter->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$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('intervention').")"; + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut = 0"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -228,8 +228,8 @@ $sql.= " s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; if (!$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('commande').")"; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; //$sql.= " AND c.fk_statut > 2"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -299,8 +299,8 @@ if (! empty($conf->ficheinter->enabled)) $sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$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('intervention').")"; + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut = 1"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index e046209a354..7fc7ca244de 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -194,8 +194,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE f.fk_soc = s.rowid "; -$sql.= " AND f.entity = ".$conf->entity; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; if ($search_ref) { $sql .= natural_search('f.ref', $search_ref); } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 239014f9142..af36e6d572e 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -50,7 +50,7 @@ $cancelbutton = GETPOST('cancel','alpha'); // Security check $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); if ($user->societe_id) $id=$user->societe_id; -$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe'); +$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid'); $object = new Fournisseur($db); $extrafields = new ExtraFields($db); diff --git a/htdocs/langs/en_NZ/companies.lang b/htdocs/langs/en_NZ/companies.lang index fd92c40825e..afa8538da3b 100644 --- a/htdocs/langs/en_NZ/companies.lang +++ b/htdocs/langs/en_NZ/companies.lang @@ -3,3 +3,6 @@ VATIsUsed=GST is used VATIsNotUsed=GST is not used VATIntra=GST number VATIntraShort=GST number +VATIntraVeryShort=GST +VATIntraSyntaxIsValid=Syntax is valid +VATIntraValueIsValid=Value is valid diff --git a/htdocs/langs/en_NZ/compta.lang b/htdocs/langs/en_NZ/compta.lang index 90936c6ccf4..7b85434bb5c 100644 --- a/htdocs/langs/en_NZ/compta.lang +++ b/htdocs/langs/en_NZ/compta.lang @@ -9,3 +9,6 @@ VATPaid=GST paid VATCollected=GST collected VATPayment=GST Payment VATPayments=GST Payments +NewVATPayment=New GST payment +TotalToPay=Total to pay +TotalVATReceived=Total GST received \ No newline at end of file diff --git a/htdocs/langs/en_NZ/main.lang b/htdocs/langs/en_NZ/main.lang index 45235b7bf39..2af1b36ceb0 100644 --- a/htdocs/langs/en_NZ/main.lang +++ b/htdocs/langs/en_NZ/main.lang @@ -19,11 +19,16 @@ FormatDateHourShort=%d/%m/%Y %H:%M FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p FormatDateHourTextShort=%d %b %Y %H:%M FormatDateHourText=%d %B %Y %H:%M +UnitPrice=Unit price UnitPriceHT=Unit price (excl GST) +UnitPriceTTC=Unit price AmountHT=Amount (excl GST) AmountTTC=Amount (incl GST) AmountVAT=Amount GST +PriceQtyHT=Price for this quantity excl GST PriceQtyMinHT=Price quantity min. excl GST +PriceQtyTTC=Price for this quantity incl GST +PriceQtyMinTTC=Price quantity min. incl GST TotalHT=Total (excl GST) TotalTTC=Total (incl GST) TotalTTCToYourCredit=Total (incl GST) to your credit diff --git a/htdocs/langs/en_NZ/sendings.lang b/htdocs/langs/en_NZ/sendings.lang new file mode 100644 index 00000000000..ceb733e140f --- /dev/null +++ b/htdocs/langs/en_NZ/sendings.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - en_NZ - main +# This file contains only line that must differs from en_US file +SendingSheet=Packing Slip \ No newline at end of file diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 81e8996aff2..64913683276 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -162,7 +162,7 @@ if (! empty($conf->societe->enabled)) $tmparray['societe/index.php?mainmenu=comp if (! empty($conf->projet->enabled)) $tmparray['projet/index.php?mainmenu=project&leftmenu=']='ProjectsArea'; if (! empty($conf->holiday->enabled) || ! empty($conf->expensereport->enabled)) $tmparray['hrm/index.php?mainmenu=hrm&leftmenu=']='HRMArea'; // TODO Complete list with first level of menus if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) $tmparray['product/index.php?mainmenu=products&leftmenu=']='ProductsAndServicesArea'; -if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea'; +if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea'; if (! empty($conf->compta->enabled) || ! empty($conf->accounting->enabled)) $tmparray['compta/index.php?mainmenu=compta&leftmenu=']='AccountancyTreasuryArea'; if (! empty($conf->adherent->enabled)) $tmparray['adherents/index.php?mainmenu=members&leftmenu=']='MembersArea'; if (! empty($conf->agenda->enabled)) $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu=']='Agenda';