X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Finquiry%2Fjournal_inquiry.php;h=2d9eaabc93e32715f000b502fe905132bf526a1c;hb=0489317205141deaecefe3a7243d11a3e38a51d0;hp=3fd59521e59157fdd96c81777b983490a29ce4e6;hpb=b11418d0e2c2691abcb5330e6b62bc1d45b741f1;p=fa-stable.git diff --git a/gl/inquiry/journal_inquiry.php b/gl/inquiry/journal_inquiry.php index 3fd59521..2d9eaabc 100644 --- a/gl/inquiry/journal_inquiry.php +++ b/gl/inquiry/journal_inquiry.php @@ -79,9 +79,45 @@ function gl_link($row) return get_gl_view_str($row["type"], $row["type_no"]); } +$editors = array( + ST_JOURNAL => "/gl/gl_journal.php?ModifyGL=Yes&trans_no=%d&trans_type=%d", + ST_BANKPAYMENT => "/gl/gl_bank.php?ModifyPayment=Yes&trans_no=%d&trans_type=%d", + ST_BANKDEPOSIT => "/gl/gl_bank.php?ModifyDeposit=Yes&trans_no=%d&trans_type=%d", +// 4=> Funds Transfer, + ST_SALESINVOICE => "/sales/customer_invoice.php?ModifyInvoice=%d", +// 11=> +// free hand (debtors_trans.order_==0) +// "/sales/credit_note_entry.php?ModifyCredit=%d" +// credit invoice +// "/sales/customer_credit_invoice.php?ModifyCredit=%d" +// 12=> Customer Payment, + ST_CUSTDELIVERY => "/sales/customer_delivery.php?ModifyDelivery=%d", +// 16=> Location Transfer, +// 17=> Inventory Adjustment, +// 20=> Supplier Invoice, +// 21=> Supplier Credit Note, +// 22=> Supplier Payment, +// 25=> Purchase Order Delivery, +// 28=> Work Order Issue, +// 29=> Work Order Production", +// 35=> Cost Update, +); + function edit_link($row) { - return edit_trans_link($row["type"], $row["type_no"]); + global $editors; + + $ok = true; + if ($row['type'] == ST_SALESINVOICE) + { + $myrow = get_customer_trans($row["type_no"], $row["type"]); + if ($myrow['alloc'] != 0 || get_voided_entry(ST_SALESINVOICE, $row["type_no"]) !== false) + $ok = false; + } + return isset($editors[$row["type"]]) && !is_closed_trans($row["type"], $row["type_no"]) && $ok ? + pager_link(_("Edit"), + sprintf($editors[$row["type"]], $row["type_no"], $row["type"]), + ICON_EDIT) : ''; } $sql = get_sql_for_journal_inquiry(get_post('filterType', -1), get_post('FromDate'), @@ -89,7 +125,7 @@ $sql = get_sql_for_journal_inquiry(get_post('filterType', -1), get_post('FromDat $cols = array( _("#") => array('fun'=>'journal_pos', 'align'=>'center'), - _("Date") =>array('name'=>'tran_date','type'=>'date', 'ord' => check_value('AlsoClosed') ? 'asc' : 'desc'), + _("Date") =>array('name'=>'tran_date','type'=>'date','ord'=>'desc'), _("Type") => array('fun'=>'systype_name'), _("Trans #") => array('fun'=>'view_link'), _("Reference"),