spreadsheet = DataFrame(
date=["Jan 1, 2019"], #start of the new year
#List of Accounts # Start of 2019
#Assets
chequing=[0], #replace with balance as of Jan 1, 2019
accounts_reciveable=[0], #replace with balance as of Jan 1, 2019
#Debts
#Debts--Credit when owed payment, Debit when recive payment
accounts_payable= [0],# be sure to add account as of Jan1, 2019
#Expenses -- Debit
personal=[0],
#income credit
wages=[0],
rent=[0],
cattle_sales=[0],
#Debts--Credit when owed payment, Debit when recive payment
#memo
memo=["puchase item and place"]
);
defaultRow = (DataFrame(
date=[""],
chequing=[0],
accounts_recivable=[0],
accounts_payable=[0],
personal=[0],
wages=[0],
rent=[0],
catle_sales=[0],
memo=[""]))
macro transaction(
Journal_Entry,
newdate,
newdebit,
debit_amount,
newcredit,
credit_amount,
new_memo)
ex=quote
if $credit_amount != $debit_amount
"Error--Debit and Credit must match"
else
push!(spreadsheet,(defaultRow...,
$newcredit=$credit_amount,
$newdebit= $debit_amount,
Date=$newdate,
memo=$new_memo
))
#figure out how to delete this row, and get around repeat variables
# I might have to save each transaction to the spreadsheet, at this stage
end
end
esc(ex)
end
@transaction(JE4,"Jan 1, 2019", wages, 1000, chequing, 1000,"this is a test")
Why can’t I get this to work, should the default row be a data frame? Is there a difference in the number of variables? I counted them 20 times. Each has 9 variables, maybe there is a spelling error?