-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bill numbers to the qbo create bill payload (#663)
* feat: add bill numbers to the qbo bill payload * test: update fixtures * fix: update get_bill logic to account for bad data in the expense group's description * fix: add script to fix inconsistent expense group fields data * refactor: code style * test: unit test `get_bill_number` (cherry picked from commit 94f4a67)
- Loading branch information
1 parent
a83a2c1
commit 43a1c7c
Showing
7 changed files
with
136 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.14 on 2024-08-28 12:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('quickbooks_online', '0014_auto_20230422_2007'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='bill', | ||
name='bill_number', | ||
field=models.CharField(help_text='Bill Number', max_length=255, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- Script to fix expense groups (reimbursable and CCC) | ||
-- by adding expense_number/claim_number to groups having | ||
-- expense_id but no expense_number OR having report_id but no claim_number | ||
|
||
rollback; | ||
begin; | ||
|
||
-- expense_group_settings.reimbursable_expense_group_fields | ||
update expense_group_settings | ||
set reimbursable_expense_group_fields = array_append(reimbursable_expense_group_fields, 'expense_number') | ||
where reimbursable_expense_group_fields::text ilike '%expense_id%' | ||
and reimbursable_expense_group_fields::text not ilike '%expense_number%'; | ||
|
||
update expense_group_settings | ||
set reimbursable_expense_group_fields = array_append(reimbursable_expense_group_fields, 'claim_number') | ||
where reimbursable_expense_group_fields::text ilike '%report_id%' | ||
and reimbursable_expense_group_fields::text not ilike '%claim_number%'; | ||
|
||
|
||
-- expense_group_settings.corporate_credit_card_expense_group_fields | ||
update expense_group_settings | ||
set corporate_credit_card_expense_group_fields = array_append(corporate_credit_card_expense_group_fields, 'expense_number') | ||
where corporate_credit_card_expense_group_fields::text ilike '%expense_id%' | ||
and corporate_credit_card_expense_group_fields::text not ilike '%expense_number%'; | ||
|
||
update expense_group_settings | ||
set corporate_credit_card_expense_group_fields = array_append(corporate_credit_card_expense_group_fields, 'claim_number') | ||
where corporate_credit_card_expense_group_fields::text ilike '%report_id%' | ||
and corporate_credit_card_expense_group_fields::text not ilike '%claim_number%'; | ||
|
||
-- Check if all groups have been fixed: Should result in 0s | ||
select count(*) from expense_group_settings where reimbursable_expense_group_fields::text ilike '%expense_id%' and reimbursable_expense_group_fields::text not ilike '%expense_number%'; | ||
|
||
select count(*) from expense_group_settings where reimbursable_expense_group_fields::text ilike '%report_id%' and reimbursable_expense_group_fields::text not ilike '%claim_number%'; | ||
|
||
select count(*) from expense_group_settings where corporate_credit_card_expense_group_fields::text ilike '%report_id%' and corporate_credit_card_expense_group_fields::text not ilike '%claim_number%'; | ||
|
||
select count(*) from expense_group_settings where corporate_credit_card_expense_group_fields::text ilike '%expense_id%' and corporate_credit_card_expense_group_fields::text not ilike '%expense_number%'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters