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
5b7411cb
Commit
5b7411cb
authored
Jan 26, 2014
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creating new invoices
parent
7b6c779a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
do_invoice_aed.php
do_invoice_aed.php
+19
-17
invoice.class.php
invoice.class.php
+2
-2
No files found.
do_invoice_aed.php
View file @
5b7411cb
...
@@ -5,7 +5,7 @@ if (!defined('W2P_BASE_DIR')) {
...
@@ -5,7 +5,7 @@ if (!defined('W2P_BASE_DIR')) {
$del
=
w2PgetParam
(
$_POST
,
'del'
,
0
);
$del
=
w2PgetParam
(
$_POST
,
'del'
,
0
);
$stat
=
w2PgetParam
(
$_POST
,
'stat'
,
-
1
);
$stat
=
w2PgetParam
(
$_POST
,
'stat'
,
-
1
);
$tag
=
w2PgetParam
(
$_POST
,
'tag'
,
-
1
);
$tag
=
w2PgetParam
(
$_POST
,
'tag'
,
null
);
$obj
=
new
CInvoice
();
$obj
=
new
CInvoice
();
if
(
!
$obj
->
bind
(
$_POST
))
{
if
(
!
$obj
->
bind
(
$_POST
))
{
...
@@ -13,6 +13,8 @@ if (!$obj->bind( $_POST )) {
...
@@ -13,6 +13,8 @@ if (!$obj->bind( $_POST )) {
$AppUI
->
redirect
();
$AppUI
->
redirect
();
}
}
$obj
->
task_invoice
=
$_POST
[
"task_invoice"
];
$obj
->
task_invoice
=
$_POST
[
"task_invoice"
];
//$obj->invoice_tag = $_POST["invoice_tag"];
//$obj->$invoice_status = $_POST['$invoice_status'];
$AppUI
->
setMsg
(
'Invoice'
);
$AppUI
->
setMsg
(
'Invoice'
);
$msg
=
"m=invoice"
;
$msg
=
"m=invoice"
;
...
@@ -23,21 +25,8 @@ if ($del) {
...
@@ -23,21 +25,8 @@ if ($del) {
$AppUI
->
setMsg
(
"Invoice deleted"
,
UI_MSG_ALERT
);
$AppUI
->
setMsg
(
"Invoice deleted"
,
UI_MSG_ALERT
);
}
}
$msg
=
"m=invoice&a=addedit&invoice_id="
.
$obj
->
task_invoice
.
"&project_id="
.
$obj
->
invoice_project
;
$msg
=
"m=invoice&a=addedit&invoice_id="
.
$obj
->
task_invoice
.
"&project_id="
.
$obj
->
invoice_project
;
}
else
if
(
$stat
!=
-
1
&&
$obj
->
task_invoice
!=
0
)
{
if
(
!
$obj
->
change_status
(
$stat
))
{
$AppUI
->
setMsg
(
'Invoice status change failed'
,
UI_MSG_ERROR
);
}
else
{
$AppUI
->
setMsg
(
"Invoice status updated"
,
UI_MSG_ALERT
);
}
$msg
=
"m=invoice&a=addedit&invoice_id="
.
$obj
->
task_invoice
.
"&project_id="
.
$obj
->
invoice_project
;
}
else
if
(
$tag
!=
''
&&
$obj
->
task_invoice
!=
0
)
{
if
(
!
$obj
->
change_invoice_tag
(
$tag
))
{
$AppUI
->
setMsg
(
"Invoice tag change failed"
,
UI_MSG_ERROR
);
}
else
{
$AppUI
->
setMsg
(
"Invoice tag updated "
.
$tag
,
UI_MSG_ALERT
);
}
$msg
=
"m=invoice&a=addedit&invoice_id="
.
$obj
->
task_invoice
.
"&project_id="
.
$obj
->
invoice_project
;
}
else
{
}
else
{
$isNotNew
=
(
$obj
->
task_invoice
!=
0
);
while
(
list
(
$key
,
$value
)
=
each
(
$_POST
))
{
while
(
list
(
$key
,
$value
)
=
each
(
$_POST
))
{
$tmparr
=
split
(
"_"
,
$key
);
$tmparr
=
split
(
"_"
,
$key
);
if
(
$tmparr
[
0
]
==
"num"
)
{
if
(
$tmparr
[
0
]
==
"num"
)
{
...
@@ -49,7 +38,20 @@ if ($del) {
...
@@ -49,7 +38,20 @@ if ($del) {
}
}
}
}
}
}
$isNotNew
=
$obj
->
task_queue_id
;
if
(
$stat
!=
-
1
)
{
if
(
!
$obj
->
change_status
(
$stat
))
{
$AppUI
->
setMsg
(
'Invoice status change failed'
,
UI_MSG_ERROR
);
}
else
{
$AppUI
->
setMsg
(
"Invoice status updated"
,
UI_MSG_ALERT
);
}
}
if
(
$tag
)
{
if
(
!
$obj
->
change_invoice_tag
(
$tag
))
{
$AppUI
->
setMsg
(
"Invoice tag change failed"
,
UI_MSG_ERROR
);
}
else
{
$AppUI
->
setMsg
(
"Invoice tag updated"
,
UI_MSG_ALERT
);
}
}
$AppUI
->
setMsg
(
$isNotNew
?
'Invoice updated'
:
'Invoice inserted'
,
UI_MSG_OK
);
$AppUI
->
setMsg
(
$isNotNew
?
'Invoice updated'
:
'Invoice inserted'
,
UI_MSG_OK
);
$msg
=
"m=invoice&a=addedit&invoice_id="
.
$obj
->
task_invoice
.
"&project_id="
.
$obj
->
invoice_project
;
$msg
=
"m=invoice&a=addedit&invoice_id="
.
$obj
->
task_invoice
.
"&project_id="
.
$obj
->
invoice_project
;
}
}
...
...
invoice.class.php
View file @
5b7411cb
...
@@ -17,7 +17,7 @@ class CInvoice extends w2p_Core_BaseObject {
...
@@ -17,7 +17,7 @@ class CInvoice extends w2p_Core_BaseObject {
public
$invoice_creator
=
null
;
public
$invoice_creator
=
null
;
// table 'invoice_task_queue'
// table 'invoice_task_queue'
public
$
invoice_
task_queue_id
=
null
;
public
$task_queue_id
=
null
;
public
$task_invoice
=
null
;
public
$task_invoice
=
null
;
public
$task_log_id
=
null
;
public
$task_log_id
=
null
;
public
$task_amount
=
null
;
public
$task_amount
=
null
;
...
@@ -91,7 +91,7 @@ class CInvoice extends w2p_Core_BaseObject {
...
@@ -91,7 +91,7 @@ class CInvoice extends w2p_Core_BaseObject {
$this
->
clearErrors
();
$this
->
clearErrors
();
$q
=
$this
->
_getQuery
();
$q
=
$this
->
_getQuery
();
$q
->
setDelete
(
'invoice_task_queue'
);
$q
->
setDelete
(
'invoice_task_queue'
);
$q
->
addWhere
(
'task_queue_id = '
.
$this
->
_
task_queue_id
);
$q
->
addWhere
(
'task_queue_id = '
.
$this
->
task_queue_id
);
if
(
!
$q
->
exec
())
{
if
(
!
$q
->
exec
())
{
$this
->
_error
[
'delete-invoice'
]
=
db_error
();
$this
->
_error
[
'delete-invoice'
]
=
db_error
();
return
false
;
return
false
;
...
...
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