Skip to content

Commit

Permalink
next
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon committed Feb 4, 2022
1 parent 2406d3c commit ba113a1
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 23 deletions.
22 changes: 15 additions & 7 deletions www/app/modules/ocstore/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Zippy\Html\Form\Form;
use Zippy\Html\Label;
use Zippy\Html\Link\ClickLink;
use Zippy\Html\Link\SubmitLink;
use Zippy\WebApplication as App;

class Items extends \App\Pages\Base
Expand Down Expand Up @@ -46,8 +47,13 @@ public function __construct() {
$this->exportform->add(new \Zippy\Html\DataList\Paginator('pag', $this->exportform->newitemlist));
$this->exportform->add(new DropDownChoice('ecat', $cats, 0));

$this->add(new ClickLink('updateqty'))->onClick($this, 'onUpdateQty');
$this->add(new ClickLink('updateprice'))->onClick($this, 'onUpdatePrice');
$this->add(new Form('upd'));
$this->upd->add(new DropDownChoice('updcat', \App\Entity\Category::getList(), 0));

$this->upd->add(new SubmitLink('updateqty'))->onClick($this, 'onUpdateQty');
$this->upd->add(new SubmitLink('updateprice'))->onClick($this, 'onUpdatePrice');


$this->add(new ClickLink('checkconn'))->onClick($this, 'onCheck');


Expand Down Expand Up @@ -173,9 +179,10 @@ public function exportOnSubmit($sender) {

public function onUpdateQty($sender) {
$modules = System::getOptions("modules");

$cat = $this->upd->updcat->getValue();

$elist = array();
$items = Item::find("disabled <> 1 ");
$items = Item::find("disabled <> 1 ". ($cat>0 ? " and cat_id=".$cat : ""));
foreach ($items as $item) {
if (strlen($item->item_code) == 0) {
continue;
Expand Down Expand Up @@ -208,10 +215,11 @@ public function onUpdateQty($sender) {

public function onUpdatePrice($sender) {
$modules = System::getOptions("modules");

$cat = $this->upd->updcat->getValue();

$elist = array();
$items = Item::find("disabled <> 1 ");
foreach ($items as $item) {
$items = Item::find("disabled <> 1 ". ($cat>0 ? " and cat_id=".$cat : ""));
foreach ($items as $item) {
if (strlen($item->item_code) == 0) {
continue;
}
Expand Down
21 changes: 14 additions & 7 deletions www/app/modules/wc/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Zippy\Html\Form\Form;
use Zippy\Html\Label;
use Zippy\Html\Link\ClickLink;
use Zippy\Html\Link\SubmitLink;
use Zippy\WebApplication as App;

class Items extends \App\Pages\Base
Expand Down Expand Up @@ -41,8 +42,12 @@ public function __construct() {
$this->exportform->newitemlist->setPageSize(H::getPG());
$this->exportform->add(new \Zippy\Html\DataList\Paginator('pag', $this->exportform->newitemlist));

$this->add(new ClickLink('updateqty'))->onClick($this, 'onUpdateQty');
$this->add(new ClickLink('updateprice'))->onClick($this, 'onUpdatePrice');
$this->add(new Form('upd'));
$this->upd->add(new DropDownChoice('updcat', \App\Entity\Category::getList(), 0));

$this->upd->add(new SubmitLink('updateqty'))->onClick($this, 'onUpdateQty');
$this->upd->add(new SubmitLink('updateprice'))->onClick($this, 'onUpdatePrice');

$this->add(new ClickLink('getitems'))->onClick($this, 'onGetItems');

$this->add(new ClickLink('checkconn'))->onClick($this, 'onCheck');
Expand Down Expand Up @@ -158,7 +163,8 @@ public function exportOnSubmit($sender) {
public function onUpdateQty($sender) {
$modules = System::getOptions("modules");
$client = \App\Modules\WC\Helper::getClient();

$cat = $this->upd->updcat->getValue();

$page=1;
$cnt =1;
while(true) {
Expand Down Expand Up @@ -207,8 +213,8 @@ public function onUpdateQty($sender) {
$qty = count($skuvarlist);

$elist = array();
$items = Item::find("disabled <> 1 ");
foreach ($items as $item) {
$items = Item::find("disabled <> 1 ". ($cat>0 ? " and cat_id=".$cat : ""));
foreach ($items as $item) {
if (strlen($item->item_code) == 0) {
continue;
}
Expand Down Expand Up @@ -249,7 +255,8 @@ public function onUpdateQty($sender) {
public function onUpdatePrice($sender) {
$modules = System::getOptions("modules");
$client = \App\Modules\WC\Helper::getClient();

$cat = $this->upd->updcat->getValue();

$page=1;
$cnt =1;
while(true) {
Expand Down Expand Up @@ -291,7 +298,7 @@ public function onUpdatePrice($sender) {
unset($data);

$elist = array();
$items = Item::find("disabled <> 1 ");
$items = Item::find("disabled <> 1 ". ($cat>0 ? " and cat_id=".$cat : ""));
foreach ($items as $item) {
if (strlen($item->item_code) == 0) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion www/app/pages/doc/goodsreceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ private function checkForm() {
if ($this->docform->payment->getValue() == 0 && $this->_doc->payed > 0) {
$this->setError("noselmf");
}
$val = $sender->getValue();
$val = $this->docform->val->getValue();
if (strlen($val) > 1) {
if($this->_doc->payamount > $this->_doc->payed ) {
$this->setError("nocreditval");
Expand Down
2 changes: 1 addition & 1 deletion www/app/pages/doc/invoicecust.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ private function checkForm() {
if ($this->docform->payment->getValue() == 0 && $this->_doc->payed > 0) {
$this->setError("noselmf");
}
$val = $sender->getValue();
$val = $this->docform->val->getValue();
if (strlen($val) > 1) {
if($this->_doc->payamount > $this->_doc->payed ) {
$this->setError("nocreditval");
Expand Down
8 changes: 7 additions & 1 deletion www/templates/modules/ocstore/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,18 @@ <h3>Экспорт товаров в магазин</h3>
<h3>Обновление цен и количеств</h3>

<div class="navbar nav">
<form zippy="upd" class="form-inline ">
<label for="updcat">Категория</label>

<select class="form-control mr-sm-2" zippy="updcat">
<option value="0">Все</option>
</select>
<a zippy="updateqty" class=" btn btn-outline-success ">Обновить количества</a>
<img id="loader3" style="display:none" src="/assets/images/ajax-loader.gif">
&nbsp;&nbsp;
<a zippy="updateprice" class=" btn btn-outline-success ">Обновить цены</a>
<img id="loader4" style="display:none" src="/assets/images/ajax-loader.gif">

</form>

</div>
</div>
Expand Down
9 changes: 8 additions & 1 deletion www/templates/modules/wc/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,20 @@ <h3>Экспорт новых товаров</h3>
<h3>Обновление цен и количеств</h3>

<div class="navbar nav">
<form zippy="upd" class="form-inline ">
<label for="updcat">Категория</label>

<select class="form-control mr-sm-2" zippy="updcat">
<option value="0">Все</option>
</select>

<a zippy="updateqty" class=" btn btn-outline-success ">Обновить количества</a>
<div id="loader3" style="display:none" class="spinner-border spinner-border-sm"></div>

&nbsp;&nbsp;
<a zippy="updateprice" class=" btn btn-outline-success ">Обновить цены</a>
<div id="loader4" style="display:none" class="spinner-border spinner-border-sm"></div>

</form>

</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion www/templates/pages/doc/goodsissue.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h3>Расходная накладная </h3>
<td zippy="total" class="text-right"></td>
<td></td>
</tr>

{{^prepaid}}
<tr style="font-weight: bolder;">

<td colspan={{colspan}} class="text-right"><span data-label="paydisc">Скидка:</span></td>
Expand All @@ -166,6 +166,7 @@ <h3>Расходная накладная </h3>
<td><a data-label="paydisc" href="javascript:void(0);" data-toggle="modal" data-target="#modaldisc"><i
class="fa fa-edit"></i></a></td>
</tr>
{{/prepaid}}
{{#prepaid}}
<tr style="font-weight: bolder;">
<td data-label="prepaid" colspan={{colspan}} class="text-right">Предоплата:</td>
Expand Down
6 changes: 5 additions & 1 deletion www/templates/pages/doc/goodsreceipt.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ <h3> Приходная накладная </h3>
<td zippy="total" class="text-right"></td>
<td></td>
</tr>
{{^prepaid}}


<tr style="font-weight: bolder;">
<td data-label="nds" colspan={{colspan}} class="text-right">НДС:</td>
<td zippy="nds" class="text-right"></td>
Expand All @@ -177,7 +180,8 @@ <h3> Приходная накладная </h3>
<td data-label="disc"><a href="javascript:void(0);" data-toggle="modal" data-target="#modaldisc"><i
class="fa fa-edit"></i></a></td>
</tr>

{{/prepaid}}

{{#prepaid}}
<tr style="font-weight: bolder;">
<td data-label="prepaid" colspan={{colspan}} class="text-right">Предоплата:</td>
Expand Down
9 changes: 8 additions & 1 deletion www/templates_ua/modules/ocstore/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ <h3>Експорт товарів в магазин</h3>
<h3>Оновлення цін і кількості</h3>

<div class="navbar nav">

<form zippy="upd" class="form-inline ">
<label for="updcat">Категорiя</label>

<select class="form-control mr-sm-2" zippy="updcat">
<option value="0">Всi</option>
</select>
<a zippy="updateqty" class=" btn btn-outline-success ">Оновити кількість</a>
<img id="loader3" style="display:none" src="/assets/images/ajax-loader.gif">
&nbsp;&nbsp;
<a zippy="updateprice" class=" btn btn-outline-success ">Оновити ціни</a>
<img id="loader4" style="display:none" src="/assets/images/ajax-loader.gif">


</form>
</div>
</div>

Expand Down
13 changes: 11 additions & 2 deletions www/templates_ua/modules/wc/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h3>Експорт нових товарів</h3>
<a zippy="checkconn"><i class="fa fa fa-sync"></i> Перевiрити з'єднання</a>
<div class="navbar nav">
<form zippy="filter" class="form-inline ">
<label for="searchcat">Категорія</label>
<label for="searchcat">Категорія</label>

<select class="form-control mr-sm-2" zippy="searchcat">
<option value="0">Не задана</option>
Expand Down Expand Up @@ -66,13 +66,22 @@ <h3>Експорт нових товарів</h3>
<h3>Оновлення цін і кількостей</h3>

<div class="navbar nav">

<form zippy="upd" class="form-inline ">
<label for="updcat">Категорiя</label>

<select class="form-control mr-sm-2" zippy="updcat">
<option value="0">Всi</option>
</select>


<a zippy="updateqty" class=" btn btn-outline-success ">Оновити кількість</a>
<div id="loader" style="display:none" class="spinner-border spinner-border-sm"></div>

&nbsp;&nbsp;
<a zippy="updateprice" class=" btn btn-outline-success ">Оновити ціни</a>
<div id="loader7" style="display:none" class="spinner-border spinner-border-sm"></div>

</form>

</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions www/templates_ua/pages/doc/goodsissue.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ <h3>Видаткова накладна </h3>
<td zippy="total" class="text-right"></td>
<td></td>
</tr>
{{^prepaid}}

<tr style="font-weight: bolder;">

Expand All @@ -165,6 +166,7 @@ <h3>Видаткова накладна </h3>
<td><a data-label="paydisc" href="javascript:void(0);" data-toggle="modal" data-target="#modaldisc"><i
class="fa fa-edit"></i></a></td>
</tr>
{{/prepaid}}
{{#prepaid}}
<tr style="font-weight: bolder;">
<td data-label="prepaid" colspan={{colspan}} class="text-right">Передплата:</td>
Expand Down
3 changes: 3 additions & 0 deletions www/templates_ua/pages/doc/goodsreceipt.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ <h3> Прибуткова накладна </h3>
<td zippy="total" class="text-right"></td>
<td></td>
</tr>
{{^prepaid}}

<tr style="font-weight: bolder;">
<td data-label="nds" colspan={{colspan}} class="text-right">ПДВ:</td>
<td zippy="nds" class="text-right"></td>
Expand All @@ -170,6 +172,7 @@ <h3> Прибуткова накладна </h3>
<td data-label="disc"><a href="javascript:void(0);" data-toggle="modal" data-target="#modaldisc"><i
class="fa fa-edit"></i></a></td>
</tr>
{{/prepaid}}


{{#prepaid}}
Expand Down

0 comments on commit ba113a1

Please sign in to comment.