You can create a plugin to add JavaScript (and stylesheets) in targeted admin pages. By the description, I think the better is to inject the total amount field together with the existent fields. Or you can create a meta box to display it. And use Stack Overflow for all your jQuery needs.
<?php
/* Plugin Name: My plugin */
# Run only in /wp-admin/post.php
add_action( 'admin_print_scripts-post.php', function()
{
global $typenow;
// Run only for the types Posts and Movies
if( !in_array( $typenow, array( 'post', 'movie' ) ) )
return;
# codex.wordpress.org/Function_Reference/wp_enqueue_script
wp_enqueue_script(
'my-custom-posts',
plugins_url( '/my-custom-posts.js', __FILE__ ),
array(), // dependencies
false, // version
true // on footer
);
# codex.wordpress.org/Function_Reference/wp_localize_script
wp_localize_script(
'my-custom-posts',
'my_vars',
array( 'typenow' => $typenow )
);
});
And the file my-custom-posts.js
in the same folder as your plugin:
jQuery(document).ready(function($)
{
alert( my_vars.typenow );
// do your stuff
});