';
@@ -199,11 +200,12 @@ function showOnlinePaymentUrl($type, $ref)
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...)
* @param string $ref Ref of object
* @param string $label Text or HTML tag to display, if empty it display the URL
+ * @param int $amount Amount of money to request for
* @return string Url string
*/
-function getHtmlOnlinePaymentLink($type, $ref, $label = '')
+function getHtmlOnlinePaymentLink($type, $ref, $label = '', $amount = '9.99')
{
- $url = getOnlinePaymentUrl(0, $type, $ref);
+ $url = getOnlinePaymentUrl(0, $type, $ref, $amount);
$label = $label ? $label : $url;
return ''.$label.'';
}
@@ -215,7 +217,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '')
* @param int $mode 0=True url, 1=Url formated with colors
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member', 'boothlocation', ...)
* @param string $ref Ref of object
- * @param int $amount Amount (required and used for $type='free' only)
+ * @param int $amount Amount of money to request for
* @param string $freetag Free tag (required and used for $type='free' only)
* @param string $localorexternal 0=Url for browser, 1=Url for external access
* @return string Url string
@@ -318,7 +320,9 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
}
} elseif ($type == 'member' || $type == 'membersubscription') {
$newtype = 'member';
- $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : '');
+ $out = $urltouse.'/public/payment/newpayment.php?source=member';
+ $out .= '&amount='.$amount;
+ $out .= '&ref='.($mode ? '' : '');
if ($mode == 1) {
$out .= 'member_ref';
}
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index 0e018514353..4e926050f24 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -798,6 +798,18 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg .= "\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
$object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type;
+ $object->sendtoid = 0;
+ } elseif ($action == 'MEMBER_EXCLUDE') {
+ // Load translation files required by the page
+ $langs->loadLangs(array("agenda", "other", "members"));
+
+ if (empty($object->actionmsg2)) {
+ $object->actionmsg2 = $langs->transnoentities("MemberExcludedInDolibarr", $object->getFullName($langs));
+ }
+ $object->actionmsg = $langs->transnoentities("MemberExcludedInDolibarr", $object->getFullName($langs));
+ $object->actionmsg .= "\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
+ $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type;
+
$object->sendtoid = 0;
} elseif ($action == 'PROJECT_CREATE') {
// Projects
diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql
index 41669848486..fa61ba725de 100644
--- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql
+++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql
@@ -32,7 +32,6 @@
-- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
-
-- Missing in v16 or lower
ALTER TABLE llx_c_action_trigger MODIFY elementtype VARCHAR(64);
@@ -54,5 +53,5 @@ ALTER TABLE llx_facture ADD COLUMN close_missing_amount double(24, 8) after clos
ALTER TABLE llx_facture_fourn ADD COLUMN close_missing_amount double(24, 8) after close_code;
-
-
+-- Allow users to make subscriptions of any amount during membership subscription
+ALTER TABLE llx_adherent_type ADD COLUMN caneditamount integer DEFAULT 0 AFTER amount;
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 272ec22df5c..b8f9ffa857b 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -57,6 +57,7 @@ MemberValidatedInDolibarr=Member %s validated
MemberModifiedInDolibarr=Member %s modified
MemberResiliatedInDolibarr=Member %s terminated
MemberDeletedInDolibarr=Member %s deleted
+MemberExcludedInDolibarr=Member %s excluded
MemberSubscriptionAddedInDolibarr=Subscription %s for member %s added
MemberSubscriptionModifiedInDolibarr=Subscription %s for member %s modified
MemberSubscriptionDeletedInDolibarr=Subscription %s for member %s deleted
diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang
index a6716034c2d..32f251707a4 100644
--- a/htdocs/langs/en_US/install.lang
+++ b/htdocs/langs/en_US/install.lang
@@ -27,6 +27,7 @@ ErrorDatabaseVersionTooLow=Database version (%s) too old. Version %s or higher i
ErrorPHPVersionTooLow=PHP version too old. Version %s is required.
ErrorConnectedButDatabaseNotFound=Connection to server successful but database '%s' not found.
ErrorDatabaseAlreadyExists=Database '%s' already exists.
+ErrorNoMigrationFilesFoundForParameters=No migration file found for the selected versions
IfDatabaseNotExistsGoBackAndUncheckCreate=If the database does not exist, go back and check option "Create database".
IfDatabaseExistsGoBackAndCheckCreate=If database already exists, go back and uncheck "Create database" option.
WarningBrowserTooOld=Version of browser is too old. Upgrading your browser to a recent version of Firefox, Chrome or Opera is highly recommended.
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index 1c205f48f46..e4ca610c44f 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -72,6 +72,12 @@ MemberTypeCanNotBeDeleted=Member type can not be deleted
NewSubscription=New contribution
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead by email %s.
Subscription=Contribution
+AnyAmountWithAdvisedAmount=Any amount with a recommended amount of %s %s
+AnyAmountWithoutAdvisedAmount=Any amount
+CanEditAmountShort=Any amount
+CanEditAmountShortForValues=recommended, any amount
+MembershipDuration=Duration
+GetMembershipButtonLabel=Get membership
Subscriptions=Contributions
SubscriptionLate=Late
SubscriptionNotReceived=Contribution never received
@@ -136,7 +142,7 @@ CardContent=Content of your member card
# Text of email templates
ThisIsContentOfYourMembershipRequestWasReceived=We want to let you know that your membership request was received.
ThisIsContentOfYourMembershipWasValidated=We want to let you know that your membership was validated with the following information:
-ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.
+ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.
ThisIsContentOfSubscriptionReminderEmail=We want to let you know that your subscription is about to expire or has already expired (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). We hope you will renew it.
ThisIsContentOfYourCard=This is a summary of the information we have about you. Please contact us if anything is incorrect.
DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the notification email received in case of auto-inscription of a guest
@@ -199,7 +205,8 @@ NbOfSubscriptions=Number of contributions
AmountOfSubscriptions=Amount collected from contributions
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
DefaultAmount=Default amount of contribution
-CanEditAmount=Visitor can choose/edit amount of its contribution
+CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type
+AmountIsLowerToMinimumNotice=sur un dû total de %s
MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page
ByProperties=By nature
MembersStatisticsByProperties=Members statistics by nature
diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang
index beaf9a5ea3f..a935cd38434 100644
--- a/htdocs/langs/en_US/paypal.lang
+++ b/htdocs/langs/en_US/paypal.lang
@@ -34,3 +34,4 @@ ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions.
ValidationOfPaymentFailed=Validation of payment has failed
CardOwner=Card holder
PayPalBalance=Paypal credit
+OnlineSubscriptionPaymentLine=Online subscription recorded on %s Paid via %s Originating IP address: %s Transaction ID: %s
diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang
index a6f805daca6..a5a76c9be55 100644
--- a/htdocs/langs/fr_FR/members.lang
+++ b/htdocs/langs/fr_FR/members.lang
@@ -198,7 +198,14 @@ NbOfSubscriptions=Nombre de cotisations
AmountOfSubscriptions=Montant des cotisations
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
DefaultAmount=Montant par défaut de la cotisation
-CanEditAmount=Le visiteur peut modifier / choisir le montant de sa cotisation
+CanEditAmount=Le visiteur peut modifier / choisir le montant de sa cotisation quel que soit le type d'adhésion
+AmountIsLowerToMinimumNotice=sur un dû total de %s
+AnyAmountWithAdvisedAmount=Montant libre avec un montant recommandé de %s %s
+AnyAmountWithoutAdvisedAmount=Montant libre
+CanEditAmountShortForValues=conseillé, montant libre
+MembershipDuration=Durée
+GetMembershipButtonLabel=Adhérer
+CanEditAmountShort=Montant libre
MEMBER_NEWFORM_PAYONLINE=Rediriger sur la page intégrée de paiement en ligne
ByProperties=Par nature
MembersStatisticsByProperties=Statistiques des adhérents par nature
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 31f1fa9f952..7b9f59ee5cc 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -64,10 +64,12 @@ if (is_numeric($entity)) {
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
// Init vars
$errmsg = '';
@@ -473,253 +475,352 @@ dol_htmloutput_errors($errmsg);
print '\n";
-print " ";
-print '