Переглянути джерело

new ndis price listed together with old price, using ID to differentiate each

master
patrick 5 роки тому
джерело
коміт
0353cd49f1
3 змінених файлів з 7 додано та 12 видалено
  1. +4
    -10
      NdisPrice.php
  2. +1
    -1
      js/bts_office.js
  3. +2
    -1
      ts.php

+ 4
- 10
NdisPrice.php Переглянути файл

@@ -6,26 +6,19 @@ class NdisPrice{
private $html = '';
private $ndis_table;
private $tos =[];
private $current_year = 2020;
public function __construct(int $year=2019) {
global $wpdb;
if ( $year == "2019"){
$now = new \DateTime();
//$year = (int)($now->format("Y"));
}
$this->ndis_table = $wpdb->prefix . 'acare_ndis_price';
$sql = "SELECT * FROM {$this->ndis_table} WHERE year=$year"; //for this year
$sql = "SELECT * FROM {$this->ndis_table}"; //for this year
$results = $wpdb->get_results($sql);
$this->tos =[];
$html = ' <select>';
foreach($results as $r){
$this->tos[$r->code] = $r;
$this->tos[$r->id] = $r;

$html .= sprintf('<option value="%d" data-ndis="%s" data-level="%d" data-year="%d" data-unit="%s" data-price="%.2f" data-ot="%s">%.2f - %s %s %s</option>',
$html .= sprintf('<option value="%d" data-ndis="%s" data-level="%d" data-year="%d" data-unit="%s" data-price="%.2f" data-ot="%s">$%.2f -(date:%d)- %s %s %s</option>',
$r->id,
$r->code,
$r->level,
@@ -34,6 +27,7 @@ class NdisPrice{
(float) $r->price,
$r->ot,
(float) $r->price,
$r->year,
$r->name,
$this->get_level((int) $r->level),
$r->ot

+ 1
- 1
js/bts_office.js Переглянути файл

@@ -1990,7 +1990,7 @@
});
if (matches.length != 1){
$(selector).find('.bstart').addClass("error");
$(selector).find(".bstart_err").html("No matching Job");
$(selector).find(".bstart_err").html("No matched driving Job");
ensure_visible(selector);
console.warn("1 driving job has more than 1 matching", $(selector).attr('id'), matches);
return false;

+ 2
- 1
ts.php Переглянути файл

@@ -201,7 +201,8 @@ class AcareOffice{
$in_kind_program = $this->get_client_in_kind_program($record->client);
$ClaimType = "";// standard;
$CancellationReason="";
return "$registration,$ndisnumber,$start,$finish,$record->tos,REC_{$record->id},$quantity,$hours,$unitprice,$GST,$authorizedby,$participant_approved,$in_kind_program,$ClaimType,$CancellationReason\n";
$SupportNumber = $this->get_ndis_price()->get_tos_ndis_code($record->tos);
return "$registration,$ndisnumber,$start,$finish,$SupportNumber,REC_{$record->id},$quantity,$hours,$unitprice,$GST,$authorizedby,$participant_approved,$in_kind_program,$ClaimType,$CancellationReason\n";
}
private function get_client_ndis_account($client)

Завантаження…
Відмінити
Зберегти