diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index f1388530317..7898f543507 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -44,16 +44,16 @@ $langs->load("bills"); $action = GETPOST('action', 'alpha'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int'); if ($user->societe_id) $socid = $user->societe_id; $result = restrictedArea($user, 'societe', $socid, '&societe'); -/** - * *************************************************** - * Price by customer - * **************************************************** + +/* + * Actions */ + if ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->rights->produit->creer || $user->rights->service->creer)) { $update_child_soc = GETPOST('updatechildprice'); @@ -114,91 +114,92 @@ if ($action == 'update_customer_price_confirm' && ! $_POST ["cancel"] && ($user- $action = ''; } + /* * View */ $form = new Form($db); -$soc = new Societe($db); +$object = new Societe($db); -$result = $soc->fetch($socid); +$result = $object->fetch($socid); llxHeader("", $langs->trans("ThirdParty") . '-' . $langs->trans('PriceByCustomer')); if (! empty($conf->notification->enabled)) $langs->load("mails"); -$head = societe_prepare_head($soc); +$head = societe_prepare_head($object); dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), 0, 'company'); print ''; print ''; // Alias names (commercial, trademark or alias names) print '"; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; } -if ($soc->client) { +if ($object->client) { print ''; } -if ($soc->fournisseur) { +if ($object->fournisseur) { print ''; } if (! empty($conf->barcode->enabled)) { - print ''; + print ''; } print ""; // Zip / Town -print '"; -print '"; +print '"; +print '"; // Country -if ($soc->country) { +if ($object->country) { print ''; } // EMail print ''; // Web print ''; // Phone / Fax -print ''; -print ''; +print ''; +print ''; print '
' . $langs->trans("ThirdPartyName") . ''; -print $form->showrefnav($soc, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom'); +print $form->showrefnav($object, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom'); print '
'.$langs->trans('AliasNames').''; -print $soc->name_alias; +print $object->name_alias; print "
' . $langs->trans('Prefix') . '' . $soc->prefix_comm . '
' . $langs->trans('Prefix') . '' . $object->prefix_comm . '
'; print $langs->trans('CustomerCode') . ''; - print $soc->code_client; - if ($soc->check_codeclient() != 0) + print $object->code_client; + if ($object->check_codeclient() != 0) print ' (' . $langs->trans("WrongCustomerCode") . ')'; print '
'; print $langs->trans('SupplierCode') . ''; - print $soc->code_fournisseur; - if ($soc->check_codefournisseur() != 0) + print $object->code_fournisseur; + if ($object->check_codefournisseur() != 0) print ' (' . $langs->trans("WrongSupplierCode") . ')'; print '
' . $langs->trans('Gencod') . '' . $soc->barcode . '
' . $langs->trans('Gencod') . '' . $object->barcode . '
" . $langs->trans('Address') . ""; -dol_print_address($soc->address, 'gmap', 'thirdparty', $soc->id); +dol_print_address($object->address, 'gmap', 'thirdparty', $object->id); print "
' . $langs->trans('Zip') . '' . $soc->zip . "' . $langs->trans('Town') . '' . $soc->town . "
' . $langs->trans('Zip') . '' . $object->zip . "' . $langs->trans('Town') . '' . $object->town . "
' . $langs->trans('Country') . ''; - $img = picto_from_langcode($soc->country_code); + $img = picto_from_langcode($object->country_code); print($img ? $img . ' ' : ''); - print $soc->country; + print $object->country; print '
' . $langs->trans('EMail') . ''; -print dol_print_email($soc->email, 0, $soc->id, 'AC_EMAIL'); +print dol_print_email($object->email, 0, $object->id, 'AC_EMAIL'); print '
' . $langs->trans('Web') . ''; -print dol_print_url($soc->url); +print dol_print_url($object->url); print '
' . $langs->trans('Phone') . '' . dol_print_phone($soc->tel, $soc->country_code, 0, $soc->id, 'AC_TEL') . '' . $langs->trans('Fax') . '' . dol_print_phone($soc->fax, $soc->country_code, 0, $soc->id, 'AC_FAX') . '
' . $langs->trans('Phone') . '' . dol_print_phone($object->tel, $object->country_code, 0, $object->id, 'AC_TEL') . '' . $langs->trans('Fax') . '' . dol_print_phone($object->fax, $object->country_code, 0, $object->id, 'AC_FAX') . '
'; @@ -224,7 +225,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Build filter to diplay only concerned lines $filter = array ( - 't.fk_soc' => $soc->id + 't.fk_soc' => $object->id ); $search_soc = GETPOST('search_soc'); @@ -238,10 +239,10 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print_fiche_titre($langs->trans('PriceByCustomer')); - print '
'; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -316,7 +317,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { setEventMessage($prodcustprice->error, 'errors'); } - print ''; + print ''; print ''; print ''; print ''; @@ -456,7 +457,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print "\n" . '
' . "\n"; - print ''; + print ''; print "\n

\n"; } else { @@ -536,15 +537,15 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Action if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; @@ -568,7 +569,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n" . '
' . "\n"; if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } print "\n

\n"; }
' . $langs->trans('Product') . ''; - print 'id . '&prodid=' . $line->fk_product . '">'; + print 'id . '&prodid=' . $line->fk_product . '">'; print img_info(); print ''; print ' '; - print 'id . '&lineid=' . $line->id . '">'; + print 'id . '&lineid=' . $line->id . '">'; print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; print ' '; - print 'id . '&lineid=' . $line->id . '">'; + print 'id . '&lineid=' . $line->id . '">'; print img_delete('default', 'style="vertical-align: middle;"'); print ''; print '