This commit is contained in:
Laurent Destailleur 2015-04-27 02:33:44 +02:00
parent 5b3b180c10
commit 4e04f75c66
3 changed files with 82 additions and 78 deletions

View File

@ -2947,16 +2947,7 @@ if ($action == 'create')
print '<br>'; print '<br>';
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, // $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote,
// $filtercreditnote, $resteapayer); // $filtercreditnote, $resteapayer);
$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We $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
// must
// allow
// credit
// not
// even
// if
// amount
// is
// higher
} }
} }
if (! $absolute_discount && ! $absolute_creditnote) { if (! $absolute_discount && ! $absolute_creditnote) {
@ -3044,14 +3035,17 @@ if ($action == 'create')
$sql .= ' ORDER BY p.datep, p.tms'; $sql .= ' ORDER BY p.datep, p.tms';
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result)
{
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
// if ($object->type != 2) // if ($object->type != 2)
// { // {
if ($num > 0) { if ($num > 0)
while ($i < $num) { {
while ($i < $num)
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
print '<tr ' . $bc [$var] . '><td>'; print '<tr ' . $bc [$var] . '><td>';
@ -3059,7 +3053,8 @@ if ($action == 'create')
print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>'; 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; $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>'; print '<td>' . $label . ' ' . $objp->num_paiement . '</td>';
if (! empty($conf->banque->enabled)) { if (! empty($conf->banque->enabled))
{
$bankaccountstatic->id = $objp->baid; $bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->ref; $bankaccountstatic->ref = $objp->ref;
$bankaccountstatic->label = $objp->ref; $bankaccountstatic->label = $objp->ref;
@ -3082,7 +3077,8 @@ if ($action == 'create')
dol_print_error($db); dol_print_error($db);
} }
if ($object->type != Facture::TYPE_CREDIT_NOTE) { if ($object->type != Facture::TYPE_CREDIT_NOTE)
{
// Total already paid // Total already paid
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" align="right">';
if ($object->type != Facture::TYPE_DEPOSIT) if ($object->type != Facture::TYPE_DEPOSIT)
@ -3101,11 +3097,13 @@ if ($action == 'create')
$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
$sql .= " WHERE fk_facture = " . $object->id; $sql .= " WHERE fk_facture = " . $object->id;
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql)
{
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$invoice = new Facture($db); $invoice = new Facture($db);
while ($i < $num) { while ($i < $num)
{
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$invoice->fetch($obj->fk_facture_source); $invoice->fetch($obj->fk_facture_source);
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" align="right">';
@ -3173,7 +3171,8 @@ if ($action == 'create')
print ' :</td>'; print ' :</td>';
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>' . price($resteapayeraffiche) . '</b></td>'; print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>' . price($resteapayeraffiche) . '</b></td>';
print '<td class="nowrap">&nbsp;</td></tr>'; print '<td class="nowrap">&nbsp;</td></tr>';
} else // Credit note }
else // Credit note
{ {
// Total already paid back // Total already paid back
print '<tr><td colspan="' . $nbcols . '" align="right">'; 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 '<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 '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($object->type != Facture::TYPE_CREDIT_NOTE) { if ($object->type != Facture::TYPE_CREDIT_NOTE)
{
if ($action == 'editconditions') { if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id'); $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else { } 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 '<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 '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($object->type != Facture::TYPE_CREDIT_NOTE) { if ($object->type != Facture::TYPE_CREDIT_NOTE)
{
if ($action == 'editpaymentterm') { if ($action == 'editpaymentterm') {
$form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm'); $form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm');
} else { } else {
@ -3294,67 +3295,67 @@ if ($action == 'create')
// Situations // Situations
if (! empty($conf->global->INVOICE_US_SITUATION)) if (! empty($conf->global->INVOICE_US_SITUATION))
{ {
if ($object->type == 5 && ($object->situation_counter > 1)) if ($object->type == 5 && ($object->situation_counter > 1))
{ {
$prevsits = $object->get_prev_sits(); $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 ' + ';
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 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 '<tr><td>';
print '<a href="' . $_SERVER['PHP_SELF'] . '?facid=' . $prevsits[$i]->id . '">'; print $langs->trans('SituationAmount');
print $langs->trans('SituationDeduction');
print ' '; print ' ';
print $prevsits[$i]->situation_counter;
print '</a></td>';
print $prevsits[0]->situation_counter;
for ($i = 1; $i < count($prevsits); $i++) {
print ' + ';
print $prevsits[$i]->situation_counter;
}
print ' + ';
print $object->situation_counter;
print '</td>';
print '<td align="right" colspan="2" nowrap>'; print '<td align="right" colspan="2" nowrap>';
print '- ' . price($prevsits[$i]->total_ht);
$prevsits_total_amount = 0;
foreach ($prevsits as $situation) {
$prevsits_total_amount += $situation->total_ht;
}
$prevsits_total_amount += $object->total_ht;
print price($prevsits_total_amount);
print '</td>'; print '</td>';
print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>'; 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 // Amount
print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; 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 '<td 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 '<tr><td>' . $langs->trans('AmountVAT') . '</td><td colspan="3" nowrap>' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
print '</tr>'; print '</tr>';
// Amount Local Taxes // Amount Local Taxes
if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) // Localtax1 if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; 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 if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) // Localtax2
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; 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 // Revenue stamp
@ -3367,7 +3368,7 @@ if ($action == 'create')
if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer) 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 '<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 '</tr></table>';
print '</td><td colspan="3" align="right">'; print '</td><td colspan="3">';
if ($action == 'editrevenuestamp') { if ($action == 'editrevenuestamp') {
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
@ -3383,11 +3384,11 @@ if ($action == 'create')
} }
// Total with tax // 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 // Statut
print '<tr><td>' . $langs->trans('Status') . '</td>'; 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 // Project
if (! empty($conf->projet->enabled)) { if (! empty($conf->projet->enabled)) {

View File

@ -102,7 +102,7 @@ else {
$coldisplay=0; } $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 <?php
@ -209,44 +209,44 @@ else {
$doleditor->Create(); $doleditor->Create();
?> ?>
</td> </td>
<?php if ($object->element == 'askpricesupplier') { ?> <?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 } ?> <?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'; 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); else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
?> ?>
</td> </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"]:''); ?>"> <input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>">
</td> </td>
<?php if (! empty($inputalsopricewithtax)) { ?> <?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"]:''); ?>"> <input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?$_POST["price_ttc"]:''); ?>">
</td> </td>
<?php } ?> <?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> </td>
<?php <?php
if($conf->global->PRODUCT_USE_UNITS) if($conf->global->PRODUCT_USE_UNITS)
{ {
print '<td align="left">'; print '<td class="nobottom" align="left">';
print $form->selectUnits($line->fk_unit, "units"); print $form->selectUnits($line->fk_unit, "units");
print '</td>'; 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 <?php
if ($this->situation_cycle_ref) { if ($this->situation_cycle_ref) {
$coldisplay++; $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)) if (! empty($usemargins))
{ {
?> ?>
<td align="right" class="margininfos"> <td class="nobottom" align="right" class="margininfos">
<!-- For predef product --> <!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select> <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)) 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++; $coldisplay++;
} }
if (! empty($conf->global->DISPLAY_MARK_RATES)) 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++; $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"> <input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
</td> </td>
<?php <?php

View File

@ -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 { tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td {
border-bottom: 0px !important; border-bottom: 0px !important;
} }
td.nobottom, td.nobottom {
border-bottom: 0px !important;
}
div.liste_titre .tagtd { div.liste_titre .tagtd {
vertical-align: middle; vertical-align: middle;
} }