CoderFunda
  • Home
  • About us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • About us
  • Home
  • Php
  • HTML
  • CSS
  • JavaScript
    • JavaScript
    • Jquery
    • JqueryUI
    • Stock
  • SQL
  • Vue.Js
  • Python
  • Wordpress
  • C++
    • C++
    • C
  • Laravel
    • Laravel
      • Overview
      • Namespaces
      • Middleware
      • Routing
      • Configuration
      • Application Structure
      • Installation
    • Overview
  • DBMS
    • DBMS
      • PL/SQL
      • SQLite
      • MongoDB
      • Cassandra
      • MySQL
      • Oracle
      • CouchDB
      • Neo4j
      • DB2
      • Quiz
    • Overview
  • Entertainment
    • TV Series Update
    • Movie Review
    • Movie Review
  • More
    • Vue. Js
    • Php Question
    • Php Interview Question
    • Laravel Interview Question
    • SQL Interview Question
    • IAS Interview Question
    • PCS Interview Question
    • Technology
    • Other

27 May, 2021

Magento 2 Free Extension - Inventory Log

 Programing Coderfunda     May 27, 2021     Magento 2     No comments   

 




1.

vendor /module under all process



magento2-inventory-log/Api/Data/MovementInterface.php

<?php
/**
* KiwiCommerce
*
* Do not edit or add to this file if you wish to upgrade to newer versions in the future.
* If you wish to customise this module for your needs.
* Please contact us https://kiwicommerce.co.uk/contacts.
*
* @category KiwiCommerce
* @package KiwiCommerce_InventoryLog
* @copyright Copyright (C) 2018 KiwiCommerce Ltd (https://kiwicommerce.co.uk/)
* @license https://kiwicommerce.co.uk/magento2-extension-license/
*/
namespace KiwiCommerce\InventoryLog\Api\Data;
interface MovementInterface
{
const MOVEMENT_ID = 'movement_id';
const QTY_MOVEMENT = 'qty_movement';
const USER_ID = 'user_id';
const STOCK_ITEM_ID = 'stock_item_id';
const OLD_QTY = 'old_qty';
const IS_ADMIN = 'is_admin';
const ENTITY_ID = 'entity_id';
const CURRENT_QTY = 'current_qty';
const MESSAGE = 'message';
const USERNAME = 'username';
const CREATED_AT = 'created_at';
const UKEY = 'ukey';
const IP = 'ip';
const IS_IN_STOCK = 'is_in_stock';
const PRODUCT_ID = 'product_id';
/**
* Get movement_id
* @return string|null
*/
public function getMovementId();
/**
* Set movement_id
* @param string $movementId
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setMovementId($movementId);
/**
* Get entity_id
* @return string|null
*/
public function getEntityId();
/**
* Set entity_id
* @param string $entityId
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setEntityId($entityId);
/**
* Get stock_item_id
* @return string|null
*/
public function getStockItemId();
/**
* Set stock_item_id
* @param string $stockItemId
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setStockItemId($stockItemId);
/**
* Get product_id
* @return string|null
*/
public function getProductId();
/**
* Set product_id
* @param string $productId
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setProductId($productId);
/**
* Get user_id
* @return string|null
*/
public function getUserId();
/**
* Set user_id
* @param string $userId
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setUserId($userId);
/**
* Get username
* @return string|null
*/
public function getUsername();
/**
* Set username
* @param string $username
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setUsername($username);
/**
* Get Is_admin
* @return string|null
*/
public function getIsAdmin();
/**
* Set Is_admin
* @param string $isAdmin
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setIsAdmin($isAdmin);
/**
* Get current_qty
* @return string|null
*/
public function getCurrentQty();
/**
* Set current_qty
* @param string $currentQty
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setCurrentQty($currentQty);
/**
* Get qty_movement
* @return string|null
*/
public function getQtyMovement();
/**
* Set qty_movement
* @param string $qtyMovement
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setQtyMovement($qtyMovement);
/**
* Get old_qty
* @return string|null
*/
public function getOldQty();
/**
* Set old_qty
* @param string $oldQty
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setOldQty($oldQty);
/**
* Get is_in_stock
* @return string|null
*/
public function getIsInStock();
/**
* Set is_in_stock
* @param string $isInStock
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setIsInStock($isInStock);
/**
* Get message
* @return string|null
*/
public function getMessage();
/**
* Set message
* @param string $message
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setMessage($message);
/**
* Get ukey
* @return string|null
*/
public function getUkey();
/**
* Set ukey
* @param string $ukey
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setUkey($ukey);
/**
* Get ip
* @return string|null
*/
public function getIp();
/**
* Set ip
* @param string $ip
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setIp($ip);
/**
* Get created_at
* @return string|null
*/
public function getCreatedAt();
/**
* Set created_at
* @param string $createdAt
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
*/
public function setCreatedAt($createdAt);
} 2nd

magento2-inventory-log/Api/Data/MovementSearchResultsInterface.php



<?php
/**
* KiwiCommerce
*
* Do not edit or add to this file if you wish to upgrade to newer versions in the future.
* If you wish to customise this module for your needs.
* Please contact us https://kiwicommerce.co.uk/contacts.
*
* @category KiwiCommerce
* @package KiwiCommerce_InventoryLog
* @copyright Copyright (C) 2018 KiwiCommerce Ltd (https://kiwicommerce.co.uk/)
* @license https://kiwicommerce.co.uk/magento2-extension-license/
*/
namespace KiwiCommerce\InventoryLog\Api\Data;
interface MovementSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
{
/**
* Get movement list.
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface[]
*/
public function getItems();
/**
* Set entity_id list.
* @param \KiwiCommerce\InventoryLog\Api\Data\MovementInterface[] $items
* @return $this
*/
public function setItems(array $items);
}

<?php
/**
* KiwiCommerce
*
* Do not edit or add to this file if you wish to upgrade to newer versions in the future.
* If you wish to customise this module for your needs.
* Please contact us https://kiwicommerce.co.uk/contacts.
*
* @category KiwiCommerce
* @package KiwiCommerce_InventoryLog
* @copyright Copyright (C) 2018 KiwiCommerce Ltd (https://kiwicommerce.co.uk/)
* @license https://kiwicommerce.co.uk/magento2-extension-license/
*/
namespace KiwiCommerce\InventoryLog\Api;
use Magento\Framework\Api\SearchCriteriaInterface;
interface MovementRepositoryInterface
{
/**
* Save movement
* @param \KiwiCommerce\InventoryLog\Api\Data\MovementInterface $movement
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function save(
\KiwiCommerce\InventoryLog\Api\Data\MovementInterface $movement
);
/**
* Retrieve movement
* @param string $movementId
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementInterface
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getById($movementId);
/**
* Retrieve movement matching the specified criteria.
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @return \KiwiCommerce\InventoryLog\Api\Data\MovementSearchResultsInterface
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getList(
SearchCriteriaInterface $searchCriteria
);
/**
* Delete movement
* @param \KiwiCommerce\InventoryLog\Api\Data\MovementInterface $movement
* @return bool true on success
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function delete(
\KiwiCommerce\InventoryLog\Api\Data\MovementInterface $movement
);
/**
* Delete movement by ID
* @param string $movementId
* @return bool true on success
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function deleteById($movementId);
}

<?php
/**
* KiwiCommerce
*
* Do not edit or add to this file if you wish to upgrade to newer versions in the future.
* If you wish to customise this module for your needs.
* Please contact us https://kiwicommerce.co.uk/contacts.
*
* @category KiwiCommerce
* @package KiwiCommerce_InventoryLog
* @copyright Copyright (C) 2018 KiwiCommerce Ltd (https://kiwicommerce.co.uk/)
* @license https://kiwicommerce.co.uk/magento2-extension-license/
*/
namespace KiwiCommerce\InventoryLog\Helper;
use \Magento\Customer\Model\Session as CustomerSession;
use \Magento\Backend\Model\Auth\Session as AdminSession;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
const RANDOM_STRING_LENGTH = 5;
const STOCK_UPDATE = 1;
const ORDER_CANCEL = 2;
const CREDIT_MEMO = 3;
const MOVEMENT_SECTION = "movement_section";
const NEW_PRODUCT = "new_product";
const MOVEMENT_DATA = "movement_data";
const RESOURCE_ID = "KiwiCommerce_InventoryLog::config";
const CONFIG_ENABLE_PATH = 'inventory_log/general/inventory_enabled';
/**
* @var string $randomString
*/
public $randomString='';
/**
* @var \Magento\Customer\Model\Session
*/
public $customerSession;
/**
* @var \Magento\Backend\Model\Auth\Session
*/
public $backendAuthSession;
/**
* @var \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress
*/
public $remoteAddress;
/**
* @var \Magento\Framework\Registry
*/
public $registry;
/**
* @var \Magento\Framework\Authorization\PolicyInterface
*/
public $policyInterface;
/**
* @var AdminSession
*/
public $authSession;
/**
* Data constructor.
* @param \Magento\Framework\App\Helper\Context $context
* @param CustomerSession $customerSession
* @param AdminSession $backendAuthSession
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Authorization\PolicyInterface $policyInterface
* @param AdminSession $authSession
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
CustomerSession $customerSession,
AdminSession $backendAuthSession,
\Magento\Framework\Registry $registry,
\Magento\Framework\Authorization\PolicyInterface $policyInterface,
\Magento\Backend\Model\Auth\Session $authSession
) {
$this->customerSession = $customerSession;
$this->backendAuthSession = $backendAuthSession;
$this->remoteAddress = $context->getRemoteAddress();
$this->registry = $registry;
$this->policyInterface = $policyInterface;
$this->authSession = $authSession;
parent::__construct($context);
}
/**
* Whether a module is enabled in the configuration or not
*
* @param string $moduleName Fully-qualified module name
* @return boolean
*/
public function isModuleEnabled()
{
if ($this->_moduleManager->isEnabled('KiwiCommerce_InventoryLog')) {
if ($this->isEnabled()) {
return true;
}
}
return false;
}
/**
* Whether a module output is permitted by the configuration or not
*
* @param string $moduleName Fully-qualified module name
* @return boolean
*/
public function isOutputEnabled()
{
if ($this->_moduleManager->isOutputEnabled('KiwiCommerce_InventoryLog')) {
if ($this->isEnabled()) {
return true;
}
}
return false;
}
/**
* @param $resourceId
* @param null $user
* @return bool
*/
public function isAllowed($user = null)
{
if (!$user) {
$user = $this->authSession->getUser();
}
$role = $user->getRole();
$permission = $this->policyInterface->isAllowed($role->getId(), self::RESOURCE_ID);
if ($permission) {
return true;
}
return false;
}
/**
* @return bool
*/
public function isEnabled()
{
$storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
if ($this->scopeConfig->getValue(self::CONFIG_ENABLE_PATH, $storeScope)) {
return true;
}
return false;
}
/**
* Generate random Unique String
* @param integer $productId
* @return string
*/
public function getRandomUniqueString($productId = null)
{
$this->randomString=$this->generateRandomString();
if (!empty($productId)) {
$this->randomString.=$productId;
}
$this->randomString.=time();
return $this->randomString;
}
/**
* @param int $length
* @return bool|string
*/
public function generateRandomString($length = self::RANDOM_STRING_LENGTH)
{
return substr(
str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 5)),
0,
$length
);
}
/**
* Check admin isLoggedIn
* @return int
*/
public function isAdminLoggedIn()
{
return (int) $this->backendAuthSession->isLoggedIn();
}
/**
* get logged userId
* @return int
*/
public function getUserId()
{
$userId = null;
if ($this->customerSession->isLoggedIn()) {
$userId = $this->customerSession->getCustomerId();
} elseif ($this->backendAuthSession->isLoggedIn()) {
$userId = $this->backendAuthSession->getUser()->getId();
}
return $userId;
}
/**
* Get logged username
* @return mixed|string
*/
public function getUsername()
{
$username = '-';
if ($this->customerSession->isLoggedIn()) {
$username = $this->customerSession->getCustomer()->getName();
} elseif ($this->backendAuthSession->isLoggedIn()) {
$username = $this->backendAuthSession->getUser()->getUsername();
}
return $username;
}
/**
* get remote computer address
* @return string
*/
public function getRemoteAddress()
{
return $this->remoteAddress->getRemoteAddress();
}
/**
* Clear registry
* @return null
*/
public function unRegisterAllData()
{
$keys = [self::MOVEMENT_SECTION, self::MOVEMENT_DATA, self::NEW_PRODUCT];
array_walk($keys, [$this->registry, 'unregister']);
}
/**
* write logfile
* @param null $logFileName
* @return \Zend\Log\Logger
*/
public function callLogObj($logFileName = null)
{
if (!$logFileName) {
$logFileName = 'custom.log';
}
if (!$logFileName) {
$logFileName = 'custom.log';
}
$logFileName = '/var/log/'.$logFileName;
$writer = new \Zend\Log\Writer\Stream(BP . $logFileName);
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('--Log Start--');
return $logger;
}
magento2-inventory-log/Model/
you can visit and check the data acording to you https://github.com/kiwicommerce/magento2-inventory-log/tree/master/Model/ResourceModel/Movement
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

02 May, 2021

Laravel Activity Log Package

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

Laravel Activity Log Package


 Freek Van der Herten has created a new package that will allow you to easily setup an activity log for your users. It includes two methods of logging activities, a Model trait and an Activity::log() facade.

Not only can you log events but you can pull them out using:

use Spatie\Activitylog\Models\Activity;

$latestActivities = Activity::with('user')->latest()->limit(100)->get();

Of course this wouldn’t be complete without an automatic way of cleaning up old logs:

Activity::cleanLog();

The cleanLog sounds like a perfect pairing with the Laravel 5 Scheduler


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Reanimate – Let users “undo” a delete

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

Reanimate – Let users “undo” a delete


Reanimate simplifies undoing of soft-deletes for your application. If you use Gmail then you may have seen this in action. After you send an email this notification pops up:

undo

This package aims to make this easier by introducing an undoDelete method on a trait, so all your left with is adding a route and styling out your “undo” message. Check out the repo for full details.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Two packages to easily install PHPCI in Laravel Homestead

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

Two packages to easily install PHPCI in Laravel Homestead


 A few weeks ago Mike Bronner wrote a tutorial on how to install PHPCI, an open source continuous integration application, in Laravel Homestead.

His tutorial demonstrated the manual way of installing it by going through all the steps required. Since this post two new packages have been released to automate this process.

