2017 © Pedro Peláez
 

library webshoptaxation

image

agriya/webshoptaxation

  • Wednesday, May 21, 2014
  • by agriya
  • Repository
  • 4 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

WebshopTaxation

This package is to manage the taxation fee for the countries and product in the site. You can manage taxatopm fees easily by calling some easy function, (*1)

Instatllation

  1. Install the package by add the following line in composer.json of your root directory, (*2)

    "require": { ... ... "agriya/webshoptaxation": "dev", (*3)

    },, (*4)

    And then run "composer update", (*5)

2, After the package loaded add this line to app/conifg/app.php in the 'providers' array as like follows, (*6)

'providers' => array(
    ...
    ...
    'Agriya\Webshoptaxation\WebshoptaxationServiceProvider',
}
  1. After that run the following migrations commands from your root directory to create the tables in ur database. This will create you two tables, (*7)

    For published package php artisan migrate --package=Agriya/Webshoptaxation, (*8)

    For workbench package php artisan migrate --bench=Agriya/Webshoptaxation, (*9)

    Note: run these commands needs to be run from your root directory (where the composer.json has placed), (*10)

Thats it of installation. :), (*11)

Usage


Shipments list

Webshoptaxation::Taxations()->getTaxations([array $array, string $return_type]);, (*12)

Parameters

$array(required) Array can have either 'id' or 'user_id' as element. If 'id' is passed, then the specific taxatiion detail will be returned. If 'user_id' is passed, then all taxatiion details of the specified user will be returned., (*13)

$return(optional) This can be either 'list' or 'all'. (default is 'list'), (*14)

                'list'  This will return the result as "id" and "tax name" combination
                'firs'  This will return first result with all fields from taxations table
                'all'   This will return all the fields from taxations table for the given condition

Example

Webshoptaxation::Taxations()->getTaxations(array('user_id'=>1), 'all');

    This will return all taxations details of the user id 1 from taxations table 

Webshoptaxation::Taxations()->getTaxations(array('user_id'=>1), 'list');

    This will return the list ('id' => 'tax_name') combination for all taxations details for the user id 1 from taxations table 

Webshoptaxation::Taxations()->getTaxations(array('id'=>10), 'first');   

    This will return single taxations details for the id 10 from taxations table 

Add Taxation Details

    $inputs = array(
        'user_id'   => 1,
        'tax_name'  => 'VAT',
        'tax_description'   => 'Value added tax',
        'tax_fee'   => '14.5',
        'fee_type'  => 'percentage',
    );
    $taxatonid = Webshoptaxation::Taxations()->addTaxation($inputs);

Update Taxation Details

    $inputs = array(
        'tax_name'  => 'VAT',
        'tax_description'   => 'Value Added Tax',
        'tax_fee'   => '10',
        'fee_type'  => 'flat',
    );

    $taxatonid = Webshoptaxation::Taxations()->updateTaxation(1, $inputs);

Delete Taxation Details

    $taxatonid = Webshoptaxation::Taxations()->deleteTaxation(1);

Product Taxation Fees

Get Product Taxation Fees List

    $inputs = array(
        'product_id'    => $product_id,
    );
    $producttaxatonslist = Webshoptaxation::ProductTaxations()->getProductTaxations($inputs);

Add Product Taxation Fees List

    $inputs = array(
        'taxation_id'   => 2,
        'product_id'    => 1,
        'tax_fee'       => '14.5',
        'fee_type'      => 'percentage',
    );
    $producttaxatonid = Webshoptaxation::ProductTaxations()->addProductTaxation($inputs);

Update Product Taxation Fees List

    Update based on id
    -------------------
            $inputs = array(
                'tax_fee'   => '5',
                'fee_type'  => 'flat',
            );

            $taxatonid = Webshoptaxation::ProductTaxations()->updateProductTaxation(1, $inputs);

    Update based on conditions
    --------------------------
            $inputs = array(
                'tax_fee'   => '5',
                'fee_type'  => 'flat',
            );

            $conditions = array(
                'product_id' => 1,
                'taxation_id' => 2
            );

            $taxatonid = Webshoptaxation::ProductTaxations()->updateProductTaxation(null, $inputs, $conditions);

Delete Product Taxation Fees List

    Delete based on id
    -------------------
            $inputs = array(
                'tax_fee'   => '5',
                'fee_type'  => 'flat',
            );

            $taxatonid = Webshoptaxation::ProductTaxations()->deleteProductTaxation(1);

    Delete based on conditions
    --------------------------
            $inputs = array(
                'tax_fee'   => '5',
                'fee_type'  => 'flat',
            );

            $conditions = array(
                'product_id' => 1,
                'taxation_id' => 2
            );
            $taxatonid = Webshoptaxation::ProductTaxations()->deleteProductTaxation(null, $conditions);

The Versions

21/05 2014

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Ahsan