Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed Dec 29, 2020
1 parent 7acf0cb commit c39618a
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 3 deletions.
40 changes: 39 additions & 1 deletion www/app/pages/doc/poscheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct($docid = 0, $basedocid = 0) {
$this->docform->add(new SubmitLink('addcode'))->onClick($this, 'addcodeOnClick');

$this->docform->add(new DropDownChoice('store', Store::getList(), H::getDefStore()))->onChange($this, 'OnChangeStore');
// $this->docform->add(new DropDownChoice('pos', \App\Entity\Pos::find('')));
$this->docform->add(new DropDownChoice('pos', \App\Entity\Pos::findArray('pos_name', '')));

$this->docform->add(new SubmitLink('addcust'))->onClick($this, 'addcustOnClick');

Expand Down Expand Up @@ -479,7 +479,42 @@ public function savedocOnClick($sender) {
$this->_doc->packDetails('detaildata', $this->_itemlist);
$this->_doc->packDetails('services', $this->_serlist);
$this->_doc->amount = $this->docform->total->getText();
$this->_doc->headerdata['pos'] = $this->docform->pos->getValue();

$pos = \App\Entity\Pos::load($this->_doc->headerdata['pos']);

if ($pos->usefisc == 1 && $sender->id == 'execdoc') {


$ret = \App\Modules\PPO\PPOHelper::check($this->_doc);
if ($ret['success'] == false && $ret['docnumber'] > 0) {
//повторяем для нового номера
$pos->fiscdocnumber = $ret['docnumber'];
$pos->save();
$ret = \App\Modules\PPO\PPOHelper::check($this->_doc);

}
if ($ret['success'] == false) {
$this->setError($ret['data']);
return;
} else {
// $this->setSuccess("Выполнено") ;
if ($ret['docnumber'] > 0) {
$pos->fiscdocnumber = $ret['doclocnumber'] + 1;
$pos->save();
$this->_doc->headerdata["fiscalnumber"] = $ret['docnumber'];
} else {
$this->setError("ppo_noretnumber");
return;

}

}

}



$isEdited = $this->_doc->document_id > 0;

$conn = \ZDB\DB::getConnect();
Expand Down Expand Up @@ -744,6 +779,9 @@ private function checkForm() {
if (($this->docform->store->getValue() > 0) == false) {
$this->setError("noselstore");
}
if (($this->docform->pos->getValue() > 0) == false) {
$this->setError("noselposterm");
}
$p = $this->docform->payment->getValue();
$c = $this->docform->customer->getKey();
if ($p == 0) {
Expand Down
4 changes: 2 additions & 2 deletions www/app/pages/doc/returnissue.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ public function savedocOnClick($sender) {
$isEdited = $this->_doc->document_id > 0;


$pos_id = $this->docform->pos->getValue();
$pos_id = $this->docform->pos->getValue();

if($pos_id>0) {
if($pos_id>0 && $sender->id == 'execdoc') {
$pos = \App\Entity\Pos::load($pos_id);

if ($this->_basedocid > 0) {
Expand Down
1 change: 1 addition & 0 deletions www/templates/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
"valeuro": "Евро",
"valrub": "Рубль",
"total": "Итого",
"noselposterm": "Не выбран POS терминал",

"refreshed": "Обновлено",
"sent": "Отправлено",
Expand Down
6 changes: 6 additions & 0 deletions www/templates/pages/doc/poscheck.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ <h3>Кассовый чек </h3>
<a style="font-size:smaller" zippy="addcust">Добавить нового</a>

</div>
<div class="form-group ">
<label for="pos">POS терминал</label>
<select class="form-control" zippy="pos">
<option value="0">Не выбран</option>
</select>
</div>


</div>
Expand Down
1 change: 1 addition & 0 deletions www/templates_ua/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
"valeuro": "Євро",
"valrub": "Рубль",
"total": "Всього",
"noselposterm": "Не вибраний POS термiнал",

"refreshed": "Оновлено",
"sent": "Відправлено",
Expand Down
6 changes: 6 additions & 0 deletions www/templates_ua/pages/doc/poscheck.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ <h3>Касовий чек </h3>
<a style="font-size:smaller" zippy="addcust">Додати нового</a>

</div>
<div class="form-group ">
<label for="pos">POS термiнал</label>
<select class="form-control" zippy="pos">
<option value="0">Не вибраний</option>
</select>
</div>


</div>
Expand Down

0 comments on commit c39618a

Please sign in to comment.