';
// Ref
- print ''.$langs->trans('Ref').' '.$langs->trans('Draft').' ';
+ print ''.$langs->trans('Ref').' '.$langs->trans('Draft').' ';
// Company
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
// Thirdparty
- print ''.$langs->trans('Customer').' ';
- if ($soc->id > 0 && !GETPOST('fac_rec', 'alpha')) {
- print '';
+ if ($soc->id > 0)
+ {
+ print ' '.$langs->trans('ThirdParty').' ';
+ print '';
print $soc->getNomUrl(1);
print ' ';
// Outstanding Bill
@@ -370,7 +376,8 @@ if ($action == 'create') {
print ')';
print ' ';
} else {
- print '';
+ print ' '.$langs->trans('ThirdParty').' ';
+ print '';
print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
// Option to reload page to retrieve customer informations. Note, this clear other input
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
@@ -386,7 +393,7 @@ if ($action == 'create') {
});
';
}
- print ' '.$langs->trans("AddThirdParty").' ';
+ print ' ';
print ' ';
}
print ''."\n";
@@ -540,11 +547,15 @@ if (!empty($id) && $action == 'edit') {
print "";
print "\n";
- if ($object->socid && !empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
+ if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
$company = new Societe($db);
- $result = $company->fetch($object->socid);
- print ''.$langs->trans("LinkedToDolibarrThirdParty").' '.$company->getNomUrl(1).' ';
+ print ''.$langs->trans("ThirdParty").' ';
+ if ($object->socid > 0) {
+ $result = $company->fetch($object->socid);
+ print $company->getNomUrl(1);
+ }
+ print ' ';
} else {
$langs->load("companies");
print ''.$langs->trans("Company").' ';
@@ -700,11 +711,15 @@ if (!empty($id) && $action != 'edit') {
print yn($object->public);
print '';
- if ($object->socid) {
+ if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
$company = new Societe($db);
- $result = $company->fetch($object->socid);
- print ''.$langs->trans("LinkedToDolibarrThirdParty").' '.$company->getNomUrl(1).' ';
+ print ''.$langs->trans("ThirdParty").' ';
+ if ($object->socid > 0) {
+ $result = $company->fetch($object->socid);
+ print $company->getNomUrl(1);
+ }
+ print ' ';
} else {
print ''.$langs->trans("Company").' '.$object->societe.' ';
print ''.$langs->trans("Lastname").' '.$object->lastname.' ';
diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang
index ec315d97142..0524cf1ca18 100644
--- a/htdocs/langs/en_US/dict.lang
+++ b/htdocs/langs/en_US/dict.lang
@@ -21,7 +21,7 @@ CountryNL=Netherlands
CountryHU=Hungary
CountryRU=Russia
CountrySE=Sweden
-CountryCI=Ivoiry Coast
+CountryCI=Ivory Coast
CountrySN=Senegal
CountryAR=Argentina
CountryCM=Cameroon
diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang
index de4bdf68f03..d512abb2eea 100644
--- a/htdocs/langs/en_US/donations.lang
+++ b/htdocs/langs/en_US/donations.lang
@@ -32,3 +32,4 @@ DONATION_ART238=Show article 238 from CGI if you are concerned
DONATION_ART885=Show article 885 from CGI if you are concerned
DonationPayment=Donation payment
DonationValidated=Donation %s validated
+DonationUseThirdparties=Use an existing thirdparty as coordinates of donators
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 67544b46328..58f5307255a 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1125,3 +1125,4 @@ ConfirmAffectTag=Bulk Tag Affect
ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)?
CategTypeNotFound=No tag type found for type of records
CopiedToClipboard=Copied to clipboard
+InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index df0bb4ed95c..85ad11bb74b 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -871,7 +871,7 @@ if (!$source) {
}
print '';
if (empty($amount) || !is_numeric($amount)) {
- print ' ';
+ print ' ';
print ' ';
} else {
print ''.price($amount).' ';
@@ -914,9 +914,13 @@ if ($source == 'order') {
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
$amount = $order->total_ttc;
+<<<<<<< HEAD
if (GETPOST("amount", 'int')) {
$amount = GETPOST("amount", 'int');
}
+=======
+ if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
$amount = price2num($amount);
}
@@ -965,8 +969,14 @@ if ($source == 'order') {
print ' ('.$langs->trans("ToComplete").')';
}
print ' ';
+<<<<<<< HEAD
if (empty($amount) || !is_numeric($amount)) {
print ' ';
+=======
+ if (empty($amount) || !is_numeric($amount))
+ {
+ print ' ';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
print ' ';
} else {
print ''.price($amount).' ';
@@ -1038,9 +1048,13 @@ if ($source == 'invoice') {
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
$amount = price2num($invoice->total_ttc - ($invoice->getSommePaiement() + $invoice->getSumCreditNotesUsed() + $invoice->getSumDepositsUsed()));
+<<<<<<< HEAD
if (GETPOST("amount", 'int')) {
$amount = GETPOST("amount", 'int');
}
+=======
+ if (GETPOST("amount", 'int')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
$amount = price2num($amount);
}
@@ -1092,8 +1106,14 @@ if ($source == 'invoice') {
if ($object->type == $object::TYPE_CREDIT_NOTE) {
print ''.$langs->trans("CreditNote").' ';
} elseif (empty($object->paye)) {
+<<<<<<< HEAD
if (empty($amount) || !is_numeric($amount)) {
print ' ';
+=======
+ if (empty($amount) || !is_numeric($amount))
+ {
+ print ' ';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
print ' ';
} else {
print ''.price($amount).' ';
@@ -1204,9 +1224,13 @@ if ($source == 'contractline') {
}
}
+<<<<<<< HEAD
if (GETPOST("amount", 'int')) {
$amount = GETPOST("amount", 'int');
}
+=======
+ if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
$amount = price2num($amount);
}
@@ -1296,8 +1320,14 @@ if ($source == 'contractline') {
print ' ('.$langs->trans("ToComplete").')';
}
print ' ';
+<<<<<<< HEAD
if (empty($amount) || !is_numeric($amount)) {
print ' ';
+=======
+ if (empty($amount) || !is_numeric($amount))
+ {
+ print ' ';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
print ' ';
} else {
print ''.price($amount).' ';
@@ -1370,10 +1400,15 @@ if ($source == 'membersubscription') {
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
$amount = $subscription->total_ttc;
+<<<<<<< HEAD
if (GETPOST("amount", 'int')) {
$amount = GETPOST("amount", 'int');
}
$amount = price2num($amount);
+=======
+ if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+ $amount = price2num($amount, 'MT');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
}
if (GETPOST('fulltag', 'alpha')) {
@@ -1470,15 +1505,30 @@ if ($source == 'membersubscription') {
}
if (empty($amount) || !is_numeric($amount)) {
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
+<<<<<<< HEAD
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
}
print ' ';
print ' ';
+=======
+ if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+ print ' ';
+ if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
+ print ' ';
+ print ' ';
+ } else {
+ print ' ';
+ }
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
} else {
$valtoshow = $amount;
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+<<<<<<< HEAD
+=======
+ $amount = $valtoshow;
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
}
print ''.price($valtoshow).' ';
print ' ';
@@ -1548,9 +1598,13 @@ if ($source == 'donation') {
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
$amount = $subscription->total_ttc;
+<<<<<<< HEAD
if (GETPOST("amount", 'int')) {
$amount = GETPOST("amount", 'int');
}
+=======
+ if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha');
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
$amount = price2num($amount);
}
@@ -1624,15 +1678,24 @@ if ($source == 'donation') {
}
if (empty($amount) || !is_numeric($amount)) {
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
+<<<<<<< HEAD
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
}
print ' ';
+=======
+ if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+ print ' ';
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
print ' ';
} else {
$valtoshow = $amount;
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+<<<<<<< HEAD
+=======
+ $amount = $valtoshow;
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
}
print ''.price($valtoshow).' ';
print ' ';
@@ -2118,6 +2181,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
console.log("We click on buttontopay");
event.preventDefault();
+<<<<<<< HEAD
if (cardholderName.value == '')
{
console.log("Field Card holder is empty");
@@ -2176,6 +2240,59 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
});
}
});
+=======
+ if (cardholderName.value == '')
+ {
+ console.log("Field Card holder is empty");
+ var displayError = document.getElementById('card-errors');
+ displayError.textContent = 'trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CardOwner"))); ?>';
+ }
+ else
+ {
+ /* Disable button to pay and show hourglass cursor */
+ jQuery('#hourglasstopay').show();
+ jQuery('#buttontopay').hide();
+
+ stripe.handleCardPayment(
+ clientSecret, cardElement, {
+ payment_method_data: {
+ billing_details: {
+ name: cardholderName.value
+ thirdparty) && !empty($object->thirdparty->email))) { ?>, email: 'thirdparty->email); ?>'
+ thirdparty) && !empty($object->thirdparty->phone)) { ?>, phone: 'thirdparty->phone); ?>'
+ thirdparty)) { ?>, address: {
+ city: 'thirdparty->town); ?>',
+ thirdparty->country_code) { ?>country: 'thirdparty->country_code); ?>',
+ line1: 'thirdparty->address)); ?>',
+ postal_code: 'thirdparty->zip); ?>'
+ }
+
+ }
+ },
+ save_payment_method: /* true when a customer was provided when creating payment intent. true ask to save the card */
+ }
+ ).then(function(result) {
+ console.log(result);
+ if (result.error) {
+ console.log("Error on result of handleCardPayment");
+ jQuery('#buttontopay').show();
+ jQuery('#hourglasstopay').hide();
+ // Inform the user if there was an error
+ var errorElement = document.getElementById('card-errors');
+ errorElement.textContent = result.error.message;
+ } else {
+ // The payment has succeeded. Display a success message.
+ console.log("No error on result of handleCardPayment, so we submit the form");
+ // Submit the form
+ jQuery('#buttontopay').hide();
+ jQuery('#hourglasstopay').show();
+ // Send form (action=charge that will do nothing)
+ jQuery('#payment-form').submit();
+ }
+ });
+ }
+ });
+>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
@@ -89,7 +89,7 @@ if (empty($conf) || !is_object($conf))
diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php
index 57b8a06b019..e03d0fa7b6e 100644
--- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php
+++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php
@@ -75,7 +75,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
control->tpl['ismodifiable_customercode']) { ?>
-
+
control->tpl['customercode']; ?>
@@ -96,7 +96,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
control->tpl['ismodifiable_suppliercode']) { ?>
-
+
control->tpl['suppliercode']; ?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
index 649d1bf8aca..389b36e50f5 100644
--- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
@@ -84,7 +84,7 @@ if (empty($conf) || !is_object($conf))
@@ -99,7 +99,7 @@ if (empty($conf) || !is_object($conf))
diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php
index b5f57544c5f..ffdbe2c3016 100644
--- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php
@@ -73,7 +73,7 @@ if (empty($conf) || !is_object($conf))
control->tpl['ismodifiable_customercode']) { ?>
-
+
control->tpl['customercode']; ?>
@@ -94,7 +94,7 @@ if (empty($conf) || !is_object($conf))
control->tpl['ismodifiable_suppliercode']) { ?>
-
+
control->tpl['suppliercode']; ?>
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 8b54144cbff..014959656db 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1289,7 +1289,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
$tmpcode = $object->code_client;
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0);
- print ' ';
+ print ' ';
print ' ';
$s = $modCodeClient->getToolTip($langs, $object, 0);
print $form->textwithpicto('', $s, 1);
@@ -1321,7 +1321,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
$tmpcode = $object->code_fournisseur;
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1);
- print ' ';
+ print ' ';
print ' ';
$s = $modCodeFournisseur->getToolTip($langs, $object, 1);
print $form->textwithpicto('', $s, 1);
@@ -1942,10 +1942,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$tmpcode = $object->code_client;
if (empty($tmpcode) && !empty($object->oldcopy->code_client)) $tmpcode = $object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0);
- print ' ';
+ print ' ';
} elseif ($object->codeclient_modifiable())
{
- print ' ';
+ print ' ';
} else {
print $object->code_client;
print ' ';
@@ -1980,10 +1980,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$tmpcode = $object->code_fournisseur;
if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1);
- print ' ';
+ print ' ';
} elseif ($object->codefournisseur_modifiable())
{
- print ' ';
+ print ' ';
} else {
print $object->code_fournisseur;
print ' ';
diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php
index b5cc638631c..03eacd13745 100644
--- a/test/phpunit/DateLibTest.php
+++ b/test/phpunit/DateLibTest.php
@@ -334,7 +334,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase
print __METHOD__." result=".$result."\n";
$this->assertSame('1 '.strtolower(dol_substr($langs->trans("Day"), 0, 1).'.'), $result);
-
return $result;
}
diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php
index 63893a9c881..7b1e4caa440 100644
--- a/test/phpunit/DateLibTzFranceTest.php
+++ b/test/phpunit/DateLibTzFranceTest.php
@@ -82,9 +82,9 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
{
global $conf,$user,$langs,$db;
- if (getServerTimeZoneString() != 'Europe/Paris') {
- print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ+1 Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
- }
+ if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') {
+ print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
+ }
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.