diff --git a/NdisPrice.php b/NdisPrice.php
index 4082646..15487f9 100644
--- a/NdisPrice.php
+++ b/NdisPrice.php
@@ -62,6 +62,20 @@ class NdisPrice{
return "";
}
+ public function get_tos_full_str($ndis_code)
+ {
+ foreach ($this->tos as $r){
+ if ($ndis_code == $r->code){
+ return sprintf("%.2f - %s %s %s",
+ (float) $r->price,
+ $r->name,
+ $this->get_level((int) $r->level),
+ $r->ot);
+ }
+ }
+ return "";
+ }
+
public function get_tos_price($ndis_code)
{
foreach ($this->tos as $r){
diff --git a/css/xeroc.css b/css/xeroc.css
index d5cb828..e5ae754 100644
--- a/css/xeroc.css
+++ b/css/xeroc.css
@@ -178,4 +178,13 @@ img.waiting_invoice_number{
animation: blinker 0.3s linear infinite;
}
+td.invoice_summary{
+ text-align:center;
+ background-color:lightcyan;
+ font-weight:900;
+ color:green;
+}
+td.invoice_summary_header{
+ background-color: #ededed;
+}
diff --git a/html/bts_client_invoice_template.html b/html/bts_client_invoice_template.html
index 96ffde3..d2e813c 100644
--- a/html/bts_client_invoice_template.html
+++ b/html/bts_client_invoice_template.html
@@ -49,6 +49,46 @@
{{/jobs}}
+ {{#has_summary}}
+
+ |
+ Summary for above client
+ |
+
+
+ |
+
+
+
+
+ |
+
+ {{/has_summary}}
+ {{#summary}}
+
+ |
+ {{tos}} |
+ {{ndis}} |
+ {{Hours}} |
+ |
+ |
+
+ {{/summary}}
+ {{#has_summary}}
+
+ |
+
+
+
+
+ |
+
+ |
+ End of summary
+ |
+
+
+ {{/has_summary}}
diff --git a/html/email_feedback_url.html b/html/email_feedback_url.html
new file mode 100644
index 0000000..a2b6267
--- /dev/null
+++ b/html/email_feedback_url.html
@@ -0,0 +1,31 @@
+Dear Helen,
+
+This is your Feedback link for
+
+=== {{display_name}} =====
+
+SMS content below:
+
+
+------------- copy from here -----------------
+
+Dear {{display_name}},
+please use it confirm our staff has provided service for you
+http://acaresydney.com.au/feedback_card/{{user_login}}
+
+------------- copy end here--------------------
+
+
+
+
+**************************************************************
+Please DO NOT click this link on your office computer,
+you will become this customer instead of timesheet manager.
+If you happen to click it by mistake,
+please contact your IT support to have this error fixed.
+**************************************************************
+
+Kind Regards
+Team of
+AcareSydney WebOffice
+Hotline 02 8103 5092
\ No newline at end of file
diff --git a/js/bts_timesheet.js b/js/bts_timesheet.js
index d44727d..5f7b3e9 100644
--- a/js/bts_timesheet.js
+++ b/js/bts_timesheet.js
@@ -1471,6 +1471,25 @@
$( ".boundary_datepicker" ).datepicker();
$( ".boundary_datepicker" ).datepicker("option", "dateFormat", "yy-mm-dd");
+ $(document).on('click', 'div.clientlist div[name="title"] a', function(e){
+ e.preventDefault();
+ e.stopPropagation();
+ var id = $(this).closest('label.peopleitem').attr('data-id').substring(1);
+ var str = 'https://acaresydncy.com.au/feedback_card/' + id;
+ var name = $(this).html();
+ if ( confirm ("Email feedback link of : " + name + "\n\n\n" + str + "\n\n\n to helen@acaresydney.com.au?")){
+ $.post(bts().ajax_url, { // POST request
+ _ajax_nonce: bts().nonce, // nonce
+ action: "email_feedback_url", // action
+ client : id,
+ }, function(response, status, xhr){
+ //alert('please check your email on the phone and SMS the link to your client');
+ }).fail(function(){
+ alert('network error ');
+ });
+ }
+ });
+
init_ts();
diff --git a/ts.php b/ts.php
index fd7d777..3bab0f1 100644
--- a/ts.php
+++ b/ts.php
@@ -63,6 +63,8 @@ class AcareOffice{
add_action('wp_ajax_list_job', array($this,'list_job' ));
add_action('wp_ajax_delete_job', array($this,'delete_job' ));
add_action('wp_ajax_email_job', array($this,'email_job' ));
+ add_action('wp_ajax_email_feedback_url', array($this,'email_feedback_url' ));
+
add_action('wp_ajax_earnings_rate', array($this,'get_payitem_earnings_rate' ));
add_action('wp_ajax_nopriv_earnings_rate', array($this,'get_payitem_earnings_rate' ));
@@ -558,6 +560,17 @@ class AcareOffice{
wp_mail($staff->user_email, $subject, $message, $headers);
}
+ private function send_email_feedback_url($client)
+ {
+ $message = file_get_contents(plugin_dir_path(__FILE__) . "/html/email_feedback_url.html");
+ $message = str_ireplace("{{display_name}}", $client->display_name, $message);
+ $message = str_ireplace("{{user_login}}", $client->user_login, $message);
+ $headers = ['Bcc: helenwang41@hotmail.com, timesheet@acaresydney.com.au'];
+ $subject = $client->display_name . " Feedback Link";
+ wp_mail( "helen@acaresydney.com.au", $subject, $message, $headers);
+ //wp_mail( "patrick@biukop.com.au", $subject, $message, $headers);
+ }
+
public function bts_staff_item($attr){
return $this->template('staff_item', 'staff.html');
}
@@ -893,6 +906,26 @@ ZOT;
wp_send_json($response);
}
+ //ajax email feedback url
+ function email_feedback_url()
+ {
+ check_ajax_referer('acaresydney');
+ $client = $_POST['client'];
+ $response=array(
+ 'status' => 'success',
+ 'error' => '',
+ 'sent' => false,
+ 'emailstatus' =>'not sent',
+ );
+ $u = get_user_by('login', $client);
+ if ($this->is_client($u)){
+ $status = $this->send_email_feedback_url($u);
+ $response['emailstatus'] = $status;
+ }
+ wp_send_json($response);
+
+ }
+
//ajax browse job with different filters
function list_job(){
check_ajax_referer('acaresydney');
@@ -1244,7 +1277,7 @@ ZOT;
$description = $this->get_job_description_for_invoice($price, $r);
$data = [
- 'tos' => $price->get_tos_str($r->tos),
+ 'tos' => $price->get_tos_full_str($r->tos),
'start' => $r->start,
'finish' => $r->finish,
'hours' => $quantity,
@@ -1265,10 +1298,13 @@ ZOT;
{
$response['summary'][] = array(
'ndis' => $key,
- 'tos' => $price->get_tos_str($key),
+ 'tos' => $price->get_tos_full_str($key),
'Hours'=> $val,
);
}
+ if (count($summary) > 0){
+ $response['has_summary'] = true;
+ }
wp_send_json($response);