Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed Jun 27, 2024
1 parent f4ffc34 commit 7488184
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions www/app/entity/doc/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,15 @@ protected function init() {
$this->amount = 0;
$this->payamount = 0;
$this->payed = 0;

$this->document_number = '';
$this->document_date = time();
$this->notes = '';


$this->headerdata = array();
$this->detaildata = array();

$this->headerdata['_state_before_approve_'] = '';

if($this->document_id==0) { //для новых документов
$this->headerdata['contract_id'] = 0;
$this->headerdata['timeentry'] = time();
$this->headerdata['time'] = time();
}
$this->headerdata['contract_id'] = 0;
$this->headerdata['timeentry'] = 0; // для проаводок
$this->headerdata['time'] = time(); // для чеков

}

Expand Down Expand Up @@ -317,6 +310,8 @@ protected function Cancel() {
$conn->Execute("delete from iostate where document_id=" . $this->document_id);

$conn->Execute("delete from empacc where document_id=" . $this->document_id);

$conn->Execute("delete from custacc where document_id=" . $this->document_id);


$conn->CommitTrans();
Expand Down Expand Up @@ -413,6 +408,7 @@ public function updateStatus($state, $onlystate = false) {
} else {
if ($state == self::STATE_CANCELED) {
if($onlystate == false) {
$this->headerdata['timeentry'] = 0;
$this->Cancel();
}
$this->headerdata['_state_before_approve_'] = '';
Expand Down

0 comments on commit 7488184

Please sign in to comment.