Fix navigation/translation

This commit is contained in:
Laurent Destailleur 2018-04-06 20:22:20 +02:00
parent 0abcf5694c
commit ee870342ef
2 changed files with 12 additions and 11 deletions

View File

@ -32,7 +32,7 @@ $langs->load("bills");
$id=GETPOST("id",'int'); $id=GETPOST("id",'int');
$socid = GETPOST('id','int'); $socid = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
@ -122,14 +122,14 @@ if ($socid > 0)
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
if(! $isCustomer && ! $isSupplier) { if(! $isCustomer && ! $isSupplier) {
print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>'; print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>';
dol_fiche_end(); dol_fiche_end();
print '</form>'; print '</form>';
llxFooter(); llxFooter();
$db->close(); $db->close();
exit; exit;
@ -142,7 +142,7 @@ if ($socid > 0)
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>"; print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>";
} }
if($isSupplier) { if($isSupplier) {
// Supplier discount // Supplier discount
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
@ -159,11 +159,11 @@ if ($socid > 0)
if($isCustomer && ! $isSupplier) { if($isCustomer && ! $isSupplier) {
print '<input type="hidden" name="discount_type" value="0" />'; print '<input type="hidden" name="discount_type" value="0" />';
} }
if(! $isCustomer && $isSupplier) { if(! $isCustomer && $isSupplier) {
print '<input type="hidden" name="discount_type" value="1" />'; print '<input type="hidden" name="discount_type" value="1" />';
} }
print '<table class="border centpercent">'; print '<table class="border centpercent">';
if($isCustomer && $isSupplier) { if($isCustomer && $isSupplier) {
@ -218,7 +218,7 @@ if ($socid > 0)
$sql.= " AND rc.entity = " . $conf->entity; $sql.= " AND rc.entity = " . $conf->entity;
$sql.= " AND u.rowid = rc.fk_user_author"; $sql.= " AND u.rowid = rc.fk_user_author";
$sql.= " ORDER BY rc.datec DESC"; $sql.= " ORDER BY rc.datec DESC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -249,7 +249,7 @@ if ($socid > 0)
else else
{ {
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$db->free($resql); $db->free($resql);
print "</table>"; print "</table>";
} }
@ -277,7 +277,7 @@ if ($socid > 0)
$sql.= " AND rc.entity = " . $conf->entity; $sql.= " AND rc.entity = " . $conf->entity;
$sql.= " AND u.rowid = rc.fk_user_author"; $sql.= " AND u.rowid = rc.fk_user_author";
$sql.= " ORDER BY rc.datec DESC"; $sql.= " ORDER BY rc.datec DESC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -267,6 +267,7 @@ Prospect=Prospect
CustomerCard=Customer Card CustomerCard=Customer Card
Customer=Customer Customer=Customer
CustomerRelativeDiscount=Relative customer discount CustomerRelativeDiscount=Relative customer discount
SupplierRelativeDiscount=Relative supplier discount
CustomerRelativeDiscountShort=Relative discount CustomerRelativeDiscountShort=Relative discount
CustomerAbsoluteDiscountShort=Absolute discount CustomerAbsoluteDiscountShort=Absolute discount
CompanyHasRelativeDiscount=This customer has a default discount of <b>%s%%</b> CompanyHasRelativeDiscount=This customer has a default discount of <b>%s%%</b>