Invoice viewing stuff.
このコミットが含まれているのは:
コミット
2d82c5d494
|
@ -760,20 +760,26 @@ class InvoiceController extends Controller {
|
|||
$com = array();
|
||||
$des = array();
|
||||
|
||||
$self = DB::table('inv_contacts')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'website', 'email', 'custom')
|
||||
->where('id', $u->user_id)
|
||||
->where('user_id', $u->user_id)
|
||||
->get();
|
||||
|
||||
$cus = DB::table('inv_contacts')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'email')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'website', 'email', 'custom')
|
||||
->where('id', $invoice[0]->customer)
|
||||
->where('user_id', $u->user_id)
|
||||
->get();
|
||||
|
||||
$emp = DB::table('inv_contacts')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'email')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'website', 'email', 'custom')
|
||||
->where('id', $invoice[0]->employer)
|
||||
->where('user_id', $u->user_id)
|
||||
->get();
|
||||
|
||||
$com = DB::table('inv_company')
|
||||
->select('id', 'name', 'compreg', 'taxnr', 'bank_number', 'bank_name', 'bank_recipient', 'logo', 'payterm')
|
||||
->select('id', 'name', 'compreg', 'taxnr', 'bank_number', 'bank_name', 'bank_recipient', 'logo', 'payterm', 'comment1', 'comment2')
|
||||
->where('user_id', $u->user_id)
|
||||
->get();
|
||||
|
||||
|
@ -785,6 +791,8 @@ class InvoiceController extends Controller {
|
|||
$inv[] = array(
|
||||
'id' => $id,
|
||||
'user_id' => $u->user_id,
|
||||
'invoice_year' => strftime('%Y', $invoice[0]->make_date),
|
||||
'invoice_month' => strftime('%B', $invoice[0]->make_date),
|
||||
'invoice_date' => strftime($format[0]->date_format, $invoice[0]->make_date),
|
||||
'invoice' => $invoice[0]->year.$fin.($invoice[0]->revision > 0 ? '_R'.$invoice[0]->revision : '')
|
||||
);
|
||||
|
@ -820,6 +828,7 @@ class InvoiceController extends Controller {
|
|||
|
||||
return array(
|
||||
'invoice' => $inv,
|
||||
'user' => $self,
|
||||
'company' => $com,
|
||||
'employer' => $emp,
|
||||
'customer' => $cus,
|
||||
|
@ -853,20 +862,26 @@ class InvoiceController extends Controller {
|
|||
$com = array();
|
||||
$des = array();
|
||||
|
||||
$self = DB::table('inv_contacts')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'website', 'email', 'custom')
|
||||
->where('id', $check)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
$cus = DB::table('inv_contacts')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'email')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'website', 'email', 'custom')
|
||||
->where('id', $invoice[0]->customer)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
$emp = DB::table('inv_contacts')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'email')
|
||||
->select('id', 'company_name', 'name', 'address', 'postcode', 'town', 'country', 'phone', 'website', 'email', 'custom')
|
||||
->where('id', $invoice[0]->employer)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
$com = DB::table('inv_company')
|
||||
->select('id', 'name', 'compreg', 'taxnr', 'bank_number', 'bank_name', 'bank_recipient', 'logo', 'payterm')
|
||||
->select('id', 'name', 'compreg', 'taxnr', 'bank_number', 'bank_name', 'bank_recipient', 'logo', 'payterm', 'comment1', 'comment2')
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
|
@ -878,6 +893,8 @@ class InvoiceController extends Controller {
|
|||
$inv[] = array(
|
||||
'id' => $id,
|
||||
'user_id' => $u->user_id,
|
||||
'invoice_year' => strftime('%Y', $invoice[0]->make_date),
|
||||
'invoice_month' => strftime('%B', $invoice[0]->make_date),
|
||||
'invoice_date' => strftime($format[0]->date_format, $invoice[0]->make_date),
|
||||
'invoice' => $invoice[0]->year.$fin.($invoice[0]->revision > 0 ? '_R'.$invoice[0]->revision : '')
|
||||
);
|
||||
|
@ -913,6 +930,7 @@ class InvoiceController extends Controller {
|
|||
|
||||
return array(
|
||||
'invoice' => $inv,
|
||||
'user' => $self,
|
||||
'company' => $com,
|
||||
'employer' => $emp,
|
||||
'customer' => $cus,
|
||||
|
|
新しいイシューから参照