From 0d042deaf26e0967a03cfc64e27de46dde19d4d4 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 30 Jun 2026 14:40:48 -0400 Subject: [PATCH] MSIN-4416 Enhance refund functionality in registration management with new documentation panel This commit introduces a new documentation panel for the refund process in the registration management interface. It adds a function to render the refund documentation aside from the main refund form, improving user guidance during the refund process. Additionally, CSS styles are added to ensure proper layout and responsiveness of the new panel. The version code is updated to 4.72.717 to reflect these changes. --- ajax_inscr_gestion.php | 10 +++- css/style.css | 75 +++++++++++++++++++++++++ php/inc_fx_doc.php | 79 +++++++++++++++++++++++++++ php/inc_settings.php | 4 +- sql/MSIN-inscr-gestion-refund-doc.sql | 23 ++++++++ superadm/php/inc_fx_paypal.php | 16 +++++- 6 files changed, 202 insertions(+), 5 deletions(-) create mode 100644 sql/MSIN-inscr-gestion-refund-doc.sql diff --git a/ajax_inscr_gestion.php b/ajax_inscr_gestion.php index 4b47939..a203322 100644 --- a/ajax_inscr_gestion.php +++ b/ajax_inscr_gestion.php @@ -102,7 +102,15 @@ switch ($strAction) { // le comportement (submit AJAX) est gere par le handler delegue dans inc_footer_scripts.php. // NB : le resume de la transaction n'est plus inclus ici (MSIN) ; il est desormais // accessible via le bouton "Afficher la transaction" de la barre Gestion (action transaction_resume). - $strForm = fxRenderRefundForm($recCommandes, $strRefundToken, $arrRefundCtx, $vDomaine, $strAuteur, null, false); + $strDocAside = ''; + if (function_exists('fxDocRenderRefundPromoteurAside')) { + global $vPage; + $memPage = $vPage ?? null; + $vPage = 'compte.php'; + $strDocAside = fxDocRenderRefundPromoteurAside(); + $vPage = $memPage; + } + $strForm = fxRenderRefundForm($recCommandes, $strRefundToken, $arrRefundCtx, $vDomaine, $strAuteur, null, false, $strDocAside); $tabRetour = array('state' => 'ok', 'html' => $strForm); break; diff --git a/css/style.css b/css/style.css index d55ba21..4272ed6 100644 --- a/css/style.css +++ b/css/style.css @@ -2849,6 +2849,81 @@ a.ms1-trad-link.btn-aide-trad{ margin:0; } +/* Remboursement PayPal — fiche gestion promoteur (formulaire + panneau doc) */ +.ms1-refund-wrap{ + width:100%; +} + +.ms1-refund-layout{ + display:flex; + flex-wrap:wrap; + align-items:flex-start; + gap:16px; +} + +.ms1-refund-main{ + flex:0 1 560px; + min-width:280px; + max-width:100%; +} + +.ms1-refund{ + border:1px solid #ddd; + border-radius:10px; + padding:14px; +} + +.ms1-refund--solo{ + max-width:560px; +} + +.ms1-refund-doc-aside{ + flex:1 1 280px; + min-width:240px; + max-width:100%; +} + +.ms1-refund-doc-panel{ + border:1px solid #dbe7ff; + border-radius:10px; + background:#f9fbff; + padding:14px 16px; + height:100%; +} + +.ms1-refund-doc-head{ + display:flex; + align-items:flex-start; + justify-content:space-between; + gap:10px; + margin-bottom:10px; +} + +.ms1-refund-doc-title{ + margin:0; + font-size:15px; + font-weight:700; + line-height:1.35; + color:#1a3a6b; +} + +.ms1-refund-doc-head-actions{ + flex-shrink:0; +} + +.ms1-refund-doc-body{ + font-size:13px; + line-height:1.55; + color:#333; +} + +@media (max-width:767px){ + .ms1-refund-main, + .ms1-refund-doc-aside{ + flex:1 1 100%; + } +} + /* Libelle d'invite devant le bouton facture (numero de commande). */ .inscr-gestion-facture-label{ align-self:center; diff --git a/php/inc_fx_doc.php b/php/inc_fx_doc.php index e8ae3b4..bb31c1a 100644 --- a/php/inc_fx_doc.php +++ b/php/inc_fx_doc.php @@ -444,6 +444,85 @@ function fxDocRenderBlock($anchorClef, $mem_global = 0, $strAriaLabel = 'Documen return fxDocRenderTrigger($anchorClef, $mem_global, $strAriaLabel) . fxDocRenderModule($anchorClef, $mem_global); } +/** Clés doc — panneau remboursement promoteur (fiche gestion inscriptions). */ +function fxDocRefundPromoteurAnchorClef() { + return 'inscr_gestion_refund_doc'; +} + +function fxDocRefundPromoteurPageClef() { + return 'inscr_gestion_refund_promoteur_info'; +} + +function fxDocRefundPromoteurModClef() { + return 'inscr_gestion_refund_doc'; +} + +/** Texte par défaut si doc_html vide (avant import SQL ou édition). */ +function fxDocRefundPromoteurFallback($strLangue) { + if ($strLangue === 'en') { + return array( + 'titre' => 'Refunds and MS1 fees', + 'html' => '
' + . '

As a promoter, you may refund the customer up to 100% of the transaction amount.

' + . '

However, MS1 platform fees are not refunded to the promoter. If you refund the customer, you absorb those fees — they remain your responsibility.

' + . '

The « Max refundable » amount is the PayPal balance available for this capture, not a reimbursement of MS1 fees.

' + . '
', + ); + } + + return array( + 'titre' => 'Remboursement et frais MS1', + 'html' => '
' + . '

En tant que promoteur, vous pouvez rembourser le client jusqu\'à 100 % du montant de la transaction.

' + . '

En revanche, les frais MS1 ne sont pas remboursés par la plateforme au promoteur. Si vous remboursez le client, vous assumez ces frais : ils restent à votre charge.

' + . '

Le montant « Max remboursable » correspond au solde PayPal disponible pour cette capture, et non au remboursement des frais MS1.

' + . '
', + ); +} + +/** + * Colonne droite du panneau remboursement (fiche gestion promoteur) — doc_html inline. + * Éditable via doc_edition.php (mode Textes, icône livre). + */ +function fxDocRenderRefundPromoteurAside() { + if (!fxDocSchemaReady()) { + return ''; + } + + $strAnchor = fxDocRefundPromoteurAnchorClef(); + $strPageClef = fxDocRefundPromoteurPageClef(); + $strModClef = fxDocRefundPromoteurModClef(); + $strLangue = fxDocLangue(); + + fxDocEnsurePage($strPageClef, 0, $strModClef); + + $strTitre = trim((string)afficheDocTitre($strPageClef, 0, 0, $strModClef)); + $strHtml = trim((string)afficheDocHtml($strPageClef, 0, 0, $strModClef)); + + $tabFallback = fxDocRefundPromoteurFallback($strLangue); + if ($strTitre === '' || $strTitre === '*' . $strPageClef . '*') { + $strTitre = $tabFallback['titre']; + } + if ($strHtml === '') { + $strHtml = $tabFallback['html']; + } + + $strEditBtn = function_exists('fxAdminDocButton') ? fxAdminDocButton($strAnchor, 0) : ''; + + $html = ''; + + return $html; +} + function fxSetDocMod($strAction, $tabData, $id = 0) { global $objDatabase; diff --git a/php/inc_settings.php b/php/inc_settings.php index 906bf0a..e6cde5c 100644 --- a/php/inc_settings.php +++ b/php/inc_settings.php @@ -7,8 +7,8 @@ * Constantes * * **************/ -define('_VERSION_CODE', '4.72.716'); -define('_DATE_CODE', '2026-06-29'); +define('_VERSION_CODE', '4.72.717'); +define('_DATE_CODE', '2026-06-30'); //MSIN-4290 define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe'); // Outil temporaire ms1_kc_set.php — modifier key_chain_http (lien /kc/{pk}/) diff --git a/sql/MSIN-inscr-gestion-refund-doc.sql b/sql/MSIN-inscr-gestion-refund-doc.sql new file mode 100644 index 0000000..2d7c1c0 --- /dev/null +++ b/sql/MSIN-inscr-gestion-refund-doc.sql @@ -0,0 +1,23 @@ +-- Panneau doc remboursement promoteur (fiche gestion inscriptions v2). +-- Anchor + module : fxDocRenderRefundPromoteurAside() / doc_edition.php (ancre inscr_gestion_refund_doc). +-- Prerequis : tables doc_mod / doc_page / doc_anchor (voir MSIN-doc-module.sql). + +SET NAMES utf8mb4; + +DELETE FROM doc_page WHERE doc_mod_clef = 'inscr_gestion_refund_doc'; +DELETE FROM doc_anchor WHERE doc_anchor_clef = 'inscr_gestion_refund_doc'; +DELETE FROM doc_mod WHERE doc_mod_clef = 'inscr_gestion_refund_doc'; + +INSERT INTO `doc_mod` (`doc_mod_clef`, `doc_mod_prg`, `doc_mod_titre`, `doc_mod_actif`, `doc_mod_tri`, `doc_mod_creation`) +VALUES ('inscr_gestion_refund_doc', 'compte.php', 'Remboursement promoteur', 1, 20, NOW()); + +INSERT INTO `doc_anchor` (`doc_anchor_clef`, `doc_mod_clef`, `doc_prg`, `doc_actif`, `doc_creation`) +VALUES ('inscr_gestion_refund_doc', 'inscr_gestion_refund_doc', 'compte.php', 1, NOW()); + +INSERT INTO `doc_page` (`doc_mod_clef`, `doc_page_clef`, `doc_langue`, `doc_titre`, `doc_sous_titre`, `doc_html`, `doc_prg`, `doc_tri`, `doc_actif`, `doc_creation`) VALUES +('inscr_gestion_refund_doc', 'inscr_gestion_refund_promoteur_info', 'fr', 'Remboursement et frais MS1', '', +'

