';
$y = $year_current;
-for ($q = 1 ; $q <= 4 ; $q++ )
+
+$total = 0; $subtotal = 0;
+$i=0;
+$subtot_coll_total = 0;
+$subtot_coll_vat = 0;
+$subtot_paye_total = 0;
+$subtot_paye_vat = 0;
+
+$x_coll = vat_by_quarter($db, $y, $q, $modetax, 'sell');
+$x_paye = vat_by_quarter($db, $y, $q, $modetax, 'buy');
+
+if (! is_array($x_coll) || ! is_array($x_paye))
{
- $total = 0; $subtotal = 0;
- $i=0;
- $subtot_coll_total = 0;
- $subtot_coll_vat = 0;
- $subtot_paye_total = 0;
- $subtot_paye_vat = 0;
-
- $x_coll = vat_by_quarter($db, $y, $q, $modetax, 'sell');
- $x_paye = vat_by_quarter($db, $y, $q, $modetax, 'buy');
-
- if (! is_array($x_coll) || ! is_array($x_paye))
- {
- print '| '.$langs->trans("FeatureNotYetAvailable").' |
';
- //print '| '.$langs->trans("FeatureIsSupportedInInOutModeOnly").' |
';
- break;
- }
-
- $x_both = array();
- //now, from these two arrays, get another array with one rate per line
- foreach(array_keys($x_coll) as $my_coll_rate)
- {
- $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
- $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
- $x_both[$my_coll_rate]['paye']['totalht'] = 0;
- $x_both[$my_coll_rate]['paye']['vat'] = 0;
- $x_both[$my_coll_rate]['coll']['links'] = '';
- $x_both[$my_coll_rate]['coll']['detail'] = array();
- foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy)
- {
- $invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id];
- $invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id];
- $x_both[$my_coll_rate]['coll']['detail'][] = array(
- 'id' =>$x_coll[$my_coll_rate]['facid'][$id],
- 'descr' =>$x_coll[$my_coll_rate]['descr'][$id],
- 'pid' =>$x_coll[$my_coll_rate]['pid'][$id],
- 'pref' =>$x_coll[$my_coll_rate]['pref'][$id],
- 'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id],
- 'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id],
- 'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id],
- 'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id],
- 'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id],
- 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id],
- 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id],
- 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id],
- 'link' =>$invoice_customer->getNomUrl(1));
- //$x_both[$my_coll_rate]['coll']['links'] .= '..'.substr($x_coll[$my_coll_rate]['facnum'][$id],-2).' ';
- }
- }
- // tva payed
- foreach(array_keys($x_paye) as $my_paye_rate){
- $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht'];
- $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat'];
- if(!isset($x_both[$my_paye_rate]['coll']['totalht'])){
- $x_both[$my_paye_rate]['coll']['totalht'] = 0;
- $x_both[$my_paye_rate]['coll']['vat'] = 0;
- }
- $x_both[$my_paye_rate]['paye']['links'] = '';
- $x_both[$my_paye_rate]['paye']['detail'] = array();
+ print '| '.$langs->trans("FeatureNotYetAvailable").' |
';
+ //print '| '.$langs->trans("FeatureIsSupportedInInOutModeOnly").' |
';
+ break;
+}
- foreach($x_paye[$my_paye_rate]['facid'] as $id=>$dummy)
- {
- $invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id];
- $invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id];
- $x_both[$my_paye_rate]['paye']['detail'][] = array(
- 'id' =>$x_paye[$my_paye_rate]['facid'][$id],
- 'descr' =>$x_paye[$my_paye_rate]['descr'][$id],
- 'pid' =>$x_paye[$my_paye_rate]['pid'][$id],
- 'pref' =>$x_paye[$my_paye_rate]['pref'][$id],
- 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id],
- 'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id],
- 'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id],
- 'ftotal_ttc'=>$x_paye[$my_paye_rate]['ftotal_ttc'][$id],
- 'dtotal_ttc'=>$x_paye[$my_paye_rate]['dtotal_ttc'][$id],
- 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id],
- 'totalht' =>$x_paye[$my_paye_rate]['totalht_list'][$id],
- 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
- 'link' =>$invoice_supplier->getNomUrl(1));
- //$x_both[$my_paye_rate]['paye']['links'] .= '..'.substr($x_paye[$my_paye_rate]['facnum'][$id],-2).' ';
- }
- }
- //now we have an array (x_both) indexed by rates for coll and paye
-
- //print table headers for this quadri - incomes first
- //imprime les en-tete de tables pour ce quadri - d'abord les revenus
-
- $x_coll_sum = 0;
- $x_coll_ht = 0;
- $x_paye_sum = 0;
- $x_paye_ht = 0;
-
- $span=3;
- if ($modetax == 0) $span+=2;
-
- print '| '.$langs->trans("Quadri")." $q (".strftime("%b %Y",dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$y)).' - '.strftime("%b %Y",dolibarr_mktime(12,0,0,($q*3),1,$y)).') |
';
-
- print '';
- print '| '.$elementcust.' | ';
- print ''.$productcust.' | ';
- if ($modetax == 0)
+$x_both = array();
+//now, from these two arrays, get another array with one rate per line
+foreach(array_keys($x_coll) as $my_coll_rate)
+{
+ $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
+ $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
+ $x_both[$my_coll_rate]['paye']['totalht'] = 0;
+ $x_both[$my_coll_rate]['paye']['vat'] = 0;
+ $x_both[$my_coll_rate]['coll']['links'] = '';
+ $x_both[$my_coll_rate]['coll']['detail'] = array();
+ foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy)
{
- print ''.$amountcust.' | ';
- print ''.$langs->trans("Payment").' (% of invoice) | ';
+ $invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id];
+ $invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id];
+ $x_both[$my_coll_rate]['coll']['detail'][] = array(
+ 'id' =>$x_coll[$my_coll_rate]['facid'][$id],
+ 'descr' =>$x_coll[$my_coll_rate]['descr'][$id],
+ 'pid' =>$x_coll[$my_coll_rate]['pid'][$id],
+ 'pref' =>$x_coll[$my_coll_rate]['pref'][$id],
+ 'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id],
+ 'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id],
+ 'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id],
+ 'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id],
+ 'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id],
+ 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id],
+ 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id],
+ 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id],
+ 'link' =>$invoice_customer->getNomUrl(1));
+ //$x_both[$my_coll_rate]['coll']['links'] .= '..'.substr($x_coll[$my_coll_rate]['facnum'][$id],-2).' ';
}
- print ''.$langs->trans("AmountHTVATRealReceived").' | ';
- print ''.$vatcust.' | ';
- print '
';
- $var=true;
- foreach(array_keys($x_coll) as $rate)
+}
+// tva payed
+foreach(array_keys($x_paye) as $my_paye_rate){
+ $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht'];
+ $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat'];
+ if(!isset($x_both[$my_paye_rate]['coll']['totalht'])){
+ $x_both[$my_paye_rate]['coll']['totalht'] = 0;
+ $x_both[$my_paye_rate]['coll']['vat'] = 0;
+ }
+ $x_both[$my_paye_rate]['paye']['links'] = '';
+ $x_both[$my_paye_rate]['paye']['detail'] = array();
+
+ foreach($x_paye[$my_paye_rate]['facid'] as $id=>$dummy)
{
- if (is_array($x_both[$rate]['coll']['detail']))
+ $invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id];
+ $invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id];
+ $x_both[$my_paye_rate]['paye']['detail'][] = array(
+ 'id' =>$x_paye[$my_paye_rate]['facid'][$id],
+ 'descr' =>$x_paye[$my_paye_rate]['descr'][$id],
+ 'pid' =>$x_paye[$my_paye_rate]['pid'][$id],
+ 'pref' =>$x_paye[$my_paye_rate]['pref'][$id],
+ 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id],
+ 'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id],
+ 'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id],
+ 'ftotal_ttc'=>$x_paye[$my_paye_rate]['ftotal_ttc'][$id],
+ 'dtotal_ttc'=>$x_paye[$my_paye_rate]['dtotal_ttc'][$id],
+ 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id],
+ 'totalht' =>$x_paye[$my_paye_rate]['totalht_list'][$id],
+ 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
+ 'link' =>$invoice_supplier->getNomUrl(1));
+ //$x_both[$my_paye_rate]['paye']['links'] .= '..'.substr($x_paye[$my_paye_rate]['facnum'][$id],-2).' ';
+ }
+}
+//now we have an array (x_both) indexed by rates for coll and paye
+
+
+//print table headers for this quadri - incomes first
+
+$x_coll_sum = 0;
+$x_coll_ht = 0;
+$x_paye_sum = 0;
+$x_paye_ht = 0;
+
+$span=3;
+if ($modetax == 0) $span+=2;
+
+//print '| '..') |
';
+
+print '';
+print '| '.$elementcust.' | ';
+print ''.$productcust.' | ';
+if ($modetax == 0)
+{
+ print ''.$amountcust.' | ';
+ print ''.$langs->trans("Payment").' (% of invoice) | ';
+}
+print ''.$langs->trans("AmountHTVATRealReceived").' | ';
+print ''.$vatcust.' | ';
+print '
';
+foreach(array_keys($x_coll) as $rate)
+{
+ if (is_array($x_both[$rate]['coll']['detail']))
+ {
+ $var=true;
+ print "";
+ print '| '.$langs->trans("Rate").': '.vatrate($rate).'% | | ';
+ print '
'."\n";
+ foreach($x_both[$rate]['coll']['detail'] as $index => $fields)
{
- print "";
- print '| '.$langs->trans("Rate").': '.vatrate($rate).'% | | ';
- print '
'."\n";
- foreach($x_both[$rate]['coll']['detail'] as $index => $fields)
+ $var=!$var;
+ print '';
+ print '| '.$fields['link'].' | ';
+ print '';
+ if ($fields['pid'])
{
- $var=!$var;
- print ' |
';
- print '| '.$fields['link'].' | ';
- print '';
- if ($fields['pid'])
- {
- $product_static->id=$fields['pid'];
- $product_static->ref=$fields['pref'];
- $product_static->fk_product_type=$fields['ptype'];
- print $product_static->getNomUrl(1);
- if ($fields['descr']) print ' - ';
- }
- else
- {
- if ($fields['dtype']==1) $text = img_object($langs->trans('Service'),'service');
- else $text = img_object($langs->trans('Product'),'product');
- print $text.' ';
- }
- print dolibarr_trunc($fields['descr'],24).' | ';
- // Amount line
- if ($modetax == 0)
- {
- print '';
- print price($fields['totalht']);
- if ($fields['ftotal_ttc'])
- {
- //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
- $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
- //print ' ('.round($ratiolineinvoice*100,2).'%)';
- }
- print ' | ';
- }
- // Payment
- $ratiopaymentinvoice=1;
- if ($modetax == 0)
- {
- if ($fields['payment_amount'] && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
- print '';
- print $fields['payment_amount'];
- if ($fields['payment_amount'] && $ratiopaymentinvoice) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
- print ' | ';
- }
- print '';
- $temp_ht=$fields['totalht'];
- if ($ratiopaymentinvoice) $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
- print price(price2num($temp_ht,'MT'));
- print ' | ';
- // VAT
- print '';
- $temp_vat=$fields['vat']*$ratiopaymentinvoice;
- print price(price2num($temp_vat,'MT'));
- //print price($fields['vat']);
- print ' | ';
- print '
';
-
- $subtot_coll_total += $temp_ht;
- $subtot_coll_vat += $temp_vat;
- $x_coll_sum += $temp_vat;
+ $product_static->id=$fields['pid'];
+ $product_static->ref=$fields['pref'];
+ $product_static->type=$fields['ptype'];
+ print $product_static->getNomUrl(1);
+ if ($fields['descr']) print ' - ';
}
+ else
+ {
+ if ($fields['dtype']==1) $text = img_object($langs->trans('Service'),'service');
+ else $text = img_object($langs->trans('Product'),'product');
+ print $text.' ';
+ }
+ print dolibarr_trunc($fields['descr'],24).'';
+ // Amount line
+ if ($modetax == 0)
+ {
+ print '';
+ print price($fields['totalht']);
+ if ($fields['ftotal_ttc'])
+ {
+ //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
+ $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
+ //print ' ('.round($ratiolineinvoice*100,2).'%)';
+ }
+ print ' | ';
+ }
+ // Payment
+ $ratiopaymentinvoice=1;
+ if ($modetax == 0)
+ {
+ if ($fields['payment_amount'] && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
+ print '';
+ if ($fields['payment_amount'] && $fields['ftotal_ttc'])
+ {
+ $payment_static->rowid=$fields['payment_id'];
+ print $payment_static->getNomUrl(2);
+ }
+ print $fields['payment_amount'];
+ if ($fields['payment_amount'] && $ratiopaymentinvoice) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
+ print ' | ';
+ }
+ print '';
+ $temp_ht=$fields['totalht'];
+ if ($ratiopaymentinvoice) $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
+ print price(price2num($temp_ht,'MT'));
+ print ' | ';
+ // VAT
+ print '';
+ $temp_vat=$fields['vat']*$ratiopaymentinvoice;
+ print price(price2num($temp_vat,'MT'));
+ //print price($fields['vat']);
+ print ' | ';
+ print '';
+
+ $subtot_coll_total += $temp_ht;
+ $subtot_coll_vat += $temp_vat;
+ $x_coll_sum += $temp_vat;
}
}
-
print '';
print ' | ';
print ''.$langs->trans("Total").': | ';
@@ -315,95 +334,102 @@ for ($q = 1 ; $q <= 4 ; $q++ )
print ''.price(price2num($subtot_coll_total,'MT')).' | ';
print ''.price(price2num($subtot_coll_vat,'MT')).' | ';
print '
';
+}
-
- //print table headers for this quadri - expenses now
- //imprime les en-tete de tables pour ce quadri - maintenant les dépenses
- print '';
- print '| '.$elementsup.' | ';
- print ''.$productsup.' | ';
- if ($modetax == 0)
+
+print '
| |
';
+
+//print table headers for this quadri - expenses now
+//imprime les en-tete de tables pour ce quadri - maintenant les dépenses
+print '';
+print '| '.$elementsup.' | ';
+print ''.$productsup.' | ';
+if ($modetax == 0)
+{
+ print ''.$amountsup.' | ';
+ print ''.$langs->trans("Payment").' (% of invoice) | ';
+}
+print ''.$langs->trans("AmountHTVATRealPayed").' | ';
+print ''.$vatsup.' | ';
+print '
'."\n";
+foreach(array_keys($x_paye) as $rate)
+{
+ if(is_array($x_both[$rate]['paye']['detail']))
{
- print ''.$amountsup.' | ';
- print ''.$langs->trans("Payment").' (% of invoice) | ';
- }
- print ''.$langs->trans("AmountHTVATRealPayed").' | ';
- print ''.$vatsup.' | ';
- print ''."\n";
- $var=true;
- foreach(array_keys($x_paye) as $rate)
- {
- if(is_array($x_both[$rate]['paye']['detail']))
+ $var=true;
+ print "";
+ print '| '.$langs->trans("Rate").': '.vatrate($rate).'% | | ';
+ print '
'."\n";
+ foreach($x_both[$rate]['paye']['detail'] as $index=>$fields)
{
- print "";
- print '| '.$langs->trans("Rate").': '.vatrate($rate).'% | | ';
- print '
'."\n";
- foreach($x_both[$rate]['paye']['detail'] as $index=>$fields)
+ $var=!$var;
+ print '';
+ print '| '.$fields['link'].' | ';
+ print '';
+ if ($fields['pid'])
{
- $var=!$var;
- print ' |
';
- print '| '.$fields['link'].' | ';
- print '';
- if ($fields['pid'])
- {
- $product_static->id=$fields['pid'];
- $product_static->ref=$fields['pref'];
- $product_static->fk_product_type=$fields['ptype'];
- print $product_static->getNomUrl(1);
- if ($fields['descr']) print ' - ';
- }
- else
- {
- if ($fields['dtype']==1) $text = img_object($langs->trans('Service'),'service');
- else $text = img_object($langs->trans('Product'),'product');
- print $text.' ';
- }
- print dolibarr_trunc($fields['descr'],24).' | ';
- // Amount line
- if ($modetax == 0)
- {
- print '';
- print price($fields['totalht']);
- if ($fields['ftotal_ttc'])
- {
- //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
- $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
- //print ' ('.round($ratiolineinvoice*100,2).'%)';
- }
- print ' | ';
- }
- // Payment
- $ratiopaymentinvoice=1;
- if ($modetax == 0)
- {
- if ($fields['payment_amount'] && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
- print '';
- print $fields['payment_amount'];
- if ($fields['payment_amount'] && $ratiopaymentinvoice) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
- print ' | ';
- }
- print '';
- $temp_ht=$fields['totalht'];
- if ($ratiopaymentinvoice) $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
- print price(price2num($temp_ht,'MT'));
- print ' | ';
- // VAT
- print '';
- $temp_vat=$fields['vat']*$ratiopaymentinvoice;
- print price(price2num($temp_vat,'MT'));
- //print price($fields['vat']);
- print ' | ';
- print '
';
-
- $subtot_paye_total += $temp_ht;
- $subtot_paye_vat += $temp_vat;
- $x_paye_sum += $temp_vat;
+ $product_static->id=$fields['pid'];
+ $product_static->ref=$fields['pref'];
+ $product_static->type=$fields['ptype'];
+ print $product_static->getNomUrl(1);
+ if ($fields['descr']) print ' - ';
}
+ else
+ {
+ if ($fields['dtype']==1) $text = img_object($langs->trans('Service'),'service');
+ else $text = img_object($langs->trans('Product'),'product');
+ print $text.' ';
+ }
+ print dolibarr_trunc($fields['descr'],24).'';
+ // Amount line
+ if ($modetax == 0)
+ {
+ print '';
+ print price($fields['totalht']);
+ if ($fields['ftotal_ttc'])
+ {
+ //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
+ $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
+ //print ' ('.round($ratiolineinvoice*100,2).'%)';
+ }
+ print ' | ';
+ }
+ // Payment
+ $ratiopaymentinvoice=1;
+ if ($modetax == 0)
+ {
+ if ($fields['payment_amount'] && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
+ print '';
+ if ($fields['payment_amount'] && $fields['ftotal_ttc'])
+ {
+ $paymentfourn_static->rowid=$fields['payment_id'];
+ print $paymentfourn_static->getNomUrl(2);
+ }
+ print $fields['payment_amount'];
+ if ($fields['payment_amount'] && $ratiopaymentinvoice) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
+ print ' | ';
+ }
+ print '';
+ $temp_ht=$fields['totalht'];
+ if ($ratiopaymentinvoice) $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
+ print price(price2num($temp_ht,'MT'));
+ print ' | ';
+ // VAT
+ print '';
+ $temp_vat=$fields['vat']*$ratiopaymentinvoice;
+ print price(price2num($temp_vat,'MT'));
+ //print price($fields['vat']);
+ print ' | ';
+ print '';
+
+ $subtot_paye_total += $temp_ht;
+ $subtot_paye_vat += $temp_vat;
+ $x_paye_sum += $temp_vat;
}
- }
-
+ }
+
print '';
- print ' | ';
+ print ' | ';
print ''.$langs->trans("Total").': | ';
if ($modetax == 0)
{
@@ -413,23 +439,23 @@ for ($q = 1 ; $q <= 4 ; $q++ )
print ''.price(price2num($subtot_paye_total,'MT')).' | ';
print ''.price(price2num($subtot_paye_vat,'MT')).' | ';
print '
';
+}
- print '';
- print ' | '.$langs->trans("TotalToPay").', '.$langs->trans("Quadri").$q.' | ';
- print '
'."\n";
+print '';
+print ' | '.$langs->trans("TotalToPay").', '.$langs->trans("Quadri").$q.' | ';
+print '
'."\n";
- $diff = $x_coll_sum - $x_paye_sum;
- //$total = $total + $diff;
- //$subtotal = $subtotal + $diff;
- print "";
- print ' | ';
- print ''.price(price2num($diff,'MT'))." | \n";
- print "
\n";
+$diff = $x_coll_sum - $x_paye_sum;
+//$total = $total + $diff;
+//$subtotal = $subtotal + $diff;
+print "";
+print ' | ';
+print ''.price(price2num($diff,'MT'))." | \n";
+print "
\n";
- print '| |
'."\n";
+print '| |
'."\n";
- $i++;
-}
+$i++;
echo '
';
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index 68d1b7d4e8e..7734f4c92d1 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -404,7 +404,7 @@ class Facture extends CommonObject
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
- $result.=$lien.$this->ref.$lienfin;
+ if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
return $result;
}
diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php
index c05ba69f444..672f8e7ac32 100644
--- a/htdocs/fourn/facture/paiementfourn.class.php
+++ b/htdocs/fourn/facture/paiementfourn.class.php
@@ -16,17 +16,14 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- * $Source$
*/
/**
\file htdocs/fourn/facture/paiementfourn.class.php
\ingroup fournisseur, facture
- \brief Page de cr�ation de paiement factures fournisseurs
- \remarks Cette classe est presque identique � paiement.class.php
- \version $Revision$
+ \brief Classe paiement fournisseur
+ \remarks Cette classe est presque identique a paiement.class.php
+ \version $Id$
*/
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/account.class.php');
@@ -455,5 +452,27 @@ class PaiementFourn
}
return $langs->trans('Unknown');
}
+
+
+ /**
+ * \brief Renvoie nom clicable (avec eventuellement le picto)
+ * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
+ * \param option Sur quoi pointe le lien
+ * \return string Chaine avec URL
+ */
+ function getNomUrl($withpicto=0,$option='')
+ {
+ global $langs;
+
+ $result='';
+
+ $lien = '