diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 5de2d02bc92..fb78c8d1af5 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2079,7 +2079,7 @@ class ActionComm extends CommonObject } if ($exportholiday == 1) { - $langs->load("holidays"); + $langs->load("holiday"); $title = $langs->trans("Holidays"); $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.email, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 948af4e2868..2dbf97d4785 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -70,9 +70,10 @@ function contact_prepare_head(Contact $object) $sql = 'SELECT COUNT(n.rowid) as nb'; $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as n'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (n.rowid = cc.element_id)'; - $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id); - $sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")'; - $sql .= ' AND n.entity IN ('.getEntity('project').')'; + $sql .= " WHERE cc.fk_socpeople = ".((int) $object->id); + $sql .= " AND cc.fk_c_type_contact IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE element='project' AND source='external')"; + $sql .= " AND n.entity IN (".getEntity('project').")"; + $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -191,10 +192,10 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_lead_status as cls on p.fk_opp_status = cls.rowid'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (p.rowid = cc.element_id)'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_contact as ctc ON (ctc.rowid = cc.fk_c_type_contact)'; - $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id); - $sql .= ' AND ctc.element="project" AND ctc.source="external"'; - $sql .= ' AND p.entity IN ('.getEntity('project').')'; - $sql .= ' ORDER BY p.dateo DESC'; + $sql .= " WHERE cc.fk_socpeople = ".((int) $object->id); + $sql .= " AND ctc.element='project' AND ctc.source='external'"; + $sql .= " AND p.entity IN (".getEntity('project').")"; + $sql .= " ORDER BY p.dateo DESC"; $result = $db->query($sql); if ($result) { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 2a0f3d654d7..c8f1ccd7a34 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -91,7 +91,7 @@ if ($module == 'propal') { } elseif ($module == 'shipping') { $permission = $user->hasRight("expedition", "creer"); } elseif ($module == 'product') { - $permission = $user->hasRight("produit", "creer"); + $permission = $user->hasRight("product", "creer"); } elseif ($module == 'service') { $permission = $user->hasRight("service", "creer"); } elseif ($module == 'ecmfiles') { diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 6a2cc78f128..358c0b208e9 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -95,7 +95,7 @@ if ($action == 'add_payment') { // Create a line of payments $payment = new PaymentDonation($db); $payment->chid = $chid; - $payment->datepaid = $datepaid; + $payment->datep = $datepaid; $payment->amounts = $amounts; // Tableau de montant $payment->paymenttype = GETPOST("paymenttype", 'int'); $payment->num_payment = GETPOST("num_payment", 'alphanohtml'); @@ -192,14 +192,14 @@ if ($action == 'create') { print ''; print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->paymenttype, "paymenttype"); + $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->fk_typepayment, "paymenttype"); print "\n"; print ''; print ''; print ''.$langs->trans('AccountToCredit').''; print ''; - $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->accountid, "accountid", 0, '', 2); // Show open bank account list + $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : "0", "accountid", 0, '', 2); // Show open bank account list print ''; // Number diff --git a/htdocs/product/note.php b/htdocs/product/note.php index 0d7ad91af5f..ba83e64c401 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -54,13 +54,13 @@ $permissionnote = $user->rights->produit->creer; // Used by the include of actio if ($object->id > 0) { if ($object->type == $object::TYPE_PRODUCT) { - restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + restrictedArea($user, 'product', $object->id, 'product&product', '', ''); } if ($object->type == $object::TYPE_SERVICE) { restrictedArea($user, 'service', $object->id, 'product&product', '', ''); } } else { - restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + restrictedArea($user, 'product|service', $fieldvalue, 'product&product', '', '', $fieldtype); } diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 273affc3563..49849b362ba 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -419,7 +419,7 @@ if (!empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter .= '
'; $moreforfilter .= '
'; -$includeonly = 'hierachyme'; +$includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0bff44a13d9..bda9821f993 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -118,6 +118,10 @@ class Reception extends CommonObject public $lines = array(); + // detail of lot and qty = array(id in llx_commande_fournisseur_dispatch, batch, qty) + // We can use this to know warehouse planned to be used for each lot. + public $detail_batch; + const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; const STATUS_CLOSED = 2; @@ -1209,6 +1213,14 @@ class Reception extends CommonObject $this->total_ttc += $pu_ht + $tva; + if (isModEnabled('productbatch') && !empty($line->batch)) { + $detail_batch = new stdClass(); + $detail_batch->eatby = $line->eatby; + $detail_batch->sellby = $line->sellby; + $detail_batch->batch = $line->batch; + $detail_batch->qty = $line->qty; + $line->detail_batch[] = $detail_batch; + } $this->lines[] = $line; }