Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Query
- {
- "select": [
- "branch.name as created_for",
- "branch_detail.name as for_location",
- "sales_outbound.transaction_date",
- "sales_outbound.sheet_number",
- "sales_outbound.udf_invoice_no_2018_07_26 as invoice_number",
- "product.name as product_name",
- "product_serial_number.serial_number as product_serial",
- "sales_outbound_detail.price",
- "user.full_name as salesman",
- "payment_surcharge.name as collection_detail_charge_type",
- {
- "column": "system_code.name + ' - ' + bank_account.account_number + ' - ' + bank_account.account_name as collection_detail_bank",
- "type": "raw"
- }
- ],
- "table": "sales_outbound",
- "join": [
- {
- "table": "sales_outbound_detail",
- "conditions": [
- {
- "column": "sales_outbound.id",
- "operator": "=",
- "value": {
- "column": "sales_outbound_detail.transaction_id",
- "type": "raw"
- }
- },
- {
- "column": "sales_outbound_detail.deleted_at",
- "operator": "null"
- }
- ]
- },
- {
- "table": "collection_reference",
- "conditions": [
- {
- "column": "sales_outbound.id",
- "operator": "=",
- "value": {
- "column": "collection_reference.reference_id",
- "type": "raw"
- }
- },
- {
- "column": "collection_reference.reference_type",
- "operator": "=",
- "value": "sales_outbound"
- },
- {
- "column": "collection_reference.deleted_at",
- "operator": "null"
- }
- ],
- "type": "left"
- },
- {
- "table": "collection",
- "conditions": [
- {
- "column": "collection_reference.transaction_id",
- "operator": "=",
- "value": {
- "column": "collection.id",
- "type": "raw"
- }
- },
- {
- "column": "collection.deleted_at",
- "operator": "null"
- },
- {
- "column": "collection.approval_status",
- "operator": "=",
- "value": "3"
- }
- ],
- "type": "left"
- },
- {
- "table": "collection_detail",
- "conditions": [
- {
- "column": "collection.id",
- "operator": "=",
- "value": {
- "column": "collection_detail.transaction_id",
- "type": "raw"
- }
- },
- {
- "column": "collection_detail.deleted_at",
- "operator": "null"
- }
- ],
- "type": "left"
- },
- {
- "table": "payment_surcharge",
- "conditions": [
- {
- "column": "collection_detail.surcharge_id",
- "operator": "=",
- "value": {
- "column": "payment_surcharge.id",
- "type": "raw"
- }
- },
- {
- "column": "payment_surcharge.deleted_at",
- "operator": "null"
- }
- ],
- "type": "left"
- },
- {
- "table": "bank_account",
- "conditions": [
- {
- "column": "collection_detail.bank_account_id",
- "operator": "=",
- "value": {
- "column": "bank_account.id",
- "type": "raw"
- }
- },
- {
- "column": "bank_account.deleted_at",
- "operator": "null"
- }
- ],
- "type": "left"
- },
- {
- "table": "system_code",
- "conditions": [
- {
- "column": "bank_account.bank_id",
- "operator": "=",
- "value": {
- "column": "system_code.id",
- "type": "raw"
- }
- },
- {
- "column": "system_code.type_id",
- "operator": "=",
- "value": "3"
- },
- {
- "column": "system_code.deleted_at",
- "operator": "null"
- }
- ],
- "type": "left"
- },
- {
- "table": "branch",
- "conditions": [
- {
- "column": "sales_outbound.created_for",
- "operator": "=",
- "value": {
- "column": "branch.id",
- "type": "raw"
- }
- }
- ]
- },
- {
- "table": "branch_detail",
- "conditions": [
- {
- "column": "sales_outbound.for_location",
- "operator": "=",
- "value": {
- "column": "branch_detail.id",
- "type": "raw"
- }
- }
- ]
- },
- {
- "table": "product",
- "conditions": [
- {
- "column": "sales_outbound_detail.product_id",
- "operator": "=",
- "value": {
- "column": "product.id",
- "type": "raw"
- }
- }
- ]
- },
- {
- "table": "transaction_serial_number",
- "type": "left",
- "conditions": [
- {
- "column": "sales_outbound_detail.id",
- "operator": "=",
- "value": {
- "column": "transaction_serial_number.seriable_id",
- "type": "raw"
- }
- },
- {
- "column": "transaction_serial_number.seriable_type",
- "operator": "=",
- "value": {
- "column": "'sales_outbound_detail'",
- "type": "raw"
- }
- }
- ]
- },
- {
- "table": "product_serial_number",
- "type": "left",
- "conditions": [
- {
- "column": "transaction_serial_number.serial_id",
- "operator": "=",
- "value": {
- "column": "product_serial_number.id",
- "type": "raw"
- }
- }
- ]
- },
- {
- "table": "system_code as brand",
- "conditions": [
- {
- "column": "brand.id",
- "operator": "=",
- "value": {
- "column": "product.brand_id",
- "type": "raw"
- }
- },
- {
- "column": "brand.type_id",
- "operator": "=",
- "value": 1
- }
- ]
- },
- {
- "table": "category",
- "conditions": [
- {
- "column": "category.id",
- "operator": "=",
- "value": {
- "column": "product.category_id",
- "type": "raw"
- }
- }
- ],
- "type": "inner"
- },
- {
- "table": "user",
- "conditions": [
- {
- "column": "sales_outbound.salesman_id",
- "operator": "=",
- "value": {
- "column": "[user].[id]",
- "type": "raw"
- }
- }
- ]
- }
- ],
- "where": [
- {
- "column": "sales_outbound.deleted_at",
- "operator": "null"
- },
- {
- "column": "sales_outbound.approval_status",
- "operator": "=",
- "value": {
- "column": "3",
- "type": "raw"
- }
- }
- ],
- "groupBy": [
- "sales_outbound.id",
- "sales_outbound_detail.id",
- "branch.name",
- "branch_detail.name",
- "sales_outbound.transaction_date",
- "sales_outbound.sheet_number",
- "product.name",
- "product_serial_number.serial_number",
- "sales_outbound_detail.price",
- "sales_outbound_detail.qty",
- "sales_outbound_detail.unit_qty",
- "user.full_name",
- "sales_outbound.udf_invoice_no_2018_07_26",
- "payment_surcharge.name",
- "system_code.name",
- "bank_account.account_number",
- "bank_account.account_name"
- ],
- "orderBy": {
- "type": "ASC",
- "columns": [
- "sheet_number"
- ]
- }
- }
- // Column Settings
- {
- "created_for": {
- "header_name": "label.created_for",
- "width": 240,
- "textAlign": "left",
- "type": "1"
- },
- "for_location": {
- "header_name": "label.for_location",
- "width": 240,
- "textAlign": "left",
- "type": "1"
- },
- "transaction_date": {
- "header_name": "label.transaction_date",
- "width": 240,
- "textAlign": "center",
- "type": "1"
- },
- "sheet_number": {
- "header_name": "label.sheet_number",
- "width": 240,
- "textAlign": "center",
- "type": "1"
- },
- "invoice_number": {
- "header_name": "label.invoice_no",
- "width": 150,
- "textAlign": "center",
- "type": "1"
- },
- "product_name": {
- "header_name": "label.product_name",
- "width": 420,
- "textAlign": "left",
- "type": "1"
- },
- "product_serial": {
- "header_name": "label.serial",
- "width": 240,
- "textAlign": "left",
- "type": "1"
- },
- "price": {
- "header_name": "label.price",
- "width": 120,
- "textAlign": "right",
- "type": "2"
- },
- "salesman": {
- "header_name": "label.salesman",
- "width": 240,
- "textAlign": "left",
- "type": "1"
- },
- "collection_detail_bank": {
- "header_name": "label.collection_detail_bank",
- "width": 240,
- "textAlign": "left",
- "type": "1"
- },
- "collection_detail_charge_type": {
- "header_name": "label.collection_detail_charge_type",
- "width": 240,
- "textAlign": "left",
- "type": "1"
- }
- }
- // Filters
- [
- {
- "name": "label.created_for",
- "columnName": "sales_outbound.created_for",
- "type": "select",
- "selectOptions": "branch",
- "selected": true,
- "default": "current_branch",
- "format": {
- "id": "id",
- "label": "name"
- },
- "freezing": true
- },
- {
- "name": "label.for_location",
- "columnName": "sales_outbound.for_location",
- "type": "select",
- "selectOptions": "location",
- "format": {
- "id": "id",
- "label": "name"
- }
- },
- {
- "name": "label.transaction_date",
- "columnName": "sales_outbound.transaction_date",
- "type": "dateRange",
- "selected": true
- },
- {
- "name": "label.product",
- "columnName": "product.name",
- "type": "string"
- },
- {
- "name": "label.serial_number",
- "columnName": "product_serial_number.serial_number",
- "type": "string"
- },
- {
- "name": "label.stock_no",
- "columnName": "product.stock_no",
- "type": "string"
- },
- {
- "name": "label.product_brand",
- "columnName": "brand.name",
- "type": "string",
- "optionBool": true,
- "tableOptions": {
- "data": "brand",
- "headers": [
- "Code",
- "Name"
- ],
- "columns": [
- "code",
- "name"
- ],
- "returncolumn": "name"
- }
- },
- {
- "name": "label.category_tag",
- "columnName": "category.tag_id",
- "type": "categoryTag",
- "optionBool": true,
- "title": "label.category_filter",
- "tableOptions": {
- "data": "category"
- }
- }
- ]
- // Footers
- []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement