Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
33725e22
authored
2011-02-01 16:06:29 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
user manager pay history
1 parent
33bf7108
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
0 deletions
com/UserManager/UserManager.js
com/UserManager/UserManager.php
com/UserManager/views/edit_user_overview.php
com/UserManager/views/edit_user_payhistory.php
com/UserManager/UserManager.js
View file @
33725e2
...
...
@@ -21,6 +21,23 @@ jQuery(function($) {
);
}
jQuery
(
'#creditNotBtn'
).
click
(
function
(
e
)
{
jQuery
(
'#credit_note'
).
slideToggle
(
'fast'
);
jQuery
(
'#creditForm'
).
ajaxForm
({
url
:
'/wp-admin/admin-ajax.php'
,
data
:
({
ajax
:
"yes"
,
action
:
'add_credit_note'
})
,
dateType
:
'json'
,
type
:
'POST'
,
success
:
function
(
data
)
{
// reload, cannot use reload() because then the form values get re-applied.
document
.
location
.
href
=
document
.
location
.
href
;
}
});
e
.
preventDefault
();
return
false
;
});
jQuery
(
'.remove-user'
).
colorbox
({
onComplete
:
function
()
{
var
cb
=
this
;
...
...
com/UserManager/UserManager.php
View file @
33725e2
...
...
@@ -18,12 +18,14 @@ use Tz\WordPress\CBV;
use
Tz\WordPress\CBV\User
;
use
Tz\WordPress\CBV\Events
;
use
Tz\WordPress\CBV\CEHours
;
use
Tz\WordPress\CBV\Invoice
;
use
Exception
,
StdClass
;
use
WP_User
;
const
OPTION_NAME
=
"user_options"
;
const
CAPABILITY
=
"manage_cbv_users"
;
CBV\load
(
'Invoice'
);
CBV\load
(
'User'
);
Tools\import
(
'HTML'
);
...
...
@@ -661,6 +663,62 @@ class Actions {
die
(
json_encode
(
$return
));
}
public
static
function
wp_ajax_add_credit_note
()
{
$uid
=
$_POST
[
'uid'
];
$title
=
$_POST
[
'title'
];
$amount
=
"-"
.
$_POST
[
'amount'
];
global
$wpdb
;
$items
=
array
();
$items
[]
=
array
(
'post_id'
=>
0
,
'cost'
=>
$amount
,
'discount_label'
=>
""
,
'discount_amount'
=>
""
,
'tax_label'
=>
""
,
'tax_rate'
=>
""
,
'tax_amount'
=>
""
,
'subtotal'
=>
$amount
,
'total'
=>
$amount
,
'description'
=>
"Credit Note"
,
'extras'
=>
array
()
);
$invoice_data
=
array
();
$invoice_data
[
'items'
]
=
$items
;
$invoice_data
[
'payment'
]
=
array
(
'total_cost'
=>
$amount
,
'total_discounts'
=>
""
,
'total_taxes'
=>
""
,
'subtotal'
=>
$amount
,
'total'
=>
$amount
,
'bt_address'
=>
""
,
'bt_address2'
=>
""
,
'bt_city'
=>
""
,
'bt_province'
=>
""
,
'bt_country'
=>
""
,
'bt_postal'
=>
""
,
'bt_card_holder'
=>
""
,
'bt_card_number'
=>
""
,
'bt_card_type'
=>
""
);
Invoice\create
(
$invoice_data
,
'credit'
,
$title
,
$uid
,
'credit'
,
'publish'
,
$amount
);
// return json object
$return
=
array
(
'success'
=>
'true'
);
die
(
json_encode
(
$return
));
}
public
static
function
wp_ajax_post_credit
()
{
$uid
=
$_POST
[
'uid'
];
...
...
com/UserManager/views/edit_user_overview.php
View file @
33725e2
...
...
@@ -204,6 +204,7 @@ use WP_User, WP_Roles;
</div>
<div
style=
"clear:both;"
></div>
</div>
<div
style=
"clear:both;"
></div>
</div>
...
...
com/UserManager/views/edit_user_payhistory.php
View file @
33725e2
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment