Skip to content

Commit

Permalink
fix checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed Mar 19, 2024
1 parent e7314a3 commit eee1a38
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
12 changes: 6 additions & 6 deletions www/app/entity/pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ public static function addPayment($document_id, $paydate, $amount, $mf_id, $comm
$payb->user_id = \App\System::getUser()->user_id;

if ( $doc->meta_name=='ReturnIssue' && $mf->back == 1 ) { //возврат
if ( $mf->btran > 0 && $amount < 0) { //возврат
$payb->amount = 0- ($amount * $mf->btran / 100);
if ( $mf->btranin > 0 && $amount < 0) { //возврат
$payb->amount = (abs($amount) * $mf->btranin / 100);
\App\Entity\IOState::addIOState($document_id, $payb->amount, \App\Entity\IOState::TYPE_OTHER_INCOME);
}
} else {

if ($mf->btran > 0 && $amount > 0) { //на счет
$payb->amount = 0- ($amount * $mf->btran / 100);
if ($mf->btran > 0 && $amount < 0) { //со счета
$payb->amount = 0- (abs($amount) * $mf->btran / 100);
}
if ($mf->btranin > 0 && $amount < 0) { //со счета
$payb->amount = ($amount * $mf->btranin / 100);
if ($mf->btranin > 0 && $amount > 0) { //на счет
$payb->amount = 0- (abs($amount) * $mf->btranin / 100);
}
\App\Entity\IOState::addIOState($document_id, $payb->amount, \App\Entity\IOState::TYPE_BANK);
}
Expand Down
2 changes: 1 addition & 1 deletion www/app/modules/cb/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function Check($doc) {
// $good["sum"] =1000000;
$good["is_return"] = false;

$sum += round(['price'] * $item->quantity);
$sum += round($g['price'] * $item->quantity);

$check["goods"][] = $good;

Expand Down
7 changes: 6 additions & 1 deletion www/app/pages/service/armpos.php
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,8 @@ public function savedocOnClick($sender) {
$this->_doc->packDetails('services', $this->_serlist);

$this->_doc->amount = $this->docpanel->form2->total->getText();
$isnew = $this->_doc->document_id ==0;

$conn = \ZDB\DB::getConnect();
$conn->BeginTrans();
try {
Expand Down Expand Up @@ -1276,7 +1278,6 @@ public function savedocOnClick($sender) {
}
}

$isnew = $this->_doc->document_id ==0;
$this->_doc->save();
if($isnew) {
$this->_doc->updateStatus(Document::STATE_NEW);
Expand Down Expand Up @@ -1375,6 +1376,10 @@ public function savedocOnClick($sender) {
$this->setErrorTopPage($ee->getMessage());

$logger->error($ee->getMessage() . " Документ " . $this->_doc->meta_desc);
if($isnew) {
$this->_doc->document_id =0;
}

return;
}
$this->docpanel->form2->customer->setKey(0);
Expand Down
4 changes: 2 additions & 2 deletions www/templates/pages/reference/mflist.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ <h3>Каси та банкiвскi рахунки</h3>
<div class="form-group">
<label for="editbtran" data-label="editbtran">Процент банку, видаток</label>
<input style="width:100px" pattern="[0-9,\.]+" class="form-control qtyprice" zippy="editbtran"/>
<small data-label="editbtran">Процент, який банк бере за перевод суми на рахунок. </small>
<small data-label="editbtran">Процент, який банк бере за перевод суми з рахунку. </small>
</div>
<div class="form-group">
<label for="editbtranin" data-label="editbtranin">Процент банку, прибуток</label>
<input style="width:100px" pattern="[0-9,\.]+" class="form-control qtyprice" zippy="editbtranin"/>
<small data-label="editbtranin">Процент, який банк бере за переказ суми з рахунку </small>
<small data-label="editbtranin">Процент, який банк бере за переказ суми на рахунок </small>
</div>
<div class="form-check">
<input zippy="editback" type="checkbox" class="form-check-input">
Expand Down

0 comments on commit eee1a38

Please sign in to comment.