forked from Wavyzz/dolibarr
Fix phpunit
This commit is contained in:
@@ -719,7 +719,7 @@ if ($object->id > 0) {
|
|||||||
* Buttons
|
* Buttons
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
print "\n".'<div class="tabsAction">'."\n";
|
||||||
|
|
||||||
$buttonlabel = $langs->trans("MakeWithdrawRequest");
|
$buttonlabel = $langs->trans("MakeWithdrawRequest");
|
||||||
$user_perms = $user->rights->prelevement->bons->creer;
|
$user_perms = $user->rights->prelevement->bons->creer;
|
||||||
@@ -744,7 +744,8 @@ if ($object->id > 0) {
|
|||||||
print '<input type="submit" class="butAction" value="'.$buttonlabel.'" />';
|
print '<input type="submit" class="butAction" value="'.$buttonlabel.'" />';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) {
|
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT_SHOW_BUTTON)) {
|
||||||
|
// TODO Replace this with a checkbox for each payment mode: "Send request to PaymentModeManager immediatly..."
|
||||||
print "<br>";
|
print "<br>";
|
||||||
//add stripe sepa button
|
//add stripe sepa button
|
||||||
$buttonlabel = $langs->trans("MakeWithdrawRequestStripe");
|
$buttonlabel = $langs->trans("MakeWithdrawRequestStripe");
|
||||||
@@ -777,13 +778,23 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div><br>\n";
|
print "</div>\n";
|
||||||
|
|
||||||
|
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
print '<div class="opacitymedium">'.$langs->trans("DoCreditTransferBeforePayments").'</div><br>';
|
print '<div class="opacitymedium">'.$langs->trans("DoCreditTransferBeforePayments");
|
||||||
|
if (isModEnabled('stripe')) {
|
||||||
|
print ' '.$langs->trans("DoStandingOrdersBeforePayments2");
|
||||||
|
}
|
||||||
|
print ' '.$langs->trans("DoStandingOrdersBeforePayments3");
|
||||||
|
print '</div><br>';
|
||||||
} else {
|
} else {
|
||||||
print '<div class="opacitymedium">'.$langs->trans("DoStandingOrdersBeforePayments").'</div><br>';
|
print '<div class="opacitymedium">'.$langs->trans("DoStandingOrdersBeforePayments");
|
||||||
|
if (isModEnabled('stripe')) {
|
||||||
|
print ' '.$langs->trans("DoStandingOrdersBeforePayments2");
|
||||||
|
}
|
||||||
|
print ' '.$langs->trans("DoStandingOrdersBeforePayments3");
|
||||||
|
print '</div><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -797,14 +808,14 @@ if ($object->id > 0) {
|
|||||||
print '<td class="left">'.$langs->trans("DateRequest").'</td>';
|
print '<td class="left">'.$langs->trans("DateRequest").'</td>';
|
||||||
print '<td class="center">'.$langs->trans("User").'</td>';
|
print '<td class="center">'.$langs->trans("User").'</td>';
|
||||||
print '<td class="center">'.$langs->trans("Amount").'</td>';
|
print '<td class="center">'.$langs->trans("Amount").'</td>';
|
||||||
|
print '<td class="center">'.$langs->trans("DateProcess").'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
print '<td class="center">'.$langs->trans("BankTransferReceipt").'</td>';
|
print '<td class="center">'.$langs->trans("BankTransferReceipt").'</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="center">'.$langs->trans("WithdrawalReceipt").'</td>';
|
print '<td class="center">'.$langs->trans("WithdrawalReceipt").'</td>';
|
||||||
}
|
}
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '<td class="center">'.$langs->trans("DateProcess").'</td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
|
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
|
||||||
@@ -844,17 +855,27 @@ if ($object->id > 0) {
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Date
|
||||||
print '<td class="left">'.dol_print_date($db->jdate($obj->date_demande), 'dayhour')."</td>\n";
|
print '<td class="left">'.dol_print_date($db->jdate($obj->date_demande), 'dayhour')."</td>\n";
|
||||||
|
|
||||||
|
// User
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $tmpuser->getNomUrl(1, '', 0, 0, 0, 0, 'login');
|
print $tmpuser->getNomUrl(1, '', 0, 0, 0, 0, 'login');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="center">'.price($obj->amount).'</td>';
|
// Amount
|
||||||
print '<td align="center">-</td>';
|
print '<td class="center"><span class="amount">'.price($obj->amount).'</span></td>';
|
||||||
print '<td> </td>';
|
|
||||||
|
|
||||||
print '<td class="center">'.$langs->trans("OrderWaiting").'</td>';
|
// Ref of SEPA request
|
||||||
|
print '<td class="center"><span class="opacitymedium">'.$langs->trans("OrderWaiting").'</span></td>';
|
||||||
|
|
||||||
|
print '<td>';
|
||||||
|
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) {
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=new&paymentservice=stripesepa&token='.newToken().'&did='.$obj->rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("SendToStripe").'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td align="center">-</td>';
|
||||||
|
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'&did='.$obj->rowid.'&type='.$type.'">';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'&did='.$obj->rowid.'&type='.$type.'">';
|
||||||
|
|||||||
@@ -854,11 +854,11 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$bac = new CompanyBankAccount($this->db);
|
$bac = new CompanyBankAccount($this->db);
|
||||||
$bac->fetch(0, $this->socid);
|
$bac->fetch(0, $this->socid);
|
||||||
|
|
||||||
$sql = 'SELECT count(*)';
|
$sql = "SELECT count(*)";
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande';
|
$sql .= " FROM ".$this->db->prefix()."prelevement_facture_demande";
|
||||||
$sql .= ' WHERE fk_facture = '.((int) $this->id);
|
$sql .= " WHERE fk_facture = ".((int) $this->id);
|
||||||
$sql .= ' AND ext_payment_id IS NULL'; // To exclude record done for some online payments
|
$sql .= " AND ext_payment_id IS NULL"; // To exclude record done for some online payments
|
||||||
$sql .= ' AND traite = 0';
|
$sql .= " AND traite = 0";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::demande_prelevement_stripe 1", LOG_DEBUG);
|
dol_syslog(get_class($this)."::demande_prelevement_stripe 1", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@@ -1025,38 +1025,6 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$errorforinvoice++;
|
$errorforinvoice++;
|
||||||
$this->errors[] = $errmsg;
|
$this->errors[] = $errmsg;
|
||||||
}
|
}
|
||||||
// if (!$error && ($this->date < ($now - ($nbdaysbeforeendoftries * 24 * 3600))) // We try until we reach $nbdaysbeforeendoftries
|
|
||||||
// && ($this->date < ($now - (62 * 24 * 3600)) || $this->date > ($now - (60 * 24 * 3600))) // or when we have 60 days
|
|
||||||
// && ($this->date < ($now - (92 * 24 * 3600)) || $this->date > ($now - (90 * 24 * 3600))) // or when we have 90 days
|
|
||||||
// && empty($nocancelifpaymenterror)) {
|
|
||||||
// $errmsg = 'Payment try was canceled (invoice date is older than ' . $nbdaysbeforeendoftries . ' days and not 60 days old and not 90 days old) - You can still take payment from backoffice.';
|
|
||||||
// dol_syslog($errmsg, LOG_DEBUG);
|
|
||||||
|
|
||||||
// $error++;
|
|
||||||
// $errorforinvoice++;
|
|
||||||
// $this->errors[] = $errmsg;
|
|
||||||
// }
|
|
||||||
// if (!$error && empty($nocancelifpaymenterror)) { // If we are not in a mode that ask to avoid cancelation, we cancel payment.
|
|
||||||
// // Test if last AC_PAYMENT_STRIPE_KO event is an old error lower than $nbhoursbetweentries hours.
|
|
||||||
// $recentfailedpayment = false;
|
|
||||||
// $sqlonevents = 'SELECT COUNT(*) as nb FROM ' . MAIN_DB_PREFIX . 'actioncomm WHERE fk_soc = ' . ((int) $thirdparty->id) . " AND code ='AC_PAYMENT_STRIPE_KO' AND datep > '" . $this->db->idate($now - ($nbhoursbetweentries * 3600)) . "'";
|
|
||||||
// $resqlonevents = $this->db->query($sqlonevents);
|
|
||||||
// if ($resqlonevents) {
|
|
||||||
// $obj = $this->db->fetch_object($resqlonevents);
|
|
||||||
// if ($obj && $obj->nb > 0) {
|
|
||||||
// $recentfailedpayment = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if ($recentfailedpayment) {
|
|
||||||
// $errmsg = 'Payment try was canceled (recent payment, in last ' . $nbhoursbetweentries . ' hours, with error AC_PAYMENT_STRIPE_KO for this customer)';
|
|
||||||
// dol_syslog($errmsg, LOG_DEBUG);
|
|
||||||
|
|
||||||
// $error++;
|
|
||||||
// $errorforinvoice++;
|
|
||||||
// $this->errors[] = $errmsg;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!$error) { // Payment was not canceled
|
if (!$error) { // Payment was not canceled
|
||||||
//erics card or sepa ?
|
//erics card or sepa ?
|
||||||
@@ -1107,15 +1075,17 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$stripefailuremessage = $e->getMessage();
|
$stripefailuremessage = $e->getMessage();
|
||||||
}
|
}
|
||||||
} else { // Using new SCA method
|
} else { // Using new SCA method
|
||||||
if ($sepaMode)
|
if ($sepaMode) {
|
||||||
dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG);
|
dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG);
|
||||||
else dol_syslog("* Create payment on card " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG);
|
} else {
|
||||||
|
dol_syslog("* Create payment on card " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
// Create payment intent and charge payment (confirmnow = true)
|
// Create payment intent and charge payment (confirmnow = true)
|
||||||
$paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1);
|
$paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1);
|
||||||
|
|
||||||
$charge = new stdClass();
|
$charge = new stdClass();
|
||||||
//erics add processing sepa is like success ?
|
//erics add processing sepa is like success ?
|
||||||
if ($paymentintent->status === 'succeeded' || $paymentintent->status === 'processing') {
|
if ($paymentintent->status === 'succeeded' || $paymentintent->status === 'processing') {
|
||||||
$charge->status = 'ok';
|
$charge->status = 'ok';
|
||||||
$charge->id = $paymentintent->id;
|
$charge->id = $paymentintent->id;
|
||||||
@@ -1145,8 +1115,8 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$stripefailuredeclinecode = $stripe->declinecode;
|
$stripefailuredeclinecode = $stripe->declinecode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump("stripefailurecode=".$stripefailurecode." stripefailuremessage=".$stripefailuremessage." stripefailuredeclinecode=".$stripefailuredeclinecode);
|
//var_dump("stripefailurecode=".$stripefailurecode." stripefailuremessage=".$stripefailuremessage." stripefailuredeclinecode=".$stripefailuredeclinecode);
|
||||||
//exit;
|
//exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
|
// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
|
||||||
@@ -1412,7 +1382,7 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$extraparams = '';
|
$extraparams = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send email + create action after
|
// Send email + create action after
|
||||||
if ($sendemailtocustomer && $labeltouse) {
|
if ($sendemailtocustomer && $labeltouse) {
|
||||||
dol_syslog("* Send email with result of payment - " . $labeltouse);
|
dol_syslog("* Send email with result of payment - " . $labeltouse);
|
||||||
|
|
||||||
@@ -1558,8 +1528,8 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$actioncomm->create($user);
|
$actioncomm->create($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
$this->postactionmessages = $postactionmessages;
|
$this->postactionmessages = $postactionmessages;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$error++;
|
$error++;
|
||||||
$errorforinvoice++;
|
$errorforinvoice++;
|
||||||
@@ -1573,25 +1543,21 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?";
|
$this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?";
|
||||||
}
|
}
|
||||||
|
|
||||||
//end copy
|
$sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande(";
|
||||||
// print json_encode($stripecard);
|
$sql .= "fk_facture, ";
|
||||||
// exit;
|
$sql .= " amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)";
|
||||||
|
$sql .= " VALUES (".$this->id;
|
||||||
|
$sql .= ",".((float) price2num($amount));
|
||||||
|
$sql .= ",'".$this->db->idate($now)."'";
|
||||||
|
$sql .= ",".((int) $fuser->id);
|
||||||
|
$sql .= ",'".$this->db->escape($stripe_id)."'";
|
||||||
|
$sql .= ",'".$this->db->escape($stripe_uri)."'";
|
||||||
|
$sql .= ",'".$this->db->escape($sourcetype)."'";
|
||||||
|
$sql .= ",".$conf->entity;
|
||||||
|
$sql .= ")";
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande(';
|
dol_syslog(get_class($this)."::demande_prelevement_stripe", LOG_DEBUG);
|
||||||
$sql .= 'fk_facture, ';
|
$resql = $this->db->query($sql);
|
||||||
$sql .= ' amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)';
|
|
||||||
$sql .= ' VALUES ('.$this->id;
|
|
||||||
$sql .= ",'".price2num($amount)."'";
|
|
||||||
$sql .= ",'".$this->db->idate($now)."'";
|
|
||||||
$sql .= ",".$fuser->id;
|
|
||||||
$sql .= ",'".$this->db->escape($stripe_id)."'";
|
|
||||||
$sql .= ",'".$this->db->escape($stripe_uri)."'";
|
|
||||||
$sql .= ",'".$this->db->escape($sourcetype)."'";
|
|
||||||
$sql .= ",".$conf->entity;
|
|
||||||
$sql .= ")";
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::demande_prelevement_stripe", LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
dol_syslog(get_class($this).'::demande_prelevement_stripe Erreur');
|
dol_syslog(get_class($this).'::demande_prelevement_stripe Erreur');
|
||||||
@@ -1614,7 +1580,7 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
if ($error) {
|
if ($error) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$this->error = "A request already exists";
|
$this->error = "A request already exists";
|
||||||
dol_syslog(get_class($this).'::demande_prelevement_stripe Impossible de creer une demande, demande deja en cours');
|
dol_syslog(get_class($this).'::demande_prelevement_stripe Impossible de creer une demande, demande deja en cours');
|
||||||
|
|||||||
@@ -262,7 +262,10 @@ if ($sall || $search_product_category > 0 || $search_user > 0) {
|
|||||||
$sql = 'SELECT DISTINCT';
|
$sql = 'SELECT DISTINCT';
|
||||||
}
|
}
|
||||||
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number, e.fk_shipping_method,";
|
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number, e.fk_shipping_method,";
|
||||||
$sql .= " l.date_delivery as date_reception,";
|
if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
|
||||||
|
// Link for delivery fields ref and date. Does not duplicate the line because we should always have ony 1 link or 0 per shipment
|
||||||
|
$sql .= " l.date_delivery as date_reception,";
|
||||||
|
}
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
|
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
@@ -299,8 +302,11 @@ if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
|
if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
|
// Link for delivery fields ref and date. Does not duplicate the line because we should always have ony 1 link or 0 per shipment
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
|
||||||
|
}
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid';
|
||||||
if ($search_user > 0) { // Get link to order to get the order id in eesource.fk_source
|
if ($search_user > 0) { // Get link to order to get the order id in eesource.fk_source
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
|
||||||
@@ -370,26 +376,28 @@ if ($search_user > 0) {
|
|||||||
// The contact on a shipment is also the contact of the order.
|
// The contact on a shipment is also the contact of the order.
|
||||||
$sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = eesource.fk_source AND ec.fk_socpeople = ".((int) $search_user);
|
$sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = eesource.fk_source AND ec.fk_socpeople = ".((int) $search_user);
|
||||||
}
|
}
|
||||||
if ($search_ref_exp) {
|
|
||||||
$sql .= natural_search('e.ref', $search_ref_exp);
|
|
||||||
}
|
|
||||||
if ($search_ref_liv) {
|
|
||||||
$sql .= natural_search('l.ref', $search_ref_liv);
|
|
||||||
}
|
|
||||||
if ($search_company) {
|
if ($search_company) {
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
|
if ($search_ref_exp) {
|
||||||
|
$sql .= natural_search('e.ref', $search_ref_exp);
|
||||||
|
}
|
||||||
if ($search_datedelivery_start) {
|
if ($search_datedelivery_start) {
|
||||||
$sql .= " AND e.date_delivery >= '".$db->idate($search_datedelivery_start)."'";
|
$sql .= " AND e.date_delivery >= '".$db->idate($search_datedelivery_start)."'";
|
||||||
}
|
}
|
||||||
if ($search_datedelivery_end) {
|
if ($search_datedelivery_end) {
|
||||||
$sql .= " AND e.date_delivery <= '".$db->idate($search_datedelivery_end)."'";
|
$sql .= " AND e.date_delivery <= '".$db->idate($search_datedelivery_end)."'";
|
||||||
}
|
}
|
||||||
if ($search_datereceipt_start) {
|
if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
|
||||||
$sql .= " AND l.date_delivery >= '".$db->idate($search_datereceipt_start)."'";
|
if ($search_ref_liv) {
|
||||||
}
|
$sql .= natural_search('l.ref', $search_ref_liv);
|
||||||
if ($search_datereceipt_end) {
|
}
|
||||||
$sql .= " AND l.date_delivery <= '".$db->idate($search_datereceipt_end)."'";
|
if ($search_datereceipt_start) {
|
||||||
|
$sql .= " AND l.date_delivery >= '".$db->idate($search_datereceipt_start)."'";
|
||||||
|
}
|
||||||
|
if ($search_datereceipt_end) {
|
||||||
|
$sql .= " AND l.date_delivery <= '".$db->idate($search_datereceipt_end)."'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ ErrorFailedToWriteInTempDirectory=Failed to write in temp directory
|
|||||||
ErrorQuantityIsLimitedTo=Quantity is limited to %s
|
ErrorQuantityIsLimitedTo=Quantity is limited to %s
|
||||||
ErrorFailedToLoadThirdParty=Failed to find/load thirdparty from id=%s, email=%s, name=%s
|
ErrorFailedToLoadThirdParty=Failed to find/load thirdparty from id=%s, email=%s, name=%s
|
||||||
ErrorThisPaymentModeIsNotSepa=This payment mode is not a bank account
|
ErrorThisPaymentModeIsNotSepa=This payment mode is not a bank account
|
||||||
|
ErrorStripeCustomerNotFoundCreateFirst=Stripe customer is not set for this thirdparty (or set to a value deleted on Stripe side). Create (or re-attach) it first.
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||||
|
|||||||
@@ -101,8 +101,11 @@ CreditDate=Credit on
|
|||||||
WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country %s (Your country is not supported)
|
WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country %s (Your country is not supported)
|
||||||
ShowWithdraw=Show Direct Debit Order
|
ShowWithdraw=Show Direct Debit Order
|
||||||
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management.
|
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management.
|
||||||
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Payment by direct debit to generate and manage the direct debit order. When direct debit order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null.
|
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, you can go into menu "Bank->Payment by direct debit" to generate and manage a Direct debit order file.
|
||||||
DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Payment by credit transfer to generate and manage the credit transfer order. When credit transfer order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null.
|
DoStandingOrdersBeforePayments2=You can also send a request directly to a SEPA payment processor like Stripe, ...
|
||||||
|
DoStandingOrdersBeforePayments3=When direct debit order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null.
|
||||||
|
DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu "Bank->Payment by credit transfer" to generate and manage a Credit transfer order file.
|
||||||
|
DoCreditTransferBeforePayments3=When credit transfer order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null.
|
||||||
WithdrawalFile=Debit order file
|
WithdrawalFile=Debit order file
|
||||||
CreditTransferFile=Credit transfer file
|
CreditTransferFile=Credit transfer file
|
||||||
SetToStatusSent=Set to status "File Sent"
|
SetToStatusSent=Set to status "File Sent"
|
||||||
|
|||||||
@@ -435,6 +435,7 @@ if (empty($reshook)) {
|
|||||||
$result = $companypaymentmode->delete($user);
|
$result = $companypaymentmode->delete($user);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$url = $_SERVER['PHP_SELF']."?socid=".$object->id;
|
$url = $_SERVER['PHP_SELF']."?socid=".$object->id;
|
||||||
|
|
||||||
header('Location: '.$url);
|
header('Location: '.$url);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@@ -458,8 +459,10 @@ if (empty($reshook)) {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
$result = $companybankaccount->delete($user);
|
$result = $companybankaccount->delete($user);
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$url = $_SERVER['PHP_SELF']."?socid=".$object->id;
|
$url = $_SERVER['PHP_SELF']."?socid=".$object->id;
|
||||||
|
|
||||||
header('Location: '.$url);
|
header('Location: '.$url);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@@ -545,11 +548,11 @@ if (empty($reshook)) {
|
|||||||
// Get the Stripe customer
|
// Get the Stripe customer
|
||||||
$cu = $stripe->customerStripe($object, $stripeacc, $servicestatus);
|
$cu = $stripe->customerStripe($object, $stripeacc, $servicestatus);
|
||||||
// print json_encode($cu);
|
// print json_encode($cu);
|
||||||
if (!$cu) {
|
if (empty($cu)) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($stripe->error, $stripe->errors, 'errors');
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->trans("ErrorStripeCustomerNotFoundCreateFirst"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Creation of Stripe SEPA + update of llx_societe_rib
|
// Creation of Stripe SEPA + update of llx_societe_rib
|
||||||
$card = $stripe->sepaStripe($cu, $companypaymentmode, $stripeacc, $servicestatus, 1);
|
$card = $stripe->sepaStripe($cu, $companypaymentmode, $stripeacc, $servicestatus, 1);
|
||||||
@@ -1587,8 +1590,9 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
print '<td class="right nowraponall">';
|
print '<td class="right nowraponall">';
|
||||||
if ($permissiontoaddupdatepaymentinformation) {
|
if ($permissiontoaddupdatepaymentinformation) {
|
||||||
if (empty($rib->stripe_card_ref)) {
|
if (empty($rib->stripe_card_ref)) {
|
||||||
|
// Add link to create BAN on Stripe
|
||||||
print '<a class="editfielda marginrightonly marginleftonly" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&id='.$rib->id.'&action=syncsepatostripe">';
|
print '<a class="editfielda marginrightonly marginleftonly" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&id='.$rib->id.'&action=syncsepatostripe">';
|
||||||
print img_picto($langs->trans("CreateBAN"), 'stripe');
|
print img_picto($langs->trans("CreateBANOnStripe"), 'stripe');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
|||||||
//if ($reg[0] != 'db') $ok=false;
|
//if ($reg[0] != 'db') $ok=false;
|
||||||
}
|
}
|
||||||
//print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
|
//print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
|
||||||
$this->assertTrue($ok, 'Found a forged SQL string that mix on same line the use of \' for PHP string and PHP variables into file '.$file['relativename'].' Use " to forge PHP string like this: $sql = "SELET ".$myvar...');
|
$this->assertTrue($ok, 'Found a forged SQL string that mix on same line the use of \' for PHP string and PHP variables into file '.$file['relativename'].' Use " to forge PHP string like this: $sql = "SELECT ".$myvar...');
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
// Check that forged sql string is using ' instead of " as string PHP quotes
|
// Check that forged sql string is using ' instead of " as string PHP quotes
|
||||||
|
|||||||
Reference in New Issue
Block a user