Merge branch 'fakproducts' into 'master'
Fakproducts See merge request 076/community/076Server!14
このコミットが含まれているのは:
コミット
51e9320940
|
@ -23,7 +23,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
|
||||
// Company
|
||||
public function getCompanies(Request $request) { // /api/rpc/invoice/company/getcompanies
|
||||
public function getCompanies(Request $request) { // /api/rpc/invoice/company/getall
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -55,7 +55,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getCompany($id, Request $request) { // /api/rpc/invoice/company/getcompany/id
|
||||
public function getCompany($id, Request $request) { // /api/rpc/invoice/company/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -231,7 +231,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
|
||||
// Contacts
|
||||
public function getContacts(Request $request) { // /api/rpc/invoice/contacts/getcontacts
|
||||
public function getContacts(Request $request) { // /api/rpc/invoice/contacts/getall
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -309,7 +309,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getContact($id, Request $request) { // /api/rpc/invoice/contacts/getcontact/id
|
||||
public function getContact($id, Request $request) { // /api/rpc/invoice/contacts/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -660,7 +660,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
|
||||
// Invoices
|
||||
public function getInvoices(Request $request) { // /api/rpc/invoice/invoices/getinvoices
|
||||
public function getInvoices(Request $request) { // /api/rpc/invoice/invoices/getall
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -743,7 +743,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getInvoice($id, Request $request) { // /api/rpc/invoice/invoices/getinvoice/id
|
||||
public function getInvoice($id, Request $request) { // /api/rpc/invoice/invoices/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1168,7 +1168,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
|
||||
// Periods
|
||||
public function getPeriods(Request $request) { // /api/rpc/invoice/periods/getperiods
|
||||
public function getPeriods(Request $request) { // /api/rpc/invoice/periods/getall
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1184,7 +1184,9 @@ class InvoiceController extends Controller {
|
|||
'id',
|
||||
'user_id',
|
||||
'name',
|
||||
'rate'
|
||||
'price',
|
||||
'intervals',
|
||||
'period'
|
||||
)
|
||||
->get();
|
||||
|
||||
|
@ -1194,7 +1196,9 @@ class InvoiceController extends Controller {
|
|||
->select(
|
||||
'id',
|
||||
'name',
|
||||
'rate'
|
||||
'price',
|
||||
'intervals',
|
||||
'period'
|
||||
)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
@ -1206,7 +1210,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getPeriod($id, Request $request) { // /api/rpc/invoice/periods/getperiod/id
|
||||
public function getPeriod($id, Request $request) { // /api/rpc/invoice/periods/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1222,7 +1226,9 @@ class InvoiceController extends Controller {
|
|||
'id',
|
||||
'user_id',
|
||||
'name',
|
||||
'rate'
|
||||
'price',
|
||||
'intervals',
|
||||
'period'
|
||||
)
|
||||
->where('id', $id)
|
||||
->get();
|
||||
|
@ -1232,7 +1238,9 @@ class InvoiceController extends Controller {
|
|||
->select(
|
||||
'id',
|
||||
'name',
|
||||
'rate'
|
||||
'price',
|
||||
'intervals',
|
||||
'period'
|
||||
)
|
||||
->where('id', $id)
|
||||
->where('user_id', $check)
|
||||
|
@ -1260,7 +1268,9 @@ class InvoiceController extends Controller {
|
|||
->insertGetId([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price,
|
||||
'intervals' => $request->intervals,
|
||||
'period' => $request->period
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
@ -1268,7 +1278,9 @@ class InvoiceController extends Controller {
|
|||
->insertGetId([
|
||||
'user_id' => $check,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price,
|
||||
'intervals' => $request->intervals,
|
||||
'period' => $request->period
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -1296,7 +1308,9 @@ class InvoiceController extends Controller {
|
|||
->update([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price,
|
||||
'intervals' => $request->intervals,
|
||||
'period' => $request->period
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
@ -1305,7 +1319,9 @@ class InvoiceController extends Controller {
|
|||
->where('user_id', $check)
|
||||
->update([
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price,
|
||||
'intervals' => $request->intervals,
|
||||
'period' => $request->period
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -1343,7 +1359,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
|
||||
// Products
|
||||
public function getProducts(Request $request) { // /api/rpc/invoice/products/products/get
|
||||
public function getProducts(Request $request) { // /api/rpc/invoice/products/getall
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1381,7 +1397,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getProduct($id, Request $request) { // /api/rpc/invoice/products/product/get/id
|
||||
public function getProduct($id, Request $request) { // /api/rpc/invoice/products/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1396,85 +1412,26 @@ class InvoiceController extends Controller {
|
|||
->select(
|
||||
'id',
|
||||
'user_id',
|
||||
'cat_id',
|
||||
'interval_id',
|
||||
'name',
|
||||
'intervals',
|
||||
'price'
|
||||
)
|
||||
->where('id', $id)
|
||||
->get();
|
||||
|
||||
$res = array();
|
||||
|
||||
foreach ($get as $g) {
|
||||
$cat = DB::table('inv_product_categories')
|
||||
->select('name')
|
||||
->where('id', $g->cat_id)
|
||||
->get();
|
||||
|
||||
$int = DB::table('inv_product_intervals')
|
||||
->select('name')
|
||||
->where('id', $g->interval_id)
|
||||
->get();
|
||||
|
||||
$res[] = array(
|
||||
'id' => $g->id,
|
||||
'user_id' => $g->id,
|
||||
'cat_id' => $g->cat_id,
|
||||
'cat_name' => $cat[0]->name,
|
||||
'interval_id' => $g->id,
|
||||
'interval_name' => $int[0]->name,
|
||||
'name' => $g->id,
|
||||
'intervals' => $g->id,
|
||||
'price' => $g->price
|
||||
);
|
||||
}
|
||||
|
||||
return $res;
|
||||
return $get;
|
||||
}
|
||||
else {
|
||||
$get = DB::table('inv_products')
|
||||
->select(
|
||||
'id',
|
||||
'cat_id',
|
||||
'interval_id',
|
||||
'name',
|
||||
'intervals',
|
||||
'price'
|
||||
)
|
||||
->where('id', $id)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
$res = array();
|
||||
|
||||
foreach ($get as $g) {
|
||||
$cat = DB::table('inv_product_categories')
|
||||
->select('name')
|
||||
->where('id', $g->cat_id)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
$int = DB::table('inv_product_intervals')
|
||||
->select('name')
|
||||
->where('id', $g->interval_id)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
||||
$res[] = array(
|
||||
'id' => $g->id,
|
||||
'cat_id' => $g->cat_id,
|
||||
'cat_name' => $cat[0]->name,
|
||||
'interval_id' => $g->id,
|
||||
'interval_name' => $int[0]->name,
|
||||
'name' => $g->id,
|
||||
'intervals' => $g->id,
|
||||
'price' => $g->price
|
||||
);
|
||||
}
|
||||
|
||||
return $res;
|
||||
return $get;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1483,7 +1440,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function newProduct(Request $request) { // /api/rpc/invoice/products/product/new
|
||||
public function newProduct(Request $request) { // /api/rpc/invoice/products/new
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1497,10 +1454,7 @@ class InvoiceController extends Controller {
|
|||
$add = DB::table('inv_products')
|
||||
->insertGetId([
|
||||
'user_id' => $request->user_id,
|
||||
'cat_id' => $request->cat_id,
|
||||
'interval_id' => $request->interval_id,
|
||||
'name' => $request->name,
|
||||
'intervals' => $request->intervals,
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
|
@ -1508,10 +1462,7 @@ class InvoiceController extends Controller {
|
|||
$add = DB::table('inv_products')
|
||||
->insertGetId([
|
||||
'user_id' => $check,
|
||||
'cat_id' => $request->cat_id,
|
||||
'interval_id' => $request->interval_id,
|
||||
'name' => $request->name,
|
||||
'intervals' => $request->intervals,
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
|
@ -1524,7 +1475,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function editProduct(Request $request) { // /api/rpc/invoice/products/product/edit
|
||||
public function editProduct(Request $request) { // /api/rpc/invoice/products/edit
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1539,10 +1490,7 @@ class InvoiceController extends Controller {
|
|||
->where('id', $request->id)
|
||||
->update([
|
||||
'user_id' => $request->user_id,
|
||||
'cat_id' => $request->cat_id,
|
||||
'interval_id' => $request->interval_id,
|
||||
'name' => $request->name,
|
||||
'intervals' => $request->intervals,
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
|
@ -1551,10 +1499,7 @@ class InvoiceController extends Controller {
|
|||
->where('id', $request->id)
|
||||
->where('user_id', $check)
|
||||
->update([
|
||||
'cat_id' => $request->cat_id,
|
||||
'interval_id' => $request->interval_id,
|
||||
'name' => $request->name,
|
||||
'intervals' => $request->intervals,
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
|
@ -1567,7 +1512,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteProduct(Request $request) { // /api/rpc/invoice/products/product/delete
|
||||
public function deleteProduct(Request $request) { // /api/rpc/invoice/products/delete
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1592,342 +1537,8 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getProductCategories(Request $request) { // /api/rpc/invoice/products/categories/get
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
return DB::table('inv_product_categories')
|
||||
->select(
|
||||
'id',
|
||||
'user_id',
|
||||
'name'
|
||||
)
|
||||
->get();
|
||||
|
||||
}
|
||||
else {
|
||||
return DB::table('inv_product_categories')
|
||||
->select(
|
||||
'id',
|
||||
'name'
|
||||
)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getProductCategory($id, Request $request) { // /api/rpc/invoice/products/category/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
return DB::table('inv_product_categories')
|
||||
->select(
|
||||
'id',
|
||||
'user_id',
|
||||
'name'
|
||||
)
|
||||
->where('id', $id)
|
||||
->get();
|
||||
|
||||
}
|
||||
else {
|
||||
return DB::table('inv_product_categories')
|
||||
->select(
|
||||
'id',
|
||||
'name'
|
||||
)
|
||||
->where('id', $id)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function newProductCategory(Request $request) { // /api/rpc/invoice/products/category/new
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
$add = DB::table('inv_product_categories')
|
||||
->insertGetId([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
else {
|
||||
$add = DB::table('inv_product_categories')
|
||||
->insertGetId([
|
||||
'user_id' => $check,
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
|
||||
return $add;
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function editProductCategory(Request $request) { // /api/rpc/invoice/products/category/edit
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
DB::table('inv_product_categories')
|
||||
->where('id', $request->id)
|
||||
->update([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
else {
|
||||
DB::table('inv_product_categories')
|
||||
->where('id', $request->id)
|
||||
->where('user_id', $check)
|
||||
->update([
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
|
||||
return 'Success!';
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteProductCategory(Request $request) { // /api/rpc/invoice/products/category/delete
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
DB::table('inv_product_categories')->where('id', $request->id)->delete();
|
||||
}
|
||||
else {
|
||||
DB::table('inv_product_categories')->where('id', $request->id)->where('user_id', $check)->delete();
|
||||
}
|
||||
|
||||
return 'Done.';
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getProductIntervals(Request $request) { // /api/rpc/invoice/product/getproductintervals
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
return DB::table('inv_product_intervals')
|
||||
->select(
|
||||
'id',
|
||||
'user_id',
|
||||
'name'
|
||||
)
|
||||
->get();
|
||||
|
||||
}
|
||||
else {
|
||||
return DB::table('inv_product_intervals')
|
||||
->select(
|
||||
'id',
|
||||
'name'
|
||||
)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getProductInterval($id, Request $request) { // /api/rpc/invoice/product/getproductinterval/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
return DB::table('inv_product_intervals')
|
||||
->select(
|
||||
'id',
|
||||
'user_id',
|
||||
'name'
|
||||
)
|
||||
->where('id', $id)
|
||||
->get();
|
||||
|
||||
}
|
||||
else {
|
||||
return DB::table('inv_product_intervals')
|
||||
->select(
|
||||
'id',
|
||||
'name'
|
||||
)
|
||||
->where('id', $id)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function newProductInterval(Request $request) { // /api/rpc/invoice/products/interval/new
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
$add = DB::table('inv_product_intervals')
|
||||
->insertGetId([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
else {
|
||||
$add = DB::table('inv_product_intervals')
|
||||
->insertGetId([
|
||||
'user_id' => $check,
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
|
||||
return $add;
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function editProductInterval(Request $request) { // /api/rpc/invoice/products/interval/edit
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
DB::table('inv_product_intervals')
|
||||
->where('id', $request->id)
|
||||
->update([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
else {
|
||||
DB::table('inv_product_intervals')
|
||||
->where('id', $request->id)
|
||||
->where('user_id', $check)
|
||||
->update([
|
||||
'name' => $request->name
|
||||
]);
|
||||
}
|
||||
|
||||
return 'Success!';
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteProductInterval(Request $request) { // /api/rpc/invoice/products/interval/delete
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
return 'Err!';
|
||||
}
|
||||
else {
|
||||
$valid = $this->objAuth->getPermissions($request->username, $request->password);
|
||||
|
||||
if ($valid['inv_makeinvoice'] == 1) {
|
||||
if ($valid['inv_manuser'] == 1) {
|
||||
DB::table('inv_product_intervals')->where('id', $request->id)->delete();
|
||||
}
|
||||
else {
|
||||
DB::table('inv_product_intervals')->where('id', $request->id)->where('user_id', $check)->delete();
|
||||
}
|
||||
|
||||
return 'Done.';
|
||||
}
|
||||
else {
|
||||
return 'Permission denied.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Services
|
||||
public function getServices(Request $request) { // /api/rpc/invoice/service/getservices
|
||||
public function getServices(Request $request) { // /api/rpc/invoice/services/getall
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -1943,7 +1554,7 @@ class InvoiceController extends Controller {
|
|||
'id',
|
||||
'user_id',
|
||||
'name',
|
||||
'rate'
|
||||
'price'
|
||||
)
|
||||
->get();
|
||||
|
||||
|
@ -1953,7 +1564,7 @@ class InvoiceController extends Controller {
|
|||
->select(
|
||||
'id',
|
||||
'name',
|
||||
'rate'
|
||||
'price'
|
||||
)
|
||||
->where('user_id', $check)
|
||||
->get();
|
||||
|
@ -1965,7 +1576,7 @@ class InvoiceController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function getService($id, Request $request) { // /api/rpc/invoice/services/getservice/id
|
||||
public function getService($id, Request $request) { // /api/rpc/invoice/services/get/id
|
||||
$check = $this->objAuth->checkLegit($request->username, $request->password);
|
||||
|
||||
if ($check == 0) {
|
||||
|
@ -2010,7 +1621,7 @@ class InvoiceController extends Controller {
|
|||
->insertGetId([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
@ -2018,7 +1629,7 @@ class InvoiceController extends Controller {
|
|||
->insertGetId([
|
||||
'user_id' => $check,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -2046,7 +1657,7 @@ class InvoiceController extends Controller {
|
|||
->update([
|
||||
'user_id' => $request->user_id,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
@ -2056,7 +1667,7 @@ class InvoiceController extends Controller {
|
|||
->update([
|
||||
'user_id' => $check,
|
||||
'name' => $request->name,
|
||||
'rate' => $request->rate
|
||||
'price' => $request->price
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,56 +10,46 @@
|
|||
*/
|
||||
|
||||
// Management
|
||||
Route::get('/api/rpc/invoice/company/getcompanies', 'InvoiceController@getCompanies');
|
||||
Route::get('/api/rpc/invoice/company/getcompany/{id}', 'InvoiceController@getCompany');
|
||||
Route::get('/api/rpc/invoice/company/getall', 'InvoiceController@getCompanies');
|
||||
Route::get('/api/rpc/invoice/company/get/{id}', 'InvoiceController@getCompany');
|
||||
|
||||
Route::post('/api/rpc/invoice/company/new', 'InvoiceController@newCompany');
|
||||
Route::post('/api/rpc/invoice/company/edit', 'InvoiceController@editCompany');
|
||||
Route::post('/api/rpc/invoice/company/delete', 'InvoiceController@deleteCompany');
|
||||
|
||||
// Relations
|
||||
Route::get('/api/rpc/invoice/contacts/getcontacts', 'InvoiceController@getContacts');
|
||||
Route::get('/api/rpc/invoice/contacts/getcontact/{id}', 'InvoiceController@getContact');
|
||||
Route::get('/api/rpc/invoice/contacts/getall', 'InvoiceController@getContacts');
|
||||
Route::get('/api/rpc/invoice/contacts/get/{id}', 'InvoiceController@getContact');
|
||||
|
||||
Route::post('/api/rpc/invoice/contacts/new', 'InvoiceController@newContact');
|
||||
Route::post('/api/rpc/invoice/contacts/edit', 'InvoiceController@editContact');
|
||||
Route::post('/api/rpc/invoice/contacts/delete', 'InvoiceController@deleteContact');
|
||||
|
||||
// Invoices
|
||||
Route::get('/api/rpc/invoice/invoices/getinvoices', 'InvoiceController@getInvoices');
|
||||
Route::get('/api/rpc/invoice/invoices/getinvoice/{id}', 'InvoiceController@getInvoice');
|
||||
Route::get('/api/rpc/invoice/services/getservices', 'InvoiceController@getServices');
|
||||
Route::get('/api/rpc/invoice/services/getservice/{id}', 'InvoiceController@getService');
|
||||
Route::get('/api/rpc/invoice/periods/getperiods', 'InvoiceController@getPeriods');
|
||||
Route::get('/api/rpc/invoice/periods/getperiod/{id}', 'InvoiceController@getPeriod');
|
||||
Route::get('/api/rpc/invoice/invoices/getall', 'InvoiceController@getInvoices');
|
||||
Route::get('/api/rpc/invoice/periods/getall', 'InvoiceController@getPeriods');
|
||||
Route::get('/api/rpc/invoice/products/getall', 'InvoiceController@getProducts');
|
||||
Route::get('/api/rpc/invoice/services/getall', 'InvoiceController@getServices');
|
||||
|
||||
Route::get('/api/rpc/invoice/products/products/get', 'InvoiceController@getProducts');
|
||||
Route::get('/api/rpc/invoice/products/product/get/{id}', 'InvoiceController@getProduct');
|
||||
Route::get('/api/rpc/invoice/products/categories/get', 'InvoiceController@getProductCategories');
|
||||
Route::get('/api/rpc/invoice/products/category/get/{id}', 'InvoiceController@getProductCategory');
|
||||
Route::get('/api/rpc/invoice/products/intervals/get', 'InvoiceController@getProductIntervals');
|
||||
Route::get('/api/rpc/invoice/products/interval/get/{id}', 'InvoiceController@getProductInterval');
|
||||
Route::get('/api/rpc/invoice/invoices/get/{id}', 'InvoiceController@getInvoice');
|
||||
Route::get('/api/rpc/invoice/periods/get/{id}', 'InvoiceController@getPeriod');
|
||||
Route::get('/api/rpc/invoice/products/get/{id}', 'InvoiceController@getProduct');
|
||||
Route::get('/api/rpc/invoice/services/get/{id}', 'InvoiceController@getService');
|
||||
|
||||
Route::post('/api/rpc/invoice/invoices/deleteitem', 'InvoiceController@deleteInvoiceItem');
|
||||
Route::post('/api/rpc/invoice/invoices/delete', 'InvoiceController@deleteInvoice');
|
||||
Route::post('/api/rpc/invoice/services/delete', 'InvoiceController@deleteService');
|
||||
Route::post('/api/rpc/invoice/invoices/deleteitem', 'InvoiceController@deleteInvoiceItem');
|
||||
Route::post('/api/rpc/invoice/periods/delete', 'InvoiceController@deletePeriod');
|
||||
Route::post('/api/rpc/invoice/products/product/delete', 'InvoiceController@deleteProduct');
|
||||
Route::post('/api/rpc/invoice/products/category/delete', 'InvoiceController@deleteProductCategory');
|
||||
Route::post('/api/rpc/invoice/products/interval/delete', 'InvoiceController@deleteProductInterval');
|
||||
Route::post('/api/rpc/invoice/products/delete', 'InvoiceController@deleteProduct');
|
||||
Route::post('/api/rpc/invoice/services/delete', 'InvoiceController@deleteService');
|
||||
|
||||
Route::post('/api/rpc/invoice/invoices/edititem', 'InvoiceController@editInvoiceItem');
|
||||
Route::post('/api/rpc/invoice/invoices/edit', 'InvoiceController@editInvoice');
|
||||
Route::post('/api/rpc/invoice/services/edit', 'InvoiceController@editService');
|
||||
Route::post('/api/rpc/invoice/invoices/edititem', 'InvoiceController@editInvoiceItem');
|
||||
Route::post('/api/rpc/invoice/periods/edit', 'InvoiceController@editPeriod');
|
||||
Route::post('/api/rpc/invoice/products/product/edit', 'InvoiceController@editProduct');
|
||||
Route::post('/api/rpc/invoice/products/category/edit', 'InvoiceController@editProductCategory');
|
||||
Route::post('/api/rpc/invoice/products/interval/edit', 'InvoiceController@editProductInterval');
|
||||
Route::post('/api/rpc/invoice/products/edit', 'InvoiceController@editProduct');
|
||||
Route::post('/api/rpc/invoice/services/edit', 'InvoiceController@editService');
|
||||
|
||||
Route::post('/api/rpc/invoice/invoices/newitem', 'InvoiceController@newInvoiceItem');
|
||||
Route::post('/api/rpc/invoice/invoices/new', 'InvoiceController@newInvoice');
|
||||
Route::post('/api/rpc/invoice/services/new', 'InvoiceController@newService');
|
||||
Route::post('/api/rpc/invoice/invoices/newitem', 'InvoiceController@newInvoiceItem');
|
||||
Route::post('/api/rpc/invoice/periods/new', 'InvoiceController@newPeriod');
|
||||
Route::post('/api/rpc/invoice/products/product/new', 'InvoiceController@newProduct');
|
||||
Route::post('/api/rpc/invoice/products/category/new', 'InvoiceController@newProductCategory');
|
||||
Route::post('/api/rpc/invoice/products/interval/new', 'InvoiceController@newProductInterval');
|
||||
Route::post('/api/rpc/invoice/products/new', 'InvoiceController@newProduct');
|
||||
Route::post('/api/rpc/invoice/services/new', 'InvoiceController@newService');
|
||||
|
|
新しいイシューから参照