|
@@ -97,7 +97,6 @@ dostęp dla zarządu i os. odp. kwota końcowa
|
|
|
$data['COST_OSPRZET'] = V::get('COST_OSPRZET', 0, $data['projectInfo']);
|
|
$data['COST_OSPRZET'] = V::get('COST_OSPRZET', 0, $data['projectInfo']);
|
|
|
$data['COST_MATERIALY'] = V::get('COST_MATERIALY', 0, $data['projectInfo']);
|
|
$data['COST_MATERIALY'] = V::get('COST_MATERIALY', 0, $data['projectInfo']);
|
|
|
|
|
|
|
|
- // TODO: tylko ZATWIERDZONE, OCZEKUJE_ZATWIERDZENIA i OCZEKUJE_OSTATECZNEGO_ZATWIERDZENIA
|
|
|
|
|
$data['ordersRaw'] = DB::getPDO()->fetchAll("
|
|
$data['ordersRaw'] = DB::getPDO()->fetchAll("
|
|
|
select r.ID
|
|
select r.ID
|
|
|
, r.ORDER_LABEL
|
|
, r.ORDER_LABEL
|
|
@@ -111,7 +110,7 @@ dostęp dla zarządu i os. odp. kwota końcowa
|
|
|
)
|
|
)
|
|
|
where (r.A_STATUS is null or r.A_STATUS not in('DELETED'))
|
|
where (r.A_STATUS is null or r.A_STATUS not in('DELETED'))
|
|
|
and r.ID_PROJECT = {$idProj}
|
|
and r.ID_PROJECT = {$idProj}
|
|
|
- -- and r.APPROVE_STATUS in('ZATWIERDZONE', 'OCZEKUJE_ZATWIERDZENIA', 'OCZEKUJE_OSTATECZNEGO_ZATWIERDZENIA')
|
|
|
|
|
|
|
+ and r.APPROVE_STATUS in('ZATWIERDZONE', 'OCZEKUJE_ZATWIERDZENIA', 'OCZEKUJE_OSTATECZNEGO_ZATWIERDZENIA')
|
|
|
group by r.ID
|
|
group by r.ID
|
|
|
");
|
|
");
|
|
|
|
|
|
|
@@ -217,12 +216,13 @@ dostęp dla zarządu i os. odp. kwota końcowa
|
|
|
where k.A_STATUS != 'DELETED'
|
|
where k.A_STATUS != 'DELETED'
|
|
|
and k.INCOME_VALUE != 0
|
|
and k.INCOME_VALUE != 0
|
|
|
and k.K_TYP_KORESP = 'OUT'
|
|
and k.K_TYP_KORESP = 'OUT'
|
|
|
|
|
+ and k.ID_PROJECT = '{$idProj}'
|
|
|
");
|
|
");
|
|
|
foreach ($data['profitFvRaw'] as $fv) {
|
|
foreach ($data['profitFvRaw'] as $fv) {
|
|
|
$item = array(
|
|
$item = array(
|
|
|
'_type' => 'profit_fv',
|
|
'_type' => 'profit_fv',
|
|
|
'data' => $fv['data'],
|
|
'data' => $fv['data'],
|
|
|
- 'sum' => (-1 * $fv['profit']),
|
|
|
|
|
|
|
+ 'sum' => 0,
|
|
|
'profit_fv_value' => $fv['profit'],
|
|
'profit_fv_value' => $fv['profit'],
|
|
|
'label' => $fv['obcy_nr_koresp'],
|
|
'label' => $fv['obcy_nr_koresp'],
|
|
|
'costRaw' => $fv
|
|
'costRaw' => $fv
|
|
@@ -537,12 +537,12 @@ dostęp dla zarządu i os. odp. kwota końcowa
|
|
|
{
|
|
{
|
|
|
var profitFvValue = costs.reduce(function (prevValue, currCost) {
|
|
var profitFvValue = costs.reduce(function (prevValue, currCost) {
|
|
|
if ('profit_fv' != currCost['_type']) return prevValue;
|
|
if ('profit_fv' != currCost['_type']) return prevValue;
|
|
|
- return prevValue + currCost['profit_fv_value'];
|
|
|
|
|
|
|
+ return p5Utils__parseFloatOrZero(prevValue) + p5Utils__parseFloatOrZero(currCost['profit_fv_value']);
|
|
|
}, 0);
|
|
}, 0);
|
|
|
if(_dbg)console.log('profitFvValue', profitFvValue);
|
|
if(_dbg)console.log('profitFvValue', profitFvValue);
|
|
|
budget__renderNodePrice('p5Budget__profit_fv', profitFvValue)
|
|
budget__renderNodePrice('p5Budget__profit_fv', profitFvValue)
|
|
|
|
|
|
|
|
- var budgetPercent = p5Utils__parseFloatOrZero(_initBudgetValue)
|
|
|
|
|
|
|
+ var budgetPercent = p5Utils__parseFloatOrZero(_initBudgetValue) + (-1 * aneksValue)
|
|
|
if (profitFvValue > 0 && budgetPercent > 0) {
|
|
if (profitFvValue > 0 && budgetPercent > 0) {
|
|
|
var profitFvPercent = Math.round((profitFvValue * 100) / budgetPercent)
|
|
var profitFvPercent = Math.round((profitFvValue * 100) / budgetPercent)
|
|
|
budget__renderNodeText('p5Budget__profit_fv_percent', '' + profitFvPercent + '%')
|
|
budget__renderNodeText('p5Budget__profit_fv_percent', '' + profitFvPercent + '%')
|
|
@@ -771,7 +771,7 @@ dostęp dla zarządu i os. odp. kwota końcowa
|
|
|
desc['ANEKS'] += "<br><small>- kwota na umowie: 100,000"
|
|
desc['ANEKS'] += "<br><small>- kwota na umowie: 100,000"
|
|
|
desc['ANEKS'] += "<br>- kwota na aneksie: 150,000"
|
|
desc['ANEKS'] += "<br>- kwota na aneksie: 150,000"
|
|
|
desc['ANEKS'] += "<br>wprowadzamy: <code>-50,000</code></small>"
|
|
desc['ANEKS'] += "<br>wprowadzamy: <code>-50,000</code></small>"
|
|
|
- var descText = (type in desc) ? desc[type] : type
|
|
|
|
|
|
|
+ var descText = (type in desc) ? desc[type] : ''
|
|
|
|
|
|
|
|
swal({
|
|
swal({
|
|
|
title: 'Kwota netto dla kosztu:',
|
|
title: 'Kwota netto dla kosztu:',
|