Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
invoice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web2project
invoice
Commits
787b3ace
Commit
787b3ace
authored
Jan 26, 2014
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addedit.php: refactor showtasklog()
parent
6b4f0383
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
addedit.php
addedit.php
+24
-22
No files found.
addedit.php
View file @
787b3ace
...
@@ -168,8 +168,6 @@ $q->addOrder('billingcode_name ASC');
...
@@ -168,8 +168,6 @@ $q->addOrder('billingcode_name ASC');
$billingcodes
=
$q
->
loadList
();
$billingcodes
=
$q
->
loadList
();
function
invoice_getTasks
(
&
$a
)
{
function
invoice_getTasks
(
&
$a
)
{
global
$project_id
;
$q
=
new
w2p_Database_Query
();
$q
=
new
w2p_Database_Query
();
$q
->
addQuery
(
'
$q
->
addQuery
(
'
task_log_id,
task_log_id,
...
@@ -186,14 +184,15 @@ function invoice_getTasks(&$a) {
...
@@ -186,14 +184,15 @@ function invoice_getTasks(&$a) {
$q
->
addOrder
(
'task_log_name ASC'
);
$q
->
addOrder
(
'task_log_name ASC'
);
$tmptasks
=
$q
->
exec
();
$tmptasks
=
$q
->
exec
();
if
(
!
$tmptasks
)
{
echo
db_error
();
return
null
;
}
$tasks
=
db_fetch_assoc
(
$tmptasks
);
$tasks
=
db_fetch_assoc
(
$tmptasks
);
return
$tasks
;
return
$tasks
;
}
}
function
invoice_showtask
(
&
$a
,
$tasks
)
{
function
invoice_getuser
(
&
$tasks
)
{
global
$AppUI
,
$project_id
,
$billingcodes
;
$df
=
$AppUI
->
getPref
(
'SHDATEFORMAT'
);
$q
=
new
w2p_Database_Query
();
$q
=
new
w2p_Database_Query
();
$q
->
addQuery
(
'
$q
->
addQuery
(
'
contact_first_name,
contact_first_name,
...
@@ -203,7 +202,19 @@ function invoice_showtask(&$a, $tasks) {
...
@@ -203,7 +202,19 @@ function invoice_showtask(&$a, $tasks) {
$q
->
addWhere
(
'user_id = '
.
$tasks
[
'task_log_creator'
]);
$q
->
addWhere
(
'user_id = '
.
$tasks
[
'task_log_creator'
]);
$tmpuser
=
$q
->
exec
();
$tmpuser
=
$q
->
exec
();
if
(
!
$tmpuser
)
{
echo
db_error
();
return
null
;
}
$username
=
db_fetch_assoc
(
$tmpuser
);
$username
=
db_fetch_assoc
(
$tmpuser
);
return
$username
;
}
function
invoice_showtask
(
&
$a
,
$tasks
)
{
global
$AppUI
,
$project_id
,
$billingcodes
;
$df
=
$AppUI
->
getPref
(
'SHDATEFORMAT'
);
$username
=
invoice_getuser
(
$tasks
);
if
(
$a
[
"task_amount"
]
==
"0"
)
{
if
(
$a
[
"task_amount"
]
==
"0"
)
{
$costdesc
=
"None"
;
$costdesc
=
"None"
;
...
@@ -242,26 +253,17 @@ function showtasklog(&$a) {
...
@@ -242,26 +253,17 @@ function showtasklog(&$a) {
global
$AppUI
,
$project_id
;
global
$AppUI
,
$project_id
;
$df
=
$AppUI
->
getPref
(
'SHDATEFORMAT'
);
$df
=
$AppUI
->
getPref
(
'SHDATEFORMAT'
);
$q
=
new
w2p_Database_Query
();
$username
=
invoice_getuser
(
$a
);
$q
->
addQuery
(
'
contact_first_name,
contact_last_name'
);
$q
->
addTable
(
'contacts'
);
$q
->
leftJoin
(
'users'
,
'u'
,
'user_contact = contact_id'
);
$q
->
addWhere
(
'user_id = '
.
$a
[
'task_log_creator'
]);
$tmpuser
=
$q
->
exec
();
$q
=
new
w2p_Database_Query
();
if
(
!
$tmpuser
)
{
echo
db_error
();
}
$username
=
db_fetch_assoc
(
$tmpuser
);
$q
->
clear
();
$q
->
addQuery
(
'task_invoice'
);
$q
->
addQuery
(
'task_invoice'
);
$q
->
addTable
(
'invoice_task_queue'
);
$q
->
addTable
(
'invoice_task_queue'
);
$q
->
addWhere
(
'task_log_id = '
.
$a
[
'task_log_id'
]);
$q
->
addWhere
(
'task_log_id = '
.
$a
[
'task_log_id'
]);
$tmpcheck
=
$q
->
exec
();
$tmpcheck
=
$q
->
exec
();
if
(
!
$tmpcheck
)
{
echo
db_error
();
}
$check
=
db_fetch_assoc
(
$tmpcheck
);
$check
=
db_fetch_assoc
(
$tmpcheck
);
$date
=
new
w2p_Utilities_Date
(
$a
[
'task_log_date'
]);
$date
=
new
w2p_Utilities_Date
(
$a
[
'task_log_date'
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment