40require
'../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmargin.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_proposal/modules_supplier_proposal.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/supplier_proposal.lib.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
52 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
53 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
66$langs->loadLangs(array(
'companies',
'supplier_proposal',
'compta',
'bills',
'propal',
'orders',
'products',
'sendings'));
68 $langs->load(
'margins');
76$action =
GETPOST(
'action',
'aZ09');
77$cancel =
GETPOST(
'cancel',
'alpha');
78$backtopage =
GETPOST(
'backtopage',
'alpha');
79$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
81$origin =
GETPOST(
'origin',
'alpha');
83$confirm =
GETPOST(
'confirm',
'alpha');
98$hookmanager->initHooks(array(
'supplier_proposalcard',
'globalcard'));
106$extrafields->fetch_name_optionals_label(
$object->table_element);
109if ($id > 0 || !empty($ref)) {
110 $ret =
$object->fetch($id, $ref);
112 $ret =
$object->fetch_thirdparty();
121$usercanread = $user->hasRight(
'supplier_proposal',
'lire');
122$usercancreate = $user->hasRight(
'supplier_proposal',
'creer');
123$usercandelete = $user->hasRight(
'supplier_proposal',
'supprimer');
126$usercanvalidate = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'supplier_proposal',
'validate_advance')));
127$usercansend = (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || $user->hasRight(
'supplier_proposal',
'send_advance'));
130$usercanclose = $user->hasRight(
'supplier_proposal',
'cloturer');
131$usercancreateorder = ($user->hasRight(
'fournisseur',
'commande',
'creer') || $user->hasRight(
'supplier_order',
'creer'));
134$permissionnote = $usercancreate;
135$permissiondellink = $usercancreate;
136$permissiontoedit = $usercancreate;
137$permissiontoadd = $usercancreate;
138$permissiontoeditextra = $permissiontoadd;
139if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
141 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
145if (!empty($user->socid)) {
146 $socid = $user->socid;
155$parameters = array(
'socid' => $socid);
156$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
161if (empty($reshook)) {
162 $backurlforlist = DOL_URL_ROOT.
'/supplier_proposal/list.php';
164 if (empty($backtopage) || ($cancel && empty($id))) {
165 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
166 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
167 $backtopage = $backurlforlist;
169 $backtopage = DOL_URL_ROOT.
'/supplier_proposal/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
174 if ($cancel && !($action ==
'updateline' && $usercancreate)) {
175 if (!empty($backtopageforcancel)) {
176 header(
"Location: ".$backtopageforcancel);
178 } elseif (!empty($backtopage)) {
179 header(
"Location: ".$backtopage);
185 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
187 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
189 include DOL_DOCUMENT_ROOT.
'/core/actions_lineupdown.inc.php';
192 if ($action ==
'confirm_clone' && $confirm ==
'yes' && $usercancreate) {
193 if (
false && !
GETPOST(
'clone_content') && !
GETPOST(
'clone_receivers')) {
197 $result =
$object->createFromClone($user, $socid);
199 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?id='.$result);
207 } elseif ($action ==
'confirm_delete' && $confirm ==
'yes' && $usercandelete) {
209 $result =
$object->delete($user);
211 header(
'Location: '.DOL_URL_ROOT.
'/supplier_proposal/list.php');
214 $langs->load(
"errors");
217 } elseif ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $usercancreate) {
219 $result =
$object->deleteLine($lineid);
224 $langs->load(
"errors");
230 $outputlangs = $langs;
233 $newlang = (
GETPOST(
'lang_id',
'aZ09') ?
GETPOST(
'lang_id',
'aZ09') :
$object->thirdparty->default_lang);
234 $outputlangs->setDefaultLang($newlang);
240 $object->generateDocument(
$object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
243 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
245 } elseif ($action ==
'confirm_validate' && $confirm ==
'yes' && $usercanvalidate) {
247 $result =
$object->valid($user);
250 $outputlangs = $langs;
253 $newlang =
GETPOST(
'lang_id',
'aZ09');
256 $newlang =
$object->thirdparty->default_lang;
258 if (!empty($newlang)) {
260 $outputlangs->setDefaultLang($newlang);
268 $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
271 $langs->load(
"errors");
272 if (count(
$object->errors) > 0) {
278 } elseif ($action ==
'setdate_livraison' && $usercancreate) {
283 } elseif ($action ==
'add' && $usercancreate) {
291 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Supplier")),
null,
'errors');
302 if (
GETPOST(
'createmode') ==
'copy' &&
GETPOSTINT(
'copie_supplier_proposal') > 0) {
305 $object->delivery_date = $date_delivery;
313 $object->model_pdf = $model_pdf;
315 $object->user_creation_id = $user->id;
321 setEventMessages($langs->trans(
"ErrorFailedToCopyProposal",
GETPOST(
'copie_supplier_proposal')),
null,
'errors');
325 $object->delivery_date = $date_delivery;
333 $object->model_pdf = $model_pdf;
335 $object->user_creation_id = $user->id;
344 $object->multicurrency_code =
GETPOST(
'multicurrency_code',
'alpha');
348 $ret = $extrafields->setOptionalsFromPost(
null, $object);
356 if ($origin && $originid) {
358 $element = $subelement = $origin;
360 if (preg_match(
'/^([^_]+)_([^_]+)/i', $origin, $regs)) {
362 $subelement = $regs[2];
366 if ($element ==
'order') {
367 $element = $subelement =
'commande';
369 if ($element ==
'propal') {
370 $element =
'comm/propal';
371 $subelement =
'propal';
373 if ($element ==
'contract') {
374 $element = $subelement =
'contrat';
376 if ($element ==
'inter') {
377 $element = $subelement =
'fichinter';
379 if ($element ==
'shipping') {
380 $element = $subelement =
'expedition';
384 $object->origin_type = $origin;
385 $object->origin_id = $originid;
390 $object->linked_objects = array_merge(
$object->linked_objects,
GETPOST(
'other_linked_objects',
'array:int'));
397 $classname = ucfirst($subelement);
398 $srcobject =
new $classname($db);
399 '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';
401 dol_syslog(
"Try to find source object origin=".
$object->origin_type.
" originid=".
$object->origin_id.
" to add lines");
402 $result = $srcobject->fetch(
$object->origin_id);
405 $lines = $srcobject->lines;
406 if (empty($lines) && method_exists($srcobject,
'fetch_lines')) {
407 $srcobject->fetch_lines();
408 $lines = $srcobject->lines;
412 $num = count($lines);
413 for ($i = 0; $i < $num; $i++) {
414 $label = (!empty($lines[$i]->label) ? $lines[$i]->label :
'');
415 $desc = (!empty($lines[$i]->desc) ? $lines[$i]->desc :
'');
418 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
421 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
426 if (method_exists($lines[$i],
'fetch_optionals')) {
427 $lines[$i]->fetch_optionals();
428 $array_options = $lines[$i]->array_options;
430 $array_options = array();
435 $lines[$i]->subprice,
438 $lines[$i]->localtax1_tx,
439 $lines[$i]->localtax2_tx,
440 $lines[$i]->fk_product,
441 $lines[$i]->remise_percent,
444 $lines[$i]->info_bits,
447 $lines[$i]->special_code,
449 $lines[$i]->fk_fournprice,
453 $lines[$i]->ref_supplier,
466 if ($result > 0 && !empty($lines[$i]->extraparams)) {
468 $newline->id = $result;
469 $newline->extraparams = $lines[$i]->extraparams;
470 $newline->setExtraParameters();
474 if ($result > 0 && $lines[$i]->product_type == 9) {
475 $fk_parent_line = $result;
480 $parameters = array(
'objFrom' => $srcobject);
481 $reshook = $hookmanager->executeHooks(
'createFrom', $parameters, $object, $action);
502 $categories =
GETPOST(
'categories',
'array');
503 $object->setCategories($categories);
510 $outputlangs = $langs;
513 $newlang =
GETPOST(
'lang_id',
'aZ09');
516 $newlang =
$object->thirdparty->default_lang;
518 if (!empty($newlang)) {
520 $outputlangs->setDefaultLang($newlang);
524 if (!empty($model)) {
526 $result =
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
533 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$id);
546 } elseif ($action ==
'confirm_reopen' && $usercanclose && !
GETPOST(
'cancel',
'alpha')) {
552 } elseif ($action ==
'close' && $usercanclose && !
GETPOST(
'cancel',
'alpha')) {
558 } elseif ($action ==
'setstatut' && $usercanclose && !
GETPOST(
'cancel',
'alpha')) {
561 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"CloseAs")),
null,
'errors');
569 } elseif ($action ==
'settags' &&
isModEnabled(
'category') && $usercancreate) {
574 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
577 $triggersendname =
'PROPOSAL_SUPPLIER_SENTBYMAIL';
578 $autocopy =
'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO';
579 $trackid =
'spro'.$object->id;
580 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
583 $upload_dir = $conf->supplier_proposal->dir_output;
584 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
588 if ($action ==
'modif' && $usercancreate) {
593 $outputlangs = $langs;
596 $newlang = (
GETPOST(
'lang_id',
'aZ09') ?
GETPOST(
'lang_id',
'aZ09') :
$object->thirdparty->default_lang);
597 $outputlangs->setDefaultLang($newlang);
603 $object->generateDocument(
$object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
605 } elseif ($action ==
"setabsolutediscount" && $usercancreate) {
617 if ($action ==
'addline' &&
GETPOST(
'submitforalllines',
'aZ09') &&
GETPOST(
'vatforalllines',
'alpha') && $usercancreate) {
619 $vat_rate = (
GETPOST(
'vatforalllines') ?
GETPOST(
'vatforalllines') : 0);
620 $vat_rate = str_replace(
'*',
'', $vat_rate);
623 foreach (
$object->lines as $line) {
624 $result =
$object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $line->desc,
'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->array_options, $line->ref_fourn, $line->fk_unit, $line->multicurrency_subprice);
626 } elseif ($action ==
'addline' && $usercancreate) {
627 $langs->load(
'errors');
632 $line_desc = (GETPOSTISSET(
'dp_desc') ?
GETPOST(
'dp_desc',
'restricthtml') :
'');
636 $ref_supplier =
GETPOST(
'fourn_ref',
'alpha');
638 $prod_entry_mode =
GETPOST(
'prod_entry_mode',
'aZ09');
639 if ($prod_entry_mode ==
'free') {
654 $remise_percent = (GETPOSTISSET(
'remise_percent'.$predef) ?
price2num(
GETPOST(
'remise_percent'.$predef,
'alpha'),
'', 2) : 0);
655 if (empty($remise_percent)) {
660 $extralabelsline = $extrafields->fetch_name_optionals_label(
$object->table_element_line);
661 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line, $predef);
663 if (is_array($extralabelsline)) {
665 foreach ($extralabelsline as $key => $value) {
666 unset($_POST[
"options_".$key]);
670 if ($prod_entry_mode ==
'free' &&
GETPOST(
'price_ht') < 0 && $qty < 0) {
671 setEventMessages($langs->trans(
'ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv(
'UnitPrice'), $langs->transnoentitiesnoconv(
'Qty')),
null,
'errors');
674 if ($prod_entry_mode ==
'free' && (empty($idprod) || $idprod < 0) &&
GETPOST(
'type') < 0) {
675 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
679 if ($prod_entry_mode ==
'free' && (empty($idprod) || $idprod < 0) &&
GETPOST(
'price_ht') ===
'' &&
GETPOST(
'price_ttc') ===
'' &&
GETPOST(
'multicurrency_price_ht') ===
'') {
680 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"UnitPrice")),
null,
'errors');
683 if ($prod_entry_mode ==
'free' && (empty($idprod) || $idprod < 0) && empty($line_desc)) {
684 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Description")),
null,
'errors');
687 if (!$error && ($qty >= 0)) {
691 $price_base_type = (
GETPOST(
'price_base_type',
'alpha') ?
GETPOST(
'price_base_type',
'alpha') :
'HT');
695 if ($prod_entry_mode !=
'free' && empty($error)) {
699 if (
GETPOST(
'idprodfournprice',
'alpha') == -1 ||
GETPOST(
'idprodfournprice',
'alpha') ==
'') {
704 if (preg_match(
'/^idprod_([0-9]+)$/',
GETPOST(
'idprodfournprice',
'alpha'), $reg)) {
705 $idprod = (int) $reg[1];
706 $res = $productsupplier->fetch($idprod);
709 if (
getDolGlobalString(
'SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER')) {
711 $productsupplier->get_buyprice(0, -1, $idprod,
'none', $fksoctosearch);
712 if ($productsupplier->fourn_socid != $socid) {
713 $productsupplier->ref_supplier =
'';
716 $fksoctosearch =
$object->thirdparty->id;
717 $productsupplier->get_buyprice(0, -1, $idprod,
'none', $fksoctosearch);
719 } elseif (
GETPOSTINT(
'idprodfournprice') > 0) {
722 $idprod = $productsupplier->get_buyprice(
GETPOSTINT(
'idprodfournprice'), $qtytosearch);
723 $res = $productsupplier->fetch($idprod);
727 $label = $productsupplier->label;
731 $outputlangs = $langs;
733 if (
GETPOST(
'lang_id',
'aZ09')) {
734 $newlang =
GETPOST(
'lang_id',
'aZ09');
736 if (empty($newlang)) {
737 $newlang =
$object->thirdparty->default_lang;
739 if (!empty($newlang)) {
741 $outputlangs->setDefaultLang($newlang);
743 $desc = (!empty($productsupplier->multilangs[$outputlangs->defaultlang][
"description"])) ? $productsupplier->multilangs[$outputlangs->defaultlang][
"description"] : $productsupplier->
description;
745 $desc = $productsupplier->description;
748 if (!empty($productsupplier->desc_supplier) &&
getDolGlobalString(
'PRODUIT_FOURN_TEXTS')) {
749 $desc = $productsupplier->desc_supplier;
760 $ref_supplier = $productsupplier->ref_supplier;
764 if (!GETPOSTISSET(
'tva_tx')) {
765 $tmpidprodfournprice =
GETPOST(
'idprodfournprice',
'alpha');
766 if (is_numeric($tmpidprodfournprice) && (
int) $tmpidprodfournprice > 0) {
767 $tmpidprodfournprice = (int) $tmpidprodfournprice;
769 $tmpidprodfournprice = 0;
775 if (empty($tva_tx)) {
781 $type = $productsupplier->type;
782 if (
GETPOST(
'price_ht') !=
'' ||
GETPOST(
'multicurrency_price_ht') !=
'') {
783 $price_base_type =
'HT';
785 $pu_devise =
price2num($price_ht_devise,
'CU');
786 } elseif (
GETPOST(
'price_ttc') !=
'' ||
GETPOST(
'multicurrency_price_ttc') !=
'') {
787 $price_base_type =
'TTC';
789 $pu_devise =
price2num($price_ttc_devise,
'CU');
791 $price_base_type = ($productsupplier->fourn_price_base_type ? $productsupplier->fourn_price_base_type :
'HT');
792 if (empty(
$object->multicurrency_code) || ($productsupplier->fourn_multicurrency_code !=
$object->multicurrency_code)) {
793 $pu = $productsupplier->fourn_pu;
796 $pu = $productsupplier->fourn_pu;
797 $pu_devise = $productsupplier->fourn_multicurrency_unitprice;
806 $fournprice = (is_numeric(
GETPOST(
'idprodfournprice',
'alpha')) ?
GETPOST(
'idprodfournprice',
'alpha') : -1);
811 ($price_base_type ==
'HT' ? $pu : 0),
816 $productsupplier->id,
819 ($price_base_type ==
'TTC' ? $pu : 0),
822 min($rank, count(
$object->lines) + 1),
830 $productsupplier->fk_unit,
846 if ($idprod == -99 || $idprod == 0) {
849 $langs->load(
"errors");
850 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"ProductOrService")).
' '.$langs->trans(
"or").
' '.$langs->trans(
"NoPriceDefinedForThisSupplier"),
null,
'errors');
855 $langs->load(
"errors");
856 setEventMessages($langs->trans(
"ErrorQtyTooLowForThisSupplier"),
null,
'errors');
858 } elseif ((
GETPOST(
'price_ht') !==
'' ||
GETPOST(
'price_ttc') !==
'' ||
GETPOST(
'multicurrency_price_ht') !=
'') && empty($error)) {
862 $tva_npr = (preg_match(
'/\*/', $tva_tx) ? 1 : 0);
863 $tva_tx = str_replace(
'*',
'', $tva_tx);
864 $label = (
GETPOST(
'product_label') ?
GETPOST(
'product_label') :
'');
870 if (!preg_match(
'/\((.*)\)/', $tva_tx)) {
878 if (
GETPOST(
'price_ht') !=
'' ||
GETPOST(
'multicurrency_price_ht') !=
'') {
882 $pu_ht =
price2num((
float) $pu_ttc / (1 + ((
float) $tva_tx / 100)),
'MU');
884 $price_base_type =
'HT';
885 $pu_ht_devise =
price2num($price_ht_devise,
'CU');
912 (
float) $pu_ht_devise
917 if (!$error && $result > 0) {
924 $outputlangs = $langs;
927 $newlang =
GETPOST(
'lang_id',
'aZ09');
930 $newlang =
$object->thirdparty->default_lang;
932 if (!empty($newlang)) {
934 $outputlangs->setDefaultLang($newlang);
942 $result =
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
948 unset($_POST[
'prod_entry_mode']);
950 unset($_POST[
'qty']);
951 unset($_POST[
'type']);
952 unset($_POST[
'remise_percent']);
954 unset($_POST[
'price_ht']);
955 unset($_POST[
'multicurrency_price_ht']);
956 unset($_POST[
'price_ttc']);
957 unset($_POST[
'fourn_ref']);
958 unset($_POST[
'tva_tx']);
959 unset($_POST[
'label']);
960 unset($_POST[
'product_ref']);
961 unset($_POST[
'product_label']);
962 unset($_POST[
'product_desc']);
963 unset($_POST[
'fournprice']);
964 unset($_POST[
'buying_price']);
965 unset($localtax1_tx);
966 unset($localtax2_tx);
967 unset($_POST[
'np_marginRate']);
968 unset($_POST[
'np_markRate']);
969 unset($_POST[
'dp_desc']);
970 unset($_POST[
'idprodfournprice']);
971 unset($_POST[
'units']);
973 unset($_POST[
'idprod']);
975 unset($_POST[
'date_starthour']);
976 unset($_POST[
'date_startmin']);
977 unset($_POST[
'date_startsec']);
978 unset($_POST[
'date_startday']);
979 unset($_POST[
'date_startmonth']);
980 unset($_POST[
'date_startyear']);
981 unset($_POST[
'date_endhour']);
982 unset($_POST[
'date_endmin']);
983 unset($_POST[
'date_endsec']);
984 unset($_POST[
'date_endday']);
985 unset($_POST[
'date_endmonth']);
986 unset($_POST[
'date_endyear']);
993 } elseif ($action ==
'updateline' && $usercancreate &&
GETPOST(
'save') == $langs->trans(
"Save")) {
999 if (preg_match(
'/\*/', $vat_rate)) {
1007 $vat_rate = str_replace(
'*',
'', $vat_rate);
1011 if (
GETPOST(
'price_ht') !=
'') {
1012 $price_base_type =
'HT';
1016 $vatratecleaned = $vat_rate;
1017 if (preg_match(
'/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) {
1018 $vatratecleaned = trim($reg[1]);
1019 $vatratecode = $reg[2];
1023 $ht = (float) $ttc / (1 + ((
float) $vatratecleaned / 100));
1024 $price_base_type =
'HT';
1034 $extralabelsline = $extrafields->fetch_name_optionals_label(
$object->table_element_line);
1035 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line);
1037 if (is_array($extralabelsline)) {
1038 foreach ($extralabelsline as $key => $value) {
1039 unset($_POST[
"options_".$key]);
1044 $special_code =
GETPOST(
'special_code');
1051 if (!empty($productid)) {
1053 if (
getDolGlobalInt(
'SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY') == 1) {
1054 if ($productid > 0 && $productsupplier->get_buyprice(0, (
float)
price2num(
GETPOST(
'qty')), $productid,
'none',
GETPOSTINT(
'socid')) < 0) {
1055 setEventMessages($langs->trans(
"ErrorQtyTooLowForThisSupplier"),
null,
'warnings');
1060 $res = $product->fetch($productid);
1062 $type = $product->type;
1064 $price_min = $product->price_min;
1066 $price_min = $product->multiprices_min [
$object->thirdparty->price_level];
1072 $label = (
GETPOST(
'product_label') ?
GETPOST(
'product_label') :
'');
1076 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
1084 $ref_supplier =
GETPOST(
'fourn_ref',
'alpha');
1087 $result =
$object->updateline(
1108 (
float) $pu_ht_devise
1116 $outputlangs = $langs;
1118 $outputlangs =
new Translate(
"", $conf);
1119 $newlang = (
GETPOST(
'lang_id',
'aZ09') ?
GETPOST(
'lang_id',
'aZ09') :
$object->thirdparty->default_lang);
1120 $outputlangs->setDefaultLang($newlang);
1123 $object->generateDocument(
$object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
1126 unset($_POST[
'qty']);
1127 unset($_POST[
'type']);
1128 unset($_POST[
'productid']);
1129 unset($_POST[
'remise_percent']);
1130 unset($_POST[
'price_ht']);
1131 unset($_POST[
'multicurrency_price_ht']);
1132 unset($_POST[
'price_ttc']);
1133 unset($_POST[
'tva_tx']);
1134 unset($_POST[
'product_ref']);
1135 unset($_POST[
'product_label']);
1136 unset($_POST[
'product_desc']);
1137 unset($_POST[
'fournprice']);
1138 unset($_POST[
'buying_price']);
1140 unset($_POST[
'date_starthour']);
1141 unset($_POST[
'date_startmin']);
1142 unset($_POST[
'date_startsec']);
1143 unset($_POST[
'date_startday']);
1144 unset($_POST[
'date_startmonth']);
1145 unset($_POST[
'date_startyear']);
1146 unset($_POST[
'date_endhour']);
1147 unset($_POST[
'date_endmin']);
1148 unset($_POST[
'date_endsec']);
1149 unset($_POST[
'date_endday']);
1150 unset($_POST[
'date_endmonth']);
1151 unset($_POST[
'date_endyear']);
1158 } elseif ($action ==
'updateline' && $usercancreate && $cancel) {
1159 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id);
1161 } elseif ($action ==
'classin' && $usercancreate) {
1164 } elseif ($action ==
'setavailability' && $usercancreate) {
1167 } elseif ($action ==
'setconditions' && $usercancreate) {
1169 $sql =
"SELECT code ";
1170 $sql .=
"FROM " . $db->prefix() .
"c_payment_term";
1171 $sql .=
" WHERE rowid = " .
GETPOSTINT(
'cond_reglement_id');
1172 $result = $db->query($sql);
1174 $obj = $db->fetch_object($result);
1175 if ($obj->code ==
'DEP30PCTDEL') {
1186 } elseif ($action ==
'setmode' && $usercancreate) {
1189 } elseif ($action ==
'setmulticurrencycode' && $usercancreate) {
1191 $result =
$object->setMulticurrencyCode(
GETPOST(
'multicurrency_code',
'alpha'));
1192 } elseif ($action ==
'setmulticurrencyrate' && $usercancreate) {
1195 } elseif ($action ==
'update_extras' && $permissiontoeditextra) {
1198 $attribute_name =
GETPOST(
'attribute',
'aZ09');
1201 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
1207 $result =
$object->updateExtraField($attribute_name,
'PROPOSAL_SUPPLIER_MODIFY');
1215 $action =
'edit_extras';
1225$title =
$object->ref.
" - ".$langs->trans(
'Card');
1226if ($action ==
'create') {
1227 $title = $langs->trans(
"SupplierProposalNew");
1229$help_url =
'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
1231llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-supplierproposal page-card');
1233$form =
new Form($db);
1237$companystatic =
new Societe($db);
1245if ($action ==
'create') {
1246 $currency_code = $conf->currency;
1248 print
load_fiche_titre($langs->trans(
"SupplierProposalNew"),
'',
'supplier_proposal');
1252 $res = $soc->fetch($socid);
1256 if (!empty($origin) && !empty($originid)) {
1257 $element = $subelement =
GETPOST(
'origin');
1259 if (preg_match(
'/^([^_]+)_([^_]+)/i',
GETPOST(
'origin'), $regs)) {
1260 $element = $regs[1];
1261 $subelement = $regs[2];
1265 if ($element ==
'order' || $element ==
'commande') {
1266 $element = $subelement =
'commande';
1268 if ($element ==
'propal') {
1269 $element =
'comm/propal';
1270 $subelement =
'propal';
1275 $classname = ucfirst($subelement);
1276 $objectsrc =
new $classname($db);
1277 '@phan-var-force Commande|Propal|CommandeFournisseur|SupplierProposal $objectsrc';
1279 $objectsrc->fetch($originid);
1280 if (empty($objectsrc->lines) && method_exists($objectsrc,
'fetch_lines')) {
1281 $objectsrc->fetch_lines();
1283 $objectsrc->fetch_thirdparty();
1285 $projectid = (int) $objectsrc->fk_project;
1286 $soc = $objectsrc->thirdparty;
1288 $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
1289 $deposit_percent = (!empty($objectsrc->deposit_percent) ? $objectsrc->deposit_percent : (!empty($soc->deposit_percent) ? $soc->deposit_percent : 0));
1290 $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
1291 $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
1294 $objectsrc->fetch_optionals();
1295 $object->array_options = $objectsrc->array_options;
1298 if (!empty($objectsrc->multicurrency_code)) {
1299 $currency_code = $objectsrc->multicurrency_code;
1301 if (
getDolGlobalString(
'MULTICURRENCY_USE_ORIGIN_TX') && !empty($objectsrc->multicurrency_tx)) {
1302 $currency_tx = $objectsrc->multicurrency_tx;
1306 $cond_reglement_id = $soc->cond_reglement_supplier_id;
1307 $deposit_percent = !empty($soc->deposit_percent) ? $soc->deposit_percent : 0;
1308 $mode_reglement_id = $soc->mode_reglement_supplier_id;
1309 $fk_account = !empty($soc->fk_account) ? $soc->fk_account : 0;
1310 if (
isModEnabled(
"multicurrency") && !empty($soc->multicurrency_code)) {
1311 $currency_code = $soc->multicurrency_code;
1314 if (GETPOSTISSET(
'cond_reglement_id_deposit_percent')) {
1315 $deposit_percent =
GETPOSTFLOAT(
'cond_reglement_id_deposit_percent');
1320 print
'<form name="addprop" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
1321 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1322 print
'<input type="hidden" name="action" value="add">';
1323 if ($origin !=
'project' && $originid) {
1324 print
'<input type="hidden" name="origin" value="'.$origin.
'">';
1325 print
'<input type="hidden" name="originid" value="'.$originid.
'">';
1327 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1332 $parameters = array();
1334 $reshook = $hookmanager->executeHooks(
'tabContentCreateSupplierProposal', $parameters, $object, $action);
1335 if (empty($reshook)) {
1336 print
'<table class="border centpercent">';
1339 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
'Ref').
'</td><td colspan="2">'.$langs->trans(
"Draft").
'</td></tr>';
1343 print
'<td class="fieldrequired">'.$langs->trans(
'Supplier').
'</td>';
1345 print
'<td colspan="2">';
1346 print $soc->getNomUrl(1,
'supplier');
1347 print
'<input type="hidden" name="socid" value="'.$soc->id.
'">';
1350 print
'<td colspan="2">';
1351 $filter =
'((s.fournisseur:=:1) AND (s.status:=:1))';
1352 print
img_picto(
'',
'company',
'class="pictofixedwidth"').$form->select_company((empty($socid) ?
'' : $socid),
'socid', $filter,
'SelectThirdParty', 1, 0, array(), 0,
'minwidth175 maxwidth500 widthcentpercentminusxx');
1356 $(document).ready(function() {
1357 $("#socid").change(function() {
1358 console.log("We have changed the company - Reload page");
1360 $("input[name=action]").val("create");
1361 $("form[name=addprop]").submit();
1366 print
' <a href="'.DOL_URL_ROOT.
'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create').
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span></a>';
1373 print
'<tr><td>'.$langs->trans(
'Discounts').
'</td><td>';
1375 $absolute_discount = $soc->getAvailableDiscounts(
null,
'', 0, 1);
1379 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?socid='.$thirdparty->id.
'&action='.$action.
'&origin='.
GETPOST(
'origin').
'&originid='.
GETPOST(
'originid'));
1380 include DOL_DOCUMENT_ROOT.
'/core/tpl/object_discounts.tpl.php';
1386 print
'<tr><td class="nowrap">'.$langs->trans(
'PaymentConditionsShort').
'</td><td colspan="2">';
1387 print
img_picto(
'',
'payment',
'class="pictofixedwidth"');
1388 print $form->getSelectConditionsPaiements(GETPOSTISSET(
'cond_reglement_id') ?
GETPOSTINT(
'cond_reglement_id') : $cond_reglement_id,
'cond_reglement_id', -1, 1, 0,
'', $deposit_percent);
1392 print
'<tr><td>'.$langs->trans(
'PaymentMode').
'</td><td colspan="2">';
1393 print
img_picto(
'',
'bank',
'class="pictofixedwidth"');
1394 $form->select_types_paiements(
GETPOST(
'mode_reglement_id') > 0 ?
GETPOST(
'mode_reglement_id') : $mode_reglement_id,
'mode_reglement_id');
1399 print
'<tr><td>'.$langs->trans(
'BankAccount').
'</td><td colspan="2">';
1400 print
img_picto(
'',
'bank',
'class="pictofixedwidth"');
1401 $form->select_comptes(
GETPOST(
'fk_account') > 0 ?
GETPOSTINT(
'fk_account') : $fk_account,
'fk_account', 0,
'', 1);
1407 print
'<tr><td>'.$langs->trans(
'SendingMethod').
'</td><td colspan="2">';
1408 print
img_picto(
'',
'dolly',
'class="pictofixedwidth"');
1409 $form->selectShippingMethod(
GETPOST(
'shipping_method_id') > 0 ?
GETPOSTINT(
'shipping_method_id') :
"",
'shipping_method_id',
'', 1);
1414 print
'<tr><td>'.$langs->trans(
"DeliveryDate").
'</td>';
1415 print
'<td colspan="2">';
1416 print
img_picto(
'',
'action',
'class="pictofixedwidth"');
1419 $tmpdte = time() + (7 *
getDolGlobalInt(
'DATE_LIVRAISON_WEEK_DELAY') * 24 * 60 * 60);
1420 $syear =
date(
"Y", $tmpdte);
1421 $smonth =
date(
"m", $tmpdte);
1422 $sday =
date(
"d", $tmpdte);
1423 print $form->selectDate($syear.
"-".$smonth.
"-".$sday,
'liv_', 0, 0, 0,
"addask");
1425 print $form->selectDate($datedelivery ? $datedelivery : -1,
'liv_', 0, 0, 0,
"addask", 1, 1);
1432 print
'<td>'.$langs->trans(
"DefaultModel").
'</td>';
1433 print
'<td colspan="2">';
1434 print
img_picto(
'',
'pdf',
'class="pictofixedwidth"');
1437 print $form->selectarray(
'model', $list, $preselected, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1442 $langs->load(
"projects");
1446 if ($origin ==
'project') {
1447 $projectid = ($originid ? $originid : 0);
1451 print
'<td>'.$langs->trans(
"Project").
'</td><td colspan="2">';
1452 if (!empty($user->socid)) {
1453 $projSocFilter = $user->socid;
1454 } elseif (
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') || $socid == 0) {
1457 $projSocFilter = -1;
1459 $projSocFilter = $socid;
1461 print
img_picto(
'',
'project',
'class="pictofixedwidth"').$formproject->select_projects($projSocFilter, $projectid,
'projectid', 0, 0, 1, 1, 0, 0, 0,
'', 1, 0,
'maxwidth500');
1462 print
' <a href="'.DOL_URL_ROOT.
'/projet/card.php?socid='.((int) $soc->id).
'&action=create&status=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create&socid='.$soc->id).
'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans(
"AddProject").
'"></span></a>';
1470 print
'<td>'.$form->editfieldkey(
'Currency',
'multicurrency_code',
'', $object, 0).
'</td>';
1471 print
'<td colspan="3" class="maxwidthonsmartphone">';
1472 print
img_picto(
'',
'currency',
'class="pictofixedwidth"');
1473 print $form->selectMultiCurrency($currency_code,
'multicurrency_code');
1478 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td colspan="3">';
1479 print $form->selectCategories(Categorie::TYPE_SUPPLIER_PROPOSAL,
'categories', $object);
1484 $parameters = array(
'colspan' =>
' colspan="3"',
'cols' => 3);
1485 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1486 print $hookmanager->resPrint;
1487 if (empty($reshook)) {
1488 print
$object->showOptionals($extrafields,
'create', $parameters);
1493 if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
1495 if ($origin ==
'contrat') {
1499 $objectsrc->update_price(1,
'auto', 1);
1502 print
"\n<!-- ".$classname.
" info -->";
1504 print
'<input type="hidden" name="amount" value="'.$objectsrc->total_ht.
'">'.
"\n";
1505 print
'<input type="hidden" name="total" value="'.$objectsrc->total_ttc.
'">'.
"\n";
1506 print
'<input type="hidden" name="tva" value="'.$objectsrc->total_tva.
'">'.
"\n";
1507 print
'<input type="hidden" name="origin" value="'.$objectsrc->element.
'">';
1508 print
'<input type="hidden" name="originid" value="'.$objectsrc->id.
'">';
1510 print
'<tr><td>'.$langs->trans(
'CommRequest').
'</td><td colspan="2">'.$objectsrc->getNomUrl(1).
'</td></tr>';
1511 print
'<tr><td>'.$langs->trans(
'AmountHT').
'</td><td colspan="2">'.
price($objectsrc->total_ht).
'</td></tr>';
1512 print
'<tr><td>'.$langs->trans(
'AmountVAT').
'</td><td colspan="2">'.
price($objectsrc->total_tva).
"</td></tr>";
1513 if (
$mysoc->localtax1_assuj ==
"1" || $objectsrc->total_localtax1 != 0) {
1514 print
'<tr><td>'.$langs->transcountry(
"AmountLT1",
$mysoc->country_code).
'</td><td colspan="2">'.
price($objectsrc->total_localtax1).
"</td></tr>";
1517 if (
$mysoc->localtax2_assuj ==
"1" || $objectsrc->total_localtax2 != 0) {
1518 print
'<tr><td>'.$langs->transcountry(
"AmountLT2",
$mysoc->country_code).
'</td><td colspan="2">'.
price($objectsrc->total_localtax2).
"</td></tr>";
1520 print
'<tr><td>'.$langs->trans(
'AmountTTC').
'</td><td colspan="2">'.
price($objectsrc->total_ttc).
"</td></tr>";
1523 print
'<tr><td>'.$langs->trans(
'MulticurrencyAmountHT').
'</td><td colspan="2">'.
price($objectsrc->multicurrency_total_ht, 0, $langs, 1, -1, -1, $objectsrc->multicurrency_code).
'</td></tr>';
1524 print
'<tr><td>'.$langs->trans(
'MulticurrencyAmountVAT').
'</td><td colspan="2">'.
price($objectsrc->multicurrency_total_tva, 0, $langs, 1, -1, -1, $objectsrc->multicurrency_code).
"</td></tr>";
1525 print
'<tr><td>'.$langs->trans(
'MulticurrencyAmountTTC').
'</td><td colspan="2">'.
price($objectsrc->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $objectsrc->multicurrency_code).
"</td></tr>";
1537 print
'<input type="hidden" name="createmode" value="empty">';
1541 print
'<br><table>';
1545 print
'<td><input type="radio" name="createmode" value="copy"></td>';
1546 print
'<td>'.$langs->trans(
"CopyAskFrom").
' </td>';
1548 $liste_ask = array();
1549 $liste_ask [0] =
'';
1551 $sql =
"SELECT p.rowid as id, p.ref, s.nom";
1552 $sql .=
" FROM ".MAIN_DB_PREFIX.
"supplier_proposal p";
1553 $sql .=
", ".MAIN_DB_PREFIX.
"societe s";
1554 $sql .=
" WHERE s.rowid = p.fk_soc";
1555 $sql .=
" AND p.entityy IN (".getEntity(
'supplier_proposal').
")";
1556 $sql .=
" AND p.fk_statut <> ".SupplierProposal::STATUS_DRAFT;
1557 $sql .=
" ORDER BY Id";
1559 $resql = $db->query($sql);
1561 $num = $db->num_rows($resql);
1564 $row = $db->fetch_row($resql);
1565 $askPriceSupplierRefAndSocName = $row[1].
" - ".$row[2];
1566 $liste_ask[$row[0]] = $askPriceSupplierRefAndSocName;
1569 print $form->selectarray(
"copie_supplier_proposal", $liste_ask, 0);
1575 print
'<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
1576 print
'<td valign="top" colspan="2">'.$langs->trans(
"CreateEmptyAsk").
'</td></tr>';
1586 print $form->buttonsSaveCancel(
"CreateDraft");
1592 if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
1595 $title = $langs->trans(
'ProductsAndServices');
1598 print
'<div class="div-table-responsive-no-min">';
1599 print
'<table class="noborder centpercent">';
1601 $objectsrc->printOriginLinesList();
1615 print
dol_get_fiche_head($head,
'comm', $langs->trans(
'CommRequest'), -1,
'supplier_proposal', 0,
'',
'', 0,
'', 1);
1620 if ($action ==
'clone') {
1621 $filter =
'(s.fournisseur:=:1)';
1623 $formquestion = array(
1631 'label' => $langs->trans(
"SelectThirdParty"),
1632 'value' => $form->select_company(
GETPOSTINT(
'socid'),
'socid', $filter))
1635 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
1636 } elseif ($action ==
'delete') {
1638 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteAsk'), $langs->trans(
'ConfirmDeleteAsk',
$object->ref),
'confirm_delete',
'', 0, 1);
1639 } elseif ($action ==
'reopen') {
1641 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ReOpen'), $langs->trans(
'ConfirmReOpenAsk',
$object->ref),
'confirm_reopen',
'', 0, 1);
1642 } elseif ($action ==
'ask_deleteline') {
1644 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteProductLine'), $langs->trans(
'ConfirmDeleteProductLine'),
'confirm_deleteline',
'', 0, 1);
1645 } elseif ($action ==
'validate') {
1650 $ref = substr(
$object->ref, 1, 4);
1651 if ($ref ==
'PROV') {
1652 $numref =
$object->getNextNumRef($soc);
1653 if (empty($numref)) {
1658 $numref = (string)
$object->ref;
1661 $text = $langs->trans(
'ConfirmValidateAsk', $numref);
1663 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
1664 $notify =
new Notify($db);
1666 $text .= $notify->confirmMessage(
'PROPOSAL_SUPPLIER_VALIDATE',
$object->socid, $object);
1670 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ValidateAsk'), $text,
'confirm_validate',
'', 0, 1);
1675 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
1676 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
1677 if (empty($reshook)) {
1678 $formconfirm .= $hookmanager->resPrint;
1679 } elseif ($reshook > 0) {
1680 $formconfirm = $hookmanager->resPrint;
1688 $linkback =
'<a href="'.DOL_URL_ROOT.
'/supplier_proposal/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
1691 $morehtmlref =
'<div class="refidno">';
1696 $morehtmlref .=
$object->thirdparty->getNomUrl(1,
'supplier');
1698 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/supplier_proposal/list.php?socid='.
$object->thirdparty->id.
'">'.$langs->trans(
"OtherProposals").
'</a>)';
1702 $langs->load(
"projects");
1703 $morehtmlref .=
'<br>';
1704 if ($usercancreate) {
1705 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
1706 if ($action !=
'classify') {
1707 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
1710 $canLinkAll = ($canLinkAll ===
'' || $canLinkAll ===
false) ? 0 : $canLinkAll;
1712 $projectSocId = ((int) $canLinkAll == 1) ? -1 : $currentSocId;
1713 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $projectSocId,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
1715 if (!empty(
$object->fk_project)) {
1717 $proj->fetch(
$object->fk_project);
1718 $morehtmlref .= $proj->getNomUrl(1);
1720 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
1725 $morehtmlref .=
'</div>';
1728 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1731 $parameters = array();
1733 $reshook = $hookmanager->executeHooks(
'tabContentViewSupplierProposal', $parameters, $object, $action);
1734 if (empty($reshook)) {
1735 print
'<div class="fichecenter">';
1736 print
'<div class="fichehalfleft">';
1737 print
'<div class="underbanner clearboth"></div>';
1739 print
'<table class="border tableforfield centpercent">';
1743 $filterabsolutediscount =
"fk_invoice_supplier_source IS NULL";
1744 $filtercreditnote =
"fk_invoice_supplier_source IS NOT NULL";
1746 $filterabsolutediscount =
"fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')";
1747 $filtercreditnote =
"fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')";
1750 print
'<tr><td class="titlefield">'.$langs->trans(
'Discounts').
'</td><td>';
1752 $absolute_discount = $soc->getAvailableDiscounts(
null, $filterabsolutediscount, 0, 1);
1753 $absolute_creditnote = $soc->getAvailableDiscounts(
null, $filtercreditnote, 0, 1);
1754 $absolute_discount =
price2num($absolute_discount,
'MT');
1755 $absolute_creditnote =
price2num($absolute_creditnote,
'MT');
1759 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
1760 include DOL_DOCUMENT_ROOT.
'/core/tpl/object_discounts.tpl.php';
1765 print
'<tr><td class="titlefield">';
1766 print
'<table class="nobordernopadding" width="100%"><tr><td>';
1767 print $langs->trans(
'PaymentConditionsShort');
1770 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editconditions&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetConditions'), 1).
'</a></td>';
1772 print
'</tr></table>';
1773 print
'</td><td class="valuefield">';
1774 if ($action ==
'editconditions') {
1775 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
string)
$object->cond_reglement_id,
'cond_reglement_id', 1,
'', 1,
$object->deposit_percent);
1777 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
string)
$object->cond_reglement_id,
'none', 1,
'', 1,
$object->deposit_percent);
1784 print
'<table class="nobordernopadding" width="100%"><tr><td>';
1785 print $langs->trans(
'DeliveryDate');
1788 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editdate_livraison&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetDeliveryDate'), 1).
'</a></td>';
1790 print
'</tr></table>';
1791 print
'</td><td class="valuefield">';
1792 if ($action ==
'editdate_livraison') {
1793 print
'<form name="editdate_livraison" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post" class="formconsumeproduce">';
1794 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1795 print
'<input type="hidden" name="action" value="setdate_livraison">';
1796 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1797 print $form->selectDate(
$object->delivery_date,
'liv_', 0, 0, 0,
"editdate_livraison");
1798 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
1809 print
'<table class="nobordernopadding" width="100%"><tr><td>';
1810 print $langs->trans(
'PaymentMode');
1813 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editmode&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetMode'), 1).
'</a></td>';
1815 print
'</tr></table>';
1816 print
'</td><td class="valuefield">';
1817 if ($action ==
'editmode') {
1818 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
string)
$object->mode_reglement_id,
'mode_reglement_id',
'DBIT', 1, 1);
1820 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
string)
$object->mode_reglement_id,
'none');
1840 print
'<table width="100%" class="nobordernopadding"><tr><td>';
1841 print $langs->trans(
'BankAccount');
1843 if ($action !=
'editbankaccount' && $usercancreate) {
1844 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editbankaccount&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->trans(
'SetBankAccount'), 1).
'</a></td>';
1846 print
'</tr></table>';
1847 print
'</td><td class="valuefield">';
1848 if ($action ==
'editbankaccount') {
1849 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
string)
$object->fk_account,
'fk_account', 1);
1851 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
string)
$object->fk_account,
'none');
1859 print
'<table class="nobordernopadding centpercent"><tr><td>';
1860 print $langs->trans(
"Categories");
1861 print
'<td><td class="right">';
1862 if ($usercancreate) {
1863 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/supplier_proposal/card.php?id='.
$object->id.
'&action=edittags&token='.
newToken().
'">'.
img_edit().
'</a>';
1867 print
'</td></tr></table>';
1870 if ($action ==
'edittags') {
1871 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
1872 print
'<input type="hidden" name="action" value="settags">';
1873 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1874 print $form->selectCategories(Categorie::TYPE_SUPPLIER_PROPOSAL,
'categories', $object);
1875 print
'<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
1878 print $form->showCategories(
$object->id, Categorie::TYPE_SUPPLIER_PROPOSAL, 1);
1883 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1888 print
'<div class="fichehalfright">';
1889 print
'<div class="underbanner clearboth"></div>';
1891 print
'<table class="border tableforfield centpercent">';
1893 include DOL_DOCUMENT_ROOT.
'/core/tpl/object_currency_amount.tpl.php';
1897 print
'<td class="titlefieldmiddle">' . $langs->trans(
'AmountHT') .
'</td>';
1898 print
'<td class="nowrap amountcard right">' .
price(
$object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) .
'</td>';
1901 print
'<td class="nowrap amountcard right">' .
price(
$object->multicurrency_total_ht, 0, $langs, 0, -1, -1,
$object->multicurrency_code) .
'</td>';
1907 print
'<td class="titlefieldmiddle">' . $langs->trans(
'AmountVAT') .
'</td>';
1908 print
'<td class="nowrap amountcard right">' .
price(
$object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) .
'</td>';
1911 print
'<td class="nowrap amountcard right">' .
price(
$object->multicurrency_total_tva, 0, $langs, 0, -1, -1,
$object->multicurrency_code) .
'</td>';
1916 if (
$mysoc->localtax1_assuj ==
"1" ||
$object->total_localtax1 != 0) {
1918 print
'<td class="titlefieldmiddle">' . $langs->transcountry(
"AmountLT1",
$mysoc->country_code) .
'</td>';
1919 print
'<td class="nowrap amountcard right">' .
price(
$object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) .
'</td>';
1921 print
'<td class="nowrap amountcard right">' .
price(
$object->total_localtax1, 0, $langs, 0, -1, -1,
$object->multicurrency_code) .
'</td>';
1925 if (
$mysoc->localtax2_assuj ==
"1" ||
$object->total_localtax2 != 0) {
1927 print
'<td>' . $langs->transcountry(
"AmountLT2",
$mysoc->country_code) .
'</td>';
1928 print
'<td class="nowrap amountcard right">' .
price(
$object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) .
'</td>';
1930 print
'<td class="nowrap amountcard right">' .
price(
$object->total_localtax2, 0, $langs, 0, -1, -1,
$object->multicurrency_code) .
'</td>';
1938 print
'<td>' . $langs->trans(
'AmountTTC') .
'</td>';
1939 print
'<td class="nowrap amountcard right">' .
price(
$object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) .
'</td>';
1942 print
'<td class="nowrap amountcard right">' .
price(
$object->multicurrency_total_ttc, 0, $langs, 0, -1, -1,
$object->multicurrency_code) .
'</td>';
1956 print
'<div class="clearboth"></div><br>';
1959 $blocname =
'contacts';
1960 $title = $langs->trans(
'ContactsAddresses');
1961 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_showhide.tpl.php';
1965 $blocname =
'notes';
1966 $title = $langs->trans(
'Notes');
1967 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_showhide.tpl.php';
1975 $result =
$object->getLinesArray();
1977 print
' <form name="addproduct" id="addproduct" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(($action !=
'editline') ?
'#add' :
'').
'" method="POST">
1978 <input type="hidden" name="token" value="' .
newToken().
'">
1979 <input type="hidden" name="action" value="' . (($action !=
'editline') ?
'addline' :
'updateline').
'">
1980 <input type="hidden" name="mode" value="">
1981 <input type="hidden" name="id" value="' .
$object->id.
'">
1986 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
1989 print
'<div class="div-table-responsive-no-min">';
1990 print
'<table id="tablelines" class="noborder noshadow centpercent">';
1993 global $forceall, $senderissupplier, $inputalsopricewithtax;
1996 $inputalsopricewithtax = 1;
1997 $senderissupplier = 2;
1998 if (
getDolGlobalInt(
'SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY')) {
1999 $senderissupplier =
getDolGlobalInt(
'SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY');
2003 $object->printObjectLines($action, $soc,
$mysoc, $lineid, $dateSelector);
2008 if ($action !=
'editline') {
2011 $parameters = array(
'dateSelector' => $dateSelector);
2012 $reshook = $hookmanager->executeHooks(
'formAddObjectLine', $parameters, $object, $action);
2016 if (empty($reshook)) {
2029 if ($action ==
'statut') {
2031 $form_close =
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="POST" id="formacceptrefuse" class="formconsumeproduce paddingbottom paddingleft paddingright">';
2032 $form_close .=
'<input type="hidden" name="token" value="'.newToken().
'">';
2033 $form_close .=
'<input type="hidden" name="action" value="setstatut">';
2036 $form_close .=
'<p class="notice">'.$langs->trans(
'SupplierProposalRefFournNotice').
'</p>';
2038 $form_close .=
'<table class="border centpercent marginleftonly marginrightonly">';
2039 $form_close .=
'<tr><td>'.$langs->trans(
"CloseAs").
'</td><td class="left">';
2040 $form_close .=
'<select id="statut" name="statut" class="flat">';
2041 $form_close .=
'<option value="0"> </option>';
2042 $form_close .=
'<option value="2">'.$langs->trans(
'SupplierProposalStatusSigned').
'</option>';
2043 $form_close .=
'<option value="3">'.$langs->trans(
'SupplierProposalStatusNotSigned').
'</option>';
2044 $form_close .=
'</select>';
2045 $form_close .=
'</td></tr>';
2046 $form_close .=
'<tr><td class="left">'.$langs->trans(
'Note').
'</td><td class="left"><textarea cols="70" rows="'.ROWS_3.
'" wrap="soft" name="note">';
2047 $form_close .=
$object->note_private;
2048 $form_close .=
'</textarea></td></tr>';
2049 $form_close .=
'</table>';
2050 $form_close .= $form->buttonsSaveCancel();
2051 $form_close .=
'<a id="acceptedrefused"> </a>';
2052 $form_close .=
'</form>';
2060 if ($action !=
'presend') {
2061 print
'<div class="tabsAction">';
2063 $parameters = array();
2064 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
2066 if (empty($reshook)) {
2067 if ($action !=
'statut' && $action !=
'editline') {
2070 if (count(
$object->lines) > 0) {
2071 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
'Validate').
'</a></div>';
2078 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=modif&token='.
newToken().
'">'.$langs->trans(
'Modify').
'</a></div>';
2083 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reopen&token='.
newToken().(!
getDolGlobalString(
'MAIN_JUMP_TAG') ?
'' :
'#reopen').
'"';
2084 print
'>'.$langs->trans(
'ReOpen').
'</a></div>';
2088 if (empty($user->socid)) {
2091 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'email',
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id,
'action' =>
'presend',
'mode' =>
'init'],
true).
'#formmailbeforetitle',
'');
2100 if ($usercancreateorder) {
2101 print
'<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/fourn/commande/card.php?action=create&origin='.
$object->element.
'&originid='.
$object->id.
'&socid='.
$object->socid.
'&token='.
newToken().
'">'.$langs->trans(
"AddSupplierOrderShort").
'</a></div>';
2107 print
'<div class="inline-block divButAction"><a class="butAction reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&token='.
newToken().
'&action=statut'.(!
getDolGlobalString(
'MAIN_JUMP_TAG') ?
'' :
'#acceptedrefused').
'"';
2108 print
'>'.$langs->trans(
'SetAcceptedRefused').
'</a></div>';
2113 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&token='.
newToken().
'&action=close'.(!
getDolGlobalString(
'MAIN_JUMP_TAG') ?
'' :
'#close').
'"';
2114 print
'>'.$langs->trans(
'Close').
'</a></div>';
2118 if ($usercancreate) {
2119 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&socid='.
$object->socid.
'&action=clone&object='.
$object->element.
'&token='.
newToken().
'">'.$langs->trans(
"ToClone").
'</a></div>';
2130 if ($action !=
'presend') {
2131 print
'<div class="fichecenter"><div class="fichehalfleft">';
2138 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
2139 $genallowed = $usercanread;
2140 $delallowed = $usercancreate;
2142 print $formfile->showdocuments(
'supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $soc->default_lang);
2146 $tmparray = $form->showLinkToObjectBlock($object, array(), array(
'supplier_proposal'), 1);
2147 $linktoelem = $tmparray[
'linktoelem'];
2148 $htmltoenteralink = $tmparray[
'htmltoenteralink'];
2149 print $htmltoenteralink;
2151 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
2155 print
'</div><div class="fichehalfright">';
2158 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
2160 $somethingshown = $formactions->showactions($object,
'supplier_proposal', $socid, 1,
'', $MAXEVENT);
2162 print
'</div></div>';
2166 if (
GETPOST(
'modelselected')) {
2167 $action =
'presend';
2171 $modelmail =
'supplier_proposal_send';
2172 $defaulttopic =
'SendAskRef';
2173 $diroutput = $conf->supplier_proposal->dir_output;
2174 $autocopy =
'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO';
2175 $trackid =
'spro'.$object->id;
2177 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Class to manage the table of subscription to notifications.
Class to manage predefined suppliers products.
Class to manage products or services.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage price ask supplier.
const STATUS_NOTSIGNED
Not signed quote, canceled.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
const STATUS_SIGNED
Signed quote.
const STATUS_CLOSE
Billed or closed/processed quote.
Class to manage supplier_proposal lines.
Class to manage translations.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolBuildUrl($url, $params=[], $addtoken=false)
Return path of url.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
Function that returns whether VAT must be recoverable collected VAT (e.g.: VAT NPR in France)
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
Function that return vat rate of a product line (according to seller, buyer and product vat rate) VAT...
get_localtax($vatrate, $local, $thirdparty_buyer=null, $thirdparty_seller=null, $vatnpr=0)
Return localtax rate for a particular VAT rate, when selling a product with vat $vatrate,...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
supplier_proposal_prepare_head($object)
Prepare array with list of tabs.