Ejemplo n.º 1
0
 public function getStockProducts()
 {
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $catogories = new Category();
     $categoriesAll = $catogories->getCategoriesDropDown();
     $products = new Product();
     $productAll = $products->getProductsWithCategories();
     return view('Searches.stockProduct', compact('productAll'))->with('categoriesAll', $categoriesAll)->with('allStockInfos', $allStockInfos)->with('branchAll', $branchAll);
 }
 public function getCreate()
 {
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $parties = new Party();
     $partyAll = $parties->getPartiesDropDown();
     $imports = new Import();
     $consignmentAll = $imports->getConsignmentNameDropDown();
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     return view('SalesReturn.add', compact('allStockInfos', 'consignmentAll'))->with('branchAll', $branchAll)->with('partyAll', $partyAll);
 }
Ejemplo n.º 3
0
 public function postStocksproductsresult()
 {
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     $catogories = new Category();
     $categoriesAll = $catogories->getCategoriesDropDown();
     $report = new Report();
     $branch_id = Input::get('branch_id');
     $stock_info_id = Input::get('stock_info_id');
     $category_id = Input::get('category_id');
     $product_type = Input::get('product_type');
     $results = $report->getStockReportResult($stock_info_id, $product_type, $branch_id, $category_id);
     return view('Reports.stockProductsReport')->with('stock_info_id', $stock_info_id)->with('branch_id', $branch_id)->with('category_id', $category_id)->with('product_type', $product_type)->with('results', $results)->with('branchAll', $branchAll)->with('allStockInfos', $allStockInfos)->with('categoriesAll', $categoriesAll);
 }
Ejemplo n.º 4
0
 public function getChangeStatus($status, $id)
 {
     $stockInfo = StockInfo::find($id);
     if ($stockInfo['status'] == $status) {
         $stockInfo->status = $status == 'Activate' ? 'Deactivate' : 'Activate';
         $stockInfo->save();
     }
     return new JsonResponse(array('id' => $stockInfo['id'], 'status' => $stockInfo['status']));
 }
Ejemplo n.º 5
0
                    <th>Price</th>
                    <th>Quantity</th>
                    <th>Amount</th>
                    <th>Remarks</th>
                    <th>Action</th>
                </tr>
                </thead>
                <tbody>
                <?php 
$total = 0;
?>
                @foreach($purchaseInvoiceDetails as $purchaseInvoiceDetail )
                    <?php 
$stocks = new \App\StockInfo();
$branch = new \App\Branch();
$stockName = \App\StockInfo::find($purchaseInvoiceDetail->stock_info_id);
$branchName = \App\Branch::find($purchaseInvoiceDetail->branch_id);
$categoryName = \App\Category::find($purchaseInvoiceDetail->product->category_id);
$subCategoryName = \App\SubCategory::find($purchaseInvoiceDetail->product->sub_category_id);
?>
                    <tr class="odd gradeX">
                        <td>{{$branchName->name}}</td>
                        <td>{{$stockName->name}}</td>
                        <td>{{$purchaseInvoiceDetail->product_type}}</td>
                        <td>{{$purchaseInvoiceDetail->product->name.'('.$categoryName->name.')'.'('.$subCategoryName->name.')'}}</td>
                        <td>{{$purchaseInvoiceDetail->price}}</td>
                        <td>{{$purchaseInvoiceDetail->quantity}}</td>
                        <td>{{$purchaseInvoiceDetail->quantity * $purchaseInvoiceDetail->price}}</td>
                        <td>
                            @if($purchaseInvoiceDetail->remarks)
                                {{ $purchaseInvoiceDetail->remarks }}
 public function getEdit($id)
 {
     $suppliers = new Party();
     $suppliersAll = $suppliers->getSuppliersDropDown();
     $products = new Product();
     $localProducts = $products->getLocalProductsDropDown();
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     $purchase[0] = PurchaseInvoice::where('invoice_id', '=', $id)->get();
     $var = $purchase[0];
     $purchaseDetails = PurchaseInvoiceDetail::where('detail_invoice_id', '=', $id)->get();
     if (count($purchaseDetails) < 1) {
         return Redirect::to('purchases/index');
     }
     return view('PurchaseInvoice.edit', compact('suppliersAll'))->with('localProducts', $localProducts)->with('purchaseDetails', $purchaseDetails)->with('purchase', $var)->with('branchAll', $branchAll)->with('allStockInfos', $allStockInfos);
 }
Ejemplo n.º 7
0
 private function stockDetailConvertToArray($stockDetails)
 {
     $array = array();
     $stockName = StockInfo::find($stockDetails->stock_info_id);
     $tostockName = StockInfo::find($stockDetails->to_stock_info_id);
     //var_dump($stockDetails->to_stock_info_id); die();
     $branchName = Branch::find($stockDetails->branch_id);
     $array['id'] = $stockDetails->id;
     $array['branch_id'] = $branchName->name;
     $array['stock_info_id'] = $stockName->name;
     $array['product_type'] = $stockDetails->product_type;
     $productsName = Product::find($stockDetails->product_id);
     $category = $productsName->category->name;
     $subCategoryName = '';
     if ($productsName->sub_category_id) {
         $subCategory = SubCategory::find($productsName->sub_category_id);
         $subCategoryName = '(' . $subCategory->name . ')';
     }
     $array['product_id'] = $stockDetails->product->name . ' (' . $category . ') ' . $subCategoryName;
     if ($tostockName != null) {
         $array['to_stock_info_id'] = $tostockName->name;
     }
     $array['entry_type'] = $stockDetails->entry_type;
     $array['product_quantity'] = $stockDetails->quantity;
     $array['remarks'] = $stockDetails->remarks;
     $array['consignment_name'] = $stockDetails->consignment_name;
     return $array;
 }
                            <th>Quantity</th>
                            <th>Remarks</th>
                            <th>Total Sale</th>

                        </tr>
                        </thead>
                        <tbody>
                        <?php 
$totalSale = 0;
$invoiceSave = array();
?>

                        @foreach($results as $result )
                            <?php 
$products = \App\Product::find($result->product_id);
$stocks = \App\StockInfo::find($result->stock);
$categories = \App\Category::find($result->category_id);
$subCategories = \App\SubCategory::find($result->sub_category_id);
if ($result->sub_category_id) {
    $subCategoryName = '(' . $subCategories->name . ')';
} else {
    $subCategoryName = '';
}
?>

                            <tr class="odd gradeX">
                                <td>
                                    @if(in_array($result->invoice,$invoiceSave))

                                    @else
                                    <a target="_blank" href="{{URL::to('sales?invoice_id='.$result->invoice)}}">{{$result->invoice}}</a>
Ejemplo n.º 9
0
 public function getStocks($id)
 {
     $stocks = StockCount::where('product_id', '=', $id)->get();
     $stockArray = array();
     $x = "";
     foreach ($stocks as $row) {
         $stockInfo = StockInfo::find($row->stock_info_id);
         $x .= "<option value='" . $row->stock_info_id . "'>" . $stockInfo->name . " (" . $row->product_quantity . ")</option>";
         array_push($stockArray, $row->stock_info_id);
     }
     $stocks = StockInfo::whereNotIn('id', $stockArray)->get();
     foreach ($stocks as $row) {
         $x .= "<option value='" . $row->id . "'>" . $row->name . " (0)</option>";
     }
     $product = Product::find($id);
     $data = array('list' => $x, 'price' => $product->price);
     return json_encode($data);
 }
Ejemplo n.º 10
0
 public function getDetails($id)
 {
     $imports = ImportDetail::where('import_num', '=', $id)->get();
     $bankCost = BankCost::where('import_id', '=', $id)->get();
     $cnfCost = CnfCost::where('import_id', '=', $id)->get();
     $pi = ProformaInvoice::where('import_id', '=', $id)->get();
     $otherCost = OtherCost::where('import_id', '=', $id)->get();
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     return view('Imports.details', compact('imports', 'id'))->with('bankCost', $bankCost)->with('pi', $pi)->with('otherCost', $otherCost)->with('cnfCost', $cnfCost)->with('allStockInfos', $allStockInfos);
 }
Ejemplo n.º 11
0
 public function getEdit($id)
 {
     $stockInvoices = SalesReturnInvoice::find($id);
     $branches = new Branch();
     $stockDetails = SalesReturnDetail::where('invoice_id', '=', $stockInvoices->invoice_id)->first();
     $stockDetails2 = SalesReturnDetail::where('invoice_id', '=', $stockInvoices->invoice_id)->get();
     // get all stocks
     $invoiceId = $stockInvoices->invoice_id;
     //$invoiceId = 's121513';
     $buyersAll = 0;
     $imports = Import::where('status', '=', 'Activate')->get();
     $productsName = Product::where('product_type', '=', $stockDetails->product_type)->get();
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $parties = new Party();
     $partyAll = $parties->getPartiesDropDown();
     $imports = new Import();
     $consignmentAll = $imports->getConsignmentNameDropDown();
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     $imports = Import::where('status', '=', 'Activate')->get();
     return view('SalesReturn.edit2', compact('buyersAll', 'invoiceId', 'stockInvoices', 'stockDetails', 'productsName', 'stockDetails2', 'imports', 'partyAll', 'consignmentAll'))->with('branchAll', $branchAll)->with('allStockInfos', $allStockInfos);
     //        return view('Stocks.edit',compact('stock'))
     //            ->with('allStockInfos',$allStockInfos)
     //            ->with('branchAll',$branchAll);
 }
Ejemplo n.º 12
0
        <div class="row" style="margin-top: -10px;">

            <div class="col-xs-8">
                <table>

                        <?php 
