Ignore:
Timestamp:
Jul 5, 2015, 6:24:33 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Added Direction column to finance operations and invoices. This column will serve as real direction where ValueSign could be different for storno operations.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Bill.php

    r740 r741  
    7878    }
    7979
    80     // If negative value => switch sides
    81     if($Invoice['ValueSign'] == -1)
     80    // If direction is in => switch sides
     81    if($Invoice['Direction'] == FINANCE_DIRECTION_OUT)
     82    {           
     83    }
     84    else if($Invoice['Direction'] == FINANCE_DIRECTION_IN)
    8285    {
    8386      $Subject = $SubjectTo;
     
    8588      $SubjectFrom = $Subject;
    8689    }
     90    else throw new Exception('Wrong finance direction');
    8791
    8892    $PaymentType = array('převodem', 'hotově');
     
    162166
    163167    $BooleanText = array('Ne', 'Ano');
    164     if($Operation['ValueSign'] == -1)
     168    if($Operation['Direction'] == FINANCE_DIRECTION_OUT)
    165169    $Desc = array(
    166170      'Type' => 'VÝDAJOVÝ',
     
    168172      'Target' => 'Vydáno komu',
    169173    );
    170     else if($Operation['ValueSign'] == 1)
     174    else if($Operation['Direction'] == FINANCE_DIRECTION_IN)
    171175    $Desc = array(
    172176      'Type' => 'PŘÍJMOVÝ',
Note: See TracChangeset for help on using the changeset viewer.