';
+ print '';
+ print '| '.$langs->trans('Ref').' | ';
+ print ''.$langs->trans('Description').' | ';
+ print ''.$langs->trans('VAT').' | ';
+ print ''.$langs->trans('PriceUHT').' | ';
+ print ''.$langs->trans('Qty').' | ';
+ print ''.$langs->trans('ReductionShort').' |
';
+
+ // Lignes
+ $resql = $db->query($sql);
+ if ($resql)
{
- $num = $db->num_rows($result);
+ $num = $db->num_rows($resql);
$i = 0;
$var=True;
while ($i < $num)
{
- $objp = $db->fetch_object($result);
+ $objp = $db->fetch_object($resql);
$var=!$var;
print '| ';
- if ($objp->info_bits == 2)
+ if (($objp->info_bits & 2) == 2)
{
- print img_object($langs->trans(''),'reduc').' '.$langs->trans("Discount");
+ print '';
+ print img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount");
+ print '';
}
else if ($objp->prodid)
{
print ''.img_object($langs->trans(''),'service').' '.$objp->ref.'';
print $objp->product?' - '.$objp->product:'';
- // Plage de dates
- $date_start=$objp->date_debut_prevue;
- if ($objp->date_debut_reel) $date_start=$objp->date_debut_reel;
- $date_end=$objp->date_fin_prevue;
- if ($objp->date_fin_reel) $date_end=$objp->date_fin_reel;
- print_date_range($date_start,$date_end);
+ // Plage de dates si contrat
+ if ($_GET['contratid'])
+ {
+ $date_start=$objp->date_debut_prevue;
+ if ($objp->date_debut_reel) $date_start=$objp->date_debut_reel;
+ $date_end=$objp->date_fin_prevue;
+ if ($objp->date_fin_reel) $date_end=$objp->date_fin_reel;
+ print_date_range($date_start,$date_end);
+ }
}
else
{
@@ -1406,9 +1312,11 @@ if ($_GET['action'] == 'create')
print ' | ';
print ''.$objp->tva_tx.'% | ';
print ''.price($objp->subprice).' | ';
- print ''.$objp->qty.' | ';
print '';
- print $objp->info_bits != 2 ? $objp->remise_percent.'%' : ' ';
+ print (($objp->info_bits & 2) != 2) ? $objp->qty : ' ';
+ print ' | ';
+ print '';
+ print (($objp->info_bits & 2) != 2) ? $objp->remise_percent.'%' : ' ';
print ' | ';
print '
';
$i++;
@@ -1508,9 +1416,21 @@ else
if ($_GET['action'] == 'payed' && $resteapayer > 0)
{
// Crée un tableau formulaire
+ // \todo Restreindre les choix en fonction d'une option globale
+ $helpescompte_avoir=$langs->trans("ConfirmClassifyPayedPartiallyAvoir").'
'.$langs->trans("Note").': '.$langs->trans("HelpEscompte");
+ $helpescompte_novat=$langs->trans("ConfirmClassifyPayedPartiallyNoVat").'
'.$langs->trans("Note").': '.$langs->trans("HelpEscompte");
+ $helpescompte_vat =$langs->trans("ConfirmClassifyPayedPartiallyVat"). '
'.$langs->trans("Note").': '.$langs->trans("HelpEscompte");
+ $reason_avoir=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountAvoir",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$helpescompte_avoir,1);
+ $reason_novat=$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountNoVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$helpescompte_novat,1);
+ $reason_vat =$html->textwithhelp($langs->transnoentities("ConfirmClassifyPayedPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$helpescompte_vat,1);
+ $reason_other=$langs->trans("ConfirmClassifyPayedPartiallyReasonOther");
+ $arrayreasons['discount_avoir']=$reason_avoir;
+ $arrayreasons['discount_novat']=$reason_novat;
+ $arrayreasons['discount_vat'] =$reason_vat;
+ $arrayreasons['discount_other']=$reason_other;
$formquestion=array(
'text' => $langs->trans("ConfirmClassifyPayedPartiallyQuestion"),
- array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => array('escompte' => $langs->trans("ConfirmClassifyPayedPartiallyReasonEscompte",$resteapayer,$langs->trans("Currency".$conf->monnaie)), 'other' => $langs->trans("ConfirmClassifyPayedPartiallyReasonOther"))),
+ array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons),
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '70')
);
// Paiement incomplet. On demande si motif = escompte ou autre
@@ -1640,7 +1560,7 @@ else
if ($fac->close_code == 'escompte')
{
print '| ';
- $html->textwithhelp($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
+ print $html->textwithhelp($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
print ' | '.price($fac->total_ttc - $totalpaye).' | '.$langs->trans('Currency'.$conf->monnaie).' |
';
}
print '| '.$langs->trans('RemainderToPay').' : | ';