Skip to content

Commit

Permalink
Merge pull request #146 from leon-mbs/dev
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
leon-mbs authored Apr 7, 2021
2 parents 6bfff94 + 0d2538e commit 9bcfa79
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 47 deletions.
2 changes: 1 addition & 1 deletion www/app/entity/doc/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected function Cancel() {
if ($this->headerdata['paydisc'] > 0 && $this->customer_id > 0) {
$customer = \App\Entity\Customer::load($this->customer_id);
if ($customer->discount > 0) {
return; //процент
// return; //процент
} else {
$customer->bonus = $customer->bonus + $this->headerdata['paydisc'];
$customer->save();
Expand Down
19 changes: 19 additions & 0 deletions www/app/entity/subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,25 @@ public function getText($doc) {
$header['amount'] = \App\Helper::fa($doc->amount);
$header['forpay'] = \App\Helper::fa($doc->payamount);
$header['customer_name'] = $doc->customer_name;
$header['nal'] = '';
$header['mf'] = '';
$header['pos'] = '';
if($doc->headerdata['payment']>0 && $doc->headerdata['payment']<10000) {
$mf = \App\Entity\MoneyFund::load($doc->headerdata['payment']);
$header['mf'] = $mf->mf_name;
if($mf->beznal==1) {
$header['nal'] = \App\Helper::l("cbeznal");
} else {
$header['nal'] = \App\Helper::l("cnal");
}
}
if($doc->headerdata['nal']== \App\Entity\MoneyFund::CREDIT) $header['mf'] = \App\Helper::l("credit");
if($doc->headerdata['nal']== \App\Entity\MoneyFund::PREPAID) $header['mf'] = \App\Helper::l("prepaid");

if($doc->headerdata['pos']) {
$pos = \App\Entity\Pos::load($doc->headerdata['pos']);
$header['pos'] = $pos->pos_name;
}

$table = array();
foreach ($doc->unpackDetails('detaildata') as $item) {
Expand Down
2 changes: 1 addition & 1 deletion www/app/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public final function __set($name, $value) {
}

public final function __get($name) {
return $this->data[$name];
return @$this->data[$name];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion www/app/modules/shop/pages/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct($id = 0) {
$this->add(new Panel("subcatlistp"));


$this->subcatlistp->add(new DataView("subcatlist", new EntityDataSource("\\App\\Entity\\Category", " detail not like '%<noshop>1</noshop>%' and parent_id=" . $id), $this, 'OnCatRow'));
$this->subcatlistp->add(new DataView("subcatlist", new EntityDataSource("\\App\\Entity\\Category", " detail not like '%<noshop>1</noshop>%' and coalesce(parent_id,0)=" . $id), $this, 'OnCatRow'));

$this->subcatlistp->subcatlist->Reload();

Expand Down
2 changes: 1 addition & 1 deletion www/app/modules/shop/pages/productlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct() {
}

$this->op = System::getOptions("shop");
if (strlen($this->op['defcust']) == 0 || strlen($this->op['defstore']) == 0 || strlen($this->op['defpricetype']) == 0) {
if (strlen($this->op['defcust']) == 0 || strlen($this->op['defpricetype']) == 0) {

$this->setWarn('notsetoptionsmag');
}
Expand Down
3 changes: 3 additions & 0 deletions www/app/pages/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function __construct() {
}
$br = '';
$cstr = '';
$brpay = '';
$cust = '';

$brids = \App\ACL::getBranchIDsConstraint();
if (strlen($brids) > 0) {
$br = " and d.branch_id in ({$brids}) ";
Expand Down
9 changes: 7 additions & 2 deletions www/app/pages/register/stocklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ public function doclistOnRow(\Zippy\Html\DataList\DataRow $row) {

$row->add(new Label('partion', H::fa($doc->partion)));
$row->add(new Label('qty', H::fqty($doc->quantity)));
$row->add(new Label('price', H::fa($doc->quantity == 0 ? '' : round(abs($doc->amount / $doc->quantity)))));
$price = $doc->quantity >= 0 ? '' : H::fa($doc->extcode +$doc->partion) ;
if($doc->meta_name =='ReturnIssue') {
$price = H::fa((0-$doc->extcode) +$doc->partion) ;
}

$row->add(new Label('price', $price )) ;

$row->add(new Label('dnumber', $doc->document_number));
$row->add(new Label('snumber', $doc->snumber));
Expand Down Expand Up @@ -145,7 +150,7 @@ public function getItemCount() {
public function getItems($start, $count, $sortfield = null, $asc = null) {

$conn = \ZDB\DB::getConnect();
$sql = "select e.entry_id, e.quantity, e.amount , d.document_id, d.document_number,d.document_date,s.partion,s.snumber from documents d ";
$sql = "select e.extcode,e.entry_id, e.quantity, e.amount , d.document_id, d.document_number,d.document_date,s.partion,s.snumber from documents d ";
$sql .= " join `entrylist` e on d.`document_id` = e.`document_id` ";
$sql .= " join `store_stock` s on s.`stock_id` = e.`stock_id` ";
$sql .= " where " . $this->getWhere() . " order by entry_id ";
Expand Down
11 changes: 9 additions & 2 deletions www/app/pages/showdoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public function __construct($type, $docid) {
$doc = $doc->cast();
$filename = $doc->document_number;


$html = $doc->generateReport();

$html = $doc->generateReport();



if (strlen($html) > 0) {

Expand All @@ -39,6 +41,11 @@ public function __construct($type, $docid) {
header("Content-Type: text/html;charset=UTF-8");
echo $html;
}
if ($type == "pos") {
header("Content-Type: text/html;charset=UTF-8");
$html = $doc->generatePosReport();
echo $html;
}
if ($type == "doc") {
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename={$filename}.doc");
Expand Down
2 changes: 1 addition & 1 deletion www/app/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function getOptions($group) {
self::$_options[$group] = @unserialize($rs);
}

return self::$_options[$group];
return @self::$_options[$group];
}

/**
Expand Down
4 changes: 1 addition & 3 deletions www/app/widgets/docview.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ public function setDoc(\App\Entity\Doc\Document $doc) {

$this->posmob->pagename = $reportpage;
$this->posmob->params = array('pos', $doc->document_id);




$this->html->pagename = $reportpage;
$this->html->params = array('html', $doc->document_id);
$this->word->pagename = $reportpage;
Expand Down
2 changes: 1 addition & 1 deletion www/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"symfony/polyfill-mbstring": "v1.22.0",
"symfony/polyfill-uuid": "v1.22.0",

"leon-mbs/zippy": "2.2.6"
"leon-mbs/zippy": "2.2.7"

}
}
57 changes: 29 additions & 28 deletions www/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions www/templates/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,13 @@
"paymentseq": "Счета одинаковые" ,
"custcreated": "Добавлен %s пользователем %s",
"custlastdoc": "Последний документ %s от %s. Всего %s" ,
"noselfprice": "Не расчитана себестоимость готовой продукции %s",
"noselfprice": "Не рассчитана себестоимость готовой продукции %s",
"enterleadsource": "Не введен источник лида",
"enterleadstatus": "Не введено состояние лида",
"nodefstore": "Укажите в профиле склад по умолчанию",
"nodefmf": "Укажите в профиле кассу по умолчанию",
"nodeffirm": "Укажите в профиле компанию по умолчанию",
"nodelcat": "Нельзя удилить категорию с ТМЦ",
"nodelcat": "Нельзя удалить категорию с ТМЦ",
"nodelcatchild": "У категории есть дочерние категории" ,
"shopattryn": "Атрибут 'Есть/Нет' указывает на наличие или отсутствие характеристики. Например FM-тюнер" ,
"shopattrnum": "Атрибут 'Число' - числовой параметр (напрмер емкость акумулятора). Список для для фильтра отбора формируется на основании диапазона значений атрибута, заданых для товаров." ,
Expand Down
3 changes: 3 additions & 0 deletions www/templates/pages/subscribes.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ <h5 class="modal-title">Описание тегов</h5>
<tr><td><small><b>{document_number}</b></small>< /td><td><small>Номер документа</small></td></tr>
<tr><td><small><b>{document_date}</b></small> </td><td><small>Дата документа</small></td></tr>
<tr><td><small><b>{amount}</b></small> </td><td><small>Сумма по документу</small></td></tr>
<tr><td><small><b>{mf} </b></small></td><td><small>Касса, счет</small></td></tr>
<tr><td><small><b>{nal} </b></small></td><td><small>Нал, безнал</small></td></tr>
<tr><td><small><b>{pos} </b></small></td><td><small>POS терминал</small></td></tr>
<tr><td><small><b>{forpay} </b></small></td><td><small>К оплате</small></td></tr>

</table>
Expand Down
2 changes: 1 addition & 1 deletion www/templates/printforms/doc/order_bill.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<table class="ctable" border="0" cellpadding="1" cellspacing="0" {{{printw}}}>
<table class="ctable" border="0" cellpadding="1" cellspacing="0" {{{printw}}}>
<tr>
<td colspan="3">Заказ {{document_number}}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion www/templates/widgets/docview.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
src="/assets/images/print_32.png"></a>
{{/usemobileprinter}}
{{#usemobileprinter}}
<a zippy="printmob" target="_blank" onclick=" printform()" title="Печать"><img class="icon20"
<a zippy="printmob" target="_blank" title="Печать"><img class="icon20"
src="/assets/images/print_32.png"></a>
{{/usemobileprinter}}

Expand Down
3 changes: 3 additions & 0 deletions www/templates_ua/pages/subscribes.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ <h5 class="modal-title">Опис тегiв</h5>
<tr><td><small><b>{document_number}</b></small>< /td><td><small>Номер документу</small></td></tr>
<tr><td><small><b>{document_date}</b></small> </td><td><small>Дата документу</small></td></tr>
<tr><td><small><b>{amount}</b></small> </td><td><small>Сума по документу</small></td></tr>
<tr><td><small><b>{mf} </b></small></td><td><small>Каса, рахунок</small></td></tr>
<tr><td><small><b>{nal} </b></small></td><td><small>Готiвка, картка</small></td></tr>
<tr><td><small><b>{pos} </b></small></td><td><small>POS термiнал</small></td></tr>
<tr><td><small><b>{forpay} </b></small></td><td><small>До сплати</small></td></tr>

</table>
Expand Down
4 changes: 2 additions & 2 deletions www/templates_ua/widgets/docview.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
src="/assets/images/print_32.png"></a>
{{/usemobileprinter}}
{{#usemobileprinter}}
<a zippy="printmob" target="_blank" onclick=" printform()" title="Печать"><img class="icon20"
<a zippy="printmob" target="_blank" title="Печать"><img class="icon20"
src="/assets/images/print_32.png"></a>
{{/usemobileprinter}}
src="/assets/images/print_32.png"></a>

<a zippy="html" target="_blank" title="Експорт в HTML"><img class="icon20"
src="/assets/images/html.png"></a>
<a zippy="word" target="_blank" title="Експорт в Word"><img class="icon20"
Expand Down

0 comments on commit 9bcfa79

Please sign in to comment.