26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
31 $langs->loadLangs(array(
'orders',
'companies'));
38 $_socid = $user->socid;
46 if ($_POST[
"action"] ==
'setpricelevel')
50 $soc->set_price_level($_POST[
"price_level"], $user);
52 header(
"Location: multiprix.php?id=".$id);
63 $userstatic =
new User($db);
69 $objsoc->id = $_socid;
70 $objsoc->fetch($_socid, $to);
76 if ($objsoc->client == 1) $tabchoice =
'customer';
77 if ($objsoc->client == 2) $tabchoice =
'prospect';
79 print '<form method="POST" action="multiprix.php?id='.$objsoc->id.
'">';
80 print '<input type="hidden" name="token" value="'.newToken().
'">';
81 print '<input type="hidden" name="action" value="setpricelevel">';
85 print '<table class="border centpercent tableforfield">';
87 print
'<tr><td class="titlefieldcreate">';
88 print $langs->trans(
"PriceLevel").
'</td><td>'.$objsoc->price_level.
"</td></tr>";
91 print $langs->trans(
"NewValue").
'</td><td>';
92 print
'<select name="price_level" class="flat">';
93 for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
95 print
'<option value="'.$i.
'"';
96 if ($i == $objsoc->price_level)
99 $keyforlabel =
'PRODUIT_MULTIPRICES_LABEL'.$i;
100 if (!empty($conf->global->$keyforlabel)) print
' - '.$langs->trans($conf->global->$keyforlabel);
110 print
'<div align="center"><input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'"></div>';
121 $sql =
"SELECT rc.rowid,rc.price_level, rc.datec as dc, u.rowid as uid, u.login";
122 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe_prices as rc, ".MAIN_DB_PREFIX.
"user as u";
123 $sql .=
" WHERE rc.fk_soc =".$objsoc->id;
124 $sql .=
" AND u.rowid = rc.fk_user_author";
125 $sql .=
" ORDER BY rc.datec DESC";
127 $resql = $db->query($sql);
130 print
'<table class="noborder centpercent">';
132 print
'<tr class="liste_titre">';
133 print
'<td>'.$langs->trans(
"Date").
'</td>';
134 print
'<td>'.$langs->trans(
"PriceLevel").
'</td>';
135 print
'<td class="right">'.$langs->trans(
"User").
'</td>';
138 $num = $db->num_rows(
$resql);
142 $obj = $db->fetch_object(
$resql);
144 print
'<tr class="oddeven">';
145 print
'<td>'.dol_print_date($db->jdate($obj->dc),
"dayhour").
'</td>';
146 print
'<td>'.$obj->price_level.
' </td>';
147 $userstatic->id = $obj->uid;
148 $userstatic->lastname = $obj->login;
149 print
'<td class="right">'.$userstatic->getNomUrl(1).
'</td>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage Dolibarr users.
Class to manage third parties objects (customers, suppliers, prospects...)
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.