remove comment and move table
This commit is contained in:
parent
b01893d536
commit
f773317bf5
@ -3838,180 +3838,10 @@ else if ($id > 0 || ! empty($ref))
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Situations
|
||||
/*if (! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
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;
|
||||
$cprevsits = count($prevsits);
|
||||
|
||||
for ($i = 1; $i < $cprevsits; $i++) {
|
||||
print ' + ';
|
||||
print $prevsits[$i]->situation_counter;
|
||||
}
|
||||
print ' + ';
|
||||
print $object->situation_counter;
|
||||
|
||||
print '</td>';
|
||||
print '<td class="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, 0, $langs, 1, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency) );
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Previous situation(s) deduction(s)
|
||||
for ($i = 0; $i < $cprevsits; $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 class="nowrap">';
|
||||
print '- ' . price($prevsits[$i]->total_ht, 0, $langs, 1, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency) );
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
// List of previous situation invoices
|
||||
if (($object->situation_cycle_ref > 0) && ! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
|
||||
print '<table class="noborder situationstable" width="100%">';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('ListOfSituationInvoices') . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">' . $langs->trans('Situation') . '</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$total_prev_ht = $total_prev_ttc = 0;
|
||||
$total_global_ht = $total_global_ttc = 0;
|
||||
|
||||
if (count($object->tab_previous_situation_invoice) > 0) {
|
||||
// List of previous invoices
|
||||
|
||||
$current_situation_counter = array();
|
||||
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
|
||||
$totalpaye = $prev_invoice->getSommePaiement();
|
||||
$total_prev_ht += $prev_invoice->total_ht;
|
||||
$total_prev_ttc += $prev_invoice->total_ttc;
|
||||
$current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?-1:1) * $prev_invoice->situation_counter;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $prev_invoice->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $prev_invoice->situation_counter.'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($prev_invoice->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$total_global_ht += $total_prev_ht ;
|
||||
$total_global_ttc += $total_prev_ttc ;
|
||||
$total_global_ht += $object->total_ht;
|
||||
$total_global_ttc += $object->total_ttc;
|
||||
$current_situation_counter[] = (($object->type == Facture::TYPE_CREDIT_NOTE)?-1:1) * $object->situation_counter;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $object->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $object->situation_counter.'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($object->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($object->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $object->getLibStatut(3, $object->getSommePaiement()) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2" align="left"><b>' . $langs->trans('CurrentSituationTotal') . '</b></td>';
|
||||
print '<td>';
|
||||
$i =0;
|
||||
foreach ($current_situation_counter as $sit)
|
||||
{
|
||||
$curSign = $sit>0?'+':'-';
|
||||
$curType = $sit>0?$langs->trans('situationInvoiceShortcode_S'):$langs->trans('situationInvoiceShortcode_AS');
|
||||
if($i>0) print ' '.$curSign.' ';
|
||||
print $curType . abs($sit);
|
||||
$i++;
|
||||
}
|
||||
print '</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if (count($object->tab_next_situation_invoice) > 0) {
|
||||
// List of next invoices
|
||||
/*print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';*/
|
||||
|
||||
$total_next_ht = $total_next_ttc = 0;
|
||||
|
||||
foreach ($object->tab_next_situation_invoice as $next_invoice) {
|
||||
$totalpaye = $next_invoice->getSommePaiement();
|
||||
$total_next_ht += $next_invoice->total_ht;
|
||||
$total_next_ttc += $next_invoice->total_ttc;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $next_invoice->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $next_invoice->situation_counter.'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($next_invoice->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($next_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
|
||||
$total_global_ht += $total_next_ht;
|
||||
$total_global_ttc += $total_next_ttc;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="3" align="right"></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
@ -4170,88 +4000,129 @@ else if ($id > 0 || ! empty($ref))
|
||||
if (! empty($conf->incoterm->enabled))
|
||||
$nbrows += 1;
|
||||
|
||||
if ($object->type == Facture::TYPE_SITUATION && ! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
// List of previous situation invoices
|
||||
if (($object->situation_cycle_ref > 0) && ! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0)
|
||||
print '<table class="noborder situationstable" width="100%">';
|
||||
|
||||
if (count($object->tab_previous_situation_invoice) > 0) {
|
||||
// List of previous invoices
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('ListOfPreviousSituationInvoices') . '</td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$total_prev_ht = $total_prev_ttc = 0;
|
||||
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
|
||||
$totalpaye = $prev_invoice->getSommePaiement();
|
||||
$total_prev_ht += $prev_invoice->total_ht;
|
||||
$total_prev_ttc += $prev_invoice->total_ttc;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $prev_invoice->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($prev_invoice->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td></td>';
|
||||
print '<td align="right"><b>' . price($total_prev_ht) . '</b></td>';
|
||||
print '<td align="right"><b>' . price($total_prev_ttc) . '</b></td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (count($object->tab_next_situation_invoice) > 0) {
|
||||
// List of next invoices
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$total_next_ht = $total_next_ttc = 0;
|
||||
|
||||
foreach ($object->tab_next_situation_invoice as $next_invoice) {
|
||||
$totalpaye = $next_invoice->getSommePaiement();
|
||||
$total_next_ht += $next_invoice->total_ht;
|
||||
$total_next_ttc += $next_invoice->total_ttc;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $next_invoice->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($next_invoice->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($next_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2" align="right"></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
|
||||
print '<td align="right"><b>' . price($total_next_ht) . '</b></td>';
|
||||
print '<td align="right"><b>' . price($total_next_ttc) . '</b></td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0)
|
||||
print '</table>';
|
||||
|
||||
print '<table class="noborder situationstable" width="100%">';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('ListOfSituationInvoices') . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">' . $langs->trans('Situation') . '</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$total_prev_ht = $total_prev_ttc = 0;
|
||||
$total_global_ht = $total_global_ttc = 0;
|
||||
|
||||
if (count($object->tab_previous_situation_invoice) > 0) {
|
||||
// List of previous invoices
|
||||
|
||||
$current_situation_counter = array();
|
||||
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
|
||||
$totalpaye = $prev_invoice->getSommePaiement();
|
||||
$total_prev_ht += $prev_invoice->total_ht;
|
||||
$total_prev_ttc += $prev_invoice->total_ttc;
|
||||
$current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?-1:1) * $prev_invoice->situation_counter;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $prev_invoice->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $prev_invoice->situation_counter.'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($prev_invoice->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$total_global_ht += $total_prev_ht ;
|
||||
$total_global_ttc += $total_prev_ttc ;
|
||||
$total_global_ht += $object->total_ht;
|
||||
$total_global_ttc += $object->total_ttc;
|
||||
$current_situation_counter[] = (($object->type == Facture::TYPE_CREDIT_NOTE)?-1:1) * $object->situation_counter;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $object->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $object->situation_counter.'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($object->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($object->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $object->getLibStatut(3, $object->getSommePaiement()) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2" align="left"><b>' . $langs->trans('CurrentSituationTotal') . '</b></td>';
|
||||
print '<td>';
|
||||
$i =0;
|
||||
foreach ($current_situation_counter as $sit)
|
||||
{
|
||||
$curSign = $sit>0?'+':'-';
|
||||
$curType = $sit>0?$langs->trans('situationInvoiceShortcode_S'):$langs->trans('situationInvoiceShortcode_AS');
|
||||
if($i>0) print ' '.$curSign.' ';
|
||||
print $curType . abs($sit);
|
||||
$i++;
|
||||
}
|
||||
print '</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if (count($object->tab_next_situation_invoice) > 0) {
|
||||
// List of next invoices
|
||||
/*print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';*/
|
||||
|
||||
$total_next_ht = $total_next_ttc = 0;
|
||||
|
||||
foreach ($object->tab_next_situation_invoice as $next_invoice) {
|
||||
$totalpaye = $next_invoice->getSommePaiement();
|
||||
$total_next_ht += $next_invoice->total_ht;
|
||||
$total_next_ttc += $next_invoice->total_ttc;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $next_invoice->getNomUrl(1) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $next_invoice->situation_counter.'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right">' . price($next_invoice->total_ht) . '</td>';
|
||||
print '<td align="right">' . price($next_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
|
||||
$total_global_ht += $total_next_ht;
|
||||
$total_global_ttc += $total_next_ttc;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="3" align="right"></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>';
|
||||
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user