InvManage.views.purchase_order_views

Module Contents

Functions

create_purchase_order_view(request)

Creates a purchase order (PO) on POST request, and returns a PO creation form on GET request.

update_purchase_order_view(request)

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

display_purchase_orders_view(request)

Retrieves the list of purchase orders on GET request.

delete_purchase_order_view(request, pk)

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

print_purchase_order_view(request, pk)

Opens the purchase order with primary key po_id for printing on GET request.

get_product_purchase_entries_view(request)

Returns the JSON serialized data of product purchase entries on GET request.

InvManage.views.purchase_order_views.create_purchase_order_view(request)

Creates a purchase order (PO) on POST request, and returns a PO creation form on GET request.

GET /purchase_order

Gets the purchase order creation form.

Example request:

GET /purchase_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 – Purchase order creation form received successfully.

POST /purchase_order

Creates a purchase order.

Example request:

POST /purchase_order/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • po-vendor4

  • vend-nameGirish

  • vend-identifierGJ

  • po-po69

  • po-date2021-09-29

  • po-tax12

  • po-discount8

  • po-paid4500

  • po-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

  • po-subtotal2595000.00

  • po-taxtotal207600.00

  • po-ordertotal2802600.00

  • form-TOTAL_FORMS2

  • form-INITIAL_FORMS0

  • form-MIN_NUM_FORMS

  • form-MAX_NUM_FORMS

  • form-0-product649

  • form-0-quantity300

  • form-0-price4500

  • form-0-discount10

  • form-0-DELETE

  • form-0-ppe_id-1

  • form-1-product664

  • form-1-quantity250

  • form-1-price6000

  • form-1-discount8

  • form-1-DELETE

  • form-1-ppe_id-1

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

Status Codes
  • 302 Found – Redirects to /purchase_order.

InvManage.views.purchase_order_views.update_purchase_order_view(request)

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

GET /purchaes_order/update

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

Example request:

GET /purchase_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 purchase 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 – Purchase order update form received successfully.

POST /purchase_order/update

Updates the purchase order.

Example request:

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

  • po-vendor4

  • vend-nameGirish

  • vend-identifierGJ

  • po-po69

  • po-date2021-09-29

  • po-tax12

  • po-discount8.0

  • po-paid4500.0

  • po-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

  • po-subtotal2595000.0

  • po-taxtotal207600.0

  • po-ordertotal2802600.0

  • form-TOTAL_FORMS2

  • form-INITIAL_FORMS2

  • form-MIN_NUM_FORMS

  • form-MAX_NUM_FORMS

  • form-0-product649

  • form-0-quantity300

  • form-0-price4500

  • form-0-discount10

  • form-0-DELETE

  • form-0-ppe_id339

  • form-1-product664

  • form-1-quantity250

  • form-1-price6000

  • form-1-discount8

  • form-1-DELETE

  • form-1-ppe_id340

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

Status Codes
InvManage.views.purchase_order_views.display_purchase_orders_view(request)

Retrieves the list of purchase orders on GET request.

GET /purchase_orders/

Gets the list of all purchase orders.

Example request:

GET /purchase_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 purchase 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 purchase orders received successfully.

InvManage.views.purchase_order_views.delete_purchase_order_view(request, pk)

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

POST /purchase_order/<str:object_id>/delete

Deletes the consumer represented by the primary key object_id.

Example request:

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

Response Headers
Status Codes
InvManage.views.purchase_order_views.print_purchase_order_view(request, pk)

Opens the purchase order with primary key po_id for printing on GET request.

POST /purchase_order/<str:po_id>/print

Opens the purchase order represented by the primary key po_id.

Example request:

