Skip to content

Commit

Permalink
v5.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed Jul 10, 2021
1 parent 821415f commit 5e36814
Show file tree
Hide file tree
Showing 26 changed files with 325 additions and 180 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
CHANGELOG
=========
### v5.2.2 (2021-07-11)

* Добавлены услуги в счет к оплате
* Уведомления в АРМах кафе и доставки
* Исправления в украинской локализации
* QR код в ценнике
* Возможность коректировки отпускной цени при оприходовании закупки
* Различные улучшения и мелкие исправления
Для обновления версии обновить папки app, templates, templates_ua.
Кто пропустил предыдущее обновление, обновить папку vendor (или выполнить 'composer --no-dev update')

### v5.2.1 (2021-06-18)
* Убраны пункты кредит и предоплата из списка счетов в документах.
Для кредита просто вводить 0 в 'Внесена оплата'. Если была предоплата выставить 0 в 'К оплате'.
Expand Down
3 changes: 3 additions & 0 deletions www/app/entity/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ public function getPrice($_price_ = 'price1', $store = 0, $partion = 0) {
}
}


//акции


return \App\Helper::fa($price);
}
Expand Down
3 changes: 1 addition & 2 deletions www/app/entity/pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class Pay extends \ZCL\DB\Entity

const PAY_CUSTOMER = 1; //расчеты с контрагентм
const PAY_BANK = 1000; //эквайринг
const PAY_BONUS = 1001; //бонусы клиенту



