InvManage.views.goods_receipt_note_views

Module Contents

Functions

create_grn_view(request)

Creates a goods receipt note (GRN) on POST request, and returns a GRN creation form on GET request.

update_grn_view(request)

Updates the goods receipt note (GRN) on POST request, and returns a GRN update form on GET request.

delete_grn_view(request, pk)

Deletes the GRN with primary key object_id on POST request.

display_grns_view(request)

Retrieves the list of GRNs on GET request.

print_grn_view(request, pk)

Opens the GRN with primary key grn_id for printing on GET request.

InvManage.views.goods_receipt_note_views.create_grn_view(request)

Creates a goods receipt note (GRN) on POST request, and returns a GRN creation form on GET request.

GET /grn

Gets the GRN creation form.

Example request:

GET /grn/ 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 – GRN creation form received successfully.

POST /grn

Creates a GRN. There are two modes: - auto : Setting grn-grnType to auto creates a GRN with PO reference. - manual : Setting grn-grnType to manual creates a GRN without PO reference. In this case

the grn-poRef is not required.

Example request:

POST /consumer/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • grn-grnTypeauto

  • grn-vendor4

  • grn-poRef182

  • grn-amendNumber546

  • grn-amendDate2021-09-29

  • grn-identifier846

  • grn-date2021-09-29

  • grn-transporterTeraTransport

  • grn-vehicleNumberGH-646358

  • grn-gateInwardNumber864353

  • grn-preparedByKJL

  • grn-checkedByKJH

  • grn-inspectedByGIO

  • grn-approvedByBHI

  • form-TOTAL_FORMS3

  • form-INITIAL_FORMS0

  • form-MIN_NUM_FORMS

  • form-MAX_NUM_FORMS

  • form-0-product637

  • form-0-quantity100

  • form-0-receivedQty50

  • form-0-acceptedQty50

  • form-0-rejectedQty0

  • form-0-remarkOK

  • form-0-DELETE

  • form-0-grne_id-1

  • form-0-ppe_id324

  • form-1-product645

  • form-1-quantity250

  • form-1-receivedQty200

  • form-1-acceptedQty180

  • form-1-rejectedQty20

  • form-1-remark20 pieces faulty

  • form-1-DELETE

  • form-1-grne_id-1

  • form-1-ppe_id325

  • form-2-product638

  • form-2-quantity200

  • form-2-receivedQty0

  • form-2-acceptedQty0

  • form-2-rejectedQty0

  • form-2-remark

  • form-2-DELETE

  • form-2-grne_id-1

  • form-2-ppe_id326

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

Status Codes
InvManage.views.goods_receipt_note_views.update_grn_view(request)

Updates the goods receipt note (GRN) on POST request, and returns a GRN update form on GET request.

GET /grn/update

Gets the GRN update form.

Example request:

GET /grn/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

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 – GRN update form received successfully.

POST /grn/update

Updates a GRN. There are two modes: - auto : Setting grn-grnType to auto creates a GRN with PO reference. - manual : Setting grn-grnType to manual creates a GRN without PO reference. In this case

the grn-poRef is not required.

Example request:

POST /consumer/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • grn-grnTypeauto

  • grn-vendor4

  • grn-poRef182

  • grn-amendNumber546

  • grn-amendDate2021-09-29

  • grn-identifier846

  • grn-date2021-09-29

  • grn-transporterTeraTransport

  • grn-vehicleNumberGH-646358

  • grn-gateInwardNumber864353

  • grn-preparedByKJL

  • grn-checkedByKJH

  • grn-inspectedByGIO

  • grn-approvedByBHI

  • form-TOTAL_FORMS3

  • form-INITIAL_FORMS0

  • form-MIN_NUM_FORMS

  • form-MAX_NUM_FORMS

  • form-0-product637

  • form-0-quantity100

  • form-0-receivedQty50

  • form-0-acceptedQty50

  • form-0-rejectedQty0

  • form-0-remarkOK

  • form-0-DELETE

  • form-0-grne_id-1

  • form-0-ppe_id324

  • form-1-product645

  • form-1-quantity250

  • form-1-receivedQty200

  • form-1-acceptedQty180

  • form-1-rejectedQty20

  • form-1-remark20 pieces faulty

  • form-1-DELETE

  • form-1-grne_id-1

  • form-1-ppe_id325

  • form-2-product638

  • form-2-quantity200

  • form-2-receivedQty0

  • form-2-acceptedQty0

  • form-2-rejectedQty0

  • form-2-remark

  • form-2-DELETE

  • form-2-grne_id-1

  • form-2-ppe_id326

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

Status Codes
InvManage.views.goods_receipt_note_views.delete_grn_view(request, pk)

Deletes the GRN with primary key object_id on POST request.

POST /grn/<str:object_id>/delete

Deletes the GRN represented by the primary key object_id.

Example request:

POST /grn/104/delete HTTP/1.1
Host: localhost:8000
Content-Type: application/x-www-form-urlencoded
Parameters
  • object_id – GRN primary key.

Response Headers
Status Codes
InvManage.views.goods_receipt_note_views.display_grns_view(request)

Retrieves the list of GRNs on GET request.

GET /grns/

Gets the list of all GRNs.

Example request:

GET /grns/ 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 GRN 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 GRNs received successfully.

InvManage.views.goods_receipt_note_views.print_grn_view(request, pk)

Opens the GRN with primary key grn_id for printing on GET request.

POST /grn/<str:grn_id>/print

Opens the GRN represented by the primary key grn_id.

Example request:

POST /grn/103/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"
        },
        "grn": {
            "grnes": [
                {
                    "grn": 103,
                    "grne_id": 117,
                    "ppe_id": 324,
                    "po_id": 293,
                    "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,
                    "receivedQty": 50,
                    "acceptedQty": 50,
                    "rejectedQty": 0,
                    "remark": "OK"
                },
                {
                    "grn": 103,
                    "grne_id": 118,
                    "ppe_id": 325,
                    "po_id": 293,
                    "product": {
                        "pk": 645,
                        "name": "Tabl",
                        "category": "Sociis Natoque Company",
                        "quantity": 38276,
                        "identifier": "PROD17",
                        "location": "Schagen",
                        "description": "aldgjlakjlkasdj",
                        "prod_id": 645
                    },
                    "quantity": 250,
                    "receivedQty": 200,
                    "acceptedQty": 180,
                    "rejectedQty": 20,
                    "remark": "20 pieces faulty"
                }
            ],
            "date": "29-Sep-2021",
            "vendor": {
                "name": "Girish",
                "identifier": "GJ",
                "gstin": "GSTIN002",
                "address": {
                    "name": "alsf",
                    "address": "jas;k",
                    "city": ";sdalkf",
                    "phone": "alsf",
                    "state": "kjdflk",
                    "country": "ljflkj",
                    "post": "54545"
                }
            },
            "poRef": [
                182
            ],
            "identifier": 846,
            "grnType": "auto",
            "amendDate": "2021-09-29T00:00:00Z",
            "transporter": "TeraTransport",
            "vehicleNumber": "GH-646358",
            "gateInwardNumber": "864353",
            "preparedBy": "KJL",
            "checkedBy": "KJH",
            "inspectedBy": "GIO",
            "approvedBy": "BHI"
        },
        "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
  • grn_id – GRN primary key.

Response Headers
Status Codes