Function at 0x4960ec
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5ec
mov eax, dword [0x59a240]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
xor esi, esi
mov dword [ebp - 0x5bc], eax
mov dword [ebp - 0x5b8], ecx
mov dword [ebp - 0x5b0], esi
push edi
test eax, eax
je 0x496922
test ebx, ebx
je 0x496922
push dword [ebx + 0x14]
call fcn.0046f1b2
xor eax, eax
mov dword [esp], 0x400
lea edi, [ebp - 0x594]
stosd dword es:[edi], eax
push esi
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x584]
push eax
call fcn.004e4da0
push 0x80
lea eax, [ebp - 0x84]
push esi
push eax
call fcn.004e4da0
push 0x100
lea eax, [ebp - 0x184]
push esi
push eax
call fcn.004e4da0
push esi
push 1
mov dword [ebp - 0x5a8], esi
call fcn.0049910a
push 1
call fcn.00499033
add esp, 0x30
cmp dword [ebx + 0x2f94], esi
jne 0x4961a7
push dword [ebx + 0x14]
call fcn.004a3646
pop ecx
mov dword [ebx + 0x14], esi
push esi
push esi
call fcn.00493fbf
pop ecx
pop ecx
push dword [ebx + 0x14]
test eax, eax
je 0x4961d6
call fcn.0046f1b2
pop ecx
test eax, eax
je 0x496922
push dword [ebx + 0x14]
call fcn.0046dac7
pop ecx
mov dword [ebx + 0x14], esi
jmp 0x496922
call fcn.0046f1b2
pop ecx
test eax, eax
jne 0x4961f9
push esi
call fcn.0046d734
mov dword [ebx + 0x14], eax
xor eax, eax
inc eax
pop ecx
mov dword [ebx + 0x2f94], eax
mov dword [ebp - 0x5a8], eax
cmp dword [ebx + 0x14], esi
jne 0x49620e
push str.:5:Need_to_handle_TAMS_II_SA7_login_failure_
call fcn.004255b9
pop ecx
jmp 0x496922
push dword [ebx + 0x14]
call fcn.004c8483
mov dword [esp], 0xbfe
lea eax, [ebp - 0x594]
push str.E:UserskerryDocumentsVisual_Studio_2022ProjectsPAULA__TEMP_COPY_ServerPAULA.c
push eax
call fcn.004c9210
push ecx
mov edi, esp
lea esi, [ebp - 0x594]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004ca980
mov dword [ebp - 0x598], eax
add esp, 0x10
mov byte [ebp - 0x595], 1
mov eax, dword [ebp - 0x598]
mov dword [ebp - 0x59c], eax
mov si, word [ebp - 0x59c]
shr eax, 0x10
inc al
cmp al, 0xc
jbe 0x49626e
inc si
xor edx, edx
movzx ecx, al
inc edx
cmp al, 0xc
push 0x2c
cmovbe edx, ecx
push str.SALES_YEAR_MONTH_ACCOUNTING_DAY_GROSS_CASH_SALES_GROSS_CHARGE_SALES_NET_SALES_RETURNS_RETURNS_COST_MISCELLANEOUS_ADJUSTMENTS_INVOICE_COUNT_VOID_AMOUNT_VOID_COUNT_RECEIVED_ON_ACCOUNT_ROA_DISCOUNT_TAKEN_JOURNAL_ENTRIES_SALES_COST_FREIGHT_CHARGES
mov dword [ebp - 0x5a0], edx
call fcn.0049dbec
push dword [ebx + 0x14]
inc eax
mov dword [ebp - 0x5ac], eax
call fcn.0046e75f
and dword [ebp - 0x5a4], 0
add esp, 0xc
mov ecx, dword [0x59a17c]
mov edi, eax
test ecx, ecx
je 0x4962f4
push edi
lea eax, [ecx + 1]
mov dword [0x59a17c], eax
movzx eax, byte [ebp - 0x599]
push eax
mov eax, dword [ebp - 0x5a0]
movzx eax, al
push eax
movzx eax, si
push eax
movzx eax, byte [ebp - 0x596]
push 1
push eax
movzx eax, word [ebp - 0x598]
push eax
push str.SALES_YEAR_MONTH_ACCOUNTING_DAY_GROSS_CASH_SALES_GROSS_CHARGE_SALES_NET_SALES_RETURNS_RETURNS_COST_MISCELLANEOUS_ADJUSTMENTS_INVOICE_COUNT_VOID_AMOUNT_VOID_COUNT_RECEIVED_ON_ACCOUNT_ROA_DISCOUNT_TAKEN_JOURNAL_ENTRIES_SALES_COST_FREIGHT_CHARGES
push ecx
push str.SA7_DBG__d:_SET_ROWCOUNT_1_SELECT__s_FROM_STORE_DAILY_SALES_WHERE__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_ORDER_BY_SALES_YEAR_MONTH_DESC__ACCOUNTING_DAY_DESC
call fcn.00425c08
add esp, 0x28
movzx ecx, byte [ebp - 0x599]
mov eax, dword [ebp - 0x5a0]
movzx edx, byte [ebp - 0x596]
push edi
push ecx
movzx eax, al
push eax
movzx esi, si
push esi
push 1
push edx
mov dword [ebp - 0x5b4], eax
movzx eax, word [ebp - 0x598]
push eax
push str.SALES_YEAR_MONTH_ACCOUNTING_DAY_GROSS_CASH_SALES_GROSS_CHARGE_SALES_NET_SALES_RETURNS_RETURNS_COST_MISCELLANEOUS_ADJUSTMENTS_INVOICE_COUNT_VOID_AMOUNT_VOID_COUNT_RECEIVED_ON_ACCOUNT_ROA_DISCOUNT_TAKEN_JOURNAL_ENTRIES_SALES_COST_FREIGHT_CHARGES
push str.SET_ROWCOUNT_1_SELECT__s_FROM_STORE_DAILY_SALES_WHERE__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_ORDER_BY_SALES_YEAR_MONTH_DESC__ACCOUNTING_DAY_DESC
push dword [ebx + 0x14]
mov dword [ebp - 0x59c], ecx
mov dword [ebp - 0x5a0], edx
call fcn.0046de59
add esp, 0x28
test eax, eax
je 0x49688c
push dword [ebp - 0x5ac]
lea eax, [ebp - 0x584]
push 9
push 0x3ff
push eax
push dword [ebx + 0x14]
call fcn.0046df4a
add esp, 0x14
push ebx
test eax, eax
je 0x4963ac
lea eax, [ebp - 0x584]
push eax
call fcn.004947b5
mov esi, eax
mov dword [ebp - 0x59c], esi
pop ecx
pop ecx
test esi, esi
jne 0x4963bb
lea eax, [ebp - 0x584]
push eax
push str.:5:RefreshSales___EAP:_Sales_line___s__is_invalid.
lea eax, [ebp - 0x184]
push 0x100
push eax
call fcn.004a0ddb
add esp, 0x10
jmp 0x4963bb
call fcn.00497ee8
xor esi, esi
inc esi
pop ecx
mov dword [ebp - 0x59c], esi
mov ecx, dword [0x59a17c]
test ecx, ecx
je 0x4963e2
lea eax, [ecx + 1]
mov dword [0x59a17c], eax
lea eax, [ebp - 0x584]
push eax
push ecx
push str.SA7_DBG__d:__s
call fcn.00425c08
add esp, 0xc
test esi, esi
jle 0x4968ca
push 0x2c
push str.EOD_STARTED_DATE_NEW_DAY_STARTED_DATE_SALES_YEAR_MONTH_ACCT_DAY_STARTED_BY_IP_ADDRESS_STARTED_BY_EMPLOYEE_ID
call fcn.0049dbec
pop ecx
pop ecx
mov ecx, dword [0x59a17c]
lea esi, [eax + 1]
test ecx, ecx
je 0x496421
push edi
push str.EOD_STARTED_DATE_NEW_DAY_STARTED_DATE_SALES_YEAR_MONTH_ACCT_DAY_STARTED_BY_IP_ADDRESS_STARTED_BY_EMPLOYEE_ID
push ecx
lea eax, [ecx + 1]
push str.SA7_DBG__d:_SET_ROWCOUNT_1_SELECT__s_FROM_END_OF_DAY_MONITOR_WHERE_LOC_d_AND_EOD_STARTED_DATE_SELECT_MAX_EOD_STARTED_DATE__FROM_END_OF_DAY_MONITOR_
mov dword [0x59a17c], eax
call fcn.00425c08
add esp, 0x10
push edi
push str.EOD_STARTED_DATE_NEW_DAY_STARTED_DATE_SALES_YEAR_MONTH_ACCT_DAY_STARTED_BY_IP_ADDRESS_STARTED_BY_EMPLOYEE_ID
push str.SET_ROWCOUNT_1_SELECT__s_FROM_END_OF_DAY_MONITOR_WHERE_LOC_d_AND_EOD_STARTED_DATE_SELECT_MAX_EOD_STARTED_DATE__FROM_END_OF_DAY_MONITOR_
push dword [ebx + 0x14]
call fcn.0046de59
add esp, 0x10
test eax, eax
je 0x4966ce
xor eax, eax
lea edi, [ebp - 0x5cc]
stosd dword es:[edi], eax
push esi
push 9
push 0x3ff
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
lea edi, [ebp - 0x5dc]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x584]
push eax
push dword [ebx + 0x14]
xor edi, edi
mov dword [ebp - 0x5a0], edi
call fcn.0046df4a
add esp, 0x14
test eax, eax
je 0x496577
push 0x80
lea eax, [ebp - 0x584]
mov dword [ebp - 0x598], edi
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.004a11a5
mov ecx, dword [0x59a17c]
add esp, 0xc
test ecx, ecx
je 0x4964c9
lea eax, [ecx + 1]
mov dword [0x59a17c], eax
lea eax, [ebp - 0x584]
push eax
push ecx
push str.SA7_DBG__d:__s
call fcn.00425c08
add esp, 0xc
lea eax, [ebp - 0x598]
push eax
lea eax, [ebp - 0x584]
push 0x511240
push eax
call fcn.004a0ad4
push eax
lea eax, [ebp - 0x5ec]
push eax
call fcn.004ca01c
mov esi, eax
lea edi, [ebp - 0x5cc]
lea eax, [ebp - 0x598]
push eax
push 0x511240
movsd dword es:[edi], dword [esi]
push 0
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a0ad4
push eax
lea eax, [ebp - 0x5ec]
push eax
call fcn.004ca01c
mov esi, eax
lea edi, [ebp - 0x5dc]
lea eax, [ebp - 0x598]
push eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov esi, 0x511240
xor edi, edi
push esi
push edi
call fcn.004a0ad4
lea eax, [ebp - 0x598]
push eax
push esi
push edi
call fcn.004a0ad4
add esp, 0x40
push eax
call fcn.004585df
mov dword [ebp - 0x5a0], eax
lea eax, [ebp - 0x598]
push eax
push esi
push edi
call fcn.004a0ad4
lea eax, [ebp - 0x598]
push eax
push esi
push edi
call fcn.004a0ad4
add esp, 0x1c
push edi
sub esp, 0x10
lea esi, [ebp - 0x5cc]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c95b5
add esp, 0x14
test eax, eax
jne 0x496604
push eax
sub esp, 0x10
lea esi, [ebp - 0x5dc]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c95b5
add esp, 0x14
test eax, eax
jne 0x496604
lea eax, [ebp - 0x84]
push eax
sub esp, 0x10
lea esi, [ebp - 0x5dc]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c9a6f
add esp, 0x10
lea esi, [ebp - 0x5cc]
push eax
sub esp, 0x10
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c9a6f
add esp, 0x10
push eax
push str.:7:RefreshSales___EAP:_Sales_CANNOT_be_posted:_stEODTime___s__stNewDayTime___s:__s
lea eax, [ebp - 0x184]
push 0x100
push eax
call fcn.004a0ddb
add esp, 0x18
jmp 0x4968ca
mov eax, dword [ebp - 0x59c]
push 0xc77
mov dword [ebp - 0x5a4], eax
lea eax, [ebx + 0x4c]
push str.E:UserskerryDocumentsVisual_Studio_2022ProjectsPAULA__TEMP_COPY_ServerPAULA.c
push eax
call fcn.004c9210
lea edi, [ebx + 0x5c]
lea esi, [ebp - 0x5cc]
movsd dword es:[edi], dword [esi]
push ecx
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movzx edi, word [ebp - 0x5c8]
lea esi, [ebp - 0x5cc]
shl edi, 4
add edi, 0x2f9c
add edi, ebx
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov edi, esp
lea esi, [ebp - 0x5dc]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c9694
add esp, 0x10
test eax, eax
jne 0x4966c9
sub esp, 0x10
lea esi, [ebp - 0x5cc]
mov edi, esp
sub esp, 0x10
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov edi, esp
lea esi, [ebp - 0x5dc]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c9469
add esp, 0x20
test eax, eax
jne 0x4966c9
mov eax, dword [ebp - 0x59c]
xor ecx, ecx
mov edx, dword [ebp - 0x5a0]
cmp edx, eax
jg 0x4966ab
cmp edx, 1
jne 0x4966f5
cmp eax, 0x14
jle 0x4966f5
push str.Yesterday_sales_catch_test.
lea eax, [ebp - 0x184]
push 0x100
push eax
call fcn.004a0ddb
add esp, 0xc
jmp 0x4968ca
xor ecx, ecx
inc ecx
jmp 0x4966f5
lea eax, [ebp - 0x84]
push eax
push edi
push str.:7:RefreshSales___EAP:_ExecuteODBCFormat_LOC_d__FAILED:_EOD_cannot_be_determined:__s
lea eax, [ebp - 0x184]
push 0x100
push eax
call fcn.004a0ddb
mov ecx, dword [ebp - 0x5b0]
add esp, 0x14
cmp dword [ebp - 0x5a4], 0
jle 0x4968ca
mov dword [ebx + 0x2f90], 1
test ecx, ecx
je 0x4967b9
cmp dword [ebx + 0x2f98], 0
jne 0x49687d
cmp dword [ebx + 0x44], 0
je 0x496790
cmp dword [ebx + 0x38], 0
je 0x496790
push ebx
call fcn.00495a60
cmp dword [0x692abc], 0
pop ecx
jne 0x49677c
push ebx
call fcn.00497ee8
push ebx
call fcn.00495a60
pop ecx
pop ecx
test eax, eax
jne 0x496762
lea eax, [ebp - 0x84]
push eax
push str.:8:RefreshSales___Critical_Exception_:_PostSales___says_EOD_has_NOT_been_encountered__This_will_result_in_EOD_never_being_posted___s
call fcn.004255b9
pop ecx
pop ecx
push str.:0:FYI:_End_Of_Day_process_has_begun.__TAMS_II_
mov dword [ebx + 0x2f98], 1
call fcn.00425c08
pop ecx
jmp 0x49687d
lea eax, [ebp - 0x84]
push eax
push str.:5:RefreshSales___EAP:_End_of_Day_process_has_begun__but_the_initial_PostSalesResult___FAILED:_EOD_cannot_be_posted._Another_attempt_will_be_made:__s
call fcn.004255b9
pop ecx
jmp 0x496776
lea eax, [ebp - 0x84]
push eax
push str.:2:RefreshSales___EAP:_EOD_has_been_detected_from_zero_sales.__This_may_happen_when_the_server_is_started_after_EOD.__EOD_has_been_ignored:__s
call fcn.00425c08
push ebx
call fcn.00497ee8
add esp, 0xc
mov dword [ebx + 0x2f98], 1
jmp 0x49687d
and dword [ebx + 0x2f98], 0
push ebx
call fcn.00495a60
pop ecx
test eax, eax
je 0x49687d
lea eax, [ebp - 0x84]
push eax
push dword [ebx + 0x38]
call fcn.00459203
pop ecx
push eax
push str.:9:RefreshSales___Critical_Exception_:_PostSales___says_EOD_has_been_encountered__This_should_never_happen._NetSales___s:__s
call fcn.004255b9
movzx eax, word [0x68f9cc]
add esp, 0xc
push dword [0x6929e0]
push eax
movzx eax, word [0x68c9bc]
push eax
push dword [0x6929dc]
movzx eax, word [0x68ca12]
push eax
movzx eax, word [0x68fa22]
push eax
push dword [0x68ca08]
push dword [0x68fa18]
push dword [0x68ca04]
push dword [0x68fa14]
push dword [0x68c9f8]
call fcn.00459203
pop ecx
push eax
push dword [0x68fa08]
call fcn.00459203
pop ecx
push eax
push dword [0x68f950]
mov esi, 0x68c9ac
push dword [0x692960]
push 0
sub esp, 0x10
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004c9acc
add esp, 0x14
push eax
push str.:9:RefreshSales___DEBUG:_SnapShot_at__s:_bIsTAMSii_d__d__tNetSales_s__s__iNumInvoices_d__d__iNumVoids_d__d__wDay_d__d:_STATICS:_dwTimeLastParse_d__wLastDayParsed_d__wLastDayEOD_d__iNumTimesInitTried_d
call fcn.004255b9
add esp, 0x40
and dword [0x59a17c], 0
xor eax, eax
inc eax
jmp 0x496924
lea eax, [ebp - 0x84]
push eax
movzx eax, word [ebp - 0x598]
push edi
push dword [ebp - 0x59c]
push dword [ebp - 0x5b4]
push esi
push 1
push dword [ebp - 0x5a0]
push eax
push str.:7:RefreshSales___EAP:_OUTER_ExecuteODBCFormat__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_FAILED:__s
lea eax, [ebp - 0x184]
push 0x100
push eax
call fcn.004a0ddb
add esp, 0x2c
cmp dword [ebp - 0x5a8], 0
jne 0x496907
push dword [ebx + 0x14]
call fcn.0046dac7
and dword [ebx + 0x14], 0
lea eax, [ebp - 0x84]
push eax
push str.:5:RefreshSales___EOP:_The_recycled_connection_failed._Trying_again_with_new_connection...___s
call fcn.004255b9
push dword [ebp - 0x5b8]
push ebx
push dword [ebp - 0x5bc]
call fcn.004960ec
add esp, 0x18
jmp 0x496924
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x184]
push eax
push str.:5:FYI:_TAMSii_SA7_FAILED:__s:__s
call fcn.004255b9
add esp, 0xc
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004e3632
leave
ret