protected function init() {
$this->pl_id = 0;
Expand Down
3 changes: 3 additions & 0 deletions www/app/entity/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ protected function init() {
$this->defsalesource = 0;
$this->deffirm = 0;
$this->hidesidebar = 0;
$this->usemobileprinter = 0;
$this->pagesize = 25;
$this->createdon = time();
$this->mainpage = '\App\Pages\Main';
Expand Down Expand Up @@ -96,6 +97,7 @@ protected function afterLoad() {
$this->viber = (string)$options['viber'];

$this->hidesidebar = (int)$options['hidesidebar'];
$this->usemobileprinter = (int)$options['usemobileprinter'];
$this->mainpage = $options['mainpage'];

parent::afterLoad();
Expand Down Expand Up @@ -126,6 +128,7 @@ protected function beforeSave() {
$options['defsalesource'] = $this->defsalesource;
$options['pagesize'] = $this->pagesize;
$options['hidesidebar'] = $this->hidesidebar;
$options['usemobileprinter'] = $this->usemobileprinter;
$options['mainpage'] = $this->mainpage;

$this->options = serialize($options);
Expand Down
2 changes: 1 addition & 1 deletion www/app/pages/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct($params = null) {
$this->_tvars["usebranch"] = $options['usebranch'] == 1;
$this->_tvars["useval"] = $options['useval'] == 1;
$this->_tvars["usecattree"] = $options['usecattree'] == 1;
$this->_tvars["usemobileprinter"] = $options['usemobileprinter'] == 1;
$this->_tvars["usemobileprinter"] = $user->usemobileprinter == 1;
$this->_tvars["noshowpartion"] = System::getUser()->noshowpartion;


Expand Down
40 changes: 39 additions & 1 deletion www/app/pages/doc/goodsreceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ public function __construct($docid = 0, $basedocid = 0) {

$this->add(new Form('editdetail'))->setVisible(false);
$this->editdetail->add(new AutocompleteTextInput('edititem'))->onText($this, 'OnAutoItem');
$this->editdetail->edititem->onChange($this, 'OnChangeItem', true);
$this->editdetail->add(new SubmitLink('addnewitem'))->onClick($this, 'addnewitemOnClick');
$this->editdetail->add(new TextInput('editquantity'))->setText("1");
$this->editdetail->add(new TextInput('editprice'));
$this->editdetail->add(new TextInput('editsellprice'));
$this->editdetail->add(new TextInput('editsnumber'));
$this->editdetail->add(new Date('editsdate'));
$this->editdetail->add(new ClickLink('openitemsel', $this, 'onOpenItemSel'));
Expand Down Expand Up @@ -300,6 +302,7 @@ public function addcodeOnClick($sender) {
$this->editdetail->edititem->setKey($item->item_id);
$this->editdetail->edititem->setText($item->itemname);
$this->editdetail->editprice->setText('');
$this->editdetail->editsellprice->setText('');
}
}

Expand All @@ -316,6 +319,15 @@ public function editOnClick($sender) {

$this->editdetail->editquantity->setText($item->quantity);
$this->editdetail->editprice->setText($item->price);

$olditem = Item::load($item->item_id);
if($olditem != null){
$this->editdetail->editsellprice->setText($olditem->price1);
}



$this->editdetail->editsellprice->setText($item->price1);
$this->editdetail->editsnumber->setText($item->snumber);
$this->editdetail->editsdate->setDate($item->sdate);

Expand Down Expand Up @@ -347,6 +359,15 @@ public function saverowOnClick($sender) {

$item->quantity = $this->editdetail->editquantity->getText();
$item->price = $this->editdetail->editprice->getText();
$sellprice = $this->editdetail->editsellprice->getText();
if(strlen($sellprice)>0) {
$olditem = Item::load($item->item_id);
if($olditem != null){
$olditem->price1 = $sellprice;
$olditem->save();
}
}


if ($item->price == 0) {

Expand Down Expand Up @@ -663,7 +684,8 @@ public function OnVal($sender) {
public function addnewitemOnClick($sender) {
$this->editnewitem->setVisible(true);
$this->editdetail->setVisible(false);

$this->wselitem->setVisible(false);

$this->editnewitem->clean();

if (System::getOption("common", "autoarticle") == 1) {
Expand Down Expand Up @@ -711,6 +733,8 @@ public function savenewitemOnClick($sender) {
if ($item->sdate == false) {
$item->sdate = '';
}
$this->editdetail->editsnumber->setText($item->snumber);
$this->editdetail->editsdate->setText($item->sdate);


$item->cat_id = $this->editnewitem->editnewcat->getValue();
Expand Down Expand Up @@ -785,6 +809,10 @@ public function onOpenItemSel($sender) {
public function onSelectItem($item_id, $itemname) {
$this->editdetail->edititem->setKey($item_id);
$this->editdetail->edititem->setText($itemname);

$item = Item::load($item_id);

$this->editdetail->editsellprice->setText($item->price1);
}

public function OnCustomerFirm($sender) {
Expand All @@ -802,4 +830,14 @@ public function OnCustomerFirm($sender) {
}
}

public function OnChangeItem($sender) {
$id = $sender->getKey();
$item = Item::load($id);

$this->editdetail->editsellprice->setText($item->price1);


$this->updateAjax(array('editsellprice' ));
}

}
50 changes: 50 additions & 0 deletions www/app/pages/notifylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Zippy\Html\DataList\DataView;
use Zippy\Html\Form\Form;
use Zippy\Html\Form\TextInput;
use Zippy\Html\Form\TextArea;
use Zippy\Html\Form\DropDownChoice;
use Zippy\Html\Form\CheckBox;
use Zippy\Html\Label;
use Zippy\WebApplication as App;

Expand Down Expand Up @@ -36,6 +39,14 @@ public function __construct() {
$this->nlist->Reload();

\App\Entity\Notify::markRead($user->user_id);


$this->add(new Form('msgform'))->onSubmit($this, 'OnSend');
$this->msgform->add(new TextArea('msgtext'));
$this->msgform->add(new DropDownChoice('users', \App\Entity\User::findArray('username', 'disabled <> 1 and user_id <>' . $user->user_id, 'username'), 0));
$this->msgform->add(new CheckBox('sendall'))->setVisible($this->user->rolename == 'admins');


}

public function OnRow($row) {
Expand All @@ -60,5 +71,44 @@ public function filterOnSubmit($sender) {
$this->ds->setWhere($where);
$this->nlist->Reload();
}

public function OnSend($sender) {
$msg = trim($sender->msgtext->getText());

if (strlen($msg) == 0) {
return;
}


$all = $sender->sendall->isChecked();

$list = array();
if ($all) {
foreach ($sender->users->getOptionList() as $id => $n) {
$list[] = $id;
}
} else {
$id = $sender->users->getValue();
if ($id == 0) {

$this->setError('noselreciever');
return;
}
$list[] = $id;
}


foreach ($list as $id) {
$n = new \App\Entity\Notify();
$n->user_id = $id;
$n->message = $msg;
$n->sender_name = $this->user->username;
$n->save();
}
$this->setSuccess('sent');
$sender->clean();
}



}
9 changes: 6 additions & 3 deletions www/app/pages/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct() {
$this->common->add(new CheckBox('usescanner'));
$this->common->add(new CheckBox('usebranch'));
$this->common->add(new CheckBox('usecattree'));
$this->common->add(new CheckBox('usemobileprinter'));

$this->common->add(new CheckBox('showactiveusers'));
$this->common->add(new CheckBox('printoutbarcode'));
$this->common->add(new CheckBox('printoutqrcode'));
Expand Down Expand Up @@ -102,7 +102,7 @@ public function __construct() {

$this->common->usesnumber->setChecked($common['usesnumber']);

$this->common->usemobileprinter->setChecked($common['usemobileprinter']);

$this->common->showactiveusers->setChecked($common['showactiveusers']);
$this->common->printoutbarcode->setChecked($common['printoutbarcode']);
$this->common->printoutqrcode->setChecked($common['printoutqrcode']);
Expand Down Expand Up @@ -151,6 +151,7 @@ public function __construct() {
$this->printer->add(new CheckBox('pcode'));
$this->printer->add(new CheckBox('pbarcode'));
$this->printer->add(new CheckBox('pprice'));
$this->printer->add(new CheckBox('pqrcode'));

$printer = System::getOptions("printer");
if (!is_array($printer)) {
Expand All @@ -166,6 +167,7 @@ public function __construct() {
$this->printer->pname->setChecked($printer['pname']);
$this->printer->pcode->setChecked($printer['pcode']);
$this->printer->pbarcode->setChecked($printer['pbarcode']);
$this->printer->pqrcode->setChecked($printer['pqrcode']);
$this->printer->pprice->setChecked($printer['pprice']);

//API
Expand Down Expand Up @@ -275,7 +277,7 @@ public function saveCommonOnClick($sender) {

$common['printoutqrcode'] = $this->common->printoutqrcode->isChecked() ? 1 : 0;
$common['printoutbarcode'] = $this->common->printoutbarcode->isChecked() ? 1 : 0;
$common['usemobileprinter'] = $this->common->usemobileprinter->isChecked() ? 1 : 0;

$common['showactiveusers'] = $this->common->showactiveusers->isChecked() ? 1 : 0;
$common['usecattree'] = $this->common->usecattree->isChecked() ? 1 : 0;
$common['usebranch'] = $this->common->usebranch->isChecked() ? 1 : 0;
Expand Down Expand Up @@ -316,6 +318,7 @@ public function savePrinterOnClick($sender) {
$printer['pname'] = $this->printer->pname->isChecked() ? 1 : 0;
$printer['pcode'] = $this->printer->pcode->isChecked() ? 1 : 0;
$printer['pbarcode'] = $this->printer->pbarcode->isChecked() ? 1 : 0;
$printer['pqrcode'] = $this->printer->pqrcode->isChecked() ? 1 : 0;
$printer['pprice'] = $this->printer->pprice->isChecked() ? 1 : 0;

System::setOptions("printer", $printer);
Expand Down
35 changes: 29 additions & 6 deletions www/app/pages/reference/itemlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,17 +553,19 @@ public function printOnClick($sender) {
$printer = \App\System::getOptions('printer');
$pwidth = 'style="width:40mm;"';
$pfs = 'style="font-size:16px;"';
$pfsp = 'style="font-size:24px;"';

if (strlen($printer['pwidth']) > 0) {
$pwidth = 'style="width:' . $printer['pwidth'] . ' ";';
}
if (strlen($printer['pfontsize']) > 0) {
$pfs = 'style="font-size:' . $printer['pfontsize'] . 'px";';
$pfsp = 'style="font-size:' . intval(($printer['pfontsize'] *1.5)). 'px";';
}


$report = new \App\Report('item_tag.tpl');
$header = array('width' => $pwidth, 'fsize' => $pfs);
$header = array('width' => $pwidth, 'fsize' => $pfs, 'fsizep' => $pfsp);
if ($printer['pname'] == 1) {

if (strlen($item->shortname) > 0) {
Expand All @@ -582,6 +584,16 @@ public function printOnClick($sender) {
$header['isap'] = true;
}

if ($printer['pqrcode'] == 1 && strlen($item->url)>0) {
$qrCode = new \Endroid\QrCode\QrCode($item->url);
$qrCode->setSize(100);
$qrCode->setMargin(5);
$qrCode->setWriterByName('png');

$dataUri = $qrCode->writeDataUri();
$header['qrcode'] = "<img src=\"{$dataUri}\" />";

}
if ($printer['pbarcode'] == 1) {
$barcode = $item->bar_code;
if (strlen($barcode) == 0) {
Expand Down Expand Up @@ -619,7 +631,8 @@ public function OnPrintAll($sender) {
$pwidth = "width:70mm;";
$pheight = "height:40mm;";
$pfs = 'style="font-size:16px;"';

$pfs = 'style="font-size:24px;"';

if (strlen($printer['pwidth']) > 0) {
$pwidth = "width:" . $printer['pwidth'] . ";";
}
Expand All @@ -633,13 +646,14 @@ public function OnPrintAll($sender) {

if (strlen($printer['pfontsize']) > 0) {
$pfs = 'style="font-size:' . $printer['pfontsize'] . 'px";';
}
$pfsp = 'style="font-size:' . intval(($printer['pfontsize'] *1.5)). 'px";';
}

$htmls="";

foreach($items as $item){
$report = new \App\Report('item_tag.tpl');
$header = array('style' => $style, 'fsize' => $pfs);
$header = array('style' => $style, 'fsize' => $pfs, 'fsizep' => $pfsp);
if ($printer['pname'] == 1) {

if (strlen($item->shortname) > 0) {
Expand All @@ -650,14 +664,23 @@ public function OnPrintAll($sender) {
}
$header['isap'] = false;
if ($printer['pprice'] == 1) {
$header['price'] = number_format($item->getPrice($printer['pricetype']), 2, '.', '');
$header['price'] = H::fa($item->getPrice($printer['pricetype']));
$header['isap'] = true;
}
if ($printer['pcode'] == 1) {
$header['article'] = $item->item_code;
$header['isap'] = true;
}

if ($printer['pqrcode'] == 1 && strlen($item->url)>0) {
$qrCode = new \Endroid\QrCode\QrCode($item->url);
$qrCode->setSize(100);
$qrCode->setMargin(5);
$qrCode->setWriterByName('png');

$dataUri = $qrCode->writeDataUri();
$header['qrcode'] = "<img src=\"{$dataUri}\" />";

}
if ($printer['pbarcode'] == 1) {
$barcode = $item->bar_code;
if (strlen($barcode) == 0) {
Expand Down
Loading

0 comments on commit 5e36814

Please sign in to comment.