Expanded invoice stuff.
このコミットが含まれているのは:
コミット
dd847c802f
|
@ -616,12 +616,19 @@ class InvoiceController extends Controller {
|
|||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
$format = DB::table('inv_company')
|
||||
->select('date_format')
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
return DB::table('inv_invoices')
|
||||
$get = DB::table('inv_invoices')
|
||||
->select(
|
||||
'id',
|
||||
'user_id',
|
||||
'employer',
|
||||
'customer',
|
||||
'year',
|
||||
'inv_number',
|
||||
'revision',
|
||||
|
@ -629,6 +636,40 @@ class InvoiceController extends Controller {
|
|||
)
|
||||
->get();
|
||||
|
||||
$res = array();
|
||||
|
||||
foreach ($get as $i) {
|
||||
$usr = DB::table('inv_contacts')
|
||||
->select('name', 'company_name')
|
||||
->where('user_id', $i->user_id)
|
||||
->get();
|
||||
|
||||
$emp = DB::table('inv_contacts')
|
||||
->select('name', 'company_name')
|
||||
->where('id', $i->employer)
|
||||
->get();
|
||||
|
||||
$cus = DB::table('inv_contacts')
|
||||
->select('name', 'company_name')
|
||||
->where('id', $i->customer)
|
||||
->get();
|
||||
|
||||
$zero = '0000';
|
||||
$len = strlen($i->inv_number);
|
||||
$num = substr($zero, $len);
|
||||
$fin = $num.$i->inv_number;
|
||||
|
||||
$res[] = array(
|
||||
'id' => $i->id,
|
||||
'employer' => $emp[0]->name.($emp[0]->company_name != '' ? ' ('.$emp[0]->company_name.')' : ''),
|
||||
'customer' => $cus[0]->name.($cus[0]->company_name != '' ? ' ('.$cus[0]->company_name.')' : ''),
|
||||
'user' => $usr[0]->name.($usr[0]->company_name != '' ? ' ('.$usr[0]->company_name.')' : ''),
|
||||
'invoice' => $i->year.$fin.($i->revision > 0 ? '_R'.$i->revision : ''),
|
||||
'date' => strftime($format[0]->date_format, $i->make_date)
|
||||
);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
else {
|
||||
return DB::table('inv_services')
|
||||
|
|
新しいイシューから参照