Skip to content

Commit

Permalink
доделки общепита
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed May 30, 2021
1 parent a70d850 commit d6644bf
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 166 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
CHANGELOG
=========
### v5.2.0 (2021-05-03)
### v5.2.0 (2021-06-08)
* Режим только обновления цен в импорте ТМЦ
* Список чеков в АРМ кассира
* Настройка источников продаж (список в общих настройках)
* Пакетное удаление ТМЦ а также печать и смена категории
* Печать QR кода по ссылке товара на ИМ
* Доставка в общепите

### v5.0.0 (2021-05-03)
* Документ Заказ общепита
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Zippy Store
Домашняя страница: [https://zippy.com.ua/zstore](https://zippy.com.ua/zstore)

####
Основная функционалльность
Основная функциональность

* управление складами, складская логистика
* закупка
Expand All @@ -28,6 +28,7 @@ Zippy Store
* модуль интеграции с Woocomerce
* интеграция с Новой Почтой
* интеграция с сервисами смс рассылок
* модуль для общепита


Требования: PHP7.2+ Mysql 5.7+
Expand Down
141 changes: 67 additions & 74 deletions db/db.sql

Large diffs are not rendered by default.

35 changes: 0 additions & 35 deletions www/app/entity/custacc.php

This file was deleted.

6 changes: 4 additions & 2 deletions www/app/entity/doc/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,17 @@ public function updateStatus($state) {
$this->state = $state;
$this->insertLog($state);

$this->save();


if ($oldstate != $state) {
$doc = $this->cast();
$doc->onState($state);

\App\Entity\Subscribe::onDocumentState($doc->document_id, $state);
}


$this->save();

return true;
}

Expand Down
7 changes: 5 additions & 2 deletions www/app/entity/doc/goodsreceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ public function Execute() {


if ($this->headerdata['payment'] > 0 && $this->payed > 0) {
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, 0 - $this->payed, $this->headerdata['payment'], \App\Entity\Pay::PAY_CUSTOMER);

$payed= \App\Entity\Pay::addPayment($this->document_id, $this->document_date, 0 - $this->payed, $this->headerdata['payment'], \App\Entity\IOState::TYPE_BASE_OUTCOME);
if ($payed > 0) {
$this->payed = $payed;
}

\App\Entity\IOState::addIOState($document_id,0 - $this->payed,\App\Entity\IOState::TYPE_BASE_OUTCOME);


Expand Down
5 changes: 4 additions & 1 deletion www/app/entity/doc/invoicecust.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ public function generateReport() {
public function Execute() {

if ($this->headerdata['payment'] > 0 && $this->payed) {
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, 0 - $this->payed, $this->headerdata['payment'], \App\Entity\PAY::PAY_CUSTOMER);
$payed = \App\Entity\Pay::addPayment($this->document_id, $this->document_date, 0 - $this->payed, $this->headerdata['payment'], \App\Entity\IOState::TYPE_BASE_OUTCOME);
if ($payed > 0) {
$this->payed = $payed;
}
\App\Entity\IOState::addIOState($document_id,0 - $this->payed,\App\Entity\IOState::TYPE_BASE_OUTCOME);

}
Expand Down
5 changes: 4 additions & 1 deletion www/app/entity/doc/retcustissue.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ public function Execute() {
}
}
if ($this->headerdata['payment'] > 0 && $this->payed > 0) {
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, $this->payed, $this->headerdata['payment'], \App\Entity\PAY::PAY_CUSTOMER);
$payed = \App\Entity\Pay::addPayment($this->document_id, $this->document_date, $this->payed, $this->headerdata['payment'], \App\Entity\IOState::TYPE_BASE_INCOME);
if ($payed > 0) {
$this->payed = $payed;
}
\App\Entity\IOState::addIOState($document_id, $this->payed,\App\Entity\IOState::TYPE_BASE_INCOME);

}
Expand Down
54 changes: 25 additions & 29 deletions www/app/entity/pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Pay extends \ZCL\DB\Entity


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


protected function init() {
Expand Down Expand Up @@ -92,38 +92,34 @@ public static function addPayment($document_id, $paydate, $amount, $mf_id, $type
//банковский процент


if ($mf->beznal == 1 && $mf->btran > 0 && $amount < 0) {
$payb = new \App\Entity\Pay();
$payb->mf_id = $mf_id;
$payb->document_id = $document_id;
$payb->amount = ($amount * $mf->btran / 100);
$payb->paytype = Pay::PAY_BANK;
$payb->paydate = $paydate;
$payb->notes = \App\Helper::l('bankproc');
$payb->user_id = \App\System::getUser()->user_id;
$payb->save();
}

if ($mf->beznal == 1 && $mf->btranin > 0 && $amount > 0) {
$payb = new \App\Entity\Pay();
$payb->mf_id = $mf_id;
$payb->document_id = $document_id;
$payb->amount = 0- ($amount * $mf->btranin / 100);
$payb->paytype = Pay::PAY_BANK;
$payb->paydate = $paydate;
$payb->notes = \App\Helper::l('bankproc');
$payb->user_id = \App\System::getUser()->user_id;
$payb->save();
if ($mf->beznal == 1) {
if ( ($mf->btran > 0 && $amount < 0)||($mf->btranin > 0 && $amount > 0) ) {
$amount = abs($amount);
$payb = new \App\Entity\Pay();
$payb->mf_id = $mf_id;
$payb->document_id = $document_id;
$payb->amount = 0 - ($amount * $mf->btran / 100);
$payb->paytype = Pay::PAY_BANK;
$payb->paydate = $paydate;
$payb->notes = \App\Helper::l('bankproc');
$payb->user_id = \App\System::getUser()->user_id;
$payb->save();

\App\Entity\IOState::addIOState($document_id, $amount,\App\Entity\IOState::TYPE_BANK);


}
}


}

// $conn = \ZDB\DB::getConnect();
$conn = \ZDB\DB::getConnect();

// $sql = "select coalesce(abs(sum(amount)),0) from paylist where paytype <> ".Pay::PAY_BANK." and document_id=" . $document_id;
// $payed = $conn->GetOne($sql);
// $conn->Execute("update documents set payed={$payed} where document_id =" . $document_id);
// return $payed;
$sql = "select coalesce(abs(sum(amount)),0) from paylist where paytype < 1000 and document_id=" . $document_id;
$payed = $conn->GetOne($sql);
$conn->Execute("update documents set payed={$payed} where document_id =" . $document_id);
return $payed;
}

public static function cancelPayment($id, $comment) {
Expand Down
2 changes: 1 addition & 1 deletion www/app/pages/register/doclist.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function cancelOnClick($sender) {
}

$doc->updateStatus(Document::STATE_CANCELED);

$doc->payed=0;
$doc->save();

$this->doclist->setSelectedRow($sender->getOwner());
Expand Down
8 changes: 4 additions & 4 deletions www/app/pages/register/paysellist.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ public function custlistOnRow(\Zippy\Html\DataList\DataRow $row) {
$row->add(new Label('phone', $cust->phone));
$row->add(new Label('amount', H::fa($cust->sam)));

$row->add(new RedirectLink('createpay')) ;
$row->add(new RedirectLink('createpay'))->setVisible(false) ;
if($cust->sam>0) {
$row->createpay->setLink("\\App\\Pages\\Doc\\OutcomeMoney",array(0,$cust->customer_id,$cust->sam));
$row->createpay->setLink("\\App\\Pages\\Doc\\OutcomeMoney",array(0,$cust->customer_id,$cust->sam));
$row->createpay->setVisible(true) ;
}



$row->add(new ClickLink('showdocs'))->onClick($this, 'showdocsOnClick');

$this->_totamount += $cust->sam;
Expand Down
26 changes: 21 additions & 5 deletions www/app/pages/service/armfood.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ARMFood extends \App\Pages\Base
private $_doc;
public $_itemlist = array();
public $_catlist = array();
public $_prodlist = array();
public $_prodlist = array();
public $_doclist = array();

public function __construct() {
Expand Down Expand Up @@ -107,7 +107,8 @@ public function __construct() {

$this->docpanel->add(new Panel('catpan'))->setVisible(false);
$this->docpanel->catpan->add(new DataView('catlist', new ArrayDataSource($this, '_catlist'), $this, 'onCatRow'));

$this->docpanel->catpan->add(new ClickLink('stopcat',$this,'onStopCat'));

$this->docpanel->add(new Panel('prodpan'))->setVisible(false);
$this->docpanel->prodpan->add(new DataView('prodlist', new ArrayDataSource($this, '_prodlist'), $this, 'onProdRow'));

Expand Down Expand Up @@ -232,7 +233,11 @@ public function onOrderList($sender) {
public function addnewposOnClick($sender) {
$this->docpanel->catpan->setVisible(true);
$this->docpanel->prodpan->setVisible(false);
$this->_catlist = Category::find('coalesce(parent_id,0)=0');
$this->docpanel->listsform->setVisible(false);
$this->docpanel->navform->setVisible(false);


$this->_catlist = Category::find('coalesce(parent_id,0)=0 and cat_id in (select cat_id from items where item_type in(1,4,5) and disabled<> 1 )');
$this->docpanel->catpan->catlist->Reload();
}

Expand Down Expand Up @@ -297,14 +302,15 @@ public function onCatBtnClick($sender) {
$this->_catlist = $catlist;
$this->docpanel->catpan->catlist->Reload();
} else {
$this->_prodlist = Item::find('disabled<>1 and item_type in (1,4) and cat_id='.$cat->cat_id) ;
$this->_prodlist = Item::find('disabled<>1 and item_type in (1,4,5) and cat_id='.$cat->cat_id) ;
$this->docpanel->catpan->setVisible(false);
$this->docpanel->prodpan->setVisible(true);
$this->docpanel->prodpan->prodlist->Reload();
}

}


public function onProdBtnClick($sender) {
$item = $sender->getOwner()->getDataItem();
$store_id = $this->setupform->store->getValue();
Expand All @@ -324,10 +330,20 @@ public function onProdBtnClick($sender) {
// $item->price = $item->getPrice($this->_pricetype, $this->_store);
$this->_itemlist[$item->item_id] = $item;
}
$this->docpanel->catpan->setVisible(true);
$this->docpanel->prodpan->setVisible(false);

}

public function onStopCat($sender) {

$this->docpanel->listsform->setVisible(true);
$this->docpanel->navform->setVisible(true);
$this->docpanel->catpan->setVisible(false);
$this->docpanel->listsform->itemlist->Reload();
$this->calcTotal() ;
$this->calcTotal() ;
}


public function addcodeOnClick($sender) {
$code = trim($this->docpanel->navform->barcode->getText());
Expand Down
6 changes: 3 additions & 3 deletions www/templates/pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ <h4>Общепит</h4>

</div>


{{#hideform}}
<div class="form-check">
<input zippy="foodbar" type="checkbox" class="form-check-input">
<label class="form-check-label" for="foodbar">Бар отдельно от кухни</label>
<small>Отдельный чек (заказ) для бара</small>
<br><small>Отдельный чек (заказ) для бара</small>
</div>
<div class="form-check">
<label for="foodworktype">Организация процесса</label>
Expand All @@ -487,7 +487,7 @@ <h4>Общепит</h4>
</select>

</div>

{{/hideform}}
<div class="form-group">
<button class="btn btn-primary" type="submit">Сохранить</button>
</div>
Expand Down
13 changes: 10 additions & 3 deletions www/templates/pages/service/armfood.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ <h3>АРМ кассира</h3>


<div zippy="docpanel">
<h4>Оформление заказа</h4>
<a zippy="toorderlist"><i class="fa fa-list"></i> Список заказов</a>
<h4>Оформление заказа</h4>


<div class="row" >
<div class="col-12 col-xl-10">
<div class="col-12 col-xl-10">

<div zippy="catpan" class="row">
<div class="col-12">
<i class="fa fa-arrow-alt-circle-left"></i><a zippy="stopcat">К заказу</a>
</div>
<div zippy="catlist" class="col-12 col-sm-6 col-md-4 col-xl-3">
<div class="card mb-2" zippy="catbtn" style="cursor:pointer" >

Expand Down Expand Up @@ -104,8 +110,9 @@ <h4>Оформление заказа</h4>
</div >
</div >
</div>

<div class="col-12 col-md-10 col-xl-8 ">

<div class="navbar mt-4">
<form zippy="navform" class="form-inline ">
<input zippy="baddnewpos" type="submit" value="Добавить позицию " class="btn btn-info mr-4">
Expand Down
6 changes: 3 additions & 3 deletions www/templates_ua/pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,12 @@ <h4>Громадське харчування</h4>




{{#hideform}}

<div class="form-check">
<input zippy="foodbar" type="checkbox" class="form-check-input">
<label class="form-check-label" for="foodbar">Бар окремо вiд кухнi</label>
<small>Окремий чек (замовлення) для бару</small>
<br><small>Окремий чек (замовлення) для бару</small>
</div>
<div class="form-check">
<label for="foodworktype">Органiзацiя процессу</label>
Expand All @@ -493,7 +493,7 @@ <h4>Громадське харчування</h4>
</select>

</div>

{{/hideform}}


<div class="form-group">
Expand Down
7 changes: 6 additions & 1 deletion www/templates_ua/pages/service/armfood.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,16 @@ <h3>АРМ касира</h3>


<div zippy="docpanel">
<h4>Оформлення замовлення</h4>
<a zippy="toorderlist"><i class="fa fa-list"></i> Список замовлень</a>
<h4>Оформлення замовлення</h4>

<div class="row" >
<div class="col-12 col-xl-10">
<div zippy="catpan" class="row">
<div class="col-12">
<i class="fa fa-arrow-alt-circle-left"></i><a zippy="stopcat">До замовлення</a>
</div>

<div zippy="catlist" class="col-12 col-sm-6 col-md-4 col-xl-3">
<div class="card mb-2" zippy="catbtn" style="cursor:pointer" >

Expand Down

0 comments on commit d6644bf

Please sign in to comment.