Skip to content
Snippets Groups Projects
Commit 0b0d672c authored by Regis Houssin's avatar Regis Houssin
Browse files

Works on paypal module

Fix: add status
parent d562249f
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,9 @@ GrossAmount=Gross amount ...@@ -26,6 +26,9 @@ GrossAmount=Gross amount
FeeAmount=Fee amount FeeAmount=Fee amount
NetAmount=Net amount NetAmount=Net amount
CustomerDetails=Customer details CustomerDetails=Customer details
NewTransaction=New transaction
OrderIsCreated=Order created
InvoiceIsCreated=Invoice created
# Paypal transaction fields # Paypal transaction fields
PAYERID=Payer ID PAYERID=Payer ID
......
...@@ -26,6 +26,9 @@ GrossAmount=Montant brut ...@@ -26,6 +26,9 @@ GrossAmount=Montant brut
FeeAmount=Frais Paypal FeeAmount=Frais Paypal
NetAmount=Montant net NetAmount=Montant net
CustomerDetails=Détail du client CustomerDetails=Détail du client
NewTransaction=Nouveau paiement
OrderIsCreated=Commande créée
InvoiceIsCreated=Facture créée
# Paypal transaction fields # Paypal transaction fields
PAYERID=ID du payeur PAYERID=ID du payeur
......
...@@ -180,6 +180,39 @@ function getLinkedObjects($transactionID) ...@@ -180,6 +180,39 @@ function getLinkedObjects($transactionID)
return $objectArray; 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 * Send redirect to paypal to browser
* *
......
...@@ -305,7 +305,19 @@ else ...@@ -305,7 +305,19 @@ else
$feeamount = $resArray["L_FEEAMT".$i]; $feeamount = $resArray["L_FEEAMT".$i];
$netamount = $resArray["L_NETAMT".$i]; $netamount = $resArray["L_NETAMT".$i];
$currency = $resArray["L_CURRENCYCODE".$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 '<tr '.$bc[$var].'>';
print '<td><div id="'.$transactionID.'" class="paypal_link" style="font-weight:bold;cursor:pointer;">'.$transactionID.'</div></td>'; print '<td><div id="'.$transactionID.'" class="paypal_link" style="font-weight:bold;cursor:pointer;">'.$transactionID.'</div></td>';
...@@ -314,7 +326,7 @@ else ...@@ -314,7 +326,7 @@ else
print '<td align="right">'.$amount.' '.$currency.'</td>'; print '<td align="right">'.$amount.' '.$currency.'</td>';
print '<td align="right">'.$feeamount.' '.$currency.'</td>'; print '<td align="right">'.$feeamount.' '.$currency.'</td>';
print '<td align="right">'.$netamount.' '.$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>'; print '</tr>';
$i++; $i++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment