mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Works on paypal module
Fix: add status
This commit is contained in:
parent
d562249fd2
commit
0b0d672c3a
|
|
@ -26,6 +26,9 @@ GrossAmount=Gross amount
|
|||
FeeAmount=Fee amount
|
||||
NetAmount=Net amount
|
||||
CustomerDetails=Customer details
|
||||
NewTransaction=New transaction
|
||||
OrderIsCreated=Order created
|
||||
InvoiceIsCreated=Invoice created
|
||||
|
||||
# Paypal transaction fields
|
||||
PAYERID=Payer ID
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ GrossAmount=Montant brut
|
|||
FeeAmount=Frais Paypal
|
||||
NetAmount=Montant net
|
||||
CustomerDetails=Détail du client
|
||||
NewTransaction=Nouveau paiement
|
||||
OrderIsCreated=Commande créée
|
||||
InvoiceIsCreated=Facture créée
|
||||
|
||||
# Paypal transaction fields
|
||||
PAYERID=ID du payeur
|
||||
|
|
|
|||
|
|
@ -180,6 +180,39 @@ function getLinkedObjects($transactionID)
|
|||
return $objectArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
* @param statut Id statut
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param url Object url
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($statut,$mode,$url)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$out='';
|
||||
|
||||
if ($url) $out.= '<a href="'.$url.'">';
|
||||
if ($mode == 0)
|
||||
{
|
||||
if ($statut==-1) $out.= $langs->trans('Undefined');
|
||||
if ($statut==0) $out.= $langs->trans('NewTransaction');
|
||||
if ($statut==1) $out.= $langs->trans('OrderIsCreated');
|
||||
if ($statut==2) $out.= $langs->trans('InvoiceIsCreated');
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut==-1) $out.= img_picto($langs->trans('Undefined'),'warning');
|
||||
if ($statut==0) $out.= img_picto($langs->trans('NewTransaction'),'statut0');
|
||||
if ($statut==1) $out.= img_picto($langs->trans('OrderIsCreated'),'statut3');
|
||||
if ($statut==2) $out.= img_picto($langs->trans('InvoiceIsCreated'),'statut4');
|
||||
}
|
||||
if ($url) $out.= '</a>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send redirect to paypal to browser
|
||||
*
|
||||
|
|
|
|||
|
|
@ -305,7 +305,19 @@ else
|
|||
$feeamount = $resArray["L_FEEAMT".$i];
|
||||
$netamount = $resArray["L_NETAMT".$i];
|
||||
$currency = $resArray["L_CURRENCYCODE".$i];
|
||||
$status = $resArray["L_STATUS".$i];
|
||||
|
||||
$status=-1; $url='';
|
||||
if ($resArray["L_STATUS".$i]=='Completed') $status=0;
|
||||
if (! empty($objects['order']))
|
||||
{
|
||||
$status=1;
|
||||
$url=$objects['order']->getNomUrl(0,'',0,1);
|
||||
}
|
||||
if (! empty($objects['invoice']))
|
||||
{
|
||||
$status=2;
|
||||
$url=$objects['invoice']->getNomUrl(0,'',0,1);
|
||||
}
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td><div id="'.$transactionID.'" class="paypal_link" style="font-weight:bold;cursor:pointer;">'.$transactionID.'</div></td>';
|
||||
|
|
@ -314,7 +326,7 @@ else
|
|||
print '<td align="right">'.$amount.' '.$currency.'</td>';
|
||||
print '<td align="right">'.$feeamount.' '.$currency.'</td>';
|
||||
print '<td align="right">'.$netamount.' '.$currency.'</td>';
|
||||
print '<td align="right">'.$status.'</td>';
|
||||
print '<td align="right">'.getLibStatut($status, 1, $url).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user