POST /purchase_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"
        },
        "po": {
            "vendor": {
                "name": "Girish",
                "identifier": "GJ",
                "gstin": "GSTIN002",
                "address": {
                    "name": "alsf",
                    "address": "jas;k",
                    "city": ";sdalkf",
                    "phone": "alsf",
                    "state": "kjdflk",
                    "country": "ljflkj",
                    "post": "54545"
                }
            },
            "date": "25-Sep-2021",
            "po": 293,
            "subtotal": 279975.0,
            "taxtotal": 22398.0,
            "ordertotal": 302373.0,
            "ppes": [
                {
                    "ppe_id": 324,
                    "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": 100,
                    "price": 10.0,
                    "discount": 0.0,
                    "order": 182,
                    "pendingQty": 50
                },
                {
                    "ppe_id": 325,
                    "product": {
                        "pk": 645,
                        "name": "Tabl",
                        "category": "Sociis Natoque Company",
                        "quantity": 38276,
                        "identifier": "PROD17",
                        "location": "Schagen",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 645
                    },
                    "quantity": 250,
                    "price": 90.0,
                    "discount": 8.0,
                    "order": 182,
                    "pendingQty": 70
                },
                {
                    "ppe_id": 326,
                    "product": {
                        "pk": 638,
                        "name": "Goblet drum",
                        "category": "Est Congue Consulting",
                        "quantity": 46076,
                        "identifier": "PROD10",
                        "location": "Kaluga",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 638
                    },
                    "quantity": 200,
                    "price": 150.0,
                    "discount": 12.0,
                    "order": 182,
                    "pendingQty": 200
                },
                {
                    "ppe_id": 327,
                    "product": {
                        "pk": 643,
                        "name": "quinto",
                        "category": "Enim Suspendisse Associates",
                        "quantity": 51099,
                        "identifier": "PROD15",
                        "location": "Nagpur",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 643
                    },
                    "quantity": 350,
                    "price": 150.0,
                    "discount": 10.0,
                    "order": 182,
                    "pendingQty": 350
                },
                {
                    "ppe_id": 328,
                    "product": {
                        "pk": 651,
                        "name": "Igihumurizo",
                        "category": "Curabitur Massa Vestibulum Consulting",
                        "quantity": 48553,
                        "identifier": "PROD23",
                        "location": "Yeovil",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 651
                    },
                    "quantity": 500,
                    "price": 50.0,
                    "discount": 6.0,
                    "order": 182,
                    "pendingQty": 500
                },
                {
                    "ppe_id": 329,
                    "product": {
                        "pk": 653,
                        "name": "Balsié",
                        "category": "Eu Foundation",
                        "quantity": 29988,
                        "identifier": "PROD25",
                        "location": "Sudbury",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 653
                    },
                    "quantity": 200,
                    "price": 500.0,
                    "discount": 15.0,
                    "order": 182,
                    "pendingQty": 200
                },
                {
                    "ppe_id": 330,
                    "product": {
                        "pk": 656,
                        "name": "Padayani thappu",
                        "category": "Posuere LLP",
                        "quantity": 6358,
                        "identifier": "PROD28",
                        "location": "Ruvo del Monte",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 656
                    },
                    "quantity": 350,
                    "price": 250.0,
                    "discount": 13.0,
                    "order": 182,
                    "pendingQty": 350
                }
            ]
        },
        "shippingaddress": {
            "name": "Harding Gross",
            "address": "8798 At, St., 7639",
            "city": "Rome",
            "phone": "936 651-4847",
            "state": "Lazio",
            "country": "Italy",
            "post": "300326"
        },
        "communication": {
            "email": "asfs@aflk.com",
            "phone": "6546432"
        }
    }
]
Parameters
  • po_id – Purchase order primary key.

Response Headers
Status Codes
InvManage.views.purchase_order_views.get_product_purchase_entries_view(request)

Returns the JSON serialized data of product purchase entries on GET request.

GET /product_purchase_entries/

Gets the JSON serialized data of the requested product purchase entries.

Example request:

GET /product_purchase_entries/ 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: application/json; charset=utf-8

[
    {
        "ppe_id": 324,
        "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": 100,
        "price": 10.0,
        "discount": 0.0,
        "order": 182,
        "pendingQty": 50,
        "po": 293
    },
    {
        "ppe_id": 325,
        "product": {
            "pk": 645,
            "name": "Tabl",
            "category": "Sociis Natoque Company",
            "quantity": 38276,
            "identifier": "PROD17",
            "location": "Schagen",
            "description": "aldgjlakjlkasdj",
            "prod_id": 645
        },
        "quantity": 250,
        "price": 90.0,
        "discount": 8.0,
        "order": 182,
        "pendingQty": 70,
        "po": 293
    },
    {
        "ppe_id": 326,
        "product": {
            "pk": 638,
            "name": "Goblet drum",
            "category": "Est Congue Consulting",
            "quantity": 46076,
            "identifier": "PROD10",
            "location": "Kaluga",
            "description": "aldgjlakjlkasdj",
            "prod_id": 638
        },
        "quantity": 200,
        "price": 150.0,
        "discount": 12.0,
        "order": 182,
        "pendingQty": 200,
        "po": 293
    },
    {
        "ppe_id": 327,
        "product": {
            "pk": 643,
            "name": "quinto",
            "category": "Enim Suspendisse Associates",
            "quantity": 51099,
            "identifier": "PROD15",
            "location": "Nagpur",
            "description": "aldgjlakjlkasdj",
            "prod_id": 643
        },
        "quantity": 350,
        "price": 150.0,
        "discount": 10.0,
        "order": 182,
        "pendingQty": 350,
        "po": 293
    },
    {
        "ppe_id": 328,
        "product": {
            "pk": 651,
            "name": "Igihumurizo",
            "category": "Curabitur Massa Vestibulum Consulting",
            "quantity": 48553,
            "identifier": "PROD23",
            "location": "Yeovil",
            "description": "aldgjlakjlkasdj",
            "prod_id": 651
        },
        "quantity": 500,
        "price": 50.0,
        "discount": 6.0,
        "order": 182,
        "pendingQty": 500,
        "po": 293
    },
    {
        "ppe_id": 329,
        "product": {
            "pk": 653,
            "name": "Balsié",
            "category": "Eu Foundation",
            "quantity": 29988,
            "identifier": "PROD25",
            "location": "Sudbury",
            "description": "aldgjlakjlkasdj",
            "prod_id": 653
        },
        "quantity": 200,
        "price": 500.0,
        "discount": 15.0,
        "order": 182,
        "pendingQty": 200,
        "po": 293
    },
    {
        "ppe_id": 330,
        "product": {
            "pk": 656,
            "name": "Padayani thappu",
            "category": "Posuere LLP",
            "quantity": 6358,
            "identifier": "PROD28",
            "location": "Ruvo del Monte",
            "description": "aldgjlakjlkasdj",
            "prod_id": 656
        },
        "quantity": 350,
        "price": 250.0,
        "discount": 13.0,
        "order": 182,
        "pendingQty": 350,
        "po": 293
    }
]
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