コード例 #1
0
def balans_full(day: Day = None):
    balans = yuki().account_balance(balance_type='B', day=day)
    all_balance_accounts = (CASH_ACCOUNTS + DEBITEUREN + CREDITEUREN +
                            OVERIGE_VLOTTENDE_ACTIVA +
                            OVERIGE_VLOTTENDE_PASSIVA)
    # for b in balans:
    #     if b['code'][0] != '0' and b['code'] not in all_balance_accounts and abs(b['amount']) > 6000:
    #         log.log_error(
    #             'finance.py', 'balans_full()', f'Onbekende balanspost {b["code"]} {b["description"]} € {b["amount"]}.'
    #         )
    return balans
コード例 #2
0
def debiteuren_leeftijd_analyse_yuki():
    debiteuren = yuki().debtors()
    df = pd.DataFrame(debiteuren)
    df = df.drop(df[df.open <= 0].index)
    # df = df.drop( 'open <= 0', axis=1)
    df['a30'] = df.apply(lambda row: row.open if row.days < 30 else 0, axis=1)
    df['a60'] = df.apply(lambda row: row.open if 30 <= row.days < 60 else 0,
                         axis=1)
    df['a90'] = df.apply(lambda row: row.open if 60 <= row.days < 90 else 0,
                         axis=1)
    df['90plus'] = df.apply(lambda row: row.open if row.days >= 90 else 0,
                            axis=1)
    df.rename(columns={'customer': 'factuuradres'}, inplace=True)
    df = (df.groupby(["factuuradres"]).agg({
        'open': 'sum',
        'a30': 'sum',
        "a60": 'sum',
        'a90': 'sum',
        "90plus": 'sum'
    }).reset_index())
    df = df.sort_values("open", ascending=False)
    return df
コード例 #3
0
def kosten_boekhoudkundig_tm_maand(y, m):
    return yuki().costs(last_day_of_month(y, m))
コード例 #4
0
def projectkosten_tm_nu():
    return yuki().direct_costs()
コード例 #5
0
def omzet_tm_nu():
    return yuki().income()
コード例 #6
0
def projectkosten_tm_maand(y, m):
    return yuki().direct_costs(last_day_of_month(y, m))
コード例 #7
0
def omzet_tm_maand(y, m):
    return yuki().income(last_day_of_month(y, m))
コード例 #8
0
    # Percentages per klant
    totaal = df['omzet'].sum()
    df['percentage'] = df['omzet'] * 100.0 / totaal
    return df.sort_values(by="omzet", ascending=False)


def simplicate_gefactureerd(tm_maand=12):
    sim = simplicate()
    params = {'from_date': Day('2021-01-01').str, 'until_date': Day().str}
    inv = sim.invoice(params)
    inv_df = sim.to_pandas(inv)
    invs = inv_df[[
        'invoice_number', 'total_excluding_vat', 'status_name',
        'organization_name', 'project_name', 'date'
    ]]
    return decimal.Decimal(invs['total_excluding_vat'].sum())


if __name__ == '__main__':
    os.chdir('..')
    print(simplicate_gefactureerd())
    print(yuki().income())
    print(simplicate_gefactureerd() - yuki().income())

    # update_omzet_per_week()
    # print(debiteuren_leeftijd_analyse())
    # print(debiteuren_30_60_90_yuki())
    # print(toekomstige_omzet_per_week())
    # print(vulling_van_de_planning())