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
344263f5
Commit
344263f5
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix travis
parent
504ea853
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/loan/calcmens.php
+2
-2
2 additions, 2 deletions
htdocs/loan/calcmens.php
htdocs/loan/class/loanschedule.class.php
+28
-12
28 additions, 12 deletions
htdocs/loan/class/loanschedule.class.php
htdocs/loan/createschedule.php
+1
-1
1 addition, 1 deletion
htdocs/loan/createschedule.php
with
31 additions
and
15 deletions
htdocs/loan/calcmens.php
+
2
−
2
View file @
344263f5
This diff is collapsed.
Click to expand it.
htdocs/loan/class/loanschedule.class.php
+
28
−
12
View file @
344263f5
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/commonobject.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/commonobject.class.php'
;
/**
\class LoanSchedule
/**
*
\brief
Class to manage Schedule of loans
* Class to manage Schedule of loans
*/
*/
class
LoanSchedule
extends
CommonObject
class
LoanSchedule
extends
CommonObject
{
{
...
@@ -382,10 +382,10 @@ class LoanSchedule extends CommonObject
...
@@ -382,10 +382,10 @@ class LoanSchedule extends CommonObject
/**
/**
* Load all object in memory from database
* Load all object in memory from database
*
*
* @param int $
id
Id object
* @param int $
loanid
Id object
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, >0 if OK
*/
*/
function
fetchall
(
$loan
)
function
fetchall
(
$loan
id
)
{
{
global
$langs
;
global
$langs
;
...
@@ -406,7 +406,7 @@ class LoanSchedule extends CommonObject
...
@@ -406,7 +406,7 @@ class LoanSchedule extends CommonObject
$sql
.
=
" t.fk_user_creat,"
;
$sql
.
=
" t.fk_user_creat,"
;
$sql
.
=
" t.fk_user_modif"
;
$sql
.
=
" t.fk_user_modif"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
$this
->
table_element
.
" as t"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
$this
->
table_element
.
" as t"
;
$sql
.
=
" WHERE t.fk_loan = "
.
$loan
;
$sql
.
=
" WHERE t.fk_loan = "
.
$loan
id
;
dol_syslog
(
get_class
(
$this
)
.
"::fetchall"
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
"::fetchall"
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
...
@@ -446,6 +446,11 @@ class LoanSchedule extends CommonObject
...
@@ -446,6 +446,11 @@ class LoanSchedule extends CommonObject
}
}
}
}
/**
* trans_paiment
*
* @return void
*/
function
trans_paiment
()
function
trans_paiment
()
{
{
require_once
DOL_DOCUMENT_ROOT
.
'/loan/class/loan.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/loan/class/loan.class.php'
;
...
@@ -482,11 +487,17 @@ class LoanSchedule extends CommonObject
...
@@ -482,11 +487,17 @@ class LoanSchedule extends CommonObject
}
}
function
lastpaiment
(
$loan
)
/**
* trans_paiment
*
* @param int $loanid Loan id
* @return int < 0 if KO, Date > 0 if OK
*/
function
lastpaiment
(
$loanid
)
{
{
$sql
=
"SELECT p.datep"
;
$sql
=
"SELECT p.datep"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"payment_loan as p "
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"payment_loan as p "
;
$sql
.
=
" WHERE p.fk_loan = "
.
$loan
;
$sql
.
=
" WHERE p.fk_loan = "
.
$loan
id
;
$sql
.
=
" ORDER BY p.datep DESC "
;
$sql
.
=
" ORDER BY p.datep DESC "
;
$sql
.
=
" LIMIT 1 "
;
$sql
.
=
" LIMIT 1 "
;
...
@@ -500,22 +511,27 @@ class LoanSchedule extends CommonObject
...
@@ -500,22 +511,27 @@ class LoanSchedule extends CommonObject
}
}
}
}
function
paimenttorecord
(
$loan
,
$datemax
)
/**
* paimenttorecord
*
* @param int $loanid Loan id
* @param int $datemax Date max
* @return array Array of id
*/
function
paimenttorecord
(
$loanid
,
$datemax
)
{
{
$sql
=
"SELECT p.rowid"
;
$sql
=
"SELECT p.rowid"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
$this
->
table_element
.
" as p "
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
$this
->
table_element
.
" as p "
;
$sql
.
=
" WHERE p.fk_loan = "
.
$loan
;
$sql
.
=
" WHERE p.fk_loan = "
.
$loan
id
;
if
(
!
empty
(
$datemax
))
{
$sql
.
=
" AND p.datep > '"
.
$this
->
db
->
idate
(
$datemax
)
.
"'"
;}
if
(
!
empty
(
$datemax
))
{
$sql
.
=
" AND p.datep > '"
.
$this
->
db
->
idate
(
$datemax
)
.
"'"
;}
$sql
.
=
" AND p.datep <= '"
.
$this
->
db
->
idate
(
dol_now
())
.
"'"
;
$sql
.
=
" AND p.datep <= '"
.
$this
->
db
->
idate
(
dol_now
())
.
"'"
;
$resql
=
$this
->
db
->
query
(
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
){
if
(
$resql
){
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
{
$result
[]
=
$obj
->
rowid
;
$result
[]
=
$obj
->
rowid
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/loan/createschedule.php
+
1
−
1
View file @
344263f5
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