|
@@ -32,6 +32,22 @@ class Route_UrlAction_ProjektyKosztyWstepnychRobot extends RouteBase {// TODO: U
|
|
|
UI::dol();
|
|
UI::dol();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function przedmiarAction() {
|
|
|
|
|
+ // TODO: check if user is allowed to run this action
|
|
|
|
|
+ UI::gora();
|
|
|
|
|
+ if (1 != V::get('_print', '', $_GET)) UI::menu();
|
|
|
|
|
+ try {
|
|
|
|
|
+ $idProject = V::get('ID_PROJECT', 0, $_REQUEST, 'int');
|
|
|
|
|
+ $idCompany = V::get('ID_COMPANY', 0, $_REQUEST, 'int');
|
|
|
|
|
+ if (!$idProject) throw new Exception("Wrong param in 'ID_PROJECT' - expected integer!");
|
|
|
|
|
+ $this->panel($idProject, $idCompany);
|
|
|
|
|
+ $this->przedmiar($idProject, $idCompany);
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ UI::dol();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function zestawienieSwMikRurAction() {
|
|
public function zestawienieSwMikRurAction() {
|
|
|
UI::gora();
|
|
UI::gora();
|
|
|
if (1 != V::get('_print', '', $_GET)) UI::menu();
|
|
if (1 != V::get('_print', '', $_GET)) UI::menu();
|
|
@@ -727,6 +743,7 @@ SQL_FUN;
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-12">
|
|
|
<?php if ($idProject > 0) : ?>
|
|
<?php if ($idProject > 0) : ?>
|
|
|
<a class="btn btn-default" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>">Kosztorys</a>
|
|
<a class="btn btn-default" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>">Kosztorys</a>
|
|
|
|
|
+ <a class="btn btn-default" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=przedmiar&_print=1" target="_blank">Przedmiar</a>
|
|
|
<a class="btn btn-default" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=zestawienieSwMikRur&_print=1" target="_blank">zestawienie (światłowód i mikrorurki)</a>
|
|
<a class="btn btn-default" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=zestawienieSwMikRur&_print=1" target="_blank">zestawienie (światłowód i mikrorurki)</a>
|
|
|
<a class="btn btn-warning" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=oferta">oferta</a>
|
|
<a class="btn btn-warning" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=oferta">oferta</a>
|
|
|
<a class="btn btn-warning" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=ofertaAdmin">oferta (Admin)</a>
|
|
<a class="btn btn-warning" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_task=ofertaAdmin">oferta (Admin)</a>
|
|
@@ -1301,6 +1318,39 @@ SQL_FUN;
|
|
|
DBG::_('DBG', '>0', "projCosts", $projCosts, __CLASS__, __FUNCTION__, __LINE__);
|
|
DBG::_('DBG', '>0', "projCosts", $projCosts, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function przedmiar($idProject) {
|
|
|
|
|
+ $idCompany = 0;
|
|
|
|
|
+ $admin = false;
|
|
|
|
|
+ $companyAdmin = false;
|
|
|
|
|
+ $model = $this->getModel($idProject);
|
|
|
|
|
+ //DBG::table("subProjectList", $model->subProjectList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
+ $schema = ProjectKosztorysSchema::getSchema();
|
|
|
|
|
+
|
|
|
|
|
+ $projCosts = $this->getProjectCostByCennik($idProject, $idCompany);
|
|
|
|
|
+ //DBG::_(true, true, "projCosts", $projCosts, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
+ $hidePrices = true;
|
|
|
|
|
+ $viewLayerDataArgs = compact('idProject', 'idCompany', 'admin', 'companyAdmin', 'hidePrices');
|
|
|
|
|
+ UI::setTitleJsTag("Przedmiar robót telekomunikacyjnych [{$idProject}]");
|
|
|
|
|
+?>
|
|
|
|
|
+<div class="container">
|
|
|
|
|
+ <h1>Przedmiar robót telekomunikacyjnych</h1>
|
|
|
|
|
+ <table class="table">
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th><?php echo $schema['nr']; ?></th>
|
|
|
|
|
+ <th><?php echo $schema['title']; ?></th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td><?php echo $model->idProject; ?></td>
|
|
|
|
|
+ <td><?php echo $model->title; ?></td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <?php $this->viewLayersData($viewLayerDataArgs); ?>
|
|
|
|
|
+</div>
|
|
|
|
|
+<?php
|
|
|
|
|
+ DBG::_('DBG', '>0', "schema", $schema, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
+ DBG::_('DBG', '>0', "projCosts", $projCosts, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function oferta($args) {
|
|
public function oferta($args) {
|
|
|
$idProject = $args['idProject'];
|
|
$idProject = $args['idProject'];
|
|
|
$idCompany = V::get('idCompany', 0, $args);
|
|
$idCompany = V::get('idCompany', 0, $args);
|
|
@@ -1339,6 +1389,7 @@ SQL_FUN;
|
|
|
$admin = V::get('admin', false, $args);
|
|
$admin = V::get('admin', false, $args);
|
|
|
$companyAdmin = V::get('companyAdmin', false, $args);
|
|
$companyAdmin = V::get('companyAdmin', false, $args);
|
|
|
$projCosts = V::get('projCosts', array(), $args);
|
|
$projCosts = V::get('projCosts', array(), $args);
|
|
|
|
|
+ $showPrices = ! V::get('hidePrices', 0, $args);
|
|
|
|
|
|
|
|
$schema = ProjectKosztorysSchema::getSchema();
|
|
$schema = ProjectKosztorysSchema::getSchema();
|
|
|
$conf = $schema['config'];
|
|
$conf = $schema['config'];
|
|
@@ -1392,8 +1443,10 @@ SQL_FUN;
|
|
|
<td style="padding:0 6px">typ</td>
|
|
<td style="padding:0 6px">typ</td>
|
|
|
<td style="width:60px; padding:0 6px; text-align:right">ilość</td>
|
|
<td style="width:60px; padding:0 6px; text-align:right">ilość</td>
|
|
|
<td style="width:80px; padding:0 6px; text-align:right">jednostka</td>
|
|
<td style="width:80px; padding:0 6px; text-align:right">jednostka</td>
|
|
|
- <td style="padding:0 6px; text-align:right">cena jednostkowa</td>
|
|
|
|
|
- <td style="padding:0 6px; text-align:right">cena jedn. (robocizna)</td>
|
|
|
|
|
|
|
+ <?php if ($showPrices) : ?>
|
|
|
|
|
+ <td style="padding:0 6px; text-align:right">cena jednostkowa</td>
|
|
|
|
|
+ <td style="padding:0 6px; text-align:right">cena jedn. (robocizna)</td>
|
|
|
|
|
+ <?php endif; ?>
|
|
|
<?php if ($admin) : ?>
|
|
<?php if ($admin) : ?>
|
|
|
<td style="padding:0 6px; text-align:right">cena jedn. (domyślna)</td>
|
|
<td style="padding:0 6px; text-align:right">cena jedn. (domyślna)</td>
|
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
@@ -1428,6 +1481,7 @@ SQL_FUN;
|
|
|
<td style="padding:0 6px" title="[<?php echo $idType; ?>] <?php echo $typeData['type']; ?>"> - <?php echo $typeData['type']; ?></td>
|
|
<td style="padding:0 6px" title="[<?php echo $idType; ?>] <?php echo $typeData['type']; ?>"> - <?php echo $typeData['type']; ?></td>
|
|
|
<td style="padding:0 6px; text-align:right"><?php echo $typeData['ilosc']; ?></td>
|
|
<td style="padding:0 6px; text-align:right"><?php echo $typeData['ilosc']; ?></td>
|
|
|
<td style="padding:0 6px; text-align:right"><?php echo ProjectKosztorysSchema::getLayerJednostka($idLayer); ?></td>
|
|
<td style="padding:0 6px; text-align:right"><?php echo ProjectKosztorysSchema::getLayerJednostka($idLayer); ?></td>
|
|
|
|
|
+ <?php if ($showPrices) : ?>
|
|
|
<td style="padding:3px 6px; text-align:right">
|
|
<td style="padding:3px 6px; text-align:right">
|
|
|
<?php if ($admin || $companyAdmin) : ?>
|
|
<?php if ($admin || $companyAdmin) : ?>
|
|
|
<input type="text" style="text-align:right" class="form-control input-sm" name="price_<?php echo $idType; ?>" value="<?php echo $price; ?>"/>
|
|
<input type="text" style="text-align:right" class="form-control input-sm" name="price_<?php echo $idType; ?>" value="<?php echo $price; ?>"/>
|
|
@@ -1448,6 +1502,7 @@ SQL_FUN;
|
|
|
<?php if (!empty($summaryTypeCost)) : ?>
|
|
<?php if (!empty($summaryTypeCost)) : ?>
|
|
|
<td style="padding:3px 6px; text-align:right"><?php echo number_format(V::get($idType, 0, $summaryTypeCost), 2, ',', ' '); ?></td>
|
|
<td style="padding:3px 6px; text-align:right"><?php echo number_format(V::get($idType, 0, $summaryTypeCost), 2, ',', ' '); ?></td>
|
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
|
|
+ <?php endif; ?>
|
|
|
<td style="padding:3px 6px; text-align:right">
|
|
<td style="padding:3px 6px; text-align:right">
|
|
|
<?php if ($admin || $companyAdmin) : ?>
|
|
<?php if ($admin || $companyAdmin) : ?>
|
|
|
<input type="text" style="text-align:left" class="form-control input-sm" name="uwagi_<?php echo $idType; ?>" value="<?php echo $uwagi; ?>"/>
|
|
<input type="text" style="text-align:left" class="form-control input-sm" name="uwagi_<?php echo $idType; ?>" value="<?php echo $uwagi; ?>"/>
|