The first is homestead-phpci by Egor Pervuninski. This package uses Ansible to automatically install PHPCI.

Syed Irfaq R. had the same ideas and created a phpci-installer. This one differs as it uses a simple shell script to install everything you need.

Whether you prefer to follow a tutorial, use a shell script, or ansible installing phpci should be really simple now.


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel 5 Hashids

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

Laravel 5 Hashids


 Laravel 5 Hashids is a wrapper to the Hashids project.

Hashids is a small open-source library that generates short, unique, non-sequential ids from numbers.

It converts numbers like 347 into strings like “yr8”, or array of numbers like [27, 986] into “3kTMd”.

You can also decode those ids back. This is useful in bundling several parameters into one or simply using them as short UIDs.

Here are a few examples on how this can be used inside your Laravel app:

// Encode integers.
Hashids::encode(4815162342);

// Decode strings.
Hashids::decode('1LLb3b4ck');

// Dependency injection example.
$hashidsManager->encode(911);

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

ReactJS Laravel Package

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

ReactJS Laravel Package


 The ReactJS Laravel Package is designed to use components from your blade views:

With react-laravel you’ll be able to use ReactJS components right from your Blade views, with optional server-side rendering, and use them on the client-side with React due to unobtrusive JavaScript.


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Aimeos – Laravel Ecommerce Package

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

Aimeos – Laravel Ecommerce Package


 Aimeos is a Laravel package that contains everything you need to create your new web shop including product catalogs, baskets, checkout, payment, order management, and e-mails.

The developer says one of its biggest advantages is the possibility to adapt everything to your needs, so it can be used not only for standard web shops but also for reservation systems, portals or anything that is organized in list and detail views. It’s also easy to replace or reorder all parts in the front-end only by configuration.


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Envoyer Deploy Command

 Programing Coderfunda     May 02, 2021     Packages, php     No comments   

Envoyer Deploy Command


 Dayle Rees created a new package that will allow you deploy with Envoyer from the command line.

With this package deploying is as simple as:

➜ php artisan envoyer:deploy
Deployment request successful!

You can also pass in a project flag for more fine-grained control:

➜ php artisan envoyer:deploy --project cakesandpies
Deployment request successful!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • Write API Integrations in Laravel and PHP Projects with Saloon
    Write API Integrations in Laravel and PHP Projects with Saloon Saloon  is a Laravel/PHP package that allows you to write your API integratio...
  • Credit card validation in laravel
      Validation rules for credit card using laravel-validation-rules/credit-card package in laravel Install package laravel-validation-rules/cr...
  • iOS 17 Force Screen Rotation not working on iPAD only
    I have followed all the links on Google and StackOverFlow, unfortunately, I could not find any reliable solution Specifically for iPad devic...
  • C++ in Hindi Introduction
    C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पह...
  • Send message via CANBus
    After some years developing for mobile devices, I've started developing for embedded devices, and I'm finding a new problem now. Th...

Categories

  • Ajax (26)
  • Bootstrap (30)
  • DBMS (42)
  • HTML (12)
  • HTML5 (45)
  • JavaScript (10)
  • Jquery (34)
  • Jquery UI (2)
  • JqueryUI (32)
  • Laravel (1017)
  • Laravel Tutorials (23)
  • Laravel-Question (6)
  • Magento (9)
  • Magento 2 (95)
  • MariaDB (1)
  • MySql Tutorial (2)
  • PHP-Interview-Questions (3)
  • Php Question (13)
  • Python (36)
  • RDBMS (13)
  • SQL Tutorial (79)
  • Vue.js Tutorial (68)
  • Wordpress (150)
  • Wordpress Theme (3)
  • codeigniter (108)
  • oops (4)
  • php (853)

Social Media Links

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • September (100)
  • August (50)
  • July (56)
  • June (46)
  • May (59)
  • April (50)
  • March (60)
  • February (42)
  • January (53)
  • December (58)
  • November (61)
  • October (39)
  • September (36)
  • August (36)
  • July (34)
  • June (34)
  • May (36)
  • April (29)
  • March (82)
  • February (1)
  • January (8)
  • December (14)
  • November (41)
  • October (13)
  • September (5)
  • August (48)
  • July (9)
  • June (6)
  • May (119)
  • April (259)
  • March (122)
  • February (368)
  • January (33)
  • October (2)
  • July (11)
  • June (29)
  • May (25)
  • April (168)
  • March (93)
  • February (60)
  • January (28)
  • December (195)
  • November (24)
  • October (40)
  • September (55)
  • August (6)
  • July (48)
  • May (2)
  • January (2)
  • July (6)
  • June (6)
  • February (17)
  • January (69)
  • December (122)
  • November (56)
  • October (92)
  • September (76)
  • August (6)

Loading...

Laravel News

Loading...

Copyright © CoderFunda | Powered by Blogger
Design by Coderfunda | Blogger Theme by Coderfunda | Distributed By Coderfunda