dolibarr 21.0.0-beta
stripe.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
26require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
27
34{
35 global $langs, $conf;
36
37 $h = 0;
38 $head = array();
39
40 $head[$h][0] = DOL_URL_ROOT."/stripe/admin/stripe.php";
41 $head[$h][1] = $langs->trans("Stripe");
42 $head[$h][2] = 'stripeaccount';
43 $h++;
44
45 $object = new stdClass();
46
47 // Show more tabs from modules
48 // Entries must be declared in modules descriptor with line
49 // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
50 // $this->tabs = array('entity:-tabname); to remove a tab
51 complete_head_from_modules($conf, $langs, $object, $head, $h, 'stripeadmin');
52
53 complete_head_from_modules($conf, $langs, $object, $head, $h, 'stripeadmin', 'remove');
54
55 return $head;
56}
57
58
66function html_print_stripe_footer($fromcompany, $langs)
67{
68 global $conf;
69
70 // Juridical status
71 $line1 = "";
72 if ($fromcompany->forme_juridique_code) {
73 $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code);
74 }
75 // Capital
76 if ($fromcompany->capital) {
77 $line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", $fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency);
78 }
79
80 $reg = array();
81
82 // Prof Id 1
83 if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
84 $field = $langs->transcountrynoentities("ProfId1", $fromcompany->country_code);
85 if (preg_match('/\‍((.*)\‍)/i', $field, $reg)) {
86 $field = $reg[1];
87 }
88 $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1;
89 }
90 // Prof Id 2
91 if ($fromcompany->idprof2) {
92 $field = $langs->transcountrynoentities("ProfId2", $fromcompany->country_code);
93 if (preg_match('/\‍((.*)\‍)/i', $field, $reg)) {
94 $field = $reg[1];
95 }
96 $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2;
97 }
98
99 // Second line of company infos
100 $line2 = "";
101 // Prof Id 3
102 if ($fromcompany->idprof3) {
103 $field = $langs->transcountrynoentities("ProfId3", $fromcompany->country_code);
104 if (preg_match('/\‍((.*)\‍)/i', $field, $reg)) {
105 $field = $reg[1];
106 }
107 $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3;
108 }
109 // Prof Id 4
110 if ($fromcompany->idprof4) {
111 $field = $langs->transcountrynoentities("ProfId4", $fromcompany->country_code);
112 if (preg_match('/\‍((.*)\‍)/i', $field, $reg)) {
113 $field = $reg[1];
114 }
115 $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4;
116 }
117 // IntraCommunautary VAT
118 if ($fromcompany->tva_intra != '') {
119 $line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
120 }
121
122 print '<br><br><hr>'."\n";
123 print '<div class="center"><span style="font-size: 10px;">'."\n";
124 print $fromcompany->name.'<br>';
125 print $line1.'<br>';
126 print $line2;
127 print '</span></div>'."\n";
128}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
getFormeJuridiqueLabel($code)
Return the name translated of juridical status.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
stripeadmin_prepare_head()
Define head array for tabs of stripe tools setup pages.
html_print_stripe_footer($fromcompany, $langs)
Show footer of company in HTML pages.