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
2775250c
Commit
2775250c
authored
9 years ago
by
Florian Henry
Browse files
Options
Downloads
Patches
Plain Diff
Fix TYPE_SITUATION on sell journals
parent
6806e2b3
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/accountancy/journal/sellsjournal.php
+12
-6
12 additions, 6 deletions
htdocs/accountancy/journal/sellsjournal.php
htdocs/compta/journal/sellsjournal.php
+10
-4
10 additions, 4 deletions
htdocs/compta/journal/sellsjournal.php
with
22 additions
and
10 deletions
htdocs/accountancy/journal/sellsjournal.php
+
12
−
6
View file @
2775250c
...
...
@@ -89,8 +89,8 @@ $idpays = $p[0];
$sql
=
"SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client,"
;
$sql
.
=
" fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,"
;
$sql
.
=
" s.rowid as socid, s.nom as name, s.code_compta, s.code_client,"
;
$sql
.
=
" p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,
"
;
$sql
.
=
" ct.accountancy_code_sell as account_tva"
;
$sql
.
=
" p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,"
;
$sql
.
=
"
fd.situation_percent,
ct.accountancy_code_sell as account_tva"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"facturedet as fd"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"product as p ON p.rowid = fd.fk_product"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation"
;
...
...
@@ -143,10 +143,16 @@ if ($result) {
$line
=
new
FactureLigne
(
$db
);
$line
->
fetch
(
$obj
->
rowid
);
$prev_progress
=
$line
->
get_prev_progress
();
if
(
$obj
->
situation_percent
==
0
)
{
// Avoid divide by 0
$situation_ratio
=
0
;
}
else
{
$situation_ratio
=
(
$obj
->
situation_percent
-
$prev_progress
)
/
$obj
->
situation_percent
;
if
(
$obj
->
type
==
5
)
{
// Avoid divide by 0
if
(
$obj
->
situation_percent
==
0
)
{
$situation_ratio
=
0
;
}
else
{
$situation_ratio
=
(
$obj
->
situation_percent
-
$prev_progress
)
/
$obj
->
situation_percent
;
}
}
else
{
$situation_ratio
=
1
;
}
// Invoice lines
...
...
This diff is collapsed.
Click to expand it.
htdocs/compta/journal/sellsjournal.php
+
10
−
4
View file @
2775250c
...
...
@@ -163,10 +163,16 @@ if ($result)
$line
=
new
FactureLigne
(
$db
);
$line
->
fetch
(
$obj
->
id
);
$prev_progress
=
$line
->
get_prev_progress
();
if
(
$obj
->
situation_percent
==
0
)
{
// Avoid divide by 0
$situation_ratio
=
0
;
}
else
{
$situation_ratio
=
(
$obj
->
situation_percent
-
$prev_progress
)
/
$obj
->
situation_percent
;
if
(
$obj
->
type
==
5
)
{
// Avoid divide by 0
if
(
$obj
->
situation_percent
==
0
)
{
$situation_ratio
=
0
;
}
else
{
$situation_ratio
=
(
$obj
->
situation_percent
-
$prev_progress
)
/
$obj
->
situation_percent
;
}
}
else
{
$situation_ratio
=
1
;
}
//la ligne facture
...
...
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