@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | throw new RestException(500, 'Error generating document'); |
201 | 201 | } |
202 | 202 | } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') { |
203 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
203 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
204 | 204 | $tmpobject = new FactureFournisseur($this->db); |
205 | 205 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
206 | 206 | if (!$result) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | throw new RestException(500, 'Error generating document'); |
238 | 238 | } |
239 | 239 | } elseif ($modulepart == 'contrat' || $modulepart == 'contract') { |
240 | - require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
240 | + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
241 | 241 | |
242 | 242 | $tmpobject = new Contrat($this->db); |
243 | 243 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | throw new RestException(500, 'Error generating document missing doctemplate parameter'); |
254 | 254 | } |
255 | 255 | } elseif ($modulepart == 'expedition' || $modulepart == 'shipment') { |
256 | - require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; |
|
256 | + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; |
|
257 | 257 | |
258 | 258 | $tmpobject = new Expedition($this->db); |
259 | 259 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | throw new RestException(500, 'Error generating document missing doctemplate parameter'); |
270 | 270 | } |
271 | 271 | } elseif ($modulepart == 'mrp') { |
272 | - require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; |
|
272 | + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; |
|
273 | 273 | |
274 | 274 | $tmpobject = new Mo($this->db); |
275 | 275 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | // $recursive = 0; |
574 | 574 | } elseif ($modulepart == 'contrat' || $modulepart == 'contract') { |
575 | 575 | $modulepart = 'contrat'; |
576 | - require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
576 | + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
577 | 577 | |
578 | 578 | $object = new Contrat($this->db); |
579 | 579 | $result = $object->fetch($id, $ref); |
@@ -581,10 +581,10 @@ discard block |
||
581 | 581 | throw new RestException(404, 'Contract not found'); |
582 | 582 | } |
583 | 583 | |
584 | - $upload_dir = $conf->contract->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract'); |
|
584 | + $upload_dir = $conf->contract->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'contract'); |
|
585 | 585 | } elseif ($modulepart == 'projet' || $modulepart == 'project') { |
586 | 586 | $modulepart = 'project'; |
587 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
587 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
588 | 588 | |
589 | 589 | $object = new Project($this->db); |
590 | 590 | $result = $object->fetch($id, $ref); |
@@ -592,10 +592,10 @@ discard block |
||
592 | 592 | throw new RestException(404, 'Project not found'); |
593 | 593 | } |
594 | 594 | |
595 | - $upload_dir = $conf->project->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project'); |
|
595 | + $upload_dir = $conf->project->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'project'); |
|
596 | 596 | } elseif ($modulepart == 'mrp') { |
597 | 597 | $modulepart = 'mrp'; |
598 | - require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; |
|
598 | + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; |
|
599 | 599 | |
600 | 600 | $object = new Mo($this->db); |
601 | 601 | $result = $object->fetch($id, $ref); |
@@ -603,13 +603,13 @@ discard block |
||
603 | 603 | throw new RestException(404, 'MO not found'); |
604 | 604 | } |
605 | 605 | |
606 | - $upload_dir = $conf->mrp->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'mrp'); |
|
606 | + $upload_dir = $conf->mrp->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'mrp'); |
|
607 | 607 | } else { |
608 | 608 | throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); |
609 | 609 | } |
610 | 610 | |
611 | 611 | $objectType = $modulepart; |
612 | - if (! empty($object->id) && ! empty($object->table_element)) { |
|
612 | + if (!empty($object->id) && !empty($object->table_element)) { |
|
613 | 613 | $objectType = $object->table_element; |
614 | 614 | } |
615 | 615 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror()); |
626 | 626 | } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { |
627 | 627 | $count = count($filearray); |
628 | - for ($i = 0 ; $i < $count ; $i++) { |
|
628 | + for ($i = 0; $i < $count; $i++) { |
|
629 | 629 | foreach ($ecmfile->lines as $line) { |
630 | 630 | if ($filearray[$i]['name'] == $line->filename) { |
631 | 631 | // Next line converts EcmFilesLine properties to array |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | $object = new Propal($this->db); |
779 | 779 | } elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') { |
780 | 780 | $modulepart = 'agenda'; |
781 | - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
781 | + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
782 | 782 | $object = new ActionComm($this->db); |
783 | 783 | } elseif ($modulepart == 'contact' || $modulepart == 'socpeople') { |
784 | 784 | $modulepart = 'contact'; |
@@ -787,11 +787,11 @@ discard block |
||
787 | 787 | $fetchbyid = true; |
788 | 788 | } elseif ($modulepart == 'contrat' || $modulepart == 'contract') { |
789 | 789 | $modulepart = 'contrat'; |
790 | - require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
790 | + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
791 | 791 | $object = new Contrat($this->db); |
792 | 792 | } elseif ($modulepart == 'mrp') { |
793 | 793 | $modulepart = 'mrp'; |
794 | - require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; |
|
794 | + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; |
|
795 | 795 | $object = new Mo($this->db); |
796 | 796 | } else { |
797 | 797 | // TODO Implement additional moduleparts |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $memberstatic->ref = $objp->rowid; |
267 | 267 | $memberstatic->lastname = $objp->lastname; |
268 | 268 | $memberstatic->firstname = $objp->firstname; |
269 | - $memberstatic->statut = $objp->statut; // deprecated |
|
269 | + $memberstatic->statut = $objp->statut; // deprecated |
|
270 | 270 | $memberstatic->status = $objp->statut; |
271 | 271 | $memberstatic->datefin = $db->jdate($objp->datefin); |
272 | 272 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | // Type |
293 | 293 | $membertypestatic->id = $objp->type_id; |
294 | - $membertypestatic->libelle = $objp->type_label; // deprecated |
|
294 | + $membertypestatic->libelle = $objp->type_label; // deprecated |
|
295 | 295 | $membertypestatic->label = $objp->type_label; |
296 | 296 | |
297 | 297 | print '<td class="nowrap">'; |
@@ -244,7 +244,7 @@ |
||
244 | 244 | $orderstatic->id = $obj->rowid; |
245 | 245 | $orderstatic->ref = $obj->ref; |
246 | 246 | $orderstatic->ref_supplier = $obj->ref_supplier; |
247 | - $orderstatic->statut = $obj->status; // deprecated |
|
247 | + $orderstatic->statut = $obj->status; // deprecated |
|
248 | 248 | $orderstatic->status = $obj->status; |
249 | 249 | $orderstatic->facturee = $obj->billed; |
250 | 250 |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | $this->mode_reglement_id = 0; |
500 | 500 | } |
501 | 501 | $this->status = self::STATUS_DRAFT; |
502 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
502 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
503 | 503 | |
504 | 504 | if (!empty($this->multicurrency_code)) { |
505 | 505 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | if (!empty($_facrec->frequency)) { // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence. |
586 | 586 | $this->socid = $_facrec->socid; |
587 | 587 | } |
588 | - $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
588 | + $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
589 | 589 | |
590 | 590 | // Fields coming from GUI. |
591 | 591 | // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $this->mode_reglement_id = 0; |
625 | 625 | } |
626 | 626 | $this->status = self::STATUS_DRAFT; |
627 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
627 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
628 | 628 | |
629 | 629 | $this->linked_objects = $_facrec->linkedObjectsIds; |
630 | 630 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | |
875 | 875 | // Complete vat rate with code |
876 | 876 | $vatrate = $newinvoiceline->tva_tx; |
877 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) { |
|
877 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) { |
|
878 | 878 | $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
879 | 879 | } |
880 | 880 | |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | ($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '', |
1083 | 1083 | 0, |
1084 | 1084 | $tva_npr, |
1085 | - 0, // fk_remise_except |
|
1085 | + 0, // fk_remise_except |
|
1086 | 1086 | 'HT', |
1087 | 1087 | 0, |
1088 | 1088 | $_facrec->lines[$i]->product_type, |
@@ -1095,8 +1095,8 @@ discard block |
||
1095 | 1095 | $buyprice, |
1096 | 1096 | $_facrec->lines[$i]->label, |
1097 | 1097 | empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, |
1098 | - 100, // situation percent is undefined on recurring invoice lines |
|
1099 | - 0, // fk_prev_id |
|
1098 | + 100, // situation percent is undefined on recurring invoice lines |
|
1099 | + 0, // fk_prev_id |
|
1100 | 1100 | $_facrec->lines[$i]->fk_unit, |
1101 | 1101 | $_facrec->lines[$i]->multicurrency_subprice, |
1102 | 1102 | $_facrec->lines[$i]->ref_ext, |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | |
1185 | 1185 | $facture->fk_facture_source = $this->fk_facture_source; |
1186 | 1186 | $facture->type = $this->type; |
1187 | - $facture->subtype = $this->subtype; |
|
1187 | + $facture->subtype = $this->subtype; |
|
1188 | 1188 | $facture->socid = $this->socid; |
1189 | 1189 | $facture->date = $this->date; |
1190 | 1190 | $facture->date_pointoftax = $this->date_pointoftax; |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | |
1202 | 1202 | $facture->origin = $this->origin; |
1203 | 1203 | $facture->origin_id = $this->origin_id; |
1204 | - $facture->fk_account = $this->fk_account; |
|
1204 | + $facture->fk_account = $this->fk_account; |
|
1205 | 1205 | |
1206 | 1206 | $facture->lines = $this->lines; // Array of lines of invoice |
1207 | 1207 | $facture->situation_counter = $this->situation_counter; |
@@ -1468,8 +1468,8 @@ discard block |
||
1468 | 1468 | $this->fk_account = $object->fk_account; |
1469 | 1469 | $this->cond_reglement_id = $object->cond_reglement_id; |
1470 | 1470 | $this->mode_reglement_id = $object->mode_reglement_id; |
1471 | - $this->fk_incoterms = $object->fk_incoterms; |
|
1472 | - $this->location_incoterms = $object->location_incoterms; |
|
1471 | + $this->fk_incoterms = $object->fk_incoterms; |
|
1472 | + $this->location_incoterms = $object->location_incoterms; |
|
1473 | 1473 | $this->availability_id = $object->availability_id; |
1474 | 1474 | $this->demand_reason_id = $object->demand_reason_id; |
1475 | 1475 | $this->delivery_date = $object->delivery_date; |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | { |
1679 | 1679 | global $conf, $langs, $hookmanager, $action; |
1680 | 1680 | |
1681 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
1681 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
1682 | 1682 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
1683 | 1683 | return null; |
1684 | 1684 | } |
@@ -1688,7 +1688,7 @@ discard block |
||
1688 | 1688 | return null; |
1689 | 1689 | } |
1690 | 1690 | |
1691 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1691 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1692 | 1692 | |
1693 | 1693 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) { |
1694 | 1694 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | $deposit->pos_source = $origin->pos_source; |
1733 | 1733 | $deposit->model_pdf = 'crabe'; |
1734 | 1734 | |
1735 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
1735 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
1736 | 1736 | |
1737 | 1737 | if (getDolGlobalString($modelByTypeConfName)) { |
1738 | 1738 | $deposit->model_pdf = getDolGlobalString($modelByTypeConfName); |
@@ -1792,10 +1792,10 @@ discard block |
||
1792 | 1792 | $descriptions[$key] = ''; |
1793 | 1793 | } |
1794 | 1794 | $TTotalByTva[$key] += $line->total_ttc; |
1795 | - $descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
1796 | - $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
1797 | - $descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
1798 | - $descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
1795 | + $descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
1796 | + $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
1797 | + $descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty; |
|
1798 | + $descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
1799 | 1799 | } |
1800 | 1800 | |
1801 | 1801 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1819,10 +1819,10 @@ discard block |
||
1819 | 1819 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
1820 | 1820 | $tva_tx = $lines[$i]->tva_tx; |
1821 | 1821 | $amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100; |
1822 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
1823 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
1824 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
1825 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
1822 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
1823 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
1824 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
1825 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
1826 | 1826 | } |
1827 | 1827 | |
1828 | 1828 | if ($totalamount == 0) { |
@@ -1837,11 +1837,11 @@ discard block |
||
1837 | 1837 | continue; |
1838 | 1838 | } |
1839 | 1839 | |
1840 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
1840 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
1841 | 1841 | |
1842 | 1842 | // Hidden conf |
1843 | 1843 | if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) { |
1844 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
1844 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
1845 | 1845 | } |
1846 | 1846 | |
1847 | 1847 | $addlineResult = $deposit->addline( |
@@ -2230,7 +2230,7 @@ discard block |
||
2230 | 2230 | : ''; |
2231 | 2231 | |
2232 | 2232 | if ($type !== 'separate') { |
2233 | - if (in_array($type, array('point','multipts','linestrg','polygon'))) { |
|
2233 | + if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) { |
|
2234 | 2234 | $sql .= ", ST_AsWKT(ef.".$key.") as ".$key; |
2235 | 2235 | } else { |
2236 | 2236 | $sql .= ", ef.".$key; |
@@ -2273,9 +2273,9 @@ discard block |
||
2273 | 2273 | $this->id = $obj->rowid; |
2274 | 2274 | $this->entity = $obj->entity; |
2275 | 2275 | |
2276 | - $this->ref = $obj->ref; |
|
2277 | - $this->ref_client = $obj->ref_client; |
|
2278 | - $this->ref_customer = $obj->ref_client; |
|
2276 | + $this->ref = $obj->ref; |
|
2277 | + $this->ref_client = $obj->ref_client; |
|
2278 | + $this->ref_customer = $obj->ref_client; |
|
2279 | 2279 | $this->ref_ext = $obj->ref_ext; |
2280 | 2280 | $this->type = $obj->type; |
2281 | 2281 | $this->subtype = $obj->subtype; |
@@ -2301,7 +2301,7 @@ discard block |
||
2301 | 2301 | $this->fk_project = $obj->fk_project; |
2302 | 2302 | $this->project = null; // Clear if another value was already set by fetch_projet |
2303 | 2303 | |
2304 | - $this->statut = $obj->status; // deprecated |
|
2304 | + $this->statut = $obj->status; // deprecated |
|
2305 | 2305 | $this->status = $obj->status; |
2306 | 2306 | |
2307 | 2307 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2317,7 +2317,7 @@ discard block |
||
2317 | 2317 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
2318 | 2318 | $this->note = $obj->note_private; // deprecated |
2319 | 2319 | $this->note_private = $obj->note_private; |
2320 | - $this->note_public = $obj->note_public; |
|
2320 | + $this->note_public = $obj->note_public; |
|
2321 | 2321 | $this->user_creation_id = $obj->fk_user_author; |
2322 | 2322 | $this->user_validation_id = $obj->fk_user_valid; |
2323 | 2323 | $this->user_modification_id = $obj->fk_user_modif; |
@@ -2365,15 +2365,15 @@ discard block |
||
2365 | 2365 | |
2366 | 2366 | // date/datetime |
2367 | 2367 | if (in_array($type, array('date', 'datetime'))) { |
2368 | - $this->array_options['options_' . $key] = $this->db->jdate($rawval); |
|
2368 | + $this->array_options['options_'.$key] = $this->db->jdate($rawval); |
|
2369 | 2369 | } elseif ($type == 'password') { |
2370 | 2370 | if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) { |
2371 | - $this->array_options['options_' . $key] = dolDecrypt($rawval); |
|
2371 | + $this->array_options['options_'.$key] = dolDecrypt($rawval); |
|
2372 | 2372 | } else { |
2373 | - $this->array_options['options_' . $key] = $rawval; |
|
2373 | + $this->array_options['options_'.$key] = $rawval; |
|
2374 | 2374 | } |
2375 | 2375 | } else { |
2376 | - $this->array_options['options_' . $key] = $rawval; |
|
2376 | + $this->array_options['options_'.$key] = $rawval; |
|
2377 | 2377 | } |
2378 | 2378 | } |
2379 | 2379 | } |
@@ -2384,7 +2384,7 @@ discard block |
||
2384 | 2384 | if (empty($conf->disable_compute)) { |
2385 | 2385 | global $objectoffield; |
2386 | 2386 | $objectoffield = $this; |
2387 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
2387 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
2388 | 2388 | } |
2389 | 2389 | } |
2390 | 2390 | } |
@@ -2480,7 +2480,7 @@ discard block |
||
2480 | 2480 | : ''; |
2481 | 2481 | |
2482 | 2482 | if ($type !== 'separate') { |
2483 | - if (in_array($type, array('point','multipts','linestrg','polygon'))) { |
|
2483 | + if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) { |
|
2484 | 2484 | $sql .= ", ST_AsWKT(ef.".$key.") as ".$key; |
2485 | 2485 | } else { |
2486 | 2486 | $sql .= ", ef.".$key; |
@@ -2520,7 +2520,7 @@ discard block |
||
2520 | 2520 | $line->ref = $objp->product_ref; // Ref product |
2521 | 2521 | $line->product_ref = $objp->product_ref; // Ref product |
2522 | 2522 | $line->libelle = $objp->product_label; // deprecated |
2523 | - $line->product_label = $objp->product_label; // Label product |
|
2523 | + $line->product_label = $objp->product_label; // Label product |
|
2524 | 2524 | $line->product_barcode = $objp->product_barcode; // Barcode number product |
2525 | 2525 | $line->product_desc = $objp->product_desc; // Description product |
2526 | 2526 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
@@ -2586,15 +2586,15 @@ discard block |
||
2586 | 2586 | |
2587 | 2587 | // date/datetime |
2588 | 2588 | if (in_array($type, array('date', 'datetime'))) { |
2589 | - $line->array_options['options_' . $key] = $this->db->jdate($rawval); |
|
2589 | + $line->array_options['options_'.$key] = $this->db->jdate($rawval); |
|
2590 | 2590 | } elseif ($type == 'password') { |
2591 | 2591 | if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) { |
2592 | - $line->array_options['options_' . $key] = dolDecrypt($rawval); |
|
2592 | + $line->array_options['options_'.$key] = dolDecrypt($rawval); |
|
2593 | 2593 | } else { |
2594 | - $line->array_options['options_' . $key] = $rawval; |
|
2594 | + $line->array_options['options_'.$key] = $rawval; |
|
2595 | 2595 | } |
2596 | 2596 | } else { |
2597 | - $line->array_options['options_' . $key] = $rawval; |
|
2597 | + $line->array_options['options_'.$key] = $rawval; |
|
2598 | 2598 | } |
2599 | 2599 | } |
2600 | 2600 | } |
@@ -2605,7 +2605,7 @@ discard block |
||
2605 | 2605 | if (empty($conf->disable_compute)) { |
2606 | 2606 | global $objectoffield; |
2607 | 2607 | $objectoffield = $line; |
2608 | - $line->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2'); |
|
2608 | + $line->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2'); |
|
2609 | 2609 | } |
2610 | 2610 | } |
2611 | 2611 | } |
@@ -3522,10 +3522,10 @@ discard block |
||
3522 | 3522 | if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer')) |
3523 | 3523 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) { |
3524 | 3524 | $this->error = 'Permission denied'; |
3525 | - dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3525 | + dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3526 | 3526 | return -1; |
3527 | 3527 | } |
3528 | - if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3528 | + if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3529 | 3529 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
3530 | 3530 | ) { |
3531 | 3531 | $this->date = dol_now(); |
@@ -3709,7 +3709,7 @@ discard block |
||
3709 | 3709 | for ($i = 0; $i < $cpt; $i++) { |
3710 | 3710 | if ($this->lines[$i]->fk_product > 0) { |
3711 | 3711 | $mouvP = new MouvementStock($this->db); |
3712 | - $mouvP->origin = &$this; // deprecated |
|
3712 | + $mouvP->origin = &$this; // deprecated |
|
3713 | 3713 | $mouvP->setOrigin($this->element, $this->id); |
3714 | 3714 | |
3715 | 3715 | // We decrease stock for product |
@@ -3878,7 +3878,7 @@ discard block |
||
3878 | 3878 | // Set new ref and define current status |
3879 | 3879 | if (!$error) { |
3880 | 3880 | $this->ref = $num; |
3881 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3881 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3882 | 3882 | $this->status = self::STATUS_VALIDATED; |
3883 | 3883 | $this->date_validation = $now; |
3884 | 3884 | $i = 0; |
@@ -4056,7 +4056,7 @@ discard block |
||
4056 | 4056 | |
4057 | 4057 | if ($error == 0) { |
4058 | 4058 | $old_statut = $this->status; |
4059 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
4059 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
4060 | 4060 | $this->status = self::STATUS_DRAFT; |
4061 | 4061 | |
4062 | 4062 | // Call trigger |
@@ -4644,8 +4644,8 @@ discard block |
||
4644 | 4644 | $rangmax = $this->line_max($fk_parent_line); |
4645 | 4645 | $this->line->rang = $rangmax + 1; |
4646 | 4646 | } |
4647 | - $apply_abs_price_on_credit_note=false; |
|
4648 | - if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) { |
|
4647 | + $apply_abs_price_on_credit_note = false; |
|
4648 | + if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) { |
|
4649 | 4649 | $apply_abs_price_on_credit_note = true; |
4650 | 4650 | } |
4651 | 4651 | |
@@ -5078,7 +5078,7 @@ discard block |
||
5078 | 5078 | } |
5079 | 5079 | |
5080 | 5080 | if (!empty($addon)) { |
5081 | - dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
5081 | + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
5082 | 5082 | |
5083 | 5083 | $mybool = false; |
5084 | 5084 | |
@@ -5365,7 +5365,7 @@ discard block |
||
5365 | 5365 | |
5366 | 5366 | if (getDolGlobalInt('LIST_OF_QUALIFIED_INVOICES_LIMIT_DEFINED') > 0) { |
5367 | 5367 | $sql .= " DESC"; //order by |
5368 | - $sql .= " LIMIT " . getDolGlobalInt('LIST_OF_QUALIFIED_INVOICES_LIMIT_DEFINED'); |
|
5368 | + $sql .= " LIMIT ".getDolGlobalInt('LIST_OF_QUALIFIED_INVOICES_LIMIT_DEFINED'); |
|
5369 | 5369 | } |
5370 | 5370 | |
5371 | 5371 | dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG); |
@@ -5550,7 +5550,7 @@ discard block |
||
5550 | 5550 | |
5551 | 5551 | if (empty($option) || $option != 'nolines') { |
5552 | 5552 | // Lines |
5553 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
5553 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
5554 | 5554 | $xnbp = 0; |
5555 | 5555 | while ($xnbp < $nbp) { |
5556 | 5556 | $line = new FactureLigne($this->db); |
@@ -6178,14 +6178,14 @@ discard block |
||
6178 | 6178 | if (!empty($paymentmode) && $paymentmode != 'all') { |
6179 | 6179 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
6180 | 6180 | } |
6181 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
6182 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
6181 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
6182 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
6183 | 6183 | if ($datetouse == 'invoicedate') { |
6184 | 6184 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
6185 | 6185 | } else { |
6186 | 6186 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
6187 | 6187 | } |
6188 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
6188 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
6189 | 6189 | if (!empty($paymentmode) && $paymentmode != 'all') { |
6190 | 6190 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
6191 | 6191 | } |
@@ -6404,7 +6404,7 @@ discard block |
||
6404 | 6404 | $actioncomm->create($user); |
6405 | 6405 | } |
6406 | 6406 | |
6407 | - $this->db->commit(); // We always commit |
|
6407 | + $this->db->commit(); // We always commit |
|
6408 | 6408 | } |
6409 | 6409 | |
6410 | 6410 | if ($errormesg) { |
@@ -6446,7 +6446,7 @@ discard block |
||
6446 | 6446 | // get date of last validated invoices of same type |
6447 | 6447 | $sql = "SELECT datef"; |
6448 | 6448 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
6449 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
6449 | + $sql .= " WHERE type = ".(int) $this->type; |
|
6450 | 6450 | $sql .= " AND date_valid IS NOT NULL"; |
6451 | 6451 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
6452 | 6452 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $facstatic->total_ht = $obj->total_ht; |
361 | 361 | $facstatic->total_tva = $obj->total_tva; |
362 | 362 | $facstatic->total_ttc = $obj->total_ttc; |
363 | - $facstatic->statut = $obj->status; // deprecated |
|
363 | + $facstatic->statut = $obj->status; // deprecated |
|
364 | 364 | $facstatic->status = $obj->status; |
365 | 365 | $facstatic->paye = $obj->paye; |
366 | 366 | $facstatic->paid = $obj->paye; |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $donationstatic->lastname = $obj->lastname; |
482 | 482 | $donationstatic->firstname = $obj->firstname; |
483 | 483 | $donationstatic->date = $db->jdate($obj->date); |
484 | - $donationstatic->statut = $obj->status; // deprecated |
|
484 | + $donationstatic->statut = $obj->status; // deprecated |
|
485 | 485 | $donationstatic->status = $obj->status; |
486 | 486 | |
487 | 487 | $label = ''; |
@@ -150,7 +150,7 @@ |
||
150 | 150 | |
151 | 151 | $invoicestatic->id = $obj->rowid; |
152 | 152 | $invoicestatic->ref = $obj->ref; |
153 | - $invoicestatic->statut = $obj->status; // deprecated |
|
153 | + $invoicestatic->statut = $obj->status; // deprecated |
|
154 | 154 | $invoicestatic->status = $obj->status; |
155 | 155 | $invoicestatic->paye = $obj->paye; |
156 | 156 | $invoicestatic->type = $obj->type; |
@@ -279,7 +279,7 @@ |
||
279 | 279 | |
280 | 280 | $supplierorderstatic->id = $objp->commandeid; |
281 | 281 | $supplierorderstatic->ref = $objp->ref; |
282 | - $supplierorderstatic->statut = $objp->status; // deprecated |
|
282 | + $supplierorderstatic->statut = $objp->status; // deprecated |
|
283 | 283 | $supplierorderstatic->status = $objp->status; |
284 | 284 | $supplierorderstatic->billed = $objp->billed; |
285 | 285 |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } else { |
265 | 265 | if (!empty($this->cache_warehouses[$tab['parent_id']])) { |
266 | 266 | if (getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') !== 2 || (getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') === 2 && empty($this->cache_warehouses[$tab['parent_id']]['parent_id']))) { |
267 | - $final_label = $this->cache_warehouses[$tab['parent_id']]['label'] . ' >> ' . $final_label; |
|
267 | + $final_label = $this->cache_warehouses[$tab['parent_id']]['label'].' >> '.$final_label; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | return $this->get_parent_path($this->cache_warehouses[$tab['parent_id']], $final_label); |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | { |
305 | 305 | global $conf, $langs, $user, $hookmanager; |
306 | 306 | |
307 | - dol_syslog(get_class($this)."::selectWarehouses " . (is_array($selected) ? 'selected is array' : $selected) . ", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG); |
|
307 | + dol_syslog(get_class($this)."::selectWarehouses ".(is_array($selected) ? 'selected is array' : $selected).", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG); |
|
308 | 308 | |
309 | 309 | $out = ''; |
310 | 310 | if ((!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) && ($filterstatus === "warehouseinternal")) { |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | $return .= '</select>'; |
634 | 634 | } |
635 | 635 | |
636 | - $return .= ajax_combobox($name, array(), 0, 0, 'resolve', $placeholderID); // avoid to have hidden value if scale = -1 (eg DM size) |
|
636 | + $return .= ajax_combobox($name, array(), 0, 0, 'resolve', $placeholderID); // avoid to have hidden value if scale = -1 (eg DM size) |
|
637 | 637 | |
638 | 638 | return $return; |
639 | 639 | } |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | } |
840 | 840 | |
841 | 841 | if (empty($hookmanager)) { |
842 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
842 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
843 | 843 | $hookmanager = new HookManager($this->db); |
844 | 844 | } |
845 | 845 | $hookmanager->initHooks(array('productdao')); |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | if (array_key_exists($productId, $this->cache_lot)) { |
859 | 859 | foreach ($this->cache_lot[$productId] as $id => $arraytypes) { |
860 | 860 | if (empty($fk_entrepot) || $fk_entrepot == $arraytypes['entrepot_id']) { |
861 | - $label = $arraytypes['entrepot_label'] . ' - '; |
|
861 | + $label = $arraytypes['entrepot_label'].' - '; |
|
862 | 862 | $label .= $arraytypes['batch']; |
863 | 863 | // Notice: Chrome show 1 line with value and 1 for label. Firefox show only 1 line with label |
864 | 864 | $optionLabel = ($conf->browser->name === 'chrome' ? '' : $arraytypes['batch']); |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | $optionLabel .= ' - '.$langs->trans('printEatby', $arraytypes['eatbydate']); |
871 | 871 | } |
872 | 872 | $optionLabel .= ')'; |
873 | - $out .= '<option data-warehouse="'.dol_escape_htmltag($label).'" data-eatbydate="'.$arraytypes['eatbydate'].'" data-sellbydate="'.$arraytypes['sellbydate'].'" value="' . $arraytypes['batch'] . '">'.$optionLabel.'</option>'; |
|
873 | + $out .= '<option data-warehouse="'.dol_escape_htmltag($label).'" data-eatbydate="'.$arraytypes['eatbydate'].'" data-sellbydate="'.$arraytypes['sellbydate'].'" value="'.$arraytypes['batch'].'">'.$optionLabel.'</option>'; |
|
874 | 874 | } |
875 | 875 | } |
876 | 876 | } |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | $batch_count = 0; |
915 | 915 | global $hookmanager; |
916 | 916 | if (empty($hookmanager)) { |
917 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
917 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
918 | 918 | $hookmanager = new HookManager($this->db); |
919 | 919 | } |
920 | 920 | $hookmanager->initHooks(array('productdao')); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | 'skip_batch' => &$skip_batch, |
253 | 253 | 'id_product_batch' => &$id_product_batch |
254 | 254 | ); |
255 | - $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
255 | + $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
256 | 256 | |
257 | 257 | if ($reshook < 0) { |
258 | 258 | if (!empty($hookmanager->resPrint)) { |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | // Update stock quantity |
600 | 600 | if (!$error) { |
601 | 601 | if ($alreadyarecord > 0) { |
602 | - $sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = " . ((float) $oldqtywarehouse + (float) $qty); |
|
602 | + $sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = ".((float) $oldqtywarehouse + (float) $qty); |
|
603 | 603 | $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); |
604 | 604 | } else { |
605 | 605 | $sql = "INSERT INTO ".$this->db->prefix()."product_stock"; |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | |
670 | 670 | if ($movestock && !$error) { |
671 | 671 | // Call trigger |
672 | - if ($product->stockable_product != Product::DISABLED_STOCK ) { |
|
672 | + if ($product->stockable_product != Product::DISABLED_STOCK) { |
|
673 | 673 | $result = $this->call_trigger('STOCK_MOVEMENT', $user); |
674 | 674 | if ($result < 0) { |
675 | 675 | $error++; |
@@ -749,8 +749,8 @@ discard block |
||
749 | 749 | $this->price = $obj->price; |
750 | 750 | $this->fk_user_author = $obj->fk_user_author; |
751 | 751 | $this->label = $obj->label; |
752 | - $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
753 | - $this->origintype = $obj->origin_type; // For backward compatibility |
|
752 | + $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
753 | + $this->origintype = $obj->origin_type; // For backward compatibility |
|
754 | 754 | $this->origin_id = $obj->origin_id; |
755 | 755 | $this->origin_type = $obj->origin_type; |
756 | 756 | $this->inventorycode = $obj->inventorycode; |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | $this->errors[] = $langs->trans('ErrorNoteAlsoThatSubProductCantBeFollowedByLot'); |
823 | 823 | } |
824 | 824 | $error = $result; |
825 | - dol_syslog(__METHOD__ . ' Error : ' . $this->errorsToString(), LOG_ERR); |
|
825 | + dol_syslog(__METHOD__.' Error : '.$this->errorsToString(), LOG_ERR); |
|
826 | 826 | break; |
827 | 827 | } |
828 | 828 | unset($tmpmove); |
@@ -980,8 +980,8 @@ discard block |
||
980 | 980 | } else { // product_batch record not found |
981 | 981 | $pdluo->fk_product_stock = $vfk_product_stock; |
982 | 982 | $pdluo->qty = $qty; |
983 | - $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
984 | - $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
983 | + $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
984 | + $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
985 | 985 | $pdluo->batch = $vbatchnumber; |
986 | 986 | |
987 | 987 | $result = $pdluo->create($user, 1); |
@@ -1178,11 +1178,11 @@ discard block |
||
1178 | 1178 | $label .= '<div width="100%">'; |
1179 | 1179 | $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->id; |
1180 | 1180 | $label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label; |
1181 | - $qtylabel = (($this->qty > 0) ? '<span class="stockmovemententry">+' : '<span class="stockmovementexit">') . $this->qty . '</span>'; |
|
1181 | + $qtylabel = (($this->qty > 0) ? '<span class="stockmovemententry">+' : '<span class="stockmovementexit">').$this->qty.'</span>'; |
|
1182 | 1182 | if ($this->inventorycode) { |
1183 | 1183 | $label .= '<br><b>'.$langs->trans('InventoryCode').':</b> '.$this->inventorycode; |
1184 | 1184 | } |
1185 | - $label .= '<br><b>'.$langs->trans('Qty').':</b> ' . $qtylabel; |
|
1185 | + $label .= '<br><b>'.$langs->trans('Qty').':</b> '.$qtylabel; |
|
1186 | 1186 | if ($this->batch) { |
1187 | 1187 | $label .= '<br><b>'.$langs->trans('Batch').':</b> '.$this->batch; |
1188 | 1188 | } |
@@ -1310,8 +1310,8 @@ discard block |
||
1310 | 1310 | $sql = "SELECT sum(pb.qty) as cpt"; |
1311 | 1311 | $sql .= " FROM ".$this->db->prefix()."product_batch as pb"; |
1312 | 1312 | $sql .= " INNER JOIN ".$this->db->prefix()."product_stock as ps ON ps.rowid = pb.fk_product_stock"; |
1313 | - $sql .= " WHERE ps.fk_product = " . ((int) $fk_product); |
|
1314 | - $sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'"; |
|
1313 | + $sql .= " WHERE ps.fk_product = ".((int) $fk_product); |
|
1314 | + $sql .= " AND pb.batch = '".$this->db->escape($batch)."'"; |
|
1315 | 1315 | |
1316 | 1316 | $result = $this->db->query($sql); |
1317 | 1317 | if ($result) { |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | */ |
1336 | 1336 | public function reverseMouvement() |
1337 | 1337 | { |
1338 | - $formattedDate = "REVERTMV" .dol_print_date($this->datem, '%Y%m%d%His'); |
|
1338 | + $formattedDate = "REVERTMV".dol_print_date($this->datem, '%Y%m%d%His'); |
|
1339 | 1339 | if ($this->label == 'Annulation movement ID'.$this->id) { |
1340 | 1340 | return -1; |
1341 | 1341 | } |
@@ -1371,11 +1371,11 @@ discard block |
||
1371 | 1371 | { |
1372 | 1372 | $date = ''; |
1373 | 1373 | |
1374 | - $sql = "SELECT MAX(datem) as datem"; |
|
1374 | + $sql = "SELECT MAX(datem) as datem"; |
|
1375 | 1375 | $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement"; |
1376 | - $sql .= " WHERE fk_product = " . ((int) $fk_product); |
|
1377 | - $sql .= " AND fk_entrepot = " .((int) $fk_entrepot); |
|
1378 | - $sql .= " AND batch = '" . $this->db->escape($batch) . "'"; |
|
1376 | + $sql .= " WHERE fk_product = ".((int) $fk_product); |
|
1377 | + $sql .= " AND fk_entrepot = ".((int) $fk_entrepot); |
|
1378 | + $sql .= " AND batch = '".$this->db->escape($batch)."'"; |
|
1379 | 1379 | |
1380 | 1380 | $result = $this->db->query($sql); |
1381 | 1381 | if ($result) { |