foreach ($stockDetails as $stockDetail) {
    ?>
                            <tr>
                                <td><b>Entry Type</b></td>
                                <td>: {{$stockDetail->entry_type}}</td>
                            </tr>
                            <?php 
    if ($stockDetail->entry_type == 'Transfer') {
        $stockName = \App\StockInfo::find($stockDetail->to_stock_info_id);
        ?>
                            <tr>
                                <td><b>Transfer To</b></td>
                                <td>: {{$stockName->name}}</td>
                            </tr>
                            <?php 
    }
    ?>
                            <?php 
    break;
    ?>

                        <?php 
}
?>
Ejemplo n.º 13
0
                        <th>Remarks</th>
                        <th>Consignment</th>
                        <th>Created By</th>
                       <!-- <th>Status</th>-->
                        <th>Action</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
$sl = 1;
?>
                    @foreach($stocks as $stock )
                        <?php 
$categoryName = \App\Category::find($stock->product->category_id);
$subCategoryName = \App\SubCategory::find($stock->product->sub_category_id);
$stockTo = \App\StockInfo::find($stock->to_stock_info_id);
?>
                    <tr class="odd gradeX">
                        <td><?php 
echo $sl;
?>
</td>
                        <td>{{$stock->branch->name}}</td>
                        <td>{{$stock->product->name.'('.$categoryName->name.')'.'('.$subCategoryName->name.')'}}</td>
                        <td>{{$stock->stockInfo->name}}</td>
                        <td>{{$stock->to_stock_info_id ? $stockTo->name : '' }}</td>
                        <td>@if($stock->entry_type == 'StockIn')
                                <span class="label label-sm label-success">StockIn</span>
                            @elseif($stock->entry_type == 'StockOut')
                                <span class="label label-sm label-danger">StockOut</span>
                            @elseif($stock->entry_type == 'Transfer')
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
            <?php 
$userId = Session::get('user_id');
$userName = \App\User::find($userId);
?>
            <?php 
use Illuminate\Support\Facades\URL;
$curent_url = $_SERVER['REQUEST_URI'];
if ($curent_url == '/reports/printstocksproducts') {
    ?>
            <h3 class="page-title" style="text-align: center;"> All Stock Report  </h3>
            <?php 
} else {
    $stock = \App\StockInfo::find($stock_info_id);
    $cat = \App\Category::find($category_id);
    $branch = \App\Branch::find($branch_id);
    ?>

            <center>
                <h3 style="text-align: center;">zxczxcStock In Hand Report</h3>
                <b>For Category: {{$cat->name}} and Stock:{{$stock->name}} and Branch {{$branch->name}}</b><br>
                    <label>Printed by : {{$userName->name}}</label>
            </center>



            <?php 
}
?>
Ejemplo n.º 15
0
 private function saleDetailConvertToArray($salesDetails)
 {
     $array = array();
     $stockName = StockInfo::find($salesDetails->stock_info_id);
     $branchName = Branch::find($salesDetails->branch_id);
     $array['id'] = $salesDetails->id;
     $array['branch_id'] = $branchName->name;
     $array['stock_info_id'] = $stockName->name;
     $array['product_type'] = $salesDetails->product_type;
     $array['product_id'] = $salesDetails->product->name;
     $array['price'] = $salesDetails->price;
     $array['quantity'] = $salesDetails->quantity;
     $array['remarks'] = $salesDetails->remarks;
     return $array;
 }
Ejemplo n.º 16
0
 public function getEdit($id)
 {
     $stock = Stock::find($id);
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     return view('Stocks.edit', compact('stock'))->with('allStockInfos', $allStockInfos)->with('branchAll', $branchAll);
 }
Ejemplo n.º 17
0
                                        <th width="">Stock Name</th>
                                        <th width="">Product Type</th>
                                        <th width="">Product Name</th>
                                        <th width="">Price</th>
                                        <th width="">Quantity</th>
                                        <th width="">Remarks</th>
                                        <th width="">Action</th>
                                    </tr>

                                    </thead>

                                    @foreach($saleDetails as $saleDetail)
                                        <?php 
$branch = new \App\Branch();
$stocks = new \App\StockInfo();
$stockName = \App\StockInfo::find($saleDetail->stock_info_id);
$branchName = \App\Branch::find($saleDetail->branch_id);
?>
                                        <tr>
                                            <td> {{ $stockName->name }}</td>
                                            <td> {{ $saleDetail->product_type }}</td>
                                            <td> {{ $saleDetail->product->name }}</td>
                                            <td> {{ $saleDetail->price }}</td>
                                            <td> {{ $saleDetail->quantity }}</td>
                                            <td>
                                                @if($saleDetail->remarks)
                                                {{ $saleDetail->remarks }}
                                                @else
                                                    {{"Not Available"}}
                                                @endif
                                            </td>
Ejemplo n.º 18
0
 public function getAllStocks()
 {
     $stocks = StockInfo::where('status', '=', 'Activate')->get();
     return $stocks;
 }