Clean/Debug code for v15
This commit is contained in:
parent
654cd8bd1c
commit
7266c78162
@ -277,7 +277,9 @@ function checkIbanForAccount($account)
|
|||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php';
|
require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php';
|
||||||
|
|
||||||
$iban = new IBAN($account->iban);
|
$ibantocheck = ($account->iban ? $account->iban : $account->iban_prefix); // iban or iban_prefix for backward compatibility
|
||||||
|
|
||||||
|
$iban = new IBAN($ibantocheck);
|
||||||
$check = $iban->Verify();
|
$check = $iban->Verify();
|
||||||
|
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
|||||||
@ -32,7 +32,7 @@ RIB=Bank Account Number
|
|||||||
IBAN=IBAN number
|
IBAN=IBAN number
|
||||||
BIC=BIC/SWIFT code
|
BIC=BIC/SWIFT code
|
||||||
SwiftValid=BIC/SWIFT valid
|
SwiftValid=BIC/SWIFT valid
|
||||||
SwiftVNotalid=BIC/SWIFT not valid
|
SwiftNotValid=BIC/SWIFT not valid
|
||||||
IbanValid=BAN valid
|
IbanValid=BAN valid
|
||||||
IbanNotValid=BAN not valid
|
IbanNotValid=BAN not valid
|
||||||
StandingOrders=Direct debit orders
|
StandingOrders=Direct debit orders
|
||||||
@ -49,7 +49,6 @@ BankAccountDomiciliation=Bank address
|
|||||||
BankAccountCountry=Account country
|
BankAccountCountry=Account country
|
||||||
BankAccountOwner=Account owner name
|
BankAccountOwner=Account owner name
|
||||||
BankAccountOwnerAddress=Account owner address
|
BankAccountOwnerAddress=Account owner address
|
||||||
RIBControlError=Integrity check of values failed. This means the information for this account number is not complete or is incorrect (check country, numbers and IBAN).
|
|
||||||
CreateAccount=Create account
|
CreateAccount=Create account
|
||||||
NewBankAccount=New account
|
NewBankAccount=New account
|
||||||
NewFinancialAccount=New financial account
|
NewFinancialAccount=New financial account
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
* \file htdocs/public/onlinesign/newonlinesign.php
|
* \file htdocs/public/onlinesign/newonlinesign.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief File to offer a way to make an online signature for a particular Dolibarr entity
|
* \brief File to offer a way to make an online signature for a particular Dolibarr entity
|
||||||
|
* Example of URL: https://localhost/public/onlinesign/newonlinesign.php?ref=PR...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('NOLOGIN')) {
|
if (!defined('NOLOGIN')) {
|
||||||
@ -352,10 +353,12 @@ if ($action == "dosign" && empty($cancel)) {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '<input type="button" class="button" id="signpropal" value="'.$langs->trans("Sign").'">';
|
print '<input type="button" class="button" id="signpropal" value="'.$langs->trans("Sign").'">';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
|
||||||
|
// Add js code managed into the div #signature
|
||||||
print '<script language="JavaScript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jSignature/jSignature.js"></script>
|
print '<script language="JavaScript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jSignature/jSignature.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#signature").jSignature({color:"#000",lineWidth:4});
|
$("#signature").jSignature({ color:"#000", lineWidth:4, height: 180});
|
||||||
|
|
||||||
$("#signature").on("change",function(){
|
$("#signature").on("change",function(){
|
||||||
$("#clearsignature").css("display","");
|
$("#clearsignature").css("display","");
|
||||||
@ -370,13 +373,13 @@ if ($action == "dosign" && empty($cancel)) {
|
|||||||
data: {
|
data: {
|
||||||
"action" : "importSignature",
|
"action" : "importSignature",
|
||||||
"signaturebase64" : signature,
|
"signaturebase64" : signature,
|
||||||
"ref" : "'.$REF.'",
|
"ref" : "'.dol_escape_js($REF).'",
|
||||||
"mode" : "propale",
|
"mode" : "propale",
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
if(response == "success"){
|
if(response == "success"){
|
||||||
console.log("Success on saving signature");
|
console.log("Success on saving signature");
|
||||||
window.location.replace("'.$_SERVER["SELF"].'?ref='.$ref.'&message=signed");
|
window.location.replace("'.$_SERVER["SELF"].'?ref='.urlencode($ref).'&message=signed");
|
||||||
}else{
|
}else{
|
||||||
console.error(response);
|
console.error(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,14 @@ class CompanyBankAccount extends Account
|
|||||||
public $socid;
|
public $socid;
|
||||||
|
|
||||||
public $default_rib;
|
public $default_rib;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value 'FRST' or 'RCUR' (For SEPA mandate)
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
public $frstrecur;
|
public $frstrecur;
|
||||||
|
|
||||||
public $rum;
|
public $rum;
|
||||||
public $date_rum;
|
public $date_rum;
|
||||||
|
|
||||||
@ -72,7 +79,7 @@ class CompanyBankAccount extends Account
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create bank information record
|
* Create bank information record.
|
||||||
*
|
*
|
||||||
* @param User $user User
|
* @param User $user User
|
||||||
* @param int $notrigger 1=Disable triggers
|
* @param int $notrigger 1=Disable triggers
|
||||||
@ -81,8 +88,17 @@ class CompanyBankAccount extends Account
|
|||||||
public function create(User $user = null, $notrigger = 0)
|
public function create(User $user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
// Correct default_rib to be sure to have always one default
|
|
||||||
|
// Check paramaters
|
||||||
|
if (empty($this->socid)) {
|
||||||
|
$this->error = 'BadValueForParameter';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Correct ->default_rib to not set the new account as default, if there is already 1. We want to be sure to have always 1 default for type = 'ban'.
|
||||||
|
// If we really want the new bank account to be the default, we must set it by calling setDefault() after creation.
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -353,12 +369,10 @@ class CompanyBankAccount extends Account
|
|||||||
|
|
||||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 0";
|
$sql2 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 0";
|
||||||
$sql2 .= " WHERE type = 'ban' AND fk_soc = ".((int) $obj->fk_soc);
|
$sql2 .= " WHERE type = 'ban' AND fk_soc = ".((int) $obj->fk_soc);
|
||||||
dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG);
|
|
||||||
$result2 = $this->db->query($sql2);
|
$result2 = $this->db->query($sql2);
|
||||||
|
|
||||||
$sql3 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 1";
|
$sql3 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 1";
|
||||||
$sql3 .= " WHERE rowid = ".((int) $obj->id);
|
$sql3 .= " WHERE rowid = ".((int) $obj->id);
|
||||||
dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG);
|
|
||||||
$result3 = $this->db->query($sql3);
|
$result3 = $this->db->query($sql3);
|
||||||
|
|
||||||
if (!$result2 || !$result3) {
|
if (!$result2 || !$result3) {
|
||||||
|
|||||||
@ -7006,6 +7006,7 @@ div.clipboardCPValue.hidewithsize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* CSS style used for small screen */
|
/* CSS style used for small screen */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user