En tant que promoteur, vous pouvez rembourser le client jusqu''à 100 % du montant de la transaction.

En revanche, les frais MS1 ne sont pas remboursés par la plateforme au promoteur. Si vous remboursez le client, vous assumez ces frais : ils restent à votre charge.

Le montant « Max remboursable » correspond au solde PayPal disponible pour cette capture, et non au remboursement des frais MS1.

', +'compte.php', 10, 1, NOW()), +('inscr_gestion_refund_doc', 'inscr_gestion_refund_promoteur_info', 'en', 'Refunds and MS1 fees', '', +'

As a promoter, you may refund the customer up to 100% of the transaction amount.

However, MS1 platform fees are not refunded to the promoter. If you refund the customer, you absorb those fees — they remain your responsibility.

The « Max refundable » amount is the PayPal balance available for this capture, not a reimbursement of MS1 fees.

', +'compte.php', 10, 1, NOW()); diff --git a/superadm/php/inc_fx_paypal.php b/superadm/php/inc_fx_paypal.php index 372c19a..160866f 100644 --- a/superadm/php/inc_fx_paypal.php +++ b/superadm/php/inc_fx_paypal.php @@ -1063,9 +1063,10 @@ function fxRefundComputeContext(array $recCommandes): array * est injecte via AJAX (innerHTML n'execute pas les