request = $request; $this->voucher = $this->request->get('voucher'); } public function getJournalVoucher(){ return $this->setJournalVoucherXML(); } public function setJournalVoucherXML(){ return '
Import Data
Vouchers '.TallyListener::$companyName.' '.$this->voucher->date.' '.str_replace('&','',$this->voucher->narration).' Journal '.$this->voucher->id.'-'.time().' Accounting Voucher View '.$this->getDebtors().' '.$this->getCreditors().'
'; } /** * @return mixed */ public function getCustomerName(){ return str_replace('&','',$this->voucher->name); } public function getUniqueNameString(){ return $this->getCustomerName().'-'.$this->voucher->ledger_id; } public function getDebtors(){ $debtors = ''; foreach ($this->request->get('payments') as $payment) { if($payment->sundry == 'DR') { $debtors .= ' ' . str_replace('&','',$payment->ledgerName) . ' Yes No Yes -' . $payment->amount . ' -' . $payment->amount . ' ' . ($payment->voucher ? $payment->voucher->id : $this->voucher->id) . ' New Ref -' . $payment->amount . ' '; } } return $debtors; } public function getCreditors(){ $creditors = ''; foreach ($this->request->get('payments') as $payment) { if($payment->sundry == 'CR') { $creditors .= ' ' . str_replace('&','',$payment->ledgerName) . ' No Yes No ' . $payment->amount . ' ' . $payment->amount . ' ' . ($payment->voucher ? $payment->voucher->id : $this->voucher->id) . ' New Ref ' . $payment->amount . ' '; } } return $creditors; } }