Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
8fd3642d
Commit
8fd3642d
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Error if country not defined
parent
ded13125
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/compta/sociales/index.php
+79
-66
79 additions, 66 deletions
htdocs/compta/sociales/index.php
htdocs/core/class/html.form.class.php
+6
-2
6 additions, 2 deletions
htdocs/core/class/html.form.class.php
with
85 additions
and
68 deletions
htdocs/compta/sociales/index.php
+
79
−
66
View file @
8fd3642d
...
...
@@ -21,7 +21,7 @@
/**
* \file htdocs/compta/sociales/index.php
* \ingroup tax
* \brief
Ecran des charges sociale
s
* \brief
Page to list all social contribution
s
* \version $Id$
*/
...
...
@@ -130,83 +130,96 @@ if ($resql)
print
$mesg
.
"<br>"
;
}
print
'<form method="GET" action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'">'
;
print
"<table class=
\"
noborder
\"
width=
\"
100%
\"
>"
;
print
"<tr class=
\"
liste_titre
\"
>"
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
"index.php"
,
"id"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Label"
),
"index.php"
,
"s.libelle"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Type"
),
"index.php"
,
"type"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"PeriodEndDate"
),
"index.php"
,
"periode"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Amount"
),
"index.php"
,
"s.amount"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"DateDue"
),
"index.php"
,
"de"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
"index.php"
,
"s.paye"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print
"</tr>
\n
"
;
print
'<tr class="liste_titre">'
;
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
// Type
print
'<td class="liste_titre" align="left">'
;
$html
->
select_type_socialcontrib
(
$typeid
,
'typeid'
,
1
,
16
,
0
);
print
'</td>'
;
// Period end date
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre" align="right">'
;
print
'<input type="image" class="liste_titre" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" name="button_search" alt="'
.
$langs
->
trans
(
"Search"
)
.
'">'
;
print
'</td>'
;
print
"</tr>
\n
"
;
while
(
$i
<
min
(
$num
,
$limit
))
if
(
empty
(
$mysoc
->
pays_id
)
&&
empty
(
$mysoc
->
pays_code
))
{
print
'<div class="error">'
;
$langs
->
load
(
"errors"
);
$countrynotdefined
=
$langs
->
trans
(
"ErrorSetACountryFirst"
);
print
$countrynotdefined
;
print
'</div>'
;
}
else
{
$obj
=
$db
->
fetch_object
(
$resql
);
$var
=
!
$var
;
print
"<tr
$bc[$var]
>"
;
print
'<form method="GET" action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'">'
;
// Ref
print
'<td width="60">'
;
$chargesociale_static
->
id
=
$obj
->
id
;
$chargesociale_static
->
lib
=
$obj
->
id
;
$chargesociale_static
->
ref
=
$obj
->
id
;
print
$chargesociale_static
->
getNomUrl
(
1
,
'20'
);
print
'</td>'
;
print
"<table class=
\"
noborder
\"
width=
\"
100%
\"
>"
;
// Label
print
'<td>'
.
dol_trunc
(
$obj
->
libelle
,
42
)
.
'</td>'
;
print
"<tr class=
\"
liste_titre
\"
>"
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
"index.php"
,
"id"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Label"
),
"index.php"
,
"s.libelle"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Type"
),
"index.php"
,
"type"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"PeriodEndDate"
),
"index.php"
,
"periode"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Amount"
),
"index.php"
,
"s.amount"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"DateDue"
),
"index.php"
,
"de"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
"index.php"
,
"s.paye"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print
"</tr>
\n
"
;
print
'<tr class="liste_titre">'
;
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
// Type
print
'<td>'
.
dol_trunc
(
$obj
->
type_lib
,
16
)
.
'</td>'
;
print
'<td class="liste_titre" align="left">'
;
$html
->
select_type_socialcontrib
(
$typeid
,
'typeid'
,
1
,
16
,
0
);
print
'</td>'
;
// Period end date
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre" align="right">'
;
print
'<input type="image" class="liste_titre" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" name="button_search" alt="'
.
$langs
->
trans
(
"Search"
)
.
'">'
;
print
'</td>'
;
print
"</tr>
\n
"
;
// Date end period
print
'<td align="center">'
;
if
(
$obj
->
periode
)
while
(
$i
<
min
(
$num
,
$limit
))
{
print
'<a href="index.php?year='
.
strftime
(
"%Y"
,
$db
->
jdate
(
$obj
->
periode
))
.
'">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
periode
),
'day'
)
.
'</a>'
;
$obj
=
$db
->
fetch_object
(
$resql
);
$var
=
!
$var
;
print
"<tr
$bc[$var]
>"
;
// Ref
print
'<td width="60">'
;
$chargesociale_static
->
id
=
$obj
->
id
;
$chargesociale_static
->
lib
=
$obj
->
id
;
$chargesociale_static
->
ref
=
$obj
->
id
;
print
$chargesociale_static
->
getNomUrl
(
1
,
'20'
);
print
'</td>'
;
// Label
print
'<td>'
.
dol_trunc
(
$obj
->
libelle
,
42
)
.
'</td>'
;
// Type
print
'<td>'
.
dol_trunc
(
$obj
->
type_lib
,
16
)
.
'</td>'
;
// Date end period
print
'<td align="center">'
;
if
(
$obj
->
periode
)
{
print
'<a href="index.php?year='
.
strftime
(
"%Y"
,
$db
->
jdate
(
$obj
->
periode
))
.
'">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
periode
),
'day'
)
.
'</a>'
;
}
else
{
print
' '
;
}
print
'</td>'
;
print
'<td align="right" width="100">'
.
price
(
$obj
->
amount
)
.
'</td>'
;
// Due date
print
'<td width="110" align="center">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
de
),
'day'
)
.
'</td>'
;
print
'<td align="right" nowrap="nowrap">'
.
$chargesociale_static
->
LibStatut
(
$obj
->
paye
,
5
)
.
'</a></td>'
;
print
'</tr>'
;
$i
++
;
}
else
{
print
' '
;
}
print
'</td>'
;
print
'<td align="right" width="100">'
.
price
(
$obj
->
amount
)
.
'</td>'
;
// Due date
print
'<td width="110" align="center">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
de
),
'day'
)
.
'</td>'
;
print
'</table>'
;
print
'<td align="right" nowrap="nowrap">'
.
$chargesociale_static
->
LibStatut
(
$obj
->
paye
,
5
)
.
'</a></td>'
;
print
'</tr>'
;
$i
++
;
print
'</form>'
;
}
print
'</table>'
;
print
'</form>'
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/html.form.class.php
+
6
−
2
View file @
8fd3642d
...
...
@@ -345,7 +345,7 @@ class Form
/**
* \brief Return list of social contributions.
* \remarks Use mysoc->pays_id or mysoc->pays_code
* \remarks Use mysoc->pays_id or mysoc->pays_code
so they must be defined.
* \param selected Preselected type
* \param htmlname Name of field in form
* \param useempty Set to 1 if we want an empty value
...
...
@@ -356,7 +356,11 @@ class Form
{
global
$db
,
$langs
,
$user
,
$mysoc
;
if
(
empty
(
$mysoc
->
pays_id
)
&&
empty
(
$mysoc
->
pays_code
))
dol_print_error
(
''
,
'ErrorBadParameter'
);
if
(
empty
(
$mysoc
->
pays_id
)
&&
empty
(
$mysoc
->
pays_code
))
{
dol_print_error
(
''
,
'Call to select_type_socialcontrib with mysoc country not yet defined'
);
exit
;
}
if
(
!
empty
(
$mysoc
->
pays_id
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment