Code Monkey home page Code Monkey logo

Comments (4)

inoerp avatar inoerp commented on June 5, 2024

Need to update the update_ar_interface in sd_delivery_line

`private function _update_ar_interface() {
$ar_ti = new ar_transaction_interface();
$soh = new sd_so_header();
$soh->findBy_id($this->sd_so_header_id);
$ar_ti->bu_org_id = $soh->bu_org_id;
$legal_org_id = org::find_by_id($ar_ti->bu_org_id)->legal_org_id;
$ar_ti->ledger_id = legal::find_by_orgId($legal_org_id)->ledger_id;
$sd_transaction_type = $soh->document_type;
$sd_doc = new sd_document_type();
$sd_doc->findBy_id($sd_transaction_type);
$ar_ti->transaction_type = $sd_doc->ar_transaction_type;
$ar_ti->ar_customer_id = $soh->ar_customer_id;
$ar_ti->ar_customer_site_id = $soh->ar_customer_site_id;
$ar_ti->currency = $soh->doc_currency;
$ar_ti->payment_term_id = $soh->payment_term_id;
$ar_tp = new ar_transaction_type();
$ar_tp->findBy_id($ar_ti->transaction_type);
$ar_ti->receivable_ac_id = $ar_tp->receivable_ac_id;
$ar_ti->revenue_ac_id = $ar_tp->revenue_ac_id;
$ar_ti->tax_code_id = $ar_tp->tax_ac_id;
$ar_ti->item_id_m = $this->item_id_m;
$ar_ti->inv_line_quantity = $this->quantity;
$sol = new sd_so_line();
$sol->findBy_id($this->sd_so_line_id);
$ar_ti->inv_unit_price = $sol->unit_price;
$sd_doc_l = new sd_document_type();
$sd_doc_l->findBy_id($sol->line_type);
if (!empty($sd_doc_l->ar_transaction_type)) {
$ar_ti->transaction_type = $sd_doc_l->ar_transaction_type;
}
$ar_ti->inv_line_price = $ar_ti->inv_line_quantity * $ar_ti->inv_unit_price;
if (!empty($soh->exchange_rate)) {
$ar_ti->gl_inv_line_price = $ar_ti->inv_line_price * $soh->exchange_rate;
} else {
$ar_ti->gl_inv_line_price = $ar_ti->inv_line_price;
}

$ar_ti->tax_code_id = $sol->tax_code_id;
$ar_ti->item_description = $sol->item_description;
$mm_tax = new mdm_tax_code();
$mm_tax->findBy_id($ar_ti->tax_code_id);
if (!empty($mm_tax->percentage)) {
$ar_ti->tax_amount = ($ar_ti->inv_line_price * $mm_tax->percentage) / 100;
} else if (!empty($mm_tax->tax_amount)) {
$ar_ti->tax_amount = $mm_tax->tax_amount;
}
$ar_ti->gl_tax_amount = $ar_ti->tax_amount * $ar_ti->inv_unit_price;
$ar_ti->line_type = $sol->line_type;
$ar_ti->line_description = $sol->line_description;
$ar_ti->uom_id = $sol->uom_id;
$ar_ti->reference_type = 'table';
$ar_ti->reference_key_name = 'sd_so_line';
$ar_ti->reference_key_value = $ar_ti->sd_so_line_id = $this->sd_so_line_id;
$ar_ti->sd_so_header_id = $this->sd_so_header_id;
$ar_ti->audit_trial();
try {
$ar_ti->save();
} catch (Exception $e) {
echo "
Transfer to AR Interface Failed. Error @sd_delivery_line @@ " . LINE . $e->getMessage();
$this->rollback = true;
}
}`

from inoerp.

kchizi avatar kchizi commented on June 5, 2024

still broken. picking combination of last item.

from inoerp.

inoerp avatar inoerp commented on June 5, 2024

Fixed now. You can sync db.
Note that ar_transaction_line_table is changed and 2 new columns are added
'revenue_ac_id',
'tax_ac_id',

No DB Update file will be provided for this. The DB update file is created only for released versions.
You can check the DB structure in inoerp.sql

from inoerp.

kchizi avatar kchizi commented on June 5, 2024

thanks finally sorted it...

from inoerp.

Related Issues (20)

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.