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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
7a98bef5
Commit
7a98bef5
authored
Oct 11, 2010
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Qual: Uniformize code
parent
1a893d4d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/compta/sociales/charges.php
+2
-1
2 additions, 1 deletion
htdocs/compta/sociales/charges.php
htdocs/compta/sociales/class/chargesociales.class.php
+39
-8
39 additions, 8 deletions
htdocs/compta/sociales/class/chargesociales.class.php
with
41 additions
and
9 deletions
htdocs/compta/sociales/charges.php
+
2
−
1
View file @
7a98bef5
...
...
@@ -53,7 +53,8 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
if
(
$_REQUEST
[
"action"
]
==
'confirm_paid'
&&
$_REQUEST
[
"confirm"
]
==
'yes'
)
{
$chargesociales
=
new
ChargeSociales
(
$db
);
$result
=
$chargesociales
->
set_paid
(
$chid
);
$chargesociales
->
fetch
(
$chid
);
$result
=
$chargesociales
->
set_paid
(
$user
);
}
/*
...
...
This diff is collapsed.
Click to expand it.
htdocs/compta/sociales/class/chargesociales.class.php
+
39
−
8
View file @
7a98bef5
...
...
@@ -36,6 +36,7 @@ class ChargeSociales extends CommonObject
var
$db
;
var
$error
;
var
$element
=
'rowid'
;
var
$table
=
'chargesociales'
;
var
$table_element
=
'chargesociales'
;
var
$id
;
...
...
@@ -227,13 +228,17 @@ class ChargeSociales extends CommonObject
}
/**
*
\brief Tag la charge comme
paye
e
complete
ment
*
\
param
rowid
id de la ligne a modifier
*
Tag social contribution as
paye
d
complete
ly
*
@
param
user
Object user making change
*/
function
set_paid
(
$
rowid
)
function
set_paid
(
$
user
)
{
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"chargesociales set paye=1 WHERE rowid = "
.
$rowid
;
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"chargesociales"
;
$sql
.
=
" set paye=1"
;
$sql
.
=
" WHERE rowid = "
.
$this
->
id
;
$return
=
$this
->
db
->
query
(
$sql
);
if
(
$return
)
return
1
;
else
return
-
1
;
}
/**
...
...
@@ -316,8 +321,8 @@ class ChargeSociales extends CommonObject
}
/**
*
\brief
Return amount of payments already done
*
\
return int Amount of payment already done, <0 if KO
* Return amount of payments already done
*
@
return int Amount of payment already done, <0 if KO
*/
function
getSommePaiement
()
{
...
...
@@ -332,15 +337,41 @@ class ChargeSociales extends CommonObject
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
$amount
=
0
;
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
if
(
$obj
)
$amount
=
$obj
->
amount
?
$obj
->
amount
:
0
;
$this
->
db
->
free
(
$resql
);
return
$
obj
->
amount
;
return
$amount
;
}
else
{
return
-
1
;
}
}
/**
* Initialise an example of social contribution with random values
* Used to build previews or test instances
*/
function
initAsSpecimen
()
{
global
$user
,
$langs
,
$conf
;
// Initialize parameters
$this
->
id
=
0
;
$this
->
ref
=
'SPECIMEN'
;
$this
->
specimen
=
1
;
$this
->
paye
=
0
;
$this
->
date
=
time
();
$this
->
date_ech
=
$this
->
date
+
3600
*
24
*
30
;
$this
->
period
=
$this
->
date
+
3600
*
24
*
30
;
$this
->
amount
=
100
;
$this
->
lib
=
0
;
$this
->
type
=
1
;
$this
->
type_libelle
=
'Social contribution label'
;
}
}
?>
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