Coder Social home page Coder Social logo

module-shipmentinvoice's Introduction

Magento 2 ShipmentInvoice Extension

This extension allows Magento 2 customers to create and download invoices directly from their account page.

They can also create invoices as per shipments of their orders. For example if an order has two shipments, customer can go to his account page and create two invoices for each shipment, or create one invoice for both of them. Once the invoice is created, it can be printed by the customer.

Architecture

Architecture of the extension is very minimalistic, simple to understand, easy to maintain the code and very low on resource usage.

Template

Template Aario_ShipmentInvoice::order/info/buttons.phtml overides Magento_Sales::order/info/buttons.phtml and adds invoice creation widget to it.

Block

Block Aario\ShipmentInvoice\Block\Order\Info\Buttons overides Magento\Sales\Block\Order\Info\Buttons and adds some extra functionality needed to render the invoice creation widget, including list of shipments which customer can select and include them in the invoice bing created.

Widget

Widget Aario_ShipmentInvoice/js/create-invoice renders the invoice creation form. So the user can select shipments and click on Create Invoice button.

Controller

Controller Aario\ShipmentInvoice\Controller\Create then responds to the post request with order ID and shipment IDs in its parameters and creates the invoice. For each created invoice, the ID of the shipments included in the invoice are saved.

InstallSchema

The Install script Aario\ShipmentInvoice\Setup\InstallSchema adds a column named invoice_id to magento sales_shipment table, so in case customer has created an invoce with that shipment included in it, this will be stored in database. This allows the block to not provide those shipments to the widget, which are already included in an invoice.

How to install

To install the module, inside your magento root folder run:

composer config repositories.aario-module-shipmentinvoice git "https://github.com/aario/module-shipmentinvoice.git"
composer require aario/module-shipmentinvoice:dev-master
bin/magento module:enable Aario_ShipmentInvoice
bin/magento cache:clean
bin/magento setup:upgrade

Screenshots

Screenshot of create invoice dropdown menu

Screenshot of created invoice

module-shipmentinvoice's People

Contributors

aario avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.