示例#1
0
文件: Sales.php 项目: awme/stocket
 /**
  * Recalculate
  */
 public function onRecalculate($recordId = null, $context = null)
 {
     $Invoice = new Invoice();
     $Invoice->saleId = $recordId;
     $Invoice->opRecalculate();
     $this->vars['invoice'] = $Invoice->get();
     $this->vars['invoiceStatus'] = Sale::find($recordId)->status;
     $this->asExtension('FormController')->update($recordId, $context);
 }
示例#2
0
文件: Invoice.php 项目: awme/stocket
 public function setTotal()
 {
     $Sale = Sale::find($this->saleId);
     $Sale->total = $this->opTotal();
     $Sale->save();
 }