Skip to content

Commit

Permalink
Merge pull request #749 from leon-mbs/master
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
leon-mbs authored Apr 21, 2024
2 parents be85404 + 879cfee commit b60b588
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions www/app/pages/reference/categorylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ public function savepriceOnClick($sender) {

foreach($this->_cplist as $it ) {

if(round($it->newp)==0) continue;

$item= \App\Entity\Item::load($it->item_id);
$item->{'price'.$pt} = round($it->newp);
$item->save();
Expand All @@ -425,12 +427,12 @@ public function calcpriceOnClick($sender) {
if($pt < 1) return;

$v =trim($this->categoryprice->chprice->getText());
$isper = strpos($v,'%') > 0;
$v = doubleval(str_replace('%','',$v) );

$rnd= $this->categoryprice->rnd->isChecked();

foreach( \App\Entity\Item::find("disabled <> 1 and cat_id=". $this->_category->cat_id,'itemname') as $item ) {
$isper = strpos($v,'%') > 0;
$v = doubleval(str_replace('%','',$v) );

$ip=$item->{'price'.$pt} ;
if(strpos($ip,'%') > 0) continue;
Expand Down Expand Up @@ -460,10 +462,7 @@ public function calcpriceOnClick($sender) {

}

// $item->{'price'.$pt} = $ip;

// $item->save();



$di = new \App\DataItem() ;
$di->item_id=$item->item_id;
Expand Down
2 changes: 1 addition & 1 deletion www/templates/pages/reference/categorylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h5 zippy="catprname"></h5>
<input zippy="calccp" type="submit" value="Перерахувати" class="btn btn-primary ">
</div>
<table class="ctable">
<tr zippy="cplist"><td zippy="cplname"></td><td zippy="cplold" class="text-right"></td><td> <input required="required" pattern="[0-9\.]+" style="width: 100px" class="form-control" zippy="cplnew"/></td> <tr>
<tr zippy="cplist"><td zippy="cplname"></td><td zippy="cplold" class="text-right"></td><td> <input pattern="[0-9\.]+" style="width: 100px" class="form-control" zippy="cplnew"/></td> <tr>

</table>
<div class="form-group mt-2 ">
Expand Down

0 comments on commit b60b588

Please sign in to comment.