/**
  * Create a new set of journal vouchers
  *
  * @param array $data
  * 	An array as follows: array('number'=>$number, 'date'=>$date, 'manual_reference'=>$manualReference, 'remark'=>$remark,
  *                              'system_reference_type'=>$systemTeferenceType, 'system_reference_field'=>$systemReferenceField, 'system_reference_id'=>$systemReferenceId
  *                              'is_editable'=>$isEditable, 'status'=>$status, 'voucher_type_id'=>$voucherTypeId, 'created_by'=>$created_by, 'organization_id'=>organizationId
  *                            );
  *
  * @return Mgallegos\DecimaAccounting\JournalVoucher
  */
 public function create(array $data)
 {
     $JournalVoucher = new JournalVoucher();
     $JournalVoucher->setConnection($this->databaseConnectionName);
     $JournalVoucher->fill($data)->save();
     return $JournalVoucher;
 }
 /**
  * Get journal voucher by organization, by period and by status
  *
  * @param  int $organizationId
  * @param  array $periodIds
  * @param  string $status
  *
  * @return integer
  */
 public function getByOrganizationByPeriodAndByStatus($organizationId, $periodIds, $status)
 {
     return $this->JournalVoucher->where('organization_id', '=', $organizationId)->whereIn('period_id', $periodIds)->where('status', '=', $status)->get();
 }