GitHub PullRequestReviewCommentEvent at 2014-04-28 00:07:28
Repository: dolibarr
Actor: eldy
Payload: {"comment":{"url":"https://api.github.com/repos/Dolibarr/dolibarr/pulls/comments/12032318","id":12032318,"diff_hunk":"@@ -304,6 +304,99 @@ function get_substitutionarray_propal_lines($line,$outputlangs)\n     \t'line_date_end'=>$line->date_end\n     \t);\n     }\n+\t\n+    /**\n+     * Define array with couple substitution key => substitution value\n+     *\n+     * @param   Object\t\t\t$object             Main object to use as data source\n+     * @param   Translate\t\t$outputlangs        Lang object to use for output\n+     * @param   array_key\t\t$array_key\t        Name of the key for return array\n+     * @return\tarray\t\t\t\t\t\t\t\tArray of substitution\n+     */\n+    function get_substitutionarray_shipment($object,$outputlangs,$array_key='object')\n+    {\n+    \tglobal $conf;\n+\t\tdol_include_once('/core/lib/product.lib.php');\n+\t\t$object->list_delivery_methods($object->shipping_method_id);\n+\t\t$calculatedVolume=($object->trueWidth * $object->trueHeight * $object->trueDepth);\n+\n+    \t$array_shipment=array(\n+\t    \t$array_key.'_id'=>$object->id,\n+\t    \t$array_key.'_ref'=>$object->ref,\n+\t    \t$array_key.'_ref_ext'=>$object->ref_ext,\n+\t    \t$array_key.'_ref_customer'=>$object->ref_customer,\n+\t    \t$array_key.'_date_delivery'=>dol_print_date($object->date_delivery,'day'),\n+\t    \t$array_key.'_hour_delivery'=>dol_print_date($object->date_delivery,'hour'),\n+\t    \t$array_key.'_date_creation'=>dol_print_date($object->date_creation,'day'),\n+\t    \t$array_key.'_total_ht'=>price($object->total_ht),\n+\t    \t$array_key.'_total_vat'=>price($object->total_tva),\n+\t    \t$array_key.'_total_ttc'=>price($object->total_ttc),\n+\t    \t$array_key.'_total_discount_ht' => price($object->getTotalDiscount()),\n+\t    \t$array_key.'_note_private'=>$object->note_private,\n+\t    \t$array_key.'_note'=>$object->note_public,\n+\t    \t$array_key.'_tracking_number'=>$object->tracking_number,\n+\t    \t$array_key.'_tracking_url'=>$object->tracking_url,\n+\t    \t$array_key.'_shipping_method'=>$object->listmeths[0]['libelle'],\n+\t    \t$array_key.'_weight'=>$object->trueWeight.' '.measuring_units_string($object->weight_units, 'weight'),\n+\t    \t$array_key.'_width'=>$object->trueWidth.' '.measuring_units_string($object->width_units, 'size'),\n+\t    \t$array_key.'_height'=>$object->trueHeight.' '.measuring_units_string($object->height_units, 'size'),\n+\t    \t$array_key.'_depth'=>$object->trueDepth.' '.measuring_units_string($object->depth_units, 'size'),\n+\t    \t$array_key.'_size'=>$calculatedVolume.' '.measuring_units_string(0, 'volume'),\n+    \t);\n+\n+    \t// Add vat by rates\n+    \tforeach ($object->lines as $line)\n+    \t{\n+    \t\tif (empty($array_shipment[$array_key.'_total_vat_'.$line->tva_tx])) $array_shipment[$array_key.'_total_vat_'.$line->tva_tx]=0;\n+    \t\t$array_shipment[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;\n+    \t}\n+\n+    \t// Retrieve extrafields\n+    \t/*if(is_array($object->array_options) && count($object->array_options))\n+    \t{\n+    \t\trequire_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';\n+    \t\t$extrafields = new ExtraFields($this->db);\n+    \t\t$extralabels = $extrafields->fetch_name_optionals_label('shipment',true);\n+    \t\t$object->fetch_optionals($object->id,$extralabels);\n+\n+    \t\t$array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs);\n+    \t}*/\n+    \treturn $array_shipment;\n+    }\n+\n+\n+    /**\n+     *\tDefine array with couple substitution key => substitution value\n+     *\n+     *\t@param  array\t\t\t$line\t\t\t\tArray of lines\n+     *\t@param  Translate\t\t$outputlangs        Lang object to use for output\n+     *\t@return\tarray\t\t\t\t\t\t\t\tSubstitution array\n+     */\n+    function get_substitutionarray_shipment_lines($line,$outputlangs)\n+    {\n+    \tglobal $conf;\n+\t\tdol_include_once('/core/lib/product.lib.php');\n+\n+    \treturn array(\n+\t    \t'line_fulldesc'=>doc_getlinedesc($line,$outputlangs),\n+\t    \t'line_product_ref'=>$line->product_ref,\n+\t    \t'line_product_label'=>$line->product_label,\n+\t    \t'line_desc'=>$line->desc,\n+\t    \t'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits),\n+\t    \t'line_up'=>price($line->subprice),\n+\t    \t'line_qty'=>$line->qty,\n+\t    \t'line_qty_shipped'=>$line->qty_shipped,","path":"htdocs/core/class/commondocgenerator.class.php","position":85,"original_position":85,"commit_id":"27e26c872ec7d66d241c040cc0657d3e306ff64f","original_commit_id":"27e26c872ec7d66d241c040cc0657d3e306ff64f","user":{"login":"eldy","id":883887,"avatar_url":"https://avatars.githubusercontent.com/u/883887?","gravatar_id":"556a68f534dbac0472dd287136a6aa62","url":"https://api.github.com/users/eldy","html_url":"https://github.com/eldy","followers_url":"https://api.github.com/users/eldy/followers","following_url":"https://api.github.com/users/eldy/following{/other_user}","gists_url":"https://api.github.com/users/eldy/gists{/gist_id}","starred_url":"https://api.github.com/users/eldy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eldy/subscriptions","organizations_url":"https://api.github.com/users/eldy/orgs","repos_url":"https://api.github.com/users/eldy/repos","events_url":"https://api.github.com/users/eldy/events{/privacy}","received_events_url":"https://api.github.com/users/eldy/received_events","type":"User","site_admin":false},"body":"Everybody can edit the wiki. So you can update it if you want (wiki = doc for dev version).","created_at":"2014-04-28T00:07:28Z","updated_at":"2014-04-28T00:07:28Z","html_url":"https://github.com/Dolibarr/dolibarr/pull/1113#discussion_r12032318","pull_request_url":"https://api.github.com/repos/Dolibarr/dolibarr/pulls/1113","_links":{"self":{"href":"https://api.github.com/repos/Dolibarr/dolibarr/pulls/comments/12032318"},"html":{"href":"https://github.com/Dolibarr/dolibarr/pull/1113#discussion_r12032318"},"pull_request":{"href":"https://api.github.com/repos/Dolibarr/dolibarr/pulls/1113"}}}}