From 4e04f75c66b31c496b92c81c33d22116a2b35cb6 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Mon, 27 Apr 2015 02:33:44 +0200
Subject: [PATCH] Fix css

---
 htdocs/compta/facture.php                 | 125 +++++++++++-----------
 htdocs/core/tpl/objectline_create.tpl.php |  30 +++---
 htdocs/theme/eldy/style.css.php           |   3 +
 3 files changed, 81 insertions(+), 77 deletions(-)

diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index a78e64f675e..152dde9dee3 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2947,16 +2947,7 @@ if ($action == 'create')
 				print '<br>';
 				// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote,
 			// $filtercreditnote, $resteapayer);
-			$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We
-			                                                                                                                                                        // must
-			                                                                                                                                                        // allow
-			                                                                                                                                                        // credit
-			                                                                                                                                                        // not
-			                                                                                                                                                        // even
-			                                                                                                                                                        // if
-			                                                                                                                                                        // amount
-			                                                                                                                                                        // is
-			                                                                                                                                                        // higher
+			$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We allow credit note even if amount is higher
 		}
 	}
 	if (! $absolute_discount && ! $absolute_creditnote) {
@@ -3044,14 +3035,17 @@ if ($action == 'create')
 	$sql .= ' ORDER BY p.datep, p.tms';
 
 	$result = $db->query($sql);
-	if ($result) {
+	if ($result)
+	{
 		$num = $db->num_rows($result);
 		$i = 0;
 
 		// if ($object->type != 2)
 		// {
-		if ($num > 0) {
-			while ($i < $num) {
+		if ($num > 0)
+		{
+			while ($i < $num)
+			{
 				$objp = $db->fetch_object($result);
 				$var = ! $var;
 				print '<tr ' . $bc [$var] . '><td>';
@@ -3059,7 +3053,8 @@ if ($action == 'create')
 				print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>';
 				$label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label;
 				print '<td>' . $label . ' ' . $objp->num_paiement . '</td>';
-				if (! empty($conf->banque->enabled)) {
+				if (! empty($conf->banque->enabled))
+				{
 					$bankaccountstatic->id = $objp->baid;
 					$bankaccountstatic->ref = $objp->ref;
 					$bankaccountstatic->label = $objp->ref;
@@ -3082,7 +3077,8 @@ if ($action == 'create')
 		dol_print_error($db);
 	}
 
-	if ($object->type != Facture::TYPE_CREDIT_NOTE) {
+	if ($object->type != Facture::TYPE_CREDIT_NOTE)
+	{
 		// Total already paid
 		print '<tr><td colspan="' . $nbcols . '" align="right">';
 		if ($object->type != Facture::TYPE_DEPOSIT)
@@ -3101,11 +3097,13 @@ if ($action == 'create')
 		$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
 		$sql .= " WHERE fk_facture = " . $object->id;
 		$resql = $db->query($sql);
-		if ($resql) {
+		if ($resql)
+		{
 			$num = $db->num_rows($resql);
 			$i = 0;
 			$invoice = new Facture($db);
-			while ($i < $num) {
+			while ($i < $num)
+			{
 				$obj = $db->fetch_object($resql);
 				$invoice->fetch($obj->fk_facture_source);
 				print '<tr><td colspan="' . $nbcols . '" align="right">';
@@ -3173,7 +3171,8 @@ if ($action == 'create')
 		print ' :</td>';
 		print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>' . price($resteapayeraffiche) . '</b></td>';
 		print '<td class="nowrap">&nbsp;</td></tr>';
-	} else 	// Credit note
+	}
+	else 	// Credit note
 	{
 		// Total already paid back
 		print '<tr><td colspan="' . $nbcols . '" align="right">';
@@ -3219,7 +3218,8 @@ if ($action == 'create')
 		print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
 	print '</tr></table>';
 	print '</td><td colspan="3">';
-	if ($object->type != Facture::TYPE_CREDIT_NOTE) {
+	if ($object->type != Facture::TYPE_CREDIT_NOTE)
+	{
 		if ($action == 'editconditions') {
 			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id');
 		} else {
@@ -3239,7 +3239,8 @@ if ($action == 'create')
 		print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editpaymentterm&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
 	print '</tr></table>';
 	print '</td><td colspan="3">';
-	if ($object->type != Facture::TYPE_CREDIT_NOTE) {
+	if ($object->type != Facture::TYPE_CREDIT_NOTE)
+	{
 		if ($action == 'editpaymentterm') {
 			$form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm');
 		} else {
@@ -3294,67 +3295,67 @@ if ($action == 'create')
 	// Situations
 	if (! empty($conf->global->INVOICE_US_SITUATION))
 	{
-	if ($object->type == 5 && ($object->situation_counter > 1))
-	{
-		$prevsits = $object->get_prev_sits();
-		print '<tr><td>';
-		print $langs->trans('SituationAmount');
-		print ' ';
+		if ($object->type == 5 && ($object->situation_counter > 1))
+		{
+			$prevsits = $object->get_prev_sits();
+			print '<tr><td>';
+			print $langs->trans('SituationAmount');
+			print ' ';
 
-		print $prevsits[0]->situation_counter;
-		for ($i = 1; $i < count($prevsits); $i++) {
+			print $prevsits[0]->situation_counter;
+			for ($i = 1; $i < count($prevsits); $i++) {
+				print ' + ';
+				print $prevsits[$i]->situation_counter;
+			}
 			print ' + ';
-			print $prevsits[$i]->situation_counter;
-		}
-		print ' + ';
-		print $object->situation_counter;
-
-		print '</td>';
-		print '<td align="right" colspan="2" nowrap>';
-
-		$prevsits_total_amount = 0;
-		foreach ($prevsits as $situation) {
-			$prevsits_total_amount += $situation->total_ht;
-		}
-		$prevsits_total_amount += $object->total_ht;
+			print $object->situation_counter;
 
-		print price($prevsits_total_amount);
-		print '</td>';
-		print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
+			print '</td>';
+			print '<td align="right" colspan="2" nowrap>';
 
-		// Previous situation(s) deduction(s)
-		for ($i = 0; $i < count($prevsits); $i++) {
-			print '<tr><td>';
-			print '<a href="' . $_SERVER['PHP_SELF'] . '?facid=' . $prevsits[$i]->id . '">';
-			print $langs->trans('SituationDeduction');
-			print ' ';
-			print $prevsits[$i]->situation_counter;
-			print '</a></td>';
+			$prevsits_total_amount = 0;
+			foreach ($prevsits as $situation) {
+				$prevsits_total_amount += $situation->total_ht;
+			}
+			$prevsits_total_amount += $object->total_ht;
 
-			print '<td align="right" colspan="2" nowrap>';
-			print '- ' . price($prevsits[$i]->total_ht);
+			print price($prevsits_total_amount);
 			print '</td>';
 			print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
+
+			// Previous situation(s) deduction(s)
+			for ($i = 0; $i < count($prevsits); $i++) {
+				print '<tr><td>';
+				print '<a href="' . $_SERVER['PHP_SELF'] . '?facid=' . $prevsits[$i]->id . '">';
+				print $langs->trans('SituationDeduction');
+				print ' ';
+				print $prevsits[$i]->situation_counter;
+				print '</a></td>';
+
+				print '<td align="right" colspan="2" nowrap>';
+				print '- ' . price($prevsits[$i]->total_ht);
+				print '</td>';
+				print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
+			}
 		}
 	}
-	}
 
 	// Amount
 	print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
-	print '<td align="right" colspan="3" nowrap>' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
-	print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td align="right" colspan="3" nowrap>' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
+	print '<td colspan="3" nowrap>' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
+	print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td colspan="3" nowrap>' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
 	print '</tr>';
 
 	// Amount Local Taxes
 	if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) 	// Localtax1
 	{
 		print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
-		print '<td align="right" colspan="3" nowrap>' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
+		print '<td colspan="3" nowrap>' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
 	}
 	if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) 	// Localtax2
 	{
 		print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
-		print '<td align="right" colspan="3" nowrap>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
+		print '<td colspan="3" nowrap>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
 	}
 
 	// Revenue stamp
@@ -3367,7 +3368,7 @@ if ($action == 'create')
 		if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer)
 			print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>';
 		print '</tr></table>';
-		print '</td><td colspan="3" align="right">';
+		print '</td><td colspan="3">';
 		if ($action == 'editrevenuestamp') {
 			print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
 			print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
@@ -3383,11 +3384,11 @@ if ($action == 'create')
 	}
 
 	// Total with tax
-	print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td align="right" colspan="3" nowrap>' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
+	print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td colspan="3" class="nowrap">' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
 
 	// Statut
 	print '<tr><td>' . $langs->trans('Status') . '</td>';
-	print '<td align="left" colspan="3">' . ($object->getLibStatut(4, $totalpaye)) . '</td></tr>';
+	print '<td colspan="3">' . ($object->getLibStatut(4, $totalpaye)) . '</td></tr>';
 
 	// Project
 	if (! empty($conf->projet->enabled)) {
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 2bda2eb6b91..d92d5082389 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -102,7 +102,7 @@ else {
 	$coldisplay=0; }
 ?>
 
-	<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
+	<td class="nobottom"<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
 
 	<?php
 
@@ -209,44 +209,44 @@ else {
 	$doleditor->Create();
 	?>
 	</td>
-	
+
 	<?php if ($object->element == 'askpricesupplier') { ?>
-		<td align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="" size="12"></td>
+		<td class="nobottom" align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="" size="12"></td>
 	<?php } ?>
-	
-	<td align="right"><?php
+
+	<td class="nobottom" align="right"><?php
 	if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">0';
 	else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
 	?>
 	</td>
-	<td align="right">
+	<td class="nobottom" align="right">
 	<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>">
 	</td>
 	<?php if (! empty($inputalsopricewithtax)) { ?>
-	<td align="right">
+	<td class="nobottom" align="right">
 	<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?$_POST["price_ttc"]:''); ?>">
 	</td>
 	<?php } ?>
-	<td align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
+	<td class="nobottom" align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
 	</td>
 	<?php
 	if($conf->global->PRODUCT_USE_UNITS)
 	{
-		print '<td align="left">';
+		print '<td class="nobottom" align="left">';
 		print $form->selectUnits($line->fk_unit, "units");
 		print '</td>';
 	}
 	?>
-	<td align="right" class="nowrap"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
+	<td class="nobottom nowrap" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
 	<?php
 	if ($this->situation_cycle_ref) {
 		$coldisplay++;
-		print '<td align="right" class="nowrap"><input type="text" size="1" value="0" name="progress">%</td>';
+		print '<td class="nobottom nowrap" align="right"><input type="text" size="1" value="0" name="progress">%</td>';
 	}
 	if (! empty($usemargins))
 	{
 		?>
-		<td align="right" class="margininfos">
+		<td class="nobottom" align="right" class="margininfos">
 			<!-- For predef product -->
 			<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
 			<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select>
@@ -261,12 +261,12 @@ else {
 		{
 			if (! empty($conf->global->DISPLAY_MARGIN_RATES))
 			{
-				echo '<td align="right" class="nowrap margininfos"><input type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:'').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
+				echo '<td align="right" class="nobottom nowrap margininfos"><input type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:'').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
 				$coldisplay++;
 			}
 			if (! empty($conf->global->DISPLAY_MARK_RATES))
 			{
-				echo '<td align="right" class="nowrap margininfos"><input type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?$_POST["np_markRate"]:'').'"><span class="np_markRate hideonsmartphone">%</span></td>';
+				echo '<td align="right" class="nobottom nowrap margininfos"><input type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?$_POST["np_markRate"]:'').'"><span class="np_markRate hideonsmartphone">%</span></td>';
 				$coldisplay++;
 			}
 		}
@@ -277,7 +277,7 @@ else {
 		}
 	}
 	?>
-	<td align="center" valign="middle" colspan="<?php echo $colspan; ?>">
+	<td class="nobottom" align="center" valign="middle" colspan="<?php echo $colspan; ?>">
 		<input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
 	</td>
 	<?php
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 496aeef731f..b21c457a1d5 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -1960,6 +1960,9 @@ tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd {
 tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td {
     border-bottom: 0px !important;
 }
+td.nobottom, td.nobottom {
+    border-bottom: 0px !important;
+}
 div.liste_titre .tagtd {
 	vertical-align: middle;
 }
-- 
GitLab