Budget 2019

This commit is contained in:
2019-05-14 15:44:37 +02:00
parent 0996682d8b
commit b5c0090f87
8 changed files with 200 additions and 137 deletions

View File

@@ -77,6 +77,7 @@ class BudgetController extends AppController
//debug($budget_id);
$uploadData = '';
if ($this->request->is('post')) {
// csv file mit 1.Spalte: SNR; 2. Spalte: Anzahl; 3. Spalte: Kommentar
if(!empty($this->request->data['file']['name'])){
$result = $this->Budget->deleteAll(['wl_budget_id' => $budget_id]);
//debug($result);die;
@@ -98,7 +99,7 @@ class BudgetController extends AppController
$new_budget['wl_budget_id'] = $budget_id;
$new_budget['count'] = $line_arr[1];
$new_budget['comment'] = trim($line_arr[2]);
$new_budget['year'] = '2018';
$new_budget['year'] = '2019';
$new_budget['asd'] = false;
$snr_arr[$line_arr[0]] = $new_budget;
}
@@ -517,27 +518,33 @@ class BudgetController extends AppController
if(isset($line['budget'])) {
if ($line['budget'] == $budget_typ['wl_kurz_bezeichnung']) {
debug($key);
//debug($key);
$curl->del_budget($ch,$budget['snr'],$key);
$budget['count'] = $budget['count'] + $line['count'];
$budget['comment'] = $line['comment'] . '; ' . $budget['comment'] ;
if(strlen($budget['comment']) > 1) {
$budget['comment'] = $line['comment'] . '; ' . $budget['comment'] ;
}
}
}
}
debug($budget);
//debug($budget);
$curl->write_budget($ch,$budget);
$budget->asd = true;
$this->Budget->save($budget);
array_push($output,$budget);
}
else {
if(!$pos) {
//if(!$pos) {
if(true) {
//debug($budget);
//die;
$curl->write_budget($ch,$budget);
$budget->asd = true;
$this->Budget->save($budget);
array_push($output,$budget);
}
}
//die;
}
$this->set('output',$output);
}