Invoices Filter
Personas in this Story: Default, RegularManager, FinancialManager, Client.
Payload:
1 2 3 4 5 6 7 8 9 10
{ "type": "Member", "email": "regular-manager@activecollab.com", "password": "123", "company_id": 1, "custom_permissions": [ "can_manage_projects", "can_manage_settings" ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
{ "single": { "id": 2, "class": "Member", "url_path": "\/users\/2", "is_archived": false, "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "created_on": 1430165058, "created_by_id": 1, "updated_on": 1430165058, "updated_by_id": 1, "language_id": 0, "first_name": "Regular-manager", "last_name": null, "display_name": "regular-manager", "short_display_name": "regular-manager", "email": "regular-manager@activecollab.com", "additional_email_addresses": [], "is_pending_activation": false, "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=2&size=--SIZE--×tamp=1430165058", "custom_permissions": [ "can_manage_settings", "can_manage_projects" ], "company_id": 1, "title": null, "phone": null, "im_type": null, "im_handle": null, "note": null } }
Payload:
1 2 3 4 5 6 7 8 9
{ "type": "Member", "email": "financial-manager@activecollab.com", "password": "123", "company_id": 1, "custom_permissions": [ "can_manage_finances" ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
{ "single": { "id": 3, "class": "Member", "url_path": "\/users\/3", "is_archived": false, "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "created_on": 1430165059, "created_by_id": 1, "updated_on": 1430165059, "updated_by_id": 1, "language_id": 0, "first_name": "Financial-manager", "last_name": null, "display_name": "financial-manager", "short_display_name": "financial-manager", "email": "financial-manager@activecollab.com", "additional_email_addresses": [], "is_pending_activation": false, "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=3&size=--SIZE--×tamp=1430165059", "custom_permissions": [ "can_manage_finances" ], "company_id": 1, "title": null, "phone": null, "im_type": null, "im_handle": null, "note": null } }
Payload:
1 2 3 4 5 6
{ "type": "Client", "email": "client@activecollab.com", "password": "123", "company_id": 2 }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
{ "single": { "id": 4, "class": "Client", "url_path": "\/users\/4", "is_archived": false, "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "created_on": 1430165059, "created_by_id": 1, "updated_on": 1430165059, "updated_by_id": 1, "language_id": 0, "first_name": "Client", "last_name": null, "display_name": "client", "short_display_name": "client", "email": "client@activecollab.com", "additional_email_addresses": [], "is_pending_activation": false, "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=4&size=--SIZE--×tamp=1430165059", "custom_permissions": [], "company_id": 2, "title": null, "phone": null, "im_type": null, "im_handle": null, "note": null } }
For the purpose of this test, we have created three client companies:
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
[ { "id": 1, "class": "Company", "url_path": "\/companies\/1", "name": "Owner Company", "members": [ 1, 2, 3 ], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "is_archived": false, "created_on": 1430165056, "created_by_id": 1, "updated_on": 1430165056, "updated_by_id": 1, "address": null, "phone": null, "homepage_url": null, "tax_id": null, "currency_id": null, "is_owner": true, "has_note": false }, { "id": 2, "class": "Company", "url_path": "\/companies\/2", "name": "First Client", "members": [ 4 ], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "is_archived": false, "created_on": 1430165059, "created_by_id": 1, "updated_on": 1430165059, "updated_by_id": 1, "address": "Street Name 12\nCity", "phone": null, "homepage_url": null, "tax_id": null, "currency_id": 1, "is_owner": false, "has_note": false }, { "id": 3, "class": "Company", "url_path": "\/companies\/3", "name": "Second Client", "members": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "is_archived": false, "created_on": 1430165060, "created_by_id": 1, "updated_on": 1430165060, "updated_by_id": 1, "address": "Street Name 12\nCity", "phone": null, "homepage_url": null, "tax_id": null, "currency_id": 1, "is_owner": false, "has_note": false }, { "id": 4, "class": "Company", "url_path": "\/companies\/4", "name": "Third Client", "members": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "is_archived": false, "created_on": 1430165060, "created_by_id": 1, "updated_on": 1430165060, "updated_by_id": 1, "address": "Street Name 12\nCity", "phone": null, "homepage_url": null, "tax_id": null, "currency_id": 1, "is_owner": false, "has_note": false } ]
and two projects:
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
[ { "id": 2, "class": "Project", "url_path": "\/projects\/2", "name": "Second Client Project", "completed_on": null, "completed_by_id": null, "is_completed": false, "members": [ 1 ], "category_id": 0, "label_id": 0, "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "created_on": 1430165060, "created_by_id": 1, "updated_on": 1430165060, "updated_by_id": 1, "body": null, "body_formatted": "", "company_id": 3, "leader_id": 1, "currency_id": 1, "template_id": 0, "based_on_type": null, "based_on_id": null, "email": "notifications+m2p-Xy4pRNw@mail.manageprojects.com", "is_tracking_enabled": true, "is_client_reporting_enabled": false, "budget": null, "count_tasks": 0, "count_discussions": 0, "count_files": 0, "count_notes": 0 }, { "id": 1, "class": "Project", "url_path": "\/projects\/1", "name": "First Client Project", "completed_on": null, "completed_by_id": null, "is_completed": false, "members": [ 1 ], "category_id": 0, "label_id": 0, "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "created_on": 1430165059, "created_by_id": 1, "updated_on": 1430165059, "updated_by_id": 1, "body": null, "body_formatted": "", "company_id": 2, "leader_id": 1, "currency_id": 1, "template_id": 0, "based_on_type": null, "based_on_id": null, "email": "notifications+m2p-EfLXmOD@mail.manageprojects.com", "is_tracking_enabled": true, "is_client_reporting_enabled": false, "budget": null, "count_tasks": 0, "count_discussions": 0, "count_files": 0, "count_notes": 0 } ]
Lets create a couple of invoices:
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{ "company_id": 2, "project_id": 1, "number": "1\/2014", "items": [ { "description": "First item", "quantity": 100, "unit_cost": 25 }, { "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1 }, { "description": "Third item", "quantity": 15, "unit_cost": 25 } ], "private_note": "Client will not be able to see this" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 1, "class": "Invoice", "url_path": "\/invoices\/1", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 2, "company_name": "First Client", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430165061, "created_by_id": 1, "updated_on": 1430165061, "based_on_type": null, "based_on_id": null, "number": "1\/2014", "project_id": 1, "purchase_order_number": null, "issued_on": 1430165061, "due_on": 1430165061, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "djSrTqc3DxW5Betkgr9Bxr9TqYoG1Hy4Qgkzwmq1", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=djSrTqc3DxW5Betkgr9Bxr9TqYoG1Hy4Qgkzwmq1&number=1%2F2014", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 1, "class": "InvoiceItem", "url_path": "\/invoice-items\/1", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 2, "class": "InvoiceItem", "url_path": "\/invoice-items\/2", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 3, "class": "InvoiceItem", "url_path": "\/invoice-items\/3", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
{ "company_id": 2, "number": "2\/2014", "items": [ { "description": "First item", "quantity": 100, "unit_cost": 25 }, { "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1 }, { "description": "Third item", "quantity": 15, "unit_cost": 25 } ], "private_note": "Client will not be able to see this" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 2, "class": "Invoice", "url_path": "\/invoices\/2", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 2, "company_name": "First Client", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430165061, "created_by_id": 1, "updated_on": 1430165061, "based_on_type": null, "based_on_id": null, "number": "2\/2014", "project_id": 0, "purchase_order_number": null, "issued_on": 1430165061, "due_on": 1430165061, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "JtMJlBFncJfDTDUBDWIG946XCnrsWiPvBr5MTz1V", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=JtMJlBFncJfDTDUBDWIG946XCnrsWiPvBr5MTz1V&number=2%2F2014", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 4, "class": "InvoiceItem", "url_path": "\/invoice-items\/4", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 5, "class": "InvoiceItem", "url_path": "\/invoice-items\/5", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 6, "class": "InvoiceItem", "url_path": "\/invoice-items\/6", "parent_type": "Invoice", "parent_id": 2, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{ "company_id": 3, "project_id": 2, "number": "3\/2014", "items": [ { "description": "First item", "quantity": 100, "unit_cost": 25 }, { "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1 }, { "description": "Third item", "quantity": 15, "unit_cost": 25 } ], "private_note": "Client will not be able to see this" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 3, "class": "Invoice", "url_path": "\/invoices\/3", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 3, "company_name": "Second Client", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430165061, "created_by_id": 1, "updated_on": 1430165061, "based_on_type": null, "based_on_id": null, "number": "3\/2014", "project_id": 2, "purchase_order_number": null, "issued_on": 1430165061, "due_on": 1430165061, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "1S0OHQI9kPchxrM7Hbqp5Ab2ctlrNRbCyag7RP42", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=1S0OHQI9kPchxrM7Hbqp5Ab2ctlrNRbCyag7RP42&number=3%2F2014", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 7, "class": "InvoiceItem", "url_path": "\/invoice-items\/7", "parent_type": "Invoice", "parent_id": 3, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 8, "class": "InvoiceItem", "url_path": "\/invoice-items\/8", "parent_type": "Invoice", "parent_id": 3, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 9, "class": "InvoiceItem", "url_path": "\/invoice-items\/9", "parent_type": "Invoice", "parent_id": 3, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
{ "company_id": 3, "number": "4\/2014", "items": [ { "description": "First item", "quantity": 100, "unit_cost": 25 }, { "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1 }, { "description": "Third item", "quantity": 15, "unit_cost": 25 } ], "private_note": "Client will not be able to see this" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 4, "class": "Invoice", "url_path": "\/invoices\/4", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 3, "company_name": "Second Client", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430165061, "created_by_id": 1, "updated_on": 1430165061, "based_on_type": null, "based_on_id": null, "number": "4\/2014", "project_id": 0, "purchase_order_number": null, "issued_on": 1430165061, "due_on": 1430165061, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "SALFtEmAlabAuuYSqyGngGzcQ2MIZu0A1rAtE1FF", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=SALFtEmAlabAuuYSqyGngGzcQ2MIZu0A1rAtE1FF&number=4%2F2014", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 10, "class": "InvoiceItem", "url_path": "\/invoice-items\/10", "parent_type": "Invoice", "parent_id": 4, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 11, "class": "InvoiceItem", "url_path": "\/invoice-items\/11", "parent_type": "Invoice", "parent_id": 4, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 12, "class": "InvoiceItem", "url_path": "\/invoice-items\/12", "parent_type": "Invoice", "parent_id": 4, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
{ "company_id": 4, "number": "5\/2014", "items": [ { "description": "First item", "quantity": 100, "unit_cost": 25 }, { "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1 }, { "description": "Third item", "quantity": 15, "unit_cost": 25 } ], "private_note": "Client will not be able to see this" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 5, "class": "Invoice", "url_path": "\/invoices\/5", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 4, "company_name": "Third Client", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 1, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 568.75, "rounding_difference": 0, "rounded_total": 6693.75, "total": 6693.75, "paid_amount": 0, "balance_due": 6693.75, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430165061, "created_by_id": 1, "updated_on": 1430165062, "based_on_type": null, "based_on_id": null, "number": "5\/2014", "project_id": 0, "purchase_order_number": null, "issued_on": 1430165061, "due_on": 1430165061, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "VSPUToMEgMNfoi5NtIrVJ2wyd0qUBUEjyo3N13h8", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=VSPUToMEgMNfoi5NtIrVJ2wyd0qUBUEjyo3N13h8&number=5%2F2014", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 13, "class": "InvoiceItem", "url_path": "\/invoice-items\/13", "parent_type": "Invoice", "parent_id": 5, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 14, "class": "InvoiceItem", "url_path": "\/invoice-items\/14", "parent_type": "Invoice", "parent_id": 5, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 1, "first_tax_value": 568.75, "first_tax_name": "VAT", "first_tax_rate": 17.5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3818.75, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 15, "class": "InvoiceItem", "url_path": "\/invoice-items\/15", "parent_type": "Invoice", "parent_id": 5, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
We'll start by checking permissions. Owner and financial managers can access invoicing reports, while other users can't:
Query Parameters:
1 2 3
{ "type": "InvoicesFilter" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
{ "all": { "label": "All Invoices", "invoices": { "1": { "id": 1, "number": "1\/2014", "company_id": 2, "company_name": "First Client", "project_id": 1, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "1\/2014", "project_name": "First Client Project", "status": "issued" }, "2": { "id": 2, "number": "2\/2014", "company_id": 2, "company_name": "First Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "2\/2014", "project_name": "N\/A", "status": "issued" }, "3": { "id": 3, "number": "3\/2014", "company_id": 3, "company_name": "Second Client", "project_id": 2, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "3\/2014", "project_name": "Second Client Project", "status": "issued" }, "4": { "id": 4, "number": "4\/2014", "company_id": 3, "company_name": "Second Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "4\/2014", "project_name": "N\/A", "status": "issued" }, "5": { "id": 5, "number": "5\/2014", "company_id": 4, "company_name": "Third Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "5\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 33468.75 }, "total_due": { "1": 33468.75 } } }
Query Parameters:
1 2 3
{ "type": "InvoicesFilter" }
Query Parameters:
1 2 3
{ "type": "InvoicesFilter" }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
{ "all": { "label": "All Invoices", "invoices": { "1": { "id": 1, "number": "1\/2014", "company_id": 2, "company_name": "First Client", "project_id": 1, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "1\/2014", "project_name": "First Client Project", "status": "issued" }, "2": { "id": 2, "number": "2\/2014", "company_id": 2, "company_name": "First Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "2\/2014", "project_name": "N\/A", "status": "issued" }, "3": { "id": 3, "number": "3\/2014", "company_id": 3, "company_name": "Second Client", "project_id": 2, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "3\/2014", "project_name": "Second Client Project", "status": "issued" }, "4": { "id": 4, "number": "4\/2014", "company_id": 3, "company_name": "Second Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "4\/2014", "project_name": "N\/A", "status": "issued" }, "5": { "id": 5, "number": "5\/2014", "company_id": 4, "company_name": "Third Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "5\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 33468.75 }, "total_due": { "1": 33468.75 } } }
Query Parameters:
1 2 3
{ "type": "InvoicesFilter" }
Invoicing reports support up to two levels of data grouping:
Query Parameters:
1 2 3 4 5 6
{ "type": "InvoicesFilter", "group_by": [ "client" ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
{ "company-2": { "label": "First Client", "invoices": { "1": { "id": 1, "number": "1\/2014", "company_id": 2, "company_name": "First Client", "project_id": 1, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "1\/2014", "project_name": "First Client Project", "status": "issued" }, "2": { "id": 2, "number": "2\/2014", "company_id": 2, "company_name": "First Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "2\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 13387.5 }, "total_due": { "1": 13387.5 } }, "company-3": { "label": "Second Client", "invoices": { "3": { "id": 3, "number": "3\/2014", "company_id": 3, "company_name": "Second Client", "project_id": 2, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "3\/2014", "project_name": "Second Client Project", "status": "issued" }, "4": { "id": 4, "number": "4\/2014", "company_id": 3, "company_name": "Second Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "4\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 13387.5 }, "total_due": { "1": 13387.5 } }, "company-4": { "label": "Third Client", "invoices": { "5": { "id": 5, "number": "5\/2014", "company_id": 4, "company_name": "Third Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "5\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 6693.75 }, "total_due": { "1": 6693.75 } } }
Query Parameters:
1 2 3 4 5 6 7
{ "type": "InvoicesFilter", "group_by": [ "client", "project" ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
{ "company-2": { "label": "First Client", "invoices": { "unknow-project": { "label": "Unknown", "invoices": { "2": { "id": 2, "number": "2\/2014", "company_id": 2, "company_name": "First Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "2\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 6693.75 }, "total_due": { "1": 6693.75 } }, "project-1": { "label": "First Client Project", "invoices": { "1": { "id": 1, "number": "1\/2014", "company_id": 2, "company_name": "First Client", "project_id": 1, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "1\/2014", "project_name": "First Client Project", "status": "issued" } }, "total": { "1": 6693.75 }, "total_due": { "1": 6693.75 } } } }, "company-3": { "label": "Second Client", "invoices": { "unknow-project": { "label": "Unknown", "invoices": { "4": { "id": 4, "number": "4\/2014", "company_id": 3, "company_name": "Second Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "4\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 6693.75 }, "total_due": { "1": 6693.75 } }, "project-2": { "label": "Second Client Project", "invoices": { "3": { "id": 3, "number": "3\/2014", "company_id": 3, "company_name": "Second Client", "project_id": 2, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "3\/2014", "project_name": "Second Client Project", "status": "issued" } }, "total": { "1": 6693.75 }, "total_due": { "1": 6693.75 } } } }, "company-4": { "label": "Third Client", "invoices": { "unknow-project": { "label": "Unknown", "invoices": { "5": { "id": 5, "number": "5\/2014", "company_id": 4, "company_name": "Third Client", "project_id": null, "currency_id": 1, "subtotal": 6125, "tax": 568.75, "total": 6693.75, "balance_due": 6693.75, "paid_amount": 0, "created_on": 1430165061, "issued_on": 1430092800, "due_on": 1430092800, "closed_on": null, "is_canceled": false, "name": "5\/2014", "project_name": "N\/A", "status": "issued" } }, "total": { "1": 6693.75 }, "total_due": { "1": 6693.75 } } } } }
Max level of grouping for invoices report is 2. If we try to set more, we'll get an error:
Query Parameters:
1 2 3 4 5 6 7 8
{ "type": "InvoicesFilter", "group_by": [ "client", "project", "status" ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
{ "type": "InvalidParamError", "message": "Max levels of grouping is 2", "file": "\/var\/www\/angie.back\/src\/Angie\/Reports\/Report\/Implementation.php", "line": 92, "trace": "#0 \/var\/www\/angie.back\/frameworks\/environment\/models\/data_filters\/FwDataFilter.php(88): BaseDataFilter->setGroupBy('client,project,...')\n#1 \/var\/www\/activecollab.back\/activecollab\/current\/modules\/invoicing\/models\/reports\/InvoicesFilter.php(587): FwDataFilter->setAttribute('group_by', 'client,project,...')\n#2 \/var\/www\/angie.back\/classes\/database\/DataObject.class.php(265): InvoicesFilter->setAttribute('group_by', 'client,project,...')\n#3 \/var\/www\/angie.back\/src\/Angie\/Reports.php(47): DataObject->setAttributes(Array)\n#4 \/var\/www\/angie.back\/frameworks\/environment\/controllers\/FwReportsController.class.php(55): Angie\\Reports::getReport('InvoicesFilter', Array, Object(Owner))\n#5 \/var\/www\/angie.back\/src\/Angie\/Controller.php(42): FwReportsController->run(Object(Owner))\n#6 \/var\/www\/angie.back\/classes\/application\/AngieApplicationAdapter.class.php(243): Angie\\Controller->executeAction('run')\n#7 \/var\/www\/angie.back\/classes\/application\/AngieApplication.class.php(839): AngieApplicationAdapter->handleHttpRequest('reports\/run', 'type=InvoicesFi...')\n#8 \/var\/www\/activecollab.back\/instance\/public\/api.php(19): AngieApplication::handleHttpRequest()\n#9 {main}", "previous": null, "var_name": "group_by", "var_value": [ "client", "project", "status" ] }
Detailed invoice reports can be exported in CSV format:
Query Parameters:
1 2 3 4 5 6 7
{ "type": "InvoicesFilter", "group_by": [ "client", "project" ] }
Response:
1 2 3 4 5 6
ID,Number,Status,Currency Name,Currency Code,Company ID,Company,Project ID,Project,Issued On,Due On,Closed On,Paid Amount,Balance Due,Total 1,1/2014,issued,Euro,EUR,2,First Client,1,First Client Project,2015-04-27 00:00:00,2015-04-27,,0,6693.75,6693.75 2,2/2014,issued,Euro,EUR,2,First Client,0,N/A,2015-04-27 00:00:00,2015-04-27,,0,6693.75,6693.75 3,3/2014,issued,Euro,EUR,3,Second Client,2,Second Client Project,2015-04-27 00:00:00,2015-04-27,,0,6693.75,6693.75 4,4/2014,issued,Euro,EUR,3,Second Client,0,N/A,2015-04-27 00:00:00,2015-04-27,,0,6693.75,6693.75 5,5/2014,issued,Euro,EUR,4,Third Client,0,N/A,2015-04-27 00:00:00,2015-04-27,,0,6693.75,6693.75
Note that export command does not support data grouping (system will not reject the request, as shown above, but it will not group the records).