InvManage.views.sales_order_views

Module Contents

Functions

create_sales_order_view(request)

Creates a sales order (SO) on POST request, and returns a SO creation form on GET request.

update_sales_order_view(request)

Updates a sales order on POST request and returns the sales order update form for GET request.

delete_sales_order_view(request, pk)

Deletes the sales order with primary key object_id on POST request.

display_sales_orders_view(request)

Retrieves the list of sales orders on GET request.

print_sales_order_view(request, pk)

Opens the sales order with primary key so_id for printing on GET request.

InvManage.views.sales_order_views.create_sales_order_view(request)

Creates a sales order (SO) on POST request, and returns a SO creation form on GET request.

GET /sales_order

Gets the sales order creation form.

Example request:

GET /sales_order/ HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Request Headers
  • Accept – text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Status Codes
  • 200 OK – Sales order creation form received successfully.

POST /sales_order

Creates a sales order.

Example request:

POST /sales_order/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • so-consumer5

  • consumer-nameThe Music Store

  • consumer-identifierCONS1256

  • consumer-gstin89ACC654654335

  • consumer-phone+91 8325642358

  • consumer-addressPlot no 958, N- 4, Neo Complex, Barh, Wokha, Nagaland, 797111

  • consumer-emailJohnDoe@themusic.store

  • consumer-locationWokha

  • so-so465

  • so-date2021-09-30

  • so-tax12

  • so-discount8

  • so-paid4500

  • so-balance1200

  • ship-titleFingDocks

  • ship-nameHarding Gross

  • ship-phone936 651-4847

  • ship-address8798 At, St., 7639

  • ship-cityRome

  • ship-stateLazio

  • ship-countryItaly

  • ship-websitehttp://fringdocs.com

  • ship-post300326

  • so-subtotal94600.00

  • so-taxtotal7568.00

  • so-ordertotal102168.00

  • form-TOTAL_FORMS2

  • form-INITIAL_FORMS0

  • form-MIN_NUM_FORMS

  • form-MAX_NUM_FORMS

  • form-0-product645

  • form-0-quantity450

  • form-0-price120

  • form-0-discount10

  • form-0-DELETE

  • form-0-pse_id-1

  • form-1-product654

  • form-1-quantity500

  • form-1-price100

  • form-1-discount8

  • form-1-DELETE

  • form-1-pse_id-1

Response Headers
  • Content-Type – multipart/form-data; boundary=—-WebKitFormBoundaryLTR88aZAnBUSE7mv

Status Codes
InvManage.views.sales_order_views.update_sales_order_view(request)

Updates a sales order on POST request and returns the sales order update form for GET request.

GET /sales_order/update

Gets the sales order update form whose primary key matches the query parameter pk.

Example request:

GET /sales_order/update HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Query Parameters
  • pk – The primary key of the sales order.

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Request Headers
  • Accept – text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Status Codes
  • 200 OK – Sales order update form received successfully.

POST /sales_order/update

Updates the sales order.

Example request:

POST /sales_order/update HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • pk30

  • so-consumer7

  • consumer-nameThe Music Store

  • consumer-identifierCONS1256

  • consumer-gstin89AAC4633353643

  • consumer-phone+91 8325642358

  • consumer-addressPlot no 958, N- 4, Neo Complex, Barh, Wokha, Nagaland, 797111

  • consumer-emailJohnDoe@themusic.store

  • consumer-locationWokha

  • so-so465

  • so-date2021-09-30

  • so-tax10

  • so-discount8.0

  • so-paid4500.0

  • so-balance1200.0

  • ship-titleFingDocks

  • ship-nameHarding Gross

  • ship-phone936 651-4847

  • ship-address8798 At, St., 7639

  • ship-cityRome

  • ship-stateLazio

  • ship-countryItaly

  • ship-websitehttp://fringdocs.com

  • ship-post300326

  • so-subtotal94600.0

  • so-taxtotal7568.0

  • so-ordertotal102168.0

  • form-TOTAL_FORMS2

  • form-INITIAL_FORMS2

  • form-MIN_NUM_FORMS

  • form-MAX_NUM_FORMS

  • form-0-product645

  • form-0-quantity450

  • form-0-price120

  • form-0-discount10

  • form-0-DELETE

  • form-0-pse_id67

  • form-1-product654

  • form-1-quantity500

  • form-1-price100

  • form-1-discount8

  • form-1-DELETE

  • form-1-pse_id68

Response Headers
  • Content-Type – multipart/form-data; boundary=—-WebKitFormBoundaryLTR88aZAnBUSE7mv

Status Codes
InvManage.views.sales_order_views.delete_sales_order_view(request, pk)

Deletes the sales order with primary key object_id on POST request.

POST /sales_order/<str:object_id>/delete

Deletes the sales order represented by the primary key object_id.

Example request:

POST /sales_order/30/delete HTTP/1.1
Host: localhost:8000
Content-Type: application/x-www-form-urlencoded
Parameters
  • object_id – Sales order primary key.

Response Headers
Status Codes
InvManage.views.sales_order_views.display_sales_orders_view(request)

Retrieves the list of sales orders on GET request.

GET /sales_orders/

Gets the list of all sales orders.

Example request:

GET /sales_orders/ HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Form Parameters
  • page – The page number of the sales order list.

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Request Headers
  • Accept – text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Status Codes
  • 200 OK – List of sales orders received successfully.

InvManage.views.sales_order_views.print_sales_order_view(request, pk)

Opens the sales order with primary key so_id for printing on GET request.

POST /purchase_order/<str:so_id>/print

Opens the sales order represented by the primary key so_id.

Example request:

POST /sales_order/182/print HTTP/1.1
Host: localhost:8000
Content-Type: application/x-www-form-urlencoded

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json; charset=utf-8

[
    {
        "company": {
            "name": "Fringillami",
            "owner": "Ivor Barnett",
            "gstin": "89AAC056465468",
            "phone": "332 220-7026",
            "address": "Ap #849-6241 Euismod Av., 677598, Carinthia, Belgium",
            "email": "est.tempor@fringillami.org",
            "location": "Belgium",
            "image": "/media/images/hyperlink-green_x91WW5n.png"
        },
        "so": {
            "consumer": {
                "name": "The Music Store",
                "identifier": "CONS1256",
                "gstin": "89AAC4633353643",
                "phone": "+91 8325642358",
                "address": "Plot no 958, N- 4, Neo Complex, Barh, Wokha, Nagaland, 797111",
                "email": "JohnDoe@themusic.store",
                "location": "Wokha"
            },
            "date": "2021-09-25T00:00:00Z",
            "so": 89,
            "subtotal": 744900.0,
            "taxtotal": 59592.0,
            "ordertotal": 804492.0,
            "pses": [
                {
                    "pse_id": 64,
                    "product": {
                        "pk": 637,
                        "name": "piano",
                        "category": "Ultricies PC",
                        "quantity": 23921,
                        "identifier": "PROD9",
                        "location": "Musselburgh",
                        "description": "88-key, Tri-sensor Scaled Hammer Action Keyboard II, Simulated ebony and ivory keys ",
                        "prod_id": 637
                    },
                    "quantity": 50,
                    "price": 9900.0,
                    "discount": 10.0,
                    "order": 29
                },
                {
                    "pse_id": 65,
                    "product": {
                        "pk": 649,
                        "name": "Sabar",
                        "category": "Amet Consulting",
                        "quantity": 3903,
                        "identifier": "PROD21",
                        "location": "Serang",
                        "description": "High Sierra Sabar, Travel bag, Blue, Grey, Zipper, 36.5 L, 51.5 cm, 26 cm ",
                        "prod_id": 649
                    },
                    "quantity": 25,
                    "price": 4800.0,
                    "discount": 8.0,
                    "order": 29
                },
                {
                    "pse_id": 66,
                    "product": {
                        "pk": 654,
                        "name": "Parai",
                        "category": "Aliquet Lobortis Ltd",
                        "quantity": 8534,
                        "identifier": "PROD26",
                        "location": "Burhaniye",
                        "description": "Kannan musical instruments Parai 15" inch (Baffallow skin) Daf Instrument",
                        "prod_id": 654
                    },
                    "quantity": 35,
                    "price": 6000.0,
                    "discount": 10.0,
                    "order": 29
                }
            ]
        },
        "shippingaddress": {
            "name": "Harding Gross",
            "address": "8798 At, St., 7639",
            "city": "Rome",
            "phone": "936 651-4847",
            "state": "Lazio",
            "country": "Italy",
            "post": "300326"
        }
    }
]
Parameters
  • so_id – Sales order primary key.

Response Headers
Status Codes