Giter VIP home page Giter VIP logo

multi-bajaj-mgt's People

Contributors

yohanavishke avatar

Watchers

 avatar  avatar

multi-bajaj-mgt's Issues

Properly setup logging

Links

https://betterstack.com/community/guides/logging/loguru/#exploring-log-levels-in-loguru
https://medium.com/analytics-vidhya/a-quick-guide-to-using-loguru-4042dc5437a5

Example

    if log["level"].name == "DEBUG":
        return (
            "<fg #aad1f7>{time:HH:mm:ss A}</fg #aad1f7> | "
            "<fg #aad1f7>{file}</fg #aad1f7> | "
            "<fg #3A99D8>{level}</fg #3A99D8> | "
            "<light-white>{message}</light-white> \n"
        )
    if log["level"].name == "INFO":
        return (
            "<fg #aad1f7>{time:HH:mm:ss A}</fg #aad1f7> | "
            "<fg #aad1f7>{file}</fg #aad1f7> | "
            "<fg #FFFFFF>{level}</fg #FFFFFF> | "
            "<light-white>{message}</light-white> \n"
        )
    if log["level"].name == "SUCCESS":
        return (
            "<fg #aad1f7>{time:HH:mm:ss A}</fg #aad1f7> | "
            "<fg #aad1f7>{file}</fg #aad1f7> | "
            "<fg #A4C945>{level}</fg #A4C945> | "
            "<light-white>{message}</light-white> \n"
        )
    if log["level"].name == "WARNING":
        return (
            "<fg #aad1f7>{time:HH:mm:ss A}</fg #aad1f7> | "
            "<fg #aad1f7>{file}</fg #aad1f7> | "
            "<fg #F0C330>{level}</fg #F0C330> | "
            "<light-white>{message}</light-white> \n"
        )
    if log["level"].name == "ERROR":
        return (
            "<fg #aad1f7>{time:HH:mm:ss A}</fg #aad1f7> | "
            "<fg #aad1f7>{file}</fg #aad1f7> | "
            "<fg #E54D42>{level}</fg #E54D42> | "
            "<light-white>{message}</light-white> \n"
        )
    if log["level"].name == "CRITICAL":
        return (
            "<fg #aad1f7>{time:HH:mm:ss A}</fg #aad1f7> | "
            "<fg #aad1f7>{file}</fg #aad1f7> | "
            "<bg #E54D42><fg #FFFFFF>{level}</fg #FFFFFF></bg #E54D42> | "
            "<light-white>{message}</light-white> \n"
        )

API ref

{
  "text": "November 13, 2022 > 18:24:03 | DEBUG | Happy logging with Loguru!\n",
  "record": {
    "elapsed": {
      "repr": "0:00:00.966418",
      "seconds": 0.966418
    },
    "exception": null,
    "extra": {},
    "file": {
      "name": "logger.py",
      "path": "/Users/yohanavishke/Code/MultiBajaj/multibajajmgt/src/multibajajmgt/logger.py"
    },
    "function": "configure_logger",
    "level": {
      "icon": "๐Ÿž",
      "name": "DEBUG",
      "no": 10
    },
    "line": 73,
    "message": "Happy logging with Loguru!",
    "module": "logger",
    "name": "logger",
    "process": {
      "id": 21349,
      "name": "MainProcess"
    },
    "thread": {
      "id": 4637550080,
      "name": "MainThread"
    },
    "time": {
      "repr": "2022-11-13 23:54:03.345468+05:30",
      "timestamp": 1668363843.345468
    }
  }
}

DPMC products cost report

Is your feature request related to a problem? Please describe.
Need a way to find the cost of DPMC products (with historical records)

Describe the solution you'd like

  • #50
  • #51
  • Map Invoice to price fluctuation ranges

Describe alternatives you've considered
N/A

Additional context
N/A

Setup web application

Is your feature request related to a problem? Please describe.
Need a web app to interact with the services.

Describe the solution you'd like
A Vue JS app using Ant Design components.

Describe alternatives you've considered
React JS

Additional context
Add any other context or screenshots about the feature request here.

Release v3

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

DPMC invoice data fetch issue

Describe the bug
GRN good receive by GRN with mobile invoices fails.

Screenshots

07:52:27 AM | INFO: Configure Odoo client. 
07:52:27 AM | INFO: Configure DPMC client session. 
07:52:27 AM | INFO: Configure Google Sheet client. 
07:52:27 AM | INFO: Export sales report from: 2022-11-17 00:00:00 to: None 
07:52:29 AM | INFO: Export DPMC Invoice reference data. 
Traceback (most recent call last):
  File "/Users/yohanavishke/Code/MultiBajaj/multibajajmgt/src/multibajajmgt/main.py", line 48, in <module>
    invoice_dpmc_service.export_invoice_data()
  File "/Users/yohanavishke/Code/MultiBajaj/multibajajmgt/src/multibajajmgt/invoice/dpmc.py", line 90, in export_invoice_data
    invoice_df = invoice_df.apply(_enrich_with_advanced_data, axis = 1)
  File "/Users/yohanavishke/.pyenv/versions/multibajajmgt/lib/python3.10/site-packages/pandas/core/frame.py", line 8848, in apply
    return op.apply().__finalize__(self, method="apply")
  File "/Users/yohanavishke/.pyenv/versions/multibajajmgt/lib/python3.10/site-packages/pandas/core/apply.py", line 733, in apply
    return self.apply_standard()
  File "/Users/yohanavishke/.pyenv/versions/multibajajmgt/lib/python3.10/site-packages/pandas/core/apply.py", line 857, in apply_standard
    results, res_index = self.apply_series_generator()
  File "/Users/yohanavishke/.pyenv/versions/multibajajmgt/lib/python3.10/site-packages/pandas/core/apply.py", line 873, in apply_series_generator
    results[i] = self.f(v)
  File "/Users/yohanavishke/Code/MultiBajaj/multibajajmgt/src/multibajajmgt/invoice/dpmc.py", line 58, in _enrich_with_advanced_data
    invoice_data = dpmc_client.inquire_goodreceivenote_by_grn_ref(col_name, default_id)
  File "/Users/yohanavishke/Code/MultiBajaj/multibajajmgt/src/multibajajmgt/client/dpmc/client.py", line 347, in inquire_goodreceivenote_by_grn_ref
    return _inquire_goodreceivenote(
  File "/Users/yohanavishke/Code/MultiBajaj/multibajajmgt/src/multibajajmgt/client/dpmc/client.py", line 335, in _inquire_goodreceivenote
    return json.loads(response_data)
  File "/Users/yohanavishke/.pyenv/versions/3.10.3/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Users/yohanavishke/.pyenv/versions/3.10.3/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/yohanavishke/.pyenv/versions/3.10.3/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.