Skip to content

Commit

Permalink
v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed Mar 16, 2019
1 parent b42d222 commit 42dae12
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 61 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
CHANGELOG
=========

### v1.3.0 (2019-03-15)
* Добавлена комплектация изделийдля производства
* Добавлен документ Заказ услуг

### v1.2.0 (2019-02-25)
* Добавлена нотификация при добавлени комента к документу
* Добавлено коректное ычисление зарезервированного и оожидаемого товара
* Добавлена нотификация при добавлени коментария к документу
* Добавлено коректное вычисление зарезервированного и оожидаемого товара

### v1.1.1 (2019-02-07)
* Добавлен документ Возврат поставщику
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Zippy Store
========
Система складского учета с веб интерфейсом и онлайн каталогом
Упрощенный вариант проекта ZippyERP. Предназначен для использования малым бизнесом с упрощенной формой учета, который не использует полноценный бухгалтерский учет.
Программа складского учета с веб интерфейсом.
Предназначена для использования малым бизнесом с упрощенной формой учета, который не использует полноценный бухгалтерский учет.

Программа представляет собой онлайн систему складского учета с модулем торговли. Как и ZippyERP, проект бесплатный, с открытым кодом, выполнен в виде веб сайта.



#### Основной функционал
Expand Down
126 changes: 81 additions & 45 deletions db/db.sql

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

Установить параметры соединения в файле config.ini.

Также необходимо убедится что разрешено право записи в папки uploads и logs.
Также необходимо убедиться что разрешено право записи в папки uploads и logs.

Залогинится дефолтным пользователем admin admin
Залогиниться дефолтным пользователем admin admin
18 changes: 18 additions & 0 deletions www/app/entity/itemset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Entity;

/**
* Клас-сущность комплект ТМЦ
*
* @table=item_set
* @view=item_set_view
* @keyfield=set_id
*/
class ItemSet extends \ZCL\DB\Entity
{
protected function init() {
$this->set_id = 0;

}
}
5 changes: 3 additions & 2 deletions www/app/pages/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ public function __construct($params = null) {
$this->pageinfo->setVisible(false);
}



$options = System::getOptions('common');

$this->_tvars["useset"] = $options['useset']==1;

$this->_tvars["smart"] = Helper::generateSmartMenu();
$this->_tvars["picontent"] = $pi;
Expand Down
4 changes: 4 additions & 0 deletions www/app/pages/doc/prodissue.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function __construct($docid = 0, $basedocid = 0) {
$this->docform->add(new CheckBox('planned'));

$this->docform->add(new SubmitLink('addrow'))->onClick($this, 'addrowOnClick');

$this->docform->add(new SubmitButton('savedoc'))->onClick($this, 'savedocOnClick');
$this->docform->add(new SubmitButton('execdoc'))->onClick($this, 'savedocOnClick');

Expand Down Expand Up @@ -117,6 +118,7 @@ public function deleteOnClick($sender) {
$this->docform->detail->Reload();
}


public function addrowOnClick($sender) {
$this->editdetail->setVisible(true);
$this->editdetail->editquantity->setText("1");
Expand Down Expand Up @@ -303,4 +305,6 @@ public function OnAutoItem($sender) {
return Stock::findArrayAC($store_id,$text) ;
}



}
3 changes: 3 additions & 0 deletions www/app/pages/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct() {



$this->common->add(new CheckBox('useset'));
$this->common->add(new CheckBox('useval'))->onChange($this, "onVal");
$this->common->add(new TextInput('cdoll'));
$this->common->add(new TextInput('ceuro'));
Expand Down Expand Up @@ -70,6 +71,7 @@ public function __construct() {
$this->common->price3->setText($common['price3']);
$this->common->price4->setText($common['price4']);
$this->common->price5->setText($common['price5']);
$this->common->useset->setChecked($common['useset']);
$this->common->useval->setChecked($common['useval']);
// $this->common->closeddate->setDate($common['closeddate']);

Expand Down Expand Up @@ -138,6 +140,7 @@ public function saveCommonOnClick($sender) {
$common['price3'] = $this->common->price3->getText();
$common['price4'] = $this->common->price4->getText();
$common['price5'] = $this->common->price5->getText();
$common['useset'] = $this->common->useset->isChecked();
$common['useval'] = $this->common->useval->isChecked();

// $common['closeddate'] = $this->common->closeddate->getDate();
Expand Down
89 changes: 89 additions & 0 deletions www/app/pages/reference/itemlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Pages\Reference;

use \Zippy\Html\DataList\DataView;
use \Zippy\Html\DataList\ArrayDataSource;
use Zippy\Html\Form\AutocompleteTextInput;
use \Zippy\Html\Form\DropDownChoice;
use \Zippy\Html\Form\Form;
use \Zippy\Html\Form\TextInput;
Expand All @@ -14,13 +16,16 @@
use \Zippy\Html\Link\ClickLink;
use \Zippy\Html\Panel;
use \App\Entity\Item;
use \App\Entity\ItemSet;
use \App\Entity\Category;
use \App\System;

class ItemList extends \App\Pages\Base
{

private $_item;
private $_pitem_id=0;
public $_itemset = array();

public function __construct($add = false) {
parent::__construct();
Expand Down Expand Up @@ -89,6 +94,17 @@ public function __construct($add = false) {
$this->itemdetail->add(new SubmitButton('save'))->onClick($this, 'OnSubmit');
$this->itemdetail->add(new Button('cancel'))->onClick($this, 'cancelOnClick');


$this->add(new Panel('setpanel'))->setVisible(false);
$this->setpanel->add(new DataView('setlist', new ArrayDataSource($this,'_itemset'), $this, 'itemsetlistOnRow'));
$this->setpanel->add(new Form('setform'))->onSubmit($this, 'OnAddSet');
$this->setpanel->setform->add(new AutocompleteTextInput('editsname'))->onText($this, 'OnAutoSet');
$this->setpanel->setform->add(new TextInput('editsqty',1));

$this->setpanel->add(new Label('stitle'));
$this->setpanel->add(new ClickLink('backtolist',$this,"onback"));


if ($add == false) {
$this->itemtable->itemlist->Reload();
} else {
Expand Down Expand Up @@ -119,6 +135,7 @@ public function itemlistOnRow($row) {

$row->add(new ClickLink('edit'))->onClick($this, 'editOnClick');
$row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick');
$row->add(new ClickLink('set'))->onClick($this, 'setOnClick');
}

public function deleteOnClick($sender) {
Expand Down Expand Up @@ -207,7 +224,79 @@ public function OnSubmit($sender) {

$this->itemtable->itemlist->Reload();
}




//комплекты
public function onback($sender) {
$this->setpanel->setVisible(false);
$this->itemtable->setVisible(true);

}
public function setOnClick($sender) {
$item = $sender->owner->getDataItem();
$this->_pitem_id = $item->item_id;
$this->_itemset = ItemSet::find("pitem_id=".$item->item_id,"itemname");
$this->setpanel->setVisible(true);
$this->itemtable->setVisible(false);

$this->setpanel->stitle->setText($item->itemname);

$this->_itemset = ItemSet::find("pitem_id=".$this->_pitem_id ,"itemname");
$this->setpanel->setlist->Reload();

}

public function itemsetlistOnRow($row) {
$item = $row->getDataItem();
$row->add(new Label('sname', $item->itemname));
$row->add(new Label('scode', $item->item_code));
$row->add(new Label('sqty', $item->qty));
$row->add(new ClickLink('sdel'))->onClick($this, 'ondelset');

}

public function OnAutoSet($sender) {
$text = Item::qstr('%' . $sender->getText() . '%');
$in="(". $this->_pitem_id;
foreach($this->_itemset as $is){
$in.= ",". $is->item_id ;
}

$in.=")";
return Item::findArray('itemname', "item_id not in {$in} and (itemname like {$text} or item_code like {$text}) and disabled <> 1");
}
public function OnAddSet($sender) {
$id = $sender->editsname->getKey();
if($id==0){
$this->setError("Не выбран товар");
return;
}

$qty = $sender->editsqty->getText();

$set = new ItemSet();
$set->pitem_id = $this->_pitem_id;
$set->item_id = $id;
$set->qty = $qty;

$set->save() ;

$this->_itemset = ItemSet::find("pitem_id=".$this->_pitem_id ,"itemname");

$this->setpanel->setlist->Reload();
$sender->clean();
}
public function ondelset($sender) {
$item = $sender->owner->getDataItem();

ItemSet::delete($item->set_id);

$this->_itemset = ItemSet::find("pitem_id=".$this->_pitem_id ,"itemname");

$this->setpanel->setlist->Reload();
}
}

class ItemDataSource implements \Zippy\Interfaces\DataSource
Expand Down
5 changes: 3 additions & 2 deletions www/templates/pages/doc/prodissue.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ <h3>Списание на производство </h3>
<div class="row">
<div class="col-10">

<a zippy="addrow">Добавить товар</a>
<table class="table table-sm">
<a zippy="addrow">Добавить ТМЦ</a>

<table class="table table-sm">
<tr>
<th>Название</th>
<th >Код</th>
Expand Down
4 changes: 4 additions & 0 deletions www/templates/pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ <h4>Основные настройки</h4>
<option value='3'>3</option>
</select>
</div>
<div class="form-check">
<input zippy="useset" type="checkbox" class="form-check-input" >
<label class="form-check-label" for="useset">Использовать комплекты для продукции</label>
</div>
<div class="form-check">
<input zippy="useval" type="checkbox" class="form-check-input" >
<label class="form-check-label" for="useval">Использовать валюту при закупке</label>
Expand Down
29 changes: 27 additions & 2 deletions www/templates/pages/reference/itemlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ <h3>Справочник товаров </h3>
<td zippy="price" class="text-right"></td>


<td aling="center"><a zippy="edit" title="Редактировать"><i class="fa fa-edit"></i></a> <a
zippy="delete" title="Удалить"><i class="fa fa-trash"></i></a></td>
<td aling="center">
{{#useset}}
<a zippy="set" title="Комплекты"><i class="fa fa-cogs"></i></a>
{{/useset}}

<a zippy="edit" title="Редактировать"><i class="fa fa-edit"></i></a>
<a zippy="delete" title="Удалить"><i class="fa fa-trash"></i></a>
</td>
</tr>
</table>
<div zippy="pag"></div>
Expand Down Expand Up @@ -132,6 +138,25 @@ <h4>Редактирование товара </h4>
</div>
</div>

<div class="row">

<div class="col-12 col-md-8 col-xl-6" zippy="setpanel">
<a zippy="backtolist"><i class="fa fa-arrow-alt-circle-left"></i> К справочнику</a>
<h4 zippy="stitle"></h4>
<form zippy="setform" class="form-inline mt-2 mb-2">
<label for="editsname">Название</label>
<input placeholder="Начните вводить.." class="form-control mr-sm-2" zippy="editsname"/>

<label for="editsqty">Кол.</label>
<input autocomplete="off" class="form-control mr-sm-2" type="text" zippy="editsqty" required="required" pattern="[0-9\.]+" style="width:60px">
<input class="btn btn-outline-success " type="submit" value="Добавить">
</form>
<table class="table table-sm ">
<tr><th>Наименование</th><th>Код</th><th class="text-right">Кол.</th><th> </th></tr>
<tr zippy="setlist"><td zippy="sname"></td><td zippy="scode"></td><td class="text-right" zippy="sqty"></td><td><a zippy="sdel"><i class="fa fa-trash"></i></a> </td></tr>
</table>
</div>

</div>
</body>
</html>
10 changes: 7 additions & 3 deletions www/templates/wait.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!DOCTYPE HTML PUBLIC" -//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>

</head>

<body>
<div style="padding-left:45%;padding-top:200px;">
<img src="/assets/images/ajax-loader.gif"></div>
<img src="/assets/images/ajax-loader.gif">
</div>
</body>
</html>

</html>

0 comments on commit 42dae12

Please sign in to comment.