Feat/billing history #3
@@ -20,6 +20,7 @@ import Store from './pages/app/Store';
|
||||
import Checkout from './pages/app/Checkout';
|
||||
import Services from './pages/app/Services';
|
||||
import Support from './pages/app/Support';
|
||||
import BillingHistory from './pages/app/BillingHistory';
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
@@ -49,6 +50,7 @@ export default function App() {
|
||||
<Route path="/checkout/:productId" element={<Checkout />} />
|
||||
<Route path="/services" element={<Services />} />
|
||||
<Route path="/support" element={<Support />} />
|
||||
<Route path="/facturation" element={<BillingHistory />} />
|
||||
</Route>
|
||||
|
||||
</Route>
|
||||
|
||||
@@ -246,8 +246,9 @@ export default function WebServiceSubscriptionManager({ order, onClose, onRefres
|
||||
// 🛡️ NOUVELLE LOGIQUE DE RÉSILIATION (US 2.1 / 2.2)
|
||||
// ==========================================
|
||||
const calculateRefundEligibility = () => {
|
||||
if (!order || !order.created_at) return false;
|
||||
const orderDate = new Date(order.created_at);
|
||||
if (!order || !order.activated_at) return false;
|
||||
const orderDate = new Date(order.activated_at);
|
||||
console.log("Order Date:", orderDate);
|
||||
const now = new Date();
|
||||
const diffDays = Math.ceil(Math.abs(now - orderDate) / (1000 * 60 * 60 * 24));
|
||||
return diffDays <= 14;
|
||||
@@ -508,7 +509,7 @@ export default function WebServiceSubscriptionManager({ order, onClose, onRefres
|
||||
<p className="text-emerald-500/80 mt-2">
|
||||
Votre abonnement a été activé il y a moins de 14 jours.
|
||||
<strong className="text-emerald-400"> Vous allez être intégralement remboursé</strong>.
|
||||
Vos services HestiaCP et bases de données seront supprimés immédiatement.
|
||||
Vos services seront supprimés immédiatement.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
@@ -74,10 +74,7 @@ export default function AppLayout() {
|
||||
</div>
|
||||
</NavLink>
|
||||
|
||||
<div className="flex justify-between items-center px-6 py-4 text-[#444] border-l-4 border-transparent uppercase tracking-widest text-sm font-mono cursor-not-allowed select-none">
|
||||
<span>Facturation</span>
|
||||
<span className="text-[9px] text-[#333] border border-[#333] px-1.5 py-0.5 rounded font-bold">WIP</span>
|
||||
</div>
|
||||
<NavLink className={navLinkClass} to="/facturation">Facturation</NavLink>
|
||||
<div className="flex justify-between items-center px-6 py-4 text-[#444] border-l-4 border-transparent uppercase tracking-widest text-sm font-mono cursor-not-allowed select-none">
|
||||
<span>Profil & Sécurité</span>
|
||||
<span className="text-[9px] text-[#333] border border-[#333] px-1.5 py-0.5 rounded font-bold">WIP</span>
|
||||
|
||||
@@ -70,6 +70,7 @@ export default function Dashboard() {
|
||||
|
||||
// 🌟 Plus besoin de charger les IPs, on ouvre juste la modale comptable !
|
||||
const handleManageSubscription = (order) => {
|
||||
console.log("Gestion de l'abonnement pour la commande :", order);
|
||||
// 1. Détection du type de service
|
||||
const titleLower = (order.title || '').toLowerCase();
|
||||
const isVPS = titleLower.includes('vps') || titleLower.includes('compute');
|
||||
|
||||
@@ -305,12 +305,12 @@ export const updateHostingPlan = (order_id, new_plan_id) =>
|
||||
// Suppression
|
||||
// Modification
|
||||
// Lister
|
||||
export const getInvoiceList = () =>
|
||||
apiCall(`${BASE_URL}/api/client/invoice/get_list`);
|
||||
export const getInvoiceList = (client_id) =>
|
||||
apiCall(`${BASE_URL}/api/client/invoice/get_list`, { client_id: client_id });
|
||||
|
||||
// Lire
|
||||
export const getInvoiceDetails = (InvoiceHash) =>
|
||||
apiCall(`${BASE_URL}/api/client/invoice/get`);
|
||||
export const getInvoiceDetails = (invoiceHash) =>
|
||||
apiCall(`${BASE_URL}/api/client/invoice/get`, { hash: invoiceHash });
|
||||
|
||||
|
||||
// ==========================================
|
||||
|
||||
Reference in New Issue
Block a user